PageSourceSearch

https://app.mentes.ai/assets/index-B5baMg1b.js

js mentes.ai collected 2026-10-02 00:42:10 UTC 1,730,101 bytes, 220 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardPage-Cx5ERdUg.js","assets/capture-box-CHIblCaI.js","assets/index-BmPkoqNV.js","assets/mic-BhvDvSAX.js","assets/recent-list-qxhevIqo.js","assets/use-midnight-tick-DlzHEGYs.js","assets/HomePage-7fQEG0vE.js","assets/connects-to-DkanfGDX.js","assets/use-journal-nav-Ct2w0V7C.js","assets/TaskDoorPage-Bi5raLCH.js","assets/use-tasks-D-189bUz.js","assets/use-history-back-C8LestKX.js","assets/arrow-left-BFFnMox4.js","assets/ChatPage-WPqoL2OA.js","assets/index-D05nGmXH.js","assets/annotations-DKsIB3qc.js","assets/extends-CF3RwP-h.js","assets/shield-question-a7XJYCZO.js","assets/markdown-T_kALzuj.js","assets/components-9bMl_kgu.js","assets/arrow-up-right-CvhE7P6h.js","assets/files-R182jDd8.js","assets/task-status-glyph-i1KxV_7E.js","assets/circle-check-big-DR2iXDuI.js","assets/play-B7oDh9Yg.js","assets/minus-B2oRPWK5.js","assets/popover-ZGEKTiWv.js","assets/square-DI-5xulm.js","assets/ChatDetailPage-UCl8GWV2.js","assets/NoteDetailPage-De806_bq.js","assets/use-notes-DV1Oz0pd.js","assets/annotate-panel-DNSIXh_M.js","assets/message-square-text-D5c792s5.js","assets/tiptap-editor-CE9Qxygm.js","assets/index-DMdaqsSR.js","assets/with-selector-CQvKU2ZW.js","assets/LibraryPage-B4jR1WgB.js","assets/LibraryShelfPage-s-AP7H1f.js","assets/circle-help-AG7pZjIH.js","assets/SearchPage-CwN41ZkN.js","assets/BoardPage-vD55XGSO.js","assets/board-detail-1NTS1Zlj.js","assets/BoardDetailPage-Cc6QNU-S.js","assets/CollectionsPage-UYgosCtr.js","assets/list-item-D11LyBdJ.js","assets/CollectionDetailPage-DxwYFv23.js","assets/MobileCollectionDetailPage-c5fxcnKj.js","assets/CaptureDetailPage-Pe48ZvgO.js","assets/FeedPage-DPtgVL-N.js","assets/popover-item-DAcKntid.js","assets/funnel-DKAzrd4_.js","assets/FilesPage-D6mCSuxI.js","assets/download-DebiY6Aw.js","assets/TasksPage-HtWl8eku.js","assets/task-viewer-panel-C92Iq0JW.js","assets/use-orchestration-cUfV72gT.js","assets/mutation-error-i11wIjEK.js","assets/clock-D7amLCDr.js","assets/message-square-CD49jZS-.js","assets/TaskGraphPage-D_cgNUSG.js","assets/Paired-CTKFKzPD.js","assets/isObject-DB8w6JNV.js","assets/toNumber-Cya0x1Ri.js","assets/isSymbol-CERAAptl.js","assets/timer-vzW49Vn5.js","assets/pointer-Drloq0xg.js","assets/quadtree-CSANTnla.js","assets/colors-Cc3OSVma.js","assets/zoom-Czi3ac0q.js","assets/transform-B2yhOX-2.js","assets/string-CcOIjdko.js","assets/drag-BFiZA5M4.js","assets/ordinal-DILIJJjt.js","assets/init-Dmth1JHB.js","assets/min-tv6RD-6E.js","assets/switch-BRJdilpU.js","assets/AgentsLayout-H_tc8dVl.js","assets/agent-form-dialog-CVTZ0DUk.js","assets/use-components-B-YRIg9H.js","assets/agent-config-CDV7HeN3.js","assets/use-agents-BJM-w1yS.js","assets/query-read-BbPwCaQd.js","assets/assignment-errors-B_qIkvVU.js","assets/component-form-dialog-eDx1JDVj.js","assets/fleet-overview-0-kj49Gi.js","assets/decision-task-link-ralspRkH.js","assets/circle-x-Bg44VKPr.js","assets/circle-check-D6o7uZHA.js","assets/empty-line-4Z0l0Vnh.js","assets/event-lines-Cr2nBViR.js","assets/activity-pane-Bsfjtj0l.js","assets/tabs-CVKTecxY.js","assets/detail-frame-qwlsp3yx.js","assets/triangle-alert-DPhl1pN2.js","assets/agent-detail-pLwd1Kfe.js","assets/collapsible-vP8CpOhI.js","assets/detail-fact-BtVVILR_.js","assets/sliders-horizontal-DynupoHa.js","assets/runner-detail-DbGHVQeC.js","assets/component-detail-ClzUdR1_.js","assets/github-warning-list-BI_z0rQc.js","assets/AdminUsagePage-Bhyx9PjU.js","assets/card-Bz5gwh3F.js","assets/quantity-cell-B2WT8J5F.js","assets/step-Bmsi4fXg.js","assets/band-CquvqAHh.js","assets/linear-a6sABc_P.js","assets/defaultLocale-C4B-KCzX.js","assets/time-Ck7C4xiW.js","assets/users-DZl4XO9u.js","assets/JournalPage-DSQl3Nto.js","assets/journal-nav-buttons-B5kpDGGz.js","assets/JournalDetailPage-BHFaCT9y.js","assets/KnowledgeGraphPage-DgpnVKs6.js","assets/ThreadsPage-LxelYRLJ.js","assets/threads-BhbJhwbm.js","assets/ThreadDetailPage-oBS1Qa5z.js","assets/SpacesPage-BczeGi3X.js","assets/ReadPage-Cs0utxGJ.js","assets/SettingsPage-CUk_ge1z.js","assets/NotFoundPage-_jxydfjh.js","assets/SignInPage-DOyqEDTf.js","assets/auth-error-notice-DgP1LQSq.js","assets/SignUpPage-ME7L_Ybf.js","assets/user-CgeQOZrr.js","assets/ForgotPasswordPage-PwRbw4EB.js","assets/ResetPasswordPage-CWmQlcPQ.js","assets/CheckEmailPage-BevGhzWK.js","assets/VerifyEmailPage-CKOMdGdN.js","assets/DeviceAuthorizePage-CN25TcJW.js","assets/GoogleAuthPage-DcVKNZ_E.js","assets/SubscriptionPage-CrllyJML.js","assets/SuccessPage-CH5Ga6kK.js","assets/CancelPage-CDDgUjJr.js"])))=>i.map(i=>d[i]);
2var CA=e=>{throw TypeError(e)};var kA=(e,t,n)=>t.has(e)||CA("Cannot "+n);var Wr=(e,t,n)=>(kA(e,t,"read from private field"),n?n.call(e):t.get(e)),TA=(e,t,n
2)=>t.has(e)?CA("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),o1=(e,t,n,r)=>(kA(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);function wJ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();var DBe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function $5(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var a1={exports:{}},qh={},l1={exports:{}},$t={};var PA;function xJ(){if(PA)return $t;PA=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),d=Symbol.iterator;function p(q){return q===null||typeof q!="object"?null:(q=d&&q[d]||q["@@iterator"],typeof q=="function"?q:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,_={};function w(q,z,N){this.props=q,this.context=z,this.refs=_,this.updater=N||m}w.prototype.isReactComponent={},w.prototype.setState=function(q,z){if(typeof q!="object"&&typeof q!="function"&&q!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,q,z,"setState")},w.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function x(){}x.prototype=w.prototype;function S(q,z,N){this.props=q,this.context=z,this.refs=_,this.updater=N||m}var C=S.prototype=new x;C.constructor=S,v(C,w.prototype),C.isPureReactComponent=!0;var R=Array.isArray,P=Object.prototype.hasOwnProperty,k={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function D(q,z,N){var ee,X={},ne=null,ae=null;if(z!=null)for(ee in z.ref!==void 0&&(ae=z.ref),z.key!==void 0&&(ne=""+z.key),z)P.call(z,ee)&&!I.hasOwnProperty(ee)&&(X[ee]=z[ee]);var se=arguments.length-2;if(se===1)X.children=N;else if(1<se){for(var ce=Array(se),fe=0;fe<se;fe++)ce[fe]=arguments[fe+2];X.children=ce}if(q&&q.defaultProps)for(ee in se=q.defaultProps,se)X[ee]===void 0&&(X[ee]=se[ee]);return{$$typeof:e,type:q,key:ne,ref:ae,props:X,_owner:k.current}}function L(q,z){return{$$typeof:e,type:q.type,key:z,ref:q.ref,props:q.props,_owner:q._owner}}function A(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function $(q){var z={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(N){return z[N]})}var j=/\/+/g;function V(q,z){return typeof q=="object"&&q!==null&&q.key!=null?$(""+q.key):z.toString(36)}function B(q,z,N,ee,X){var ne=typeof q;(ne==="undefined"||ne==="boolean")&&(q=null);var ae=!1;if(q===null)ae=!0;else switch(ne){case"string":case"number":ae=!0;break;case"object":switch(q.$$typeof){case e:case t:ae=!0}}if(ae)return ae=q,X=X(ae),q=ee===""?"."+V(ae,0):ee,R(X)?(N="",q!=null&&(N=q.replace(j,"$&/")+"/"),B(X,z,N,"",function(fe){return fe})):X!=null&&(A(X)&&(X=L(X,N+(!X.key||ae&&ae.key===X.key?"":(""+X.key).replace(j,"$&/")+"/")+q)),z.push(X)),1;if(ae=0,ee=ee===""?".":ee+":",R(q))for(var se=0;se<q.length;se++){ne=q[se];var ce=ee+V(ne,se);ae+=B(ne,z,N,ce,X)}else if(ce=p(q),typeof ce=="function")for(q=ce.call(q),se=0;!(ne=q.next()).done;)ne=ne.value,ce=ee+V(ne,se++),ae+=B(ne,z,N,ce,X);else if(ne==="object")throw z=String(q),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return ae}
vendor: 5,800 bytes, line 2
2function H(q,z,N){if(q==null)return q;var ee=[],X=0;return B(q,ee,"","",function(ne){return z.call(N,ne,X++)}),ee}function te(q){if(q._status===-1){var z=q._result;z=z(),z.then(function(N){(q._status===0||q._status===-1)&&(q._status=1,q._result=N)},function(N){(q._status===0||q._status===-1)&&(q._status=2,q._result=N)}),q._status===-1&&(q._status=0,q._result=z)}if(q._status===1)return q._result.default;throw q._result}var G={current:null},Z={transition:null},Y={ReactCurrentDispatcher:G,ReactCurrentBatchConfig:Z,ReactCurrentOwner:k};function M(){throw Error("act(...) is not supported in production builds of React.")}return $t.Children={map:H,forEach:function(q,z,N){H(q,function(){z.apply(this,arguments)},N)},count:function(q){var z=0;return H(q,function(){z++}),z},toArray:function(q){return H(q,function(z){return z})||[]},only:function(q){if(!A(q))throw Error("React.Children.only expected to receive a single React element child.");return q}},$t.Component=w,$t.Fragment=n,$t.Profiler=i,$t.PureComponent=S,$t.StrictMode=r,$t.Suspense=l,$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Y,$t.act=M,$t.cloneElement=function(q,z,N){if(q==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+q+".");var ee=v({},q.props),X=q.key,ne=q.ref,ae=q._owner;if(z!=null){if(z.ref!==void 0&&(ne=z.ref,ae=k.current),z.key!==void 0&&(X=""+z.key),q.type&&q.type.defaultProps)var se=q.type.defaultProps;for(ce in z)P.call(z,ce)&&!I.hasOwnProperty(ce)&&(ee[ce]=z[ce]===void 0&&se!==void 0?se[ce]:z[ce])}var ce=arguments.length-2;if(ce===1)ee.children=N;else if(1<ce){se=Array(ce);for(var fe=0;fe<ce;fe++)se[fe]=arguments[fe+2];ee.children=se}return{$$typeof:e,type:q.type,key:X,ref:ne,props:ee,_owner:ae}},$t.createContext=function(q){return q={$$typeof:o,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},q.Provider={$$typeof:s,_context:q},q.Consumer=q},$t.createElement=D,$t.createFactory=function(q){var z=D.bind(null,q);return z.type=q,z},$t.createRef=function(){return{current:null}},$t.forwardRef=function(q){return{$$typeof:a,render:q}},$t.isValidElement=A,$t.lazy=function(q){return{$$typeof:f,_payload:{_status:-1,_result:q},_init:te}},$t.memo=function(q,z){return{$$typeof:u,type:q,compare:z===void 0?null:z}},$t.startTransition=function(q){var z=Z.transition;Z.transition={};try{q()}finally{Z.transition=z}},$t.unstable_act=M,$t.useCallback=function(q,z){return G.current.useCallback(q,z)},$t.useContext=function(q){return G.current.useContext(q)},$t.useDebugValue=function(){},$t.useDeferredValue=function(q){return G.current.useDeferredValue(q)},$t.useEffect=function(q,z){return G.current.useEffect(q,z)},$t.useId=function(){return G.current.useId()},$t.useImperativeHandle=function(q,z,N){return G.current.useImperativeHandle(q,z,N)},$t.useInsertionEffect=function(q,z){return G.current.useInsertionEffect(q,z)},$t.useLayoutEffect=function(q,z){return G.current.useLayoutEffect(q,z)},$t.useMemo=function(q,z){return G.current.useMemo(q,z)},$t.useReducer=function(q,z,N){return G.current.useReducer(q,z,N)},$t.useRef=function(q){return G.current.useRef(q)},$t.useState=function(q){return G.current.useState(q)},$t.useSyncExternalStore=function(q,z,N){return G.current.useSyncExternalStore(q,z,N)},$t.useTransition=function(){return G.current.useTransition()},$t.version="18.3.1",$t}var RA;function zr(){return RA||(RA=1,l1.exports=xJ()),l1.exports}var IA;function SJ(){if(IA)return qh;IA=1;var e=zr(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function o(a,l,u){var f,d={},p=null,m=null;u!==void 0&&(p=""+u),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(m=l.ref);for(f in l)r.call(l,f)&&!s.hasOwnProperty(f)&&(d[f]=l[f]);if(a&&a.defaultProps)for(f in l=a.defaultProps,l)d[f]===void 0&&(d[f]=l[f]);return{$$typeof:t,type:a,key:p,ref:m,props:d,_owner:i.current}}return qh.Fragment=n,qh.jsx=o,qh.jsxs=o,qh}var OA;function EJ(){return OA||(OA=1,a1.exports=SJ()),a1.exports}var g=EJ(),b=zr();const ve=vo(b),Ua=wJ({__proto__:null,default:ve},[b]);var Hv={},u1={exports:{}},Pi={},c1={exports:{}},d1={};var DA;function CJ(){return DA||(DA=1,(function(e){function t(Z,Y){var M=Z.length;Z.push(Y);e:for(;0<M;){var q=M-1>>>1,z=Z[q];if(0<i(z,Y))Z[q]=Y,Z[M]=z,M=q;else break e}}function n(Z){return Z.length===0?null:Z[0]}function r(Z){if(Z.length===0)return null;var Y=Z[0],M=Z.pop();if(M!==Y){Z[0]=M;e:for(var q=0,z=Z.length,N=z>>>1;q<N;){var ee=2*(q+1)-1,X=Z[ee],ne=ee+1,ae=Z[ne];if(0>i(X,M))ne<z&&0>i(ae,X)?(Z[q]=ae,Z[ne]=M,q=ne):(Z[q]=X,Z[ee]=M,q=ee);else if(ne<z&&0>i(ae,M))Z[q]=ae,Z[ne]=M,q=ne;else break e}}return Y}function i(Z,Y){var M=Z.sortIndex-Y.sortIndex;return M!==0?M:Z.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],f=1,d=null,p=3,m=!1,v=!1,_=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function C(Z){for(var Y=n(u);Y!==null;){if(Y.callback===null)r(u);else if(Y.startTime<=Z)r(u),Y.sortIndex=Y.expirationTime,t(l,Y);else break;Y=n(u)}}function R(Z){if(_=!1,C(Z),!v)if(n(l)!==null)v=!0,te(P);else{var Y=n(u);Y!==null&&G(R,Y.startTime-Z)}}function P(Z,Y){v=!1,_&&(_=!1,x(D),D=-1),m=!0;var M=p;try{for(C(Y),d=n(l);d!==null&&(!(d.expirationTime>Y)||Z&&!$());){var q=d.callback;
vendor: 49,503 bytes, lines 2-7
2if(typeof q=="function"){d.callback=null,p=d.priorityLevel;var z=q(d.expirationTime<=Y);Y=e.unstable_now(),typeof z=="function"?d.callback=z:d===n(l)&&r(l),C(Y)}else r(l);d=n(l)}if(d!==null)var N=!0;else{var ee=n(u);ee!==null&&G(R,ee.startTime-Y),N=!1}return N}finally{d=null,p=M,m=!1}}var k=!1,I=null,D=-1,L=5,A=-1;function $(){return!(e.unstable_now()-A<L)}function j(){if(I!==null){var Z=e.unstable_now();A=Z;var Y=!0;try{Y=I(!0,Z)}finally{Y?V():(k=!1,I=null)}}else k=!1}var V;if(typeof S=="function")V=function(){S(j)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,H=B.port2;B.port1.onmessage=j,V=function(){H.postMessage(null)}}else V=function(){w(j,0)};function te(Z){I=Z,k||(k=!0,V())}function G(Z,Y){D=w(function(){Z(e.unstable_now())},Y)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(Z){Z.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,te(P))},e.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"):L=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(Z){switch(p){case 1:case 2:case 3:var Y=3;break;default:Y=p}var M=p;p=Y;try{return Z()}finally{p=M}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(Z,Y){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var M=p;p=Z;try{return Y()}finally{p=M}},e.unstable_scheduleCallback=function(Z,Y,M){var q=e.unstable_now();switch(typeof M=="object"&&M!==null?(M=M.delay,M=typeof M=="number"&&0<M?q+M:q):M=q,Z){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=M+z,Z={id:f++,callback:Y,priorityLevel:Z,startTime:M,expirationTime:z,sortIndex:-1},M>q?(Z.sortIndex=M,t(u,Z),n(l)===null&&Z===n(u)&&(_?(x(D),D=-1):_=!0,G(R,M-q))):(Z.sortIndex=z,t(l,Z),v||m||(v=!0,te(P))),Z},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(Z){var Y=p;return function(){var M=p;p=Y;try{return Z.apply(this,arguments)}finally{p=M}}}})(d1)),d1}var AA;function kJ(){return AA||(AA=1,c1.exports=CJ()),c1.exports}var MA;function TJ(){if(MA)return Pi;MA=1;var e=zr(),t=kJ();function n(c){for(var h="https://reactjs.org/docs/error-decoder.html?invariant="+c,y=1;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y]);return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(c,h){o(c,h),o(c+"Capture",h)}function o(c,h){for(i[c]=h,c=0;c<h.length;c++)r.add(h[c])}var a=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,f={},d={};function p(c){return l.call(d,c)?!0:l.call(f,c)?!1:u.test(c)?d[c]=!0:(f[c]=!0,!1)}function m(c,h,y,E){if(y!==null&&y.type===0)return!1;switch(typeof h){case"function":case"symbol":return!0;case"boolean":return E?!1:y!==null?!y.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function v(c,h,y,E){if(h===null||typeof h>"u"||m(c,h,y,E))return!0;if(E)return!1;if(y!==null)switch(y.type){case 3:return!h;case 4:return h===!1;case 5:return isNaN(h);case 6:return isNaN(h)||1>h}return!1}function _(c,h,y,E,T,O,F){this.acceptsBooleans=h===2||h===3||h===4,this.attributeName=E,this.attributeNamespace=T,this.mustUseProperty=y,this.propertyName=c,this.type=h,this.sanitizeURL=O,this.removeEmptyString=F}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){w[c]=new _(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var h=c[0];w[h]=new _(h,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){w[c]=new _(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){w[c]=new _(c,2,!1,c,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(c){w[c]=new _(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){w[c]=new _(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){w[c]=new _(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){w[c]=new _(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){w[c]=new _(c,5,!1,c.toLowerCase(),null,!1,!1)});var x=/[\-:]([a-z])/g;function S(c){return c[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(c){var h=c.replace(x,S);w[h]=new _(h,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var h=c.replace(x,S);w[h]=new _(h,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var h=c.replace(x,S);w[h]=new _(h,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){w[c]=new _(c,1,!1,c.toLowerCase(),null,!1,!1)}),w.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){w[c]=new _(c,1,!1,c.toLowerCase(),null,!0,!0)});function C(c,h,y,E){var T=w.hasOwnProperty(h)?w[h]:null;(T!==null?T.type!==0:E||!(2<h.length)||h[0]!=="o"&&h[0]!=="O"||h[1]!=="n"&&h[1]!=="N")&&(v(h,y,T,E)&&(y=null),E||T===null?p(h)&&(y===null?c.removeAttribute(h):c.setAttribute(h,""+y)):T.mustUseProperty?c[T.propertyName]=y===null?T.type===3?!1:"":y:(h=T.attributeName,E=T.attributeNamespace,y===null?c.removeAttribute(h):(T=T.type,y=T===3||T===4&&y===!0?"":""+y,E?c.setAttributeNS(E,h,y):c.setAttribute(h,y))))}var R=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),k=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),$=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),G=Symbol.for("react.offscreen"),Z=Symbol.iterator;function Y(c){return c===null||typeof c!="object"?null:(c=Z&&c[Z]||c["@@iterator"],typeof c=="function"?c:null)}var M=Object.assign,q;function z(c){if(q===void 0)try{throw Error()}catch(y){var h=y.stack.trim().match(/\n( *(at )?)/);q=h&&h[1]||""}return`
3`+q+c}var N=!1;function ee(c,h){if(!c||N)return"";N=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(h)if(h=function(){throw Error()},Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(pe){var E=pe}Reflect.construct(c,[],h)}else{try{h.call()}catch(pe){E=pe}c.call(h.prototype)}else{try{throw Error()}catch(pe){E=pe}c()}}catch(pe){if(pe&&E&&typeof pe.stack=="string"){for(var T=pe.stack.split(`
4`),O=E.stack.split(`
5`),F=T.length-1,K=O.length-1;1<=F&&0<=K&&T[F]!==O[K];)K--;for(;1<=F&&0<=K;F--,K--)if(T[F]!==O[K]){if(F!==1||K!==1)do if(F--,K--,0>K||T[F]!==O[K]){var J=`
6`+T[F].replace(" at new "," at ");return c.displayName&&J.includes("<anonymous>")&&(J=J.replace("<anonymous>",c.displayName)),J}while(1<=F&&0<=K);break}}}finally{N=!1,Error.prepareStackTrace=y}return(c=c?c.displayName||c.name:"")?z(c):""}function X(c){switch(c.tag){case 5:return z(c.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return c=ee(c.type,!1),c;case 11:return c=ee(c.type.render,!1),c;case 1:return c=ee(c.type,!0),c;default:return""}}function ne(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case I:return"Fragment";case k:return"Portal";case L:return"Profiler";case D:return"StrictMode";case V:return"Suspense";case B:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case $:return(c.displayName||"Context")+".Consumer";case A:return(c._context.displayName||"Context")+".Provider";case j:var h=c.render;return c=c.displayName,c||(c=h.displayName||h.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case H:return h=c.displayName||null,h!==null?h:ne(c.type)||"Memo";case te:h=c._payload,c=c._init;try{return ne(c(h))}catch{}}return null}function ae(c){var h=c.type;switch(c.tag){case 24:return"Cache";case 9:return(h.displayName||"Context")+".Consumer";case 10:return(h._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=h.render,c=c.displayName||c.name||"",h.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return h;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ne(h);case 8:return h===D?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof h=="function")return h.displayName||h.name||null;if(typeof h=="string")return h}return null}function se(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function ce(c){var h=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function fe(c){var h=ce(c)?"checked":"value",y=Object.getOwnPropertyDescriptor(c.constructor.prototype,h),E=""+c[h];if(!c.hasOwnProperty(h)&&typeof y<"u"&&typeof y.get=="function"&&typeof y.set=="function"){var T=y.get,O=y.set;return Object.defineProperty(c,h,{configurable:!0,get:function(){return T.call(this)},set:function(F){E=""+F,O.call(this,F)}}),Object.defineProperty(c,h,{enumerable:y.enumerable}),{getValue:function(){return E},setValue:function(F){E=""+F},stopTracking:function(){c._valueTracker=null,delete c[h]}}}}function ke(c){c._valueTracker||(c._valueTracker=fe(c))}function Ce(c){if(!c)return!1;var h=c._valueTracker;if(!h)return!0;var y=h.getValue(),E="";return c&&(E=ce(c)?c.checked?"true":"false":c.value),c=E,c!==y?(h.setValue(c),!0):!1}function Se(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function Fe(c,h){var y=h.checked;return M({},h,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:y??c._wrapperState.initialChecked})}function Be(c,h){var y=h.defaultValue==null?"":h.defaultValue,E=h.checked!=null?h.checked:h.defaultChecked;y=se(h.value!=null?h.value:y),c._wrapperState={initialChecked:E,initialValue:y,controlled:h.type==="checkbox"||h.type==="radio"?h.checked!=null:h.value!=null}}function wt(c,h){h=h.checked,h!=null&&C(c,"checked",h,!1)}function ht(c,h){wt(c,h);var y=se(h.value),E=h.type;if(y!=null)E==="number"?(y===0&&c.value===""||c.value!=y)&&(c.value=""+y):c.value!==""+y&&(c.value=""+y);else if(E==="submit"||E==="reset"){c.removeAttribute("value");return}h.hasOwnProperty("value")?ie(c,h.type,y):h.hasOwnProperty("defaultValue")&&ie(c,h.type,se(h.defaultValue)),h.checked==null&&h.defaultChecked!=null&&(c.defaultChecked=!!h.defaultChecked)}function W(c,h,y){if(h.hasOwnProperty("value")||h.hasOwnProperty("defaultValue")){var E=h.type;if(!(E!=="submit"&&E!=="reset"||h.value!==void 0&&h.value!==null))return;h=""+c._wrapperState.initialValue,y||h===c.value||(c.value=h),c.defaultValue=h}y=c.name,y!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,y!==""&&(c.name=y)}function ie(c,h,y){(h!=="number"||Se(c.ownerDocument)!==c)&&(y==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+y&&(c.defaultValue=""+y))}var ue=Array.isArray;function Re(c,h,y,E){if(c=c.options,h){h={};for(var T=0;T<y.length;T++)h["$"+y[T]]=!0;for(y=0;y<c.length;y++)T=h.hasOwnProperty("$"+c[y].value),c[y].selected!==T&&(c[y].selected=T),T&&E&&(c[y].defaultSelected=!0)}else{for(y=""+se(y),h=null,T=0;T<c.length;T++){if(c[T].value===y){c[T].selected=!0,E&&(c[T].defaultSelected=!0);return}h!==null||c[T].disabled||(h=c[T])}h!==null&&(h.selected=!0)}}function Ee(c,h){if(h.dangerouslySetInnerHTML!=null)throw Error(n(91));return M({},h,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function xe(c,h){var y=h.value;if(y==null){if(y=h.children,h=h.defaultValue,y!=null){if(h!=null)throw Error(n(92));if(ue(y)){if(1<y.length)throw Error(n(93));y=y[0]}h=y}h==null&&(h=""),y=h}c._wrapperState={initialValue:se(y)}}function ze(c,h){var y=se(h.value),E=se(h.defaultValue);y!=null&&(y=""+y,y!==c.value&&(c.value=y),h.defaultValue==null&&c.defaultValue!==y&&(c.defaultValue=y)),E!=null&&(c.defaultValue=""+E)}function Ze(c){var h=c.textContent;h===c._wrapperState.initialValue&&h!==""&&h!==null&&(c.value=h)}function he(c){switch(c){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function we(c,h){return c==null||c==="http://www.w3.org/1999/xhtml"?he(h):c==="http://www.w3.org/2000/svg"&&h==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var We,Et=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(h,y,E,T){MSApp.execUnsafeLocalFunction(function(){return c(h,y,E,T)})}:c})(function(c,h){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=h;else{for(We=We||document.createElement("div"),We.innerHTML="<svg>"+h.valueOf().toString()+"</svg>",h=We.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;h.firstChild;)c.appendChild(h.firstChild)}});function jt(c,h){if(h){var y=c.firstChild;if(y&&y===c.lastChild&&y.nodeType===3){y.nodeValue=h;return}}c.textContent=h}var Sn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},zi=["Webkit","ms","Moz","O"];Object.keys(Sn).forEach(function(c){zi.forEach(function(h){h=h+c.charAt(0).toUpperCase()+c.substring(1),Sn[h]=Sn[c]})});function En(c,h,y){return h==null||typeof h=="boolean"||h===""?"":y||typeof h!="number"||h===0||Sn.hasOwnProperty(c)&&Sn[c]?(""+h).trim():h+"px"}function Vi(c,h){c=c.style;for(var y in h)if(h.hasOwnProperty(y)){var E=y.indexOf("--")===0,T=En(y,h[y],E);y==="float"&&(y="cssFloat"),E?c.setProperty(y,T):c[y]=T}}var Ui=M({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function sr(c,h){if(h){if(Ui[c]&&(h.children!=null||h.dangerouslySetInnerHTML!=null))throw Error(n(137,c));if(h.dangerouslySetInnerHTML!=null){if(h.children!=null)throw Error(n(60));if(typeof h.dangerouslySetInnerHTML!="object"||!("__html"in h.dangerouslySetInnerHTML))throw Error(n(61))}if(h.style!=null&&typeof h.style!="object")throw Error(n(62))}}function us(c,h){if(c.indexOf("-")===-1)return typeof h.is=="string";switch(c){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 Vr=null;function Za(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Zc=null,xo=null,Ya=null;function ch(c){if(c=Ih(c)){if(typeof Zc!="function")throw Error(n(280));var h=c.stateNode;h&&(h=sv(h),Zc(c.stateNode,c.type,h))}}function $g(c){xo?Ya?Ya.push(c):Ya=[c]:xo=c}function dh(){if(xo){var c=xo,h=Ya;if(Ya=xo=null,ch(c),h)for(c=0;c<h.length;c++)ch(h[c])}}function fu(c,h){return c(h)}function hu(){}var Yc=!1;function zg(c,h,y){if(Yc)return c(h,y);Yc=!0;try{return fu(c,h,y)}finally{Yc=!1,(xo!==null||Ya!==null)&&(hu(),dh())}}function pu(c,h){var y=c.stateNode;if(y===null)return null;var E=sv(y);if(E===null)return null;y=E[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(E=!E.disabled)||(c=c.type,E=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!E;break e;default:c=!1}if(c)return null;if(y&&typeof y!="function")throw Error(n(231,h,typeof y));return y}var Q=!1;if(a)try{var oe={};Object.defineProperty(oe,"passive",{get:function(){Q=!0}}),window.addEventListener("test",oe,oe),window.removeEventListener("test",oe,oe)}catch{Q=!1}function me(c,h,y,E,T,O,F,K,J){var pe=Array.prototype.slice.call(arguments,3);try{h.apply(y,pe)}catch(Pe){this.onError(Pe)}}var Ie=!1,je=null,it=!1,ot=null,st={onError:function(c){Ie=!0,je=c}};function dt(c,h,y,E,T,O,F,K,J){Ie=!1,je=null,me.apply(st,arguments)}function pt(c,h,y,E,T,O,F,K,J){if(dt.apply(this,arguments),Ie){if(Ie){var pe=je;Ie=!1,je=null}else throw Error(n(198));it||(it=!0,ot=pe)}}function tt(c){var h=c,y=c;if(c.alternate)for(;h.return;)h=h.return;else{c=h;do h=c,(h.flags&4098)!==0&&(y=h.return),c=h.return;while(c)}return h.tag===3?y:null}function ft(c){if(c.tag===13){var h=c.memoizedState;if(h===null&&(c=c.alternate,c!==null&&(h=c.memoizedState)),h!==null)return h.dehydrated}return null}function Wt(c){if(tt(c)!==c)throw Error(n(188))}function vn(c){var h=c.alternate;if(!h){if(h=tt(c),h===null)throw Error(n(188));return h!==c?null:c}for(var y=c,E=h;;){var T=y.return;if(T===null)break;var O=T.alternate;if(O===null){if(E=T.return,E!==null){y=E;continue}break}if(T.child===O.child){for(O=T.child;O;){if(O===y)return Wt(T),c;if(O===E)return Wt(T),h;O=O.sibling}throw Error(n(188))}if(y.return!==E.return)y=T,E=O;else{for(var F=!1,K=T.child;K;){if(K===y){F=!0,y=T,E=O;break}if(K===E){F=!0,E=T,y=O;break}K=K.sibling}if(!F){for(K=O.child;K;){if(K===y){F=!0,y=O,E=T;break}if(K===E){F=!0,E=O,y=T;break}K=K.sibling}if(!F)throw Error(n(189))}}if(y.alternate!==E)throw Error(n(190))}if(y.tag!==3)throw Error(n(188));return y.stateNode.current===y?c:h}function Un(c){return c=vn(c),c!==null?Xn(c):null}function Xn(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var h=Xn(c);if(h!==null)return h;c=c.sibling}return null}var un=t.unstable_scheduleCallback,cn=t.unstable_cancelCallback,ia=t.unstable_shouldYield,mu=t.unstable_requestPaint,nn=t.unstable_now,cs=t.unstable_getCurrentPriorityLevel,gu=t.unstable_ImmediatePriority,Qa=t.unstable_UserBlockingPriority,ds=t.unstable_NormalPriority,Qc=t.unstable_LowPriority,vu=t.unstable_IdlePriority,Ft=null,hn=null;function Xa(c){if(hn&&typeof hn.onCommitFiberRoot=="function")try{hn.onCommitFiberRoot(Ft,c,void 0,(c.current.flags&128)===128)}catch{}}var mr=Math.clz32?Math.clz32:Vg,Rn=Math.log,Xc=Math.LN2;function Vg(c){return c>>>=0,c===0?32:31-(Rn(c)/Xc|0)|0}var Jc=64,Ug=4194304;function fh(c){switch(c&-c){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: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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function Bg(c,h){var y=c.pendingLanes;if(y===0)return 0;var E=0,T=c.suspendedLanes,O=c.pingedLanes,F=y&268435455;if(F!==0){var K=F&~T;K!==0?E=fh(K):(O&=F,O!==0&&(E=fh(O)))}else F=y&~T,F!==0?E=fh(F):O!==0&&(E=fh(O));if(E===0)return 0;if(h!==0&&h!==E&&(h&T)===0&&(T=E&-E,O=h&-h,T>=O||T===16&&(O&4194240)!==0))return h;if((E&4)!==0&&(E|=y&16),h=c.entangledLanes,h!==0)for(c=c.entanglements,h&=E;0<h;)y=31-mr(h),T=1<<y,E|=c[y],h&=~T;return E}function zQ(c,h){switch(c){case 1:case 2:case 4:return h+250;case 8:case 16:case 32:case 64: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 h+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function VQ(c,h){for(var y=c.suspendedLanes,E=c.pingedLanes,T=c.expirationTimes,O=c.pendingLanes;0<O;){var F=31-mr(O),K=1<<F,J=T[F];J===-1?((K&y)===0||(K&E)!==0)&&(T[F]=zQ(K,h)):J<=h&&(c.expiredLanes|=K),O&=~K}}function Tw(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function nO(){var c=Jc;return Jc<<=1,(Jc&4194240)===0&&(Jc=64),c}function Pw(c){for(var h=[],y=0;31>y;y++)h.push(c);return h}function hh(c,h,y){c.pendingLanes|=h,h!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,h=31-mr(h),c[h]=y}function UQ(c,h){var y=c.pendingLanes&~h;c.pendingLanes=h,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=h,c.mutableReadLanes&=h,c.entangledLanes&=h,h=c.entanglements;var E=c.eventTimes;for(c=c.expirationTimes;0<y;){var T=31-mr(y),O=1<<T;h[T]=0,E[T]=-1,c[T]=-1,y&=~O}}function Rw(c,h){var y=c.entangledLanes|=h;for(c=c.entanglements;y;){var E=31-mr(y),T=1<<E;T&h|c[E]&h&&(c[E]|=h),y&=~T}}var on=0;function rO(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var iO,Iw,sO,oO,aO,Ow=!1,Hg=[],Ja=null,el=null,tl=null,ph=new Map,mh=new Map,nl=[],BQ="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 submit".split(" ");function lO(c,h){switch(c){case"focusin":case"focusout":Ja=null;break;case"dragenter":case"dragleave":el=null;break;case"mouseover":case"mouseout":tl=null;break;case"pointerover":case"pointerout":ph.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":mh.delete(h.pointerId)}}function gh(c,h,y,E,T,O){return c===null||c.nativeEvent!==O?(c={blockedOn:h,domEventName:y,eventSystemFlags:E,nativeEvent:O,targetContainers:[T]},h!==null&&(h=Ih(h),h!==null&&Iw(h)),c):(c.eventSystemFlags|=E,h=c.targetContainers,T!==null&&h.indexOf(T)===-1&&h.push(T),c)}function HQ(c,h,y,E,T){switch(h){case"focusin":return Ja=gh(Ja,c,h,y,E,T),!0;case"dragenter":return el=gh(el,c,h,y,E,T),!0;case"mouseover":return tl=gh(tl,c,h,y,E,T),!0;case"pointerover":var O=T.pointerId;return ph.set(O,gh(ph.get(O)||null,c,h,y,E,T)),!0;case"gotpointercapture":return O=T.pointerId,mh.set(O,gh(mh.get(O)||null,c,h,y,E,T)),!0}return!1}function uO(c){var h=yu(c.target);if(h!==null){var y=tt(h);if(y!==null){if(h=y.tag,h===13){if(h=ft(y),h!==null){c.blockedOn=h,aO(c.priority,function(){sO(y)});return}}else if(h===3&&y.stateNode.current.memoizedState.isDehydrated){c.blockedOn=y.tag===3?y.stateNode.containerInfo:null;return}}}c.blockedOn=null}function qg(c){if(c.blockedOn!==null)return!1;for(var h=c.targetContainers;0<h.length;){var y=Aw(c.domEventName,c.eventSystemFlags,h[0],c.nativeEvent);if(y===null){y=c.nativeEvent;var E=new y.constructor(y.type,y);Vr=E,y.target.dispatchEvent(E),Vr=null}else return h=Ih(y),h!==null&&Iw(h),c.blockedOn=y,!1;h.shift()}return!0}function cO(c,h,y){qg(c)&&y.delete(h)}function qQ(){Ow=!1,Ja!==null&&qg(Ja)&&(Ja=null),el!==null&&qg(el)&&(el=null),tl!==null&&qg(tl)&&(tl=null),ph.forEach(cO),mh.forEach(cO)}function vh(c,h){c.blockedOn===h&&(c.blockedOn=null,Ow||(Ow=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qQ)))}function yh(c){function h(T){return vh(T,c)}if(0<Hg.length){vh(Hg[0],c);for(var y=1;y<Hg.length;y++){var E=Hg[y];E.blockedOn===c&&(E.blockedOn=null)}}for(Ja!==null&&vh(Ja,c),el!==null&&vh(el,c),tl!==null&&vh(tl,c),ph.forEach(h),mh.forEach(h),y=0;y<nl.length;y++)E=nl[y],E.blockedOn===c&&(E.blockedOn=null);for(;0<nl.length&&(y=nl[0],y.blockedOn===null);)uO(y),y.blockedOn===null&&nl.shift()}var ed=R.ReactCurrentBatchConfig,Wg=!0;function WQ(c,h,y,E){var T=on,O=ed.transition;ed.transition=null;try{on=1,Dw(c,h,y,E)}finally{on=T,ed.transition=O}}function GQ(c,h,y,E){var T=on,O=ed.transition;ed.transition=null;try{on=4,Dw(c,h,y,E)}finally{on=T,ed.transition=O}}function Dw(c,h,y,E){if(Wg){var T=Aw(c,h,y,E);if(T===null)Yw(c,h,E,Gg,y),lO(c,E);else if(HQ(T,c,h,y,E))E.stopPropagation();else if(lO(c,E),h&4&&-1<BQ.indexOf(c)){for(;T!==null;){var O=Ih(T);if(O!==null&&iO(O),O=Aw(c,h,y,E),O===null&&Yw(c,h,E,Gg,y),O===T)break;T=O}T!==null&&E.stopPropagation()}else Yw(c,h,E,null,y)}}var Gg=null;function Aw(c,h,y,E){if(Gg=null,c=Za(E),c=yu(c),c!==null)if(h=tt(c),h===null)c=null;else if(y=h.tag,y===13){if(c=ft(h),c!==null)return c;c=null}else if(y===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;c=null}else h!==c&&(c=null);return Gg=c,null}function dO(c){switch(c){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cs()){case gu:return 1;case Qa:return 4;case ds:case Qc:return 16;case vu:return 536870912;default:return 16}default:return 16}}var rl=null,Mw=null,Kg=null;function fO(){if(Kg)return Kg;var c,h=Mw,y=h.length,E,T="value"in rl?rl.value:rl.textContent,O=T.length;for(c=0;c<y&&h[c]===T[c];c++);var F=y-c;for(E=1;E<=F&&h[y-E]===T[O-E];E++);return Kg=T.slice(c,1<E?1-E:void 0)}function Zg(c){var h=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&h===13&&(c=13)):c=h,c===10&&(c=13),32<=c||c===13?c:0}function Yg(){return!0}function hO(){return!1}function Bi(c){function h(y,E,T,O,F){this._reactName=y,this._targetInst=T,this.type=E,this.nativeEvent=O,this.target=F,this.currentTarget=null;for(var K in c)c.hasOwnProperty(K)&&(y=c[K],this[K]=y?y(O):O[K]);return this.isDefaultPrevented=(O.defaultPrevented!=null?O.defaultPrevented:O.returnValue===!1)?Yg:hO,this.isPropagationStopped=hO,this}return M(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var y=this.nativeEvent;y&&(y.preventDefault?y.preventDefault():typeof y.returnValue!="unknown"&&(y.returnValue=!1),this.isDefaultPrevented=Yg)},stopPropagation:function(){var y=this.nativeEvent;y&&(y.stopPropagation?y.stopPropagation():typeof y.cancelBubble!="unknown"&&(y.cancelBubble=!0),this.isPropagationStopped=Yg)},persist:function(){},isPersistent:Yg}),h}var td={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nw=Bi(td),bh=M({},td,{view:0,detail:0}),KQ=Bi(bh),jw,Lw,_h,Qg=M({},bh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$w,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==_h&&(_h&&c.type==="mousemove"?(jw=c.screenX-_h.screenX,Lw=c.screenY-_h.screenY):Lw=jw=0,_h=c),jw)},movementY:function(c){return"movementY"in c?c.movementY:Lw}}),pO=Bi(Qg),ZQ=M({},Qg,{dataTransfer:0}),YQ=Bi(ZQ),QQ=M({},bh,{relatedTarget:0}),Fw=Bi(QQ),XQ=M({},td,{animationName:0,elapsedTime:0,pseudoElement:0}),JQ=Bi(XQ),eX=M({},td,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),tX=Bi(eX),nX=M({},td,{data:0}),mO=Bi(nX),rX={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},iX={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"},sX={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oX(c){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(c):(c=sX[c])?!!h[c]:!1}function $w(){return oX}var aX=M({},bh,{key:function(c){if(c.key){var h=rX[c.key]||c.key;if(h!=="Unidentified")return h}return c.type==="keypress"?(c=Zg(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?iX[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$w,charCode:function(c){return c.type==="keypress"?Zg(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?Zg(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),lX=Bi(aX),uX=M({},Qg,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gO=Bi(uX),cX=M({},bh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$w}),dX=Bi(cX),fX=M({},td,{propertyName:0,elapsedTime:0,pseudoElement:0}),hX=Bi(fX),pX=M({},Qg,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),mX=Bi(pX),gX=[9,13,27,32],zw=a&&"CompositionEvent"in window,wh=null;a&&"documentMode"in document&&(wh=document.documentMode);var vX=a&&"TextEvent"in window&&!wh,vO=a&&(!zw||wh&&8<wh&&11>=wh),yO=" ",bO=!1;function _O(c,h){switch(c){case"keyup":return gX.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function wO(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var nd=!1;function yX(c,h){switch(c){case"compositionend":return wO(h);case"keypress":return h.which!==32?null:(bO=!0,yO);case"textInput":return c=h.data,c===yO&&bO?null:c;default:return null}}function bX(c,h){if(nd)return c==="compositionend"||!zw&&_O(c,h)?(c=fO(),Kg=Mw=rl=null,nd=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return vO&&h.locale!=="ko"?null:h.data;default:return null}}var _X={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 xO(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h==="input"?!!_X[c.type]:h==="textarea"}function SO(c,h,y,E){$g(E),h=nv(h,"onChange"),0<h.length&&(y=new Nw("onChange","change",null,y,E),c.push({event:y,listeners:h}))}var xh=null,Sh=null;function wX(c){VO(c,0)}function Xg(c){var h=ad(c);if(Ce(h))return c}function xX(c,h){if(c==="change")return h}var EO=!1;if(a){var Vw;if(a){var Uw="oninput"in document;if(!Uw){var CO=document.createElement("div");CO.setAttribute("oninput","return;"),Uw=typeof CO.oninput=="function"}Vw=Uw}else Vw=!1;EO=Vw&&(!document.documentMode||9<document.documentMode)}function kO(){xh&&(xh.detachEvent("onpropertychange",TO),Sh=xh=null)}function TO(c){if(c.propertyName==="value"&&Xg(Sh)){var h=[];SO(h,Sh,c,Za(c)),zg(wX,h)}}function SX(c,h,y){c==="focusin"?(kO(),xh=h,Sh=y,xh.attachEvent("onpropertychange",TO)):c==="focusout"&&kO()}function EX(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Xg(Sh)}function CX(c,h){if(c==="click")return Xg(h)}function kX(c,h){if(c==="input"||c==="change")return Xg(h)}function TX(c,h){return c===h&&(c!==0||1/c===1/h)||c!==c&&h!==h}var Hs=typeof Object.is=="function"?Object.is:TX;function Eh(c,h){if(Hs(c,h))return!0;if(typeof c!="object"||c===null||typeof h!="object"||h===null)return!1;var y=Object.keys(c),E=Object.keys(h);if(y.length!==E.length)return!1;for(E=0;E<y.length;E++){var T=y[E];if(!l.call(h,T)||!Hs(c[T],h[T]))return!1}return!0}function PO(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function RO(c,h){var y=PO(c);c=0;for(var E;y;){if(y.nodeType===3){if(E=c+y.textContent.length,c<=h&&E>=h)return{node:y,offset:h-c};c=E}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=PO(y)}}function IO(c,h){return c&&h?c===h?!0:c&&c.nodeType===3?!1:h&&h.nodeType===3?IO(c,h.parentNode):"contains"in c?c.contains(h):c.compareDocumentPosition?!!(c.compareDocumentPosition(h)&16):!1:!1}function OO(){for(var c=window,h=Se();h instanceof c.HTMLIFrameElement;){try{var y=typeof h.contentWindow.location.href=="string"}catch{y=!1}if(y)c=h.contentWindow;else break;h=Se(c.document)}return h}function Bw(c){var h=c&&c.nodeName&&c.nodeName.toLowerCase();return h&&(h==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||h==="textarea"||c.contentEditable==="true")}function PX(c){var h=OO(),y=c.focusedElem,E=c.selectionRange;if(h!==y&&y&&y.ownerDocument&&IO(y.ownerDocument.documentElement,y)){if(E!==null&&Bw(y)){if(h=E.start,c=E.end,c===void 0&&(c=h),"selectionStart"in y)y.selectionStart=h,y.selectionEnd=Math.min(c,y.value.length);else if(c=(h=y.ownerDocument||document)&&h.defaultView||window,c.getSelection){c=c.getSelection();var T=y.textContent.length,O=Math.min(E.start,T);E=E.end===void 0?O:Math.min(E.end,T),!c.extend&&O>E&&(T=E,E=O,O=T),T=RO(y,O);var F=RO(y,E);T&&F&&(c.rangeCount!==1||c.anchorNode!==T.node||c.anchorOffset!==T.offset||c.focusNode!==F.node||c.focusOffset!==F.offset)&&(h=h.createRange(),h.setStart(T.node,T.offset),c.removeAllRanges(),O>E?(c.addRange(h),c.extend(F.node,F.offset)):(h.setEnd(F.node,F.offset),c.addRange(h)))}}for(h=[],c=y;c=c.parentNode;)c.nodeType===1&&h.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<h.length;y++)c=h[y],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var RX=a&&"documentMode"in document&&11>=document.documentMode,rd=null,Hw=null,Ch=null,qw=!1;function DO(c,h,y){var E=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;qw||rd==null||rd!==Se(E)||(E=rd,"selectionStart"in E&&Bw(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),Ch&&Eh(Ch,E)||(Ch=E,E=nv(Hw,"onSelect"),0<E.length&&(h=new Nw("onSelect","select",null,h,y),c.push({event:h,listeners:E}),h.target=rd)))}function Jg(c,h){var y={};return y[c.toLowerCase()]=h.toLowerCase(),y["Webkit"+c]="webkit"+h,y["Moz"+c]="moz"+h,y}var id={animationend:Jg("Animation","AnimationEnd"),animationiteration:Jg("Animation","AnimationIteration"),animationstart:Jg("Animation","AnimationStart"),transitionend:Jg("Transition","TransitionEnd")},Ww={},AO={};a&&(AO=document.createElement("div").style,"AnimationEvent"in window||(delete id.animationend.animation,delete id.animationiteration.animation,delete id.animationstart.animation),"TransitionEvent"in window||delete id.transitionend.transition);function ev(c){if(Ww[c])return Ww[c];if(!id[c])return c;var h=id[c],y;for(y in h)if(h.hasOwnProperty(y)&&y in AO)return Ww[c]=h[y];return c}var MO=ev("animationend"),NO=ev("animationiteration"),jO=ev("animationstart"),LO=ev("transitionend"),FO=new Map,$O="abort auxClick 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(" ");function il(c,h){FO.set(c,h),s(h,[c])}for(var Gw=0;Gw<$O.length;Gw++){var Kw=$O[Gw],IX=Kw.toLowerCase(),OX=Kw[0].toUpperCase()+Kw.slice(1);il(IX,"on"+OX)}il(MO,"onAnimationEnd"),il(NO,"onAnimationIteration"),il(jO,"onAnimationStart"),il("dblclick","onDoubleClick"),il("focusin","onFocus"),il("focusout","onBlur"),il(LO,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kh="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("cancel close invalid load scroll toggle".split(" ").concat(kh));function zO(c,h,y){var E=c.type||"unknown-event";c.currentTarget=y,pt(E,h,void 0,c),c.currentTarget=null}function VO(c,h){h=(h&4)!==0;for(var y=0;y<c.length;y++){var E=c[y],T=E.event;E=E.listeners;e:{var O=void 0;if(h)for(var F=E.length-1;0<=F;F--){var K=E[F],J=K.instance,pe=K.currentTarget;if(K=K.listener,J!==O&&T.isPropagationStopped())break e;zO(T,K,pe),O=J}else for(F=0;F<E.length;F++){if(K=E[F],J=K.instance,pe=K.currentTarget,K=K.listener,J!==O&&T.isPropagationStopped())break e;zO(T,K,pe),O=J}}}if(it)throw c=ot,it=!1,ot=null,c}function Cn(c,h){var y=h[nx];y===void 0&&(y=h[nx]=new Set);var E=c+"__bubble";y.has(E)||(UO(h,c,2,!1),y.add(E))}function Zw(c,h,y){var E=0;h&&(E|=4),UO(y,c,E,h)}var tv="_reactListening"+Math.random().toString(36).slice(2);function Th(c){if(!c[tv]){c[tv]=!0,r.forEach(function(y){y!=="selectionchange"&&(DX.has(y)||Zw(y,!1,c),Zw(y,!0,c))});var h=c.nodeType===9?c:c.ownerDocument;h===null||h[tv]||(h[tv]=!0,Zw("selectionchange",!1,h))}}function UO(c,h,y,E){switch(dO(h)){case 1:var T=WQ;break;case 4:T=GQ;break;default:T=Dw}y=T.bind(null,h,y,c),T=void 0,!Q||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(T=!0),E?T!==void 0?c.addEventListener(h,y,{capture:!0,passive:T}):c.addEventListener(h,y,!0):T!==void 0?c.addEventListener(h,y,{passive:T}):c.addEventListener(h,y,!1)}function Yw(c,h,y,E,T){var O=E;if((h&1)===0&&(h&2)===0&&E!==null)e:for(;;){if(E===null)return;var F=E.tag;if(F===3||F===4){var K=E.stateNode.containerInfo;if(K===T||K.nodeType===8&&K.parentNode===T)break;if(F===4)for(F=E.return;F!==null;){var J=F.tag;if((J===3||J===4)&&(J=F.stateNode.containerInfo,J===T||J.nodeType===8&&J.parentNode===T))return;F=F.return}for(;K!==null;){if(F=yu(K),F===null)return;if(J=F.tag,J===5||J===6){E=O=F;continue e}K=K.parentNode}}E=E.return}zg(function(){var pe=O,Pe=Za(y),Oe=[];e:{var Te=FO.get(c);if(Te!==void 0){var He=Nw,Xe=c;switch(c){case"keypress":if(Zg(y)===0)break e;case"keydown":case"keyup":He=lX;break;case"focusin":Xe="focus",He=Fw;break;case"focusout":Xe="blur",He=Fw;break;case"beforeblur":case"afterblur":He=Fw;break;case"click":if(y.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":He=pO;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":He=YQ;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":He=dX;break;case MO:case NO:case jO:He=JQ;break;case LO:He=hX;break;case"scroll":He=KQ;break;case"wheel":He=mX;break;case"copy":case"cut":case"paste":He=tX;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":He=gO}var nt=(h&4)!==0,Jn=!nt&&c==="scroll",le=nt?Te!==null?Te+"Capture":null:Te;nt=[];for(var re=pe,de;re!==null;){de=re;var Ae=de.stateNode;if(de.tag===5&&Ae!==null&&(de=Ae,le!==null&&(Ae=pu(re,le),Ae!=null&&nt.push(Ph(re,Ae,de)))),Jn)break;re=re.return}0<nt.length&&(Te=new He(Te,Xe,null,y,Pe),Oe.push({event:Te,listeners:nt}))}}if((h&7)===0){e:{if(Te=c==="mouseover"||c==="pointerover",He=c==="mouseout"||c==="pointerout",Te&&y!==Vr&&(Xe=y.relatedTarget||y.fromElement)&&(yu(Xe)||Xe[sa]))break e;if((He||Te)&&(Te=Pe.window===Pe?Pe:(Te=Pe.ownerDocument)?Te.defaultView||Te.parentWindow:window,He?(Xe=y.relatedTarget||y.toElement,He=pe,Xe=Xe?yu(Xe):null,Xe!==null&&(Jn=tt(Xe),Xe!==Jn||Xe.tag!==5&&Xe.tag!==6)&&(Xe=null)):(He=null,Xe=pe),He!==Xe)){if(nt=pO,Ae="onMouseLeave",le="onMouseEnter",re="mouse",(c==="pointerout"||c==="pointerover")&&(nt=gO,Ae="onPointerLeave",le="onPointerEnter",re="pointer"),Jn=He==null?Te:ad(He),de=Xe==null?Te:ad(Xe),Te=new nt(Ae,re+"leave",He,y,Pe),Te.target=Jn,Te.relatedTarget=de,Ae=null,yu(Pe)===pe&&(nt=new nt(le,re+"enter",Xe,y,Pe),nt.target=de,nt.relatedTarget=Jn,Ae=nt),Jn=Ae,He&&Xe)t:{for(nt=He,le=Xe,re=0,de=nt;de;de=sd(de))re++;for(de=0,Ae=le;Ae;Ae=sd(Ae))de++;for(;0<re-de;)nt=sd(nt),re--;for(;0<de-re;)le=sd(le),de--;for(;re--;){if(nt===le||le!==null&&nt===le.alternate)break t;nt=sd(nt),le=sd(le)}nt=null}else nt=null;He!==null&&BO(Oe,Te,He,nt,!1),Xe!==null&&Jn!==null&&BO(Oe,Jn,Xe,nt,!0)}}e:{if(Te=pe?ad(pe):window,He=Te.nodeName&&Te.nodeName.toLowerCase(),He==="select"||He==="input"&&Te.type==="file")var at=xX;else if(xO(Te))if(EO)at=kX;else{at=EX;var mt=SX}else(He=Te.nodeName)&&He.toLowerCase()==="input"&&(Te.type==="checkbox"||Te.type==="radio")&&(at=CX);if(at&&(at=at(c,pe))){SO(Oe,at,y,Pe);break e}mt&&mt(c,Te,pe),c==="focusout"&&(mt=Te._wrapperState)&&mt.controlled&&Te.type==="number"&&ie(Te,"number",Te.value)}switch(mt=pe?ad(pe):window,c){case"focusin":(xO(mt)||mt.contentEditable==="true")&&(rd=mt,Hw=pe,Ch=null);break;case"focusout":Ch=Hw=rd=null;break;case"mousedown":qw=!0;break;case"contextmenu":case"mouseup":case"dragend":qw=!1,DO(Oe,y,Pe);break;case"selectionchange":if(RX)break;case"keydown":case"keyup":DO(Oe,y,Pe)}var gt;if(zw)e:{switch(c){case"compositionstart":var Ct="onCompositionStart";break e;case"compositionend":Ct="onCompositionEnd";break e;case"compositionupdate":Ct="onCompositionUpdate";break e}Ct=void 0}else nd?_O(c,y)&&(Ct="onCompositionEnd"):c==="keydown"&&y.keyCode===229&&(Ct="onCompositionStart");Ct&&(vO&&y.locale!=="ko"&&(nd||Ct!=="onCompositionStart"?Ct==="onCompositionEnd"&&nd&&(gt=fO()):(rl=Pe,Mw="value"in rl?rl.value:rl.textContent,nd=!0)),mt=nv(pe,Ct),0<mt.length&&(Ct=new mO(Ct,c,null,y,Pe),Oe.push({event:Ct,listeners:mt}),gt?Ct.data=gt:(gt=wO(y),gt!==null&&(Ct.data=gt)))),(gt=vX?yX(c,y):bX(c,y))&&(pe=nv(pe,"onBeforeInput"),0<pe.length&&(Pe=new mO("onBeforeInput","beforeinput",null,y,Pe),Oe.push({event:Pe,listeners:pe}),Pe.data=gt))}VO(Oe,h)})}function Ph(c,h,y){return{instance:c,listener:h,currentTarget:y}}function nv(c,h){for(var y=h+"Capture",E=[];c!==null;){var T=c,O=T.stateNode;T.tag===5&&O!==null&&(T=O,O=pu(c,y),O!=null&&E.unshift(Ph(c,O,T)),O=pu(c,h),O!=null&&E.push(Ph(c,O,T))),c=c.return}return E}function sd(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function BO(c,h,y,E,T){for(var O=h._reactName,F=[];y!==null&&y!==E;){var K=y,J=K.alternate,pe=K.stateNode;if(J!==null&&J===E)break;K.tag===5&&pe!==null&&(K=pe,T?(J=pu(y,O),J!=null&&F.unshift(Ph(y,J,K))):T||(J=pu(y,O),J!=null&&F.push(Ph(y,J,K)))),y=y.return}F.length!==0&&c.push({event:h,listeners:F})}var AX=/\r\n?/g,MX=/\u0000|\uFFFD/g;function HO(c){return(typeof c=="string"?c:""+c).replace(AX,`
7`).replace(MX,"")}function rv(c,h,y){if(h=HO(h),HO(c)!==h&&y)throw Error(n(425))}function iv(){}var Qw=null,Xw=null;function Jw(c,h){return c==="textarea"||c==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var ex=typeof setTimeout=="function"?setTimeout:void 0,NX=typeof clearTimeout=="function"?clearTimeout:void 0,qO=typeof Promise=="function"?Promise:void 0,jX=typeof queueMicrotask=="function"?queueMicrotask:typeof qO<"u"?function(c){return qO.resolve(null).then(c).catch(LX)}:ex;function LX(c){setTimeout(function(){throw c})}function tx(c,h){var y=h,E=0;do{var T=y.nextSibling;if(c.removeChild(y),T&&T.nodeType===8)if(y=T.data,y==="/$"){if(E===0){c.removeChild(T),yh(h);return}E--}else y!=="$"&&y!=="$?"&&y!=="$!"||E++;y=T}while(y);yh(h)}function sl(c){for(;c!=null;c=c.nextSibling){var h=c.nodeType;if(h===1||h===3)break;if(h===8){if(h=c.data,h==="$"||h==="$!"||h==="$?")break;if(h==="/$")return null}}return c}function WO(c){c=c.previousSibling;for(var h=0;c;){if(c.nodeType===8){var y=c.data;if(y==="$"||y==="$!"||y==="$?"){if(h===0)return c;h--}else y==="/$"&&h++}c=c.previousSibling}return null}var od=Math.random().toString(36).slice(2),So="__reactFiber$"+od,Rh="__reactProps$"+od,sa="__reactContainer$"+od,nx="__reactEvents$"+od,FX="__reactListeners$"+od,$X="__reactHandles$"+od;function yu(c){var h=c[So];if(h)return h;for(var y=c.parentNode;y;){if(h=y[sa]||y[So]){if(y=h.alternate,h.child!==null||y!==null&&y.child!==null)for(c=WO(c);c!==null;){if(y=c[So])return y;c=WO(c)}return h}c=y,y=c.parentNode}return null}function Ih(c){return c=c[So]||c[sa],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function ad(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(n(33))}function sv(c){return c[Rh]||null}var rx=[],ld=-1;function ol(c){return{current:c}}function kn(c){0>ld||(c.current=rx[ld],rx[ld]=null,ld--)}function yn(c,h){ld++,rx[ld]=c.current,c.current=h}var al={},Ur=ol(al),Si=ol(!1),bu=al;function ud(c,h){var y=c.type.contextTypes;if(!y)return al;var E=c.stateNode;if(E&&E.__reactInternalMemoizedUnmaskedChildContext===h)return E.__reactInternalMemoizedMaskedChildContext;var T={},O;for(O in y)T[O]=h[O];return E&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=h,c.__reactInternalMemoizedMaskedChildContext=T),T}function Ei(c){return c=c.childContextTypes,c!=null}function ov(){kn(Si),kn(Ur)}function GO(c,h,y){if(Ur.current!==al)throw Error(n(168));
vendor: 4,671 bytes, line 7
7yn(Ur,h),yn(Si,y)}function KO(c,h,y){var E=c.stateNode;if(h=h.childContextTypes,typeof E.getChildContext!="function")return y;E=E.getChildContext();for(var T in E)if(!(T in h))throw Error(n(108,ae(c)||"Unknown",T));return M({},y,E)}function av(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||al,bu=Ur.current,yn(Ur,c),yn(Si,Si.current),!0}function ZO(c,h,y){var E=c.stateNode;if(!E)throw Error(n(169));y?(c=KO(c,h,bu),E.__reactInternalMemoizedMergedChildContext=c,kn(Si),kn(Ur),yn(Ur,c)):kn(Si),yn(Si,y)}var oa=null,lv=!1,ix=!1;function YO(c){oa===null?oa=[c]:oa.push(c)}function zX(c){lv=!0,YO(c)}function ll(){if(!ix&&oa!==null){ix=!0;var c=0,h=on;try{var y=oa;for(on=1;c<y.length;c++){var E=y[c];do E=E(!0);while(E!==null)}oa=null,lv=!1}catch(T){throw oa!==null&&(oa=oa.slice(c+1)),un(gu,ll),T}finally{on=h,ix=!1}}return null}var cd=[],dd=0,uv=null,cv=0,fs=[],hs=0,_u=null,aa=1,la="";function wu(c,h){cd[dd++]=cv,cd[dd++]=uv,uv=c,cv=h}function QO(c,h,y){fs[hs++]=aa,fs[hs++]=la,fs[hs++]=_u,_u=c;var E=aa;c=la;var T=32-mr(E)-1;E&=~(1<<T),y+=1;var O=32-mr(h)+T;if(30<O){var F=T-T%5;O=(E&(1<<F)-1).toString(32),E>>=F,T-=F,aa=1<<32-mr(h)+T|y<<T|E,la=O+c}else aa=1<<O|y<<T|E,la=c}function sx(c){c.return!==null&&(wu(c,1),QO(c,1,0))}function ox(c){for(;c===uv;)uv=cd[--dd],cd[dd]=null,cv=cd[--dd],cd[dd]=null;for(;c===_u;)_u=fs[--hs],fs[hs]=null,la=fs[--hs],fs[hs]=null,aa=fs[--hs],fs[hs]=null}var Hi=null,qi=null,In=!1,qs=null;function XO(c,h){var y=vs(5,null,null,0);y.elementType="DELETED",y.stateNode=h,y.return=c,h=c.deletions,h===null?(c.deletions=[y],c.flags|=16):h.push(y)}function JO(c,h){switch(c.tag){case 5:var y=c.type;return h=h.nodeType!==1||y.toLowerCase()!==h.nodeName.toLowerCase()?null:h,h!==null?(c.stateNode=h,Hi=c,qi=sl(h.firstChild),!0):!1;case 6:return h=c.pendingProps===""||h.nodeType!==3?null:h,h!==null?(c.stateNode=h,Hi=c,qi=null,!0):!1;case 13:return h=h.nodeType!==8?null:h,h!==null?(y=_u!==null?{id:aa,overflow:la}:null,c.memoizedState={dehydrated:h,treeContext:y,retryLane:1073741824},y=vs(18,null,null,0),y.stateNode=h,y.return=c,c.child=y,Hi=c,qi=null,!0):!1;default:return!1}}function ax(c){return(c.mode&1)!==0&&(c.flags&128)===0}function lx(c){if(In){var h=qi;if(h){var y=h;if(!JO(c,h)){if(ax(c))throw Error(n(418));h=sl(y.nextSibling);var E=Hi;h&&JO(c,h)?XO(E,y):(c.flags=c.flags&-4097|2,In=!1,Hi=c)}}else{if(ax(c))throw Error(n(418));c.flags=c.flags&-4097|2,In=!1,Hi=c}}}function eD(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;Hi=c}function dv(c){if(c!==Hi)return!1;if(!In)return eD(c),In=!0,!1;var h;if((h=c.tag!==3)&&!(h=c.tag!==5)&&(h=c.type,h=h!=="head"&&h!=="body"&&!Jw(c.type,c.memoizedProps)),h&&(h=qi)){if(ax(c))throw tD(),Error(n(418));for(;h;)XO(c,h),h=sl(h.nextSibling)}if(eD(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));e:{for(c=c.nextSibling,h=0;c;){if(c.nodeType===8){var y=c.data;if(y==="/$"){if(h===0){qi=sl(c.nextSibling);break e}h--}else y!=="$"&&y!=="$!"&&y!=="$?"||h++}c=c.nextSibling}qi=null}}else qi=Hi?sl(c.stateNode.nextSibling):null;return!0}function tD(){for(var c=qi;c;)c=sl(c.nextSibling)}function fd(){qi=Hi=null,In=!1}function ux(c){qs===null?qs=[c]:qs.push(c)}var VX=R.ReactCurrentBatchConfig;function Oh(c,h,y){if(c=y.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(y._owner){if(y=y._owner,y){if(y.tag!==1)throw Error(n(309));var E=y.stateNode}if(!E)throw Error(n(147,c));var T=E,O=""+c;return h!==null&&h.ref!==null&&typeof h.ref=="function"&&h.ref._stringRef===O?h.ref:(h=function(F){var K=T.refs;F===null?delete K[O]:K[O]=F},h._stringRef=O,h)}if(typeof c!="string")throw Error(n(284));if(!y._owner)throw Error(n(290,c))}return c}function fv(c,h){throw c=Object.prototype.toString.call(h),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":c))}function nD(c){var h=c._init;return h(c._payload)}function rD(c){function h(le,re){if(c){var de=le.deletions;de===null?(le.deletions=[re],le.flags|=16):de.push(re)}}function y(le,re){if(!c)return null;for(;re!==null;)h(le,re),re=re.sibling;return null}function E(le,re){for(le=new Map;re!==null;)re.key!==null?le.set(re.key,re):le.set(re.index,re),re=re.sibling;return le}function T(le,re){return le=gl(le,re),le.index=0,le.sibling=null,le}function O(le,re,de){return le.index=de,c?(de=le.alternate,de!==null?(de=de.index,de<re?(le.flags|=2,re):de):(le.flags|=2,re)):(le.flags|=1048576,re)}function F(le){return c&&le.alternate===null&&(le.flags|=2),le}function K(le,re,de,Ae){return re===null||re.tag!==6?(re=e1(de,le.mode,Ae),re.return=le,re):(re=T(re,de),re.return=le,re)}function J(le,re,de,Ae){var at=de.type;
vendor: 4,229 bytes, line 7
7return at===I?Pe(le,re,de.props.children,Ae,de.key):re!==null&&(re.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===te&&nD(at)===re.type)?(Ae=T(re,de.props),Ae.ref=Oh(le,re,de),Ae.return=le,Ae):(Ae=jv(de.type,de.key,de.props,null,le.mode,Ae),Ae.ref=Oh(le,re,de),Ae.return=le,Ae)}function pe(le,re,de,Ae){return re===null||re.tag!==4||re.stateNode.containerInfo!==de.containerInfo||re.stateNode.implementation!==de.implementation?(re=t1(de,le.mode,Ae),re.return=le,re):(re=T(re,de.children||[]),re.return=le,re)}function Pe(le,re,de,Ae,at){return re===null||re.tag!==7?(re=Ru(de,le.mode,Ae,at),re.return=le,re):(re=T(re,de),re.return=le,re)}function Oe(le,re,de){if(typeof re=="string"&&re!==""||typeof re=="number")return re=e1(""+re,le.mode,de),re.return=le,re;if(typeof re=="object"&&re!==null){switch(re.$$typeof){case P:return de=jv(re.type,re.key,re.props,null,le.mode,de),de.ref=Oh(le,null,re),de.return=le,de;case k:return re=t1(re,le.mode,de),re.return=le,re;case te:var Ae=re._init;return Oe(le,Ae(re._payload),de)}if(ue(re)||Y(re))return re=Ru(re,le.mode,de,null),re.return=le,re;fv(le,re)}return null}function Te(le,re,de,Ae){var at=re!==null?re.key:null;if(typeof de=="string"&&de!==""||typeof de=="number")return at!==null?null:K(le,re,""+de,Ae);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case P:return de.key===at?J(le,re,de,Ae):null;case k:return de.key===at?pe(le,re,de,Ae):null;case te:return at=de._init,Te(le,re,at(de._payload),Ae)}if(ue(de)||Y(de))return at!==null?null:Pe(le,re,de,Ae,null);fv(le,de)}return null}function He(le,re,de,Ae,at){if(typeof Ae=="string"&&Ae!==""||typeof Ae=="number")return le=le.get(de)||null,K(re,le,""+Ae,at);if(typeof Ae=="object"&&Ae!==null){switch(Ae.$$typeof){case P:return le=le.get(Ae.key===null?de:Ae.key)||null,J(re,le,Ae,at);case k:return le=le.get(Ae.key===null?de:Ae.key)||null,pe(re,le,Ae,at);case te:var mt=Ae._init;return He(le,re,de,mt(Ae._payload),at)}if(ue(Ae)||Y(Ae))return le=le.get(de)||null,Pe(re,le,Ae,at,null);fv(re,Ae)}return null}function Xe(le,re,de,Ae){for(var at=null,mt=null,gt=re,Ct=re=0,Tr=null;gt!==null&&Ct<de.length;Ct++){gt.index>Ct?(Tr=gt,gt=null):Tr=gt.sibling;var Xt=Te(le,gt,de[Ct],Ae);if(Xt===null){gt===null&&(gt=Tr);break}c&&gt&&Xt.alternate===null&&h(le,gt),re=O(Xt,re,Ct),mt===null?at=Xt:mt.sibling=Xt,mt=Xt,gt=Tr}if(Ct===de.length)return y(le,gt),In&&wu(le,Ct),at;if(gt===null){for(;Ct<de.length;Ct++)gt=Oe(le,de[Ct],Ae),gt!==null&&(re=O(gt,re,Ct),mt===null?at=gt:mt.sibling=gt,mt=gt);return In&&wu(le,Ct),at}for(gt=E(le,gt);Ct<de.length;Ct++)Tr=He(gt,le,Ct,de[Ct],Ae),Tr!==null&&(c&&Tr.alternate!==null&&gt.delete(Tr.key===null?Ct:Tr.key),re=O(Tr,re,Ct),mt===null?at=Tr:mt.sibling=Tr,mt=Tr);return c&&gt.forEach(function(vl){return h(le,vl)}),In&&wu(le,Ct),at}function nt(le,re,de,Ae){var at=Y(de);if(typeof at!="function")throw Error(n(150));if(de=at.call(de),de==null)throw Error(n(151));for(var mt=at=null,gt=re,Ct=re=0,Tr=null,Xt=de.next();gt!==null&&!Xt.done;Ct++,Xt=de.next()){gt.index>Ct?(Tr=gt,gt=null):Tr=gt.sibling;var vl=Te(le,gt,Xt.value,Ae);if(vl===null){gt===null&&(gt=Tr);break}c&&gt&&vl.alternate===null&&h(le,gt),re=O(vl,re,Ct),mt===null?at=vl:mt.sibling=vl,mt=vl,gt=Tr}if(Xt.done)return y(le,gt),In&&wu(le,Ct),at;if(gt===null){for(;!Xt.done;Ct++,Xt=de.next())Xt=Oe(le,Xt.value,Ae),Xt!==null&&(re=O(Xt,re,Ct),mt===null?at=Xt:mt.sibling=Xt,mt=Xt);return In&&wu(le,Ct),at}for(gt=E(le,gt);!Xt.done;Ct++,Xt=de.next())Xt=He(gt,le,Ct,Xt.value,Ae),Xt!==null&&(c&&Xt.alternate!==null&&gt.delete(Xt.key===null?Ct:Xt.key),re=O(Xt,re,Ct),mt===null?at=Xt:mt.sibling=Xt,mt=Xt);return c&&gt.forEach(function(_J){return h(le,_J)}),In&&wu(le,Ct),at}function Jn(le,re,de,Ae){if(typeof de=="object"&&de!==null&&de.type===I&&de.key===null&&(de=de.props.children),typeof de=="object"&&de!==null){switch(de.$$typeof){case P:e:{for(var at=de.key,mt=re;mt!==null;){if(mt.key===at){if(at=de.type,at===I){if(mt.tag===7){y(le,mt.sibling),re=T(mt,de.props.children),re.return=le,le=re;break e}}else if(mt.elementType===at||typeof at=="object"&&at!==null&&at.$$typeof===te&&nD(at)===mt.type){y(le,mt.sibling),re=T(mt,de.props),re.ref=Oh(le,mt,de),re.return=le,le=re;break e}y(le,mt);break}else h(le,mt);mt=mt.sibling}
vendor: 5,829 bytes, line 7
7de.type===I?(re=Ru(de.props.children,le.mode,Ae,de.key),re.return=le,le=re):(Ae=jv(de.type,de.key,de.props,null,le.mode,Ae),Ae.ref=Oh(le,re,de),Ae.return=le,le=Ae)}return F(le);case k:e:{for(mt=de.key;re!==null;){if(re.key===mt)if(re.tag===4&&re.stateNode.containerInfo===de.containerInfo&&re.stateNode.implementation===de.implementation){y(le,re.sibling),re=T(re,de.children||[]),re.return=le,le=re;break e}else{y(le,re);break}else h(le,re);re=re.sibling}re=t1(de,le.mode,Ae),re.return=le,le=re}return F(le);case te:return mt=de._init,Jn(le,re,mt(de._payload),Ae)}if(ue(de))return Xe(le,re,de,Ae);if(Y(de))return nt(le,re,de,Ae);fv(le,de)}return typeof de=="string"&&de!==""||typeof de=="number"?(de=""+de,re!==null&&re.tag===6?(y(le,re.sibling),re=T(re,de),re.return=le,le=re):(y(le,re),re=e1(de,le.mode,Ae),re.return=le,le=re),F(le)):y(le,re)}return Jn}var hd=rD(!0),iD=rD(!1),hv=ol(null),pv=null,pd=null,cx=null;function dx(){cx=pd=pv=null}function fx(c){var h=hv.current;kn(hv),c._currentValue=h}function hx(c,h,y){for(;c!==null;){var E=c.alternate;if((c.childLanes&h)!==h?(c.childLanes|=h,E!==null&&(E.childLanes|=h)):E!==null&&(E.childLanes&h)!==h&&(E.childLanes|=h),c===y)break;c=c.return}}function md(c,h){pv=c,cx=pd=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&h)!==0&&(Ci=!0),c.firstContext=null)}function ps(c){var h=c._currentValue;if(cx!==c)if(c={context:c,memoizedValue:h,next:null},pd===null){if(pv===null)throw Error(n(308));pd=c,pv.dependencies={lanes:0,firstContext:c}}else pd=pd.next=c;return h}var xu=null;function px(c){xu===null?xu=[c]:xu.push(c)}function sD(c,h,y,E){var T=h.interleaved;return T===null?(y.next=y,px(h)):(y.next=T.next,T.next=y),h.interleaved=y,ua(c,E)}function ua(c,h){c.lanes|=h;var y=c.alternate;for(y!==null&&(y.lanes|=h),y=c,c=c.return;c!==null;)c.childLanes|=h,y=c.alternate,y!==null&&(y.childLanes|=h),y=c,c=c.return;return y.tag===3?y.stateNode:null}var ul=!1;function mx(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oD(c,h){c=c.updateQueue,h.updateQueue===c&&(h.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function ca(c,h){return{eventTime:c,lane:h,tag:0,payload:null,callback:null,next:null}}function cl(c,h,y){var E=c.updateQueue;if(E===null)return null;if(E=E.shared,(Zt&2)!==0){var T=E.pending;return T===null?h.next=h:(h.next=T.next,T.next=h),E.pending=h,ua(c,y)}return T=E.interleaved,T===null?(h.next=h,px(E)):(h.next=T.next,T.next=h),E.interleaved=h,ua(c,y)}function mv(c,h,y){if(h=h.updateQueue,h!==null&&(h=h.shared,(y&4194240)!==0)){var E=h.lanes;E&=c.pendingLanes,y|=E,h.lanes=y,Rw(c,y)}}function aD(c,h){var y=c.updateQueue,E=c.alternate;if(E!==null&&(E=E.updateQueue,y===E)){var T=null,O=null;if(y=y.firstBaseUpdate,y!==null){do{var F={eventTime:y.eventTime,lane:y.lane,tag:y.tag,payload:y.payload,callback:y.callback,next:null};O===null?T=O=F:O=O.next=F,y=y.next}while(y!==null);O===null?T=O=h:O=O.next=h}else T=O=h;y={baseState:E.baseState,firstBaseUpdate:T,lastBaseUpdate:O,shared:E.shared,effects:E.effects},c.updateQueue=y;return}c=y.lastBaseUpdate,c===null?y.firstBaseUpdate=h:c.next=h,y.lastBaseUpdate=h}function gv(c,h,y,E){var T=c.updateQueue;ul=!1;var O=T.firstBaseUpdate,F=T.lastBaseUpdate,K=T.shared.pending;if(K!==null){T.shared.pending=null;var J=K,pe=J.next;J.next=null,F===null?O=pe:F.next=pe,F=J;var Pe=c.alternate;Pe!==null&&(Pe=Pe.updateQueue,K=Pe.lastBaseUpdate,K!==F&&(K===null?Pe.firstBaseUpdate=pe:K.next=pe,Pe.lastBaseUpdate=J))}if(O!==null){var Oe=T.baseState;F=0,Pe=pe=J=null,K=O;do{var Te=K.lane,He=K.eventTime;if((E&Te)===Te){Pe!==null&&(Pe=Pe.next={eventTime:He,lane:0,tag:K.tag,payload:K.payload,callback:K.callback,next:null});e:{var Xe=c,nt=K;switch(Te=h,He=y,nt.tag){case 1:if(Xe=nt.payload,typeof Xe=="function"){Oe=Xe.call(He,Oe,Te);break e}Oe=Xe;break e;case 3:Xe.flags=Xe.flags&-65537|128;case 0:if(Xe=nt.payload,Te=typeof Xe=="function"?Xe.call(He,Oe,Te):Xe,Te==null)break e;Oe=M({},Oe,Te);break e;case 2:ul=!0}}K.callback!==null&&K.lane!==0&&(c.flags|=64,Te=T.effects,Te===null?T.effects=[K]:Te.push(K))}else He={eventTime:He,lane:Te,tag:K.tag,payload:K.payload,callback:K.callback,next:null},Pe===null?(pe=Pe=He,J=Oe):Pe=Pe.next=He,F|=Te;if(K=K.next,K===null){if(K=T.shared.pending,K===null)break;Te=K,K=Te.next,Te.next=null,T.lastBaseUpdate=Te,T.shared.pending=null}}while(!0);if(Pe===null&&(J=Oe),T.baseState=J,T.firstBaseUpdate=pe,T.lastBaseUpdate=Pe,h=T.shared.interleaved,h!==null){T=h;do F|=T.lane,T=T.next;while(T!==h)}else O===null&&(T.shared.lanes=0);Cu|=F,c.lanes=F,c.memoizedState=Oe}}function lD(c,h,y){if(c=h.effects,h.effects=null,c!==null)for(h=0;h<c.length;h++){var E=c[h],T=E.callback;if(T!==null){if(E.callback=null,E=y,typeof T!="function")throw Error(n(191,T));T.call(E)}}}var Dh={},Eo=ol(Dh),Ah=ol(Dh),Mh=ol(Dh);function Su(c){if(c===Dh)throw Error(n(174));return c}function gx(c,h){switch(yn(Mh,h),yn(Ah,c),yn(Eo,Dh),c=h.nodeType,c){case 9:case 11:h=(h=h.documentElement)?h.namespaceURI:we(null,"");break;default:c=c===8?h.parentNode:h,h=c.namespaceURI||null,c=c.tagName,h=we(h,c)}kn(Eo),yn(Eo,h)}function gd(){kn(Eo),kn(Ah),kn(Mh)}function uD(c){Su(Mh.current);var h=Su(Eo.current),y=we(h,c.type);h!==y&&(yn(Ah,c),yn(Eo,y))}function vx(c){Ah.current===c&&(kn(Eo),kn(Ah))}var Nn=ol(0);function vv(c){for(var h=c;h!==null;){if(h.tag===13){var y=h.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||y.data==="$?"||y.data==="$!"))return h}else if(h.tag===19&&h.memoizedProps.revealOrder!==void 0){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return null;h=h.return}
vendor: 7,202 bytes, line 7
7h.sibling.return=h.return,h=h.sibling}return null}var yx=[];function bx(){for(var c=0;c<yx.length;c++)yx[c]._workInProgressVersionPrimary=null;yx.length=0}var yv=R.ReactCurrentDispatcher,_x=R.ReactCurrentBatchConfig,Eu=0,jn=null,gr=null,Cr=null,bv=!1,Nh=!1,jh=0,UX=0;function Br(){throw Error(n(321))}function wx(c,h){if(h===null)return!1;for(var y=0;y<h.length&&y<c.length;y++)if(!Hs(c[y],h[y]))return!1;return!0}function xx(c,h,y,E,T,O){if(Eu=O,jn=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,yv.current=c===null||c.memoizedState===null?WX:GX,c=y(E,T),Nh){O=0;do{if(Nh=!1,jh=0,25<=O)throw Error(n(301));O+=1,Cr=gr=null,h.updateQueue=null,yv.current=KX,c=y(E,T)}while(Nh)}if(yv.current=xv,h=gr!==null&&gr.next!==null,Eu=0,Cr=gr=jn=null,bv=!1,h)throw Error(n(300));return c}function Sx(){var c=jh!==0;return jh=0,c}function Co(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Cr===null?jn.memoizedState=Cr=c:Cr=Cr.next=c,Cr}function ms(){if(gr===null){var c=jn.alternate;c=c!==null?c.memoizedState:null}else c=gr.next;var h=Cr===null?jn.memoizedState:Cr.next;if(h!==null)Cr=h,gr=c;else{if(c===null)throw Error(n(310));gr=c,c={memoizedState:gr.memoizedState,baseState:gr.baseState,baseQueue:gr.baseQueue,queue:gr.queue,next:null},Cr===null?jn.memoizedState=Cr=c:Cr=Cr.next=c}return Cr}function Lh(c,h){return typeof h=="function"?h(c):h}function Ex(c){var h=ms(),y=h.queue;if(y===null)throw Error(n(311));y.lastRenderedReducer=c;var E=gr,T=E.baseQueue,O=y.pending;if(O!==null){if(T!==null){var F=T.next;T.next=O.next,O.next=F}E.baseQueue=T=O,y.pending=null}if(T!==null){O=T.next,E=E.baseState;var K=F=null,J=null,pe=O;do{var Pe=pe.lane;if((Eu&Pe)===Pe)J!==null&&(J=J.next={lane:0,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null}),E=pe.hasEagerState?pe.eagerState:c(E,pe.action);else{var Oe={lane:Pe,action:pe.action,hasEagerState:pe.hasEagerState,eagerState:pe.eagerState,next:null};J===null?(K=J=Oe,F=E):J=J.next=Oe,jn.lanes|=Pe,Cu|=Pe}pe=pe.next}while(pe!==null&&pe!==O);J===null?F=E:J.next=K,Hs(E,h.memoizedState)||(Ci=!0),h.memoizedState=E,h.baseState=F,h.baseQueue=J,y.lastRenderedState=E}if(c=y.interleaved,c!==null){T=c;do O=T.lane,jn.lanes|=O,Cu|=O,T=T.next;while(T!==c)}else T===null&&(y.lanes=0);return[h.memoizedState,y.dispatch]}function Cx(c){var h=ms(),y=h.queue;if(y===null)throw Error(n(311));y.lastRenderedReducer=c;var E=y.dispatch,T=y.pending,O=h.memoizedState;if(T!==null){y.pending=null;var F=T=T.next;do O=c(O,F.action),F=F.next;while(F!==T);Hs(O,h.memoizedState)||(Ci=!0),h.memoizedState=O,h.baseQueue===null&&(h.baseState=O),y.lastRenderedState=O}return[O,E]}function cD(){}function dD(c,h){var y=jn,E=ms(),T=h(),O=!Hs(E.memoizedState,T);if(O&&(E.memoizedState=T,Ci=!0),E=E.queue,kx(pD.bind(null,y,E,c),[c]),E.getSnapshot!==h||O||Cr!==null&&Cr.memoizedState.tag&1){if(y.flags|=2048,Fh(9,hD.bind(null,y,E,T,h),void 0,null),kr===null)throw Error(n(349));(Eu&30)!==0||fD(y,h,T)}return T}function fD(c,h,y){c.flags|=16384,c={getSnapshot:h,value:y},h=jn.updateQueue,h===null?(h={lastEffect:null,stores:null},jn.updateQueue=h,h.stores=[c]):(y=h.stores,y===null?h.stores=[c]:y.push(c))}function hD(c,h,y,E){h.value=y,h.getSnapshot=E,mD(h)&&gD(c)}function pD(c,h,y){return y(function(){mD(h)&&gD(c)})}function mD(c){var h=c.getSnapshot;c=c.value;try{var y=h();return!Hs(c,y)}catch{return!0}}function gD(c){var h=ua(c,1);h!==null&&Zs(h,c,1,-1)}function vD(c){var h=Co();return typeof c=="function"&&(c=c()),h.memoizedState=h.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Lh,lastRenderedState:c},h.queue=c,c=c.dispatch=qX.bind(null,jn,c),[h.memoizedState,c]}function Fh(c,h,y,E){return c={tag:c,create:h,destroy:y,deps:E,next:null},h=jn.updateQueue,h===null?(h={lastEffect:null,stores:null},jn.updateQueue=h,h.lastEffect=c.next=c):(y=h.lastEffect,y===null?h.lastEffect=c.next=c:(E=y.next,y.next=c,c.next=E,h.lastEffect=c)),c}function yD(){return ms().memoizedState}function _v(c,h,y,E){var T=Co();jn.flags|=c,T.memoizedState=Fh(1|h,y,void 0,E===void 0?null:E)}function wv(c,h,y,E){var T=ms();E=E===void 0?null:E;var O=void 0;if(gr!==null){var F=gr.memoizedState;if(O=F.destroy,E!==null&&wx(E,F.deps)){T.memoizedState=Fh(h,y,O,E);return}}jn.flags|=c,T.memoizedState=Fh(1|h,y,O,E)}function bD(c,h){return _v(8390656,8,c,h)}function kx(c,h){return wv(2048,8,c,h)}function _D(c,h){return wv(4,2,c,h)}function wD(c,h){return wv(4,4,c,h)}function xD(c,h){if(typeof h=="function")return c=c(),h(c),function(){h(null)};if(h!=null)return c=c(),h.current=c,function(){h.current=null}}function SD(c,h,y){return y=y!=null?y.concat([c]):null,wv(4,4,xD.bind(null,h,c),y)}function Tx(){}function ED(c,h){var y=ms();h=h===void 0?null:h;var E=y.memoizedState;return E!==null&&h!==null&&wx(h,E[1])?E[0]:(y.memoizedState=[c,h],c)}function CD(c,h){var y=ms();h=h===void 0?null:h;var E=y.memoizedState;return E!==null&&h!==null&&wx(h,E[1])?E[0]:(c=c(),y.memoizedState=[c,h],c)}function kD(c,h,y){return(Eu&21)===0?(c.baseState&&(c.baseState=!1,Ci=!0),c.memoizedState=y):(Hs(y,h)||(y=nO(),jn.lanes|=y,Cu|=y,c.baseState=!0),h)}function BX(c,h){var y=on;on=y!==0&&4>y?y:4,c(!0);var E=_x.transition;_x.transition={};try{c(!1),h()}finally{on=y,_x.transition=E}}function TD(){return ms().memoizedState}function HX(c,h,y){var E=pl(c);if(y={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null},PD(c))RD(h,y);else if(y=sD(c,h,y,E),y!==null){var T=ri();Zs(y,c,E,T),ID(y,h,E)}}function qX(c,h,y){var E=pl(c),T={lane:E,action:y,hasEagerState:!1,eagerState:null,next:null};if(PD(c))RD(h,T);else{var O=c.alternate;if(c.lanes===0&&(O===null||O.lanes===0)&&(O=h.lastRenderedReducer,O!==null))try{var F=h.lastRenderedState,K=O(F,y);if(T.hasEagerState=!0,T.eagerState=K,Hs(K,F)){var J=h.interleaved;J===null?(T.next=T,px(h)):(T.next=J.next,J.next=T),h.interleaved=T;return}}catch{}finally{}y=sD(c,h,T,E),y!==null&&(T=ri(),Zs(y,c,E,T),ID(y,h,E))}}function PD(c){var h=c.alternate;return c===jn||h!==null&&h===jn}function RD(c,h){Nh=bv=!0;var y=c.pending;y===null?h.next=h:(h.next=y.next,y.next=h),c.pending=h}function ID(c,h,y){if((y&4194240)!==0){var E=h.lanes;E&=c.pendingLanes,y|=E,h.lanes=y,Rw(c,y)}}var xv={readContext:ps,useCallback:Br,useContext:Br,useEffect:Br,useImperativeHandle:Br,useInsertionEffect:Br,useLayoutEffect:Br,useMemo:Br,useReducer:Br,useRef:Br,useState:Br,useDebugValue:Br,useDeferredValue:Br,useTransition:Br,useMutableSource:Br,useSyncExternalStore:Br,useId:Br,unstable_isNewReconciler:!1},WX={readContext:ps,useCallback:function(c,h){return Co().memoizedState=[c,h===void 0?null:h],c},useContext:ps,useEffect:bD,useImperativeHandle:function(c,h,y){return y=y!=null?y.concat([c]):null,_v(4194308,4,xD.bind(null,h,c),y)},useLayoutEffect:function(c,h){return _v(4194308,4,c,h)},useInsertionEffect:function(c,h){return _v(4,2,c,h)},useMemo:function(c,h){var y=Co();return h=h===void 0?null:h,c=c(),y.memoizedState=[c,h],c},useReducer:function(c,h,y){var E=Co();return h=y!==void 0?y(h):h,E.memoizedState=E.baseState=h,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:h},E.queue=c,c=c.dispatch=HX.bind(null,jn,c),[E.memoizedState,c]}
vendor: 4,712 bytes, lines 7-9
7,useRef:function(c){var h=Co();return c={current:c},h.memoizedState=c},useState:vD,useDebugValue:Tx,useDeferredValue:function(c){return Co().memoizedState=c},useTransition:function(){var c=vD(!1),h=c[0];return c=BX.bind(null,c[1]),Co().memoizedState=c,[h,c]},useMutableSource:function(){},useSyncExternalStore:function(c,h,y){var E=jn,T=Co();if(In){if(y===void 0)throw Error(n(407));y=y()}else{if(y=h(),kr===null)throw Error(n(349));(Eu&30)!==0||fD(E,h,y)}T.memoizedState=y;var O={value:y,getSnapshot:h};return T.queue=O,bD(pD.bind(null,E,O,c),[c]),E.flags|=2048,Fh(9,hD.bind(null,E,O,y,h),void 0,null),y},useId:function(){var c=Co(),h=kr.identifierPrefix;if(In){var y=la,E=aa;y=(E&~(1<<32-mr(E)-1)).toString(32)+y,h=":"+h+"R"+y,y=jh++,0<y&&(h+="H"+y.toString(32)),h+=":"}else y=UX++,h=":"+h+"r"+y.toString(32)+":";return c.memoizedState=h},unstable_isNewReconciler:!1},GX={readContext:ps,useCallback:ED,useContext:ps,useEffect:kx,useImperativeHandle:SD,useInsertionEffect:_D,useLayoutEffect:wD,useMemo:CD,useReducer:Ex,useRef:yD,useState:function(){return Ex(Lh)},useDebugValue:Tx,useDeferredValue:function(c){var h=ms();return kD(h,gr.memoizedState,c)},useTransition:function(){var c=Ex(Lh)[0],h=ms().memoizedState;return[c,h]},useMutableSource:cD,useSyncExternalStore:dD,useId:TD,unstable_isNewReconciler:!1},KX={readContext:ps,useCallback:ED,useContext:ps,useEffect:kx,useImperativeHandle:SD,useInsertionEffect:_D,useLayoutEffect:wD,useMemo:CD,useReducer:Cx,useRef:yD,useState:function(){return Cx(Lh)},useDebugValue:Tx,useDeferredValue:function(c){var h=ms();return gr===null?h.memoizedState=c:kD(h,gr.memoizedState,c)},useTransition:function(){var c=Cx(Lh)[0],h=ms().memoizedState;return[c,h]},useMutableSource:cD,useSyncExternalStore:dD,useId:TD,unstable_isNewReconciler:!1};function Ws(c,h){if(c&&c.defaultProps){h=M({},h),c=c.defaultProps;for(var y in c)h[y]===void 0&&(h[y]=c[y]);return h}return h}function Px(c,h,y,E){h=c.memoizedState,y=y(E,h),y=y==null?h:M({},h,y),c.memoizedState=y,c.lanes===0&&(c.updateQueue.baseState=y)}var Sv={isMounted:function(c){return(c=c._reactInternals)?tt(c)===c:!1},enqueueSetState:function(c,h,y){c=c._reactInternals;var E=ri(),T=pl(c),O=ca(E,T);O.payload=h,y!=null&&(O.callback=y),h=cl(c,O,T),h!==null&&(Zs(h,c,T,E),mv(h,c,T))},enqueueReplaceState:function(c,h,y){c=c._reactInternals;var E=ri(),T=pl(c),O=ca(E,T);O.tag=1,O.payload=h,y!=null&&(O.callback=y),h=cl(c,O,T),h!==null&&(Zs(h,c,T,E),mv(h,c,T))},enqueueForceUpdate:function(c,h){c=c._reactInternals;var y=ri(),E=pl(c),T=ca(y,E);T.tag=2,h!=null&&(T.callback=h),h=cl(c,T,E),h!==null&&(Zs(h,c,E,y),mv(h,c,E))}};function OD(c,h,y,E,T,O,F){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(E,O,F):h.prototype&&h.prototype.isPureReactComponent?!Eh(y,E)||!Eh(T,O):!0}function DD(c,h,y){var E=!1,T=al,O=h.contextType;return typeof O=="object"&&O!==null?O=ps(O):(T=Ei(h)?bu:Ur.current,E=h.contextTypes,O=(E=E!=null)?ud(c,T):al),h=new h(y,O),c.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Sv,c.stateNode=h,h._reactInternals=c,E&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=T,c.__reactInternalMemoizedMaskedChildContext=O),h}function AD(c,h,y,E){c=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(y,E),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(y,E),h.state!==c&&Sv.enqueueReplaceState(h,h.state,null)}function Rx(c,h,y,E){var T=c.stateNode;T.props=y,T.state=c.memoizedState,T.refs={},mx(c);var O=h.contextType;typeof O=="object"&&O!==null?T.context=ps(O):(O=Ei(h)?bu:Ur.current,T.context=ud(c,O)),T.state=c.memoizedState,O=h.getDerivedStateFromProps,typeof O=="function"&&(Px(c,h,O,y),T.state=c.memoizedState),typeof h.getDerivedStateFromProps=="function"||typeof T.getSnapshotBeforeUpdate=="function"||typeof T.UNSAFE_componentWillMount!="function"&&typeof T.componentWillMount!="function"||(h=T.state,typeof T.componentWillMount=="function"&&T.componentWillMount(),typeof T.UNSAFE_componentWillMount=="function"&&T.UNSAFE_componentWillMount(),h!==T.state&&Sv.enqueueReplaceState(T,T.state,null),gv(c,y,T,E),T.state=c.memoizedState),typeof T.componentDidMount=="function"&&(c.flags|=4194308)}function vd(c,h){try{var y="",E=h;do y+=X(E),E=E.return;while(E);var T=y}catch(O){T=`
8Error generating stack: `+O.message+`
9`+O.stack}return{value:c,source:h,stack:T,digest:null}}function Ix(c,h,y){return{value:c,source:null,stack:y??null,digest:h??null}}function Ox(c,h){try{console.error(h.value)}catch(y){setTimeout(function(){throw y})}}var ZX=typeof WeakMap=="function"?WeakMap:Map;function MD(c,h,y){y=ca(-1,y),y.tag=3,y.payload={element:null};var E=h.value;
vendor: 9,771 bytes, line 9
9return y.callback=function(){Iv||(Iv=!0,Wx=E),Ox(c,h)},y}function ND(c,h,y){y=ca(-1,y),y.tag=3;var E=c.type.getDerivedStateFromError;if(typeof E=="function"){var T=h.value;y.payload=function(){return E(T)},y.callback=function(){Ox(c,h)}}var O=c.stateNode;return O!==null&&typeof O.componentDidCatch=="function"&&(y.callback=function(){Ox(c,h),typeof E!="function"&&(fl===null?fl=new Set([this]):fl.add(this));var F=h.stack;this.componentDidCatch(h.value,{componentStack:F!==null?F:""})}),y}function jD(c,h,y){var E=c.pingCache;if(E===null){E=c.pingCache=new ZX;var T=new Set;E.set(h,T)}else T=E.get(h),T===void 0&&(T=new Set,E.set(h,T));T.has(y)||(T.add(y),c=uJ.bind(null,c,h,y),h.then(c,c))}function LD(c){do{var h;if((h=c.tag===13)&&(h=c.memoizedState,h=h!==null?h.dehydrated!==null:!0),h)return c;c=c.return}while(c!==null);return null}function FD(c,h,y,E,T){return(c.mode&1)===0?(c===h?c.flags|=65536:(c.flags|=128,y.flags|=131072,y.flags&=-52805,y.tag===1&&(y.alternate===null?y.tag=17:(h=ca(-1,1),h.tag=2,cl(y,h,1))),y.lanes|=1),c):(c.flags|=65536,c.lanes=T,c)}var YX=R.ReactCurrentOwner,Ci=!1;function ni(c,h,y,E){h.child=c===null?iD(h,null,y,E):hd(h,c.child,y,E)}function $D(c,h,y,E,T){y=y.render;var O=h.ref;return md(h,T),E=xx(c,h,y,E,O,T),y=Sx(),c!==null&&!Ci?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~T,da(c,h,T)):(In&&y&&sx(h),h.flags|=1,ni(c,h,E,T),h.child)}function zD(c,h,y,E,T){if(c===null){var O=y.type;return typeof O=="function"&&!Jx(O)&&O.defaultProps===void 0&&y.compare===null&&y.defaultProps===void 0?(h.tag=15,h.type=O,VD(c,h,O,E,T)):(c=jv(y.type,null,E,h,h.mode,T),c.ref=h.ref,c.return=h,h.child=c)}if(O=c.child,(c.lanes&T)===0){var F=O.memoizedProps;if(y=y.compare,y=y!==null?y:Eh,y(F,E)&&c.ref===h.ref)return da(c,h,T)}return h.flags|=1,c=gl(O,E),c.ref=h.ref,c.return=h,h.child=c}function VD(c,h,y,E,T){if(c!==null){var O=c.memoizedProps;if(Eh(O,E)&&c.ref===h.ref)if(Ci=!1,h.pendingProps=E=O,(c.lanes&T)!==0)(c.flags&131072)!==0&&(Ci=!0);else return h.lanes=c.lanes,da(c,h,T)}return Dx(c,h,y,E,T)}function UD(c,h,y){var E=h.pendingProps,T=E.children,O=c!==null?c.memoizedState:null;if(E.mode==="hidden")if((h.mode&1)===0)h.memoizedState={baseLanes:0,cachePool:null,transitions:null},yn(bd,Wi),Wi|=y;else{if((y&1073741824)===0)return c=O!==null?O.baseLanes|y:y,h.lanes=h.childLanes=1073741824,h.memoizedState={baseLanes:c,cachePool:null,transitions:null},h.updateQueue=null,yn(bd,Wi),Wi|=c,null;h.memoizedState={baseLanes:0,cachePool:null,transitions:null},E=O!==null?O.baseLanes:y,yn(bd,Wi),Wi|=E}else O!==null?(E=O.baseLanes|y,h.memoizedState=null):E=y,yn(bd,Wi),Wi|=E;return ni(c,h,T,y),h.child}function BD(c,h){var y=h.ref;(c===null&&y!==null||c!==null&&c.ref!==y)&&(h.flags|=512,h.flags|=2097152)}function Dx(c,h,y,E,T){var O=Ei(y)?bu:Ur.current;return O=ud(h,O),md(h,T),y=xx(c,h,y,E,O,T),E=Sx(),c!==null&&!Ci?(h.updateQueue=c.updateQueue,h.flags&=-2053,c.lanes&=~T,da(c,h,T)):(In&&E&&sx(h),h.flags|=1,ni(c,h,y,T),h.child)}function HD(c,h,y,E,T){if(Ei(y)){var O=!0;av(h)}else O=!1;if(md(h,T),h.stateNode===null)Cv(c,h),DD(h,y,E),Rx(h,y,E,T),E=!0;else if(c===null){var F=h.stateNode,K=h.memoizedProps;F.props=K;var J=F.context,pe=y.contextType;typeof pe=="object"&&pe!==null?pe=ps(pe):(pe=Ei(y)?bu:Ur.current,pe=ud(h,pe));var Pe=y.getDerivedStateFromProps,Oe=typeof Pe=="function"||typeof F.getSnapshotBeforeUpdate=="function";Oe||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(K!==E||J!==pe)&&AD(h,F,E,pe),ul=!1;var Te=h.memoizedState;F.state=Te,gv(h,E,F,T),J=h.memoizedState,K!==E||Te!==J||Si.current||ul?(typeof Pe=="function"&&(Px(h,y,Pe,E),J=h.memoizedState),(K=ul||OD(h,y,K,E,Te,J,pe))?(Oe||typeof F.UNSAFE_componentWillMount!="function"&&typeof F.componentWillMount!="function"||(typeof F.componentWillMount=="function"&&F.componentWillMount(),typeof F.UNSAFE_componentWillMount=="function"&&F.UNSAFE_componentWillMount()),typeof F.componentDidMount=="function"&&(h.flags|=4194308)):(typeof F.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=E,h.memoizedState=J),F.props=E,F.state=J,F.context=pe,E=K):(typeof F.componentDidMount=="function"&&(h.flags|=4194308),E=!1)}else{F=h.stateNode,oD(c,h),K=h.memoizedProps,pe=h.type===h.elementType?K:Ws(h.type,K),F.props=pe,Oe=h.pendingProps,Te=F.context,J=y.contextType,typeof J=="object"&&J!==null?J=ps(J):(J=Ei(y)?bu:Ur.current,J=ud(h,J));var He=y.getDerivedStateFromProps;(Pe=typeof He=="function"||typeof F.getSnapshotBeforeUpdate=="function")||typeof F.UNSAFE_componentWillReceiveProps!="function"&&typeof F.componentWillReceiveProps!="function"||(K!==Oe||Te!==J)&&AD(h,F,E,J),ul=!1,Te=h.memoizedState,F.state=Te,gv(h,E,F,T);var Xe=h.memoizedState;K!==Oe||Te!==Xe||Si.current||ul?(typeof He=="function"&&(Px(h,y,He,E),Xe=h.memoizedState),(pe=ul||OD(h,y,pe,E,Te,Xe,J)||!1)?(Pe||typeof F.UNSAFE_componentWillUpdate!="function"&&typeof F.componentWillUpdate!="function"||(typeof F.componentWillUpdate=="function"&&F.componentWillUpdate(E,Xe,J),typeof F.UNSAFE_componentWillUpdate=="function"&&F.UNSAFE_componentWillUpdate(E,Xe,J)),typeof F.componentDidUpdate=="function"&&(h.flags|=4),typeof F.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof F.componentDidUpdate!="function"||K===c.memoizedProps&&Te===c.memoizedState||(h.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||K===c.memoizedProps&&Te===c.memoizedState||(h.flags|=1024),h.memoizedProps=E,h.memoizedState=Xe),F.props=E,F.state=Xe,F.context=J,E=pe):(typeof F.componentDidUpdate!="function"||K===c.memoizedProps&&Te===c.memoizedState||(h.flags|=4),typeof F.getSnapshotBeforeUpdate!="function"||K===c.memoizedProps&&Te===c.memoizedState||(h.flags|=1024),E=!1)}return Ax(c,h,y,E,O,T)}function Ax(c,h,y,E,T,O){BD(c,h);var F=(h.flags&128)!==0;if(!E&&!F)return T&&ZO(h,y,!1),da(c,h,O);E=h.stateNode,YX.current=h;var K=F&&typeof y.getDerivedStateFromError!="function"?null:E.render();return h.flags|=1,c!==null&&F?(h.child=hd(h,c.child,null,O),h.child=hd(h,null,K,O)):ni(c,h,K,O),h.memoizedState=E.state,T&&ZO(h,y,!0),h.child}function qD(c){var h=c.stateNode;h.pendingContext?GO(c,h.pendingContext,h.pendingContext!==h.context):h.context&&GO(c,h.context,!1),gx(c,h.containerInfo)}function WD(c,h,y,E,T){return fd(),ux(T),h.flags|=256,ni(c,h,y,E),h.child}var Mx={dehydrated:null,treeContext:null,retryLane:0};function Nx(c){return{baseLanes:c,cachePool:null,transitions:null}}function GD(c,h,y){var E=h.pendingProps,T=Nn.current,O=!1,F=(h.flags&128)!==0,K;if((K=F)||(K=c!==null&&c.memoizedState===null?!1:(T&2)!==0),K?(O=!0,h.flags&=-129):(c===null||c.memoizedState!==null)&&(T|=1),yn(Nn,T&1),c===null)return lx(h),c=h.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((h.mode&1)===0?h.lanes=1:c.data==="$!"?h.lanes=8:h.lanes=1073741824,null):(F=E.children,c=E.fallback,O?(E=h.mode,O=h.child,F={mode:"hidden",children:F},(E&1)===0&&O!==null?(O.childLanes=0,O.pendingProps=F):O=Lv(F,E,0,null),c=Ru(c,E,y,null),O.return=h,c.return=h,O.sibling=c,h.child=O,h.child.memoizedState=Nx(y),h.memoizedState=Mx,c):jx(h,F));if(T=c.memoizedState,T!==null&&(K=T.dehydrated,K!==null))return QX(c,h,F,E,K,T,y);if(O){O=E.fallback,F=h.mode,T=c.child,K=T.sibling;var J={mode:"hidden",children:E.children};return(F&1)===0&&h.child!==T?(E=h.child,E.childLanes=0,E.pendingProps=J,h.deletions=null):(E=gl(T,J),E.subtreeFlags=T.subtreeFlags&14680064),K!==null?O=gl(K,O):(O=Ru(O,F,y,null),O.flags|=2),O.return=h,E.return=h,E.sibling=O,h.child=E,E=O,O=h.child,F=c.child.memoizedState,F=F===null?Nx(y):{baseLanes:F.baseLanes|y,cachePool:null,transitions:F.transitions},O.memoizedState=F,O.childLanes=c.childLanes&~y,h.memoizedState=Mx,E}return O=c.child,c=O.sibling,E=gl(O,{mode:"visible",children:E.children}),(h.mode&1)===0&&(E.lanes=y),E.return=h,E.sibling=null,c!==null&&(y=h.deletions,y===null?(h.deletions=[c],h.flags|=16):y.push(c)),h.child=E,h.memoizedState=null,E}function jx(c,h){return h=Lv({mode:"visible",children:h},c.mode,0,null),h.return=c,c.child=h}function Ev(c,h,y,E){return E!==null&&ux(E),hd(h,c.child,null,y),c=jx(h,h.pendingProps.children),c.flags|=2,h.memoizedState=null,c}function QX(c,h,y,E,T,O,F){if(y)return h.flags&256?(h.flags&=-257,E=Ix(Error(n(422))),Ev(c,h,F,E)):h.memoizedState!==null?(h.child=c.child,h.flags|=128,null):(O=E.fallback,T=h.mode,E=Lv({mode:"visible",children:E.children},T,0,null),O=Ru(O,T,F,null),O.flags|=2,E.return=h,O.return=h,E.sibling=O,h.child=E,(h.mode&1)!==0&&hd(h,c.child,null,F),h.child.memoizedState=Nx(F),h.memoizedState=Mx,O);if((h.mode&1)===0)return Ev(c,h,F,null);if(T.data==="$!"){if(E=T.nextSibling&&T.nextSibling.dataset,E)var K=E.dgst;return E=K,O=Error(n(419)),E=Ix(O,E,void 0),Ev(c,h,F,E)}if(K=(F&c.childLanes)!==0,Ci||K){if(E=kr,E!==null){switch(F&-F){case 4:T=2;break;case 16:T=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:T=32;break;case 536870912:T=268435456;break;default:T=0}T=(T&(E.suspendedLanes|F))!==0?0:T,T!==0&&T!==O.retryLane&&(O.retryLane=T,ua(c,T),Zs(E,c,T,-1))}return Xx(),E=Ix(Error(n(421))),Ev(c,h,F,E)}return T.data==="$?"?(h.flags|=128,h.child=c.child,h=cJ.bind(null,c),T._reactRetry=h,null):(c=O.treeContext,qi=sl(T.nextSibling),Hi=h,In=!0,qs=null,c!==null&&(fs[hs++]=aa,fs[hs++]=la,fs[hs++]=_u,aa=c.id,la=c.overflow,_u=h),h=jx(h,E.children),h.flags|=4096,h)}function KD(c,h,y){c.lanes|=h;var E=c.alternate;E!==null&&(E.lanes|=h),hx(c.return,h,y)}function Lx(c,h,y,E,T){var O=c.memoizedState;O===null?c.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:E,tail:y,tailMode:T}:(O.isBackwards=h,O.rendering=null,O.renderingStartTime=0,O.last=E,O.tail
vendor: 4,887 bytes, line 9
9=y,O.tailMode=T)}function ZD(c,h,y){var E=h.pendingProps,T=E.revealOrder,O=E.tail;if(ni(c,h,E.children,y),E=Nn.current,(E&2)!==0)E=E&1|2,h.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=h.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&KD(c,y,h);else if(c.tag===19)KD(c,y,h);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===h)break e;for(;c.sibling===null;){if(c.return===null||c.return===h)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}E&=1}if(yn(Nn,E),(h.mode&1)===0)h.memoizedState=null;else switch(T){case"forwards":for(y=h.child,T=null;y!==null;)c=y.alternate,c!==null&&vv(c)===null&&(T=y),y=y.sibling;y=T,y===null?(T=h.child,h.child=null):(T=y.sibling,y.sibling=null),Lx(h,!1,T,y,O);break;case"backwards":for(y=null,T=h.child,h.child=null;T!==null;){if(c=T.alternate,c!==null&&vv(c)===null){h.child=T;break}c=T.sibling,T.sibling=y,y=T,T=c}Lx(h,!0,y,null,O);break;case"together":Lx(h,!1,null,null,void 0);break;default:h.memoizedState=null}return h.child}function Cv(c,h){(h.mode&1)===0&&c!==null&&(c.alternate=null,h.alternate=null,h.flags|=2)}function da(c,h,y){if(c!==null&&(h.dependencies=c.dependencies),Cu|=h.lanes,(y&h.childLanes)===0)return null;if(c!==null&&h.child!==c.child)throw Error(n(153));if(h.child!==null){for(c=h.child,y=gl(c,c.pendingProps),h.child=y,y.return=h;c.sibling!==null;)c=c.sibling,y=y.sibling=gl(c,c.pendingProps),y.return=h;y.sibling=null}return h.child}function XX(c,h,y){switch(h.tag){case 3:qD(h),fd();break;case 5:uD(h);break;case 1:Ei(h.type)&&av(h);break;case 4:gx(h,h.stateNode.containerInfo);break;case 10:var E=h.type._context,T=h.memoizedProps.value;yn(hv,E._currentValue),E._currentValue=T;break;case 13:if(E=h.memoizedState,E!==null)return E.dehydrated!==null?(yn(Nn,Nn.current&1),h.flags|=128,null):(y&h.child.childLanes)!==0?GD(c,h,y):(yn(Nn,Nn.current&1),c=da(c,h,y),c!==null?c.sibling:null);yn(Nn,Nn.current&1);break;case 19:if(E=(y&h.childLanes)!==0,(c.flags&128)!==0){if(E)return ZD(c,h,y);h.flags|=128}if(T=h.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),yn(Nn,Nn.current),E)break;return null;case 22:case 23:return h.lanes=0,UD(c,h,y)}return da(c,h,y)}var YD,Fx,QD,XD;YD=function(c,h){for(var y=h.child;y!==null;){if(y.tag===5||y.tag===6)c.appendChild(y.stateNode);else if(y.tag!==4&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===h)break;for(;y.sibling===null;){if(y.return===null||y.return===h)return;y=y.return}y.sibling.return=y.return,y=y.sibling}},Fx=function(){},QD=function(c,h,y,E){var T=c.memoizedProps;if(T!==E){c=h.stateNode,Su(Eo.current);var O=null;switch(y){case"input":T=Fe(c,T),E=Fe(c,E),O=[];break;case"select":T=M({},T,{value:void 0}),E=M({},E,{value:void 0}),O=[];break;case"textarea":T=Ee(c,T),E=Ee(c,E),O=[];break;default:typeof T.onClick!="function"&&typeof E.onClick=="function"&&(c.onclick=iv)}sr(y,E);var F;y=null;for(pe in T)if(!E.hasOwnProperty(pe)&&T.hasOwnProperty(pe)&&T[pe]!=null)if(pe==="style"){var K=T[pe];for(F in K)K.hasOwnProperty(F)&&(y||(y={}),y[F]="")}else pe!=="dangerouslySetInnerHTML"&&pe!=="children"&&pe!=="suppressContentEditableWarning"&&pe!=="suppressHydrationWarning"&&pe!=="autoFocus"&&(i.hasOwnProperty(pe)?O||(O=[]):(O=O||[]).push(pe,null));for(pe in E){var J=E[pe];if(K=T?.[pe],E.hasOwnProperty(pe)&&J!==K&&(J!=null||K!=null))if(pe==="style")if(K){for(F in K)!K.hasOwnProperty(F)||J&&J.hasOwnProperty(F)||(y||(y={}),y[F]="");for(F in J)J.hasOwnProperty(F)&&K[F]!==J[F]&&(y||(y={}),y[F]=J[F])}else y||(O||(O=[]),O.push(pe,y)),y=J;else pe==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,K=K?K.__html:void 0,J!=null&&K!==J&&(O=O||[]).push(pe,J)):pe==="children"?typeof J!="string"&&typeof J!="number"||(O=O||[]).push(pe,""+J):pe!=="suppressContentEditableWarning"&&pe!=="suppressHydrationWarning"&&(i.hasOwnProperty(pe)?(J!=null&&pe==="onScroll"&&Cn("scroll",c),O||K===J||(O=[])):(O=O||[]).push(pe,J))}y&&(O=O||[]).push("style",y);var pe=O;(h.updateQueue=pe)&&(h.flags|=4)}},XD=function(c,h,y,E){y!==E&&(h.flags|=4)};function $h(c,h){if(!In)switch(c.tailMode){case"hidden":h=c.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?c.tail=null:y.sibling=null;break;case"collapsed":y=c.tail;for(var E=null;y!==null;)y.alternate!==null&&(E=y),y=y.sibling;E===null?h||c.tail===null?c.tail=null:c.tail.sibling=null:E.sibling=null}}function Hr(c){var h=c.alternate!==null&&c.alternate.child===c.child,y=0,E=0;if(h)for(var T=c.child;T!==null;)y|=T.lanes|T.childLanes,E|=T.subtreeFlags&14680064,E|=T.flags&14680064,T.return=c,T=T.sibling;else for(T=c.child;T!==null;)y|=T.lanes|T.childLanes,E|=T.subtreeFlags,E|=T.flags,T.return=c,T=T.sibling;return c.subtreeFlags|=E,c.childLanes=y,h}function JX(c,h,y){var E=h.pendingProps;switch(ox(h),h.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hr(h),null;case 1:return Ei(h.type)&&ov(),Hr(h),null;
vendor: 29,081 bytes, line 9
9case 3:return E=h.stateNode,gd(),kn(Si),kn(Ur),bx(),E.pendingContext&&(E.context=E.pendingContext,E.pendingContext=null),(c===null||c.child===null)&&(dv(h)?h.flags|=4:c===null||c.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,qs!==null&&(Zx(qs),qs=null))),Fx(c,h),Hr(h),null;case 5:vx(h);var T=Su(Mh.current);if(y=h.type,c!==null&&h.stateNode!=null)QD(c,h,y,E,T),c.ref!==h.ref&&(h.flags|=512,h.flags|=2097152);else{if(!E){if(h.stateNode===null)throw Error(n(166));return Hr(h),null}if(c=Su(Eo.current),dv(h)){E=h.stateNode,y=h.type;var O=h.memoizedProps;switch(E[So]=h,E[Rh]=O,c=(h.mode&1)!==0,y){case"dialog":Cn("cancel",E),Cn("close",E);break;case"iframe":case"object":case"embed":Cn("load",E);break;case"video":case"audio":for(T=0;T<kh.length;T++)Cn(kh[T],E);break;case"source":Cn("error",E);break;case"img":case"image":case"link":Cn("error",E),Cn("load",E);break;case"details":Cn("toggle",E);break;case"input":Be(E,O),Cn("invalid",E);break;case"select":E._wrapperState={wasMultiple:!!O.multiple},Cn("invalid",E);break;case"textarea":xe(E,O),Cn("invalid",E)}sr(y,O),T=null;for(var F in O)if(O.hasOwnProperty(F)){var K=O[F];F==="children"?typeof K=="string"?E.textContent!==K&&(O.suppressHydrationWarning!==!0&&rv(E.textContent,K,c),T=["children",K]):typeof K=="number"&&E.textContent!==""+K&&(O.suppressHydrationWarning!==!0&&rv(E.textContent,K,c),T=["children",""+K]):i.hasOwnProperty(F)&&K!=null&&F==="onScroll"&&Cn("scroll",E)}switch(y){case"input":ke(E),W(E,O,!0);break;case"textarea":ke(E),Ze(E);break;case"select":case"option":break;default:typeof O.onClick=="function"&&(E.onclick=iv)}E=T,h.updateQueue=E,E!==null&&(h.flags|=4)}else{F=T.nodeType===9?T:T.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=he(y)),c==="http://www.w3.org/1999/xhtml"?y==="script"?(c=F.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof E.is=="string"?c=F.createElement(y,{is:E.is}):(c=F.createElement(y),y==="select"&&(F=c,E.multiple?F.multiple=!0:E.size&&(F.size=E.size))):c=F.createElementNS(c,y),c[So]=h,c[Rh]=E,YD(c,h,!1,!1),h.stateNode=c;e:{switch(F=us(y,E),y){case"dialog":Cn("cancel",c),Cn("close",c),T=E;break;case"iframe":case"object":case"embed":Cn("load",c),T=E;break;case"video":case"audio":for(T=0;T<kh.length;T++)Cn(kh[T],c);T=E;break;case"source":Cn("error",c),T=E;break;case"img":case"image":case"link":Cn("error",c),Cn("load",c),T=E;break;case"details":Cn("toggle",c),T=E;break;case"input":Be(c,E),T=Fe(c,E),Cn("invalid",c);break;case"option":T=E;break;case"select":c._wrapperState={wasMultiple:!!E.multiple},T=M({},E,{value:void 0}),Cn("invalid",c);break;case"textarea":xe(c,E),T=Ee(c,E),Cn("invalid",c);break;default:T=E}sr(y,T),K=T;for(O in K)if(K.hasOwnProperty(O)){var J=K[O];O==="style"?Vi(c,J):O==="dangerouslySetInnerHTML"?(J=J?J.__html:void 0,J!=null&&Et(c,J)):O==="children"?typeof J=="string"?(y!=="textarea"||J!=="")&&jt(c,J):typeof J=="number"&&jt(c,""+J):O!=="suppressContentEditableWarning"&&O!=="suppressHydrationWarning"&&O!=="autoFocus"&&(i.hasOwnProperty(O)?J!=null&&O==="onScroll"&&Cn("scroll",c):J!=null&&C(c,O,J,F))}switch(y){case"input":ke(c),W(c,E,!1);break;case"textarea":ke(c),Ze(c);break;case"option":E.value!=null&&c.setAttribute("value",""+se(E.value));break;case"select":c.multiple=!!E.multiple,O=E.value,O!=null?Re(c,!!E.multiple,O,!1):E.defaultValue!=null&&Re(c,!!E.multiple,E.defaultValue,!0);break;default:typeof T.onClick=="function"&&(c.onclick=iv)}switch(y){case"button":case"input":case"select":case"textarea":E=!!E.autoFocus;break e;case"img":E=!0;break e;default:E=!1}}E&&(h.flags|=4)}h.ref!==null&&(h.flags|=512,h.flags|=2097152)}return Hr(h),null;case 6:if(c&&h.stateNode!=null)XD(c,h,c.memoizedProps,E);else{if(typeof E!="string"&&h.stateNode===null)throw Error(n(166));if(y=Su(Mh.current),Su(Eo.current),dv(h)){if(E=h.stateNode,y=h.memoizedProps,E[So]=h,(O=E.nodeValue!==y)&&(c=Hi,c!==null))switch(c.tag){case 3:rv(E.nodeValue,y,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&rv(E.nodeValue,y,(c.mode&1)!==0)}O&&(h.flags|=4)}else E=(y.nodeType===9?y:y.ownerDocument).createTextNode(E),E[So]=h,h.stateNode=E}return Hr(h),null;case 13:if(kn(Nn),E=h.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(In&&qi!==null&&(h.mode&1)!==0&&(h.flags&128)===0)tD(),fd(),h.flags|=98560,O=!1;else if(O=dv(h),E!==null&&E.dehydrated!==null){if(c===null){if(!O)throw Error(n(318));if(O=h.memoizedState,O=O!==null?O.dehydrated:null,!O)throw Error(n(317));O[So]=h}else fd(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Hr(h),O=!1}else qs!==null&&(Zx(qs),qs=null),O=!0;if(!O)return h.flags&65536?h:null}return(h.flags&128)!==0?(h.lanes=y,h):(E=E!==null,E!==(c!==null&&c.memoizedState!==null)&&E&&(h.child.flags|=8192,(h.mode&1)!==0&&(c===null||(Nn.current&1)!==0?vr===0&&(vr=3):Xx())),h.updateQueue!==null&&(h.flags|=4),Hr(h),null);case 4:return gd(),Fx(c,h),c===null&&Th(h.stateNode.containerInfo),Hr(h),null;case 10:return fx(h.type._context),Hr(h),null;case 17:return Ei(h.type)&&ov(),Hr(h),null;case 19:if(kn(Nn),O=h.memoizedState,O===null)return Hr(h),null;if(E=(h.flags&128)!==0,F=O.rendering,F===null)if(E)$h(O,!1);else{if(vr!==0||c!==null&&(c.flags&128)!==0)for(c=h.child;c!==null;){if(F=vv(c),F!==null){for(h.flags|=128,$h(O,!1),E=F.updateQueue,E!==null&&(h.updateQueue=E,h.flags|=4),h.subtreeFlags=0,E=y,y=h.child;y!==null;)O=y,c=E,O.flags&=14680066,F=O.alternate,F===null?(O.childLanes=0,O.lanes=c,O.child=null,O.subtreeFlags=0,O.memoizedProps=null,O.memoizedState=null,O.updateQueue=null,O.dependencies=null,O.stateNode=null):(O.childLanes=F.childLanes,O.lanes=F.lanes,O.child=F.child,O.subtreeFlags=0,O.deletions=null,O.memoizedProps=F.memoizedProps,O.memoizedState=F.memoizedState,O.updateQueue=F.updateQueue,O.type=F.type,c=F.dependencies,O.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),y=y.sibling;return yn(Nn,Nn.current&1|2),h.child}c=c.sibling}O.tail!==null&&nn()>_d&&(h.flags|=128,E=!0,$h(O,!1),h.lanes=4194304)}else{if(!E)if(c=vv(F),c!==null){if(h.flags|=128,E=!0,y=c.updateQueue,y!==null&&(h.updateQueue=y,h.flags|=4),$h(O,!0),O.tail===null&&O.tailMode==="hidden"&&!F.alternate&&!In)return Hr(h),null}else 2*nn()-O.renderingStartTime>_d&&y!==1073741824&&(h.flags|=128,E=!0,$h(O,!1),h.lanes=4194304);O.isBackwards?(F.sibling=h.child,h.child=F):(y=O.last,y!==null?y.sibling=F:h.child=F,O.last=F)}return O.tail!==null?(h=O.tail,O.rendering=h,O.tail=h.sibling,O.renderingStartTime=nn(),h.sibling=null,y=Nn.current,yn(Nn,E?y&1|2:y&1),h):(Hr(h),null);case 22:case 23:return Qx(),E=h.memoizedState!==null,c!==null&&c.memoizedState!==null!==E&&(h.flags|=8192),E&&(h.mode&1)!==0?(Wi&1073741824)!==0&&(Hr(h),h.subtreeFlags&6&&(h.flags|=8192)):Hr(h),null;case 24:return null;case 25:return null}throw Error(n(156,h.tag))}function eJ(c,h){switch(ox(h),h.tag){case 1:return Ei(h.type)&&ov(),c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 3:return gd(),kn(Si),kn(Ur),bx(),c=h.flags,(c&65536)!==0&&(c&128)===0?(h.flags=c&-65537|128,h):null;case 5:return vx(h),null;case 13:if(kn(Nn),c=h.memoizedState,c!==null&&c.dehydrated!==null){if(h.alternate===null)throw Error(n(340));fd()}return c=h.flags,c&65536?(h.flags=c&-65537|128,h):null;case 19:return kn(Nn),null;case 4:return gd(),null;case 10:return fx(h.type._context),null;case 22:case 23:return Qx(),null;case 24:return null;default:return null}}var kv=!1,qr=!1,tJ=typeof WeakSet=="function"?WeakSet:Set,Ye=null;function yd(c,h){var y=c.ref;if(y!==null)if(typeof y=="function")try{y(null)}catch(E){Bn(c,h,E)}else y.current=null}function $x(c,h,y){try{y()}catch(E){Bn(c,h,E)}}var JD=!1;function nJ(c,h){if(Qw=Wg,c=OO(),Bw(c)){if("selectionStart"in c)var y={start:c.selectionStart,end:c.selectionEnd};else e:{y=(y=c.ownerDocument)&&y.defaultView||window;var E=y.getSelection&&y.getSelection();if(E&&E.rangeCount!==0){y=E.anchorNode;var T=E.anchorOffset,O=E.focusNode;E=E.focusOffset;try{y.nodeType,O.nodeType}catch{y=null;break e}var F=0,K=-1,J=-1,pe=0,Pe=0,Oe=c,Te=null;t:for(;;){for(var He;Oe!==y||T!==0&&Oe.nodeType!==3||(K=F+T),Oe!==O||E!==0&&Oe.nodeType!==3||(J=F+E),Oe.nodeType===3&&(F+=Oe.nodeValue.length),(He=Oe.firstChild)!==null;)Te=Oe,Oe=He;for(;;){if(Oe===c)break t;if(Te===y&&++pe===T&&(K=F),Te===O&&++Pe===E&&(J=F),(He=Oe.nextSibling)!==null)break;Oe=Te,Te=Oe.parentNode}Oe=He}y=K===-1||J===-1?null:{start:K,end:J}}else y=null}y=y||{start:0,end:0}}else y=null;for(Xw={focusedElem:c,selectionRange:y},Wg=!1,Ye=h;Ye!==null;)if(h=Ye,c=h.child,(h.subtreeFlags&1028)!==0&&c!==null)c.return=h,Ye=c;else for(;Ye!==null;){h=Ye;try{var Xe=h.alternate;if((h.flags&1024)!==0)switch(h.tag){case 0:case 11:case 15:break;case 1:if(Xe!==null){var nt=Xe.memoizedProps,Jn=Xe.memoizedState,le=h.stateNode,re=le.getSnapshotBeforeUpdate(h.elementType===h.type?nt:Ws(h.type,nt),Jn);le.__reactInternalSnapshotBeforeUpdate=re}break;case 3:var de=h.stateNode.containerInfo;de.nodeType===1?de.textContent="":de.nodeType===9&&de.documentElement&&de.removeChild(de.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ae){Bn(h,h.return,Ae)}if(c=h.sibling,c!==null){c.return=h.return,Ye=c;break}Ye=h.return}return Xe=JD,JD=!1,Xe}function zh(c,h,y){var E=h.updateQueue;if(E=E!==null?E.lastEffect:null,E!==null){var T=E=E.next;do{if((T.tag&c)===c){var O=T.destroy;T.destroy=void 0,O!==void 0&&$x(h,y,O)}T=T.next}while(T!==E)}}function Tv(c,h){if(h=h.updateQueue,h=h!==null?h.lastEffect:null,h!==null){var y=h=h.next;do{if((y.tag&c)===c){var E=y.create;y.destroy=E()}y=y.next}while(y!==h)}}function zx(c){var h=c.ref;if(h!==null){var y=c.stateNode;switch(c.tag){case 5:c=y;break;default:c=y}typeof h=="function"?h(c):h.current=c}}function eA(c){var h=c.alternate;h!==null&&(c.alternate=null,eA(h)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(h=c.stateNode,h!==null&&(delete h[So],delete h[Rh],delete h[nx],delete h[FX],delete h[$X])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}function tA(c){return c.tag===5||c.tag===3||c.tag===4}function nA(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||tA(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Vx(c,h,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,h?y.nodeType===8?y.parentNode.insertBefore(c,h):y.insertBefore(c,h):(y.nodeType===8?(h=y.parentNode,h.insertBefore(c,y)):(h=y,h.appendChild(c)),y=y._reactRootContainer,y!=null||h.onclick!==null||(h.onclick=iv));else if(E!==4&&(c=c.child,c!==null))for(Vx(c,h,y),c=c.sibling;c!==null;)Vx(c,h,y),c=c.sibling}function Ux(c,h,y){var E=c.tag;if(E===5||E===6)c=c.stateNode,h?y.insertBefore(c,h):y.appendChild(c);else if(E!==4&&(c=c.child,c!==null))for(Ux(c,h,y),c=c.sibling;c!==null;)Ux(c,h,y),c=c.sibling}var Ar=null,Gs=!1;function dl(c,h,y){for(y=y.child;y!==null;)rA(c,h,y),y=y.sibling}function rA(c,h,y){if(hn&&typeof hn.onCommitFiberUnmount=="function")try{hn.onCommitFiberUnmount(Ft,y)}catch{}switch(y.tag){case 5:qr||yd(y,h);case 6:var E=Ar,T=Gs;Ar=null,dl(c,h,y),Ar=E,Gs=T,Ar!==null&&(Gs?(c=Ar,y=y.stateNode,c.nodeType===8?c.parentNode.removeChild(y):c.removeChild(y)):Ar.removeChild(y.stateNode));break;case 18:Ar!==null&&(Gs?(c=Ar,y=y.stateNode,c.nodeType===8?tx(c.parentNode,y):c.nodeType===1&&tx(c,y),yh(c)):tx(Ar,y.stateNode));break;case 4:E=Ar,T=Gs,Ar=y.stateNode.containerInfo,Gs=!0,dl(c,h,y),Ar=E,Gs=T;break;case 0:case 11:case 14:case 15:if(!qr&&(E=y.updateQueue,E!==null&&(E=E.lastEffect,E!==null))){T=E=E.next;do{var O=T,F=O.destroy;O=O.tag,F!==void 0&&((O&2)!==0||(O&4)!==0)&&$x(y,h,F),T=T.next}while(T!==E)}dl(c,h,y);break;case 1:if(!qr&&(yd(y,h),E=y.stateNode,typeof E.componentWillUnmount=="function"))try{E.props=y.memoizedProps,E.state=y.memoizedState,E.componentWillUnmount()}catch(K){Bn(y,h,K)}dl(c,h,y);break;case 21:dl(c,h,y);break;case 22:y.mode&1?(qr=(E=qr)||y.memoizedState!==null,dl(c,h,y),qr=E):dl(c,h,y);break;default:dl(c,h,y)}}function iA(c){var h=c.updateQueue;if(h!==null){c.updateQueue=null;var y=c.stateNode;y===null&&(y=c.stateNode=new tJ),h.forEach(function(E){var T=dJ.bind(null,c,E);y.has(E)||(y.add(E),E.then(T,T))})}}function Ks(c,h){var y=h.deletions;if(y!==null)for(var E=0;E<y.length;E++){var T=y[E];try{var O=c,F=h,K=F;e:for(;K!==null;){switch(K.tag){case 5:Ar=K.stateNode,Gs=!1;break e;case 3:Ar=K.stateNode.containerInfo,Gs=!0;break e;case 4:Ar=K.stateNode.containerInfo,Gs=!0;break e}K=K.return}if(Ar===null)throw Error(n(160));rA(O,F,T),Ar=null,Gs=!1;var J=T.alternate;J!==null&&(J.return=null),T.return=null}catch(pe){Bn(T,h,pe)}}if(h.subtreeFlags&12854)for(h=h.child;h!==null;)sA(h,c),h=h.sibling}function sA(c,h){var y=c.alternate,E=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Ks(h,c),ko(c),E&4){try{zh(3,c,c.return),Tv(3,c)}catch(nt){Bn(c,c.return,nt)}try{zh(5,c,c.return)}catch(nt){Bn(c,c.return,nt)}}break;case 1:Ks(h,c),ko(c),E&512&&y!==null&&yd(y,y.return);break;case 5:if(Ks(h,c),ko(c),E&512&&y!==null&&yd(y,y.return),c.flags&32){var T=c.stateNode;try{jt(T,"")}catch(nt){Bn(c,c.return,nt)}}if(E&4&&(T=c.stateNode,T!=null)){var O=c.memoizedProps,F=y!==null?y.memoizedProps:O,K=c.type,J=c.updateQueue;if(c.updateQueue=null,J!==null)try{K==="input"&&O.type==="radio"&&O.name!=null&&wt(T,O),us(K,F);var pe=us(K,O);for(F=0;F<J.length;F+=2){var Pe=J[F],Oe=J[F+1];Pe==="style"?Vi(T,Oe):Pe==="dangerouslySetInnerHTML"?Et(T,Oe):Pe==="children"?jt(T,Oe):C(T,Pe,Oe,pe)}switch(K){case"input":ht(T,O);break;case"textarea":ze(T,O);break;case"select":var Te=T._wrapperState.wasMultiple;T._wrapperState.wasMultiple=!!O.multiple;var He=O.value;He!=null?Re(T,!!O.multiple,He,!1):Te!==!!O.multiple&&(O.defaultValue!=null?Re(T,!!O.multiple,O.defaultValue,!0):Re(T,!!O.multiple,O.multiple?[]:"",!1))}T[Rh]=O}catch(nt){Bn(c,c.return,nt)}}break;case 6:if(Ks(h,c),ko(c),E&4){if(c.stateNode===null)throw Error(n(162));T=c.stateNode,O=c.memoizedProps;try{T.nodeValue=O}catch(nt){Bn(c,c.return,nt)}}break;case 3:if(Ks(h,c),ko(c),E&4&&y!==null&&y.memoizedState.isDehydrated)try{yh(h.containerInfo)}catch(nt){Bn(c,c.return,nt)}break;case 4:Ks(h,c),ko(c);break;case 13:Ks(h,c),ko(c),T=c.child,T.flags&8192&&(O=T.memoizedState!==null,T.stateNode.isHidden=O,!O||T.alternate!==null&&T.alternate.memoizedState!==null||(qx=nn())),E&4&&iA(c);break;case 22:if(Pe=y!==null&&y.memoizedState!==null,c.mode&1?(qr=(pe=qr)||Pe,Ks(h,c),qr=pe):Ks(h,c),ko(c),E&8192){if(pe=c.memoizedState!==null,(c.stateNode.isHidden=pe)&&!Pe&&(c.mode&1)!==0)for(Ye=c,Pe=c.child;Pe!==null;){for(Oe=Ye=Pe;Ye!==null;){switch(Te=Ye,He=Te.child,Te.tag){case 0:case 11:case 14:case 15:zh(4,Te,Te.return);break;case 1:yd(Te,Te.return);var Xe=Te.stateNode;if(typeof Xe.componentWillUnmount=="function"){E=Te,y=Te.return;try{h=E,Xe.props=h.memoizedProps,Xe.state=h.memoizedState,Xe.componentWillUnmount()}catch(nt){Bn(E,y,nt)}}break;case 5:yd(Te,Te.return);break;case 22:if(Te.memoizedState!==null){lA(Oe);continue}}He!==null?(He.return=Te,Ye=He):lA(Oe)}Pe=Pe.sibling}e:for(Pe=null,Oe=c;;){if(Oe.tag===5){if(Pe===null){Pe=Oe;try{T=Oe.stateNode,pe?(O=T.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none"):(K=Oe.stateNode,J=Oe.memoizedProps.style,F=J!=null&&J.hasOwnProperty("display")?J.display:null,K.style.display=En("display",F))}catch(nt){Bn(c,c.return,nt)}}}else if(Oe.tag===6){if(Pe===null)try{Oe.stateNode.nodeValue=pe?"":Oe.memoizedProps}catch(nt){Bn(c,c.return,nt)}}else if((Oe.tag!==22&&Oe.tag!==23||Oe.memoizedState===null||Oe===c)&&Oe.child!==null){Oe.child.return=Oe,Oe=Oe.child;continue}if(Oe===c)break e;for(;Oe.sibling===null;){if(Oe.return===null||Oe.return===c)break e;Pe===Oe&&(Pe=null),Oe=Oe.return}Pe===Oe&&(Pe=null),Oe.sibling.return=Oe.return,Oe=Oe.sibling}}break;case 19:Ks(h,c),ko(c),E&4&&iA(c);break;case 21:break;default:Ks(h,c),ko(c)}}function ko(c){var h=c.flags;if(h&2){try{e:{for(var y=c.return;y!==null;){if(tA(y)){var E=y;break e}y=y.return}throw Error(n(160))}switch(E.tag){case 5:var T=E.stateNode;E.flags&32&&(jt(T,""),E.flags&=-33);var O=nA(c);Ux(c,O,T);break;case 3:case 4:var F=E.stateNode.containerInfo,K=nA(c);Vx(c,K,F);break;default:throw Error(n(161))}}catch(J){Bn(c,c.return,J)}c.flags&=-3}h&4096&&(c.flags&=-4097)}function rJ(c,h,y){Ye=c,oA(c)}function oA(c,h,y){for(var E=(c.mode&1)!==0;Ye!==null;){var T=Ye,O=T.child;if(T.tag===22&&E){var F=T.memoizedState!==null||kv;if(!F){var K=T.alternate,J=K!==null&&K.memoizedState!==null||qr;K=kv;var pe=qr;if(kv=F,(qr=J)&&!pe)for(Ye=T;Ye!==null;)F=Ye,J=F.child,F.tag===22&&F.memoizedState!==null?uA(T):J!==null?(J.return=F,Ye=J):uA(T);for(;O!==null;)Ye=O,oA(O),O=O.sibling;Ye=T,kv=K,qr=pe}aA(c)}else(T.subtreeFlags&8772)!==0&&O!==null?(O.return=T,Ye=O):aA(c)}}function aA(c){for(;Ye!==null;){var h=Ye;if((h.flags&8772)!==0){var y=h.alternate;try{if((h.flags&8772)!==0)switch(h.tag){case 0:case 11:case 15:qr||Tv(5,h);break;case 1:var E=h.stateNode;if(h.flags&4&&!qr)if(y===null)E.componentDidMount();else{var T=h.elementType===h.type?y.memoizedProps:Ws(h.type,y.memoizedProps);E.componentDidUpdate(T,y.memoizedState,E.__reactInternalSnapshotBeforeUpdate)}var O=h.updateQueue;O!==null&&lD(h,O,E);break;case 3:var F=h.updateQueue;if(F!==null){if(y=null,h.child!==null)switch(h.child.tag){case 5:y=h.child.stateNode;break;case 1:y=h.child.stateNode}lD(h,F,y)}break;case 5:var K=h.stateNode;if(y===null&&h.flags&4){y=K;var J=h.memoizedProps;switch(h.type){case"button":case"input":case"select":case"textarea":J.autoFocus&&y.focus();break;case"img":J.src&&(y.src=J.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(h.memoizedState===null){var pe=h.alternate;if(pe!==null){var Pe=pe.memoizedState;if(Pe!==null){var Oe=Pe.dehydrated;Oe!==null&&yh(Oe)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qr||h.flags&512&&zx(h)}catch(Te){Bn(h,h.return,Te)}}if(h===c){Ye=null;break}if(y=h.sibling,y!==null){y.return=h.return,Ye=y;break}Ye=h.return}}function lA(c){for(;Ye!==null;){var h=Ye;if(h===c){Ye=null;break}var y=h.sibling;if(y!==null){y.return=h.return,Ye=y;break}Ye=h.return}}function uA(c){for(;Ye!==null;){var h=Ye;try{switch(h.tag){case 0:case 11:case 15:var y=h.return;try{Tv(4,h)}catch(J){Bn(h,y,J)}break;case 1:var E=h.stateNode;if(typeof E.componentDidMount=="function"){var T=h.return;try{E.componentDidMount()}catch(J){Bn(h,T,J)}}var O=h.return;try{zx(h)}catch(J){Bn(h,O,J)}break;case 5:var F=h.return;try{zx(h)}catch(J){Bn(h,F,J)}}}catch(J){Bn(h,h.return,J)}if(h===c){Ye=null;break}var K=h.sibling;if(K!==null){K.return=h.return,Ye=K;break}Ye=h.return}}var iJ=Math.ceil,Pv=R.ReactCurrentDispatcher,Bx=R.ReactCurrentOwner,gs=R.ReactCurrentBatchConfig,Zt=0,kr=null,or=null,Mr=0,Wi=0,bd=ol(0),vr=0,Vh=null,Cu=0,Rv=0,Hx=0,Uh=null,ki=null,qx=0,_d=1/0,fa=null,Iv=!1,Wx=null,fl=null,Ov=!1,hl=null,Dv=0,Bh=0,Gx=null,Av=-1,Mv=0;function ri(){return(Zt&6)!==0?nn():Av!==-1?Av:Av=nn()}function pl(c){return(c.mode&1)===0?1:(Zt&2)!==0&&Mr!==0?Mr&-Mr:VX.transition!==null?(Mv===0&&(Mv=nO()),Mv):(c=on,c!==0||(c=window.event,c=c===void 0?16:dO(c.type)),c)}function Zs(c,h,y,E){if(50<Bh)throw Bh=0,Gx=null,Error(n(185));hh(c,y,E),((Zt&2)===0||c!==kr)&&(c===kr&&((Zt&2)===0&&(Rv|=y),vr===4&&ml(c,Mr)),Ti(c,E),y===1&&Zt===0&&(h.mode&1)===0&&(_d=nn()+500,lv&&ll()))}function Ti(c,h){var y=c.callbackNode;VQ(c,h);var E=Bg(c,c===kr?Mr:0);if(E===0)y!==null&&cn(y),c.callbackNode=null,c.callbackPriority=0;else if(h=E&-E,c.callbackPriority!==h){if(y!=null&&cn(y),h===1)c.tag===0?zX(dA.bind(null,c)):YO(dA.bind(null,c)),jX(function(){(Zt&6)===0&&ll()}),y=null;else{switch(rO(E)){case 1:y=gu;break;case 4:y=Qa;break;case 16:y=ds;break;case 536870912:y=vu;break;default:y=ds}y=bA(y,cA.bind(null,c))}c.callbackPriority=h,c.callbackNode=y}}function cA(c,h){if(Av=-1,Mv=0,(Zt&6)!==0)throw Error(n(327));var y=c.callbackNode;if(wd()&&c.callbackNode!==y)return null;var E=Bg(c,c===kr?Mr:0);if(E===0)return null;if((E&30)!==0||(E&c.expiredLanes)!==0||h)h=Nv(c,E);else{h=E;var T=Zt;Zt|=2;var O=hA();(kr!==c||Mr!==h)&&(fa=null,_d=nn()+500,Tu(c,h));do try{aJ();break}catch(K){fA(c,K)}while(!0);dx(),Pv.current=O,Zt=T,or!==null?h=0:(kr=null,Mr=0,h=vr)}if(h!==0){if(h===2&&(T=Tw(c),T!==0&&(E=T,h=Kx(c,T))),h===1)throw y=Vh,Tu(c,0),ml(c,E),Ti(c,nn()),y;if(h===6)ml(c,E);else{if(T=c.current.alternate,(E&30)===0&&!sJ(T)&&(h=Nv(c,E),h===2&&(O=Tw(c),O!==0&&(E=O,h=Kx(c,O))),h===1))throw y=Vh,Tu(c,0),ml(c,E),Ti(c,nn()),y;switch(c.finishedWork=T,c.finishedLanes=E,h){case 0:case 1:throw Error(n(345));case 2:Pu(c,ki,fa);break;case 3:if(ml(c,E),(E&130023424)===E&&(h=qx+500-nn(),10<h)){if(Bg(c,0)!==0)break;if(T=c.suspendedLanes,(T&E)!==E){ri(),c.pingedLanes|=c.suspendedLanes&T;break}c.timeoutHandle=ex(Pu.bind(null,c,ki,fa),h);break}Pu(c,ki,fa);break;case 4:if(ml(c,E),(E&4194240)===E)break;for(h=c.eventTimes,T=-1;0<E;){var F=31-mr(E);O=1<<F,F=h[F],F>T&&(T=F),E&=~O}if(E=T,E=nn()-E,E=(120>E?120:480>E?480:1080>E?1080:1920>E?1920:3e3>E?3e3:4320>E?4320:1960*iJ(E/1960))-E,10<E){c.timeoutHandle=ex(Pu.bind(null,c,ki,fa),E);break}Pu(c,ki,fa);break;case 5:Pu(c,ki,fa);break;default:throw Error(n(329))}}}return Ti(c,nn()),c.callbackNode===y?cA.bind(null,c):null}function Kx(c,h){var y=Uh;return c.current.memoizedState.isDehydrated&&(Tu(c,h).flags|=256),c=Nv(c,h),c!==2&&(h=ki,ki=y,h!==null&&Zx(h)),c}function Zx(c){ki===null?ki=c:ki.push.apply(ki,c)}function sJ(c){for(var h=c;;){if(h.flags&16384){var y=h.updateQueue;if(y!==null&&(y=y.stores,y!==null))for(var E=0;E<y.length;E++){var T=y[E],O=T.getSnapshot;T=T.value;try{if(!Hs(O(),T))return!1}catch{return!1}}}if(y=h.child,h.subtreeFlags&16384&&y!==null)y.return=h,h=y;else{if(h===c)break;for(;h.sibling===null;){if(h.return===null||h.return===c)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function ml(c,h){for(h&=~Hx,h&=~Rv,c.suspendedLanes|=h,c.pingedLanes&=~h,c=c.expirationTimes;0<h;){var y=31-mr(h),E=1<<y;c[y]=-1,h&=~E}}function dA(c){if((Zt&6)!==0)throw Error(n(327));wd();var h=Bg(c,0);if((h&1)===0)return Ti(c,nn()),null;var y=Nv(c,h);if(c.tag!==0&&y===2){var E=Tw(c);E!==0&&(h=E,y=Kx(c,E))}if(y===1)throw y=Vh,Tu(c,0),ml(c,h),Ti(c,nn()),y;if(y===6)throw Error(n(345));return c.finishedWork=c.current.alternate,c.finishedLanes=h,Pu(c,ki,fa),Ti(c,nn()),null}function Yx(c,h){var y=Zt;Zt|=1;try{return c(h)}finally{Zt=y,Zt===0&&(_d=nn()+500,lv&&ll())}}function ku(c){hl!==null&&hl.tag===0&&(Zt&6)===0&&wd();var h=Zt;Zt|=1;var y=gs.transition,E=on;try{if(gs.transition=null,on=1,c)return c()}finally{on=E,gs.transition=y,Zt=h,(Zt&6)===0&&ll()}}function Qx(){Wi=bd.current,kn(bd)}function Tu(c,h){c.finishedWork=null,c.finishedLanes=0;var y=c.timeoutHandle;if(y!==-1&&(c.timeoutHandle=-1,NX(y)),or!==null)for(y=or.return;y!==null;){var E=y;switch(ox(E),E.tag){case 1:E=E.type.childContextTypes,E!=null&&ov();break;case 3:gd(),kn(Si),kn(Ur),bx();break;case 5:vx(E);break;case 4:gd();break;case 13:kn(Nn);break;case 19:kn(Nn);break;case 10:fx(E.type._context);break;case 22:case 23:Qx()}y=y.return}if(kr=c,or=c=gl(c.current,null),Mr=Wi=h,vr=0,Vh=null,Hx=Rv=Cu=0,ki=Uh=null,xu!==null){for(h=0;h<xu.length;h++)if(y=xu[h],E=y.interleaved,E!==null){y.interleaved=null;var T=E.next,O=y.pending;if(O!==null){var F=O.next;O.next=T,E.next=F}y.pending=E}xu=null}return c}function fA(c,h){do{var y=or;try{if(dx(),yv.current=xv,bv){for(var E=jn.memoizedState;E!==null;){var T=E.queue;T!==null&&(T.pending=null),E=E.next}bv=!1}if(Eu=0,Cr=gr=jn=null,Nh=!1,jh=0,Bx.current=null,y===null||y.return===null){vr=1,Vh=h,or=null;break}e:{var O=c,F=y.return,K=y,J=h;if(h=Mr,K.flags|=32768,J!==null&&typeof J=="object"&&typeof J.then=="function"){var pe=J,Pe=K,Oe=Pe.tag;if((Pe.mode&1)===0&&(Oe===0||Oe===11||Oe===15)){var Te=Pe.alternate;Te?(Pe.updateQueue=Te.updateQueue,Pe.memoizedState=Te.memoizedState,Pe.lanes=Te.lanes):(Pe.updateQueue=null,Pe.memoizedState=null)}var He=LD(F);if(He!==null){He.flags&=-257,FD(He,F,K,O,h),He.mode&1&&jD(O,pe,h),h=He,J=pe;var Xe=h.updateQueue;if(Xe===null){var nt=new Set;nt.add(J),h.updateQueue=nt}else Xe.add(J);break e}else{if((h&1)===0){jD(O,pe,h),Xx();break e}J=Error(n(426))}}else if(In&&K.mode&1){var Jn=LD(F);if(Jn!==null){(Jn.flags&65536)===0&&(Jn.flags|=256),FD(Jn,F,K,O,h),ux(vd(J,K));break e}}O=J=vd(J,K),vr!==4&&(vr=2),Uh===null?Uh=[O]:Uh.push(O),O=F;do{switch(O.tag){case 3:O.flags|=65536,h&=-h,O.lanes|=h;var le=MD(O,J,h);aD(O,le);break e;case 1:K=J;var re=O.type,de=O.stateNode;if((O.flags&128)===0&&(typeof re.getDerivedStateFromError=="function"||de!==null&&typeof de.componentDidCatch=="function"&&(fl===null||!fl.has(de)))){O.flags|=65536,h&=-h,O.lanes|=h;var Ae=ND(O,K,h);aD(O,Ae);break e}}O=O.return}while(O!==null)}mA(y)}catch(at){h=at,or===y&&y!==null&&(or=y=y.return);continue}break}while(!0)}function hA(){var c=Pv.current;return Pv.current=xv,c===null?xv:c}function Xx(){(vr===0||vr===3||vr===2)&&(vr=4),kr===null||(Cu&268435455)===0&&(Rv&268435455)===0||ml(kr,Mr)}function Nv(c,h){var y=Zt;Zt|=2;var E=hA();(kr!==c||Mr!==h)&&(fa=null,Tu(c,h));do try{oJ();break}catch(T){fA(c,T)}while(!0);if(dx(),Zt=y,Pv.current=E,or!==null)throw Error(n(261));return kr=null,Mr=0,vr}function oJ(){for(;or!==null;)pA(or)}function aJ(){for(;or!==null&&!ia();)pA(or)}function pA(c){var h=yA(c.alternate,c,Wi);c.memoizedProps=c.pendingProps,h===null?mA(c):or=h,Bx.current=null}function mA(c){var h=c;do{var y=h.alternate;if(c=h.return,(h.flags&32768)===0){if(y=JX(y,h,Wi),y!==null){or=y;return}}else{if(y=eJ(y,h),y!==null){y.flags&=32767,or=y;return}if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{vr=6,or=null;return}}if(h=h.sibling,h!==null){or=h;return}or=h=c}while(h!==null);vr===0&&(vr=5)}function Pu(c,h,y){var E=on,T=gs.transition;try{gs.transition=null,on=1,lJ(c,h,y,E)}finally{gs.transition=T,on=E}return null}function lJ(c,h,y,E){do wd();while(hl!==null);if((Zt&6)!==0)throw Error(n(327));y=c.finishedWork;var T=c.finishedLanes;if(y===null)return null;if(c.finishedWork=null,c.finishedLanes=0,y===c.current)throw Error(n(177));c.callbackNode=null,c.callbackPriority=0;var O=y.lanes|y.childLanes;if(UQ(c,O),c===kr&&(or=kr=null,Mr=0),(y.subtreeFlags&2064)===0&&(y.flags&2064)===0||Ov||(Ov=!0,bA(ds,function(){return wd(),null})),O=(y.flags&15990)!==0,(y.subtreeFlags&15990)!==0||O){O=gs.transition,gs.transition=null;var F=on;on=1;var K=Zt;Zt|=4,Bx.current=null,nJ(c,y),sA(y,c),PX(Xw),Wg=!!Qw,Xw=Qw=null,c.current=y,rJ(y),mu(),Zt=K,on=F,gs.transition=O}else c.current=y;if(Ov&&(Ov=!1,hl=c,Dv=T),O=c.pendingLanes,O===0&&(fl=null),Xa(y.stateNode),Ti(c,nn()),h!==null)for(E=c.onRecoverableError,y=0;y<h.length;y++)T=h[y],E(T.value,{componentStack:T.stack,digest:T.digest});if(Iv)throw Iv=!1,c=Wx,Wx=null,c;return(Dv&1)!==0&&c.tag!==0&&wd(),O=c.pendingLanes,(O&1)!==0?c===Gx?Bh++:(Bh=0,Gx=c):Bh=0,ll(),null}function wd(){if(hl!==null){var c=rO(Dv),h=gs.transition,y=on;try{if(gs.transition=null,on=16>c?16:c,hl===null)var E=!1;else{if(c=hl,hl=null,Dv=0,(Zt&6)!==0)throw Error(n(331));var T=Zt;for(Zt|=4,Ye=c.current;Ye!==null;){var O=Ye,F=O.child;if((Ye.flags&16)!==0){var K=O.deletions;if(K!==null){for(var J=0;J<K.length;J++){var pe=K[J];for(Ye=pe;Ye!==null;){var Pe=Ye;switch(Pe.tag){case 0:case 11:case 15:zh(8,Pe,O)}var Oe=Pe.child;if(Oe!==null)Oe.return=Pe,Ye=Oe;else for(;Ye!==null;){Pe=Ye;var Te=Pe.sibling,He=Pe.return;if(eA(Pe),Pe===pe){Ye=null;break}if(Te!==null){Te.return=He,Ye=Te;break}Ye=He}}}var Xe=O.alternate;if(Xe!==null){var nt=Xe.child;if(nt!==null){Xe.child=null;do{var Jn=nt.sibling;nt.sibling=null,nt=Jn}while(nt!==null)}}Ye=O}}if((O.subtreeFlags&2064)!==0&&F!==null)F.return=O,Ye=F;else e:for(;Ye!==null;){if(O=Ye,(O.flags&2048)!==0)switch(O.tag){case 0:case 11:case 15:zh(9,O,O.return)}var le=O.sibling;if(le!==null){le.return=O.return,Ye=le;break e}Ye=O.return}}var re=c.current;for(Ye=re;Ye!==null;){F=Ye;var de=F.child;if((F.subtreeFlags&2064)!==0&&de!==null)de.return=F,Ye=de;else e:for(F=re;Ye!==null;){if(K=Ye,(K.flags&2048)!==0)try{switch(K.tag){case 0:case 11:case 15:Tv(9,K)}}catch(at){Bn(K,K.return,at)}if(K===F){Ye=null;break e}var Ae=K.sibling;if(Ae!==null){Ae.return=K.return,Ye=Ae;break e}Ye=K.return}}if(Zt=T,ll(),hn&&typeof hn.onPostCommitFiberRoot=="function")try{hn.onPostCommitFiberRoot(Ft,c)}catch{}E=!0}return E}finally{on=y,gs.transition=h}}return!1}function gA(c,h,y){h=vd(y,h),h=MD(c,h,1),c=cl(c,h,1),h=ri(),c!==null&&(hh(c,1,h),Ti(c,h))}function Bn(c,h,y){if(c.tag===3)gA(c,c,y);else for(;h!==null;){if(h.tag===3){gA(h,c,y);break}else if(h.tag===1){var E=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(fl===null||!fl.has(E))){c=vd(y,c),c=ND(h,c,1),h=cl(h,c,1),c=ri(),h!==null&&(hh(h,1,c),Ti(h,c));break}}h=h.return}}function uJ(c,h,y){var E=c.pingCache;E!==null&&E.delete(h),h=ri(),c.pingedLanes|=c.suspendedLanes&y,kr===c&&(Mr&y)===y&&(vr===4||vr===3&&(Mr&130023424)===Mr&&500>nn()-qx?Tu(c,0):Hx|=y),Ti(c,h)}function vA(c,h){h===0&&((c.mode&1)===0?h=1:(h=Ug,Ug<<=1,(Ug&130023424)===0&&(Ug=4194304)));var y=ri();
vendor: 4,118 bytes, line 9
9c=ua(c,h),c!==null&&(hh(c,h,y),Ti(c,y))}function cJ(c){var h=c.memoizedState,y=0;h!==null&&(y=h.retryLane),vA(c,y)}function dJ(c,h){var y=0;switch(c.tag){case 13:var E=c.stateNode,T=c.memoizedState;T!==null&&(y=T.retryLane);break;case 19:E=c.stateNode;break;default:throw Error(n(314))}E!==null&&E.delete(h),vA(c,y)}var yA;yA=function(c,h,y){if(c!==null)if(c.memoizedProps!==h.pendingProps||Si.current)Ci=!0;else{if((c.lanes&y)===0&&(h.flags&128)===0)return Ci=!1,XX(c,h,y);Ci=(c.flags&131072)!==0}else Ci=!1,In&&(h.flags&1048576)!==0&&QO(h,cv,h.index);switch(h.lanes=0,h.tag){case 2:var E=h.type;Cv(c,h),c=h.pendingProps;var T=ud(h,Ur.current);md(h,y),T=xx(null,h,E,c,T,y);var O=Sx();return h.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(h.tag=1,h.memoizedState=null,h.updateQueue=null,Ei(E)?(O=!0,av(h)):O=!1,h.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,mx(h),T.updater=Sv,h.stateNode=T,T._reactInternals=h,Rx(h,E,c,y),h=Ax(null,h,E,!0,O,y)):(h.tag=0,In&&O&&sx(h),ni(null,h,T,y),h=h.child),h;case 16:E=h.elementType;e:{switch(Cv(c,h),c=h.pendingProps,T=E._init,E=T(E._payload),h.type=E,T=h.tag=hJ(E),c=Ws(E,c),T){case 0:h=Dx(null,h,E,c,y);break e;case 1:h=HD(null,h,E,c,y);break e;case 11:h=$D(null,h,E,c,y);break e;case 14:h=zD(null,h,E,Ws(E.type,c),y);break e}throw Error(n(306,E,""))}return h;case 0:return E=h.type,T=h.pendingProps,T=h.elementType===E?T:Ws(E,T),Dx(c,h,E,T,y);case 1:return E=h.type,T=h.pendingProps,T=h.elementType===E?T:Ws(E,T),HD(c,h,E,T,y);case 3:e:{if(qD(h),c===null)throw Error(n(387));E=h.pendingProps,O=h.memoizedState,T=O.element,oD(c,h),gv(h,E,null,y);var F=h.memoizedState;if(E=F.element,O.isDehydrated)if(O={element:E,isDehydrated:!1,cache:F.cache,pendingSuspenseBoundaries:F.pendingSuspenseBoundaries,transitions:F.transitions},h.updateQueue.baseState=O,h.memoizedState=O,h.flags&256){T=vd(Error(n(423)),h),h=WD(c,h,E,y,T);break e}else if(E!==T){T=vd(Error(n(424)),h),h=WD(c,h,E,y,T);break e}else for(qi=sl(h.stateNode.containerInfo.firstChild),Hi=h,In=!0,qs=null,y=iD(h,null,E,y),h.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(fd(),E===T){h=da(c,h,y);break e}ni(c,h,E,y)}h=h.child}return h;case 5:return uD(h),c===null&&lx(h),E=h.type,T=h.pendingProps,O=c!==null?c.memoizedProps:null,F=T.children,Jw(E,T)?F=null:O!==null&&Jw(E,O)&&(h.flags|=32),BD(c,h),ni(c,h,F,y),h.child;case 6:return c===null&&lx(h),null;case 13:return GD(c,h,y);case 4:return gx(h,h.stateNode.containerInfo),E=h.pendingProps,c===null?h.child=hd(h,null,E,y):ni(c,h,E,y),h.child;case 11:return E=h.type,T=h.pendingProps,T=h.elementType===E?T:Ws(E,T),$D(c,h,E,T,y);case 7:return ni(c,h,h.pendingProps,y),h.child;case 8:return ni(c,h,h.pendingProps.children,y),h.child;case 12:return ni(c,h,h.pendingProps.children,y),h.child;case 10:e:{if(E=h.type._context,T=h.pendingProps,O=h.memoizedProps,F=T.value,yn(hv,E._currentValue),E._currentValue=F,O!==null)if(Hs(O.value,F)){if(O.children===T.children&&!Si.current){h=da(c,h,y);break e}}else for(O=h.child,O!==null&&(O.return=h);O!==null;){var K=O.dependencies;if(K!==null){F=O.child;for(var J=K.firstContext;J!==null;){if(J.context===E){if(O.tag===1){J=ca(-1,y&-y),J.tag=2;var pe=O.updateQueue;if(pe!==null){pe=pe.shared;var Pe=pe.pending;Pe===null?J.next=J:(J.next=Pe.next,Pe.next=J),pe.pending=J}}O.lanes|=y,J=O.alternate,J!==null&&(J.lanes|=y),hx(O.return,y,h),K.lanes|=y;break}J=J.next}}else if(O.tag===10)F=O.type===h.type?null:O.child;else if(O.tag===18){if(F=O.return,F===null)throw Error(n(341));F.lanes|=y,K=F.alternate,K!==null&&(K.lanes|=y),hx(F,y,h),F=O.sibling}else F=O.child;if(F!==null)F.return=O;else for(F=O;F!==null;){if(F===h){F=null;break}if(O=F.sibling,O!==null){O.return=F.return,F=O;break}F=F.return}O=F}ni(c,h,T.children,y),h=h.child}return h;case 9:return T=h.type,E=h.pendingProps.children,md(h,y),T=ps(T),E=E(T),h.flags|=1,ni(c,h,E,y),h.child;case 14:return E=h.type,T=Ws(E,h.pendingProps),T=Ws(E.type,T),zD(c,h,E,T,y);case 15:return VD(c,h,h.type,h.pendingProps,y);case 17:return E=h.type,T=h.pendingProps,T=h.elementType===E?T:Ws(E,T),Cv(c,h),h.tag=1,Ei(E)?(c=!0,av(h)
vendor: 10,407 bytes, line 9
9):c=!1,md(h,y),DD(h,E,T),Rx(h,E,T,y),Ax(null,h,E,!0,c,y);case 19:return ZD(c,h,y);case 22:return UD(c,h,y)}throw Error(n(156,h.tag))};function bA(c,h){return un(c,h)}function fJ(c,h,y,E){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vs(c,h,y,E){return new fJ(c,h,y,E)}function Jx(c){return c=c.prototype,!(!c||!c.isReactComponent)}function hJ(c){if(typeof c=="function")return Jx(c)?1:0;if(c!=null){if(c=c.$$typeof,c===j)return 11;if(c===H)return 14}return 2}function gl(c,h){var y=c.alternate;return y===null?(y=vs(c.tag,h,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=h,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=c.flags&14680064,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,h=c.dependencies,y.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y}function jv(c,h,y,E,T,O){var F=2;if(E=c,typeof c=="function")Jx(c)&&(F=1);else if(typeof c=="string")F=5;else e:switch(c){case I:return Ru(y.children,T,O,h);case D:F=8,T|=8;break;case L:return c=vs(12,y,h,T|2),c.elementType=L,c.lanes=O,c;case V:return c=vs(13,y,h,T),c.elementType=V,c.lanes=O,c;case B:return c=vs(19,y,h,T),c.elementType=B,c.lanes=O,c;case G:return Lv(y,T,O,h);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case A:F=10;break e;case $:F=9;break e;case j:F=11;break e;case H:F=14;break e;case te:F=16,E=null;break e}throw Error(n(130,c==null?c:typeof c,""))}return h=vs(F,y,h,T),h.elementType=c,h.type=E,h.lanes=O,h}function Ru(c,h,y,E){return c=vs(7,c,E,h),c.lanes=y,c}function Lv(c,h,y,E){return c=vs(22,c,E,h),c.elementType=G,c.lanes=y,c.stateNode={isHidden:!1},c}function e1(c,h,y){return c=vs(6,c,null,h),c.lanes=y,c}function t1(c,h,y){return h=vs(4,c.children!==null?c.children:[],c.key,h),h.lanes=y,h.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},h}function pJ(c,h,y,E,T){this.tag=h,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pw(0),this.expirationTimes=Pw(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pw(0),this.identifierPrefix=E,this.onRecoverableError=T,this.mutableSourceEagerHydrationData=null}function n1(c,h,y,E,T,O,F,K,J){return c=new pJ(c,h,y,K,J),h===1?(h=1,O===!0&&(h|=8)):h=0,O=vs(3,null,null,h),c.current=O,O.stateNode=c,O.memoizedState={element:E,isDehydrated:y,cache:null,transitions:null,pendingSuspenseBoundaries:null},mx(O),c}function mJ(c,h,y){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:k,key:E==null?null:""+E,children:c,containerInfo:h,implementation:y}}function _A(c){if(!c)return al;c=c._reactInternals;e:{if(tt(c)!==c||c.tag!==1)throw Error(n(170));var h=c;do{switch(h.tag){case 3:h=h.stateNode.context;break e;case 1:if(Ei(h.type)){h=h.stateNode.__reactInternalMemoizedMergedChildContext;break e}}h=h.return}while(h!==null);throw Error(n(171))}if(c.tag===1){var y=c.type;if(Ei(y))return KO(c,y,h)}return h}function wA(c,h,y,E,T,O,F,K,J){return c=n1(y,E,!0,c,T,O,F,K,J),c.context=_A(null),y=c.current,E=ri(),T=pl(y),O=ca(E,T),O.callback=h??null,cl(y,O,T),c.current.lanes=T,hh(c,T,E),Ti(c,E),c}function Fv(c,h,y,E){var T=h.current,O=ri(),F=pl(T);return y=_A(y),h.context===null?h.context=y:h.pendingContext=y,h=ca(O,F),h.payload={element:c},E=E===void 0?null:E,E!==null&&(h.callback=E),c=cl(T,h,F),c!==null&&(Zs(c,T,F,O),mv(c,T,F)),F}function $v(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function xA(c,h){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y<h?y:h}}function r1(c,h){xA(c,h),(c=c.alternate)&&xA(c,h)}function gJ(){return null}var SA=typeof reportError=="function"?reportError:function(c){console.error(c)};function i1(c){this._internalRoot=c}zv.prototype.render=i1.prototype.render=function(c){var h=this._internalRoot;if(h===null)throw Error(n(409));Fv(c,h,null,null)},zv.prototype.unmount=i1.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var h=c.containerInfo;ku(function(){Fv(null,c,null,null)}),h[sa]=null}};function zv(c){this._internalRoot=c}zv.prototype.unstable_scheduleHydration=function(c){if(c){var h=oO();c={blockedOn:null,target:c,priority:h};for(var y=0;y<nl.length&&h!==0&&h<nl[y].priority;y++);nl.splice(y,0,c),y===0&&uO(c)}};function s1(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function Vv(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function EA(){}function vJ(c,h,y,E,T){if(T){if(typeof E=="function"){var O=E;E=function(){var pe=$v(F);O.call(pe)}}var F=wA(h,E,c,0,null,!1,!1,"",EA);return c._reactRootContainer=F,c[sa]=F.current,Th(c.nodeType===8?c.parentNode:c),ku(),F}for(;T=c.lastChild;)c.removeChild(T);if(typeof E=="function"){var K=E;E=function(){var pe=$v(J);K.call(pe)}}var J=n1(c,0,!1,null,null,!1,!1,"",EA);return c._reactRootContainer=J,c[sa]=J.current,Th(c.nodeType===8?c.parentNode:c),ku(function(){Fv(h,J,y,E)}),J}function Uv(c,h,y,E,T){var O=y._reactRootContainer;if(O){var F=O;if(typeof T=="function"){var K=T;T=function(){var J=$v(F);K.call(J)}}Fv(h,F,c,T)}else F=vJ(y,h,c,T,E);return $v(F)}iO=function(c){switch(c.tag){case 3:var h=c.stateNode;if(h.current.memoizedState.isDehydrated){var y=fh(h.pendingLanes);y!==0&&(Rw(h,y|1),Ti(h,nn()),(Zt&6)===0&&(_d=nn()+500,ll()))}break;case 13:ku(function(){var E=ua(c,1);if(E!==null){var T=ri();Zs(E,c,1,T)}}),r1(c,1)}},Iw=function(c){if(c.tag===13){var h=ua(c,134217728);if(h!==null){var y=ri();Zs(h,c,134217728,y)}r1(c,134217728)}},sO=function(c){if(c.tag===13){var h=pl(c),y=ua(c,h);if(y!==null){var E=ri();Zs(y,c,h,E)}r1(c,h)}},oO=function(){return on},aO=function(c,h){var y=on;try{return on=c,h()}finally{on=y}},Zc=function(c,h,y){switch(h){case"input":if(ht(c,y),h=y.name,y.type==="radio"&&h!=null){for(y=c;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll("input[name="+JSON.stringify(""+h)+'][type="radio"]'),h=0;h<y.length;h++){var E=y[h];if(E!==c&&E.form===c.form){var T=sv(E);if(!T)throw Error(n(90));Ce(E),ht(E,T)}}}break;case"textarea":ze(c,y);break;case"select":h=y.value,h!=null&&Re(c,!!y.multiple,h,!1)}},fu=Yx,hu=ku;var yJ={usingClientEntryPoint:!1,Events:[Ih,ad,sv,$g,dh,Yx]},Hh={findFiberByHostInstance:yu,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},bJ={bundleType:Hh.bundleType,version:Hh.version,rendererPackageName:Hh.rendererPackageName,rendererConfig:Hh.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:R.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=Un(c),c===null?null:c.stateNode},findFiberByHostInstance:Hh.findFiberByHostInstance||gJ,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Bv=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Bv.isDisabled&&Bv.supportsFiber)try{Ft=Bv.inject(bJ),hn=Bv}catch{}}return Pi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=yJ,Pi.createPortal=function(c,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!s1(h))throw Error(n(200));return mJ(c,h,null,y)},Pi.createRoot=function(c,h){if(!s1(c))throw Error(n(299));var y=!1,E="",T=SA;return h!=null&&(h.unstable_strictMode===!0&&(y=!0),h.identifierPrefix!==void 0&&(E=h.identifierPrefix),h.onRecoverableError!==void 0&&(T=h.onRecoverableError)),h=n1(c,1,!1,null,null,y,!1,E,T),c[sa]=h.current,Th(c.nodeType===8?c.parentNode:c),new i1(h)},Pi.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var h=c._reactInternals;if(h===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=Un(h),c=c===null?null:c.stateNode,c},Pi.flushSync=function(c){return ku(c)},Pi.hydrate=function(c,h,y){if(!Vv(h))throw Error(n(200));return Uv(null,c,h,!0,y)},Pi.hydrateRoot=function(c,h,y){if(!s1(c))throw Error(n(405));var E=y!=null&&y.hydratedSources||null,T=!1,O="",F=SA;if(y!=null&&(y.unstable_strictMode===!0&&(T=!0),y.identifierPrefix!==void 0&&(O=y.identifierPrefix),y.onRecoverableError!==void 0&&(F=y.onRecoverableError)),h=wA(h,null,c,1,y??null,T,!1,O,F),c[sa]=h.current,Th(c),E)for(c=0;c<E.length;c++)y=E[c],T=y._getVersion,T=T(y._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[y,T]:h.mutableSourceEagerHydrationData.push(y,T);return new zv(h)},Pi.render=function(c,h,y){if(!Vv(h))throw Error(n(200));return Uv(null,c,h,!1,y)},Pi.unmountComponentAtNode=function(c){if(!Vv(c))throw Error(n(40));return c._reactRootContainer?(ku(function(){Uv(null,null,c,!1,function(){c._reactRootContainer=null,c[sa]=null})}),!0):!1},Pi.unstable_batchedUpdates=Yx,Pi.unstable_renderSubtreeIntoContainer=function(c,h,y,E){if(!Vv(y))throw Error(n(200));if(c==null||c._reactInternals===void 0)throw Error(n(38));return Uv(c,h,y,!1,E)},Pi.version="18.3.1-next-f1338f8080-20240426",Pi}var NA;function z5(){if(NA)return u1.exports;NA=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),u1.exports=TJ(),u1.exports}var jA;function PJ(){if(jA)return Hv;jA=1;var e=z5();return Hv.createRoot=e.createRoot,Hv.hydrateRoot=e.hydrateRoot,Hv}var RJ=PJ();const IJ=vo(RJ);var V5=e=>{throw TypeError(e)}
9,OJ=(e,t,n)=>t.has(e)||V5("Cannot "+n),f1=(e,t,n)=>(OJ(e,t,"read from private field"),n?n.call(e):t.get(e)),DJ=(e,t,n)=>t.has(e)?V5("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),LA="popstate";function AJ(e={}){function t(r,i){let{pathname:s,search:o,hash:a}=r.location;return dm("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Go(i)}return NJ(t,n,null,e)}function Nt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MJ(){return Math.random().toString(36).substring(2,10)}function FA(e,t){return{usr:e.state,key:e.key,idx:t}}function dm(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ru(t):t,state:n,key:t&&t.key||r||MJ()}}function Go({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ru(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function NJ(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a="POP",l=null,u=f();u==null&&(u=0,o.replaceState({...o.state,idx:u},""));function f(){return(o.state||{idx:null}).idx}function d(){a="POP";let w=f(),x=w==null?null:w-u;u=w,l&&l({action:a,location:_.location,delta:x})}function p(w,x){a="PUSH";let S=dm(_.location,w,x);u=f()+1;let C=FA(S,u),R=_.createHref(S);try{o.pushState(C,"",R)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(R)}s&&l&&l({action:a,location:_.location,delta:1})}function m(w,x){a="REPLACE";let S=dm(_.location,w,x);u=f();let C=FA(S,u),R=_.createHref(S);o.replaceState(C,"",R),s&&l&&l({action:a,location:_.location,delta:0})}function v(w){return U5(w)}let _={get action(){return a},get location(){return e(i,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(LA,d),l=w,()=>{i.removeEventListener(LA,d),l=null}},createHref(w){return t(i,w)},createURL:v,encodeLocation(w){let x=v(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:p,replace:m,go(w){return o.go(w)}};return _}function U5(e,t=!1){let n="http://localhost";
9typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Nt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Go(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var bp,$A=class{constructor(e){if(DJ(this,bp,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(f1(this,bp).has(e))return f1(this,bp).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){f1(this,bp).set(e,t)}};bp=new WeakMap;var jJ=new Set(["lazy","caseSensitive","path","id","index","children"]);function LJ(e){return jJ.has(e)}var FJ=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function $J(e){return FJ.has(e)}function zJ(e){return e.index===!0}function fm(e,t,n=[],r={},i=!1){return e.map((s,o)=>{let a=[...n,String(o)],l=typeof s.id=="string"?s.id:a.join("-");if(Nt(s.index!==!0||!s.children,"Cannot specify children on an index route"),Nt(i||!r[l],`Found a route id collision on i
9d "${l}".  Route id's must be globally unique within Data Router usages`),zJ(s)){let u={...s,id:l};return r[l]=zA(u,t(u)),u}else{let u={...s,id:l,children:void 0};return r[l]=zA(u,t(u)),s.children&&(u.children=fm(s.children,t,a,r,i)),u}})}function zA(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Rl(e,t,n="/"){return _p(e,t,n,!1)}function _p(e,t,n,r){let i=typeof t=="string"?ru(t):t,s=js(i.pathname||"/",n);if(s==null)return null;let o=B5(e);UJ(o);let a=null;for(let l=0;a==null&&l<o.length;++l){let u=q5(s);a=QJ(o[l],u,r)}return a}function VJ(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function B5(e,t=[],n=[],r="",i=!1){let s=(o,a,l=i,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};if(f.relativePath.startsWith("/")){if(!f.relativePath.startsWith(r)&&l)return;Nt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length)}let d=Fo([r,f.relativePath]),p=n.concat(f);o.children&&o.children.length>0&&(Nt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),B5(o.children,t,p,d,l)),!(o.path==null&&!o.index)&&t.push({path:d,score:ZJ(d,o.index),routesMeta:p})};return e.forEach((o,a)=>{if(o.path===""||!o.path?.includes("?"))s(o,a);else for(let l of H5(o.path))s(o,a,!0,l)}),t}function H5(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=H5(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function UJ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:YJ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var BJ=/^:[\w-]+$/,HJ=3,qJ=2,WJ=1,GJ=10,KJ=-2,VA=e=>e==="*";function ZJ(e,t){let n=e.split("/"),r=n.length;return n.some(VA)&&(r+=KJ),t&&(r+=qJ),n.filter(i=>!VA(i)).reduce((i,s)=>i+(BJ.test(s)?HJ:s===""?WJ:GJ),r)}function YJ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function QJ(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],u=a===r.length-1,f=s==="/"?t:t.slice(s.length)||"/",d=hm({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},f),p=l.route;if(!d&&u&&n&&!r[r.length-1].route.index&&(d=hm({path:l.relativePath,caseSensitive:l.caseSensitive,end:!1},f)),!d)return null;
9Object.assign(i,d.params),o.push({params:i,pathname:Fo([s,d.pathname]),pathnameBase:nee(Fo([s,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(s=Fo([s,d.pathnameBase]))}return o}function hm(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=XJ(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,{paramName:f,isOptional:d},p)=>{if(f==="*"){let v=a[p]||"";o=s.slice(0,s.length-v.length).replace(/(.)\/+$/,"$1")}const m=a[p];return d&&!m?u[f]=void 0:u[f]=(m||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:o,pattern:e}}function XJ(e,t=!1,n=!0){Fn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function q5(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function js(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function JJ({basename:e,pathname:t}){return t==="/"?e:Fo([e,t])}var eee=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kb=e=>eee.test(e);function tee(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ru(e):e,s;if(n)if(Kb(n))s=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Fn(!1,`Pathnames cannot have embedded double slashes - normalizing ${o} -> ${n}`)}n.startsWith("/")?s=UA(n.substring(1),"/"):s=UA(n,t)}else s=t;return{pathname:s,search:ree(r),hash:iee(i)}}function UA(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function h1(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function W5(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Zb(e){let t=W5(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Yb(e,t,n,r=!1){let i;typeof e=="string"?i=ru(e):(i={...e},Nt(!i.pathname||!i.pathname.includes("?"),h1("?","pathname","search",i)),Nt(!i.pathname||!i.pathname.includes("#"),h1("#","pathname","hash",i)),Nt(!i.search||!i.search.includes("#"),h1("#","search","hash",i)));let s=e===""||i.pathname==="",o=s?"/":i.pathname,a;if(o==null)a=n;else{let d=t.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;i.pathname=p.join("/")}a=d>=0?t[d]:"/"}let l=tee(i,a),u=o&&o!=="/"&&o.endsWith("/"),f=(s||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}var Fo=e=>e.join("/").replace(/\/\/+/g,"/"),nee=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ree=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,iee=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,T0=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function pm(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function FT(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ml=Symbol("Uninstrumented");function see(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(i=>
9i({id:t.id,index:t.index,path:t.path,instrument(s){let o=Object.keys(n);for(let a of o)s[a]&&n[a].push(s[a])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let i=Xd(n.lazy,t.lazy,()=>{});i&&(r.lazy=i)}if(typeof t.lazy=="object"){let i=t.lazy;["middleware","loader","action"].forEach(s=>{let o=i[s],a=n[`lazy.${s}`];if(typeof o=="function"&&a.length>0){let l=Xd(a,o,()=>{});l&&(r.lazy=Object.assign(r.lazy||{},{[s]:l}))}})}return["loader","action"].forEach(i=>{let s=t[i];if(typeof s=="function"&&n[i].length>0){let o=s[Ml]??s,a=Xd(n[i],o,(...l)=>BA(l[0]));a&&(a[Ml]=o,r[i]=a)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(i=>{let s=i[Ml]??i,o=Xd(n.middleware,s,(...a)=>BA(a[0]));return o?(o[Ml]=s,o):i})),r}function oee(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(i){let s=Object.keys(i);for(let o of s)i[o]&&n[o].push(i[o])}})),n.navigate.length>0){let r=e.navigate[Ml]??e.navigate,i=Xd(n.navigate,r,(...s)=>{let[o,a]=s;return{to:typeof o=="number"||typeof o=="string"?o:o?Go(o):".",...HA(e,a??{})}});i&&(i[Ml]=r,e.navigate=i)}if(n.fetch.length>0){let r=e.fetch[Ml]??e.fetch,i=Xd(n.fetch,r,(...s)=>{let[o,,a,l]=s;return{href:a??".",fetcherKey:o,...HA(e,l??{})}});i&&(i[Ml]=r,e.fetch=i)}return e}function Xd(e,t,n){return e.length===0?null:async(...r)=>{let i=await G5(e,n(...r),()=>t(...r),e.length-1);if(i.type==="error")throw i.value;return i.value}}async function G5(e,t,n,r){let i=e[r],s;if(i){let o,a=async()=>(o?console.error("You cannot call instrumented handlers more than once"):o=G5(e,t,n,r-1),s=await o,Nt(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await i(a,t)}catch(l){console.error("An instrumentation function threw an error:",l)}o||await a(),await o}else try{s={type:"success",value:await n()}}catch(o){s={type:"error",value:o}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function BA(e){let{request:t,context:n,params:r,unstable_pattern:i}=e;return{request:aee(t),params:{...r},unstable_pattern:i,context:lee(n)}}function HA(e,t){return{currentUrl:Go(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function aee(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function lee(e){if(cee(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var uee=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function cee(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===uee}var K5=["POST","PUT","PATCH","DELETE"],dee=new Set(K5),fee=["GET",...K5],hee=new Set(fee),pee=new Set([301,302,303,307,308]),mee=new Set([307,308]),p1={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},gee={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Wh={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},vee=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),Z5="remix-router-transitions",Y5=Symbol("ResetLoaderData");function yee(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Nt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||vee,s=i;if(e.unstable_instrumentations){let Q=e.unstable_instrumentations;s=oe=>({...i(oe),...see(Q.map(me=>me.route).filter(Boolean),oe)})}let o={},a=fm(e.routes,s,void 0,o),l,u=e.basename||"/";u.startsWith("/")||(u=`/${u}`);let f=e.dataStrategy||See,d={...e.future},p=null,m=new Set,v=null,_=null,w=null,x=e.hydrationData!=null,S=Rl(a,e.history.location,u),C=!1,R=null,P;if(S==null&&!e.patchRoutesOnNavigation){let Q=Ss(404,{pathname:e.history.location.pathname}),{matches:oe,route:me}=qv(a);P=!0,S=oe,R={[me.id]:Q}}else if(S&&!e.hydrationData&&fu(S,a,e.history.location.pathname).active&&(S=null),S)if(S.some(Q=>Q.route.lazy))P=!1;else if(!S.some(Q=>$T(Q.route)))P=!0;else{let Q=e.hydrationData?e.hydrationData.loaderData:null,oe=e.hydrationData?e.hydrationData.errors:null;if(oe){let me=S.findIndex(Ie=>oe[Ie.route.id]!==void 0);P=S.slice(0,me+1).every(Ie=>!WE(Ie.route,Q,oe))}else P=S.every(me=>!WE(me.route,Q,oe))}else{P=!1,S=[];let Q=fu(null,a,e.history.location.pathname);Q.active&&Q.matches&&(C=!0,S=Q.matches)}let k,I={historyAction:e.history.action,location:e.history.location,matches:S,initialized:P,navigation:p1,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},D="POP",L=!1,A,$=!1,j=new Map,V=null,B=!1,H=!1,te=new Set,G=new Map,Z=0,Y=-1,M=new Map,q=new Set,z=new Map,N=new Map,ee=new Set,X=new Map,ne,ae=null;function se(){if(p=e.history.listen(({action:Q,location:oe,delta:me})=>{if(ne){ne(),ne=void 0;return}Fn(X.size===0||me!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs.  This can also happen if you are using createHashRouter and the user manually changes the URL.");let Ie=Zc({currentLocation:I.location,nextLocation:oe,historyAction:Q});if(Ie&&me!=null){let je=new Promise(it=>{ne=it});e.history.go(me*-1),Za(Ie,{state:"blocked",location:oe,proceed(){Za(Ie,{state:"proceeding",proceed:void 0,reset:void 0,location:oe}),je.then(()=>e.history.go(me))},reset(){let it=new Map(I.blockers);it.set(Ie,Wh),ke({blockers:it})}});return}return Be(Q,oe)}),n){Fee(t,j);let Q=()=>$ee(t,j);t.addEventListener("pagehide",Q),V=()=>t.removeEventListener("pagehide",Q)}return I.initialized||Be("POP",I.location,{initialHydration:!0}),k}function ce(){p&&p(),V&&V(),m.clear(),A&&A.abort(),I.fetchers.forEac
9h((Q,oe)=>Sn(oe)),I.blockers.forEach((Q,oe)=>Vr(oe))}function fe(Q){return m.add(Q),()=>m.delete(Q)}function ke(Q,oe={}){Q.matches&&(Q.matches=Q.matches.map(je=>{let it=o[je.route.id],ot=je.route;return ot.element!==it.element||ot.errorElement!==it.errorElement||ot.hydrateFallbackElement!==it.hydrateFallbackElement?{...je,route:it}:je})),I={...I,...Q};let me=[],Ie=[];I.fetchers.forEach((je,it)=>{je.state==="idle"&&(ee.has(it)?me.push(it):Ie.push(it))}),ee.forEach(je=>{!I.fetchers.has(je)&&!G.has(je)&&me.push(je)}),[...m].forEach(je=>je(I,{deletedFetchers:me,viewTransitionOpts:oe.viewTransitionOpts,flushSync:oe.flushSync===!0})),me.forEach(je=>Sn(je)),Ie.forEach(je=>I.fetchers.delete(je))}function Ce(Q,oe,{flushSync:me}={}){let Ie=I.actionData!=null&&I.navigation.formMethod!=null&&hi(I.navigation.formMethod)&&I.navigation.state==="loading"&&Q.state?._isRedirect!==!0,je;oe.actionData?Object.keys(oe.actionData).length>0?je=oe.actionData:je=null:Ie?je=I.actionData:je=null;let it=oe.loaderData?eM(I.loaderData,oe.loaderData,oe.matches||[],oe.errors):I.loaderData,ot=I.blockers;ot.size>0&&(ot=new Map(ot),ot.forEach((tt,ft)=>ot.set(ft,Wh)));let st=B?!1:dh(Q,oe.matches||I.matches),dt=L===!0||I.navigation.formMethod!=null&&hi(I.navigation.formMethod)&&Q.state?._isRedirect!==!0;l&&(a=l,l=void 0),B||D==="POP"||(D==="PUSH"?e.history.push(Q,Q.state):D==="REPLACE"&&e.history.replace(Q,Q.state));let pt;if(D==="POP"){let tt=j.get(I.location.pathname);tt&&tt.has(Q.pathname)?pt={currentLocation:I.location,nextLocation:Q}:j.has(Q.pathname)&&(pt={currentLocation:Q,nextLocation:I.location})}else if($){let tt=j.get(I.location.pathname);tt?tt.add(Q.pathname):(tt=new Set([Q.pathname]),j.set(I.location.pathname,tt)),pt={currentLocation:I.location,nextLocation:Q}}ke({...oe,actionData:je,loaderData:it,historyAction:D,location:Q,initialized:!0,navigation:p1,revalidation:"idle",restoreScrollPosition:st,preventScrollReset:dt,blockers:ot},{viewTransitionOpts:pt,flushSync:me===!0}),D="POP",L=!1,$=!1,B=!1,H=!1,ae?.resolve(),ae=null}async function Se(Q,oe){if(typeof Q=="number"){e.history.go(Q);return}let me=qE(I.location,I.matches,u,Q,oe?.fromRouteId,oe?.relative),{path:Ie,submission:je,error:it}=qA(!1,me,oe),ot=I.location,st=dm(I.location,Ie,oe&&oe.state);st={...st,...e.history.encodeLocation(st)};let dt=oe&&oe.replace!=null?oe.replace:void 0,pt="PUSH";dt===!0?pt="REPLACE":dt===!1||je!=null&&hi(je.formMethod)&&je.formAction===I.location.pathname+I.location.search&&(pt="REPLACE");let tt=oe&&"preventScrollReset"in oe?oe.preventScrollReset===!0:void 0,ft=(oe&&oe.flushSync)===!0,Wt=Zc({currentLocation:ot,nextLocation:st,historyAction:pt});if(Wt){Za(Wt,{state:"blocked",location:st,proceed(){Za(Wt,{state:"proceeding",proceed:void 0,reset:void 0,location:st}),Se(Q,oe)},reset(){let vn=new Map(I.blockers);vn.set(Wt,Wh),ke({blockers:vn})}});return}await Be(pt,st,{submission:je,pendingError:it,preventScrollReset:tt,replace:oe&&oe.replace,enableViewTransition:oe&&oe.viewTransition,flushSync:ft})}function Fe(){ae||(ae=zee()),he(),ke({revalidation:"loading"});let Q=ae.promise;return I.navigation.state==="submitting"?Q:I.navigation.state==="idle"?(Be(I.historyAction,I.location,{startUninterruptedRevalidation:!0}),Q):(Be(D||I.historyAction,I.navigation.location,{overrideNavigation:I.navigation,enableViewTransition:$===!0}),Q)}async function Be(Q,oe,me){A&&A.abort(),A=null,D=Q,B=(me&&me.startUninterruptedRevalidation)===!0,$g(I.location,I.matches),L=(me&&me.preventScrollReset)===!0,$=(me&&me.enableViewTransition)===!0;let Ie=l||a,je=me&&me.overrideNavigation,it=me?.initialHydration&&I.matches&&I.matches.length>0&&!C?I.matches:Rl(Ie,oe,u),ot=(me&&me.flushSync)===!0;if(it&&I.initialized&&!H&&Oee(I.location,oe)&&!(me&&me.submission&&hi(me.submission.formMethod))){Ce(oe,{matches:it},{flushSync:ot});return}let st=fu(it,Ie,oe.pathname);if(st.active&&st.matches&&(it=st.matches),!it){let{error:Xn,notFoundMatches:un,route:cn}=xo(oe.pathname);Ce(oe,{matches:un,loaderData:{},errors:{[cn.id]:Xn}},{flushSync:ot});return}A=new AbortController;let dt=Fd(e.history,oe,A.signal,me&&me.submission),pt=e.getContext?await e.getContext():new $A,tt;if(me&&me.pendingError)tt=[Il(it).route.id,{type:"error",error:me.pendingError}];else if(me&&me.submission&&hi(me.submission.formMethod)){let Xn=await wt(dt,oe,me.submission,it,pt,st.active,me&&me.
9initialHydration===!0,{replace:me.replace,flushSync:ot});if(Xn.shortCircuited)return;if(Xn.pendingActionResult){let[un,cn]=Xn.pendingActionResult;if(Qi(cn)&&pm(cn.error)&&cn.error.status===404){A=null,Ce(oe,{matches:Xn.matches,loaderData:{},errors:{[un]:cn.error}});return}}it=Xn.matches||it,tt=Xn.pendingActionResult,je=m1(oe,me.submission),ot=!1,st.active=!1,dt=Fd(e.history,dt.url,dt.signal)}let{shortCircuited:ft,matches:Wt,loaderData:vn,errors:Un}=await ht(dt,oe,it,pt,st.active,je,me&&me.submission,me&&me.fetcherSubmission,me&&me.replace,me&&me.initialHydration===!0,ot,tt);ft||(A=null,Ce(oe,{matches:Wt||it,...tM(tt),loaderData:vn,errors:Un}))}async function wt(Q,oe,me,Ie,je,it,ot,st={}){he();let dt=jee(oe,me);if(ke({navigation:dt},{flushSync:st.flushSync===!0}),it){let ft=await hu(Ie,oe.pathname,Q.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:vn,route:Un}=qv(a);return{matches:vn,pendingActionResult:[Un.id,{type:"error",error:ft.error}]}}let Wt=Il(ft.partialMatches).route.id;return{matches:ft.partialMatches,pendingActionResult:[Wt,{type:"error",error:ft.error}]}}else if(ft.matches)Ie=ft.matches;else{let{notFoundMatches:Wt,error:vn,route:Un}=xo(oe.pathname);return{matches:Wt,pendingActionResult:[Un.id,{type:"error",error:vn}]}}}let pt,tt=Xy(Ie,oe);if(!tt.route.action&&!tt.route.lazy)pt={type:"error",error:Ss(405,{method:Q.method,pathname:oe.pathname,routeId:tt.route.id})};else{let ft=cf(s,o,Q,Ie,tt,ot?[]:r,je),Wt=await ze(Q,ft,je,null);if(pt=Wt[tt.route.id],!pt){for(let vn of Ie)if(Wt[vn.route.id]){pt=Wt[vn.route.id];break}}if(Q.signal.aborted)return{shortCircuited:!0}}if(tc(pt)){let ft;return st&&st.replace!=null?ft=st.replace:ft=QA(pt.response.headers.get("Location"),new URL(Q.url),u)===I.location.pathname+I.location.search,await xe(Q,pt,!0,{submission:me,replace:ft}),{shortCircuited:!0}}if(Qi(pt)){let ft=Il(Ie,tt.route.id);return(st&&st.replace)!==!0&&(D="PUSH"),{matches:Ie,pendingActionResult:[ft.route.id,pt,tt.route.id]}}return{matches:Ie,pendingActionResult:[tt.route.id,pt]}}async function ht(Q,oe,me,Ie,je,it,ot,st,dt,pt,tt,ft){let Wt=it||m1(oe,ot),vn=ot||st||rM(Wt),Un=!B&&!pt;if(je){if(Un){let hn=W(ft);ke({navigation:Wt,...hn!==void 0?{actionData:hn}:{}},{flushSync:tt})}let Ft=await hu(me,oe.pathname,Q.signal);if(Ft.type==="aborted")return{shortCircuited:!0};if(Ft.type==="error"){if(Ft.partialMatches.length===0){let{matches:Xa,route:mr}=qv(a);return{matches:Xa,loaderData:{},errors:{[mr.id]:Ft.error}}}let hn=Il(Ft.partialMatches).route.id;return{matches:Ft.partialMatches,loaderData:{},errors:{[hn]:Ft.error}}}else if(Ft.matches)me=Ft.matches;else{let{error:hn,notFoundMatches:Xa,route:mr}=xo(oe.pathname);return{matches:Xa,loaderData:{},errors:{[mr.id]:hn}}}}let Xn=l||a,{dsMatches:un,revalidatingFetchers:cn}=WA(Q,Ie,s,o,e.history,I,me,vn,oe,pt?[]:r,pt===!0,H,te,ee,z,q,Xn,u,e.patchRoutesOnNavigation!=null,ft);if(Y=++Z,!e.dataStrategy&&!un.some(Ft=>Ft.shouldLoad)&&!un.some(Ft=>Ft.route.middleware&&Ft.route.middleware.length>0)&&cn.length===0){let Ft=Ui();return Ce(oe,{matches:me,loaderData:{},errors:ft&&Qi(ft[1])?{[ft[0]]:ft[1].error}:null,...tM(ft),...Ft?{fetchers:new Map(I.fetchers)}:{}},{flushSync:tt}),{shortCircuited:!0}}if(Un){let Ft={};if(!je){Ft.navigation=Wt;let hn=W(ft);hn!==void 0&&(Ft.actionData=hn)}cn.length>0&&(Ft.fetchers=ie(cn)),ke(Ft,{flushSync:tt})}cn.forEach(Ft=>{En(Ft.key),Ft.controller&&G.set(Ft.key,Ft.controller)});let ia=()=>cn.forEach(Ft=>En(Ft.key));A&&A.signal.addEventListener("abort",ia);let{loaderResults:mu,fetcherResults:nn}=await Ze(un,cn,Q,Ie);if(Q.signal.aborted)return{shortCircuited:!0};A&&A.signal.removeEventListener("abort",ia),cn.forEach(Ft=>G.delete(Ft.key));let cs=Wv(mu);if(cs)return await xe(Q,cs.result,!0,{replace:dt}),{shortCircuited:!0};if(cs=Wv(nn),cs)return q.add(cs.key),await xe(Q,cs.result,!0,{replace:dt}),{shortCircuited:!0};let{loaderData:gu,errors:Qa}=JA(I,me,mu,ft,cn,nn);pt&&I.errors&&(Qa={...I.errors,...Qa});let ds=Ui(),Qc=sr(Y),vu=ds||Qc||cn.length>0;return{matches:me,loaderData:gu,errors:Qa,...vu?{fetchers:new Map(I.fetchers)}:{}}}
9function W(Q){if(Q&&!Qi(Q[1]))return{[Q[0]]:Q[1].data};if(I.actionData)return Object.keys(I.actionData).length===0?null:I.actionData}function ie(Q){return Q.forEach(oe=>{let me=I.fetchers.get(oe.key),Ie=Gh(void 0,me?me.data:void 0);I.fetchers.set(oe.key,Ie)}),new Map(I.fetchers)}async function ue(Q,oe,me,Ie){En(Q);let je=(Ie&&Ie.flushSync)===!0,it=l||a,ot=qE(I.location,I.matches,u,me,oe,Ie?.relative),st=Rl(it,ot,u),dt=fu(st,it,ot);if(dt.active&&dt.matches&&(st=dt.matches),!st){We(Q,oe,Ss(404,{pathname:ot}),{flushSync:je});return}let{path:pt,submission:tt,error:ft}=qA(!0,ot,Ie);if(ft){We(Q,oe,ft,{flushSync:je});return}let Wt=e.getContext?await e.getContext():new $A,vn=(Ie&&Ie.preventScrollReset)===!0;if(tt&&hi(tt.formMethod)){await Re(Q,oe,pt,st,Wt,dt.active,je,vn,tt);return}z.set(Q,{routeId:oe,path:pt}),await Ee(Q,oe,pt,st,Wt,dt.active,je,vn,tt)}async function Re(Q,oe,me,Ie,je,it,ot,st,dt){he(),z.delete(Q);let pt=I.fetchers.get(Q);we(Q,Lee(dt,pt),{flushSync:ot});let tt=new AbortController,ft=Fd(e.history,me,tt.signal,dt);if(it){let Rn=await hu(Ie,new URL(ft.url).pathname,ft.signal,Q);if(Rn.type==="aborted")return;if(Rn.type==="error"){We(Q,oe,Rn.error,{flushSync:ot});return}else if(Rn.matches)Ie=Rn.matches;else{We(Q,oe,Ss(404,{pathname:me}),{flushSync:ot});return}}let Wt=Xy(Ie,me);if(!Wt.route.action&&!Wt.route.lazy){let Rn=Ss(405,{method:dt.formMethod,pathname:me,routeId:oe});We(Q,oe,Rn,{flushSync:ot});return}G.set(Q,tt);let vn=Z,Un=cf(s,o,ft,Ie,Wt,r,je),Xn=await ze(ft,Un,je,Q),un=Xn[Wt.route.id];if(!un){for(let Rn of Un)if(Xn[Rn.route.id]){un=Xn[Rn.route.id];break}}if(ft.signal.aborted){G.get(Q)===tt&&G.delete(Q);return}if(ee.has(Q)){if(tc(un)||Qi(un)){we(Q,xa(void 0));return}}else{if(tc(un))if(G.delete(Q),Y>vn){we(Q,xa(void 0));return}else return q.add(Q),we(Q,Gh(dt)),xe(ft,un,!1,{fetcherSubmission:dt,preventScrollReset:st});if(Qi(un)){We(Q,oe,un.error);return}}let cn=I.navigation.location||I.location,ia=Fd(e.history,cn,tt.signal),mu=l||a,nn=I.navigation.state!=="idle"?Rl(mu,I.navigation.location,u):I.matches;Nt(nn,"Didn't find any matches after fetcher action");let cs=++Z;M.set(Q,cs);let gu=Gh(dt,un.data);I.fetchers.set(Q,gu);let{dsMatches:Qa,revalidatingFetchers:ds}=WA(ia,je,s,o,e.history,I,nn,dt,cn,r,!1,H,te,ee,z,q,mu,u,e.patchRoutesOnNavigation!=null,[Wt.route.id,un]);ds.filter(Rn=>Rn.key!==Q).forEach(Rn=>{let Xc=Rn.key,Vg=I.fetchers.get(Xc),Jc=Gh(void 0,Vg?Vg.data:void 0);I.fetchers.set(Xc,Jc),En(Xc),Rn.controller&&G.set(Xc,Rn.controller)}),ke({fetchers:new Map(I.fetchers)});let Qc=()=>ds.forEach(Rn=>En(Rn.key));tt.signal.addEventListener("abort",Qc);let{loaderResults:vu,fetcherResults:Ft}=await Ze(Qa,ds,ia,je);if(tt.signal.aborted)return;if(tt.signal.removeEventListener("abort",Qc),M.delete(Q),G.delete(Q),ds.forEach(Rn=>G.delete(Rn.key)),I.fetchers.has(Q)){let Rn=xa(un.data);I.fetchers.set(Q,Rn)}let hn=Wv(vu);if(hn)return xe(ia,hn.result,!1,{preventScrollReset:st});if(hn=Wv(Ft),hn)return q.add(hn.key),xe(ia,hn.result,!1,{preventScrollReset:st});let{loaderData:Xa,errors:mr}=JA(I,nn,vu,void 0,ds,Ft);sr(cs),I.navigation.state==="loading"&&cs>Y?(Nt(D,"Expected pending action"),A&&A.abort(),Ce(I.navigation.location,{matches:nn,loaderData:Xa,errors:mr,fetchers:new Map(I.fetchers)})):(ke({errors:mr,loaderData:eM(I.loaderData,Xa,nn,mr),fetchers:new Map(I.fetchers)}),H=!1)}async function Ee(Q,oe,me,Ie,je,it,ot,st,dt){let pt=I.fetchers.get(Q);we(Q,Gh(dt,pt?pt.data:void 0),{flushSync:ot});let tt=new AbortController,ft=Fd(e.history,me,tt.signal);if(it){let cn=await hu(Ie,new URL(ft.url).pathname,ft.signal,Q);if(cn.type==="aborted")return;if(cn.type==="error"){We(Q,oe,cn.error,{flushSync:ot});return}else if(cn.matches)Ie=cn.matches;else{We(Q,oe,Ss(404,{pathname:me}),{flushSync:ot});return}}let Wt=Xy(Ie,me);G.set(Q,tt);let vn=Z,Un=cf(s,o,ft,Ie,Wt,r,je),un=(await ze(ft,Un,je,Q))[Wt.route.id];if(G.get(Q)===tt&&G.delete(Q),!ft.signal.aborted){if(ee.has(Q)){we(Q,xa(void 0));return}if(tc(un))if(Y>vn){we(Q,xa(void 0));return}else{q.add(Q),await xe(ft,un,!1,{preventScrollReset:st});return}if(Qi(un)){We(Q,oe,un.error);return}we(Q,xa(un.data))}}async function xe(Q,oe,me,{submission:Ie,fetcherSubmission:je,preventScrollReset:it,replace:ot}={}){oe.response.headers.has("X-Remix-Revalidate")&&(H=!0);let st=oe.response.headers.get("Location");Nt(st,"Expected a Location header on the redirect Response"),st=QA(st,new URL(Q.url),u);let dt=dm(I.location,st,{_isRedirect:!0});if(n){let Un=!1;if(oe.response.headers.has("X-Remix-Reload-Document"))Un=!0;else if(Kb(st)){const Xn=U5(st,!0);Un=Xn.origin!==t.location.origin||js(Xn.pathname,u)==null}if(Un){ot?t.location.replace(st):t.location.assign(st);return}}A=null;let pt=ot===!0||oe.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:tt,formAction:ft,formEncType:Wt}=I.navigation;!Ie&&!je&&tt&&ft&&Wt&&(Ie=rM(I.navigation));let vn=Ie||je;if(mee.has(oe.response.status)&&vn&&hi(vn.formMethod))await Be(pt,dt,{submission:{...vn,formAction:st},preventScrollReset:it||L,enableViewTransition:me?$:void 0});else{let Un=m1(dt,Ie);await Be(pt,dt,{overrideNavigation:Un,fetcherSubmission:je,preventScrollReset:it||L,enableViewTransition:me?$:void 0})}}async function ze(Q,oe,me,Ie){let je,it={};try{je=await Cee(f,Q,oe,Ie,me,!1)}catch(ot){return oe.filter(st=>
9st.shouldLoad).forEach(st=>{it[st.route.id]={type:"error",error:ot}}),it}if(Q.signal.aborted)return it;for(let[ot,st]of Object.entries(je))if(Mee(st)){let dt=st.result;it[ot]={type:"redirect",response:Ree(dt,Q,ot,oe,u)}}else it[ot]=await Pee(st);return it}async function Ze(Q,oe,me,Ie){let je=ze(me,Q,Ie,null),it=Promise.all(oe.map(async dt=>{if(dt.matches&&dt.match&&dt.request&&dt.controller){let tt=(await ze(dt.request,dt.matches,Ie,dt.key))[dt.match.route.id];return{[dt.key]:tt}}else return Promise.resolve({[dt.key]:{type:"error",error:Ss(404,{pathname:dt.path})}})})),ot=await je,st=(await it).reduce((dt,pt)=>Object.assign(dt,pt),{});return{loaderResults:ot,fetcherResults:st}}function he(){H=!0,z.forEach((Q,oe)=>{G.has(oe)&&te.add(oe),En(oe)})}function we(Q,oe,me={}){I.fetchers.set(Q,oe),ke({fetchers:new Map(I.fetchers)},{flushSync:(me&&me.flushSync)===!0})}function We(Q,oe,me,Ie={}){let je=Il(I.matches,oe);Sn(Q),ke({errors:{[je.route.id]:me},fetchers:new Map(I.fetchers)},{flushSync:(Ie&&Ie.flushSync)===!0})}function Et(Q){return N.set(Q,(N.get(Q)||0)+1),ee.has(Q)&&ee.delete(Q),I.fetchers.get(Q)||gee}function jt(Q,oe){En(Q,oe?.reason),we(Q,xa(null))}function Sn(Q){let oe=I.fetchers.get(Q);G.has(Q)&&!(oe&&oe.state==="loading"&&M.has(Q))&&En(Q),z.delete(Q),M.delete(Q),q.delete(Q),ee.delete(Q),te.delete(Q),I.fetchers.delete(Q)}function zi(Q){let oe=(N.get(Q)||0)-1;oe<=0?(N.delete(Q),ee.add(Q)):N.set(Q,oe),ke({fetchers:new Map(I.fetchers)})}function En(Q,oe){let me=G.get(Q);me&&(me.abort(oe),G.delete(Q))}function Vi(Q){for(let oe of Q){let me=Et(oe),Ie=xa(me.data);I.fetchers.set(oe,Ie)}}function Ui(){let Q=[],oe=!1;for(let me of q){let Ie=I.fetchers.get(me);Nt(Ie,`Expected fetcher: ${me}`),Ie.state==="loading"&&(q.delete(me),Q.push(me),oe=!0)}return Vi(Q),oe}function sr(Q){let oe=[];for(let[me,Ie]of M)if(Ie<Q){let je=I.fetchers.get(me);Nt(je,`Expected fetcher: ${me}`),je.state==="loading"&&(En(me),M.delete(me),oe.push(me))}return Vi(oe),oe.length>0}function us(Q,oe){let me=I.blockers.get(Q)||Wh;return X.get(Q)!==oe&&X.set(Q,oe),me}function Vr(Q){I.blockers.delete(Q),X.delete(Q)}function Za(Q,oe){let me=I.blockers.get(Q)||Wh;Nt(me.state==="unblocked"&&oe.state==="blocked"||me.state==="blocked"&&oe.state==="blocked"||me.state==="blocked"&&oe.state==="proceeding"||me.state==="blocked"&&oe.state==="unblocked"||me.state==="proceeding"&&oe.state==="unblocked",`Invalid blocker state transition: ${me.state} -> ${oe.state}`);let Ie=new Map(I.blockers);Ie.set(Q,oe),ke({blockers:Ie})}function Zc({currentLocation:Q,nextLocation:oe,historyAction:me}){if(X.size===0)return;X.size>1&&Fn(!1,"A router only supports one blocker at a time");let Ie=Array.from(X.entries()),[je,it]=Ie[Ie.length-1],ot=I.blockers.get(je);if(!(ot&&ot.state==="proceeding")&&it({currentLocation:Q,nextLocation:oe,historyAction:me}))return je}function xo(Q){let oe=Ss(404,{pathname:Q}),me=l||a,{matches:Ie,route:je}=qv(me);return{notFoundMatches:Ie,route:je,error:oe}}function Ya(Q,oe,me){if(v=Q,w=oe,_=me||null,!x&&I.navigation===p1){x=!0;let Ie=dh(I.location,I.matches);Ie!=null&&ke({restoreScrollPosition:Ie})}return()=>{v=null,w=null,_=null}}function ch(Q,oe){return _&&_(Q,oe.map(Ie=>VJ(Ie,I.loaderData)))||Q.key}function $g(Q,oe){if(v&&w){let me=ch(Q,oe);v[me]=w()}}function dh(Q,oe){if(v){let me=ch(Q,oe),Ie=v[me];if(typeof Ie=="number")return Ie}return null}function fu(Q,oe,me){if(e.patchRoutesOnNavigation)if(Q){if(Object.keys(Q[0].params).length>0)return{active:!0,matches:_p(oe,me,u,!0)}}else return{active:!0,matches:_p(oe,me,u,!0)||[]};return{active:!1,matches:null}}async function hu(Q,oe,me,Ie){if(!e.patchRoutesOnNavigation)return{type:"success",matches:Q};let je=Q;for(;;){let it=l==null,ot=l||a,st=o;try{await e.patchRoutesOnNavigation({signal:me,path:oe,matches:je,fetcherKey:Ie,patch:(tt,ft)=>{me.aborted||GA(tt,ft,ot,st,s,!1)}})}catch(tt){return{type:"error",error:tt,partialMatches:je}}finally{it&&!me.aborted&&(a=[...a])}if(me.aborted)return{type:"aborted"};let dt=Rl(ot,oe,u),pt=null;if(dt){if(Object.keys(dt[0].params).length===0)return{type:"success",matches:dt};if(pt=_p(ot,oe,u,!0),!(pt&&je.length<pt.length&&Yc(je,pt.slice(0,je.length))))return{type:"success",matches:dt}}if(pt||(pt=_p(ot,oe,u,!0)),!pt||Yc(je,pt))return{type:"success",matches:null};je=pt}}function Yc(Q,oe){return Q.length===oe.length&&Q.every((me,Ie)=>
9me.route.id===oe[Ie].route.id)}function zg(Q){o={},l=fm(Q,s,void 0,o)}function pu(Q,oe,me=!1){let Ie=l==null;GA(Q,oe,l||a,o,s,me),Ie&&(a=[...a],ke({}))}return k={get basename(){return u},get future(){return d},get state(){return I},get routes(){return a},get window(){return t},initialize:se,subscribe:fe,enableScrollRestoration:Ya,navigate:Se,fetch:ue,revalidate:Fe,createHref:Q=>e.history.createHref(Q),encodeLocation:Q=>e.history.encodeLocation(Q),getFetcher:Et,resetFetcher:jt,deleteFetcher:zi,dispose:ce,getBlocker:us,deleteBlocker:Vr,patchRoutes:pu,_internalFetchControllers:G,_internalSetRoutes:zg,_internalSetStateDoNotUseOrYouWillBreakYourApp(Q){ke(Q)}},e.unstable_instrumentations&&(k=oee(k,e.unstable_instrumentations.map(Q=>Q.router).filter(Boolean))),k}function bee(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function qE(e,t,n,r,i,s){let o,a;if(i){o=[];for(let u of t)if(o.push(u),u.route.id===i){a=u;break}}else o=t,a=t[t.length-1];let l=Yb(r||".",Zb(o),js(e.pathname,n)||e.pathname,s==="path");if(r==null&&(l.search=e.search,l.hash=e.hash),(r==null||r===""||r===".")&&a){let u=zT(l.search);if(a.route.index&&!u)l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index";else if(!a.route.index&&u){let f=new URLSearchParams(l.search),d=f.getAll("index");f.delete("index"),d.filter(m=>m).forEach(m=>f.append("index",m));let p=f.toString();l.search=p?`?${p}`:""}}return n!=="/"&&(l.pathname=JJ({basename:n,pathname:l.pathname})),Go(l)}function qA(e,t,n){if(!n||!bee(n))return{path:t};if(n.formMethod&&!Nee(n.formMethod))return{path:t,error:Ss(405,{method:n.formMethod})};let r=()=>({path:t,error:Ss(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),o=nz(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!hi(s))return r();let d=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,[m,v])=>`${p}${m}=${v}
10`,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:void 0,text:d}}}else if(n.formEncType==="application/json"){if(!hi(s))return r();try{let d=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:o,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch{return r()}}}Nt(typeof FormData=="function","FormData is not available in this environment");let a,l;if(n.formData)a=KE(n.formData),l=n.formData;else if(n.body instanceof FormData)a=KE(n.body),l=n.body;else if(n.body instanceof URLSearchParams)a=n.body,l=XA(a);else if(n.body==null)a=new URLSearchParams,l=new FormData;else try{a=new URLSearchParams(n.body),l=XA(a)}catch{return r()}let u={formMethod:s,formAction:o,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:l,json:void 0,text:void 0};if(hi(u.formMethod))return{path:t,submission:u};let f=ru(t);return e&&f.search&&zT(f.search)&&a.append("index",""),f.search=`?${a}`,{path:Go(f),submission:u}}function WA(e,t,n,r,i,s,o,a,l,u,f,d,p,m,v,_,w,x,S,C){let R=C?Qi(C[1])?C[1].error:C[1].data:void 0,P=i.createURL(s.location),k=i.createURL(l),I;if(f&&s.errors){let B=Object.keys(s.errors)[0];I=o.findIndex(H=>H.route.id===B)}else if(C&&Qi(C[1])){let B=C[0];I=o.findIndex(H=>H.route.id===B)-1}let D=C?C[1].statusCode:void 0,L=D&&D>=400,A={currentUrl:P,currentParams:s.matches[0]?.params||{},nextUrl:k,nextParams:o[0].params,...a,actionResult:R,actionStatus:D},$=FT(o.map(B=>B.route.path)),j=o.map((B,H)=>{let{route:te}=B,G=null;if(I!=null&&H>I?G=!1:te.lazy?G=!0:$T(te)?f?G=WE(te,s.loaderData,s.errors):_ee(s.loaderData,s.matches[H],B)&&(G=!0):G=!1,G!==null)return GE(n,r,e,$,B,u,t,G);let Z=L?!1:d||P.pathname+P.search===k.pathname+k.search||P.search!==k.search||wee(s.matches[H],B),Y={...A,defaultShouldRevalidate:Z},M=P0(B,Y);return GE(n,r,e,$,B,u,t,M,Y)}),V=[];return v.forEach((B,H)=>{if(f||!o.some(N=>N.route.id===B.routeId)||m.has(H))return;let te=s.fetchers.get(H),G=te&&te.state!=="idle"&&te.data===void 0,Z=Rl(w,B.path,x);if(!Z){if(S&&G)return;V.push({key:H,routeId:B.routeId,path:B.path,matches:null,match:null,request:null,controller:null});return}if(_.has(H))return;let Y=Xy(Z,B.path),M=new AbortController,q=Fd(i,B.path,M.signal),z=null;if(p.has(H))p.delete(H),z=cf(n,r,q,Z,Y,u,t);else if(G)d&&(z=cf(n,r,q,Z,Y,u,t));else{let N={...A,defaultShouldRevalidate:L?!1:d};P0(Y,N)&&(z=cf(n,r,q,Z,Y,u,t,N))}z&&V.push({key:H,routeId:B.routeId,path:B.path,matches:z,match:Y,request:q,controller:M})}),{dsMatches:j,revalidatingFetchers:V}}function $T(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function WE(e,t,n){if(e.lazy)return!0;
10if(!$T(e))return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function _ee(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function wee(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function P0(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function GA(e,t,n,r,i,s){let o;if(e){let u=r[e];Nt(u,`No route found to patch children into: routeId = ${e}`),u.children||(u.children=[]),o=u.children}else o=n;let a=[],l=[];if(t.forEach(u=>{let f=o.find(d=>Q5(u,d));f?l.push({existingRoute:f,newRoute:u}):a.push(u)}),a.length>0){let u=fm(a,i,[e||"_","patch",String(o?.length||"0")],r);o.push(...u)}if(s&&l.length>0)for(let u=0;u<l.length;u++){let{existingRoute:f,newRoute:d}=l[u],p=f,[m]=fm([d],i,[],{},!0);Object.assign(p,{element:m.element?m.element:p.element,errorElement:m.errorElement?m.errorElement:p.errorElement,hydrateFallbackElement:m.hydrateFallbackElement?m.hydrateFallbackElement:p.hydrateFallbackElement})}}function Q5(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>t.children?.some(i=>Q5(n,i))):!1}var KA=new WeakMap,X5=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(Nt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let o=KA.get(i);o||(o={},KA.set(i,o));let a=o[e];if(a)return a;let l=(async()=>{let u=LJ(e),d=i[e]!==void 0&&e!=="hasErrorBoundary";if(u)Fn(!u,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),o[e]=Promise.resolve();else if(d)Fn(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let p=await s();p!=null&&(Object.assign(i,{[e]:p}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(p=>p===void 0)&&(i.lazy=void 0))})();return o[e]=l,l},ZA=new WeakMap;function xee(e,t,n,r,i){let s=n[e.id];if(Nt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let f=ZA.get(s);if(f)return{lazyRoutePromise:f,lazyHandlerPromise:f};let d=(async()=>{Nt(typeof e.lazy=="function","No lazy route function found");let p=await e.lazy(),m={};for(let v in p){let _=p[v];if(_===void 0)continue;let w=$J(v),S=s[v]!==void 0&&v!=="hasErrorBoundary";w?Fn(!w,"Route property "+v+" is not a supported property to be returned from a lazy route function. This property will be ignored."):S?Fn(!S,`Route "${s.id}" has a static property "${v}" defined but its lazy function is also returning a value for this property. The lazy route property "${v}" will be ignored.`):m[v]=_}Object.assign(s,m),Object.assign(s,{...r(s),lazy:void 0})})();return ZA.set(s,d),d.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:d}}let o=Object.keys(e.lazy),a=[],l;for(let f of o){if(i&&i.includes(f))continue;let d=X5({key:f,route:e,manifest:n,mapRouteProperties:r});d&&(a.push(d),f===t&&(l=d))}let u=a.length>0?Promise.all(a).then(()=>{}):void 0;return u?.catch(()=>{}),l?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:l}}async function YA(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,s)=>{n[t[s].route.id]=i}),n}async function See(e){return e.matches.some(t=>t.route.middleware)?J5(e,()=>YA(e)):YA(e)}function J5(e,t){return Eee(e,t,r=>r,Dee,n);function n(r,i,s){if(s)return Promise.resolve(Object.assign(s.value,{[i]:{type:"error",result:r}}));{let{matches:o}=e,a=Math.min(Math.max(o.findIndex(u=>u.route.id===i),0),Math.max(o.findIndex(u=>u.unstable_shouldCallHandler()),0)),l=Il(o,o[a].route.id).route.id;return Promise.resolve({[l]:{type:"error",result:r}})}}}async function Eee(e,t,n,r,i){let{matches:s,request:o,params:a,context:l,unstable_pattern:u}=e,f=s.flatMap(p=>p.route.middleware?p.route.middleware.map(m=>[p.route.id,m]):[]);return await ez({request:o,params:a,context:l,unstable_pattern:u},f,t,n,r,i)}async function ez(e,t,n,r,i,s,o=0){let{request:a}=e;if(a.signal.aborted)throw a.signal.reason??new Error(`Request aborted: ${a.method} ${a.url}`);let l=t[o];if(!l)return await n();let[u,f]=l,d,p=async()=>
10{if(d)throw new Error("You may only call `next()` once per middleware");try{return d={value:await ez(e,t,n,r,i,s,o+1)},d.value}catch(m){return d={value:await s(m,u,d)},d.value}};try{let m=await f(e,p),v=m!=null?r(m):void 0;return i(v)?v:d?v??d.value:(d={value:await p()},d.value)}catch(m){return await s(m,u,d)}}function tz(e,t,n,r,i){let s=X5({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),o=xee(r.route,hi(n.method)?"action":"loader",t,e,i);return{middleware:s,route:o.lazyRoutePromise,handler:o.lazyHandlerPromise}}function GE(e,t,n,r,i,s,o,a,l=null){let u=!1,f=tz(e,t,n,i,s);return{...i,_lazyPromises:f,shouldLoad:a,unstable_shouldRevalidateArgs:l,unstable_shouldCallHandler(d){return u=!0,l?typeof d=="boolean"?P0(i,{...l,defaultShouldRevalidate:d}):P0(i,l):a},resolve(d){let{lazy:p,loader:m,middleware:v}=i.route,_=u||a||d&&!hi(n.method)&&(p||m),w=v&&v.length>0&&!m&&!p;return _&&(hi(n.method)||!w)?kee({request:n,unstable_pattern:r,match:i,lazyHandlerPromise:f?.handler,lazyRoutePromise:f?.route,handlerOverride:d,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function cf(e,t,n,r,i,s,o,a=null){return r.map(l=>l.route.id!==i.route.id?{...l,shouldLoad:!1,unstable_shouldRevalidateArgs:a,unstable_shouldCallHandler:()=>!1,_lazyPromises:tz(e,t,n,l,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:GE(e,t,n,FT(r.map(u=>u.route.path)),l,s,o,!0,a))}async function Cee(e,t,n,r,i,s){n.some(u=>u._lazyPromises?.middleware)&&await Promise.all(n.map(u=>u._lazyPromises?.middleware));let o={request:t,unstable_pattern:FT(n.map(u=>u.route.path)),params:n[0].params,context:i,matches:n},l=await e({...o,fetcherKey:r,runClientMiddleware:u=>{let f=o;return J5(f,()=>u({...f,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return l}async function kee({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:i,handlerOverride:s,scopedContext:o}){let a,l,u=hi(e.method),f=u?"action":"loader",d=p=>{let m,v=new Promise((x,S)=>m=S);l=()=>m(),e.signal.addEventListener("abort",l);let _=x=>typeof p!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${f}" [routeId: ${n.route.id}]`)):p({request:e,unstable_pattern:t,params:n.params,context:o},...x!==void 0?[x]:[]),w=(async()=>{try{return{type:"data",result:await(s?s(S=>_(S)):_())}}catch(x){return{type:"error",result:x}}})();return Promise.race([w,v])};try{let p=u?n.route.action:n.route.loader;if(r||i)if(p){let m,[v]=await Promise.all([d(p).catch(_=>{m=_}),r,i]);if(m!==void 0)throw m;a=v}else{await r;let m=u?n.route.action:n.route.loader;if(m)[a]=await Promise.all([d(m),i]);else if(f==="action"){let v=new URL(e.url),_=v.pathname+v.search;throw Ss(405,{method:e.method,pathname:_,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(p)a=await d(p);else{let m=new URL(e.url),v=m.pathname+m.search;throw Ss(404,{pathname:v})}}catch(p){return{type:"error",result:p}}finally{l&&e.signal.removeEventListener("abort",l)}return a}
10async function Tee(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function Pee(e){let{result:t,type:n}=e;if(rz(t)){let r;try{r=await Tee(t)}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new T0(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?nM(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new T0(t.init?.status||500,void 0,t.data),statusCode:pm(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:pm(t)?t.status:void 0}:nM(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function Ree(e,t,n,r,i){let s=e.headers.get("Location");if(Nt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Kb(s)){let o=r.slice(0,r.findIndex(a=>a.route.id===n)+1);s=qE(new URL(t.url),o,i,s),e.headers.set("Location",s)}return e}function QA(e,t,n){if(Kb(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=js(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function Fd(e,t,n,r){let i=e.createURL(nz(t)).toString(),s={signal:n};if(r&&hi(r.formMethod)){let{formMethod:o,formEncType:a}=r;s.method=o.toUpperCase(),a==="application/json"?(s.headers=new Headers({"Content-Type":a}),s.body=JSON.stringify(r.json)):a==="text/plain"?s.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?s.body=KE(r.formData):s.body=r.formData}return new Request(i,s)}function KE(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function XA(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Iee(e,t,n,r=!1,i=!1){let s={},o=null,a,l=!1,u={},f=n&&Qi(n[1])?n[1].error:void 0;return e.forEach(d=>{if(!(d.route.id in t))return;let p=d.route.id,m=t[p];if(Nt(!tc(m),"Cannot handle redirect results in processLoaderData"),Qi(m)){let v=m.error;if(f!==void 0&&(v=f,f=void 0),o=o||{},i)o[p]=v;else{let _=Il(e,p);o[_.route.id]==null&&(o[_.route.id]=v)}r||(s[p]=Y5),l||(l=!0,a=pm(m.error)?m.error.status:500),m.headers&&(u[p]=m.headers)}else s[p]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(a=m.statusCode),m.headers&&(u[p]=m.headers)}),f!==void 0&&n&&(o={[n[0]]:f},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:o,statusCode:a||200,loaderHeaders:u}}function JA(e,t,n,r,i,s){let{loaderData:o,errors:a}=Iee(t,n,r);return i.filter(l=>!l.matches||l.matches.some(u=>u.shouldLoad)).forEach(l=>{let{key:u,match:f,controller:d}=l;if(d&&d.signal.aborted)return;let p=s[u];if(Nt(p,"Did not find corresponding fetcher result"),Qi(p)){let m=Il(e.matches,f?.route.id);a&&a[m.route.id]||(a={...a,[m.route.id]:p.error}),e.fetchers.delete(u)}else if(tc(p))Nt(!1,"Unhandled fetcher revalidation redirect");else{let m=xa(p.data);e.fetchers.set(u,m)}}),{loaderData:o,errors:a}}function eM(e,t,n,r){let i=Object.entries(t).filter(([,s])=>s!==Y5).reduce((s,[o,a])=>(s[o]=a,s),{});for(let s of n){let o=s.route.id;if(!t.hasOwnProperty(o)&&e.hasOwnProperty(o)&&s.route.loader&&(i[o]=e[o]),r&&r.hasOwnProperty(o))break}return i}function tM(e){return e?Qi(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Il(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function qv(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ss(e,{pathname:t,routeId:n,method:r,type:i,message:s}={}){let o="Unknown Server Error",a="Unknown @remix-run/router error";return e===400?(o="Bad Request",r&&t&&n?a=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:i==="invalid-body"&&(a="Unable to encode submission body")):e===403?(o="Forbidden",a=`Route "${n}" does not match URL "${t}"`):e===404?(o="Not Found",a=`No route matches URL "${t}"`):e===405&&(o="Method Not Allowed",r&&t&&n?a=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(a=`Invalid request method "${r.toUpperCase()}"`)),new T0(e||500,o,new Error(a),!0)}function Wv(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(tc(i))return{key:r,result:i}}}function nz(e){let t=typeof e=="string"?ru(e):e;return Go({...t,hash:""})}function Oee(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Dee(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&Aee(n))}function Aee(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function Mee(e){return rz(e.result)&&pee.has(e.result.status)}function Qi(e){return e.type==="error"}function tc(e){return(e&&e.type)==="redirect"}function nM(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function rz(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Nee(e){return hee.has(e.toUpperCase())}function hi(e){return dee.has(e.toUpperCase())}function zT(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Xy(e,t){let n=typeof t=="string"?ru(t).search:t.search;if(e[e.length-1].route.index&&zT(n||""))return e[e.length-1];let r=W5(e);return r[r.length-1]}function rM(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:o}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(o!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:o,text:void 0}}}function m1(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function jee(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Gh(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function Lee(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function xa(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function Fee(e,t){try{let n=e.sessionStorage.getItem(Z5);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function $ee(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(Z5,JSON.stringify(n))}catch(r){Fn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function zee(){let e,t,n=new Promise((r,i)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{i(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Oc=b.createContext(null);Oc.displayName="DataRouter";var Qm=b.createContext(null);Qm.displayName="DataRouterState";b.createContext(!1);var VT=b.createContext({isTransitioning:!1});
10VT.displayName="ViewTransition";var iz=b.createContext(new Map);iz.displayName="Fetchers";var Vee=b.createContext(null);Vee.displayName="Await";var yo=b.createContext(null);yo.displayName="Navigation";var Qb=b.createContext(null);Qb.displayName="Location";var Ls=b.createContext({outlet:null,matches:[],isDataRoute:!1});Ls.displayName="Route";var UT=b.createContext(null);UT.displayName="RouteError";function Uee(e,{relative:t}={}){Nt(Dc(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=b.useContext(yo),{hash:i,pathname:s,search:o}=Xm(e,{relative:t}),a=s;return n!=="/"&&(a=s==="/"?n:Fo([n,s])),r.createHref({pathname:a,search:o,hash:i})}function Dc(){return b.useContext(Qb)!=null}function Qn(){return Nt(Dc(),"useLocation() may be used only in the context of a <Router> component."),b.useContext(Qb).location}function Bee(e){Nt(Dc(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=Qn();return b.useMemo(()=>hm(e,q5(t)),[t,e])}var sz="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oz(e){b.useContext(yo).static||b.useLayoutEffect(e)}function wi(){let{isDataRoute:e}=b.useContext(Ls);return e?rte():Hee()}function Hee(){Nt(Dc(),"useNavigate() may be used only in the context of a <Router> component.");let e=b.useContext(Oc),{basename:t,navigator:n}=b.useContext(yo),{matches:r}=b.useContext(Ls),{pathname:i}=Qn(),s=JSON.stringify(Zb(r)),o=b.useRef(!1);return oz(()=>{o.current=!0}),b.useCallback((l,u={})=>{if(Fn(o.current,sz),!o.current)return;if(typeof l=="number"){n.go(l);return}let f=Yb(l,JSON.parse(s),i,u.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Fo([t,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[t,n,s,i,e])}var qee=b.createContext(null);function Wee(e){let t=b.useContext(Ls).outlet;return b.useMemo(()=>t&&b.createElement(qee.Provider,{value:e},t),[t,e])}function BT(){let{matches:e}=b.useContext(Ls),t=e[e.length-1];return t?t.params:{}}function Xm(e,{relative:t}={}){let{matches:n}=b.useContext(Ls),{pathname:r}=Qn(),i=JSON.stringify(Zb(n));return b.useMemo(()=>Yb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function Gee(e,t,n,r,i){Nt(Dc(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=b.useContext(yo),{matches:o}=b.useContext(Ls),a=o[o.length-1],l=a?a.params:{},u=a?a.pathname:"/",f=a?a.pathnameBase:"/",d=a&&a.route;{let S=d&&d.path||"";lz(u,!d||S.endsWith("*")||S.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${S}">) 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.
11
12Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let p=Qn(),m;m=p;let v=m.pathname||"/",_=v;if(f!=="/"){let S=f.replace(/^\//,"").split("/");_="/"+v.replace(/^\//,"").split("/").slice(S.length).join("/")}let w=Rl(e,{pathname:_});return Fn(d||w!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Fn(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 "${m.pathname}${m.search}${m.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.`),Xee(w&&w.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Fo([f,s.encodeLocation?s.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?f:Fo([f,s.encodeLocation?s.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),o,n,r,i)}function Kee(){let e=az(),t=pm(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=b.createElement(b.Fragment,null,b.createElement("p",null,"💿 Hey developer 👋"),b.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",b.createElement("code",{style:s},"ErrorBoundary")," or"," ",b.createElement("code",{style:s},"errorElement")," prop on your route.")),b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application 
12Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:i},n):null,o)}var Zee=b.createElement(Kee,null),Yee=class extends b.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?b.createElement(Ls.Provider,{value:this.props.routeContext},b.createElement(UT.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function Qee({routeContext:e,match:t,children:n}){let r=b.useContext(Oc);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),b.createElement(Ls.Provider,{value:e},n)}function Xee(e,t=[],n=null,r=null,i=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,o=n?.errors;if(o!=null){let f=s.findIndex(d=>d.route.id&&o?.[d.route.id]!==void 0);Nt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,f+1))}let a=!1,l=-1;if(n)for(let f=0;f<s.length;f++){let d=s[f];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(l=f),d.route.id){let{loaderData:p,errors:m}=n,v=d.route.loader&&!p.hasOwnProperty(d.route.id)&&(!m||m[d.route.id]===void 0);if(d.route.lazy||v){a=!0,l>=0?s=s.slice(0,l+1):s=[s[0]];break}}}let u=n&&r?(f,d)=>{r(f,{location:n.location,params:n.matches?.[0]?.params??{},errorInfo:d})}:void 0;return s.reduceRight((f,d,p)=>{let m,v=!1,_=null,w=null;n&&(m=o&&d.route.id?o[d.route.id]:void 0,_=d.route.errorElement||Zee,a&&(l<0&&p===0?(lz("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,w=null):l===p&&(v=!0,w=d.route.hydrateFallbackElement||null)));let x=t.concat(s.slice(0,p+1)),S=()=>{let C;return m?C=_:v?C=w:d.route.Component?C=b.createElement(d.route.Component,null):d.route.element?C=d.route.element:C=f,b.createElement(Qee,{match:d,routeContext:{outlet:f,matches:x,isDataRoute:n!=null},children:C})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?b.createElement(Yee,{location:n.location,revalidation:n.revalidation,component:_,error:m,children:S(),routeC
12ontext:{outlet:null,matches:x,isDataRoute:!0},onError:u}):S()},null)}function HT(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Jee(e){let t=b.useContext(Oc);return Nt(t,HT(e)),t}function ete(e){let t=b.useContext(Qm);return Nt(t,HT(e)),t}function tte(e){let t=b.useContext(Ls);return Nt(t,HT(e)),t}function qT(e){let t=tte(e),n=t.matches[t.matches.length-1];return Nt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function nte(){return qT("useRouteId")}function az(){let e=b.useContext(UT),t=ete("useRouteError"),n=qT("useRouteError");return e!==void 0?e:t.errors?.[n]}function rte(){let{router:e}=Jee("useNavigate"),t=qT("useNavigate"),n=b.useRef(!1);return oz(()=>{n.current=!0}),b.useCallback(async(i,s={})=>{Fn(n.current,sz),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var iM={};function lz(e,t,n){!t&&!iM[e]&&(iM[e]=!0,Fn(!1,n))}var sM={};function oM(e,t){!e&&!sM[t]&&(sM[t]=!0,console.warn(t))}function ite(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Fn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:b.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Fn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:b.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Fn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:b.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var ste=["HydrateFallback","hydrateFallbackElement"],ote=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function ate({router:e,flushSync:t,unstable_onError:n}){let[r,i]=b.useState(e.state),[s,o]=b.useState(),[a,l]=b.useState({isTransitioning:!1}),[u,f]=b.useState(),[d,p]=b.useState(),[m,v]=b.useState(),_=b.useRef(new Map),w=b.useCallback(P=>{i(k=>(P.errors&&n&&Object.entries(P.errors).forEach(([I,D])=>{k.errors?.[I]!==D&&n(D,{location:P.location,params:P.matches[0]?.params??{}})}),P))},[n]),x=b.useCallback((P,{deletedFetchers:k,flushSync:I,viewTransitionOpts:D})=>{P.fetchers.forEach((A,$)=>{A.data!==void 0&&_.current.set($,A.data)}),k.forEach(A=>_.current.delete(A)),oM(I===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable.  Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let L=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(oM(D==null||L,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!D||!L){t&&I?t(()=>w(P)):b.startTransition(()=>w(P));return}if(t&&I){t(()=>{d&&(u&&u.resolve(),d.skipTransition()),l({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let A=e.window.document.startViewTransition(()=>{t(()=>w(P))});A.finished.finally(()=>{t(()=>{f(void 0),p(void 0),o(void 0),l({isTransitioning:!1})})}),t(()=>p(A));return}d?(u&&u.resolve(),d.skipTransition(),v({state:P,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(o(P),l({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,d,u,w]);b.useLayoutEffect(()=>e.subscribe(x),[e,x]),b.useEffect(()=>
12{a.isTransitioning&&!a.flushSync&&f(new ote)},[a]),b.useEffect(()=>{if(u&&s&&e.window){let P=s,k=u.promise,I=e.window.document.startViewTransition(async()=>{b.startTransition(()=>w(P)),await k});I.finished.finally(()=>{f(void 0),p(void 0),o(void 0),l({isTransitioning:!1})}),p(I)}},[s,u,e.window,w]),b.useEffect(()=>{u&&s&&r.location.key===s.location.key&&u.resolve()},[u,d,r.location,s]),b.useEffect(()=>{!a.isTransitioning&&m&&(o(m.state),l({isTransitioning:!0,flushSync:!1,currentLocation:m.currentLocation,nextLocation:m.nextLocation}),v(void 0))},[a.isTransitioning,m]);let S=b.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,k,I)=>e.navigate(P,{state:k,preventScrollReset:I?.preventScrollReset}),replace:(P,k,I)=>e.navigate(P,{replace:!0,state:k,preventScrollReset:I?.preventScrollReset})}),[e]),C=e.basename||"/",R=b.useMemo(()=>({router:e,navigator:S,static:!1,basename:C,unstable_onError:n}),[e,S,C,n]);return b.createElement(b.Fragment,null,b.createElement(Oc.Provider,{value:R},b.createElement(Qm.Provider,{value:r},b.createElement(iz.Provider,{value:_.current},b.createElement(VT.Provider,{value:a},b.createElement(cte,{basename:C,location:r.location,navigationType:r.historyAction,navigator:S},b.createElement(lte,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var lte=b.memo(ute);function ute({routes:e,future:t,state:n,unstable_onError:r}){return Gee(e,void 0,n,r,t)}function wp({to:e,replace:t,state:n,relative:r}){Nt(Dc(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=b.useContext(yo);Fn(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=b.useContext(Ls),{pathname:o}=Qn(),a=wi(),l=Yb(e,Zb(s),o,r==="path"),u=JSON.stringify(l);return b.useEffect(()=>{a(JSON.parse(u),{replace:t,state:n,relative:r})},[a,u,r,t,n]),null}function Ko(e){return Wee(e.context)}function cte({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){Nt(!Dc(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),a=b.useMemo(()=>({basename:o,navigator:i,static:s,future:{}}),[o,i,s]);typeof n=="string"&&(n=ru(n));let{pathname:l="/",search:u="",hash:f="",state:d=null,key:p="default"}=n,m=b.useMemo(()=>{let v=js(l,o);return v==null?null:{location:{pathname:v,search:u,hash:f,state:d,key:p},navigationType:r}},[o,l,u,f,d,p,r]);return Fn(m!=null,`<Router basename="${o}"> is not able to match the URL "${l}${u}${f}" because it does not start with the basename, so the <Router> won't render anything.`),m==null?null:b.createElement(yo.Provider,{value:a},b.createElement(Qb.Provider,{children:t,value:m}))}var Jy="get",e0="application/x-www-form-urlencoded";function Xb(e){return e!=null&&typeof e.tagName=="string"}function dte(e){return Xb(e)&&e.tagName.toLowerCase()==="button"}function fte(e){return Xb(e)&&e.tagName.toLowerCase()==="form"}function hte(e){return Xb(e)&&e.tagName.toLowerCase()==="input"}function pte(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function mte(e,t){return e.button===0&&(!t||t==="_self")&&!pte(e)}function ZE(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function gte(e,t){let n=ZE(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}var Gv=null;function vte(){if(Gv===null)try{new FormData(document.createElement("form"),0),Gv=!1}catch{Gv=!0}return Gv}var yte=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function g1(e){return e!=null&&!yte.has(e)?(Fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${e0}"`),null):e}function bte(e,t){let n,r,i,s,o;if(fte(e)){let a=e.getAttribute("action");r=a?js(a,t):null,n=e.getAttribute("method")||Jy,i=g1(e.getAttribute("enctype"))||e0,s=new FormData(e)}else if(dte(e)||hte(e)&&(e.type==="submit"||e.type==="image")){let a=e.form;if(a==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let l=e.getAttribute("formaction")||a.getAttribute("action");if(r=l?js(l,t):null,n=e.getAttribute("formmethod")||a.getAttribute("method")||Jy,i=g1(e.getAttribute("formenctype"))||g1(a.getAttribute("enctype"))||e0,s=new FormData(a,e),!vte()){let{name:u,type:f,value:d}=e;if(f==="image"){let p=u?`${u}.`:"";s.append(`${p}x`,"0"),s.append(`${p}y`,"0")}else u&&s.append(u,d)}}else{if(Xb(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Jy,r=null,i=e0,o=e}return s&&i==="text/plain"&&(o=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function WT(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function _te(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&js(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function wte(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.
12isSpaMode,window.location.reload(),new Promise(()=>{})}}function xte(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function Ste(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let o=await wte(s,n);return o.links?o.links():[]}return[]}));return Tte(r.flat(1).filter(xte).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function aM(e,t,n,r,i,s){let o=(l,u)=>n[u]?l.route.id!==n[u].route.id:!0,a=(l,u)=>n[u].pathname!==l.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==l.params["*"];return s==="assets"?t.filter((l,u)=>o(l,u)||a(l,u)):s==="data"?t.filter((l,u)=>{let f=r.routes[l.route.id];if(!f||!f.hasLoader)return!1;if(o(l,u)||a(l,u))return!0;if(l.route.shouldRevalidate){let d=l.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParam
12s:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:l.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function Ete(e,t,{includeHydrateFallback:n}={}){return Cte(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function Cte(e){return[...new Set(e)]}function kte(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Tte(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(kte(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function uz(){let e=b.useContext(Oc);return WT(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Pte(){let e=b.useContext(Qm);return WT(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var GT=b.createContext(void 0);GT.displayName="FrameworkContext";function cz(){let e=b.useContext(GT);return WT(e,"You must render this element inside a <HydratedRouter> element"),e}function Rte(e,t){let n=b.useContext(GT),[r,i]=b.useState(!1),[s,o]=b.useState(!1),{onFocus:a,onBlur:l,onMouseEnter:u,onMouseLeave:f,onTouchStart:d}=t,p=b.useRef(null);b.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let _=x=>{x.forEach(S=>{o(S.isIntersecting)})},w=new IntersectionObserver(_,{threshold:.5});return p.current&&w.observe(p.current),()=>{w.disconnect()}}},[e]),b.useEffect(()=>{if(r){let _=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(_)}}},[r]);let m=()=>{i(!0)},v=()=>{i(!1),o(!1)};return n?e!=="intent"?[s,p,{}]:[s,p,{onFocus:Kh(a,m),onBlur:Kh(l,v),onMouseEnter:Kh(u,m),onMouseLeave:Kh(f,v),onTouchStart:Kh(d,m)}]:[!1,p,{}]}function Kh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ite({page:e,...t}){let{router:n}=uz(),r=b.useMemo(()=>Rl(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?b.createElement(Dte,{page:e,matches:r,...t}):null}function Ote(e){let{manifest:t,routeModules:n}=cz(),[r,i]=b.useState([]);return b.useEffect(()=>{let s=!1;return Ste(e,t,n).then(o=>{s||i(o)}),()=>{s=!0}},[e,t,n]),r}function Dte({page:e,matches:t,...n}){let r=Qn(),{manifest:i,routeModules:s}=cz(),{basename:o}=uz(),{loaderData:a,matches:l}=Pte(),u=b.useMemo(()=>aM(e,t,l,i,r,"data"),[e,t,l,i,r]),f=b.useMemo(()=>aM(e,t,l,i,r,"assets"),[e,t,l,i,r]),d=b.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,_=!1;if(t.forEach(x=>{let S=i.routes[x.route.id];!S||!S.hasLoader||(!u.some(C=>C.route.id===x.route.id)&&x.route.id in a&&s[x.route.id]?.shouldRevalidate||S.hasClientLoader?_=!0:v.add(x.route.id))}),v.size===0)return[];let w=_te(e,o,"data");return _&&v.size>0&&w.searchParams.set("_routes",t.filter(x=>v.has(x.route.id)).map(x=>x.route.id).join(",")),[w.pathname+w.search]},[o,a,r,i,u,t,e,s]),p=b.useMemo(()=>Ete(f,i),[f,i]),m=Ote(f);return b.createElement(b.Fragment,null,d.map(v=>b.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),p.map(v=>b.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),m.map(({key:v,link:_})=>b.createElement("link",{key:v,nonce:n.nonce,..._})))}function Ate(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var dz=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{dz&&(window.__reactRouterVersion="7.9.6")}catch{}function Mte(e,t){return yee({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:AJ({window:t?.window}),hydrationData:Nte(),routes:e,mapRouteProperties:ite,hydrationRouteProperties:ste,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function Nte(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:jte(e.errors)}),e}function jte(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new T0(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let o=new s(i.message);o.stack="",n[r]=o}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}var fz=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fo=b.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:f,viewTransition:d,...p},m){let{basename:v}=b.useContext(yo),_=typeof u=="string"&&fz.test(u),w,x=!1;if(typeof u=="string"&&_&&(w=u,dz))try{let L=new URL(window.location.href),A=u.startsWith("//")?new URL(L.protocol+u):new URL(u),$=js(A.pathname,v);A.origin===L.origin&&$!=null?u=$+A.search+A.hash:x=!0}catch{Fn(!1,`<Link to="${u}">
12 contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let S=Uee(u,{relative:i}),[C,R,P]=Rte(r,p),k=zte(u,{replace:o,state:a,target:l,preventScrollReset:f,relative:i,viewTransition:d});function I(L){t&&t(L),L.defaultPrevented||k(L)}let D=b.createElement("a",{...p,...P,href:w||S,onClick:x||s?t:I,ref:Ate(m,R),target:l,"data-discover":!_&&n==="render"?"true":void 0});return C&&!_?b.createElement(b.Fragment,null,D,b.createElement(Ite,{page:S})):D});fo.displayName="Link";var Lte=b.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:o,viewTransition:a,children:l,...u},f){let d=Xm(o,{relative:u.relative}),p=Qn(),m=b.useContext(Qm),{navigator:v,basename:_}=b.useContext(yo),w=m!=null&&qte(d)&&a===!0,x=v.encodeLocation?v.encodeLocation(d).pathname:d.pathname,S=p.pathname,C=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;n||(S=S.toLowerCase(),C=C?C.toLowerCase():null,x=x.toLowerCase()),C&&_&&(C=js(C,_)||C);const R=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let P=S===x||!i&&S.startsWith(x)&&S.charAt(R)==="/",k=C!=null&&(C===x||!i&&C.startsWith(x)&&C.charAt(x.length)==="/"),I={isActive:P,isPending:k,isTransitioning:w},D=P?t:void 0,L;typeof r=="function"?L=r(I):L=[r,P?"active":null,k?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof s=="function"?s(I):s;return b.createElement(fo,{...u,"aria-current":D,className:L,ref:f,style:A,to:o,viewTransition:a},typeof l=="function"?l(I):l)});Lte.displayName="NavLink";var Fte=b.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:o=Jy,action:a,onSubmit:l,relative:u,preventScrollReset:f,viewTransition:d,...p},m)=>{let v=Bte(),_=Hte(a,{relative:u}),w=o.toLowerCase()==="get"?"get":"post",x=typeof a=="string"&&fz.test(a),S=C=>{if(l&&l(C),C.defaultPrevented)return;C.preventDefault();let R=C.nativeEvent.submitter,P=R?.getAttribute("formmethod")||o;v(R||C.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:s,relative:u,preventScrollReset:f,viewTransition:d})};return b.createElement("form",{ref:m,method:w,action:_,onSubmit:r?l:S,...p,"data-discover":!x&&e==="render"?"true":void 0})});Fte.displayName="Form";function $te(e){return`${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function hz(e){let t=b.useContext(Oc);return Nt(t,$te(e)),t}function zte(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:o}={}){let a=wi(),l=Qn(),u=Xm(e,{relative:s});return b.useCallback(f=>{if(mte(f,t)){f.preventDefault();let d=n!==void 0?n:Go(l)===Go(u);a(e,{replace:d,state:r,preventScrollReset:i,relative:s,viewTransition:o})}},[l,a,u,n,r,t,e,i,s,o])}function Jm(e){Fn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=b.useRef(ZE(e)),n=b.useRef(!1),r=Qn(),i=b.useMemo(()=>gte(r.search,n.current?null:t.current),[r.search]),s=wi(),o=b.useCallback((a,l)=>{const u=ZE(typeof a=="function"?a(new URLSearchParams(i)):a);n.current=!0,s("?"+u,l)},[s,i]);return[i,o]}var Vte=0,Ute=()=>`__${String(++Vte)}__`;function Bte(){let{router:e}=hz("useSubmit"),{basename:t}=b.useContext(yo),n=nte();return b.useCallback(async(r,i={})=>{let{action:s,method:o,encType:a,formData:l,body:u}=bte(r,t);if(i.navigate===!1){let f=i.fetcherKey||Ute();await e.fetch(f,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||o,formEncType:i.encType||a,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:l,body:u,formMethod:i.method||o,formEncType:i.encType||a,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function Hte(e,{relative:t}={}){let{basename:n}=b.useContext(yo),r=b.useContext(Ls);Nt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Xm(e||".",{relative:t})},o=Qn();if(e==null){s.search=o.search;let a=new URLSearchParams(s.search),l=a.getAll("index");if(l.some(f=>f==="")){a.delete("index"),l.filter(d=>
12d).forEach(d=>a.append("index",d));let f=a.toString();s.search=f?`?${f}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Fo([n,s.pathname])),Go(s)}function qte(e,{relative:t}={}){let n=b.useContext(VT);Nt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hz("useViewTransitionState"),i=Xm(e,{relative:t});if(!n.isTransitioning)return!1;let s=js(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=js(n.nextLocation.pathname,r)||n.nextLocation.pathname;return hm(i.pathname,o)!=null||hm(i.pathname,s)!=null}var Ba=z5();const Wte=vo(Ba);function Gte(e){return b.createElement(ate,{flushSync:Ba.flushSync,...e})}var pz=(e=>(e.BASE="base",e.BODY="body",e.HEAD="head",e.HTML="html",e.LINK="link",e.META="meta",e.NOSCRIPT="noscript",e.SCRIPT="script",e.STYLE="style",e.TITLE="title",e.FRAGMENT="Symbol(react.fragment)",e))(pz||{}),v1={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}};Object.values(pz);var KT={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"};Object.entries(KT).reduce((e,[t,n])=>(e[n]=t,e),{});var mm="data-rh",Kte=e=>Array.isArray(e)?e.join(""):e,Zte=(e,t)=>{const n=Object.keys(e);for(let r=0;r<n.length;r+=1)if(t[n[r]]&&t[n[r]].includes(e[n[r]]))return!0;return!1},y1=(e,t)=>Array.isArray(e)?e.reduce((n,r)=>(Zte(r,t)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:e,priority:[]},Yte=["noscript","script","style"],YE=(e,t=!0)=>t===!1?String(e):String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),mz=e=>Object.keys(e).reduce((t,n)=>{const r=typeof e[n]<"u"?`${n}="${e[n]}"`:`${n}`;return t?`${t} ${r}`:r},""),Qte=(e,t,n,r)=>{const i=mz(n),s=Kte(t);return i?`<${e} ${mm}="true" ${i}>${YE(s,r)}</${e}>`:`<${e} ${mm}="true">${YE(s,r)}</${e}>`},Xte=(e,t,n=!0)=>t.reduce((r,i)=>{const s=i,o=Object.keys(s).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,f)=>{const d=typeof s[f]>"u"?f:`${f}="${YE(s[f],n)}"`;return u?`${u} ${d}`:d},""),a=s.innerHTML||s.cssText||"",l=Yte.indexOf(e)===-1;return`${r}<${e} ${mm}="true" ${o}${l?"/>":`>${a}</${e}>`}`},""),gz=(e,t={})=>Object.keys(e).reduce((n,r)=>{const i=KT[r];return n[i||r]=e[r],n},t),Jte=(e,t,n)=>{const r={key:t,[mm]:!0},i=gz(n,r);return[ve.createElement("title",i,t)]},t0=(e,t)=>t.map((n,r)=>{const i={key:r,[mm]:!0};return Object.keys(n).forEach(s=>{const a=KT[s]||s;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;i.dangerouslySetInnerHTML={__html:l}}else i[a]=n[s]}),ve.createElement(e,i)}),xs=(e,t,n=!0)=>{switch(e){case"title":return{toComponent:()=>Jte(e,t.title,t.titleAttributes),toString:()=>Qte(e,t.title,t.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>gz(t),toString:()=>mz(t)};default:return{toComponent:()=>t0(e,t),toString:()=>Xte(e,t,n)}}},ene=({metaTags:e,linkTags:t,scriptTags:n,encode:r})=>{const i=y1(e,v1.meta),s=y1(t,v1.link),o=y1(n,v1.script);return{priorityMethods:{toComponent:()=>[...t0("meta",i.priority),...t0("link",s.priority),...t0("script",o.priority)],toString:()=>`${xs("meta",i.priority,r)} ${xs("link",s.priority,r)} ${xs("script",o.priority,r)}`},metaTags:i.default,linkTags:s.default,scriptTags:o.default}},tne=e=>{const{baseTag:t,bodyAttributes:n,encode:r=!0,htmlAttributes:i,noscriptTags:s,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:u}=e;let{linkTags:f,metaTags:d,scriptTags:p}=e,m={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:m,linkTags:f,metaTags:d,scriptTags:p}=ene(e)),{priority:m,base:xs("base",t,r),bodyAttributes:xs("bodyAttributes",n,r),htmlAttributes:xs("htmlAttributes",i,r),link:xs("link",f,r),meta:xs("meta",d,r),noscript:xs("noscript",s,r),script:xs("script",p,r),style:xs("style",o,r),title:xs("title",{title:a,titleAttributes:l},r)}},nne=tne,Kv=[],vz=!!(typeof window<"u"&&window.document&&window.document.createElement),rne=class{instances=[];canUseDOM=vz;context;value={setHelmet:e=>{this.context.helmet=e},helmetInstances:{get:()=>this.canUseDOM?Kv:this.instances,add:e=>{(this.canUseDOM?Kv:this.instances).push(e)},remove:e=>{const t=(this.canUseDOM?Kv:this.instances).indexOf(e);(this.canUseDOM?Kv:this.instances).splice(t,1)}}};constructor(e,t){this.context=e,this.canUseDOM=t||!1,t||(e.helmet=nne({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},ine={},sne=ve.createContext(ine),one=class yz extends b.Component{static canUseDOM=vz;helmetData;constructor(t){super(t),this.helmetData=new rne(this.props.context||{},yz.canUseDOM)}render(){return ve.createElement(sne.Provider,{value:this.helmetData.value},this.props.children)}};const bz=b.createContext(void 0),_z="mentes-theme";function b1(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dar
12k":"light"}function ane(){if(typeof window>"u")return"system";const e=localStorage.getItem(_z);return e==="light"||e==="dark"||e==="system"?e:"system"}function lne({children:e}){const[t,n]=b.useState("system"),[r,i]=b.useState("light"),[s,o]=b.useState(!1);b.useEffect(()=>{const l=ane();n(l),o(!0)},[]),b.useEffect(()=>{if(!s)return;const l=t==="system"?b1():t;i(l);const u=document.documentElement;u.classList.remove("light","dark"),u.classList.add(l)},[t,s]),b.useEffect(()=>{if(!s||t!=="system")return;const l=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{i(b1());const f=document.documentElement;f.classList.remove("light","dark"),f.classList.add(b1())};return l.addEventListener("change",u),()=>l.removeEventListener("change",u)},[t,s]);const a=l=>{n(l),localStorage.setItem(_z,l)};return s?g.jsx(bz.Provider,{value:{theme:t,resolvedTheme:r,setTheme:a},children:e}):g.jsx("div",{style:{visibility:"hidden"},children:e})}function wz(){const e=b.useContext(bz);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e}function une({children:e,...t}){return g.jsx(lne,{children:e})}const cne=1,dne=1e6;let _1=0;function fne(){return _1=(_1+1)%Number.MAX_SAFE_INTEGER,_1.toString()}const w1=new Map,lM=e=>{if(w1.has(e))return;const t=setTimeout(()=>{w1.delete(e),qp({type:"REMOVE_TOAST",toastId:e})},dne);w1.set(e,t)},hne=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,cne)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?lM(n):e.toasts.forEach(r=>{lM(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},n0=[];let r0={toasts:[]};function qp(e){r0=hne(r0,e),n0.forEach(t=>{t(r0)})}function df({...e}){const t=fne(),n=i=>qp({type:"UPDATE_TOAST",toast:{...i,id:t}}),r=()=>qp({type:"DISMISS_TOAST",toastId:t});return qp({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:i=>{i||r()}}}),{id:t,dismiss:r,update:n}}function xz(){const[e,t]=b.useState(r0);return b.useEffect(()=>(n0.push(t),()=>{const n=n0.indexOf(t);n>-1&&n0.splice(n,1)}),[e]),{...e,toast:df,dismiss:n=>qp({type:"DISMISS_TOAST",toastId:n})}}const pne=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mne=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),uM=e=>{const t=mne(e);return t.charAt(0).toUpperCase()+t.slice(1)},Sz=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();var gne={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"};const vne=b.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:o,...a},l)=>b.createElement("svg",{ref:l,...gne,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sz("lucide",i),...a},[...o.map(([u,f])=>b.createElement(u,f)),...Array.isArray(s)?s:[s]]));const Ne=(e,t)=>{const n=b.forwardRef(({className:r,...i},s)=>b.createElement(vne,{ref:s,iconNode:t,className:Sz(`lucide-${pne(uM(e))}`,`lucide-${e}`,r),...i}));return n.displayName=uM(e),n};const yne=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Ez=Ne("archive",yne);const bne=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],ZT=Ne("arrow-right",bne);const _ne=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],wne=Ne("bell",_ne);const xne=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Cz=Ne("book-open",xne);const Sne=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],eg=Ne("bookmark",Sne);const Ene=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],tg=Ne("bot",Ene);const Cne=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],kne=Ne("box",Cne);const Tne=[["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"}]],Pne=Ne("calendar",Tne);const Rne=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ng=Ne("check",Rne);const Ine=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],kz=Ne("chevron-down",Ine);const One=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Tz=Ne("chevron-left",One);const Dne=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Jb=Ne("chevron-right",Dne);const Ane=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Pz=Ne("chevron-up",Ane);const Mne=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],Rz=Ne("chevrons-left",Mne);const Nne=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],Iz=Ne("chevrons-right",Nne);const jne=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Lne=Ne("chevrons-up-down",jne);const Fne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],$ne=Ne("circle-plus",Fne);const zne=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Oz=Ne("circle",zne);
12const Vne=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Dz=Ne("clipboard-list",Vne);const Une=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Bne=Ne("compass",Une);const Hne=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],qne=Ne("copy",Hne);const Wne=[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]],Gne=Ne("dot",Wne);const Kne=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],Zne=Ne("ellipsis-vertical",Kne);const Yne=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Az=Ne("ellipsis",Yne);const Qne=[["path",{d:"m7 21-4.3-4.3c-1-1-1-2.5 0-3.4l9.6-9.6c1-1 2.5-1 3.4 0l5.6 5.6c1 1 1 2.5 0 3.4L13 21",key:"182aya"}],["path",{d:"M22 21H7",key:"t4ddhn"}],["path",{d:"m5 11 9 9",key:"1mo9qw"}]],Xne=Ne("eraser",Qne);const Jne=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ere=Ne("external-link",Jne);const tre=[["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"}]],nre=Ne("eye",tre);const rre=[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]],ire=Ne("file-pen-line",rre);const sre=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],e_=Ne("file-text",sre);const ore=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],are=Ne("file",ore);const lre=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],ure=Ne("folder-open",lre);const cre=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],dre=Ne("folder-plus",cre);const fre=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Mz=Ne("folder",fre);const hre=[["line",{x1:"22",x2:"2",y1:"6",y2:"6",key:"15w7dq"}],["line",{x1:"22",x2:"2",y1:"18",y2:"18",key:"1ip48p"}],["line",{x1:"6",x2:"6",y1:"2",y2:"22",key:"a2lnyx"}],["line",{x1:"18",x2:"18",y1:"2",y2:"22",key:"8vb6jd"}]],pre=Ne("frame",hre);const mre=[["path",{d:"M9 10h.01",key:"qbtxuw"}],["path",{d:"M15 10h.01",key:"1qmjsl"}],["path",{d:"M12 2a8 8 0 0 0-8 8v12l3-3 2.5 2.5L12 19l2.5 2.5L17 19l3 3V10a8 8 0 0 0-8-8z",key:"uwwb07"}]],R0=Ne("ghost",mre);const gre=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],vre=Ne("grip-vertical",gre);const yre=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],bre=Ne("house",yre);const _re=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],wre=Ne("inbox",_re);
12const xre=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],cM=Ne("library-big",xre);const Sre=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],Nz=Ne("library",Sre);const Ere=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],jz=Ne("link",Ere);const Cre=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],Lz=Ne("list-todo",Cre);const kre=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],QE=Ne("loader-circle",kre);const Tre=[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],Fz=Ne("maximize-2",Tre);const Pre=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],$z=Ne("menu",Pre);const Rre=[["path",{d:"M13.5 3.1c-.5 0-1-.1-1.5-.1s-1 .1-1.5.1",key:"16ll65"}],["path",{d:"M19.3 6.8a10.45 10.45 0 0 0-2.1-2.1",key:"1nq77a"}],["path",{d:"M20.9 13.5c.1-.5.1-1 .1-1.5s-.1-1-.1-1.5",key:"1sf7wn"}],["path",{d:"M17.2 19.3a10.45 10.45 0 0 0 2.1-2.1",key:"x1hs5g"}],["path",{d:"M10.5 20.9c.5.1 1 .1 1.5.1s1-.1 1.5-.1",key:"19m18z"}],["path",{d:"M3.5 17.5 2 22l4.5-1.5",key:"1f36qi"}],["path",{d:"M3.1 10.5c0 .5-.1 1-.1 1.5s.1 1 .1 1.5",key:"1vz3ju"}],["path",{d:"M6.8 4.7a10.45 10.45 0 0 0-2.1 2.1",key:"19f9do"}]],Ire=Ne("message-circle-dashed",Rre);const Ore=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Dre=Ne("message-circle-question",Ore);const Are=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],YT=Ne("message-circle",Are);const Mre=[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M16 10h.01",key:"1m94wz"}]],Nre=Ne("message-square-more",Mre);const jre=[["path",{d:"M14 9a2 2 0 0 1-2 2H6l-4 4V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2z",key:"p1xzt8"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v11l-4-4h-6a2 2 0 0 1-2-2v-1",key:"1cx29u"}]],Lre=Ne("messages-square",jre);const Fre=[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]],zz=Ne("minimize-2",Fre);const $re=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],zre=Ne("monitor",$re);const Vre=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],Vz=Ne("moon",Vre);const Ure=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Bre=Ne("network",Ure);const Hre=[["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-4 0v-9a2 2 0 0 1 2-2h2",key:"39pd36"}],["rect",{width:"8",height:"4",x:"10",y:"6",rx:"1",key:"aywv1n"}]],qre=Ne("newspaper",Hre);const Wre=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}
12],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],QT=Ne("notebook-pen",Wre);const Gre=[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]],Kre=Ne("paintbrush",Gre);const Zre=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m10 15-3-3 3-3",key:"1pgupc"}]],Yre=Ne("panel-right-open",Zre);const Qre=[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]],Xre=Ne("paperclip",Qre);const Jre=[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]],eie=Ne("pen-line",Jre);const tie=[["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"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Uz=Ne("pencil",tie);const nie=[["path",{d:"M2 10h6V4",key:"zwrco"}],["path",{d:"m2 4 6 6",key:"ug085t"}],["path",{d:"M21 10V7a2 2 0 0 0-2-2h-7",key:"git5jr"}],["path",{d:"M3 14v2a2 2 0 0 0 2 2h3",key:"1f7fh3"}],["rect",{x:"12",y:"14",width:"10",height:"7",rx:"1",key:"1wjs3o"}]],rie=Ne("picture-in-picture",nie);const iie=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xf=Ne("plus",iie);const sie=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],Bz=Ne("presentation",sie);const oie=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Hz=Ne("refresh-cw",oie);const aie=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],lie=Ne("rocket",aie);const uie=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],qz=Ne("rotate-cw",uie);const cie=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Tf=Ne("search",cie);const die=[["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"}]],fie=Ne("send",die);const hie=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],pie=Ne("settings",hie);const mie=[["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"}]],gie=Ne("share-2",mie);const vie=[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]],yie=Ne("sliders-vertical",vie);const bie=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],_ie=Ne("sparkles",bie);const wie=[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Wz=Ne("square-check-big",wie);const xie=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],Sie=Ne("square-pen",xie);const Eie=[["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"}]],i0=Ne("star",Eie);const Cie=[["path",{d:"M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",key:"qazsjp"}],["path",{d:"M15 3v4a2 2 0 0 0 2 2h4",key:"40519r"}]],Gz=Ne("sticky-note",Cie);const kie=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]],Tie=Ne("sun-medium",kie);const Pie=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Rie=Ne("sun",Pie);
12const Iie=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Oie=Ne("tag",Iie);const Die=[["path",{d:"M4 4v16",key:"6qkkli"}]],Aie=Ne("tally-1",Die);const Mie=[["path",{d:"M15 18H3",key:"olowqp"}],["path",{d:"M17 6H3",key:"16j9eg"}],["path",{d:"M21 12H3",key:"2avoz0"}]],Nie=Ne("text",Mie);const jie=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],t_=Ne("trash-2",jie);const Lie=[["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"}]],Fie=Ne("twitter",Lie);const $ie=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],zie=Ne("user-plus",$ie);const Vie=[["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"}]],Kz=Ne("user",Vie);const Uie=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Jo=Ne("x",Uie);function yt(e,t,{checkForDefaultPrevented:n=!0}={}){return function(i){if(e?.(i),n===!1||!i.defaultPrevented)return t?.(i)}}function dM(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ja(...e){return t=>{let n=!1;const r=e.map(i=>{const s=dM(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():dM(e[i],null)}}}}function pr(...e){return b.useCallback(ja(...e),e)}function Bie(e,t){const n=b.createContext(t),r=s=>{const{children:o,...a}=s,l=b.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:o})};r.displayName=e+"Provider";function i(s){const o=b.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function iu(e,t=[]){let n=[];function r(s,o){const a=b.createContext(o),l=n.length;n=[...n,o];const u=d=>{const{scope:p,children:m,...v}=d,_=p?.[e]?.[l]||a,w=b.useMemo(()=>v,Object.values(v));return g.jsx(_.Provider,{value:w,children:m})};u.displayName=s+"Provider";function f(d,p){const m=p?.[e]?.[l]||a,v=b.useContext(m);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[u,f]}const i=()=>{const s=n.map(o=>b.createContext(o));return function(a){const l=a?.[e]||s;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return i.scopeName=e,[r,Hie(i,...t)]}function Hie(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}var Pf=b.forwardRef((e,t)=>{const{children:n,...r}=e,i=b.Children.toArray(n),s=i.find(Wie);if(s){const o=s.props.children,a=i.map(l=>l===s?b.Children.count(o)>1?b.Children.only(null):b.isValidElement(o)?o.props.children:null:l);return g.jsx(XE,{...r,ref:t,children:b.isValidElement(o)?b.cloneElement(o,void 0,a):null})}return g.jsx(XE,{...r,ref:t,children:n})});Pf.displayName="Slot";var XE=b.forwardRef((e,t)=>{const{children:n,...r}=e;if(b.isValidElement(n)){const i=Kie(n),s=Gie(r,n.props);return n.type!==b.Fragment&&(s.ref=t?ja(t,i):i),b.cloneElement(n,s)}return b.Children.count(n)>1?b.Children.only(null):null});XE.displayName="SlotClone";var qie=({children:e})=>g.jsx(g.Fragment,{children:e});function Wie(e){return b.isValidElement(e)&&e.type===qie}function Gie(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{s(...a),i(...a)}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}
vendor: 1,693 bytes, line 12
12:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}function Kie(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function XT(e){const t=e+"CollectionProvider",[n,r]=iu(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=m=>{const{scope:v,children:_}=m,w=ve.useRef(null),x=ve.useRef(new Map).current;return g.jsx(i,{scope:v,itemMap:x,collectionRef:w,children:_})};o.displayName=t;const a=e+"CollectionSlot",l=ve.forwardRef((m,v)=>{const{scope:_,children:w}=m,x=s(a,_),S=pr(v,x.collectionRef);return g.jsx(Pf,{ref:S,children:w})});l.displayName=a;const u=e+"CollectionItemSlot",f="data-radix-collection-item",d=ve.forwardRef((m,v)=>{const{scope:_,children:w,...x}=m,S=ve.useRef(null),C=pr(v,S),R=s(u,_);return ve.useEffect(()=>(R.itemMap.set(S,{ref:S,...x}),()=>void R.itemMap.delete(S))),g.jsx(Pf,{[f]:"",ref:C,children:w})});d.displayName=u;function p(m){const v=s(e+"CollectionConsumer",m);return ve.useCallback(()=>{const w=v.collectionRef.current;if(!w)return[];const x=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(v.itemMap.values()).sort((R,P)=>x.indexOf(R.ref.current)-x.indexOf(P.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:o,Slot:l,ItemSlot:d},p,r]}var Zie=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],qt=Zie.reduce((e,t)=>{const n=b.forwardRef((r,i)=>{const{asChild:s,...o}=r,a=s?Pf:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(a,{...o,ref:i}
vendor: 6,491 bytes, line 12
12)});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function JT(e,t){e&&Ba.flushSync(()=>e.dispatchEvent(t))}function _i(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...n)=>t.current?.(...n),[])}function Yie(e,t=globalThis?.document){const n=_i(e);b.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Qie="DismissableLayer",JE="dismissableLayer.update",Xie="dismissableLayer.pointerDownOutside",Jie="dismissableLayer.focusOutside",fM,Zz=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),n_=b.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:o,onDismiss:a,...l}=e,u=b.useContext(Zz),[f,d]=b.useState(null),p=f?.ownerDocument??globalThis?.document,[,m]=b.useState({}),v=pr(t,I=>d(I)),_=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),x=_.indexOf(w),S=f?_.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,R=S>=x,P=tse(I=>{const D=I.target,L=[...u.branches].some(A=>A.contains(D));!R||L||(i?.(I),o?.(I),I.defaultPrevented||a?.())},p),k=nse(I=>{const D=I.target;[...u.branches].some(A=>A.contains(D))||(s?.(I),o?.(I),I.defaultPrevented||a?.())},p);return Yie(I=>{S===u.layers.size-1&&(r?.(I),!I.defaultPrevented&&a&&(I.preventDefault(),a()))},p),b.useEffect(()=>{if(f)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(fM=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),hM(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=fM)}},[f,p,n,u]),b.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),hM())},[f,u]),b.useEffect(()=>{const I=()=>m({});return document.addEventListener(JE,I),()=>document.removeEventListener(JE,I)},[]),g.jsx(qt.div,{...l,ref:v,style:{pointerEvents:C?R?"auto":"none":void 0,...e.style},onFocusCapture:yt(e.onFocusCapture,k.onFocusCapture),onBlurCapture:yt(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:yt(e.onPointerDownCapture,P.onPointerDownCapture)})});n_.displayName=Qie;var ese="DismissableLayerBranch",Yz=b.forwardRef((e,t)=>{const n=b.useContext(Zz),r=b.useRef(null),i=pr(t,r);return b.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),g.jsx(qt.div,{...e,ref:i})});Yz.displayName=ese;function tse(e,t=globalThis?.document){const n=_i(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{const s=a=>{if(a.target&&!r.current){let l=function(){Qz(Xie,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}else t.removeEventListener("click",i.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function nse(e,t=globalThis?.document){const n=_i(e),r=b.useRef(!1);return b.useEffect(()=>{const i=s=>{s.target&&!r.current&&Qz(Jie,n,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hM(){const e=new CustomEvent(JE);document.dispatchEvent(e)}function Qz(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?JT(i,s):i.dispatchEvent(s)}var rse=n_,ise=Yz,Wl=globalThis?.document?b.useLayoutEffect:()=>{},sse="Portal",r_=b.forwardRef((e,t)=>{const{container:n,...r}=e,[i,s]=b.useState(!1);Wl(()=>s(!0),[]);const o=n||i&&globalThis?.document?.body;return o?Wte.createPortal(g.jsx(qt.div,{...r,ref:t}),o):null});r_.displayName=sse;function ose(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}var ea=e=>{const{present:t,children:n}=e,r=ase(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=pr(r.ref,lse(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:s}):null};ea.displayName="Presence";function ase(e){const[t,n]=b.useState(),r=b.useRef({}),i=b.useRef(e),s=b.useRef("none"),o=e?"mounted":"unmounted",[a,l]=ose(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=Zv(r.current);s.current=a==="mounted"?u:"none"},[a]),Wl(()=>{const u=r.current,f=i.current;if(f!==e){const p=s.current,m=Zv(u);e?l("MOUNT"):m==="none"||u?.display==="none"?l("UNMOUNT"):l(f&&p!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),Wl(()=>{if(t){let u;const f=t.ownerDocument.defaultView??window,d=m=>{const _=Zv(r.current).includes(m.animationName);if(m.target===t&&_&&(l("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",u=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},p=m=>{m.target===t&&(s.current=Zv(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(u),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Zv(e){return e?.animationName||"none"}function lse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function rg({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=use({defaultProp:t,onChange:n}),s=e!==void 0,o=s?e:r,a=_i(n),l=b.useCallback(u=>{if(s){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else i(u)},[s,e,i,a]);return[o,l]}function use({defaultProp:e,onChange:t}){const n=b.useState(e),[r]=n,i=b.useRef(r),s=_i(t);return b.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}var cse="VisuallyHidden",eP=b.forwardRef((e,t)=>
12g.jsx(qt.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));eP.displayName=cse;var tP="ToastProvider",[nP,dse,fse]=XT("Toast"),[Xz]=iu("Toast",[fse]),[hse,i_]=Xz(tP),Jz=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:i="right",swipeThreshold:s=50,children:o}=e,[a,l]=b.useState(null),[u,f]=b.useState(0),d=b.useRef(!1),p=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${tP}\`. Expected non-empty \`string\`.`),g.jsx(nP.Provider,{scope:t,children:g.jsx(hse,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:s,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:b.useCallback(()=>f(m=>m+1),[]),onToastRemove:b.useCallback(()=>f(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:p,children:o})})};Jz.displayName=tP;var e6="ToastViewport",pse=["F8"],eC="toast.viewportPause",tC="toast.viewportResume",t6=b.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=pse,label:i="Notifications ({hotkey})",...s}=e,o=i_(e6,n),a=dse(n),l=b.useRef(null),u=b.useRef(null),f=b.useRef(null),d=b.useRef(null),p=pr(t,d,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),v=o.toastCount>0;b.useEffect(()=>{const w=x=>{r.length!==0&&r.every(C=>x[C]||x.code===C)&&d.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),b.useEffect(()=>{const w=l.current,x=d.current;if(v&&w&&x){const S=()=>{if(!o.isClosePausedRef.current){const k=new CustomEvent(eC);x.dispatchEvent(k),o.isClosePausedRef.current=!0}},C=()=>{if(o.isClosePausedRef.current){const k=new CustomEvent(tC);x.dispatchEvent(k),o.isClosePausedRef.current=!1}},R=k=>{!w.contains(k.relatedTarget)&&C()},P=()=>{w.contains(document.activeElement)||C()};return w.addEventListener("focusin",S),w.addEventListener("focusout",R),w.addEventListener("pointermove",S),w.addEventListener("pointerleave",P),window.addEventListener("blur",S),window.addEventListener("focus",C),()=>{w.removeEventListener("focusin",S),w.removeEventListener("focusout",R),w.removeEventListener("pointermove",S),w.removeEventListener("pointerleave",P),window.removeEventListener("blur",S),window.removeEventListener("focus",C)}}},[v,o.isClosePausedRef]);const _=b.useCallback(({tabbingDirection:w})=>{const S=a().map(C=>{const R=C.ref.current,P=[R,...Tse(R)];return w==="forwards"?P:P.reverse()});return(w==="forwards"?S.reverse():S).flat()},[a]);return b.useEffect(()=>{const w=d.current;if(w){const x=S=>{const C=S.altKey||S.ctrlKey||S.metaKey;if(S.key==="Tab"&&!C){const P=document.activeElement,k=S.shiftKey;if(S.target===w&&k){u.current?.focus();return}const L=_({tabbingDirection:k?"backwards":"forwards"}),A=L.findIndex($=>$===P);x1(L.slice(A+1))?S.preventDefault():k?u.current?.focus():f.current?.focus()}};return w.addEventListener("keydown",x),()=>w.removeEventListener("keydown",x)}},[a,_]),g.jsxs(ise,{ref:l,role:"region","aria-label":i.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:v?void 0:"none"},children:[v&&g.jsx(nC,{ref:u,onFocusFromOutsideViewport:()=>{const w=_({tabbingDirection:"forwards"});x1(w)}}),g.jsx(nP.Slot,{scope:n,children:g.jsx(qt.ol,{tabIndex:-1,...s,ref:p})}),v&&g.jsx(nC,{ref:f,onFocusFromOutsideViewport:()=>{const w=_({tabbingDirection:"backwards"});x1(w)}})]})});t6.displayName=e6;var n6="ToastFocusProxy",nC=b.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,s=i_(n6,n);return g.jsx(eP,{"aria-hidden":!0,tabIndex:0,...i,ref:t,style:{position:"fixed"},onFocus:o=>{const a=o.relatedTarget;!s.viewport?.contains(a)&&r()}})});nC.displayName=n6;var s_="Toast",mse="toast.swipeStart",gse="toast.swipeMove",vse="toast.swipeCancel",yse="toast.swipeEnd",r6=b.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:i,onOpenChange:s,...o}=e,[a=!0,l]=rg({prop:r,defaultProp:i,onChange:s});return g.jsx(ea,{present:n||a,children:g.jsx(wse,{open:a,...o,ref:t,onClose:()=>l(!1),onPause:_i(e.onPause),onResume:_i(e.onResume),onSwipeStart:yt(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:yt(e.onSwipeMove,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${d}px`)}),onSwipeCancel:yt(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:yt(e.onSwipeEnd,u=>{const{x:f,y:d}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${f}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${d}px`),l(!1)})})})});r6.displayName=s_;var[bse,_se]=Xz(s_,{onClose(){}}),wse=b.forwardRef((e,t)=>
12{const{__scopeToast:n,type:r="foreground",duration:i,open:s,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:f,onSwipeMove:d,onSwipeCancel:p,onSwipeEnd:m,...v}=e,_=i_(s_,n),[w,x]=b.useState(null),S=pr(t,B=>x(B)),C=b.useRef(null),R=b.useRef(null),P=i||_.duration,k=b.useRef(0),I=b.useRef(P),D=b.useRef(0),{onToastAdd:L,onToastRemove:A}=_,$=_i(()=>{w?.contains(document.activeElement)&&_.viewport?.focus(),o()}),j=b.useCallback(B=>{!B||B===1/0||(window.clearTimeout(D.current),k.current=new Date().getTime(),D.current=window.setTimeout($,B))},[$]);b.useEffect(()=>{const B=_.viewport;if(B){const H=()=>{j(I.current),u?.()},te=()=>{const G=new Date().getTime()-k.current;I.current=I.current-G,window.clearTimeout(D.current),l?.()};return B.addEventListener(eC,te),B.addEventListener(tC,H),()=>{B.removeEventListener(eC,te),B.removeEventListener(tC,H)}}},[_.viewport,P,l,u,j]),b.useEffect(()=>{s&&!_.isClosePausedRef.current&&j(P)},[s,P,_.isClosePausedRef,j]),b.useEffect(()=>(L(),()=>A()),[L,A]);const V=b.useMemo(()=>w?c6(w):null,[w]);return _.viewport?g.jsxs(g.Fragment,{children:[V&&g.jsx(xse,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:V}),g.jsx(bse,{scope:n,onClose:$,children:Ba.createPortal(g.jsx(nP.ItemSlot,{scope:n,children:g.jsx(rse,{asChild:!0,onEscapeKeyDown:yt(a,()=>{_.isFocusedToastEscapeKeyDownRef.current||$(),_.isFocusedToastEscapeKeyDownRef.current=!1}),children:g.jsx(qt.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":_.swipeDirection,...v,ref:S,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:yt(e.onKeyDown,B=>{B.key==="Escape"&&(a?.(B.nativeEvent),B.nativeEvent.defaultPrevented||(_.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:yt(e.onPointerDown,B=>{B.button===0&&(C.current={x:B.clientX,y:B.clientY})}),onPointerMove:yt(e.onPointerMove,B=>{if(!C.current)return;const H=B.clientX-C.current.x,te=B.clientY-C.current.y,G=!!R.current,Z=["left","right"].includes(_.swipeDirection),Y=["left","up"].includes(_.swipeDirection)?Math.min:Math.max,M=Z?Y(0,H):0,q=Z?0:Y(0,te),z=B.pointerType==="touch"?10:2,N={x:M,y:q},ee={originalEvent:B,delta:N};G?(R.current=N,Yv(gse,d,ee,{discrete:!1})):pM(N,_.swipeDirection,z)?(R.current=N,Yv(mse,f,ee,{discrete:!1}),B.target.setPointerCapture(B.pointerId)):(Math.abs(H)>z||Math.abs(te)>z)&&(C.current=null)}),onPointerUp:yt(e.onPointerUp,B=>{const H=R.current,te=B.target;if(te.hasPointerCapture(B.pointerId)&&te.releasePointerCapture(B.pointerId),R.current=null,C.current=null,H){const G=B.currentTarget,Z={originalEvent:B,delta:H};pM(H,_.swipeDirection,_.swipeThreshold)?Yv(yse,m,Z,{discrete:!0}):Yv(vse,p,Z,{discrete:!0}),G.addEventListener("click",Y=>Y.preventDefault(),{once:!0})}})})})}),_.viewport)})]}):null}),xse=e=>{const{__scopeToast:t,children:n,...r}=e,i=i_(s_,t),[s,o]=b.useState(!1),[a,l]=b.useState(!1);return Cse(()=>o(!0)),b.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:g.jsx(r_,{asChild:!0,children:g.jsx(eP,{...r,children:s&&g.jsxs(g.Fragment,{children:[i.label," ",n]})})})},Sse="ToastTitle",i6=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(qt.div,{...r,ref:t})});i6.displayName=Sse;var Ese="ToastDescription",s6=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return g.jsx(qt.div,{...r,ref:t})});s6.displayName=Ese;var o6="ToastAction",a6=b.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?g.jsx(u6,{altText:n,asChild:!0,children:g.jsx(rP,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${o6}\`. Expected non-empty \`string\`.`),null)});a6.displayName=o6;var l6="ToastClose",rP=b.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,i=_se(l6,n);return g.jsx(u6,{asChild:!0,children:g.jsx(qt.button,{type:"button",...r,ref:t,onClick:yt(e.onClick,i.onClose)})})});rP.displayName=l6;var u6=b.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...i}=e;return g.jsx(qt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function c6(e){const t=[];
12return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),kse(r)){const i=r.ariaHidden||r.hidden||r.style.display==="none",s=r.dataset.radixToastAnnounceExclude==="";if(!i)if(s){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...c6(r))}}),t}function Yv(e,t,n,{discrete:r}){const i=n.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?JT(i,s):i.dispatchEvent(s)}var pM=(e,t,n=0)=>{const r=Math.abs(e.x),i=Math.abs(e.y),s=r>i;return t==="left"||t==="right"?s&&r>n:!s&&i>n};function Cse(e=()=>{}){const t=_i(e);Wl(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function kse(e){return e.nodeType===e.ELEMENT_NODE}function Tse(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function x1(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var Pse=Jz,d6=t6,f6=r6,h6=i6,p6=s6,m6=a6,g6=rP;function v6(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=v6(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $o(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=v6(e))&&(r&&(r+=" "),r+=t);return r}const mM=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gM=$o,Jf=(e,t)=>n=>{var r;if(t?.variants==null)return gM(e,n?.class,n?.className);const{variants:i,defaultVariants:s}=t,o=Object.keys(i).map(u=>{const f=n?.[u],d=s?.[u];if(f===null)return null;const p=mM(f)||mM(d);return i[u][p]}),a=n&&Object.entries(n).reduce((u,f)=>{let[d,p]=f;return p===void 0||(u[d]=p),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:p,...m}=f;return Object.entries(m).every(v=>{let[_,w]=v;return Array.isArray(w)?w.includes({...s,...a}[_]):{...s,...a}[_]===w})?[...u,d,p]:u},[]);return gM(e,o,l,n?.class,n?.className)},Rse=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ise=(e,t)=>({classGroupId:e,validator:t}),y6=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),I0="-",vM=[],Ose="arbitrary..",Dse=e=>{const t=Mse(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Ase(o);const a=o.split(I0),l=a[0]===""&&a.length>1?1:0;return b6(a,l,t)},getConflictingClassGroupIds:(o,a)=>{if(a){const l=r[o],u=n[o];return l?u?Rse(u,l):l:u||vM}return n[o]||vM}}},b6=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],s=n.nextPart.get(i);if(s){const u=b6(e,t+1,s);if(u)return u}const o=n.validators;if(o===null)return;const a=t===0?e.join(I0):e.slice(t).join(I0),l=o.length;for(let u=0;u<l;u++){const f=o[u];if(f.validator(a))return f.classGroupId}},Ase=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Ose+r:void 0})(),Mse=e=>{const{theme:t,classGroups:n}=e;return Nse(n,t)},Nse=(e,t)=>{const n=y6();for(const r in e){const i=e[r];iP(i,n,r,t)}return n},iP=(e,t,n,r)=>{const i=e.length;for(let s=0;s<i;s++){const o=e[s];jse(o,t,n,r)}},jse=(e,t,n,r)=>{if(typeof e=="string"){Lse(e,t,n);return}if(typeof e=="function"){Fse(e,t,n,r);return}$se(e,t,n,r)},Lse=(e,t,n)=>{const r=e===""?t:_6(t,e);r.classGroupId=n},Fse=(e,t,n,r)=>{if(zse(e)){iP(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ise(n,e))},$se=(e,t,n,r)=>{const i=Object.entries(e),s=i.length;for(let o=0;o<s;o++){const[a,l]=i[o];iP(l,_6(t,a),n,r)}},_6=(e,t)=>{let n=e;const r=t.split(I0),i=r.length;for(let s=0;s<i;s++){const o=r[s];let a=n.nextPart.get(o);a||(a=y6(),n.nextPart.set(o,a)),n=a}return n},zse=e=>
vendor: 7,110 bytes, line 12
12"isThemeGetter"in e&&e.isThemeGetter===!0,Vse=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(s,o)=>{n[s]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(s){let o=n[s];if(o!==void 0)return o;if((o=r[s])!==void 0)return i(s,o),o},set(s,o){s in n?n[s]=o:i(s,o)}}},rC="!",yM=":",Use=[],bM=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Bse=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const s=[];let o=0,a=0,l=0,u;const f=i.length;for(let _=0;_<f;_++){const w=i[_];if(o===0&&a===0){if(w===yM){s.push(i.slice(l,_)),l=_+1;continue}if(w==="/"){u=_;continue}}w==="["?o++:w==="]"?o--:w==="("?a++:w===")"&&a--}const d=s.length===0?i:i.slice(l);let p=d,m=!1;d.endsWith(rC)?(p=d.slice(0,-1),m=!0):d.startsWith(rC)&&(p=d.slice(1),m=!0);const v=u&&u>l?u-l:void 0;return bM(s,m,p,v)};if(t){const i=t+yM,s=r;r=o=>o.startsWith(i)?s(o.slice(i.length)):bM(Use,!1,o,void 0,!0)}if(n){const i=r;r=s=>n({className:s,parseClassName:i})}return r},Hse=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let s=0;s<n.length;s++){const o=n[s],a=o[0]==="[",l=t.has(o);a||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},qse=e=>({cache:Vse(e.cacheSize),parseClassName:Bse(e),sortModifiers:Hse(e),postfixLookupClassGroupIds:Wse(e),...Dse(e)}),Wse=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let r=0;r<n.length;r++)t[n[r]]=!0;return t},Gse=/\s+/,Kse=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:s,postfixLookupClassGroupIds:o}=t,a=[],l=e.trim().split(Gse);let u="";for(let f=l.length-1;f>=0;f-=1){const d=l[f],{isExternal:p,modifiers:m,hasImportantModifier:v,baseClassName:_,maybePostfixModifierPosition:w}=n(d);if(p){u=d+(u.length>0?" "+u:u);continue}let x=!!w,S;if(x){const I=_.substring(0,w);S=r(I);const D=S&&o[S]?r(_):void 0;D&&D!==S&&(S=D,x=!1)}else S=r(_);if(!S){if(!x){u=d+(u.length>0?" "+u:u);continue}if(S=r(_),!S){u=d+(u.length>0?" "+u:u);continue}x=!1}const C=m.length===0?"":m.length===1?m[0]:s(m).join(":"),R=v?C+rC:C,P=R+S;if(a.indexOf(P)>-1)continue;a.push(P);const k=i(S,x);for(let I=0;I<k.length;++I){const D=k[I];a.push(R+D)}u=d+(u.length>0?" "+u:u)}return u},Zse=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=w6(n))&&(i&&(i+=" "),i+=r);return i},w6=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=w6(e[r]))&&(n&&(n+=" "),n+=t);return n},Yse=(e,...t)=>{let n,r,i,s;const o=l=>{const u=t.reduce((f,d)=>d(f),e());return n=qse(u),r=n.cache.get,i=n.cache.set,s=a,a(l)},a=l=>{const u=r(l);if(u)return u;const f=Kse(l,n);return i(l,f),f};return s=o,(...l)=>s(Zse(...l))},Qse=[],yr=e=>{const t=n=>n[e]||Qse;return t.isThemeGetter=!0,t},x6=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,S6=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xse=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Jse=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,eoe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,toe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,noe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,roe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,yl=e=>Xse.test(e),Lt=e=>!!e&&!Number.isNaN(Number(e)),To=e=>!!e&&Number.isInteger(Number(e)),S1=e=>e.endsWith("%")&&Lt(e.slice(0,-1)),ha=e=>Jse.test(e),E6=()=>!0,ioe=e=>eoe.test(e)&&!toe.test(e),sP=()=>!1,soe=e=>noe.test(e),ooe=e=>roe.test(e),aoe=e=>!Ge(e)&&!Qe(e),loe=e=>e.startsWith("@container")&&(e[10]==="/"&&e[11]!==void 0||e[11]==="s"&&e[16]!==void 0&&e.startsWith("-size/",10)||e[11]==="n"&&e[18]!==void 0&&e.startsWith("-normal/",10)),uoe=e=>su(e,T6,sP),Ge=e=>x6.test(e),Iu=e=>su(e,P6,ioe),_M=e=>su(e,voe,Lt),coe=e=>su(e,I6,E6),doe=e=>su(e,R6,sP),wM=e=>su(e,C6,sP),foe=e=>su(e,k6,ooe),Qv=e=>su(e,O6,soe),Qe=e=>S6.test(e),Zh=e=>Ac(e,P6),hoe=e=>Ac(e,R6),xM=e=>Ac(e,C6),poe=e=>Ac(e,T6),moe=e=>Ac(e,k6),Xv=e=>Ac(e,O6,!0),goe=e=>Ac(e,I6,!0),su=(e,t,n)=>{const r=x6.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ac=(e,t,n=!1)=>{const r=S6.exec(e);return r?r[1]?t(r[1]):n:!1},C6=e=>e==="position"||e==="percentage",k6=e=>e==="image"||e==="url",T6=e=>e==="length"||e==="size"||e==="bg-size",P6=e=>e==="length",voe=e=>e==="number",R6=e=>e==="family-name",I6=e=>e==="number"||e==="weight",O6=e=>e==="shadow",yoe=()=>{const e=yr("color"),t=yr("font"),n=yr("text"),r=yr("font-weight"),i=yr("tracking"),s=yr("leading"),o=yr("breakpoint"),a=yr("container"),l=yr("spacing"),u=yr("radius"),f=yr("shadow"),d=yr("inset-shadow"),p=yr("text-shadow"),m=yr("drop-shadow"),v=yr("blur"),_=yr("perspective"),w=yr("aspect"),x=yr("ease"),S=yr("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...R(),Qe,Ge],k=()=>["auto","hidden","clip","visible","scroll"],I=()=>["auto","contain","none"],D=()=>[Qe,Ge,l],L=()=>[yl,"full","auto",...D()],A=()=>[To,"none","subgrid",Qe,Ge],$=()=>["auto",{span:["full",To,Qe,Ge]},To,Qe,Ge],j=()=>[To,"auto",Qe,Ge],V=()=>["auto","min","max","fr",Qe,Ge],B=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],te=()=>["auto",...D()],G=()=>[yl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],Z=()=>[yl,"screen","full","dvw","lvw","svw","min","max","fit",...D()],Y=()=>[yl,"screen","full","lh","dvh","lvh","svh","min","max","fit",...D()],M=()=>[e,Qe,Ge],q=()=>[...R(),xM,wM,{position:[Qe,Ge]}],z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],N=()=>["auto","cover","contain",poe,uoe,{size:[Qe,Ge]}],ee=()=>[S1,Zh,Iu],X=()=>["","none","full",u,Qe,Ge],ne=()=>["",Lt,Zh,Iu],ae=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ce=()=>[Lt,S1,xM,wM],fe=()=>["","none",v,Qe,Ge],ke=()=>["none",Lt,Qe,Ge],Ce=()=>["none",Lt,Qe,Ge],Se=()=>[Lt,Qe,Ge],Fe=()=>[yl,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ha],breakpoint:[ha],color:[E6],container:[ha],"drop-shadow":[ha],ease:["in","out","in-out"],font:[aoe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ha],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ha],shadow:[ha],spacing:["px",Lt],text:[ha],"text-shadow":[ha],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",yl,Ge,Qe,w]}],container:["container"],"container-type":[{"@container":["","normal","size",Qe,Ge]}
vendor: 4,995 bytes, line 12
12],"container-named":[loe],columns:[{columns:[Lt,Ge,Qe,a]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:P()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{"inset-s":L(),start:L()}],end:[{"inset-e":L(),end:L()}],"inset-bs":[{"inset-bs":L()}],"inset-be":[{"inset-be":L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[To,"auto",Qe,Ge]}],basis:[{basis:[yl,"full","auto",a,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,yl,"auto","initial","none",Ge]}],grow:[{grow:["",Lt,Qe,Ge]}],shrink:[{shrink:["",Lt,Qe,Ge]}],order:[{order:[To,"first","last","none",Qe,Ge]}],"grid-cols":[{"grid-cols":A()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":j()}],"col-end":[{"col-end":j()}],"grid-rows":[{"grid-rows":A()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":j()}],"row-end":[{"row-end":j()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...B(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...B()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":B()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pbs:[{pbs:D()}],pbe:[{pbe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:te()}],mx:[{mx:te()}],my:[{my:te()}],ms:[{ms:te()}],me:[{me:te()}],mbs:[{mbs:te()}],mbe:[{mbe:te()}],mt:[{mt:te()}],mr:[{mr:te()}],mb:[{mb:te()}],ml:[{ml:te()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...Z()]}],"min-inline-size":[{"min-inline":["auto",...Z()]}],"max-inline-size":[{"max-inline":["none",...Z()]}],"block-size":[{block:["auto",...Y()]}],"min-block-size":[{"min-block":["auto",...Y()]}],"max-block-size":[{"max-block":["none",...Y()]}],w:[{w:[a,"screen",...G()]}],"min-w":[{"min-w":[a,"screen","none",...G()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[o]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",n,Zh,Iu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,goe,coe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",S1,Ge]}],"font-family":[{font:[hoe,doe,t]}],"font-features":[{"font-features":[Ge]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Qe,Ge]}],"line-clamp":[{"line-clamp":[Lt,"none",Qe,_M]}],leading:[{leading:[s,...D()]}],"list-image":[{"list-image":["none",Qe,Ge]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Qe,Ge]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ae(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",Qe,Iu]}
vendor: 8,556 bytes, line 12
12],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[Lt,"auto",Qe,Ge]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"tab-size":[{tab:[To,Qe,Ge]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe,Ge]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Qe,Ge]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:z()}],"bg-size":[{bg:N()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},To,Qe,Ge],radial:["",Qe,Ge],conic:[To,Qe,Ge]},moe,foe]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ae(),"hidden","none"]}],"divide-style":[{divide:[...ae(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...ae(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,Qe,Ge]}],"outline-w":[{outline:["",Lt,Zh,Iu]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",f,Xv,Qv]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",d,Xv,Qv]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[Lt,Iu]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",p,Xv,Qv]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[Lt,Qe,Ge]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Qe,Ge]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":R()}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:z()}],"mask-size":[{mask:N()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Qe,Ge]}],filter:[{filter:["","none",Qe,Ge]}],blur:[{blur:fe()}],brightness:[{brightness:[Lt,Qe,Ge]}],contrast:[{contrast:[Lt,Qe,Ge]}],"drop-shadow":[{"drop-shadow":["","none",m,Xv,Qv]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",Lt,Qe,Ge]}],"hue-rotate":[{"hue-rotate":[Lt,Qe,Ge]}],invert:[{invert:["",Lt,Qe,Ge]}],saturate:[{saturate:[Lt,Qe,Ge]}],sepia:[{sepia:["",Lt,Qe,Ge]}],"backdrop-filter":[{"backdrop-filter":["","none",Qe,Ge]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,Qe,Ge]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,Qe,Ge]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,Qe,Ge]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,Qe,Ge]}],"backdrop-invert":[{"backdrop-invert":["",Lt,Qe,Ge]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,Qe,Ge]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,Qe,Ge]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,Qe,Ge]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Qe,Ge]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",Qe,Ge]}],ease:[{ease:["linear","initial",x,Qe,Ge]}],delay:[{delay:[Lt,Qe,Ge]}],animate:[{animate:["none",S,Qe,Ge]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Qe,Ge]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:ke()}],"rotate-x":[{"rotate-x":ke()}],"rotate-y":[{"rotate-y":ke()}],"rotate-z":[{"rotate-z":ke()}],scale:[{scale:Ce()}],"scale-x":[{"scale-x":Ce()}],"scale-y":[{"scale-y":Ce()}],"scale-z":[{"scale-z":Ce()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[Qe,Ge,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Fe()}],"translate-x":[{"translate-x":Fe()}],"translate-y":[{"translate-y":Fe()}],"translate-z":[{"translate-z":Fe()}],"translate-none":["translate-none"],zoom:[{zoom:[To,Qe,Ge]}],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}
12],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Qe,Ge]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":M()}],"scrollbar-track-color":[{"scrollbar-track":M()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mbs":[{"scroll-mbs":D()}],"scroll-mbe":[{"scroll-mbe":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pbs":[{"scroll-pbs":D()}],"scroll-pbe":[{"scroll-pbe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Qe,Ge]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[Lt,Zh,Iu,_M]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},boe=Yse(yoe);function _e(...e){return boe($o(e))}const ABe=typeof window<"u",_oe=Pse,D6=b.forwardRef(({className:e,...t},n)=>g.jsx(d6,{ref:n,className:_e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));D6.displayName=d6.displayName;const woe=Jf("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-sm transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),A6=b.forwardRef(({className:e,variant:t,...n},r)=>g.jsx(f6,{ref:r,className:_e(woe({variant:t}),e),...n}));A6.displayName=f6.displayName;const xoe=b.forwardRef(({className:e,...t},n)=>g.jsx(m6,{ref:n,className:_e("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));xoe.displayName=m6.displayName;const M6=b.forwardRef(({className:e,...t},n)=>g.jsx(g6,{ref:n,className:_e("absolute right-1 top-1 rounded-md p-1 text-foreground
12/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-destructive-foreground/70 group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive-foreground/40",e),"toast-close":"",...t,children:g.jsx(Jo,{className:"size-4"})}));M6.displayName=g6.displayName;const N6=b.forwardRef(({className:e,...t},n)=>g.jsx(h6,{ref:n,className:_e("text-sm font-semibold [&+div]:text-xs",e),...t}));N6.displayName=h6.displayName;const j6=b.forwardRef(({className:e,...t},n)=>g.jsx(p6,{ref:n,className:_e("text-sm opacity-90",e),...t}));j6.displayName=p6.displayName;function Soe(){const{toasts:e}=xz();return g.jsxs(_oe,{children:[e.map(function({id:t,title:n,description:r,action:i,...s}){return g.jsxs(A6,{...s,children:[g.jsxs("div",{className:"grid gap-1",children:[n&&g.jsx(N6,{children:n}),r&&g.jsx(j6,{children:r})]}),i,g.jsx(M6,{})]},t)}),g.jsx(D6,{})]})}function Eoe(){return null}var ro,ge=typeof window<"u"?window:void 0,Ni=typeof globalThis<"u"?globalThis:ge,L6=Array.prototype,SM=L6.forEach,EM=L6.indexOf,Xi=Ni?.navigator,Ke=Ni?.document,Es=Ni?.location,iC=Ni?.fetch,sC=Ni!=null&&Ni.XMLHttpRequest&&"withCredentials"in new Ni.XMLHttpRequest?Ni.XMLHttpRequest:void 0,CM=Ni?.AbortController,ur=Xi?.userAgent,Dt=ge??{},Pa={DEBUG:!1,LIB_VERSION:"1.234.1"},E1="$copy_autocapture",Coe=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];(function(e){e.GZipJS="gzip-js",e.Base64="base64"})(ro||(ro={}));var koe=["fatal","error","warning","log","info","debug"];function Ut(e,t){return e.indexOf(t)!==-1}var o_=function(e){return e.trim()},oP=function(e){return e.replace(/^\$/,"")},Toe=Array.isArray,F6=Object.prototype,$6=F6.hasOwnProperty,a_=F6.toString,Wn=Toe||function(e){return a_.call(e)==="[object Array]"},oo=e=>typeof e=="function",Gn=e=>e===Object(e)&&!Wn(e),Jd=e=>{if(Gn(e)){for(var t in e)if($6.call(e,t))return!1;return!0}return!1},Ve=e=>e===void 0,fr=e=>a_.call(e)=="[object String]",oC=e=>fr(e)&&e.trim().length===0,ou=e=>e===null,dn=e=>Ve(e)||ou(e),pi=e=>a_.call(e)=="[object Number]",Ol=e=>a_.call(e)==="[object Boolean]",Poe=e=>e instanceof FormData,Roe=e=>Ut(Coe,e),z6=e=>{var t={_log:function(n){if(ge&&(Pa.DEBUG||Dt.POSTHOG_DEBUG)&&!Ve(ge.console)&&ge.console){for(var r=("__rrweb_original__"in ge.console[n])?ge.console[n].__rrweb_original__:ge.console[n],i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];r(e,...s)}},info:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("log",...r)},warn:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("warn",...r)},error:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t._log("error",...r)},critical:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];console.error(e,...r)},uninitializedWarning:n=>{t.error("You must initialize PostHog before calling ".concat(n))},createLogger:n=>z6("".concat(e," ").concat(n))};return t},ct=z6("[PostHog.js]"),ei=ct.createLogger,Ioe=ei("[ExternalScriptsLoader]"),kM=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return Ioe.warn("".concat(t," was requested but loading of external scripts is disabled.")),n("Loading of external scripts is disabled");var r=Ke?.querySelectorAll("script");if(r){for(var i=0;i<r.length;i++)if(r[i].src===t)return n()}var s=()=>{if(!Ke)return n("document not found");var o=Ke.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",o.src=t,o.onload=u=>n(void 0,u),o.onerror=u=>n(u),e.config.prepare_external_dependency_script&&(o=e.config.prepare_external_dependency_script(o)),!o)return n("prepare_external_dependency_script returned null");var a,l=Ke.querySelectorAll("body > script");l.length>0?(a=l[0].parentNode)===null||a===void 0||a.insertBefore(o,l[0]):Ke.body.appendChild(o)};Ke!=null&&Ke.body?s():Ke?.addEventListener("DOMContentLoaded",s)};function TM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable}))),n.push.apply(n,r)}return n}function be(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};
12t%2?TM(Object(n),!0).forEach((function(r){Le(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TM(Object(n)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))}))}return e}function Le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V6(e,t){if(e==null)return{};var n,r,i=(function(o,a){if(o==null)return{};var l,u,f={},d=Object.keys(o);for(u=0;u<d.length;u++)l=d[u],a.indexOf(l)>=0||(f[l]=o[l]);return f})(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}Dt.__PosthogExtensions__=Dt.__PosthogExtensions__||{},Dt.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/".concat(t,".js")+"?v=".concat(e.version);if(t==="remote-config"&&(r="/array/".concat(e.config.token,"/config.js")),t==="toolbar"){var i=3e5,s=Math.floor(Date.now()/i)*i;r="".concat(r,"&t=").concat(s)}var o=e.requestRouter.endpointFor("assets",r);kM(e,o,n)},Dt.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);kM(e,r,n)};var O0={};function $l(e,t,n){if(Wn(e)){if(SM&&e.forEach===SM)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===O0)return}}}function mn(e,t,n){if(!dn(e)){if(Wn(e))return $l(e,t,n);if(Poe(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===O0)return}else for(var i in e)if($6.call(e,i)&&t.call(n,e[i],i)===O0)return}}var dr=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];
12return $l(n,(function(i){for(var s in i)i[s]!==void 0&&(e[s]=i[s])})),e},s0=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return $l(n,(function(i){$l(i,(function(s){e.push(s)}))})),e};function o0(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var PM=function(e){try{return e()}catch{return}},Ooe=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(i){ct.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ct.critical(i)}}},gm=function(e){var t={};return mn(e,(function(n,r){fr(n)&&n.length>0&&(t[r]=n)})),t};function Doe(e,t){return n=e,r=s=>fr(s)&&!ou(t)?s.slice(0,t):s,i=new Set,(function s(o,a){return o!==Object(o)?r?r(o,a):o:i.has(o)?void 0:(i.add(o),Wn(o)?(l=[],$l(o,(u=>{l.push(s(u))}))):(l={},mn(o,((u,f)=>{i.has(u)||(l[f]=s(u,f))}))),l);var l})(n);var n,r,i}var Aoe=["herokuapp.com","vercel.app","netlify.app"];function Moe(e){var t=e?.hostname;if(!fr(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of Aoe)if(n===r)return!1;return!0}function U6(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function tr(e,t,n,r){var{capture:i=!1,passive:s=!0}=r??{};e?.addEventListener(t,n,{capture:i,passive:s})}var B6="$people_distinct_id",xp="__alias",Sp="__timers",RM="$autocapture_disabled_server_side",aC="$heatmaps_enabled_server_side",IM="$exception_capture_enabled_server_side",OM="$web_vitals_enabled_server_side",H6="$dead_clicks_enabled_server_side",DM="$web_vitals_allowed_metrics",lC="$session_recording_enabled_server_side",AM="$console_log_recording_enabled_server_side",MM="$session_recording_network_payload_capture",NM="$session_recording_masking",jM="$session_recording_canvas_recording",LM="$replay_sample_rate",FM="$replay_minimum_duration",$M="$replay_script_config",D0="$sesid",Ep="$session_is_sampled",C1="$session_recording_url_trigger_activated_session",k1="$session_recording_event_trigger_activated_session",ef="$enabled_feature_flags",a0="$early_access_features",uC="$feature_flag_details",Cp="$stored_person_properties",Ku="$stored_group_properties",cC="$surveys",Jv="$surveys_activated",A0="$flag_call_reported",Ea="$user_state",dC="$client_session_props",fC="$capture_rate_limit",hC="$initial_campaign_params",pC="$initial_referrer_info",mC="$initial_person_info",M0="$epp",q6="__POSTHOG_TOOLBAR__",zM="$posthog_cookieless",Noe=[B6,xp,"__cmpns",Sp,lC,aC,D0,ef,Ea,a0,uC,Ku,Cp,cC,A0,dC,fC,hC,pC,M0];function VM(e){var t;return e instanceof Element&&(e.id===q6||!((t=e.closest)===null||t===void 0||!t.call(e,".toolbar-global-fade-container")))}function l_(e){return!!e&&e.nodeType===1}function zl(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function W6(e){return!!e&&e.nodeType===3}function G6(e){return!!e&&e.nodeType===11}function aP(e){return e?o_(e).split(/\s+/):[]}function UM(e){var t=ge?.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function N0(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return aP(t)}function K6(e){return dn(e)?null:o_(e).split(/(\s+)/).filter((t=>Rf(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function u_(e){var t="";return vC(e)&&!Q6(e)&&e.childNodes&&e.childNodes.length&&mn(e.childNodes,(function(n){var r;W6(n)&&n.textContent&&(t+=(r=K6(n.textContent))!==null&&r!==void 0?r:"")})),o_(t)}function Z6(e){return Ve(e.target)?e.srcElement||null:(t=e.target)!==null&&t!==void 0&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var gC=["a","button","form","input","select","textarea","label"];function Y6(e){var t=e.parentNode;return!(!t||!l_(t))&&t}function joe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!ge||!e||zl(e,"html")||!l_(e)||n!=null&&n.url_allowlist&&!UM(n.url_allowlist)||n!=null&&n.url_ignorelist&&UM(n.url_ignorelist))return!1;if(n!=null&&n.dom_event_allowlist){var s=n.dom_event_allowlist;if(s&&!s.some((m=>t.type===m)))return!1}for(var o=!1,a=[e],l=!0,u=e;u.parentNode&&!zl(u,"body");)if(G6(u.parentNode))a.push(u.parentNode.host),u=u.parentNode.host;else{if(!(l=Y6(u)))break;if(r||gC.indexOf(l.tagName.toLowerCase())>-1)o=!0;else{var f=ge.getComputedStyle(l);f&&f.getPropertyValue("cursor")==="pointer"&&(o=!0)}a.push(l),u=l}if(!(function(m,v){var _=v?.element_allowlist;if(Ve(_))return!0;var w=function(C){if(_.some((R=>C.tagName.toLowerCase()===R)))return{v:!0}};for(var x of m){var S=w(x);if(typeof S=="object")return S.v}return!1})(a,n)||!(function(m,v){var _=v?.css_selector_allowlist;if(Ve(_))return!0;var w=function(C){if(_.some((R=>C.matches(R))))return{v:!0}};for(var x of m){var S=w(x);if(typeof S=="object")return S.v}return!1}
12)(a,n))return!1;var d=ge.getComputedStyle(e);if(d&&d.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return o?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(gC.indexOf(p)>-1||e.getAttribute("contenteditable")==="true")}}function vC(e){for(var t=e;t.parentNode&&!zl(t,"body");t=t.parentNode){var n=N0(t);if(Ut(n,"ph-sensitive")||Ut(n,"ph-no-capture"))return!1}if(Ut(N0(e),"ph-include"))return!0;var r=e.type||"";if(fr(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(fr(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function Q6(e){return!!(zl(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||zl(e,"select")||zl(e,"textarea")||e.getAttribute("contenteditable")==="true")}var X6="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",Loe=new RegExp("^(?:".concat(X6,")$")),Foe=new RegExp(X6),J6="\\d{3}-?\\d{2}-?\\d{4}",$oe=new RegExp("^(".concat(J6,")$")),zoe=new RegExp("(".concat(J6,")"));function Rf(e){var t=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];return!(dn(e)||fr(e)&&(e=o_(e),(t?Loe:Foe).test((e||"").replace(/[- ]/g,""))||(t?$oe:zoe).test(e)))}function e9(e){var t=u_(e);return Rf(t="".concat(t," ").concat(t9(e)).trim())?t:""}function t9(e){var t="";return e&&e.childNodes&&e.childNodes.length&&mn(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)===null||r===void 0?void 0:r.toLowerCase())==="span")try{var i=u_(n);t="".concat(t," ").concat(i).trim(),n.childNodes&&n.childNodes.length&&(t="".concat(t," ").concat(t9(n)).trim())}catch(s){ct.error("[AutoCapture]",s)}})),t}function Voe(e){return(function(t){var n=t.map((r=>{var i,s,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var a of(r.attr_class.sort(),r.attr_class))o+=".".concat(a.replace(/"/g,""));var l=be(be(be(be({},r.text?{text:r.text}:{}),{},{"nth-child":(i=r.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(s=r.nth_of_type)!==null&&s!==void 0?s:0},r.href?{href:r.href}:{}),r.attr_id?{attr_id:r.attr_id}:{}),r.attributes),u={};return o0(l).sort(((f,d)=>{var[p]=f,[m]=d;return p.localeCompare(m)})).forEach((f=>{var[d,p]=f;return u[BM(d.toString())]=BM(p.toString())})),o+=":",o+=o0(l).map((f=>{var[d,p]=f;return"".concat(d,'="').concat(p,'"')})).join("")}));return n.join(";")})((function(t){return t.map((n=>{var r,i,s={text:(r=n.$el_text)===null||r===void 0?void 0:r.slice(0,400),tag_name:n.tag_name,href:(i=n.attr__href)===null||i===void 0?void 0:i.slice(0,2048),attr_class:Uoe(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return o0(n).filter((o=>{var[a]=o;return a.indexOf("attr__")===0})).forEach((o=>{var[a,l]=o;return s.attributes[a]=l})),s}))})(e))}function BM(e){return e.replace(/"|\\"/g,'\\"')}function Uoe(e){var t=e.attr__class;return t?Wn(t)?t:aP(t):void 0}class n9{constructor(){this.clicks=[]}isRageClick(t,n,r){var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(t-i.x)+Math.abs(n-i.y)<30&&r-i.timestamp<1e3){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===3)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var Boe=["localhost","127.0.0.1"],ff=e=>{var t=Ke?.createElement("a");return Ve(t)?null:(t.href=e,t)},Hoe=function(e){var t,n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"&",i=[];return mn(e,(function(s,o){Ve(s)||Ve(o)||o==="undefined"||(t=encodeURIComponent((a=>a instanceof File)(s)?s.name:s.toString()),n=encodeURIComponent(o),i[i.length]=n+"="+t)})),i.join(r)},j0=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<r.length;i++){var s=r[i].split("=");if(s[0]===t){n=s;break}}if(!Wn(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{ct.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},T1=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),i=r[0]||"",s=r[1],o=i.split("?"),a=o[1],l=o[0],u=(a||"").split("&"),f=[],d=0;d<u.length;d++){var p=u[d].split("=");
12Wn(p)&&(t.includes(p[0])?f.push(p[0]+"="+n):f.push(u[d]))}var m=l;return a!=null&&(m+="?"+f.join("&")),s!=null&&(m+="#"+s),m},L0=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},HM=ei("[AutoCapture]");function P1(e,t){return t.length>e?t.slice(0,e)+"...":t}function qoe(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!l_(t));return t}function Woe(e,t,n,r){var i=e.tagName.toLowerCase(),s={tag_name:i};gC.indexOf(i)>-1&&!n&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?s.$el_text=P1(1024,e9(e)):s.$el_text=P1(1024,u_(e)));var o=N0(e);o.length>0&&(s.classes=o.filter((function(f){return f!==""}))),mn(e.attributes,(function(f){var d;if((!Q6(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(r==null||!r.includes(f.name))&&!t&&Rf(f.value)&&(d=f.name,!fr(d)||d.substring(0,10)!=="_ngcontent"&&d.substring(0,7)!=="_nghost")){var p=f.value;f.name==="class"&&(p=aP(p).join(" ")),s["attr__"+f.name]=P1(1024,p)}}));for(var a=1,l=1,u=e;u=qoe(u);)a++,u.tagName===e.tagName&&l++;return s.nth_child=a,s.nth_of_type=l,s}function Goe(e,t){for(var n,r,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsC
12hainAsString:l}=t,u=[e],f=e;f.parentNode&&!zl(f,"body");)G6(f.parentNode)?(u.push(f.parentNode.host),f=f.parentNode.host):(u.push(f.parentNode),f=f.parentNode);var d,p=[],m={},v=!1,_=!1;if(mn(u,(R=>{var P=vC(R);R.tagName.toLowerCase()==="a"&&(v=R.getAttribute("href"),v=P&&v&&Rf(v)&&v),Ut(N0(R),"ph-no-capture")&&(_=!0),p.push(Woe(R,s,o,a));var k=(function(I){if(!vC(I))return{};var D={};return mn(I.attributes,(function(L){if(L.name&&L.name.indexOf("data-ph-capture-attribute")===0){var A=L.name.replace("data-ph-capture-attribute-",""),$=L.value;A&&$&&Rf($)&&(D[A]=$)}})),D})(R);dr(m,k)})),_)return{props:{},explicitNoCapture:_};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?p[0].$el_text=e9(e):p[0].$el_text=u_(e)),v){var w,x;p[0].attr__href=v;var S=(w=ff(v))===null||w===void 0?void 0:w.host,C=ge==null||(x=ge.location)===null||x===void 0?void 0:x.host;S&&C&&S!==C&&(d=v)}return{props:dr({$event_type:i.type,$ce_version:1},l?{}:{$elements:p},{$elements_chain:Voe(p)},(n=p[0])!==null&&n!==void 0&&n.$el_text?{$el_text:(r=p[0])===null||r===void 0?void 0:r.$el_text}:{},d&&i.type==="click"?{$external_click_url:d}:{},m)}}class Koe{constructor(t){Le(this,"_initialized",!1),Le(this,"_isDisabledServerSide",null),Le(this,"rageclicks",new n9),Le(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}get config(){var t,n,r=Gn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)===null||t===void 0?void 0:t.map((i=>new RegExp(i))),r.url_ignorelist=(n=r.url_ignorelist)===null||n===void 0?void 0:n.map((i=>new RegExp(i))),r}_addDomEventHandlers(){if(this.isBrowserSupported()){if(ge&&Ke){var t=r=>{r=r||ge?.event;try{this._captureEvent(r)}catch(i){HM.error("Failed to capture event",i)}};if(tr(Ke,"submit",t,{capture:!0}),tr(Ke,"change",t,{capture:!0}),tr(Ke,"click",t,{capture:!0}),this.config.capture_copied_text){var n=r=>{r=r||ge?.event,this._captureEvent(r,E1)};tr(Ke,"copy",n,{capture:!0}),tr(Ke,"cut",n,{capture:!0})}}}else HM.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}
12onRemoteConfig(t){t.elementsChainAsString&&(this._elementsChainAsString=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[RM]:!!t.autocapture_opt_out}),this._isDisabledServerSide=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this._elementSelectors=t}getElementSelectors(t){var n,r=[];return(n=this._elementSelectors)===null||n===void 0||n.forEach((i=>{var s=Ke?.querySelectorAll(i);s?.forEach((o=>{t===o&&r.push(i)}))})),r}get isEnabled(){var t,n,r=(t=this.instance.persistence)===null||t===void 0?void 0:t.props[RM],i=this._isDisabledServerSide;if(ou(i)&&!Ol(r)&&!this.instance.config.advanced_disable_decide)return!1;var s=(n=this._isDisabledServerSide)!==null&&n!==void 0?n:!!r;return!!this.instance.config.autocapture&&!s}_captureEvent(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"$autocapture";if(this.isEnabled){var r,i=Z6(t);W6(i)&&(i=i.parentNode||null),n==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!==null&&r!==void 0&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._captureEvent(t,"$rageclick");var s=n===E1;if(i&&joe(i,t,this.config,s,s?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=Goe(i,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.config.element_attribute_ignorelist,elementsChainAsString:this._elementsC
12hainAsString});if(a)return!1;var l=this.getElementSelectors(i);if(l&&l.length>0&&(o.$element_selectors=l),n===E1){var u,f=K6(ge==null||(u=ge.getSelection())===null||u===void 0?void 0:u.toString()),d=t.type||"clipboard";if(!f)return!1;o.$selected_content=f,o.$copy_type=d}return this.instance.capture(n,o),!0}}}isBrowserSupported(){return oo(Ke?.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return pi(e)&&isFinite(e)&&Math.floor(e)===e});var qM="0123456789abcdef";class F0{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new F0(s)}toString(){for(var t="",n=0;n<this.bytes.length;
12n++)t=t+qM.charAt(this.bytes[n]>>>4)+qM.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new F0(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class Zoe{constructor(){Le(this,"timestamp",0),Le(this,"counter",0),Le(this,"random",new Yoe)}generate(){var t=this.generateOrAbort();if(Ve(t)){this.timestamp=0;var n=this.generateOrAbort();if(Ve(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.timestamp)this.timestamp=t,this.resetCounter();else{if(!(t+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return F0.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32())}resetCounter(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}var WM,r9=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ge&&!Ve(ge.crypto)&&crypto.getRandomValues&&(r9=e=>crypto.getRandomValues(e));class Yoe{constructor(){Le(this,"buffer",new Uint32Array(8)),Le(this,"cursor",1/0)}nextUint32(){return this.cursor>=this.buffer.length&&(r9(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}var Nl=()=>Qoe().toString(),Qoe=()=>(WM||(WM=new Zoe)).generate(),Xoe="Thu, 01 Jan 1970 00:00:00 GMT",Yh="",Joe=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function eae(e,t){if(t){var n=(function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ke;if(Yh)return Yh;if(!s||["localhost","127.0.0.1"].includes(i))return"";for(var o=i.split("."),a=Math.min(o.length,8),l="dmn_chk_"+Nl(),u=new RegExp("(^|;)\\s*"+l+"=1");!Yh&&a--;){var f=o.slice(a).join("."),d=l+"=1;domain=."+f;s.cookie=d,u.test(s.cookie)&&(s.cookie=d+";expires="+Xoe,Yh=f)}return Yh})(e);if(!n){var r=(i=>{var s=i.match(Joe);return s?s[0]:""})(e);r!==n&&ct.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var kl,Na={is_supported:()=>!!Ke,error:function(e){ct.error("cookieStore error: "+e)},get:function(e){if(Ke){try{for(var t=e+"=",n=Ke.cookie.split(";").filter((s=>s.length)),r=0;r<n.length;r++){for(var i=n[r];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},parse:function(e){var t;try{t=JSON.parse(Na.get(e))||{}}catch{}return t},set:function(e,t,n,r,i){if(Ke)try{var s="",o="",a=eae(Ke.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*60*60*1e3),s="; expires="+l.toUTCString()}i&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ct.warn("cookieStore warning: large cookie, len="+u.length),Ke.cookie=u,u}catch{return}},remove:function(e,t){try{Na.set(e,"",-1,t)}catch{return}}},R1=null,xr={is_supported:function(){if(!ou(R1))return R1;var e=!0;if(Ve(ge))e=!1;else try{var t="__mplssupport__";xr.set(t,"xyz"),xr.get(t)!=='"xyz"'&&(e=!1),xr.remove(t)}catch{e=!1}return e||ct.error("localStorage unsupported; falling back to cookie store"),R1=e,e},error:function(e){ct.error("localStorage error: "+e)},get:function(e){try{return ge?.localStorage.getItem(e)}catch(t){xr.error(t)}return null},parse:function(e){try{return JSON.parse(xr.get(e))||{}}catch{}return null},set:function(e,t){try{ge?.localStorage.setItem(e,JSON.stringify(t))}catch(n){xr.error(n)}},remove:function(e){try{ge?.localStorage.removeItem(e)}catch(t){xr.error(t)}}},tae=["distinct_id",D0,Ep,M0,mC],ey=be(be({},xr),{},{parse:function(e){try{var t={};try{t=Na.parse(e)||{}}catch{}var n=dr(t,JSON.parse(xr.get(e)||"{}"));return xr.set(e,n),n}catch{}return null},set:function(e,t,n,r,i,s){try{xr.set(e,t,void 0,void 0,s);var o={};tae.forEach((a=>{t[a]&&(o[a]=t[a])})),Object.keys(o).length&&Na.set(e,o,n,r,i,s)}catch(a){xr.error(a)}},remove:function(e,t){try{ge?.localStorage.removeItem(e),Na.remove(e,t)}catch(n){xr.error(n)}}}),ty={},nae={is_supported:function(){return!0},error:function(e){ct.error("memoryStorage error: "+e)},get:function(e){return ty[e]||null},parse:function(e){return ty[e]||null},set:function(e,t){ty[e]=t},remove:function(e){delete ty[e]}},Ou=null,Fr={is_supported:function(){if(!ou(Ou))return Ou;if(Ou=!0,Ve(ge))Ou=!1;else try{var e="__support__";Fr.set(e,"xyz"),Fr.get(e)!=='"xyz"'&&(Ou=!1),Fr.remove(e)}catch{Ou=!1}return Ou},error:function(e){ct.error("sessionStorage error: ",e)},get:function(e){try{return ge?.sessionStorage.getItem(e)}catch(t){Fr.error(t)}return null},parse:function(e){try{return JSON.parse(Fr.get(e))||null}catch{}return null},set:function(e,t){try{ge?.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){Fr.error(n)}},remove:function(e){try{ge?.sessionStorage.removeItem(e)}catch(t){Fr.error(t)}}};
12(function(e){e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED"})(kl||(kl={}));class rae{constructor(t){this.instance=t}get config(){return this.instance.config}get consent(){return this.getDnt()?kl.DENIED:this.storedConsent}isOptedOut(){return this.consent===kl.DENIED||this.consent===kl.PENDING&&this.config.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(t){this.storage.set(this.storageKey,t?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}reset(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}get storageKey(){var{token:t,opt_out_capturing_cookie_prefix:n}=this.instance.config;return(n||"__ph_opt_in_out_")+t}get storedConsent(){var t=this.storage.get(this.storageKey);return t==="1"?kl.GRANTED:t==="0"?kl.DENIED:kl.PENDING}get storage(){if(!this._storage){var t=this.config.opt_out_capturing_persistence_type;this._storage=t==="localStorage"?xr:Na;var n=t==="localStorage"?Na:xr;n.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut(n.get(this.storageKey)==="1"),n.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}getDnt(){return!!this.config.respect_dnt&&!!U6([Xi?.doNotTrack,Xi?.msDoNotTrack,Dt.doNotTrack],(t=>Ut([!0,1,"1","yes"],t)))}}var ny=ei("[Dead Clicks]"),iae=()=>!0,sae=e=>{var t,n=!((t=e.instance.persistence)===null||t===void 0||!t.get_property(H6)),r=e.instance.config.capture_dead_clicks;return Ol(r)?r:n};class i9{get lazyLoadedDeadClicksAutocapture(){return this._lazyLoadedDeadClicksAutocapture}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabled()}onRemoteConfig(t){this.instance.persistence&&this.instance.persistence.register({[H6]:t?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.loadScript((()=>{this.start()}))}loadScript(t){var n,r,i;(n=Dt.__PosthogExtensions__)!==null&&n!==void 0&&n.initDeadClicksAutocapture&&t(),(r=Dt.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"dead-clicks-autocapture",(s=>{s?ny.error("failed to load script",s):t()}))}start(){var t;if(Ke){if(!this._lazyLoadedDeadClicksAutocapture&&(t=Dt.__PosthogExtensions__)!==null&&t!==void 0&&t.initDeadClicksAutocapture){var n=Gn(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this._lazyLoadedDeadClicksAutocapture=Dt.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this._lazyLoadedDeadClicksAutocapture.start(Ke),ny.info("starting...")}}else ny.error("`document` not found. Cannot start.")}stop(){this._lazyLoadedDeadClicksAutocapture&&(this._lazyLoadedDeadClicksAutocapture.stop(),this._lazyLoadedDeadClicksAutocapture=void 0,ny.info("stopping..."))}}var ry=ei("[ExceptionAutocapture]");class oae{constructor(t){var n;Le(this,"startCapturing",(()=>{var r,i,s,o,a,l;if(ge&&this.isEnabled){var u=(r=Dt.__PosthogExtensions__)===null||r===void 0||(i=r.errorWrappingFunctions)===null||i===void 0?void 0:i.wrapOnError,f=(s=Dt.__PosthogExtensions__)===null||s===void 0||(o=s.errorWrappingFunctions)===null||o===void 0?void 0:o.wrapUnhandledRejection,d=(a=Dt.__PosthogExtensions__)===null||a===void 0||(l=a.errorWrappingFunctions)===null||l===void 0?void 0:l.wrapConsoleError;if(u&&f&&d)try{this.unwrapOnError||(this.unwrapOnError=u(this.captureException.bind(this))),this.unwrapUnhandledRejection||(this.unwrapUnhandledRejection=f(this.captureException.bind(this))),this.unwrapConsoleError||(this.unwrapConsoleError=d(this.captureException.bind(this)))}catch(p){ry.error("failed to start",p),this.stopCapturing()}else ry.error("failed to load error wrapping functions - cannot start")}})),this.instance=t,this.remoteEnabled=!((n=this.instance.persistence)===null||n===void 0||!n.props[IM]),this.config=this.requiredConfig(),this.startIfEnabled()}requiredConfig(){var t=this.instance.config.capture_exceptions,n={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Gn(t)?n=be(be({},n),t):(Ve(t)?this.remoteEnabled:t)&&(n=be(be({},n),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),n}get isEnabled(){return this.config.capture_console_errors||this.config.capture_unhandled_errors||this.config.capture_unhandled_rejections}get hasHandlers(){return!Ve(this.unwrapOnError)&&!Ve(this.unwrapUnhandledRejection)&&!Ve(this.unwrapConsoleError)}startIfEnabled(){this.isEnabled&&!this.hasHandlers&&(ry.info("enabled, starting..."),this.loadScript(this.startCapturing))}loadScript(t){var n,r;this.hasHandlers&&t(),(n=Dt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,"exception-autocapture",(i=>{if(i)return ry.error("failed to load script",i);t()}))}stopCapturing(){var t,n,r;(t=this.unwrapOnError)===null||t===void 0||t.call(this),this.unwrapOnError=void 0,(n=this.unwrapUnhandledRejection)===null||n===void 0||n.call(this),this.unwrapUnhandledRejection=void 0,(r=this.unwrapConsoleError)===null||r===void 0||r.call(this),this.unwrapConsoleError=void 0}onRemoteConfig(t){var n=t.autocaptureExceptions;this.remoteEnabled=!!n||!1,this.config=this.requiredConfig(),this.instance.persistence&&this.instance.persistence.register({[IM]:this.remoteEnabled}),this.startIfEnabled()}captureException(t){var n=this.instance.requestRouter.endpointFor("ui");t.$exception_personURL="".concat(n,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.instance.exceptions.sendExceptionEvent(t)}}function s9(e){return!Ve(Event)&&o9(e,Event)}function o9(e,t){try{return e instanceof t}catch{return!1}}function l0(e,t){return Object.prototype.toString.call(e)==="[object ".concat(t,"]")}function I1(e){return l0(e,"DOMError")}var GM=/\(error: (.*)\)/,KM=50,tf="?";function O1(e,t,n,r){var i={platform:"web:javascript",filename:e,function:t==="<anonymous>"?tf:t,in_app:!0};return Ve(n)||(i.lineno=n),Ve(r)||(i.colno=r),i}var aae=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,lae=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,uae=/\((\S*)(?::(\d+))(?::(\d+))\)/,cae=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,dae=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,fae=(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.sort(((i,s)=>i[0]-s[0])).map((i=>i[1]));return function(i){for(var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=[],a=i.split(`
13`),l=s;l<a.length;l++){var u=a[l];if(!(u.length>1024)){var f=GM.test(u)?u.replace(GM,"$1"):u;if(!f.match(/\S*Error: /)){for(var d of r){var p=d(f);
13if(p){o.push(p);break}}if(o.length>=KM)break}}}return(function(m){if(!m.length)return[];var v=Array.from(m);return v.reverse(),v.slice(0,KM).map((_=>be(be({},_),{},{filename:_.filename||hae(v).filename,function:_.function||tf})))})(o)}})([30,e=>{var t=aae.exec(e);if(t){var[,n,r,i]=t;return O1(n,tf,+r,+i)}var s=lae.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){var o=uae.exec(s[2]);o&&(s[2]=o[1],s[3]=o[2],s[4]=o[3])}var[a,l]=YM(s[1]||tf,s[2]);return O1(l,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}}],[50,e=>{var t=cae.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var n=dae.exec(t[3]);n&&(t[1]=t[1]||"eval",t[3]=n[1],t[4]=n[2],t[5]="")}var r=t[3],i=t[1]||tf;return[i,r]=YM(i,r),O1(r,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]);function hae(e){return e[e.length-1]||{}}var iy,ZM,D1,YM=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:tf,n?"safari-extension:".concat(t):"safari-web-extension:".concat(t)]:[e,t]},pae=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function lP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=e.stacktrace||e.stack||"",r=(function(o){return o&&mae.test(o.message)?1:0})(e);try{var i=fae,s=(function(o,a){var l=(function(u){var f=globalThis._posthogChunkIds;if(!f)return{};var d=Object.keys(f);return D1&&d.length===ZM||(ZM=d.length,D1=d.reduce(((p,m)=>{iy||(iy={});var v=iy[m];if(v)p[v[0]]=v[1];else for(var _=u(m),w=_.length-1;w>=0;w--){var x=_[w],S=x?.filename,C=f[m];if(S&&C){p[S]=C,iy[m]=[S,C];break}}return p}),{})),D1})(a);return o.forEach((u=>{u.filename&&(u.chunk_id=l[u.filename])})),o})(i(n,r),i);return s.slice(0,s.length-t)}catch{}return[]}var mae=/Minified React error #\d+;/i;function A1(e,t){var n,r,i=lP(e),s=(n=t?.handled)===null||n===void 0||n,o=(r=t?.synthetic)!==null&&r!==void 0&&r;return{$exception_list:[{type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:e.name,value:t!=null&&t.overrideExceptionMessage?t.overrideExceptionMessage:(function(a){var l=a.message;return l.error&&typeof l.error.message=="string"?l.error.message:l})(e),stacktrace:{frames:i,type:"raw"},mechanism:{handled:s,synthetic:o}}],$exception_level:"error"}}function M1(e,t){var n,r,i,s=(n=t?.handled)===null||n===void 0||n,o=(r=t?.synthetic)===null||r===void 0||r,a={type:t!=null&&t.overrideExceptionType?t.overrideExceptionType:(i=t?.defaultExceptionType)!==null&&i!==void 0?i:"Error",value:t!=null&&t.overrideExceptionMessage?t.overrideExceptionMessage:e||t?.defaultExceptionMessage,mechanism:{handled:s,synthetic:o}};if(t!=null&&t.syntheticException){var l=lP(t.syntheticException,1);l.length&&(a.stacktrace={frames:l,type:"raw"})}return{$exception_list:[a],$exception_level:"error"}}function gae(e){return fr(e)&&!oC(e)&&koe.indexOf(e)>=0}function vae(e,t){var n,r,i=(n=t?.handled)===null||n===void 0||n,s=(r=t?.synthetic)===null||r===void 0||r,o=t!=null&&t.overrideExceptionType?t.overrideExceptionType:s9(e)?e.constructor.name:"Error",a=t!=null&&t.overrideExceptionMessage?t.overrideExceptionMessage:"Non-Error ".concat("exception"," captured with keys: ",(function(f){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:40,p=Object.keys(f);if(p.sort(),!p.length)return"[object has no keys]";for(var m=p.length;m>0;m--){var v=p.slice(0,m).join(", ");if(!(v.length>d))return m===p.length||v.length<=d?v:"".concat(v.slice(0,d),"...")}return""})(e)),l={type:o,value:a,mechanism:{handled:i,synthetic:s}};if(t!=null&&t.syntheticException){var u=lP(t?.syntheticException,1);u.length&&(l.stacktrace={frames:u,type:"raw"})}return{$exception_list:[l],$exception_level:gae(e.level)?e.level:"error"}}function yae(e,t){var{error:n,event:r}=e,i={$exception_list:[]},s=n||r;if(I1(s)||(function(m){return l0(m,"DOMException")})(s)){var o=s;if((function(m){return"stack"in m})(s))i=A1(s,t);else{var a=o.name||(I1(o)?"DOMError":"DOMException"),l=o.message?"".concat(a,": ").concat(o.message):a,u=I1(o)?"DOMError":"DOMException";i=M1(l,be(be({},t),{},{overrideExceptionType:u,defaultExceptionMessage:l}))}return"code"in o&&(i.$exception_DOMException_code="".concat(o.code)),i}if((function(m){return l0(m,"ErrorEvent")})(s)&&s.error)return A1(s.error,t);if((function(m){switch(Object.prototype.toString.call(m)){case"[object Error]":case"[object E
13xception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return o9(m,Error)}})(s))return A1(s,t);if((function(m){return l0(m,"Object")})(s)||s9(s))return vae(s,t);if(Ve(n)&&fr(r)){var f="Error",d=r,p=r.match(pae);return p&&(f=p[1],d=p[2]),M1(d,be(be({},t),{},{overrideExceptionType:f,defaultExceptionMessage:d}))}return M1(s,t)}function $0(e){var t,n;return((t=JSON.stringify(e,(n=[],function(r,i){if(Gn(i)){for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(i)?"[Circular]":(n.push(i),i)}return i})))===null||t===void 0?void 0:t.length)||0}function yC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:66060288e-1;if(e.size>=t&&e.data.length>1){var n=Math.floor(e.data.length/2),r=e.data.slice(0,n),i=e.data.slice(n);return[yC({size:$0(r),data:r,sessionId:e.sessionId,windowId:e.windowId}),yC({size:$0(i),data:i,sessionId:e.sessionId,windowId:e.windowId})].flatMap((s=>s))}return[e]}var Ca=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Ca||{}),to=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(to||{}),bC="[SessionRecording]",_C="redacted",sy={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:e=>e,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com"]},bae=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],_ae=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],wae=["/s/","/e/","/i/"];function QM(e,t,n,r){if(dn(e))return e;var i=t?.["content-length"]||(function(s){return new Blob([s]).size})(e);return fr(i)&&(i=parseInt(i)),i>n?bC+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function XM(e,t){if(dn(e))return e;var n=e;return Rf(n,!1)||(n=bC+" "+t+" body "+_C),mn(_ae,(r=>{var i,s;(i=n)!==null&&i!==void 0&&i.length&&((s=n)===null||s===void 0?void 0:s.indexOf(r))!==-1&&(n=bC+" "+t+" body "+_C+" as might contain: "+r)})),n}var xae=(e,t)=>{var n,r,i,s={payloadSizeLimitBytes:sy.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...sy.performanceEntryTypeToObserve],payloadHostDenyList:[...t.payloadHostDenyList||[],...sy.payloadHostDenyList]},o=e.session_recording.recordHeaders!==!1&&t.recordHeaders,a=e.session_recording.recordBody!==!1&&t.recordBody,l=e.capture_performance!==!1&&t.recordPerformance,u=(n=s,i=Math.min(1e6,(r=n.payloadSizeLimitBytes)!==null&&r!==void 0?r:1e6),p=>(p!=null&&p.requestBody&&(p.requestBody=QM(p.requestBody,p.requestHeaders,i,"Request")),p!=null&&p.responseBody&&(p.responseBody=QM(p.responseBody,p.responseHeaders,i,"Response")),p)),f=p=>{return u(((_,w)=>{var x,S=ff(_.name),C=w.indexOf("http")===0?(x=ff(w))===null||x===void 0?void 0:x.pathname:w;C==="/"&&(C="");var R=S?.pathname.replace(C||"","");if(!(S&&R&&wae.some((P=>R.indexOf(P)===0))))return _})((v=(m=p).requestHeaders,dn(v)||mn(Object.keys(v??{}),(_=>{bae.includes(_.toLowerCase())&&(v[_]=_C)})),m),e.api_host));var m,v}
13,d=oo(e.session_recording.maskNetworkRequestFn);return d&&oo(e.session_recording.maskCapturedNetworkRequestFn)&&ct.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),d&&(e.session_recording.maskCapturedNetworkRequestFn=p=>{var m=e.session_recording.maskNetworkRequestFn({url:p.name});return be(be({},p),{},{name:m?.url})}),s.maskRequestFn=oo(e.session_recording.maskCapturedNetworkRequestFn)?p=>{var m,v,_,w=f(p);return w&&(m=(v=(_=e.session_recording).maskCapturedNetworkRequestFn)===null||v===void 0?void 0:v.call(_,w))!==null&&m!==void 0?m:void 0}:p=>(function(m){if(!Ve(m))return m.requestBody=XM(m.requestBody,"Request"),m.responseBody=XM(m.responseBody,"Response"),m})(f(p)),be(be(be({},sy),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})};function Is(e,t,n,r,i){return t>n&&(ct.warn("min cannot be greater than max."),t=n),pi(e)?e>n?(r&&ct.warn(r+" cannot be  greater than max: "+n+". Using max value instead."),n):e<t?(r&&ct.warn(r+" cannot be less than min: "+t+". Using min value instead."),t):e:(r&&ct.warn(r+" must be a number. using max or fallback. max: "+n+", fallback: "+i),Is(i||n,t,n,r))}class Sae{constructor(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Le(this,"bucketSize",100),Le(this,"refillRate",10),Le(this,"mutationBuckets",{}),Le(this,"loggedTracker",{}),Le(this,"refillBuckets",(()=>{Object.keys(this.mutationBuckets).forEach((s=>{this.mutationBuckets[s]=this.mutationBuckets[s]+this.refillRate,this.mutationBuckets[s]>=this.bucketSize&&delete this.mutationBuckets[s]}))})),Le(this,"getNodeOrRelevantParent",(s=>{var o=this.rrweb.mirror.getNode(s);if(o?.nodeName!=="svg"&&o instanceof Element){var a=o.closest("svg");if(a)return[this.rrweb.mirror.getId(a),a]}return[s,o]})),Le(this,"numberOfChanges",(s=>{var o,a,l,u,f,d,p,m;return((o=(a=s.removes)===null||a===void 0?void 0:a.length)!==null&&o!==void 0?o:0)+((l=(u=s.attributes)===null||u===void 0?void 0:u.length)!==null&&l!==void 0?l:0)+((f=(d=s.texts)===null||d===void 0?void 0:d.length)!==null&&f!==void 0?f:0)+((p=(m=s.adds)===null||m===void 0?void 0:m.length)!==null&&p!==void 0?p:0)})),Le(this,"throttleMutations",(s=>{if(s.type!==3||s.data.source!==0)return s;var o=s.data,a=this.numberOfChanges(o);o.attributes&&(o.attributes=o.attributes.filter((u=>{var f,d,p,[m,v]=this.getNodeOrRelevantParent(u.id);return this.mutationBuckets[m]===0?!1:(this.mutationBuckets[m]=(f=this.mutationBuckets[m])!==null&&f!==void 0?f:this.bucketSize,this.mutationBuckets[m]=Math.max(this.mutationBuckets[m]-1,0),this.mutationBuckets[m]===0&&(this.loggedTracker[m]||(this.loggedTracker[m]=!0,(d=(p=this.options).onBlockedNode)===null||d===void 0||d.call(p,m,v))),u)})));var l=this.numberOfChanges(o);return l!==0||a===l?s:void 0})),this.rrweb=t,this.options=i,this.refillRate=Is((n=this.options.refillRate)!==null&&n!==void 0?n:this.refillRate,0,100,"mutation throttling refill rate"),this.bucketSize=Is((r=this.options.bucketSize)!==null&&r!==void 0?r:this.bucketSize,0,100,"mutation throttling bucket size"),setInterval((()=>{this.refillBuckets()}),1e3)}}var Os=Uint8Array,ji=Uint16Array,If=Uint32Array,uP=new Os([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),cP=new Os([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),JM=new Os([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a9=function(e,t){for(var n=new ji(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new If(n[30]);for(r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)i[s]=s-n[r]<<5|r;return[n,i]},l9=a9(uP,2),Eae=l9[0],wC=l9[1];Eae[28]=258,wC[258]=28;for(var eN=a9(cP,0)[1],u9=new ji(32768),Pn=0;Pn<32768;++Pn){var Du=(43690&Pn)>>>1|(21845&Pn)<<1;Du=(61680&(Du=(52428&Du)>>>2|(13107&Du)<<2))>>>4|(3855&Du)<<4,u9[Pn]=((65280&Du)>>>8|(255&Du)<<8)>>>1}var Wp=function(e,t,n){for(var r=e.length,i=0,s=new ji(t);i<r;++i)++s[e[i]-1];var o,a=new ji(t);for(i=0;i<t;++i)a[i]=a[i-1]+s[i-1]<<1;for(o=new ji(r),i=0;i<r;++i)o[i]=u9[a[e[i]-1]++]>>>15-e[i];return o},fc=new Os(288);for(Pn=0;Pn<144;++Pn)fc[Pn]=8;for(Pn=144;Pn<256;++Pn)fc[Pn]=9;for(Pn=256;Pn<280;++Pn)fc[Pn]=7;for(Pn=280;Pn<288;++Pn)fc[Pn]=8;var z0=new Os(32);for(Pn=0;Pn<32;++Pn)z0[Pn]=5;var Cae=Wp(fc,9),kae=Wp(z0,5),c9=function(e){return(e/8>>0)+(7&e&&1)},d9=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof ji?ji:e instanceof If?If:Os)(n-t);return r.set(e.subarray(t,n)),r},pa=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},Qh=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},N1=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,s=n.slice();if(!i)return[new Os(0),0];if(i==1){var o=new Os(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(P,k){return P.f-k.f})),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,f=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};f!=i-1;)a=n[n[u].f<n[d].f?u++:d++],l=n[u!=f&&n[u].f<n[d].f?u++:d++],n[f++]={s:-1,f:a.f+l.f,l:a,r:l};var p=s[0].s;for(r=1;r<i;++r)s[r].s>p&&(p=s[r].s);var m=new ji(p+1),v=xC(n[f-1],m,0);if(v>t){r=0;var _=0,w=v-t,x=1<<w;for(s.sort((function(P,k){return m[k.s]-m[P.s]||P.f-k.f}));r<i;++r){var S=s[r].s;if(!(m[S]>t))break;_+=x-(1<<v-m[S]),m[S]=t}for(_>>>=w;_>0;
13){var C=s[r].s;m[C]<t?_-=1<<t-m[C]++-1:++r}for(;r>=0&&_;--r){var R=s[r].s;m[R]==t&&(--m[R],++_)}v=t}return[new Os(m),v]},xC=function(e,t,n){return e.s==-1?Math.max(xC(e.l,t,n+1),xC(e.r,t,n+1)):t[e.s]=n},tN=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new ji(++t),r=0,i=e[0],s=1,o=function(l){n[r++]=l},a=1;a<=t;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[n.subarray(0,r),t]},Xh=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},SC=function(e,t,n){var r=n.length,i=c9(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;s<r;++s)e[i+s+4]=n[s];return 8*(i+4+r)},nN=function(e,t,n,r,i,s,o,a,l,u,f){pa(t,f++,n),++i[256];for(var d=N1(i,15),p=d[0],m=d[1],v=N1(s,15),_=v[0],w=v[1],x=tN(p),S=x[0],C=x[1],R=tN(_),P=R[0],k=R[1],I=new ji(19),D=0;D<S.length;++D)I[31&S[D]]++;for(D=0;D<P.length;++D)I[31&P[D]]++;for(var L=N1(I,7),A=L[0],$=L[1],j=19;j>4&&!A[JM[j-1]];--j);var V,B,H,te,G=u+5<<3,Z=Xh(i,fc)+Xh(s,z0)+o,Y=Xh(i,p)+Xh(s,_)+o+14+3*j+Xh(I,A)+(2*I[16]+3*I[17]+7*I[18]);if(G<=Z&&G<=Y)return SC(t,f,e.subarray(l,l+u));if(pa(t,f,1+(Y<Z)),f+=2,Y<Z){V=Wp(p,m),B=p,H=Wp(_,w),te=_;var M=Wp(A,$);for(pa(t,f,C-257),pa(t,f+5,k-1),pa(t,f+10,j-4),f+=14,D=0;D<j;++D)pa(t,f+3*D,A[JM[D]]);f+=3*j;for(var q=[S,P],z=0;z<2;++z){var N=q[z];for(D=0;D<N.length;++D){var ee=31&N[D];pa(t,f,M[ee]),f+=A[ee],ee>15&&(pa(t,f,N[D]>>>5&127),f+=N[D]>>>12)}}}else V=Cae,B=fc,H=kae,te=z0;for(D=0;D<a;++D)if(r[D]>255){ee=r[D]>>>18&31,Qh(t,f,V[ee+257]),f+=B[ee+257],ee>7&&(pa(t,f,r[D]>>>23&31),f+=uP[ee]);var X=31&r[D];Qh(t,f,H[X]),f+=te[X],X>3&&(Qh(t,f,r[D]>>>5&8191),f+=cP[X])}else Qh(t,f,V[r[D]]),f+=B[r[D]];return Qh(t,f,V[256]),f+B[256]},Tae=new If([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pae=(function(){for(var e=new If(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),Rae=function(){var e=4294967295;return{p:function(t){for(var n=e,r=0;r<t.length;++r)n=Pae[255&n^t[r]]^n>>>8;e=n},d:function(){return 4294967295^e}}},Iae=function(e,t,n,r,i){return(function(s,o,a,l,u,f){var d=s.length,p=new Os(l+d+5*(1+Math.floor(d/7e3))+u),m=p.subarray(l,p.length-u),v=0;if(!o||d<8)for(var _=0;_<=d;_+=65535){var w=_+65535;w<d?v=SC(m,v,s.subarray(_,w)):(m[_]=f,v=SC(m,v,s.subarray(_,d)))}else{for(var x=Tae[o-1],S=x>>>13,C=8191&x,R=(1<<a)-1,P=new ji(32768),k=new ji(R+1),I=Math.ceil(a/3),D=2*I,L=function(ht){return(s[ht]^s[ht+1]<<I^s[ht+2]<<D)&R},A=new If(25e3),$=new ji(288),j=new ji(32),V=0,B=0,H=(_=0,0),te=0,G=0;_<d;++_){var Z=L(_),Y=32767&_,M=k[Z];if(P[Y]=M,k[Z]=Y,te<=_){var q=d-_;if((V>7e3||H>24576)&&q>423){v=nN(s,m,0,A,$,j,B,H,G,_-G,v),H=V=B=0,G=_;for(var z=0;z<286;++z)$[z]=0;for(z=0;z<30;++z)j[z]=0}var N=2,ee=0,X=C,ne=Y-M&32767;if(q>2&&Z==L(_-ne))for(var ae=Math.min(S,q)-1,se=Math.min(32767,_),ce=Math.min(258,q);ne<=se&&--X&&Y!=M;){if(s[_+N]==s[_+N-ne]){for(var fe=0;fe<ce&&s[_+fe]==s[_+fe-ne];++fe);if(fe>N){if(N=fe,ee=ne,fe>ae)break;var ke=Math.min(ne,fe-2),Ce=0;for(z=0;z<ke;++z){var Se=_-ne+z+32768&32767,Fe=Se-P[Se]+32768&32767;Fe>Ce&&(Ce=Fe,M=Se)}}}ne+=(Y=M)-(M=P[Y])+32768&32767}if(ee){A[H++]=268435456|wC[N]<<18|eN[ee];var Be=31&wC[N],wt=31&eN[ee];B+=uP[Be]+cP[wt],++$[257+Be],++j[wt],te=_+N,++V}else A[H++]=s[_],++$[s[_]]}}v=nN(s,m,f,A,$,j,B,H,G,_-G,v)}return d9(p,0,l+c9(v)+u)})(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},EC=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},Oae=function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:t.level==9?2:0,e[9]=3,t.mtime!=0&&EC(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}},Dae=function(e){return 10+(e.filename&&e.filename.length+1||0)};function f9(e,t){t===void 0&&(t={});var n=Rae(),r=e.length;n.p(e);var i=Iae(e,t,Dae(t),8),s=i.length;return Oae(i,t),EC(i,s-8,n.d()),EC(i,s-4,r),i}function h9(e,t){var n=e.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(e);for(var r=new Os(e.length+(e.length>>>1)),i=0,s=function(u){r[i++]=u},o=0;o<n;++o){if(i+5>r.length){var a=new Os(i+8+(n-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);l<128||t?s(l):l<2048?(s(192|l>>>6),s(128|63&l)):l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63),s(128|l>>>6&63),s(128|63&l)):(s(224|l>>>12),s(128|l>>>6&63),s(128|63&l))}return d9(r,0,i)}function Aae(e,t){return(function(n){for(var r=0,i=0;i<n.length;i++)r=(r<<5)-r+n.charCodeAt(i),r|=0;return Math.abs(r)})(e)%100<Is(100*t,0,100)}var kp="[SessionRecording]",Gr=ei(kp);function oy(){var e,t;return Dt==null||(e=Dt.__PosthogExtensions__)===null||e===void 0||(t=e.rrweb)===null||t===void 0?void 0:t.record}var Mae=3e5,Nae=[to.MouseMove,to.MouseInteraction,to.Scroll,to.ViewportResize,to.Input,to.TouchMove,to.MediaInteraction,to.Drag],rN=e=>({rrwebMethod:e,enqueuedAt:Date.now(),attempt:1});function Au(e){return(function(t,n){for(var r="",i=0;i<t.length;){var s=t[i++];r+=String.fromCharCode(s)}return r})(f9(h9(JSON.stringify(e))))}function iN(e){return e.type===Ca.Custom&&e.data.tag==="sessionIdle"}function sN(e,t){return t.some((n=>n.matching==="regex"&&new RegExp(n.url).test(e)))}class jae{get sessionIdleThresholdMilliseconds(){return this.instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this._captureStarted}get sessionManager(){if(!this.instance.sessionManager)throw new Error(kp+" must be started with a valid sessionManager.");return this.instance.sessionManager}get fullSnapshotIntervalMillis(){var t,n;return this.triggerStatus==="trigger_pending"?6e4:(t=(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.full_snapshot_interval_millis)!==null&&t!==void 0?t:Mae}get isSampled(){var t=this.instance.get_property(Ep);return Ol(t)?t:null}get sessionDuration(){var t,n,r=(t=this.buffer)===null||t===void 0?void 0:t.data[((n=this.buffer)===null||n===void 0?void 0:n.data.length)-1],{sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0);return r?r.timestamp-i:null}get isRecordingEnabled(){var t=!!this.instance.get_property(lC),n=!this.instance.config.disable_session_recording;return ge&&t&&n}get isConsoleLogCaptureEnabled(){var t=!!this.instance.get_property(AM),n=this.instance.config.enable_recording_console_log;return n??t}get canvasRecording(){var t,n,r,i,s,o,a=this.instance.config.session_recording.captureCanvas,l=this.instance.get_property(jM),u=(t=(n=a?.recordCanvas)!==null&&n!==void 0?n:l?.enabled)!==null&&t!==void 0&&t,f=(r=(i=a?.canvasFps)!==null&&i!==void 0?i:l?.fps)!==null&&r!==void 0?r:4,d=(s=(o=a?.canvasQuality)!==null&&o!==void 0?o:l?.quality)!==null&&s!==void 0?s:.4;
13if(typeof d=="string"){var p=parseFloat(d);d=isNaN(p)?.4:p}return{enabled:u,fps:Is(f,0,12,"canvas recording fps",4),quality:Is(d,0,1,"canvas recording quality",.4)}}get networkPayloadCapture(){var t,n,r=this.instance.get_property(MM),i={recordHeaders:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.recordHeaders,recordBody:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.recordBody},s=i?.recordHeaders||r?.recordHeaders,o=i?.recordBody||r?.recordBody,a=Gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,l=!!(Ol(a)?a:r?.capturePerformance);return s||o||l?{recordHeaders:s,recordBody:o,recordPerformance:l}:void 0}get masking(){var t,n,r,i,s,o,a=this.instance.get_property(NM),l={maskAllInputs:(t=this.instance.config.session_recording)===null||t===void 0?void 0:t.maskAllInputs,maskTextSelector:(n=this.instance.config.session_recording)===null||n===void 0?void 0:n.maskTextSelector,blockSelector:(r=this.instance.config.session_recording)===null||r===void 0?void 0:r.blockSelector},u=(i=l?.maskAllInputs)!==null&&i!==void 0?i:a?.maskAllInputs,f=(s=l?.maskTextSelector)!==null&&s!==void 0?s:a?.maskTextSelector,d=(o=l?.blockSelector)!==null&&o!==void 0?o:a?.blockSelector;return Ve(u)&&Ve(f)&&Ve(d)?void 0:{maskAllInputs:u==null||u,maskTextSelector:f,blockSelector:d}}get sampleRate(){var t=this.instance.get_property(LM);return pi(t)?t:null}get minimumDuration(){var t=this.instance.get_property(FM);return pi(t)?t:null}get status(){return this.receivedDecide?this.isRecordingEnabled?this.isSampled===!1?"disabled":this._urlBlocked?"paused":dn(this._linkedFlag)||this._linkedFlagSeen?this.triggerStatus==="trigger_pending"?"buffering":Ol(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}get urlTriggerStatus(){var t;return this._urlTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(C1))===this.sessionId?"trigger_activated":"trigger_pending"}get eventTriggerStatus(){var t;return this._eventTriggers.length===0?"trigger_disabled":((t=this.instance)===null||t===void 0?void 0:t.get_property(k1))===this.sessionId?"trigger_activated":"trigger_pending"}get triggerStatus(){var t=this.eventTriggerStatus==="trigger_activated"||this.urlTriggerStatus==="trigger_activated",n=this.eventTriggerStatus==="trigger_pending"||this.urlTriggerStatus==="trigger_pending";return t?"trigger_activated":n?"trigger_pending":"trigger_disabled"}constructor(t){if(Le(this,"queuedRRWebEvents",[]),Le(this,"isIdle","unknown"),Le(this,"_linkedFlagSeen",!1),Le(this,"_lastActivityTimestamp",Date.now()),Le(this,"_linkedFlag",null),Le(this,"_removePageViewCaptureHook",void 0),Le(this,"_onSessionIdListener",void 0),Le(this,"_persistDecideOnSessionListener",void 0),Le(this,"_samplingSessionListener",void 0),Le(this,"_urlTriggers",[]),Le(this,"_urlBlocklist",[]),Le(this,"_urlBlocked",!1),Le(this,"_eventTriggers",[]),Le(this,"_removeEventTriggerCaptureHook",void 0),Le(this,"_forceAllowLocalhostNetworkCapture",!1),Le(this,"_onBeforeUnload",(()=>{this._flushBuffer()})),Le(this,"_onOffline",(()=>{this._tryAddCustomEvent("browser offline",{})})),Le(this,"_onOnline",(()=>{this._tryAddCustomEvent("browser online",{})})),Le(this,"_onVisibilityChange",(()=>{if(Ke!=null&&Ke.visibilityState){var i="window "+Ke.visibilityState;this._tryAddCustomEvent(i,{})}})),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw Gr.error("started without valid sessionManager"),new Error(kp+" started without valid sessionManager. This is a bug.");if(this.instance.config.__preview_experimental_cookieless_mode)throw new Error(kp+" cannot be used with __preview_experimental_cookieless_mode.");var{sessionId:n,windowId:r}=this.sessionManager.checkAndGetSessionAndWindowId();this.sessionId=n,this.windowId=r,this.buffer=this.clearBuffer(),this.sessionIdleThresholdMilliseconds>=this.sessionManager.sessionTimeoutMs&&Gr.warn("session_idle_threshold_ms (".concat(this.sessionIdleThresholdMilliseconds,") is greater than the session timeout (").concat(this.sessionManager.sessionTimeoutMs,"). Session will never be detected as i
13dle"))}startIfEnabledOrStop(t){this.isRecordingEnabled?(this._startCapture(t),tr(ge,"beforeunload",this._onBeforeUnload),tr(ge,"offline",this._onOffline),tr(ge,"online",this._onOnline),tr(ge,"visibilitychange",this._onVisibilityChange),this._setupSampling(),this._addEventTriggerListener(),dn(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance.on("eventCaptured",(n=>{try{if(n.event==="$pageview"){var r=n!=null&&n.properties.$current_url?this._maskUrl(n?.properties.$current_url):"";if(!r)return;this._tryAddCustomEvent("$pageview",{href:r})}}catch(i){Gr.error("Could not add $pageview to rrweb session",i)}}))),this._onSessionIdListener||(this._onSessionIdListener=this.sessionManager.onSessionId(((n,r,i)=>{var s,o,a,l;i&&(this._tryAddCustomEvent("$session_id_change",{sessionId:n,windowId:r,changeReason:i}),(s=this.instance)===null||s===void 0||(o=s.persistence)===null||o===void 0||o.unregister(k1),(a=this.instance)===null||a===void 0||(l=a.persistence)===null||l===void 0||l.unregister(C1))})))):this.stopRecording()}stopRecording(){var t,n,r,i;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,ge?.removeEventListener("beforeunload",this._onBeforeUnload),ge?.removeEventListener("offline",this._onOffline),ge?.removeEventListener("online",this._onOnline),ge?.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),(t=this._removePageViewCaptureHook)===null||t===void 0||t.call(this),this._removePageViewCaptureHook=void 0,(n=this._removeEventTriggerCaptureHook)===null||n===void 0||n.call(this),this._removeEventTriggerCaptureHook=void 0,(r=this._onSessionIdListener)===null||r===void 0||r.call(this),this._onSessionIdListener=void 0,(i=this._samplingSessionListener)===null||i===void 0||i.call(this),this._samplingSessionListener=void 0,Gr.info("stopped"))}makeSamplingDecision(t){var n,r=this.sessionId!==t,i=this.sampleRate;if(pi(i)){var s=this.isSampled,o=r||!Ol(s),a=o?Aae(t,i):s;o&&(a?this._reportStarted("sampled"):Gr.warn("Sample rate (".concat(i,") has determined that this sessionId (").concat(t,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i,isSampled:a})),(n=this.instance.persistence)===null||n===void 0||n.register({[Ep]:a})}else{var l;(l=this.instance.persistence)===null||l===void 0||l.register({[Ep]:null})}}onRemoteConfig(t){var n,r,i,s,o,a;if(this._tryAddCustomEvent("$remote_config_received",t),this._persistRemoteConfig(t),this._linkedFlag=((n=t.sessionRecording)===null||n===void 0?void 0:n.linkedFlag)||null,(r=t.sessionRecording)!==null&&r!==void 0&&r.endpoint&&(this._endpoint=(a=t.sessionRecording)===null||a===void 0?void 0:a.endpoint),this._setupSampling(),!dn(this._linkedFlag)&&!this._linkedFlagSeen){var l=fr(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,u=fr(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(((f,d)=>{var p=Gn(d)&&l in d,m=u?d[l]===u:p;m&&this._reportStarted("linked_flag_matched",{linkedFlag:l,linkedVariant:u}),this._linkedFlagSeen=m}))}(i=t.sessionRecording)!==null&&i!==void 0&&i.urlTriggers&&(this._urlTriggers=t.sessionRecording.urlTriggers),(s=t.sessionRecording)!==null&&s!==void 0&&s.urlBlocklist&&(this._urlBlocklist=t.sessionRecording.urlBlocklist),(o=t.sessionRecording)!==null&&o!==void 0&&o.eventTriggers&&(this._eventTriggers=t.sessionRecording.eventTriggers),this.receivedDecide=!0,this.startIfEnabledOrStop()}_setupSampling(){pi(this.sampleRate)&&dn(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId((t=>{this.makeSamplingDecision(t)})))}_persistRemoteConfig(t){if(this.instance.persistence){var n,r=this.instance.persistence,i=()=>{var s,o,a,l,u,f,d,p,m,v=(s=t.sessionRecording)===null||s===void 0?void 0:s.sampleRate,_=dn(v)?null:parseFloat(v),w=(o=t.sessionRecording)===null||o===void 0?void 0:o.minimumDurationMilliseconds;r.register({[lC]:!!t.sessionRecording,[AM]:(a=t.sessionRecording)===null||a===void 0?void 0:a.consoleLogRecordingEnabled,[MM]:be({capturePerformance:t.capturePerformance},(l=t.sessionRecording)===null||l===void 0?void 0:l.networkPayloadCapture),[NM]:(u=t.sessionRecording)===null||u===void 0?void 0:u.masking,[jM]:{enabled:(f=t.sessionRecording)===null||f===void 0?void 0:f.recordCanvas,fps:(d=t.sessionRecording)===null||d===void 0?void 0:d.canvasFps,quality:(p=t.sessionRecording)===null||p===void 0?void 0:p.canvasQuality},[LM]:_,[FM]:Ve(w)?null:w,[$M]:(m=t.sessionRecording)===null||m===void 0?void 0:m.scriptConfig})};i(),(n=this._persistDecideOnSessionListener)===null||n===void 0||n.call(this),this._persistDecideOnSessionListener=this.sessionManager.onSessionId(i)}}log(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"log";(n=this.instance.sessionRecording)===null||n===void 0||n.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:r,trace:[],payload:[JSON.stringify(t)]}},timestamp:Date.now()})}_startCapture(t){if(!Ve(Object.assign)&&!Ve(Array.from)&&!(this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut())){var n,r;this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),oy()?this._onScriptLoaded():(n=Dt.__PosthogExtensions__)===null||n===void 0||(r=n.loadExternalDependency)===null||r===void 0||r.call(n,this.instance,this.scriptName,(i=>{if(i)return Gr.error("could not load recorder",i);this._onScriptLoaded()})),Gr.info("starting"),this.status==="active"&&this._reportStarted(t||"recording_initialized")}}get scriptName(){var t,n,r;return((t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0||(r=n.get_property($M))===null||r===void 0?void 0:r.script)||"recorder"}isInteractiveEvent(t){var n;return t.type===3&&Nae.indexOf((n=t.data)===null||n===void 0?void 0:n.source)!==-1}_updateWindowAndSessionIds(t){var n=this.isInteractiveEvent(t);n||this.isIdle||t.timestamp-this._lastActivityTimestamp>this.sessionIdleThresholdMilliseconds&&(this.isIdle=!0,clearInterval(this._fullSnapshotTimer),this._tryAddCustomEvent("sessionIdle",{eventTimestamp:t.timestamp,lastActivityTimestamp:this._lastActivityTimestamp,threshold:this.sessionIdleThresholdMilliseconds,bufferLength:this.buffer.data.length,bufferSize:this.buffer.size}),this._flushBuffer());var r=!1;if(n&&(this._lastActivityTimestamp=t.timestamp,this.isIdle)){var i=this.isIdle==="unknown";this.isIdle=!1,i||(this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:t.type}),r=!0)}if(!this.isIdle){var{windowId:s,sessionId:o}=this.sessionManager.checkAndGetSessionAndWindowId(!n,t.timestamp),a=this.sessionId!==o,l=this.windowId!==s;this.windowId=s,this.sessionId=o,a||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):r&&this._scheduleFullSnapshot()}}_tryRRWebMethod(t){try{return t.rrwebMethod(),!0}catch(n){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:t.enqueuedAt||Date.now(),attempt:t.attempt++,rrwebMethod:t.rrwebMethod}):Gr.warn("could not emit queued rrweb event.",n,t),!1}}_tryAddCustomEvent(t,n){return this._tryRRWebMethod(rN((()=>oy().addCustomEvent(t,n))))}_tryTakeFullSnapshot(){return this._tryRRWebMethod(rN((()=>oy().takeFullSnapshot())))}_onScriptLoaded(){var t,n,r,i,s={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{}
13,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},o=this.instance.config.session_recording;for(var[a,l]of Object.entries(o||{}))a in s&&(a==="maskInputOptions"?s.maskInputOptions=be({password:!0},l):s[a]=l);this.canvasRecording&&this.canvasRecording.enabled&&(s.recordCanvas=!0,s.sampling={canvas:this.canvasRecording.fps},s.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.masking&&(s.maskAllInputs=(n=this.masking.maskAllInputs)===null||n===void 0||n,s.maskTextSelector=(r=this.masking.maskTextSelector)!==null&&r!==void 0?r:void 0,s.blockSelector=(i=this.masking.blockSelector)!==null&&i!==void 0?i:void 0);var u=oy();if(u){this.mutationRateLimiter=(t=this.mutationRateLimiter)!==null&&t!==void 0?t:new Sae(u,{refillRate:this.instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this.instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(d,p)=>{var m="Too many mutations on node '".concat(d,"'. Rate limiting. This could be due to SVG animations or something similar");Gr.info(m,{node:p}),this.log(kp+" "+m,"warn")}});var f=this._gatherRRWebPlugins();this.stopRrweb=u(be({emit:d=>{this.onRRwebEmit(d)},plugins:f},s)),this._lastActivityTimestamp=Date.now(),this.isIdle=Ol(this.isIdle)?this.isIdle:"unknown",this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:s,activePlugins:f.map((d=>d?.name))}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else Gr.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}_scheduleFullSnapshot(){if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),this.isIdle!==!0){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval((()=>{this._tryTakeFullSnapshot()}),t))}}_gatherRRWebPlugins(){var t,n,r,i,s=[],o=(t=Dt.__PosthogExtensions__)===null||t===void 0||(n=t.rrwebPlugins)===null||n===void 0?void 0:n.getRecordConsolePlugin;o&&this.isConsoleLogCaptureEnabled&&s.push(o());var a=(r=Dt.__PosthogExtensions__)===null||r===void 0||(i=r.rrwebPlugins)===null||i===void 0?void 0:i.getRecordNetworkPlugin;return this.networkPayloadCapture&&oo(a)&&(!Boe.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?s.push(a(xae(this.instance.config,this.networkPayloadCapture))):Gr.info("NetworkCapture not started because we are on localhost.")),s}onRRwebEmit(t){var n;if(this._processQueuedEvents(),t&&Gn(t)){if(t.type===Ca.Meta){var r=this._maskUrl(t.data.href);if(this._lastHref=r,!r)return;t.data.href=r}else this._pageViewFallBack();if(this._checkUrlTriggerConditions(),!this._urlBlocked||(function(d){return d.type===Ca.Custom&&d.data.tag==="recording paused"})(t)){t.type===Ca.FullSnapshot&&this._scheduleFullSnapshot(),t.type===Ca.FullSnapshot&&this.triggerStatus==="trigger_pending"&&this.clearBuffer();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(t):t;if(i){var s=(function(d){var p=d;if(p&&Gn(p)&&p.type===6&&Gn(p.data)&&p.data.plugin==="rrweb/console@1"){p.data.payload.payload.length>10&&(p.data.payload.payload=p.data.payload.payload.slice(0,10),p.data.payload.payload.push("...[truncated]"));for(var m=[],v=0;v<p.data.payload.payload.length;v++)p.data.payload.payload[v]&&p.data.payload.payload[v].length>2e3?m.push(p.data.payload.payload[v].slice(0,2e3)+"...[truncated]"):m.push(p.data.payload.payload[v]);return p.data.payload.payload=m,d}return d})(i);if(this._updateWindowAndSessionIds(s),this.isIdle!==!0||iN(s)){if(iN(s)){var o=s.data.payload;if(o){var a=o.lastActivityTimestamp,l=o.threshold;s.timestamp=a+l}}var u=(n=this.instance.config.session_recording.compress_events)===null||n===void 0||n?(function(d){if($0(d)<1024)return d;try{if(d.type===Ca.FullSnapshot)return be(be({},d),{},{data:Au(d.data),cv:"2024-10"});if(d.type===Ca.IncrementalSnapshot&&d.data.source===to.Mutation)return be(be({},d),{},{cv:"2024-10",data:be(be({},d.data),{},{texts:Au(d.data.texts),attributes:Au(d.data.attributes),removes:Au(d.data.removes),adds:Au(d.data.adds)})});if(d.type===Ca.IncrementalSnapshot&&d.data.source===to.StyleSheetRule)return be(be({},d),{},{cv:"2024-10",data:be(be({},d.data),{},{adds:d.data.adds?Au(d.data.adds):void 0,removes:d.data.removes?Au(d.data.removes):void 0})})}catch(p){Gr.error("could not compress event - will use uncompressed event",p)}return d})(s):s,f={$snapshot_bytes:$0(u),$snapshot_data:u,$session_id:this.sessionId,$window_id:this.windowId};this.status!=="disabled"?this._captureSnapshotBuffered(f):this.clearBuffer()}}}}}_pageViewFallBack(){if(!this.instance.config.capture_pageview&&ge){var t=this._maskUrl(ge.location.href);this._lastHref!==t&&(this._tryAddCustomEvent("$url_changed",{href:t}),this._lastHref=t)}}_processQueuedEvents(){if(this.queuedRRWebEvents.length){var t=[...this.queuedRRWebEvents];this.queuedRRWebEvents=[],t.forEach((n=>{Date.now()-n.enqueuedAt<=2e3&&this._tryRRWebMethod(n)}))}}_maskUrl(t){var n=this.instance.config.session_recording;
13if(n.maskNetworkRequestFn){var r,i={url:t};return(r=i=n.maskNetworkRequestFn(i))===null||r===void 0?void 0:r.url}return t}clearBuffer(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}_flushBuffer(){this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=pi(n)&&n>=0,i=pi(t)&&r&&n<t;return this.status==="buffering"||this.status==="paused"||this.status==="disabled"||i?(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3),this.buffer):(this.buffer.data.length>0&&yC(this.buffer).forEach((s=>{this._captureSnapshot({$snapshot_bytes:s.size,$snapshot_data:s.data,$session_id:s.sessionId,$window_id:s.windowId,$lib:"web",$lib_version:Pa.LIB_VERSION})})),this.clearBuffer())}_captureSnapshotBuffered(t){var n,r=2+(((n=this.buffer)===null||n===void 0?void 0:n.data.length)||0);!this.isIdle&&(this.buffer.size+t.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=t.$snapshot_bytes,this.buffer.data.push(t.$snapshot_data),this.flushBufferTimer||this.isIdle||(this.flushBufferTimer=setTimeout((()=>{this._flushBuffer()}),2e3))}_captureSnapshot(t){this.instance.capture("$snapshot",t,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}_checkUrlTriggerConditions(){if(ge!==void 0&&ge.location.href){var t=ge.location.href,n=this._urlBlocked,r=sN(t,this._urlBlocklist);r&&!n?this._pauseRecording():!r&&n&&this._resumeRecording(),sN(t,this._urlTriggers)&&this._activateTrigger("url")}}_activateTrigger(t){var n,r;this.triggerStatus==="trigger_pending"&&((n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0||r.register({[t==="url"?C1:k1]:this.sessionId}),this._flushBuffer(),this._reportStarted(t+"_trigger_matched"))}_pauseRecording(){this._urlBlocked||(this._urlBlocked=!0,clearInterval(this._fullSnapshotTimer),Gr.info("recording paused due to URL blocker"),this._tryAddCustomEvent("recording paused",{reason:"url blocker"}))}_resumeRecording(){this._urlBlocked&&(this._urlBlocked=!1,this._tryTakeFullSnapshot(),this._scheduleFullSnapshot(),this._tryAddCustomEvent("recording resumed",{reason:"left blocked url"}),Gr.info("recording resumed"))}_addEventTriggerListener(){this._eventTriggers.length!==0&&dn(this._removeEventTriggerCaptureHook)&&(this._removeEventTriggerCaptureHook=this.instance.on("eventCaptured",(t=>{try{this._eventTriggers.includes(t.event)&&this._activateTrigger("event")}catch(n){Gr.error("Could not activate event trigger",n)}})))}overrideLinkedFlag(){this._linkedFlagSeen=!0,this._tryTakeFullSnapshot(),this._reportStarted("linked_flag_overridden")}overrideSampling(){var t;(t=this.instance.persistence)===null||t===void 0||t.register({[Ep]:!0}),this._tryTakeFullSnapshot(),this._reportStarted("sampling_overridden")}overrideTrigger(t){this._activateTrigger(t)}_reportStarted(t,n){this.instance.register_for_session({$session_recording_start_reason:t}),Gr.info(t.replace("_"," "),n),Ut(["recording_initialized","session_id_changed"],t)||this._tryAddCustomEvent(t,n)}}var j1=ei("[SegmentIntegration]");function Lae(e,t){var n=e.config.segment;if(!n)return t();(function(r,i){var s=r.config.segment;if(!s)return i();var o=l=>{var u=()=>l.anonymousId()||Nl();r.config.get_device_id=u,l.id()&&(r.register({distinct_id:l.id(),$device_id:u()}),r.persistence.set_property(Ea,"identified")),i()},a=s.user();"then"in a&&oo(a.then)?a.then((l=>o(l))):o(a)})(e,(()=>{n.register((r=>{Promise&&Promise.resolve||j1.warn("This browser does not have Promise support, and can not use the segment integration");var i=(s,o)=>{var a;if(!o)return s;s.event.userId||s.event.anonymousId===r.get_distinct_id()||(j1.info("No userId set, resetting PostHog"),r.reset()),s.event.userId&&s.event.userId!==r.get_distinct_id()&&(j1.info("UserId set, identifying with PostHog"),r.identify(s.event.userId));var l=r._calculate_event_properties(o,(a=s.event.properties)!==null&&a!==void 0?a:{},new Date);return s.event.properties=Object.assign({},l,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:s=>i(s,s.event.event),page:s=>i(s,"$pageview"),identify:s=>i(s,"$identify"),screen:s=>i(s,"$screen")}})(e)).then((()=>{t()}))}))}var p9="posthog-js";function m9(e){var{organization:t,projectId:n,prefix:r,severityAllowList:i=["error"]}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return s=>{var o,a,l,u,f;if(!(i==="*"||i.includes(s.level))||!e.__loaded)return s;s.tags||(s.tags={});var d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));s.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(s.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=((o=s.exception)===null||o===void 0?void 0:o.values)||[],m=p.map((_=>be(be({},_),{},{stacktrace:_.stacktrace?be(be({},_.stacktrace),{},{type:"raw",frames:(_.stacktrace.frames||[]).map((w=>be(be({},w),{},{platform:"web:javascript"})))}):void 0}))),v={$exception_message:((a=p[0])===null||a===void 0?void 0:a.value)||s.message,$exception_type:(l=p[0])===null||l===void 0?void 0:l.type,$exception_personURL:d,$exception_level:s.level,$exception_list:m,$sentry_event_id:s.event_id,$sentry_exception:s.exception,$sentry_exception_message:((u=p[0])===null||u===void 0?void 0:u.value)||s.message,$sentry_exception_type:(f=p[0])===null||f===void 0?void 0:f.type,$sentry_tags:s.tags};return t&&n&&(v.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+n+"&query="+s.event_id),e.exceptions.sendExceptionEvent(v),s}}class Fae{constructor(t,n,r,i,s){this.name=p9,this.setupOnce=function(o){o(m9(t,{organization:n,projectId:r,prefix:i,severityAllowList:s}))}}}var ka,$ae=ge!=null&&ge.location?L0(ge.location.hash,"__posthog")||L0(location.hash,"state"):null,oN="_postHogToolbarParam
13s",aN=ei("[Toolbar]");(function(e){e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED"})(ka||(ka={}));class zae{constructor(t){this.instance=t}setToolbarState(t){Dt.ph_toolbar_state=t}getToolbarState(){var t;return(t=Dt.ph_toolbar_state)!==null&&t!==void 0?t:ka.UNINITIALIZED}maybeLoadToolbar(){var t,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;if(!ge||!Ke)return!1;r=(t=r)!==null&&t!==void 0?t:ge.location,s=(n=s)!==null&&n!==void 0?n:ge.history;try{if(!i){try{ge.localStorage.setItem("test","test"),ge.localStorage.removeItem("test")}catch{return!1}i=ge?.localStorage}var o,a=$ae||L0(r.hash,"__posthog")||L0(r.hash,"state"),l=a?PM((()=>JSON.parse(atob(decodeURIComponent(a)))))||PM((()=>JSON.parse(decodeURIComponent(a)))):null;return l&&l.action==="ph_authorize"?((o=l).source="url",o&&Object.keys(o).length>0&&(l.desiredHash?r.hash=l.desiredHash:s?s.replaceState(s.state,"",r.pathname+r.search):r.hash="")):((o=JSON.parse(i.getItem(oN)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch{return!1}}_callLoadToolbar(t){var n=Dt.ph_load_toolbar||Dt.ph_load_editor;!dn(n)&&oo(n)?n(t,this.instance):aN.warn("No toolbar load function found")}loadToolbar(t){var n=!(Ke==null||!Ke.getElementById(q6));if(!ge||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=be(be({token:this.instance.config.token},t),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(ge.localStorage.setItem(oN,JSON.stringify(be(be({},i),{},{source:void 0}))),this.getToolbarState()===ka.LOADED)this._callLoadToolbar(i);else if(this.getToolbarState()===ka.UNINITIALIZED){var s,o;this.setToolbarState(ka.LOADING),(s=Dt.__PosthogExtensions__)===null||s===void 0||(o=s.loadExternalDependency)===null||o===void 0||o.call(s,this.instance,"toolbar",(a=>{if(a)return aN.error("[Toolbar] Failed to load",a),void this.setToolbarState(ka.UNINITIALIZED);this.setToolbarState(ka.LOADED),this._callLoadToolbar(i)})),tr(ge,"turbolinks:load",(()=>{this.setToolbarState(ka.UNINITIALIZED),this.loadToolbar(i)}))}return!0}_loadEditor(t){return this.loadToolbar(t)}maybeLoadEditor(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:void 0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;return this.maybeLoadToolbar(t,n,r)}}var Vae=ei("[TracingHeaders]");class Uae{constructor(t){Le(this,"_restoreXHRPatch",void 0),Le(this,"_restoreFetchPatch",void 0),Le(this,"_startCapturing",(()=>{var n,r,i,s;Ve(this._restoreXHRPatch)&&((n=Dt.__PosthogExtensions__)===null||n===void 0||(r=n.tracingHeadersPatchFns)===null||r===void 0||r._patchXHR(this.instance.sessionManager)),Ve(this._restoreFetchPatch)&&((i=Dt.__PosthogExtensions__)===null||i===void 0||(s=i.tracingHeadersPatchFns)===null||s===void 0||s._patchFetch(this.instance.sessionManager))})),this.instance=t}_loadScript(t){var n,r,i;(n=Dt.__PosthogExtensions__)!==null&&n!==void 0&&n.tracingHeadersPatchFns&&t(),(r=Dt.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"tracing-headers",(s=>{if(s)return Vae.error("failed to load script",s);t()}))}startIfEnabledOrStop(){var t,n;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):((t=this._restoreXHRPatch)===null||t===void 0||t.call(this),(n=this._restoreFetchPatch)===null||n===void 0||n.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}var Mu=ei("[Web Vitals]"),lN=9e5;class Bae{constructor(t){var n;Le(this,"_enabledServerSide",!1),Le(this,"_initialized",!1),Le(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),Le(this,"_flushToCapture",(()=>{clearTimeout(this._delayedFlushTimer),this.buffer.metrics.length!==0&&(this.instance.capture("$web_vitals",this.buffer.metrics.reduce(((r,i)=>be(be({},r),{},{["$web_vitals_".concat(i.name,"_event")]:be({},i),["$web_vitals_".concat(i.name,"_value")]:i.value})),{})),this.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})})),Le(this,"_addToBuffer",(r=>{var i,s=(i=this.instance.sessionManager)===null||i===void 0?void 0:i.checkAndGetSessionAndWindowId(!0);if(Ve(s))Mu.error("Could not read session ID. Dropping metrics!");else{this.buffer=this.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var o=this._currentURL();Ve(o)||(dn(r?.name)||dn(r?.value)?Mu.error("Invalid metric received",r):this._maxAllowedValue&&r.value>=this._maxAllowedValue?Mu.error("Ignoring metric with value >= "+this._maxAllowedValue,r):(this.buffer.url!==o&&(this._flushToCapture(),this._delayedFlushTimer=setTimeout(this._flushToCapture,this.flushToCaptureTimeoutMs)),Ve(this.buffer.url)&&(this.buffer.url=o),this.buffer.firstMetricTimestamp=Ve(this.buffer.firstMetricTimestamp)?Date.now():this.buffer.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.buffer.metrics.push(be(be({},r),{},{$current_url:o,$session_id:s.sessionId,$window_id:s.windowId,timestamp:Date.now()})),this.buffer.metrics.length===this.allowedMetrics.length&&this._flushToCapture()))}})),Le(this,"_startCapturing",(()=>{var r,i,s,o,a=Dt.__PosthogExtensions__;Ve(a)||Ve(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:i,onFCP:s,onINP:o}=a.postHogWebVitalsCallbacks),r&&i&&s&&o?(this.allowedMetrics.indexOf("LCP")>-1&&r(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this._addToBuffer.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&o(this._addToBuffer.bind(this)),this._initialized=!0):Mu.error("web vitals callbacks not loaded - not starting")})),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[OM]),this.startIfEnabled()}get allowedMetrics(){var t,n,r=Gn(this.instance.config.capture_performance)?(t=this.instance.config.capture_performance)===null||t===void 0?void 0:t.web_vitals_allowed_metrics:void 0;return Ve(r)?((n=this.instance.persistence)===null||n===void 0?void 0:n.props[DM])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(Gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get _maxAllowedValue(){var t=Gn(this.instance.config.capture_performance)&&pi(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:lN;return 0<t&&t<=6e4?lN:t}get isEnabled(){var t=Gn(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return Ol(t)?t:this._enabledServerSide}startIfEnabled(){this.isEnabled&&!this._initialized&&(Mu.info("enabled, starting..."),this.loadScript(this._startCapturing))}onRemoteConfig(t){var n=Gn(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=Gn(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register({[OM]:n}),this.instance.persistence.register({[DM]:r})),this._enabledServerSide=n,this.startIfEnabled()}loadScript(t){var n,r,i;(n=Dt.__PosthogExtensions__)!==null&&n!==void 0&&n.postHogWebVitalsCallbacks&&t(),(r=Dt.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"web-vitals",(s=>{s?Mu.error("failed to load script",s):t()}))}_currentURL(){var t=ge?ge.location.href:void 0;return t||Mu.error("Could not determine current URL"),t}}var Hae=ei("[Heatmaps]");function uN(e){return Gn(e)&&"clientX"in e&&"clientY"in e&&pi(e.clientX)&&pi(e.clientY)}class qae{constructor(t){var n;Le(this,"rageclicks",new n9),Le(this,"_enabledServerSide",!1),Le(this,"_initialized",!1),Le(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!((n=this.instance.persistence)===null||n===void 0||!n.props[aC]
13)}get flushIntervalMilliseconds(){var t=5e3;return Gn(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return Ve(this.instance.config.capture_heatmaps)?Ve(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this._initialized)return;Hae.info("starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds)}else{var t,n;clearInterval((t=this._flushInterval)!==null&&t!==void 0?t:void 0),(n=this.deadClicksCapture)===null||n===void 0||n.stop(),this.getAndClearBuffer()}}onRemoteConfig(t){var n=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[aC]:n}),this._enabledServerSide=n,this.startIfEnabled()}getAndClearBuffer(){var t=this.buffer;return this.buffer=void 0,t}_onDeadClick(t){this._onClick(t.originalEvent,"deadclick")}_setupListeners(){ge&&Ke&&(tr(ge,"beforeunload",this.flush.bind(this)),tr(Ke,"click",(t=>this._onClick(t||ge?.event)),{capture:!0}),tr(Ke,"mousemove",(t=>this._onMouseMove(t||ge?.event)),{capture:!0}),this.deadClicksCapture=new i9(this.instance,iae,this._onDeadClick.bind(this)),this.deadClicksCapture.startIfEnabled(),this._initialized=!0)}_getProperties(t,n){var r=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),o=(function(a,l,u){for(var f=a;f&&l_(f)&&!zl(f,"body");){if(f===u)return!1;if(Ut(l,ge?.getComputedStyle(f).position))return!0;f=Y6(f)}return!1})(Z6(t),["fixed","sticky"],s);return{x:t.clientX+(o?0:i),y:t.clientY+(o?0:r),target_fixed:o,type:n}}_onClick(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"click";if(!VM(t.target)&&uN(t)){var i=this._getProperties(t,r);(n=this.rageclicks)!==null&&n!==void 0&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this._capture(be(be({},i),{},{type:"rageclick"})),this._capture(i)}}_onMouseMove(t){!VM(t.target)&&uN(t)&&(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout((()=>{this._capture(this._getProperties(t,"mousemove"))}),500))}_capture(t){if(ge){var n=ge.location.href;this.buffer=this.buffer||{},this.buffer[n]||(this.buffer[n]=[]),this.buffer[n].push(t)}}flush(){this.buffer&&!Jd(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Wae{constructor(t){this._instance=t}doPageView(t,n){var r,i=this._previousPageViewProperties(t,n);return this._currentPageview={pathname:(r=ge?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),i}doPageLeave(t){var n;return this._previousPageViewProperties(t,(n=this._currentPageview)===null||n===void 0?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this._currentPageview)===null||t===void 0?void 0:t.pageViewId}}_previousPageViewProperties(t,n){var r=this._currentPageview;if(!r)return{$pageview_id:n};var i={$pageview_id:n,$prev_pageview_id:r.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:a,maxScrollY:l,maxContentHeight:u,lastContentY:f,maxContentY:d}=s;if(!(Ve(o)||Ve(a)||Ve(l)||Ve(u)||Ve(f)||Ve(d))){o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),f=Math.ceil(f),d=Math.ceil(d);var p=o<=1?1:Is(a/o,0,1),m=o<=1?1:Is(l/o,0,1),v=u<=1?1:Is(f/u,0,1),_=u<=1?1:Is(d/u,0,1);i=dr(i,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:f,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:d,$prev_pageview_max_content_percentage:_})}}return r.pathname&&(i.$prev_pageview_pathname=r.pathname),r.timestamp&&(i.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),i}}class Gae{constructor(t){this.instance=t}sendExceptionEvent(t){this.instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent"})}}var Ds="Mobile",V0="iOS",No="Android",vm="Tablet",g9=No+" "+vm,v9="iPad",y9="Apple",b9=y9+" Watch",ym="Safari",Of="BlackBerry",_9="Samsung",w9=_9+"Browser",x9=_9+" Internet",hc="Chrome",Kae=hc+" OS",S9=hc+" "+V0,dP="Internet Explorer",E9=dP+" "+Ds,fP="Opera",Zae=fP+" Mini",hP="Edge",C9="Microsoft "+hP,hf="Firefox",k9=hf+" "+V0,bm="Nintendo",_m="PlayStation",pf="Xbox",T9=No+" "+Ds,P9=Ds+" "+ym,Tp="Windows",CC=Tp+" Phone",cN="Nokia",kC="Ouya",R9="Generic",Yae=R9+" "+Ds.toLowerCase(),I9=R9+" "+vm.toLowerCase(),TC="Konqueror",ci="(\\d+(\\.\\d+)?)",L1=new RegExp("Version/"+ci),Qae=new RegExp(pf,"i"),Xae=new RegExp(_m+" \\w+","i"),Jae=new RegExp(bm+" \\w+","i"),pP=new RegExp(Of+"|PlayBook|BB10","i"),ele={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},PC,tle=(e,t)=>
13t&&Ut(t,y9)||(function(n){return Ut(n,ym)&&!Ut(n,hc)&&!Ut(n,No)})(e),dN=function(e,t){return t=t||"",Ut(e," OPR/")&&Ut(e,"Mini")?Zae:Ut(e," OPR/")?fP:pP.test(e)?Of:Ut(e,"IE"+Ds)||Ut(e,"WPDesktop")?E9:Ut(e,w9)?x9:Ut(e,hP)||Ut(e,"Edg/")?C9:Ut(e,"FBIOS")?"Facebook "+Ds:Ut(e,"UCWEB")||Ut(e,"UCBrowser")?"UC Browser":Ut(e,"CriOS")?S9:Ut(e,"CrMo")||Ut(e,hc)?hc:Ut(e,No)&&Ut(e,ym)?T9:Ut(e,"FxiOS")?k9:Ut(e.toLowerCase(),TC.toLowerCase())?TC:tle(e,t)?Ut(e,Ds)?P9:ym:Ut(e,hf)?hf:Ut(e,"MSIE")||Ut(e,"Trident/")?dP:Ut(e,"Gecko")?hf:""},nle={[E9]:[new RegExp("rv:"+ci)],[C9]:[new RegExp(hP+"?\\/"+ci)],[hc]:[new RegExp("("+hc+"|CrMo)\\/"+ci)],[S9]:[new RegExp("CriOS\\/"+ci)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ci)],[ym]:[L1],[P9]:[L1],[fP]:[new RegExp("(Opera|OPR)\\/"+ci)],[hf]:[new RegExp(hf+"\\/"+ci)],[k9]:[new RegExp("FxiOS\\/"+ci)],[TC]:[new RegExp("Konqueror[:/]?"+ci,"i")],[Of]:[new RegExp(Of+" "+ci),L1],[T9]:[new RegExp("android\\s"+ci,"i")],[x9]:[new RegExp(w9+"\\/"+ci)],[dP]:[new RegExp("(rv:|MSIE )"+ci)],Mozilla:[new RegExp("rv:"+ci)]},fN=[[new RegExp(pf+"; "+pf+" (.*?)[);]","i"),e=>[pf,e&&e[1]||""]],[new RegExp(bm,"i"),[bm,""]],[new RegExp(_m,"i"),[_m,""]],[pP,[Of,""]],[new RegExp(Tp,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[CC,""];if(new RegExp(Ds).test(t)&&!/IEMobile\b/.test(t))return[Tp+" "+Ds,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],i=ele[r]||"";return/arm/i.test(t)&&(i="RT"),[Tp,i]}return[Tp,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[V0,t.join(".")]}return[V0,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Ve(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+No+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+No+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[No,t.join(".")]}return[No,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Kae,""]],[/Linux|debian/i,["Linux",""]]],hN=function(e){return Jae.test(e)?bm:Xae.test(e)?_m:Qae.test(e)?pf:new RegExp(kC,"i").test(e)?kC:new RegExp("("+CC+"|WPDesktop)","i").test(e)?CC:/iPad/.test(e)?v9:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?b9:pP.test(e)?Of:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(cN,"i").test(e)?cN:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?!new RegExp(Ds).test(e)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)?/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?No:g9:No:new RegExp("(pda|"+Ds+")","i").test(e)?Yae:new RegExp(vm,"i").test(e)&&!new RegExp(vm+" pc","i").test(e)?I9:""},ay="https?://(.*)",u0=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","irclid","_kx"],rle=s0(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],u0),F1="<masked>",On={campaignParams:function(){var{customTrackedParams:e,maskPersonalDataProperties:t,customPersonalDataProperties:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!Ke)return{};var r=t?s0([],u0,n||[]):[];return this._campaignParamsFromUrl(T1(Ke.URL,r,F1),e)},_campaignParamsFromUrl:function(e,t){var n=rle.concat(t||[]),r={};return mn(n,(function(i){var s=j0(e,i);r[i]=s||null})),r},_searchEngine:function(e){return e?e.search(ay+"google.([^/?]*)")===0?"google":e.search(ay+"bing.com")===0?"bing":e.search(ay+"yahoo.com")===0?"yahoo":e.search(ay+"duckduckgo.com")===0?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=On._searchEngine(e),n=t!="yahoo"?"q":"p",r={};if(!ou(t)){r.$search_engine=t;var i=Ke?j0(Ke.referrer,n):"";i.length&&(r.ph_keyword=i)}return r},searchInfo:function(){var e=Ke?.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:dN,browserVersion:function(e,t){var n=dN(e,t),r=nle[n];if(Ve(r))return null;for(var i=0;i<r.length;i++){var s=r[i],o=e.match(s);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},browserLanguagePrefix:function(){var e=this.browserLanguage();return typeof e=="string"?e.split("-")[0]:void 0},os:function(e){for(var t=0;t<fN.length;t++){var[n,r]=fN[t],i=n.exec(e),s=i&&(oo(r)?r(i,e):r);if(s)return s}return["",""]},device:hN,deviceType:function(e){var t=hN(e);return t===v9||t===g9||t==="Kobo"||t==="Kindle Fire"||t===I9?vm:t===bm||t===pf||t===_m||t===kC?"Console":t===b9?"Wearable":t?Ds:"Desktop"},referrer:function(){return Ke?.referrer||"$direct"},referringDomain:function(){var e;return Ke!=null&&Ke.referrer&&((e=ff(Ke.referrer))===null||e===void 0?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},personInfo:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e?s0([],u0,t||[]):[],r=Es?.href.substring(0,1e3);return{r:this.referrer().substring(0,1e3),u:r?T1(r,n,F1):void 0}},personPropsFromInfo:function(e){var t,{r:n,u:r}=e,i={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=ff(n))===null||t===void 0?void 0:t.host};
13if(r){i.$current_url=r;var s=ff(r);i.$host=s?.host,i.$pathname=s?.pathname;var o=this._campaignParamsFromUrl(r);dr(i,o)}if(n){var a=this._searchInfoFromReferrer(n);dr(i,a)}return i},initialPersonPropsFromInfo:function(e){var t=this.personPropsFromInfo(e),n={};return mn(t,(function(r,i){n["$initial_".concat(oP(i))]=r})),n},timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}},timezoneOffset:function(){try{return new Date().getTimezoneOffset()}catch{return}},properties:function(){var{maskPersonalDataProperties:e,customPersonalDataProperties:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!ur)return{};var n=e?s0([],u0,t||[]):[],[r,i]=On.os(ur);return dr(gm({$os:r,$os_version:i,$browser:On.browser(ur,navigator.vendor),$device:On.device(ur),$device_type:On.deviceType(ur),$timezone:On.timezone(),$timezone_offset:On.timezoneOffset()}),{$current_url:T1(Es?.href,n,F1),$host:Es?.host,$pathname:Es?.pathname,$raw_user_agent:ur.length>1e3?ur.substring(0,997)+"...":ur,$browser_version:On.browserVersion(ur,navigator.vendor),$browser_language:On.browserLanguage(),$browser_language_prefix:On.browserLanguagePrefix(),$screen_height:ge?.screen.height,$screen_width:ge?.screen.width,$viewport_height:ge?.innerHeight,$viewport_width:ge?.innerWidth,$lib:"web",$lib_version:Pa.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})},people_properties:function(){if(!ur)return{};var[e,t]=On.os(ur);return dr(gm({$os:e,$os_version:t,$browser:On.browser(ur,navigator.vendor)}),{$browser_version:On.browserVersion(ur,navigator.vendor)})}},Po=ei("[FeatureFlags]"),$1="$active_feature_flags",xd="$override_feature_flags",pN="$feature_flag_payloads",Jh="$override_feature_flag_payloads",mN="$feature_flag_request_id",gN=e=>{var t={};for(var[n,r]of o0(e||{}))r&&(t[n]=r);return t},ile=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((n=>t[n].enabled)).filter((n=>{var r;return(r=t[n].metadata)===null||r===void 0?void 0:r.payload})).map((n=>{var r;return[n,(r=t[n].metadata)===null||r===void 0?void 0:r.payload]})))):Po.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e};(function(e){e.FeatureFlags="feature_flags",e.Recordings="recordings"})(PC||(PC={}));class sle{constructor(t){Le(this,"_override_warning",!1),Le(this,"_hasLoadedFlags",!1),Le(this,"_requestInFlight",!1),Le(this,"_reloadingDisabled",!1),Le(this,"_additionalReloadRequested",!1),Le(this,"_decideCalled",!1),Le(this,"_flagsLoadedFromRemote",!1),this.instance=t,this.featureFlagEventHandlers=[]}decide(){if(this.instance.config.__preview_remote_config)this._decideCalled=!0;else{var t=!this._reloadDebouncer&&(this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load);this._callDecideEndpoint({disableFlags:t})}}get hasLoadedFlags(){return this._hasLoadedFlags}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this.instance.get_property(uC),n=this.instance.get_property(xd),r=this.instance.get_property(Jh);if(!r&&!n)return t||{};var i=dr({},t||{}),s=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of s){var a,l,u=i[o],f=n?.[o],d=Ve(f)?(a=u?.enabled)!==null&&a!==void 0&&a:!!f,p=Ve(f)?u.variant:typeof f=="string"?f:void 0,m=r?.[o],v=be(be({},u),{},{enabled:d,variant:d?p??u?.variant:void 0});d!==u?.enabled&&(v.original_enabled=u?.enabled),p!==u?.variant&&(v.original_variant=u?.variant),m&&(v.metadata=be(be({},u?.metadata),{},{payload:m,original_payload:u==null||(l=u.metadata)===null||l===void 0?void 0:l.payload})),i[o]=v}return this._override_warning||(Po.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:i}),this._override_warning=!0),i}getFlagVariants(){var t=this.instance.get_property(ef),n=this.instance.get_property(xd);if(!n)return t||{};for(var r=dr({},t),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this._override_warning||(Po.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._override_warning=!0),r}getFlagPayloads(){var t=this.instance.get_property(pN),n=this.instance.get_property(Jh);if(!n)return t||{};for(var r=dr({},t||{}),i=Object.keys(n),s=0;s<i.length;s++)r[i[s]]=n[i[s]];return this._override_warning||(Po.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._override_warning=!0),r}reloadFeatureFlags(){this._reloadingDisabled||this.instance.config.advanced_disable_feature_flags||this._reloadDebouncer||(this._reloadDebouncer=setTimeout((()=>{this._callDecideEndpoint()}),5))}clearDebouncer(){clearTimeout(this._reloadDebouncer),this._reloadDebouncer=void 0}ensureFlagsLoaded(){this._hasLoadedFlags||this._requestInFlight||this._reloadDebouncer||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this._reloadingDisabled=t}_callDecideEndpoint(t){var n;if(this.clearDebouncer(),!this.instance.config.advanced_disable_decide)if(this._requestInFlight)this._additionalReloadRequested=!0;else{var r={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:be(be({},((n=this.instance.persistence)===null||n===void 0?void 0:n.get_initial_props())||{}),this.instance.get_property(Cp)||{}),group_properties:this.instance.get_property(Ku)};(t!=null&&t.disableFlags||this.instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0);var i=this.instance.config.__preview_flags_v2&&this.instance.config.__preview_remote_config;i&&(r.timezone=On.timezone()),this._requestInFlight=!0,this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api",i?"/flags/?v=2":"/decide/?v=4"),data:r,compression:this.instance.config.disable_compression?void 0:ro.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:s=>{var o,a,l,u=!0;s.statusCode===200&&(this._additionalReloadRequested||(this.$anon_distinct_id=void 0),u=!1),this._requestInFlight=!1,this._decideCalled||(this._decideCalled=!0,this.instance._onRemoteConfig((l=s.json)!==null&&l!==void 0?l:{})),r.disable_flags&&!this._additionalReloadRequested||(this._flagsLoadedFromRemote=!u,s.json&&(o=s.json.quotaLimited)!==null&&o!==void 0&&o.includes(PC.FeatureFlags)?Po.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(this.receivedFeatureFlags((a=s.json)!==null&&a!==void 0?a:{},u),this._additionalReloadRequested&&(this._additionalReloadRequested=!1,this._callDecideEndpoint())))}})}}getFeatureFlag(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0){var r=this.getFlagVariants()[t],i="".concat(r),s=this.instance.get_property(mN)||void 0,o=this.instance.get_property(A0)||{};if((n.send_event||!("send_event"in n))&&(!(t in o)||!o[t].includes(i))){var a,l,u,f,d,p,m,v,_,w,x;Wn(o[t])?o[t].push(i):o[t]=[i],(a=this.instance.persistence)===null||a===void 0||a.register({[A0]:o});var S=this.getFeatureFlagDetails(t),C={$feature_flag:t,$feature_flag_response:r,$feature_flag_payload:this.getFeatureFlagPayload(t)||null,$feature_flag_request_id:s,$feature_flag_bootstrapped_response:((l=this.instance.config.bootstrap)===null||l===void 0||(u=l.featureFlags)===null||u===void 0?void 0:u[t])||null,$feature_flag_bootstrapped_payload:((f=this.instance.config.bootstrap)===null||f===void 0||(d=f.featureFlagPayloads)===null||d===void 0?void 0:d[t])||null,$used_bootstrap_value:!this._flagsLoadedFromRemote};Ve(S==null||(p=S.metadata)===null||p===void 0?void 0:p.version)||(C.$feature_flag_version=S.metadata.version);var R,P=(m=S==null||(v=S.reason)===null||v===void 0?void 0:v.description)!==null&&m!==void 0?m:S==null||(_=S.reason)===null||_===void 0?void 0:_.code;P&&(C.$feature_flag_reason=P),S!=null&&(w=S.metadata)!==null&&w!==void 0&&w.id&&(C.$feature_flag_id=S.metadata.id),Ve(S?.original_variant)&&Ve(S?.original_enabled)||(C.$feature_flag_original_response=Ve(S.original_variant)?S.original_enabled:S.original_variant),S!=null&&(x=S.metadata)!==null&&x!==void 0&&x.original_payload&&(C.$feature_flag_original_payload=S==null||(R=S.metadata)===null||R===void 0?void 0:R.original_payload),this.instance.capture("$feature_flag_called",C)}return r}Po.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){return this.getFlagPayloads()[t]}getRemoteConfigPayload(t,n){var r=this.instance.config.token;this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this.instance.get_distinct_id(),token:r},compression:this.instance.config.disable_compression?void 0:ro.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,o=(s=i.json)===null||s===void 0?void 0:s.featureFlagPayloads;n(o?.[t]||void 0)}})}isFeatureEnabled(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this._hasLoadedFlags||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(t,n);Po.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==t))}receivedFeatureFlags(t,n){if(this.instance.persistence){this._hasLoadedFlags=!0;var r=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(o,a){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},f=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{},d=ile(o),p=d.flags,m=d.featureFlags,v=d.featureFlagPayloads;if(m){var _=o.requestId;if(Wn(m)){Po.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var w={};if(m)for(var x=0;x<m.length;x++)w[m[x]]=!0;a&&a.register({[$1]:m,[ef]:w})}else{var S=m,C=v,R=p;o.errorsWhileComputingFlags&&(S=be(be({},l),S),C=be(be({},u),C),R=be(be({},f),R)),a&&a.register(be({[$1]:Object.keys(gN(S)),[ef]:S||{},[pN]:C||{},[uC]:R||{}},_?{[mN]:_}:{}))}}})(t,this.instance.persistence,r,i,s),this._fireFeatureFlagsCallbacks(n)}}override(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];Po.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this.instance.__loaded||!this.instance.persistence)return Po.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this.instance.persistence.unregister(xd),this.instance.persistence.unregister(Jh),void this._fireFeatureFlagsCallbacks();if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._override_warning=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this.instance.persistence.unregister(xd);else if(r.flags)if(Wn(r.flags)){for(var i={},s=0;s<r.flags.length;s++)i[r.flags[s]]=!0;this.instance.persistence.register({[xd]:i})}else this.instance.persistence.register({[xd]:r.flags})}return"payloads"in r&&(r.payloads===!1?this.instance.persistence.unregister(Jh):r.payloads&&this.instance.persistence.register({[Jh]:r.payloads})),void this._fireFeatureFlagsCallbacks()}this._fireFeatureFlagsCallbacks()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this._hasLoadedFlags){var{flags:n,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n){var r,i=(this.instance.get_property(a0)||[]).find((l=>l.flagKey===t)),s={["$feature_enrollment/".concat(t)]:n},o={$feature_flag:t,$feature_enrollment:n,$set:s};i&&(o.$early_access_feature_name=i.name),this.instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var a=be(be({},this.getFlagVariants()),{},{[t]:n});(r=this.instance.persistence)===null||r===void 0||r.register({[$1]:Object.keys(gN(a)),[ef]:a}),this._fireFeatureFlagsCallbacks()}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=arguments.length>2?arguments[2]:void 0,i=this.instance.get_property(a0),s=r?"&".concat(r.map((o=>"stage=".concat(o))).join("&")):"";if(i&&!n)return t(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token).concat(s)),method:"GET",callback:o=>{var a;if(o.json){var l=o.json.earlyAccessFeatures;return(a=this.instance.persistence)===null||a===void 0||a.register({[a0]:l}),t(l)}}})}_prepareFeatureFlagsForCallbacks(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,i)=>(r[i]=n[i],r)),{})}}_fireFeatureFlagsCallbacks(t){var{flags:n,flagVariants:r}=this._prepareFeatureFlagsForCallbacks();
13this.featureFlagEventHandlers.forEach((i=>i(n,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Cp)||{};this.instance.register({[Cp]:be(be({},r),t)}),n&&this.instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this.instance.unregister(Cp)}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],r=this.instance.get_property(Ku)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((i=>{r[i]=be(be({},r[i]),t[i]),delete t[i]})),this.instance.register({[Ku]:be(be({},r),t)}),n&&this.instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this.instance.get_property(Ku)||{};this.instance.register({[Ku]:be(be({},n),{},{[t]:{}})})}else this.instance.unregister(Ku)}}var ole=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class z1{constructor(t){this.config=t,this.props={},this.campaign_params_saved=!1,this.name=(n=>{var r="";return n.token&&(r=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+r+"_posthog"})(t),this.storage=this.buildStorage(t),this.load(),t.debug&&ct.info("Persistence loaded",t.persistence,be({},this.props)),this.update_config(t,t),this.save()}buildStorage(t){ole.indexOf(t.persistence.toLowerCase())===-1&&(ct.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=t.persistence.toLowerCase();return n==="localstorage"&&xr.is_supported()?xr:n==="localstorage+cookie"&&ey.is_supported()?ey:n==="sessionstorage"&&Fr.is_supported()?Fr:n==="memory"?nae:n==="cookie"?Na:ey.is_supported()?ey:Na}properties(){var t={};return mn(this.props,(function(n,r){if(r===ef&&Gn(n))for(var i=Object.keys(n),s=0;s<i.length;s++)t["$feature/".concat(i[s])]=n[i[s]];else a=r,l=!1,(ou(o=Noe)?l:EM&&o.indexOf===EM?o.indexOf(a)!=-1:(mn(o,(function(u){if(l||(l=u===a))return O0})),l))||(t[r]=n);var o,a,l})),t}load(){if(!this.disabled){var t=this.storage.parse(this.name);t&&(this.props=dr({},t))}}save(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure,this.config.debug)}remove(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Gn(t)){Ve(n)&&(n="None"),this.expire_days=Ve(r)?this.default_expiry:r;var i=!1;if(mn(t,((s,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=s,i=!0)})),i)return this.save(),!0}return!1}register(t,n){if(Gn(t)){this.expire_days=Ve(n)?this.default_expiry:n;var r=!1;if(mn(t,((i,s)=>{t.hasOwnProperty(s)&&this.props[s]!==i&&(this.props[s]=i,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.campaign_params_saved){var t=On.campaignParams({customTrackedParams:this.config.custom_campaign_params,maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});Jd(gm(t))||this.register(t),this.campaign_params_saved=!0}}update_search_keyword(){this.register(On.searchInfo())}update_referrer_info(){this.register_once(On.referrerInfo(),void 0)}set_initial_person_info(){this.props[hC]||this.props[pC]||this.register_once({[mC]:On.personInfo({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties})},void 0)}get_referrer_info(){return gm({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}get_initial_props(){var t={};mn([pC,hC],(i=>{var s=this.props[i];s&&mn(s,(function(o,a){t["$initial_"+oP(a)]=o}))}));var n=this.props[mC];if(n){var r=On.initialPersonPropsFromInfo(n);dr(t,r)}return t}safe_merge(t){return mn(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n){if(this.default_expiry=this.expire_days=t.cookie_expiration,this.set_disabled(t.disable_persistence),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence){var r=this.buildStorage(t),i=this.props;this.clear(),this.storage=r,this.props=i,this.save()}}set_disabled(t){this.disabled=t,this.disabled?this.remove():this.save()}set_cross_subdomain(t){t!==this.cross_subdomain&&(this.cross_subdomain=t,this.remove(),this.save())}
vendor: 9,679 bytes, line 13
13get_cross_subdomain(){return!!this.cross_subdomain}set_secure(t){t!==this.secure&&(this.secure=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Sp]||{};r[t]=n,this.props[Sp]=r,this.save()}remove_event_timer(t){var n=(this.props[Sp]||{})[t];return Ve(n)||(delete this.props[Sp][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var O9,Zn,D9,Ju,vN,A9,RC,M9,yN,bN,_N,wN,IC={},N9=[],ale=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,mP=Array.isArray;function jl(e,t){for(var n in t)e[n]=t[n];return e}function j9(e){var t=e.parentNode;t&&t.removeChild(e)}function V1(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++D9,__i:-1,__u:0};return i==null&&Zn.vnode!=null&&Zn.vnode(s),s}function gP(e){return e.children}function c0(e,t){this.props=e,this.context=t}function Df(e,t){if(t==null)return e.__?Df(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?Df(e):null}function L9(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return L9(e)}}function OC(e){(!e.__d&&(e.__d=!0)&&Ju.push(e)&&!U0.__r++||vN!==Zn.debounceRendering)&&((vN=Zn.debounceRendering)||A9)(U0)}function U0(){var e,t,n,r,i,s,o,a,l;for(Ju.sort(RC);e=Ju.shift();)e.__d&&(t=Ju.length,r=void 0,s=(i=(n=e).__v).__e,a=[],l=[],(o=n.__P)&&((r=jl({},i)).__v=i.__v+1,Zn.vnode&&Zn.vnode(r),z9(o,r,i,n.__n,o.ownerSVGElement!==void 0,32&i.__u?[s]:null,a,s??Df(i),!!(32&i.__u),l),r.__.__k[r.__i]=r,cle(a,r,l),r.__e!=s&&L9(r)),Ju.length>t&&Ju.sort(RC));U0.__r=0}function F9(e,t,n,r,i,s,o,a,l,u,f){var d,p,m,v,_,w=r&&r.__k||N9,x=t.length;for(n.__d=l,lle(n,t,w),l=n.__d,d=0;d<x;d++)(m=n.__k[d])!=null&&typeof m!="boolean"&&typeof m!="function"&&(p=m.__i===-1?IC:w[m.__i]||IC,m.__i=d,z9(e,m,p,i,s,o,a,l,u,f),v=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&vP(p.ref,null,m),f.push(m.ref,m.__c||v,m)),_==null&&v!=null&&(_=v),65536&m.__u||p.__k===m.__k?l=$9(m,l,e):typeof m.type=="function"&&m.__d!==void 0?l=m.__d:v&&(l=v.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=_}function lle(e,t,n){var r,i,s,o,a,l=t.length,u=n.length,f=u,d=0;for(e.__k=[],r=0;r<l;r++)(i=e.__k[r]=(i=t[r])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?V1(null,i,null,null,i):mP(i)?V1(gP,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?V1(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=e,i.__b=e.__b+1,a=ule(i,n,o=r+d,f),i.__i=a,s=null,a!==-1&&(f--,(s=n[a])&&(s.__u|=131072)),s==null||s.__v===null?(a==-1&&d--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a===o+1?d++:a>o?f>l-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==r+d&&(i.__u|=65536))):(s=n[r])&&s.key==null&&s.__e&&(s.__e==e.__d&&(e.__d=Df(s)),DC(s,s,!1),n[r]=null,f--);if(f)for(r=0;r<u;r++)(s=n[r])!=null&&(131072&s.__u)==0&&(s.__e==e.__d&&(e.__d=Df(s)),DC(s,s))}function $9(e,t,n){var r,i;if(typeof e.type=="function"){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=$9(r[i],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function ule(e,t,n,r){var i=e.key,s=e.type,o=n-1,a=n+1,l=t[n];if(l===null||l&&i==l.key&&s===l.type)return n;if(r>(l!=null&&(131072&l.__u)==0?1:0))for(;o>=0||a<t.length;){if(o>=0){if((l=t[o])&&(131072&l.__u)==0&&i==l.key&&s===l.type)return o;o--}if(a<t.length){if((l=t[a])&&(131072&l.__u)==0&&i==l.key&&s===l.type)return a;a++}}return-1}function xN(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||ale.test(t)?n:n+"px"}function ly(e,t,n,r,i){var s;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||xN(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||xN(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")s=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?EN:SN,s)):e.removeEventListener(t,s?EN:SN,s);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function SN(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Zn.event?Zn.event(e):e)}function EN(e){return this.l[e.type+!0](Zn.event?Zn.event(e):e)}function z9(e,t,n,r,i,s,o,a,l,u){var f,d,p,m,v,_,w,x,S,C,R,P,k,I,D,L=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),s=[a=t.__e=n.__e]),(f=Zn.__b)&&f(t);e:if(typeof L=="function")try{if(x=t.props,S=(f=L.contextType)&&r[f.__c],C=f?S?S.props.value:f.__:r,n.__c?w=(d=t.__c=n.__c).__=d.__E:("prototype"in L&&L.prototype.render?t.__c=d=new L(x,C):(t.__c=d=new c0(x,C),d.constructor=L,d.render=fle),S&&S.sub(d),d.props=x,d.state||(d.state={}),d.context=C,d.__n=r,p=d.__d=!0,d.__h=[],d._sb=[]),d.__s==null&&(d.__s=d.state),L.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=jl({},d.__s)),jl(d.__s,L.getDerivedStateFromProps(x,d.__s))),m=d.props,v=d.state,d.__v=t,p)L.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(L.getDerivedStateFromProps==null&&x!==m&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(x,C),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(x,d.__s,C)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=x,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(A){A&&(A.__=t)})),R=0;R<d._sb.length;R++)d.__h.push(d._sb[R]);d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(x,d.__s,C),d.componentDidUpdate!=null&&d.__h.push((function(){d.componentDidUpdate(m,v,_)}))}if(d.context=C,d.props=x,d.__P=e,d.__e=!1,P=Zn.__r,k=0,"prototype"in L&&L.prototype.render){for(d.state=d.__s,d.__d=!1,P&&P(t),f=d.render(d.props,d.state,d.context),I=0;I<d._sb.length;I++)d.__h.push(d._sb[I]);d._sb=[]}else do d.__d=!1,P&&P(t),f=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++k<25);d.state=d.__s,d.getChildContext!=null&&(r=jl(jl({},r),d.getChildContext())),p||d.getSnapshotBeforeUpdate==null||(_=d.getSnapshotBeforeUpdate(m,v)),F9(e,mP(D=f!=null&&f.type===gP&&f.key==null?f.props.children:f)?D:[D],t,n,r,i,s,o,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),w&&(d.__E=d.__=null)}catch(A){t.__v=null,l||s!=null?(t.__e=a,t.__u|=l?160:32,s[s.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),Zn.__e(A,t,n)}else s==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=dle(n.__e,t,n,r,i,s,o,l,u);(f=Zn.diffed)&&f(t)}function cle(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)vP(n[r],n[++r],n[++r]);Zn.__c&&Zn.__c(t,e),e.some((function(i){try{e=i.__h,i.__h=[],e.some((function(s){s.call(i)}))}catch(s){Zn.__e(s,i.__v)}}))}function dle(e,t,n,r,i,s,o,a,l){var u,f,d,p,m,v,_,w=n.props,x=t.props,S=t.type;if(S==="svg"&&(i=!0),s!=null){for(u=0;u<s.length;u++)if((m=s[u])&&"setAttribute"in m==!!S&&(S?m.localName===S:m.nodeType===3)){e=m,s[u]=null;break}}if(e==null){if(S===null)return document.createTextNode(x);e=i?document.createElementNS("http://www.w3.org/2000/svg",S):document.createElement(S,x.is&&x),s=null,a=!1}if(S===null)w===x||a&&e.data===x||(e.data=x);else{if(s=s&&O9.call(e.childNodes),w=n.props||IC,!a&&s!=null)for(w={},u=0;u<e.attributes.length;u++)w[(m=e.attributes[u]).name]=m.value;for(u in w)m=w[u],u=="children"||(u=="dangerouslySetInnerHTML"?d=m:u==="key"||u in x||ly(e,u,null,m,i));for(u in x)m=x[u],u=="children"?p=m:u=="dangerouslySetInnerHTML"?f=m:u=="value"?v=m:u=="checked"?_=m:u==="key"||a&&typeof m!="function"||w[u]===m||ly(e,u,m,w[u],i);if(f)a||d&&(f.__html===d.__html||f.__html===e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(d&&(e.innerHTML=""),F9(e,mP(p)?p:[p],t,n,r,i&&S!=="foreignObject",s,o,s?s[0]:n.__k&&Df(n,0),a,l),s!=null)for(u=s.length;u--;)s[u]!=null&&j9(s[u]);a||(u="value",v!==void 0&&(v!==e[u]||S==="progress"&&!v||S==="option"&&v!==w[u])&&ly(e,u,v,w[u],!1),u="checked",_!==void 0&&_!==e[u]&&ly(e,u,_,w[u],!1))}return e}function vP(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){Zn.__e(r,n)}}function DC(e,t,n){var r,i;if(Zn.unmount&&Zn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||vP(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){Zn.__e(s,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&DC(r[i],t,n||typeof e.type!="function");n||e.__e==null||j9(e.__e),e.__=e.__e=e.__d=void 0}function fle(e,t,n){return this.constructor(e,n)}O9=N9.slice,Zn={__e:function(e,t,n,r){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(a){e=a}throw e}},D9=0,c0.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=jl({},this.state),typeof e=="function"&&(e=e(jl({},n),this.props)),e&&jl(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),OC(this))},c0.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),OC(this))},c0.prototype.render=gP,Ju=[],A9=typeof Promise=="function"?Promise.prototype.then.bind(Prom
13ise.resolve()):setTimeout,RC=function(e,t){return e.__v.__b-t.__v.__b},U0.__r=0,M9=0,(function(e){e.Popover="popover",e.API="api",e.Widget="widget"})(yN||(yN={})),(function(e){e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link"})(bN||(bN={})),(function(e){e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question"})(_N||(_N={})),(function(e){e.Once="once",e.Recurring="recurring",e.Always="always"})(wN||(wN={}));(function(e,t){var n={__c:t="__cC"+M9++,__:e,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[t]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some((function(a){a.__e=!0,OC(a)}))},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};n.Provider.__=n.Consumer.contextType=n})({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed:()=>{},isPopup:!0,onPreviewSubmit:()=>{}});var Af=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};class V9{constructor(){Le(this,"events",{}),this.events={}}on(t,n){return this.events[t]||(this.events[t]=[]),this.events[t].push(n),()=>{this.events[t]=this.events[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.events[t]||[])r(n);for(var i of this.events["*"]||[])i(t,n)}}class ec{constructor(t){Le(this,"_debugEventEmitter",new V9),Le(this,"checkStep",((n,r)=>this.checkStepEvent(n,r)&&this.checkStepUrl(n,r)&&this.checkStepElement(n,r))),Le(this,"checkStepEvent",((n,r)=>r==null||!r.event||n?.event===r?.event)),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}init(){var t;if(!Ve((t=this.instance)===null||t===void 0?void 0:t._addCaptureHook)){var n;(n=this.instance)===null||n===void 0||n._addCaptureHook(((r,i)=>{this.on(r,i)}))}}register(t){var n,r;if(!Ve((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)&&(t.forEach((o=>{var a,l;(a=this.actionRegistry)===null||a===void 0||a.add(o),(l=o.steps)===null||l===void 0||l.forEach((u=>{var f;(f=this.actionEvents)===null||f===void 0||f.add(u?.event||"")}))})),(r=this.instance)!==null&&r!==void 0&&r.autocapture)){var i,s=new Set;t.forEach((o=>{var a;(a=o.steps)===null||a===void 0||a.forEach((l=>{l!=null&&l.selector&&s.add(l?.selector)}))})),(i=this.instance)===null||i===void 0||i.autocapture.setElementSelectors(s)}}on(t,n){var r;n!=null&&t.length!=0&&(this.actionEvents.has(t)||this.actionEvents.has(n?.event))&&this.actionRegistry&&((r=this.actionRegistry)===null||r===void 0?void 0:r.size)>0&&this.actionRegistry.forEach((i=>{this.checkAction(n,i)&&this._debugEventEmitter.emit("actionCaptured",i.name)}))}_addActionHook(t){this.onAction("actionCaptured",(n=>t(n)))}checkAction(t,n){if(n?.steps==null)return!1;for(var r of n.steps)if(this.checkStep(t,r))return!0;return!1}onAction(t,n){return this._debugEventEmitter.on(t,n)}checkStepUrl(t,n){if(n!=null&&n.url){var r,i=t==null||(r=t.properties)===null||r===void 0?void 0:r.$current_url;if(!i||typeof i!="string"||!ec.matchString(i,n?.url,n?.url_matching||"contains"))return!1}return!0}static matchString(t,n,r){switch(r){case"regex":return!!ge&&Af(t,n);case"exact":return n===t;case"contains":var i=ec.escapeStringRegexp(n).replace(/_/g,".").replace(/%/g,".*");return Af(t,i);default:return!1}}static escapeStringRegexp(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}checkStepElement(t,n){if((n!=null&&n.href||n!=null&&n.tag_name||n!=null&&n.text)&&!this.getElementsList(t).some((s=>!(n!=null&&n.href&&!ec.matchString(s.href||"",n?.href,n?.href_matching||"exact"))&&(n==null||!n.tag_name||s.tag_name===n?.tag_name)&&!(n!=null&&n.text&&!ec.matchString(s.text||"",n?.text,n?.text_matching||"exact")&&!ec.matchString(s.$el_text||"",n?.text,n?.text_matching||"exact")))))return!1;if(n!=null&&n.selector){var r,i=t==null||(r=t.properties)===null||r===void 0?void 0:r.$element_selectors;if(!i||!i.includes(n?.selector))return!1}return!0}getElementsList(t){return t?.properties.$elements==null?[]:t?.properties.$elements}}class wm{constructor(t){this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}register(t){var n;Ve((n=this.instance)===null||n===void 0?void 0:n._addCaptureHook)||(this.setupEventBasedSurveys(t),this.setupActionBasedSurveys(t))}setupActionBasedSurveys(t){var n=t.filter((r=>{var i,s,o,a;return((i=r.conditions)===null||i===void 0?void 0:i.actions)&&((s=r.conditions)===null||s===void 0||(o=s.actions)===null||o===void 0||(a=o.values)===null||a===void 0?void 0:a.length)>0}));n.length!==0&&(this.actionMatcher==null&&(this.actionMatcher=new ec(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook((r=>{this.onAction(r)}
13))),n.forEach((r=>{var i,s,o,a,l,u,f,d,p,m;r.conditions&&(i=r.conditions)!==null&&i!==void 0&&i.actions&&(s=r.conditions)!==null&&s!==void 0&&(o=s.actions)!==null&&o!==void 0&&o.values&&((a=r.conditions)===null||a===void 0||(l=a.actions)===null||l===void 0||(u=l.values)===null||u===void 0?void 0:u.length)>0&&((f=this.actionMatcher)===null||f===void 0||f.register(r.conditions.actions.values),(d=r.conditions)===null||d===void 0||(p=d.actions)===null||p===void 0||(m=p.values)===null||m===void 0||m.forEach((v=>{if(v&&v.name){var _=this.actionToSurveys.get(v.name);_&&_.push(r.id),this.actionToSurveys.set(v.name,_||[r.id])}})))})))}setupEventBasedSurveys(t){var n;t.filter((r=>{var i,s,o,a;return((i=r.conditions)===null||i===void 0?void 0:i.events)&&((s=r.conditions)===null||s===void 0||(o=s.events)===null||o===void 0||(a=o.values)===null||a===void 0?void 0:a.length)>0})).length!==0&&((n=this.instance)===null||n===void 0||n._addCaptureHook(((r,i)=>{this.onEvent(r,i)})),t.forEach((r=>{var i,s,o;(i=r.conditions)===null||i===void 0||(s=i.events)===null||s===void 0||(o=s.values)===null||o===void 0||o.forEach((a=>{if(a&&a.name){var l=this.eventToSurveys.get(a.name);l&&l.push(r.id),this.eventToSurveys.set(a.name,l||[r.id])}}))})))}onEvent(t,n){var r,i,s=((r=this.instance)===null||r===void 0||(i=r.persistence)===null||i===void 0?void 0:i.props[Jv])||[];if(wm.SURVEY_SHOWN_EVENT_NAME==t&&n&&s.length>0){var o,a=n==null||(o=n.properties)===null||o===void 0?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&(s.splice(l,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(t)||[]))}onAction(t){var n,r,i=((n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0?void 0:r.props[Jv])||[];this.actionToSurveys.has(t)&&this._updateActivatedSurveys(i.concat(this.actionToSurveys.get(t)||[]))}_updateActivatedSurveys(t){var n,r;(n=this.instance)===null||n===void 0||(r=n.persistence)===null||r===void 0||r.register({[Jv]:[...new Set(t)]})}getSurveys(){var t,n,r=(t=this.instance)===null||t===void 0||(n=t.persistence)===null||n===void 0?void 0:n.props[Jv];return r||[]}getEventToSurveys(){return this.eventToSurveys}_getActionMatcher(){return this.actionMatcher}}Le(wm,"SURVEY_SHOWN_EVENT_NAME","survey shown");var Nr=ei("[Surveys]"),CN={icontains:(e,t)=>e.some((n=>t.toLowerCase().includes(n.toLowerCase()))),not_icontains:(e,t)=>e.every((n=>!t.toLowerCase().includes(n.toLowerCase()))),regex:(e,t)=>e.some((n=>Af(t,n))),not_regex:(e,t)=>e.every((n=>!Af(t,n))),exact:(e,t)=>e.some((n=>t===n)),is_not:(e,t)=>e.every((n=>t!==n))};function kN(e){return e??"icontains"}class hle{constructor(t){Le(this,"_isFetchingSurveys",!1),Le(this,"_isInitializingSurveys",!1),Le(this,"_surveyCallbacks",[]),this.instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){var n=t.surveys;if(dn(n))return Nr.warn("Decide not loaded yet. Not loading surveys.");var r=Wn(n);this._hasSurveys=r?n.length>0:n,Nr.info("decide response received, hasSurveys: ".concat(this._hasSurveys)),this._hasSurveys&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");var t=(()=>{for(var n=[],r=0;r<localStorage.length;r++){var i=localStorage.key(r);i!=null&&i.startsWith("seenSurvey_")&&n.push(i)}return n})();t.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this._isInitializingSurveys)Nr.info("Already initializing surveys, skipping...");else if(this.instance.config.disable_surveys)Nr.info("Disabled. Not loading surveys.");else{var t=Dt?.__PosthogExtensions__;if(t)if(this._hasSurveys){this._isInitializingSurveys=!0;try{var n=t.generateSurveys;if(n)this._surveyManager=n(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new wm(this.instance),Nr.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0});else{var r=t.loadExternalDependency;if(r)r(this.instance,"surveys",(s=>{if(s||!t.generateSurveys)return Nr.error("Could not load surveys script",s),void(this._isInitializingSurveys=!1);this._surveyManager=t.generateSurveys(this.instance),this._isInitializingSurveys=!1,this._surveyEventReceiver=new wm(this.instance),Nr.info("Surveys loaded successfully"),this._notifySurveyCallbacks({isLoaded:!0})}));else{var i="PostHog loadExternalDependency extension not found. Cannot load remote config.";Nr.error(i),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:i})}}}catch(s){throw Nr.error("Error initializing surveys",s),this._isInitializingSurveys=!1,this._notifySurveyCallbacks({isLoaded:!1,error:"Error initializing surveys"}),s}}else Nr.info("No surveys to load.");else Nr.error("PostHog Extensions not found.")}}onSurveysLoaded(t){return this._surveyCallbacks.push(t),this._surveyManager&&this._notifySurveyCallbacks({isLoaded:!0}),()=>{this._surveyCallbacks=this._surveyCallbacks.filter((n=>n!==t))}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(this.instance.config.disable_surveys)return Nr.info("Disabled. Not loading surveys."),t([]);var r=this.instance.get_property(cC);if(r&&!n)return t(r,{isLoaded:!0});if(this._isFetchingSurveys)return t([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this._isFetchingSurveys=!0,this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",timeout:this.instance.config.surveys_request_timeout_ms,callback:i=>{var s;this._isFetchingSurveys=!1;var o=i.statusCode;if(o!==200||!i.json){var a="Surveys API could not be loaded, status: ".concat(o);return Nr.error(a),t([],{isLoaded:!1,error:a})}var l,u=i.json.surveys||[],f=u.filter((d=>{var p,m,v,_,w,x,S,C,R,P,k,I;return((p=d.conditions)===null||p===void 0?void 0:p.events)&&((m=d.conditions)===null||m===void 0||(v=m.events)===null||v===void 0?void 0:v.values)&&((_=d.conditions)===null||_===void 0||(w=_.events)===null||w===void 0||(x=w.values)===null||x===void 0?void 0:x.length)>0||((S=d.conditions)===null||S===void 0?void 0:S.actions)&&((C=d.conditions)===null||C===void 0||(R=C.actions)===null||R===void 0?void 0:R.values)&&((P=d.conditions)===null||P===void 0||(k=P.actions)===null||k===void 0||(I=k.values)===null||I===void 0?void 0:I.length)>0}));return f.length>0&&((l=this._surveyEventReceiver)===null||l===void 0||l.register(f)),(s=this.instance.persistence)===null||s===void 0||s.register({[cC]:u}),t(u,{isLoaded:!0})}})}catch(i){throw this._isFetchingSurveys=!1,i}}_notifySurveyCallbacks(t){for(var n of this._surveyCallbacks)try{t.isLoaded?this.get
13Surveys(n):n([],t)}catch(r){Nr.error("Error in survey callback",r)}}isSurveyFeatureFlagEnabled(t){return!t||this.instance.featureFlags.isFeatureEnabled(t)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.getSurveys((r=>{var i,s=r.filter((l=>!(!l.start_date||l.end_date))).filter((l=>{var u;if(!l.conditions)return!0;var f=(function(m){var v,_,w;if((v=m.conditions)===null||v===void 0||!v.url)return!0;var x=ge==null||(_=ge.location)===null||_===void 0?void 0:_.href;if(!x)return!1;var S=[m.conditions.url];return CN[kN((w=m.conditions)===null||w===void 0?void 0:w.urlMatchType)](S,x)})(l),d=(u=l.conditions)===null||u===void 0||!u.selector||Ke?.querySelector(l.conditions.selector),p=(function(m){var v,_,w;if((v=m.conditions)===null||v===void 0||!v.deviceTypes||((_=m.conditions)===null||_===void 0?void 0:_.deviceTypes.length)===0)return!0;if(!ur)return!1;var x=On.deviceType(ur);return CN[kN((w=m.conditions)===null||w===void 0?void 0:w.deviceTypesMatchType)](m.conditions.deviceTypes,x)})(l);return f&&d&&p})),o=(i=this._surveyEventReceiver)===null||i===void 0?void 0:i.getSurveys(),a=s.filter((l=>{var u,f,d,p,m,v,_,w,x;if(!(l.linked_flag_key||l.targeting_flag_key||l.internal_targeting_flag_key||(u=l.feature_flag_keys)!==null&&u!==void 0&&u.length))return!0;var S=this.isSurveyFeatureFlagEnabled(l.linked_flag_key),C=this.isSurveyFeatureFlagEnabled(l.targeting_flag_key),R=((f=(d=l.conditions)===null||d===void 0||(p=d.events)===null||p===void 0||(m=p.values)===null||m===void 0?void 0:m.length)!==null&&f!==void 0?f:0)>0,P=((v=(_=l.conditions)===null||_===void 0||(w=_.actions)===null||w===void 0||(x=w.values)===null||x===void 0?void 0:x.length)!==null&&v!==void 0?v:0)>0,k=!R&&!P||o?.includes(l.id),I=this._canActivateRepeatedly(l)||this.isSurveyFeatureFlagEnabled(l.internal_targeting_flag_key),D=this.checkFlags(l);return S&&C&&I&&k&&D}));return t(a)}),n)}checkFlags(t){var n;return(n=t.feature_flag_keys)===null||n===void 0||!n.length||t.feature_flag_keys.every((r=>{var{key:i,value:s}=r;return!i||!s||this.instance.featureFlags.isFeatureEnabled(s)}))}_canActivateRepeatedly(t){var n;return dn((n=Dt.__PosthogExtensions__)===null||n===void 0?void 0:n.canActivateRepeatedly)?(Nr.warn("init was not called"),!1):Dt.__PosthogExtensions__.canActivateRepeatedly(t)}canRenderSurvey(t){dn(this._surveyManager)?Nr.warn("init was not called"):this.getSurveys((n=>{var r=n.filter((i=>i.id===t))[0];this._surveyManager.canRenderSurvey(r)}))}renderSurvey(t,n){dn(this._surveyManager)?Nr.warn("init was not called"):this.getSurveys((r=>{var i=r.filter((s=>s.id===t))[0];this._surveyManager.renderSurvey(i,Ke?.querySelector(n))}))}}var TN=ei("[RateLimiter]");class ple{constructor(t){var n,r;Le(this,"serverLimits",{}),Le(this,"lastEventRateLimited",!1),Le(this,"checkForLimiting",(i=>{var s=i.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach((o=>{TN.info("".concat(o||"events"," is quota limited.")),this.serverLimits[o]=new Date().getTime()+6e4}))}catch(o){return void TN.warn('could not rate limit - continuing. Error: "'.concat(o?.message,'"'),{text:s})}})),this.instance=t,this.captureEventsPerSecond=((n=t.config.rate_limiting)===null||n===void 0?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((r=t.config.rate_limiting)===null||r===void 0?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(){var t,n,r,i=arguments.length>0&&arguments[0]!==void 0&&arguments[0],s=new Date().getTime(),o=(t=(n=this.instance.persistence)===null||n===void 0?void 0:n.get_property(fC))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:s};o.tokens+=(s-o.last)/1e3*this.captureEventsPerSecond,o.last=s,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var a=o.tokens<1;return a||i||(o.tokens=Math.max(0,o.tokens-1)),!a||this.lastEventRateLimited||i||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=a,(r=this.instance.persistence)===null||r===void 0||r.set_property(fC,o),{isRateLimited:a,remainingTokens:o.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var Nu=ei("[RemoteConfig]");class mle{constructor(t){this.instance=t}get remoteConfig(){var t,n;return(t=Dt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.config}_loadRemoteConfigJs(t){var n,r,i;(n=Dt.__PosthogExtensions__)!==null&&n!==void 0&&n.loadExternalDependency?(r=Dt.__PosthogExtensions__)===null||r===void 0||(i=r.loadExternalDependency)===null||i===void 0||i.call(r,this.instance,"remote-config",(()=>t(this.remoteConfig))):(Nu.error("PostHog Extensions not found. Cannot load remote config."),t())}_loadRemoteConfigJSON(t){this.instance._send_request({method:"GET",url:this.instance.requestRouter.endpointFor("assets","/array/".concat(this.instance.config.token,"/config")),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Nu.info("Using preloaded remote config",this.remoteConfig),void this.onRemoteConfig(this.remoteConfig);if(this.instance.config.advanced_disable_decide)return void Nu.warn("Remote config is disabled. Falling back to local config.");this._loadRemoteConfigJs((t=>{if(!t)return Nu.info("No config found after loading remote JS config. Falling back to JSON."),void this._loadRemoteConfigJSON((n=>{this.onRemoteConfig(n)}));this.onRemoteConfig(t)}))}
13catch(t){Nu.error("Error loading remote config",t)}}onRemoteConfig(t){t?this.instance.config.__preview_remote_config?(this.instance._onRemoteConfig(t),t.hasFeatureFlags!==!1&&this.instance.featureFlags.ensureFlagsLoaded()):Nu.info("__preview_remote_config is disabled. Logging config instead",t):Nu.error("Failed to fetch remote config from PostHog.")}}var gle=function(e){var t,n,r,i,s="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
14`).replace(/\r/g,`
15`)).length,i=0;i<r;i++){var o=e.charCodeAt(i),a=null;o<128?n++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),ou(a)||(n>t&&(s+=e.substring(t,n)),s+=a,t=n=i+1)}return n>t&&(s+=e.substring(t,e.length)),s},vle=!!sC||!!iC,PN="text/plain",B0=(e,t)=>{var[n,r]=e.split("?"),i=be({},t);r?.split("&").forEach((o=>{var[a]=o.split("=");delete i[a]}));var s=Hoe(i);return s=s?(r?r+"&":"")+s:r,"".concat(n,"?").concat(s)},Pp=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),U1=e=>{var{data:t,compression:n}=e;if(t){if(n===ro.GZipJS){var r=f9(h9(Pp(t)),{mtime:0}),i=new Blob([r],{type:PN});return{contentType:PN,body:i,estimatedSize:i.size}}if(n===ro.Base64){var s=(function(l){var u,f,d,p,m,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,w=0,x="",S=[];if(!l)return l;l=gle(l);do u=(m=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,f=m>>12&63,d=m>>6&63,p=63&m,S[w++]=v.charAt(u)+v.charAt(f)+v.charAt(d)+v.charAt(p);while(_<l.length);switch(x=S.join(""),l.length%3){case 1:x=x.slice(0,-2)+"==";break;case 2:x=x.slice(0,-1)+"="}return x})(Pp(t)),o=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Pp(l)))(s);return{contentType:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=Pp(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Gp=[];iC&&Gp.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:i,estimatedSize:s}=(t=U1(e))!==null&&t!==void 0?t:{},o=new Headers;mn(e.headers,(function(f,d){o.append(d,f)})),r&&o.append("Content-Type",r);var a=e.url,l=null;if(CM){var u=new CM;l={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}iC(a,be({method:e?.method||"GET",headers:o,keepalive:e.method==="POST"&&(s||0)<52428.8,body:i,signal:(n=l)===null||n===void 0?void 0:n.signal},e.fetchOptions)).then((f=>f.text().then((d=>{var p,m={statusCode:f.status,text:d};if(f.status===200)try{m.json=JSON.parse(d)}catch(v){ct.error(v)}(p=e.callback)===null||p===void 0||p.call(e,m)})))).catch((f=>{var d;ct.error(f),(d=e.callback)===null||d===void 0||d.call(e,{statusCode:0,text:f})})).finally((()=>l?clearTimeout(l.timeout):null))}}),sC&&Gp.push({transport:"XHR",method:e=>{var t,n=new sC;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:i}=(t=U1(e))!==null&&t!==void 0?t:{};mn(e.headers,(function(s,o){n.setRequestHeader(o,s)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=()=>{if(n.readyState===4){var s,o={statusCode:n.status,text:n.responseText};if(n.status===200)try{o.json=JSON.parse(n.responseText)}catch{}(s=e.callback)===null||s===void 0||s.call(e,o)}},n.send(i)}}),Xi!=null&&Xi.sendBeacon&&Gp.push({transport:"sendBeacon",method:e=>{var t=B0(e.url,{beacon:"1"});try{var n,{contentType:r,body:i}=(n=U1(e))!==null&&n!==void 0?n:{},s=typeof i=="string"?new Blob([i],{type:r}):i;Xi.sendBeacon(t,s)}catch{}}});var AC=3e3;class yle{constructor(t,n){Le(this,"isPaused",!0),Le(this,"queue",[]),this.flushTimeoutMs=Is(n?.flush_interval_ms||AC,250,5e3,"flush interval",AC),this.sendRequest=t}enqueue(t){this.queue.push(t),this.flushTimeout||this.setFlushTimeout()}unload(){this.clearFlushTimeout();var t=this.queue.length>0?this.formatQueue():{},n=Object.values(t),r=[...n.filter((i=>i.url.indexOf("/e")===0)),...n.filter((i=>i.url.indexOf("/e")!==0))];r.map((i=>{this.sendRequest(be(be({},i),{},{transport:"sendBeacon"}))}))}enable(){this.isPaused=!1,this.setFlushTimeout()}setFlushTimeout(){var t=this;this.isPaused||(this.flushTimeout=setTimeout((()=>{if(this.clearFlushTimeout(),this.queue.length>0){var n=this.formatQueue(),r=function(s){var o=n[s],a=new Date().getTime();o.data&&Wn(o.data)&&mn(o.data,(l=>{l.offset=Math.abs(l.timestamp-a),delete l.timestamp})),t.sendRequest(o)};for(var i in n)r(i)}}),this.flushTimeoutMs))}clearFlushTimeout(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}formatQueue(){var t={};return mn(this.queue,(n=>{var r,i=n,s=(i?i.batchKey:null)||i.url;Ve(t[s])&&(t[s]=be(be({},i),{},{data:[]})),(r=t[s].data)===null||r===void 0||r.push(i.data)})),this.queue=[],t}}var ble=["retriesPerformedSoFar"];class _le{constructor(t){Le(this,"isPolling",!1),Le(this,"pollIntervalMs",3e3),Le(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!Ve(ge)&&"onLine"in ge.
15navigator&&(this.areWeOnline=ge.navigator.onLine,tr(ge,"online",(()=>{this.areWeOnline=!0,this.flush()})),tr(ge,"offline",(()=>{this.areWeOnline=!1})))}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=V6(t,ble);pi(n)&&n>0&&(r.url=B0(r.url,{retry_count:n})),this.instance._send_request(be(be({},r),{},{callback:i=>{var s;i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(n??0)<10?this.enqueue(be({retriesPerformedSoFar:n},r)):(s=r.callback)===null||s===void 0||s.call(r,i)}}))}enqueue(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(o){var a=3e3*Math.pow(2,o),l=a/2,u=Math.min(18e5,a),f=(Math.random()-.5)*(u-l);return Math.ceil(u+f)})(n),i=Date.now()+r;this.queue.push({retryAt:i,requestOptions:t});var s="Enqueued failed request for retry in ".concat(r);navigator.onLine||(s+=" (Browser is offline)"),ct.warn(s),this.isPolling||(this.isPolling=!0,this.poll())}poll(){this.poller&&clearTimeout(this.poller),this.poller=setTimeout((()=>{this.areWeOnline&&this.queue.length>0&&this.flush(),this.poll()}),this.pollIntervalMs)}flush(){var t=Date.now(),n=[],r=this.queue.filter((s=>s.retryAt<t||(n.push(s),!1)));if(this.queue=n,r.length>0)for(var{requestOptions:i}of r)this.retriableRequest(i)}unload(){for(var{requestOptions:t}of(this.poller&&(clearTimeout(this.poller),this.poller=void 0),this.queue))try{this.instance._send_request(be(be({},t),{},{transport:"sendBeacon"}))}catch(n){ct.error(n)}this.queue=[]}}class wle{constructor(t){Le(this,"_updateScrollData",(()=>{var n,r,i,s;this.context||(this.context={});var o=this.scrollElement(),a=this.scrollY(),l=o?Math.max(0,o.scrollHeight-o.clientHeight):0,u=a+(o?.clientHeight||0),f=o?.scrollHeight||0;this.context.lastScrollY=Math.ceil(a),this.context.maxScrollY=Math.max(a,(n=this.context.maxScrollY)!==null&&n!==void 0?n:0),this.context.maxScrollHeight=Math.max(l,(r=this.context.maxScrollHeight)!==null&&r!==void 0?r:0),this.context.lastContentY=u,this.context.maxContentY=Math.max(u,(i=this.context.maxContentY)!==null&&i!==void 0?i:0),this.context.maxContentHeight=Math.max(f,(s=this.context.maxContentHeight)!==null&&s!==void 0?s:0)})),this.instance=t}getContext(){return this.context}resetContext(){var t=this.context;return setTimeout(this._updateScrollData,0),t}startMeasuringScrollPosition(){tr(ge,"scroll",this._updateScrollData,{capture:!0}),tr(ge,"scrollend",this._updateScrollData,{capture:!0}),tr(ge,"resize",this._updateScrollData)}scrollElement(){if(!this.instance.config.scroll_root_selector)return ge?.document.documentElement;var t=Wn(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector];for(var n of t){var r=ge?.document.querySelector(n);if(r)return r}}scrollY(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return ge&&(ge.scrollY||ge.pageYOffset||ge.document.documentElement.scrollTop)||0}scrollX(){if(this.instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return ge&&(ge.scrollX||ge.pageXOffset||ge.document.documentElement.scrollLeft)||0}}var xle=e=>On.personInfo({maskPersonalDataProperties:e?.config.mask_personal_data_properties,customPersonalDataProperties:e?.config.custom_personal_data_properties});class Sle{constructor(t,n,r,i){Le(this,"_onSessionIdCallback",(s=>{var o=this._getStored();if(!o||o.sessionId!==s){var a={sessionId:s,props:this._sessionSourceParamGenerator(this.instance)};this._persistence.register({[dC]:a})}})),this.instance=t,this._sessionIdManager=n,this._persistence=r,this._sessionSourceParamGenerator=i||xle,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}_getStored(){return this._persistence.props[dC]}getSetOnceProps(){var t,n=(t=this._getStored())===null||t===void 0?void 0:t.props;return n?"r"in n?On.personPropsFromInfo(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return mn(gm(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_".concat(oP(r))]=n})),t}}var RN=ei("[SessionId]");class Ele{constructor(t,n,r){var i;
15if(Le(this,"_sessionIdChangedHandlers",[]),!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.config=t.config,this.persistence=t.persistence,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||Nl,this._windowIdGenerator=r||Nl;var s=this.config.persistence_name||this.config.token,o=this.config.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Is(o,60,36e3,"session_idle_timeout_seconds",1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.resetIdleTimer(),this._window_id_storage_key="ph_"+s+"_window_id",this._primary_window_exists_storage_key="ph_"+s+"_primary_window_exists",this._canUseSessionStorage()){var a=Fr.parse(this._window_id_storage_key),l=Fr.parse(this._primary_window_exists_storage_key);a&&!l?this._windowId=a:Fr.remove(this._window_id_storage_key),Fr.set(this._primary_window_exists_storage_key,!0)}if((i=this.config.bootstrap)!==null&&i!==void 0&&i.sessionID)try{var u=(f=>{var d=f.replace(/-/g,"");if(d.length!==32)throw new Error("Not a valid UUID");if(d[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(d.substring(0,12),16)})(this.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,new Date().getTime(),u)}catch(f){RN.error("Invalid sessionID in bootstrap",f)}this._listenToReloadWindow()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ve(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(t),this._sessionId&&t(this._sessionId,this._windowId),()=>{this._sessionIdChangedHandlers=this._sessionIdChangedHandlers.filter((n=>n!==t))}}_canUseSessionStorage(){return this.config.persistence!=="memory"&&!this.persistence.disabled&&Fr.is_supported()}_setWindowId(t){t!==this._windowId&&(this._windowId=t,this._canUseSessionStorage()&&Fr.set(this._window_id_storage_key,t))}_getWindowId(){return this._windowId?this._windowId:this._canUseSessionStorage()?Fr.parse(this._window_id_storage_key):null}_setSessionId(t,n,r){t===this._sessionId&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this._sessionId=t,this.persistence.register({[D0]:[n,t,r]}))}_getSessionId(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var t=this.persistence.props[D0];return Wn(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this._setSessionId(null,null,null)}_listenToReloadWindow(){tr(ge,"beforeunload",(()=>{this._canUseSessionStorage()&&Fr.remove(this._primary_window_exists_storage_key)}),{capture:!1})}checkAndGetSessionAndWindowId(){var t=arguments.length>0&&arguments[0]!==void 0&&arguments[0],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.config.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var r=n||new Date().getTime(),[i,s,o]=this._getSessionId(),a=this._getWindowId(),l=pi(o)&&o>0&&Math.abs(r-o)>864e5,u=!1,f=!s,d=!t&&Math.abs(r-i)>this.sessionTimeoutMs;f||d||l?(s=this._sessionIdGenerator(),a=this._windowIdGenerator(),RN.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:f,activityTimeout:d,sessionPastMaximumLength:l}}),o=r,u=!0):a||(a=this._windowIdGenerator(),u=!0);var p=i===0||!t||l?r:i,m=o===0?new Date().getTime():o;return this._setWindowId(a),this._setSessionId(s,p,m),t||this.resetIdleTimer(),u&&this._sessionIdChangedHandlers.forEach((v=>v(s,a,u?{noSessionId:f,activityTimeout:d,sessionPastMaximumLength:l}:void 0))),{sessionId:s,windowId:a,sessionStartTimestamp:m,changeReason:u?{noSessionId:f,activityTimeout:d,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}resetIdleTimer(){clearTimeout(this._enforceIdleTimeout),this._enforceIdleTimeout=setTimeout((()=>{this.resetSessionId()}),1.1*this.sessionTimeoutMs)}}var Cle=["$set_once","$set"],bl=ei("[SiteApps]");class kle{constructor(t){this.instance=t,this.bufferedInvocations=[],this.apps={}}get isEnabled(){return!!this.instance.config.opt_in_site_apps}eventCollector(t,n){if(n){var r=this.globalsForEvent(n);this.bufferedInvocations.push(r),this.bufferedInvocations.length>1e3&&(this.bufferedInvocations=this.bufferedInvocations.slice(10))}}get siteAppLoaders(){var t,n;return(t=Dt._POSTHOG_REMOTE_CONFIG)===null||t===void 0||(n=t[this.instance.config.token])===null||n===void 0?void 0:n.siteApps}init(){if(this.isEnabled){var t=this.instance._addCaptureHook(this.eventCollector.bind(this));this.stopBuffering=()=>{t(),this.bufferedInvocations=[],this.stopBuffering=void 0}}}globalsForEvent(t){var n,r,i,s,o,a,l;if(!t)throw new Error("Event payload is required");var u={},f=this.instance.get_property("$groups")||[],d=this.instance.get_property("$stored_group_properties")||{};for(var[p,m]of Object.entries(d))u[p]={id:f[p],type:p,properties:m};var{$set_once:v,$set:_}=t;return{event:be(be({},V6(t,Cle)),{},{properties:be(be(be({},t.properties),_?{$set:be(be({},(n=(r=t.properties)===null||r===void 0?void 0:r.$set)!==null&&n!==void 0?n:{}),_)}:{}),v?{$set_once:be(be({},(i=(s=t.properties)===null||s===void 0?void 0:s.$set_once)!==null&&i!==void 0?i:{}),v)}:{}),elements_chain:(o=(a=t.properties)===null||a===void 0?void 0:a.$elements_chain)!==null&&o!==void 0?o:"",distinct_id:(l=t.properties)===null||l===void 0?void 0:l.distinct_id}),person:{properties:this.instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(t){var n=this.apps[t.id],r=()=>{var a;!n.errored&&this.bufferedInvocations.length&&(bl.info("Processing ".concat(this.bufferedInvocations.length," events for site app with id ").concat(t.id)),this.bufferedInvocations.forEach((l=>{var u;return(u=n.processEvent)===null||u===void 0?void 0:u.call(n,l)})),n.processedBuffer=!0),Object.values(this.apps).every((l=>l.processedBuffer||l.errored))&&((a=this.stopBuffering)===null||a===void 0||a.call(this))},i=!1,s=a=>{n.errored=!a,n.loaded=!0,bl.info("Site app with id ".concat(t.id," ").concat(a?"loaded":"errored")),i&&r()};try{var{processEvent:o}=t.init({posthog:this.instance,callback:a=>{s(a)}});o&&(n.processEvent=o),i=!0}catch(a){bl.error("Error while initializing PostHog app with config id ".concat(t.id),a),s(!1)}if(i&&n.loaded)try{r()}catch(a){bl.error("Error while processing buffered events PostHog app with config id ".concat(t.id),a),n.errored=!0}}setupSiteApps(){var t=this.siteAppLoaders||[];for(var n of t)this.apps[n.id]={id:n.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}onCapturedEvent(t){if(Object.keys(this.apps).length!==0){var n=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{var i;(i=r.processEvent)===null||i===void 0||i.call(r,n)}catch(s){bl.error("Error while processing event ".concat(t.event," for site app ").concat(r.id),s)}}}onRemoteConfig(t){var n,r,i,s=this;if((n=this.siteAppLoaders)!==null&&n!==void 0&&n.length)return this.isEnabled?(this.setupSiteApps(),void this.instance.on("eventCaptured",(u=>this.onCapturedEvent(u)))):void bl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.stopBuffering)===null||r===void 0||r.call(this),(i=t.siteApps)!==null&&i!==void 0&&i.length)if(this.isEnabled){var o=function(u,f){var d,p;Dt["__$$ph_site_app_".concat(u)]=s.instance,(d=Dt.__PosthogExtensions__)===null||d===void 0||(p=d.loadSiteApp)===null||p===void 0||p.call(d,s.instance,f,(m=>{if(m)return bl.error("Error while initializing PostHog app with config id ".concat(u),m)}))};for(var{id:a,url:l}of t.siteApps)o(a,l)}else bl.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var nc,Tle=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
15spot","ia_archiver","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","bytespider"],IN=function(e,t){if(!e)return!1;var n=e.toLowerCase();return Tle.concat(t||[]).some((r=>{var i=r.toLowerCase();return n.indexOf(i)!==-1}))},U9=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&IN(n,t))return!0;try{var r=e?.userAgentData;if(r!=null&&r.brands&&r.brands.some((i=>IN(i?.brand,t))))return!0}catch{}return!!e.webdriver};function B1(e,t,n){return Pp({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}(function(e){e.US="us",e.EU="eu",e.CUSTOM="custom"})(nc||(nc={}));var ON="i.posthog.com";class Ple{constructor(t){Le(this,"_regionCache",{}),this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get uiHost(){var t,n=(t=this.instance.config.ui_host)===null||t===void 0?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace(".".concat(ON),".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=nc.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=nc.EU:this._regionCache[this.apiHost]=nc.CUSTOM),this._regionCache[this.apiHost]}endpointFor(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(n&&(n=n[0]==="/"?n:"/".concat(n)),t==="ui")return this.uiHost+n;if(this.region===nc.CUSTOM)return this.apiHost+n;var r=ON+n;switch(t){case"assets":return"https://".concat(this.region,"-assets.").concat(r);case"api":return"https://".concat(this.region,".").concat(r)}}}var Rle={icontains:(e,t)=>!!ge&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!ge&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!ge&&Af(t.href,e),not_regex:(e,t)=>!!ge&&!Af(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Kr{constructor(t){var n=this;Le(this,"getWebExperimentsAndEvaluateDisplayLogic",(function(){var r=arguments.length>0&&arguments[0]!==void 0&&arguments[0];n.getWebExperiments((i=>{Kr.logInfo("retrieved web experiments from the server"),n._flagToExperiments=new Map,i.forEach((s=>{if(s.feature_flag_key){var o;n._flagToExperiments&&(Kr.logInfo("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=n._flagToExperiments)===null||o===void 0||o.set(s.feature_flag_key,s));var a=n.instance.getFeatureFlag(s.feature_flag_key);fr(a)&&s.variants[a]&&n.applyTransforms(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var l in s.variants){var u=s.variants[l];Kr.matchesTestVariant(u)&&n.applyTransforms(s.name,l,u.transforms)}}))}),r)})),this.instance=t,this.instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(t){if(this._is_bot())Kr.logInfo("Refusing to render web experiment since the viewer is a likely bot");else if(!this.instance.config.disable_web_experiments){if(dn(this._flagToExperiments))return this._flagToExperiments=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Kr.logInfo("applying feature flags",t),t.forEach((n=>{var r;if(this._flagToExperiments&&(r=this._flagToExperiments)!==null&&r!==void 0&&r.has(n)){var i,s=this.instance.getFeatureFlag(n),o=(i=this._flagToExperiments)===null||i===void 0?void 0:i.get(n);s&&o!=null&&o.variants[s]&&this.applyTransforms(o.name,s,o.variants[s].transforms)}}))}}
15previewWebExperiment(){var t=Kr.getWindowLocation();if(t!=null&&t.search){var n=j0(t?.search,"__experiment_id"),r=j0(t?.search,"__experiment_variant");n&&r&&(Kr.logInfo("previewing web experiments ".concat(n," && ").concat(r)),this.getWebExperiments((i=>{this.showPreviewWebExperiment(parseInt(n),r,i)}),!1,!0))}}loadIfEnabled(){this.instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this.instance.config.disable_web_experiments&&!r)return t([]);var i=this.instance.get_property("$web_experiments");if(i&&!n)return t(i);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/web_experiments/?token=".concat(this.instance.config.token)),method:"GET",callback:s=>{if(s.statusCode!==200||!s.json)return t([]);var o=s.json.experiments||[];return t(o)}})}showPreviewWebExperiment(t,n,r){var i=r.filter((s=>s.id===t));i&&i.length>0&&(Kr.logInfo("Previewing web experiment [".concat(i[0].name,"] with variant [").concat(n,"]")),this.applyTransforms(i[0].name,n,i[0].variants[n].transforms))}static matchesTestVariant(t){return!dn(t.conditions)&&Kr.matchUrlConditions(t)&&Kr.matchUTMConditions(t)}static matchUrlConditions(t){var n;if(dn(t.conditions)||dn((n=t.conditions)===null||n===void 0?void 0:n.url))return!0;var r,i,s,o=Kr.getWindowLocation();return!!o&&((r=t.conditions)===null||r===void 0||!r.url||Rle[(i=(s=t.conditions)===null||s===void 0?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](t.conditions.url,o))}
15static getWindowLocation(){return ge?.location}static matchUTMConditions(t){var n;if(dn(t.conditions)||dn((n=t.conditions)===null||n===void 0?void 0:n.utm))return!0;var r=On.campaignParams();if(r.utm_source){var i,s,o,a,l,u,f,d,p,m,v,_,w,x,S,C,R=(i=t.conditions)===null||i===void 0||(s=i.utm)===null||s===void 0||!s.utm_campaign||((o=t.conditions)===null||o===void 0||(a=o.utm)===null||a===void 0?void 0:a.utm_campaign)==r.utm_campaign,P=(l=t.conditions)===null||l===void 0||(u=l.utm)===null||u===void 0||!u.utm_source||((f=t.conditions)===null||f===void 0||(d=f.utm)===null||d===void 0?void 0:d.utm_source)==r.utm_source,k=(p=t.conditions)===null||p===void 0||(m=p.utm)===null||m===void 0||!m.utm_medium||((v=t.conditions)===null||v===void 0||(_=v.utm)===null||_===void 0?void 0:_.utm_medium)==r.utm_medium,I=(w=t.conditions)===null||w===void 0||(x=w.utm)===null||x===void 0||!x.utm_term||((S=t.conditions)===null||S===void 0||(C=S.utm)===null||C===void 0?void 0:C.utm_term)==r.utm_term;return R&&k&&I&&P}return!1}static logInfo(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];ct.info("[WebExperiments] ".concat(t),r)}applyTransforms(t,n,r){this._is_bot()?Kr.logInfo("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((i=>{if(i.selector){var s;Kr.logInfo("applying transform of variant ".concat(n," for experiment ").concat(t," "),i);var o=(s=document)===null||s===void 0?void 0:s.querySelectorAll(i.selector);o?.forEach((a=>{var l=a;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):Kr.logInfo("Control variants leave the page unmodified.")}_is_bot(){return Xi&&this.instance?U9(Xi,this.instance.config.custom_blocked_useragents):void 0}}var Kp={},MC=()=>{},$d="posthog",B9=!vle&&ur?.indexOf("MSIE")===-1&&ur?.indexOf("Mozilla")===-1,DN=()=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:Moe(Ke?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:MC,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:Es&&fr(Es?.search)&&Es.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(ge==null||(e=ge.location)===null||e===void 0?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var n="Bad HTTP status: "+t.statusCode+" "+t.text;ct.error(n)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:AC},_onCapture:MC}},AN=e=>{var t={};Ve(e.process_person)||(t.person_profiles=e.process_person),Ve(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ve(e.cookie_name)||(t.persistence_name=e.cookie_name),Ve(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ve(e.store_google)||(t.save_campaign_params=e.store_google),Ve(e.verbose)||(t.debug=e.verbose);var n=dr({},t,e);return Wn(e.property_blacklist)&&(Ve(e.property_denylist)?n.property_denylist=e.property_blacklist:Wn(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ct.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Ile{constructor(){Le(this,"__forceAllowLocalhost",!1)}get _forceAllowLocalhost(){return this.__forceAllowLocalhost}set _forceAllowLocalhost(t){ct.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class c_{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)===null||n===void 0?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){Le(this,"webPerformance",new Ile),Le(this,"_personProcessingSetOncePropertiesSent",!1),Le(this,"version",Pa.LIB_VERSION),Le(this,"_internalEventEmitter",new V9),this.config=DN(),this.SentryIntegration=Fae,this.sentryIntegration=t=>(function(n,r){var i=m9(n,r);return{name:p9,processEvent:s=>i(s)}})(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this._initialPersonProfilesConfig=null,this._cachedIdentify=null,this.featureFlags=new sle(this),this.toolbar=ne
15w zae(this),this.scrollManager=new wle(this),this.pageViewManager=new Wae(this),this.surveys=new hle(this),this.experiments=new Kr(this),this.exceptions=new Gae(this),this.rateLimiter=new ple(this),this.requestRouter=new Ple(this),this.consent=new rae(this),this.people={set:(t,n,r)=>{var i=fr(t)?{[t]:n}:t;this.setPersonProperties(i),r?.({})},set_once:(t,n,r)=>{var i=fr(t)?{[t]:n}:t;this.setPersonProperties(void 0,i),r?.({})}},this.on("eventCaptured",(t=>ct.info('send "'.concat(t?.event,'"'),t)))}init(t,n,r){if(r&&r!==$d){var i,s=(i=Kp[r])!==null&&i!==void 0?i:new c_;return s._init(t,n,r),Kp[r]=s,Kp[$d][r]=s,s}return this._init(t,n,r)}_init(t){var n,r,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(Ve(t)||oC(t))return ct.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return ct.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this._triggered_notifs=[],i.person_profiles&&(this._initialPersonProfilesConfig=i.person_profiles),this.set_config(dr({},DN(),AN(i),{name:s,token:t})),this.config.on_xhr_error&&ct.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:ro.GZipJS,this.persistence=new z1(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new z1(be(be({},this.config),{},{persistence:"sessionStorage"}));var o=be({},this.persistence.props),a=be({},this.sessionPersistence.props);if(this._requestQueue=new yle((x=>this._send_retriable_request(x)),this.config.request_queue_config),this._retryQueue=new _le(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new Ele(this),this.sessionPropsManager=new Sle(this,this.sessionManager,this.persistence)),new Uae(this).startIfEnabledOrStop(),this.siteApps=new kle(this),(n=this.siteApps)===null||n===void 0||n.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new jae(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Koe(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new qae(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Bae(this),this.exceptionObserver=new oae(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new i9(this,sae),this.deadClicksAutocapture.startIfEnabled(),Pa.DEBUG=Pa.DEBUG||this.config.debug,Pa.DEBUG&&ct.info("Starting in debug mode",{this:this,config:i,thisC:be({},this.config),p:o,s:a}),this._sync_opt_out_with_persistence(),((r=i.bootstrap)===null||r===void 0?void 0:r.distinctID)!==void 0){var l,u,f=this.config.get_device_id(Nl()),d=(l=i.bootstrap)!==null&&l!==void 0&&l.isIdentifiedID?f:i.bootstrap.distinctID;this.persistence.set_property(Ea,(u=i.bootstrap)!==null&&u!==void 0&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.bootstrap.distinctID,$device_id:d})}if(this._hasBootstrappedFeatureFlags()){var p,m,v=Object.keys(((p=i.bootstrap)===null||p===void 0?void 0:p.featureFlags)||{}).filter((x=>{var S,C;return!((S=i.bootstrap)===null||S===void 0||(C=S.featureFlags)===null||C===void 0||!C[x])})).reduce(((x,S)=>{var C,R;return x[S]=((C=i.bootstrap)===null||C===void 0||(R=C.featureFlags)===null||R===void 0?void 0:R[S])||!1,x}),{}),_=Object.keys(((m=i.bootstrap)===null||m===void 0?void 0:m.featureFlagPayloads)||{}).filter((x=>v[x])).reduce(((x,S)=>{var C,R,P,k;return(C=i.bootstrap)!==null&&C!==void 0&&(R=C.featureFlagPayloads)!==null&&R!==void 0&&R[S]&&(x[S]=(P=i.bootstrap)===null||P===void 0||(k=P.featureFlagPayloads)===null||k===void 0?void 0:k[S]),x}),{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:_})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:zM,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(Nl());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(Ea,"anonymous")}return tr(ge,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),i.segment?Lae(this,(()=>this._loaded())):this._loaded(),oo(this.config._onCapture)&&this.config._onCapture!==MC&&(ct.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(x=>this.config._onCapture(x.event,x)))),this}_onRemoteConfig(t){var n,r,i,s,o,a,l,u;if(!Ke||!Ke.body)return ct.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this._onRemoteConfig(t)}),500);this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=Ut(t.supp
15ortedCompression,ro.GZipJS)?ro.GZipJS:Ut(t.supportedCompression,ro.Base64)?ro.Base64:void 0),(n=t.analytics)!==null&&n!==void 0&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this._initialPersonProfilesConfig?this._initialPersonProfilesConfig:"identified_only"}),(r=this.siteApps)===null||r===void 0||r.onRemoteConfig(t),(i=this.sessionRecording)===null||i===void 0||i.onRemoteConfig(t),(s=this.autocapture)===null||s===void 0||s.onRemoteConfig(t),(o=this.heatmaps)===null||o===void 0||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),(a=this.webVitalsAutocapture)===null||a===void 0||a.onRemoteConfig(t),(l=this.exceptionObserver)===null||l===void 0||l.onRemoteConfig(t),(u=this.deadClicksAutocapture)===null||u===void 0||u.onRemoteConfig(t)}_loaded(){try{this.config.loaded(this)}catch(t){ct.critical("`loaded` function failed",t)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout((()=>{this.consent.isOptedIn()&&this._captureInitialPageview()}),1),new mle(this).load(),this.featureFlags.decide()}_start_queue_if_opted_in(){var t;this.has_opted_out_capturing()||this.config.request_batching&&((t=this._requestQueue)===null||t===void 0||t.enable())}_dom_loaded(){this.has_opted_out_capturing()||$l(this.__request_queue,(t=>this._send_retriable_request(t))),this.__request_queue=[],this._start_queue_if_opted_in()}_handle_unload(){var t,n;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),(t=this._requestQueue)===null||t===void 0||t.unload(),(n=this._retryQueue)===null||n===void 0||n.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(B9?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=B0(t.url,{ip:this.config.ip?1:0}),t.headers=be({},this.config.request_headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,i,s,o=be({},n);o.timeout=o.timeout||6e4,o.url=B0(o.url,{_:new Date().getTime().toString(),ver:Pa.LIB_VERSION,compression:o.compression});var a=(r=o.transport)!==null&&r!==void 0?r:"fetch",l=(i=(s=U6(Gp,(u=>u.transport===a)))===null||s===void 0?void 0:s.method)!==null&&i!==void 0?i:Gp[0].method;if(!l)throw new Error("No available transport method");l(o)})(be(be({},t),{},{callback:n=>{var r,i,s;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((i=(s=this.config).on_request_error)===null||i===void 0||i.call(s,n)),(r=t.callback)===null||r===void 0||r.call(t,n)}}))))}_send_retriable_request(t){this._retryQueue?this._retryQueue.retriableRequest(t):this._send_request(t)}_execute_array(t){var n,r=[],i=[],s=[];$l(t,(a=>{a&&(n=a[0],Wn(n)?s.push(a):oo(a)?a.call(this):Wn(a)&&n==="alias"?r.push(a):Wn(a)&&n.indexOf("capture")!==-1&&oo(this[n])?s.push(a):i.push(a))}));var o=function(a,l){$l(a,(function(u){if(Wn(u[0])){var f=l;mn(u,(function(d){f=f[d[0]].apply(f,d.slice(1))}))}else this[u[0]].apply(this,u.slice(1))}),l)};o(r,this),o(i,this),o(s,this)}_hasBootstrappedFeatureFlags(){var t,n;return((t=this.config.bootstrap)===null||t===void 0?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)===null||n===void 0?void 0:n.featureFlags).length>0||!1}push(t){this._execute_array([t])}capture(t,n,r){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut())if(!Ve(t)&&fr(t)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(s==null||!s.isRateLimited){n!=null&&n.$current_url&&!fr(n?.$current_url)&&(ct.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,a=r?.timestamp||o,l=Nl(),u={uuid:l,event:t,properties:this._calculate_event_properties(t,n||{},a,l)};s&&(u.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),r?.$set&&(u.$set=r?.$set);var f=this._calculate_set_once_properties(r?.$set_once);f&&(u.$set_once=f),(u=Doe(u,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=a,Ve(r?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o);var d=be(be({},u.properties.$set),u.$set);if(Jd(d)||this.setPersonPropertiesForFlags(d),!dn(this.config.before_send)){var p=this._runBeforeSend(u);if(!p)return;u=p}this._internalEventEmitter.emit("eventCaptured",u);var m={method:"POST",url:(i=r?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:r?._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this._send_retriable_request(m):this._requestQueue.enqueue(m),u}ct.critical("This capture call is ignored due to client rate limiting.")}}else ct.error("No event name provided to posthog.capture")}else ct.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}_calculate_event_properties(t,n,r,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var s=this.persistence.remove_event_timer(t),o=be({},n);if(o.token=this.config.token,this.config.__preview_experimental_cookieless_mode&&(o.$cookieless_mode=!0),t==="$snapshot"){var a=be(be({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=a.distinct_id,(!fr(o.distinct_id)&&!pi(o.distinct_id)||oC(o.distinct_id))&&ct.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var l,u=On.properties({maskPersonalDataProperties:this.config.mask_personal_data_properties,customPersonalDataProperties:this.config.custom_personal_data_properties});if(this.sessionManager){var{sessionId:f,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId();o.$session_id=f,o.$window_id=d}this.sessionPropsManager&&dr(o,this.sessionPropsManager.getSessionProps());try{var p,m;this.sessionRecording&&(o.$recording_status=this.sessionRecording.status,o.$sdk_debug_replay_internal_buffer_length=this.sessionRecording.buffer.data.length,o.$sdk_debug_replay_internal_buffer_size=this.sessionRecording.buffer.size),o.$sdk_debug_retry_queue_size=(p=this._retryQueue)===null||p===void 0||(m=p.queue)===null||m===void 0?void 0:m.length}catch(x){o.$sdk_debug_error_capturing_properties=String(x)}if(this.requestRouter.region===nc.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),l=t==="$pageview"?this.pageViewM
15anager.doPageView(r,i):t==="$pageleave"?this.pageViewManager.doPageLeave(r):this.pageViewManager.doEvent(),o=dr(o,l),t==="$pageview"&&Ke&&(o.title=Ke.title),!Ve(s)){var v=r.getTime()-s;o.$duration=parseFloat((v/1e3).toFixed(3))}ur&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=dr({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Wn(this.config.property_denylist)?mn(this.config.property_denylist,(function(x){delete o[x]})):ct.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(ct.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,t));var w=this._hasPersonProcessing();return o.$process_person_profile=w,w&&this._requirePersonProcessing("_calculate_event_properties"),o}_calculate_set_once_properties(t){var n;if(!this.persistence||!this._hasPersonProcessing()||this._personProcessingSetOncePropertiesSent)return t;var r=this.persistence.get_initial_props(),i=(n=this.sessionPropsManager)===null||n===void 0?void 0:n.getSetOnceProps(),s=dr({},r,i||{},t||{}),o=this.config.sanitize_properties;return o&&(ct.error("sanitize_properties is deprecated. Use before_send instead"),s=o(s,"$set_once")),this._personProcessingSetOncePropertiesSent=!0,Jd(s)?void 0:s}register(t,n){var r;(r=this.persistence)===null||r===void 0||r.register(t,n)}register_once(t,n,r){var i;(i=this.persistence)===null||i===void 0||i.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.register(t)}unregister(t){var n;(n=this.persistence)===null||n===void 0||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)===null||n===void 0||n.unregister(t)}_register_single(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){var n=this.featureFlags.getFeatureFlagPayload(t);try{return JSON.parse(n)}catch{return n}}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(t,n){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n)}getEarlyAccessFeatures(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1],r=arguments.length>2?arguments[2]:void 0;return this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this._internalEventEmitter.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)===null||r===void 0?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t){var n=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}canRenderSurvey(t){this.surveys.canRenderSurvey(t)}identify(t,n,r){if(!this.__loaded||!this.persistence)return ct.uninitializedWarning("posthog.identify");if(pi(t)&&(t=t.toString(),ct.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t){if(["distinct_id","distinctid"].includes(t.toLowerCase()))ct.critical('The string "'.concat(t,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var s=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:s},"")}t!==i&&t!==this.get_property(xp)&&(this.unregister(xp),this.register({distinct_id:t}));var o=(this.persistence.get_property(Ea)||"anonymous")==="anonymous";t!==i&&o?(this.persistence.set_property(Ea,"identified"),this.setPersonPropertiesForFlags(be(be({},r||{}),n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:i},{$set:n||{},$set_once:r||{}}),this.featureFlags.setAnonymousDistinctId(i),this._cachedIdentify=B1(t,n,r)):(n||r)&&(this._cachedIdentify!==B1(t,n,r)?(this.setPersonProperties(n,r),this._cachedIdentify=B1(t,n,r)):ct.info("A duplicate posthog.identify call was made with the same properties. It has been ignored.")),t!==i&&(this.reloadFeatureFlags(),this.unregister(A0))}}else ct.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){(t||n)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(be(be({},n||{}),t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}))}group(t,n,r){if(t&&n){if(this._requirePersonProcessing("posthog.group")){var i=this.getGroups();i[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:be(be({},i),{},{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),i[t]===n||r||this.reloadFeatureFlags()}}else ct.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t){var n=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,i,s;if(ct.info("reset"),!this.__loaded)return ct.uninitializedWarning("posthog.reset");var o=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)===null||n===void 0||n.clear(),(r=this.sessionPersistence)===null||r===void 0||r.clear(),this.surveys.reset(),(i=this.persistence)===null||i===void 0||i.set_property(Ea,"anonymous"),(s=this.sessionManager)===null||s===void 0||s.resetSessionId(),this._cachedIdentify=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:zM,$device_id:null},"");else{var a=this.config.get_device_id(Nl());this.register_once({distinct_id:a,$device_id:t?a:o},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,n;return(t=(n=this.sessionManager)===null||n===void 0?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(t!=null&&t.withTimestamp&&r){var s,o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!r)return i;var a=Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0);i+="?t=".concat(a)}return i}alias(t,n){return t===this.get_property(B6)?(ct.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(Ve(n)&&(n=this.get_distinct_id()),t!==n?(this._register_single(xp,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(ct.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n,r,i,s,o=be({},this.config);Gn(t)&&(dr(this.config,AN(t)),(n=this.persistence)===null||n===void 0||n.update_config(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new z1(be(be({},this.config),{},{persistence:"sessionStorage"})),xr.is_supported()&&xr.get("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(Pa.DEBUG=!0,ct.info("set_config",JSON.stringify({config:t,oldConfig:o,newConfig:be({},this.config)},null,2))),(r=this.sessionRecording)===null||r===void 0||r.startIfEnabledOrStop(),(i=this.autocapture)===null||i===void 0||i.startIfEnabled(),(s=this.heatmaps)===null||s===void 0||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}
15startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var i,s,o,a,l;(i=this.sessionManager)===null||i===void 0||i.checkAndGetSessionAndWindowId(),r.sampling&&((s=this.sessionRecording)===null||s===void 0||s.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)===null||o===void 0||o.overrideLinkedFlag()),r.url_trigger&&((a=this.sessionRecording)===null||a===void 0||a.overrideTrigger("url")),r.event_trigger&&((l=this.sessionRecording)===null||l===void 0||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)===null||t===void 0||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(be(be({},yae((i=>i instanceof Error)(t)?{error:t,event:t.message}:{event:t},{syntheticException:r})),n))}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)===null||n===void 0?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)===null||n===void 0?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:$d;return n!==$d&&(n=$d+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)===null||t===void 0?void 0:t.get_property(Ea))==="identified"||((n=this.sessionPersistence)===null||n===void 0?void 0:n.get_property(Ea))==="identified"}_hasPersonProcessing(){var t,n,r,i;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Jd(this.getGroups())&&((t=this.persistence)===null||t===void 0||(n=t.props)===null||n===void 0||!n[xp])&&((r=this.persistence)===null||r===void 0||(i=r.props)===null||i===void 0||!i[M0]))}_shouldCapturePageleave(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&this.config.capture_pageview}createPersonProfile(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}_requirePersonProcessing(t){return this.config.person_profiles==="never"?(ct.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(M0,!0),!0)}_sync_opt_out_with_persistence(){var t,n,r,i,s=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,a=this.config.disable_persistence||s&&!!o;((t=this.persistence)===null||t===void 0?void 0:t.disabled)!==a&&((r=this.persistence)===null||r===void 0||r.set_disabled(a)),((n=this.sessionPersistence)===null||n===void 0?void 0:n.disabled)!==a&&((i=this.sessionPersistence)===null||i===void 0||i.set_disabled(a))}opt_in_capturing(t){var n;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(Ve(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((n=t?.captureEventName)!==null&&n!==void 0?n:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._captureInitialPageview()}opt_out_capturing(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this._sync_opt_out_with_persistence()}_is_bot(){return Xi?U9(Xi,this.config.custom_blocked_useragents):void 0}_captureInitialPageview(){Ke&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:Ke.title},{send_instantly:!0}))}debug(t){t===!1?(ge?.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(ge?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}_runBeforeSend(t){if(dn(this.config.before_send))return t;var n=Wn(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var i of n){if(r=i(r),dn(r)){var s="Event '".concat(t.event,"' was rejected in beforeSend function");return Roe(t.event)?ct.warn("".concat(s,". This can cause unexpected behavior.")):ct.info(s),null}r.properties&&!Jd(r.properties)||ct.warn("Event '".concat(t.event,"' has no properties after beforeSend function, this is likely an error."))}return r}getPageViewId(){var t;
15return(t=this.pageViewManager._currentPageview)===null||t===void 0?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}}(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Ooe(e.prototype[t[n]])})(c_,["identify"]);var MN,Ra=(MN=Kp[$d]=new c_,(function(){function e(){e.done||(e.done=!0,B9=!1,mn(Kp,(function(t){t._dom_loaded()})))}Ke!=null&&Ke.addEventListener?Ke.readyState==="complete"?e():tr(Ke,"DOMContentLoaded",e,{capture:!1}):ge&&ct.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),MN),H9=b.createContext({client:Ra});function q9(e,t,n){if(n===void 0&&(n=new WeakMap),e===t)return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(n.has(e)&&n.get(e)===t)return!0;n.set(e,t);var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(var s=0,o=r;s<o.length;s++){var a=o[s];if(!i.includes(a)||!q9(e[a],t[a],n))return!1}return!0}function Ole(e){var t=e.children,n=e.client,r=e.apiKey,i=e.options,s=b.useState(!1),o=s[0],a=s[1],l=b.useMemo(function(){return n?(r&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),i&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n):r?o!==!1?(r!==o.previousAPIKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),i&&!q9(i,o.previousOptions)&&Ra.set_config(i),a({previousAPIKey:r,previousOptions:i??{}}),Ra):(Ra.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),Ra.init(r,i),a({previousAPIKey:r,previousOptions:i??{}}),Ra):(console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),Ra)},[n,r,JSON.stringify(i)]);return ve.createElement(H9.Provider,{value:{client:l}},t)}var Dle=function(){var e=b.useContext(H9).client;return e};const Ale=()=>!0;function Mle({children:e}){return b.useEffect(()=>{Ra.init("phc_lSFMpjp0hun7tYOf877qMzlXQVCS8psflN0O9PJ8ttc",{api_host:"/ingest",ui_host:"https://us.posthog.com",capture_pageview:!1,capture_pageleave:!0})},[]),g.jsx(Ole,{client:Ra,children:e})}function Nle(){return g.jsx(b.Suspense,{fallback:null,children:g.jsx(jle,{})})}function jle(){const t=Qn().pathname,[n]=Jm(),r=Dle();return b.useEffect(()=>{if(t&&r&&Ale()){let i=window.origin+t;const s=n.toString();s&&(i+="?"+s),r.capture("$pageview",{$current_url:i})}},[t,n,r]),null}function Lle(e={}){const{nonce:t,onScriptLoadSuccess:n,onScriptLoadError:r}=e,[i,s]=b.useState(!1),o=b.useRef(n);o.current=n;const a=b.useRef(r);return a.current=r,b.useEffect(()=>{const l=document.createElement("script");return l.src="https://accounts.google.com/gsi/client",l.async=!0,l.defer=!0,l.nonce=t,l.onload=()=>{var u;s(!0),(u=o.current)===null||u===void 0||u.call(o)},l.onerror=()=>{var u;s(!1),(u=a.current)===null||u===void 0||u.call(a)},document.body.appendChild(l),()=>{document.body.removeChild(l)}},[t]),i}const Fle=b.createContext(null);function $le({clientId:e,nonce:t,onScriptLoadSuccess:n,onScriptLoadError:r,children:i}){const s=Lle({nonce:t,onScriptLoadSuccess:n,onScriptLoadError:r}),o=b.useMemo(()=>({clientId:e,scriptLoadedSuccessfully:s}),[e,s]);return ve.createElement(Fle.Provider,{value:o},i)}const NN={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_URL:"https://api.mentes.ai",VITE_GOOGLE_CLIENT_ID:"265396989594-2naqejd1dvrs5scqpb0lovrv76hokbpc.apps.googleusercontent.com",VITE_POSTHOG_KEY:"phc_lSFMpjp0hun7tYOf877qMzlXQVCS8psflN0O9PJ8ttc",VITE_VERCEL_BRANCH_URL:"mentes-web-git-main-sri-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_6Nku8QhbuksrSKVMMn6rk1NLkw8W",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"ramsrib",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Sri",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Task Management block: prettier-stable layout (same content)
16
17Regenerated from mentes-ai agents-md/task-management.md (143f8cb) so formatters that rewrite markdown leave it unchanged.`,VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"7228e21f233378493dded6d8c304cf4936d49640",V
17ITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"749277532",VITE_VERCEL_GIT_REPO_OWNER:"ramsrib",VITE_VERCEL_GIT_REPO_SLUG:"mentes-web",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"73c92d25b065f873/script.js","viewEndpoint":"73c92d25b065f873/view","eventEndpoint":"73c92d25b065f873/event","sessionEndpoint":"73c92d25b065f873/session"},"speedInsights":{"scriptSrc":"56005d7377100aec/script.js","endpoint":"56005d7377100aec/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_CZo8r6cAAR4BJMe23gPR6qzVQ6oL",VITE_VERCEL_PROJECT_PRODUCTION_URL:"app.mentes.ai",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"mentes-1i8zm4ap9-sri-projects.vercel.app"},yP=(e,t="")=>typeof import.meta<"u"&&NN&&NN[e]||t,Ha=`${yP("VITE_BACKEND_URL","http://localhost:8000")}/api/v1`,W9=yP("VITE_GOOGLE_CLIENT_ID",""),G9=yP("VITE_JENA_READER_API_URL","https://r.jina.ai"),zle=!1,K9={API_URL:Ha,GOOGLE_CLIENT_ID:W9,JENA_READER_API_URL:G9,IS_DEV:zle};class Rp extends Error{}Rp.prototype.name="InvalidTokenError";function Vle(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function Ule(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Vle(t)}catch{return atob(t)}}function Z9(e,t){if(typeof e!="string")throw new Rp("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new Rp(`Invalid token specified: missing part #${n+1}`);let i;try{i=Ule(r)}catch(s){throw new Rp(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new Rp(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}const xm="auth_session",bP="token",_P="refresh_token",wP="token_type",xP="token_expires_at",H0="auth_session_generation";function SP(e){if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||!Number.isFinite(t.generation)||Number(t.generation)<0?null:{generation:Number(t.generation),credentials:t.credentials&&typeof t.credentials=="object"?t.credentials:void 0}}catch{return null}}function EP(){localStorage.removeItem(bP),localStorage.removeItem(_P),localStorage.removeItem(wP),localStorage.removeItem(xP),localStorage.removeItem(H0)}function Ble(){return[bP,_P,wP,xP,H0].some(e=>localStorage.getItem(e)!==null)}function Y9(e){document.cookie=e?`token=${e}; path=/;`:"token=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT"}function zd(e){localStorage.setItem(xm,JSON.stringify(e)),EP(),Y9(e.credentials?.accessToken)}function Sa(){const e=SP(localStorage.getItem(xm));if(e)return Ble()&&EP(),e;const t=Number(localStorage.getItem(H0)),n=Number.isFinite(t)?t:0,r=localStorage.getItem(bP)||void 0,i=localStorage.getItem(_P)||void 0,s=localStorage.getItem(wP)||void 0,o=localStorage.getItem(xP),a=Number(o),l=o!==null&&Number.isFinite(a)?a:void 0,u={generation:n,credentials:r||i?{accessToken:r,refreshToken:i,tokenType:s,accessTokenExpiresAt:l}:void 0};return(localStorage.getItem(H0)!==null||u.credentials)&&zd(u),u}function jN(e,t){const n=JSON.stringify(e),r=e.credentials?.accessToken;return Sa().generation!==t||(SP(localStorage.getItem(xm))?.generation??0)!==t?!1:(localStorage.setItem(xm,n),EP(),Y9(r),!0)}const pn={getSessionSnapshot:()=>Sa(),getSessionGeneration:()=>Sa().generation,getTokens:()=>Sa().credentials??{},getToken:()=>Sa().credentials?.accessToken??null,getRefreshToken:()=>Sa().credentials?.refreshToken??null,saveToken:(e,t)=>{zd({generation:t,credentials:{accessToken:e}})},saveTokenPair:(e,t)=>{zd({generation:t,credentials:{accessToken:e.access_token,refreshToken:e.refresh_token,tokenType:e.token_type,accessTokenExpiresAt:Date.now()+e.expires_in*1e3}})},saveTokenIfGeneration:(e,t,n)=>jN({generation:t,credentials:{accessToken:e}},n),saveTokenPairIfGeneration:(e,t,n)=>jN({generation:t,credentials:{accessToken:e.access_token,refreshToken:e.refresh_token,tokenType:e.token_type,accessTokenExpiresAt:Date.now()+e.expires_in*1e3}},n),incrementSessionGeneration:()=>{const e=Sa();zd({...e,generation:e.generation+1})},clearSession:()=>{const e=Sa();zd({generation:e.generation+1})},removeTokens:()=>{zd({generation:Sa().generation})},removeToken:()=>pn.removeTokens()},Hle=1440*60*1e3,qle=1e4,Wle="mentes:auth-token-refresh",Gle="mentes:auth-token-mutation",Sm="mentes:auth-tokens-updated";let uy=null;const Kle=async e=>{const t=globalThis.navigator?.locks;return t?t.request(Wle,e):e()},Mc=async e=>{const t=globalThis.navigator?.locks;return t?t.request(Gle,e):e()};function kt(){return pn.getSessionGeneration()}function Zle(e){return!!(e.access_token&&e.refresh_token&&e.token_type&&Number.isFinite(e.expires_in)&&e.expires_in>0)}
17function Q9(e,t,n){if(!Zle(e))throw new Error("Authentication returned an invalid token pair");const r=pn.saveTokenPairIfGeneration(e,n,t);return r&&window.dispatchEvent(new Event(Sm)),r}function X9(e,t){return kt()===e&&pn.getToken()===t}async function J9(e,t){return Mc(()=>Q9(e,t,t+1))}function Yle(e,t){return Mc(()=>Q9(e,t,t))}async function Qle(e,t){return Mc(()=>{const n=pn.saveTokenIfGeneration(e,t+1,t);return n&&window.dispatchEvent(new Event(Sm)),n})}function d_(){pn.clearSession(),window.dispatchEvent(new Event(Sm))}function Xle(){return Mc(d_)}const NC=e=>{try{const t=Z9(e);if(t.exp)return Date.now()>=t.exp*1e3}catch(t){console.error("Invalid token",t)}return!0};function e8(e){try{const t=Z9(e);return!t.exp||Date.now()>=t.exp*1e3-Hle}catch{return!0}}function CP(){if(window.location.pathname!=="/auth/signin"){const e=`${window.location.pathname}${window.location.search}`;window.location.assign(`/auth/signin?callbackUrl=${encodeURIComponent(e)}`)}}function Jle(){throw d_(),CP(),new Error("Unauthorized — session cleared")}async function t8(){const e=kt(),t=pn.getToken();return Mc(()=>{if(kt()!==e||pn.getToken()!==t)throw new Error("Credential changed while request was in flight");return Jle()})}async function Em(e,t){return Mc(()=>X9(e,t)?(d_(),!0):!1)}async function eue(e,t){throw await Em(e,t)?(CP(),new Error("Unauthorized — session cleared")):new Error("Credential changed while request was in flight")}function tue(){const{accessToken:e,refreshToken:t,tokenType:n,accessTokenExpiresAt:r}=pn.getTokens();return!e||!t?null:{access_token:e,refresh_token:t,token_type:n||"bearer",expires_in:r?Math.max(0,Math.floor((r-Date.now())/1e3)):0}}async function n8(e,t){const n=new AbortController,r=()=>n.abort(),i=window.setTimeout(r,qle);t?.aborted?r():t?.addEventListener("abort",r,{once:!0});try{const s=await fetch(`${Ha}/auth/jwt/refresh`,{...e,signal:n.signal});return{body:await s.text(),ok:s.ok,status:s.status}}finally{window.clearTimeout(i),t?.removeEventListener("abort",r)}}async function nue(e,t,n){const r=await n8({method:"POST",headers:e?{"Content-Type":"application/json"}:{Authorization:`Bearer ${t}`},body:e?JSON.stringify({refresh_token:e}):void 0});if(r.status===401){const s=e||t;throw await Mc(()=>{if(n!==kt())return!1;const a=e?pn.getRefreshToken():pn.getToken();return!s||a!==s?!1:(d_(),!0)})?(CP(),new Error("Unauthorized — session cleared")):new Error("Session changed during refresh")}if(!r.ok)throw new Error(`Token refresh failed (${r.status})`);const i=JSON.parse(r.body);if(!await Yle(i,n))throw new Error("Session changed during refresh");return i}async function rue(){const e=kt(),t=pn.getRefreshToken(),n=pn.getToken();return Kle(async()=>{if(e!==kt())throw new Error("Session changed during refresh");if(!t&&!n)return t8();const i=tue();return i&&(i.refresh_token!==t||i.access_token!==n)?i:nue(t,n,e)})}async function iue(e,t){const n=await n8({method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e})},t);if(!n.ok)throw new Error(`Token refresh failed (${n.status})`);const r=JSON.parse(n.body);if(!r.access_token)throw new Error("Authentication returned an invalid token pair");return r.access_token}function kP(){return uy||(uy=rue().finally(()=>{uy=null})),uy}async function TP(){const e=kt(),t=pn.getToken();if(!t)return t8();if(e8(t))try{return(await kP()).access_token}catch(n){if(kt()!==e)throw new Error("Session changed during refresh");if(pn.getToken()&&!NC(t))return console.warn("Unable to refresh session; continuing with valid access token",n),t;throw n}return t}const LN=async()=>TP(),sue="X-Mentes-Timezone",oue=/^[\x20-\x7e]+$/;function aue(){let e;try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return null}return!e||!oue.test(e)?null:e}function r8(){const e=aue();return e?{[sue]:e}:{}}const q0="mentes_google_oauth_pkce_verifier",FN="Mentes is currently invite-only. Please request an invite to join.",H1="Something went wrong signing in with Google. Please try again.",lue="Google sign-in is temporarily unavailable. Please try again later.",uue="Unable to reach Mentes. Check your connection and try again.",cue="Google sign-in failed. Please try again.",due="Google sign-in was cancelled. Please try again.",fue="https://accounts.google.com/o/oauth2/v2/auth",MBe="This browser is blocking site storage, which signing in needs. Allow cookies and site data for app.mentes.ai, then try again.",NBe="Mentes could not save this sign-in attempt in y
17our browser. Free up browser storage for app.mentes.ai, or allow site data, then try again.";function jBe(){try{const e=window.localStorage;return e.getItem(q0),e}catch{return null}}function PP(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function LBe(){const e=new Uint8Array(32);return crypto.getRandomValues(e),PP(e)}function FBe(){const e=new Uint8Array(16);return crypto.getRandomValues(e),PP(e)}async function $Be(e){const t=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e));return PP(new Uint8Array(t))}function zBe(e){return`${e}/auth/google`}function VBe({clientId:e,redirectUri:t,callbackUrl:n,codeChallenge:r,attemptId:i}){const s=new URL(fue);return s.search=new URLSearchParams({client_id:e,redirect_uri:t,response_type:"code",scope:"openid profile email",prompt:"select_account",state:hue({attemptId:i,callbackUrl:n}),code_challenge:r,code_challenge_method:"S256"}).toString(),s.toString()}function hue({attemptId:e,callbackUrl:t}){return`${e}.${encodeURIComponent(t)}`}function $N(e){if(!e)return{attemptId:null,callbackUrl:"/"};const t=e.indexOf(".");if(t<=0)return{attemptId:null,callbackUrl:"/"};try{return{attemptId:e.slice(0,t),callbackUrl:decodeURIComponent(e.slice(t+1))||"/"}}catch{return{attemptId:null,callbackUrl:"/"}}}function UBe(e){const t=new URLSearchParams(e),n=t.get("error"),r=t.get("code");return n?{type:"error",error:n,...$N(t.get("state"))}:r?{type:"code",code:r,...$N(t.get("state"))}:{type:"initial",callbackUrl:t.get("callbackUrl")||"/"}}const pue=600*1e3,mue=5;function BBe(e,t,n,r=Date.now()){const i=RP(e,r),s=Object.entries(i).sort(([,o],[,a])=>o.issuedAt-a.issuedAt).slice(0,Math.max(0,Object.keys(i).length-mue+1));for(const[o]of s)delete i[o];i[t]={verifier:n,issuedAt:r},i8(e,i)}function HBe(e,t,n=Date.now()){if(!t)return null;const r=RP(e,n),i=r[t];return delete r[t],s8(e,r),i?.verifier??null}function qBe(e,t=null,n=Date.now()){const r=RP(e,n);t&&delete r[t],s8(e,r)}function RP(e,t){const n=e.getItem(q0);if(!n)return{};let r;try{r=JSON.parse(n)}catch{return{}}if(!r||typeof r!="object")return{};const i={};for(const[s,o]of Object.entries(r)){const{verifier:a,issuedAt:l}=o??{};typeof a!="string"||!a||Number.isFinite(l)&&(t-Number(l)>pue||(i[s]={verifier:a,issuedAt:Number(l)}))}return i}function i8(e,t){if(Object.keys(t).length===0){e.removeItem(q0);return}e.setItem(q0,JSON.stringify(t))}function s8(e,t){try{i8(e,t)}catch{}}function WBe(e){return e==="access_denied"?due:cue}function GBe(e){return`/auth/google?callbackUrl=${encodeURIComponent(e)}`}function zN(e){try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function gue(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function vue(e){if(typeof e=="string")return e;if(e==null)return null;if(Array.isArray(e))return e.length===0?null:e.map(t=>{if(t&&typeof t=="object"&&"msg"in t){const n=t,r=Array.isArray(n.loc)?n.loc.filter(i=>i!=="body").join("."):"";return r?`${r}: ${String(n.msg)}`:String(n.msg)}return zN(t)}).join("; ");if(typeof e=="object"){const t=e;return typeof t.reason=="string"?typeof t.code=="string"?`${t.code}: ${t.reason}`:t.reason:zN(e)}return String(e)}async function o8(e){let t=null;try{t=await e.text()}catch{}let n=null;if(t)try{n=JSON.parse(t)}catch{}const r=n&&typeof n=="object"?n.detail??n.message:null,i=typeof r=="string"?r:r&&typeof r=="object"&&typeof r.code=="string"?r.code:null,s=vue(r),o=s??(t?gue(t.trim(),300):null);return{status:e.status,code:i,detailText:o,fromDetail:s}}class f_ extends Error{status;code;detailText;constructor(t,n={}){super(t),this.name="AuthApiError",this.status=n.status,this.code=n.code,this.detailText=n.detailText}}const a8={LOGIN_BAD_CREDENTIALS:"Incorrect email or password.",LOGIN_USER_NOT_VERIFIED:"Please verify your email before signing in.",REGISTER_USER_ALREADY_EXISTS:"An account with this email already exists. Please sign in instead.",REGISTER_INVALID_PASSWORD:"Password must be at least 8 characters long and contain at least one number.",REGISTER_INVALID_EMAIL:"Please enter a valid email address.",REGISTER_NOT_INVITED:FN,USER_NOT_FOUND:"No account found with this email address.",INVA
17LID_EMAIL:"Please enter a valid email address.",RESET_PASSWORD_BAD_TOKEN:"Invalid or expired reset token. Please request a new password reset.",RESET_PASSWORD_INVALID_PASSWORD:"Password does not meet requirements.",VERIFY_USER_BAD_TOKEN:"This verification link is invalid or has expired.",VERIFY_USER_ALREADY_VERIFIED:"This email is already verified — you can sign in.",USER_NOT_INVITED:FN,GOOGLE_UNAVAILABLE:lue,OAUTH_NOT_AVAILABLE_EMAIL:"Your Google account did not share an email address with Mentes. Check that your Google account has an email and try again.",OAUTH_USER_ALREADY_EXISTS:"An account with this email already exists. Please sign in with your password instead.",OAUTH_INVALID_TOKEN:H1,OAUTH_INVALID_GOOGLE_AUTHORIZATION_CODE:H1,INVALID_AUTHORIZATION_CODE:H1};function KBe({status:e,code:t,detailText:n,fallback:r}){const s=a8[t];return new f_(s,{status:e,code:t,detailText:n??void 0})}async function l8(e,t){const{status:n,code:r,detailText:i,fromDetail:s}=await o8(e),o=r?a8[r]:void 0;return new f_(o??s??t,{status:n,code:r??void 0,detailText:i??void 0})}const yue=uue;function u8(e){return new f_(yue,{code:"NETWORK_ERROR",detailText:e instanceof Error&&e.message?`NETWORK_ERROR: ${e.message}`:"NETWORK_ERROR"})}function ZBe(e,t){if(e instanceof f_){const n=[],r=e.detailText??e.code;return r&&r!==e.message&&n.push(r),e.status!=null&&n.push(`HTTP ${e.status}`),{message:e.message,debug:n.length?n.join(" · "):void 0}}return e instanceof Error&&e.message?{message:e.message}:{message:t}}var Nc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},pc=typeof window>"u"||"Deno"in globalThis;function Cs(){}function bue(e,t){return typeof e=="function"?e(t):e}function jC(e){return typeof e=="number"&&e>=0&&e!==1/0}function c8(e,t){return Math.max(e+(t||0)-Date.now(),0)}function mf(e,t){return typeof e=="function"?e(t):e}function no(e,t){return typeof e=="function"?e(t):e}function VN(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:a}=e;if(o){if(r){if(t.queryHash!==IP(o,t.options))return!1}else if(!Cm(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||s&&!s(t))}function UN(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(mc(t.options.mutationKey)!==mc(s))return!1}else if(!Cm(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function IP(e,t){return(t?.queryKeyHashFn||mc)(e)}function mc(e){return JSON.stringify(e,(t,n)=>LC(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Cm(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Cm(e[n],t[n])):!1}function OP(e,t){if(e===t)return e;const n=BN(e)&&BN(t);if(n||LC(e)&&LC(t)){const r=n?e:Object.keys(e),i=r.length,s=n?t:Object.keys(t),o=s.length,a=n?[]:{};let l=0;for(let u=0;u<o;u++){const f=n?u:s[u];(!n&&r.includes(f)||n)&&e[f]===void 0&&t[f]===void 0?(a[f]=void 0,l++):(a[f]=OP(e[f],t[f]),a[f]===e[f]&&e[f]!==void 0&&l++)}return i===o&&l===i?e:a}return t}function W0(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function BN(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function LC(e){if(!HN(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!HN(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function HN(e){return Object.prototype.toString.call(e)==="[object Object]"}function _ue(e){return new Promise(t=>{setTimeout(t,e)})}function FC(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?OP(e,t):t}function wue(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function xue(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var DP=Symbol();function d8(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===DP?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Sue=class extends Nc{#t;#e;#n;constructor(){super(),this.#n=e=>{if(!pc&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 11,803 bytes, line 17
17this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},AP=new Sue,Eue=class extends Nc{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(!pc&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},G0=new Eue;function $C(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function Cue(e){return Math.min(1e3*2**e,3e4)}function f8(e){return(e??"online")==="online"?G0.isOnline():!0}var h8=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function q1(e){return e instanceof h8}function p8(e){let t=!1,n=0,r=!1,i;const s=$C(),o=_=>{r||(p(new h8(_)),e.abort?.())},a=()=>{t=!0},l=()=>{t=!1},u=()=>AP.isFocused()&&(e.networkMode==="always"||G0.isOnline())&&e.canRun(),f=()=>f8(e.networkMode)&&e.canRun(),d=_=>{r||(r=!0,e.onSuccess?.(_),i?.(),s.resolve(_))},p=_=>{r||(r=!0,e.onError?.(_),i?.(),s.reject(_))},m=()=>new Promise(_=>{i=w=>{(r||u())&&_(w)},e.onPause?.()}).then(()=>{i=void 0,r||e.onContinue?.()}),v=()=>{if(r)return;let _;const w=n===0?e.initialPromise:void 0;try{_=w??e.fn()}catch(x){_=Promise.reject(x)}Promise.resolve(_).then(d).catch(x=>{if(r)return;const S=e.retry??(pc?0:3),C=e.retryDelay??Cue,R=typeof C=="function"?C(n,x):C,P=S===!0||typeof S=="number"&&n<S||typeof S=="function"&&S(n,x);if(t||!P){p(x);return}n++,e.onFail?.(n,x),_ue(R).then(()=>u()?void 0:m()).then(()=>{t?p(x):v()})})};return{promise:s,cancel:o,continue:()=>(i?.(),s),cancelRetry:a,continueRetry:l,canStart:f,start:()=>(f()?v():m().then(v),s)}}function kue(){let e=[],t=0,n=a=>{a()},r=a=>{a()},i=a=>setTimeout(a,0);const s=a=>{t?e.push(a):i(()=>{n(a)})},o=()=>{const a=e;e=[],a.length&&i(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||o()}return l},batchCalls:a=>(...l)=>{s(()=>{a(...l)})},schedule:s,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{i=a}}}var Kn=kue(),m8=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),jC(this.gcTime)&&(this.#t=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(pc?1/0:300*1e3))}clearGcTimeout(){this.#t&&(clearTimeout(this.#t),this.#t=void 0)}},Tue=class extends m8{#t;#e;#n;#r;#i;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Pue(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=FC(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Cs).catch(Cs):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#t)}isActive(){return this.observers.some(e=>no(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===DP||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!c8(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#a?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){const a=this.observers.find(l=>l.options.queryFn);a&&this.setOptions(a.options)}const n=new AbortController,r=a=>{Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const a=d8(this.options,t),l={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(l),this.#a=!1,this.options.persister?this.options.persister(a,l,this):a(l)},s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};r(s),this.options.behavior?.onFetch(s,this),this.#e=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#s({type:"fetch",meta:s.fetchOptions?.meta});const o=a=>{q1(a)&&a.silent||this.#s({type:"error",error:a}),q1(a)||(this.#n.config.onError?.(a,this),this.#n.config.onSettled?.(this.state.data,a,this)),this.scheduleGc()};return this.#i=p8({initialPromise:t?.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:a=>{if(a===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(a)}catch(l){o(l);return}this.#n.config.onSuccess?.(a,this),this.#n.config.onSettled?.(a,this.state.error,this),this.scheduleGc()},onError:o,onFail:(a,l)=>{this.#s({type:"failed",failureCount:a,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#i.start()}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...g8(n.data,this.options),fetchMeta:e.meta??null};case"success":return{...n,data:e.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return q1(r)&&r.revert&&this.#e?{...this.#e,fetchStatus:"idle"}:{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Kn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function g8(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:f8(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Pue(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Rue=class extends Nc{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const r=t.queryKey,i=t.queryHash??IP(r,t);let s=this.get(i);return s||(s=new Tue({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(s)),s}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Kn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>VN(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>VN(e,n)):t}notify(e){Kn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Kn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Kn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Iue=class extends m8{#t;#e;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#e=e.mutationCache,this.#t=[],this.state=e.state||v8(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#e.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=p8({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(r,i)=>{this.#r({type:"failed",failureCount:r,error:i})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const t=this.state.status==="pending",n=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:n}),await this.#e.config.onMutate?.(e,this);const i=await this.options.onMutate?.(e);i!==this.state.context&&this.#r({type:"pending",context:i,variables:e,isPaused:n})}const r=await this.#n.start();return await this.#e.config.onSuccess?.(r,e,this.state.context,this),await this.options.onSuccess?.(r,e,this.state.context),await this.#e.config.onSettled?.(r,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(r,null,e,this.state.context),this.#r({type:"success",data:r}),r}catch(r){try{throw await this.#e.config.onError?.(r,e,this.state.context,this),await this.options.onError?.(r,e,this.state.context),await this.#e.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,r,e,this.state.context),r}finally{this.#r({type:"error",error:r})}}finally{this.#e.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};
vendor: 8,217 bytes, line 17
17case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Kn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#e.notify({mutation:this,type:"updated",action:e})})}};function v8(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oue=class extends Nc{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const r=new Iue({mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#t.add(e);const t=cy(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=cy(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=cy(e);if(typeof t=="string"){const r=this.#e.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=cy(e);return typeof t=="string"?this.#e.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Kn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>UN(t,n))}findAll(e={}){return this.getAll().filter(t=>UN(e,t))}notify(e){Kn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Kn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Cs))))}};function cy(e){return e.options.scope?.id}function K0(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let f=!1;const d=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?f=!0:t.signal.addEventListener("abort",()=>{f=!0}),t.signal)})},p=d8(t.options,t.fetchOptions),m=async(v,_,w)=>{if(f)return Promise.reject();if(_==null&&v.pages.length)return Promise.resolve(v);const x={client:t.client,queryKey:t.queryKey,pageParam:_,direction:w?"backward":"forward",meta:t.options.meta};d(x);const S=await p(x),{maxPages:C}=t.options,R=w?xue:wue;return{pages:R(v.pages,S,C),pageParams:R(v.pageParams,_,C)}};if(i&&s.length){const v=i==="backward",_=v?y8:zC,w={pages:s,pageParams:o},x=_(r,w);a=await m(w,x,v)}else{const v=e??s.length;do{const _=l===0?o[0]??r.initialPageParam:zC(r,a);if(l>0&&_==null)break;a=await m(a,_),l++}while(l<v)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=u}}}function zC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function y8(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Due(e,t){return t?zC(e,t)!=null:!1}function Aue(e,t){return!t||!e.getPreviousPageParam?!1:y8(e,t)!=null}var b8=class{#t;#e;#n;#r;#i;#o;#a;#s;constructor(e={}){this.#t=e.queryCache||new Rue,this.#e=e.mutationCache||new Oue,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=AP.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#s=G0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(mf(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),s=this.#t.get(r.queryHash)?.state.data,o=bue(t,s);if(o!==void 0)return this.#t.build(this,r).setData(o,{...n,manual:!0})}setQueriesData(e,t,n){return Kn.batch(()=>this.#t.findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;Kn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return Kn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Kn.batch(()=>this.#t.findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Cs).catch(Cs)}invalidateQueries(e,t={}){return Kn.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Kn.batch(()=>this.#t.findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Cs)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Cs)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(mf(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Cs).catch(Cs)}fetchInfiniteQuery(e){return e.behavior=K0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Cs).catch(Cs)}ensureInfiniteQueryData(e){return e.behavior=K0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return G0.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(mc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(r=>{Cm(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(mc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(r=>{Cm(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=IP(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===DP&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},h_=class extends Nc{constructor(e,t){super(),this.options=t,this.#t=e,this.#s=null,this.#a=$C(),this.options.experimental_prefetchInRender||this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#r=void 0;#i;#o;#a;#s;#h;#d;#f;#u;#c;#l;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),qN(this.#e,this.options)?this.#p():this.updateResult(),this.#b()
vendor: 4,082 bytes, line 17
17)}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return VC(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return VC(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#_(),this.#w(),this.#e.removeObserver(this)}setOptions(e,t){const n=this.options,r=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof no(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#e.setOptions(this.options),n._defaulted&&!W0(this.options,n)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const i=this.hasListeners();i&&WN(this.#e,r,this.options,n)&&this.#p(),this.updateResult(t),i&&(this.#e!==r||no(this.options.enabled,this.#e)!==no(n.enabled,this.#e)||mf(this.options.staleTime,this.#e)!==mf(n.staleTime,this.#e))&&this.#g();const s=this.#v();i&&(this.#e!==r||no(this.options.enabled,this.#e)!==no(n.enabled,this.#e)||s!==this.#l)&&this.#y(s)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return Nue(this,n)&&(this.#r=n,this.#o=this.options,this.#i=this.#e.state),n}getCurrentResult(){return this.#r}trackResult(e,t){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(r),t?.(r),e[r])})}),n}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#p(e){this.#x();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Cs)),t}#g(){this.#_();const e=mf(this.options.staleTime,this.#e);if(pc||this.#r.isStale||!jC(e))return;const n=c8(this.#r.dataUpdatedAt,e)+1;this.#u=setTimeout(()=>{this.#r.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#w(),this.#l=e,!(pc||no(this.options.enabled,this.#e)===!1||!jC(this.#l)||this.#l===0)&&(this.#c=setInterval(()=>{(this.options.refetchIntervalInBackground||AP.isFocused())&&this.#p()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#_(){this.#u&&(clearTimeout(this.#u),this.#u=void 0)}#w(){this.#c&&(clearInterval(this.#c),this.#c=void 0)}createResult(e,t){const n=this.#e,r=this.options,i=this.#r,s=this.#i,o=this.#o,l=e!==n?e.state:this.#n,{state:u}=e;let f={...u},d=!1,p;if(t._optimisticResults){const I=this.hasListeners(),D=!I&&qN(e,t),L=I&&WN(e,n,t,r);(D||L)&&(f={...f,...g8(u.data,e.options)}),t._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:m,errorUpdatedAt:v,status:_}=f;if(t.select&&f.data!==void 0)if(i&&f.data===s?.data&&t.select===this.#h)p=this.#d;else try{this.#h=t.select,p=t.select(f.data),p=FC(i?.data,p,t),this.#d=p,this.#s=null}catch(I){this.#s=I}else p=f.data;if(t.placeholderData!==void 0&&p===void 0&&_==="pending"){let I;if(i?.isPlaceholderData&&t.placeholderData===o?.placeholderData)I=i.data;else if(I=typeof t.placeholderData=="function"?t.placeholderData(this.#f?.state.data,this.#f):t.placeholderData,t.select&&I!==void 0)try{I=t.select(I),this.#s=null}catch(D){this.#s=D}I!==void 0&&(_="success",p=FC(i?.data,I,t),d=!0)}this.#s&&(m=this.#s,p=this.#d,v=Date.now(),_="error");const w=f.fetchStatus==="fetching",x=_==="pending",S=_==="error",C=x&&w,R=p!==void 0,k={status:_,fetchStatus:f.fetchStatus,isPending:x,isSuccess:_==="success",isError:S,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:f.dataUpdatedAt,error:m,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>
170||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>l.dataUpdateCount||f.errorUpdateCount>l.errorUpdateCount,isFetching:w,isRefetching:w&&!x,isLoadingError:S&&!R,isPaused:f.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:S&&R,isStale:MP(e,t),refetch:this.refetch,promise:this.#a};if(this.options.experimental_prefetchInRender){const I=A=>{k.status==="error"?A.reject(k.error):k.data!==void 0&&A.resolve(k.data)},D=()=>{const A=this.#a=k.promise=$C();I(A)},L=this.#a;switch(L.status){case"pending":e.queryHash===n.queryHash&&I(L);break;case"fulfilled":(k.status==="error"||k.data!==L.value)&&D();break;case"rejected":(k.status!=="error"||k.error!==L.reason)&&D();break}}return k}updateResult(e){const t=this.#r,n=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#o=this.options,this.#i.data!==void 0&&(this.#f=this.#e),W0(n,t))return;this.#r=n;const r={},i=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!this.#m.size)return!0;const a=new Set(o??this.#m);return this.options.throwOnError&&a.add("error"),Object.keys(this.#r).some(l=>{const u=l;return this.#r[u]!==t[u]&&a.has(u)})};e?.listeners!==!1&&i()&&(r.listeners=!0),this.#S({...r,...e})}#x(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#S(e){Kn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#r)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Mue(e,t){return no(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qN(e,t){return Mue(e,t)||e.state.data!==void 0&&VC(e,t,t.refetchOnMount)}function VC(e,t,n){if(no(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&MP(e,t)}return!1}function WN(e,t,n,r){return(e!==t||no(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&MP(e,n)}function MP(e,t){return no(t.enabled,e)!==!1&&e.isStaleByTime(mf(t.staleTime,e))}function Nue(e,t){return!W0(e.getCurrentResult(),t)}function GN(e,t){return e.filter(n=>!t.includes(n))}function jue(e,t,n){const r=e.slice(0);return r[t]=n,r}var Lue=class extends Nc{#t;#e;#n;#r;#i;#o;#a;#s;#h=[];constructor(e,t,n){super(),this.#t=e,this.#r=n,this.#n=[],this.#i=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#c(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t,n){this.#n=e,this.#r=t,Kn.batch(()=>{const r=this.#i,i=this.#u(this.#n);this.#h=i,i.forEach(l=>l.observer.setOptions(l.defaultedQueryOptions,n));const s=i.map(l=>l.observer),o=s.map(l=>l.getCurrentResult()),a=s.some((l,u)=>l!==r[u]);r.length===s.length&&!a||(this.#i=s,this.#e=o,this.hasListeners()&&(GN(r,s).forEach(l=>{l.destroy()}),GN(s,r).forEach(l=>{l.subscribe(u=>{this.#c(l,u)})}),this.#l()))})}getCurrentResult(){return this.#e}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){const n=this.#u(e),r=n.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[r,i=>this.#f(i??r,t),()=>this.#d(r,n)]}#d(e,t){return t.map((n,r)=>{const i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,s=>{t.forEach(o=>{o.observer.trackProp(s)})})})}#f(e,t){return t?((!this.#o||this.#e!==this.#s||t!==this.#a)&&(this.#a=t,this.#s=this.#e,this.#o=OP(this.#o,t(e))),this.#o):e}#u(e){const t=new Map(this.#i.map(r=>[r.options.queryHash,r])),n=[];return e.forEach(r=>{const i=this.#t.defaultQueryOptions(r),s=t.get(i.queryHash);s?n.push({defaultedQueryOptions:i,observer:s}):n.push({defaultedQueryOptions:i,observer:new h_(this.#t,i)})}),n}#c(e,t){const n=this.#i.indexOf(e);n!==-1&&(this.#e=jue(this.#e,n,t),this.#l())}#l(){if(this.hasListeners()){const e=this.#o,t=this.#d(this.#e,this.#h),n=this.#f(t,this.#r?.combine);e!==n&&Kn.batch(()=>
17{this.listeners.forEach(r=>{r(this.#e)})})}}},Fue=class extends h_{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e,t){super.setOptions({...e,behavior:K0()},t)}getOptimisticResult(e){return e.behavior=K0(),super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:s,isError:o,isRefetchError:a}=r,l=n.fetchMeta?.fetchMore?.direction,u=o&&l==="forward",f=i&&l==="forward",d=o&&l==="backward",p=i&&l==="backward";return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Due(t,n.data),hasPreviousPage:Aue(t,n.data),isFetchNextPageError:u,isFetchingNextPage:f,isFetchPreviousPageError:d,isFetchingPreviousPage:p,isRefetchError:a&&!u&&!d,isRefetching:s&&!f&&!p}}},$ue=class extends Nc{#t;#e=void 0;#n;#r;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),W0(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&mc(n.mutationKey)!==mc(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#o(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#o()}mutate(t,n){return this.#r=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#i(){const t=this.#n?.state??v8();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Kn.batch(()=>{if(this.#r&&this.hasListeners()){const n=this.#e.variables,r=this.#e.context;t?.type==="success"?(this.#r.onSuccess?.(t.data,n,r),this.#r.onSettled?.(t.data,null,
17n,r)):t?.type==="error"&&(this.#r.onError?.(t.error,n,r),this.#r.onSettled?.(void 0,t.error,n,r))}this.listeners.forEach(n=>{n(this.#e)})})}},_8=b.createContext(void 0),Dr=e=>{const t=b.useContext(_8);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},NP=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),g.jsx(_8.Provider,{value:e,children:t})),w8=b.createContext(!1),x8=()=>b.useContext(w8);w8.Provider;function zue(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vue=b.createContext(zue()),S8=()=>b.useContext(Vue);function E8(e,t){return typeof e=="function"?e(...t):!!e}function Z0(){}var C8=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},k8=e=>{b.useEffect(()=>{e.clearReset()},[e])},T8=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||E8(n,[e.error,r])),P8=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},R8=(e,t)=>e.isLoading&&e.isFetching&&!t,UC=(e,t)=>e?.suspense&&t.isPending,Y0=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Uue({queries:e,...t},n){const r=Dr(),i=x8(),s=S8(),o=b.useMemo(()=>e.map(_=>{const w=r.defaultQueryOptions(_);return w._optimisticResults=i?"isRestoring":"optimistic",w}),[e,r,i]);o.forEach(_=>{P8(_),C8(_,s)}),k8(s);const[a]=b.useState(()=>new Lue(r,o,t)),[l,u,f]=a.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;b.useSyncExternalStore(b.useCallback(_=>d?a.subscribe(Kn.batchCalls(_)):Z0,[a,d]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),b.useEffect(()=>{a.setQueries(o,t,{listeners:!1})},[o,t,a]);const m=l.some((_,w)=>UC(o[w],_))?l.flatMap((_,w)=>{const x=o[w];if(x){const S=new h_(r,x);if(UC(x,_))return Y0(x,S,s);R8(_,i)&&Y0(x,S,s)}return[]}):[];if(m.length>0)throw Promise.all(m);const v=l.find((_,w)=>{const x=o[w];return x&&T8({result:_,errorResetBoundary:s,throwOnError:x.throwOnError,query:r.getQueryCache().get(x.queryHash),suspense:x.suspense})});if(v?.error)throw v.error;return u(f())}function I8(e,t,n){const r=Dr(),i=x8(),s=S8(),o=r.defaultQueryOptions(e);r.getDefaultOptions().queries?._experimental_beforeQuery?.(o),o._optimisticResults=i?"isRestoring":"optimistic",P8(o),C8(o,s),k8(s);const a=!r.getQueryCache().get(o.queryHash),[l]=b.useState(()=>new t(r,o)),u=l.getOptimisticResult(o),f=!i&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(d=>{const p=f?l.subscribe(Kn.batchCalls(d)):Z0;return l.updateResult(),p},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),b.useEffect(()=>{l.setOptions(o,{listeners:!1})},[o,l]),UC(o,u))throw Y0(o,l,s);if(T8({result:u,errorResetBoundary:s,throwOnError:o.throwOnError,query:r.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;return r.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!pc&&R8(u,i)&&(a?Y0(o,l,s):r.getQueryCache().get(o.queryHash)?.promise)?.catch(Z0).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function hr(e,t){return I8(e,h_)}function os(e,t){const n=Dr(),[r]=b.useState(()=>new $ue(n,e));b.useEffect(()=>{r.setOptions(e)},[r,e]);const i=b.useSyncExternalStore(b.useCallback(o=>r.subscribe(Kn.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=b.useCallback((o,a)=>{r.mutate(o,a).catch(Z0)},[r]);if(i.error&&E8(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}function O8(e,t){return I8(e,Fue)}var D8="vercel.ai.error",Bue=Symbol.for(D8),KN,ZN,Or=class A8 extends(ZN=Error,KN=Bue,ZN){constructor({name:t,message:n,cause:r}){super(n),this[KN]=!0,this.name=t,this.cause=r}static isInstance(t){return A8.hasMarker(t,D8)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}},M8="AI_APICallError",N8=`vercel.ai.error.${M8}`,Hue=Symbol.for(N8),YN,QN,que=class extends(QN=Or,YN=Hue,QN){constructor({message:e,url:t,requestBodyValues:n,statusCode:r,responseHeaders:i,responseBody:s,cause:o,isRetryable:a=r!=null&&(r===408||r===409||r===429||r>=500),data:l}){super({name:M8,message:e,cause:o}),this[YN]=!0,this.url=t,this.requestBodyValues=n,this.statusCode=r,this.responseHeaders=i,this.responseBody=s,this.isRetryable=a,this.data=l}static isInstance(e){return Or.hasMarker(e,N8)}},j8="AI_EmptyResponseBodyError",L8=`vercel.ai.error.${j8}`,Wue=Symbol.for(L8),XN,JN,ej=class extends(JN=Or,XN=Wue,JN){constructor({message:e="Empty response body"}={}){super({name:j8,message:e}),this[XN]=!0}static isInstance(e){return Or.hasMarker(e,L8)}};function F8(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.toString():JSON.stringify(e)}var $8="AI_InvalidArgumentError",z8=`vercel.ai.error.${$8}`,Gue=Symbol.for(z8),tj,nj,Kue=class extends(nj=Or,tj=Gue,nj){constructor({message:t,cause:n,argument:r}){super({name:$8,message:t,cause:n}),this[tj]=!0,this.argument=r}static isInstance(t){return Or.hasMarker(t,z8)}},V8="AI_JSONParseError",U8=`vercel.ai.error.${V8}`,Zue=Symbol.for(U8),rj,ij,sj=class extends(ij=Or,rj=Zue,ij){constructor({text:e,cause:t}){super({name:V8,message:`JSON parsing failed: Text: ${e}.
18Error message: ${F8(t)}`,cause:t}),this[rj]=!0,this.text=e}static isInstance(e){return Or.hasMarker(e,U8)}},B8="AI_TypeValidationError",H8=`vercel.ai.error.${B8}`,Yue=Symbol.for(H8),oj,aj,Gl=class BC extends(aj=Or,oj=Yue,aj){constructor({value:t,cause:n,context:r}){let i="Type validation failed";if(r?.field&&(i+=` for ${r.field}`),r?.entityName||r?.entityId){i+=" (";const s=[];r.entityName&&s.push(r.entityName),r.entityId&&s.push(`id: "${r.entityId}"`),i+=s.join(", "),i+=")"}super({name:B8,message:`${i}: Value: ${JSON.stringify(t)}.
19Error message: ${F8(n)}`,cause:n}),this[oj]=!0,this.value=t,this.context=r}static isInstance(t){return Or.hasMarker(t,H8)}static wrap({value:t,cause:n,context:r}){var i,s,o;return BC.isInstance(n)&&n.value===t&&((i=n.context)==null?void 0:i.field)===r?.field&&((s=n.context)==null?void 0:s.entityName)===r?.entityName&&((o=n.context)==null?void 0:o.entityId)===r?.entityId?n:new BC({value:t,cause:n,context:r})}},q8="AI_UnsupportedFunctionalityError",W8=`vercel.ai.error.${q8}`,Que=Symbol.for(W8),lj,uj,Xue=class extends(uj=Or,lj=Que,uj){constructor({functionality:e,message:t=`'${e}' functionality not supported.`}){super({name:q8,message:t}),this[lj]=!0,this.functionality=e}static isInstance(e){return Or.hasMarker(e,W8)}};function ye(e,t,n){function r(a,l){var u;
19Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(const f in o.prototype)f in a||Object.defineProperty(a,f,{value:o.prototype[f].bind(a)});a._zod.constr=o,a._zod.def=l}const i=n?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function o(a){var l;const u=n?.Parent?new s:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class km extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const G8={};function Kl(e){return G8}function K8(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Jue(e,t){return typeof t=="bigint"?t.toString():t}function jP(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function LP(e){return e==null}function FP(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function ece(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}function sn(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function p_(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ep(e){return JSON.stringify(e)}const Z8=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Q0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const tce=jP(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function X0(e){if(Q0(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Q0(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const nce=new Set(["string","number","symbol"]);function ig(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jc(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ut(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function rce(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const ice={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function sce(e,t){const n={},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(n[i]=r.shape[i])}return jc(e,{...e._zod.def,shape:n,checks:[]})}function oce(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete n[i]}return jc(e,{...e._zod.def,shape:n,checks:[]})}function ace(e,t){if(!X0(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return p_(this,"shape",r),r},checks:[]};return jc(e,n)}function lce(e,t){return jc(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return p_(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function uce(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const s in n){if(!(s in r))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=e?new e({type:"optional",innerType:r[s]}):r[s])}else for(const s in r)i[s]=e?new e({type:"optional",innerType:r[s]}):r[s];return jc(t,{...t._zod.def,shape:i,checks:[]})}function cce(e,t,n){const r=t._zod.def.shape,i={...r};if(n)for(const s in n){if(!(s in i))throw new Error(`Unrecognized key: "${s}"`);n[s]&&(i[s]=new e({type:"nonoptional",innerType:r[s]}))}else for(const s in r)i[s]=new e({type:"nonoptional",innerType:r[s]});return jc(t,{...t._zod.def,shape:i,checks:[]})}function Zp(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function rc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function dy(e){return typeof e=="string"?e:e?.message}function Zl(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=dy(e.inst?._zod.def?.error?.(e))??dy(t?.error?.(e))??dy(n.customError?.(e))??dy(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function $P(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Tm(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Y8=(e,t)=>
vendor: 9,642 bytes, line 19
19{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,Jue,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Q8=ye("$ZodError",Y8),X8=ye("$ZodError",Y8,{Parent:Error});function dce(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function fce(e,t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(e),r}const hce=e=>(t,n,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new km;if(o.issues.length){const a=new(i?.Err??e)(o.issues.map(l=>Zl(l,s,Kl())));throw Z8(a,i?.callee),a}return o.value},pce=e=>async(t,n,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new(i?.Err??e)(o.issues.map(l=>Zl(l,s,Kl())));throw Z8(a,i?.callee),a}return o.value},J8=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new km;return s.issues.length?{success:!1,error:new(e??Q8)(s.issues.map(o=>Zl(o,i,Kl())))}:{success:!0,data:s.value}},mce=J8(X8),eV=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>Zl(o,i,Kl())))}:{success:!0,data:s.value}},gce=eV(X8),vce=/^[cC][^\s-]{8,}$/,yce=/^[0-9a-z]+$/,bce=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_ce=/^[0-9a-vA-V]{20}$/,wce=/^[A-Za-z0-9]{27}$/,xce=/^[a-zA-Z0-9_-]{21}$/,Sce=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ece=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cj=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Cce=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,kce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Tce(){return new RegExp(kce,"u")}const Pce=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rce=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Ice=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Oce=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Dce=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,tV=/^[A-Za-z0-9_-]*$/,Ace=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Mce=/^\+(?:[0-9]){6,14}[0-9]$/,nV="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Nce=new RegExp(`^${nV}$`);function rV(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function jce(e){return new RegExp(`^${rV(e)}$`)}function Lce(e){const t=rV({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${nV}T(?:${r})$`)}const Fce=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$ce=/^\d+$/,zce=/^-?\d+(?:\.\d+)?/i,Vce=/true|false/i,Uce=/null/i,Bce=/^[^A-Z]*$/,Hce=/^[^a-z]*$/,Li=ye("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),iV={number:"number",bigint:"bigint",object:"date"},sV=ye("$ZodCheckLessThan",(e,t)=>{Li.init(e,t);const n=iV[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oV=ye("$ZodCheckGreaterThan",(e,t)=>{Li.init(e,t);const n=iV[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qce=ye("$ZodCheckMultipleOf",(e,t)=>{Li.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):ece(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Wce=ye("$ZodCheckNumberFormat",(e,t)=>{Li.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=ice[t.format];e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,a.minimum=i,a.maximum=s,n&&(a.pattern=$ce)}),e._zod.check=o=>{const a=o.value;if(n){if(!Number.isInteger(a)){o.issues.push({expected:r,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}a<i&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inst:e})}}),Gce=ye("$ZodCheckMaxLength",(e,t)=>{var n;Li.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!LP(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=$P(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Kce=ye("$ZodCheckMinLength",(e,t)=>{var n;Li.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!LP(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=$P(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Zce=ye("$ZodCheckLengthEquals",(e,t)=>{var n;Li.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!LP(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=$P(i),a=s>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),m_=ye("$ZodCheckStringFormat",(e,t)=>{var n,r;Li.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Yce=ye("$ZodCheckRegex",(e,t)=>{m_.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Qce=ye("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bce),m_.init(e,t)}),Xce=ye("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Hce),m_.init(e,t)}),Jce=ye("$ZodCheckIncludes",(e,t)=>{Li.init(e,t);const n=ig(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input
vendor: 5,694 bytes, lines 19-21
19:i.value,inst:e,continue:!t.abort})}}),ede=ye("$ZodCheckStartsWith",(e,t)=>{Li.init(e,t);const n=new RegExp(`^${ig(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),tde=ye("$ZodCheckEndsWith",(e,t)=>{Li.init(e,t);const n=new RegExp(`.*${ig(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),nde=ye("$ZodCheckOverwrite",(e,t)=>{Li.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class rde{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
20`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>`  ${s}`)];return new t(...n,i.join(`
21`))}}const ide={major:4,minor:0,patch:0},wn=ye("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ide;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,o,a)=>{let l=Zp(s),u;for(const f of o){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(l)continue;const d=s.issues.length,p=f._zod.check(s);if(p instanceof Promise&&a?.async===!1)throw new km;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,s.issues.length!==d&&(l||(l=Zp(s,d)))});else{if(s.issues.length===d)continue;l||(l=Zp(s,d))}}return u?u.then(()=>s):s};e._zod.run=(s,o)=>{const a=e._zod.parse(s,o);if(a instanceof Promise){if(o.async===!1)throw new km;return a.then(l=>i(l,r,o))}return i(a,r,o)}}e["~standard"]={validate:i=>{try{const s=mce(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return gce(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),zP=ye("$ZodString",(e,t)=>{wn.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Fce(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),An=ye("$ZodStringFormat",(e,t)=>{m_.init(e,t),zP.init(e,t)}),sde=ye("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ece),An.init(e,t)}),ode=ye("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=cj(r))}else t.pattern??(t.pattern=cj());An.init(e,t)}),ade=ye("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Cce),An.init(e,t)}),lde=ye("$ZodURL",(e,t)=>{An.init(e,t),e._zod.check=n=>{try{const r=n.value,i=new URL(r),s=i.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Ace.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&s.endsWith("/")?n.value=s.slice(0,-1):n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),ude=ye("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Tce()),An.init(e,t)}),cde=ye("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=xce),An.init(e,t)}),dde=ye("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=vce),An.init(e,t)}),fde=ye("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yce),An.init(e,t)}),hde=ye("$ZodULID",(e,t)=>{t.pattern??(t.pattern=bce),An.init(e,t)}),pde=ye("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_ce),An.init(e,t)}),mde=ye("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=wce),An.init(e,t)}),gde=ye("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Lce(t)),An.init(e,t)}),vde=ye("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Nce),An.init(e,t)}),yde=ye("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=jce(t)),An.init(e,t)}),bde=ye("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Sce),An.init(e,t)}),_de=ye("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Pce),An.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),wde=ye("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Rce),An.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),xde=ye("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Ice),An.init(e,t)}),Sde=ye("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Oce),An.init(e,t),e._zod.check=n=>{const[r,i]=n.value.split("/");try{if(!i)throw new Error;const s=Number(i);if(`${s}`!==i)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function aV(e){if(e==="")return!0;
vendor: 5,262 bytes, lines 21-44
21if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Ede=ye("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Dce),An.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{aV(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Cde(e){if(!tV.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return aV(n)}const kde=ye("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=tV),An.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{Cde(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Tde=ye("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Mce),An.init(e,t)});function Pde(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const Rde=ye("$ZodJWT",(e,t)=>{An.init(e,t),e._zod.check=n=>{Pde(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),lV=ye("$ZodNumber",(e,t)=>{wn.init(e,t),e._zod.pattern=e._zod.bag.pattern??zce,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),Ide=ye("$ZodNumber",(e,t)=>{Wce.init(e,t),lV.init(e,t)}),Ode=ye("$ZodBoolean",(e,t)=>{wn.init(e,t),e._zod.pattern=Vce,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),Dde=ye("$ZodNull",(e,t)=>{wn.init(e,t),e._zod.pattern=Uce,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),Ade=ye("$ZodUnknown",(e,t)=>{wn.init(e,t),e._zod.parse=n=>n}),Mde=ye("$ZodNever",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function dj(e,t,n){e.issues.length&&t.issues.push(...rc(n,e.issues)),t.value[n]=e.value}const Nde=ye("$ZodArray",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const a=i[o],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?s.push(l.then(u=>dj(u,n,o))):dj(l,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function fy(e,t,n){e.issues.length&&t.issues.push(...rc(n,e.issues)),t.value[n]=e.value}function fj(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...rc(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const jde=ye("$ZodObject",(e,t)=>{wn.init(e,t);const n=jP(()=>{const d=Object.keys(t.shape);for(const m of d)if(!(t.shape[m]instanceof wn))throw new Error(`Invalid element at key "${m}": expected a Zod schema`);const p=rce(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(p)}});sn(e._zod,"propValues",()=>{const d=t.shape,p={};for(const m in d){const v=d[m]._zod;if(v.values){p[m]??(p[m]=new Set);for(const _ of v.values)p[m].add(_)}}return p});const r=d=>{const p=new rde(["shape","payload","ctx"]),m=n.value,v=S=>{const C=ep(S);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};p.write("const input = payload.value;");const _=Object.create(null);let w=0;for(const S of m.keys)_[S]=`key_${w++}`;p.write("const newResult = {}");for(const S of m.keys)if(m.optionalKeys.has(S)){const C=_[S];p.write(`const ${C} = ${v(S)};`);const R=ep(S);p.write(`
22        if (${C}.issues.length) {
23          if (input[${R}] === undefined) {
24            if (${R} in input) {
25              newResult[${R}] = undefined;
26            }
27          } else {
28            payload.issues = payload.issues.concat(
29              ${C}.issues.map((iss) => ({
30                ...iss,
31                path: iss.path ? [${R}, ...iss.path] : [${R}],
32              }))
33            );
34          }
35        } else if (${C}.value === undefined) {
36          if (${R} in input) newResult[${R}] = undefined;
37        } else {
38          newResult[${R}] = ${C}.value;
39        }
40        `)}else{const C=_[S];p.write(`const ${C} = ${v(S)};`),p.write(`
41          if (${C}.issues.length) payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
42            ...iss,
43            path: iss.path ? [${ep(S)}, ...iss.path] : [${ep(S)}]
44          })));`),p.write(`newResult[${ep(S)}] = ${C}.value`)}p.write("payload.value = newResult;"),p.write("return payload;");const x=p.compile();return(S,C)=>x(d,S,C)};let i;const s=Q0,o=!G8.jitless,l=o&&tce.value,u=t.catchall;let f;e._zod.parse=(d,p)=>{f??(f=n.value);const m=d.value;if(!s(m))return d.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),d;const v=[];
44if(o&&l&&p?.async===!1&&p.jitless!==!0)i||(i=r(t.shape)),d=i(d,p);else{d.value={};const C=f.shape;for(const R of f.keys){const P=C[R],k=P._zod.run({value:m[R],issues:[]},p),I=P._zod.optin==="optional"&&P._zod.optout==="optional";k instanceof Promise?v.push(k.then(D=>I?fj(D,d,R,m):fy(D,d,R))):I?fj(k,d,R,m):fy(k,d,R)}}if(!u)return v.length?Promise.all(v).then(()=>d):d;const _=[],w=f.keySet,x=u._zod,S=x.def.type;for(const C of Object.keys(m)){if(w.has(C))continue;if(S==="never"){_.push(C);continue}const R=x.run({value:m[C],issues:[]},p);R instanceof Promise?v.push(R.then(P=>fy(P,d,C))):fy(R,d,C)}return _.length&&d.issues.push({code:"unrecognized_keys",keys:_,input:m,inst:e}),v.length?Promise.all(v).then(()=>d):d}});function hj(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(s=>Zl(s,r,Kl())))}),t}const uV=ye("$ZodUnion",(e,t)=>{wn.init(e,t),sn(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),sn(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),sn(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),sn(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>FP(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let i=!1;const s=[];for(const o of t.options){const a=o._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)s.push(a),i=!0;else{if(a.issues.length===0)return a;s.push(a)}}return i?Promise.all(s).then(o=>hj(o,n,e,r)):hj(s,n,e,r)}}),Lde=ye("$ZodDiscriminatedUnion",(e,t)=>{uV.init(e,t);const n=e._zod.parse;sn(e._zod,"propValues",()=>{const i={};for(const s of t.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,l]of Object.entries(o)){i[a]||(i[a]=new Set);for(const u of l)i[a].add(u)}}return i});const r=jP(()=>{const i=t.options,s=new Map;for(const o of i){const a=o._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const l of a){if(s.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);s.set(l,o)}}return s});e._zod.parse=(i,s)=>{const o=i.value;if(!Q0(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const a=r.value.get(o?.[t.discriminator]);return a?a._zod.run(i,s):t.unionFallback?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:o,path:[t.discriminator],inst:e}),i)}}),Fde=ye("$ZodIntersection",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([l,u])=>pj(n,l,u)):pj(n,s,o)}});function HC(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(X0(e)&&X0(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const o=HC(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],o=HC(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function pj(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Zp(e))return e;const r=HC(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const $de=ye("$ZodRecord",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!X0(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[];if(t.keyType._zod.values){const o=t.keyType._zod.values;n.value={};for(const l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:i[l],issues:[]},r);u instanceof Promise?s.push(u.then(f=>{f.issues.length&&n.issues.push(...rc(l,f.issues)),n.value[l]=f.value})):(u.issues.length&&n.issues.push(...rc(l,u.issues)),n.value[l]=u.value)}let a;for(const l in i)o.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else{n.value={};for(const o of Reflect.ownKeys(i)){if(o==="__proto__")continue;const a=t.keyType._zod.run({value:o,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>
44Zl(u,r,Kl())),input:o,path:[o],inst:e}),n.value[a.value]=a.value;continue}const l=t.valueType._zod.run({value:i[o],issues:[]},r);l instanceof Promise?s.push(l.then(u=>{u.issues.length&&n.issues.push(...rc(o,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...rc(o,l.issues)),n.value[a.value]=l.value)}}return s.length?Promise.all(s).then(()=>n):n}}),zde=ye("$ZodEnum",(e,t)=>{wn.init(e,t);const n=K8(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>nce.has(typeof r)).map(r=>typeof r=="string"?ig(r):r.toString()).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return e._zod.values.has(s)||r.issues.push({code:"invalid_value",values:n,input:s,inst:e}),r}}),Vde=ye("$ZodLiteral",(e,t)=>{wn.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?ig(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,r)=>{const i=n.value;return e._zod.values.has(i)||n.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),n}}),Ude=ye("$ZodTransform",(e,t)=>{wn.init(e,t),e._zod.parse=(n,r)=>{const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n));if(i instanceof Promise)throw new km;return n.value=i,n}}),Bde=ye("$ZodOptional",(e,t)=>{wn.init(e,t),e._zod.optin="optional",e._zod.optout="optional",sn(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),sn(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${FP(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),Hde=ye("$ZodNullable",(e,t)=>{wn.init(e,t),sn(e._zod,"optin",()=>t.innerType._zod.optin),sn(e._zod,"optout",()=>t.innerType._zod.optout),sn(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${FP(n.source)}|null)$`):void 0}),sn(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),qde=ye("$ZodDefault",(e,t)=>{wn.init(e,t),e._zod.optin="optional",sn(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>mj(s,t)):mj(i,t)}});function mj(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Wde=ye("$ZodPrefault",(e,t)=>{wn.init(e,t),e._zod.optin="optional",sn(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),Gde=ye("$ZodNonOptional",(e,t)=>{wn.init(e,t),sn(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>gj(s,e)):gj(i,e)}});function gj(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Kde=ye("$ZodCatch",(e,t)=>{wn.init(e,t),e._zod.optin="optional",sn(e._zod,"optout",()=>t.innerType._zod.optout),sn(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>Zl(o,r,Kl()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Zl(s,r,Kl()))},input:n.value}),n.issues=[]),n)}}),Zde=ye("$ZodPipe",(e,t)=>{wn.init(e,t),sn(e._zod,"values",()=>t.in._zod.values),sn(e._zod,"optin",()=>t.in._zod.optin),sn(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>vj(s,t,r)):vj(i,t,r)}});
vendor: 5,920 bytes, line 44
44function vj(e,t,n){return Zp(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const Yde=ye("$ZodReadonly",(e,t)=>{wn.init(e,t),sn(e._zod,"propValues",()=>t.innerType._zod.propValues),sn(e._zod,"values",()=>t.innerType._zod.values),sn(e._zod,"optin",()=>t.innerType._zod.optin),sn(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(yj):yj(i)}});function yj(e){return e.value=Object.freeze(e.value),e}const Qde=ye("$ZodLazy",(e,t)=>{wn.init(e,t),sn(e._zod,"innerType",()=>t.getter()),sn(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),sn(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),sn(e._zod,"optin",()=>e._zod.innerType._zod.optin),sn(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),Xde=ye("$ZodCustom",(e,t)=>{Li.init(e,t),wn.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>bj(s,n,r,e));bj(i,n,r,e)}});function bj(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Tm(i))}}class cV{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function Jde(){return new cV}const Ip=Jde();function efe(e,t){return new e({type:"string",...ut(t)})}function tfe(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ut(t)})}function _j(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ut(t)})}function nfe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ut(t)})}function rfe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ut(t)})}function ife(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ut(t)})}function sfe(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ut(t)})}function ofe(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ut(t)})}function afe(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ut(t)})}function lfe(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ut(t)})}function ufe(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ut(t)})}function cfe(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ut(t)})}function dfe(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ut(t)})}function ffe(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ut(t)})}function hfe(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ut(t)})}function pfe(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ut(t)})}function mfe(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ut(t)})}function gfe(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ut(t)})}function vfe(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ut(t)})}function yfe(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ut(t)})}function bfe(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ut(t)})}function _fe(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ut(t)})}function wfe(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ut(t)})}function xfe(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ut(t)})}function Sfe(e,t){return new e({type:"string",format:"date",check:"string_format",...ut(t)})}function Efe(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ut(t)})}function Cfe(e,t){return new e({type:"string",format:"duration",check:"string_format",...ut(t)})}function kfe(e,t){return new e({type:"number",checks:[],...ut(t)})}function Tfe(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ut(t)})}function Pfe(e,t){return new e({type:"boolean",...ut(t)})}function Rfe(e,t){return new e({type:"null",...ut(t)})}function Ife(e){return new e({type:"unknown"})}function Ofe(e,t){return new e({type:"never",...ut(t)})}function wj(e,t){return new sV({check:"less_than",...ut(t),value:e,inclusive:!1})}function W1(e,t){return new sV({check:"less_than",...ut(t),value:e,inclusive:!0})}function xj(e,t){return new oV({check:"greater_than",...ut(t),value:e,inclusive:!1})}function G1(e,t){return new oV({check:"greater_than",...ut(t),value:e,inclusive:!0})}function Sj(e,t){return new qce({check:"multiple_of",...ut(t),value:e})}function dV(e,t){return new Gce({check:"max_length",...ut(t),maximum:e})}function J0(e,t){return new Kce({check:"min_length",...ut(t),minimum:e})}function fV(e,t){return new Zce({check:"length_equals",...ut(t),length:e})}function Dfe(e,t){return new Yce({check:"string_format",format:"regex",...ut(t),pattern:e})}function Afe(e){return new Qce({check:"string_format",format:"lowercase",...ut(e)})}function Mfe(e){return new Xce({check:"string_format",format:"up
44percase",...ut(e)})}function Nfe(e,t){return new Jce({check:"string_format",format:"includes",...ut(t),includes:e})}function jfe(e,t){return new ede({check:"string_format",format:"starts_with",...ut(t),prefix:e})}function Lfe(e,t){return new tde({check:"string_format",format:"ends_with",...ut(t),suffix:e})}function sg(e){return new nde({check:"overwrite",tx:e})}function Ffe(e){return sg(t=>t.normalize(e))}function $fe(){return sg(e=>e.trim())}function zfe(){return sg(e=>e.toLowerCase())}function Vfe(){return sg(e=>e.toUpperCase())}function Ufe(e,t,n){return new e({type:"array",element:t,...ut(n)})}function Bfe(e,t,n){const r=ut(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function Hfe(e,t,n){return new e({type:"custom",check:"custom",fn:t,...ut(n)})}class Ej{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??Ip,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var r;const i=t._zod.def,s={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},o=this.seen.get(t);if(o)return o.count++,n.schemaPath.includes(t)&&(o.cycle=n.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,a);const l=t._zod.toJSONSchema?.();if(l)a.schema=l;else{const d={...n,schemaPath:[...n.schemaPath,t],path:n.path},p=t._zod.parent;if(p)a.ref=p,this.process(p,d),this.seen.get(p).isParent=!0;else{const m=a.schema;switch(i.type){case"string":{const v=m;v.type="string";const{minimum:_,maximum:w,format:x,patterns:S,contentEncoding:C}=t._zod.bag;if(typeof _=="number"&&(v.minLength=_),typeof w=="number"&&(v.maxLength=w),x&&(v.format=s[x]??x,v.format===""&&delete v.format),C&&(v.contentEncoding=C),S&&S.size>0){const R=[...S];R.length===1?v.pattern=R[0].source:R.length>1&&(a.schema.allOf=[...R.map(P=>({...this.target==="draft-7"?{type:"string"}:{},pattern:P.source}))])}break}case"number":{const v=m,{minimum:_,maximum:w,format:x,multipleOf:S,exclusiveMaximum:C,exclusiveMinimum:R}=t._zod.bag;typeof x=="string"&&x.includes("int")?v.type="integer":v.type="number",typeof R=="number"&&(v.exclusiveMinimum=R),typeof _=="number"&&(v.minimum=_,typeof R=="number"&&(R>=_?delete v.minimum:delete v.exclusiveMinimum)),typeof C=="number"&&(v.exclusiveMaximum=C),typeof w=="number"&&(v.maximum=w,typeof C=="number"&&(C<=w?delete v.maximum:delete v.exclusiveMaximum)),typeof S=="number"&&(v.multipleOf=S);break}case"boolean":{const v=m;v.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{m.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{m.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{const v=m,{minimum:_,maximum:w}=t._zod.bag;typeof _=="number"&&(v.minItems=_),typeof w=="number"&&(v.maxItems=w),v.type="array",v.items=this.process(i.element,{...d,path:[...d.path,"items"]});break}case"object":{const v=m;v.type="object",v.properties={};const _=i.shape;for(const S in _)v.properties[S]=this.process(_[S],{...d,path:[...d.path,"properties",S]});const w=new Set(Object.keys(_)),x=new Set([...w].filter(S=>{const C=i.shape[S]._zod;return this.io==="input"?C.optin===void 0:C.optout===void 0}));x.size>0&&(v.required=Array.from(x)),i.catchall?._zod.def.type==="never"?v.additionalProperties=!1:i.catchall?i.catchall&&(v.additionalProperties=this.process(i.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(v.additionalProperties=!1);break}case"union":{const v=m;v.anyOf=i.options.map((_,w)=>this.process(_,{...d,path:[...d.path,"anyOf",w]}));break}case"intersection":{const v=m,_=this.process(i.left,{...d,path:[...d.path,"allOf",0]}),w=this.process(i.right,{...d,path:[...d.path,"allOf",1]}),x=C=>"allOf"in C&&Object.keys(C).length===1,S=[...x(_)?_.allOf:[_],...x(w)?w.allOf:[w]];v.allOf=S;break}case"tuple":{const v=m;v.type="array";const _=i.items.map((S,C)=>this.process(S,{...d,path:[...d.path,"prefixItems",C]}));
44if(this.target==="draft-2020-12"?v.prefixItems=_:v.items=_,i.rest){const S=this.process(i.rest,{...d,path:[...d.path,"items"]});this.target==="draft-2020-12"?v.items=S:v.additionalItems=S}i.rest&&(v.items=this.process(i.rest,{...d,path:[...d.path,"items"]}));const{minimum:w,maximum:x}=t._zod.bag;typeof w=="number"&&(v.minItems=w),typeof x=="number"&&(v.maxItems=x);break}case"record":{const v=m;v.type="object",v.propertyNames=this.process(i.keyType,{...d,path:[...d.path,"propertyNames"]}),v.additionalProperties=this.process(i.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{const v=m,_=K8(i.entries);_.every(w=>typeof w=="number")&&(v.type="number"),_.every(w=>typeof w=="string")&&(v.type="string"),v.enum=_;break}case"literal":{const v=m,_=[];for(const w of i.values)if(w===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof w=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");_.push(Number(w))}else _.push(w);if(_.length!==0)if(_.length===1){const w=_[0];v.type=w===null?"null":typeof w,v.const=w}else _.every(w=>typeof w=="number")&&(v.type="number"),_.every(w=>typeof w=="string")&&(v.type="string"),_.every(w=>typeof w=="boolean")&&(v.type="string"),_.every(w=>w===null)&&(v.type="null"),v.enum=_;break}case"file":{const v=m,_={type:"string",format:"binary",contentEncoding:"binary"},{minimum:w,maximum:x,mime:S}=t._zod.bag;w!==void 0&&(_.minLength=w),x!==void 0&&(_.maxLength=x),S?S.length===1?(_.contentMediaType=S[0],Object.assign(v,_)):v.anyOf=S.map(C=>({..._,contentMediaType:C})):Object.assign(v,_);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{const v=this.process(i.innerType,d);m.anyOf=[v,{type:"null"}];break}case"nonoptional":{this.process(i.innerType,d),a.ref=i.innerType;break}case"success":{const v=m;v.type="boolean";break}case"default":{this.process(i.innerType,d),a.ref=i.innerType,m.default=JSON.parse(JSON.stringify(i.defaultValue));break}case"prefault":{this.process(i.innerType,d),a.ref=i.innerType,this.io==="input"&&(m._prefault=JSON.parse(JSON.stringify(i.defaultValue)));break}case"catch":{this.process(i.innerType,d),a.ref=i.innerType;let v;try{v=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}m.default=v;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{const v=m,_=t._zod.pattern;if(!_)throw new Error("Pattern not found in template literal");v.type="string",v.pattern=_.source;break}case"pipe":{const v=this.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;this.process(v,d),a.ref=v;break}case"readonly":{this.process(i.innerType,d),a.ref=i.innerType,m.readOnly=!0;break}case"promise":{this.process(i.innerType,d),a.ref=i.innerType;break}case"optional":{this.process(i.innerType,d),a.ref=i.innerType;break}case"lazy":{const v=t._zod.innerType;this.process(v,d),a.ref=v;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}}}}const u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&br(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,n){const r={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},i=this.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=f=>{const d=this.target==="draft-2020-12"?"$defs":"definitions";if(r.external){const _=r.external.registry.get(f[0])?.id,w=r.external.uri??(S=>S);if(_)return{ref:w(_)};const x=f[1].defId??f[1].schema.id??`schema${this.counter++}`;return f[1].defId=x,{defId:x,ref:`${w("__shared")}#/${d}/${x}`}}if(f[1]===i)return{ref:"#"};const m=`#/${d}/`,v=f[1].schema.id??`__schema${this.counter++}`;return{defId:v,ref:m+v}},o=f=>{if(f[1].schema.$ref)return;const d=f[1],{ref:p,defId:m}=s(f);d.def={...d.schema},m&&(d.defId=m);const v=d.schema;for(const _ in v)delete v[_];v.$ref=p};if(r.cycles==="throw")for(const f of this.seen.entries()){const d=f[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
45
46Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of this.seen.entries()){const d=f[1];if(t===f[0]){o(f);continue}if(r.external){const m=r.external.registry.get(f[0])?.id;if(t!==f[0]&&m){o(f);continue}}if(this.metadataRegistry.get(f[0])?.id){o(f);continue}if(d.cycle){o(f);continue}if(d.count>1&&r.reused==="ref"){o(f);continue}}const a=(f,d)=>{const p=this.seen.get(f),m=p.def??p.schema,v={...m};if(p.ref===null)return;const _=p.ref;if(p.ref=null,_){a(_,d);const w=this.seen.get(_).schema;w.$ref&&d.target==="draft-7"?(m.allOf=m.allOf??[],m.allOf.push(w)):(Object.assign(m,w),Object.assign(m,v))}p.isParent||this.override({zodSchema:f,jsonSchema:m,path:p.path??[]})};for(const f of[...this.seen.entries()].reverse())a(f[0],{target:this.target});const l={};
46if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),r.external?.uri){const f=r.external.registry.get(t)?.id;if(!f)throw new Error("Schema is missing an `id` property");l.$id=r.external.uri(f)}Object.assign(l,i.def);const u=r.external?.defs??{};for(const f of this.seen.entries()){const d=f[1];d.def&&d.defId&&(u[d.defId]=d.def)}r.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?l.$defs=u:l.definitions=u);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}}function qfe(e,t){if(e instanceof cV){const r=new Ej(t),i={};for(const a of e._idmap.entries()){const[l,u]=a;r.process(u)}const s={},o={registry:e,uri:t?.uri,defs:i};for(const a of e._idmap.entries()){const[l,u]=a;s[l]=r.emit(u,{...t,external:o})}if(Object.keys(i).length>0){const a=r.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[a]:i}}return{schemas:s}}const n=new Ej(t);return n.process(e),n.emit(e,t)}function br(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;switch(i.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return br(i.element,n);case"object":{for(const s in i.shape)if(br(i.shape[s],n))return!0;return!1}case"union":{for(const s of i.options)if(br(s,n))return!0;return!1}case"intersection":return br(i.left,n)||br(i.right,n);case"tuple":{for(const s of i.items)if(br(s,n))return!0;return!!(i.rest&&br(i.rest,n))}case"record":return br(i.keyType,n)||br(i.valueType,n);case"map":return br(i.keyType,n)||br(i.valueType,n);case"set":return br(i.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return br(i.innerType,n);case"lazy":return br(i.getter(),n);case"default":return br(i.innerType,n);case"prefault":return br(i.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return br(i.in,n)||br(i.out,n);case"success":return!1;case"catch":return!1}throw new Error(`Unknown schema type: ${i.type}`)}const Wfe=ye("ZodISODateTime",(e,t)=>{gde.init(e,t),Vn.init(e,t)});function Gfe(e){return xfe(Wfe,e)}const Kfe=ye("ZodISODate",(e,t)=>{vde.init(e,t),Vn.init(e,t)});function Zfe(e){return Sfe(Kfe,e)}const Yfe=ye("ZodISOTime",(e,t)=>{yde.init(e,t),Vn.init(e,t)});function Qfe(e){return Efe(Yfe,e)}const Xfe=ye("ZodISODuration",(e,t)=>{bde.init(e,t),Vn.init(e,t)});function Jfe(e){return Cfe(Xfe,e)}const ehe=(e,t)=>{Q8.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>fce(e,n)},flatten:{value:n=>dce(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},g_=ye("ZodError",ehe,{Parent:Error}),the=hce(g_),nhe=pce(g_),rhe=J8(g_),hV=eV(g_),Mn=ye("ZodType",(e,t)=>(wn.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>jc(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>the(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>rhe(e,n,r),e.parseAsync=async(n,r)=>nhe(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>hV(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(spe(n,r)),e.superRefine=n=>e.check(ope(n)),e.overwrite=n=>e.check(sg(n)),e.optional=()=>Tj(e),e.nullable=()=>Pj(e),e.nullish=()=>Tj(Pj(e)),e.nonoptional=n=>Zhe(e,n),e.array=()=>vV(e),e.or=n=>_V([e,n]),e.and=n=>Lhe(e,n),e.transform=n=>Rj(e,Bhe(n)),e.default=n=>Whe(e,n),e.prefault=n=>Khe(e,n),e.catch=n=>Qhe(e,n),e.pipe=n=>Rj(e,n),e.readonly=()=>epe(e),e.describe=n=>{const r=e.clone();return Ip.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return Ip.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return Ip.get(e);const r=e.clone();return Ip.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),pV=ye("_ZodString",(e,t)=>{zP.init(e,t),Mn.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Dfe(...r)),e.includes=(...r)=>e.check(Nfe(...r)),e.startsWith=(...r)=>e.check(jfe(...r)),e.endsWith=(...r)=>e.check(Lfe(...r)),e.min=(...r)=>e.check(J0(...r)),e.max=(...r)=>e.check(dV(...r)),e.length=(...r)=>e.check(fV(...r)),e.nonempty=(...r)=>e.check(J0(1,...r)),e.lowercase=r=>
vendor: 5,511 bytes, line 46
46e.check(Afe(r)),e.uppercase=r=>e.check(Mfe(r)),e.trim=()=>e.check($fe()),e.normalize=(...r)=>e.check(Ffe(...r)),e.toLowerCase=()=>e.check(zfe()),e.toUpperCase=()=>e.check(Vfe())}),ihe=ye("ZodString",(e,t)=>{zP.init(e,t),pV.init(e,t),e.email=n=>e.check(tfe(ohe,n)),e.url=n=>e.check(ofe(ahe,n)),e.jwt=n=>e.check(wfe(xhe,n)),e.emoji=n=>e.check(afe(lhe,n)),e.guid=n=>e.check(_j(Cj,n)),e.uuid=n=>e.check(nfe(hy,n)),e.uuidv4=n=>e.check(rfe(hy,n)),e.uuidv6=n=>e.check(ife(hy,n)),e.uuidv7=n=>e.check(sfe(hy,n)),e.nanoid=n=>e.check(lfe(uhe,n)),e.guid=n=>e.check(_j(Cj,n)),e.cuid=n=>e.check(ufe(che,n)),e.cuid2=n=>e.check(cfe(dhe,n)),e.ulid=n=>e.check(dfe(fhe,n)),e.base64=n=>e.check(yfe(bhe,n)),e.base64url=n=>e.check(bfe(_he,n)),e.xid=n=>e.check(ffe(hhe,n)),e.ksuid=n=>e.check(hfe(phe,n)),e.ipv4=n=>e.check(pfe(mhe,n)),e.ipv6=n=>e.check(mfe(ghe,n)),e.cidrv4=n=>e.check(gfe(vhe,n)),e.cidrv6=n=>e.check(vfe(yhe,n)),e.e164=n=>e.check(_fe(whe,n)),e.datetime=n=>e.check(Gfe(n)),e.date=n=>e.check(Zfe(n)),e.time=n=>e.check(Qfe(n)),e.duration=n=>e.check(Jfe(n))});function she(e){return efe(ihe,e)}const Vn=ye("ZodStringFormat",(e,t)=>{An.init(e,t),pV.init(e,t)}),ohe=ye("ZodEmail",(e,t)=>{ade.init(e,t),Vn.init(e,t)}),Cj=ye("ZodGUID",(e,t)=>{sde.init(e,t),Vn.init(e,t)}),hy=ye("ZodUUID",(e,t)=>{ode.init(e,t),Vn.init(e,t)}),ahe=ye("ZodURL",(e,t)=>{lde.init(e,t),Vn.init(e,t)}),lhe=ye("ZodEmoji",(e,t)=>{ude.init(e,t),Vn.init(e,t)}),uhe=ye("ZodNanoID",(e,t)=>{cde.init(e,t),Vn.init(e,t)}),che=ye("ZodCUID",(e,t)=>{dde.init(e,t),Vn.init(e,t)}),dhe=ye("ZodCUID2",(e,t)=>{fde.init(e,t),Vn.init(e,t)}),fhe=ye("ZodULID",(e,t)=>{hde.init(e,t),Vn.init(e,t)}),hhe=ye("ZodXID",(e,t)=>{pde.init(e,t),Vn.init(e,t)}),phe=ye("ZodKSUID",(e,t)=>{mde.init(e,t),Vn.init(e,t)}),mhe=ye("ZodIPv4",(e,t)=>{_de.init(e,t),Vn.init(e,t)}),ghe=ye("ZodIPv6",(e,t)=>{wde.init(e,t),Vn.init(e,t)}),vhe=ye("ZodCIDRv4",(e,t)=>{xde.init(e,t),Vn.init(e,t)}),yhe=ye("ZodCIDRv6",(e,t)=>{Sde.init(e,t),Vn.init(e,t)}),bhe=ye("ZodBase64",(e,t)=>{Ede.init(e,t),Vn.init(e,t)}),_he=ye("ZodBase64URL",(e,t)=>{kde.init(e,t),Vn.init(e,t)}),whe=ye("ZodE164",(e,t)=>{Tde.init(e,t),Vn.init(e,t)}),xhe=ye("ZodJWT",(e,t)=>{Rde.init(e,t),Vn.init(e,t)}),mV=ye("ZodNumber",(e,t)=>{lV.init(e,t),Mn.init(e,t),e.gt=(r,i)=>e.check(xj(r,i)),e.gte=(r,i)=>e.check(G1(r,i)),e.min=(r,i)=>e.check(G1(r,i)),e.lt=(r,i)=>e.check(wj(r,i)),e.lte=(r,i)=>e.check(W1(r,i)),e.max=(r,i)=>e.check(W1(r,i)),e.int=r=>e.check(kj(r)),e.safe=r=>e.check(kj(r)),e.positive=r=>e.check(xj(0,r)),e.nonnegative=r=>e.check(G1(0,r)),e.negative=r=>e.check(wj(0,r)),e.nonpositive=r=>e.check(W1(0,r)),e.multipleOf=(r,i)=>e.check(Sj(r,i)),e.step=(r,i)=>e.check(Sj(r,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function She(e){return kfe(mV,e)}const Ehe=ye("ZodNumberFormat",(e,t)=>{Ide.init(e,t),mV.init(e,t)});function kj(e){return Tfe(Ehe,e)}const Che=ye("ZodBoolean",(e,t)=>{Ode.init(e,t),Mn.init(e,t)});function khe(e){return Pfe(Che,e)}const The=ye("ZodNull",(e,t)=>{Dde.init(e,t),Mn.init(e,t)});function Phe(e){return Rfe(The,e)}const Rhe=ye("ZodUnknown",(e,t)=>{Ade.init(e,t),Mn.init(e,t)});function eb(){return Ife(Rhe)}const Ihe=ye("ZodNever",(e,t)=>{Mde.init(e,t),Mn.init(e,t)});function gV(e){return Ofe(Ihe,e)}const Ohe=ye("ZodArray",(e,t)=>{Nde.init(e,t),Mn.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(J0(n,r)),e.nonempty=n=>e.check(J0(1,n)),e.max=(n,r)=>e.check(dV(n,r)),e.length=(n,r)=>e.check(fV(n,r)),e.unwrap=()=>e.element});function vV(e,t){return Ufe(Ohe,e,t)}const yV=ye("ZodObject",(e,t)=>{jde.init(e,t),Mn.init(e,t),sn(e,"shape",()=>t.shape),e.keyof=()=>wV(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:eb()}),e.loose=()=>e.clone({...e._zod.def,catchall:eb()}),e.strict=()=>e.clone({...e._zod.def,catchall:gV()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>ace(e,n),e.merge=n=>lce(e,n),e.pick=n=>sce(e,n),e.omit=n=>oce(e,n),e.partial=(...n)=>uce(xV,e,n[0]),e.required=(...n)=>cce(SV,e,n[0])});function Dhe(e,t){const n={type:"object",get shape(){return p_(this,"shape",{...e}),this.shape},...ut(t)};return new yV(n)}function Ahe(e,t){return new yV({type:"object",get shape(){return p_(this,"shape",{...e}),this.shape},catchall:eb(),...ut(t)})}const bV=ye("ZodUnion",(e,t)=>{uV.init(e,t),Mn.init(e,t),e.options=t.options});function _V(e,t){return new bV({type:"union",options:e,...ut(t)})}const Mhe=ye("ZodDiscriminatedUnion",(e,t)=>{bV.init(e,t),Lde.init(e,t)});function Nhe(e,t,n){return new Mhe({type:"union",options:t,discriminator:e,...ut(n)})}const jhe=ye("ZodIntersection",(e,t)=>{Fde.init(e,t),Mn.init(e,t)});function Lhe(e,t){return new jhe({type:"intersection",left:e,right:t})}const Fhe=ye("ZodRecord",(e,t)=>{$de.init(e,t),Mn.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function $he(e,t,n){return new Fhe({type:"record",keyType:e,valueType:t,...ut(n)})}const qC=ye("ZodEnum",(e,t)=>{zde.init(e,t),Mn.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);
vendor: 25,802 bytes, lines 46-59
46return new qC({...t,checks:[],...ut(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new qC({...t,checks:[],...ut(i),entries:s})}});function wV(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new qC({type:"enum",entries:n,...ut(t)})}const zhe=ye("ZodLiteral",(e,t)=>{Vde.init(e,t),Mn.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Vhe(e,t){return new zhe({type:"literal",values:Array.isArray(e)?e:[e],...ut(t)})}const Uhe=ye("ZodTransform",(e,t)=>{Ude.init(e,t),Mn.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=s=>{if(typeof s=="string")n.issues.push(Tm(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),o.continue??(o.continue=!0),n.issues.push(Tm(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n)):(n.value=i,n)}});function Bhe(e){return new Uhe({type:"transform",transform:e})}const xV=ye("ZodOptional",(e,t)=>{Bde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Tj(e){return new xV({type:"optional",innerType:e})}const Hhe=ye("ZodNullable",(e,t)=>{Hde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Pj(e){return new Hhe({type:"nullable",innerType:e})}const qhe=ye("ZodDefault",(e,t)=>{qde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Whe(e,t){return new qhe({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const Ghe=ye("ZodPrefault",(e,t)=>{Wde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Khe(e,t){return new Ghe({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const SV=ye("ZodNonOptional",(e,t)=>{Gde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Zhe(e,t){return new SV({type:"nonoptional",innerType:e,...ut(t)})}const Yhe=ye("ZodCatch",(e,t)=>{Kde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Qhe(e,t){return new Yhe({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Xhe=ye("ZodPipe",(e,t)=>{Zde.init(e,t),Mn.init(e,t),e.in=t.in,e.out=t.out});function Rj(e,t){return new Xhe({type:"pipe",in:e,out:t})}const Jhe=ye("ZodReadonly",(e,t)=>{Yde.init(e,t),Mn.init(e,t)});function epe(e){return new Jhe({type:"readonly",innerType:e})}const tpe=ye("ZodLazy",(e,t)=>{Qde.init(e,t),Mn.init(e,t),e.unwrap=()=>e._zod.def.getter()});function npe(e){return new tpe({type:"lazy",getter:e})}const VP=ye("ZodCustom",(e,t)=>{Xde.init(e,t),Mn.init(e,t)});function rpe(e){const t=new Li({check:"custom"});return t._zod.check=e,t}function ipe(e,t){return Bfe(VP,e??(()=>!0),t)}function spe(e,t={}){return Hfe(VP,e,t)}function ope(e){const t=rpe(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(Tm(r,n.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(Tm(i))}},e(n.value,n)));return t}function ape(e,t={error:`Input not instance of ${e.name}`}){const n=new VP({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...ut(t)});return n._zod.bag.Class=e,n}class K1 extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const Ij=10,lpe=13,ju=32;function Z1(e){}function upe(e){if(typeof e=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:t=Z1,onError:n=Z1,onRetry:r=Z1,onComment:i,maxBufferSize:s}=e,o=[];let a=0,l=!0,u,f="",d=0,p,m=!1;function v(P){if(m)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(l&&(l=!1,P.charCodeAt(0)===239&&P.charCodeAt(1)===187&&P.charCodeAt(2)===191&&(P=P.slice(3))),o.length===0){const D=w(P);D!==""&&(o.push(D),a=D.length),_();return}if(P.indexOf(`
47`)===-1&&P.indexOf("\r")===-1){o.push(P),a+=P.length,_();return}o.push(P);const k=o.join("");o.length=0,a=0;const I=w(k);I!==""&&(o.push(I),a=I.length),_()}function _(){s!==void 0&&(a+f.length<=s||(m=!0,o.length=0,a=0,u=void 0,f="",d=0,p=void 0,n(new K1(`Buffered data exceeded max buffer size of ${s} characters`,{type:"max-buffer-size-exceeded"}))))}function w(P){let k=0;if(P.indexOf("\r")===-1){let I=P.indexOf(`
48`,k);for(;I!==-1;){if(k===I){d>0&&t({id:u,event:p,data:f}),u=void 0,f="",d=0,p=void 0,k=I+1,I=P.indexOf(`
49`,k);continue}const D=P.charCodeAt(k);if(Oj(P,k,D)){const L=P.charCodeAt(k+5)===ju?k+6:k+5,A=P.slice(L,I);if(d===0&&P.charCodeAt(I+1)===Ij){t({id:u,event:p,data:A}),u=void 0,f="",p=void 0,k=I+2,I=P.indexOf(`
50`,k);continue}f=d===0?A:`${f}
51${A}`,d++}else Dj(P,k,D)?p=P.slice(P.charCodeAt(k+6)===ju?k+7:k+6,I)||void 0:x(P,k,I);k=I+1,I=P.indexOf(`
52`,k)}return P.slice(k)}for(;k<P.length;){const I=P.indexOf("\r",k),D=P.indexOf(`
53`,k);let L=-1;if(I!==-1&&D!==-1?L=I<D?I:D:I!==-1?I===P.length-1?L=-1:L=I:D!==-1&&(L=D),L===-1)break;x(P,k,L),k=L+1,P.charCodeAt(k-1)===lpe&&P.charCodeAt(k)===Ij&&k++}return P.slice(k)}function x(P,k,I){if(k===I){C();return}const D=P.charCodeAt(k);if(Oj(P,k,D)){const B=P.charCodeAt(k+5)===ju?k+6:k+5,H=P.slice(B,I);f=d===0?H:`${f}
54${H}`,d++;return}if(Dj(P,k,D)){p=P.slice(P.charCodeAt(k+6)===ju?k+7:k+6,I)||void 0;return}if(D===105&&P.charCodeAt(k+1)===100&&P.charCodeAt(k+2)===58){const B=P.slice(P.charCodeAt(k+3)===ju?k+4:k+3,I);u=B.includes("\0")?void 0:B;return}if(D===58){if(i){const B=P.slice(k,I);i(B.slice(P.charCodeAt(k+1)===ju?2:1))}return}const L=P.slice(k,I),A=L.indexOf(":");if(A===-1){S(L,"",L);return}const $=L.slice(0,A),j=L.charCodeAt(A+1)===ju?2:1,V=L.slice(A+j);S($,V,L)}function S(P,k,I){switch(P){case"event":p=k||void 0;break;case"data":f=d===0?k:`${f}
55${k}`,d++;break;case"id":u=k.includes("\0")?void 0:k;break;case"retry":/^\d+$/.test(k)?r(parseInt(k,10)):n(new K1(`Invalid \`retry\` value: "${k}"`,{type:"invalid-retry",value:k,line:I}));break;default:n(new K1(`Unknown field "${P.length>20?`${P.slice(0,20)}…`:P}"`,{type:"unknown-field",field:P,value:k,line:I}));break}}function C(){d>0&&t({id:u,event:p,data:f}),u=void 0,f="",d=0,p=void 0}function R(P={}){if(P.consume&&o.length>0){const k=o.join("");x(k,0,k.length)}l=!0,u=void 0,f="",d=0,p=void 0,o.length=0,a=0,m=!1}return{feed:v,reset:R}}function Oj(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Dj(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class cpe extends TransformStream{constructor({onError:t,onRetry:n,onComment:r,maxBufferSize:i}={}){let s;super({start(o){s=upe({onEvent:a=>{o.enqueue(a)},onError(a){typeof t=="function"&&t(a),(t==="terminate"||a.type==="max-buffer-size-exceeded")&&o.error(a)},onRetry:n,onComment:r,maxBufferSize:i})},transform(o){s.feed(o)}})}}new TextDecoder;function Sd(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((n,r)=>{t[r.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(const[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}var Fs=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const s=n.length,o=new Array(t);for(let a=0;a<t;a++)o[a]=n[Math.random()*s|0];return o.join("")};if(e==null)return i;if(n.includes(r))throw new Kue({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},dpe=Fs();function fpe(e){var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1}var hpe=/"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/,ppe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;function Aj(e){const t=JSON.parse(e);return t===null||typeof t!="object"||hpe.test(e)===!1&&ppe.test(e)===!1?t:mpe(t)}function mpe(e){let t=[e];for(;t.length;){const n=t;t=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&r.constructor!==null&&typeof r.constructor=="object"&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const s=r[i];s&&typeof s=="object"&&t.push(s)}}}return e}function gpe(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return Aj(e)}try{return Aj(e)}finally{Error.stackTraceLimit=t}}function UP(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){const{additionalProperties:n}=e;e.additionalProperties=n!=null&&typeof n!="boolean"?_l(n):!1;const{properties:r}=e;if(r!=null)for(const i of Object.keys(r))r[i]=_l(r[i])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(_l):_l(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(_l)),e.allOf!=null&&(e.allOf=e.allOf.map(_l)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(_l));const{definitions:t}=e;if(t!=null)for(const n of Object.keys(t))t[n]=_l(t[n]);return e}function _l(e){return typeof e=="boolean"?e:UP(e)}var vpe=Symbol("Let zodToJsonSchema decide on which parser to use"),Mj={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},ype=e=>typeof e=="string"?{...Mj,name:e}:{...Mj,...e};function ns(){return{}}function bpe(e,t){var n,r,i;const s={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!=="ZodAny"&&(s.items=ln(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}function _pe(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function wpe(){return{type:"boolean"}}function EV(e,t){return ln(e.type._def,t)}var xpe=(e,t)=>ln(e.innerType._def,t);function CV(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map(i=>CV(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Spe(e)}}var Spe=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function Epe(e,t){return{...ln(e.innerType._def,t),default:e.defaultValue()}}function Cpe(e,t){return t.effectStrategy==="input"?ln(e.schema._def,t):ns()}function kpe(e){return{type:"string",enum:Array.from(e.values)}}var Tpe=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Ppe(e,t){const n=[ln(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),ln(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(Tpe(i))r.push(...i.allOf);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:o,...a}=i;s=a}r.push(s)}}),r.length?{allOf:r}:void 0}function Rpe(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Y1=void 0,Ys={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Y1===void 0&&(Y1=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Y1),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function kV(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":Qs(n,"email",r.message,t);break;case"format:idn-email":Qs(n,"idn-email",r.message,t);break;case"pattern:zod":ii(n,Ys.email,r.message,t);break}break;case"url":Qs(n,"uri",r.message,t);break;case"uuid":Qs(n,"uuid",r.message,t);break;case"regex":ii(n,r.regex,r.message,t);break;case"cuid":ii(n,Ys.cuid,r.message,t);break;case"cuid2":ii(n,Ys.cuid2,r.message,t);break;case"startsWith":ii(n,RegExp(`^${Q1(r.value,t)}`),r.message,t);break;case"endsWith":ii(n,RegExp(`${Q1(r.value,t)}$`),r.message,t);break;case"datetime":Qs(n,"date-time",r.message,t);break;case"date":Qs(n,"date",r.message,t);break;case"time":Qs(n,"time",r.message,t);break;case"duration":Qs(n,"duration",r.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{ii(n,RegExp(Q1(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Qs(n,"ipv4",r.message,t),r.version!=="v4"&&Qs(n,"ipv6",r.message,t);break}case"base64url":ii(n,Ys.base64url,r.message,t);break;case"jwt":ii(n,Ys.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&ii(n,Ys.ipv4Cidr,r.message,t),r.version!=="v4"&&ii(n,Ys.ipv6Cidr,r.message,t);break}case"emoji":ii(n,Ys.emoji(),r.message,t);break;case"ulid":{ii(n,Ys.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Qs(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{ii(n,Ys.base64,r.message,t);break}}break}case"nanoid":ii(n,Ys.nanoid,r.message,t)}return n}function Q1(e,t){return t.patternStrategy==="escape"?Ope(e):e}var Ipe=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ope(e){let t="";for(let n=0;n<e.length;n++)Ipe.has(e[n])||(t+="\\"),t+=e[n];return t}function Qs(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function ii(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:Nj(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=Nj(t,r)}function Nj(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source;let s="",o=!1,a=!1,l=!1;for(let u=0;u<i.length;u++){if(o){s+=i[u],o=!1;continue}if(r.i){if(a){if(i[u].match(/[a-z]/)){l?(s+=i[u],s+=`${i[u-2]}-${i[u]}`.toUpperCase(),l=!1):i[u+1]==="-"&&((n=i[u+2])!=null&&n.match(/[a-z]/))?(s+=i[u],l=!0):s+=`${i[u]}${i[u].toUpperCase()}`;continue}}else if(i[u].match(/[a-z]/)){s+=`[${i[u]}${i[u].toUpperCase()}]`;continue}}if(r.m){if(i[u]==="^"){s+=`(^|(?<=[\r
56]))`;continue}else if(i[u]==="$"){s+=`($|(?=[\r
57]))`;continue}}if(r.s&&i[u]==="."){s+=a?`${i[u]}\r
58`:`[${i[u]}\r
59]`;continue}s+=i[u],i[u]==="\\"?o=!0:a&&i[u]==="]"?a=!1:!a&&i[u]==="["&&(a=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function TV(e,t){var n,r,i,s,o,a;const l={type:"object",additionalProperties:(n=ln(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)==="ZodString"&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:u,...f}=kV(e.keyType._def,t);return{...l,propertyNames:f}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)==="ZodEnum")return{...l,propertyNames:{enum:e.keyType._def.values}};if(((o=e.keyType)==null?void 0:o._def.typeName)==="ZodBranded"&&e.keyType._def.type._def.typeName==="ZodString"&&((a=e.keyType._def.type._def.checks)!=null&&a.length)){const{type:u,...f}=EV(e.keyType._def,t);return{...l,propertyNames:f}}}return l}function Dpe(e,t){if(t.mapStrategy==="record")return TV(e,t);const n=ln(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||ns(),r=ln(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||ns();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function Ape(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function Mpe(){return{not:ns()}}function Npe(){return{type:"null"}}var WC={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function jpe(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in WC&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,s)=>{const o=WC[s._def.typeName];return o&&!i.includes(o)?[...i,o]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,s)=>{const o=typeof s._def.value;switch(o){case"string":case"number":case"boolean":return[...i,o];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((s,o,a)=>a.indexOf(s)===o);return{type:i.length>1?i:i[0],enum:n.reduce((s,o)=>s.includes(o._def.value)?s:[...s,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(s=>!r.includes(s))],[])};return Lpe(e,t)}var Lpe=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>ln(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function Fpe(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[WC[e.innerType._def.typeName],"null"]};const n=ln(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function $pe(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function zpe(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const o in i){let a=i[o];if(a===void 0||a._def===void 0)continue;const l=Upe(a),u=ln(a._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});u!==void 0&&(n.properties[o]=u,l||r.push(o))}r.length&&(n.required=r);const s=Vpe(e,t);return s!==void 0&&(n.additionalProperties=s),n}function Vpe(e,t){if(e.catchall._def.typeName!=="ZodNever")return ln(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Upe(e){try{return e.isOptional()}catch{return!0}}var Bpe=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return ln(e.innerType._def,t);const r=ln(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:ns()},r]}:ns()},Hpe=(e,t)=>{if(t.pipeStrategy==="input")return ln(e.in._def,t);if(t.pipeStrategy==="output")return ln(e.out._def,t);const n=ln(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=ln(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function qpe(e,t){return ln(e.type._def,t)}function Wpe(e,t){const r={type:"array",uniqueItems:!0,items:ln(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function Gpe(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>ln(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:ln(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>ln(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function Kpe(){return{not:ns()}}function Zpe(){return ns()}var Ype=(e,t)=>ln(e.innerType._def,t),Qpe=(e,t,n)=>{switch(t){case"ZodString":return kV(e,n);case"ZodNumber":return $pe(e);case"ZodObject":return zpe(e,n);case"ZodBigInt":return _pe(e);case"ZodBoolean":return wpe();case"ZodDate":return CV(e,n);case"ZodUndefined":return Kpe();case"ZodNull":return Npe();case"ZodArray":return bpe(e,n);case"ZodUnion":case"ZodDiscriminatedUnion":return jpe(e,n);case"ZodIntersection":return Ppe(e,n);case"ZodTuple":return Gpe(e,n);case"ZodRecord":return TV(e,n);case"ZodLiteral":return Rpe(e);case"ZodEnum":return kpe(e);case"ZodNativeEnum":return Ape(e);case"ZodNullable":return Fpe(e,n);case"ZodOptional":return Bpe(e,n);case"ZodMap":return Dpe(e,n);case"ZodSet":return Wpe(e,n);case"ZodLazy":return()=>e.getter()._def;case"ZodPromise":return qpe(e,n);case"ZodNaN":case"ZodNever":return Mpe();case"ZodEffects":return Cpe(e,n);case"ZodAny":return ns();case"ZodUnknown":return Zpe();case"ZodDefault":return Epe(e,n);case"ZodBranded":return EV(e,n);case"ZodReadonly":return Ype(e,n);case"ZodCatch":return xpe(e,n);case"ZodPipeline":return Hpe(e,n);case"ZodFunction":case"ZodVoid":case"ZodSymbol":return;default:return(r=>{})()}},Xpe=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")};function ln(e,t,n=!1){var r;const i=t.seen.get(e);if(t.override){const l=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(l!==vpe)return l}if(i&&!n){const l=Jpe(i,t);if(l!==void 0)return l}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const o=Qpe(e,e.typeName,t),a=typeof o=="function"?ln(o(),t):o;if(a&&eme(e,t,a),t.postProcess){const l=t.postProcess(a,e,t);return s.jsonSchema=a,l}return s.jsonSchema=a,a}var Jpe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Xpe(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),ns()):t.$refStrategy==="seen"?ns():void 0}}
59,eme=(e,t,n)=>(e.description&&(n.description=e.description),n),tme=e=>{const t=ype(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},nme=(e,t)=>{var n;const r=tme(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((u,[f,d])=>{var p;return{...u,[f]:(p=ln(d._def,{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0))!=null?p:ns()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=(n=ln(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:ns(),a=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;a!==void 0&&(o.title=a);const l=s===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...i,[s]:o}};return l.$schema="http://json-schema.org/draft-07/schema#",l},GC=Symbol.for("vercel.ai.schema");function rme(e){let t;return()=>(t==null&&(t=e()),t)}function v_(e,{validate:t}={}){return{[GC]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function ime(e){return typeof e=="object"&&e!==null&&GC in e&&e[GC]===!0&&"jsonSchema"in e&&"validate"in e}function BP(e){return e==null?v_({type:"object",properties:{},additionalProperties:!1}):ime(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?PV(e):sme(e):e()}function sme(e){return v_(()=>{if(!ome(e))throw new Error(`Standard schema vendor '${e["~standard"].vendor}' does not support JSON Schema conversion.`);return UP(e["~standard"].jsonSchema.input({target:"draft-07"}))},{validate:async t=>{const n=await e["~standard"].validate(t);return"value"in n?{success:!0,value:n.value}:{success:!1,error:new Gl({value:t,cause:n.issues})}}})}function ome(e){return e["~standard"].jsonSchema!=null}function ame(e,t){var n;const r=(n=void 0)!=null?n:!1;return v_(()=>nme(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const s=await e.safeParseAsync(i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function lme(e,t){var n;const r=(n=void 0)!=null?n:!1;return v_(()=>UP(qfe(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const s=await hV(e,i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function ume(e){return"_zod"in e}function PV(e,t){return ume(e)?lme(e):ame(e)}async function jj({value:e,schema:t,context:n}){const r=await Pm({value:e,schema:t,context:n});if(!r.success)throw Gl.wrap({value:e,cause:r.error,context:n});return r.value}async function Pm({value:e,schema:t,context:n}){const r=BP(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};const i=await r.validate(e);return i.success?{success:!0,value:i.value,rawValue:e}:{success:!1,error:Gl.wrap({value:e,cause:i.error,context:n}),rawValue:e}}catch(i){return{success:!1,error:Gl.wrap({value:e,cause:i,context:n}),rawValue:e}}}async function gc({text:e,schema:t}){try{const n=gpe(e);return t==null?{success:!0,value:n,rawValue:n}:await Pm({value:n,schema:t})}catch(n){return{success:!1,error:sj.isInstance(n)?n:new sj({text:e,cause:n}),rawValue:void 0}}}function cme({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new cpe).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await gc({text:n,schema:t}))}}))}async function Tl(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}new TextDecoder;var dme=Object.defineProperty,fme=(e,t)=>{for(var n in t)dme(e,n,{get:t[n],enumerable:!0})},RV="AI_InvalidArgumentError",IV=`vercel.ai.error.${RV}`,hme=Symbol.for(IV),Lj,Fj,gf=class extends(Fj=Or,Lj=hme,Fj){constructor({parameter:e,value:t,message:n}){super({name:RV,message:`Invalid argument for parameter ${e}: ${n}`}),this[Lj]=!0,this.parameter=e,this.value=t}static isInstance(e){return Or.hasMarker(e,IV)}},OV="AI_NoObjectGeneratedError",DV=`vercel.ai.error.${OV}`,pme=Symbol.for(DV),$j,zj,Ma=class extends(zj=Or,$j=pme,zj){constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:s}){super({name:OV,message:e,cause:t}),this[$j]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=s}static isInstance(e){return Or.hasMarker(e,DV)}},AV="AI_UIMessageStreamError",MV=`vercel.ai.error.${AV}`,mme=Symbol.for(MV),Vj,Uj,Lu=class extends(Uj=Or,Vj=mme,Uj){constructor({chunkType:e,chunkId:t,message:n}){super({name:AV,message:n}),this[Vj]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return Or.hasMarker(e,MV)}};function gme({warning:e,provider:t,model:n}){const i=`AI SDK Warning${t!=null&&n!=null?` (${t} / ${n})`:""}:`;switch(e.type){case"unsupported":{let s=`${i} The feature "${e.feature}" is not supported.`;return e.details&&(s+=` ${e.details}`),s}case"compatibility":{let s=`${i} The feature "${e.feature}" is used in a compatibility mode.`;return e.details&&(s+=` ${e.details}`),s}case"deprecated":return`${i} Deprecated: "${e.setting}". ${e.message}`;case"other":return`${i} ${e.message}`;default:return`${i} ${JSON.stringify(e,null,2)}`}}var vme="AI SDK Warning System: To turn off warning logging, set the AI_SDK_LOG_WARNINGS global to false.",Bj=!1;function Hj({message:e,type:t}){typeof process<"u"&&typeof process.emitWarning=="function"?process.emitWarning(e,{type:t}):console.warn(e)}var yme=e=>{if(e.warnings.length===0)return;const t=globalThis.AI_SDK_LOG_WARNINGS;if(t!==!1){if(typeof t=="function"){t(e);return}Bj||(Bj=!0,Hj({message:vme,type:"Warning"}));for(const n of e.warnings){const r=gme({warning:n,provider:e.provider,model:e.model});Hj({message:r,type:n.type==="deprecated"?"DeprecationWarning":"Warning"})}}};function NV(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const n={...e};for(const r in t)if(!(r==="__proto__"||r==="constructor"||r==="prototype")&&Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];
59if(i===void 0)continue;const s=r in e?e[r]:void 0,o=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),a=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);o&&a?n[r]=NV(s,i):n[r]=i}return n}var U={array:vV,boolean:khe,custom:ipe,discriminatedUnion:Nhe,enum:wV,instanceof:ape,lazy:npe,literal:Vhe,looseObject:Ahe,never:gV,null:Phe,number:She,object:Dhe,record:$he,string:she,union:_V,unknown:eb},vc=U.lazy(()=>U.union([U.null(),U.string(),U.number(),U.boolean(),U.record(U.string(),vc.optional()),U.array(vc)])),Tt=U.record(U.string(),U.record(U.string(),vc.optional())),og=U.union([U.string(),U.instanceof(Uint8Array),U.instanceof(ArrayBuffer),U.custom(fpe,{message:"Must be a Buffer"})]),HP=U.record(U.string(),U.string()),jV=U.object({type:U.literal("text"),text:U.string(),providerOptions:Tt.optional()}),bme=U.object({type:U.literal("image"),image:U.union([og,U.instanceof(URL),HP]),mediaType:U.string().optional(),providerOptions:Tt.optional()}),LV=U.discriminatedUnion("type",[U.object({type:U.literal("data"),data:og}),U.object({type:U.literal("url"),url:U.instanceof(URL)}),U.object({type:U.literal("reference"),reference:HP}),U.object({type:U.literal("text"),text:U.string()})]),_me=U.discriminatedUnion("type",[U.object({type:U.literal("data"),data:og}),U.object({type:U.literal("url"),url:U.instanceof(URL)})]),FV=U.object({type:U.literal("file"),data:U.union([LV,og,U.instanceof(URL),HP]),filename:U.string().optional(),mediaType:U.string(),providerOptions:Tt.optional()}),wme=U.object({type:U.literal("reasoning"),text:U.string(),providerOptions:Tt.optional()}),xme=U.object({type:U.literal("custom"),kind:U.string().transform(e=>e),providerOptions:Tt.optional()}),Sme=U.object({type:U.literal("reasoning-file"),data:U.union([_me,og,U.instanceof(URL)]),mediaType:U.string(),providerOptions:Tt.optional()}),Eme=U.object({type:U.literal("tool-call"),toolCallId:U.string(),toolName:U.string(),input:U.unknown(),providerOptions:Tt.optional(),providerExecuted:U.boolean().optional()}),Cme=U.discriminatedUnion("type",[U.object({type:U.literal("text"),value:U.string(),providerOptions:Tt.optional()}),U.object({type:U.literal("json"),value:vc,providerOptions:Tt.optional()}),U.object({type:U.literal("execution-denied"),reason:U.string().optional(),providerOptions:Tt.optional()}),U.object({type:U.literal("error-text"),value:U.string(),providerOptions:Tt.optional()}),U.object({type:U.literal("error-json"),value:vc,providerOptions:Tt.optional()}),U.object({type:U.literal("content"),value:U.array(U.union([U.object({type:U.literal("text"),text:U.string(),providerOptions:Tt.optional()}),U.object({type:U.literal("file"),data:LV,mediaType:U.string(),filename:U.string().optional(),providerOptions:Tt.optional()}),U.object({type:U.literal("file-data"),data:U.string(),mediaType:U.string(),filename:U.string().optional(),providerOptions:Tt.optional()}),U.object({type:U.literal("file-url"),url:U.string(),mediaType:U.string().optional(),providerOptions:Tt.optional()}),U.object({type:U.literal("file-id"),fileId:U.union([U.string(),U.record(U.string(),U.string())]),providerOptions:Tt.optional()}),U.object({type:U.literal("file-reference"),providerReference:U.record(U.string(),U.string()),providerOptions:Tt.optional()}),U.object({type:U.literal("image-data"),data:U.string(),mediaType:U.string(),providerOptions:Tt.optional()}),U.object({type:U.literal("image-url"),url:U.string(),providerOptions:Tt.optional()}),U.object({type:U.literal("image-file-id"),fileId:U.union([U.string(),U.record(U.string(),U.string())]),providerOptions:Tt.optional()}),U.object({type:U.literal("image-file-reference"),providerReference:U.record(U.string(),U.string()),providerOptions:Tt.optional()}),U.object({type:U.literal("custom"),providerOptions:Tt.optional()})]))})]),$V=U.object({type:U.literal("tool-result"),toolCallId:U.string(),toolName:U.string(),output:Cme,providerOptions:Tt.optional()}),kme=U.object({type:U.literal("tool-approval-request"),approvalId:U.string(),toolCallId:U.string(),reason:U.string().optional()}),Tme=U.object({type:U.literal("tool-approval-response"),approvalId:U.string(),approved:U.boolean(),reason:U.string().optional()}),Pme=U.object({role:U.literal("system"),content:U.string(),providerOptions:Tt.optional()}),Rme=U.object({role:U.literal("user"),content:U.union([U.string(),U.array(U.union([jV,bme,FV]))]),providerOptions:Tt.optional()}),Ime=U.object({role:U.literal("assistant"),content:U.union([U.string(),U.array(U.union([jV,xme,FV,wme,Sme,Eme,$V,kme]))]),providerOptions:Tt.optional()}),Ome=U.object({role:U.literal("tool"),content:U.array(U.union([$V,Tme])),providerOptions:Tt.optional()});U.union([Pme,Rme,Ime,Ome]);var Dme={};fme(Dme,{array:()=>jme,choice:()=>Lme,json:()=>Fme,object:()=>Nme,text:()=>Mme});function Ame(e){const t=["ROOT"];let n=-1,r=null,i=0;function s(f){return f>="0"&&f<="9"||f>="A"&&f<="F"||f>="a"&&f<="f"}function o(f,d,p){switch(f){case'"':{n=d,t.pop(),t.push(p),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=d,r=d,t.pop(),t.push(p),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(p),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=d,t.pop(),t.push(p),t.push("INSIDE_NUMBER");break}case"{":{n=d,t.pop(),t.push(p),t.push("INSIDE_OBJECT_START");break}case"[":{n=d,t.pop(),t.push(p),t.push("INSIDE_ARRAY_START");break}}}function a(f,d){switch(f){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=d,t.pop();break}}}function l(f,d){switch(f){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=d,t.pop();break}}}for(let f=0;f<e.length;f++){const d=e[f];switch(t[t.length-1]){case"ROOT":o(d,f,"FINISH");break;case"INSIDE_OBJECT_START":{switch(d){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=f,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(d){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(d){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(d){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(d,f,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{a(d,f);break}case"INSIDE_STRING":{switch(d){case'"':{t.pop(),n=f;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=f}break}case"INSIDE_ARRAY_START":{switch(d){case"]":{n=f,t.pop();break}default:{n=f,o(d,f,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(d){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=f,t.pop();break}default:{n=f;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(d,f,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),d==="u"?(i=0,t.push("INSIDE_STRING_UNICODE_ESCAPE")):n=f;break}case"INSIDE_STRING_UNICODE_ESCAPE":{s(d)&&(i++,i===4&&(t.pop(),n=f));break}case"INSIDE_NUMBER":{switch(d){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=f;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(d,f),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(d,f);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&a(d,f);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(d,f);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const m=e.substring(r,f+1);!"false".startsWith(m)&&!"true".startsWith(m)&&!"null".startsWith(m)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?a(d,f):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&l(d,f)):n=f;break}}}let u=e.slice(0,n+1);for(let f=t.length-1;f>=0;f--)switch(t[f]){case"INSIDE_STRING":{u+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{u+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{u+="]";break}case"INSIDE_LITERAL":{const p=e.substring(r,e.length);"true".startsWith(p)?u+="true".slice(p.length):"false".startsWith(p)?u+="false".slice(p.length):"null".startsWith(p)&&(u+="null".slice(p.length))}}return u}async function ag(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await gc({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await gc({text:Ame(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Mme=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),Nme=({schema:e,name:t,description:n})=>{const r=BP(e);return{name:"object",responseFormat:Tl(r.jsonSchema).then(i=>({type:"json",schema:i,...t!=null&&{name:t},...n!=null&&{description:n}})),async parseCompleteOutput({text:i},s){const o=await gc({text:i});if(!o.success)throw new Ma({message:"No object generated: could not parse the response.",cause:o.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});
59const a=await Pm({value:o.value,schema:r});if(!a.success)throw new Ma({message:"No object generated: response did not match schema.",cause:a.error,text:i,response:s.response,usage:s.usage,finishReason:s.finishReason});return a.value},async parsePartialOutput({text:i}){const s=await ag(i);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:s.value}}},createElementStreamTransform(){}}},jme=({element:e,minItems:t,maxItems:n,name:r,description:i})=>{if(qj({name:"minItems",value:t}),qj({name:"maxItems",value:n}),t!=null&&n!=null&&t>n)throw new gf({parameter:"minItems",value:t,message:"minItems must be less than or equal to maxItems"});const s=BP(e);return{name:"array",responseFormat:Tl(s.jsonSchema).then(o=>{const{$schema:a,definitions:l,$defs:u,...f}=o;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",...l!=null&&{definitions:l},...u!=null&&{$defs:u},type:"object",properties:{elements:{type:"array",items:f,...t!=null&&{minItems:t},...n!=null&&{maxItems:n}}},required:["elements"],additionalProperties:!1},...r!=null&&{name:r},...i!=null&&{description:i}}}),async parseCompleteOutput({text:o},a){const l=await gc({text:o});if(!l.success)throw new Ma({message:"No object generated: could not parse the response.",cause:l.error,text:o,response:a.response,usage:a.usage,finishReason:a.finishReason});const u=l.value;if(u==null||typeof u!="object"||!("elements"in u)||!Array.isArray(u.elements))throw new Ma({message:"No object generated: response did not match schema.",cause:new Gl({value:u,cause:"response must be an object with an elements array"}),text:o,response:a.response,usage:a.usage,finishReason:a.finishReason});const f=Wj({value:u.elements,minItems:t,maxItems:n});if(f!=null)throw new Ma({message:"No object generated: response did not match schema.",cause:f,text:o,response:a.response,usage:a.usage,finishReason:a.finishReason});const d=[];for(const p of u.elements){const m=await Pm({value:p,schema:s});if(!m.success)throw new Ma({message:"No object generated: response did not match schema.",cause:m.error,text:o,response:a.response,usage:a.usage,finishReason:a.finishReason});d.push(m.value)}return d},async parsePartialOutput({text:o}){const a=await ag(o);switch(a.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const l=a.value;if(l==null||typeof l!="object"||!("elements"in l)||!Array.isArray(l.elements))return;const u=a.state==="repaired-parse"&&l.elements.length>0?l.elements.slice(0,-1):l.elements,f=[];for(const d of u){const p=await Pm({value:d,schema:s});p.success&&f.push(p.value)}return{partial:f}}}},createElementStreamTransform(){let o=0;return new TransformStream({transform({partialOutput:a},l){if(a!=null)for(;o<a.length;o++){if(n!=null&&o>=n){l.error(Wj({value:a,maxItems:n}));return}l.enqueue(a[o])}}})}}};function qj({name:e,value:t}){if(t!=null){if(!Number.isInteger(t))throw new gf({parameter:e,value:t,message:`${e} must be an integer`});if(t<0)throw new gf({parameter:e,value:t,message:`${e} must be greater than or equal to 0`})}}function Wj({value:e,minItems:t,maxItems:n}){if(t!=null&&e.length<t)return new Gl({value:e,cause:`elements array must contain at least ${t} items`});if(n!=null&&e.length>n)return new Gl({value:e,cause:`elements array must contain at most ${n} items`})}var Lme=({options:e,name:t,description:n})=>({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...t!=null&&{name:t},...n!=null&&{description:n}}),async parseCompleteOutput({text:r},i){const s=await gc({text:r});if(!s.success)throw new Ma({message:"No object generated: could not parse the response.",cause:s.error,text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});const o=s.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string"||!e.includes(o.result))throw new Ma({message:"No object generated: response did not match sc
59hema.",cause:new Gl({value:o,cause:"response must be an object that contains a choice value."}),text:r,response:i.response,usage:i.usage,finishReason:i.finishReason});return o.result},async parsePartialOutput({text:r}){const i=await ag(r);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=i.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string")return;const o=e.filter(a=>a.startsWith(s.result));return i.state==="successful-parse"?o.includes(s.result)?{partial:s.result}:void 0:o.length===1?{partial:o[0]}:void 0}}},createElementStreamTransform(){}}),Fme=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:n},r){const i=await gc({text:n});if(!i.success)throw new Ma({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return i.value},async parsePartialOutput({text:n}){const r=await ag(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return r.value===void 0?void 0:{partial:r.value}}},createElementStreamTransform(){}});new TextEncoder;new TextEncoder;Fs({prefix:"aitxt",size:24});Fs({prefix:"call",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
60
61`)},flush(e){e.enqueue(`data: [DONE]
62
63`)}})}});var tp=U.record(U.string(),vc.optional()),$me=rme(()=>PV(U.union([U.looseObject({type:U.literal("text-start"),id:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("text-delta"),id:U.string(),delta:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("text-end"),id:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("error"),errorText:U.string()}),U.looseObject({type:U.literal("tool-input-start"),toolCallId:U.string(),toolName:U.string(),providerExecuted:U.boolean().optional(),providerMetadata:Tt.optional(),toolMetadata:tp.optional(),dynamic:U.boolean().optional(),title:U.string().optional()}),U.looseObject({type:U.literal("tool-input-delta"),toolCallId:U.string(),inputTextDelta:U.string()}),U.looseObject({type:U.literal("tool-input-available"),toolCallId:U.string(),toolName:U.string(),input:U.unknown(),providerExecuted:U.boolean().optional(),providerMetadata:Tt.optional(),toolMetadata:tp.optional(),dynamic:U.boolean().optional(),title:U.string().optional()}),U.looseObject({type:U.literal("tool-input-error"),toolCallId:U.string(),toolName:U.string(),input:U.unknown(),providerExecuted:U.boolean().optional(),providerMetadata:Tt.optional(),toolMetadata:tp.optional(),dynamic:U.boolean().optional(),errorText:U.string(),title:U.string().optional()}),U.looseObject({type:U.literal("tool-approval-request"),approvalId:U.string(),toolCallId:U.string(),approvalDescriptor:U.unknown().optional(),reason:U.string().optional(),isAutomatic:U.boolean().optional(),signature:U.string().optional()}),U.looseObject({type:U.literal("tool-approval-response"),approvalId:U.string(),approved:U.boolean(),reason:U.string().optional(),providerExecuted:U.boolean().optional(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("tool-output-available"),toolCallId:U.string(),output:U.unknown(),providerExecuted:U.boolean().optional(),providerMetadata:Tt.optional(),toolMetadata:tp.optional(),dynamic:U.boolean().optional(),preliminary:U.boolean().optional()}),U.looseObject({type:U.literal("tool-output-error"),toolCallId:U.string(),errorText:U.string(),providerExecuted:U.boolean().optional(),providerMetadata:Tt.optional(),toolMetadata:tp.optional(),dynamic:U.boolean().optional()}),U.looseObject({type:U.literal("tool-output-denied"),toolCallId:U.string()}),U.looseObject({type:U.literal("reasoning-start"),id:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("reasoning-delta"),id:U.string(),delta:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("reasoning-end"),id:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("custom"),kind:U.string().transform(e=>e),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("source-url"),sourceId:U.string(),url:U.string(),title:U.string().optional(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("source-document"),sourceId:U.string(),mediaType:U.string(),title:U.string(),filename:U.string().optional(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("file"),url:U.string(),mediaType:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.literal("reasoning-file"),url:U.string(),mediaType:U.string(),providerMetadata:Tt.optional()}),U.looseObject({type:U.custom(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:U.string().optional(),data:U.unknown(),transient:U.boolean().optional()}),U.looseObject({type:U.literal("start-step")}),U.looseObject({type:U.literal("finish-step")}),U.looseObject({type:U.literal("reset-step")}),U.looseObject({type:U.literal("start"),messageId:U.string().optional(),messageMetadata:U.unknown().optional()}),U.looseObject({type:U.literal("finish"),finishReason:U.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:U.unknown().optional()}),U.looseObject({type:U.literal("abort"),reason:U.string().optional()}),U.looseObject({type:U.literal("message-metadata"),messageMetadata:U.unknown()})])));function zme(e){return e.type.startsWith("data-")}function vf(){return Object.create(null)}function KC(e){return e.type.startsWith("tool-")}function zV(e){return e.type==="dynamic-tool"}function nf(e){return KC(e)||zV(e)}function ZC(e){return e.type.split("-").slice(1).join("-")}function XBe(e){return zV(e)?e.toolName:ZC(e)}var Vme={type:"deprecated",setting:"rawInput in output-error UI message parts",message:'Use the "input" field instead. The "rawInput" field will be removed in the next major version.'};function Ume(e){e.some(n=>n.parts.some(r=>r!=null&&typeof r=="object"&&"type"in r&&typeof r.type=="string"&&(r.type==="dynamic-tool"||r.type.startsWith("tool-"))&&"state"in r&&r.state==="output-error"&&Object.prototype.hasOwnProperty.call(r,"rawInput")&&"rawInput"in r&&r.rawInput!==void 0))&&yme({warnings:[Vme]})}function Bme({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:vf(),activeReasoningParts:vf(),partialToolCalls:vf()}}
63function Hme({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:s,onData:o}){return e.pipeThrough(new TransformStream({async transform(a,l){await r(async({state:u,write:f})=>{var d,p,m,v;function _(){const k=u.message.parts;let I=k.length-1;for(;I>=0&&k[I].type!=="step-start";)I--;return k.slice(I+1)}function w(){return _().filter(nf)}function x(k){let D=w().find(L=>L.toolCallId===k);if(D==null){const L=u.message.parts;for(let A=L.length-1;A>=0;A--){const $=L[A];if(nf($)&&$.toolCallId===k){D=$;break}}}if(D==null)throw new Lu({chunkType:"tool-invocation",chunkId:k,message:`No tool invocation found for tool call ID "${k}".`});return D}function S(k){const D=u.message.parts.filter(nf).find(L=>{var A;return((A=L.approval)==null?void 0:A.id)===k});if(D==null)throw new Lu({chunkType:"tool-approval-response",chunkId:k,message:`No tool invocation found for approval ID "${k}".`});return D}function C(k,I){var D;const L=I??_().find(j=>KC(j)&&j.toolCallId===k.toolCallId),A=k,$=L;if(L!=null){L.state=k.state,$.input=A.input,$.output=A.output,$.errorText=A.errorText,$.rawInput=A.rawInput,$.preliminary=A.preliminary,k.title!==void 0&&($.title=k.title),k.toolMetadata!==void 0&&($.toolMetadata=k.toolMetadata),$.providerExecuted=(D=A.providerExecuted)!=null?D:L.providerExecuted;const j=A.providerMetadata;if(j!=null)if(k.state==="output-available"||k.state==="output-error"){const V=L;V.resultProviderMetadata=j}else L.callProviderMetadata=j}else u.message.parts.push({type:`tool-${k.toolName}`,toolCallId:k.toolCallId,state:k.state,title:k.title,...k.toolMetadata!==void 0?{toolMetadata:k.toolMetadata}:{},input:A.input,output:A.output,rawInput:A.rawInput,errorText:A.errorText,providerExecuted:A.providerExecuted,preliminary:A.preliminary,...A.providerMetadata!=null&&(k.state==="output-available"||k.state==="output-error")?{resultProviderMetadata:A.providerMetadata}:{},...A.providerMetadata!=null&&!(k.state==="output-available"||k.state==="output-error")?{c
63allProviderMetadata:A.providerMetadata}:{}})}function R(k,I){var D,L;const A=I??_().find(V=>V.type==="dynamic-tool"&&V.toolCallId===k.toolCallId),$=k,j=A;if(A!=null){A.state=k.state,j.toolName=k.toolName,j.input=$.input,j.output=$.output,j.errorText=$.errorText,j.rawInput=(D=$.rawInput)!=null?D:j.rawInput,j.preliminary=$.preliminary,k.title!==void 0&&(j.title=k.title),k.toolMetadata!==void 0&&(j.toolMetadata=k.toolMetadata),j.providerExecuted=(L=$.providerExecuted)!=null?L:A.providerExecuted;const V=$.providerMetadata;if(V!=null)if(k.state==="output-available"||k.state==="output-error"){const B=A;B.resultProviderMetadata=V}else A.callProviderMetadata=V}else u.message.parts.push({type:"dynamic-tool",toolName:k.toolName,toolCallId:k.toolCallId,state:k.state,input:$.input,output:$.output,errorText:$.errorText,preliminary:$.preliminary,providerExecuted:$.providerExecuted,title:k.title,...k.toolMetadata!==void 0?{toolMetadata:k.toolMetadata}:{},...$.providerMetadata!=null&&(k.state==="output-available"||k.state==="output-error")?{resultProviderMetadata:$.providerMetadata}:{},...$.providerMetadata!=null&&!(k.state==="output-available"||k.state==="output-error")?{c
63allProviderMetadata:$.providerMetadata}:{}})}async function P(k){if(k!=null){const I=u.message.metadata!=null?NV(u.message.metadata,k):k;t!=null&&await jj({value:I,schema:t,context:{field:"message.metadata",entityId:u.message.id}}),u.message.metadata=I}}switch(a.type){case"text-start":{const k={type:"text",text:"",providerMetadata:a.providerMetadata,state:"streaming"};u.activeTextParts[a.id]=k,u.message.parts.push(k),f();break}case"text-delta":{const k=u.activeTextParts[a.id];if(k==null)throw new Lu({chunkType:"text-delta",chunkId:a.id,message:`Received text-delta for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});k.text+=a.delta,k.providerMetadata=(d=a.providerMetadata)!=null?d:k.providerMetadata,f();break}case"text-end":{const k=u.activeTextParts[a.id];if(k==null)throw new Lu({chunkType:"text-end",chunkId:a.id,message:`Received text-end for missing text part with ID "${a.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});k.state="done",k.providerMetadata=(p=a.providerMetadata)!=null?p:k.providerMetadata,delete u.activeTextParts[a.id],f();break}case"custom":{const k={type:"custom",kind:a.kind,providerMetadata:a.providerMetadata};u.message.parts.push(k),f();break}case"reasoning-start":{const k={type:"reasoning",id:a.id,text:"",providerMetadata:a.providerMetadata,state:"streaming"};u.activeReasoningParts[a.id]=k,u.message.parts.push(k),f();break}case"reasoning-delta":{const k=u.activeReasoningParts[a.id];if(k==null)throw new Lu({chunkType:"reasoning-delta",chunkId:a.id,message:`Received reasoning-delta for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});k.text+=a.delta,k.providerMetadata=(m=a.providerMetadata)!=null?m:k.providerMetadata,f();break}case"reasoning-end":{const k=u.activeReasoningParts[a.id];if(k==null)throw new Lu({chunkType:"reasoning-end",chunkId:a.id,message:`Received reasoning-end for missing reasoning part with ID "${a.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});k.providerMetadata=(v=a.providerMetadata)!=null?v:k.providerMetadata,k.state="done",delete u.activeReasoningParts[a.id],f();break}case"file":case"reasoning-file":{u.message.parts.push({type:a.type,mediaType:a.mediaType,url:a.url,...a.providerMetadata!=null?{providerMetadata:a.providerMetadata}:{}}),f();break}case"source-url":{u.message.parts.push({type:"source-url",sourceId:a.sourceId,url:a.url,title:a.title,providerMetadata:a.providerMetadata}),f();break}case"source-document":{u.message.parts.push({type:"source-document",sourceId:a.sourceId,mediaType:a.mediaType,title:a.title,filename:a.filename,providerMetadata:a.providerMetadata}),f();break}case"tool-input-start":{const k=_().filter(KC);u.partialToolCalls[a.toolCallId]={text:"",toolName:a.toolName,index:k.length,dynamic:a.dynamic,title:a.title,toolMetadata:a.toolMetadata},a.dynamic?R({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-streaming",input:void 0,providerExecuted:a.providerExecuted,title:a.title,toolMetadata:a.toolMetadata,providerMetadata:a.providerMetadata}):C({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-streaming",input:void 0,providerExecuted:a.providerExecuted,title:a.title,toolMetadata:a.toolMetadata,providerMetadata:a.providerMetadata}),f();break}case"tool-input-delta":{const k=u.partialToolCalls[a.toolCallId];if(k==null)throw new Lu({chunkType:"tool-input-delta",chunkId:a.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${a.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});k.text+=a.inputTextDelta;const{value:I}=await ag(k.text);k.dynamic?R({toolCallId:a.toolCallId,toolName:k.toolName,state:"input-streaming",input:I,title:k.title,toolMetadata:k.toolMetadata}):C({toolCallId:a.toolCallId,toolName:k.toolName,state:"input-streaming",input:I,title:k.title,toolMetadata:k.toolMetadata}),f();break}case"tool-input-available":{a.dynamic?R({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-available",input:a.input,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:a.title,toolMetadata:a.toolMetadata}):C({toolCallId:a.toolCallId,toolName:a.toolName,state:"input-available",input:a.input,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:a.title,toolMetadata:a.toolMetadata}),f(),s&&!a.providerExecuted&&await s({toolCall:a});break}case"tool-input-error":{const k=_().filter(nf).find(D=>D.toolCallId===a.toolCallId);(k!=null?k.type==="dynamic-tool":!!a.dynamic)?R({toolCallId:a.toolCallId,toolName:a.toolName,state:"output-error",input:a.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,toolMetadata:a.toolMetadata}):(C({toolCallId:a.toolCallId,toolName:a.toolName,state:"output-error",input:void 0,rawInput:a.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,toolMetadata:a.toolMetadata}),Ume([u.message])),f();break}case"tool-approval-request":{const k=x(a.toolCallId);k.state="approval-requested",k.approval={id:a.approvalId,...a.approvalDescriptor!=null?{descriptor:a.approvalDescriptor}:{},...a.reason!=null?{requestReason:a.reason}:{},...a.isAutomatic===!0?{isAutomatic:!0}:{},...a.signature!=null?{signature:a.signature}:{}},f();break}case"tool-approval-response":{const k=S(a.approvalId),I=k.approval==null?{id:a.approvalId}:k.approval;k.state="approval-responded",k.approval={...I,id:a.approvalId,approved:a.approved,...a.reason!=null?{reason:a.reason}:{}},a.providerExecuted!=null&&(k.providerExecuted=a.providerExecuted),a.providerMetadata!=null&&(k.callProviderMetadata=a.providerMetadata),f();break}case"tool-output-denied":{const k=x(a.toolCallId);k.state="output-denied",f();break}case"tool-output-available":{const k=x(a.toolCallId);k.type==="dynamic-tool"?R({toolCallId:a.toolCallId,toolName:k.toolName,state:"output-available",input:k.input,output:a.output,preliminary:a.preliminary,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:k.title,toolMetadata:k.toolMetadata},k):C({toolCallId:a.toolCallId,toolName:ZC(k),state:"output-available",input:k.input,output:a.output,providerExecuted:a.providerExecuted,preliminary:a.preliminary,providerMetadata:a.providerMetadata,title:k.title,toolMetadata:k.toolMetadata},k),f();break}case"tool-output-error":{const k=x(a.toolCallId);k.type==="dynamic-tool"?R({toolCallId:a.toolCallId,toolName:k.toolName,state:"output-error",input:k.input,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:k.title,toolMetadata:k.toolMetadata},k):C({toolCallId:a.toolCallId,toolName:ZC(k),state:"output-error",input:k.input,rawInput:k.rawInput,errorText:a.errorText,providerExecuted:a.providerExecuted,providerMetadata:a.providerMetadata,title:k.title,toolMetadata:k.toolMetadata},k),f();break}case"start-step":{u.message.parts.push({type:"step-start"});break}case"finish-step":break;case"reset-step":{const k=_();u.activeTextParts=vf(),u.activeReasoningParts=vf(),u.partialToolCalls=vf(),k.length>0&&(u.message.parts.splice(u.message.parts.length-k.length,k.length),f());break}case"start":{a.messageId!=null&&(u.message.id=a.messageId),await P(a.messageMetadata),(a.messageId!=null||a.messageMetadata!=null)&&f({updateStatus:!1});break}case"finish":{a.finishReason!=null&&(u.finishReason=a.finishReason),await P(a.messageMetadata),a.messageMetadata!=null&&f();break}case"message-metadata":{await P(a.messageMetadata),a.messageMetadata!=null&&f();break}case"error":{i?.(new Error(a.errorText));break}default:if(zme(a)){if(n?.[a.type]!=null){const D=u.message.parts.findIndex(A=>"id"in A&&"data"in A&&A.id===a.id&&A.type===a.type),L=D>=0?D:u.message.parts.length;await jj({value:a.data,schema:n[a.type],context:{field:`message.parts[${L}].data`,entityName:a.type,entityId:a.id}})}const k=a;if(k.transient){o?.(k);break}const I=k.id!=null?u.message.parts.find(D=>k.type===D.type&&k.id===D.id):void 0;I!=null?I.data=k.data:u.message.parts.push(k),o?.(k),f()}}l.enqueue(a)})}}))}
63async function qme({stream:e,onError:t,abortSignal:n}){const r=e.getReader(),i=()=>{r.cancel().catch(()=>{})};n?.aborted?i():n?.addEventListener("abort",i,{once:!0});try{for(;;){const{done:s}=await r.read();if(s)break}}catch(s){t?.(s)}finally{n?.removeEventListener("abort",i),r.releaseLock()}}Fs({prefix:"aitxt",size:24});Fs({prefix:"call",size:24});Fs({prefix:"aitxt",size:24});Fs({prefix:"call",size:24});U.record(U.string(),vc.optional());U.record(U.string(),U.string());Fs({prefix:"call",size:24});Fs({prefix:"call",size:24});new TextEncoder;Fs({prefix:"aiobj",size:24});var Wme=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(r){n(r)}}),this.processQueue()})}};Fs({prefix:"aiobj",size:24});U.object({token:U.string().refine(e=>e.trim().length>0),url:U.string().refine(e=>{try{const t=new URL(e);return(t.protocol==="ws:"||t.protocol==="wss:")&&t.hostname!==""}catch{return!1}}),expiresAt:U.number().positive().max(Number.MAX_SAFE_INTEGER).optional(),tools:U.array(U.object({type:U.literal("function"),name:U.string().min(1),description:U.string().optional(),parameters:U.record(U.string(),U.unknown())})).optional()});Fs({prefix:"call",size:24});async function Gj({response:e,url:t,fallbackMessage:n}){const r=await e.text();return new que({message:r||n,url:t,requestBodyValues:void 0,statusCode:e.status,responseBody:r})}async function Gme(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Xue({functionality:"FileList",message:"FileList is not supported in the current environment"});return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((s,o)=>{const a=new FileReader;a.onload=l=>{var u;s((u=l.target)==null?void 0:u.result)},a.onerror=l=>o(l),a.readAsDataURL(t)});return{type:"file",mediaType:r,filename:n,url:i}}))}var Kme=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){var n,r,i,s;const o=await Tl(this.body),a=await Tl(this.headers),l=await Tl(this.credentials),u={...Sd(a),...Sd(t.headers)},f=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...o,...t.body},headers:u,credentials:l,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),d=(r=f?.api)!=null?r:this.api,p=f?.headers!==void 0?Sd(f.headers):u,m=f?.body!==void 0?f.body:{...o,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},v=(i=f?.credentials)!=null?i:l,w=await((s=this.fetch)!=null?s:globalThis.fetch)(d,{method:"POST",headers:{"Content-Type":"application/json",...p},body:JSON.stringify(m),credentials:v,signal:e});if(!w.ok)throw await Gj({response:w,url:d,fallbackMessage:"Failed to fetch the chat response."});if(!w.body)throw new ej({message:"The response body is empty."});return this.processResponseStream(w.body)}async reconnectToStream(e){var t,n,r,i;const s=await Tl(this.body),o=await Tl(this.headers),a=await Tl(this.credentials),l={...Sd(o),...Sd(e.headers)},u=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...s,...e.body},headers:l,credentials:a,requestMetadata:e.metadata})),f=(n=u?.api)!=null?n:`${this.api}/${e.chatId}/stream`,d=u?.headers!==void 0?Sd(u.headers):l,p=(r=u?.credentials)!=null?r:a,v=await((i=this.fetch)!=null?i:globalThis.fetch)(f,{method:"GET",headers:d,credentials:p,signal:e.abortSignal});if(v.status===204)return null;if(!v.ok)throw await Gj({response:v,url:f,fallbackMessage:"Failed to fetch the chat response."});if(!v.body)throw new ej({message:"The response body is empty."});return this.processResponseStream(v.body)}},y_=class extends Kme{constructor(e={}){super(e)}
63processResponseStream(e){return cme({stream:e,schema:$me}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},Zme=class{constructor({generateId:e=dpe,id:t=e(),transport:n=new y_,messageMetadataSchema:r,dataPartSchemas:i,state:s,onError:o,onToolCall:a,onFinish:l,onData:u,sendAutomaticallyWhen:f}){this.pendingMessagePreparations=new Set,this.activeResponse=void 0,this.activeResumeRequest=void 0,this.jobExecutor=new Wme,this.sendMessage=async(d,p)=>{var m,v,_,w;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(m=this.lastMessage)==null?void 0:m.id,...p});return}let x;if("text"in d||"files"in d){const S=new AbortController;this.pendingMessagePreparations.add(S);let C;try{C=Array.isArray(d.files)?d.files:await Gme(d.files)}finally{this.pendingMessagePreparations.delete(S)}if(S.signal.aborted)return;x={parts:[...C,..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}}else x=d;if(d.messageId!=null){const S=this.state.messages.findIndex(C=>C.id===d.messageId);if(S===-1)throw new gf({parameter:"message.messageId",value:d.messageId,message:`message with id ${d.messageId} not found`});if(this.state.messages[S].role!=="user")throw new gf({parameter:"message.messageId",value:d.messageId,message:`message with id ${d.messageId} is not a user message`});this.state.messages=this.state.messages.slice(0,S+1),this.state.replaceMessage(S,{id:d.messageId,...x,role:(v=x.role)!=null?v:"user",metadata:d.metadata})}else this.state.pushMessage({...x,id:(_=x.id)!=null?_:this.generateId(),role:(w=x.role)!=null?w:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,...p})},this.regenerate=async({messageId:d,...p}={})=>{const m=d==null?this.state.messages.length-1:this.state.messages.findIndex(v=>v.id===d);if(m===-1)throw new gf({parameter:"messageId",value:d,message:`message ${d} not found`});this.state.messages=this.state.messages.slice(0,this.messages[m].role==="assistant"?m:m+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,...p})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:p,reason:m,options:v})=>this.jobExecutor.run(async()=>{const _=this.state.messages,w=_[_.length-1],x=S=>nf(S)&&S.state==="approval-requested"&&S.approval.id===d?{...S,state:"approval-responded",approval:{...S.approval,id:d,approved:p,reason:m}}:S;this.state.replaceMessage(_.length-1,{...w,parts:w.parts.map(x)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(x)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(S=>{var C;S&&this.makeRequest({trigger:"submit-message",messageId:(C=this.lastMessage)==null?void 0:C.id,...v})})}),this.addToolOutput=async({state:d="output-available",toolCallId:p,output:m,errorText:v,options:_})=>this.jobExecutor.run(async()=>{const w=this.state.messages,x=w[w.length-1],S=C=>nf(C)&&C.toolCallId===p?{...C,state:d,output:m,errorText:v}:C;this.state.replaceMessage(w.length-1,{...x,parts:x.parts.map(S)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(S)),this.status!=="streaming"&&this.status!=="submitted"&&this.sendAutomaticallyWhen&&this.shouldSendAutomatically().then(C=>{var R;C&&this.makeRequest({trigger:"submit-message",messageId:(R=this.lastMessage)==null?void 0:R.id,..._})})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d,p;for(const m of this.pendingMessagePreparations)m.abort();(d=this.activeResumeRequest)==null||d.abortController.abort(),(p=this.activeResponse)==null||p.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=s,this.onError=o,this.onToolCall=a,this.onFinish=l,this.onData=u,this.sendAutomaticallyWhen=f}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}
63async shouldSendAutomatically(){if(!this.sendAutomaticallyWhen)return!1;const e=this.sendAutomaticallyWhen({messages:this.state.messages});return e&&typeof e=="object"&&"then"in e?await e:e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var s,o,a;const l=new AbortController,u=e==="resume-stream"?{abortController:l}:void 0;u&&((s=this.activeResumeRequest)==null||s.abortController.abort(),this.activeResumeRequest=u);const f=()=>u==null||this.activeResumeRequest===u,d=()=>{this.activeResumeRequest===u&&(this.activeResumeRequest=void 0)};let p;if(e==="resume-stream")try{const S=await this.transport.reconnectToStream({chatId:this.id,abortSignal:l.signal,metadata:t,headers:n,body:r});if(l.signal.aborted||!f()){await S?.cancel().catch(()=>{}),f()&&this.setStatus({status:"ready"}),d();return}if(S==null){this.setStatus({status:"ready"}),d();return}p=S}catch(S){if(l.signal.aborted||S.name==="AbortError"){f()&&this.setStatus({status:"ready"}),d();return}if(!f())return;this.onError&&S instanceof Error&&this.onError(S),this.setStatus({status:"error",error:S}),d();return}this.setStatus({status:"submitted",error:void 0});const m=this.lastMessage;let v=!1,_=!1,w=!1,x;try{const S={state:Bme({lastMessage:e==="resume-stream"||e==="regenerate-message"?void 0:this.state.snapshot(m),messageId:this.generateId()}),abortController:l};x=S,S.abortController.signal.addEventListener("abort",()=>{v=!0}),this.activeResponse=S;let C;e==="resume-stream"?C=p:C=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:S.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});const R=P=>this.jobExecutor.run(()=>S.abortController.signal.aborted?Promise.resolve():P({state:S.state,write:({updateStatus:k=!0}={})=>{var I;if(S.abortController.signal.aborted)return;k&&this.setStatus({status:"streaming"}),S.state.message.id===((I=this.lastMessage)==null?void 0:I.id)?this.state.replaceMessage(this.state.messages.length-1,S.state.message):this.state.pushMessage(S.state.message)}}));if(await qme({stream:Hme({stream:C,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:R,onError:P=>{throw P}}),abortSignal:S.abortController.signal,onError:P=>{throw P}}),v)return f()&&this.setStatus({status:"ready"}),null;f()&&this.setStatus({status:"ready"})}catch(S){if(v||S.name==="AbortError")return v=!0,f()&&this.setStatus({status:"ready"}),null;if(!f())return null;w=!0,S instanceof TypeError&&(S.message.toLowerCase().includes("fetch")||S.message.toLowerCase().includes("network"))&&(_=!0),this.onError&&S instanceof Error&&this.onError(S),this.setStatus({status:"error",error:S})}finally{try{x&&((o=this.onFinish)==null||o.call(this,{message:x.state.message,messages:this.state.messages,isAbort:v,isDisconnect:_,isError:w,finishReason:x.state.finishReason}))}finally{this.activeResponse===x&&(this.activeResponse=void 0),d()}}!w&&await this.shouldSendAutomatically()&&await this.makeRequest({trigger:"submit-message",messageId:(a=this.lastMessage)==null?void 0:a.id,metadata:t,headers:n,body:r})}},Kj=Object.prototype.hasOwnProperty;function YC(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&YC(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(Kj.call(e,n)&&++r&&!Kj.call(t,n)||!(n in t)||!YC(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var X1,Zj;function Yme(){if(Zj)return X1;Zj=1;function e(t,n){if(typeof t!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof t}\`.`);let r,i=0;return function(...o){clearTimeout(r);const a=Date.now(),l=a-i,u=n-l;u<=0?(i=a,t.apply(this,o)):r=setTimeout(()=>{i=Date.now(),t.apply(this,o)},u)}}return X1=e,X1}var Qme=Yme();const Xme=vo(Qme);var VV=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Tn=(e,t,n)=>(VV(e,t,"read from private field"),n?n.call(e):t.get(e)),Ro=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Sl=(e,t,n,r)=>(VV(e,t,"write to private field"),t.set(e,n),n);function Jme(e,t){return t!=null?Xme(e,t):e}function ege(e){return Array.isArray(e)?[...e]:e!=null&&typeof e=="object"&&(Object.getPrototypeOf(e)===Object.prototype||Ob
63ject.getPrototypeOf(e)===null)?{...e}:e}var _s,d0,f0,Op,Dp,Ap,Vd,QC,XC,tge=class{constructor(e=[]){Ro(this,_s,void 0),Ro(this,d0,"ready"),Ro(this,f0,void 0),Ro(this,Op,new Set),Ro(this,Dp,new Set),Ro(this,Ap,new Set),this.pushMessage=t=>{Sl(this,_s,Tn(this,_s).concat(t)),Tn(this,Vd).call(this)},this.popMessage=()=>{Sl(this,_s,Tn(this,_s).slice(0,-1)),Tn(this,Vd).call(this)},this.replaceMessage=(t,n)=>{Sl(this,_s,[...Tn(this,_s).slice(0,t),this.snapshot(n),...Tn(this,_s).slice(t+1)]),Tn(this,Vd).call(this)},this.snapshot=t=>{if(t==null||typeof t!="object"||!("parts"in t)||!Array.isArray(t.parts))return t;const n=t,r={...n,parts:n.parts.map(i=>({...i}))};return"metadata"in n&&(r.metadata=ege(n.metadata)),r},this["~registerMessagesCallback"]=(t,n)=>{const r=n?Jme(t,n):t;return Tn(this,Op).add(r),()=>{Tn(this,Op).delete(r)}},this["~registerStatusCallback"]=t=>(Tn(this,Dp).add(t),()=>{Tn(this,Dp).delete(t)}),this["~registerErrorCallback"]=t=>(Tn(this,Ap).add(t),()=>{Tn(this,Ap).delete(t)}),Ro(this,Vd,()=>{Tn(this,Op).forEach(t=>t())}),Ro(this,QC,()=>{Tn(this,Dp).forEach(t=>t())}),Ro(this,XC,()=>{Tn(this,Ap).forEach(t=>t())}),Sl(this,_s,e)}get status(){return Tn(this,d0)}set status(e){Sl(this,d0,e),Tn(this,QC).call(this)}get error(){return Tn(this,f0)}set error(e){Sl(this,f0,e),Tn(this,XC).call(this)}get messages(){return Tn(this,_s)}set messages(e){Sl(this,_s,[...e]),Tn(this,Vd).call(this)}};_s=new WeakMap;d0=new WeakMap;f0=new WeakMap;Op=new WeakMap;Dp=new WeakMap;Ap=new WeakMap;Vd=new WeakMap;QC=new WeakMap;XC=new WeakMap;var Ud,UV=class extends Zme{constructor({messages:t,...n}){const r=new tge(t);super({...n,state:r}),Ro(this,Ud,void 0),this["~registerMessagesCallback"]=(i,s)=>Tn(this,Ud)["~registerMessagesCallback"](i,s),this["~registerStatusCallback"]=i=>Tn(this,Ud)["~registerStatusCallback"](i),this["~registerErrorCallback"]=i=>Tn(this,Ud)["~registerErrorCallback"](i),Sl(this,Ud,r)}};Ud=new WeakMap;function nge({throttle:e,experimental_throttle:t,resume:n=!1,...r}={}){const i=e??t,s=b.useRef({});"chat"in r||(s.current={onToolCall:r.onToolCall,onData:r.onData,onFinish:r.onFinish,onError:r.onError,sendAutomaticallyWhen:r.sendAutomaticallyWhen,transport:r.transport});let o;const a=()=>{var P;return(P=s.current.transport)!=null?P:o??(o=new y_)},l={...r,transport:{sendMessages:P=>a().sendMessages(P),reconnectToStream:P=>a().reconnectToStream(P)},onToolCall:P=>{var k,I;return(I=(k=s.current).onToolCall)==null?void 0:I.call(k,P)},onData:P=>{var k,I;return(I=(k=s.current).onData)==null?void 0:I.call(k,P)},onFinish:P=>{var k,I;return(I=(k=s.current).onFinish)==null?void 0:I.call(k,P)},onError:P=>{var k,I;return(I=(k=s.current).onError)==null?void 0:I.call(k,P)},sendAutomaticallyWhen:P=>{var k,I,D;return(D=(I=(k=s.current).sendAutomaticallyWhen)==null?void 0:I.call(k,P))!=null?D:!1}},u="chat"in r?r.chat:r.id,{chat:f,isExternallyManaged:d}=b.useMemo(()=>({chat:"chat"in r?r.chat:new UV(l),isExternallyManaged:"chat"in r}),[u]);b.useEffect(()=>{if(!d)return()=>{f.stop()}},[f,d]);const p=b.useMemo(()=>({messages:f.messages}),[f]),m=b.useCallback(P=>{let k=!0;const I=()=>{k&&(p.messages=f.messages,P())},D=f["~registerMessagesCallback"](I,i);return p.messages=f.messages,()=>{k=!1,D()}},[f,p,i]),v=b.useCallback(()=>p.messages,[p]),_=b.useSyncExternalStore(m,v,v),w=b.useCallback(P=>f["~registerStatusCallback"](()=>{(f.status==="ready"||f.status==="error")&&(p.messages=f.messages),P()}),[f,p]),x=b.useCallback(()=>f.status,[f]),S=b.useSyncExternalStore(w,x,x),C=b.useSyncExternalStore(f["~registerErrorCallback"],()=>f.error,()=>f.error),R=b.useCallback(P=>{typeof P=="function"&&(P=P(f.messages)),f.messages=P},[f]);return b.useEffect(()=>{n&&f.resumeStream()},[n,f]),{id:f.id,messages:_,setMessages:R,sendMessage:f.sendMessage,regenerate:f.regenerate,clearError:f.clearError,stop:f.stop,error:C,resumeStream:f.resumeStream,status:S,addToolResult:f.addToolOutput,addToolOutput:f.addToolOutput,addToolApprovalResponse:f.addToolApprovalResponse}}const py="0123456789abcdef";class ic{constructor(t){this.bytes=t}static ofInner(t){if(t.length!==16)throw new TypeError("not 128-bit length");return new ic(t)}static fromFieldsV7(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw new RangeError("invalid field value");const s=new Uint8Array(16);return s[0]=t/2**40,s[1]=t/2**32,s[2]=t/2**24,s[3]=t/2**16,s[4]=t/2**8,s[5]=t,s[6]=112|n>>>8,s[7]=n,s[8]=128|r>>>24,s[9]=r>>>16,s[10]=r>>>8,s[11]=r,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new ic(s)}static parse(t){var n,r,i,s;let o;switch(t.length){case 32:o=(n=/^[0-9a-f]{32}$/i.exec(t))===null||n===void 0?void 0:n[0];break;case 36:o=(r=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))===null||r===void 0?void 0:r.slice(1,6).join("");break;case 38:o=(i=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(t))===null||i===void 0?void 0:i.slice(1,6).join("");break;case 45:o=(s=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(t))===null||s===void 0?void 0:s.slice(1,6).join("");break}if(o){const a=new Uint8Array(16);for(let l=0;l<16;l+=4){const u=parseInt(o.substring(2*l,2*l+8),16);a[l+0]=u>>>24,a[l+1]=u>>>16,a[l+2]=u>>>8,a[l+3]=u}return new ic(a)}else throw new SyntaxError("could not parse UUID string")}toString(){let t="";for(let n=0;n<this.bytes.length;n++)t+=py.charAt(this.bytes[n]>>>4),t+=py.charAt(this.bytes[n]&15),(n===3||n===5||n===7||n===9)&&(t+="-");return t}toHex(){let t="";for(let n=0;n<this.bytes.length;n++)t+=py.charAt(this.bytes[n]>>>4),t+=py.charAt(this.bytes[n]&15);return t}toJSON(){return this.toString()}getVariant(){const t=this.bytes[8]>>>4;if(t<0)throw new Error("unreachable");if(t<=7)return this.isNil()?"NIL":"VAR_0";
63if(t<=11)return"VAR_10";if(t<=13)return"VAR_110";if(t<=15)return this.isMax()?"MAX":"VAR_RESERVED";throw new Error("unreachable")}getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:void 0}isNil(){return this.bytes.every(t=>t===0)}isMax(){return this.bytes.every(t=>t===255)}clone(){return new ic(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(let n=0;n<16;n++){const r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class rge{constructor(t){this.timestampBiased=0,this.counter=0,this.rollbackAllowance=1e4,this.random=t??ige()}setRollbackAllowance(t){if(t<0||t>0xffffffffffff)throw new RangeError("`rollbackAllowance` out of reasonable range");this.rollbackAllowance=t}generate(){return this.generateOrResetWithTs(Date.now())}generateOrAbort(){return this.generateOrAbortWithTs(Date.now())}generateOrResetWithTs(t){let n=this.generateOrAbortWithTs(t);return n===void 0&&(this.timestampBiased=0,n=this.generateOrAbortWithTs(t)),n}generateOrAbortWithTs(t){if(!Number.isInteger(t)||t<0||t>0xffffffffffff)throw new RangeError("`unixTsMs` must be a 48-bit unsigned integer");if(t++,t>this.timestampBiased)this.timestampBiased=t,this.resetCounter();else if(t+this.rollbackAllowance>=this.timestampBiased)this.counter++,this.counter>4398046511103&&(this.timestampBiased++,this.resetCounter());else return;return ic.fromFieldsV7(this.timestampBiased-1,Math.trunc(this.counter/2**30),this.counter&2**30-1,this.random.nextUint32())}generateOrResetCore(t,n){const r=this.rollbackAllowance;try{return this.setRollbackAllowance(n),this.generateOrResetWithTs(t)}catch(i){throw i}finally{this.rollbackAllowance=r}}generateOrAbortCore(t,n){const r=this.rollbackAllowance;try{return this.setRollbackAllowance(n),this.generateOrAbortWithTs(t)}catch(i){throw i}finally{this.rollbackAllowance=r}}resetCounter(){this.counter=this.random.nextUint32()*1024+(this.random.nextUint32()&1023)}generateV4(){const t=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);return t[6]=64|t[6]>>>4,t[8]=128|t[8]>>>2,ic.ofInner(t)}}const ige=()=>{if(typeof crypto<"u"&&typeof crypto.getRandomValues<"u")return new sge;if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");return{nextUint32:()=>Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536)}};class sge{constructor(){this.buffer=new Uint32Array(8),this.cursor=65535}nextUint32(){return this.cursor>=this.buffer.length&&(crypto.getRandomValues(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}let Yj;const b_=()=>oge().toString(),oge=()=>(Yj||(Yj=new rge)).generate();class __ extends Error{status;code;detailText;constructor(t,n){super(t),this.name="ChatApiError",this.status=n.status,this.code=n.code,this.detailText=n.detailText}}const age={409:"A response is still streaming in this conversation. Wait for it to finish, or stop it first."},JC="Something went wrong.",lge={turn_in_progress:"A response is still streaming in this conversation. Wait for it to finish, or stop it first.",approval_already_answered:"That approval was already answered.",approval_agent_mismatch:"That approval was for a different agent than the one now selected.",access_mode_fixed:"This chat's access mode was set when it started and can't change."},uge=[[/already (submitted|processing|running)/i,"The agent is still working on your last message."],[/model access denied/i,"That model isn't available on your plan."],[/(chat )?session not found/i,"This chat no longer exists."],[/not authenticated|could not validate credentials|invalid token|token has expired/i,"Your session expired. Sign in again."]],cge=/^processing error:\s*/i;function dge(e){const t=e.replace(cge,"").trim(),n=uge.find(([r])=>r.test(t));return n?n[1]:t||e}async function fge(e){try{const t=await e.json();return typeof t?.code=="string"?t.code:void 0}catch{return}}async function tb(e){const t=fge(e.clone()),{status:n,code:r,detailText:i,fromDetail:s}=await o8(e),o=await t,a=(o&&lge[o])??age[n]??(s?dge(s):void 0);return new __(a??JC,{status:n,code:o??r??void 0,detailText:i??void 0})}function hge(e){if(e instanceof __){const t=[],n=e.detailText??e.code;return n&&n!==e.message&&t.push(n),t.push(`HTTP ${e.status}`),{message:e.message,debug:t.join(" · ")}}return e instanceof Error&&e.message?{message:JC,debug:e.message}:{message:JC}}function pge(e){let t={};
63return e.headers instanceof Headers?e.headers.forEach((n,r)=>{t[r]=n}):e.headers&&(t=e.headers),t}function Qj(e,t){return{...e,headers:{...pge(e),Authorization:`Bearer ${t}`}}}async function lg(e,t={}){const n=kt(),r=await TP();if(n!==kt())throw new Error("Session changed before request was sent");let i=await fetch(e,Qj(t,r));if(i.status!==401){if(n!==kt())throw new Error("Session changed while request was in flight");return i}if(n!==kt())throw new Error("Session changed while request was in flight");const s=pn.getToken(),o=s&&s!==r?s:(await kP()).access_token;if(n!==kt())throw new Error("Session changed before request was retried");if(i=await fetch(e,Qj(t,o)),i.status===401)return eue(n,o);if(n!==kt())throw new Error("Session changed while request was retried");return i}class qP extends Error{status;detailText;constructor(t,n){super(t),this.name="ApiError",this.status=n.status,this.detailText=n.detailText}}class Bd extends Error{isNetworkError;isTimeout;constructor(t,n=!1){super(t),this.name="StreamConnectionError",this.isNetworkError=!n,this.isTimeout=n}}const mge=9e4,BV=new WeakMap;function h0(e){BV.get(e)?.()}function WP(e){return(e instanceof qP||e instanceof __)&&e.status===404}async function HV(e,t={}){const{timeoutMs:n=0,idleTimeoutMs:r=0,streamTerminator:i,signal:s,...o}=t,a=new AbortController,l=()=>a.abort();s?.addEventListener("abort",l,{once:!0}),s?.aborted&&l();let u,f=!1;const d=()=>{u&&clearTimeout(u),u=void 0,s?.removeEventListener("abort",l)},p=P=>{u&&clearTimeout(u),u=setTimeout(()=>{f=!0,a.abort()},P)};n>0&&p(n);let m;try{m=await lg(e,{...o,signal:a.signal})}catch(P){throw d(),f?new Bd("Connection timed out",!0):s?.aborted?P:P instanceof TypeError?new Bd(P.message):P}if(!m.body||m.status===204)return d(),m;r>0&&p(r);const v=m.body.getReader(),_=m.ok&&m.headers.get("content-type")?.includes("text/event-stream")?i:void 0,w=_?`
64${_}
65`:"";let x=`
66`,S=!1;const C=new TextDecoder,R=new Response(new ReadableStream({async pull(P){try{const k=await v.read();if(k.done){d(),w&&!S?P.error(new Bd("The response stream ended early")):P.close();return}w&&!S&&(x=(x+C.decode(k.value,{stream:!0})).replace(/\r\n/g,`
67`).slice(-w.length*2),S=x.includes(w)),r>0&&p(r),P.enqueue(k.value)}catch(k){d(),P.error(f?new Bd("Response body stalled",!0):a.signal.aborted?k:new Bd(k instanceof Error?k.message:"Connection lost"))}},cancel(P){return d(),a.abort(),v.cancel(P)}}),{status:m.status,statusText:m.statusText,headers:m.headers});return BV.set(R,d),R}async function et(e,t={}){const n=kt(),r=await lg(`${Ha}${e}`,t);if(r.status===204)return;const i=await r.json();if(n!==kt())throw new Error("Session changed while response body was read");if(!r.ok){console.error(`${t.method||"GET"} ${e} failed`,JSON.stringify(i));const s=i.detail??i.error,o=typeof s=="string"?s:s?JSON.stringify(s):void 0;throw new qP(i.error||o||"Request failed",{status:r.status,detailText:o})}return i}const gge=["origin","user_id","created_at","updated_at","archived_at","content_preview"];function qV(e){const t={...e};for(const n of gge)delete t[n];return t}function vge(){return async(e,t)=>{const n=await lg(e,t);if(n.ok)return n;if((t?.method??"GET").toUpperCase()==="GET")return new Response(null,{status:204});throw await tb(n)}}async function eHe(e,t){const n=await lg(`${Ha}${e}`,{method:"POST",body:t});if(!n.ok){const r=await n.text();throw console.error(`File upload to ${e} failed`,r),new Error(r||"Failed to upload file")}return n.json()}async function tHe(){return et("/chats/models/")}function WV(e){const t=e.metadata?.delegation;return!!(t&&typeof t=="object"&&"parent_session_id"in t&&typeof t.parent_session_id=="string")}async function GP(e=20,t=1){const r=(await et(`/chats/?page=${t}&per_page=${e}&starred_first=true`)).data||[],i=r.filter(s=>!WV(s));return Object.defineProperty(i,"serverCount",{value:r.length}),i}const GV=new Map;function yge(e){const t=GV.get(e);return t===void 0?1/0:Date.now()-t}async function nb(e){const t=await et(`/chats/${e}/`);return GV.set(e,Date.now()),t}async function bge(e,t){return et(`/chats/${e}/`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function nHe(e,t){return et(`/chats/${e}/context`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:t})})}async function rHe(e){try{return await et(`/chats/${e}/stop`,{method:"POST"})}catch{return{stopped:!1}}}async function _ge(e){return et(`/chats/${e}/`,{method:"DELETE"})}const wge=5;async function KV(e,t=10){const n=[];for(let r=1;r<=wge;r++){const i=new URLSearchParams({page:String(r),per_page:String(t),q:e}),o=(await et(`/chats/search/?${i.toString()}`)).data||[];if(n.push(...o.filter(a=>!WV(a))),n.length>=t||o.length<t)break}return n.slice(0,t)}async function xge(e){return et(`/chats/${e}/star`,{method:"POST"})}async function Sge(e){return et(`/chats/${e}/unstar`,{method:"POST"})}async function Ege(e){return et(`/chats/${e}/archive`,{method:"POST"})}async function iHe(e,t){return et(`/chats/${e}/fork`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message_id:t})})}const Cge=/(?:turn|response).*(?:already|still).*(?:running|streaming|progress)/i;function kge(e){try{const t=JSON.parse(e);if(t&&typeof t=="object"&&"code"in t&&typeof t.code=="string")return t.code==="turn_in_progress"}catch{}return Cge.test(e)}
67class Tge extends Error{constructor(){super("A response is still streaming for this chat"),this.name="StreamBusyError"}}function Pge(e){if(!e||typeof e!="object")return null;const t=e,n=t.input_id??t.id;return typeof n!="string"||!n?null:{input_id:n,position:typeof t.position=="number"?t.position:0,content:typeof t.content=="string"?t.content:"",...typeof t.created_at=="string"&&{created_at:t.created_at}}}async function Rge(e){const t=await et(`/chats/${e}/queue`);return(Array.isArray(t)?t:t&&typeof t=="object"&&"data"in t&&Array.isArray(t.data)?t.data:[]).map(Pge).filter(r=>r!==null).sort((r,i)=>r.position-i.position)}function Xj(e){return(e instanceof qP||e instanceof __)&&(e.status===409||e.status===404)}async function Ige(e,t,n){await et(`/chats/${e}/queue/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n})})}async function Oge(e,t){await et(`/chats/${e}/queue/${t}`,{method:"DELETE"})}async function Dge(e){const t=kt(),n=await lg(`${Ha}/chats/`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json, text/event-stream"},body:JSON.stringify({...e,intent:"queue"})});if(!n.ok)throw await tb(n);if(n.headers.get("content-type")?.includes("text/event-stream"))return n.body?.cancel().catch(()=>{}),null;const r=await n.json();if(t!==kt())throw new Error("Session changed while queued response was read");if(!r||typeof r!="object"||!("input_id"in r)||typeof r.input_id!="string")throw new Error("The queued message was accepted but not identified");return{input_id:r.input_id,status:"status"in r&&typeof r.status=="string"?r.status:"queued",position:"position"in r&&typeof r.position=="number"?r.position:0}}const Age={Accept:"text/event-stream"},Mge=["system","user","assistant"],Nge=e=>{if(typeof e!="object"||e===null)return!1;const{type:t,text:n}=e;return typeof t!="string"?!1:t==="text"||t==="reasoning"?typeof n=="string":!0};function jge(e,t){const n=e.agent_request;if(!n?.request_id)return;const r={type:`tool-${n.tool_name||"unknown"}`,toolCallId:n.request_id,input:n.tool_input??{},toolMetadata:{...n.summary&&{summary:n.summary},...n.status&&{status:n.status}}},i=t.find(s=>s.approval_response?.request_id===n.request_id)?.approval_response;return n.status==="answered"||i?{...r,state:"approval-responded",approval:{id:n.request_id,approved:i?i.decision==="allow":!0,...i?.note?{reason:i.note}:{}}}:{...r,state:"approval-requested",approval:{id:n.request_id}}}function KP(e){if(!Array.isArray(e)||e.length===0)return[];const t=[],n=new Map,r=new Map;return e.forEach((i,s)=>{i.role==="tool"&&i.tool_call_id&&n.set(i.tool_call_id,{row:i,index:s}),i.approval_response?.request_id&&r.set(i.approval_response.request_id,s)}),e.forEach((i,s)=>{if(!i||!Mge.includes(i.role)||i.approval_response)return;const o=Array.isArray(i.parts)?i.parts.filter(Nge):[],a=o.length>0?o:i.content?[{type:"text",text:i.content}]:[];if(i.role==="assistant"&&i.tool_calls?.length&&!o.length)for(const u of i.tool_calls){if(!u.id||!u.function?.name)continue;let f={};try{f=JSON.parse(u.function.arguments||"{}")}catch{f=u.function.arguments}const d=n.get(u.id)?.row;let p=d?.content;if(typeof p=="string")try{p=JSON.parse(p)}catch{}const m={type:`tool-${u.function.name}`,toolCallId:u.id,input:f};a.push(d?.is_error?{...m,state:"output-error",errorText:d.content||"Tool call failed"}:d?{...m,state:"output-available",output:p}:{...m,state:"output-available",output:void 0})}if(i.role==="assistant"&&typeof i.reasoning=="string"&&i.reasoning&&!a.some(u=>u.type==="reasoning"&&!!u.text)&&a.unshift({type:"reasoning",text:i.reasoning}),i.role==="assistant"&&i.agent_request){const u=jge(i,e);u&&(i.agent_request.summary&&a.push({type:"data-agent-request",data:{request_id:i.agent_request.request_id,summary:i.agent_request.summary}}),a.push(u))}
67if(a.length===0&&i.role==="user"&&i.files?.length&&a.push({type:"text",text:""}),a.length===0)return;const l={};i.created_at&&(l.created_at=i.created_at),i.files?.length&&(l.files=i.files),i.delegation&&(l.delegation=i.delegation),i.origin&&(l.origin=i.origin),t.push({id:i.id||`history-${s}`,role:i.role,parts:a,metadata:l,sourceIndex:Math.max(s,i.agent_request?.request_id?r.get(i.agent_request.request_id)??s:s,...(i.tool_calls??[]).map(u=>u.id?n.get(u.id)?.index??s:s))})}),Fge(t)}function ZP(e){return e.type==="dynamic-tool"||e.type.startsWith("tool-")}function ZV(e){if(!ZP(e))return!1;const t=e.state;return t?.startsWith("approval-")===!0||t==="output-denied"}function Lge(e){if(e.role!=="assistant"||e.metadata?.files?.length)return!1;const t=e.parts.filter(n=>n.type!=="step-start");return t.length>0&&t.every(n=>ZP(n)&&!ZV(n))}function Jj(e){if(e.role!=="assistant"||e.parts.some(ZV))return!1;const t=[...e.parts].reverse().find(n=>n.type!=="step-start");return!!t&&ZP(t)}function my(e,t,n=!1){return{...e,id:n?e.id:t.id,metadata:{...e.metadata,created_at:n?t.metadata?.created_at??e.metadata?.created_at:e.metadata?.created_at??t.metadata?.created_at},sourceIndex:Math.max(e.sourceIndex??-1,t.sourceIndex??-1),parts:n?[...t.parts,...e.parts]:[...e.parts,...t.parts]}}function Fge(e){const t=[];let n=null;for(const r of e){if(Lge(r)){const s=t[t.length-1];n?n=my(n,r):s&&Jj(s)?t[t.length-1]=my(s,r):n={...r,parts:[...r.parts]};continue}if(n){if(r.role==="assistant"){t.push(my(r,n,!0)),n=null;continue}t.push(n),n=null}const i=t[t.length-1];r.role==="assistant"&&i&&Jj(i)?t[t.length-1]=my(i,r):t.push(r)}return n&&t.push(n),t}function sHe(e,t){let n=-1,r=0;for(let i=0;i<e.length;i++){const s=e[i].sourceIndex??r;if(r=s+1,s>=t.until_index)break;n=i}return n}function $ge(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join(`
68`)}const YV="chat_unread",zge=200,yf=new Set;let io=new Set;const ek=new Set;let QV=0;function yc(){QV+=1;for(const e of ek)e()}function w_(){try{localStorage.setItem(YV,JSON.stringify([...io]))}catch{}}async function Vge(){try{const e=JSON.parse(localStorage.getItem(YV)??"[]");return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}catch{return[]}}const tk=new Set;let XV=!1;Vge().then(e=>{if(XV)return;const t=new Set(e.filter(n=>!tk.has(n)));for(const n of io)t.add(n);io=t,tk.clear(),w_(),yc()});function JV(e){if(!io.has(e)){io.add(e);for(const t of[...io].slice(0,Math.max(0,io.size-zge)))io.delete(t);w_(),yc()}}
68function eL(e,t,n){if(t!==yf.has(e)){if(t){yf.add(e),yc();return}yf.delete(e),n||JV(e),yc()}}function Uge(e,t){t||JV(e)}function Bge(e){tk.add(e),io.delete(e)&&(w_(),yc())}function Hge(e){yf.delete(e)&&yc()}function qge(){XV=!0,yf.clear(),io=new Set,w_(),yc()}function Wge(e){return ek.add(e),()=>{ek.delete(e)}}function Gge(){return QV}function Kge(e){return yf.has(e)}function Zge(e){return io.has(e)}const Yge=Number.MAX_SAFE_INTEGER;function Qge(e,t){const n=e.messages;if(!Array.isArray(n)||n.length===0)return e;const r=n[n.length-1];return{...e,messages:[...n.slice(0,-1),{...r,content:t,parts:[{type:"text",text:t}]}]}}function Xge(e){const t=e.references,n=e.files;return!!t?.length||!!n?.length}function Jge(e){const t=e.references,n=e.files;return(Array.isArray(t)?t.length:0)+(Array.isArray(n)?n.length:0)}class eve{constructor(t){this.id=t}ownerGeneration=null;get generation(){return this.ownerGeneration}outbox=[];snapshot=[];rows=[];listeners=new Set;chain=Promise.resolve();refreshing=!1;refreshWanted=!1;resendWanted=!1;forceWanted=!1;disposed=!1;inFlight=0;releaseWanted=!1;subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t),this.releaseIfIdle()});getSnapshot=()=>this.rows;get isActive(){return this.outbox.length>0||this.snapshot.length>0}get isIdle(){return!this.isActive&&this.listeners.size===0&&this.inFlight===0}release(){this.releaseWanted=!0,this.releaseIfIdle()}releaseIfIdle(){!this.releaseWanted||!this.isIdle||(this.releaseWanted=!1,!(As.get(this.id)!==this||Ia(this.id))&&(this.dispose(),As.delete(this.id)))}publish(){const t=new Map(this.snapshot.map(r=>[r.input_id,r])),n=[];for(const r of this.outbox){const i=r.inputId?t.get(r.inputId):void 0;i&&t.delete(r.inputId),n.push({key:r.key,text:i?.content||r.text,inputId:r.inputId,position:i?.position??Yge,state:r.state==="acknowledged"?"queued":r.state,remote:!1,hasAttachments:Xge(r.body),attachmentCount:Jge(r.body),error:r.error})}for(const r of t.values())n.push({key:`remote:${r.input_id}`,text:r.content,inputId:r.input_id,position:r.position,state:"queued",remote:!0,hasAttachments:!1,attachmentCount:0});n.sort((r,i)=>r.position-i.position),this.rows=n;for(const r of this.listeners)r();this.releaseIfIdle()}current(t){return this.ownerGeneration===null&&(this.ownerGeneration=t),!this.disposed&&this.ownerGeneration===t&&kt()===t}run(t,n){const r=kt();this.inFlight++;const i=this.chain.then(()=>this.current(r)?t(r):n);return this.chain=i.catch(()=>{}).then(()=>{this.inFlight--,this.releaseIfIdle()}),i}send(t,n){if(!this.current(kt()))return Promise.resolve("failed");const r={key:b_(),text:t,body:n,inputId:null,state:"sending"};return this.outbox=[...this.outbox,r],this.publish(),this.run(i=>this.admit(r,i),"failed")}async admit(t,n){if(!this.current(n))return"failed";try{const r=await Dge(t.body);return this.current(n)?r?(t.inputId=r.input_id,t.state="acknowledged",this.publish(),"queued"):(this.outbox=this.outbox.filter(s=>s!==t),this.publish(),Ia(this.id)?.noteTurnStarted(void 0,typeof t.body.model=="string"?t.body.model:void 0),this.requestRefresh(),"ran"):"failed"}catch(r){return this.current(n)&&(console.debug("[chat] queueing the message failed",r),t.state="failed",t.inputId=null,t.error=r,this.publish()),"failed"}}retry(t){const n=this.outbox.find(r=>r.key===t.key);return n?(n.state="sending",n.error=void 0,this.publish(),this.run(r=>this.admit(n,r),"failed")):Promise.resolve("failed")}edit(t,n){const r=t.inputId;return!r||!n||n===t.text?Promise.resolve():this.run(async i=>{try{if(await Ige(this.id,r,n),!this.current(i))return;const s=this.outbox.find(o=>o.inputId===r);s&&(s.text=n,s.body=Qge(s.body,n)),this.snapshot=this.snapshot.map(o=>o.input_id===r?{...o,content:n}:o),this.publish()}catch(s){if(!this.current(i))return;Xj(s)?this.requestRefresh():console.debug("[chat] editing a queued message failed",s)}},void 0)}remove(t){const n=t.inputId;return n?this.run(async r=>{try{if(await Oge(this.id,n),!this.current(r))return;this.forgetId(n)}catch(i){if(!this.current(r))return;Xj(i)?(this.forgetId(n),this.requestRefresh()):console.debug("[chat] removing a queued message failed",i)}},void 0):(this.forgetKey(t.key),Promise.resolve())}forgetKey(t){this.outbox=this.outbox.filter(n=>n.key!==t),this.publish()}forgetId(t){this.outbox=this.outbox.filter(n=>n.inputId!==t),this.snapshot=this.snapshot.filter(n=>n.input_id!==t),this.publish()}
68noteTurnStarted(t,n=[]){if(!this.current(kt()))return;const r=this.outbox.find(s=>s.inputId&&n.includes(s.inputId))?.body.model;if(n.length>0){const s=new Set(n);this.outbox=this.outbox.filter(o=>!(o.inputId&&s.has(o.inputId))),this.snapshot=this.snapshot.filter(o=>!s.has(o.input_id)),this.publish()}const i=Ia(this.id);i?.noteTurnStarted(t,typeof r=="string"?r:void 0),!i?.isStreaming&&this.requestRefresh()}requestRefresh({resend:t=!1,offer:n=!1}={}){this.current(kt())&&(this.refreshWanted=!0,this.resendWanted=this.resendWanted||t,this.forceWanted=this.forceWanted||!n,!this.refreshing&&this.run(r=>this.drain(r),void 0))}async drain(t){this.refreshing=!0;try{for(;this.refreshWanted&&this.current(t);){this.refreshWanted=!1;const n=this.resendWanted,r=this.forceWanted;this.resendWanted=!1,this.forceWanted=!1,await this.reconcile(n,r,t)}}finally{this.refreshing=!1}}async reconcile(t,n,r){const i=t?new Set(this.outbox.filter(d=>d.state==="acknowledged"&&d.inputId).map(d=>d.key)):new Set;let s;try{if(s=await Rge(this.id),!this.current(r))return}catch(d){if(!this.current(r))return;if(WP(d))return this.forgetChat();console.debug("[chat] queue listing failed",d);return}const o=await Eve(this.id,{reuseRecent:!n&&!t});if(!this.current(r))return;if(o===nU)return Ia(this.id)?.isTemporary?void 0:this.forgetChat();if(o===null)return;const a=new Set(o.recordIds),l=new Set(s.map(d=>d.input_id));this.snapshot=s;const u=[];this.outbox=this.outbox.filter(d=>d.inputId?a.has(d.inputId)?!1:(l.has(d.inputId)||i.has(d.key)&&u.push(d),!0):!0),this.publish();const f=Ia(this.id);o.model&&!f?.isStreaming&&f?.setHistoryModel(o.model),f&&!f.installHistory(o.messages,{force:n})&&f.notifyWhenReaderFree(()=>this.requestRefresh());for(const d of u){if(!this.current(r))return;console.debug("[chat] re-sending an input the queue lost",d.inputId),d.inputId=null,d.state="sending",this.publish(),await this.admit(d,r)}}forgetChat(){eU(this.id)}installTranscript(t,{force:n=!1}={}){this.run(async r=>{if(!this.current(r))return;const i=Ia(this.id);i&&!i.installHistory(t,{force:n})&&i.notifyWhenReaderFree(()=>this.requestRefresh({offer:!n}))},void 0)}dispose(){this.disposed=!0,this.listeners.clear()}}const As=new Map;function bf(e){let t=As.get(e);return t&&t.generation!==null&&t.generation!==kt()&&(t.dispose(),As.delete(e),t=void 0),t||(t=new eve(e),As.set(e,t)),t}function tve(e){return As.get(e)}function nve(){return[...As.entries()].filter(([,e])=>e.isActive).map(([e])=>e)}function eU(e){tU(e),rU(e),wr.removeQueries({queryKey:["chat",e]}),wr.setQueryData(["infinite-chats"],t=>t&&{...t,pages:t.pages.map(n=>n.filter(r=>r.id!==e))})}function tL(e){As.get(e)?.release()}function tU(e){As.get(e)?.dispose(),As.delete(e)}function rve(){for(const e of As.values())e.dispose();As.clear()}const ive=[{definition:{type:"function",function:{name:"getUserLocation",description:"Get the user's current location (latitude and longitude)",parameters:{type:"object",properties:{},required:[]}}},handler:async()=>{try{const e=await new Promise((t,n)=>{navigator.geolocation.getCurrentPosition(t,n)});return{latitude:e.coords.latitude,longitude:e.coords.longitude,accuracy:e.coords.accuracy}}catch{return{error:"Failed to get user location"}}}}];function sve(e){return e.type==="chat_title"&&typeof e.session_id=="string"&&typeof e.title=="string"&&e.title.length>0}function ove(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(sve(n))return n}}function p0(e){return e.parts.filter(t=>t.type==="text").map(t=>t.text).join(`
69`)}function ave(e,t){if(!e)return`Chat ${t.slice(0,8)}`;const n=e.split(" ");return n.slice(0,6).join(" ")+(n.length>6?"...":"")}function Hd(e){return e.parts.filter(t=>t.type==="dynamic-tool"||t.type.startsWith("tool-"))}function lve(){return{task:new Map,list:new Map,note:new Map,toolStatus:new Map,cancelledToolIds:new Set}}const uve=64*1024;function nL(e,t){const n=e[e.length-1],r=!!n&&n.role==="assistant";return{assistantTailIndex:r?e.length-1:null,partsLength:r?n.parts.length:0,streamDataLength:t}}function cve(e,t){const n=e.length-1;if(t.assistantTailIndex===n){const r=e[n];return[...e.slice(0,n),{...r,parts:r.parts.slice(0,t.partsLength)}]}return e.slice(0,n)}function rL(e){return e.parts.some(t=>(t.type==="dynamic-tool"||t.type.startsWith("tool-"))&&t.state==="approval-responded")}function iL(e,t,n=[],r=new Set){const i=e.length-1,s=e[i];if(!s)return{kind:"attach"};
69if(s.role==="user")return n.length===0||n.includes(s.id)||r.has(s.id)?{kind:"attach"}:{kind:"refuse"};if(s.role!=="assistant")return{kind:"attach"};if(t!==null&&s.id===t)return{kind:"restore"};if(rL(s))return{kind:"attach"};const o=new Set(n);for(let a=i-1;a>=0;a--){const l=e[a];if(o.has(l.id))return{kind:"rewind",keep:a+1};if(l.role!=="assistant"||rL(l))break}return{kind:"refuse"}}async function dve(e){const t=e.body;if(!t)return{messageId:null,inputIds:[],response:e};const n=t.getReader(),r=new TextDecoder,i=[];let s="",o=null,a=[],l=!1;try{for(;s.length<uve;){const{done:f,value:d}=await n.read();if(f){l=!0;break}i.push(d),s+=r.decode(d,{stream:!0});const p=fve(s);if(p.settled){o=p.messageId,a=p.inputIds;break}}}catch(f){throw n.cancel().catch(()=>{}),f}const u=new ReadableStream({start(f){for(const d of i)f.enqueue(d);l&&f.close()},async pull(f){const{done:d,value:p}=await n.read();d?f.close():f.enqueue(p)},cancel(f){return n.cancel(f)}});return{messageId:o,inputIds:a,response:new Response(u,{status:e.status,statusText:e.statusText,headers:e.headers})}}function fve(e){const t=e.replace(/\r\n?/g,`
70`).split(`
71
72`);for(const n of t.slice(0,-1))for(const r of n.split(`
73`)){if(!r.startsWith("data:"))continue;let i;try{i=JSON.parse(r.slice(5).trim())}catch{continue}if(i.transient!==!0)return i.type==="start"?{settled:!0,messageId:typeof i.messageId=="string"?i.messageId:null,inputIds:hve(i.messageMetadata)}:{settled:!0,messageId:null,inputIds:[]}}return{settled:!1,messageId:null,inputIds:[]}}function hve(e){if(!e||typeof e!="object")return[];const t=e.input_ids;return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}function sL(e){return e instanceof Bd?e.isNetworkError||e.isTimeout:e instanceof TypeError}const pve=15e3,mve=2e4;class oL extends Error{constructor(){super("The message was not sent"),this.name="UnacceptedSendError"}}const gve={liveTurn:!1,streamData:[],sentReferences:{},sentFiles:{},sentReferenceTitles:[],replaying:!1,reconnect:null,reconnectError:null,refreshError:null,sendCount:0},aL=[2e3,5e3,15e3];class vve{id;apiUrl;chat;persisted;temporary;requestBody={};sentModel;lastRequestBody=null;sessionStamp=null;streamedTitle=null;pendingApprovalWire=new Map;wireCarriedApprovalIds=[];autoSentApprovalIds=new Set;approvalModels=new Map;activeTurnModel;historyModel;lastSendKind="message";viewState=gve;listeners=new Set;turnDataStart=0;processedDataCount=0;listed=!1;requestStart={assistantTailIndex:null,partsLength:0,streamDataLength:0};_interrupted=null;reattaching=!1;reattachInFlight=!1;reattachFailed=!1;reattachRetries=0;reattachGaveUp=!1;reattachTimer=null;sendEpoch=0;lastError=null;lastFrameAt=0;abortToReattach=!1;resumeActive=!1;statusHint=null;cardAssignments=lve();sentUserIds=new Set;viewCount=0;coldResumeDone=!1;coldResumeQueued=!1;disposed=!1;lastSentAttachments=null;unsubscribers=[];constructor(t){this.id=t.sessionId,this.apiUrl=t.apiUrl,this.persisted=t.persisted,this.temporary=t.isTemporary,this.seedAnsweredApprovals(t.initialMessages),this.chat=new UV({id:this.id,messages:t.initialMessages,transport:this.createTransport(),onToolCall:({toolCall:i})=>{const s=ive.find(o=>o.definition.function.name===i.toolName);s&&Promise.resolve(s.handler()).then(o=>this.chat.addToolOutput({tool:i.toolName,toolCallId:i.toolCallId,output:o}))},onData:i=>this.handleData(i),onError:i=>{this.lastError=i},onFinish:i=>this.handleFinish(i),sendAutomaticallyWhen:({messages:i})=>this.shouldSendAutomatically(i)}),this.unsubscribers.push(this.chat["~registerStatusCallback"](()=>this.handleStatusChange()),this.chat["~registerMessagesCallback"](()=>this.handleMessagesChange()));const n=()=>{document.visibilityState==="visible"&&this.recover()},r=()=>{document.visibilityState!=="hidden"&&this.recover()};document.addEventListener("visibilitychange",n),window.addEventListener("online",r),this.unsubscribers.push(()=>{document.removeEventListener("visibilitychange",n),window.removeEventListener("online",r)})}seedAnsweredApprovals(t){for(const n of t)for(const r of Hd(n))r.state==="approval-responded"&&typeof r.approval?.id=="string"&&this.autoSentApprovalIds.add(r.approval.id)}setTurnModel(t){t&&(this.activeTurnModel=t,this.sentModel=t,this.bindApprovalModels(this.chat.messages,t))}setHistoryModel(t){t&&(this.historyModel=t,this.activeTurnModel||(this.activeTurnModel=t),this.bindApprovalModels(this.chat.messages,t))}bindApprovalModels(t,n){if(n)for(const r of t)for(const i of Hd(r)){const s=i.approval?.id;typeof s=="string"&&!this.approvalModels.has(s)&&this.approvalModels.set(s,n)}}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.viewState;update(t){this.viewState={...this.viewState,...t};for(const n of this.listeners)n()}get interrupted(){return this._interrupted}set interrupted(t){this._interrupted=t,t||this.cancelReattachRetry(),this.syncReconnect(),this.syncLiveTurn(),!t&&!this.disposed&&window.setTimeout(()=>this.drainPending(),0)}syncLiveTurn(){const t=this.hasLiveTurn;t!==this.viewState.liveTurn&&this.update({liveTurn:t}),this.disposed||eL(this.id,this.confirmedLive,this.hasViews)}
73get confirmedLive(){return this.status==="streaming"||!!this.liveTurnHint||!!this.interrupted&&!this.reattachGaveUp}syncReconnect(){const t=this._interrupted?this.reattachGaveUp?"failed":"reconnecting":null,n=t==="failed"?this.lastError:null;(t!==this.viewState.reconnect||n!==this.viewState.reconnectError)&&(this.update({reconnect:t,reconnectError:n}),this.disposed||eL(this.id,this.confirmedLive,this.hasViews))}cancelReattachRetry(){this.reattachTimer&&(clearTimeout(this.reattachTimer),this.reattachTimer=null),this.reattachRetries=0,this.reattachGaveUp=!1,this.syncReconnect()}scheduleReattachRetry(){if(!this.interrupted||this.disposed||this.reattachTimer||document.visibilityState==="hidden")return;if(!!this.lastError&&!sL(this.lastError)||this.reattachRetries>=aL.length){this.reattachGaveUp=!0,this.syncReconnect();return}const n=aL[this.reattachRetries++];this.reattachTimer=setTimeout(()=>{this.reattachTimer=null,document.visibilityState!=="hidden"&&this.tryReattach()},n)}get streamData(){return this.viewState.streamData}get status(){return this.statusHint??this.chat.status}get isStreaming(){const t=this.status;return t==="submitted"||t==="streaming"}get hasLiveTurn(){return this.status==="streaming"||!!this.liveTurnHint||!!this.interrupted||this.resumeActive}get isBusy(){return this.isStreaming||!!this.interrupted}get shouldRetain(){return this.hasViews||this.isBusy||this.resumeActive||!!this.chat.error}
73attach(){return this.viewCount+=1,Bge(this.id),this.coldResumeDone||this.coldResume(),()=>{this.viewCount=Math.max(0,this.viewCount-1)}}recover(){this.cancelReattachRetry(),this.tryReattach(),this.coldResumeDone||this.coldResume(),this.drainPending()}releaseResume(){this.resumeActive=!1,this.syncLiveTurn(),window.setTimeout(()=>this.drainPending(),0),this.coldResumeQueued&&(this.coldResumeQueued=!1,window.setTimeout(()=>this.coldResume(),0))}coldResume(){if(!(this.disposed||!this.persisted||this.isBusy||this.chat.messages.length===0)){if(this.resumeActive){this.coldResumeQueued=!0;return}this.coldResumeDone=!0,this.chat.resumeStream().catch(t=>{this.coldResumeDone=!1,console.debug("[chat] cold resume failed",t)})}}noteTurnStarted(t,n){n&&this.setTurnModel(n),!this.isStreaming&&(t&&this.chat.messages.some(r=>r.id===t)||(n||(this.activeTurnModel=void 0),this.persisted=!0,this.liveTurnHint=t??"live",this.syncLiveTurn()))}installHistory(t,{force:n=!0}={}){return this.disposed?!0:this.isBusy||this.chat.error?!1:(!t||t.length===0||(this.adoptHistory(t,{force:n})||this.tryReattach(),this.liveTurnHint=null,this.syncLiveTurn()),!0)}notifyWhenReaderFree(t){if(!this.disposed){if(!this.isBusy&&!this.resumeActive&&!this.chat.error){t();return}this.readerWaiters.push(t)}}readerWaiters=[];liveTurnHint=null;drainPending(){if(this.disposed||this.isBusy||this.resumeActive||this.chat.error||this.readerWaiters.length===0)return;const t=this.readerWaiters.splice(0,this.readerWaiters.length);for(const n of t)n()}get isTemporary(){return this.temporary}setTemporary(t){this.temporary=t}get hasViews(){return this.viewCount>0}get isDisposed(){return this.disposed}dispose(){if(!this.disposed){this.disposed=!0,this.readerWaiters.length=0,this.liveTurnHint=null,Hge(this.id
73),this.cancelReattachRetry(),this.chat.stop();for(const t of this.unsubscribers)t();this.unsubscribers.length=0,this.listeners.clear()}}handleData(t){this.lastFrameAt=Date.now();const{type:n,data:r}=t;if(n==="data-heartbeat")return;let i=[];if(n==="data-mentes")i=(Array.isArray(r)?r:r?[r]:[]).filter(a=>!!a&&typeof a=="object"&&typeof a.type=="string");else if(n==="data-tool-status")r&&typeof r=="object"&&(i=[{...r,type:"tool_status"}]);else if(n==="data-agent-request")r&&typeof r=="object"&&(i=[{...r,type:"agent_request"}]);else{const o=n.replace(/^data-/,"");i=[r&&typeof r=="object"?{...r,type:o}:{type:o}]}if(i.length===0)return;const s=this.viewState.streamData;this.setStreamData([...s,...i.map((o,a)=>({...o,_seq:`s${s.length+a}`}))])}resetCardAssignments(){const t=this.cardAssignments;t.task.clear(),t.list.clear(),t.note.clear(),t.toolStatus.clear(),t.cancelledToolIds.clear()}setStreamData(t){this.update({streamData:t}),this.absorbStreamedTitle()}absorbStreamedTitle(){const t=this.viewState.streamData,n=t.slice(this.processedDataCount);this.processedDataCount=t.length;const r=ove(n);!r||r.session_id!==this.id||(this.streamedTitle=r,wr.setQueryData(["chat",r.session_id],i=>i&&i.title!==r.title?{...i,title:r.title}:i),wr.setQueryData(["infinite-chats"],i=>i&&{...i,pages:i.pages.map(s=>s.map(o=>o.id===r.session_id?{...o,title:r.title}:o))}))}currentTurnData(){return this.viewState.streamData.slice(this.turnDataStart)}recordSentAttachments(t){this.lastSentAttachments=t}recordSentReferenceTitles(t){t.length!==0&&this.update({sentReferenceTitles:[...this.viewState.sentReferenceTitles,...t]})}get sentReferenceTitles(){return this.viewState.sentReferenceTitles}get sentReferences(){return this.viewState.sentReferences}get sentFiles(){return this.viewState.sentFiles}get pendingSentAttachments(){return this.lastSentAttachments}handleMessagesChange(){this.isStreaming&&(this.lastFrameAt=Date.now()),this.bindApprovalModels(this.chat.messages,this.activeTurnModel??this.historyModel);const t=this.lastSentAttachments;if(!t)return;const n=this.chat.messages;if(n.length<=t.priorCount)return;const r=n.slice(t.priorCount).find(s=>s.role==="user");if(!r)return;this.lastSentAttachments=null;const i={};t.refs.length>0&&(i.sentReferences={...this.viewState.sentReferences,[r.id]:t.refs}),t.files.length>0&&(i.sentFiles={...this.viewState.sentFiles,[r.id]:t.files}),Object.keys(i).length>0&&this.update(i)}handleStatusChange(){this.statusHint=null,this.syncLiveTurn();const t=this.chat.status;t==="submitted"&&(this.turnDataStart=this.viewState.streamData.length),t==="streaming"&&(this.listInSidebar(),this.persisted=!0),this.viewState.replaying&&!this.isStreaming&&this.update({replaying:!1}),this.drainPending(),!this.hasViews&&!this.isBusy&&window.setTimeout(()=>xve(),0)}listInSidebar(){if(this.persisted||this.isTemporary||this.listed)return;const t=this.chat.messages.find(r=>r.role==="user");if(!t)return;this.listed=!0;const n=ave(p0(t),this.id);wr.setQueryData(["infinite-chats"],r=>{const i=r?.pages??[[]];if(i.some(o=>o.some(a=>a.id===this.id)))return r;const s=new Date().toISOString();return{pages:[[{id:this.id,title:n,created_at:s,updated_at:s,...this.sessionStamp?.isAgent&&{source:"agent"}},...i[0]],...i.slice(1)],pageParams:r?.pageParams??[1]}})}shouldSendAutomatically(t){const n=t[t.length-1];if(!n||n.role!=="assistant")return!1;const r=Hd(n);if(r.some(s=>s.state==="approval-requested"))return!1;const i=r.filter(s=>s.state==="approval-responded").map(s=>s.approval?.id).filter(s=>typeof s=="string"&&!this.autoSentApprovalIds.has(s));return i.length===0?!1:(i.forEach(s=>this.autoSentApprovalIds.add(s)),!0)}loadHistory=async()=>{const t=kt();try{const n=await nb(this.id);if(t!==kt())throw new Error("Session changed while history was read");return wr.setQueryData(["chat",this.id],n),n?.messages?KP(n.messages):[]}catch(n){return WP(n)?!this.persisted||this.temporary?[]:(this.lastHistoryError=n,window.setTimeout(()=>eU(this.id),0),null):(this.lastHistoryError=n,null)}};lastHistoryError=null;refreshFromServer=async()=>{if(this.disposed)return;if(this.update({refreshError:null}),this.hasInterruption){await this.retryReattach();return}if(this.chat.error){await this.resyncFromServer()||this.update({refreshError:this.lastHistoryError??this.chat.error});return}if(this.isBusy||this.resumeActive){await this.tryReattach(),this.notifyWhenReaderFree(()=>void this.refreshFromServer());return}this.lastHistoryError=null;const t=await this.loadHistory();if(!this.disposed){if(t===null){this.update({refreshError:this.lastHistoryError});return}
73bf(this.id).installTranscript(t,{force:!0})}};resyncFromServer=()=>this.loadHistory().then(t=>t?(t.length>0&&this.replaceTranscript(t),this.chat.clearError(),window.setTimeout(()=>this.drainPending(),0),!0):!1);replaceTranscript(t){this.chat.messages=t,this.seedAnsweredApprovals(t),this.bindApprovalModels(t,this.historyModel??this.activeTurnModel),this.resetCardAssignments()}adoptHistory(t,{force:n=!1}={}){if(this.isBusy||this.chat.error||t.length===0||!n&&!bve(t,this.chat.messages))return!1;this.replaceTranscript(t),this.viewState={...this.viewState,streamData:[]},this.turnDataStart=0,this.processedDataCount=0;for(const r of this.listeners)r();return this.coldResumeDone=!1,this.coldResume(),!0}reconcileHistory(t){return this.adoptHistory(t)}tryReattach=async()=>{if(this.disposed||this.reattachInFlight)return;this.reattachTimer&&(clearTimeout(this.reattachTimer),this.reattachTimer=null);const t=this.status;if(t==="submitted")return;if(t==="streaming"){Date.now()-this.lastFrameAt>mve&&(this.abortToReattach=!0,this.chat.stop());return}if(!this.interrupted)return;console.debug("[chat] re-attaching to the interrupted turn");const n=this.interrupted;this.reattachGaveUp&&(this.reattachGaveUp=!1,this.syncReconnect()),this.reattachInFlight=!0,this.reattaching=!0,this.reattachFailed=!1;try{await this.chat.resumeStream()}finally{this.reattaching=!1,this.reattachInFlight=!1}!this.reattachFailed&&this.interrupted===n?this.interrupted=null:this.scheduleReattachRetry()};retryReattach(){return this.cancelReattachRetry(),this.tryReattach()}get hasInterruption(){return!!this.interrupted}stoppedByUser(){this.interrupted=null,this.liveTurnHint=null,this.syncLiveTurn()}handleFinish({messages:t,isAbort:n,isError:r}){if(this.disposed)return;const i=this.resumeActive,s=n&&this.abortToReattach,o=s||r&&sL(this.lastError);if(this.abortToReattach=!1,this.lastError=null,o?(this.interrupted={start:this.requestStart,kind:this.interrupted?.kind??this.lastSendKind},(!i||s)&&document.visibilityState!=="hidden"?(this.statusHint=r?"error":"ready",window.setTimeout(()=>void this.tryReattach(),0)):this.reattachInFlight||this.scheduleReattachRetry()):!n&&!r&&(this.interrupted=null),i){this.releaseResume();return}if(!n&&!r){const u=this.sentModel;if(u){const f=["chat",this.id],d=wr.getQueryState(f)?.dataUpdatedAt;wr.setQueryData(f,p=>p&&p.model!==u?{...p,model:u}:p,{updatedAt:d})}for(const f of this.wireCarriedApprovalIds)this.pendingApprovalWire.delete(f);if(this.wireCarriedApprovalIds=[],!this.isTemporary){const f=["chat",this.id],d=wr.getQueryState(f)?.dataUpdatedAt;wr.setQueryData(f,p=>p&&{...p,messages:t},{updatedAt:d}),wr.invalidateQueries({queryKey:["infinite-chats"]}),bf(this.id).requestRefresh({offer:!0})}return}const a=t[t.length-1];if(!a||a.role!=="assistant")return;const l=Hd(a).filter(u=>u.state==="approval-responded").map(u=>u.approval?.id).filter(u=>typeof u=="string"&&!this.autoSentApprovalIds.has(u));l.length!==0&&(l.forEach(u=>this.autoSentApprovalIds.add(u)),this.lastSendKind="approval",this.chat.sendMessage(void 0))}createTransport(){const t=async(o,a,l=!1)=>{const u=new Headers(a?.headers);u.set("Accept","text/event-stream");const f=await HV(o,{...a,headers:u,timeoutMs:l?pve:0,idleTimeoutMs:mge,streamTerminator:"data: [DONE]"});let d=null,p=!1;f.status===409&&(d=await f.text(),p=kge(d));let m=!1;if(d)try{const v=JSON.parse(d);m=!!v&&typeof v=="object"&&"code"in v&&v.code==="approval_already_answered"}catch{}if((f.status===409&&m||f.status===404)&&this.wireCarriedApprovalIds.length>0){for(const v of this.wireCarriedApprovalIds)this.pendingApprovalWire.delete(v);this.wireCarriedApprovalIds=[]}if(p)throw new Tge;if(!f.ok&&!l)throw await tb(d===null?f:new Response(d,{status:f.status,statusText:f.statusText,headers:f.headers}));return d!==null?new Response(d,{status:f.status,statusText:f.statusText,headers:f.headers}):f},n=o=>{h0(o),o.body?.cancel().catch(()=>{})},r=(o,a)=>{const l=this.requestStart,u=iL(this.chat.messages,o,a,this.sentUserIds);if(u.kind==="restore"){this.chat.messages=cve(this.chat.messages,l);const f=this.viewState.streamData.slice(l.streamDataLength);for(const d of f)d.type!=="tool_status"||typeof d.id!="string"||(this.cardAssignments.cancelledToolIds.delete(
73d.id),this.cardAssignments.toolStatus.delete(d.id));this.setStreamData(this.viewState.streamData.slice(0,l.streamDataLength))}else u.kind==="rewind"&&(this.chat.messages=this.chat.messages.slice(0,u.keep));return u},i=async(o,a)=>{const{messageId:l,inputIds:u,response:f}=await dve(o);if(a())return f.body?.cancel().catch(()=>{}),"overtaken";let d=iL(this.chat.messages,l,u,this.sentUserIds);if((d.kind==="restore"||d.kind==="rewind")&&(d=r(l,u)),console.debug(`[chat] resume: live turn ${l??"?"} — ${d.kind}${this.reattaching?" (re-attach)":""}`),d.kind==="refuse")return this.coldResumeDone=!1,console.debug("[chat] resume refused — the transcript predates the live turn"),f.body?.cancel().catch(()=>{}),null;if(this.reattaching&&this.interrupted?.kind==="approval"){for(const p of this.wireCarriedApprovalIds)this.pendingApprovalWire.delete(p);this.wireCarriedApprovalIds=[]}return this.requestStart=nL(this.chat.messages,this.viewState.streamData.length),this.update({replaying:!0}),f},s=async(o,a)=>{if(!((a?.method??"GET").toUpperCase()==="GET")){const _=this.chat.messages[this.chat.messages.length-1];return _?.role==="user"&&this.sentUserIds.add(_.id),this.requestStart=nL(this.chat.messages,this.viewState.streamData.length),this.interrupted=null,this.sendEpoch+=1,this.resumeActive=!1,this.syncLiveTurn(),this.update({sendCount:this.viewState.sendCount+1,...this.viewState.replaying&&{replaying:!1}}),t(o,a)}this.resumeActive=!0,this.syncLiveTurn();const u=this.lastSendKind;this.lastSendKind="resume";const f=this.reattaching,d=this.sendEpoch,p=()=>(this.releaseResume(),new Response(null,{status:204})),m=()=>this.sendEpoch!==d,v=async()=>{if(f){this.lastHistoryError=null;const _=await this.loadHistory();if(!_){const I=this.lastHistoryError;throw I instanceof Error?I:new Error("Could not reload the chat after reconnecting")}if(m())return p();const w=this.interrupted?.kind??u,x=I=>I.filter(D=>D.role==="user"),S=x(this.chat.messages),C=S[S.length-1],R=x(_),P=w==="message"&&!!C&&!R.slice(S.length-1).some(I=>p0(I)===p0(C));let k=!1;if(w==="approval"){const I=this.pendingApprovalWire,D=new Set;for(const L of _)for(const A of Hd(L))A.state==="approval-responded"&&typeof A.approval?.id=="string"&&D.add(A.approval.id);for(const L of[...I.keys()])D.has(L)&&I.delete(L);k=I.size>0}if(P||k)throw this.lastSendKind=w,new oL;this.setStreamData(this.viewState.streamData.slice(0,this.requestStart.streamDataLength)),this.replaceTranscript(_),this.chat.clearError()}return p()};try{const _=await t(o,a,!0);if(m())return n(_),p();if(_.status===204||_.status===404)return _.status===404&&n(_),await v();if(_.ok){const x=await i(_,m);return x==="overtaken"?p():x??await v()}console.debug(`[chat] resume unavailable (${_.status}) — falling back to history`),this.coldResumeDone=!1;const w=f?await tb(_):null;if(n(_),w)throw w;return p()}catch(_){if(f){if(this.releaseResume(),m())return p();throw _ instanceof oL?this.interrupted=null:this.reattachFailed=!0,_}return console.debug("[chat] resume failed — falling back to history",_),this.coldResumeDone=!1,p()}};return new y_({api:this.apiUrl,fetch:s,prepareReconnectToStreamRequest:({api:o,id:a})=>({api:`${o.replace(/\/$/,"")}/${a}/stream`}),body:()=>this.requestBody,prepareSendMessagesRequest:({id:o,messages:a,body:l,trigger:u,messageId:f})=>{const d=a.filter(S=>S.role==="user"||S.role==="assistant"||S.role==="system"),p=this.pendingApprovalWire,m=this.requestBody.model,v=p.keys().next().value,_=v?this.approvalModels.get(v)??this.activeTurnModel??this.historyModel??this.sentModel??m:void 0,w=[...p].filter(([S])=>(this.approvalModels.get(S)??_)===_);if(this.wireCarriedApprovalIds=w.map(([S])=>S),w.length>0&&d.length>0){const S=d[d.length-1];d[d.length-1]={...S,parts:[...S.parts,...w.map(([C,R])=>({type:"tool-approval-response",approvalId:C,approved:R.approved,...R.reason&&{reason:R.reason}}))]}}const x=w.length>0?_:m;return this.sentModel=x,x&&(this.activeTurnModel=x),{headers:{Accept:"text/event-stream"},body:{...l,...x&&{model:x},id:o,messages:d,trigger:u,messageId:f}}}})}}const yve={"input-streaming":1,"input-available":2,"approval-requested":2,"approval-responded":3,"output-error":4,"output-
73available":4};function lL(e){let t=0;for(const n of e){if(n.role==="user"||n.role==="assistant"){t+=p0(n).length;const r=n.parts.filter(i=>i.type==="file").length;t+=Math.max(r,n.metadata?.files?.length??0);for(const i of n.parts??[])i.type==="reasoning"&&(t+=i.text?.length??0)}for(const r of Hd(n))t+=yve[r.state]??0}return t}function bve(e,t){return lL(e)>lL(t)}const _ve=5,yi=new Map,wve=50,qd=new Map;function oHe(e){const t=qd.get(e);if(t)return t;const n=b_();qd.set(e,n);for(const[r,i]of[...qd].slice(0,qd.size-wve))yi.has(i)||qd.delete(r);return n}function Ia(e){const t=yi.get(e);return t&&!t.isDisposed?t:void 0}function aHe(e){const t=yi.get(e);t&&(yi.delete(e),yi.set(e,t))}function lHe(e){const t=yi.get(e.sessionId);if(t&&!t.isDisposed)return t.persisted=t.persisted||e.persisted,t;const n=new vve(e);return yi.set(e.sessionId,n),n}function xve(){const e=[];for(const t of yi.values())if(!t.shouldRetain){if(t.chat.messages.length===0){yi.delete(t.id),t.dispose(),tL(t.id);continue}e.push(t)}for(const t of e.slice(0,Math.max(0,e.length-_ve)))yi.delete(t.id),t.dis
73pose(),tL(t.id)}function Sve(){return[...yi.values()].filter(e=>!e.isDisposed&&e.persisted).map(e=>e.id)}const nU="missing",uL=5e3;async function Eve(e,{reuseRecent:t=!1}={}){const n=kt();return(t&&(wr.getQueryState(["chat",e])?.fetchStatus==="fetching"||yge(e)<uL)?wr.fetchQuery({queryKey:["chat",e],queryFn:()=>nb(e),staleTime:uL}):nb(e).then(s=>{if(n!==kt())throw new Error("Session changed before history was cached");return s&&wr.setQueryData(["chat",e],s),s})).then(s=>{if(n!==kt())throw new Error("Session changed while history was read");return{messages:s?.messages?KP(s.messages):[],model:s?.model??void 0,recordIds:s?.messages?.map(o=>o.id).filter(o=>typeof o=="string")??[]}}).catch(s=>WP(s)?nU:null)}function rU(e){const t=yi.get(e);t&&(yi.delete(e),t.dispose())}function Cve(){qd.clear();for(const e of yi.values())e.dispose();yi.clear()}const wr=new b8({defaultOptions:{queries:{staleTime:60*1e3}}}),iU=new b8;function gy(){Cve(),rve(),qge(),wr.clear(),iU.clear()}const kve=360*60*1e3,sU=b.createContext(void 0);async function Tve(e,t){const n=kt(),r=new FormData;r.set("username",e),r.set("password",t);let i;try{i=await fetch(`${Ha}/auth/jwt/login`,{method:"POST",headers:r8(),body:r})}catch(l){throw u8(l)}if(!i.ok)throw await l8(i,"Login failed");const s=await i.json();if(!await J9(s,n))return null;const o=kt(),a=await Rm(s.access_token);if(kt()!==o)return null;if(a.status==="rejected"){if(!await Em(o,s.access_token))return null;throw new Error("Failed to fetch user profile (401)")}return a.status==="unavailable"?{status:"unavailable",sessionGeneration:o,...s}:{status:"ok",user:a.user,sessionGeneration:o,...s}}async function Pve(e){const t=kt();let n;try{n=await fetch(`${Ha}/auth/jwt/exchange`,{method:"POST",headers:{"Content-Type":"application/json",...r8()},body:JSON.stringify({provider:"google",access_token:e.access_token,id_token:e.access_token,token_type:e.token_type,expires_in:e.expires_in,scope:e.scope,type:"oauth",providerAccountId:""})})}catch(o){throw u8(o)}if(!n.ok)throw await l8(n,"Google login failed");const r=await n.json();if(!await J9(r,t))return null;const i=kt(),s=await Rm(r.access_token);if(kt()!==i)return null;if(s.status==="rejected"){if(!await Em(i,r.access_token))return null;throw new Error("Failed to fetch user profile (401)")}return s.status==="unavailable"?{status:"unavailable",sessionGeneration:i,...r}:{status:"ok",user:s.user,sessionGeneration:i,...r}}async function Rm(e){let t;try{t=await fetch(`${Ha}/users/me`,{headers:{Authorization:`Bearer ${e}`}})}catch(n){return console.error("Could not reach /users/me",n),{status:"unavailable"}}if(t.status===401)return{status:"rejected"};if(!t.ok)return{status:"unavailable"};try{const n=await t.json();return{status:"ok",user:Rve(n)}}catch(n){return console.error("Invalid /users/me response",n),{status:"unavailable"}}}async function cL(e){const t=await Rm(e);return t.status==="ok"?t.user:null}function Rve(e){return{id:e.id,email:e.email,name:e.full_name||e.email,image:e.image,full_name:e.full_name,is_active:e.is_active,is_superuser:e.is_superuser,is_verified:e.is_verified,nickname:e.nickname,job_title:e.job_title,bio:e.bio,picture:e.picture,plan:e.plan,timezone:e.timezone}}function Ive({children:e}){const[t,n]=b.useState(null),[r,i]=b.useState(null),[s,o]=b.useState(!0),a=b.useRef(null),l=b.useRef(0),u=b.useCallback((w,x)=>{const S=a.current;if(S&&w.generation<S.generation)return;const C=w.credentials?.accessToken??null,R=!S||w.generation>S.generation;if(a.current=w,!R){i(C),C||(l.current+=1,gy(),n(null),o(!1));return}const P=++l.current;if(gy(),n(null),i(C),!C||!x){o(!1);return}o(!0),(async()=>{const k=await Rm(C);P!==l.current||kt()!==w.generation||(k.status==="ok"?n(k.user):k.status==="rejected"&&await Em(w.generation,C),P===l.current&&o(!1))})()},[]);b.useEffect(()=>{const w=()=>{u(pn.getSessionSnapshot(),!1)},x=S=>{S.key!==xm||S.storageArea&&S.storageArea!==localStorage||!SP(S.newValue)||u(pn.getSessionSnapshot(),!0)};return window.addEventListener(Sm,w),window.addEventListener("storage",x),()=>{window.removeEventListener(Sm,w),window.removeEventListener("storage",x)}},[u]);const f=b.useCallback(async()=>{const w=pn.getToken();if(w)try{const x=await LN();x!==w&&i(x)}catch(x){console.error("Unable to refresh session",x)}},[]);b.useEffect(()=>{(async()=>{const x=pn.getSessionSnapshot();a.current=x;const S=x.generation,C=x.credentials?.accessToken??null;if(C){let R=C;try{R=await LN()}catch{if(kt()!==S)return;if(!pn.getToken()){o(!1);return}if(NC(C)){o(!1);return}}if(kt()!==S)return;const P=await Rm(R);if(kt()!==S)return;if(P.status==="ok"){const k=pn.getToken();k&&(n(P.user),i(k))}else P.status==="rejected"&&await Em(S,R)}o(!1)})()},[]),b.useEffect(()=>{const w=()=>{document.visibilityState==="visible"&&f()};return document.addEventListener("visibilitychange",w),()=>document.removeEventListener("visibilitychange",w)},[f]),b.useEffect(()=>{const w=setInterval(f,kve);return()=>clearInterval(w)},[f]);const d=b.useCallback(async(w,x)=>{const S=await Tve(w,x);if(!S||kt()!==S.sessionGeneration)return;const C=pn.getToken();if(C){if(S.status==="unavailable")throw gy(),n(null),i(C),new Error("Failed to fetch user profile");n(S.user),i(C)}},[]),p=b.useCallback(async w=>{const x=await Pve(w);if(!x||kt()!==x.sessionGeneration)return;const S=pn.getToken();if(S){if(x.status==="unavailable")throw gy(),n(null),i(S),new Error("Failed to fetch user profile");n(x.user),i(S)}},[]),m=b.useCallback(async w=>{const x=kt(),S=await cL(w);if(x===kt()){if(!S)throw new Error("Invalid token");await Qle(w,x)&&(n(S),i(w))}},[]),v=b.useCallback(async()=>{const w=pn.getToken(),x=pn.getRefreshToken();if(await Xle(),n(null),i(null),!w)return;const S=new AbortController,C=window.setTimeout(()=>S.abort(),3e3);try{const R=x&&e8(w)?await iue(x,S.signal):w;await fetch(`${Ha}/auth/jwt/logout`,{method:"POST",headers:{Authorization:`Bearer ${R}`},signal:S.signal})}catch{}finally{window.clearTimeout(C)}},[]),_=b.useCallback(async()=>{const w=pn.getToken();if(w&&!NC(w)){const x=kt(),S=await cL(w);
73S&&X9(x,w)&&n(S)}},[]);return g.jsx(sU.Provider,{value:{user:t,accessToken:r,isLoading:s,isAuthenticated:!!t,login:d,googleLogin:p,loginWithToken:m,logout:v,refreshUser:_},children:e})}function Ove({children:e}){return g.jsx($le,{clientId:W9,children:g.jsx(Ive,{children:e})})}function eh(){const e=b.useContext(sU);if(e===void 0)throw new Error("useAuth must be used within an AuthProvider");return e}const Dve="modulepreload",Ave=function(e){return"/"+e},dL={},_t=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(u){return Promise.all(u.map(f=>Promise.resolve(f).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=l(n.map(u=>{if(u=Ave(u),u in dL)return;dL[u]=!0;const f=u.endsWith(".css"),d=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${u}"]${d}`))return;const p=document.createElement("link");if(p.rel=f?"stylesheet":Dve,f||(p.as="script"),p.crossOrigin="",p.href=u,a&&p.setAttribute("nonce",a),document.head.appendChild(p),f)return new Promise((m,v)=>{p.addEventListener("load",m),p.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};class Mve{buffer="";event="";data=[];push(t){this.buffer+=t;const n=[];let r;const i=/\r\n|\n|\r/;for(;(r=i.exec(this.buffer))&&!(r[0]==="\r"&&r.index===this.buffer.length-1);){const s=this.buffer.slice(0,r.index);this.buffer=this.buffer.slice(r.index+r[0].length);const o=this.line(s);o&&n.push(o)}return n}line(t){if(t===""){const s=this.data.length>0?{event:this.event||"message",data:this.data.join(`
74`)}:null;return this.event="",this.data=[],s}if(t.startsWith(":"))return null;const n=t.indexOf(":"),r=n===-1?t:t.slice(0,n);let i=n===-1?"":t.slice(n+1);return i.startsWith(" ")&&(i=i.slice(1)),r==="event"?this.event=i:r==="data"&&this.data.push(i),null}}function Nve(e){let t;try{const i=JSON.parse(e.data);if(!i||typeof i!="object")return null;t=i}catch{return null}const n=t?.session_id;if(typeof n!="string"||!n)return null;const r=typeof t.turn_id=="string"?t.turn_id:void 0;switch(e.event){case"records_added":return{type:"records_added",session_id:n,turn_id:r};case"turn_started":return{type:"turn_started",session_id:n,turn_id:r,input_ids:Array.isArray(t.input_ids)?t.input_ids.filter(i=>typeof i=="string"):[]};case"queue_changed":return{type:"queue_changed",session_id:n};default:return null}}const jve=3e5,fL=[1e3,3e3,1e4,3e4],hL=25e3;function Lve(e){let t=!1,n=null,r=null,i=0,s=0,o=!1,a=!1,l=null;const u=()=>{if(t||r||o)return;const m=fL[Math.min(i,fL.length-1)];i+=1,r=setTimeout(()=>{r=null,f()},m)},f=async()=>{if(t||a||n)return;a=!0;let m=null;try{const v=kt();let _=await TP();if(t||!_)return;n=new AbortController,m=n;const w=P=>HV(`${K9.API_URL}/chats/events`,{method:"GET",headers:{Accept:"text/event-stream",Authorization:`Bearer ${P}`},signal:m.signal,timeoutMs:0,idleTimeoutMs:jve});let x=await w(_);if(x.status===401){if(h0(x),x.body?.cancel().catch(()=>{}),_=(await kP()).access_token,t)return;if(x=await w(_),x.status===401){o=!0,h0(x),x.body?.cancel().catch(()=>{}),console.debug("[events] authentication refused after a refresh");return}}if(!x.ok||!x.body)throw h0(x),x.body?.cancel().catch(()=>{}),new Error(`events stream unavailable (${x.status})`);i=0,s=Date.now(),l&&(clearTimeout(l),l=null),a=!1,e.onConnected?.();const S=x.body.getReader(),C=new TextDecoder,R=new Mve;for(;;){const{done:P,value:k}=await S.read();if(s=Date.now(),P)break;if(t||kt()!==v){S.cancel().catch(()=>{}),i=0;break}for(const I of R.push(C.decode(k,{stream:!0}))){const D=Nve(I);D&&e.onEvent(D)}}}catch(v){t||console.debug("[events] stream ended",v)}finally{a=!1,m&&m===n&&(n=null),u()}},d=()=>{if(!(t||a)){if(o=!1,n){const m=Date.now()-s;if(m>hL){i=0,n.abort();return}l||(l=setTimeout(()=>{l=null,d()},hL-m+250));return}r&&(clearTimeout(r),r=null),i=0,f()}},p=()=>{document.visibilityState==="visible"&&d()};return document.addEventListener("visibilitychange",p),window.addEventListener("online",d),f(),()=>{t=!0,document.removeEventListener("visibilitychange",p),window.removeEventListener("online",d),r&&clearTimeout(r),l&&clearTimeout(l),n?.abort(),n=null}}
74function oU(){wr.invalidateQueries({queryKey:["infinite-chats"]}),wr.invalidateQueries({queryKey:["chats"]})}function J1(e){return!!Ia(e)||!!tve(e)?.isActive}function Fve(e){switch(e.type){case"records_added":oU(),Uge(e.session_id,!!Ia(e.session_id)?.hasViews),J1(e.session_id)&&bf(e.session_id).requestRefresh();return;case"turn_started":if(!J1(e.session_id))return;bf(e.session_id).noteTurnStarted(e.turn_id,e.input_ids);return;case"queue_changed":if(!J1(e.session_id))return;bf(e.session_id).requestRefresh();return}}function $ve(){oU();for(const e of new Set([...Sve(),...nve()]))bf(e).requestRefresh({resend:!0})}function zve(){b.useEffect(()=>Lve({onEvent:Fve,onConnected:$ve}),[])}function Vve(){return zve(),null}function Uve(){const{isAuthenticated:e}=eh();return g.jsxs(g.Fragment,{children:[g.jsx(Nle,{}),e&&g.jsx(Vve,{}),g.jsx(Ko,{})]})}const aU=b.createContext(void 0);function YP({children:e}){const[t,n]=b.useState(!1);return g.jsx(aU.Provider,{value:{isChatWidgetOpen:t,setChatWidgetOpen:n},children:e})}function Bve(){const e=b.useContext(aU);if(typeof e>"u")throw new Error("useSidebarContext must be used within a SidebarProvider!");return e}const Hve=(e,t)=>{switch(t.type){case"SET_LINKS":return{...e,links:t.links};case"SET_SELECTED_LINK":return{...e,selectedLink:t.link};case"SET_SELECTED_COLLECTION":return{...e,selectedCollection:t.collection};default:return e}},lU=b.createContext(void 0),qve=({children:e,value:t})=>{const[n,r]=b.useReducer(Hve,{links:[],selectedLink:null,selectedCollection:null,...t}),i=a=>{r({type:"SET_LINKS",links:a})},s=a=>{r({type:"SET_SELECTED_LINK",link:a})},o=a=>{r({type:"SET_SELECTED_COLLECTION",collection:a})};return g.jsx(lU.Provider,{value:{...n,setLinks:i,setSelectedLink:s,setSelectedCollection:o},children:e})};function ug(){const e=b.useContext(lU);if(typeof e>"u")throw new Error("usePageContext should be used within the PageContext provider!");return e}var Wve=Object.defineProperty,th=(e,t)=>Wve(e,"name",{value:t,configurable:!0}),uU=!!(typeof window<"u"&&window.document&&window.document.createElement);function Ue(e,t,{checkForDefaultPrevented:n=!0}={}){return th(function(i){if(e?.(i),n===!1||!i||!i.defaultPrevented)return t?.(i)},"handleEvent")}th(Ue,"composeEventHandlers");function Gve(e){if(!uU)throw new Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window}th(Gve,"getOwnerWindow");function nk(e){if(!uU)throw new Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}th(nk,"getOwnerDocument");function cU(e,t=!1){const{activeElement:n}=nk(e);if(!n?.nodeName)return null;if(dU(n)&&n.contentDocument)return cU(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=nk(n).getElementById(r);if(i)return i}}return n}th(cU,"getActiveElement");function dU(e){return e.tagName==="IFRAME"}th(dU,"isFrame");var Kve=Object.defineProperty,QP=(e,t)=>Kve(e,"name",{value:t,configurable:!0});function rk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}QP(rk,"setRef");function fU(...e){return t=>{let n=!1;const r=e.map(i=>{const s=rk(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i<r.length;i++){const s=r[i];typeof s=="function"?s():rk(e[i],null)}}}}QP(fU,"composeRefs");function At(...e){return b.useCallback(fU(...e),e)}QP(At,"useComposedRefs");var Zve=Object.defineProperty,Rs=(e,t)=>Zve(e,"name",{value:t,configurable:!0});function Yve(e,t){const n=b.createContext(t);n.displayName=e+"Context";const r=Rs(s=>{const{children:o,...a}=s,l=b.useMemo(()=>a,Object.values(a));return g.jsx(n.Provider,{value:l,children:o})},"Provider");r.displayName=e+"Provider";function i(s,o={}){const{optional:a=!1}=o,l=b.useContext(n);if(l)return l;if(t!==void 0)return t;if(!a)throw new Error(`\`${s}\` must be used within \`${e}\``)}return Rs(i,"useContext"),[r,i]}Rs(Yve,"createContext");function $s(e,t=[]){let n=[];function r(s,o){const a=b.createContext(o);a.displayName=s+"Context";const l=n.length;n=[...n,o];const u=Rs(d=>{const{scope:p,children:m,...v}=d,_=p?.[e]?.[l]||a,w=b.useMemo(()=>v,Object.values(v));return g.jsx(_.Provider,{value:w,children:m})},"Provider");u.displayName=s+"Provider";function f(d,p,m={}){const{optional:v=!1}=m,_=p?.[e]?.[l]||a,w=b.useContext(_);if(w)return w;if(o!==void 0)return o;if(!v)throw new Error(`\`${d}\` must be used within \`${s}\``)}return Rs(f,"useContext"),[u,f]}Rs(r,"createContext");const i=Rs(()=>{const s=n.map(o=>b.createContext(o));return Rs(function(a){const l=a?.[e]||s;return b.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])},"useScope")},"createScope");return i.scopeName=e,[r,hU(i,...t)]}Rs($s,"createContextScope");function hU(...e){const t=e[0];if(e.length===1)return t;const n=Rs(()=>{const r=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return Rs(function(s){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const d=l(s)[`__scope${u}`];return{...a,...d}},{});return b.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Rs(hU,"composeContextScopes");var Qve=Object.defineProperty,bo=(e,t)=>Qve(e,"name",{value:t,configurable:!0});function Zo(e){const t=b.forwardRef((n,r)=>{let{children:i,...s}=n,o=null,a=!1;const l=[];ik(i)&&typeof vy=="function"&&(i=vy(i._payload)),b.Children.forEac
74h(i,p=>{if(yU(p)){a=!0;const m=p;let v="child"in m.props?m.props.child:m.props.children;ik(v)&&typeof vy=="function"&&(v=vy(v._payload)),o=Xve(m,v),l.push(o?.props?.children)}else l.push(p)}),o?o=b.cloneElement(o,void 0,l):!a&&b.Children.count(i)===1&&b.isValidElement(i)&&(o=i);const u=o?vU(o):void 0,f=At(r,u);if(!o){if(i||i===0)throw new Error(a?tye(e):eye(e));return i}const d=gU(s,o.props??{});return o.type!==b.Fragment&&(d.ref=r?f:u),b.cloneElement(o,d)});return t.displayName=`${e}.Slot`,t}bo(Zo,"createSlot");var XP=Zo("Slot"),pU=Symbol.for("radix.slottable");function mU(e){const t=bo(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=pU,t}bo(mU,"createSlottable");var Xve=bo((e,t)=>{if("child"in e.props){const n=e.props.child;return b.isValidElement(n)?b.cloneElement(n,void 0,e.props.children(n.props.children)):null}return b.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function gU(e,t){const n={...t};for(const r in t){const i=e[r],s=t[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const l=s(...a);return i(...a),l}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...e,...n}}bo(gU,"mergeProps");function vU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}bo(vU,"getElementRef");function yU(e){return b.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===pU}bo(yU,"isSlottable");var Jve=Symbol.for("react.lazy");function ik(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Jve&&"_payload"in e&&bU(e._payload)}bo(ik,"isLazyComponent");function bU(e){return typeof e=="object"&&e!==null&&"then"in e}bo(bU,"isPromiseLike");var eye=bo(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),tye=bo(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),vy=Ua[" use ".trim().toString()],nye=Object.defineProperty,rye=(e,t)=>nye(e,"name",{value:t,configurable:!0}),iye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vt=iye.reduce((e,t)=>{const n=Zo(`Primitive.${t}`),r=b.forwardRef((i,s)=>{const{asChild:o,...a}=i,l=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),g.jsx(l,{...a,ref:s})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function JP(e,t){e&&Ba.flushSync(()=>e.dispatchEvent(t))}rye(JP,"dispatchDiscreteCustomEvent");var sye=Object.defineProperty,oye=(e,t)=>sye(e,"name",{value:t,configurable:!0});function Sr(e){const t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>((...n)=>t.current?.(...n)),[])}oye(Sr,"useCallbackRef");var aye=Object.defineProperty,Pr=(e,t)=>aye(e,"name",{value:t,configurable:!0}),sk="dismissableLayer.update",lye="dismissableLayer.pointerDownOutside",uye="dismissableLayer.focusOutside",pL,_U=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),x_=b.forwardRef(Pr(function(t,n){const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:i=!1,onEscapeKeyDown:s,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:l,onDismiss:u,...f}=t,d=b.useContext(_U),[p,m]=b.useState(null),v=p?.ownerDocument??globalThis?.document,[,_]=b.useState({}),w=At(n,m),x=Array.from(d.layers),[S]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=S?x.indexOf(S):-1,R=p?x.indexOf(p):-1,P=d.layersWithOutsidePointerEventsDisabled.size>0,k=R>=C,I=b.useRef(!1),D=xU(j=>{o?.(j),l?.(j),j.defaultPrevented||u?.()},{ownerDocument:v,deferPointerDownOutside:i,isDeferredPointerDownOutsideRef:I,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:b.useCallback(j=>{if(!(j instanceof Node))return!1;const V=[...d.branches].some(B=>B.contains(j));return k&&!V},[d.branches,k])}),L=SU(j=>{if(i&&I.current)return;const V=j.target;[...d.branches].some(H=>H.contains(V))||(a?.(j),l?.(j),j.defaultPrevented||u?.())},v),A=p?R===x.length-1:!1,$=Sr(j=>{j.key==="Escape"&&(s?.(j),!j.defaultPrevented&&u&&(j.preventDefault(),u()))});return b.useEffect(()=>{if(A)return v.addEventListener("keydown",$,{capture:!0}),()=>v.removeEventListener("keydown",$,{capture:!0})},[v,A,$]),b.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(pL=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),ok(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(p),d.layersWithOutsidePointerEventsDisabled.size===0&&(v.body.style.pointerEvents=pL))}},[p,v,r,d]),b.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),ok())},[p,d]),b.useEffect(()=>{const j=Pr(()=>_({}),"handleUpdate");return document.addEventListener(sk,j),()=>document.removeEventListener(sk,j)},[]),g.jsx(Vt.div,{...f,ref:w,style:{pointerEvents:P?k?"auto":"none":void 0,...t.style},onFocusCapture:Ue(t.onFocusCapture,L.onFocusCapture),onBlurCapture:Ue(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:Ue(t.onPointerDownCapture,D.onPointerDownCapture)})},"DismissableLayer"));function wU(){const e=b.useContext(_U),[t,n]=b.useState(null);return b.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}Pr(wU,"useDismissableLayerSurface");var cye=Pr(()=>!0,"IS_TRUE");function xU(e,t){const{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:s,shouldHandlePointerDownOutside:o=cye}=t,a=Sr(e),l=b.useRef(!1),u=b.useRef(!1),f=b.useRef(new Map),d=b.useRef(()=>{});return b.useEffect(()=>{function p(){u.current=!1,i.current=!1,f.current.clear()}Pr(p,"resetOutsideInteraction");function m(){return Array.from(f.current.values()).some(Boolean)}Pr(m,"isOutsideInteractionIntercepted");function v(C){if(!u.current)return;const R=C.target;R instanceof Node&&[...s].some(k=>k.contains(R))||f.current.set(C.type,!0),C.type==="click"&&window.setTimeout(()=>{u.current&&d.current()},0)}Pr(v,"handleInteractionCapture");function _(C){u.current&&f.current.set(C.type,!1)}Pr(_,"handleInteractionBubble");const w=Pr(C=>{if(C.target&&!l.current){let R=function(){n.removeEventListener("click",d.current);const k=m();p(),k||eR(lye,a,P,{discrete:!0})};if(Pr(R,"handleAndDispatchPointerDownOutsideEvent"),!o(C.target)){n.removeEventListener("click",d.current),p(),l.current=!1;return}const P={originalEvent:C};u.current=!0,i.current=r&&C.button===0,f.current.clear(),!r||C.button!==0?R():(n.removeEventListener("click",d.current),d.current=R,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),p();l.current=!1},"handlePointerDown"),x=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const C of x)n.addEventListener(C,v,!0),n.addEventListener(C,_);const S=window.setTimeout(()=>{n.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(S),n.removeEventListener("pointerdown",w),n.removeEventListener("click",d.current);for(const C of x)n.removeEventListener(C,v,!0),n.removeEventListener(C,_)}}
74,[n,a,r,i,s,o]),{onPointerDownCapture:Pr(()=>l.current=!0,"onPointerDownCapture")}}Pr(xU,"usePointerDownOutside");function SU(e,t=globalThis?.document){const n=Sr(e),r=b.useRef(!1);return b.useEffect(()=>{const i=Pr(s=>{s.target&&!r.current&&eR(uye,n,{originalEvent:s},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,n]),{onFocusCapture:Pr(()=>r.current=!0,"onFocusCapture"),onBlurCapture:Pr(()=>r.current=!1,"onBlurCapture")}}Pr(SU,"useFocusOutside");function ok(){const e=new CustomEvent(sk);document.dispatchEvent(e)}Pr(ok,"dispatchUpdate");function eR(e,t,n,{discrete:r}){const i=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?JP(i,s):i.dispatchEvent(s)}Pr(eR,"handleAndDispatchCustomEvent");var $n=globalThis?.document?b.useLayoutEffect:()=>{},dye=Object.defineProperty,fye=(e,t)=>dye(e,"name",{value:t,configurable:!0}),hye=Ua[" useId ".trim().toString()]||(()=>{}),pye=0;function Vl(e){const[t,n]=b.useState(hye());return $n(()=>{e||n(r=>r??String(pye++))},[e]),e||(t?`radix-${t}`:"")}fye(Vl,"useId");const EU=["top","right","bottom","left"],mL=["start","end"],gL=EU.reduce((e,t)=>e.concat(t,t+"-"+mL[0],t+"-"+mL[1]),[]),ho=Math.min,Yr=Math.max,rb=Math.round,yy=Math.floor,zo=e=>({x:e,y:e}
74),mye={left:"right",right:"left",bottom:"top",top:"bottom"},gye={start:"end",end:"start"};function ak(e,t,n){return Yr(e,ho(t,n))}function po(e,t){return typeof e=="function"?e(t):e}function rs(e){return e.split("-")[0]}function ao(e){return e.split("-")[1]}function tR(e){return e==="x"?"y":"x"}function nR(e){return e==="y"?"height":"width"}function La(e){return["top","bottom"].includes(rs(e))?"y":"x"}function rR(e){return tR(La(e))}function CU(e,t,n){n===void 0&&(n=!1);const r=ao(e),i=rR(e),s=nR(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(o=sb(o)),[o,sb(o)]}function vye(e){const t=sb(e);return[ib(e),t,ib(t)]}function ib(e){return e.replace(/start|end/g,t=>gye[t])}function yye(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:o;default:return[]}}function bye(e,t,n,r){const i=ao(e);let s=yye(rs(e),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),t&&(s=s.concat(s.map(ib)))),s}function sb(e){return e.replace(/left|right|bottom|top/g,t=>mye[t])}function _ye(e){return{top:0,right:0,bottom:0,left:0,...e}}function iR(e){return typeof e!="number"?_ye(e):{top:e,right:e,bottom:e,left:e}}function Mf(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function vL(e,t,n){let{reference:r,floating:i}=e;const s=La(t),o=rR(t),a=nR(o),l=rs(t),u=s==="y",f=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(ao(t)){case"start":m[o]-=p*(n&&u?-1:1);break;case"end":m[o]+=p*(n&&u?-1:1);break}return m}const wye=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,a=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=vL(u,r,l),p=r,m={},v=0;for(let _=0;_<a.length;_++){const{name:w,fn:x}=a[_],{x:S,y:C,data:R,reset:P}=await x({x:f,y:d,initialPlacement:r,placement:p,strategy:i,middlewareData:m,rects:u,platform:o,elements:{reference:e,floating:t}});f=S??f,d=C??d,m={...m,[w]:{...m[w],...R}},P&&v<=50&&(v++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(u=P.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:f,y:d}=vL(u,p,l)),_=-1)}return{x:f,y:d,placement:p,strategy:i,middlewareData:m}};async function Nf(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:o,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:m=0}=po(t,e),v=iR(m),w=a[p?d==="floating"?"reference":"floating":d],x=Mf(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:u,rootBoundary:f,strategy:l})),S=d==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),R=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},P=Mf(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:C,strategy:l}):S);return{top:(x.top-P.top+v.top)/R.y,bottom:(P.bottom-x.bottom+v.bottom)/R.y,left:(x.left-P.left+v.left)/R.x,right:(P.right-x.right+v.right)/R.x}}const xye=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:o,elements:a,middlewareData:l}=t,{element:u,padding:f=0}=po(e,t)||{};if(u==null)return{};const d=iR(f),p={x:n,y:r},m=rR(i),v=nR(m),_=await o.getDimensions(u),w=m==="y",x=w?"top":"left",S=w?"bottom":"right",C=w?"clientHeight":"clientWidth",R=s.reference[v]+s.reference[m]-p[m]-s.floating[v],P=p[m]-s.reference[m],k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let I=k?k[C]:0;(!I||!await(o.isElement==null?void 0:o.isElement(k)))&&(I=a.floating[C]||s.floating[v]);const D=R/2-P/2,L=I/2-_[v]/2-1,A=ho(d[x],L),$=ho(d[S],L),j=A,V=I-_[v]-$,B=I/2-_[v]/2+D,H=ak(j,B,V),te=!l.arrow&&ao(i)!=null&&B!==H&&s.reference[v]/2-(B<j?A:$)-_[v]/2<0,G=te?B<j?B-j:B-V:0;return{[m]:p[m]+G,data:{[m]:H,centerOffset:B-H-G,...te&&{alignmentOffset:G}},reset:te}}});function Sye(e,t,n){return(e?[...n.filter(i=>ao(i)===e),...n.filter(i=>ao(i)!==e)]:n.filter(i=>rs(i)===i)).filter(i=>e?ao(i)===e||(t?ib(i)!==i:!1):!0)}const Eye=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,i;const{rects:s,middlewareData:o,placement:a,platform:l,elements:u}=t,{crossAxis:f=!1,alignment:d,allowedPlacements:p=gL,autoAlignment:m=!0,...v}=po(e,t),_=d!==void 0||p===gL?Sye(d||null,m,p):p,w=await Nf(t,v),x=((n=o.autoPlacement)==null?void 0:n.index)||0,S=_[x];if(S==null)return{};const C=CU(S,s,await(l.isRTL==null?void 0:l.isRTL(u.floating)));if(a!==S)return{reset:{placement:_[0]}};const R=[w[rs(S)],w[C[0]],w[C[1]]],P=[...((r=o.autoPlacement)==null?void 0:r.overflows)||[],{placement:S,overflows:R}],k=_[x+1];if(k)return{data:{index:x+1,overflows:P},reset:{placement:k}};const I=P.map(A=>{const $=ao(A.placement);return[A.placement,$&&f?A.overflows.slice(0,2).reduce((j,V)=>j+V,0):A.overflows[0],A.overflows]}).sort((A,$)=>A[1]-$[1]),L=((i=I.filter(A=>A[2].slice(0,ao(A[0])?2:3).every($=>$<=0))[0])==null?void 0:i[0])||I[0][0];return L!==a?{data:{index:x+1,overflows:P},reset:{placement:L}}:{}}}},Cye=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:a,platform:l,elements:u}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:_=!0,...w}
74=po(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=rs(i),S=La(a),C=rs(a)===a,R=await(l.isRTL==null?void 0:l.isRTL(u.floating)),P=p||(C||!_?[sb(a)]:vye(a)),k=v!=="none";!p&&k&&P.push(...bye(a,_,v,R));const I=[a,...P],D=await Nf(t,w),L=[];let A=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&L.push(D[x]),d){const B=CU(i,o,R);L.push(D[B[0]],D[B[1]])}if(A=[...A,{placement:i,overflows:L}],!L.every(B=>B<=0)){var $,j;const B=((($=s.flip)==null?void 0:$.index)||0)+1,H=I[B];if(H)return{data:{index:B,overflows:A},reset:{placement:H}};let te=(j=A.filter(G=>G.overflows[0]<=0).sort((G,Z)=>G.overflows[1]-Z.overflows[1])[0])==null?void 0:j.placement;if(!te)switch(m){case"bestFit":{var V;const G=(V=A.filter(Z=>{if(k){const Y=La(Z.placement);return Y===S||Y==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(Y=>Y>0).reduce((Y,M)=>Y+M,0)]).sort((Z,Y)=>Z[1]-Y[1])[0])==null?void 0:V[0];G&&(te=G);break}case"initialPlacement":te=a;break}if(i!==te)return{reset:{placement:te}}}return{}}}};function yL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bL(e){return EU.some(t=>e[t]>=0)}const kye=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=po(e,t);switch(r){case"referenceHidden":{const s=await Nf(t,{...i,elementContext:"reference"}),o=yL(s,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:bL(o)}}}case"escaped":{const s=await Nf(t,{...i,altBoundary:!0}),o=yL(s,n.floating);return{data:{escapedOffsets:o,escaped:bL(o)}}}default:return{}}}}};function kU(e){const t=ho(...e.map(s=>s.left)),n=ho(...e.map(s=>s.top)),r=Yr(...e.map(s=>s.right)),i=Yr(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Tye(e){const t=e.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<t.length;i++){const s=t[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>Mf(kU(i)))}const Pye=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:s,strategy:o}=t,{padding:a=2,x:l,y:u}=po(e,t),f=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),d=Tye(f),p=Mf(kU(f)),m=iR(a);function v(){if(d.length===2&&d[0].left>d[1].right&&l!=null&&u!=null)return d.find(w=>l>w.left-m.left&&l<w.right+m.right&&u>w.top-m.top&&u<w.bottom+m.bottom)||p;if(d.length>=2){if(La(n)==="y"){const A=d[0],$=d[d.length-1],j=rs(n)==="top",V=A.top,B=$.bottom,H=j?A.left:$.left,te=j?A.right:$.right,G=te-H,Z=B-V;return{top:V,bottom:B,left:H,right:te,width:G,height:Z,x:H,y:V}}const w=rs(n)==="left",x=Yr(...d.map(A=>A.right)),S=ho(...d.map(A=>A.left)),C=d.filter(A=>w?A.left===S:A.right===x),R=C[0].top,P=C[C.length-1].bottom,k=S,I=x,D=I-k,L=P-R;return{top:R,bottom:P,left:k,right:I,width:D,height:L,x:k,y:R}}return p}const _=await s.getElementRects({reference:{getBoundingClientRect:v},floating:r.floating,strategy:o});return i.reference.x!==_.reference.x||i.reference.y!==_.reference.y||i.reference.width!==_.reference.width||i.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}};async function Rye(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rs(n),a=ao(n),l=La(n)==="y",u=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,d=po(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof v=="number"&&(m=a==="end"?v*-1:v),l?{x:m*f,y:p*u}:{x:p*u,y:m*f}}const Iye=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:o,middlewareData:a}=t,l=await Rye(t,e);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Oye=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:o=!1,limiter:a={fn:w=>{let{x,y:S}=w;return{x,y:S}}},...l}=po(e,t),u={x:n,y:r},f=await Nf(t,l),d=La(rs(i)),p=tR(d);let m=u[p],v=u[d];if(s){const w=p==="y"?"top":"left",x=p==="y"?"bottom":"right",S=m+f[w],C=m-f[x];m=ak(S,m,C)}if(o){const w=d==="y"?"top":"left",x=d==="y"?"bottom":"right",S=v+f[w],C=v-f[x];v=ak(S,v,C)}const _=a.fn({...t,[p]:m,[d]:v});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:s,[d]:o}}}}}},Dye=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:o}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=po(e,t),f={x:n,y:r},d=La(i),p=tR(d);let m=f[p],v=f[d];const _=po(a,t),w=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(l){const C=p==="y"?"height":"width",R=s.reference[p]-s.floating[C]+w.mainAxis,P=s.reference[p]+s.reference[C]-w.mainAxis;m<R?m=R:m>P&&(m=P)}if(u){var x,S;const C=p==="y"?"width":"height",R=["top","left"].includes(rs(i)),P=s.reference[d]-s.floating[C]+(R&&((x=o.offset)==null?void 0:x[d])||0)+(R?0:w.crossAxis),k=s.reference[d]+s.reference[C]+(R?0:((S=o.offset)==null?void 0:S[d])||0)-(R?w.crossAxis:0);v<P?v=P:v>k&&(v=k)}return{[p]:m,[d]:v}}}},Aye=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:o,elements:a}=t,{apply:l=()=>{},...u}
vendor: 10,231 bytes, line 74
74=po(e,t),f=await Nf(t,u),d=rs(i),p=ao(i),m=La(i)==="y",{width:v,height:_}=s.floating;let w,x;d==="top"||d==="bottom"?(w=d,x=p===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(x=d,w=p==="end"?"top":"bottom");const S=_-f.top-f.bottom,C=v-f.left-f.right,R=ho(_-f[w],S),P=ho(v-f[x],C),k=!t.middlewareData.shift;let I=R,D=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(I=S),k&&!p){const A=Yr(f.left,0),$=Yr(f.right,0),j=Yr(f.top,0),V=Yr(f.bottom,0);m?D=v-2*(A!==0||$!==0?A+$:Yr(f.left,f.right)):I=_-2*(j!==0||V!==0?j+V:Yr(f.top,f.bottom))}await l({...t,availableWidth:D,availableHeight:I});const L=await o.getDimensions(a.floating);return v!==L.width||_!==L.height?{reset:{rects:!0}}:{}}}};function S_(){return typeof window<"u"}function nh(e){return TU(e)?(e.nodeName||"").toLowerCase():"#document"}function Ji(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ta(e){var t;return(t=(TU(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function TU(e){return S_()?e instanceof Node||e instanceof Ji(e).Node:!1}function mo(e){return S_()?e instanceof Element||e instanceof Ji(e).Element:!1}function Yo(e){return S_()?e instanceof HTMLElement||e instanceof Ji(e).HTMLElement:!1}function _L(e){return!S_()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ji(e).ShadowRoot}function cg(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=go(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Mye(e){return["table","td","th"].includes(nh(e))}function E_(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function sR(e){const t=oR(),n=mo(e)?go(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Nye(e){let t=Yl(e);for(;Yo(t)&&!jf(t);){if(sR(t))return t;if(E_(t))return null;t=Yl(t)}return null}function oR(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jf(e){return["html","body","#document"].includes(nh(e))}function go(e){return Ji(e).getComputedStyle(e)}function C_(e){return mo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Yl(e){if(nh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_L(e)&&e.host||ta(e);return _L(t)?t.host:t}function PU(e){const t=Yl(e);return jf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yo(t)&&cg(t)?t:PU(t)}function Im(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=PU(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),o=Ji(i);if(s){const a=lk(o);return t.concat(o,o.visualViewport||[],cg(i)?i:[],a&&n?Im(a):[])}return t.concat(i,Im(i,[],n))}function lk(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function RU(e){const t=go(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Yo(e),s=i?e.offsetWidth:n,o=i?e.offsetHeight:r,a=rb(n)!==s||rb(r)!==o;return a&&(n=s,r=o),{width:n,height:r,$:a}}function aR(e){return mo(e)?e:e.contextElement}function _f(e){const t=aR(e);if(!Yo(t))return zo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=RU(t);let o=(s?rb(n.width):n.width)/r,a=(s?rb(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const jye=zo(0);function IU(e){const t=Ji(e);return!oR()||!t.visualViewport?jye:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Lye(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ji(e)?!1:t}function bc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=aR(e);let o=zo(1);t&&(r?mo(r)&&(o=_f(r)):o=_f(e));const a=Lye(s,n,r)?IU(s):zo(0);let l=(i.left+a.x)/o.x,u=(i.top+a.y)/o.y,f=i.width/o.x,d=i.height/o.y;if(s){const p=Ji(s),m=r&&mo(r)?Ji(r):r;let v=p,_=lk(v);for(;_&&r&&m!==v;){const w=_f(_),x=_.getBoundingClientRect(),S=go(_),C=x.left+(_.clientLeft+parseFloat(S.paddingLeft))*w.x,R=x.top+(_.clientTop+parseFloat(S.paddingTop))*w.y;l*=w.x,u*=w.y,f*=w.x,d*=w.y,l+=C,u+=R,v=Ji(_),_=lk(v)}}return Mf({width:f,height:d,x:l,y:u})}function lR(e,t){const n=C_(e).scrollLeft;return t?t.left+n:bc(ta(e)).left+n}function OU(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:lR(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function Fye(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",o=ta(r),a=t?E_(t.floating):!1;if(r===o||a&&s)return n;let l={scrollLeft:0,scrollTop:0},u=zo(1);const f=zo(0),d=Yo(r);if((d||!d&&!s)&&((nh(r)!=="body"||cg(o))&&(l=C_(r)),Yo(r))){const m=bc(r);u=_f(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const p=o&&!d&&!s?OU(o,l,!0):zo(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-l.scrollTop*u.y+f.y+p.y}}function $ye(e){return Array.from(e.getClientRects())}function zye(e){const t=ta(e),n=C_(e),r=e.ownerDocument.body,i=Yr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Yr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+lR(e);const a=-n.scrollTop;return go(r).direction==="rtl"&&(o+=Yr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:a}}function Vye(e,t){const n=Ji(e),r=ta(e),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(i){s=i.width,o=i.height;const u=oR();(!u||u&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:a,y:l}}function Uye(e,t){const n=bc(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Yo(e)?_f(e):zo(1),o=e.clientWidth*s.x,a=e.clientHeight*s.y,l=i*s.x,u=r*s.y;return{width:o,height:a,x:l,y:u}}function wL(e,t,n){let r;if(t==="viewport")r=Vye(e,n);else if(t==="document")r=zye(ta(e));else if(mo(t))r=Uye(t,n);else{const i=IU(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Mf(r)}function DU(e,t){const n=Yl(e);return n===t||!mo(n)||jf(n)?!1:go(n).position==="fixed"||DU(n,t)}function Bye(e,t){const n=t.get(e);if(n)return n;let r=Im(e,[],!1).filter(a=>mo(a)&&nh(a)!=="body"),i=null;const s=go(e).position==="fixed";let o=s?Yl(e):e;for(;mo(o)&&!jf(o);){const a=go(o),l=sR(o);!l&&a.position==="fixed"&&(i=null),(s?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||cg(o)&&!l&&DU(e,o))?r=r.filter(f=>f!==o):i=a,o=Yl(o)}return t.set(e,r),r}function Hye(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?E_(t)?[]:Bye(t,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,f)=>{const d=wL(t,f,i);return u.top=Yr(d.top,u.top),u.right=ho(d.right,u.right),u.bottom=ho(d.bottom,u.bottom),u.left=Yr(d.left,u.left),u},wL(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function qye(e){const{width:t,height:n}=RU(e);return{width:t,height:n}}function Wye(e,t,n){const r=Yo(t),i=ta(t),s=n==="fixed",o=bc(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=zo(0);if(r||!r&&!s)if((nh(t)!=="body"||cg(i))&&(a=C_(t)),r){const p=bc(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else i&&(l.x=lR(i));const u=i&&!r&&!s?OU(i,a):zo(0),f=o.left+a.scrollLeft-l.x-u.x,d=o.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:o.width,height:o.height}}function eS(e){return go(e).position==="static"}function xL(e,t){if(!Yo(e)||go(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ta(e)===n&&(n=n.ownerDocument.body),n}function AU(e,t){const n=Ji(e);if(E_(e))return n;if(!Yo(e)){let i=Yl(e);for(;i&&!jf(i);){if(mo(i)&&!eS(i))return i;i=Yl(i)}return n}let r=xL(e,t);for(;r&&Mye(r)&&eS(r);)r=xL(r,t);return r&&jf(r)&&eS(r)&&!sR(r)?n:r||Nye(e)||n}const Gye=async function(e){const t=this.getOffsetParent||AU,n=this.getDimensions,r=await n(e.floating);return{reference:Wye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Kye(e){return go(e).direction==="rtl"}const Zye={convertOffsetParentRelativeRectToViewportRelativeRect:Fye,getDocumentElement:ta,getClippingRect:Hye,getOffsetParent:AU,getElementRects:Gye,getClientRects:$ye,getDimensions:qye,getScale:_f,isElement:mo,isRTL:Kye};function MU(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yye(e,t){let n=null,r;const i=ta(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();const u=e.getBoundingClientRect(),{left:f,top:d,width:p,height:m}=u;if(a||t(),!p||!m)return;const v=yy(d),_=yy(i.clientWidth-(f+p)),w=yy(i.clientHeight-(d+m)),x=yy(f),C={rootMargin:-v+"px "+-_+"px "+-w+"px "+-x+"px",threshold:Yr(0,ho(1,l))||1};let R=!0;function P(k){const I=k[0].intersectionRatio;if(I!==l){if(!R)return o();I?o(!1,I):r=setTimeout(()=>{o(!1,1e-7)},1e3)}I===1&&!MU(u,e.getBoundingClientRect())&&o(),R=!1}try{n=new IntersectionObserver(P,{...C,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,C)}n.observe(e)}return o(!0),s}function NU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=aR(e),f=i||s?[...u?Im(u):[],...Im(t)]:[];f.forEach(x=>{i&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const d=u&&a?Yye(u,n):null;let p=-1,m=null;o&&(m=new ResizeObserver(x=>{let[S]=x;S&&S.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let v,_=l?bc(e):null;l&&w();function w(){const x=bc(e);_&&!MU(_,x)&&n(),_=x,v=requestAnimationFrame(w)}return n(),()=>{var x;f.forEach(S=>{i&&S.removeEventListener("scroll",n),s&&S.removeEventListener("resize",n)}),d?.(),(x=m)==null||x.disconnect(),m=null,l&&cancelAnimationFrame(v)}}const Qye=Iye,uHe=Eye,Xye=Oye,Jye=Cye,e0e=Aye,t0e=kye,SL=xye,cHe=Pye,n0e
74=Dye,r0e=(e,t,n)=>{const r=new Map,i={platform:Zye,...n},s={...i.platform,_c:r};return wye(e,t,{...i,platform:s})};var m0=typeof document<"u"?b.useLayoutEffect:b.useEffect;function ob(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ob(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!ob(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function jU(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function EL(e,t){const n=jU(e);return Math.round(t*n)/n}function tS(e){const t=b.useRef(e);return m0(()=>{t.current=e}),t}function LU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[f,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=b.useState(r);ob(p,r)||m(r);const[v,_]=b.useState(null),[w,x]=b.useState(null),S=b.useCallback(Z=>{Z!==k.current&&(k.current=Z,_(Z))},[]),C=b.useCallback(Z=>{Z!==I.current&&(I.current=Z,x(Z))},[]),R=s||v,P=o||w,k=b.useRef(null),I=b.useRef(null),D=b.useRef(f),L=l!=null,A=tS(l),$=tS(i),j=tS(u),V=b.useCallback(()=>{if(!k.current||!I.current)return;const Z={placement:t,strategy:n,middleware:p};$.current&&(Z.platform=$.current),r0e(k.current,I.current,Z).then(Y=>{const M={...Y,isPositioned:j.current!==!1};B.current&&!ob(D.current,M)&&(D.current=M,Ba.flushSync(()=>{d(M)}))})},[p,t,n,$,j]);m0(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,d(Z=>({...Z,isPositioned:!1})))},[u]);const B=b.useRef(!1);m0(()=>(B.current=!0,()=>{B.current=!1}),[]),m0(()=>{if(R&&(k.current=R),P&&(I.current=P),R&&P){if(A.current)return A.current(R,P,V);V()}},[R,P,V,A,L]);const H=b.useMemo(()=>({reference:k,floating:I,setReference:S,setFloating:C}),[S,C]),te=b.useMemo(()=>({reference:R,floating:P}),[R,P]),G=b.useMemo(()=>{const Z={position:n,left:0,top:0};if(!te.floating)return Z;const Y=EL(te.floating,f.x),M=EL(te.floating,f.y);return a?{...Z,transform:"translate("+Y+"px, "+M+"px)",...jU(te.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:M}},[n,a,te.floating,f.x,f.y]);return b.useMemo(()=>({...f,update:V,refs:H,elements:te,floatingStyles:G}),[f,V,H,te,G])}const i0e=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?SL({element:r.current,padding:i}).fn(n):{}:r?SL({element:r,padding:i}).fn(n):{}}}},FU=(e,t)=>({...Qye(e),options:[e,t]}),$U=(e,t)=>({...Xye(e),options:[e,t]}),zU=(e,t)=>({...n0e(e),options:[e,t]}),VU=(e,t)=>({...Jye(e),options:[e,t]}),UU=(e,t)=>({...e0e(e),options:[e,t]}),BU=(e,t)=>({...t0e(e),options:[e,t]}),HU=(e,t)=>({...i0e(e),options:[e,t]});var s0e=Object.defineProperty,o0e=(e,t)=>s0e(e,"name",{value:t,configurable:!0});function qU(e){const[t,n]=b.useState(void 0);return $n(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}o0e(qU,"useSize");var a0e=Object.defineProperty,Ul=(e,t)=>a0e(e,"name",{value:t,configurable:!0}),WU="Popper",[GU,rh]=$s(WU),[l0e,KU]=GU(WU),u0e=Ul(e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null),[s,o]=b.useState(void 0);return g.jsx(l0e,{scope:t,anchor:r,onAnchorChange:i,placementState:s,setPlacementState:o,children:n})},"Popper"),c0e="PopperAnchor",d0e=b.forwardRef(Ul(function(t,n){const{__scopePopper:r,virtualRef:i,...s}=t,o=KU(c0e,r),a=b.useRef(null),l=o.onAnchorChange,u=b.useCallback(_=>{a.current=_,_&&l(_)},[l]),f=At(n,u),d=b.useRef(null);b.useEffect(()=>{if(!i)return;const _=d.current;d.current=i.current,_!==d.current&&l(d.current)});const p=o.placementState&&k_(o.placementState),m=p?.[0],v=p?.[1];return i?null:g.jsx(Vt.div,{"data-radix-popper-side":m,"data-radix-popper-align":v,...s,ref:f})},"PopperAnchor")),ZU="PopperContent",[f0e,dHe]=GU(ZU),h0e=b.forwardRef(Ul(function(t,n){const{__scopePopper:r,side:i="bottom",sideOffset:s=0,align:o="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:f=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:v="optimized",onPlaced:_,...w}=t,x=KU(ZU,r),[S,C]=b.useState(null),R=At(n,C),[P,k]=b.useState(null),I=qU(P),D=I?.width??0,L=I?.height??0,A=i+(o!=="center"?"-"+o:""),$=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},j=Array.isArray(f)?f:[f],V=j.length>0,B={padding:$,boundary:j.filter(YU),altBoundary:V},{refs:H,floatingStyles:te,placement:G,isPositioned:Z,middlewareData:Y}=LU({strategy:"fixed",placement:A,whileElementsMounted:Ul((...ce)=>NU(...ce,{animationFrame:v==="always"}),"whileElementsMounted"),elements:{reference:x.anchor},middleware:[FU({mainAxis:s+L,alignmentAxis:a}),u&&$U({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?zU():void 0,...B}),u&&VU({...B}),UU({...B,apply:Ul(({elements:ce,rects:fe,availableWidth:ke,availableHeight:Ce})=>{const{width:Se,height:Fe}=fe.reference,Be=ce.floating.style;Be.setProperty("--radix-popper-available-width",`${ke}px`),Be.setProperty("--radix-popper-available-height",`${Ce}px`),Be.setProperty("--radix-popper-anchor-width",`${Se}px`),Be.setProperty("--radix-popper-anchor-height",`${Fe}px`)},"apply")}),P&&HU({element:P,padding:l}),p0e({arrowWidth:D,arrowHeight:L}),m&&BU({strategy:"referenceHidden",...B,boundary:V?B.boundary:void 0})]}),M=x.setPlacementState;$n(()=>(M(G),()=>{M(void 0)}),[G,M]);const[q,z]=k_(G),N=Sr(_);$n(()=>{Z&&N?.()},[Z,N]);const ee=Y.arrow?.x,X=Y.arrow?.y,ne=Y.arrow?.centerOffset!==0,[ae,se]=b.useState();return $n(()=>{S&&se(window.getComputedStyle(S).zIndex)},[S]),g.jsx("div",{ref:H.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:Z?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ae,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:g.jsx(f0e,{scope:r,placedSide:q,placedAlign:z,onArrowChange:k,arrowX:ee,arrowY:X,shouldHideArrow:ne,children:g.jsx(Vt.div,{"data-side":q,"data-align":z,...w,ref:R,style:{...w.style,animation:Z?w.style?.animation:"none"}})})})},"PopperContent"));function YU(e){return e!==null}Ul(YU,"isNotNull");var p0e=Ul(e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,f]=k_(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(i.arrow?.x??0)+a/2,m=(i.arrow?.y??0)+l/2;let v="",_="";return u==="bottom"?(v=o?d:`${p}px`,_=`${-l}px`):u==="top"?(v=o?d:`${p}px`,_=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,_=o?d:`${m}px`):u==="left"&&(v=`${r.floating.width+l}px`,_=o?d:`${m}px`),{data:{x:v,y:_}}}}),"transformOrigin");function k_(e){const[t,n="center"]=e.split("-");return[t,n]}Ul(k_,"getSideAndAlignFromPlacement");var uR=u0e,cR=d0e,dR=h0e,m0e=Object.defineProperty,g0e=(e,t)=>m0e(e,"name",{value:t,configurable:!0}),fR=b.forwardRef(g0e(function(t,n){const{container:r,...i}=t,[s,o]=b.useState(!1);$n(()=>o(!0),[]);const a=r||s&&globalThis?.document?.body;return a?Ba.createPortal(g.jsx(Vt.div,{...i,ref:n}),a):null},"Portal")),v0e=Object.defineProperty,Fa=(e,t)=>v0e(e,"name",{value:t,configurable:!0});function QU(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}Fa(QU,"useStateMachine");var as=Fa(e=>{const{present:t,children:n}=e,r=XU(t),i=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),s=JU(r.ref,e7(i));return typeof n=="function"||r.isPresent?b.cloneElement(i,{ref:s}):null},"Presence");function XU(e){const[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),s=b.useRef("none"),o=b.useRef(void 0),a=e?"mounted":"unmounted",[l,u]=QU(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{l==="mounted"?(s.current=o.current??Wd(r.current),o.current=void 0):s.current="none"},[l]),$n(()=>{const f=r.current,d=i.current;if(d!==e){const m=s.current,v=Wd(f);e?(o.current=v,u("MOUNT")):v==="none"||f?.display==="none"?u("UNMOUNT"):u(d&&m!==v?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,u]),$n(()=>
74{if(t){let f;const d=t.ownerDocument.defaultView??window,p=Fa(v=>{const w=Wd(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(u("ANIMATION_END"),!i.current)){const x=t.style.animationFillMode;t.style.animationFillMode="forwards",f=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=x)})}},"handleAnimationEnd"),m=Fa(v=>{v.target===t&&(s.current=Wd(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(f),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:b.useCallback(f=>{if(f){const d=getComputedStyle(f);r.current=d,o.current=Wd(d)}else r.current=null;n(f)},[])}}Fa(XU,"usePresence");function uk(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Fa(uk,"setRef");function JU(...e){const t=b.useRef(e);return t.current=e,b.useCallback(n=>{const r=t.current;let i=!1;const s=r.map(o=>{const a=uk(o,n);return!i&&typeof a=="function"&&(i=!0),a});if(i)return()=>{for(let o=0;o<s.length;o++){const a=s[o];typeof a=="function"?a():uk(r[o],null)}}},[])}Fa(JU,"useStableComposedRefs");function Wd(e){return e?.animationName||"none"}Fa(Wd,"getAnimationName");function e7(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Fa(e7,"getElementRef");var y0e=Object.defineProperty,b0e=(e,t)=>y0e(e,"name",{value:t,configurable:!0}),CL=Ua[" useEffectEvent ".trim().toString()],kL=Ua[" useInsertionEffect ".trim().toString()];function t7(e){if(typeof CL=="function")return CL(e);const t=b.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof kL=="function"?kL(()=>{t.current=e}):$n(()=>{t.current=e}),b.useMemo(()=>((...n)=>t.current?.(...n)),[])}b0e(t7,"useEffectEvent");var _0e=Object.defineProperty,dg=(e,t)=>_0e(e,"name",{value:t,configurable:!0}),w0e=Ua[" useInsertionEffect ".trim().toString()]||$n;function _c({prop:e,defaultProp:t,onChange:n=dg(()=>{},"onChange"),caller:r}){const[i,s,o]=n7({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:i,u=b.useCallback(f=>{if(a){const d=r7(f)?f(e):f;d!==e&&o.current?.(d)}else s(f)},[a,e,s,o]);return[l,u]}dg(_c,"useControllableState");function n7({defaultProp:e,onChange:t}){const[n,r]=b.useState(e),i=b.useRef(n),s=b.useRef(t);return w0e(()=>{s.current=t},[t]),b.useEffect(()=>{i.current!==n&&(s.current?.(n),i.current=n)},[n,i]),[n,r,s]}dg(n7,"useUncontrolledState");function r7(e){return typeof e=="function"}dg(r7,"isFunction");var TL=Symbol("RADIX:SYNC_STATE");function x0e(e,t,n,r){const{prop:i,defaultProp:s,onChange:o,caller:a}=t,l=i!==void 0,u=t7(o),f=[{...n,state:s}];r&&f.push(r);const[d,p]=b.useReducer((w,x)=>{if(x.type===TL)return{...w,state:x.state};const S=e(w,x);return l&&!Object.is(S.state,w.state)&&u(S.state),S},...f),m=d.state,v=b.useRef(m);b.useEffect(()=>{v.current!==m&&(v.current=m,l||u(m))},[m,v,l]);const _=b.useMemo(()=>i!==void 0?{...d,state:i}:d,[d,i]);return b.useEffect(()=>{l&&!Object.is(i,d.state)&&p({type:TL,state:i})},[i,d.state,l]),[_,p]}dg(x0e,"useControllableStateReducer");var S0e=Object.defineProperty,E0e=(e,t)=>S0e(e,"name",{value:t,configurable:!0}),i7=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),C0e=b.forwardRef(E0e(function(t,n){return g.jsx(Vt.span,{...t,ref:n,style:{...i7,...t.style}})},"VisuallyHidden")),k0e=C0e,T0e=Object.defineProperty,$r=(e,t)=>T0e(e,"name",{value:t,configurable:!0}),[hR,fHe]=$s("Tooltip",[rh]),pR=rh(),P0e="TooltipProvider",R0e=700,ck="tooltip.open",[I0e,mR]=hR(P0e),O0e=$r(e=>{const{__scopeTooltip:t,delayDuration:n=R0e,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,o=b.useRef(!0),a=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),g.jsx(I0e,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:b.useCallback(()=>{r<=0||(window.clearTimeout(l.current),o.current=!1)},[r]),onClose:b.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>
74o.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:b.useCallback(u=>{a.current=u},[]),disableHoverableContent:i,children:s})},"TooltipProvider"),dk="Tooltip",[D0e,T_]=hR(dk),A0e=$r(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:s,disableHoverableContent:o,delayDuration:a}=e,l=mR(dk,e.__scopeTooltip),u=pR(t),[f,d]=b.useState(null),[p,m]=b.useState(void 0),v=Vl(),_=b.useRef(0),w=o??l.disableHoverableContent,x=a??l.delayDuration,S=b.useRef(!1),[C,R]=_c({prop:r,defaultProp:i??!1,onChange:$r(A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ck))):l.onClose(),s?.(A)},"onChange"),caller:dk}),P=b.useMemo(()=>C?S.current?"delayed-open":"instant-open":"closed",[C]),k=b.useCallback(()=>{window.clearTimeout(_.current),_.current=0,S.current=!1,R(!0)},[R]),I=b.useCallback(()=>{window.clearTimeout(_.current),_.current=0,R(!1)},[R]),D=b.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>{S.current=!0,R(!0),_.current=0},x)},[x,R]);b.useEffect(()=>()=>{_.current&&(window.clearTimeout(_.current),_.current=0)},[]);const L=p??v;return g.jsx(uR,{...u,children:g.jsx(D0e,{scope:t,contentId:L,setContentId:m,open:C,stateAttribute:P,trigger:f,onTriggerChange:d,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayedRef.current?D():k()},[l.isOpenDelayedRef,D,k]),onTriggerLeave:b.useCallback(()=>{w?I():(window.clearTimeout(_.current),_.current=0)},[I,w]),onOpen:k,onClose:I,disableHoverableContent:w,children:n})})},"Tooltip"),PL="TooltipTrigger",M0e=b.forwardRef($r(function(t,n){const{__scopeTooltip:r,...i}=t,s=T_(PL,r),o=mR(PL,r),a=pR(r),l=b.useRef(null),u=At(n,l,s.onTriggerChange),f=b.useRef(!1),d=b.useRef(!1),p=b.useCallback(()=>f.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),g.jsx(cR,{asChild:!0,...a,children:g.jsx(Vt.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...i,ref:u,onPointerMove:Ue(t.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:Ue(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:Ue(t.onPointerDown,()=>{s.open&&s.onClose(),f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ue(t.onFocus,()=>{f.current||s.onOpen()}),onBlur:Ue(t.onBlur,s.onClose),onClick:Ue(t.onClick,s.onClose)})})},"TooltipTrigger")),N0e="TooltipPortal",[hHe,j0e]=hR(N0e,{forceMount:void 0}),Om="TooltipContent",L0e=b.forwardRef($r(function(t,n){const r=j0e(Om,t.__scopeTooltip),{forceMount:i=r.forceMount,side:s="top",...o}=t,a=T_(Om,t.__scopeTooltip);return g.jsx(as,{present:i||a.open,children:a.disableHoverableContent?g.jsx(s7,{side:s,...o,ref:n}):g.jsx(F0e,{side:s,...o,ref:n})})},"TooltipContent")),F0e=b.forwardRef($r(function(t,n){const r=T_(Om,t.__scopeTooltip),i=mR(Om,t.__scopeTooltip),s=b.useRef(null),o=At(n,s),[a,l]=b.useState(null),{trigger:u,onClose:f}=r,d=s.current,{onPointerInTransitChange:p}=i,m=b.useCallback(()=>{l(null),p(!1)},[p]),v=b.useCallback((_,w)=>{const x=_.currentTarget,S={x:_.clientX,y:_.clientY},C=o7(S,x.getBoundingClientRect()),R=a7(S,C),P=l7(w.getBoundingClientRect()),k=c7([...R,...P]);l(k),p(!0)},[p]);return b.useEffect(()=>()=>m(),[m]),b.useEffect(()=>{if(u&&d){const _=$r(x=>v(x,d),"handleTriggerLeave"),w=$r(x=>v(x,u),"handleContentLeave");return u.addEventListener("pointerleave",_),d.addEventListener("pointerleave",w),()=>{u.removeEventListener("pointerleave",_),d.removeEventListener("pointerleave",w)}}},[u,d,v,m]),b.useEffect(()=>{if(a){const _=$r(w=>{const x=w.target,S={x:w.clientX,y:w.clientY},C=u?.contains(x)||d?.contains(x),R=!u7(S,a);C?m():R&&(m(),f())},"handleTrackPointerGrace");return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[u,d,a,f,m]),g.jsx(s7,{...t,ref:o})},"TooltipContentHoverable")),$0e=mU("TooltipContent"),s7=b.forwardRef($r(function(t,n){const{__scopeTooltip:r,children:i,"aria-label":s,id:o,onEscapeKeyDown:a,onPointerDownOutside:l,...u}=t,f=T_(Om,r),d=pR(r),{onClose:p}=f;b.useEffect(()=>(document.addEventListener(ck,p),()=>document.removeEventListener(ck,p)),[p]),b.useEffect(()=>{if(f.trigger){const v=$r(_=>{_.target instanceof Node&&_.target.contains(f.trigger)&&p()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[f.trigger,p]);const{setContentId:m}=f;return $n(()=>(m(o),()=>{m(void 0)}),[o,m]),g.jsx(x_,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:g.jsxs(dR,{"data-state":f.stateAttribute,role:s?void 0:"tooltip",id:s?void 0:f.contentId,...d,...u,ref:n,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[g.jsx($0e,{children:i}),s?g.jsx(k0e,{id:f.contentId,role:"tooltip",children:s}):null]})})},"TooltipContentImpl"));function o7(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),s=Math.abs(t.left-e.x);switch(Math.min(n,r,i,s)){case s:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}$r(o7,"getExitSideFromRect");function a7(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}$r(a7,"getPaddedExitPoints");function l7(e){const{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}$r(l7,"getPointsFromRect");function u7(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],u=a.x,f=a.y,d=l.x,p=l.y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(i=!i)}return i}$r(u7,"isPointInPolygon");function c7(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),d7(t)}$r(c7,"getHull");function d7(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const i=e[r];for(;t.length>=2;){const s=t[t.length-1],o=t[t.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))t.pop();else break}t.push(i)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const i=e[r];for(;n.length>=2;){const s=n[n.length-1],o=n[n.length-2];if((s.x-o.x)*(i.y-o.y)>=(s.y-o.y)*(i.x-o.x))n.pop();else break}n.push(i)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}$r(d7,"getHullPresorted");var z0e=O0e,V0e=A0e,U0e=M0e,f7=L0e;const Lf=z0e,ab=V0e,lb=U0e,Dm=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(f7,{ref:r,sideOffset:t,className:_e("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
74de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));Dm.displayName=f7.displayName;const gR=b.createContext({});function fg(e){const t=b.useRef(null);return t.current===null&&(t.current=e()),t.current}const P_=b.createContext(null),R_=b.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class B0e extends b.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function H0e({children:e,isPresent:t}){const n=b.useId(),r=b.useRef(null),i=b.useRef({width:0,height:0,top:0,left:0}),{nonce:s}=b.useContext(R_);return b.useInsertionEffect(()=>{const{width:o,height:a,top:l,left:u}=i.current;if(t||!r.current||!o||!a)return;r.current.dataset.motionPopId=n;const f=document.createElement("style");return s&&(f.nonce=s),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(`
75          [data-motion-pop-id="${n}"] {
76            position: absolute !important;
77            width: ${o}px !important;
78            height: ${a}px !important;
79            top: ${l}px !important;
80            left: ${u}px !important;
81          }
82        `),()=>{document.head.removeChild(f)}},[t]),g.jsx(B0e,{isPresent:t,childRef:r,sizeRef:i,children:b.cloneElement(e,{ref:r})})}const q0e=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:s,mode:o})=>{const a=fg(W0e),l=b.useId(),u=b.useCallback(d=>{a.set(d,!0);for(const p of a.values())if(!p)return;r&&r()},[a,r]),f=b.useMemo(()=>({id:l,initial:t,isPresent:n,custom:i,onExitComplete:u,register:d=>(a.set(d,!1),()=>a.delete(d))}),s?[Math.random(),u]:[n,u]);return b.useMemo(()=>{a.forEach((d,p)=>a.set(p,!1))},[n]),b.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),o==="popLayout"&&(e=g.jsx(H0e,{isPresent:n,children:e})),g.jsx(P_.Provider,{value:f,children:e})};function W0e(){return new Map}function h7(e=!0){const t=b.useContext(P_);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:i}=t,s=b.useId();b.useEffect(()=>{e&&i(s)},[e]);const o=b.useCallback(()=>e&&r&&r(s),[s,r,e]);return!n&&r?[!1,o]:[!0]}const by=e=>e.key||"";function RL(e){const t=[];return b.Children.forEach(e,n=>{b.isValidElement(n)&&t.push(n)}),t}const vR=typeof window<"u",yR=vR?b.useLayoutEffect:b.useEffect,G0e=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:s="sync",propagate:o=!1})=>{const[a,l]=h7(o),u=b.useMemo(()=>RL(e),[e]),f=o&&!a?[]:u.map(by),d=b.useRef(!0),p=b.useRef(u),m=fg(()=>new Map),[v,_]=b.useState(u),[w,x]=b.useState(u);yR(()=>{d.current=!1,p.current=u;for(let R=0;R<w.length;R++){const P=by(w[R]);f.includes(P)?m.delete(P):m.get(P)!==!0&&m.set(P,!1)}},[w,f.length,f.join("-")]);const S=[];if(u!==v){let R=[...u];for(let P=0;P<w.length;P++){const k=w[P],I=by(k);f.includes(I)||(R.splice(P,0,k),S.push(k))}s==="wait"&&S.length&&(R=S),x(RL(R)),_(u);return}const{forceRender:C}=b.useContext(gR);return g.jsx(g.Fragment,{children:w.map(R=>{const P=by(R),k=o&&!a?!1:u===w||f.includes(P),I=()=>{if(m.has(P))m.set(P,!0);else return;let D=!0;m.forEach(L=>{L||(D=!1)}),D&&(C?.(),x(p.current),o&&l?.(),r&&r())};return g.jsx(q0e,{isPresent:k,initial:!d.current||n?void 0:!1,custom:k?void 0:t,presenceAffectsLayout:i,mode:s,onExitComplete:k?void 0:I,children:R},P)})})},es=e=>e;let p7=es;function bR(e){let t;return()=>(t===void 0&&(t=e()),t)}const wc=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Vo=e=>e*1e3,Uo=e=>e/1e3,K0e={useManualTiming:!1};function Z0e(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(l.schedule(u),e()),u(o)}const l={schedule:(u,f=!1,d=!1)=>{const m=d&&r?t:n;return f&&s.add(u),m.has(u)||m.add(u),u},cancel:u=>{n.delete(u),s.delete(u)},process:u=>{if(o=u,r){i=!0;return}r=!0,[t,n]=[n,t],t.forEach(a),t.clear(),r=!1,i&&(i=!1,l.process(u))}};return l}const _y=["read","resolveKeyframes","update","preRender","render","postRender"],Y0e=40;function m7(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=_y.reduce((x,S)=>(x[S]=Z0e(s),x),{}),{read:a,resolveKeyframes:l,update:u,preRender:f,render:d,postRender:p}=o,m=()=>{const x=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(x-i.timestamp,Y0e),1),i.timestamp=x,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),f.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))},v=()=>{n=!0,r=!0,i.isProcessing||e(m)};return{schedule:_y.reduce((x,S)=>{const C=o[S];return x[S]=(R,P=!1,k=!1)=>(n||v(),C.schedule(R,P,k)),x},{}),cancel:x=>{for(let S=0;S<_y.length;S++)o[_y[S]].cancel(x)},state:i,steps:o}}const{schedule:_n,cancel:$a,state:Lr,steps:nS}=m7(typeof requestAnimationFrame<"u"?requestAnimationFrame:es,!0),g7=b.createContext({strict:!1}),IL={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ff={};for(const e in IL)Ff[e]={isEnabled:t=>IL[e].some(n=>!!t[n])};function Q0e(e){for(const t in e)Ff[t]={...Ff[t],...e[t]}}const X0e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ub(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||X0e.has(e)}let v7=e=>!ub(e);function J0e(e){e&&(v7=t=>t.startsWith("on")?!ub(t):e(t))}try{J0e(require("@emotion/is-prop-valid").default)}catch{}function ebe(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(v7(i)||n===!0&&ub(i)||!t&&!ub(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function tbe(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}const I_=b.createContext({});function Am(e){return typeof e=="string"||Array.isArray(e)}function O_(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const _R=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],wR=["initial",..._R];function D_(e){return O_(e.animate)||wR.some(t=>Am(e[t]))}function y7(e){return!!(D_(e)||e.variants)}function nbe(e,t){if(D_(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Am(n)?n:void 0,animate:Am(r)?r:void 0}}return e.inherit!==!1?t:{}}function rbe(e){const{initial:t,animate:n}=nbe(e,b.useContext(I_));return b.useMemo(()=>({initial:t,animate:n}),[OL(t),OL(n)])}function OL(e){return Array.isArray(e)?e.join(" "):e}const ibe=Symbol.for("motionComponentSymbol");function rf(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sbe(e,t,n){return b.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):rf(n)&&(n.current=r))},[t])}const xR=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),obe="framerAppearId",b7="data-"+xR(obe),{schedule:SR}=m7(queueMicrotask,!1),_7=b.createContext({});function abe(e,t,n,r,i){var s,o;const{visualElement:a}=b.useContext(I_),l=b.useContext(g7),u=b.useContext(P_),f=b.useContext(R_).reducedMotion,d=b.useRef(null);r=r||l.renderer,!d.current&&r&&(d.current=r(e,{visualState:t,parent:a,props:n,presenceContext:u,blockInitialAnimation:u?u.
vendor: 9,955 bytes, line 82
82initial===!1:!1,reducedMotionConfig:f}));const p=d.current,m=b.useContext(_7);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&lbe(d.current,n,i,m);const v=b.useRef(!1);b.useInsertionEffect(()=>{p&&v.current&&p.update(n,u)});const _=n[b7],w=b.useRef(!!_&&!(!((s=window.MotionHandoffIsComplete)===null||s===void 0)&&s.call(window,_))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,_)));return yR(()=>{p&&(v.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),SR.render(p.render),w.current&&p.animationState&&p.animationState.animateChanges())}),b.useEffect(()=>{p&&(!w.current&&p.animationState&&p.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)===null||x===void 0||x.call(window,_)}),w.current=!1))}),p}function lbe(e,t,n,r){const{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:w7(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&rf(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:u})}function w7(e){if(e)return e.options.allowProjection!==!1?e.projection:w7(e.parent)}function ube({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){var s,o;e&&Q0e(e);function a(u,f){let d;const p={...b.useContext(R_),...u,layoutId:cbe(u)},{isStatic:m}=p,v=rbe(u),_=r(u,m);if(!m&&vR){dbe();const w=fbe(p);d=w.MeasureLayout,v.visualElement=abe(i,_,p,t,w.ProjectionNode)}return g.jsxs(I_.Provider,{value:v,children:[d&&v.visualElement?g.jsx(d,{visualElement:v.visualElement,...p}):null,n(i,u,sbe(_,v.visualElement,f),_,m,v.visualElement)]})}a.displayName=`motion.${typeof i=="string"?i:`create(${(o=(s=i.displayName)!==null&&s!==void 0?s:i.name)!==null&&o!==void 0?o:""})`}`;const l=b.forwardRef(a);return l[ibe]=i,l}function cbe({layoutId:e}){const t=b.useContext(gR).id;return t&&e!==void 0?t+"-"+e:e}function dbe(e,t){b.useContext(g7).strict}function fbe(e){const{drag:t,layout:n}=Ff;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const hbe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ER(e){return typeof e!="string"||e.includes("-")?!1:!!(hbe.indexOf(e)>-1||/[A-Z]/u.test(e))}function DL(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function CR(e,t,n,r){if(typeof t=="function"){const[i,s]=DL(r);t=t(n!==void 0?n:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,s]=DL(r);t=t(n!==void 0?n:e.custom,i,s)}return t}const fk=e=>Array.isArray(e),pbe=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),mbe=e=>fk(e)?e[e.length-1]||0:e,Ir=e=>!!(e&&e.getVelocity);function g0(e){const t=Ir(e)?e.get():e;return pbe(t)?t.toValue():t}function gbe({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,i,s){const o={latestValues:vbe(r,i,s,e),renderState:t()};return n&&(o.onMount=a=>n({props:r,current:a,...o}),o.onUpdate=a=>n(a)),o}const x7=e=>(t,n)=>{const r=b.useContext(I_),i=b.useContext(P_),s=()=>gbe(e,t,r,i);return n?s():fg(s)};function vbe(e,t,n,r){const i={},s=r(e,{});for(const p in s)i[p]=g0(s[p]);let{initial:o,animate:a}=e;const l=D_(e),u=y7(e);t&&u&&!l&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let f=n?n.initial===!1:!1;f=f||o===!1;const d=f?a:o;if(d&&typeof d!="boolean"&&!O_(d)){const p=Array.isArray(d)?d:[d];for(let m=0;m<p.length;m++){const v=CR(e,p[m]);if(v){const{transitionEnd:_,transition:w,...x}=v;for(const S in x){let C=x[S];if(Array.isArray(C)){const R=f?C.length-1:0;C=C[R]}C!==null&&(i[S]=C)}for(const S in _)i[S]=_[S]}}}return i}const ih=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Lc=new Set(ih),S7=e=>t=>typeof t=="string"&&t.startsWith(e),E7=S7("--"),ybe=S7("var(--"),kR=e=>ybe(e)?bbe.test(e.split("/*")[0].trim()):!1,bbe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,C7=(e,t)=>t&&typeof e=="number"?t.transform(e):e,za=(e,t,n)=>n>t?t:n<e?e:n,sh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Mm={...sh,transform:e=>za(0,1,e)},wy={...sh,default:1},hg=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),El=hg("deg"),Bo=hg("%"),bt=hg("px"),_be=hg("vh"),wbe=hg("vw"),AL={...Bo,parse:e=>Bo.parse(e)/100,transform:e=>Bo.transform(e*100)},xbe={borderWidth:bt,borderTopWidth:bt,borderRightWidth:bt,borderBottomWidth:bt,borderLeftWidth:bt,borderRadius:bt,radius:bt,borderTopLeftRadius:bt,borderTopRightRadius:bt,borderBottomRightRadius:bt,borderBottomLeftRadius:bt,width:bt,maxWidth:bt,height:bt,maxHeight:bt,top:bt,right:bt,bottom:bt,left:bt,padding:bt,paddingTop:bt,paddingRight:bt,paddingBottom:bt,paddingLeft:bt,margin:bt,marginTop:bt,marginRight:bt,marginBottom:bt,marginLeft:bt,backgroundPositionX:bt,backgroundPositionY:bt},Sbe={rotate:El,rotateX:El,rotateY:El,rotateZ:El,scale:wy,scaleX:wy,scaleY:wy,scaleZ:wy,skew:El,skewX:El,skewY:El,distance:bt,translateX:bt,translateY:bt,translateZ:bt,x:bt,y:bt,z:bt,perspective:bt,transformPerspective:bt,opacity:Mm,originX:AL,originY:AL,originZ:bt},ML={...sh,transform:Math.round},TR={...xbe,...Sbe,zIndex:ML,size:bt,fillOpacity:Mm,strokeOpacity:Mm,numOctaves:ML},Ebe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Cbe=ih.length;function kbe(e,t,n){let r="",i=!0;for(let s=0;s<Cbe;s++){const o=ih[s],a=e[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||n){const u=C7(a,TR[o]);if(!l){i=!1;const f=Ebe[o]||o;r+=`${f}(${u}) `}n&&(t[o]=u)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function PR(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const l in t){const u=t[l];if(Lc.has(l)){o=!0;continue}else if(E7(l)){i[l]=u;continue}else{const f=C7(u,TR[l]);l.startsWith("origin")?(a=!0,s[l]=f):r[l]=f}}if(t.transform||(o||n?r.transform=kbe(t,e.transform,n):r.transform&&(r.transform="none")),a){const{originX:l="50%",originY:u="50%",originZ:f=0}=s;r.transformOrigin=`${l} ${u} ${f}`}}const Tbe={offset:"stroke-dashoffset",array:"stroke-dasharray"},Pbe={offset:"strokeDashoffset",array:"strokeDasharray"};function Rbe(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Tbe:Pbe;e[s.offset]=bt.transform(-r);const o=bt.transform(t),a=bt.transform(n);e[s.array]=`${o} ${a}`}function NL(e,t,n){return typeof e=="string"?e:bt.transform(t+n*e)}function Ibe(e,t,n){const r=NL(t,e.x,e.width),i=NL(n,e.y,e.height);return`${r} ${i}`}function RR(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},f,d){if(PR(e,u,d),f){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:m,dimensions:v}=e;p.transform&&(v&&(m.transform=p.transform),delete p.transform),v&&(i!==void 0||s!==void 0||m.transform)&&(m.transformOrigin=Ibe(v,i!==void 0?i:.5,s!==void 0?s:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),o!==void 0&&Rbe(p,o,a,l,!1)}const IR=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),k7=()=>({...IR(),attrs:{}}),OR=e=>typeof e=="string"&&e.toLowerCase()==="svg";function T7(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const s in n)e.style.setProperty(s,n[s])}const P7=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function R7(e,t,n,r){T7(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(P7.has(i)?i:xR(i),t.attrs[i])}const cb={};function Obe(e){Object.assign(cb,e)}function I7(e,{layout:t,layoutId:n}){return Lc.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!cb[e]||e==="opacity")}function DR(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(Ir(i[o])||t.style&&Ir(t.style[o])||I7(o,e)||((r=n?.getValue(o))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(s[o]=i[o]);return s}function O7(e,t,n){const r=DR(e,t,n);for(const i in e)if(Ir(e[i])||Ir(t[i])){const s=ih.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[s]=e[i]}return r}function Dbe(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const jL=["x","y","width","height","cx","cy","r"],Abe={useVisualState:x7({scrapeMotionValuesFromProps:O7,createRenderState:k7,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:i})=>{if(!n)return;let s=!!e.drag;if(!s){for(const a in i)if(Lc.has(a)){s=!0;break}}if(!s)return;let o=!t;if(t)for(let a=0;a<jL.length;a++){const l=jL[a];e[l]!==t[l]&&(o=!0)}o&&_n.read(()=>{Dbe(n,r),_n.render(()=>{RR(r,i,OR(n.tagName),e.transformTemplate),R7(n,r)})})}})},Mbe={useVisualState:x7({scrapeMotionValuesFromProps:DR,createRenderState:IR})};function D7(e,t,n){for(const r in t)!Ir(t[r])&&!I7(r,n)&&(e[r]=t[r])}function Nbe({transformTemplate:e},t){return b.useMemo(()=>{const n=IR();return PR(n,t,e),Object.assign({},n.vars,n.style)},[t])}function jbe(e,t){const n=e.style||{},r={};return D7(r,n,e),Object.assign(r,Nbe(e,t)),r}function Lbe(e,t){const n={},r=jbe(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}
82`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function Fbe(e,t,n,r){const i=b.useMemo(()=>{const s=k7();return RR(s,t,OR(r),e.transformTemplate),{...s.attrs,style:{...s.style}}},[t]);if(e.style){const s={};D7(s,e.style,e),i.style={...s,...i.style}}return i}function $be(e=!1){return(n,r,i,{latestValues:s},o)=>{const l=(ER(n)?Fbe:Lbe)(r,s,o,n),u=ebe(r,typeof n=="string",e),f=n!==b.Fragment?{...u,...l,ref:i}:{},{children:d}=r,p=b.useMemo(()=>Ir(d)?d.get():d,[d]);return b.createElement(n,{...f,children:p})}}function zbe(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const o={...ER(r)?Abe:Mbe,preloadedFeatures:e,useRender:$be(i),createVisualElement:t,Component:r};return ube(o)}}function A7(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function A_(e,t,n){const r=e.getProps();return CR(r,t,n!==void 0?n:r.custom,e)}const Vbe=bR(()=>window.ScrollTimeline!==void 0);class Ube{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(i=>{if(Vbe()&&i.attachTimeline)return i.attachTimeline(t);if(typeof n=="function")return n(i)});return()=>{r.forEach((i,s)=>{i&&i(),this.animations[s].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class M7 extends Ube{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function AR(e,t){return e?e[t]||e.default||e:void 0}const db=2e4;function MR(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<db;)t+=n,r=e.next(t);return t>=db?1/0:t}function Bbe(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(MR(r),db);return{type:"keyframes",ease:s=>r.next(i*s).value/t,duration:Uo(i)}}function M_(e){return typeof e=="function"}function LL(e,t){e.timeline=t,e.onfinish=null}const NR=e=>Array.isArray(e)&&typeof e[0]=="number",Hbe={linearEasing:void 0};function qbe(e,t){const n=bR(e);return()=>{var r;return(r=Hbe[t])!==null&&r!==void 0?r:n()}}const fb=qbe(()=>{try{document.createElement("div").animate({opacity:0}
vendor: 15,387 bytes, line 82
82,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),N7=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let s=0;s<i;s++)r+=e(wc(0,i-1,s))+", ";return`linear(${r.substring(0,r.length-2)})`};function j7(e){return!!(typeof e=="function"&&fb()||!e||typeof e=="string"&&(e in hk||fb())||NR(e)||Array.isArray(e)&&e.every(j7))}const Mp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,hk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mp([0,.65,.55,1]),circOut:Mp([.55,0,1,.45]),backIn:Mp([.31,.01,.66,-.59]),backOut:Mp([.33,1.53,.69,.99])};function L7(e,t){if(e)return typeof e=="function"&&fb()?N7(e,t):NR(e)?Mp(e):Array.isArray(e)?e.map(n=>L7(n,t)||hk.easeOut):hk[e]}const Js={x:!1,y:!1};function F7(){return Js.x||Js.y}function $7(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let i=document;const s=(r=n?.[e])!==null&&r!==void 0?r:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e)}function z7(e,t){const n=$7(e),r=new AbortController,i={passive:!0,...t,signal:r.signal};return[n,i,()=>r.abort()]}function FL(e){return t=>{t.pointerType==="touch"||F7()||e(t)}}function Wbe(e,t,n={}){const[r,i,s]=z7(e,n),o=FL(a=>{const{target:l}=a,u=t(a);if(typeof u!="function"||!l)return;const f=FL(d=>{u(d),l.removeEventListener("pointerleave",f)});l.addEventListener("pointerleave",f,i)});return r.forEach(a=>{a.addEventListener("pointerenter",o,i)}),s}const V7=(e,t)=>t?e===t?!0:V7(e,t.parentElement):!1,jR=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Gbe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Kbe(e){return Gbe.has(e.tagName)||e.tabIndex!==-1}const Np=new WeakSet;function $L(e){return t=>{t.key==="Enter"&&e(t)}}function rS(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Zbe=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=$L(()=>{if(Np.has(n))return;rS(n,"down");const i=$L(()=>{rS(n,"up")}),s=()=>rS(n,"cancel");n.addEventListener("keyup",i,t),n.addEventListener("blur",s,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function zL(e){return jR(e)&&!F7()}function Ybe(e,t,n={}){const[r,i,s]=z7(e,n),o=a=>{const l=a.currentTarget;if(!zL(a)||Np.has(l))return;Np.add(l);const u=t(a),f=(m,v)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),!(!zL(m)||!Np.has(l))&&(Np.delete(l),typeof u=="function"&&u(m,{success:v}))},d=m=>{f(m,n.useGlobalTarget||V7(l,m.target))},p=m=>{f(m,!1)};window.addEventListener("pointerup",d,i),window.addEventListener("pointercancel",p,i)};return r.forEach(a=>{!Kbe(a)&&a.getAttribute("tabindex")===null&&(a.tabIndex=0),(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),a.addEventListener("focus",u=>Zbe(u,i),i)}),s}function Qbe(e){return e==="x"||e==="y"?Js[e]?null:(Js[e]=!0,()=>{Js[e]=!1}):Js.x||Js.y?null:(Js.x=Js.y=!0,()=>{Js.x=Js.y=!1})}const U7=new Set(["width","height","top","left","right","bottom",...ih]);let v0;function Xbe(){v0=void 0}const Ho={now:()=>(v0===void 0&&Ho.set(Lr.isProcessing||K0e.useManualTiming?Lr.timestamp:performance.now()),v0),set:e=>{v0=e,queueMicrotask(Xbe)}};function LR(e,t){e.indexOf(t)===-1&&e.push(t)}function N_(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class FR{constructor(){this.subscriptions=[]}add(t){return LR(this.subscriptions,t),()=>N_(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let s=0;s<i;s++){const o=this.subscriptions[s];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function B7(e,t){return t?e*(1e3/t):0}const VL=30,Jbe=e=>!isNaN(parseFloat(e)),Yp={current:void 0};class e_e{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const s=Ho.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Ho.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Jbe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new FR);const r=this.events[t].add(n);return t==="change"?()=>{r(),_n.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Yp.current&&Yp.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Ho.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>VL)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,VL);return B7(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function $f(e,t){return new e_e(e,t)}function t_e(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,$f(n))}function n_e(e,t){const n=A_(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const o in s){const a=mbe(s[o]);t_e(e,o,a)}}function r_e(e){return!!(Ir(e)&&e.add)}function pk(e,t){const n=e.getValue("willChange");if(r_e(n))return n.add(t)}function H7(e){return e.props[b7]}const q7=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,i_e=1e-7,s_e=12;function o_e(e,t,n,r,i){let s,o,a=0;do o=t+(n-t)/2,s=q7(o,r,i)-e,s>0?n=o:t=o;while(Math.abs(s)>i_e&&++a<s_e);return o}function pg(e,t,n,r){if(e===t&&n===r)return es;const i=s=>o_e(s,0,1,e,n);return s=>s===0||s===1?s:q7(i(s),t,r)}const W7=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,G7=e=>t=>1-e(1-t),K7=pg(.33,1.53,.69,.99),$R=G7(K7),Z7=W7($R),Y7=e=>(e*=2)<1?.5*$R(e):.5*(2-Math.pow(2,-10*(e-1))),zR=e=>1-Math.sin(Math.acos(e)),Q7=G7(zR),X7=W7(zR),J7=e=>/^0[^.\s]+$/u.test(e);function a_e(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||J7(e):!0}const Qp=e=>Math.round(e*1e5)/1e5,VR=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function l_e(e){return e==null}const u_e=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,UR=(e,t)=>n=>!!(typeof n=="string"&&u_e.test(n)&&n.startsWith(e)||t&&!l_e(n)&&Object.prototype.hasOwnProperty.call(n,t)),eB=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,s,o,a]=r.match(VR);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},c_e=e=>za(0,255,e),iS={...sh,transform:e=>Math.round(c_e(e))},sc={test:UR("rgb","red"),parse:eB("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+iS.transform(e)+", "+iS.transform(t)+", "+iS.transform(n)+", "+Qp(Mm.transform(r))+")"};function d_e(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const mk={test:UR("#"),parse:d_e,transform:sc.transform},sf={test:UR("hsl","hue"),parse:eB("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Bo.transform(Qp(t))+", "+Bo.transform(Qp(n))+", "+Qp(Mm.transform(r))+")"},Zr={test:e=>sc.test(e)||mk.test(e)||sf.test(e),parse:e=>sc.test(e)?sc.parse(e):sf.test(e)?sf.parse(e):mk.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?sc.transform(e):sf.transform(e)},f_e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function h_e(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(VR))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(f_e))===null||n===void 0?void 0:n.length)||0)>0}const tB="number",nB="color",p_e="var",m_e="var(",UL="${}",g_e=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Nm(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const a=t.replace(g_e,l=>(Zr.test(l)?(r.color.push(s),i.push(nB),n.push(Zr.parse(l))):l.startsWith(m_e)?(r.var.push(s),i.push(p_e),n.push(l)):(r.number.push(s),i.push(tB),n.push(parseFloat(l))),++s,UL)).split(UL);return{values:n,split:a,indexes:r,types:i}}function rB(e){return Nm(e).values}function iB(e){const{split:t,types:n}=Nm(e),r=t.length;return i=>{let s="";for(let o=0;o<r;o++)if(s+=t[o],i[o]!==void 0){const a=n[o];a===tB?s+=Qp(i[o]):a===nB?s+=Zr.transform(i[o]):s+=i[o]}return s}}const v_e=e=>typeof e=="number"?0:e;function y_e(e){const t=rB(e);return iB(e)(t.map(v_e))}const Ql={test:h_e,parse:rB,createTransformer:iB,getAnimatableNone:y_e},b_e=new Set(["brightness","contrast","saturate","opacity"]);function __e(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(VR)||[];if(!r)return e;const i=n.replace(r,"");let s=b_e.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const w_e=/\b([a-z-]*)\(.*?\)/gu,gk={...Ql,getAnimatableNone:e=>{const t=e.match(w_e);return t?t.map(__e).join(" "):e}},x_e={...TR,color:Zr,backgroundColor:Zr,outlineColor:Zr,fill:Zr,stroke:Zr,borderColor:Zr,borderTopColor:Zr,borderRightColor:Zr,borderBottomColor:Zr,borderLeftColor:Zr,filter:gk,WebkitFilter:gk},BR=e=>x_e[e];function sB(e,t){let n=BR(e);return n!==gk&&(n=Ql),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const S_e=new Set(["auto","none","0"]);function E_e(e,t,n){let r=0,i;for(;r<e.length&&!i;){const s=e[r];typeof s=="string"&&!S_e.has(s)&&Nm(s).values.length&&(i=e[r]),r++}if(i&&n)for(const s of t)e[s]=sB(n,i)}const BL=e=>e===sh||e===bt,HL=(e,t)=>parseFloat(e.split(", ")[t]),qL=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return HL(i[1],t);{const s=r.match(/^matrix\((.+)\)$/u);return s?HL(s[1],e):0}},C_e=new Set(["x","y","z"]),k_e=ih.filter(e=>!C_e.has(e));function T_e(e){const t=[];return k_e.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zf={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:qL(4,13),y:qL(5,14)};zf.translateX=zf.x;zf.translateY=zf.y;const lc=new Set;let vk=!1,yk=!1;function oB(){if(yk){const e=Array.from(lc).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=T_e(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([s,o])=>{var a;(a=r.getValue(s))===null||a===void 0||a.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}yk=!1,vk=!1,lc.forEach(e=>e.complete()),lc.clear()}function aB(){lc.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(yk=!0)})}function P_e(){aB(),oB()}class HR{constructor(t,n,r,i,s,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(lc.add(this),vk||(vk=!0,_n.read(aB),_n.resolveKeyframes(oB))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let s=0;s<t.length;s++)if(t[s]===null)if(s===0){const o=i?.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(r&&n){const l=r.readValue(n,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[s]=t[s-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),lc.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,lc.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const lB=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),R_e=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function I_e(e){const t=R_e.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function uB(e,t,n=1){const[r,i]=I_e(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const o=s.trim();return lB(o)?parseFloat(o):o}return kR(i)?uB(i,t,n+1):i}const cB=e=>t=>t.test(e),O_e={test:e=>e==="auto",parse:e=>e},dB=[sh,bt,Bo,El,wbe,_be,O_e],WL=e=>dB.find(cB(e));class fB extends HR{constructor(t,n,r,i,s){super(t,n,r,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let u=t[l];if(typeof u=="string"&&(u=u.trim(),kR(u))){const f=uB(u,n.current);f!==void 0&&(t[l]=f),l===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!U7.has(r)||t.length!==2)return;const[i,s]=t,o=WL(i),a=WL(s);if(o!==a)if(BL(o)&&BL(a))for(let l=0;l<t.length;l++){const u=t[l];typeof u=="string"&&(t[l]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)a_e(t[i])&&r.push(i);r.length&&E_e(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zf[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:i}=this;if(!n||!n.current)return;const s=n.getValue(r);s&&s.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=zf[r](n.measureViewportBox(),window.getComputedStyle(n.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEac
vendor: 11,906 bytes, line 82
82h(([l,u])=>{n.getValue(l).set(u)}),this.resolveNoneKeyframes()}}const GL=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ql.test(e)||e==="0")&&!e.startsWith("url("));function D_e(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function A_e(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const s=e[e.length-1],o=GL(i,t),a=GL(s,t);return!o||!a?!1:D_e(e)||(n==="spring"||M_(n))&&r}const M_e=e=>e!==null;function j_(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(M_e),s=t&&n!=="loop"&&t%2===1?0:i.length-1;return!s||r===void 0?i[s]:r}const N_e=40;class hB{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Ho.now(),this.options={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:s,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>N_e?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&P_e(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=Ho.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:s,delay:o,onComplete:a,onUpdate:l,isGenerator:u}=this.options;if(!u&&!A_e(t,r,i,s))if(o)this.options.duration=0;else{l&&l(j_(t,this.options,n)),a&&a(),this.resolveFinishedPromise();return}const f=this.initPlayback(t,n);f!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...f},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Dn=(e,t,n)=>e+(t-e)*n;function sS(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function j_e({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,s=0,o=0;if(!t)i=s=o=n;else{const a=n<.5?n*(1+t):n+t-n*t,l=2*n-a;i=sS(l,a,e+1/3),s=sS(l,a,e),o=sS(l,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:r}}function hb(e,t){return n=>n>0?t:e}const oS=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},L_e=[mk,sc,sf],F_e=e=>L_e.find(t=>t.test(e));function KL(e){const t=F_e(e);if(!t)return!1;let n=t.parse(e);return t===sf&&(n=j_e(n)),n}const ZL=(e,t)=>{const n=KL(e),r=KL(t);if(!n||!r)return hb(e,t);const i={...n};return s=>(i.red=oS(n.red,r.red,s),i.green=oS(n.green,r.green,s),i.blue=oS(n.blue,r.blue,s),i.alpha=Dn(n.alpha,r.alpha,s),sc.transform(i))},$_e=(e,t)=>n=>t(e(n)),mg=(...e)=>e.reduce($_e),bk=new Set(["none","hidden"]);function z_e(e,t){return bk.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function V_e(e,t){return n=>Dn(e,t,n)}function qR(e){return typeof e=="number"?V_e:typeof e=="string"?kR(e)?hb:Zr.test(e)?ZL:H_e:Array.isArray(e)?pB:typeof e=="object"?Zr.test(e)?ZL:U_e:hb}function pB(e,t){const n=[...e],r=n.length,i=e.map((s,o)=>qR(s)(s,t[o]));return s=>{for(let o=0;o<r;o++)n[o]=i[o](s);return n}}function U_e(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=qR(e[i])(e[i],t[i]));return i=>{for(const s in r)n[s]=r[s](i);return n}}function B_e(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){const o=t.types[s],a=e.indexes[o][i[o]],l=(n=e.values[a])!==null&&n!==void 0?n:0;r[s]=l,i[o]++}return r}const H_e=(e,t)=>{const n=Ql.createTransformer(t),r=Nm(e),i=Nm(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?bk.has(e)&&!i.values.length||bk.has(t)&&!r.values.length?z_e(e,t):mg(pB(B_e(r,i),i.values),n):hb(e,t)};function mB(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Dn(e,t,n):qR(e)(e,t)}const q_e=5;function gB(e,t,n){const r=Math.max(t-q_e,0);return B7(n-e(r),t-r)}const qn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},aS=.001;function W_e({duration:e=qn.duration,bounce:t=qn.bounce,velocity:n=qn.velocity,mass:r=qn.mass}){let i,s,o=1-t;o=za(qn.minDamping,qn.maxDamping,o),e=za(qn.minDuration,qn.maxDuration,Uo(e)),o<1?(i=u=>{const f=u*o,d=f*e,p=f-n,m=_k(u,o),v=Math.exp(-d);return aS-p/m*v},s=u=>{const d=u*o*e,p=d*n+n,m=Math.pow(o,2)*Math.pow(u,2)*e,v=Math.exp(-d),_=_k(Math.pow(u,2),o);return(-i(u)+aS>0?-1:1)*((p-m)*v)/_}):(i=u=>{const f=Math.exp(-u*e),d=(u-n)*e+1;return-aS+f*d},s=u=>{const f=Math.exp(-u*e),d=(n-u)*(e*e);return f*d});const a=5/e,l=K_e(i,s,a);if(e=Vo(e),isNaN(l))return{stiffness:qn.stiffness,damping:qn.damping,duration:e};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:e}}}const G_e=12;function K_e(e,t,n){let r=n;for(let i=1;i<G_e;i++)r=r-e(r)/t(r);return r}function _k(e,t){return e*Math.sqrt(1-t*t)}const Z_e=["duration","bounce"],Y_e=["stiffness","damping","mass"];function YL(e,t){return t.some(n=>e[n]!==void 0)}function Q_e(e){let t={velocity:qn.velocity,stiffness:qn.stiffness,damping:qn.damping,mass:qn.mass,isResolvedFromDuration:!1,...e};if(!YL(e,Y_e)&&YL(e,Z_e))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,s=2*za(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:qn.mass,stiffness:i,damping:s}}else{const n=W_e(e);t={...t,...n,mass:qn.mass},t.isResolvedFromDuration=!0}return t}function WR(e=qn.visualDuration,t=qn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const s=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:f,duration:d,velocity:p,isResolvedFromDuration:m}=Q_e({...n,velocity:-Uo(n.velocity||0)}),v=p||0,_=u/(2*Math.sqrt(l*f)),w=o-s,x=Uo(Math.sqrt(l/f)),S=Math.abs(w)<5;r||(r=S?qn.restSpeed.granular:qn.restSpeed.default),i||(i=S?qn.restDelta.granular:qn.restDelta.default);let C;if(_<1){const P=_k(x,_);C=k=>{const I=Math.exp(-_*x*k);return o-I*((v+_*x*w)/P*Math.sin(P*k)+w*Math.cos(P*k))}}else if(_===1)C=P=>o-Math.exp(-x*P)*(w+(v+x*w)*P);else{const P=x*Math.sqrt(_*_-1);C=k=>{const I=Math.exp(-_*x*k),D=Math.min(P*k,300);return o-I*((v+_*x*w)*Math.sinh(D)+P*w*Math.cosh(D))/P}}const R={calculatedDuration:m&&d||null,next:P=>{const k=C(P);if(m)a.done=P>=d;else{let I=0;_<1&&(I=P===0?Vo(v):gB(C,P,k));const D=Math.abs(I)<=r,L=Math.abs(o-k)<=i;a.done=D&&L}return a.value=a.done?o:k,a},toString:()=>{const P=Math.min(MR(R),db),k=N7(I=>R.next(P*I).value,P,30);return P+"ms "+k}};return R}function QL({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:f}){const d=e[0],p={done:!1,value:d},m=D=>a!==void 0&&D<a||l!==void 0&&D>l,v=D=>a===void 0?l:l===void 0||Math.abs(a-D)<Math.abs(l-D)?a:l;let _=n*t;const w=d+_,x=o===void 0?w:o(w);x!==w&&(_=x-d);const S=D=>-_*Math.exp(-D/r),C=D=>x+S(D),R=D=>{const L=S(D),A=C(D);p.done=Math.abs(L)<=u,p.value=p.done?x:A};let P,k;const I=D=>{m(p.value)&&(P=D,k=WR({keyframes:[p.value,v(p.value)],velocity:gB(C,D,p.value),damping:i,stiffness:s,restDelta:u,restSpeed:f}))};return I(0),{calculatedDuration:null,next:D=>{let L=!1;return!k&&P===void 0&&(L=!0,R(D),I(D)),P!==void 0&&D>=P?k.next(D-P):(!L&&R(D),p)}}}const X_e=pg(.42,0,1,1),J_e=pg(0,0,.58,1),vB=pg(.42,0,.58,1),yB=e=>Array.isArray(e)&&typeof e[0]!="number",ewe={linear:es,easeIn:X_e,easeInOut:vB,easeOut:J_e,circIn:zR,circInOut:X7,circOut:Q7,backIn:$R,backInOut:Z7,backOut:K7,anticipate:Y7},XL=e=>{if(NR(e)){p7(e.length===4);const[t,n,r,i]=e;return pg(t,n,r,i)}else if(typeof e=="string")return ewe[e];return e};function twe(e,t,n){const r=[],i=n||mB,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||es:t;a=mg(l,a)}r.push(a)}return r}function bB(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if(p7(s===t.length),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=twe(t,r,i),l=a.length,u=f=>{if(o&&f<e[0])return t[0];let d=0;if(l>1)for(;d<e.length-2&&!(f<e[d+1]);d++);const p=wc(e[d],e[d+1],f);return a[d](p)};return n?f=>u(za(e[0],e[s-1],f)):u}function _B(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=wc(0,t,r);e.push(Dn(n,1,i))}}function wB(e){const t=[0];return _B(t,e.length-1),t}function nwe(e,t){return e.map(n=>n*t)}function rwe(e,t){return e.map(()=>t||vB).splice(0,e.length-1)}function pb({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=yB(r)?r.map(XL):XL(r),s={done:!1,value:t[0]},o=nwe(n&&n.length===t.length?n:wB(t),e),a=bB(o,t,{ease:Array.isArray(i)?i:rwe(t,i)});return{calculatedDuration:e,next:l=>(s.value=a(l),s.done=l>=e,s)}}const iwe=e=>{const t=({timestamp:n})=>e(n);return{start:()=>_n.update(t,!0),stop:()=>$a(t),now:()=>Lr.isProcessing?Lr.timestamp:Ho.now()}},swe={decay:QL,inertia:QL,tween:pb,keyframes:pb,spring:WR},owe=e=>e/100;class GR extends hB{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:n,motionValue:r,element:i,keyframes:s}=this.options,o=i?.KeyframeResolver||HR,a=(l,u)=>this.onKeyframesResolved(l,u);this.resolver=new o(s,a,n,r,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=this.options,a=M_(n)?n:swe[n]||pb;let l,u;a!==pb&&typeof t[0]!="number"&&(l=mg(owe,mB(t[0],t[1])),t=[0,100]);const f=a({...this.options,keyframes:t});s==="mirror"&&(u=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),f.calculatedDuration===null&&(f.calculatedDuration=MR(f));const{calculatedDuration:d}=f,p=d+i,m=p*(r+1)-i;return{generator:f,mirroredGenerator:u,mapPercentToKeyframes:l,calculatedDuration:d,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:D}=this.options;return{done:!0,value:D[D.length-1]}}const{finalKeyframe:i,generator:s,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:u,totalDuration:f,resolvedDuration:d}=r;if(this.startTime===null)return s.next(0);const{delay:p,repeat:m,repeatType:v,repeatDelay:_,onUpdate:w}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-f/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-p*(this.speed>=0?1:-1),S=this.speed>=0?x<0:x>f;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let C=this.currentTime,R=s;if(m){const D=Math.min(this.currentTime,f)/d;let L=Math.floor(D),A=D%1;!A&&D>=1&&(A=1),A===1&&L--,L=Math.min(L,m+1),!!(L%2)&&(v==="reverse"?(A=1-A,_&&(A-=_/d)):v==="mirror"&&(R=o)),C=za(0,1,A)*d}const P=S?{done:!1,value:l[0]}:R.next(C);a&&(P.value=a(P.value));let{done:k}=P;!S&&u!==null&&(k=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return I&&i!==void 0&&(P.value=j_(l,this.options,i)),w&&w(P.value),I&&this.finish(),P}get duration(){const{resolved:t}=this;return t?Uo(t.calculatedDuration):0}
vendor: 33,118 bytes, line 82
82get time(){return Uo(this.currentTime)}set time(t){t=Vo(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Uo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=iwe,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(s=>this.tick(s))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const awe=new Set(["opacity","clipPath","filter","transform"]);function lwe(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const u={[t]:n};l&&(u.offset=l);const f=L7(a,i);return Array.isArray(f)&&(u.easing=f),e.animate(u,{delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"})}const uwe=bR(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),mb=10,cwe=2e4;function dwe(e){return M_(e.type)||e.type==="spring"||!j7(e.ease)}function fwe(e,t){const n=new GR({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<cwe;)r=n.sample(s),i.push(r.value),s+=mb;return{times:void 0,keyframes:i,duration:s-mb,ease:"linear"}}const xB={anticipate:Y7,backInOut:Z7,circInOut:X7};function hwe(e){return e in xB}class JL extends hB{constructor(t){super(t);const{name:n,motionValue:r,element:i,keyframes:s}=this.options;this.resolver=new fB(s,(o,a)=>this.onKeyframesResolved(o,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l,startTime:u}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof s=="string"&&fb()&&hwe(s)&&(s=xB[s]),dwe(this.options)){const{onComplete:d,onUpdate:p,motionValue:m,element:v,..._}=this.options,w=fwe(t,_);t=w.keyframes,t.length===1&&(t[1]=t[0]),r=w.duration,i=w.times,s=w.ease,o="keyframes"}const f=lwe(a.owner.current,l,t,{...this.options,duration:r,times:i,ease:s});return f.startTime=u??this.calcStartTime(),this.pendingTimeline?(LL(f,this.pendingTimeline),this.pendingTimeline=void 0):f.onfinish=()=>{const{onComplete:d}=this.options;a.set(j_(t,this.options,n)),d&&d(),this.cancel(),this.resolveFinishedPromise()},{animation:f,duration:r,times:i,type:o,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Uo(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Uo(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=Vo(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return es;const{animation:r}=n;LL(r,t)}return es}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:s,ease:o,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:f,onComplete:d,element:p,...m}=this.options,v=new GR({...m,keyframes:r,duration:i,type:s,ease:o,times:a,isGenerator:!0}),_=Vo(this.time);u.setWithVelocity(v.sample(_-mb).value,v.sample(_).value,mb)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:s,damping:o,type:a}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=n.owner.getProps();return uwe()&&r&&awe.has(r)&&!l&&!u&&!i&&s!=="mirror"&&o!==0&&a!=="inertia"}}const pwe={type:"spring",stiffness:500,damping:25,restSpeed:10},mwe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),gwe={type:"keyframes",duration:.8},vwe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ywe=(e,{keyframes:t})=>t.length>2?gwe:Lc.has(e)?e.startsWith("scale")?mwe(t[1]):pwe:vwe;function bwe({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...f}){return!!Object.keys(f).length}const KR=(e,t,n,r={},i,s)=>o=>{const a=AR(r,e)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Vo(l);let f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:p=>{t.set(p),a.onUpdate&&a.onUpdate(p)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};bwe(a)||(f={...f,...ywe(e,f)}),f.duration&&(f.duration=Vo(f.duration)),f.repeatDelay&&(f.repeatDelay=Vo(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let d=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(f.duration=0,f.delay===0&&(d=!0)),d&&!s&&t.get()!==void 0){const p=j_(f.keyframes,a);if(p!==void 0)return _n.update(()=>{f.onUpdate(p),f.onComplete()}),new M7([])}return!s&&JL.supports(f)?new JL(f):new GR(f)};function _we({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ZR(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const d in l){const p=e.getValue(d,(s=e.latestValues[d])!==null&&s!==void 0?s:null),m=l[d];if(m===void 0||f&&_we(f,d))continue;const v={delay:n,...AR(o||{},d)};let _=!1;if(window.MotionHandoffAnimation){const x=H7(e);if(x){const S=window.MotionHandoffAnimation(x,d,_n);S!==null&&(v.startTime=S,_=!0)}}pk(e,d),p.start(KR(d,p,m,e.shouldReduceMotion&&U7.has(d)?{type:!1}:v,e,_));const w=p.animation;w&&u.push(w)}return a&&Promise.all(u).then(()=>{_n.update(()=>{a&&n_e(e,a)})}),u}function wk(e,t,n={}){var r;const i=A_(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ZR(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:f=0,staggerChildren:d,staggerDirection:p}=s;return wwe(e,t,f+u,d,p,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,f]=l==="beforeChildren"?[o,a]:[a,o];return u().then(()=>f())}else return Promise.all([o(),a(n.delay)])}function wwe(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=i===1?(u=0)=>u*r:(u=0)=>a-u*r;return Array.from(e.variantChildren).sort(xwe).forEach((u,f)=>{u.notify("AnimationStart",t),o.push(wk(u,t,{...s,delay:n+l(f)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(o)}function xwe(e,t){return e.sortNodePosition(t)}function Swe(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(s=>wk(e,s,n));r=Promise.all(i)}else if(typeof t=="string")r=wk(e,t,n);else{const i=typeof t=="function"?A_(e,t,n.custom):t;r=Promise.all(ZR(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Ewe=wR.length;function SB(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?SB(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Ewe;n++){const r=wR[n],i=e.props[r];(Am(i)||i===!1)&&(t[r]=i)}return t}const Cwe=[..._R].reverse(),kwe=_R.length;function Twe(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Swe(e,n,r)))}function Pwe(e){let t=Twe(e),n=eF(),r=!0;const i=l=>(u,f)=>{var d;const p=A_(e,f,l==="exit"?(d=e.presenceContext)===null||d===void 0?void 0:d.custom:void 0);if(p){const{transition:m,transitionEnd:v,..._}=p;u={...u,..._,...v}}return u};function s(l){t=l(e)}function o(l){const{props:u}=e,f=SB(e.parent)||{},d=[],p=new Set;let m={},v=1/0;for(let w=0;w<kwe;w++){const x=Cwe[w],S=n[x],C=u[x]!==void 0?u[x]:f[x],R=Am(C),P=x===l?S.isActive:null;P===!1&&(v=w);let k=C===f[x]&&C!==u[x]&&R;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),S.protectedKeys={...m},!S.isActive&&P===null||!C&&!S.prevProp||O_(C)||typeof C=="boolean")continue;const I=Rwe(S.prevProp,C);let D=I||x===l&&S.isActive&&!k&&R||w>v&&R,L=!1;const A=Array.isArray(C)?C:[C];let $=A.reduce(i(x),{});P===!1&&($={});const{prevResolvedValues:j={}}=S,V={...j,...$},B=G=>{D=!0,p.has(G)&&(L=!0,p.delete(G)),S.needsAnimating[G]=!0;const Z=e.getValue(G);Z&&(Z.liveStyle=!1)};for(const G in V){const Z=$[G],Y=j[G];if(m.hasOwnProperty(G))continue;let M=!1;fk(Z)&&fk(Y)?M=!A7(Z,Y):M=Z!==Y,M?Z!=null?B(G):p.add(G):Z!==void 0&&p.has(G)?B(G):S.protectedKeys[G]=!0}S.prevProp=C,S.prevResolvedValues=$,S.isActive&&(m={...m,...$}),r&&e.blockInitialAnimation&&(D=!1),D&&(!(k&&I)||L)&&d.push(...A.map(G=>({animation:G,options:{type:x}})))}if(p.size){const w={};p.forEach(x=>{const S=e.getBaseTarget(x),C=e.getValue(x);C&&(C.liveStyle=!0),w[x]=S??null}),d.push({animation:w})}let _=!!d.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(_=!1),r=!1,_?t(d):Promise.resolve()}function a(l,u){var f;if(n[l].isActive===u)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(p=>{var m;return(m=p.animationState)===null||m===void 0?void 0:m.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:s,getState:()=>n,reset:()=>{n=eF(),r=!0}}}function Rwe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!A7(t,e):!1}function Fu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function eF(){return{animate:Fu(!0),whileInView:Fu(),whileHover:Fu(),whileTap:Fu(),whileDrag:Fu(),whileFocus:Fu(),exit:Fu()}}class au{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Iwe extends au{constructor(t){super(t),t.animationState||(t.animationState=Pwe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();O_(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let Owe=0;class Dwe extends au{constructor(){super(...arguments),this.id=Owe++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const Awe={animation:{Feature:Iwe},exit:{Feature:Dwe}};function jm(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function gg(e){return{point:{x:e.pageX,y:e.pageY}}}const Mwe=e=>t=>jR(t)&&e(t,gg(t));function Xp(e,t,n,r){return jm(e,t,Mwe(n),r)}const tF=(e,t)=>Math.abs(e-t);function Nwe(e,t){const n=tF(e.x,t.x),r=tF(e.y,t.y);return Math.sqrt(n**2+r**2)}class EB{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:s=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const d=uS(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=Nwe(d.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:v}=d,{timestamp:_}=Lr;this.history.push({...v,timestamp:_});const{onStart:w,onMove:x}=this.handlers;p||(w&&w(this.lastMoveEvent,d),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,d)},this.handlePointerMove=(d,p)=>{this.lastMoveEvent=d,this.lastMoveEventInfo=lS(p,this.transformPagePoint),_n.update(this.updatePoint,!0)},this.handlePointerUp=(d,p)=>{this.end();const{onEnd:m,onSessionEnd:v,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const w=uS(d.type==="pointercancel"?this.lastMoveEventInfo:lS(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(d,w),v&&v(d,w)},!jR(t))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const o=gg(t),a=lS(o,this.transformPagePoint),{point:l}=a,{timestamp:u}=Lr;this.history=[{...l,timestamp:u}];const{onSessionStart:f}=n;f&&f(t,uS(a,this.history)),this.removeListeners=mg(Xp(this.contextWindow,"pointermove",this.handlePointerMove),Xp(this.contextWindow,"pointerup",this.handlePointerUp),Xp(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),$a(this.updatePoint)}}function lS(e,t){return t?{point:t(e.point)}:e}function nF(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uS({point:e},t){return{point:e,delta:nF(e,CB(t)),offset:nF(e,jwe(t)),velocity:Lwe(t,.1)}}function jwe(e){return e[0]}function CB(e){return e[e.length-1]}function Lwe(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=CB(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Vo(t)));)n--;if(!r)return{x:0,y:0};const s=Uo(i.timestamp-r.timestamp);if(s===0)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const kB=1e-4,Fwe=1-kB,$we=1+kB,TB=.01,zwe=0-TB,Vwe=0+TB;function is(e){return e.max-e.min}function Uwe(e,t,n){return Math.abs(e-t)<=n}function rF(e,t,n,r=.5){e.origin=r,e.originPoint=Dn(t.min,t.max,e.origin),e.scale=is(n)/is(t),e.translate=Dn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Fwe&&e.scale<=$we||isNaN(e.scale))&&(e.scale=1),(e.translate>=zwe&&e.translate<=Vwe||isNaN(e.translate))&&(e.translate=0)}function Jp(e,t,n,r){rF(e.x,t.x,n.x,r?r.originX:void 0),rF(e.y,t.y,n.y,r?r.originY:void 0)}function iF(e,t,n){e.min=n.min+t.min,e.max=e.min+is(t)}function Bwe(e,t,n){iF(e.x,t.x,n.x),iF(e.y,t.y,n.y)}function sF(e,t,n){e.min=t.min-n.min,e.max=e.min+is(t)}function em(e,t,n){sF(e.x,t.x,n.x),sF(e.y,t.y,n.y)}function Hwe(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Dn(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Dn(n,e,r.max):Math.min(e,n)),e}function oF(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function qwe(e,{top:t,left:n,bottom:r,right:i}){return{x:oF(e.x,n,i),y:oF(e.y,t,r)}}function aF(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Wwe(e,t){return{x:aF(e.x,t.x),y:aF(e.y,t.y)}}function Gwe(e,t){let n=.5;const r=is(e),i=is(t);return i>r?n=wc(t.min,t.max-r,e.min):r>i&&(n=wc(e.min,e.max-i,t.min)),za(0,1,n)}function Kwe(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const xk=.35;function Zwe(e=xk){return e===!1?e=0:e===!0&&(e=xk),{x:lF(e,"left","right"),y:lF(e,"top","bottom")}}function lF(e,t,n){return{min:uF(e,t),max:uF(e,n)}}function uF(e,t){return typeof e=="number"?e:e[t]||0}const cF=()=>({translate:0,scale:1,origin:0,originPoint:0}),of=()=>({x:cF(),y:cF()}),dF=()=>({min:0,max:0}),Hn=()=>({x:dF(),y:dF()});function ws(e){return[e("x"),e("y")]}function PB({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Ywe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Qwe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function cS(e){return e===void 0||e===1}function Sk({scale:e,scaleX:t,scaleY:n}){return!cS(e)||!cS(t)||!cS(n)}function Zu(e){return Sk(e)||RB(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function RB(e){return fF(e.x)||fF(e.y)}function fF(e){return e&&e!=="0%"}function gb(e,t,n){const r=e-n,i=t*r;return n+i}function hF(e,t,n,r,i){return i!==void 0&&(e=gb(e,i,r)),gb(e,n,r)+t}function Ek(e,t=0,n=1,r,i){e.min=hF(e.min,t,n,r,i),e.max=hF(e.max,t,n,r,i)}function IB(e,{x:t,y:n}){Ek(e.x,t.translate,t.scale,t.originPoint),Ek(e.y,n.translate,n.scale,n.originPoint)}const pF=.999999999999,mF=1.0000000000001;function Xwe(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let s,o;for(let a=0;a<i;a++){s=n[a],o=s.projectionDelta;const{visualElement:l}=s.options;l&&l.props.style&&l.props.style.display==="contents"||(r&&s.options.layoutScroll&&s.scroll&&s!==s.root&&lf(e,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),o&&(t.x*=o.x.scale,t.y*=o.y.scale,IB(e,o)),r&&Zu(s.latestValues)&&lf(e,s.latestValues))}t.x<mF&&t.x>pF&&(t.x=1),t.y<mF&&t.y>pF&&(t.y=1)}function af(e,t){e.min=e.min+t,e.max=e.max+t}function gF(e,t,n,r,i=.5){const s=Dn(e.min,e.max,i);Ek(e,t,n,s,r)}function lf(e,t){gF(e.x,t.x,t.scaleX,t.scale,t.originX),gF(e.y,t.y,t.scaleY,t.scale,t.originY)}function OB(e,t){return PB(Qwe(e.getBoundingClientRect(),t))}function Jwe(e,t,n){const r=OB(e,n),{scroll:i}=t;return i&&(af(r.x,i.offset.x),af(r.y,i.offset.y)),r}const DB=({current:e})=>e?e.ownerDocument.defaultView:null,exe=new WeakMap;class txe{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Hn(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:d}=this.getProps();d?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(gg(f).point)},s=(f,d)=>{const{drag:p,dragPropagation:m,onDragStart:v}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Qbe(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ws(w=>{let x=this.getAxisMotionValue(w).get()||0;if(Bo.test(x)){const{projection:S}=this.visualElement;if(S&&S.layout){const C=S.layout.layoutBox[w];C&&(x=is(C)*(parseFloat(x)/100))}}this.originPoint[w]=x}),v&&_n.postRender(()=>v(f,d)),pk(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},o=(f,d)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:v,onDrag:_}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:w}=d;if(m&&this.currentDirection===null){this.currentDirection=nxe(w),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",d.point,w),this.updateAxis("y",d.point,w),this.visualElement.render(),_&&_(f,d)},a=(f,d)=>this.stop(f,d),l=()=>ws(f=>{var d;return this.getAnimationState(f)==="paused"&&((d=this.getAxisMotionValue(f).animation)===null||d===void 0?void 0:d.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new EB(t,{onSessionStart:i,onStart:s,onMove:o,onSessionEnd:a,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:DB(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&_n.postRender(()=>s(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!xy(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(o=Hwe(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,s=this.constraints;n&&rf(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=qwe(i.layoutBox,n):this.constraints=!1,this.elastic=Zwe(r),s!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&ws(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Kwe(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!rf(t))return!1;const r=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=Jwe(r,i.root,this.visualElement.getTransformPagePoint());let o=Wwe(i.layout.layoutBox,s);if(n){const a=n(Ywe(o));this.hasMutatedConstraints=!!a,a&&(o=PB(a))}return o}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=ws(f=>{if(!xy(f,n,this.currentDirection))return;let d=l&&l[f]||{};o&&(d={min:0,max:0});const p=i?200:1e6,m=i?40:1e7,v={type:"inertia",velocity:r?t[f]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(f,v)});return Promise.all(u).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return pk(this.visualElement,t),r.start(KR(t,r,0,n,this.visualElement,!1))}stopAnimation(){ws(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){ws(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){ws(n=>{const{drag:r}=this.getProps();if(!xy(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(n);if(i&&i.layout){const{min:o,max:a}=i.layout.layoutBox[n];s.set(t[n]-Dn(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!rf(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};ws(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();i[o]=Gwe({min:l,max:l},this.constraints[o])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),ws(o=>{if(!xy(o,t,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Dn(l,u,i[o]))})}addListeners(){if(!this.visualElement.current)return;exe.set(this.visualElement,this);const t=this.visualElement.current,n=Xp(t,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();rf(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),_n.read(r);const o=jm(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ws(f=>{const d=this.getAxisMotionValue(f);d&&(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.render())}));return()=>{o(),n(),s(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=xk,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}}function xy(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function nxe(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class rxe extends au{constructor(t){super(t),this.removeGroupControls=es,this.removeListeners=es,this.controls=new txe(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||es}unmount(){this.removeGroupControls(),this.removeListeners()}}const vF=e=>(t,n)=>{e&&_n.postRender(()=>e(t,n))};class ixe extends au{constructor(){super(...arguments),this.removePointerDownListener=es}onPointerDown(t){this.session=new EB(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:DB(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:vF(t),onStart:vF(n),onMove:r,onEnd:(s,o)=>{delete this.session,i&&_n.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=Xp(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const y0={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function yF(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const np={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(bt.test(e))e=parseFloat(e);else return e;const n=yF(e,t.target.x),r=yF(e,t.target.y);return`${n}% ${r}%`}},sxe={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ql.parse(e);if(i.length>5)return r;const s=Ql.createTransformer(e),o=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=Dn(a,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};class oxe extends b.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:s}=t;Obe(axe),s&&(n.group&&n.group.add(s),r&&r.register&&i&&r.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),y0.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:s}=this.props,o=r.projection;return o&&(o.isPresent=s,i||t.layoutDependency!==n||n===void 0?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||_n.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),SR.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function AB(e){const[t,n]=h7(),r=b.useContext(gR);return g.jsx(oxe,{...e,layoutGroup:r,switchLayoutGroup:b.useContext(_7),isPresent:t,safeToRemove:n})}const axe={borderRadius:{...np,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:np,borderTopRightRadius:np,borderBottomLeftRadius:np,borderBottomRightRadius:np,boxShadow:sxe};function MB(e,t,n){const r=Ir(e)?e:$f(e);return r.start(KR("",r,t,n)),r.animation}function NB(e){return e instanceof SVGElement&&e.tagName!=="svg"}const lxe=(e,t)=>e.depth-t.depth;class uxe{constructor(){this.children=[],this.isDirty=!1}add(t){LR(this.children,t),this.isDirty=!0}remove(t){N_(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(lxe),this.isDirty=!1,this.children.forEach(t)}}function cxe(e,t){const n=Ho.now(),r=({timestamp:i})=>{const s=i-n;s>=t&&($a(r),e(s-t))};return _n.read(r,!0),()=>$a(r)}const jB=["TopLeft","TopRight","BottomLeft","BottomRight"],dxe=jB.length,bF=e=>typeof e=="string"?parseFloat(e):e,_F=e=>typeof e=="number"||bt.test(e);function fxe(e,t,n,r,i,s){i?(e.opacity=Dn(0,n.opacity!==void 0?n.opacity:1,hxe(r)),e.opacityExit=Dn(t.opacity!==void 0?t.opacity:1,0,pxe(r))):s&&(e.opacity=Dn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let o=0;o<dxe;o++){const a=`border${jB[o]}Radius`;let l=wF(t,a),u=wF(n,a);if(l===void 0&&u===void 0)continue;l||(l=0),u||(u=0),l===0||u===0||_F(l)===_F(u)?(e[a]=Math.max(Dn(bF(l),bF(u),r),0),(Bo.test(u)||Bo.test(l))&&(e[a]+="%")):e[a]=u}(t.rotate||n.rotate)&&(e.rotate=Dn(t.rotate||0,n.rotate||0,r))}function wF(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const hxe=LB(0,.5,Q7),pxe=LB(.5,.95,es);function LB(e,t,n){return r=>r<e?0:r>t?1:n(wc(e,t,r))}function xF(e,t){e.min=t.min,e.max=t.max}function ys(e,t){xF(e.x,t.x),xF(e.y,t.y)}function SF(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function EF(e,t,n,r,i){return e-=t,e=gb(e,1/n,r),i!==void 0&&(e=gb(e,1/i,r)),e}function mxe(e,t=0,n=1,r=.5,i,s=e,o=e){if(Bo.test(t)&&(t=parseFloat(t),t=Dn(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=Dn(s.min,s.max,r);e===s&&(a-=t),e.min=EF(e.min,t,n,a,i),e.max=EF(e.max,t,n,a,i)}function CF(e,t,[n,r,i],s,o){mxe(e,t[n],t[r],t[i],t.scale,s,o)}const gxe=["x","scaleX","originX"],vxe=["y","scaleY","originY"];function kF(e,t,n,r){CF(e.x,t,gxe,n?n.x:void 0,r?r.x:void 0),CF(e.y,t,vxe,n?n.y:void 0,r?r.y:void 0)}function TF(e){return e.translate===0&&e.scale===1}function FB(e){return TF(e.x)&&TF(e.y)}function PF(e,t){return e.min===t.min&&e.max===t.max}function yxe(e,t){return PF(e.x,t.x)&&PF(e.y,t.y)}function RF(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function $B(e,t){return RF(e.x,t.x)&&RF(e.y,t.y)}function IF(e){return is(e.x)/is(e.y)}function OF(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class bxe{constructor(){this.members=[]}add(t){LR(this.members,t),t.scheduleRender()}remove(t){if(N_(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const s=this.members[i];if(s.isPresent!==!1){r=s;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function _xe(e,t,n){let r="";const i=e.x.translate/t.x,s=e.y.translate/t.y,o=n?.z||0;if((i||s||o)&&(r=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:f,rotateX:d,rotateY:p,skewX:m,skewY:v}=n;u&&(r=`perspective(${u}px) ${r}`),f&&(r+=`rotate(${f}deg) `),d&&(r+=`rotateX(${d}deg) `),p&&(r+=`rotateY(${p}deg) `),m&&(r+=`skewX(${m}deg) `),v&&(r+=`skewY(${v}deg) `)}const a=e.x.scale*t.x,l=e.y.scale*t.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l}
82)`),r||"none"}const Yu={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},jp=typeof window<"u"&&window.MotionDebug!==void 0,dS=["","X","Y","Z"],wxe={visibility:"hidden"},DF=1e3;let xxe=0;function fS(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function zB(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=H7(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",_n,!(i||s))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&zB(r)}function VB({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(o={},a=t?.()){this.id=xxe++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,jp&&(Yu.totalNodes=Yu.resolvedTargetDeltas=Yu.recalculatedProjection=0),this.nodes.forEach(Cxe),this.nodes.forEach(Ixe),this.nodes.forEach(Oxe),this.nodes.forEach(kxe),jp&&window.MotionDebug.record(Yu)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;l<this.path.length;l++)this.path[l].shouldResetTransform=!0;this.root===this&&(this.nodes=new uxe)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new FR),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){const l=this.eventHandlers.get(o);l&&l.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=NB(o),this.instance=o;const{layoutId:l,layout:u,visualElement:f}=this.options;if(f&&!f.current&&f.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(u||l)&&(this.isLayoutDirty=!0),e){let d;const p=()=>this.root.updateBlockedByResize=!1;e(o,()=>{this.root.updateBlockedByResize=!0,d&&d(),d=cxe(p,250),y0.hasAnimatedSinceResize&&(y0.hasAnimatedSinceResize=!1,this.nodes.forEach(MF))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeTargetChanged:m,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||f.getDefaultTransition()||jxe,{onLayoutAnimationStart:w,onLayoutAnimationComplete:x}=f.getProps(),S=!this.targetLayout||!$B(this.targetLayout,v)||m,C=!p&&m;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||C||p&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,C);const R={...AR(_,"layout"),onPlay:w,onComplete:x};(f.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R)}else p||MF(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,$a(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEac
vendor: 17,044 bytes, line 82
82h(Dxe),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zB(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f<this.path.length;f++){const d=this.path[f];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:a,layout:l}=this.options;if(a===void 0&&!l)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(AF);return}this.isUpdating||this.nodes.forEach(Pxe),this.isUpdating=!1,this.nodes.forEach(Rxe),this.nodes.forEach(Sxe),this.nodes.forEach(Exe),this.clearAllSnapshots();const a=Ho.now();Lr.delta=za(0,1e3/60,a-Lr.timestamp),Lr.timestamp=a,Lr.isProcessing=!0,nS.update.process(Lr),nS.preRender.process(Lr),nS.render.process(Lr),Lr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,SR.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Txe),this.sharedNodes.forEach(Axe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,_n.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){_n.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l<this.path.length;l++)this.path[l].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Hn(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a){const l=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:l,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:l}}}resetTransform(){if(!i)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!FB(this.projectionDelta),l=this.getTransformTemplate(),u=l?l(this.latestValues,""):void 0,f=u!==this.prevTransformTemplateValue;o&&(a||Zu(this.latestValues)||f)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const a=this.measurePageBox();let l=this.removeElementScroll(a);return o&&(l=this.removeTransform(l)),Lxe(l),{animationId:this.root.animationId,measuredBox:a,layoutBox:l,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:a}=this.options;if(!a)return Hn();const l=a.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(Fxe))){const{scroll:f}=this.root;f&&(af(l.x,f.offset.x),af(l.y,f.offset.y))}return l}removeElementScroll(o){var a;const l=Hn();if(ys(l,o),!((a=this.scroll)===null||a===void 0)&&a.wasRoot)return l;for(let u=0;u<this.path.length;u++){const f=this.path[u],{scroll:d,options:p}=f;f!==this.root&&d&&p.layoutScroll&&(d.wasRoot&&ys(l,o),af(l.x,d.offset.x),af(l.y,d.offset.y))}return l}applyTransform(o,a=!1){const l=Hn();ys(l,o);for(let u=0;u<this.path.length;u++){const f=this.path[u];!a&&f.options.layoutScroll&&f.scroll&&f!==f.root&&lf(l,{x:-f.scroll.offset.x,y:-f.scroll.offset.y}),Zu(f.latestValues)&&lf(l,f.latestValues)}return Zu(this.latestValues)&&lf(l,this.latestValues),l}removeTransform(o){const a=Hn();ys(a,o);for(let l=0;l<this.path.length;l++){const u=this.path[l];if(!u.instance||!Zu(u.latestValues))continue;Sk(u.latestValues)&&u.updateSnapshot();const f=Hn(),d=u.measurePageBox();ys(f,d),kF(a,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,f)}return Zu(this.latestValues)&&kF(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Lr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var a;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:p}=this.options;if(!(!this.layout||!(d||p))){if(this.resolvedRelativeTargetAt=Lr.timestamp,!this.targetDelta&&!this.relativeTarget){const m=this.getClosestProjectingParent();m&&m.layout&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Hn(),this.relativeTargetOrigin=Hn(),em(this.relativeTargetOrigin,this.layout.layoutBox,m.layout.layoutBox),ys(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Hn(),this.targetWithTransforms=Hn()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bwe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ys(this.target,this.layout.layoutBox),IB(this.target,this.targetDelta)):ys(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const m=this.getClosestProjectingParent();m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?(this.relativeParent=m,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Hn(),this.relativeTargetOrigin=Hn(),em(this.relativeTargetOrigin,this.target,m.target),ys(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}jp&&Yu.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Sk(this.parent.latestValues)||RB(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let u=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Lr.timestamp&&(u=!1),u)return;const{layout:f,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(f||d))return;ys(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,m=this.treeScale.y;Xwe(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Hn());const{target:v}=a;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(SF(this.prevProjectionDelta.x,this.projectionDelta.x),SF(this.prevProjectionDelta.y,this.projectionDelta.y)),Jp(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==m||!OF(this.projectionDelta.x,this.prevProjectionDelta.x)||!OF(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v)),jp&&Yu.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)===null||a===void 0||a.scheduleRender(),o){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=of(),this.projectionDelta=of(),this.projectionDeltaWithTransform=of()}setAnimationOrigin(o,a=!1){const l=this.snapshot,u=l?l.latestValues:{},f={...this.latestValues},d=of();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const p=Hn(),m=l?l.source:void 0,v=this.layout?this.layout.source:void 0,_=m!==v,w=this.getStack(),x=!w||w.members.length<=1,S=!!(_&&!x&&this.options.crossfade===!0&&!this.path.some(Nxe));this.animationProgress=0;let C;this.mixTargetDelta=R=>{const P=R/1e3;NF(d.x,o.x,P),NF(d.y,o.y,P),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(em(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Mxe(this.relativeTarget,this.relativeTargetOrigin,p,P),C&&yxe(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=Hn()),ys(C,this.relativeTarget)),_&&(this.animationValues=f,fxe(f,u,this.latestValues,P,S,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=P},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&($a(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=_n.update(()=>{y0.hasAnimatedSinceResize=!0,this.currentAnimation=MB(0,DF,{...o,onUpdate:a=>{this.mixTargetDelta(a),o.onUpdate&&o.onUpdate(a)},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(DF),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:f}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&UB(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||Hn();const d=is(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+d;const p=is(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+p}ys(a,l),lf(a,f),Jp(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new bxe),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:a}=this.options;return a?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:a}=this.options;return a?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&fS("z",o,u,this.animationValues);for(let f=0;f<dS.length;f++)fS(`rotate${dS[f]}`,o,u,this.animationValues),fS(`skew${dS[f]}`,o,u,this.animationValues);o.render();for(const f in u)o.setStaticValue(f,u[f]),this.animationValues&&(this.animationValues[f]=u[f]);o.scheduleRender()}getProjectionStyles(o){var a,l;if(!this.instance||this.isSVG)return;if(!this.isVisible)return wxe;const u={visibility:""},f=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,u.opacity="",u.pointerEvents=g0(o?.pointerEvents)||"",u.transform=f?f(this.latestValues,""):"none",u;const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){const _={};return this.options.layoutId&&(_.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,_.pointerEvents=g0(o?.pointerEvents)||""),this.hasProjected&&!Zu(this.latestValues)&&(_.transform=f?f({},""):"none",this.hasProjected=!1),_}const p=d.animationValues||d.latestValues;this.applyTransformsToTarget(),u.transform=_xe(this.projectionDeltaWithTransform,this.treeScale,p),f&&(u.transform=f(p,u.transform));const{x:m,y:v}=this.projectionDelta;u.transformOrigin=`${m.origin*100}% ${v.origin*100}% 0`,d.animationValues?u.opacity=d===this?(l=(a=p.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&l!==void 0?l:1:this.preserveOpacity?this.latestValues.opacity:p.opacityExit:u.opacity=d===this?p.opacity!==void 0?p.opacity:"":p.opacityExit!==void 0?p.opacityExit:0;for(const _ in cb){if(p[_]===void 0)continue;const{correct:w,applyTo:x}=cb[_],S=u.transform==="none"?p[_]:w(p[_],d);if(x){const C=x.length;for(let R=0;R<C;R++)u[x[R]]=S}else u[_]=S}return this.options.layoutId&&(u.pointerEvents=d===this?g0(o?.pointerEvents)||"":"none"),u}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(AF),this.root.sharedNodes.clear()}}}function Sxe(e){e.updateLayout()}function Exe(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:s}=e.options,o=n.source!==e.layout.source;s==="size"?ws(d=>{const p=o?n.measuredBox[d]:n.layoutBox[d],m=is(p);p.min=r[d].min,p.max=p.min+m}):UB(s,n.layoutBox,r)&&ws(d=>{const p=o?n.measuredBox[d]:n.layoutBox[d],m=is(r[d]);p.max=p.min+m,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[d].max=e.relativeTarget[d].min+m)});const a=of();Jp(a,r,n.layoutBox);const l=of();o?Jp(l,e.applyTransform(i,!0),n.measuredBox):Jp(l,r,n.layoutBox);const u=!FB(a);let f=!1;if(!e.resumeFrom){const d=e.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:p,layout:m}=d;if(p&&m){const v=Hn();em(v,n.layoutBox,p.layoutBox);const _=Hn();em(_,r,m.layoutBox),$B(v,_)||(f=!0),d.options.layoutRoot&&(e.relativeTarget=_,e.relativeTargetOrigin=v,e.relativeParent=d)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeTargetChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function Cxe(e){jp&&Yu.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function kxe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Txe(e){e.clearSnapshot()}function AF(e){e.clearMeasurements()}function Pxe(e){e.isLayoutDirty=!1}function Rxe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function MF(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Ixe(e){e.resolveTargetDelta()}function Oxe(e){e.calcProjection()}
vendor: 6,637 bytes, line 82
82function Dxe(e){e.resetSkewAndRotation()}function Axe(e){e.removeLeadSnapshot()}function NF(e,t,n){e.translate=Dn(t.translate,0,n),e.scale=Dn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function jF(e,t,n,r){e.min=Dn(t.min,n.min,r),e.max=Dn(t.max,n.max,r)}function Mxe(e,t,n,r){jF(e.x,t.x,n.x,r),jF(e.y,t.y,n.y,r)}function Nxe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const jxe={duration:.45,ease:[.4,0,.1,1]},LF=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),FF=LF("applewebkit/")&&!LF("chrome/")?Math.round:es;function $F(e){e.min=FF(e.min),e.max=FF(e.max)}function Lxe(e){$F(e.x),$F(e.y)}function UB(e,t,n){return e==="position"||e==="preserve-aspect"&&!Uwe(IF(t),IF(n),.2)}function Fxe(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const $xe=VB({attachResizeListener:(e,t)=>jm(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),hS={current:void 0},BB=VB({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!hS.current){const e=new $xe({});e.mount(window),e.setOptions({layoutScroll:!0}),hS.current=e}return hS.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),zxe={pan:{Feature:ixe},drag:{Feature:rxe,ProjectionNode:BB,MeasureLayout:AB}};function zF(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const i="onHover"+n,s=r[i];s&&_n.postRender(()=>s(t,gg(t)))}class Vxe extends au{mount(){const{current:t}=this.node;t&&(this.unmount=Wbe(t,n=>(zF(this.node,n,"Start"),r=>zF(this.node,r,"End"))))}unmount(){}}class Uxe extends au{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=mg(jm(this.node.current,"focus",()=>this.onFocus()),jm(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function VF(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const i="onTap"+(n==="End"?"":n),s=r[i];s&&_n.postRender(()=>s(t,gg(t)))}class Bxe extends au{mount(){const{current:t}=this.node;t&&(this.unmount=Ybe(t,n=>(VF(this.node,n,"Start"),(r,{success:i})=>VF(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Ck=new WeakMap,pS=new WeakMap,Hxe=e=>{const t=Ck.get(e.target);t&&t(e)},qxe=e=>{e.forEach(Hxe)};function Wxe({root:e,...t}){const n=e||document;pS.has(n)||pS.set(n,{});const r=pS.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(qxe,{root:e,...t})),r[i]}function Gxe(e,t,n){const r=Wxe(t);return Ck.set(e,n),r.observe(e),()=>{Ck.delete(e),r.unobserve(e)}}const Kxe={some:0,all:1};class Zxe extends au{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:s}=t,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:Kxe[i]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:f,onViewportLeave:d}=this.node.getProps(),p=u?f:d;p&&p(l)};return Gxe(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Yxe(t,n))&&this.startObserver()}unmount(){}}function Yxe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const Qxe={inView:{Feature:Zxe},tap:{Feature:Bxe},focus:{Feature:Uxe},hover:{Feature:Vxe}},Xxe={layout:{ProjectionNode:BB,MeasureLayout:AB}},kk={current:null},HB={current:!1};function Jxe(){if(HB.current=!0,!!vR)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>kk.current=e.matches;e.addListener(t),t()}else kk.current=!1}const e1e=[...dB,Zr,Ql],t1e=e=>e1e.find(cB(e)),Vf=new WeakMap;function n1e(e,t,n){for(const r in t){const i=t[r],s=n[r];if(Ir(i))e.addValue(r,i);else if(Ir(s))e.addValue(r,$f(i,{owner:e}));else if(s!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,$f(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const UF=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class qB{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=HR,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=Ho.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,_n.render(this.render,!1,!0))};const{latestValues:l,renderState:u,onUpdate:f}=o;this.onUpdate=f,this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!s,this.isControllingVariants=D_(n),this.isVariantNode=y7(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:d,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const v=p[m];l[m]!==void 0&&Ir(v)&&v.set(l[m],!1)}}mount(t){this.current=t,Vf.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEac
vendor: 5,938 bytes, line 82
82h((n,r)=>this.bindToMotionValue(r,n)),HB.current||Jxe(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:kk.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Vf.delete(this.current),this.projection&&this.projection.unmount(),$a(this.notifyUpdate),$a(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=Lc.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&_n.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),s=n.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ff){const n=Ff[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Hn()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<UF.length;r++){const i=UF[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=n1e(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=$f(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(lB(i)||J7(i))?i=parseFloat(i):!t1e(i)&&Ql.test(n)&&(i=sB(t,n)),this.setBaseTarget(t,Ir(i)?i.get():i)),Ir(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const o=CR(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);o&&(i=o[t])}if(r&&i!==void 0)return i;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!Ir(s)?s:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new FR),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class WB extends qB{constructor(){super(...arguments),this.KeyframeResolver=fB}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ir(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function r1e(e){return window.getComputedStyle(e)}class GB extends WB{constructor(){super(...arguments),this.type="html",this.renderInstance=T7}readValueFromInstance(t,n){if(Lc.has(n)){const r=BR(n);return r&&r.default||0}else{const r=r1e(t),i=(E7(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return OB(t,n)}build(t,n,r){PR(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return DR(t,n,r)}}class KB extends WB{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Hn}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Lc.has(n)){const r=BR(n);return r&&r.default||0}return n=P7.has(n)?n:xR(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return O7(t,n,r)}build(t,n,r){RR(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){R7(t,n,r,i)}mount(t){this.isSVGTag=OR(t.tagName),super.mount(t)}}const i1e=(e,t)=>
82ER(e)?new KB(t):new GB(t,{allowProjection:e!==b.Fragment}),s1e=zbe({...Awe,...Qxe,...zxe,...Xxe},i1e),vb=tbe(s1e);function ZB(e){const t=fg(()=>$f(e)),{isStatic:n}=b.useContext(R_);if(n){const[,r]=b.useState(e);b.useEffect(()=>t.on("change",r),[])}return t}function YB(e,t){const n=ZB(t()),r=()=>n.set(t());return r(),yR(()=>{const i=()=>_n.preRender(r,!1,!0),s=e.map(o=>o.on("change",i));return()=>{s.forEach(o=>o()),$a(r)}}),n}const o1e=e=>e&&typeof e=="object"&&e.mix,a1e=e=>o1e(e)?e.mix:void 0;function l1e(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],i=e[1+n],s=e[2+n],o=e[3+n],a=bB(i,s,{mixer:a1e(s[0]),...o});return t?a(r):a}function u1e(e){Yp.current=[],e();const t=YB(Yp.current,e);return Yp.current=void 0,t}function BF(e,t,n,r){if(typeof e=="function")return u1e(e);const i=typeof t=="function"?t:l1e(t,n,r);return Array.isArray(e)?HF(e,i):HF([e],([s])=>i(s))}function HF(e,t){const n=fg(()=>[]);return YB(e,()=>{n.length=0;const r=e.length;for(let i=0;i<r;i++)n[i]=e[i].get();return t(n)})}const c1e=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e};function QB(e,t){return yB(e)?e[c1e(0,e.length,t)]:e}function YR(e){return typeof e=="object"&&!Array.isArray(e)}function XB(e,t,n,r){return typeof e=="string"&&YR(t)?$7(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e:[e]}function d1e(e,t,n){return e*(t+1)}function qF(e,t,n,r){var i;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:(i=r.get(t))!==null&&i!==void 0?i:e}function f1e(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(N_(e,i),r--)}}function h1e(e,t,n,r,i,s){f1e(e,i,s);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Dn(i,s,r[o]),easing:QB(n,o)})}function p1e(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function m1e(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const g1e="easeInOut";function v1e(e,{defaultTransition:t={},...n}={},r,i){const s=t.duration||.3,o=new Map,a=new Map,l={},u=new Map;let f=0,d=0,p=0;for(let m=0;m<e.length;m++){const v=e[m];if(typeof v=="string"){u.set(v,d);continue}else if(!Array.isArray(v)){u.set(v.name,qF(d,v.at,f,u));continue}let[_,w,x={}]=v;x.at!==void 0&&(d=qF(d,x.at,f,u));let S=0;const C=(R,P,k,I=0,D=0)=>{const L=y1e(R),{delay:A=0,times:$=wB(L),type:j="keyframes",repeat:V,repeatType:B,repeatDelay:H=0,...te}=P;let{ease:G=t.ease||"easeOut",duration:Z}=P;const Y=typeof A=="function"?A(I,D):A,M=L.length,q=M_(j)?j:i?.[j];if(M<=2&&q){let X=100;if(M===2&&w1e(L)){const se=L[1]-L[0];X=Math.abs(se)}const ne={...te};Z!==void 0&&(ne.duration=Vo(Z));const ae=Bbe(ne,X,q);G=ae.ease,Z=ae.duration}Z??(Z=s);const z=d+Y;$.length===1&&$[0]===0&&($[1]=1);const N=$.length-L.length;if(N>0&&_B($,N),L.length===1&&L.unshift(null),V){Z=d1e(Z,V);const X=[...L],ne=[...$];G=Array.isArray(G)?[...G]:[G];const ae=[...G];for(let se=0;se<V;se++){L.push(...X);for(let ce=0;ce<X.length;ce++)$.push(ne[ce]+(se+1)),G.push(ce===0?"linear":QB(ae,ce-1))}p1e($,V)}const ee=z+Z;h1e(k,L,G,$,z,ee),S=Math.max(Y+Z,S),p=Math.max(ee,p)};if(Ir(_)){const R=WF(_,a);C(w,x,GF("default",R))}else{const R=XB(_,w,r,l),P=R.length;for(let k=0;k<P;k++){w=w,x=x;const I=R[k],D=WF(I,a);for(const L in w)C(w[L],b1e(x,L),GF(L,D),k,P)}}f=d,d+=S}return a.forEach((m,v)=>{for(const _ in m){const w=m[_];w.sort(m1e);const x=[],S=[],C=[];for(let P=0;P<w.length;
82P++){const{at:k,value:I,easing:D}=w[P];x.push(I),S.push(wc(0,p,k)),C.push(D||"easeOut")}S[0]!==0&&(S.unshift(0),x.unshift(x[0]),C.unshift(g1e)),S[S.length-1]!==1&&(S.push(1),x.push(null)),o.has(v)||o.set(v,{keyframes:{},transition:{}});const R=o.get(v);R.keyframes[_]=x,R.transition[_]={...t,duration:p,ease:C,times:S,...n}}}),o}function WF(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function GF(e,t){return t[e]||(t[e]=[]),t[e]}function y1e(e){return Array.isArray(e)?e:[e]}function b1e(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const _1e=e=>typeof e=="number",w1e=e=>e.every(_1e);function x1e(e,t){return e in t}class S1e extends qB{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(x1e(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return Hn()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}function E1e(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=NB(e)?new KB(t):new GB(t);n.mount(e),Vf.set(e,n)}function C1e(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new S1e(t);n.mount(e),Vf.set(e,n)}function k1e(e,t){return Ir(e)||typeof e=="number"||typeof e=="string"&&!YR(t)}function JB(e,t,n,r){const i=[];if(k1e(e,t))i.push(MB(e,YR(t)&&t.default||t,n&&(n.default||n)));else{const s=XB(e,t,r),o=s.length;for(let a=0;a<o;a++){const l=s[a],u=l instanceof Element?E1e:C1e;Vf.has(l)||u(l);const f=Vf.get(l),d={...n};"delay"in d&&typeof d.delay=="function"&&(d.delay=d.delay(a,o)),i.push(...ZR(f,{...t,transition:d},{}))}}return i}function T1e(e,t,n){const r=[];return v1e(e,t,n,{spring:WR}).forEach(({keyframes:s,transition:o},a)=>{r.push(...JB(a,s,o))}),r}function P1e(e){return Array.isArray(e)&&e.some(Array.isArray)}function R1e(e){function t(n,r,i){let s=[];return P1e(n)?s=T1e(n,r,e):s=JB(n,r,i,e),new M7(s)}return t}const eH=R1e(),tH=b.createContext({dragDropManager:void 0});function bs(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var KF=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),ZF=function(){return Math.random().toString(36).substring(7).split("").join(".")},YF={INIT:"@@redux/INIT"+ZF(),REPLACE:"@@redux/REPLACE"+ZF()};function I1e(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function nH(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(bs(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(bs(1));return n(nH)(e,t)}if(typeof e!="function")throw new Error(bs(2));var i=e,s=t,o=[],a=o,l=!1;function u(){a===o&&(a=o.slice())}function f(){if(l)throw new Error(bs(3));return s}function d(_){if(typeof _!="function")throw new Error(bs(4));if(l)throw new Error(bs(5));var w=!0;return u(),a.push(_),function(){if(w){if(l)throw new Error(bs(6));w=!1,u();var S=a.indexOf(_);a.splice(S,1),o=null}}}function p(_){if(!I1e(_))throw new Error(bs(7));if(typeof _.type>"u")throw new Error(bs(8));if(l)throw new Error(bs(9));try{l=!0,s=i(s,_)}finally{l=!1}for(var w=o=a,x=0;x<w.length;x++){var S=w[x];S()}return _}function m(_){if(typeof _!="function")throw new Error(bs(10));i=_,p({type:YF.REPLACE})}function v(){var _,w=d;return _={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(bs(11));function C(){S.next&&S.next(f())}C();var R=w(C);return{unsubscribe:R}}},_[KF]=function(){return this},_}return p({type:YF.INIT}),r={dispatch:p,subscribe:d,getState:f,replaceReducer:m},r[KF]=v,r}function It(e,t,...n){if(O1e()&&t===void 0)throw new Error("invariant requires an error message argument");
82if(!e){let r;if(t===void 0)r=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let i=0;r=new Error(t.replace(/%s/g,function(){return n[i++]})),r.name="Invariant Violation"}throw r.framesToPop=1,r}}function O1e(){return typeof process<"u"&&!0}function D1e(e,t,n){return t.split(".").reduce((r,i)=>r&&r[i]?r[i]:n||null,e)}function A1e(e,t){return e.filter(n=>n!==t)}function rH(e){return typeof e=="object"}function M1e(e,t){const n=new Map,r=s=>{n.set(s,n.has(s)?n.get(s)+1:1)};e.forEach(r),t.forEach(r);const i=[];return n.forEach((s,o)=>{s===1&&i.push(o)}),i}function N1e(e,t){return e.filter(n=>t.indexOf(n)>-1)}const QR="dnd-core/INIT_COORDS",L_="dnd-core/BEGIN_DRAG",XR="dnd-core/PUBLISH_DRAG_SOURCE",F_="dnd-core/HOVER",$_="dnd-core/DROP",z_="dnd-core/END_DRAG";function QF(e,t){return{type:QR,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const j1e={type:QR,payload:{clientOffset:null,sourceClientOffset:null}};function L1e(e){return function(n=[],r={publishSource:!0}){const{publishSource:i=!0,clientOffset:s,getSourceClientOffset:o}=r,a=e.getMonitor(),l=e.getRegistry();e.dispatch(QF(s)),F1e(n,a,l);const u=V1e(n,a);if(u==null){e.dispatch(j1e);return}let f=null;if(s){if(!o)throw new Error("getSourceClientOffset must be defined");$1e(o),f=o(u)}e.dispatch(QF(s,f));const p=l.getSource(u).beginDrag(a,u);if(p==null)return;z1e(p),l.pinSource(u);const m=l.getSourceType(u);return{type:L_,payload:{itemType:m,item:p,sourceId:u,clientOffset:s||null,sourceClientOffset:f||null,isSourcePublic:!!i}}}}function F1e(e,t,n){It(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(r){It(n.getSource(r),"Expected sourceIds to be registered.")})}function $1e(e){It(typeof e=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function z1e(e){It(rH(e),"Item must be an object.")}function V1e(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}function U1e(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function B1e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){U1e(e,i,n[i])})}return e}function H1e(e){return function(n={}){const r=e.getMonitor(),i=e.getRegistry();q1e(r),K1e(r).forEach((o,a)=>{const l=W1e(o,a,i,r),u={type:$_,payload:{dropResult:B1e({},n,l)}};e.dispatch(u)})}}function q1e(e){It(e.isDragging(),"Cannot call drop while not dragging."),It(!e.didDrop(),"Cannot call drop twice during one drag operation.")}function W1e(e,t,n,r){const i=n.getTarget(e);let s=i?i.drop(r,e):void 0;return G1e(s),typeof s>"u"&&(s=t===0?{}:r.getDropResult()),s}function G1e(e){It(typeof e>"u"||rH(e),"Drop result must either be an object or undefined.")}function K1e(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}function Z1e(e){return function(){const n=e.getMonitor(),r=e.getRegistry();Y1e(n);const i=n.getSourceId();return i!=null&&(r.getSource(i,!0).endDrag(n,i),r.unpinSource()),{type:z_}}}function Y1e(e){It(e.isDragging(),"Cannot call endDrag while not dragging.")}function Tk(e,t){return t===null?e===null:Array.isArray(e)?e.some(n=>n===t):e===t}function Q1e(e){return function(n,{clientOffset:r}={}){X1e(n);const i=n.slice(0),s=e.getMonitor(),o=e.getRegistry(),a=s.getItemType();return eSe(i,o,a),J1e(i,s,o),tSe(i,s,o),{type:F_,payload:{targetIds:i,clientOffset:r||null}}}}function X1e(e){It(Array.isArray(e),"Expected targetIds to be an array.")}function J1e(e,t,n){It(t.isDragging(),"Cannot call hover while not dragging."),It(!t.didDrop(),"Cannot call hover after drop.");for(let r=0;r<e.length;r++){const i=e[r];It(e.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");const s=n.getTarget(i);It(s,"Expected targetIds to be registered.")}}function eSe(e,t,n){for(let r=e.length-1;r>=0;r--){const i=e[r],s=t.getTargetType(i);Tk(s,n)||e.splice(r,1)}}function tSe(e,t,n){e.forEach(function(r){n.getTarget(r).hover(t,r)})}function nSe(e){return function(){if(e.getMonitor().isDragging())return{type:XR}}}function rSe(e){return{beginDrag:L1e(e),publishDragSource:nSe(e),hover:Q1e(e),drop:H1e(e),endDrag:Z1e(e)}}class iSe{receiveBackend(t){this.backend=t}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const t=this,{dispatch:n}=this.store;function r(s){return(...o)=>{const a=s.apply(t,o);typeof a<"u"&&n(a)}}const i=rSe(this);return Object.keys(i).reduce((s,o)=>{const a=i[o];return s[o]=r(a),s},{})}dispatch(t){this.store.dispatch(t)}constructor(t,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=t,this.monitor=n,t.subscribe(this.handleRefCountChange)}}function sSe(e,t){return{x:e.x+t.x,y:e.y+t.y}}function iH(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oSe(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return!t||!n||!r?null:iH(sSe(t,r),n)}function aSe(e){const{clientOffset:t,initialClientOffset:n}=e;return!t||!n?null:iH(t,n)}const tm=[],JR=[];tm.__IS_NONE__=!0;JR.__IS_ALL__=!0;
82function lSe(e,t){return e===tm?!1:e===JR||typeof t>"u"?!0:N1e(t,e).length>0}class uSe{subscribeToStateChange(t,n={}){const{handlerIds:r}=n;It(typeof t=="function","listener must be a function."),It(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let i=this.store.getState().stateId;const s=()=>{const o=this.store.getState(),a=o.stateId;try{a===i||a===i+1&&!lSe(o.dirtyHandlerIds,r)||t()}finally{i=a}};return this.store.subscribe(s)}subscribeToOffsetChange(t){It(typeof t=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const i=this.store.getState().dragOffset;i!==n&&(n=i,t())};return this.store.subscribe(r)}canDragSource(t){if(!t)return!1;const n=this.registry.getSource(t);return It(n,`Expected to find a valid source. sourceId=${t}`),this.isDragging()?!1:n.canDrag(this,t)}canDropOnTarget(t){if(!t)return!1;const n=this.registry.getTarget(t);if(It(n,`Expected to find a valid target. targetId=${t}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(t),i=this.getItemType();return Tk(r,i)&&n.canDrop(this,t)}isDragging(){return!!this.getItemType()}isDraggingSource(t){if(!t)return!1;const n=this.registry.getSource(t,!0);if(It(n,`Expected to find a valid source. sourceId=${t}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(t),i=this.getItemType();return r!==i?!1:n.isDragging(this,t)}isOverTarget(t,n={shallow:!1}){if(!t)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const i=this.registry.getTargetType(t),s=this.getItemType();if(s&&!Tk(i,s))return!1;const o=this.getTargetIds();if(!o.length)return!1;const a=o.indexOf(t);return r?a===o.length-1:a>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return oSe(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return aSe(this.store.getState().dragOffset)}constructor(t,n){this.store=t,this.registry=n}}const XF=typeof global<"u"?global:self,sH=XF.MutationObserver||XF.WebKitMutationObserver;function oH(e){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),e()}}}function cSe(e){let t=1;const n=new sH(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}const dSe=typeof sH=="function"?cSe:oH;class fSe{enqueueTask(t){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=t}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:t}=this;for(;this.index<t.length;){const n=this.index;if(this.index++,t[n].call(),this.index>this.capacity){for(let r=0,i=t.length-this.index;r<i;r++)t[r]=t[r+this.index];t.length-=this.index,this.index=0}}t.length=0,this.index=0,this.flushing=!1},this.registerPendingError=t=>{this.pendingErrors.push(t),this.requestErrorThrow()},this.requestFlush=dSe(this.flush),this.requestErrorThrow=oH(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class hSe{call(){try{this.task&&this.task()}catch(t){this.onError(t)}finally{this.task=null,this.release(this)}}constructor(t,n){this.onError=t,this.release=n,this.task=null}}class pSe{create(t){const n=this.freeTasks,r=n.length?n.pop():new hSe(this.onError,i=>n[n.length]=i);return r.task=t,r}constructor(t){this.onError=t,this.freeTasks=[]}}const aH=new fSe,mSe=new pSe(aH.registerPendingError);function gSe(e){aH.enqueueTask(mSe.create(e))}const eI="dnd-core/ADD_SOURCE",tI="dnd-core/ADD_TARGET",nI="dnd-core/REMOVE_SOURCE",V_="dnd-core/REMOVE_TARGET";function vSe(e){return{type:eI,payload:{sourceId:e}}}function ySe(e){return{type:tI,payload:{targetId:e}}}function bSe(e){return{type:nI,payload:{sourceId:e}}}function _Se(e){return{type:V_,payload:{targetId:e}}}function wSe(e){It(typeof e.canDrag=="function","Expected canDrag to be a function."),It(typeof e.beginDrag=="function","Expected beginDrag to be a function."),It(typeof e.endDrag=="function","Expected endDrag to be a function.")}function xSe(e){It(typeof e.canDrop=="function","Expected canDrop to be a function."),It(typeof e.hover=="function","Expected hover to be a function."),It(typeof e.drop=="function","Expected beginDrag to be a function.")}function Pk(e,t){if(t&&Array.isArray(e)){e.forEach(n=>Pk(n,!1));return}It(typeof e=="string"||typeof e=="symbol",t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var Ts;(function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"})(Ts||(Ts={}));let SSe=0;function ESe(){return SSe++}function CSe(e){const t=ESe().toString();switch(e){case Ts.SOURCE:return`S${t}`;case Ts.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function JF(e){switch(e[0]){case"S":return Ts.SOURCE;case"T":return Ts.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function e4(e,t){const n=e.entries();let r=!1;do{const{done:i,value:[,s]}=n.next();if(s===t)return!0;r=!!i}while(!r);return!1}class kSe{addSource(t,n){Pk(t),wSe(n);const r=this.addHandler(Ts.SOURCE,t,n);return this.store.dispatch(vSe(r)),r}addTarget(t,n){Pk(t,!0),xSe(n);const r=this.addHandler(Ts.TARGET,t,n);return this.store.dispatch(ySe(r)),r}containsHandler(t){return e4(this.dragSources,t)||e4(this.dropTargets,t)}getSource(t,n=!1){return It(this.isSourceId(t),"Expected a valid source ID."),n&&t===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(t)}getTarget(t){return It(this.isTargetId(t),"Expected a valid target ID."),this.dropTargets.get(t)}getSourceType(t){return It(this.isSourceId(t),"Expected a valid source ID."),this.types.get(t)}getTargetType(t){return It(this.isTargetId(t),"Expected a valid target ID."),this.types.get(t)}isSourceId(t){return JF(t)===Ts.SOURCE}isTargetId(t){return JF(t)===Ts.TARGET}removeSource(t){It(this.getSource(t),"Expected an existing source."),this.store.dispatch(bSe(t)),gSe(()=>{this.dragSources.delete(t),this.types.delete(t)})}removeTarget(t){It(this.getTarget(t),"Expected an existing target."),this.store.dispatch(_Se(t)),this.dropTargets.delete(t),this.types.delete(t)}pinSource(t){const n=this.getSource(t);It(n,"Expected an existing source."),this.pinnedSourceId=t,this.pinnedSource=n}unpinSource(){It(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(t,n,r){const i=CSe(t);return this.types.set(i,n),t===Ts.SOURCE?this.dragSources.set(i,r):t===Ts.TARGET&&this.dropTargets.set(i,r),i}constructor(t){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=t}}const TSe=(e,t)=>e===t;function PSe(e,t){return!e&&!t?!0:!e||!t?!1:e.x===t.x&&e.y===t.y}function RSe(e,t,n=TSe){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}function ISe(e=tm,t){switch(t.type){case F_:break;case eI:case tI:case V_:case nI:return tm;case L_:case XR:case z_:case $_:default:return JR}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,i=M1e(n,r);if(!(i.length>
820||!RSe(n,r)))return tm;const o=r[r.length-1],a=n[n.length-1];return o!==a&&(o&&i.push(o),a&&i.push(a)),i}function OSe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function DSe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){OSe(e,i,n[i])})}return e}const t4={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function ASe(e=t4,t){const{payload:n}=t;switch(t.type){case QR:case L_:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case F_:return PSe(e.clientOffset,n.clientOffset)?e:DSe({},e,{clientOffset:n.clientOffset});case z_:case $_:return t4;default:return e}}function MSe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ed(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){MSe(e,i,n[i])})}return e}const NSe={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function jSe(e=NSe,t){const{payload:n}=t;switch(t.type){case L_:return Ed({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case XR:return Ed({},e,{isSourcePublic:!0});case F_:return Ed({},e,{targetIds:n.targetIds});case V_:return e.targetIds.indexOf(n.targetId)===-1?e:Ed({},e,{targetIds:A1e(e.targetIds,n.targetId)});case $_:return Ed({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case z_:return Ed({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}}function LSe(e=0,t){switch(t.type){case eI:case tI:return e+1;case nI:case V_:return e-1;default:return e}}function FSe(e=0){return e+1}function $Se(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zSe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){$Se(e,i,n[i])})}return e}function VSe(e={},t){return{dirtyHandlerIds:ISe(e.dirtyHandlerIds,{type:t.type,payload:zSe({},t.payload,{prevTargetIds:D1e(e,"dragOperation.targetIds",[])})}),dragOffset:ASe(e.dragOffset,t),refCount:LSe(e.refCount,t),dragOperation:jSe(e.dragOperation,t),stateId:FSe(e.stateId)}}function USe(e,t=void 0,n={},r=!1){const i=BSe(r),s=new uSe(i,new kSe(i)),o=new iSe(i,s),a=e(o,t,n);return o.receiveBackend(a),o}function BSe(e){const t=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return nH(VSe,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}function HSe(e,t){if(e==null)return{};var n=qSe(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qSe(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}let n4=0;const b0=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var lH=b.memo(function(t){var{children:n}=t,r=HSe(t,["children"]);const[i,s]=WSe(r);return b.useEffect(()=>{if(s){const o=uH();return++n4,()=>{--n4===0&&(o[b0]=null)}}},[]),g.jsx(tH.Provider,{value:i,children:n})});function WSe(e){if("manager"in e)return[{dragDropManager:e.manager},!1];const t=GSe(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}function GSe(e,t=uH(),n,r){const i=t;return i[b0]||(i[b0]={dragDropManager:USe(e,t,n,r)}),i[b0]}function uH(){return typeof global<"u"?global:window}const KSe=b.memo(function({connect:t,src:n}){return b.useEffect(()=>{if(typeof Image>"u")return;let r=!1;const i=new Image;return i.src=n,i.onload=()=>{t(i),r=!0},()=>{r&&t(null)}}),null});var mS,r4;function ZSe(){return r4||(r4=1,mS=function e(t,n){if(t===n)return!0;
82if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,s;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[i]))return!1;for(i=r;i--!==0;){var o=s[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}),mS}var YSe=ZSe();const cH=vo(YSe),xc=typeof window<"u"?b.useLayoutEffect:b.useEffect;function QSe(e,t,n){const[r,i]=b.useState(()=>t(e)),s=b.useCallback(()=>{const o=t(e);cH(r,o)||(i(o),n&&n())},[r,e,n]);return xc(s),[r,s]}function XSe(e,t,n){const[r,i]=QSe(e,t,n);return xc(function(){const o=e.getHandlerId();if(o!=null)return e.subscribeToStateChange(i,{handlerIds:[o]})},[e,i]),r}function dH(e,t,n){return XSe(t,e||(()=>({})),()=>n.reconnect())}function fH(e,t){const n=[...t||[]];return t==null&&typeof e!="function"&&n.push(e),b.useMemo(()=>typeof e=="function"?e():e,n)}function JSe(e){return b.useMemo(()=>e.hooks.dragSource(),[e])}function eEe(e){return b.useMemo(()=>e.hooks.dragPreview(),[e])}let gS=!1,vS=!1;class tEe{receiveHandlerId(t){this.sourceId=t}getHandlerId(){return this.sourceId}canDrag(){It(!gS,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return gS=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{gS=!1}}isDragging(){if(!this.sourceId)return!1;It(!vS,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return vS=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{vS=!1}}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}isDraggingSource(t){return this.internalMonitor.isDraggingSource(t)}isOverTarget(t,n){return this.internalMonitor.isOverTarget(t,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(t){return this.internalMonitor.subscribeToOffsetChange(t)}canDragSource(t){return this.internalMonitor.canDragSource(t)}canDropOnTarget(t){return this.internalMonitor.canDropOnTarget(t)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.sourceId=null,this.internalMonitor=t.getMonitor()}}let yS=!1;class nEe{receiveHandlerId(t){this.targetId=t}getHandlerId(){return this.targetId}subscribeToStateChange(t,n){return this.internalMonitor.subscribeToStateChange(t,n)}canDrop(){if(!this.targetId)return!1;It(!yS,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return yS=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{yS=!1}}isOver(t){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,t):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(t){this.targetId=null,this.internalMonitor=t.getMonitor()}}function rEe(e,t,n){const r=n.getRegistry(),i=r.addTarget(e,t);return[i,()=>r.removeTarget(i)]}function iEe(e,t,n){const r=n.getRegistry(),i=r.addSource(e,t);return[i,()=>r.removeSource(i)]}function Rk(e,t,n,r){let i;if(i!==void 0)return!!i;if(e===t)return!0;
82if(typeof e!="object"||!e||typeof t!="object"||!t)return!1;const s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;const a=Object.prototype.hasOwnProperty.bind(t);for(let l=0;l<s.length;l++){const u=s[l];if(!a(u))return!1;const f=e[u],d=t[u];if(i=void 0,i===!1||i===void 0&&f!==d)return!1}return!0}function Ik(e){return e!==null&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function sEe(e){if(typeof e.type=="string")return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}function oEe(e){return(t=null,n=null)=>{if(!b.isValidElement(t)){const s=t;return e(s,n),s}const r=t;return sEe(r),aEe(r,n?s=>e(s,n):e)}}function hH(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const i=oEe(r);t[n]=()=>i}}),t}function i4(e,t){typeof e=="function"?e(t):e.current=t}function aEe(e,t){const n=e.ref;return It(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?b.cloneElement(e,{ref:r=>{i4(n,r),i4(t,r)}}):b.cloneElement(e,{ref:t})}class lEe{receiveHandlerId(t){this.handlerId!==t&&(this.handlerId=t,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(t){this.dragSourceOptionsInternal=t}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(t){this.dragPreviewOptionsInternal=t}reconnect(){const t=this.reconnectDragSource();this.reconnectDragPreview(t)}reconnectDragSource(){const t=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?t?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=t,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,t,this.dragSourceOptions)),n):(this.lastConnectedDragSource=t,n):n}reconnectDragPreview(t=!1){const n=this.dragPreview,r=t||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Rk(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Rk(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(t){this.hooks=hH({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Ik(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Ik(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=t}}class uEe{get connectTarget(){return this.dropTarget}reconnect(){const t=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();t&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(t){t!==this.handlerId&&(this.handlerId=t,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(t){this.dropTargetOptionsInternal=t}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Rk(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}
82constructor(t){this.hooks=hH({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Ik(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=t}}function oh(){const{dragDropManager:e}=b.useContext(tH);return It(e!=null,"Expected drag drop context"),e}function cEe(e,t){const n=oh(),r=b.useMemo(()=>new lEe(n.getBackend()),[n]);return xc(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),xc(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}function dEe(){const e=oh();return b.useMemo(()=>new tEe(e),[e])}class fEe{beginDrag(){const t=this.spec,n=this.monitor;let r=null;return typeof t.item=="object"?r=t.item:typeof t.item=="function"?r=t.item(n):r={},r??null}canDrag(){const t=this.spec,n=this.monitor;return typeof t.canDrag=="boolean"?t.canDrag:typeof t.canDrag=="function"?t.canDrag(n):!0}isDragging(t,n){const r=this.spec,i=this.monitor,{isDragging:s}=r;return s?s(i):n===t.getSourceId()}endDrag(){const t=this.spec,n=this.monitor,r=this.connector,{end:i}=t;i&&i(n.getItem(),n),r.reconnect()}constructor(t,n,r){this.spec=t,this.monitor=n,this.connector=r}}function hEe(e,t,n){const r=b.useMemo(()=>new fEe(e,t,n),[t,n]);return b.useEffect(()=>{r.spec=e},[e]),r}function pEe(e){return b.useMemo(()=>{const t=e.type;
82return It(t!=null,"spec.type must be defined"),t},[e])}function mEe(e,t,n){const r=oh(),i=hEe(e,t,n),s=pEe(e);xc(function(){if(s!=null){const[a,l]=iEe(s,i,r);return t.receiveHandlerId(a),n.receiveHandlerId(a),l}},[r,t,n,i,s])}function gEe(e,t){const n=fH(e,t);It(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=dEe(),i=cEe(n.options,n.previewOptions);return mEe(n,r,i),[dH(n.collect,r,i),JSe(i),eEe(i)]}function vEe(e){return b.useMemo(()=>e.hooks.dropTarget(),[e])}function yEe(e){const t=oh(),n=b.useMemo(()=>new uEe(t.getBackend()),[t]);return xc(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}function bEe(){const e=oh();return b.useMemo(()=>new nEe(e),[e])}function _Ee(e){const{accept:t}=e;return b.useMemo(()=>(It(e.accept!=null,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}class wEe{canDrop(){const t=this.spec,n=this.monitor;return t.canDrop?t.canDrop(n.getItem(),n):!0}hover(){const t=this.spec,n=this.monitor;t.hover&&t.hover(n.getItem(),n)}drop(){const t=this.spec,n=this.monitor;if(t.drop)return t.drop(n.getItem(),n)}constructor(t,n){this.spec=t,this.monitor=n}}function xEe(e,t){const n=b.useMemo(()=>new wEe(e,t),[t]);return b.useEffect(()=>{n.spec=e},[e]),n}function SEe(e,t,n){const r=oh(),i=xEe(e,t),s=_Ee(e);xc(function(){const[a,l]=rEe(s,i,r);return t.receiveHandlerId(a),n.receiveHandlerId(a),l},[r,t,i,n,s.map(o=>o.toString()).join("|")])}function EEe(e,t){const n=fH(e,t),r=bEe(),i=yEe(n.options);return SEe(n,r,i),[dH(n.collect,r,i),vEe(i)]}function pH(e){let t=null;return()=>(t==null&&(t=e()),t)}function CEe(e,t){return e.filter(n=>n!==t)}function kEe(e,t){const n=new Set,r=s=>n.add(s);e.forEach(r),t.forEach(r);const i=[];return n.forEach(s=>i.push(s)),i}class TEe{enter(t){const n=this.entered.length,r=i=>this.isNodeInDocument(i)&&(!i.contains||i.contains(t));return this.entered=kEe(this.entered.filter(r),[t]),n===0&&this.entered.length>0}leave(t){const n=this.entered.length;return this.entered=CEe(this.entered.filter(this.isNodeInDocument),t),n>0&&this.entered.length===0}reset(){this.entered=[]}constructor(t){this.entered=[],this.isNodeInDocument=t}}class PEe{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(t=>{Object.defineProperty(this.item,t,{configurable:!0,enumerable:!0,get(){return console.warn(`Browser doesn't allow reading "${t}" until the drop event.`),null}})})}loadDataTransfer(t){if(t){const n={};Object.keys(this.config.exposeProperties).forEach(r=>{const i=this.config.exposeProperties[r];i!=null&&(n[r]={value:i(t,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,n)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(t,n){return n===t.getSourceId()}endDrag(){}constructor(t){this.config=t,this.item={},this.initializeExposedProperties()}}const mH="__NATIVE_FILE__",gH="__NATIVE_URL__",vH="__NATIVE_TEXT__",yH="__NATIVE_HTML__",s4=Object.freeze(Object.defineProperty({__proto__:null,FILE:mH,HTML:yH,TEXT:vH,URL:gH},Symbol.toStringTag,{value:"Module"}));function bS(e,t,n){const r=t.reduce((i,s)=>i||e.getData(s),"");return r??n}const Ok={[mH]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[yH]:{exposeProperties:{html:(e,t)=>
vendor: 7,142 bytes, lines 82-83
82bS(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[gH]:{exposeProperties:{urls:(e,t)=>bS(e,t,"").split(`
83`),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[vH]:{exposeProperties:{text:(e,t)=>bS(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function REe(e,t){const n=Ok[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new PEe(n);return r.loadDataTransfer(t),r}function _S(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(Ok).filter(n=>{const r=Ok[n];return r?.matchesTypes?r.matchesTypes.some(i=>t.indexOf(i)>-1):!1})[0]||null}const IEe=pH(()=>/firefox/i.test(navigator.userAgent)),bH=pH(()=>!!window.safari);class o4{interpolate(t){const{xs:n,ys:r,c1s:i,c2s:s,c3s:o}=this;let a=n.length-1;if(t===n[a])return r[a];let l=0,u=o.length-1,f;for(;l<=u;){f=Math.floor(.5*(l+u));const m=n[f];if(m<t)l=f+1;else if(m>t)u=f-1;else return r[f]}a=Math.max(0,u);const d=t-n[a],p=d*d;return r[a]+i[a]*d+s[a]*p+o[a]*d*p}constructor(t,n){const{length:r}=t,i=[];for(let m=0;m<r;m++)i.push(m);i.sort((m,v)=>t[m]<t[v]?-1:1);const s=[],o=[];let a,l;for(let m=0;m<r-1;m++)a=t[m+1]-t[m],l=n[m+1]-n[m],s.push(a),o.push(l/a);const u=[o[0]];for(let m=0;m<s.length-1;m++){const v=o[m],_=o[m+1];if(v*_<=0)u.push(0);else{a=s[m];const w=s[m+1],x=a+w;u.push(3*x/((x+w)/v+(x+a)/_))}}u.push(o[o.length-1]);const f=[],d=[];let p;for(let m=0;m<u.length-1;m++){p=o[m];const v=u[m],_=1/s[m],w=v+u[m+1]-p-p;f.push((p-v-w)*_),d.push(w*_*_)}this.xs=t,this.ys=n,this.c1s=u,this.c2s=f,this.c3s=d}}const OEe=1;function _H(e){const t=e.nodeType===OEe?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function Sy(e){return{x:e.clientX,y:e.clientY}}function DEe(e){var t;return e.nodeName==="IMG"&&(IEe()||!(!((t=document.documentElement)===null||t===void 0)&&t.contains(e)))}function AEe(e,t,n,r){let i=e?t.width:n,s=e?t.height:r;return bH()&&e&&(s/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:s}}function MEe(e,t,n,r,i){const s=DEe(t),a=_H(s?e:t),l={x:n.x-a.x,y:n.y-a.y},{offsetWidth:u,offsetHeight:f}=e,{anchorX:d,anchorY:p}=r,{dragPreviewWidth:m,dragPreviewHeight:v}=AEe(s,t,u,f),_=()=>{let k=new o4([0,.5,1],[l.y,l.y/f*v,l.y+v-f]).interpolate(p);return bH()&&s&&(k+=(window.devicePixelRatio-1)*v),k},w=()=>new o4([0,.5,1],[l.x,l.x/u*m,l.x+m-u]).interpolate(d),{offsetX:x,offsetY:S}=i,C=x===0||x,R=S===0||S;return{x:C?x:w(),y:R?S:_()}}let NEe=class{get window(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}get document(){var t;return!((t=this.globalContext)===null||t===void 0)&&t.document?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var t;return((t=this.optionsArgs)===null||t===void 0?void 0:t.rootElement)||this.window}constructor(t,n){this.ownerDocument=null,this.globalContext=t,this.optionsArgs=n}};function jEe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable}))),r.forEach(function(i){jEe(e,i,n[i])})}return e}class LEe{profile(){var t,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((t=this.dragStartSourceIds)===null||t===void 0?void 0:t.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const t=this.rootElement;if(t!==void 0){if(t.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");t.__isReactDndBackendSetUp=!0,this.addEventListeners(t)}}teardown(){const t=this.rootElement;if(t!==void 0&&(t.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDragSource(t,n,r){this.sourceNodes.set(t,n),this.sourceNodeOptions.set(t,r);const i=o=>this.handleDragStart(o,t),s=o=>this.handleSelectStart(o);return n.setAttribute("draggable","true"),n.addEventListener("dragstart",i),n.addEventListener("selectstart",s),()=>{this.sourceNodes.delete(t),this.sourceNodeOptions.delete(t),n.removeEventListener("dragstart",i),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}connectDropTarget(t,n){const r=o=>this.handleDragEnter(o,t),i=o=>this.handleDragOver(o,t),s=o=>this.handleDrop(o,t);return n.addEventListener("dragenter",r),n.addEventListener("dragover",i),n.addEventListener("drop",s),()=>{n.removeEventListener("dragenter",r),n.removeEventListener("dragover",i),n.removeEventListener("drop",s)}}addEventListeners(t){t.addEventListener&&(t.addEventListener("dragstart",this.handleTopDragStart),t.addEventListener("dragstart",this.handleTopDragStartCapture,!0),t.addEventListener("dragend",this.handleTopDragEndCapture,!0),t.addEventListener("dragenter",this.handleTopDragEnter),t.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.addEventListener("dragover",this.handleTopDragOver),t.addEventListener("dragover",this.handleTopDragOverCapture,!0),t.addEventListener("drop",this.handleTopDrop),t.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(t){t.removeEventListener&&(t.removeEventListener("dragstart",this.handleTopDragStart),t.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),t.removeEventListener("dragend",this.handleTopDragEndCapture,!0),t.removeEventListener("dragenter",this.handleTopDragEnter),t.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),t.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),t.removeEventListener("dragover",this.handleTopDragOver),t.removeEventListener("dragover",this.handleTopDragOverCapture,!0),t.removeEventListener("drop",this.handleTopDrop),t.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(t);return a4({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const t=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(t);
83return a4({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}isDraggingNativeItem(){const t=this.monitor.getItemType();return Object.keys(s4).some(n=>s4[n]===t)}beginDragNativeItem(t,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=REe(t,n),this.currentNativeHandle=this.registry.addSource(t,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(t){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=t;const n=1e3;this.mouseMoveTimeoutTimer=setTimeout(()=>{var r;return(r=this.rootElement)===null||r===void 0?void 0:r.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},n)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var t;(t=this.window)===null||t===void 0||t.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(t,n){t.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}handleDragEnter(t,n){this.dragEnterTargetIds.unshift(n)}handleDragOver(t,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}handleDrop(t,n){this.dropTargetIds.unshift(n)}constructor(t,n,r){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&_H(s)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=i=>!!(i&&this.document&&this.document.body&&this.document.body.contains(i)),this.endDragIfSourceWasRemovedFromDOM=()=>{const i=this.currentDragSourceNode;i==null||this.isNodeInDocument(i)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=i=>{this.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(i||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{this.hoverRafId!==null&&typeof cancelAnimationFrame<"u"&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=i=>{if(i.defaultPrevented)return;const{dragStartSourceIds:s}=this;this.dragStartSourceIds=null;const o=Sy(i);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(s||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:o});const{dataTransfer:a}=i,l=_S(a);if(this.monitor.isDragging()){if(a&&typeof a.setDragImage=="function"){const f=this.monitor.getSourceId(),d=this.sourceNodes.get(f),p=this.sourcePreviewNodes.get(f)||d;if(p){const{anchorX:m,anchorY:v,offsetX:_,offsetY:w}
83=this.getCurrentSourcePreviewNodeOptions(),C=MEe(d,p,o,{anchorX:m,anchorY:v},{offsetX:_,offsetY:w});a.setDragImage(p,C.x,C.y)}}try{a?.setData("application/json",{})}catch{}this.setCurrentDragSourceNode(i.target);const{captureDraggingState:u}=this.getCurrentSourcePreviewNodeOptions();u?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(l)this.beginDragNativeItem(l);else{if(a&&!a.types&&(i.target&&!i.target.hasAttribute||!i.target.hasAttribute("draggable")))return;i.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=i=>{if(this.dragEnterTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}if(!this.enterLeaveCounter.enter(i.target)||this.monitor.isDragging())return;const{dataTransfer:a}=i,l=_S(a);l&&this.beginDragNativeItem(l,a)},this.handleTopDragEnter=i=>{const{dragEnterTargetIds:s}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=i.altKey,s.length>0&&this.actions.hover(s,{clientOffset:Sy(i)}),s.some(a=>this.monitor.canDropOnTarget(a))&&(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=i=>{if(this.dragOverTargetIds=[],this.isDraggingNativeItem()){var s;(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}},this.handleTopDragOver=i=>{const{dragOverTargetIds:s}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging()){i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none");return}this.altKeyPressed=i.altKey,this.lastClientOffset=Sy(i),this.scheduleHover(s),(s||[]).some(a=>this.monitor.canDropOnTarget(a))?(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?i.preventDefault():(i.preventDefault(),i.dataTransfer&&(i.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=i=>{this.isDraggingNativeItem()&&i.preventDefault(),this.enterLeaveCounter.leave(i.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=i=>{if(this.dropTargetIds=[],this.isDraggingNativeItem()){var s;i.preventDefault(),(s=this.currentNativeSource)===null||s===void 0||s.loadDataTransfer(i.dataTransfer)}else _S(i.dataTransfer)&&i.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=i=>{const{dropTargetIds:s}=this;this.dropTargetIds=[],this.actions.hover(s,{clientOffset:Sy(i)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=i=>{const s=i.target;typeof s.dragDrop=="function"&&(s.tagName==="INPUT"||s.tagName==="SELECT"||s.tagName==="TEXTAREA"||s.isContentEditable||(i.preventDefault(),s.dragDrop()))},this.options=new NEe(n,r),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.registry=t.getRegistry(),this.enterLeaveCounter=new TEe(this.isNodeInDocument)}}const wH=function(t,n,r){return new LEe(t,n,r)};var Bl;(function(e){e.mouse="mouse",e.touch="touch",e.keyboard="keyboard"})(Bl||(Bl={}));class FEe{get delay(){var t;return(t=this.args.delay)!==null&&t!==void 0?t:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var t;return(t=this.args.ignoreContextMenu)!==null&&t!==void 0?t:!1}get enableHoverOutsideTarget(){var t;return(t=this.args.enableHoverOutsideTarget)!==null&&t!==void 0?t:!1}get enableKeyboardEvents(){var t;return(t=this.args.enableKeyboardEvents)!==null&&t!==void 0?t:!1}get enableMouseEvents(){var t;return(t=this.args.enableMouseEvents)!==null&&t!==void 0?t:!1}get enableTouchEvents(){var t;return(t=this.args.enableTouchEvents)!==null&&t!==void 0?t:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var t,n,r,i;return(i=(r=(t=this.args)===null||t===void 0?void 0:t.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get delayMouseStart(){var t,n,r,i;return(i=(r=(t=this.args)===null||t===void 0?void 0:t.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&i!==void 0?i:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}
vendor: 6,654 bytes, line 83
83get document(){var t;if(!((t=this.context)===null||t===void 0)&&t.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var t;return((t=this.args)===null||t===void 0?void 0:t.rootElement)||this.document}constructor(t,n){this.args=t,this.context=n}}function $Ee(e,t,n,r){return Math.sqrt(Math.pow(Math.abs(n-e),2)+Math.pow(Math.abs(r-t),2))}function zEe(e,t,n,r,i){if(!i)return!1;const s=Math.atan2(r-t,n-e)*180/Math.PI+180;for(let o=0;o<i.length;++o){const a=i[o];if(a&&(a.start==null||s>=a.start)&&(a.end==null||s<=a.end))return!0}return!1}const VEe={Left:1},UEe={Left:0};function wS(e){return e.button===void 0||e.button===UEe.Left}function BEe(e){return e.buttons===void 0||(e.buttons&VEe.Left)===0}function xH(e){return!!e.targetTouches}const HEe=1;function qEe(e){const t=e.nodeType===HEe?e:e.parentElement;if(!t)return;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function WEe(e,t){if(e.targetTouches.length===1)return yb(e.targetTouches[0]);if(t&&e.touches.length===1&&e.touches[0].target===t.target)return yb(e.touches[0])}function yb(e,t){return xH(e)?WEe(e,t):{x:e.clientX,y:e.clientY}}const l4=(()=>{let e=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return e=!0,!0}}))}catch{}return e})(),rp={[Bl.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Bl.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Bl.keyboard]:{keydown:"keydown"}};class nm{profile(){var t;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((t=this.dragOverTargetIds)===null||t===void 0?void 0:t.length)||0}}get document(){return this.options.document}setup(){const t=this.options.rootElement;t&&(It(!nm.isSetUp,"Cannot have two Touch backends at the same time."),nm.isSetUp=!0,this.addEventListener(t,"start",this.getTopMoveStartHandler()),this.addEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(t,"move",this.handleTopMove),this.addEventListener(t,"move",this.handleTopMoveCapture,!0),this.addEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(t,"keydown",this.handleCancelOnEscape,!0))}teardown(){const t=this.options.rootElement;t&&(nm.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(t,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(t,"start",this.handleTopMoveStart),this.removeEventListener(t,"move",this.handleTopMoveCapture,!0),this.removeEventListener(t,"move",this.handleTopMove),this.removeEventListener(t,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(t,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(t,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(t,n,r,i=!1){const s=l4?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=rp[o][n];a&&t.addEventListener(a,r,s)})}removeEventListener(t,n,r,i=!1){const s=l4?{capture:i,passive:!1}:i;this.listenerTypes.forEach(function(o){const a=rp[o][n];a&&t.removeEventListener(a,r,s)})}connectDragSource(t,n){const r=this.handleMoveStart.bind(this,t);return this.sourceNodes.set(t,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(t),this.removeEventListener(n,"start",r)}}connectDragPreview(t,n,r){return this.sourcePreviewNodeOptions.set(t,r),this.sourcePreviewNodes.set(t,n),()=>{this.sourcePreviewNodes.delete(t),this.sourcePreviewNodeOptions.delete(t)}}connectDropTarget(t,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const i=s=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(s.type){case rp.mouse.move:o={x:s.clientX,y:s.clientY};break;case rp.touch.move:var a,l;o={x:((a=s.touches[0])===null||a===void 0?void 0:a.clientX)||0,y:((l=s.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const u=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,f=u&&n.contains(u);if(u===n||f)return this.handleMove(s,t)};return this.addEventListener(this.document.body,"move",i),this.targetNodes.set(t,n),()=>{this.document&&(this.targetNodes.delete(t),this.removeEventListener(this.document.body,"move",i))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(t){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=t,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{t&&!t.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!t||!t.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(t.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(t,n,r){this.getSourceClientOffset=i=>{const s=this.sourceNodes.get(i);return s&&qEe(s)},this.handleTopMoveStartCapture=i=>{wS(i)&&(this.moveStartSourceIds=[])},this.handleMoveStart=i=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(i)},this.handleTopMoveStart=i=>{if(!wS(i))return;const s=yb(i);s&&(xH(i)&&(this.lastTargetTouchFallback=i.targetTouches[0]),this._mouseClientOffset=s),this.waitingForDelay=!1},this.handleTopMoveStartDelay=i=>{if(!wS(i))return;const s=i.type===rp.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,i),s),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(i,s)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(s)},this.handleTopMove=i=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:s,dragOverTargetIds:o}=this,a=this.options.enableHoverOutsideTarget,l=yb(i,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&zEe(this._mouseClientOffset.x||
830,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&s&&$Ee(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(s,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const u=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(u),this.actions.publishDragSource(),i.cancelable&&i.preventDefault();const f=(o||[]).map(v=>this.targetNodes.get(v)).filter(v=>!!v),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,f):this.document.elementsFromPoint(l.x,l.y),p=[];for(const v in d){if(!d.hasOwnProperty(v))continue;let _=d[v];for(_!=null&&p.push(_);_;)_=_.parentElement,_&&p.indexOf(_)===-1&&p.push(_)}const m=p.filter(v=>f.indexOf(v)>-1).map(v=>this._getDropTargetId(v)).filter(v=>!!v).filter((v,_,w)=>w.indexOf(v)===_);if(a)for(const v in this.targetNodes){const _=this.targetNodes.get(v);if(u&&_&&_.contains(u)&&m.indexOf(v)===-1){m.unshift(v);break}}m.reverse(),this.actions.hover(m,{clientOffset:l})},this._getDropTargetId=i=>{const s=this.targetNodes.keys();let o=s.next();for(;o.done===!1;){const a=o.value;if(i===this.targetNodes.get(a))return a;o=s.next()}},this.handleTopMoveEndCapture=i=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!BEe(i)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}i.cancelable&&i.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=i=>{i.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new FEe(r,n),this.actions=t.getActions(),this.monitor=t.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Bl.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Bl.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Bl.keyboard)}}const SH=function(t,n={},r={}){return new nm(t,n,r)},{createElement:Uf,createContext:GEe,forwardRef:EH,useCallback:Ri,useContext:CH,useEffect:uc,useImperativeHandle:kH,useLayoutEffect:KEe,useMemo:ZEe,useRef:Mi,useState:wf}=Ua,u4=Ua[`useId${Math.random()}`.slice(0,5)],YEe=KEe,U_=GEe(null);U_.displayName="PanelGroupContext";const cc=YEe,QEe=typeof u4=="function"?u4:()=>null;let XEe=0;function rI(e=null){const t=QEe(),n=Mi(e||t||null);return n.current===null&&(n.current=""+XEe++),e??n.current}function TH({children:e,className:t="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:s,id:o,maxSize:a,minSize:l,onCollapse:u,onExpand:f,onResize:d,order:p,style:m,tagName:v="div",..._}){const w=CH(U_);if(w===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:x,expandPanel:S,getPanelSize:C,getPanelStyle:R,groupId:P,isPanelCollapsed:k,reevaluatePanelConstraints:I,registerPanel:D,resizePanel:L,unregisterPanel:A}=w,$=rI(o),j=Mi({callbacks:{onCollapse:u,onExpand:f,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:a,minSize:l},id:$,idIsFromProps:o!==void 0,order:p});Mi({didLogMissingDefaultSizeWarning:!1}),cc(()=>{const{callbacks:B,constraints:H}=j.current,te={...H};j.current.id=$,j.current.idIsFromProps=o!==void 0,j.current.order=p,B.onCollapse=u,B.onExpand=f,B.onResize=d,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=a,H.minSize=l,(te.collapsedSize!==H.collapsedSize||te.collapsible!==H.collapsible||te.maxSize!==H.maxSize||te.minSize!==H.minSize)&&I(j.current,te)}),cc(()=>{const B=j.current;return D(B),()=>{A(B)}},[p,$,D,A]),kH(s,()=>({collapse:()=>{x(j.current)},expand:B=>{S(j.current,B)},getId(){return $},getSize(){return C(j.current)},isCollapsed(){return k(j.current)},isExpanded(){return!k(j.current)},resize:B=>{L(j.current,B)}}),[x,S,C,k,$,L]);const V=R(j.current,i);return Uf(v,{..._,children:e,className:t,id:o,style:{...V,...m},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":P,"data-
83panel-id":$,"data-panel-size":parseFloat(""+V.flexGrow).toFixed(1)})}const PH=EH((e,t)=>Uf(TH,{...e,forwardedRef:t}));TH.displayName="Panel";PH.displayName="forwardRef(Panel)";let Dk=null,oc=null;function JEe(e,t){if(t){const n=(t&AH)!==0,r=(t&MH)!==0,i=(t&NH)!==0,s=(t&jH)!==0;if(n)return i?"se-resize":s?"ne-resize":"e-resize";if(r)return i?"sw-resize":s?"nw-resize":"w-resize";if(i)return"s-resize";if(s)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function eCe(){oc!==null&&(document.head.removeChild(oc),Dk=null,oc=null)}function xS(e,t){const n=JEe(e,t);Dk!==n&&(Dk=n,oc===null&&(oc=document.createElement("style"),document.head.appendChild(oc)),oc.innerHTML=`*{cursor: ${n}!important;}`)}function RH(e){return e.type==="keydown"}function IH(e){return e.type.startsWith("pointer")}function OH(e){return e.type.startsWith("mouse")}function B_(e){if(IH(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(OH(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function tCe(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function nCe(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function rCe(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:f4(e),b:f4(t)};let r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Mt(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:d4(c4(n.a)),b:d4(c4(n.b))};if(i.a===i.b){const s=r.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let a=s.length;for(;a--;){const l=s[a];if(l===o.a)return 1;if(l===o.b)return-1}}return Math.sign(i.a-i.b)}const iCe=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function sCe(e){var t;const n=getComputedStyle((t=DH(e))!==null&&t!==void 0?t:e).display;return n==="flex"||n==="inline-flex"}function oCe(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||sCe(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||iCe.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function c4(e){let t=e.length;for(;t--;){const n=e[t];if(Mt(n,"Missing node"),oCe(n))return n}return null}function d4(e){return e&&Number(getComputedStyle(e).zIndex)||0}function f4(e){const t=[];for(;e;)t.push(e),e=DH(e);return t}function DH(e){const{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}const AH=1,MH=2,NH=4,jH=8,aCe=tCe()==="coarse";let lo=[],xf=!1,Dl=new Map,H_=new Map;const Lm=new Set;function lCe(e,t,n,r,i){var s;const{ownerDocument:o}=t,a={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},l=(s=Dl.get(o))!==null&&s!==void 0?s:0;return Dl.set(o,l+1),Lm.add(a),bb(),function(){var f;H_.delete(e),Lm.delete(a);const d=(f=Dl.get(o))!==null&&f!==void 0?f:1;if(Dl.set(o,d-1),bb(),d===1&&Dl.delete(o),lo.includes(a)){const p=lo.indexOf(a);p>=0&&lo.splice(p,1),sI(),i("up",!0,null)}}}function h4(e){const{target:t}=e,{x:n,y:r}=B_(e);xf=!0,iI({target:t,x:n,y:r}),bb(),lo.length>0&&(_b("down",e),e.preventDefault(),e.stopPropagation())}function ip(e){const{x:t,y:n}=B_(e);if(xf&&e.buttons===0&&(xf=!1,_b("up",e)),!xf){const{target:r}=e;iI({target:r,x:t,y:n})}_b("move",e),sI(),lo.length>0&&e.preventDefault()}function Cd(e){const{target:t}=e,{x:n,y:r}=B_(e);H_.clear(),xf=!1,lo.length>0&&e.preventDefault(),_b("up",e),iI({target:t,x:n,y:r}),sI(),bb()}function iI({target:e,x:t,y:n}){lo.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),Lm.forEach(i=>{const{element:s,hitAreaMargins:o}=i,a=s.getBoundingClientRect(),{bottom:l,left:u,right:f,top:d}=a,p=aCe?o.coarse:o.fine;if(t>=u-p&&t<=f+p&&n>=d-p&&n<=l+p){if(r!==null&&document.contains(r)&&s!==r&&!s.contains(r)&&!r.contains(s)&&rCe(r,s)>0){let v=r,_=!1;for(;v&&!v.contains(s);){if(nCe(v.getBoundingClientRect(),a)){_=!0;break}v=v.parentElement}if(_)return}lo.push(i)}})}function SS(e,t){H_.set(e,t)}function sI(){let e=!1,t=!1;lo.forEach(r=>{const{direction:i}=r;i==="horizontal"?e=!0:t=!0});let n=0;H_.forEach(r=>{n|=r}
83),e&&t?xS("intersection",n):e?xS("horizontal",n):t?xS("vertical",n):eCe()}function bb(){Dl.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",Cd),n.removeEventListener("pointerdown",h4),n.removeEventListener("pointerleave",ip),n.removeEventListener("pointermove",ip)}),window.removeEventListener("pointerup",Cd),window.removeEventListener("pointercancel",Cd),Lm.size>0&&(xf?(lo.length>0&&Dl.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",Cd),n.addEventListener("pointerleave",ip),n.addEventListener("pointermove",ip))}),window.addEventListener("pointerup",Cd),window.addEventListener("pointercancel",Cd)):Dl.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("pointerdown",h4,{capture:!0}),n.addEventListener("pointermove",ip))}))}function _b(e,t){Lm.forEach(n=>{const{setResizeHandlerState:r}=n,i=lo.includes(n);r(e,i,t)})}function uCe(){const[e,t]=wf(0);return Ri(()=>t(n=>n+1),[])}function Mt(e,t){if(!e)throw console.error(t),Error(t)}const oI=10;function Sc(e,t,n=oI){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function Oa(e,t,n=oI){return Sc(e,t,n)===0}function Zi(e,t,n){return Sc(e,t,n)===0}function cCe(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){const i=e[r],s=t[r];if(!Zi(i,s,n))return!1}return!0}function uf({panelConstraints:e,panelIndex:t,size:n}){const r=e[t];Mt(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:s,maxSize:o=100,minSize:a=0}=r;if(Sc(n,a)<0)if(s){const l=(i+a)/2;Sc(n,l)<0?n=i:n=a}else n=a;return n=Math.min(o,n),n=parseFloat(n.toFixed(oI)),n}function Lp({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:s}){if(Zi(e,0))return t;const o=[...t],[a,l]=r;Mt(a!=null,"Invalid first pivot index"),Mt(l!=null,"Invalid second pivot index");let u=0;if(s==="keyboard"){{const d=e<0?l:a,p=n[d];Mt(p,`Panel constraints not found for index ${d}`);const{collapsedSize:m=0,collapsible:v,minSize:_=0}=p;if(v){const w=t[d];if(Mt(w!=null,`Previous layout not found for panel index ${d}`),Zi(w,m)){const x=_-w;Sc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}{const d=e<0?a:l,p=n[d];Mt(p,`No panel constraints found for index ${d}`);const{collapsedSize:m=0,collapsible:v,minSize:_=0}=p;if(v){const w=t[d];if(Mt(w!=null,`Previous layout not found for panel index ${d}`),Zi(w,_)){const x=w-m;Sc(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const d=e<0?1:-1;let p=e<0?l:a,m=0;for(;;){const _=t[p];Mt(_!=null,`Previous layout not found for panel index ${p}`);const x=uf({panelConstraints:n,panelIndex:p,size:100})-_;if(m+=x,p+=d,p<0||p>=n.length)break}const v=Math.min(Math.abs(e),Math.abs(m));e=e<0?0-v:v}{let p=e<0?a:l;for(;p>=0&&p<n.length;){const m=Math.abs(e)-Math.abs(u),v=t[p];Mt(v!=null,`Previous layout not found for panel index ${p}`);const _=v-m,w=uf({panelConstraints:n,panelIndex:p,size:_});if(!Zi(v,w)&&(u+=v-w,o[p]=w,u.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?p--:p++}}if(cCe(i,o))return i;{const d=e<0?l:a,p=t[d];Mt(p!=null,`Previous layout not found for panel index ${d}`);const m=p+u,v=uf({panelConstraints:n,panelIndex:d,size:m});if(o[d]=v,!Zi(v,m)){let _=m-v,x=e<0?l:a;for(;x>=0&&x<n.length;){const S=o[x];Mt(S!=null,`Previous layout not found for panel index ${x}`);const C=S+_,R=uf({panelConstraints:n,panelIndex:x,size:C});if(Zi(S,R)||(_-=R-S,o[x]=R),Zi(_,0))break;e>0?x--:x++}}}const f=o.reduce((d,p)=>p+d,0);return Zi(f,100)?o:i}function dCe({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,s=0,o=0;const a=n[0];Mt(a!=null,"No pivot index found"),t.forEach((d,p)=>{const{constraints:m}=d,{maxSize:v=100,minSize:_=0}=m;p===a?(r=_,i=v):(s+=_,o+=v)});const l=Math.min(i,100-s),u=Math.max(r,100-o),f=e[a];return{valueMax:l,valueMin:u,valueNow:f}}function Fm(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function LH(e,t,n=document){const i=Fm(e,n).findIndex(s=>s.getAttribute("data-panel-resize-handle-id")===t);return i??null}function FH(e,t,n){const r=LH(e,t,n);return r!=null?[r,r+1]:[-1,-1]}function $H(e,t=document){var n;if(t instanceof HTMLElement&&(t==null||(n=t.dataset)===null||n===void 0?void 0:n.panelGroupId)==e)return t;
83const r=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return r||null}function q_(e,t=document){const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function fCe(e,t,n,r=document){var i,s,o,a;const l=q_(t,r),u=Fm(e,r),f=l?u.indexOf(l):-1,d=(i=(s=n[f])===null||s===void 0?void 0:s.id)!==null&&i!==void 0?i:null,p=(o=(a=n[f+1])===null||a===void 0?void 0:a.id)!==null&&o!==void 0?o:null;return[d,p]}function hCe({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:s,setLayout:o}){Mi({didWarnAboutMissingResizeHandle:!1}),cc(()=>{if(!s)return;const a=Fm(n,s);for(let l=0;l<i.length-1;l++){const{valueMax:u,valueMin:f,valueNow:d}=dCe({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),p=a[l];if(p!=null){const m=i[l];Mt(m,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",m.id),p.setAttribute("aria-valuemax",""+Math.round(u)),p.setAttribute("aria-valuemin",""+Math.round(f)),p.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{a.forEach((l,u)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,i,s]),uc(()=>{if(!s)return;const a=t.current;Mt(a,"Eager values not found");const{panelDataArray:l}=a,u=$H(n,s);Mt(u!=null,`No group found for id "${n}"`);const f=Fm(n,s);Mt(f,`No resize handles found for group id "${n}"`);const d=f.map(p=>{const m=p.getAttribute("data-panel-resize-handle-id");Mt(m,"Resize handle element has no handle id attribute");const[v,_]=fCe(n,m,l,s);if(v==null||_==null)return()=>{};const w=x=>{if(!x.defaultPrevented)switch(x.key){case"Enter":{x.preventDefault();const S=l.findIndex(C=>C.id===v);if(S>=0){const C=l[S];Mt(C,`No panel data found for index ${S}`);const R=r[S],{collapsedSize:P=0,collapsible:k,minSize:I=0}=C.constraints;if(R!=null&&k){const D=Lp({delta:Zi(R,P)?I-P:P-R,initialLayout:r,panelConstraints:l.map(L=>L.constraints),pivotIndices:FH(n,m,s),prevLayout:r,trigger:"keyboard"});r!==D&&o(D)}}break}}};return p.addEventListener("keydown",w),()=>{p.removeEventListener("keydown",w)}});return()=>{d.forEach(p=>p())}},[s,e,t,n,r,i,o])}function p4(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function zH(e,t){const n=e==="horizontal",{x:r,y:i}=B_(t);return n?r:i}function pCe(e,t,n,r,i){const s=n==="horizontal",o=q_(t,i);Mt(o,`No resize handle element found for id "${t}"`);const a=o.getAttribute("data-panel-group-id");Mt(a,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const u=zH(n,e),f=$H(a,i);Mt(f,`No group element found for id "${a}"`);const d=f.getBoundingClientRect(),p=s?d.width:d.height;return(u-l)/p*100}function mCe(e,t,n,r,i,s){if(RH(e)){const o=n==="horizontal";let a=0;e.shiftKey?a=100:i!=null?a=i:a=10;let l=0;switch(e.key){case"ArrowDown":l=o?0:a;break;case"ArrowLeft":l=o?-a:0;break;case"ArrowRight":l=o?a:0;break;case"ArrowUp":l=o?0:-a;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:pCe(e,t,n,r,s)}function gCe({panelDataArray:e}){const t=Array(e.length),n=e.map(s=>s.constraints);let r=0,i=100;for(let s=0;s<e.length;s++){const o=n[s];Mt(o,`Panel constraints not found for index ${s}`);const{defaultSize:a}=o;a!=null&&(r++,t[s]=a,i-=a)}for(let s=0;s<e.length;s++){const o=n[s];Mt(o,`Panel constraints not found for index ${s}`);const{defaultSize:a}=o;if(a!=null)continue;const l=e.length-r,u=i/l;r++,t[s]=u,i-=u}return t}function kd(e,t,n){t.forEach((r,i)=>{const s=e[i];Mt(s,`Panel data not found for index ${i}`);const{callbacks:o,constraints:a,id:l}=s,{collapsedSize:u=0,collapsible:f}=a,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:p,onExpand:m,onResize:v}=o;v&&v(r,d),f&&(p||m)&&(m&&(d==null||Oa(d,u))&&!Oa(r,u)&&m(),p&&(d==null||!Oa(d,u))&&Oa(r,u)&&p())}})}function Ey(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function vCe({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:s=3}){const o=n[i];let a;return o==null?a=e!=null?e.toPrecision(s):"1":r.length===1?a="1":a=o.toPrecision(s),{flexBasis:0,flexGrow:a,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function yCe(e,t=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...i)},t)}}function m4(e){try{if(typeof localStorage<"u")e.getItem=t=>
83localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function VH(e){return`react-resizable-panels:${e}`}function UH(e){return e.map(t=>{const{constraints:n,id:r,idIsFromProps:i,order:s}=t;return i?r:s?`${s}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function BH(e,t){try{const n=VH(e),r=t.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function bCe(e,t,n){var r,i;const s=(r=BH(e,n))!==null&&r!==void 0?r:{},o=UH(t);return(i=s[o])!==null&&i!==void 0?i:null}function _Ce(e,t,n,r,i){var s;const o=VH(e),a=UH(t),l=(s=BH(e,i))!==null&&s!==void 0?s:{};l[a]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(o,JSON.stringify(l))}catch(u){console.error(u)}}function g4({layout:e,panelConstraints:t}){const n=[...e],r=n.reduce((s,o)=>s+o,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(s=>`${s}%`).join(", ")}`);if(!Zi(r,100)&&n.length>0)for(let s=0;s<t.length;s++){const o=n[s];Mt(o!=null,`No layout data found for index ${s}`);const a=100/r*o;n[s]=a}let i=0;for(let s=0;s<t.length;s++){const o=n[s];Mt(o!=null,`No layout data found for index ${s}`);const a=uf({panelConstraints:t,panelIndex:s,size:o});o!=a&&(i+=o-a,n[s]=a)}if(!Zi(i,0))for(let s=0;s<t.length;s++){const o=n[s];Mt(o!=null,`No layout data found for index ${s}`);const a=o+i,l=uf({panelConstraints:t,panelIndex:s,size:a});if(o!==l&&(i-=l-o,n[s]=l,Zi(i,0)))break}return n}const wCe=100,Fp={getItem:e=>(m4(Fp),Fp.getItem(e)),setItem:(e,t)=>{m4(Fp),Fp.setItem(e,t)}},v4={};function HH({autoSaveId:e=null,children:t,className:n="",direction:r,forwardedRef:i,id:s=null,onLayout:o=null,keyboardResizeBy:a=null,storage:l=Fp,style:u,tagName:f="div",...d}){const p=rI(s),m=Mi(null),[v,_]=wf(null),[w,x]=wf([]),S=uCe(),C=Mi({}),R=Mi(new Map),P=Mi(0),k=Mi({autoSaveId:e,direction:r,dragState:v,id:p,keyboardResizeBy:a,onLayout:o,storage:l}),I=Mi({layout:w,panelDataArray:[],panelDataArrayChanged:!1});Mi({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),kH(i,()=>({getId:()=>k.current.id,getLayout:()=>{const{layout:N}=I.current;return N},setLayout:N=>{const{onLayout:ee}=k.current,{layout:X,panelDataArray:ne}=I.current,ae=g4({layout:N,panelConstraints:ne.map(se=>se.constraints)});p4(X,ae)||(x(ae),I.current.layout=ae,ee&&ee(ae),kd(ne,ae,C.current))}}),[]),cc(()=>{k.current.autoSaveId=e,k.current.direction=r,k.current.dragState=v,k.current.id=p,k.current.onLayout=o,k.current.storage=l}),hCe({committedValuesRef:k,eagerValuesRef:I,groupId:p,layout:w,panelDataArray:I.current.panelDataArray,setLayout:x,panelGroupElement:m.current}),uc(()=>{const{panelDataArray:N}=I.current;if(e){if(w.length===0||w.length!==N.length)return;let ee=v4[e];ee==null&&(ee=yCe(_Ce,wCe),v4[e]=ee);const X=[...N],ne=new Map(R.current);ee(e,X,ne,w,l)}},[e,w,l]),uc(()=>{});const D=Ri(N=>{const{onLayout:ee}=k.current,{layout:X,panelDataArray:ne}=I.current;if(N.constraints.collapsible){const ae=ne.map(ke=>ke.constraints),{collapsedSize:se=0,panelSize:ce,pivotIndices:fe}=$u(ne,N,X);if(Mt(ce!=null,`Panel size not found for panel "${N.id}"`),!Oa(ce,se)){R.current.set(N.id,ce);const Ce=Gd(ne,N)===ne.length-1?ce-se:se-ce,Se=Lp({delta:Ce,initialLayout:X,panelConstraints:ae,pivotIndices:fe,prevLayout:X,trigger:"imperative-api"});Ey(X,Se)||(x(Se),I.current.layout=Se,ee&&ee(Se),kd(ne,Se,C.current))}}},[]),L=Ri((N,ee)=>{const{onLayout:X}=k.current,{layout:ne,panelDataArray:ae}=I.current;if(N.constraints.collapsible){const se=ae.map(Fe=>Fe.constraints),{collapsedSize:ce=0,panelSize:fe=0,minSize:ke=0,pivotIndices:Ce}=$u(ae,N,ne),Se=ee??ke;if(Oa(fe,ce)){const Fe=R.current.get(N.id),Be=Fe!=null&&Fe>=Se?Fe:Se,ht=Gd(ae,N)===ae.length-1?fe-Be:Be-fe,W=Lp({delta:ht,initialLayout:ne,panelConstraints:se,pivotIndices:Ce,prevLayout:ne,trigger:"imperative-api"});Ey(ne,W)||(x(W),I.current.layout=W,X&&X(W),kd(ae,W,C.current))}}},[]),A=Ri(N=>{const{layout:ee,panelDataArray:X}=I.current,{panelSize:ne}=$u(X,N,ee);return Mt(ne!=null,`Panel size not found for panel "${N.id}"`),ne},[]),$=Ri((N,ee)=>{const{panelDataArray:X}=I.current,ne=Gd(X,N);return vCe({defaultSize:ee,dragState:v,layout:w,panelData:X,panelIndex:ne})},[v,w]),j=Ri(N=>{const{layout:ee,panelDataArray:X}=I.current,{collapsedSize:ne=0,collapsible:ae,panelSize:se}=$u(X,N,ee);return Mt(se!=null,`Panel size not found for panel "${N.id}"`),ae===!0&&Oa(se,ne)},[]),V=Ri(N=>{const{layout:ee,panelDataArray:X}=I.current,{collapsedSize:ne=0,collapsible:ae,panelSize:se}=$u(X,N,ee);return Mt(se!=null,`Panel size not found for panel "${N.id}"`),!ae||Sc(se,ne)>0},[]),B=Ri(N=>{const{panelDataArray:ee}=I.current;ee.push(N),ee.sort((X,ne)=>{const ae=X.order,se=ne.order;return ae==null&&se==null?0:ae==null?-1:se==null?1:ae-se}),I.current.panelDataArrayChanged=!0,S()},[S]);cc(()=>
83{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:N,onLayout:ee,storage:X}=k.current,{layout:ne,panelDataArray:ae}=I.current;let se=null;if(N){const fe=bCe(N,ae,X);fe&&(R.current=new Map(Object.entries(fe.expandToSizes)),se=fe.layout)}se==null&&(se=gCe({panelDataArray:ae}));const ce=g4({layout:se,panelConstraints:ae.map(fe=>fe.constraints)});p4(ne,ce)||(x(ce),I.current.layout=ce,ee&&ee(ce),kd(ae,ce,C.current))}}),cc(()=>{const N=I.current;return()=>{N.layout=[]}},[]);const H=Ri(N=>{let ee=!1;const X=m.current;return X&&window.getComputedStyle(X,null).getPropertyValue("direction")==="rtl"&&(ee=!0),function(ae){ae.preventDefault();const se=m.current;if(!se)return()=>null;const{direction:ce,dragState:fe,id:ke,keyboardResizeBy:Ce,onLayout:Se}=k.current,{layout:Fe,panelDataArray:Be}=I.current,{initialLayout:wt}=fe??{},ht=FH(ke,N,se);let W=mCe(ae,N,ce,fe,Ce,se);const ie=ce==="horizontal";ie&&ee&&(W=-W);const ue=Be.map(xe=>xe.constraints),Re=Lp({delta:W,initialLayout:wt??Fe,panelConstraints:ue,pivotIndices:ht,prevLayout:Fe,trigger:RH(ae)?"keyboard":"mouse-or-touch"}),Ee=!Ey(Fe,Re);(IH(ae)||OH(ae))&&P.current!=W&&(P.current=W,!Ee&&W!==0?ie?SS(N,W<0?AH:MH):SS(N,W<0?NH:jH):SS(N,0)),Ee&&(x(Re),I.current.layout=Re,Se&&Se(Re),kd(Be,Re,C.current))}},[]),te=Ri((N,ee)=>{const{onLayout:X}=k.current,{layout:ne,panelDataArray:ae}=I.current,se=ae.map(Fe=>Fe.constraints),{panelSize:ce,pivotIndices:fe}=$u(ae,N,ne);Mt(ce!=null,`Panel size not found for panel "${N.id}"`);const Ce=Gd(ae,N)===ae.length-1?ce-ee:ee-ce,Se=Lp({delta:Ce,initialLayout:ne,panelConstraints:se,pivotIndices:fe,prevLayout:ne,trigger:"imperative-api"});Ey(ne,Se)||(x(Se),I.current.layout=Se,X&&X(Se),kd(ae,Se,C.current))},[]),G=Ri((N,ee)=>{const{layout:X,panelDataArray:ne}=I.current,{collapsedSize:ae=0,collapsible:se}=ee,{collapsedSize:ce=0,collapsible:fe,maxSize:ke=100,minSize:Ce=0}=N.constraints,{panelSize:Se}=$u(ne,N,X);Se!=null&&(se&&fe&&Oa(Se,ae)?Oa(ae,ce)||te(N,ce):Se<Ce?te(N,Ce):Se>ke&&te(N,ke))},[te]),Z=Ri((N,ee)=>{const{direction:X}=k.current,{layout:ne}=I.current;if(!m.current)return;const ae=q_(N,m.current);Mt(ae,`Drag handle element not found for id "${N}"`);const se=zH(X,ee);_({dragHandleId:N,dragHandleRect:ae.getBoundingClientRect(),initialCursorPosition:se,initialLayout:ne})},[]),Y=Ri(()=>{_(null)},[]),M=Ri(N=>{const{panelDataArray:ee}=I.current,X=Gd(ee,N);X>=0&&(ee.splice(X,1),delete C.current[N.id],I.current.panelDataArrayChanged=!0,S())},[S]),q=ZEe(()=>({collapsePanel:D,direction:r,dragState:v,expandPanel:L,getPanelSize:A,getPanelStyle:$,groupId:p,isPanelCollapsed:j,isPanelExpanded:V,reevaluatePanelConstraints:G,registerPanel:B,registerResizeHandle:H,resizePanel:te,startDragging:Z,stopDragging:Y,unregisterPanel:M,panelGroupElement:m.current}),[D,v,r,L,A,$,p,j,V,G,B,H,te,Z,Y,M]),z={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Uf(U_.Provider,{value:q},Uf(f,{...d,children:t,className:n,id:s,ref:m,style:{...z,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const qH=EH((e,t)=>Uf(HH,{...e,forwardedRef:t}));HH.displayName="PanelGroup";qH.displayName="forwardRef(PanelGroup)";function Gd(e,t){return e.findIndex(n=>n===t||n.id===t.id)}function $u(e,t,n){const r=Gd(e,t),s=r===e.length-1?[r-1,r]:[r,r+1],o=n[r];return{...t.constraints,panelSize:o,pivotIndices:s}}function xCe({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){uc(()=>{if(e||n==null||r==null)return;const i=q_(t,r);
83if(i==null)return;const s=o=>{if(!o.defaultPrevented)switch(o.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{o.preventDefault(),n(o);break}case"F6":{o.preventDefault();const a=i.getAttribute("data-panel-group-id");Mt(a,`No group element found for id "${a}"`);const l=Fm(a,r),u=LH(a,t,r);Mt(u!==null,`No resize element found for id "${t}"`);const f=o.shiftKey?u>0?u-1:l.length-1:u+1<l.length?u+1:0;l[f].focus();break}}};return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}},[r,e,t,n])}function WH({children:e=null,className:t="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:s,onDragging:o,onFocus:a,style:l={},tabIndex:u=0,tagName:f="div",...d}){var p,m;const v=Mi(null),_=Mi({onDragging:o});uc(()=>{_.current.onDragging=o});const w=CH(U_);if(w===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:x,groupId:S,registerResizeHandle:C,startDragging:R,stopDragging:P,panelGroupElement:k}=w,I=rI(i),[D,L]=wf("inactive"),[A,$]=wf(!1),[j,V]=wf(null),B=Mi({state:D});cc(()=>{B.current.state=D}),uc(()=>{if(n)V(null);else{const Z=C(I);V(()=>Z)}},[n,I,C]);const H=(p=r?.coarse)!==null&&p!==void 0?p:15,te=(m=r?.fine)!==null&&m!==void 0?m:5;return uc(()=>{if(n||j==null)return;const Z=v.current;return Mt(Z,"Element ref not attached"),lCe(I,Z,x,{coarse:H,fine:te},(M,q,z)=>{if(q)switch(M){case"down":{L("drag"),Mt(z,'Expected event to be defined for "down" action'),R(I,z);const{onDragging:N}=_.current;N&&N(!0);break}case"move":{const{state:N}=B.current;N!=="drag"&&L("hover"),Mt(z,'Expected event to be defined for "move" action'),j(z);break}case"up":{L("hover"),P();const{onDragging:N}=_.current;N&&N(!1);break}}else L("inactive")})},[H,x,n,te,C,I,j,R,P]),xCe({disabled:n,handleId:I,resizeHandler:j,panelGroupElement:k}),Uf(f,{...d,children:e,className:t,id:i,onBlur:()=>{$(!1),s?.()},onFocus:()=>{$(!0),a?.()},ref:v,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:u,"data-panel-group-direction":x,"data-panel-group-id":S,"data-resize-handle":"","data-resize-handle-active":D==="drag"?"pointer":A?"keyboard":void 0,"data-resize-handle-state":D,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":I})}WH.displayName="PanelResizeHandle";const GH=({className:e,...t})=>g.jsx(qH,{className:_e("flex size-full data-[panel-group-direction=vertical]:flex-col",e),...t}),wb=PH,KH=({withHandle:e,handle:t,className:n,...r})=>g.jsx(WH,{className:_e("relative flex w-px items-center justify-center bg-border transition-colors hover:bg-foreground
83/40 after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",n),...r,children:e&&g.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:t??g.jsx(vre,{className:"size-2.5"})})}),dc=Jf("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}}),fn=b.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const o=r?XP:"button";return g.jsx(o,{className:_e(dc({variant:t,size:n,className:e})),ref:s,...i})});fn.displayName="Button";var Cy={},y4;function SCe(){if(y4)return Cy;y4=1,Cy.match=s,Cy.parse=o;var e=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,t=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,n=/^(?:(min|max)-)?(.+)/,r=/(em|rem|px|cm|mm|in|pt|pc)?$/,i=/(dpi|dpcm|dppx)?$/;function s(f,d){return o(f).some(function(p){var m=p.inverse,v=p.type==="all"||d.type===p.type;if(v&&m||!(v||m))return!1;var _=p.expressions.every(function(w){var x=w.feature,S=w.modifier,C=w.value,R=d[x];if(!R)return!1;switch(x){case"orientation":case"scan":return R.toLowerCase()===C.toLowerCase();case"width":case"height":case"device-width":case"device-height":C=u(C),R=u(R);break;case"resolution":C=l(C),R=l(R);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":C=a(C),R=a(R);break;case"grid":case"color":case"color-index":case"monochrome":C=parseInt(C,10)||1,R=parseInt(R,10)||0;break}switch(S){case"min":return R>=C;case"max":return R<=C;default:return R===C}});return _&&!m||!_&&m})}function o(f){return f.split(",").map(function(d){d=d.trim();var p=d.match(e),m=p[1],v=p[2],_=p[3]||"",w={};return w.inverse=!!m&&m.toLowerCase()==="not",w.type=v?v.toLowerCase():"all",_=_.match(/\([^\)]+\)/g)||[],w.expressions=_.map(function(x){var S=x.match(t),C=S[1].toLowerCase().match(n);return{modifier:C[1],feature:C[2],value:S[2]}}),w})}function a(f){var d=Number(f),p;return d||(p=f.match(/^(\d+)\s*\/\s*(\d+)$/),d=p[1]/p[2]),d}function l(f){var d=parseFloat(f),p=String(f).match(i)[1];switch(p){case"dpcm":return d/2.54;case"dppx":return d*96;default:return d}}function u(f){var d=parseFloat(f),p=String(f).match(r)[1];switch(p){case"em":return d*16;case"rem":return d*16;case"cm":return d*96/2.54;case"mm":return d*96/2.54/10;case"in":return d*96;case"pt":return d*72;case"pc":return d*72/12;default:return d}}return Cy}var ES,b4;function ECe(){if(b4)return ES;b4=1;var e=SCe().match,t=typeof window<"u"?window.matchMedia:null;function n(i,s,o){var a=this,l;t&&!o&&(l=t.call(window,i)),l?(this.matches=l.matches,this.media=l.media,l.addListener(d)):(this.matches=e(i,s),this.media=i),this.addListener=u,this.removeListener=f,this.dispose=p;function u(m){l&&l.addListener(m)}function f(m){l&&l.removeListener(m)}function d(m){a.matches=m.matches,a.media=m.media}function p(){l&&l.removeListener(d)}}function r(i,s,o){return new n(i,s,o)}return ES=r,ES}var CCe=ECe();const kCe=vo(CCe);var TCe=/[A-Z]/g,PCe=/^ms-/,CS={};function RCe(e){return"-"+e.toLowerCase()}function ZH(e){if(CS.hasOwnProperty(e))return CS[e];var t=e.replace(TCe,RCe);return CS[e]=PCe.test(t)?"-"+t:t}function ICe(e,t){if(e===t)return!0;
83if(!e||!t)return!1;const n=Object.keys(e),r=Object.keys(t),i=n.length;if(r.length!==i)return!1;for(let s=0;s<i;s++){const o=n[s];if(e[o]!==t[o]||!Object.prototype.hasOwnProperty.call(t,o))return!1}return!0}var kS={exports:{}},TS,_4;function OCe(){if(_4)return TS;_4=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return TS=e,TS}var PS,w4;function DCe(){if(w4)return PS;w4=1;var e=OCe();function t(){}function n(){}return n.resetWarningCache=t,PS=function(){function r(o,a,l,u,f,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},PS}var x4;function ACe(){return x4||(x4=1,kS.exports=DCe()()),kS.exports}var MCe=ACe();const St=vo(MCe),di=St.oneOfType([St.string,St.number]),YH={all:St.bool,grid:St.bool,aural:St.bool,braille:St.bool,handheld:St.bool,print:St.bool,projection:St.bool,screen:St.bool,tty:St.bool,tv:St.bool,embossed:St.bool},NCe={orientation:St.oneOf(["portrait","landscape"]),scan:St.oneOf(["progressive","interlace"]),aspectRatio:St.string,deviceAspectRatio:St.string,height:di,deviceHeight:di,width:di,deviceWidth:di,color:St.bool,colorIndex:St.bool,monochrome:St.bool,resolution:di,type:Object.keys(YH)},{type:gHe,...jCe}=NCe,LCe={minAspectRatio:St.string,maxAspectRatio:St.string,minDeviceAspectRatio:St.string,maxDeviceAspectRatio:St.string,minHeight:di,maxHeight:di,minDeviceHeight:di,maxDeviceHeight:di,minWidth:di,maxWidth:di,minDeviceWidth:di,maxDeviceWidth:di,minColor:St.number,maxColor:St.number,minColorIndex:St.number,maxColorIndex:St.number,minMonochrome:St.number,maxMonochrome:St.number,minResolution:di,maxResolution:di,...jCe},FCe={...YH,...LCe};var $Ce={all:FCe};const zCe=e=>`not ${e}`,VCe=(e,t)=>{const n=ZH(e);return typeof t=="number"&&(t=`${t}px`),t===!0?n:t===!1?zCe(n):`(${n}: ${t})`},UCe=e=>e.join(" and "),BCe=e=>{const t=[];return Object.keys($Ce.all).forEach(n=>{const r=e[n];r!=null&&t.push(VCe(n,r))}),UCe(t)},HCe=b.createContext(void 0),qCe=e=>e.query||BCe(e),S4=e=>e?Object.keys(e).reduce((n,r)=>(n[ZH(r)]=e[r],n),{}):void 0,QH=()=>{const e=b.useRef(!1);return b.useEffect(()=>{e.current=!0},[]),e.current},WCe=e=>{const t=b.useContext(HCe),n=()=>S4(e)||S4(t),[r,i]=b.useState(n);return b.useEffect(()=>{const s=n();ICe(r,s)||i(s)},[e,t]),r},GCe=e=>{const t=()=>qCe(e),[n,r]=b.useState(t);return b.useEffect(()=>{const i=t();n!==i&&r(i)},[e]),n},KCe=(e,t)=>{const n=()=>kCe(e,t||{},!!t),[r,i]=b.useState(n),s=QH();return b.useEffect(()=>{if(s){const o=n();return i(o),()=>{o&&o.dispose()}}},[e,t]),r},ZCe=e=>{const[t,n]=b.useState(e.matches);return b.useEffect(()=>{const r=i=>{n(i.matches)};return e.addListener(r),n(e.matches),()=>{e.removeListener(r)}},[e]),t},aI=(e,t,n)=>{const r=WCe(t),i=GCe(e);if(!i)throw new Error("Invalid or missing MediaQuery!");const s=KCe(i,r),o=ZCe(s);return QH(),b.useEffect(()=>{},[o]),b.useEffect(()=>()=>{s&&s.dispose()},[]),o};function ah(){return aI({maxWidth:767.98})}function lI(){return aI({maxWidth:1023.98})}function XH(){return aI({query:"(pointer: coarse)"})}const qo={name:"Mentes AI",mainNav:[{title:"Apps",children:[{title:"Links",description:"All your links in one place",href:"/",disabled:!0},{title:"Collections",description:"Group your links",href:"/collections"},{title:"Tags",description:"Organize your links",href:"/tags"},{title:"Knowledge Graph",description:"Visualize your knowledge graphs",href:"/knowledge-graph"}]},{title:"Settings",children:[{title:"App Settings",description:"Crawl websites and save links",href:"/settings"}]},{title:"Pricing",children:[{title:"Free",description:"Get started for free",href:"/pricing/free"},{title:"Pro",description:"Upgrade for more features",href:"/pricing/pro"}]},{title:"Subscription",href:"/subscription"}],links:{twitter:"https://twitter.com/mentesdotai",discord:"https://discord.gg/ENpDFVybBu",feedback:"https://mentesai.featurebase.app"}};var YCe=Object.defineProperty,JH=(e,t)=>YCe(e,"name",{value:t,configurable:!0}),E4="horizontal",QCe=["horizontal","vertical"],XCe=b.forwardRef(JH(function(t,n){const{decorative:r,orientation:i=E4,...s}=t,o=eq(i)?i:E4,l=r?{role:"none"}:{"aria-orientation":o==="vertical"?o:void 0,role:"separator"};return g.jsx(Vt.div,{"data-orientation":o,...l,...s,ref:n})},"Separator"));function eq(e){return QCe.includes(e)}JH(eq,"isValidOrientation");var tq=XCe;const uI=b.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},i)=>g.jsx(tq,{ref:i,decorative:n,orientation:t,className:_e("shrink-0 bg-border",t==="horizontal"?"h-px w-full":"h-full w-px",e),...r}));uI.displayName=tq.displayName;var JCe=Object.defineProperty,eke=(e,t)=>JCe(e,"name",{value:t,configurable:!0}),tke=b.createContext(void 0);function vg(e){const t=b.useContext(tke);return e||t||"ltr"}eke(vg,"useDirection");var nke=Object.defineProperty,rke=(e,t)=>nke(e,"name",{value:t,configurable:!0});function xb(e,[t,n]){return Math.min(n,Math.max(t,e))}rke(xb,"clamp");var ike=Object.defineProperty,Ht=(e,t)=>
83ike(e,"name",{value:t,configurable:!0});function nq(e,t){return b.useReducer((n,r)=>t[n][r]??n,e)}Ht(nq,"useStateMachine");var rq="ScrollArea",[iq,vHe]=$s(rq),[ske,zs]=iq(rq),oke=b.forwardRef(Ht(function(t,n){const{__scopeScrollArea:r,type:i="hover",dir:s,scrollHideDelay:o=600,...a}=t,[l,u]=b.useState(null),[f,d]=b.useState(null),[p,m]=b.useState(null),[v,_]=b.useState(null),[w,x]=b.useState(null),[S,C]=b.useState(0),[R,P]=b.useState(0),[k,I]=b.useState(!1),[D,L]=b.useState(!1),A=At(n,u),$=vg(s);return g.jsx(ske,{scope:r,type:i,dir:$,scrollHideDelay:o,scrollArea:l,viewport:f,onViewportChange:d,content:p,onContentChange:m,scrollbarX:v,onScrollbarXChange:_,scrollbarXEnabled:k,onScrollbarXEnabledChange:I,scrollbarY:w,onScrollbarYChange:x,scrollbarYEnabled:D,onScrollbarYEnabledChange:L,onCornerWidthChange:C,onCornerHeightChange:P,children:g.jsx(Vt.div,{dir:$,...a,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":S+"px","--radix-scroll-area-corner-height":R+"px",...t.style}})})},"ScrollArea")),ake="ScrollAreaViewport",lke=b.forwardRef(Ht(function(t,n){const{__scopeScrollArea:r,children:i,nonce:s,...o}=t,a=zs(ake,r),l=b.useRef(null),u=At(n,l,a.onViewportChange);return g.jsxs(g.Fragment,{children:[g.jsx(uke,{nonce:s}),g.jsx(Vt.div,{"data-radix-scroll-area-viewport":"",...o,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t.style},children:g.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})},"ScrollAreaViewport")),uke=b.memo(Ht(function({nonce:t}){return g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:t})},"ScrollAreaViewportStyle"),(e,t)=>e.nonce===t.nonce),qa="ScrollAreaScrollbar",sq=b.forwardRef(Ht(function(t,n){const{forceMount:r,...i}=t,s=zs(qa,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:a}=s,l=t.orientation==="horizontal";return b.useEffect(()=>(l?o(!0):a(!0),()=>{l?o(!1):a(!1)}),[l,o,a]),s.type==="hover"?g.jsx(cke,{...i,ref:n,forceMount:r}):s.type==="scroll"?g.jsx(dke,{...i,ref:n,forceMount:r}):s.type==="auto"?g.jsx(oq,{...i,ref:n,forceMount:r}):s.type==="always"?g.jsx(cI,{...i,ref:n,"data-state":"visible"}):null},"ScrollAreaScrollbar")),cke=b.forwardRef(Ht(function(t,n){const{forceMount:r,...i}=t,s=zs(qa,t.__scopeScrollArea),[o,a]=b.useState(!1);return b.useEffect(()=>{const l=s.scrollArea;let u=0;if(l){const f=Ht(()=>{window.clearTimeout(u),a(!0)},"handlePointerEnter"),d=Ht(()=>{u=window.setTimeout(()=>a(!1),s.scrollHideDelay)},"handlePointerLeave");return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(u),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",d)}}},[s.scrollArea,s.scrollHideDelay]),g.jsx(as,{present:r||o,children:g.jsx(oq,{"data-state":o?"visible":"hidden",...i,ref:n})})},"ScrollAreaScrollbarHover")),dke=b.forwardRef(Ht(function(t,n){const{forceMount:r,...i}=t,s=zs(qa,t.__scopeScrollArea),o=t.orientation==="horizontal",a=bg(()=>u("SCROLL_END"),100),[l,u]=nq("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return b.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>u("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,s.scrollHideDelay,u]),b.useEffect(()=>{const f=s.viewport,d=o?"scrollLeft":"scrollTop";if(f){let p=f[d];const m=Ht(()=>{const v=f[d];p!==v&&(u("SCROLL"),a()),p=v},"handleScroll");return f.addEventListener("scroll",m),()=>f.removeEventListener("scroll",m)}},[s.viewport,o,u,a]),g.jsx(as,{present:r||l!=="hidden",children:g.jsx(cI,{"data-state":l==="hidden"?"hidden":"visible",...i,ref:n,onPointerEnter:Ue(t.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:Ue(t.onPointerLeave,()=>u("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),oq=b.forwardRef(Ht(function(t,n){const r=zs(qa,t.__scopeScrollArea),{forceMount:i,...s}=t,[o,a]=b.useState(!1),l=t.orientation==="horizontal",u=bg(()=>{if(r.viewport){const f=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;a(l?f:d)}},10);return Ec(r.viewport,u),Ec(r.content,u),g.jsx(as,{present:i||o,children:g.jsx(cI,{"data-state":o?"visible":"hidden",...s,ref:n})})},"ScrollAreaScrollbarAuto")),cI=b.forwardRef(Ht(function(t,n){const{orientation:r="vertical",...i}=t,s=zs(qa,t.__scopeScrollArea),o=b.useRef(null),a=b.useRef(0),[l,u]=b.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=dI(l.viewport,l.content),d={...i,sizes:l,onSizesChange:u,hasThumb:f>0&&f<1,onThumbChange:Ht(m=>o.current=m,"onThumbChange"),onThumbPointerUp:Ht(()=>a.current=0,"onThumbPointerUp"),onThumbPointerDown:Ht(m=>a.current=m,"onThumbPointerDown")};function p(m,v){return cq(m,a.current,l,v)}return Ht(p,"getScrollPosition"),r==="horizontal"?g.jsx(fke,{...d,ref:n,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollLeft,v=Mk(m,l,s.dir);o.current.style.transform=`translate3d(${v}px, 0, 0)`}}
83,onWheelScroll:m=>{s.viewport&&(s.viewport.scrollLeft=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollLeft=p(m,s.dir))}}):r==="vertical"?g.jsx(hke,{...d,ref:n,onThumbPositionChange:()=>{if(s.viewport&&o.current){const m=s.viewport.scrollTop,v=Mk(m,l);o.current.style.transform=`translate3d(0, ${v}px, 0)`}},onWheelScroll:m=>{s.viewport&&(s.viewport.scrollTop=m)},onDragScroll:m=>{s.viewport&&(s.viewport.scrollTop=p(m))}}):null},"ScrollAreaScrollbarVisible")),fke=b.forwardRef(Ht(function(t,n){const{sizes:r,onSizesChange:i,...s}=t,o=zs(qa,t.__scopeScrollArea),[a,l]=b.useState(),u=b.useRef(null),f=At(n,u,o.onScrollbarXChange);return b.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),g.jsx(lq,{"data-orientation":"horizontal",...s,ref:f,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":yg(r)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;t.onWheelScroll(m),hI(m,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&i({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:$m(a.paddingLeft),paddingEnd:$m(a.paddingRight)}})}})},"ScrollAreaScrollbarX")),hke=b.forwardRef(Ht(function(t,n){const{sizes:r,onSizesChange:i,...s}=t,o=zs(qa,t.__scopeScrollArea),[a,l]=b.useState(),u=b.useRef(null),f=At(n,u,o.onScrollbarYChange);return b.useEffect(()=>{u.current&&l(getComputedStyle(u.current))},[u]),g.jsx(lq,{"data-orientation":"vertical",...s,ref:f,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":yg(r)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;t.onWheelScroll(m),hI(m,p)&&d.preventDefault()}},onResize:()=>{u.current&&o.viewport&&a&&i({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:$m(a.paddingTop),paddingEnd:$m(a.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[pke,aq]=iq(qa),lq=b.forwardRef(Ht(function(t,n){const{__scopeScrollArea:r,sizes:i,hasThumb:s,onThumbChange:o,onThumbPointerUp:a,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:d,onResize:p,...m}=t,v=zs(qa,r),[_,w]=b.useState(null),x=At(n,w),S=b.useRef(null),C=b.useRef(""),R=v.viewport,P=i.content-i.viewport,k=Sr(d),I=Sr(u),D=bg(p,10);function L(A){if(S.current){const $=A.clientX-S.current.left,j=A.clientY-S.current.top;f({x:$,y:j})}}return Ht(L,"handleDragScroll"),b.useEffect(()=>{const A=Ht($=>{const j=$.target;_?.contains(j)&&k($,P)},"handleWheel");return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[R,_,P,k]),b.useEffect(I,[i,I]),Ec(_,D),Ec(v.content,D),g.jsx(pke,{scope:r,scrollbar:_,hasThumb:s,onThumbChange:Sr(o),onThumbPointerUp:Sr(a),onThumbPositionChange:I,onThumbPointerDown:Sr(l),children:g.jsx(Vt.div,{...m,ref:x,style:{position:"absolute",...m.style},onPointerDown:Ue(t.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),S.current=_.getBoundingClientRect(),C.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",v.viewport&&(v.viewport.style.scrollBehavior="auto"),L(A))}),onPointerMove:Ue(t.onPointerMove,L),onPointerUp:Ue(t.onPointerUp,A=>{const $=A.target;$.hasPointerCapture(A.pointerId)&&$.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=C.current,v.viewport&&(v.viewport.style.scrollBehavior=""),S.current=null})})})},"ScrollAreaScrollbarImpl")),Ak="ScrollAreaThumb",mke=b.forwardRef(Ht(function(t,n){const{forceMount:r,...i}=t,s=aq(Ak,t.__scopeScrollArea);return g.jsx(as,{present:r||s.hasThumb,children:g.jsx(gke,{ref:n,...i})})},"ScrollAreaThumb")),gke=b.forwardRef(Ht(function(t,n){const{__scopeScrollArea:r,style:i,...s}=t,o=zs(Ak,r),a=aq(Ak,r),{onThumbPositionChange:l}=a,u=At(n,a.onThumbChange),f=b.useRef(void 0),d=bg(()=>{f.current&&(f.current(),f.current=void 0)},100);return b.useEffect(()=>{const p=o.viewport;if(p){const m=Ht(()=>{if(d(),!f.current){const v=bke(p,l);f.current=v,l()}},"handleScroll");return l(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[o.viewport,d,l]),g.jsx(Vt.div,{"data-state":a.hasThumb?"visible":"hidden",...s,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:Ue(t.onPointerDownCapture,p=>{const v=p.target.getBoundingClientRect(),_=p.clientX-v.left,w=p.clientY-v.top;a.onThumbPointerDown({x:_,y:w}
83)}),onPointerUp:Ue(t.onPointerUp,a.onThumbPointerUp)})},"ScrollAreaThumbImpl")),uq="ScrollAreaCorner",vke=b.forwardRef(Ht(function(t,n){const r=zs(uq,t.__scopeScrollArea),i=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&i?g.jsx(yke,{...t,ref:n}):null},"ScrollAreaCorner")),yke=b.forwardRef(Ht(function(t,n){const{__scopeScrollArea:r,...i}=t,s=zs(uq,r),[o,a]=b.useState(0),[l,u]=b.useState(0),f=!!(o&&l),{onCornerWidthChange:d,onCornerHeightChange:p}=s;return Ec(s.scrollbarX,()=>{const m=s.scrollbarX?.offsetHeight||0;s.onCornerHeightChange(m),u(m)}),Ec(s.scrollbarY,()=>{const m=s.scrollbarY?.offsetWidth||0;s.onCornerWidthChange(m),a(m)}),b.useEffect(()=>()=>{d(0),p(0)},[d,p]),f?g.jsx(Vt.div,{...i,ref:n,style:{width:o,height:l,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null},"ScrollAreaCornerImpl"));function $m(e){return e?parseInt(e,10):0}Ht($m,"toInt");function dI(e,t){const n=e/t;return isNaN(n)?0:n}Ht(dI,"getThumbRatio");function yg(e){const t=dI(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}Ht(yg,"getThumbSize");function cq(e,t,n,r="ltr"){const i=yg(n),s=i/2,o=t||s,a=i-o,l=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-a,f=n.content-n.viewport,d=r==="ltr"?[0,f]:[f*-1,0];return fI([l,u],d)(e)}Ht(cq,"getScrollPositionFromPointer");function Mk(e,t,n="ltr"){const r=yg(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,o=t.content-t.viewport,a=s-r,l=n==="ltr"?[0,o]:[o*-1,0],u=xb(e,l);return fI([0,o],[0,a])(u)}Ht(Mk,"getThumbOffsetFromScroll");function fI(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}Ht(fI,"linearScale");function hI(e,t){return e>0&&e<t}Ht(hI,"isScrollingWithinScrollbarBounds");var bke=Ht((e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return Ht((function i(){const s={left:e.scrollLeft,top:e.scrollTop},o=n.left!==s.left,a=n.top!==s.top;(o||a)&&t(),n=s,r=window.requestAnimationFrame(i)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function bg(e,t){const n=Sr(e),r=b.useRef(0);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),b.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}Ht(bg,"useDebounceCallback");function Ec(e,t){const n=Sr(t);$n(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}Ht(Ec,"useResizeObserver");var dq=oke,_ke=lke,wke=vke;const Cc=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(dq,{ref:r,className:_e("relative overflow-hidden",e),...n,children:[g.jsx(_ke,{className:"size-full rounded-[inherit]",children:t}),g.jsx(fq,{}),g.jsx(wke,{})]}));Cc.displayName=dq.displayName;const fq=b.forwardRef(({className:e,orientation:t="vertical",...n},r)=>g.jsx(sq,{ref:r,orientation:t,className:_e("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-px",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-px",e),...n,children:g.jsx(mke,{className:"relative flex-1 rounded-full bg-border dark:bg-neutral-700"})}));fq.displayName=sq.displayName;function xke(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Ske=["color"],Eke=b.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,i=xke(e,Ske);return b.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i,{ref:t}),b.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07451 1.82584C5.03267 1.81926 4.99014 1.81825 4.94803 1.82284C4.10683 1.91446 2.82673 2.36828 2.07115 2.77808C2.02106 2.80525 1.97621 2.84112 1.93869 2.88402C1.62502 3.24266 1.34046 3.82836 1.11706 4.38186C0.887447 4.95076 0.697293 5.55032 0.588937 5.98354C0.236232 7.39369 0.042502 9.08728 0.0174948 10.6925C0.0162429 10.7729 0.0351883 10.8523 0.0725931 10.9234C0.373679 11.496 1.02015 12.027 1.66809 12.4152C2.32332 12.8078 3.08732 13.1182 3.70385 13.1778C3.85335 13.1922 4.00098 13.1358 4.10282 13.0255C4.2572 12.8581 4.5193 12.4676 4.71745 12.1643C4.80739 12.0267 4.89157 11.8953 4.95845 11.7901C5.62023 11.9106 6.45043 11.9801 7.50002 11.9801C8.54844 11.9801 9.37796 11.9107 10.0394 11.7905C10.1062 11.8957 10.1903 12.0269 10.2801 12.1643C10.4783 12.4676 10.7404 12.8581 10.8947 13.0255C10.9966 13.1358 11.1442 13.1922 11.2937 13.1778C11.9102 13.1182 12.6742 12.8078 13.3295 12.4152C13.9774 12.027 14.6239 11.496 14.925 10.9234C14.9624 10.8523 14.9813 10.7729 14.9801 10.6925C14.9551 9.08728 14.7613 7.39369 14.4086 5.98354C14.3003 5.55032 14.1101 4.95076 13.8805 4.38186C13.6571 3.82836 13.3725 3.24266 13.0589 2.88402C13.0214 2.84112 12.976
835 2.80525 12.9264 2.77808C12.1708 2.36828 10.8907 1.91446 10.0495 1.82284C10.0074 1.81825 9.96489 1.81926 9.92305 1.82584C9.71676 1.85825 9.5391 1.96458 9.40809 2.06355C9.26977 2.16804 9.1413 2.29668 9.0304 2.42682C8.86968 2.61544 8.71437 2.84488 8.61428 3.06225C8.27237 3.03501 7.90138 3.02 7.5 3.02C7.0977 3.02 6.72593 3.03508 6.38337 3.06244C6.28328 2.84501 6.12792 2.61549 5.96716 2.42682C5.85626 2.29668 5.72778 2.16804 5.58947 2.06355C5.45846 1.96458 5.2808 1.85825 5.07451 1.82584ZM11.0181 11.5382C11.0395 11.5713 11.0615 11.6051 11.0838 11.6392C11.2169 11.843 11.3487 12.0385 11.4508 12.1809C11.8475 12.0916 12.352 11.8818 12.8361 11.5917C13.3795 11.2661 13.8098 10.8918 14.0177 10.5739C13.9852 9.06758 13.7993 7.50369 13.4773 6.21648C13.38 5.82759 13.2038 5.27021 12.9903 4.74117C12.7893 4.24326 12.5753 3.82162 12.388 3.5792C11.7376 3.24219 10.7129 2.88582 10.0454 2.78987C10.0308 2.79839 10.0113 2.81102 9.98675 2.82955C9.91863 2.881 9.84018 2.95666 9.76111 3.04945C9.71959 3.09817 9.68166 3.1471 9.64768 3.19449C9.953 3.25031 10.2253 3.3171 10.4662 3.39123C11.1499 3.6016 11.6428 3.89039 11.884 4.212C12.0431 4.42408 12.0001 4.72494 11.788 4.884C11.5759 5.04306 11.2751 5.00008 11.116 4.788C11.0572 4.70961 10.8001 4.4984 10.1838 4.30877C9.58933 4.12585 8.71356 3.98 7.5 3.98C6.28644 3.98 5.41067 4.12585 4.81616 4.30877C4.19988 4.4984 3.94279 4.70961 3.884 4.788C3.72494 5.00008 3.42408 5.04306 3.212 4.884C2.99992 4.72494 2.95694 4.42408 3.116 4.212C3.35721 3.89039 3.85011 3.6016 4.53383 3.39123C4.77418 3.31727 5.04571 3.25062 5.35016 3.19488C5.31611 3.14738 5.27808 3.09831 5.23645 3.04945C5.15738 2.95666 5.07893 2.881 5.01081 2.82955C4.98628 2.81102 4.96674 2.79839 4.95217 2.78987C4.28464 2.88582 3.25999 3.24219 2.60954 3.5792C2.42226 3.82162 2.20825 4.24326 2.00729 4.74117C1.79376 5.27021 1.61752 5.82759 1.52025 6.21648C1.19829 7.50369 1.01236 9.06758 0.97986 10.5739C1.18772 10.8918 1.61807 11.2661 2.16148 11.5917C2.64557 11.8818 3.15003 12.0916 3.5468 12.1809C3.64885 12.0385 3.78065 11.843 3.9138 11.6392C3.93626 11.6048 3.95838 11.5708 3.97996 11.5375C3.19521 11.2591 2.77361 10.8758 2.50064 10.4664C2.35359 10.2458 2.4132 9.94778 2.63377 9.80074C2.85435 9.65369 3.15236 9.71329 3.29941 9.93387C3.56077 10.3259 4.24355 11.0201 7.50002 11.0201C10.7565 11.0201 11.4392 10.326 11.7006 9.93386C11.8477 9.71329 12.1457 9.65369 12.3663 9.80074C12.5869 9.94779 12.6465 10.2458 12.4994 10.4664C12.2262 10.8762 11.8041 11.2598 11.0181 11.5382ZM4.08049 7.01221C4.32412 6.74984 4.65476 6.60162 5.00007 6.59998C5.34538 6.60162 5.67603 6.74984 5.91966 7.01221C6.16329 7.27459 6.30007 7.62974 6.30007 7.99998C6.30007 8.37021 6.16329 8.72536 5.91966 8.98774C5.67603 9.25011 5.34538 9.39833 5.00007 9.39998C4.65476 9.39833 4.32412 9.25011 4.08049 8.98774C3.83685 8.72536 3.70007 8.37021 3.70007 7.99998C3.70007 7.62974 3.83685 7.27459 4.08049 7.01221ZM9.99885 6.59998C9.65354 6.60162 9.3229 6.74984 9.07926 7.01221C8.83563 7.27459 8.69885 7.62974 8.69885 7.99998C8.69885 8.37021 8.83563 8.72536 9.07926 8.98774C9.3229 9.25011 9.65354 9.39833 9.99885 9.39998C10.3442 9.39833 10.6748 9.25011 10.9184 8.98774C11.1621 8.72536 11.2989 8.37021 11.2989 7.99998C11.2989 7.62974 11.1621 7.27459 10.9184 7.01221C10.6748 6.74984 10.3442 6.60162 9.99885 6.59998Z",fill:r}))});const Er={sun:Tie,moon:Vz,twitter:Fie,discord:Eke,seperator:Aie,Search:Tf,Gear:pie,PlusCircle:$ne,Folder:Mz,FolderOpen:ure,FolderPlus:dre,Inbox:wre,File:are,FileText:e_,Library:cM,ChevronLeft:Tz,ChevronRight:Jb,PanelRightOpen:Yre,Compass:Bne,EllipsisVertical:Zne,Dot:Gne,Plus:Xf,Close:Jo,PictureInPicture:rie,Bookmark:eg,Preview:nre,Text:Nie,Link:jz,Rocket:lie,Chat:Nre,Delete:t_,Copy:qne,Rename:eie,Edit:ire,NotebookPen:QT,EraserIcon:Xne,AI:_ie,MessageCircleQuestion:Dre,Feedback:qre,Share:gie,Home:bre,User:Kz,Notifications:wne,Collections:cM,Calendar:Pne,Tag:Oie,Menu:$z,Whiteboard:pre,Tasks:Wz,Bot:tg,Admin:yie,logo:e=>g.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",...e,children:[g.jsx("path",{d:"M50 10c19.299 0 35 15.701 35 35s-15.701 35-35 35S15 64.299 15 45 30.701 10 50 10m0-5C26.663 5 7 24.663 7 48s19.663 43 43 43 43-19.663 43-43S73.337 5 50 5z",fill:"none",stroke:"currentColor",strokeWidth:"5"}),g.jsx("path",{d:"M23.917 30.988c5.96-10.321 18.019-17.112 31.083-17.112 13.067 0 25.126 6.791 31.086 17.112",fill:"none",stroke:"currentColor",strokeWidth:"5"}
83),g.jsx("path",{d:"M23.917 69.012c5.96 10.321 18.019 17.112 31.083 17.112 13.067 0 25.126-6.791 31.086-17.112",fill:"none",stroke:"currentColor",strokeWidth:"5"})]}),gitHub:e=>g.jsx("svg",{viewBox:"0 0 438.549 438.549",...e,children:g.jsx("path",{fill:"currentColor",d:"M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"})}),spinner:e=>g.jsx("svg",{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",...e,children:g.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),fallback_bookmark:e=>g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","stroke-linecap":"round","stroke-linejoin":"round",...e,children:g.jsx("path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z"})})};function pI(){const{theme:e,setTheme:t}=wz(),[n,r]=b.useTransition(),i=()=>{r(()=>{t(e==="light"?"dark":e==="dark"?"system":"light")})};return g.jsxs(fn,{variant:"ghost",size:"icon",onClick:i,children:[e==="light"&&g.jsx(Rie,{className:"size-5"}),e==="dark"&&g.jsx(Vz,{className:"size-5"}),e==="system"&&g.jsx(zre,{className:"size-5"}),g.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}var Cke=b.createContext(void 0);function hq(e){const t=b.useContext(Cke);return e||t||"ltr"}var RS=0;function pq(){b.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??C4()),document.body.insertAdjacentElement("beforeend",e[1]??C4()),RS++,()=>{RS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),RS--}},[])}function C4(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var IS="focusScope.autoFocusOnMount",OS="focusScope.autoFocusOnUnmount",k4={bubbles:!1,cancelable:!0},kke="FocusScope",mI=b.forwardRef((e,t)=>
vendor: 4,148 bytes, line 83
83{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...o}=e,[a,l]=b.useState(null),u=_i(i),f=_i(s),d=b.useRef(null),p=pr(t,_=>l(_)),m=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let _=function(C){if(m.paused||!a)return;const R=C.target;a.contains(R)?d.current=R:Cl(d.current,{select:!0})},w=function(C){if(m.paused||!a)return;const R=C.relatedTarget;R!==null&&(a.contains(R)||Cl(d.current,{select:!0}))},x=function(C){if(document.activeElement===document.body)for(const P of C)P.removedNodes.length>0&&Cl(a)};document.addEventListener("focusin",_),document.addEventListener("focusout",w);const S=new MutationObserver(x);return a&&S.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",w),S.disconnect()}}},[r,a,m.paused]),b.useEffect(()=>{if(a){P4.add(m);const _=document.activeElement;if(!a.contains(_)){const x=new CustomEvent(IS,k4);a.addEventListener(IS,u),a.dispatchEvent(x),x.defaultPrevented||(Tke(Dke(mq(a)),{select:!0}),document.activeElement===_&&Cl(a))}return()=>{a.removeEventListener(IS,u),setTimeout(()=>{const x=new CustomEvent(OS,k4);a.addEventListener(OS,f),a.dispatchEvent(x),x.defaultPrevented||Cl(_??document.body,{select:!0}),a.removeEventListener(OS,f),P4.remove(m)},0)}}},[a,u,f,m]);const v=b.useCallback(_=>{if(!n&&!r||m.paused)return;const w=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,x=document.activeElement;if(w&&x){const S=_.currentTarget,[C,R]=Pke(S);C&&R?!_.shiftKey&&x===R?(_.preventDefault(),n&&Cl(C,{select:!0})):_.shiftKey&&x===C&&(_.preventDefault(),n&&Cl(R,{select:!0})):x===S&&_.preventDefault()}},[n,r,m.paused]);return g.jsx(qt.div,{tabIndex:-1,...o,ref:p,onKeyDown:v})});mI.displayName=kke;function Tke(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Cl(r,{select:t}),document.activeElement!==n)return}function Pke(e){const t=mq(e),n=T4(t,e),r=T4(t.reverse(),e);return[n,r]}function mq(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function T4(e,t){for(const n of e)if(!Rke(n,{upTo:t}))return n}function Rke(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Ike(e){return e instanceof HTMLInputElement&&"select"in e}function Cl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ike(e)&&t&&e.select()}}var P4=Oke();function Oke(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=R4(e,t),e.unshift(t)},remove(t){e=R4(e,t),e[0]?.resume()}}}function R4(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Dke(e){return e.filter(t=>t.tagName!=="A")}var Ake=Ua.useId||(()=>{}),Mke=0;function Ms(e){const[t,n]=b.useState(Ake());return Wl(()=>{n(r=>r??String(Mke++))},[e]),t?`radix-${t}`:""}var Nke="Arrow",gq=b.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return g.jsx(qt.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:g.jsx("polygon",{points:"0,0 30,0 15,10"})})});gq.displayName=Nke;var jke=gq;function vq(e){const[t,n]=b.useState(void 0);return Wl(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];let o,a;if("borderBoxSize"in s){const l=s.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=e.offsetWidth,a=e.offsetHeight;n({width:o,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var gI="Popper",[yq,bq]=iu(gI),[Lke,_q]=yq(gI),wq=e=>{const{__scopePopper:t,children:n}=e,[r,i]=b.useState(null);return g.jsx(Lke,{scope:t,anchor:r,onAnchorChange:i,children:n})};wq.displayName=gI;var xq="PopperAnchor",Sq=b.forwardRef((e,t)=>
vendor: 4,431 bytes, line 83
83{const{__scopePopper:n,virtualRef:r,...i}=e,s=_q(xq,n),o=b.useRef(null),a=pr(t,o);return b.useEffect(()=>{s.onAnchorChange(r?.current||o.current)}),r?null:g.jsx(qt.div,{...i,ref:a})});Sq.displayName=xq;var vI="PopperContent",[Fke,$ke]=yq(vI),Eq=b.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:v,..._}=e,w=_q(vI,n),[x,S]=b.useState(null),C=pr(t,ae=>S(ae)),[R,P]=b.useState(null),k=vq(R),I=k?.width??0,D=k?.height??0,L=r+(s!=="center"?"-"+s:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},$=Array.isArray(u)?u:[u],j=$.length>0,V={padding:A,boundary:$.filter(Vke),altBoundary:j},{refs:B,floatingStyles:H,placement:te,isPositioned:G,middlewareData:Z}=LU({strategy:"fixed",placement:L,whileElementsMounted:(...ae)=>NU(...ae,{animationFrame:m==="always"}),elements:{reference:w.anchor},middleware:[FU({mainAxis:i+D,alignmentAxis:o}),l&&$U({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?zU():void 0,...V}),l&&VU({...V}),UU({...V,apply:({elements:ae,rects:se,availableWidth:ce,availableHeight:fe})=>{const{width:ke,height:Ce}=se.reference,Se=ae.floating.style;Se.setProperty("--radix-popper-available-width",`${ce}px`),Se.setProperty("--radix-popper-available-height",`${fe}px`),Se.setProperty("--radix-popper-anchor-width",`${ke}px`),Se.setProperty("--radix-popper-anchor-height",`${Ce}px`)}}),R&&HU({element:R,padding:a}),Uke({arrowWidth:I,arrowHeight:D}),p&&BU({strategy:"referenceHidden",...V})]}),[Y,M]=Tq(te),q=_i(v);Wl(()=>{G&&q?.()},[G,q]);const z=Z.arrow?.x,N=Z.arrow?.y,ee=Z.arrow?.centerOffset!==0,[X,ne]=b.useState();return Wl(()=>{x&&ne(window.getComputedStyle(x).zIndex)},[x]),g.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:G?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:X,"--radix-popper-transform-origin":[Z.transformOrigin?.x,Z.transformOrigin?.y].join(" "),...Z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:g.jsx(Fke,{scope:n,placedSide:Y,onArrowChange:P,arrowX:z,arrowY:N,shouldHideArrow:ee,children:g.jsx(qt.div,{"data-side":Y,"data-align":M,..._,ref:C,style:{..._.style,animation:G?void 0:"none"}})})})});Eq.displayName=vI;var Cq="PopperArrow",zke={top:"bottom",right:"left",bottom:"top",left:"right"},kq=b.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=$ke(Cq,r),o=zke[s.placedSide];return g.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:g.jsx(jke,{...i,ref:n,style:{...i.style,display:"block"}})})});kq.displayName=Cq;function Vke(e){return e!==null}var Uke=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:i}=t,o=i.arrow?.centerOffset!==0,a=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[u,f]=Tq(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(i.arrow?.x??0)+a/2,m=(i.arrow?.y??0)+l/2;let v="",_="";return u==="bottom"?(v=o?d:`${p}px`,_=`${-l}px`):u==="top"?(v=o?d:`${p}px`,_=`${r.floating.height+l}px`):u==="right"?(v=`${-l}px`,_=o?d:`${m}px`):u==="left"&&(v=`${r.floating.width+l}px`,_=o?d:`${m}px`),{data:{x:v,y:_}}}});function Tq(e){const[t,n="center"]=e.split("-");return[t,n]}var Bke=wq,Hke=Sq,qke=Eq,Wke=kq,DS="rovingFocusGroup.onEntryFocus",Gke={bubbles:!1,cancelable:!0},W_="RovingFocusGroup",[Nk,Pq,Kke]=XT(W_),[Zke,Rq]=iu(W_,[Kke]),[Yke,Qke]=Zke(W_),Iq=b.forwardRef((e,t)=>g.jsx(Nk.Provider,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Nk.Slot,{scope:e.__scopeRovingFocusGroup,children:g.jsx(Xke,{...e,ref:t})})}));Iq.displayName=W_;var Xke=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:o,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:f=!1,...d}=e,p=b.useRef(null),m=pr(t,p),v=hq(s),[_=null,w]=rg({prop:o,defaultProp:a,onChange:l}),[x,S]=b.useState(!1),C=_i(u),R=Pq(n),P=b.useRef(!1),[k,I]=b.useState(0);return b.useEffect(()=>{const D=p.current;
vendor: 4,190 bytes, line 83
83if(D)return D.addEventListener(DS,C),()=>D.removeEventListener(DS,C)},[C]),g.jsx(Yke,{scope:n,orientation:r,dir:v,loop:i,currentTabStopId:_,onItemFocus:b.useCallback(D=>w(D),[w]),onItemShiftTab:b.useCallback(()=>S(!0),[]),onFocusableItemAdd:b.useCallback(()=>I(D=>D+1),[]),onFocusableItemRemove:b.useCallback(()=>I(D=>D-1),[]),children:g.jsx(qt.div,{tabIndex:x||k===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:yt(e.onMouseDown,()=>{P.current=!0}),onFocus:yt(e.onFocus,D=>{const L=!P.current;if(D.target===D.currentTarget&&L&&!x){const A=new CustomEvent(DS,Gke);if(D.currentTarget.dispatchEvent(A),!A.defaultPrevented){const $=R().filter(te=>te.focusable),j=$.find(te=>te.active),V=$.find(te=>te.id===_),H=[j,V,...$].filter(Boolean).map(te=>te.ref.current);Aq(H,f)}}P.current=!1}),onBlur:yt(e.onBlur,()=>S(!1))})})}),Oq="RovingFocusGroupItem",Dq=b.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...o}=e,a=Ms(),l=s||a,u=Qke(Oq,n),f=u.currentTabStopId===l,d=Pq(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=u;return b.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),g.jsx(Nk.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:g.jsx(qt.span,{tabIndex:f?0:-1,"data-orientation":u.orientation,...o,ref:t,onMouseDown:yt(e.onMouseDown,v=>{r?u.onItemFocus(l):v.preventDefault()}),onFocus:yt(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:yt(e.onKeyDown,v=>{if(v.key==="Tab"&&v.shiftKey){u.onItemShiftTab();return}if(v.target!==v.currentTarget)return;const _=tTe(v,u.orientation,u.dir);if(_!==void 0){if(v.metaKey||v.ctrlKey||v.altKey||v.shiftKey)return;v.preventDefault();let x=d().filter(S=>S.focusable).map(S=>S.ref.current);if(_==="last")x.reverse();else if(_==="prev"||_==="next"){_==="prev"&&x.reverse();const S=x.indexOf(v.currentTarget);x=u.loop?nTe(x,S+1):x.slice(S+1)}setTimeout(()=>Aq(x))}})})})});Dq.displayName=Oq;var Jke={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function eTe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function tTe(e,t,n){const r=eTe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Jke[r]}function Aq(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function nTe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var rTe=Iq,iTe=Dq,sTe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Td=new WeakMap,ky=new WeakMap,Ty={},AS=0,Mq=function(e){return e&&(e.host||Mq(e.parentNode))},oTe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Mq(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},aTe=function(e,t,n,r){var i=oTe(t,Array.isArray(e)?e:[e]);Ty[n]||(Ty[n]=new WeakMap);var s=Ty[n],o=[],a=new Set,l=new Set(i),u=function(d){!d||a.has(d)||(a.add(d),u(d.parentNode))};i.forEach(u);var f=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(p){if(a.has(p))f(p);else try{var m=p.getAttribute(r),v=m!==null&&m!=="false",_=(Td.get(p)||0)+1,w=(s.get(p)||0)+1;Td.set(p,_),s.set(p,w),o.push(p),_===1&&v&&ky.set(p,!0),w===1&&p.setAttribute(n,"true"),v||p.setAttribute(r,"true")}catch(x){console.error("aria-hidden: cannot operate on ",p,x)}})};return f(t),a.clear(),AS++,function(){o.forEach(function(d){var p=Td.get(d)-1,m=s.get(d)-1;Td.set(d,p),s.set(d,m),p||(ky.has(d)||d.removeAttribute(r),ky.delete(d)),m||d.removeAttribute(n)}),AS--,AS||(Td=new WeakMap,Td=new WeakMap,ky=new WeakMap,Ty={})}},_g=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=sTe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),aTe(r,i,n,"aria-hidden")):function(){return null}},Xr=function(){return Xr=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t}
vendor: 5,395 bytes, lines 83-98
83,Xr.apply(this,arguments)};function yI(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Nq(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var rm="right-scroll-bar-position",im="width-before-scroll-bar",lTe="with-scroll-bars-hidden",uTe="--removed-body-scroll-bar-size";function MS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cTe(e,t){var n=b.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var dTe=typeof window<"u"?b.useLayoutEffect:b.useEffect,I4=new WeakMap;function jq(e,t){var n=cTe(null,function(r){return e.forEach(function(i){return MS(i,r)})});return dTe(function(){var r=I4.get(n);if(r){var i=new Set(r),s=new Set(e),o=n.current;i.forEach(function(a){s.has(a)||MS(a,null)}),s.forEach(function(a){i.has(a)||MS(a,o)})}I4.set(n,e)},[e]),n}function fTe(e){return e}function hTe(e,t){t===void 0&&(t=fTe);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var o=t(s,r);return n.push(o),function(){n=n.filter(function(a){return a!==o})}},assignSyncMedium:function(s){for(r=!0;n.length;){var o=n;n=[],o.forEach(s)}n={push:function(a){return s(a)},filter:function(){return n}}},assignMedium:function(s){r=!0;var o=[];if(n.length){var a=n;n=[],a.forEach(s),o=n}var l=function(){var f=o;o=[],f.forEach(s)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(f){o.push(f),u()},filter:function(f){return o=o.filter(f),n}}}};return i}function Lq(e){e===void 0&&(e={});var t=hTe(null);return t.options=Xr({async:!0,ssr:!1},e),t}var Fq=function(e){var t=e.sideCar,n=yI(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return b.createElement(r,Xr({},n))};Fq.isSideCarExport=!0;function $q(e,t){return e.useMedium(t),Fq}var zq=Lq(),NS=function(){},G_=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:NS,onWheelCapture:NS,onTouchMoveCapture:NS}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,p=e.sideCar,m=e.noIsolation,v=e.inert,_=e.allowPinchZoom,w=e.as,x=w===void 0?"div":w,S=e.gapMode,C=yI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),R=p,P=jq([n,t]),k=Xr(Xr({},C),i);return b.createElement(b.Fragment,null,f&&b.createElement(R,{sideCar:zq,removeScrollBar:u,shards:d,noIsolation:m,inert:v,setCallbacks:s,allowPinchZoom:!!_,lockRef:n,gapMode:S}),o?b.cloneElement(b.Children.only(a),Xr(Xr({},k),{ref:P})):b.createElement(x,Xr({},k,{className:l,ref:P}),a))});G_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};G_.classNames={fullWidth:im,zeroRight:rm};var pTe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function mTe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=pTe();return t&&e.setAttribute("nonce",t),e}function gTe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vTe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var yTe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=mTe())&&(gTe(t,n),vTe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bTe=function(){var e=yTe();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},bI=function(){var e=bTe(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},_Te={left:0,top:0,right:0,gap:0},jS=function(e){return parseInt(e||"",10)||0},wTe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[jS(n),jS(r),jS(i)]},xTe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return _Te;var t=wTe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},STe=bI(),Sf="data-scroll-locked",ETe=function(e,t,n,r){var i=e.left,s=e.top,o=e.right,a=e.gap;return n===void 0&&(n="margin"),`
84  .`.concat(lTe,` {
85   overflow: hidden `).concat(r,`;
86   padding-right: `).concat(a,"px ").concat(r,`;
87  }
88  body[`).concat(Sf,`] {
89    overflow: hidden `).concat(r,`;
90    overscroll-behavior: contain;
91    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
92    padding-left: `.concat(i,`px;
93    padding-top: `).concat(s,`px;
94    padding-right: `).concat(o,`px;
95    margin-left:0;
96    margin-top:0;
97    margin-right: `).concat(a,"px ").concat(r,`;
98    `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";
98")].filter(Boolean).join(""),`
99  }
100  
101  .`).concat(rm,` {
102    right: `).concat(a,"px ").concat(r,`;
103  }
104  
105  .`).concat(im,` {
106    margin-right: `).concat(a,"px ").concat(r,`;
107  }
108  
109  .`).concat(rm," .").concat(rm,` {
110    right: 0 `).concat(r,`;
111  }
112  
113  .`).concat(im," .").concat(im,` {
114    margin-right: 0 `).concat(r,`;
115  }
116  
117  body[`).concat(Sf,`] {
118    `).concat(uTe,": ").concat(a,`px;
119  }
120`)},O4=function(){var e=parseInt(document.body.getAttribute(Sf)||"0",10);return isFinite(e)?e:0},CTe=function(){b.useEffect(function(){return document.body.setAttribute(Sf,(O4()+1).toString()),function(){var e=O4()-1;e<=0?document.body.removeAttribute(Sf):document.body.setAttribute(Sf,e.toString())}},[])},Vq=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;CTe();var s=b.useMemo(function(){return xTe(i)},[i]);return b.createElement(STe,{styles:ETe(s,!t,i,n?"":"!important")})},jk=!1;if(typeof window<"u")try{var Py=Object.defineProperty({},"passive",{get:function(){return jk=!0,!0}});window.addEventListener("test",Py,Py),window.removeEventListener("test",Py,Py)}catch{jk=!1}var Pd=jk?{passive:!1}:!1,kTe=function(e){return e.tagName==="TEXTAREA"},Uq=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!kTe(e)&&n[t]==="visible")},TTe=function(e){return Uq(e,"overflowY")},PTe=function(e){return Uq(e,"overflowX")},D4=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Bq(e,r);if(i){var s=Hq(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},RTe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ITe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Bq=function(e,t){return e==="v"?TTe(t):PTe(t)},Hq=function(e,t){return e==="v"?RTe(t):ITe(t)},OTe=function(e,t){return e==="h"&&t==="rtl"?-1:1},DTe=function(e,t,n,r,i){var s=OTe(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),u=!1,f=o>0,d=0,p=0;do{var m=Hq(e,a),v=m[0],_=m[1],w=m[2],x=_-w-s*v;(v||x)&&Bq(e,a)&&(d+=x,p+=v),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(p)<1)&&(u=!0),u},Ry=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},A4=function(e){return[e.deltaX,e.deltaY]},M4=function(e){return e&&"current"in e?e.current:e},ATe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},MTe=function(e){return`
121  .block-interactivity-`.concat(e,` {pointer-events: none;}
122  .allow-interactivity-`).concat(e,` {pointer-events: all;}
123`)},NTe=0,Rd=[];function jTe(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(NTe++)[0],s=b.useState(bI)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var _=Nq([e.lockRef.current],(e.shards||[]).map(M4),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var x=Ry(_),S=n.current,C="deltaX"in _?_.deltaX:S[0]-x[0],R="deltaY"in _?_.deltaY:S[1]-x[1],P,k=_.target,I=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in _&&I==="h"&&k.type==="range")return!1;var D=D4(I,k);if(!D)return!0;if(D?P=I:(P=I==="v"?"h":"v",D=D4(I,k)),!D)return!1;if(!r.current&&"changedTouches"in _&&(C||R)&&(r.current=P),!P)return!0;var L=r.current||P;return DTe(L,w,_,L==="h"?C:R)},[]),l=b.useCallback(function(_){var w=_;if(!(!Rd.length||Rd[Rd.length-1]!==s)){var x="deltaY"in w?A4(w):Ry(w),S=t.current.filter(function(P){return P.name===w.type&&(P.target===w.target||w.target===P.shadowParent)&&ATe(P.delta,x)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}
vendor: 19,114 bytes, line 123
123if(!S){var C=(o.current.shards||[]).map(M4).filter(Boolean).filter(function(P){return P.contains(w.target)}),R=C.length>0?a(w,C[0]):!o.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),u=b.useCallback(function(_,w,x,S){var C={name:_,delta:w,target:x,should:S,shadowParent:LTe(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),f=b.useCallback(function(_){n.current=Ry(_),r.current=void 0},[]),d=b.useCallback(function(_){u(_.type,A4(_),_.target,a(_,e.lockRef.current))},[]),p=b.useCallback(function(_){u(_.type,Ry(_),_.target,a(_,e.lockRef.current))},[]);b.useEffect(function(){return Rd.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Pd),document.addEventListener("touchmove",l,Pd),document.addEventListener("touchstart",f,Pd),function(){Rd=Rd.filter(function(_){return _!==s}),document.removeEventListener("wheel",l,Pd),document.removeEventListener("touchmove",l,Pd),document.removeEventListener("touchstart",f,Pd)}},[]);var m=e.removeScrollBar,v=e.inert;return b.createElement(b.Fragment,null,v?b.createElement(s,{styles:MTe(i)}):null,m?b.createElement(Vq,{gapMode:e.gapMode}):null)}function LTe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const FTe=$q(zq,jTe);var _I=b.forwardRef(function(e,t){return b.createElement(G_,Xr({},e,{ref:t,sideCar:FTe}))});_I.classNames=G_.classNames;var Lk=["Enter"," "],$Te=["ArrowDown","PageUp","Home"],qq=["ArrowUp","PageDown","End"],zTe=[...$Te,...qq],VTe={ltr:[...Lk,"ArrowRight"],rtl:[...Lk,"ArrowLeft"]},UTe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},wg="Menu",[zm,BTe,HTe]=XT(wg),[Fc,Wq]=iu(wg,[HTe,bq,Rq]),K_=bq(),Gq=Rq(),[qTe,$c]=Fc(wg),[WTe,xg]=Fc(wg),Kq=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=K_(t),[l,u]=b.useState(null),f=b.useRef(!1),d=_i(s),p=hq(i);return b.useEffect(()=>{const m=()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},v=()=>f.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),g.jsx(Bke,{...a,children:g.jsx(qTe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:g.jsx(WTe,{scope:t,onClose:b.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:o,children:r})})})};Kq.displayName=wg;var GTe="MenuAnchor",wI=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=K_(n);return g.jsx(Hke,{...i,...r,ref:t})});wI.displayName=GTe;var xI="MenuPortal",[KTe,Zq]=Fc(xI,{forceMount:void 0}),Yq=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=$c(xI,t);return g.jsx(KTe,{scope:t,forceMount:n,children:g.jsx(ea,{present:n||s.open,children:g.jsx(r_,{asChild:!0,container:i,children:r})})})};Yq.displayName=xI;var Ns="MenuContent",[ZTe,SI]=Fc(Ns),Qq=b.forwardRef((e,t)=>{const n=Zq(Ns,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=$c(Ns,e.__scopeMenu),o=xg(Ns,e.__scopeMenu);return g.jsx(zm.Provider,{scope:e.__scopeMenu,children:g.jsx(ea,{present:r||s.open,children:g.jsx(zm.Slot,{scope:e.__scopeMenu,children:o.modal?g.jsx(YTe,{...i,ref:t}):g.jsx(QTe,{...i,ref:t})})})})}),YTe=b.forwardRef((e,t)=>{const n=$c(Ns,e.__scopeMenu),r=b.useRef(null),i=pr(t,r);return b.useEffect(()=>{const s=r.current;if(s)return _g(s)},[]),g.jsx(EI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:yt(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),QTe=b.forwardRef((e,t)=>{const n=$c(Ns,e.__scopeMenu);return g.jsx(EI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),EI=b.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,disableOutsideScroll:v,..._}=e,w=$c(Ns,n),x=xg(Ns,n),S=K_(n),C=Gq(n),R=BTe(n),[P,k]=b.useState(null),I=b.useRef(null),D=pr(t,I,w.onContentChange),L=b.useRef(0),A=b.useRef(""),$=b.useRef(0),j=b.useRef(null),V=b.useRef("right"),B=b.useRef(0),H=v?_I:b.Fragment,te=v?{as:Pf,allowPinchZoom:!0}:void 0,G=Y=>{const M=A.current+Y,q=R().filter(ae=>!ae.disabled),z=document.activeElement,N=q.find(ae=>ae.ref.current===z)?.textValue,ee=q.map(ae=>ae.textValue),X=uPe(ee,M,N),ne=q.find(ae=>ae.textValue===X)?.ref.current;(function ae(se){A.current=se,window.clearTimeout(L.current),se!==""&&(L.current=window.setTimeout(()=>ae(""),1e3))})(M),ne&&setTimeout(()=>ne.focus())};b.useEffect(()=>()=>window.clearTimeout(L.current),[]),pq();const Z=b.useCallback(Y=>V.current===j.current?.side&&dPe(Y,j.current?.area),[]);return g.jsx(ZTe,{scope:n,searchRef:A,onItemEnter:b.useCallback(Y=>{Z(Y)&&Y.preventDefault()},[Z]),onItemLeave:b.useCallback(Y=>{Z(Y)||(I.current?.focus(),k(null))},[Z]),onTriggerLeave:b.useCallback(Y=>{Z(Y)&&Y.preventDefault()},[Z]),pointerGraceTimerRef:$,onPointerGraceIntentChange:b.useCallback(Y=>{j.current=Y},[]),children:g.jsx(H,{...te,children:g.jsx(mI,{asChild:!0,trapped:i,onMountAutoFocus:yt(s,Y=>{Y.preventDefault(),I.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:g.jsx(n_,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:d,onInteractOutside:p,onDismiss:m,children:g.jsx(rTe,{asChild:!0,...C,dir:x.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:k,onEntryFocus:yt(l,Y=>{x.isUsingKeyboardRef.current||Y.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(qke,{role:"menu","aria-orientation":"vertical","data-state":hW(w.open),"data-radix-menu-content":"",dir:x.dir,...S,..._,ref:D,style:{outline:"none",..._.style},onKeyDown:yt(_.onKeyDown,Y=>{const q=Y.target.closest("[data-radix-menu-content]")===Y.currentTarget,z=Y.ctrlKey||Y.altKey||Y.metaKey,N=Y.key.length===1;q&&(Y.key==="Tab"&&Y.preventDefault(),!z&&N&&G(Y.key));const ee=I.current;if(Y.target!==ee||!zTe.includes(Y.key))return;Y.preventDefault();const ne=R().filter(ae=>!ae.disabled).map(ae=>ae.ref.current);qq.includes(Y.key)&&ne.reverse(),aPe(ne)}),onBlur:yt(e.onBlur,Y=>{Y.currentTarget.contains(Y.target)||(window.clearTimeout(L.current),A.current="")}),onPointerMove:yt(e.onPointerMove,Vm(Y=>{const M=Y.target,q=B.current!==Y.clientX;if(Y.currentTarget.contains(M)&&q){const z=Y.clientX>B.current?"right":"left";V.current=z,B.current=Y.clientX}}))})})})})})})});Qq.displayName=Ns;var XTe="MenuGroup",CI=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(qt.div,{role:"group",...r,ref:t})});CI.displayName=XTe;var JTe="MenuLabel",Xq=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(qt.div,{...r,ref:t})});Xq.displayName=JTe;var Sb="MenuItem",N4="menu.itemSelect",Z_=b.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=b.useRef(null),o=xg(Sb,e.__scopeMenu),a=SI(Sb,e.__scopeMenu),l=pr(t,s),u=b.useRef(!1),f=()=>{const d=s.current;if(!n&&d){const p=new CustomEvent(N4,{bubbles:!0,cancelable:!0});d.addEventListener(N4,m=>r?.(m),{once:!0}),JT(d,p),p.defaultPrevented?u.current=!1:o.onClose()}};return g.jsx(Jq,{...i,ref:l,disabled:n,onClick:yt(e.onClick,f),onPointerDown:d=>{e.onPointerDown?.(d),u.current=!0},onPointerUp:yt(e.onPointerUp,d=>{u.current||d.currentTarget?.click()}),onKeyDown:yt(e.onKeyDown,d=>{const p=a.searchRef.current!=="";n||p&&d.key===" "||Lk.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});Z_.displayName=Sb;var Jq=b.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,o=SI(Sb,n),a=Gq(n),l=b.useRef(null),u=pr(t,l),[f,d]=b.useState(!1),[p,m]=b.useState("");return b.useEffect(()=>{const v=l.current;v&&m((v.textContent??"").trim())},[s.children]),g.jsx(zm.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:g.jsx(iTe,{asChild:!0,...a,focusable:!r,children:g.jsx(qt.div,{role:"menuitem","data-highlighted":f?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:u,onPointerMove:yt(e.onPointerMove,Vm(v=>{r?o.onItemLeave(v):(o.onItemEnter(v),v.defaultPrevented||v.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:yt(e.onPointerLeave,Vm(v=>o.onItemLeave(v))),onFocus:yt(e.onFocus,()=>d(!0)),onBlur:yt(e.onBlur,()=>d(!1))})})})}),ePe="MenuCheckboxItem",eW=b.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return g.jsx(sW,{scope:e.__scopeMenu,checked:n,children:g.jsx(Z_,{role:"menuitemcheckbox","aria-checked":Eb(n)?"mixed":n,...i,ref:t,"data-state":TI(n),onSelect:yt(i.onSelect,()=>r?.(Eb(n)?!0:!n),{checkForDefaultPrevented:!1})})})});eW.displayName=ePe;var tW="MenuRadioGroup",[tPe,nPe]=Fc(tW,{value:void 0,onValueChange:()=>{}}),nW=b.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=_i(r);return g.jsx(tPe,{scope:e.__scopeMenu,value:n,onValueChange:s,children:g.jsx(CI,{...i,ref:t})})});nW.displayName=tW;var rW="MenuRadioItem",iW=b.forwardRef((e,t)=>{const{value:n,...r}=e,i=nPe(rW,e.__scopeMenu),s=n===i.value;return g.jsx(sW,{scope:e.__scopeMenu,checked:s,children:g.jsx(Z_,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":TI(s),onSelect:yt(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});iW.displayName=rW;var kI="MenuItemIndicator",[sW,rPe]=Fc(kI,{checked:!1}),oW=b.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=rPe(kI,n);return g.jsx(ea,{present:r||Eb(s.checked)||s.checked===!0,children:g.jsx(qt.span,{...i,ref:t,"data-state":TI(s.checked)})})});oW.displayName=kI;var iPe="MenuSeparator",aW=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return g.jsx(qt.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});aW.displayName=iPe;var sPe="MenuArrow",lW=b.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=K_(n);return g.jsx(Wke,{...i,...r,ref:t})});lW.displayName=sPe;var oPe="MenuSub",[yHe,uW]=Fc(oPe),$p="MenuSubTrigger",cW=b.forwardRef((e,t)=>{const n=$c($p,e.__scopeMenu),r=xg($p,e.__scopeMenu),i=uW($p,e.__scopeMenu),s=SI($p,e.__scopeMenu),o=b.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=s,u={__scopeMenu:e.__scopeMenu},f=b.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return b.useEffect(()=>f,[f]),b.useEffect(()=>{const d=a.current;return()=>{window.clearTimeout(d),l(null)}},[a,l]),g.jsx(wI,{asChild:!0,...u,children:g.jsx(Jq,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":hW(n.open),...e,ref:ja(t,i.onTriggerChange),onClick:d=>{e.onClick?.(d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:yt(e.onPointerMove,Vm(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(s.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:yt(e.onPointerLeave,Vm(d=>{f();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,v=m==="right",_=v?-5:5,w=p[v?"left":"right"],x=p[v?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+_,y:d.clientY},{x:w,y:p.top},{x,y:p.top},{x,y:p.bottom},{x:w,y:p.bottom}],side:m}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:yt(e.onKeyDown,d=>{const p=s.searchRef.current!=="";e.disabled||p&&d.key===" "||VTe[r.dir].includes(d.key)&&(n.onOpenChange(!0),n.content?.focus(),d.preventDefault())})})})});cW.displayName=$p;var dW="MenuSubContent",fW=b.forwardRef((e,t)=>{const n=Zq(Ns,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=$c(Ns,e.__scopeMenu),o=xg(Ns,e.__scopeMenu),a=uW(dW,e.__scopeMenu),l=b.useRef(null),u=pr(t,l);return g.jsx(zm.Provider,{scope:e.__scopeMenu,children:g.jsx(ea,{present:r||s.open,children:g.jsx(zm.Slot,{scope:e.__scopeMenu,children:g.jsx(EI,{id:a.contentId,"aria-labelledby":a.triggerId,...i,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:f=>{o.isUsingKeyboardRef.current&&l.current?.focus(),f.preventDefault()},onCloseAutoFocus:f=>f.preventDefault(),onFocusOutside:yt(e.onFocusOutside,f=>{f.target!==a.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:yt(e.onEscapeKeyDown,f=>{o.onClose(),f.preventDefault()}),onKeyDown:yt(e.onKeyDown,f=>{const d=f.currentTarget.contains(f.target),p=UTe[o.dir].includes(f.key);d&&p&&(s.onOpenChange(!1),a.trigger?.focus(),f.preventDefault())})})})})})});fW.displayName=dW;function hW(e){return e?"open":"closed"}function Eb(e){return e==="indeterminate"}function TI(e){return Eb(e)?"indeterminate":e?"checked":"unchecked"}function aPe(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function lPe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function uPe(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=lPe(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}function cPe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s].x,l=t[s].y,u=t[o].x,f=t[o].y;l>r!=f>r&&n<(u-a)*(r-l)/(f-l)+a&&(i=!i)}return i}function dPe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return cPe(n,t)}function Vm(e){return t=>t.pointerType==="mouse"?e(t):void 0}var fPe=Kq,hPe=wI,pPe=Yq,mPe=Qq,gPe=CI,vPe=Xq,yPe=Z_,bPe=eW,_Pe=nW,wPe=iW,xPe=oW,SPe=aW,EPe=lW,CPe=cW,kPe=fW,PI="DropdownMenu",[TPe]=iu(PI,[Wq]),xi=Wq(),[PPe,pW]=TPe(PI),mW=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:o,modal:a=!0}=e,l=xi(t),u=b.useRef(null),[f=!1,d]=rg({prop:i,defaultProp:s,onChange:o});return g.jsx(PPe,{scope:t,triggerId:Ms(),triggerRef:u,contentId:Ms(),open:f,onOpenChange:d,onOpenToggle:b.useCallback(()=>d(p=>!p),[d]),modal:a,children:g.jsx(fPe,{...l,open:f,onOpenChange:d,dir:r,modal:a,children:n})})};mW.displayName=PI;var gW="DropdownMenuTrigger",vW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=pW(gW,n),o=xi(n);return g.jsx(hPe,{asChild:!0,...o,children:g.jsx(qt.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...i,ref:ja(t,s.triggerRef),onPointerDown:yt(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(s.onOpenToggle(),s.open||a.preventDefault())}),onKeyDown:yt(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&s.onOpenToggle(),a.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});vW.displayName=gW;var RPe="DropdownMenuPortal",yW=e=>{const{__scopeDropdownMenu:t,...n}=e,r=xi(t);return g.jsx(pPe,{...r,...n})};yW.displayName=RPe;var bW="DropdownMenuContent",_W=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pW(bW,n),s=xi(n),o=b.useRef(!1);return g.jsx(mPe,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:yt(e.onCloseAutoFocus,a=>{o.current||i.triggerRef.current?.focus(),o.current=!1,a.preventDefault()}),onInteractOutside:yt(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,f=l.button===2||u;(!i.modal||f)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});_W.displayName=bW;var IPe="DropdownMenuGroup",OPe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(gPe,{...i,...r,ref:t})});OPe.displayName=IPe;var DPe="DropdownMenuLabel",wW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(vPe,{...i,...r,ref:t})});wW.displayName=DPe;var APe="DropdownMenuItem",xW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(yPe,{...i,...r,ref:t})});xW.displayName=APe;var MPe="DropdownMenuCheckboxItem",SW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(bPe,{...i,...r,ref:t})});SW.displayName=MPe;var NPe="DropdownMenuRadioGroup",jPe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(_Pe,{...i,...r,ref:t})});jPe.displayName=NPe;var LPe="DropdownMenuRadioItem",EW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(wPe,{...i,...r,ref:t})});EW.displayName=LPe;var FPe="DropdownMenuItemIndicator",CW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(xPe,{...i,...r,ref:t})});CW.displayName=FPe;var $Pe="DropdownMenuSeparator",kW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(SPe,{...i,...r,ref:t})});kW.displayName=$Pe;var zPe="DropdownMenuArrow",VPe=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(EPe,{...i,...r,ref:t})});VPe.displayName=zPe;var UPe="DropdownMenuSubTrigger",TW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(CPe,{...i,...r,ref:t})});TW.displayName=UPe;var BPe="DropdownMenuSubContent",PW=b.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=xi(n);return g.jsx(kPe,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});PW.displayName=BPe;var HPe=mW,qPe=vW,WPe=yW,RW=_W,IW=wW,OW=xW,DW=SW,AW=EW,MW=CW,NW=kW,jW=TW,LW=PW;const RI=HPe,II=qPe,GPe=b.forwardRef(({className:e,inset:t,children:n,...r},i)=>g.jsxs(jW,{ref:i,className:_e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,g.jsx(Jb,{className:"ml-auto size-4"})]}));GPe.displayName=jW.displayName;const KPe=b.forwardRef(({className:e,...t},n)=>g.jsx(LW,{ref:n,className:_e("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
123de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));KPe.displayName=LW.displayName;const Y_=b.forwardRef(({className:e,sideOffset:t=4,...n},r)=>g.jsx(WPe,{children:g.jsx(RW,{ref:r,sideOffset:t,className:_e("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-sm","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Y_.displayName=RW.displayName;const Qr=b.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(OW,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Qr.displayName=OW.displayName;const ZPe=b.forwardRef(({className:e,children:t,checked:n,...r},i)=>g.jsxs(DW,{ref:i,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(MW,{children:g.jsx(ng,{className:"size-4"})})}),t]}));ZPe.displayName=DW.displayName;const YPe=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(AW,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(MW,{children:g.jsx(Oz,{className:"size-2 fill-current"})})}),t]}));YPe.displayName=AW.displayName;const FW=b.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(IW,{ref:r,className:_e("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));FW.displayName=IW.displayName;const Ef=b.forwardRef(({className:e,...t},n)=>g.jsx(NW,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));Ef.displayName=NW.displayName;function zp({className:e,...t}){return g.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",className:_e("size-4",e),viewBox:"0 0 256 256",...t,children:g.jsx("path",{d:"M224 104a8 8 0 0 1-16 0V59.32l-66.33 66.34a8 8 0 0 1-11.32-11.32L196.68 48H152a8 8 0 0 1 0-16h64a8 8 0 0 1 8 8Zm-40 24a8 8 0 0 0-8 8v72H48V80h72a8 8 0 0 0 0-16H48a16 16 0 0 0-16 16v128a16 16 0 0 0 16 16h128a16 16 0 0 0 16-16v-72a8 8 0 0 0-8-8Z"})})}function QPe(e){const[t,n]=e.split(" ");return n?`${t[0]}${n[0]}`:t.slice(0,2)}function OI({user:e}){const{user:t,logout:n}=eh(),r=wi(),i=e||t,s=async()=>{await n(),r("/auth/signin")};return i?g.jsx("div",{className:"flex items-center justify-between",children:g.jsxs(RI,{children:[g.jsx(II,{asChild:!0,children:g.jsxs(fn,{variant:"ghost",className:"pl-0",children:[i?.image?g.jsx("img",{className:"size-6 select-none rounded-full ring-1 ring-zinc-100/10 transition-opacity duration-300 hover:opacity-80",src:i.image,alt:i.name??"Avatar",height:48,width:48}):g.jsx("div",{className:"flex size-7 shrink-0 select-none items-center justify-center rounded-full bg-muted/50 text-xs font-medium uppercase text-muted-foreground",children:i?.name?QPe(i.name):null}),g.jsx("span",{className:"ml-2",children:i?.name})]})}),g.jsxs(Y_,{sideOffset:8,align:"start",className:"w-[200px] dark:bg-accent",children:[g.jsxs(Qr,{className:"flex-col items-start",children:[g.jsx("div",{className:"text-xs font-medium",children:i?.name}),g.jsx("div",{className:"text-xs text-zinc-500",children:i?.email})]}),g.jsx(Ef,{}),g.jsx(Qr,{asChild:!0,children:g.jsxs("a",{href:"https://www.mentes.ai",target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center justify-between text-xs",children:["Homepage",g.jsx(zp,{className:"ml-auto size-3"})]})}),g.jsx(Ef,{}),g.jsx(FW,{className:"text-xs font-normal text-muted-foreground",children:"Community"}),g.jsx(Qr,{asChild:!0,children:g.jsxs("a",{href:qo.links.feedback,target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center gap-2 text-xs",children:[g.jsx(Er.Feedback,{className:"size-4"}),"Send Feedback",g.jsx(zp,{className:"ml-auto size-3"})]})}),g.jsx(Qr,{asChild:!0,children:g.jsxs("a",{href:qo.links.discord,target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center gap-2 text-xs",children:[g.jsx(Er.discord,{className:"size-4"}),"Discord Community",g.jsx(zp,{className:"ml-auto size-3"})]})}),g.jsx(Qr,{asChild:!0,children:g.jsxs("a",{href:qo.links.twitter,target:"_blank",rel:"noopener noreferrer",className:"inline-flex w-full items-center gap-2 text-xs",children:[g.jsx(Er.twitter,{className:"size-4"}),"Follow on Twitter",g.jsx(zp,{className:"ml-auto size-3"})]})}),g.jsx(Ef,{}),g.jsx(Qr,{onClick:s,className:"text-xs",children:"Log Out"})]})]})}):null}var XPe=Object.defineProperty,Rr=(e,t)=>
123XPe(e,"name",{value:t,configurable:!0});function Q_(e){const t=e+"CollectionProvider",[n,r]=$s(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=Rr(_=>{const{scope:w,children:x}=_,S=b.useRef(null),C=b.useRef(new Map).current;return g.jsx(i,{scope:w,itemMap:C,collectionRef:S,children:x})},"CollectionProvider");o.displayName=t;const a=e+"CollectionSlot",l=Zo(a),u=b.forwardRef((_,w)=>{const{scope:x,children:S}=_,C=s(a,x),R=At(w,C.collectionRef);return g.jsx(l,{ref:R,children:S})});u.displayName=a;const f=e+"CollectionItemSlot",d="data-radix-collection-item",p=Zo(f),m=b.forwardRef((_,w)=>{const{scope:x,children:S,...C}=_,R=b.useRef(null),P=At(w,R),k=s(f,x);return b.useEffect(()=>(k.itemMap.set(R,{ref:R,...C}),()=>void k.itemMap.delete(R))),g.jsx(p,{[d]:"",ref:P,children:S})});m.displayName=f;function v(_){const w=s(e+"CollectionConsumer",_);return b.useCallback(()=>{const S=w.collectionRef.current;if(!S)return[];const C=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(w.itemMap.values()).sort((k,I)=>C.indexOf(k.ref.current)-C.indexOf(I.ref.current))},[w.collectionRef,w.itemMap])}return Rr(v,"useCollection"),[{Provider:o,Slot:u,ItemSlot:m},v,r]}Rr(Q_,"createCollection");var j4=new WeakMap,ar,Yi,LS=(Yi=class extends Map{constructor(n){super(n);TA(this,ar);o1(this,ar,[...super.keys()]),j4.set(this,!0)}set(n,r){return j4.get(this)&&(this.has(n)?Wr(this,ar)[Wr(this,ar).indexOf(n)]=n:Wr(this,ar).push(n)),super.set(n,r),this}insert(n,r,i){const s=this.has(r),o=Wr(this,ar).length,a=DI(n);let l=a>=0?a:o+a;const u=l<0||l>=o?-1:l;if(u===this.size||s&&u===this.size-1||u===-1)return this.set(r,i),this;const f=this.size+(s?0:1);a<0&&l++;const d=[...Wr(this,ar)];let p,m=!1;for(let v=l;v<f;v++)if(l===v){let _=d[v];d[v]===r&&(_=d[v+1]),s&&this.delete(r),p=this.get(_),this.set(r,i)}else{!m&&d[v-1]===r&&(m=!0);const _=d[m?v:v-1],w=p;p=this.get(_),this.delete(_),this.set(_,w)}return this}with(n,r,i){const s=new Yi(this);return s.insert(n,r,i),s}before(n){const r=Wr(this,ar).indexOf(n)-1;if(!(r<0))return this.entryAt(r)}setBefore(n,r,i){const s=Wr(this,ar).indexOf(n);return s===-1?this:this.insert(s,r,i)}after(n){let r=Wr(this,ar).indexOf(n);if(r=r===-1||r===this.size-1?-1:r+1,r!==-1)return this.entryAt(r)}setAfter(n,r,i){const s=Wr(this,ar).indexOf(n);return s===-1?this:this.insert(s+1,r,i)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return o1(this,ar,[]),super.clear()}delete(n){const r=super.delete(n);return r&&Wr(this,ar).splice(Wr(this,ar).indexOf(n),1),r}deleteAt(n){const r=this.keyAt(n);return r!==void 0?this.delete(r):!1}at(n){const r=_0(Wr(this,ar),n);if(r!==void 0)return this.get(r)}entryAt(n){const r=_0(Wr(this,ar),n);if(r!==void 0)return[r,this.get(r)]}indexOf(n){return Wr(this,ar).indexOf(n)}keyAt(n){return _0(Wr(this,ar),n)}from(n,r){const i=this.indexOf(n);if(i===-1)return;let s=i+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.at(s)}keyFrom(n,r){const i=this.indexOf(n);if(i===-1)return;let s=i+r;return s<0&&(s=0),s>=this.size&&(s=this.size-1),this.keyAt(s)}find(n,r){let i=0;for(const s of this){if(Reflect.apply(n,r,[s,i,this]))return s;i++}}findIndex(n,r){let i=0;for(const s of this){if(Reflect.apply(n,r,[s,i,this]))return i;i++}return-1}filter(n,r){const i=[];let s=0;for(const o of this)Reflect.apply(n,r,[o,s,this])&&i.push(o),s++;return new Yi(i)}map(n,r){const i=[];let s=0;for(const o of this)i.push([o[0],Reflect.apply(n,r,[o,s,this])]),s++;return new Yi(i)}reduce(...n){const[r,i]=n;let s=0,o=i??this.at(0);for(const a of this)s===0&&n.length===1?o=a:o=Reflect.apply(r,this,[o,a,s,this]),s++;return o}reduceRight(...n){const[r,i]=n;let s=i??this.at(-1);for(let o=this.size-1;o>=0;o--){const a=this.at(o);o===this.size-1&&n.length===1?s=a:s=Reflect.apply(r,this,[s,a,o,this])}return s}toSorted(n){const r=[...this.entries()].sort(n);return new Yi(r)}toReversed(){const n=new Yi;for(let r=this.size-1;r>=0;r--){const i=this.keyAt(r),s=this.get(i);n.set(i,s)}return n}toSpliced(...n){const r=[...this.entries()];return r.splice(...n),new Yi(r)}slice(n,r){const i=new Yi;let s=this.size-1;if(n===void 0)return i;n<0&&(n=n+this.size),r!==void 0&&r>0&&(s=r-1);for(let o=n;o<=s;o++){const a=this.keyAt(o),l=this.get(a);i.set(a,l)}return i}every(n,r){let i=0;for(const s of this){if(!Reflect.apply(n,r,[s,i,this]))return!1;i++}return!0}some(n,r){let i=0;for(const s of this){if(Reflect.apply(n,r,[s,i,this]))return!0;
123i++}return!1}},ar=new WeakMap,Rr(Yi,"OrderedDict"),Yi);function _0(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);const n=$W(e,t);return n===-1?void 0:e[n]}Rr(_0,"at");function $W(e,t){const n=e.length,r=DI(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}Rr($W,"toSafeIndex");function DI(e){return e!==e||e===0?0:Math.trunc(e)}Rr(DI,"toSafeInteger");function JPe(e){const t=e+"CollectionProvider",[n,r]=$s(t),[i,s]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new LS,setItemMap:Rr(()=>{},"setItemMap")}),o=Rr(({state:C,...R})=>C?g.jsx(l,{...R,state:C}):g.jsx(a,{...R}),"CollectionProvider");o.displayName=t;const a=Rr(C=>{const R=w();return g.jsx(l,{...C,state:R})},"CollectionInit");a.displayName=t+"Init";const l=Rr(C=>{const{scope:R,children:P,state:k}=C,I=b.useRef(null),[D,L]=b.useState(null),A=At(I,L),[$,j]=k;return b.useEffect(()=>{if(!D)return;const V=UW(()=>{});return V.observe(D,{childList:!0,subtree:!0}),()=>{V.disconnect()}},[D]),g.jsx(i,{scope:R,itemMap:$,setItemMap:j,collectionRef:A,collectionRefObject:I,collectionElement:D,children:P})},"CollectionProviderImpl");l.displayName=t+"Impl";const u=e+"CollectionSlot",f=Zo(u),d=b.forwardRef((C,R)=>{const{scope:P,children:k}=C,I=s(u,P),D=At(R,I.collectionRef);return g.jsx(f,{ref:D,children:k})});d.displayName=u;const p=e+"CollectionItemSlot",m="data-radix-collection-item",v=Zo(p),_=b.forwardRef((C,R)=>{const{scope:P,children:k,...I}=C,D=b.useRef(null),[L,A]=b.useState(null),$=At(R,D,A),j=s(p,P),{setItemMap:V}=j,B=b.useRef(I);zW(B.current,I)||(B.current=I);const H=B.current;return b.useEffect(()=>{const te=H;return V(G=>L?G.has(L)?G.set(L,{...te,element:L}).toSorted(Fk):(G.set(L,{...te,element:L}),G.toSorted(Fk)):G),()=>{V(G=>!L||!G.has(L)?G:(G.delete(L),new LS(G)))}},[L,H,V]),g.jsx(v,{[m]:"",ref:$,children:k})});_.displayName=p;function w(){return b.useState(new LS)}Rr(w,"useInitCollection");function x(C){const{itemMap:R}=s(e+"CollectionConsumer",C);return R}return Rr(x,"useCollection"),[{Provider:o,Slot:d,ItemSlot:_},{createCollectionScope:r,useCollection:x,useInitCollection:w}]}Rr(JPe,"createCollection");function zW(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e==null||t==null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n)if(!Object.prototype.hasOwnProperty.call(t,i)||e[i]!==t[i])return!1;return!0}Rr(zW,"shallowEqual");function VW(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}Rr(VW,"isElementPreceding");function Fk(e,t){return!e[1].element||!t[1].element?0:VW(e[1].element,t[1].element)?-1:1}Rr(Fk,"sortByDocumentPosition");function UW(e){return new MutationObserver(n=>{for(const r of n)if(r.type==="childList"){e();return}})}Rr(UW,"getChildListObserver");var eRe=Object.defineProperty,AI=(e,t)=>eRe(e,"name",{value:t,configurable:!0}),Iy=0,Id=null;function tRe(e){return Sg(),e.children}AI(tRe,"FocusGuards");function Sg(){b.useEffect(()=>{Id||(Id={start:$k(),end:$k()});const{start:e,end:t}=Id;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Iy++,()=>{Iy===1&&(Id?.start.remove(),Id?.end.remove(),Id=null),Iy=Math.max(0,Iy-1)}},[])}AI(Sg,"useFocusGuards");function $k(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}AI($k,"createFocusGuard");var nRe=Object.defineProperty,vi=(e,t)=>nRe(e,"name",{value:t,configurable:!0}),FS="focusScope.autoFocusOnMount",$S="focusScope.autoFocusOnUnmount",L4={bubbles:!1,cancelable:!0},MI=b.forwardRef(vi(function(t,n){const{loop:r=!1,trapped:i=!1,onMountAutoFocus:s,onUnmountAutoFocus:o,...a}=t,[l,u]=b.useState(null),f=Sr(s),d=Sr(o),p=b.useRef(null),m=At(n,u),v=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(i){let w=function(R){if(v.paused||!l)return;const P=R.target;l.contains(P)?p.current=P:Ta(p.current,{select:!0})},x=function(R){if(v.paused||!l)return;const P=R.relatedTarget;P!==null&&(l.contains(P)||Ta(p.current,{select:!0}))},S=function(R){if(document.activeElement===document.body)for(const k of R)k.removedNodes.length>0&&Ta(l)};vi(w,"handleFocusIn"),vi(x,"handleFocusOut"),vi(S,"handleMutations"),document.addEventListener("focusin",w),document.addEventListener("focusout",x);const C=new MutationObserver(S);return l&&C.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",x),C.disconnect()}}},[i,l,v.paused]),b.useEffect(()=>{if(l){F4.add(v);const w=document.activeElement;if(!l.contains(w)){const S=new CustomEvent(FS,L4);l.addEventListener(FS,f),l.dispatchEvent(S),S.defaultPrevented||(BW(KW(NI(l)),{select:!0}),document.activeElement===w&&Ta(l))}return()=>{l.removeEventListener(FS,f),setTimeout(()=>{const S=new CustomEvent($S,L4);l.addEventListener($S,d),l.dispatchEvent(S),S.defaultPrevented||Ta(w??document.body,{select:!0}),l.removeEventListener($S,d),F4.remove(v)},0)}}},[l,f,d,v]);const _=b.useCallback(w=>{if(!r&&!i||v.paused)return;const x=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(x&&S){const C=w.currentTarget,[R,P]=HW(C);R&&P?!w.shiftKey&&S===P?(w.preventDefault(),r&&Ta(R,{select:!0})):w.shiftKey&&S===R&&(w.preventDefault(),r&&Ta(P,{select:!0})):S===C&&w.preventDefault()}},[r,i,v.paused]);return g.jsx(Vt.div,{tabIndex:-1,...a,ref:m,onKeyDown:_})},"FocusScope"));function BW(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Ta(r,{select:t}),document.activeElement!==n)return}vi(BW,"focusFirst");function HW(e){const t=NI(e),n=zk(t,e),r=zk(t.reverse(),e);return[n,r]}vi(HW,"getTabbableEdges");function NI(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vi(r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}vi(NI,"getTabbableCandidates");function zk(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):qW(r,{upTo:t})))return r}vi(zk,"findVisible");function qW(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}vi(qW,"isHidden");function WW(e){return e instanceof HTMLInputElement&&"select"in e}vi(WW,"isSelectableInput");function Ta(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&WW(e)&&t&&e.select()}}vi(Ta,"focus");var F4=GW();function GW(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Vk(e,t),e.unshift(t)},remove(t){e=Vk(e,t),e[0]?.resume()}}}vi(GW,"createFocusScopesStack");function Vk(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}vi(Vk,"arrayRemove");function KW(e){return e.filter(t=>t.tagName!=="A")}vi(KW,"removeLinks");var rRe=Object.defineProperty,jI=(e,t)=>rRe(e,"name",{value:t,configurable:!0}),zS=!1;function ZW(){const[e,t]=b.useState(zS);return b.useEffect(()=>{zS||(zS=!0,t(!0))},[]),e}jI(ZW,"useIsHydrated");var YW=Ua[" useSyncExternalStore ".trim().toString()];function QW(){return()=>{}}jI(QW,"subscribe");function XW(){return YW(QW,()=>!0,()=>!1)}jI(XW,"useIsHydratedModern");var iRe=typeof YW=="function"?XW:ZW,sRe=Object.defineProperty,zc=(e,t)=>sRe(e,"name",{value:t,configurable:!0}),VS="rovingFocusGroup.onEntryFocus",oRe={bubbles:!1,cancelable:!0},X_="RovingFocusGroup",[Uk,JW,aRe]=Q_(X_),[lRe,eG]=$s(X_,[aRe]),[uRe,cRe]=lRe(X_),dRe=b.forwardRef(zc(function(t,n){return g.jsx(Uk.Provider,{scope:t.__scopeRovingFocusGroup,children:g.jsx(Uk.Slot,{scope:t.__scopeRovingFocusGroup,children:g.jsx(fRe,{...t,ref:n})})})},"RovingFocusGroup")),fRe=b.forwardRef(zc(function(t,n){const{__scopeRovingFocusGroup:r,orientation:i,loop:s=!1,dir:o,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:f,preventScrollOnEntryFocus:d=!1,...p}=t,m=b.useRef(null),v=At(n,m),_=vg(o),[w,x]=_c({prop:a,defaultProp:l??null,onChange:u,caller:X_}),[S,C]=b.useState(!1),R=Sr(f),P=JW(r),k=b.useRef(!1),[I,D]=b.useState(0);return b.useEffect(()=>{const L=m.current;if(L)return L.addEventListener(VS,R),()=>L.removeEventListener(VS,R)},[R]),g.jsx(uRe,{scope:r,orientation:i,dir:_,loop:s,currentTabStopId:w,onItemFocus:b.useCallback(L=>x(L),[x]),onItemShiftTab:b.useCallback(()=>C(!0),[]),onFocusableItemAdd:b.useCallback(()=>D(L=>L+1),[]),onFocusableItemRemove:b.useCallback(()=>D(L=>L-1),[]),children:g.jsx(Vt.div,{tabIndex:S||I===0?-1:0,"data-orientation":i,...p,ref:v,style:{outline:"none",...t.style},onMouseDown:Ue(t.onMouseDown,()=>{k.current=!0}),onFocus:Ue(t.onFocus,L=>{const A=!k.current;if(L.target===L.currentTarget&&A&&!S){const $=new CustomEvent(VS,oRe);if(L.currentTarget.dispatchEvent($),!$.defaultPrevented){const j=P().filter(G=>G.focusable),V=j.find(G=>G.active),B=j.find(G=>
123G.id===w),te=[V,B,...j].filter(Boolean).map(G=>G.ref.current);LI(te,d)}}k.current=!1}),onBlur:Ue(t.onBlur,()=>C(!1))})})},"RovingFocusGroupImpl")),hRe="RovingFocusGroupItem",pRe=b.forwardRef(zc(function(t,n){const{__scopeRovingFocusGroup:r,focusable:i=!0,active:s=!1,tabStopId:o,children:a,...l}=t,u=Vl(),f=o||u,d=cRe(hRe,r),p=d.currentTabStopId===f,m=JW(r),{onFocusableItemAdd:v,onFocusableItemRemove:_,currentTabStopId:w}=d,x=iRe();return $n(()=>{if(!(!x||!i))return v(),()=>_()},[x,i,v,_]),b.useEffect(()=>{if(!(x||!i))return v(),()=>_()},[x,i,v,_]),g.jsx(Uk.ItemSlot,{scope:r,id:f,focusable:i,active:s,children:g.jsx(Vt.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:Ue(t.onMouseDown,S=>{i?d.onItemFocus(f):S.preventDefault()}),onFocus:Ue(t.onFocus,()=>d.onItemFocus(f)),onKeyDown:Ue(t.onKeyDown,S=>{if(S.key==="Tab"&&S.shiftKey){d.onItemShiftTab();return}if(S.target!==S.currentTarget)return;const C=nG(S,d.orientation,d.dir);if(C!==void 0){if(S.metaKey||S.ctrlKey||S.altKey||S.shiftKey)return;S.preventDefault();let P=m().filter(k=>k.focusable).map(k=>k.ref.current);if(C==="last")P.reverse();else if(C==="prev"||C==="next"){C==="prev"&&P.reverse();const k=P.indexOf(S.currentTarget);P=d.loop?rG(P,k+1):P.slice(k+1)}setTimeout(()=>LI(P))}}),children:typeof a=="function"?a({isCurrentTabStop:p,hasTabStop:w!=null}):a})})},"RovingFocusGroupItem")),mRe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tG(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}zc(tG,"getDirectionAwareKey");function nG(e,t,n){const r=tG(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mRe[r]}zc(nG,"getFocusIntent");function LI(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}zc(LI,"focusFirst");function rG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}zc(rG,"wrapArray");var gRe=dRe,vRe=pRe,iG=Lq(),US=function(){},J_=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:US,onWheelCapture:US,onTouchMoveCapture:US}),i=r[0],s=r[1],o=e.forwardProps,a=e.children,l=e.className,u=e.removeScrollBar,f=e.enabled,d=e.shards,p=e.sideCar,m=e.noRelative,v=e.noIsolation,_=e.inert,w=e.allowPinchZoom,x=e.as,S=x===void 0?"div":x,C=e.gapMode,R=yI(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=p,k=jq([n,t]),I=Xr(Xr({},R),i);return b.createElement(b.Fragment,null,f&&b.createElement(P,{sideCar:iG,removeScrollBar:u,shards:d,noRelative:m,noIsolation:v,inert:_,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:C}),o?b.cloneElement(b.Children.only(a),Xr(Xr({},I),{ref:k})):b.createElement(S,Xr({},I,{className:l,ref:k}),a))});J_.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};J_.classNames={fullWidth:im,zeroRight:rm};var Bk=!1;if(typeof window<"u")try{var Oy=Object.defineProperty({},"passive",{get:function(){return Bk=!0,!0}});window.addEventListener("test",Oy,Oy),window.removeEventListener("test",Oy,Oy)}catch{Bk=!1}var Od=Bk?{passive:!1}:!1,yRe=function(e){return e.tagName==="TEXTAREA"},sG=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!yRe(e)&&n[t]==="visible")},bRe=function(e){return sG(e,"overflowY")},_Re=function(e){return sG(e,"overflowX")},$4=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=oG(e,r);if(i){var s=aG(e,r),o=s[1],a=s[2];if(o>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},wRe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},xRe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},oG=function(e,t){return e==="v"?bRe(t):_Re(t)},aG=function(e,t){return e==="v"?wRe(t):xRe(t)},SRe=function(e,t){return e==="h"&&t==="rtl"?-1:1},ERe=function(e,t,n,r,i){var s=SRe(e,window.getComputedStyle(t).direction),o=s*r,a=n.target,l=t.contains(a),u=!1,f=o>0,d=0,p=0;
vendor: 10,920 bytes, lines 123-126
123do{if(!a)break;var m=aG(e,a),v=m[0],_=m[1],w=m[2],x=_-w-s*v;(v||x)&&oG(e,a)&&(d+=x,p+=v);var S=a.parentNode;a=S&&S.nodeType===Node.DOCUMENT_FRAGMENT_NODE?S.host:S}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(f&&Math.abs(d)<1||!f&&Math.abs(p)<1)&&(u=!0),u},Dy=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},z4=function(e){return[e.deltaX,e.deltaY]},V4=function(e){return e&&"current"in e?e.current:e},CRe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kRe=function(e){return`
124  .block-interactivity-`.concat(e,` {pointer-events: none;}
125  .allow-interactivity-`).concat(e,` {pointer-events: all;}
126`)},TRe=0,Dd=[];function PRe(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(TRe++)[0],s=b.useState(bI)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var _=Nq([e.lockRef.current],(e.shards||[]).map(V4),!0).filter(Boolean);return _.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),_.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var a=b.useCallback(function(_,w){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!o.current.allowPinchZoom;var x=Dy(_),S=n.current,C="deltaX"in _?_.deltaX:S[0]-x[0],R="deltaY"in _?_.deltaY:S[1]-x[1],P,k=_.target,I=Math.abs(C)>Math.abs(R)?"h":"v";if("touches"in _&&I==="h"&&k.type==="range")return!1;var D=window.getSelection(),L=D&&D.anchorNode,A=L?L===k||L.contains(k):!1;if(A)return!1;var $=$4(I,k);if(!$)return!0;if($?P=I:(P=I==="v"?"h":"v",$=$4(I,k)),!$)return!1;if(!r.current&&"changedTouches"in _&&(C||R)&&(r.current=P),!P)return!0;var j=r.current||P;return ERe(j,w,_,j==="h"?C:R)},[]),l=b.useCallback(function(_){var w=_;if(!(!Dd.length||Dd[Dd.length-1]!==s)){var x="deltaY"in w?z4(w):Dy(w),S=t.current.filter(function(P){return P.name===w.type&&(P.target===w.target||w.target===P.shadowParent)&&CRe(P.delta,x)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var C=(o.current.shards||[]).map(V4).filter(Boolean).filter(function(P){return P.contains(w.target)}),R=C.length>0?a(w,C[0]):!o.current.noIsolation;R&&w.cancelable&&w.preventDefault()}}},[]),u=b.useCallback(function(_,w,x,S){var C={name:_,delta:w,target:x,should:S,shadowParent:RRe(x)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(R){return R!==C})},1)},[]),f=b.useCallback(function(_){n.current=Dy(_),r.current=void 0},[]),d=b.useCallback(function(_){u(_.type,z4(_),_.target,a(_,e.lockRef.current))},[]),p=b.useCallback(function(_){u(_.type,Dy(_),_.target,a(_,e.lockRef.current))},[]);b.useEffect(function(){return Dd.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Od),document.addEventListener("touchmove",l,Od),document.addEventListener("touchstart",f,Od),function(){Dd=Dd.filter(function(_){return _!==s}),document.removeEventListener("wheel",l,Od),document.removeEventListener("touchmove",l,Od),document.removeEventListener("touchstart",f,Od)}},[]);var m=e.removeScrollBar,v=e.inert;return b.createElement(b.Fragment,null,v?b.createElement(s,{styles:kRe(i)}):null,m?b.createElement(Vq,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function RRe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const IRe=$q(iG,PRe);var ew=b.forwardRef(function(e,t){return b.createElement(J_,Xr({},e,{ref:t,sideCar:IRe}))});ew.classNames=J_.classNames;var ORe=Object.defineProperty,en=(e,t)=>ORe(e,"name",{value:t,configurable:!0}),Hk=["Enter"," "],DRe=["ArrowDown","PageUp","Home"],lG=["ArrowUp","PageDown","End"],ARe=[...DRe,...lG],MRe={ltr:[...Hk,"ArrowRight"],rtl:[...Hk,"ArrowLeft"]},NRe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tw="Menu",[Um,jRe,LRe]=Q_(tw),[Vc,uG]=$s(tw,[LRe,rh,eG]),FI=rh(),cG=eG(),[FRe,Uc]=Vc(tw),[$Re,Eg]=Vc(tw),zRe=en(e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:o=!0}=e,a=FI(t),[l,u]=b.useState(null),f=b.useRef(!1),d=Sr(s),p=vg(i);return b.useEffect(()=>{const m=en(()=>{f.current=!0,document.addEventListener("pointerdown",v,{capture:!0,once:!0}),document.addEventListener("pointermove",v,{capture:!0,once:!0})},"handleKeyDown"),v=en(()=>f.current=!1,"handlePointer");return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",v,{capture:!0}),document.removeEventListener("pointermove",v,{capture:!0})}},[]),b.useEffect(()=>{if(!n)return;const m=en(()=>d(!1),"handleBlur");return window.addEventListener("blur",m),()=>window.removeEventListener("blur",m)},[n,d]),g.jsx(uR,{...a,children:g.jsx(FRe,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:u,children:g.jsx($Re,{scope:t,onClose:b.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:f,dir:p,modal:o,children:r})})})},"Menu"),dG=b.forwardRef(en(function(t,n){const{__scopeMenu:r,...i}=t,s=FI(r);return g.jsx(cR,{...s,...i,ref:n})},"MenuAnchor")),fG="MenuPortal",[VRe,hG]=Vc(fG,{forceMount:void 0}),URe=en(e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=Uc(fG,t);return g.jsx(VRe,{scope:t,forceMount:n,children:g.jsx(as,{present:n||s.open,children:g.jsx(fR,{asChild:!0,container:i,children:r})})})},"MenuPortal"),uo="MenuContent",[BRe,$I]=Vc(uo),HRe=b.forwardRef(en(function(t,n){const r=hG(uo,t.__scopeMenu),{forceMount:i=r.forceMount,...s}=t,o=Uc(uo,t.__scopeMenu),a=Eg(uo,t.__scopeMenu);return g.jsx(Um.Provider,{scope:t.__scopeMenu,children:g.jsx(as,{present:i||o.open,children:g.jsx(Um.Slot,{scope:t.__scopeMenu,children:a.modal?g.jsx(qRe,{...s,ref:n}):g.jsx(WRe,{...s,ref:n})})})})},"MenuContent")),qRe=b.forwardRef(en(function(t,n){const r=Uc(uo,t.__scopeMenu),i=b.useRef(null),s=At(n,i);return b.useEffect(()=>{const o=i.current;if(o)return _g(o)},[]),g.jsx(zI,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:Ue(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentModal")),WRe=b.forwardRef(en(function(t,n){const r=Uc(uo,t.__scopeMenu);return g.jsx(zI,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})},"MenuRootContentNonModal")),GRe=Zo("MenuContent.ScrollLock"),zI=b.forwardRef(en(function(t,n){const{__scopeMenu:r,loop:i=!1,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:u,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:v,disableOutsideScroll:_,...w}=t,x=Uc(uo,r),S=Eg(uo,r),C=FI(r),R=cG(r),P=jRe(r),[k,I]=b.useState(null),D=b.useRef(null),L=At(n,D,x.onContentChange),A=b.useRef(0),$=b.useRef(""),j=b.useRef(0),V=b.useRef(null),B=b.useRef("right"),H=b.useRef(0),te=_?ew:b.Fragment,G=_?{as:GRe,allowPinchZoom:!0}:void 0,Z=en(M=>{const q=$.current+M,z=P().filter(se=>!se.disabled),N=document.activeElement,ee=z.find(se=>se.ref.current===N)?.textValue,X=z.map(se=>se.textValue),ne=_G(X,q,ee),ae=z.find(se=>se.textValue===ne)?.ref.current;en((function se(ce){$.current=ce,window.clearTimeout(A.current),ce!==""&&(A.current=window.setTimeout(()=>se(""),1e3))}),"updateSearch")(q),ae&&setTimeout(()=>ae.focus())},"handleTypeaheadSearch");b.useEffect(()=>()=>window.clearTimeout(A.current),[]),Sg();const Y=b.useCallback(M=>B.current===V.current?.side&&xG(M,V.current?.area),[]);return g.jsx(BRe,{scope:r,searchRef:$,onItemEnter:b.useCallback(M=>{Y(M)&&M.preventDefault()},[Y]),onItemLeave:b.useCallback(M=>{Y(M)||(D.current?.focus(),I(null))},[Y]),onTriggerLeave:b.useCallback(M=>{Y(M)&&M.preventDefault()},[Y]),pointerGraceTimerRef:j,onPointerGraceIntentChange:b.useCallback(M=>{V.current=M},[]),children:g.jsx(te,{...G,children:g.jsx(MI,{asChild:!0,trapped:s,onMountAutoFocus:Ue(o,M=>{M.preventDefault(),D.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:g.jsx(x_,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:f,onPointerDownOutside:d,onFocusOutside:p,onInteractOutside:m,onDismiss:v,children:g.jsx(gRe,{asChild:!0,...R,dir:S.dir,orientation:"vertical",loop:i,currentTabStopId:k,onCurrentTabStopIdChange:I,onEntryFocus:Ue(u,M=>{S.isUsingKeyboardRef.current||M.preventDefault()}),preventScrollOnEntryFocus:!0,children:g.jsx(dR,{role:"menu","aria-orientation":"vertical","data-state":UI(x.open),"data-radix-menu-content":"",dir:S.dir,...C,...w,ref:L,style:{outline:"none",...w.style},onKeyDown:Ue(w.onKeyDown,M=>{const z=M.target.closest("[data-radix-menu-content]")===M.currentTarget,N=M.ctrlKey||M.altKey||M.metaKey,ee=M.key.length===1;z&&(M.key==="Tab"&&M.preventDefault(),!N&&ee&&Z(M.key));const X=D.current;if(M.target!==X||!ARe.includes(M.key))return;M.preventDefault();const ae=P().filter(se=>!se.disabled).map(se=>se.ref.current);lG.includes(M.key)&&ae.reverse(),yG(ae)}),onBlur:Ue(t.onBlur,M=>{M.currentTarget.contains(M.target)||(window.clearTimeout(A.current),$.current="")}),onPointerMove:Ue(t.onPointerMove,Bf(M=>{const q=M.target,z=H.current!==M.clientX;if(M.currentTarget.contains(q)&&z){const N=M.clientX>H.current?"right":"left";B.current=N,H.current=M.clientX}}))})})})})})})},"MenuContentImpl")),KRe=b.forwardRef(en(function(t,n){const{__scopeMenu:r,...i}=t;return g.jsx(Vt.div,{...i,ref:n})},"MenuLabel")),qk="MenuItem",U4="menu.itemSelect",VI=b.forwardRef(en(function(t,n){const{disabled:r=!1,onSelect:i,...s}=t,o=b.useRef(null),a=Eg(qk,t.__scopeMenu),l=$I(qk,t.__scopeMenu),u=At(n,o),f=b.useRef(!1),d=en(()=>{const p=o.current;if(!r&&p){const m=new CustomEvent(U4,{bubbles:!0,cancelable:!0});p.addEventListener(U4,v=>i?.(v),{once:!0}),JP(p,m),m.defaultPrevented?f.current=!1:a.onClose()}},"handleSelect");return g.jsx(pG,{...s,ref:u,disabled:r,onClick:Ue(t.onClick,d),onPointerDown:p=>{t.onPointerDown?.(p),f.current=!0},onPointerUp:Ue(t.onPointerUp,p=>{f.current||p.currentTarget?.click()}),onKeyDown:Ue(t.onKeyDown,p=>{r||p.target!==p.currentTarget||l.searchRef.current!==""&&p.key===" "||Hk.includes(p.key)&&(p.currentTarget.click(),p.preventDefault())})})},"MenuItem")),pG=b.forwardRef(en(function(t,n){const{__scopeMenu:r,disabled:i=!1,textValue:s,...o}=t,a=$I(qk,r),l=cG(r),u=b.useRef(null),f=At(n,u),[d,p]=b.useState(!1),[m,v]=b.useState("");return b.useEffect(()=>{const _=u.current;_&&v((_.textContent??"").trim())},[o.children]),g.jsx(Um.ItemSlot,{scope:r,disabled:i,textValue:s??m,children:g.jsx(vRe,{asChild:!0,...l,focusable:!i,children:g.jsx(Vt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":i||void 0,"data-disabled":i?"":void 0,...o,ref:f,onPointerMove:Ue(t.onPointerMove,Bf(_=>{i?a.onItemLeave(_):(a.onItemEnter(_),_.defaultPrevented||_.currentTarget.focu
126s({preventScroll:!0}))})),onPointerLeave:Ue(t.onPointerLeave,Bf(_=>a.onItemLeave(_))),onFocus:Ue(t.onFocus,()=>p(!0)),onBlur:Ue(t.onBlur,()=>p(!1))})})})},"MenuItemImpl")),ZRe=b.forwardRef(en(function(t,n){const{checked:r=!1,onCheckedChange:i,...s}=t;return g.jsx(gG,{scope:t.__scopeMenu,checked:r,children:g.jsx(VI,{role:"menuitemcheckbox","aria-checked":Bm(r)?"mixed":r,...s,ref:n,"data-state":nw(r),onSelect:Ue(s.onSelect,()=>i?.(Bm(r)?!0:!r),{checkForDefaultPrevented:!1})})})},"MenuCheckboxItem")),YRe="MenuRadioGroup",[bHe,QRe]=Vc(YRe,{value:void 0,onValueChange:en(()=>{},"onValueChange")}),XRe="MenuRadioItem",JRe=b.forwardRef(en(function(t,n){const{value:r,...i}=t,s=QRe(XRe,t.__scopeMenu),o=r===s.value;return g.jsx(gG,{scope:t.__scopeMenu,checked:o,children:g.jsx(VI,{role:"menuitemradio","aria-checked":o,...i,ref:n,"data-state":nw(o),onSelect:Ue(i.onSelect,()=>s.onValueChange?.(r),{checkForDefaultPrevented:!1})})})},"MenuRadioItem")),mG="MenuItemIndicator",[gG,eIe]=Vc(mG,{checked:!1}),tIe=b.forwardRef(en(function(t,n){const{__scopeMenu:r,forceMount:i,...s}=t,o=eIe(mG,r);return g.jsx(as,{present:i||Bm(o.checked)||o.checked===!0,children:g.jsx(Vt.span,{...s,ref:n,"data-state":nw(o.checked)})})},"MenuItemIndicator")),nIe=b.forwardRef(en(function(t,n){const{__scopeMenu:r,...i}=t;return g.jsx(Vt.div,{role:"separator","aria-orientation":"horizontal",...i,ref:n})},"MenuSeparator")),rIe="MenuSub",[_He,vG]=Vc(rIe),Ay="MenuSubTrigger",iIe=b.forwardRef(en(function(t,n){const r=Uc(Ay,t.__scopeMenu),i=Eg(Ay,t.__scopeMenu),s=vG(Ay,t.__scopeMenu),o=$I(Ay,t.__scopeMenu),a=b.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:u}=o,f={__scopeMenu:t.__scopeMenu},d=b.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);b.useEffect(()=>d,[d]),b.useEffect(()=>{const m=l.current;return()=>{window.clearTimeout(m),u(null)}},[l,u]);const p=At(n,s.onTriggerChange);return g.jsx(dG,{asChild:!0,...f,children:g.jsx(pG,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":r.open?s.contentId:void 0,"data-state":UI(r.open),...t,ref:p,onClick:m=>{t.onClick?.(m),!(t.disabled||m.defaultPrevented)&&(m.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:Ue(t.onPointerMove,Bf(m=>{o.onItemEnter(m),!m.defaultPrevented&&!t.disabled&&!r.open&&!a.current&&(o.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:Ue(t.onPointerLeave,Bf(m=>{d();const v=r.content?.getBoundingClientRect();if(v){const _=r.content?.dataset.side,w=_==="right",x=w?-5:5,S=v[w?"left":"right"],C=v[w?"right":"left"];o.onPointerGraceIntentChange({area:[{x:m.clientX+x,y:m.clientY},{x:S,y:v.top},{x:C,y:v.top},{x:C,y:v.bottom},{x:S,y:v.bottom}],side:_}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>o.onPointerGraceIntentChange(null),300)}else{if(o.onTriggerLeave(m),m.defaultPrevented)return;o.onPointerGraceIntentChange(null)}})),onKeyDown:Ue(t.onKeyDown,m=>{t.disabled||m.target!==m.currentTarget||o.searchRef.current!==""&&m.key===" "||MRe[i.dir].includes(m.key)&&(r.onOpenChange(!0),r.content?.focus(),m.preventDefault())})})})},"MenuSubTrigger")),sIe="MenuSubContent",oIe=b.forwardRef(en(function(t,n){const r=hG(uo,t.__scopeMenu),{forceMount:i=r.forceMount,align:s="start",...o}=t,a=Uc(uo,t.__scopeMenu),l=Eg(uo,t.__scopeMenu),u=vG(sIe,t.__scopeMenu),f=b.useRef(null),d=At(n,f);return g.jsx(Um.Provider,{scope:t.__scopeMenu,children:g.jsx(as,{present:i||a.open,children:g.jsx(Um.Slot,{scope:t.__scopeMenu,children:g.jsx(zI,{id:u.contentId,"aria-labelledby":u.triggerId,...o,ref:d,align:s,side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{l.isUsingKeyboardRef.current&&f.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:Ue(t.onFocusOutside,p=>{p.target!==u.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Ue(t.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:Ue(t.onKeyDown,p=>{const m=p.currentTarget.contains(p.target),v=NRe[l.dir].includes(p.key);m&&v&&(a.onOpenChange(!1),u.trigger?.focus(),p.preventDefault())})})})})})},"MenuSubContent"));function UI(e){return e?"open":"closed"}en(UI,"getOpenState");function Bm(e){return e==="indeterminate"}en(Bm,"isIndeterminate");function nw(e){return Bm(e)?"indeterminate":e?"checked":"unchecked"}en(nw,"getCheckedState");function yG(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}en(yG,"focusFirst");function bG(e,t){return e.map((n,r)=>e[(t+r)%e.length])}en(bG,"wrapArray");function _G(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=bG(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}en(_G,"getNextMatch");function wG(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,o=t.length-1;s<t.length;o=s++){const a=t[s],l=t[o],u=a.x,f=a.y,d=l.x,p=l.y;f>r!=p>r&&n<(d-u)*(r-f)/(p-f)+u&&(i=!i)}return i}en(wG,"isPointInPolygon");function xG(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return wG(n,t)}en(xG,"isPointerInGraceArea");function Bf(e){return t=>t.pointerType==="mouse"?e(t):void 0}en(Bf,"whenMouse");var aIe=zRe,lIe=dG,uIe=URe,cIe=HRe,dIe=KRe,fIe=VI,hIe=ZRe,pIe=JRe,mIe=tIe,gIe=nIe,vIe=iIe,yIe=oIe,bIe=Object.defineProperty,bi=(e,t)=>bIe(e,"name",{value:t,configurable:!0}
126),BI="ContextMenu",[_Ie,wHe]=$s(BI,[uG]),Vs=uG(),[wIe,SG]=_Ie(BI),xIe=bi(e=>{const{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,dir:s,modal:o=!0}=e,a=b.useRef(!1),[l,u]=_c({prop:i,defaultProp:!1,onChange:r,caller:BI}),f=Vs(t);return g.jsx(wIe,{scope:t,open:l,onOpenChange:u,modal:o,hasInteractedRef:a,children:g.jsx(aIe,{...f,dir:s,open:l,onOpenChange:u,modal:o,children:n})})},"ContextMenu"),SIe="ContextMenuTrigger",EIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,disabled:i=!1,...s}=t,o=SG(SIe,r),a=Vs(r),[l,u]=b.useState({x:0,y:0}),f=b.useMemo(()=>({current:{getBoundingClientRect:bi(()=>DOMRect.fromRect({width:0,height:0,...l}),"getBoundingClientRect")}}),[l]),d=b.useRef(0),p=b.useCallback(()=>window.clearTimeout(d.current),[]),m=bi(v=>{o.hasInteractedRef.current=!0,u({x:v.clientX,y:v.clientY}),o.onOpenChange(!0)},"handleOpen");return b.useEffect(()=>p,[p]),b.useEffect(()=>void(i&&p()),[i,p]),g.jsxs(g.Fragment,{children:[g.jsx(lIe,{...a,virtualRef:f}),g.jsx(Vt.span,{"data-state":o.open?"open":"closed","data-disabled":i?"":void 0,...s,ref:n,style:{WebkitTouchCallout:"none",...t.style},onContextMenu:i?t.onContextMenu:Ue(t.onContextMenu,v=>{p(),m(v),v.preventDefault()}),onPointerDown:i?t.onPointerDown:Ue(t.onPointerDown,Vp(v=>{p(),o.open&&o.onOpenChange(!1),d.current=window.setTimeout(()=>m(v),700)})),onPointerMove:i?t.onPointerMove:Ue(t.onPointerMove,Vp(p)),onPointerCancel:i?t.onPointerCancel:Ue(t.onPointerCancel,Vp(p)),onPointerUp:i?t.onPointerUp:Ue(t.onPointerUp,Vp(p))})]})},"ContextMenuTrigger")),CIe=bi(e=>{const{__scopeContextMenu:t,...n}=e,r=Vs(t);return g.jsx(uIe,{...r,...n})},"ContextMenuPortal"),kIe="ContextMenuContent",TIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=SG(kIe,r),o=Vs(r),a=b.useRef(!1);return g.jsx(cIe,{...o,...i,ref:n,side:"right",sideOffset:2,align:"start",onCloseAutoFocus:l=>{t.onCloseAutoFocus?.(l),!l.defaultPrevented&&a.current&&l.preventDefault(),a.current=!1},onInteractOutside:l=>{t.onInteractOutside?.(l),!l.defaultPrevented&&!s.modal&&(a.current=!0)},style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuContent")),PIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(dIe,{...s,...i,ref:n})},"ContextMenuLabel")),RIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(fIe,{...s,...i,ref:n})},"ContextMenuItem")),IIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(hIe,{...s,...i,ref:n})},"ContextMenuCheckboxItem")),OIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(pIe,{...s,...i,ref:n})},"ContextMenuRadioItem")),DIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(mIe,{...s,...i,ref:n})},"ContextMenuItemIndicator")),AIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(gIe,{...s,...i,ref:n})},"ContextMenuSeparator")),MIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(vIe,{...s,...i,ref:n})},"ContextMenuSubTrigger")),NIe=b.forwardRef(bi(function(t,n){const{__scopeContextMenu:r,...i}=t,s=Vs(r);return g.jsx(yIe,{...s,...i,ref:n,style:{...t.style,"--radix-context-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-context-menu-content-available-width":"var(--radix-popper-available-width)","--radix-context-menu-content-available-height":"var(--radix-popper-available-height)","--radix-context-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-context-menu-trigger-height":"var(--radix-popper-anchor-height)"}})},"ContextMenuSubContent"));function Vp(e){return t=>t.pointerType!=="mouse"?e(t):void 0}bi(Vp,"whenTouchOrPen");
126var jIe=xIe,LIe=EIe,FIe=CIe,EG=TIe,CG=PIe,kG=RIe,TG=IIe,PG=OIe,RG=DIe,IG=AIe,OG=MIe,DG=NIe;const $Ie=jIe,zIe=LIe,VIe=b.forwardRef(({className:e,inset:t,children:n,...r},i)=>g.jsxs(OG,{ref:i,className:_e("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",t&&"pl-8",e),...r,children:[n,g.jsx(Jb,{className:"ml-auto size-4"})]}));VIe.displayName=OG.displayName;const UIe=b.forwardRef(({className:e,...t},n)=>g.jsx(DG,{ref:n,className:_e("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));UIe.displayName=DG.displayName;const AG=b.forwardRef(({className:e,...t},n)=>g.jsx(FIe,{children:g.jsx(EG,{ref:n,className:_e("z-50 min-w-32 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t})}));AG.displayName=EG.displayName;const Up=b.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(kG,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...n}));Up.displayName=kG.displayName;const BIe=b.forwardRef(({className:e,children:t,checked:n,...r},i)=>g.jsxs(TG,{ref:i,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[g.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(RG,{children:g.jsx(ng,{className:"size-4"})})}),t]}));BIe.displayName=TG.displayName;const HIe=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(PG,{ref:r,className:_e("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute left-2 flex size-3.5 items-center justify-center",children:g.jsx(RG,{children:g.jsx(Oz,{className:"size-2 fill-current"})})}),t]}));HIe.displayName=PG.displayName;const qIe=b.forwardRef(({className:e,inset:t,...n},r)=>g.jsx(CG,{ref:r,className:_e("px-2 py-1.5 text-sm font-semibold text-foreground",t&&"pl-8",e),...n}));qIe.displayName=CG.displayName;const WIe=b.forwardRef(({className:e,...t},n)=>g.jsx(IG,{ref:n,className:_e("-mx-1 my-1 h-px bg-border",e),...t}));WIe.displayName=IG.displayName;async function GIe(e,t=25){return(await et(`/links/?collection_id=${e}&per_page=${t}`)).data||[]}async function KIe(e=20){return(await et(`/links/?page=1&per_page=${e}`)).data||[]}async function xHe(e){return et(`/links/${e}`)}async function ZIe(e){return et("/links/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function YIe(e,t){return et(`/links/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...t})})}async function QIe(e){return et(`/links/${e}`,{method:"DELETE"})}async function SHe(e){return et("/bookmarks/import/",{method:"POST",body:e})}async function XIe(e,t=10){const n=new URLSearchParams({per_page:String(t),q:e});return(await et(`/links/search/?${n.toString()}`)).data||[]}const Wk=(e="-1")=>{const{data:t,isLoading:n,error:r,refetch:i}=hr({queryKey:["links",e?.toString()],queryFn:()=>GIe(e)});return{links:t,isLoading:n,error:r,refetch:i}},JIe=()=>{const e=Dr();return os({mutationFn:ZIe,onSuccess:()=>e.invalidateQueries({queryKey:["links"]})})},MG=()=>{const e=Dr();return os({mutationFn:t=>
126YIe(t.id,t),onSuccess:()=>e.invalidateQueries({queryKey:["link"]})})},e2e=()=>{const e=Dr();return os({mutationFn:QIe,onSuccess:()=>e.invalidateQueries({queryKey:["links"]})})},NG={LINK:"link"};var t2e=Object.defineProperty,ls=(e,t)=>t2e(e,"name",{value:t,configurable:!0}),HI="Dialog",[jG,LG]=$s(HI),[n2e,_o]=jG(HI),qI=ls(e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=b.useRef(null),l=b.useRef(null),[u,f]=_c({prop:r,defaultProp:i??!1,onChange:s,caller:HI}),[d,p]=b.useState(0),[m,v]=b.useState(0);return g.jsx(n2e,{scope:t,triggerRef:a,contentRef:l,contentId:Vl(),titleId:Vl(),descriptionId:Vl(),titlePresent:d>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:v,open:u,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(_=>!_),[f]),modal:o,children:n})},"Dialog"),r2e="DialogTrigger",WI=b.forwardRef(ls(function(t,n){const{__scopeDialog:r,...i}=t,s=_o(r2e,r),o=At(n,s.triggerRef);return g.jsx(Vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":rw(s.open),...i,ref:o,onClick:Ue(t.onClick,s.onOpenToggle)})},"DialogTrigger")),FG="DialogPortal",[i2e,$G]=jG(FG,{forceMount:void 0}),GI=ls(e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=_o(FG,t);return g.jsx(i2e,{scope:t,forceMount:n,children:b.Children.map(r,o=>g.jsx(as,{present:n||s.open,children:g.jsx(fR,{asChild:!0,container:i,children:o})}))})},"DialogPortal"),Gk="DialogOverlay",Cg=b.forwardRef(ls(function(t,n){const r=$G(Gk,t.__scopeDialog),{forceMount:i=r.forceMount,...s}=t,o=_o(Gk,t.__scopeDialog);return o.modal?g.jsx(as,{present:i||o.open,children:g.jsx(o2e,{...s,ref:n})}):null},"DialogOverlay")),s2e=Zo("DialogOverlay.RemoveScroll"),o2e=b.forwardRef(ls(function(t,n){const{__scopeDialog:r,...i}=t,s=_o(Gk,r),o=wU(),a=At(n,o);return g.jsx(ew,{as:s2e,allowPinchZoom:!0,shards:[s.contentRef],children:g.jsx(Vt.div,{"data-state":rw(s.open),...i,ref:a,style:{pointerEvents:"auto",...i.style}})})},"DialogOverlayImpl")),Hm="DialogContent",kg=b.forwardRef(ls(function(t,n){const r=$G(Hm,t.__scopeDialog),{forceMount:i=r.forceMount,...s}=t,o=_o(Hm,t.__scopeDialog);return g.jsx(as,{present:i||o.open,children:o.modal?g.jsx(a2e,{...s,ref:n}):g.jsx(l2e,{...s,ref:n})})},"DialogContent")),a2e=b.forwardRef(ls(function(t,n){const r=_o(Hm,t.__scopeDialog),i=b.useRef(null),s=At(n,r.contentRef,i);return b.useEffect(()=>{const o=i.current;if(o)return _g(o)},[]),g.jsx(zG,{...t,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:Ue(t.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ue(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&o.preventDefault()}),onFocusOutside:Ue(t.onFocusOutside,o=>o.preventDefault())})},"DialogContentModal")),l2e=b.forwardRef(ls(function(t,n){const r=_o(Hm,t.__scopeDialog),i=b.useRef(!1),s=b.useRef(!1);return g.jsx(zG,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{t.onCloseAutoFocus?.(o),o.defaultPrevented||(i.current||r.triggerRef.current?.focus(),o.preventDefault()),i.current=!1,s.current=!1},onInteractOutside:o=>{t.onInteractOutside?.(o),o.defaultPrevented||(i.current=!0,o.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=o.target;r.triggerRef.current?.contains(a)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&s.current&&o.preventDefault()}})},"DialogContentNonModal")),zG=b.forwardRef(ls(function(t,n){const{__scopeDialog:r,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:o,...a}=t,l=_o(Hm,r);return Sg(),g.jsx(g.Fragment,{children:g.jsx(MI,{asChild:!0,loop:!0,trapped:i,onMountAutoFocus:s,onUnmountAutoFocus:o,children:g.jsx(x_,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionPresent?l.descriptionId:void 0,"aria-labelledby":l.titlePresent?l.titleId:void 0,"data-state":rw(l.open),...a,ref:n,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})},"DialogContentImpl")),u2e="DialogTitle",Tg=b.forwardRef(ls(function(t,n){const{__scopeDialog:r,...i}=t,s=_o(u2e,r),{setTitleCount:o}=s;return $n(()=>(o(a=>a+1),()=>o(a=>a-1)),[o]),g.jsx(Vt.h2,{id:s.titleId,...i,ref:n})},"DialogTitle")),c2e="DialogDescription",Pg=b.forwardRef(ls(function(t,n){const{__scopeDialog:r,...i}=t,s=_o(c2e,r),{setDescriptionCount:o}=s;return $n(()=>(o(a=>a+1),()=>o(a=>a-1)),[o]),g.jsx(Vt.p,{id:s.descriptionId,...i,ref:n})},"DialogDescription")),d2e="DialogClose",Rg=b.forwardRef(ls(function(t,n){const{__scopeDialog:r,...i}=t,s=_o(d2e,r);return g.jsx(Vt.button,{type:"button",...i,ref:n,onClick:Ue(t.onClick,()=>s.onOpenChange(!1))})},"DialogClose"));function rw(e){return e?"open":"closed"}ls(rw,"getState");const KI=qI,f2e=WI,h2e=GI,p2e=Rg,VG=b.forwardRef(({className:e,...t},n)=>g.jsx(Cg,{ref:n,className:_e("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));VG.displayName=Cg.displayName;const iw=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(h2e,{children:[g.jsx(VG,{}),g.jsxs(kg,{ref:r,className:_e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
126nded-lg",e),...n,children:[t,g.jsxs(Rg,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[g.jsx(Jo,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));iw.displayName=kg.displayName;const ZI=({className:e,...t})=>g.jsx("div",{className:_e("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});ZI.displayName="DialogHeader";const YI=({className:e,...t})=>g.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});YI.displayName="DialogFooter";const QI=b.forwardRef(({className:e,...t},n)=>g.jsx(Tg,{ref:n,className:_e("text-lg font-semibold leading-none tracking-tight",e),...t}));QI.displayName=Tg.displayName;const UG=b.forwardRef(({className:e,...t},n)=>g.jsx(Pg,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));UG.displayName=Pg.displayName;function m2e(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var XI="Checkbox",[g2e]=iu(XI),[v2e,y2e]=g2e(XI),BG=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:o,disabled:a,value:l="on",onCheckedChange:u,form:f,...d}=e,[p,m]=b.useState(null),v=pr(t,R=>m(R)),_=b.useRef(!1),w=p?f||!!p.closest("form"):!0,[x=!1,S]=rg({prop:i,defaultProp:s,onChange:u}),C=b.useRef(x);return b.useEffect(()=>{const R=p?.form;if(R){const P=()=>S(C.current);return R.addEventListener("reset",P),()=>R.removeEventListener("reset",P)}},[p,S]),g.jsxs(v2e,{scope:n,state:x,disabled:a,children:[g.jsx(qt.button,{type:"button",role:"checkbox","aria-checked":Hl(x)?"mixed":x,"aria-required":o,"data-state":WG(x),"data-disabled":a?"":void 0,disabled:a,value:l,...d,ref:v,onKeyDown:yt(e.onKeyDown,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:yt(e.onClick,R=>{S(P=>Hl(P)?!0:!P),w&&(_.current=R.isPropagationStopped(),_.current||R.stopPropagation())})}),w&&g.jsx(b2e,{control:p,bubbles:!_.current,name:r,value:l,checked:x,required:o,disabled:a,form:f,style:{transform:"translateX(-100%)"},defaultChecked:Hl(s)?!1:s})]})});BG.displayName=XI;var HG="CheckboxIndicator",qG=b.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=y2e(HG,n);return g.jsx(ea,{present:r||Hl(s.state)||s.state===!0,children:g.jsx(qt.span,{"data-state":WG(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});qG.displayName=HG;var b2e=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...s}=e,o=b.useRef(null),a=m2e(n),l=vq(t);b.useEffect(()=>{const f=o.current,d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(a!==n&&m){const v=new Event("click",{bubbles:r});f.indeterminate=Hl(n),m.call(f,Hl(n)?!1:n),f.dispatchEvent(v)}},[a,n,r]);const u=b.useRef(Hl(n)?!1:n);return g.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??u.current,...s,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Hl(e){return e==="indeterminate"}function WG(e){return Hl(e)?"indeterminate":e?"checked":"unchecked"}var GG=BG,_2e=qG;const w2e=b.forwardRef(({className:e,...t},n)=>g.jsx(GG,{ref:n,className:_e("peer size-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:g.jsx(_2e,{className:_e("flex items-center justify-center text-current"),children:g.jsx(ng,{className:"size-4"})})}));w2e.displayName=GG.displayName;const x2e=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{className:"relative w-full overflow-auto",children:g.jsx("table",{ref:n,className:_e("w-full caption-bottom text-sm",e),...t})}));x2e.displayName="Table";const S2e=b.forwardRef(({className:e,...t},n)=>g.jsx("thead",{ref:n,className:_e("[&_tr]:border-b",e),...t}));S2e.displayName="TableHeader";const E2e=b.forwardRef(({className:e,...t},n)=>g.jsx("tbody",{ref:n,className:_e("[&_tr:last-child]:border-0",e),...t}));E2e.displayName="TableBody";const C2e=b.forwardRef(({className:e,...t},n)=>g.jsx("tfoot",{ref:n,className:_e("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));C2e.displayName="TableFooter";const k2e=b.forwardRef(({className:e,...t},n)=>g.jsx("tr",{ref:n,className:_e("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));k2e.displayName="TableRow";const T2e=b.forwardRef(({className:e,...t},n)=>g.jsx("th",{ref:n,className:_e("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));T2e.displayName="TableHead";const P2e=b.forwardRef(({className:e,...t},n)=>g.jsx("td",{ref:n,className:_e("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));P2e.displayName="TableCell";const R2e=b.forwardRef(({className:e,...t},n)=>g.jsx("caption",{ref:n,className:_e("mt-4 text-sm text-muted-foreground",e),...t}));R2e.displayName="TableCaption";function jo({className:e,...t}){return g.jsx("div",{className:_e("animate-pulse rounded-md bg-primary/10",e),...t})}const I2e=()=>g.jsxs("div",{className:"flex flex-col space-y-3",children:[g.jsx(jo,{className:"h-[125px] w-[400px] rounded-xl"}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jo,{className:"h-4 w-full"}),g.jsx(jo,{className:"h-4 w-full"})]})]}),EHe=()=>g.jsx("div",{className:"bg-color/50 fixed inset-0 z-50 flex items-center justify-center",children:g.jsx("div",{className:"size-16 animate-spin rounded-full border-y-2 border-gray-900 dark:border-primary"})}),CHe=()=>g.jsxs("div",{className:"flex w-full flex-col space-y-3",children:[g.jsx(jo,{className:"h-[125px] w-full rounded-xl"}),g.jsxs("div",{className:"space-y-2",children:[g.jsx(jo,{className:"h-4 w-full"}),g.jsx(jo,{className:"h-4 w-full"}),g.jsx(jo,{className:"h-4 w-full"})]})]});var O2e=Object.defineProperty,Wa=(e,t)=>O2e(e,"name",{value:t,configurable:!0}),D2e="AlertDialog",[A2e,kHe]=$s(D2e,[LG]),Ga=LG(),M2e=Wa(e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return g.jsx(qI,{...r,...n,modal:!0})},"AlertDialog"),N2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,...i}=t,s=Ga(r);return g.jsx(WI,{...s,...i,ref:n})},"AlertDialogTrigger")),j2e=Wa(e=>{const{__scopeAlertDialog:t,...n}=e,r=Ga(t);return g.jsx(GI,{...r,...n})},"AlertDialogPortal"),L2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,...i}=t,s=Ga(r);return g.jsx(Cg,{...s,...i,ref:n})},"AlertDialogOverlay")),F2e="AlertDialogContent",[$2e,z2e]=A2e(F2e),V2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,children:i,...s}=t,o=Ga(r),a=b.useRef(null),l=At(n,a),u=b.useRef(null);return g.jsx($2e,{scope:r,cancelRef:u,children:g.jsx(kg,{role:"alertdialog",...o,...s,ref:l,onOpenAutoFocus:Ue(s.onOpenAutoFocus,f=>{f.preventDefault(),u.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:i})})},"AlertDialogContent")),U2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,...i}=t,s=Ga(r);return g.jsx(Tg,{...s,...i,ref:n})},"AlertDialogTitle")),B2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,...i}=t,s=Ga(r);return g.jsx(Pg,{...s,...i,ref:n})},"AlertDialogDescription")),H2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,...i}=t,s=Ga(r);return g.jsx(Rg,{...s,...i,ref:n})},"AlertDialogAction")),q2e="AlertDialogCancel",W2e=b.forwardRef(Wa(function(t,n){const{__scopeAlertDialog:r,...i}=t,{cancelRef:s}=z2e(q2e,r),o=Ga(r),a=At(n,s);return g.jsx(Rg,{...o,...i,ref:a})},"AlertDialogCancel")),G2e=M2e,K2e=N2e,Z2e=j2e,KG=L2e,ZG=V2e,YG=H2e,QG=W2e,XG=U2e,JG=B2e;const JI=G2e,THe=K2e,Y2e=Z2e,eK=b.forwardRef(({className:e,...t},n)=>g.jsx(KG,{className:_e("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));eK.displayName=KG.displayName;const sw=b.forwardRef(({className:e,...t},n)=>g.jsxs(Y2e,{children:[g.jsx(eK,{}),g.jsx(ZG,{ref:n,className:_e("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
126nded-lg",e),...t})]}));sw.displayName=ZG.displayName;const ow=({className:e,...t})=>g.jsx("div",{className:_e("flex flex-col space-y-2 text-center sm:text-left",e),...t});ow.displayName="AlertDialogHeader";const aw=({className:e,...t})=>g.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});aw.displayName="AlertDialogFooter";const lw=b.forwardRef(({className:e,...t},n)=>g.jsx(XG,{ref:n,className:_e("text-lg font-semibold",e),...t}));lw.displayName=XG.displayName;const uw=b.forwardRef(({className:e,...t},n)=>g.jsx(JG,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));uw.displayName=JG.displayName;const cw=b.forwardRef(({className:e,...t},n)=>g.jsx(YG,{ref:n,className:_e(dc(),e),...t}));cw.displayName=YG.displayName;const dw=b.forwardRef(({className:e,...t},n)=>g.jsx(QG,{ref:n,className:_e(dc({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));dw.displayName=QG.displayName;const Xs=({onClick:e,text:t,iconName:n,className:r,isMobile:i,node:s})=>{const o=Er[n],a=MG(),l=b.useCallback(async(m,v)=>{try{return await a.mutateAsync({id:m.id,collection:{id:v.id}}),df({title:`Link moved to ${v.name}`}),{moved:!0,id:m.id,parentId:v.id}}catch(_){return console.error("Error moving link",_),df({title:"Link move failed",variant:"destructive"}),{moved:!1,id:m.id,parentId:v.id}}},[df]),[{canDrop:u,isOver:f},d]=EEe(()=>({accept:NG.LINK,drop:async(m,v)=>await l(m,s.data),collect:m=>({isOver:m.isOver(),canDrop:m.canDrop()})})),p=u&&f;return g.jsxs("div",{ref:d,className:_e("flex w-full cursor-pointer items-center rounded-2xl py-[2px] hover:bg-accent focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",r,i&&"px-1 py-2",p&&"rounded-2xl bg-primary/20"),onClick:e,children:[g.jsx(o,{className:_e("size-6 shrink-0 p-1",i&&"size-8")}),g.jsx("span",{className:_e("w-max select-none truncate pl-1 text-sm",i&&"text-base"),children:t})]})};var B4=1,Q2e=.9,X2e=.8,J2e=.17,BS=.1,HS=.999,eOe=.9999,tOe=.99,nOe=/[\\\/_+.#"@\[\(\{&]/,rOe=/[\\\/_+.#"@\[\(\{&]/g,iOe=/[\s-]/,tK=/[\s-]/g;function Kk(e,t,n,r,i,s,o){if(s===t.length)return i===e.length?B4:tOe;var a=`${i},${s}`;if(o[a]!==void 0)return o[a];for(var l=r.charAt(s),u=n.indexOf(l,i),f=0,d,p,m,v;u>=0;)d=Kk(e,t,n,r,u+1,s+1,o),d>f&&(u===i?d*=B4:nOe.test(e.charAt(u-1))?(d*=X2e,m=e.slice(i,u-1).match(rOe),m&&i>0&&(d*=Math.pow(HS,m.length))):iOe.test(e.charAt(u-1))?(d*=Q2e,v=e.slice(i,u-1).match(tK),v&&i>0&&(d*=Math.pow(HS,v.length))):(d*=J2e,i>0&&(d*=Math.pow(HS,u-i))),e.charAt(u)!==t.charAt(s)&&(d*=eOe)),(d<BS&&n.charAt(u-1)===r.charAt(s+1)||r.charAt(s+1)===r.charAt(s)&&n.charAt(u-1)!==r.charAt(s))&&(p=Kk(e,t,n,r,u+1,s+2,o),p*BS>d&&(d=p*BS)),d>f&&(f=d),u=n.indexOf(l,u+1);return o[a]=f,f}function H4(e){return e.toLowerCase().replace(tK," ")}function sOe(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,Kk(e,t,H4(e),H4(t),0,0,{})}var e2="Dialog",[nK]=iu(e2),[oOe,wo]=nK(e2),rK=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!0}=e,a=b.useRef(null),l=b.useRef(null),[u=!1,f]=rg({prop:r,defaultProp:i,onChange:s});return g.jsx(oOe,{scope:t,triggerRef:a,contentRef:l,contentId:Ms(),titleId:Ms(),descriptionId:Ms(),open:u,onOpenChange:f,onOpenToggle:b.useCallback(()=>f(d=>!d),[f]),modal:o,children:n})};rK.displayName=e2;var iK="DialogTrigger",aOe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wo(iK,n),s=pr(t,i.triggerRef);return g.jsx(qt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":r2(i.open),...r,ref:s,onClick:yt(e.onClick,i.onOpenToggle)})});aOe.displayName=iK;var t2="DialogPortal",[lOe,sK]=nK(t2,{forceMount:void 0}),oK=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=wo(t2,t);return g.jsx(lOe,{scope:t,forceMount:n,children:b.Children.map(r,o=>g.jsx(ea,{present:n||s.open,children:g.jsx(r_,{asChild:!0,container:i,children:o})}))})};oK.displayName=t2;var Cb="DialogOverlay",aK=b.forwardRef((e,t)=>{const n=sK(Cb,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=wo(Cb,e.__scopeDialog);return s.modal?g.jsx(ea,{present:r||s.open,children:g.jsx(uOe,{...i,ref:t})}):null});aK.displayName=Cb;var uOe=b.forwardRef((e,t)=>
vendor: 14,030 bytes, lines 126-130
126{const{__scopeDialog:n,...r}=e,i=wo(Cb,n);return g.jsx(_I,{as:Pf,allowPinchZoom:!0,shards:[i.contentRef],children:g.jsx(qt.div,{"data-state":r2(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),kc="DialogContent",lK=b.forwardRef((e,t)=>{const n=sK(kc,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=wo(kc,e.__scopeDialog);return g.jsx(ea,{present:r||s.open,children:s.modal?g.jsx(cOe,{...i,ref:t}):g.jsx(dOe,{...i,ref:t})})});lK.displayName=kc;var cOe=b.forwardRef((e,t)=>{const n=wo(kc,e.__scopeDialog),r=b.useRef(null),i=pr(t,n.contentRef,r);return b.useEffect(()=>{const s=r.current;if(s)return _g(s)},[]),g.jsx(uK,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:yt(e.onCloseAutoFocus,s=>{s.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:yt(e.onPointerDownOutside,s=>{const o=s.detail.originalEvent,a=o.button===0&&o.ctrlKey===!0;(o.button===2||a)&&s.preventDefault()}),onFocusOutside:yt(e.onFocusOutside,s=>s.preventDefault())})}),dOe=b.forwardRef((e,t)=>{const n=wo(kc,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return g.jsx(uK,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{e.onCloseAutoFocus?.(s),s.defaultPrevented||(r.current||n.triggerRef.current?.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{e.onInteractOutside?.(s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const o=s.target;n.triggerRef.current?.contains(o)&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),uK=b.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...o}=e,a=wo(kc,n),l=b.useRef(null),u=pr(t,l);return pq(),g.jsxs(g.Fragment,{children:[g.jsx(mI,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:g.jsx(n_,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":r2(a.open),...o,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),g.jsxs(g.Fragment,{children:[g.jsx(mOe,{titleId:a.titleId}),g.jsx(vOe,{contentRef:l,descriptionId:a.descriptionId})]})]})}),n2="DialogTitle",fOe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wo(n2,n);return g.jsx(qt.h2,{id:i.titleId,...r,ref:t})});fOe.displayName=n2;var cK="DialogDescription",hOe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wo(cK,n);return g.jsx(qt.p,{id:i.descriptionId,...r,ref:t})});hOe.displayName=cK;var dK="DialogClose",pOe=b.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=wo(dK,n);return g.jsx(qt.button,{type:"button",...r,ref:t,onClick:yt(e.onClick,()=>i.onOpenChange(!1))})});pOe.displayName=dK;function r2(e){return e?"open":"closed"}var fK="DialogTitleWarning",[PHe,hK]=Bie(fK,{contentName:kc,titleName:n2,docsSlug:"dialog"}),mOe=({titleId:e})=>{const t=hK(fK),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
127
128If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
129
130For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return b.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},gOe="DialogDescriptionWarning",vOe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hK(gOe).contentName}}.`;return b.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},yOe=rK,bOe=oK,_Oe=aK,wOe=lK,sp='[cmdk-group=""]',qS='[cmdk-group-items=""]',xOe='[cmdk-group-heading=""]',pK='[cmdk-item=""]',q4=`${pK}:not([aria-disabled="true"])`,Zk="cmdk-item-select",Kd="data-value",SOe=(e,t,n)=>sOe(e,t,n),mK=b.createContext(void 0),Ig=()=>b.useContext(mK),gK=b.createContext(void 0),i2=()=>b.useContext(gK),vK=b.createContext(void 0),yK=b.forwardRef((e,t)=>{let n=Zd(()=>{var z,N;return{search:"",value:(N=(z=e.value)!=null?z:e.defaultValue)!=null?N:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Zd(()=>new Set),i=Zd(()=>new Map),s=Zd(()=>new Map),o=Zd(()=>new Set),a=bK(e),{label:l,children:u,value:f,onValueChange:d,filter:p,shouldFilter:m,loop:v,disablePointerSelection:_=!1,vimBindings:w=!0,...x}=e,S=Ms(),C=Ms(),R=Ms(),P=b.useRef(null),k=MOe();Tc(()=>{if(f!==void 0){let z=f.trim();n.current.value=z,I.emit()}},[f]),Tc(()=>{k(6,V)},[]);let I=b.useMemo(()=>({subscribe:z=>(o.current.add(z),()=>o.current.delete(z)),snapshot:()=>n.current,setState:(z,N,ee)=>{var X,ne,ae,se;if(!Object.is(n.current[z],N)){if(n.current[z]=N,z==="search")j(),A(),k(1,$);else if(z==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let ce=document.getElementById(R);ce?ce.focus():(X=document.getElementById(S))==null||X.focus()}if(k(7,()=>{var ce;n.current.selectedItemId=(ce=B())==null?void 0:ce.id,I.emit()}),ee||k(5,V),((ne=a.current)==null?void 0:ne.value)!==void 0){let ce=N??"";(se=(ae=a.current).onValueChange)==null||se.call(ae,ce);return}}I.emit()}},emit:()=>{o.current.forEach(z=>z())}}),[]),D=b.useMemo(()=>({value:(z,N,ee)=>{var X;N!==((X=s.current.get(z))==null?void 0:X.value)&&(s.current.set(z,{value:N,keywords:ee}),n.current.filtered.items.set(z,L(N,ee)),k(2,()=>{A(),I.emit()}))},item:(z,N)=>(r.current.add(z),N&&(i.current.has(N)?i.current.get(N).add(z):i.current.set(N,new Set([z]))),k(3,()=>{j(),A(),n.current.value||$(),I.emit()}),()=>{s.current.delete(z),r.current.delete(z),n.current.filtered.items.delete(z);let ee=B();k(4,()=>{j(),ee?.getAttribute("id")===z&&$(),I.emit()})}),group:z=>(i.current.has(z)||i.current.set(z,new Set),()=>{s.current.delete(z),i.current.delete(z)}),filter:()=>a.current.shouldFilter,label:l||e["aria-label"],getDisablePointerSelection:()=>a.current.disablePointerSelection,listId:S,inputId:R,labelId:C,listInnerRef:P}),[]);function L(z,N){var ee,X;let ne=(X=(ee=a.current)==null?void 0:ee.filter)!=null?X:SOe;return z?ne(z,n.current.search,N):0}function A(){if(!n.current.search||a.current.shouldFilter===!1)return;let z=n.current.filtered.items,N=[];n.current.filtered.groups.forEach(X=>{let ne=i.current.get(X),ae=0;ne.forEach(se=>{let ce=z.get(se);ae=Math.max(ce,ae)}),N.push([X,ae])});let ee=P.current;H().sort((X,ne)=>{var ae,se;let ce=X.getAttribute("id"),fe=ne.getAttribute("id");return((ae=z.get(fe))!=null?ae:0)-((se=z.get(ce))!=null?se:0)}).forEach(X=>{let ne=X.closest(qS);ne?ne.appendChild(X.parentElement===ne?X:X.closest(`${qS} > *`)):ee.appendChild(X.parentElement===ee?X:X.closest(`${qS} > *`))}),N.sort((X,ne)=>ne[1]-X[1]).forEach(X=>{var ne;let ae=(ne=P.current)==null?void 0:ne.querySelector(`${sp}[${Kd}="${encodeURIComponent(X[0])}"]`);ae?.parentElement.appendChild(ae)})}function $(){let z=H().find(ee=>ee.getAttribute("aria-disabled")!=="true"),N=z?.getAttribute(Kd);I.setState("value",N||void 0)}function j(){var z,N,ee,X;if(!n.current.search||a.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ne=0;for(let ae of r.current){let se=(N=(z=s.current.get(ae))==null?void 0:z.value)!=null?N:"",ce=(X=(ee=s.current.get(ae))==null?void 0:ee.keywords)!=null?X:[],fe=L(se,ce);n.current.filtered.items.set(ae,fe),fe>0&&ne++}for(let[ae,se]of i.current)for(let ce of se)if(n.current.filtered.items.get(ce)>0){n.current.filtered.groups.add(ae);break}n.current.filtered.count=ne}function V(){var z,N,ee;let X=B();X&&(((z=X.parentElement)==null?void 0:z.firstChild)===X&&((ee=(N=X.closest(sp))==null?void 0:N.querySelector(xOe))==null||ee.scrollIntoView({block:"nearest"})),X.scrollIntoView({block:"nearest"}))}function B(){var z;return(z=P.current)==null?void 0:z.querySelector(`${pK}[aria-selected="true"]`)}function H(){var z;return Array.from(((z=P.current)==null?void 0:z.querySelectorAll(q4))||[])}function te(z){let N=H()[z];N&&I.setState("value",N.getAttribute(Kd))}function G(z){var N;let ee=B(),X=H(),ne=X.findIndex(se=>se===ee),ae=X[ne+z];(N=a.current)!=null&&N.loop&&(ae=ne+z<0?X[X.length-1]:ne+z===X.length?X[0]:X[ne+z]),ae&&I.setState("value",ae.getAttribute(Kd))}function Z(z){let N=B(),ee=N?.closest(sp),X;for(;ee&&!X;)ee=z>0?DOe(ee,sp):AOe(ee,sp),X=ee?.querySelector(q4);X?I.setState("value",X.getAttribute(Kd)):G(z)}let Y=()=>te(H().length-1),M=z=>{z.preventDefault(),z.metaKey?Y():z.altKey?Z(1):G(1)},q=z=>{z.preventDefault(),z.metaKey?te(0):z.altKey?Z(-1):G(-1)};return b.createElement(qt.div,{ref:t,tabIndex:-1,...x,"cmdk-root":"",onKeyDown:z=>{var N;(N=x.onKeyDown)==null||N.call(x,z);let ee=z.nativeEvent.isComposing||z.keyCode===229;if(!(z.defaultPrevented||ee))switch(z.key){case"n":case"j":{w&&z.ctrlKey&&M(z);break}case"ArrowDown":{M(z);break}case"p":case"k":{w&&z.ctrlKey&&q(z);break}case"ArrowUp":{q(z);break}case"Home":{z.preventDefault(),te(0);break}case"End":{z.preventDefault(),Y();break}case"Enter":{z.preventDefault();let X=B();if(X){let ne=new Event(Zk);X.dispatchEvent(ne)}}}}},b.createElement("label",{"cmdk-label":"",htmlFor:D.inputId,id:D.labelId,style:jOe},l),fw(e,z=>b.createElement(gK.Provider,{value:I},b.createElement(mK.Provider,{value:D},z))))}),EOe=b.forwardRef((e,t)=>{var n,r;let i=Ms(),s=b.useRef(null),o=b.useContext(vK),a=Ig(),l=bK(e),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:o?.forceMount;Tc(()=>{if(!u)return a.item(i,o?.id)},[u]);let f=_K(i,s,[e.value,e.children,s],e.keywords),d=i2(),p=Xl(k=>k.value&&k.value===f.current),m=Xl(k=>u||a.filter()===!1?!0:k.search?k.filtered.items.get(i)>0:!0);b.useEffect(()=>{let k=s.current;if(!(!k||e.disabled))return k.addEventListener(Zk,v),()=>k.removeEventListener(Zk,v)},[m,e.onSelect,e.disabled]);function v(){var k,I;_(),(I=(k=l.current).onSelect)==null||I.call(k,f.current)}function _(){d.setState("value",f.current,!0)}if(!m)return null;let{disabled:w,value:x,onSelect:S,forceMount:C,keywords:R,...P}=e;return b.createElement(qt.div,{ref:ja(s,t),...P,id:i,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!p,"data-disabled":!!w,"data-selected":!!p,onPointerMove:w||a.getDisablePointerSelection()?void 0:_,onClick:w?void 0:v},e.children)}),COe=b.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...s}=e,o=Ms(),a=b.useRef(null),l=b.useRef(null),u=Ms(),f=Ig(),d=Xl(m=>i||f.filter()===!1?!0:m.search?m.filtered.groups.has(o):!0);Tc(()=>f.group(o),[]),_K(o,a,[e.value,e.heading,l]);let p=b.useMemo(()=>({id:o,forceMount:i}),[i]);return b.createElement(qt.div,{ref:ja(a,t),...s,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&b.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),fw(e,m=>b.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},b.createElement(vK.Provider,{value:p},m))))}),kOe=b.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=b.useRef(null),s=Xl(o=>!o.search);return!n&&!s?null:b.createElement(qt.div,{ref:ja(i,t),...r,"cmdk-separator":"",role:"separator"})}),TOe=b.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,s=i2(),o=Xl(u=>u.search),a=Xl(u=>u.selectedItemId),l=Ig();return b.useEffect(()=>{e.value!=null&&s.setState("search",e.value)},[e.value]),b.createElement(qt.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":a,id:l.inputId,type:"text",value:i?e.value:o,onChange:u=>{i||s.setState("search",u.target.value),n?.(u.target.value)}})}),POe=b.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...i}=e,s=b.useRef(null),o=b.useRef(null),a=Xl(u=>u.selectedItemId),l=Ig();return b.useEffect(()=>{if(o.current&&s.current){let u=o.current,f=s.current,d,p=new ResizeObserver(()=>{d=requestAnimationFrame(()=>{let m=u.offsetHeight;f.style.setProperty("--cmdk-list-height",m.toFixed(1)+"px")})});return p.observe(u),()=>{cancelAnimationFrame(d),p.unobserve(u)}}},[]),b.createElement(qt.div,{ref:ja(s,t),...i,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":a,"aria-label":r,id:l.listId},fw(e,u=>b.createElement("div",{ref:ja(o,l.listInnerRef),"cmdk-list-sizer":""},u)))}),ROe=b.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:s,container:o,...a}=e;return b.createElement(yOe,{open:n,onOpenChange:r},b.createElement(bOe,{container:o},b.createElement(_Oe,{"cmdk-overlay":"",className:i}),b.createElement(wOe,{"aria-label":e.label,"cmdk-dialog":"",className:s},b.createElement(yK,{ref:t,...a}))))}),IOe=b.forwardRef((e,t)=>Xl(n=>n.filtered.count===0)?b.createElement(qt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),OOe=b.forwardRef((e,t)=>{let{progress:n,children:r,label:i="Loading...",...s}=e;return b.createElement(qt.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},fw(e,o=>b.createElement("div",{"aria-hidden":!0},o)))}),Fi=Object.assign(yK,{List:POe,Item:EOe,Input:TOe,Group:COe,Separator:kOe,Dialog:ROe,Empty:IOe,Loading:OOe});function DOe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function AOe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function bK(e){let t=b.useRef(e);return Tc(()=>{t.current=e}),t}var Tc=typeof window>"u"?b.useEffect:b.useLayoutEffect;function Zd(e){let t=b.useRef();return t.current===void 0&&(t.current=e()),t}function Xl(e){let t=i2(),n=()=>e(t.snapshot());return b.useSyncExternalStore(t.subscribe,n,n)}function _K(e,t,n,r=[]){let i=b.useRef(),s=Ig();return Tc(()=>{var o;let a=(()=>{var u;for(let f of n){if(typeof f=="string")return f.trim();if(typeof f=="object"&&"current"in f)return f.current?(u=f.current.textContent)==null?void 0:u.trim():i.current}})(),l=r.map(u=>u.trim());s.value(e,a,l),(o=t.current)==null||o.setAttribute(Kd,a),i.current=a}),i}var MOe=()=>{let[e,t]=b.useState(),n=Zd(()=>new Map);return Tc(()=>{n.current.forEach(r=>
130r()),n.current=new Map},[e]),(r,i)=>{n.current.set(r,i),t({})}};function NOe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function fw({asChild:e,children:t},n){return e&&b.isValidElement(t)?b.cloneElement(NOe(t),{ref:t.ref},n(t.props.children)):n(t)}var jOe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const wK=b.forwardRef(({className:e,...t},n)=>g.jsx(Fi,{ref:n,className:_e("flex size-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));wK.displayName=Fi.displayName;const LOe=({children:e,open:t,onOpenChange:n,className:r,...i})=>g.jsx(KI,{open:t,onOpenChange:n,children:g.jsx(iw,{className:"overflow-hidden p-0 md:rounded-xl",children:g.jsx(wK,{className:_e("[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5",r),...i,children:e})})}),xK=b.forwardRef(({className:e,...t},n)=>g.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[g.jsx(Tf,{className:"mr-2 size-4 shrink-0 opacity-50"}),g.jsx(Fi.Input,{ref:n,className:_e("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));xK.displayName=Fi.Input.displayName;const SK=b.forwardRef(({className:e,...t},n)=>g.jsx(Fi.List,{ref:n,className:_e("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));SK.displayName=Fi.List.displayName;const EK=b.forwardRef((e,t)=>g.jsx(Fi.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));EK.displayName=Fi.Empty.displayName;const Bp=b.forwardRef(({className:e,...t},n)=>g.jsx(Fi.Group,{ref:n,className:_e("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));Bp.displayName=Fi.Group.displayName;const Yk=b.forwardRef(({className:e,...t},n)=>g.jsx(Fi.Separator,{ref:n,className:_e("-mx-1 h-px bg-border",e),...t}));Yk.displayName=Fi.Separator.displayName;const kb=b.forwardRef(({className:e,...t},n)=>g.jsx(Fi.Item,{ref:n,className:_e("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...t}));kb.displayName=Fi.Item.displayName;const CK=6048e5,FOe=864e5,$Oe=6e4,zOe=36e5,VOe=1e3,My=43200,W4=1440,G4=Symbol.for("constructDateFrom");function zn(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&G4 in e?e[G4](t):e instanceof Date?new e.constructor(t):new Date(t)}function xn(e,t){return zn(t||e,e)}function s2(e,t,n){const r=xn(e,n?.in);return isNaN(t)?zn(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}let UOe={};function Bc(){return UOe}function Qo(e,t){const n=Bc(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=xn(e,t?.in),s=i.getDay(),o=(s<r?7:0)+s-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Hf(e,t){return Qo(e,{...t,weekStartsOn:1})}function kK(e,t){const n=xn(e,t?.in),r=n.getFullYear(),i=zn(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);const s=Hf(i),o=zn(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);const a=Hf(o);return n.getTime()>=s.getTime()?r+1:n.getTime()>=a.getTime()?r:r-1}function qf(e){const t=xn(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Hc(e,...t){const n=zn.bind(null,e||t.find(r=>typeof r=="object"));return t.map(n)}function Tb(e,t){const n=xn(e,t?.in);return n.setHours(0,0,0,0),n}
130function TK(e,t,n){const[r,i]=Hc(n?.in,e,t),s=Tb(r),o=Tb(i),a=+s-qf(s),l=+o-qf(o);return Math.round((a-l)/FOe)}function BOe(e,t){const n=kK(e,t),r=zn(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Hf(r)}function w0(e,t){const n=+xn(e)-+xn(t);return n<0?-1:n>0?1:n}function Og(e){return zn(e,Date.now())}function PK(e,t,n){const[r,i]=Hc(n?.in,e,t);return+Tb(r)==+Tb(i)}function HOe(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function RK(e){return!(!HOe(e)&&typeof e!="number"||isNaN(+xn(e)))}function qOe(e,t,n){const[r,i]=Hc(n?.in,e,t),s=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return s*12+o}function WOe(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function GOe(e,t){return+xn(e)-+xn(t)}function KOe(e,t){const n=xn(e,t?.in);return n.setHours(23,59,59,999),n}function ZOe(e,t){const n=xn(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function YOe(e,t){const n=xn(e,t?.in);return+KOe(n,t)==+ZOe(n,t)}function QOe(e,t,n){const[r,i,s]=Hc(n?.in,e,e,t),o=w0(i,s),a=Math.abs(qOe(i,s));if(a<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*a);let l=w0(i,s)===-o;YOe(r)&&a===1&&w0(r,s)===1&&(l=!1);const u=o*(a-+l);return u===0?0:u}function XOe(e,t,n){const r=GOe(e,t)/1e3;return WOe(n?.roundingMethod)(r)}function JOe(e,t){const n=xn(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const eDe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},tDe=(e,t,n)=>{let r;const i=eDe[e];return typeof i=="string"?r=i:t===1?r=i.one:r=i.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function WS(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const nDe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},rDe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},iDe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sDe={date:WS({formats:nDe,defaultWidth:"full"}),time:WS({formats:rDe,defaultWidth:"full"}),dateTime:WS({formats:iDe,defaultWidth:"full"})},oDe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},aDe=(e,t,n,r)=>oDe[e];function op(e){return(t,n)=>{const r=n?.context?String(n.context):"standalone";let i;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):o;i=e.formattingValues[a]||e.formattingValues[o]}else{const o=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;i=e.values[a]||e.values[o]}const s=e.argumentCallback?e.argumentCallback(t):t;return i[s]}}const lDe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uDe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},cDe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dDe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
130ay","Saturday"]},fDe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},hDe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pDe=(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},mDe={ordinalNumber:pDe,era:op({values:lDe,defaultWidth:"wide"}),quarter:op({values:uDe,defaultWidth:"wide",argumentCallback:e=>e-1}),month:op({values:cDe,defaultWidth:"wide"}),day:op({values:dDe,defaultWidth:"wide"}),dayPeriod:op({values:fDe,defaultWidth:"wide",formattingValues:hDe,defaultFormattingWidth:"wide"})};function ap(e){return(t,n={})=>{const r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],s=t.match(i);if(!s)return null;const o=s[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?vDe(a,d=>d.test(o)):gDe(a,d=>d.test(o));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const f=t.slice(o.length);return{value:u,rest:f}}}function gDe(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function vDe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function yDe(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const i=r[0],s=t.match(e.parsePattern);if(!s)return null;let o=e.valueCallback?e.valueCallback(s[0]):s[0];o=n.valueCallback?n.valueCallback(o):o;const a=t.slice(i.length);return{value:o,rest:a}}}const bDe=/^(\d+)(th|st|nd|rd)?/i,_De=/\d+/i,wDe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},xDe={any:[/^b/i,/^(a|c)/i]},SDe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},EDe={any:[/1/i,/2/i,/3/i,/4/i]},CDe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},kDe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},TDe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},PDe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},RDe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},IDe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},ODe={ordinalNumber:yDe({matchPattern:bDe,parsePattern:_De,valueCallback:e=>parseInt(e,10)}),era:ap({matchPatterns:wDe,defaultMatchWidth:"wide",parsePatterns:xDe,defaultParseWidth:"any"}),quarter:ap({matchPatterns:SDe,defaultMatchWidth:"wide",parsePatterns:EDe,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ap({matchPatterns:CDe,defaultMatchWidth:"wide",parsePatterns:kDe,defaultParseWidth:"any"}),day:ap({matchPatterns:TDe,defaultMatchWidth:"wide",parsePatterns:PDe,defaultParseWidth:"any"}),dayPeriod:ap({matchPatterns:RDe,defaultMatchWidth:"any",parsePatterns:IDe,defaultParseWidth:"any"})},o2={code:"en-US",formatDistance:tDe,formatLong:sDe,formatRelative:aDe,localize:mDe,match:ODe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function DDe(e,t){const n=xn(e,t?.in);return TK(n,JOe(n))+1}function IK(e,t){const n=xn(e,t?.in),r=+Hf(n)-+BOe(n);return Math.round(r/CK)+1}function a2(e,t){const n=xn(e,t?.in),r=n.getFullYear(),i=Bc(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=zn(t?.in||e,0);o.setFullYear(r+1,0,s),o.setHours(0,0,0,0);const a=Qo(o,t),l=zn(t?.in||e,0);l.setFullYear(r,0,s),l.setHours(0,0,0,0);const u=Qo(l,t);return+n>=+a?r+1:+n>=+u?r:r-1}function ADe(e,t){const n=Bc(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=a2(e,t),s=zn(t?.in||e,0);return s.setFullYear(i,0,r),s.setHours(0,0,0,0),Qo(s,t)}function OK(e,t){const n=xn(e,t?.in),r=+Qo(n,t)-+ADe(n,t);return Math.round(r/CK)+1}function an(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const wl={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return an(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):an(n+1,2)},d(e,t){return an(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return an(e.getHours()%12||12,t.length)},H(e,t){return an(e.getHours(),t.length)},m(e,t){return an(e.getMinutes(),t.length)},s(e,t){return an(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),i=Math.trunc(r*Math.pow(10,n-3));return an(i,t.length)}},Ad={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},K4={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return wl.y(e,t)},Y:function(e,t,n,r){const i=a2(e,r),s=i>0?i:1-i;if(t==="YY"){const o=s%100;return an(o,2)}return t==="Yo"?n.ordinalNumber(s,{unit:"year"}):an(s,t.length)},R:function(e,t){const n=kK(e);return an(n,t.length)},u:function(e,t){const n=e.getFullYear();return an(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return an(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return an(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return wl.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return an(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const i=OK(e,r);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):an(i,t.length)},I:function(e,t,n){const r=IK(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):an(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):wl.d(e,t)},D:function(e,t,n){const r=DDe(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):an(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return an(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const i=e.getDay(),s=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return an(s,t.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),i=r===0?7:r;switch(t){case"i":return String(i);case"ii":return an(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let i;switch(r===12?i=Ad.noon:r===0?i=Ad.midnight:i=r/12>
vendor: 4,441 bytes, line 130
130=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let i;switch(r>=17?i=Ad.evening:r>=12?i=Ad.afternoon:r>=4?i=Ad.morning:i=Ad.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return wl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):wl.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):an(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):an(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):wl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):wl.s(e,t)},S:function(e,t){return wl.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return Y4(r);case"XXXX":case"XX":return Qu(r);case"XXXXX":case"XXX":default:return Qu(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return Y4(r);case"xxxx":case"xx":return Qu(r);case"xxxxx":case"xxx":default:return Qu(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Z4(r,":");case"OOOO":default:return"GMT"+Qu(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Z4(r,":");case"zzzz":default:return"GMT"+Qu(r,":")}},t:function(e,t,n){const r=Math.trunc(+e/1e3);return an(r,t.length)},T:function(e,t,n){return an(+e,t.length)}};function Z4(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=Math.trunc(r/60),s=r%60;return s===0?n+String(i):n+String(i)+t+an(s,2)}function Y4(e,t){return e%60===0?(e>0?"-":"+")+an(Math.abs(e)/60,2):Qu(e,t)}function Qu(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),i=an(Math.trunc(r/60),2),s=an(r%60,2);return n+i+t+s}const Q4=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},DK=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},MDe=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return Q4(e,t);let s;switch(r){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",Q4(r,t)).replace("{{time}}",DK(i,t))},Qk={p:DK,P:MDe},NDe=/^D+$/,jDe=/^Y+$/,LDe=["D","DD","YY","YYYY"];function AK(e){return NDe.test(e)}function MK(e){return jDe.test(e)}function Xk(e,t,n){const r=FDe(e,t,n);if(console.warn(r),LDe.includes(e))throw new RangeError(r)}function FDe(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $De=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zDe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,VDe=/^'([^]*?)'?$/,UDe=/''/g,BDe=/[a-zA-Z]/;function Jl(e,t,n){const r=Bc(),i=n?.locale??r.locale??o2,s=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=xn(e,n?.in);if(!RK(a))throw new RangeError("Invalid time value");let l=t.match(zDe).map(f=>{const d=f[0];if(d==="p"||d==="P"){const p=Qk[d];return p(f,i.formatLong)}return f}).join("").match($De).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const d=f[0];if(d==="'")return{isToken:!1,value:HDe(f)};if(K4[d])return{isToken:!0,value:f};
130if(d.match(BDe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(l=i.localize.preprocessor(a,l));const u={firstWeekContainsDate:s,weekStartsOn:o,locale:i};return l.map(f=>{if(!f.isToken)return f.value;const d=f.value;(!n?.useAdditionalWeekYearTokens&&MK(d)||!n?.useAdditionalDayOfYearTokens&&AK(d))&&Xk(d,t,String(e));const p=K4[d[0]];return p(a,d,i.localize,u)}).join("")}function HDe(e){const t=e.match(VDe);return t?t[1].replace(UDe,"'"):e}function qDe(e,t,n){const r=Bc(),i=n?.locale??r.locale??o2,s=2520,o=w0(e,t);if(isNaN(o))throw new RangeError("Invalid time value");const a=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:o}),[l,u]=Hc(n?.in,...o>0?[t,e]:[e,t]),f=XOe(u,l),d=(qf(u)-qf(l))/1e3,p=Math.round((f-d)/60);let m;if(p<2)return n?.includeSeconds?f<5?i.formatDistance("lessThanXSeconds",5,a):f<10?i.formatDistance("lessThanXSeconds",10,a):f<20?i.formatDistance("lessThanXSeconds",20,a):f<40?i.formatDistance("halfAMinute",0,a):f<60?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",1,a):p===0?i.formatDistance("lessThanXMinutes",1,a):i.formatDistance("xMinutes",p,a);if(p<45)return i.formatDistance("xMinutes",p,a);if(p<90)return i.formatDistance("aboutXHours",1,a);if(p<W4){const v=Math.round(p/60);return i.formatDistance("aboutXHours",v,a)}else{if(p<s)return i.formatDistance("xDays",1,a);if(p<My){const v=Math.round(p/W4);return i.formatDistance("xDays",v,a)}else if(p<My*2)return m=Math.round(p/My),i.formatDistance("aboutXMonths",m,a)}if(m=QOe(u,l),m<12){const v=Math.round(p/My);return i.formatDistance("xMonths",v,a)}else{const v=m%12,_=Math.trunc(m/12);return v<3?i.formatDistance("aboutXYears",_,a):v<9?i.formatDistance("overXYears",_,a):i.formatDistance("almostXYears",_+1,a)}}function WDe(e,t){return qDe(e,Og(e),t)}function GDe(){return Object.assign({},Bc())}function KDe(e,t){const n=xn(e,t?.in).getDay();return n===0?7:n}function ZDe(e,t){const n=YDe(t)?new t(0):zn(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function YDe(e){return typeof e=="function"&&e.prototype?.constructor===e}const QDe=10;class NK{subPriority=0;validate(t,n){return!0}}class XDe extends NK{constructor(t,n,r,i,s){super(),this.value=t,this.validateValue=n,this.setValue=r,this.priority=i,s&&(this.subPriority=s)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,r){return this.setValue(t,n,this.value,r)}}class JDe extends NK{priority=QDe;subPriority=-1;constructor(t,n){super(),this.context=t||(r=>zn(n,r))}set(t,n){return n.timestampIsSet?t:zn(t,ZDe(t,this.context))}}class tn{run(t,n,r,i){const s=this.parse(t,n,r,i);return s?{setter:new XDe(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(t,n,r){return!0}}class eAe extends tn{priority=140;parse(t,n,r){switch(n){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});case"GGGG":default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"})}}set(t,n,r){return n.era=r,t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const nr={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Oo={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function rr(e,t){return e&&{value:t(e.value),rest:e.rest}}function Ln(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function Do(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const r=n[1]==="+"?1:-1,i=n[2]?parseInt(n[2],10):0,s=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*zOe+s*$Oe+o*VOe),rest:t.slice(n[0].length)}}function jK(e){return Ln(nr.anyDigitsSigned,e)}function Yn(e,t){switch(e){case 1:return Ln(nr.singleDigit,t);case 2:return Ln(nr.twoDigits,t);case 3:return Ln(nr.threeDigits,t);case 4:return Ln(nr.fourDigits,t);default:return Ln(new RegExp("^\\d{1,"+e+"}"),t)}}function Pb(e,t){switch(e){case 1:return Ln(nr.singleDigitSigned,t);case 2:return Ln(nr.twoDigitsSigned,t);case 3:return Ln(nr.threeDigitsSigned,t);case 4:return Ln(nr.fourDigitsSigned,t);default:return Ln(new RegExp("^-?\\d{1,"+e+"}"),t)}}function l2(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function LK(e,t){const n=t>0,r=n?t:1-t;let i;if(r<=50)i=e||100;else{const s=r+50,o=Math.trunc(s/100)*100,a=e>=s%100;i=e+o-(a?100:0)}return n?i:1-i}function FK(e){return e%400===0||e%4===0&&e%100!==0}class tAe extends tn{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,r){const i=s=>({year:s,isTwoDigitYear:n==="yy"});switch(n){case"y":return rr(Yn(4,t),i);case"yo":return rr(r.ordinalNumber(t,{unit:"year"}),i);default:return rr(Yn(n.length,t),i)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,r){const i=t.getFullYear();if(r.isTwoDigitYear){const o=LK(r.year,i);return t.setFullYear(o,0,1),t.setHours(0,0,0,0),t}const s=!("era"in n)||n.era===1?r.year:1-r.year;return t.setFullYear(s,0,1),t.setHours(0,0,0,0),t}}class nAe extends tn{priority=130;parse(t,n,r){const i=s=>({year:s,isTwoDigitYear:n==="YY"});switch(n){case"Y":return rr(Yn(4,t),i);case"Yo":return rr(r.ordinalNumber(t,{unit:"year"}),i);default:return rr(Yn(n.length,t),i)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,r,i){const s=a2(t,i);if(r.isTwoDigitYear){const a=LK(r.year,s);return t.setFullYear(a,0,i.firstWeekContainsDate),t.setHours(0,0,0,0),Qo(t,i)}const o=!("era"in n)||n.era===1?r.year:1-r.year;return t.setFullYear(o,0,i.firstWeekContainsDate),t.setHours(0,0,0,0),Qo(t,i)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class rAe extends tn{priority=130;parse(t,n){return Pb(n==="R"?4:n.length,t)}set(t,n,r){const i=zn(t,0);return i.setFullYear(r,0,4),i.setHours(0,0,0,0),Hf(i)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class iAe extends tn{priority=130;parse(t,n){return Pb(n==="u"?4:n.length,t)}set(t,n,r){return t.setFullYear(r,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class sAe extends tn{priority=120;parse(t,n,r){switch(n){case"Q":case"QQ":return Yn(n.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class oAe extends tn{priority=120;parse(t,n,r){switch(n){case"q":case"qq":return Yn(n.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,r){return t.setMonth((r-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class aAe extends tn{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,r){const i=s=>s-1;switch(n){case"M":return rr(Ln(nr.month,t),i);case"MM":return rr(Yn(2,t),i);case"Mo":return rr(r.ordinalNumber(t,{unit:"month"}),i);case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}}class lAe extends tn{priority=110;parse(t,n,r){const i=s=>s-1;switch(n){case"L":return rr(Ln(nr.month,t),i);case"LL":return rr(Yn(2,t),i);case"Lo":return rr(r.ordinalNumber(t,{unit:"month"}),i);case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.setMonth(r,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function uAe(e,t,n){const r=xn(e,n?.in),i=OK(r,n)-t;return r.setDate(r.getDate()-i*7),xn(r,n?.in)}class cAe extends tn{priority=100;parse(t,n,r){switch(n){case"w":return Ln(nr.week,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return Yn(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,r,i){return Qo(uAe(t,r,i),i)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function dAe(e,t,n){const r=xn(e,n?.in),i=IK(r,n)-t;return r.setDate(r.getDate()-i*7),r}class fAe extends tn{priority=100;parse(t,n,r){switch(n){case"I":return Ln(nr.week,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return Yn(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,r){return Hf(dAe(t,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const hAe=[31,28,31,30,31,30,31,31,30,31,30,31],pAe=[31,29,31,30,31,30,31,31,30,31,30,31];class mAe extends tn{priority=90;subPriority=1;parse(t,n,r){switch(n){case"d":return Ln(nr.date,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return Yn(n.length,t)}}validate(t,n){const r=t.getFullYear(),i=FK(r),s=t.getMonth();return i?n>=1&&n<=pAe[s]:n>=1&&n<=hAe[s]}set(t,n,r){return t.setDate(r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class gAe extends tn{priority=90;subpriority=1;parse(t,n,r){switch(n){case"D":case"DD":return Ln(nr.dayOfYear,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return Yn(n.length,t)}}validate(t,n){const r=t.getFullYear();return FK(r)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,r){return t.setMonth(0,r),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function u2(e,t,n){const r=Bc(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=xn(e,n?.in),o=s.getDay(),l=(t%7+7)%7,u=7-i,f=t<0||t>6?t-(o+u)%7:(l+u)%7-(o+u)%7;return s2(s,f,n)}class vAe extends tn{priority=90;parse(t,n,r){switch(n){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,i){return t=u2(t,r,i),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class yAe extends tn{priority=90;parse(t,n,r,i){const s=o=>{const a=Math.floor((o-1)/7)*7;return(o+i.weekStartsOn+6)%7+a};switch(n){case"e":case"ee":return rr(Yn(n.length,t),s);case"eo":return rr(r.ordinalNumber(t,{unit:"day"}),s);case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,i){return t=u2(t,r,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class bAe extends tn{priority=90;parse(t,n,r,i){const s=o=>{const a=Math.floor((o-1)/7)*7;return(o+i.weekStartsOn+6)%7+a};switch(n){case"c":case"cc":return rr(Yn(n.length,t),s);case"co":return rr(r.ordinalNumber(t,{unit:"day"}),s);case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,r,i){return t=u2(t,r,i),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function _Ae(e,t,n){const r=xn(e,n?.in),i=KDe(r,n),s=t-i;return s2(r,s,n)}class wAe extends tn{priority=90;parse(t,n,r){const i=s=>s===0?7:s;switch(n){case"i":case"ii":return Yn(n.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return rr(r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),i);case"iiiii":return rr(r.day(t,{width:"narrow",context:"formatting"}),i);case"iiiiii":return rr(r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),i);case"iiii":default:return rr(r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"}),i)}}validate(t,n){return n>=1&&n<=7}set(t,n,r){return t=_Ae(t,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class xAe extends tn{priority=80;parse(t,n,r){switch(n){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(l2(r),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class SAe extends tn{priority=80;
130parse(t,n,r){switch(n){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(l2(r),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class EAe extends tn{priority=80;parse(t,n,r){switch(n){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,r){return t.setHours(l2(r),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class CAe extends tn{priority=70;parse(t,n,r){switch(n){case"h":return Ln(nr.hour12h,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return Yn(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,r){const i=t.getHours()>=12;return i&&r<12?t.setHours(r+12,0,0,0):!i&&r===12?t.setHours(0,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class kAe extends tn{priority=70;parse(t,n,r){switch(n){case"H":return Ln(nr.hour23h,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return Yn(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,r){return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class TAe extends tn{priority=70;parse(t,n,r){switch(n){case"K":return Ln(nr.hour11h,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return Yn(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,r){return t.getHours()>=12&&r<12?t.setHours(r+12,0,0,0):t.setHours(r,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class PAe extends tn{priority=70;parse(t,n,r){switch(n){case"k":return Ln(nr.hour24h,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return Yn(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,r){const i=r<=24?r%24:r;return t.setHours(i,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class RAe extends tn{priority=60;parse(t,n,r){switch(n){case"m":return Ln(nr.minute,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return Yn(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,r){return t.setMinutes(r,0,0),t}incompatibleTokens=["t","T"]}class IAe extends tn{priority=50;parse(t,n,r){switch(n){case"s":return Ln(nr.second,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return Yn(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,r){return t.setSeconds(r,0),t}incompatibleTokens=["t","T"]}class OAe extends tn{priority=30;parse(t,n){const r=i=>Math.trunc(i*Math.pow(10,-n.length+3));return rr(Yn(n.length,t),r)}set(t,n,r){return t.setMilliseconds(r),t}incompatibleTokens=["t","T"]}class DAe extends tn{priority=10;parse(t,n){switch(n){case"X":return Do(Oo.basicOptionalMinutes,t);case"XX":return Do(Oo.basic,t);case"XXXX":return Do(Oo.basicOptionalSeconds,t);case"XXXXX":return Do(Oo.extendedOptionalSeconds,t);case"XXX":default:return Do(Oo.extended,t)}}set(t,n,r){return n.timestampIsSet?t:zn(t,t.getTime()-qf(t)-r)}incompatibleTokens=["t","T","x"]}class AAe extends tn{priority=10;parse(t,n){switch(n){case"x":return Do(Oo.basicOptionalMinutes,t);case"xx":return Do(Oo.basic,t);case"xxxx":return Do(Oo.basicOptionalSeconds,t);case"xxxxx":return Do(Oo.extendedOptionalSeconds,t);case"xxx":default:return Do(Oo.extended,t)}}set(t,n,r){return n.timestampIsSet?t:zn(t,t.getTime()-qf(t)-r)}incompatibleTokens=["t","T","X"]}class MAe extends tn{priority=40;parse(t){return jK(t)}set(t,n,r){return[zn(t,r*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class NAe extends tn{priority=20;parse(t){return jK(t)}set(t,n,r){return[zn(t,r),{timestampIsSet:!0}]}incompatibleTokens="*"}const jAe={G:new eAe,y:new tAe,Y:new nAe,R:new rAe,u:new iAe,Q:new sAe,q:new oAe,M:new aAe,L:new lAe,w:new cAe,I:new fAe,d:new mAe,D:new gAe,E:new vAe,e:new yAe,c:new bAe,i:new wAe,a:new xAe,b:new SAe,B:new EAe,h:new CAe,H:new kAe,K:new TAe,k:new PAe,m:new RAe,s:new IAe,S:new OAe,X:new DAe,x:new AAe,t:new MAe,T:new NAe},LAe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FAe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,$Ae=/^'([^]*?)'?$/,zAe=/''/g,VAe=/\S/,UAe=/[a-zA-Z]/;function BAe(e,t,n,r){const i=()=>zn(n,NaN),s=GDe(),o=s.locale??o2,a=s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=s.weekStartsOn??s.locale?.options?.weekStartsOn??0,u={firstWeekContainsDate:a,weekStartsOn:l,locale:o},f=[new JDe(r?.in,n)],d=t.match(FAe).map(w=>{const x=w[0];if(x in Qk){const S=Qk[x];return S(w,o.formatLong)}return w}).join("").match(LAe),p=[];for(let w of d){MK(w)&&Xk(w,t,e),AK(w)&&Xk(w,t,e);const x=w[0],S=jAe[x];if(S){const{incompatibleTokens:C}=S;if(Array.isArray(C)){const P=p.find(k=>C.includes(k.token)||k.token===x);
130if(P)throw new RangeError(`The format string mustn't contain \`${P.fullToken}\` and \`${w}\` at the same time`)}else if(S.incompatibleTokens==="*"&&p.length>0)throw new RangeError(`The format string mustn't contain \`${w}\` and any other token at the same time`);p.push({token:x,fullToken:w});const R=S.run(e,w,o.match,u);if(!R)return i();f.push(R.setter),e=R.rest}else{if(x.match(UAe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+x+"`");if(w==="''"?w="'":x==="'"&&(w=HAe(w)),e.indexOf(w)===0)e=e.slice(w.length);else return i()}}if(e.length>0&&VAe.test(e))return i();const m=f.map(w=>w.priority).sort((w,x)=>x-w).filter((w,x,S)=>S.indexOf(w)===x).map(w=>f.filter(x=>x.priority===w).sort((x,S)=>S.subPriority-x.subPriority)).map(w=>w[0]);let v=xn(n,r?.in);if(isNaN(+v))return i();const _={};for(const w of m){if(!w.validate(v,u))return i();const x=w.set(v,_,u);Array.isArray(x)?(v=x[0],Object.assign(_,x[1])):v=x}return v}function HAe(e){return e.match($Ae)[1].replace(zAe,"'")}function qAe(e,t,n){const[r,i]=Hc(n?.in,e,t);return+Qo(r,n)==+Qo(i,n)}function WAe(e,t,n){const[r,i]=Hc(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function $K(e,t){return WAe(zn(e,e),Og(e))}function zK(e,t){return qAe(zn(e,e),Og(e),t)}function qc(e,t){return PK(zn(e,e),Og(e))}function GAe(e,t,n){return s2(e,-t,n)}function hw(e,t){return PK(zn(e,e),GAe(Og(e),1))}const KAe=2,X4="MMMM d, yyyy";function pw(e){const t=e.title?.trim()??"";if(t){const n=BAe(t,X4,new Date);if(RK(n)&&Jl(n,X4)===t)return n}return e.created_at?new Date(e.created_at):new Date}function ZAe(e,t=new Date){return e.note_type!=="JOURNAL"?!1:TK(t,pw(e))>=KAe}function RHe(e,t={}){if(e.archived_at)return!1;switch(e.note_type){case"JOURNAL":return t.amended===!0||!ZAe(e,t.now);case"PLAN":return!1;default:return e.origin==null||e.origin==="HUMAN"}}function VK(e){return qc(pw(e))}function IHe(e){const t=typeof e=="string"?new Date(e):e;return qc(t)?"Today":hw(t)?"Yesterday":Jl(t,"EEEE, MMMM d")}function YAe(e){const t=new Date(e);return qc(t)?Jl(t,"h:mm a"):hw(t)?"Yesterday":Jl(t,"MMM d")}function QAe(e){return Jl(typeof e=="string"?new Date(e):e,"MMMM yyyy")}const UK=b.createContext("classic");function XAe({shell:e,children:t}){return g.jsx(UK.Provider,{value:e,children:t})}function JAe(){return b.useContext(UK)}const OHe=e=>e==="study"?"/study":"/",eMe=e=>e==="study"?"/study/search":"/search",tMe=(e,t)=>t==="study"?`/study/n/${e}`:`/notes/${e}`,nMe=e=>e==="study"?"/study/j":"/journal",J4=(e,t)=>t==="study"?`/study/j/${e}`:`/journal/${e}`,rMe=(e,t)=>t==="study"?`/study/t/${e}`:`/tasks/${e}`,iMe=(e,t)=>t==="study"?`/study/d/${e}`:`/chat/${e}`,DHe=e=>e==="study"?"/study/d":"/chat/new",sMe=(e,t)=>t==="study"?`/study/w/${e}`:`/board/${e}`,oMe=(e,t)=>t==="study"?`/study/r/${e}`:`/read/${e}`,aMe=(e,t)=>t==="study"?`/study/cap/${e}`:"/library/captures";function lMe(e,t){return e.note_type==="JOURNAL"?e.archived_at?J4(e.id??"",t):VK(e)?nMe(t):J4(e.id??"",t):tMe(e.id??"",t)}async function AHe(e){return et(`/notes/${e}`)}async function BK(e,t={}){const n=new URLSearchParams({page:"1",per_page:"1"});return e&&n.set("note_type",e),t.includeArchived&&n.set("include_archived","true"),(await et(`/notes/?${n.toString()}`)).meta?.total??0}async function Rb(e=1,t=100,n="",r,i={}){const s=new URLSearchParams;return s.set("page",e.toString()),s.set("per_page",t.toString()),n&&s.set("q",n),r&&s.set("note_type",r),i.includeArchived&&s.set("include_archived","true"),i.orderBy&&s.set("order_by",i.orderBy),et(`/notes/?${s.toString()}`)}async function MHe(e){return et(`/notes/${e}/archive`,{method:"POST"})}async function NHe(e){return et(`/notes/${e}/unarchive`,{method:"POST"})}async function jHe(e){return et("/notes/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function LHe(e,t){return et(`/notes/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...qV(t)})})}async function FHe(e){return et(`/notes/${e}`,{method:"DELETE"})}async function $He(e=1,t=100){return et(`/notes/?page=${e}&per_page=${t}&note_type=JOURNAL`)}async function zHe(e){return et("/captures/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:e.type||"TEXT",content:e.content,source_app:e.source_app||"mentes-web",source_platform:e.source_platform||"web",...e.metadata&&{metadata:e.metadata},...e.target_type&&e.target_id&&{target_type:e.target_type,target_id:e.target_id}})})}async function c2(e=1,t=20,n,r={}){const i=new URLSearchParams({page:String(e),per_page:String(t)});return n&&i.set("q",n),r.includeArchived&&i.set("include_archived","true"),et(`/captures/?${i}`)}async function VHe(e){return et(`/captures/${e}`)}async function UHe(e){return et(`/captures/${e}/archive`,{method:"POST"})}async function BHe(e){return et(`/captures/${e}/derivations`)}const HHe=["journals","notes","plans","captures"];function qHe(e,t){return`${e} ${e===1?t.countNoun:t.countNounPlural}`}const HK={journals:{path:"/library/journals",title:"Journals",subtitle:"Your journal, day by day.",emptyState:"No journal entries yet.",countNoun:"entry",countNounPlural:"entries",icon:Cz,noteType:"JOURNAL",sort:"created",groupByMonth:!0},notes:{path:"/library/notes",title:"Notes",subtitle:"Documents the librarian keeps for you.",emptyState:"No notes yet.",countNoun:"note",countNounPlural:"notes",icon:e_,noteType:"NOTE",sort:"updated"},plans:{path:"/library/plans",title:"Plans",subtitle:"Plans the librarian keeps for you.",emptyState:"No plans yet.",countNoun:"plan",countNounPlural:"plans",icon:Dz,noteType:"PLAN",sort:"updated"},captures:{path:"/library/captures",title:"Captures",subtitle:"Quick thoughts you've captured.",emptyState:"No captures yet.",countNoun:"capture",countNounPlural:"captures",icon:Gz,sort:"created"}};function WHe(e){return e!==void 0&&Object.prototype.hasOwnProperty.call(HK,e)}const qK="shelf-count";function GHe(e){const{noteType:t}=HK[e];return hr({queryKey:[qK,e],queryFn:async()=>t?BK(t):(await c2(1,1)).meta?.total??0,staleTime:30*1e3})}function uMe(){return hr({queryKey:[qK,"plans","exists"],queryFn:async()=>await BK("PLAN",{includeArchived:!0})>0,staleTime:30*1e3})}async function cMe(e=1,t=10,n=""){console.log("fetching whiteboards",{page:e,per_page:t,query:n});
130const r=new URLSearchParams;return r.set("page",e.toString()),r.set("per_page",t.toString()),n&&n!==""&&r.set("q",n),(await et(`/whiteboards/?${r.toString()}`)).data||[]}async function dMe(e){return et(`/whiteboards/${e}`)}async function WK(e=20){return(await et(`/whiteboards/?page=1&per_page=${e}`)).data||[]}async function fMe(e){return et("/whiteboards/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function hMe(e,t){return et(`/whiteboards/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,...qV(t)})})}async function pMe(e){return et(`/whiteboards/${e}`,{method:"DELETE"})}async function mMe(e,t=10){const n=new URLSearchParams({per_page:String(t),q:e});return(await et(`/whiteboards/search/?${n.toString()}`)).data||[]}const gMe={today:"Today",thisWeek:"This week",thisMonth:"This month",older:"Older"},vMe=["today","thisWeek","thisMonth","older"];function yMe(e,t){const n={today:[],thisWeek:[],thisMonth:[],older:[]};return e.forEach(r=>{const i=Xo(t(r));if(!i){n.older.push(r);return}qc(i)?n.today.push(r):zK(i)?n.thisWeek.push(r):$K(i)?n.thisMonth.push(r):n.older.push(r)}),n}const bMe=/(\.\d{3})\d+(?=(?:Z|[+\-]\d{2}:?\d{2})?$)/,_Me=/(?:Z|[+\-]\d{2}:?\d{2})$/i,wMe=/^\d{4}-\d{2}-\d{2}T/,lp=e=>!Number.isNaN(e.getTime()),zu=e=>e.toString().padStart(2,"0");function Xo(e){if(e==null)return null;if(e instanceof Date)return lp(e)?e:null;if(typeof e=="number"){const i=new Date(e);return lp(i)?i:null}const t=e.trim();if(!t)return null;const n=new Date(t);if(lp(n))return n;const r=t.replace(bMe,"$1");if(r!==t){const i=new Date(r);if(lp(i))return i}if(!_Me.test(r)&&wMe.test(t)){const i=new Date(`${r}Z`);if(lp(i))return i}return null}function xMe(e,t="compact"){const n=Xo(e);if(!n)return"";const r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),s=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=Math.round((s.getTime()-i.getTime())/864e5);if(o===0)return"Today";if(o===1)return"Tomorrow";if(o===-1)return"Yesterday";if(t==="compact"){if(o<-1&&o>=-6)return`${Math.abs(o)}d ago`;if(o>1&&o<=6)return`${o}d`}else if(o>1&&o<=6)return n.toLocaleDateString("en-US",{weekday:"long"});return n.toLocaleDateString("en-US",{month:"short",day:"numeric"})}function SMe(e){const t=Xo(e);if(!t)return null;const n=new Date,r=new Date(n.getFullYear(),n.getMonth(),n.getDate()),i=new Date(t.getFullYear(),t.getMonth(),t.getDate());return Math.round((r.getTime()-i.getTime())/864e5)}function KHe(e){const t=SMe(e);return t===null?"":t<7?xMe(e,"compact"):t<56?`${Math.round(t/7)}w ago`:t<365?`${Math.round(t/30.4)}mo ago`:`${Math.round(t/365)}y ago`}function ZHe(e){if(!e)return null;const t=Xo(e);if(!t)return null;const n=-t.getTimezoneOffset(),r=n>=0?"+":"-",i=Math.abs(n),s=zu(Math.floor(i/60)),o=zu(i%60);return`${t.getFullYear()}-${zu(t.getMonth()+1)}-${zu(t.getDate())}T${zu(t.getHours())}:${zu(t.getMinutes())}:${zu(t.getSeconds())}${r}${s}:${o}`}const YHe={1:"Critical",2:"High",3:"Normal",4:"Low"};async function Ib(e){const t=new URLSearchParams;return e?.status&&t.append("status",e.status),e?.priority&&t.append("priority",e.priority.toString()),e?.source_type&&t.append("source_type",e.source_type),e?.collection_id&&t.append("collection_id",e.collection_id.toString()),e?.label_ids&&e.label_ids.forEach(n=>t.append("label_ids",n.toString())),e?.ids&&e.ids.forEach(n=>t.append("ids",n)),e?.due_before&&t.append("due_before",e.due_before),e?.due_after&&t.append("due_after",e.due_after),e?.overdue&&t.append("overdue","true"),e?.assignee_type&&t.append("assignee_type",e.assignee_type),e?.assignee_id&&t.append("assignee_id",e.assignee_id),e?.unassigned&&t.append("unassigned","true"),t.append("page",(e?.page||1).toString()),t.append("per_page",(e?.per_page||50).toString()),et(`/tasks/?${t.toString()}`)}const EMe=["IN_PROGRESS","IN_REVIEW","QUEUED","PENDING"];async function CMe(e){const t=await Promise.all(EMe.map(n=>Ib({...e,per_page:e?.per_page??200,status:n})));return{data:t.flatMap(n=>n.data),meta:{total:t.reduce((n,r)=>n+r.meta.total,0),page:1,per_page:t[0].meta.per_page,total_pages:1,has_more:t.some(n=>n.meta.has_more)}}}async function QHe(e,t={}){const n=e?.per_page??200,r=t.maxTasks??5e3,i=await Ib({...e,per_page:n,page:1}),s=i.meta.total,o=i.meta.total_pages;if(o<=1||i.data.length>=s)return i;const a=Math.min(o,Math.ceil(r/n)),l=await Promise.all(Array.from({length:a-1},(f,d)=>Ib({...e,per_page:n,page:d+2}))),u=[i.data,...l.map(f=>f.data)].flat();return{data:u,meta:{total:s,page:1,per_page:n,total_pages:1,has_more:u.length<s}}}async function kMe(e,t=20){const n=new URLSearchParams({q:e,page:"1",per_page:t.toString()});return et(`/tasks/search/?${n.toString()}`)}async function TMe(e){return et(`/tasks/${e}`)}async function XHe(e){return et(`/tasks/${e}/dependencies`)}async function JHe(e,t,n="user"){const i=(await TMe(e)).updates||[],s={role:n,content:t,created_at:new Date().toISOString()};return PMe(e,{updates:[...i,s]})}async function eqe(e){return et("/tasks/capture",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:e})})}async function tqe(e){return et("/tasks/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function PMe(e,t){return et(`/tasks/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}
130async function nqe(e){return et(`/tasks/${e}`,{method:"DELETE"})}async function rqe(e){return et(`/tasks/${e}/complete`,{method:"PATCH"})}async function iqe(e){return et(`/tasks/${e}/incomplete`,{method:"PATCH"})}function sqe(e){if(!e.due_at||e.status==="COMPLETED"||e.status==="CANCELLED")return!1;const t=Xo(e.due_at);return t?t<new Date:!1}const oqe={1:"P1",2:"P2",3:"P3",4:"P4"};function RMe(e){if(!e)return"";const t=[],n=r=>{if(!r||typeof r!="object")return;const i=r;typeof i.text=="string"&&t.push(i.text),Array.isArray(i.content)&&i.content.forEach(n)};return n(e),t.join("")}function IMe(e,t=80){const n=RMe(e).replace(/\s+/g," ").trim();return n?n.length>t?`${n.slice(0,t).trimEnd()}…`:n:""}function OMe(e,t=80){const n=e.content_preview?.replace(/\s+/g," ").trim();return n?n.length>t?`${n.slice(0,t).trimEnd()}…`:n:IMe(e.content,t)}function DMe(e){return e.note_type==="JOURNAL"?e.archived_at?`/journal/${e.id}`:VK(e)?"/journal":`/journal/${e.id}`:`/notes/${e.id}`}function AMe(e){return"/library/captures"}function aqe(e){const t=e.map(i=>({note:i,day:pw(i)}));t.sort((i,s)=>s.day.getTime()-i.day.getTime());const n=[],r=new Map;for(const{note:i,day:s}of t){const o=`${s.getFullYear()}-${String(s.getMonth()+1).padStart(2,"0")}`;let a=r.get(o);a||(a={key:o,label:QAe(s),notes:[]},r.set(o,a),n.push(a)),a.notes.push(i)}return n}function lqe(e){return e}const Jk=["journal","note","plan","capture","board","link","task","conversation"],GK=[{value:"all",label:"All"},{value:"journal",label:"Journals"},{value:"note",label:"Notes"},{value:"plan",label:"Plans"},{value:"capture",label:"Captures"},{value:"board",label:"Boards"},{value:"link",label:"Links"},{value:"task",label:"Tasks"},{value:"conversation",label:"Chats"}];function uqe(e){return GK.some(t=>t.value===e)}const KK={journal:{label:"Journals",icon:Cz},note:{label:"Notes",icon:e_},plan:{label:"Plans",icon:Dz},capture:{label:"Captures",icon:Gz},board:{label:"Boards",icon:Bz},link:{label:"Links",icon:eg},task:{label:"Tasks",icon:Lz},conversation:{label:"Chats",icon:YT}},MMe={JOURNAL:"journal",NOTE:"note",PLAN:"plan"};function x0(e){return{kind:MMe[e.note_type??"NOTE"],note:e}}function ZK(e){return{kind:"capture",capture:e}}function YK(e){return{kind:"board",board:e}}function NMe(e){return{kind:"link",link:e}}function QK(e){return{kind:"task",task:e}}function XK(e){return{kind:"conversation",chat:e}}function Xu(e){const t=e.kind==="capture"?e.capture.id:e.kind==="board"?e.board.id??"":e.kind==="link"?e.link.id:e.kind==="task"?e.task.id:e.kind==="conversation"?e.chat.id??"":e.note.id??"";return`${e.kind}-${t}`.toLowerCase()}function jMe(e,t="classic"){switch(e.kind){case"capture":return t==="study"?aMe(e.capture.id,t):AMe(e.capture);case"board":return sMe(e.board.id??"",t);case"link":return oMe(e.link.id,t);case"task":return rMe(e.task.id,t);case"conversation":return iMe(e.chat.id??"",t);default:return t==="study"?lMe(e.note,t):DMe(e.note)}}function LMe(e){switch(e.kind){case"capture":return e$(e.capture.content,80);case"board":return e.board.title?.trim()||"Untitled";case"link":return e.link.title?.trim()||e.link.url||"Untitled";case"task":return e$(e.task.description,80,"Untitled task");case"conversation":return e.chat.title?.trim()||"Untitled";default:{const{note:t}=e;if(t.note_type==="JOURNAL"){const n=pw(t);return qc(n)?"Today":hw(n)?"Yesterday":t.title?.trim()||Jl(n,"MMMM d, yyyy")}return t.title?.trim()||"Untitled"}}}function FMe(e){switch(e.kind){case"capture":return"";case"board":return"";case"link":return e.link.url??"";case"task":return"";case"conversation":return e.chat.preview?.trim()??"";default:return OMe(e.note,80)}}function cqe(e){switch(e.kind){case"journal":case"note":case"plan":return!!e.note.archived_at;case"capture":return!!e.capture.archived_at;default:return!1}}function eT(e){switch(e.kind){case"capture":return e.capture.created_at;case"board":return e.board.updated_at||e.board.created_at||"";case"link":return e.link.updated_at||e.link.created_at||"";case"task":return e.task.updated_at||e.task.created_at||"";case"conversation":return e.chat.updated_at||e.chat.created_at||"";default:return e.kind==="journal"?e.note.created_at||"":e.note.updated_at||e.note.created_at||""}}function $Me(e){const t=new Map;for(const n of e){const r=t.get(n.kind);r?r.push(n):t.set(n.kind,[n])}return Jk.flatMap(n=>{const r=t.get(n);return!r||r.length===0?[]:[{kind:n,label:KK[n].label,items:r}]})}function e$(e,t,n="Untitled capture"){const r=e.replace(/\s+/g," ").trim();return r?r.length>t?`${r.slice(0,t).trimEnd()}…`:r:n}const zMe="library-list",VMe=25;async function UMe(e=VMe,t){return(await Rb(1,e,"",t,{orderBy:"updated_at"})).data??[]}const BMe=["captures","recent"],HMe=100;async function qMe(e=HMe){return(await c2(1,e)).data??[]}const JK=100,WMe=100,eZ=10,tZ=JK*eZ,dqe=`No archived items in the ${tZ.toLocaleStr
130ing()} most recent notes — older archived items may exist.`,fqe=`Showing archived items from the ${tZ.toLocaleString()} most recent notes; older archived items may exist.`;async function hqe(e,t={}){const n=[];let r=1,i=!0;for(;;){const s=await Rb(r,JK,"",e,{includeArchived:!0,...t.orderBy?{orderBy:t.orderBy}:{}});if(n.push(...(s.data??[]).filter(o=>o.archived_at!=null)),!s.meta?.has_more)break;if(n.length>=WMe){i=!1;break}if(r>=eZ){i=!1;break}r++}return{notes:n,complete:i}}function GMe(e,t){const[n,r]=b.useState(e);return b.useEffect(()=>{const i=setTimeout(()=>r(e),t);return()=>clearTimeout(i)},[e,t]),n}const KMe=[];function GS(e,t,n,r,i,s){const o={...i?{orderBy:i}:{},...s?{includeArchived:s}:{}},{data:a,isFetching:l}=hr({queryKey:["finding",e,t,n,i??"",s?"all":"active"],queryFn:()=>Object.keys(o).length>0?Rb(1,n+1,t,e,o):Rb(1,n+1,t,e),enabled:r,placeholderData:d=>d}),u=a?.data?.length??0;return{rows:b.useMemo(()=>r&&a?.data?a.data.slice(0,n):KMe,[r,a,n]),truncated:r&&u>n,isFetching:r&&l}}function ZMe({query:e,filter:t="all",limit:n=20,debounceMs:r=300,includeArchived:i=!1}){const o=GMe(e,r).trim(),a=o.length>0,l=!a&&t!=="all",u=G=>t==="all"||t===G,f=G=>u(G)&&(a||l),d=l?"updated_at":void 0,p=GS("JOURNAL",o,n,f("journal"),void 0,i),m=GS("NOTE",o,n,f("note"),d,i),v=GS("PLAN",o,n,f("plan"),d,i),_=l?"recent":"search",w=f("link"),{data:x,isFetching:S}=hr({queryKey:["finding","link",_,o,n],queryFn:()=>l?KIe(n+1):XIe(o,n+1),enabled:w,placeholderData:G=>G}),C=f("board"),{data:R,isFetching:P}=hr({queryKey:["finding","board",_,o,n],queryFn:()=>l?WK(n+1):mMe(o,n+1),enabled:C,placeholderData:G=>G}),k=f("conversation"),{data:I,isFetching:D}=hr({queryKey:["finding","conversation",_,o,n],queryFn:()=>l?GP(n+1):KV(o,n+1),enabled:k,placeholderData:G=>G}),L=f("capture"),{data:A,isFetching:$}=hr({queryKey:["finding","capture",_,o,n,i?"all":"active"],queryFn:()=>c2(1,n+1,l?void 0:o,{includeArchived:i}),enabled:L,placeholderData:G=>G}),j=f("task"),{data:V,isFetching:B}=hr({queryKey:["finding","task",_,o,n],queryFn:()=>l?Ib({page:1,per_page:n+1}):kMe(o,n+1),enabled:j,placeholderData:G=>G}),H=b.useMemo(()=>{const G=w?x??[]:[],Z=C?R??[]:[],Y=k?I??[]:[],M=L?A?.data??[]:[],q=j?V?.data??[]:[];return{journal:{items:p.rows.map(x0),truncated:p.truncated,isFetching:p.isFetching},note:{items:m.rows.map(x0),truncated:m.truncated,isFetching:m.isFetching},plan:{items:v.rows.map(x0),truncated:v.truncated,isFetching:v.isFetching},capture:{items:M.slice(0,n).map(ZK),truncated:L&&M.length>n,isFetching:L&&$},board:{items:Z.slice(0,n).map(YK),truncated:C&&Z.length>n,isFetching:C&&P},link:{items:G.slice(0,n).map(NMe),truncated:w&&G.length>n,isFetching:w&&S},task:{items:q.slice(0,n).map(QK),truncated:j&&q.length>n,isFetching:j&&B},conversation:{items:Y.slice(0,n).map(XK),truncated:k&&Y.length>n,isFetching:k&&D}}},[p.rows,p.truncated,p.isFetching,m.rows,m.truncated,m.isFetching,v.rows,v.truncated,v.isFetching,A,L,$,R,C,P,V,j,B,I,k,D,x,w,S,n]);return{groups:b.useMemo(()=>$Me(Jk.flatMap(G=>H[G].items)).map(G=>({...G,truncated:H[G.kind].truncated})),[H]),debouncedQuery:o,isSearching:Jk.some(G=>H[G].isFetching),browse:l}}function YMe(e=8,t=!0,n="library"){const r=n==="study",{data:i}=hr({queryKey:[zMe,"recent"],queryFn:()=>UMe(),staleTime:30*1e3,enabled:t}),{data:s}=hr({queryKey:BMe,queryFn:()=>qMe(),staleTime:30*1e3,enabled:t}),{data:o}=hr({queryKey:["chats","recent","switchboard"],queryFn:()=>GP(20),staleTime:30*1e3,enabled:t&&r}),{data:a}=hr({queryKey:["whiteboards","recent","switchboard"],queryFn:()=>WK(10),staleTime:30*1e3,enabled:t&&r}),{data:l}=hr({queryKey:["tasks","open","switchboard"],queryFn:()=>CMe({}),staleTime:30*1e3,enabled:t&&r});return b.useMemo(()=>{const u=i??[],f=s??[],d=[...u.map(x0),...f.map(ZK)];return r&&d.push(...(o??[]).filter(p=>p.id).map(XK),...(a??[]).filter(p=>p.id).map(YK),...(l?.data??[]).map(QK)),d.sort((p,m)=>t$(eT(m))-t$(eT(p))).slice(0,e)},[i,s,o,a,l,r,e])}const t$=e=>e?new Date(e).getTime():0,n$="__see-all-results",QMe=[{key:"nav-home",label:"Home",value:"home front page",icon:Nz,to:"/study"},{key:"nav-journal",label:"Journal",value:"journal today write",icon:QT,to:"/study/j"},{key:"nav-chat",label:"New conversation",value:"chat ask desk new conversation",icon:YT,to:"/study/d"},{key:"nav-classic",label:"Classic layout",value:"classic primary layout everything",icon:ZT,to:"/"}],XMe=[{key:"nav-chat",label:"Chat",value:"chat",icon:YT,to:"/chat"},{key:"nav-journal",label:"Journal",value:"journal today",icon:QT,to:"/journal"},{key:"nav-library",label:"Library",value:"library shelves browse journals notes plans captures",icon:Nz,to:"/library"},{key:"nav-tasks",label:"Tasks",value:"tasks",icon:Lz,to:"/tasks"},{key:"nav-whiteboards",label:"Whiteboards",value:"whiteboards board",icon:Bz,to:"/board"},{key:"nav-agents",label:"Agents",value:"agents",icon:tg,to:"/agents"},{key:"nav-task-graph",label:"Task Graph",value:"task graph dependencies",icon:Bre,to:"/tasks/graph"},{key:"nav-threads",label:"Threads",value:"threads",icon:Lre,to:"/threads"},{key:"nav-invite",label:"Invite People",value:"invite people share",icon:zie,to:"/settings/invite"},{key:"nav-study",label:"The study",value:"study new layout redesign",icon:ZT,to:"/study"}];function r$({item:e,onSelect:t}){const n=KK[e.kind].icon,r=FMe(e),i=eT(e);return g.jsxs(kb,{value:Xu(e),onSelect:()=>t(e),className:"flex flex-col items-start gap-1 py-3",children:[g.jsxs("div",{className:"flex w-full items-center gap-2",children:[g.jsx(n,{className:"size-3.5 shrink-0 text-muted-foreground"}),g.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:LMe(e)}),i&&g.jsx("span",{className:"shrink-0 text-xs text-muted-foreground",children:YAe(i)})]}
130),r&&g.jsx("p",{className:"line-clamp-1 pl-[1.375rem] text-xs text-muted-foreground",children:r})]})}function nZ({open:e,onOpenChange:t}){const n=wi(),r=JAe(),[i,s]=b.useState(""),[o,a]=b.useState("all"),[l,u]=b.useState(""),{groups:f,debouncedQuery:d,isSearching:p,browse:m}=ZMe({query:i,filter:o,limit:o==="all"?4:20}),v=YMe(8,e,r==="study"?"study":"library"),_=r==="study"?QMe:XMe,{data:w=!1}=uMe(),x=b.useMemo(()=>GK.filter(j=>j.value!=="plan"||w),[w]);b.useEffect(()=>{e||(s(""),a("all"),u(""))},[e]);const S=d.length>0,C=f.length>0,R=S||m,P=R&&f.some(j=>j.truncated),k=R?f[0]?.items[0]?Xu(f[0].items[0]):"":v[0]?Xu(v[0]):_[0].value,I=b.useMemo(()=>{const j=new Set;if(R){for(const V of f)for(const B of V.items)j.add(Xu(B));P&&j.add(n$)}else{for(const V of v)j.add(Xu(V));for(const V of _)j.add(V.value)}return j},[R,f,v,P,_]);b.useEffect(()=>{l&&I.has(l)||u(k)},[l,I,k]);const D=b.useCallback(j=>{t(!1),n(jMe(j,r))},[n,t,r]),L=b.useCallback(()=>{const j=i.trim(),V=new URLSearchParams;j&&V.set("q",j),o!=="all"&&V.set("type",o),t(!1),n(`${eMe(r)}?${V.toString()}`)},[i,o,n,t,r]),A=x.find(j=>j.value===o)?.label,$=p?m?"Loading…":"Searching…":m?`No ${A?.toLowerCase()} yet.`:S?"No results found.":"Search everything — journals, notes, captures, boards, tasks, conversations…";return g.jsxs(LOe,{open:e,onOpenChange:t,shouldFilter:!1,value:l,onValueChange:u,children:[g.jsx(xK,{placeholder:"Search everything…",value:i,onValueChange:s,autoFocus:!0}),g.jsx("div",{className:"flex items-center gap-0.5 overflow-x-auto border-b px-3 py-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:x.map(j=>{const V=j.value===o;return g.jsx("button",{type:"button",onMouseDown:B=>B.preventDefault(),onClick:()=>a(j.value),className:_e("shrink-0 whitespace-nowrap rounded-full px-2 py-1 text-xs transition-colors",V?"bg-foreground
130/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:j.label},j.value)})}),g.jsxs(SK,{className:"max-h-[420px]",children:[g.jsx(EK,{children:$}),!R&&v.length>0&&g.jsx(Bp,{heading:"Recent",children:v.map(j=>g.jsx(r$,{item:j,onSelect:D},Xu(j)))}),R&&f.map(j=>g.jsx(Bp,{heading:m?j.kind==="task"?"Tasks — highest priority first":`Recent ${j.label.toLowerCase()}`:j.label,children:j.items.map(V=>g.jsx(r$,{item:V,onSelect:D},Xu(V)))},j.kind)),P&&C&&g.jsxs(g.Fragment,{children:[g.jsx(Yk,{}),g.jsx(Bp,{children:g.jsxs(kb,{value:n$,onSelect:L,className:"gap-2 py-2.5 text-sm text-muted-foreground",children:[g.jsx(ZT,{className:"size-3.5"}),"See all results"]})})]}),!R&&g.jsxs(g.Fragment,{children:[g.jsx(Yk,{}),g.jsx(Bp,{heading:"Go to",children:_.map(j=>{const V=j.icon;return g.jsxs(kb,{value:j.value,onSelect:()=>{t(!1),n(j.to)},children:[g.jsx(V,{className:"mr-2 size-4"}),g.jsx("span",{className:"font-medium",children:j.label})]},j.key)})})]})]})]})}function JMe(){const[e,t]=b.useState(!1),n=wi();return b.useEffect(()=>{const r=i=>{i.key==="k"&&(i.metaKey||i.ctrlKey)&&(i.preventDefault(),t(s=>!s)),i.key==="g"&&(i.metaKey||i.ctrlKey)&&i.shiftKey&&(i.preventDefault(),n("/knowledge-graph"))};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[n]),g.jsxs(g.Fragment,{children:[g.jsx(Lf,{children:g.jsxs(ab,{children:[g.jsx(lb,{children:g.jsx(Xs,{iconName:"Search",text:"Search",onClick:()=>t(r=>!r)})}),g.jsx(Dm,{children:g.jsxs("p",{className:"text-sm",children:["Press"," ",g.jsxs("kbd",{className:"pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-mono text-[10px] font-medium text-muted-foreground opacity-100",children:[g.jsx("span",{className:"text-xs",children:"⌘"}),"K"]})]})})]})}),g.jsx(nZ,{open:e,onOpenChange:t})]})}async function eNe(e){const t=new URLSearchParams;return e?.space_type&&t.append("space_type",e.space_type),e?.status&&t.append("status",e.status),t.append("page",(e?.page||1).toString()),t.append("per_page",(e?.per_page).toString()),et(`/spaces/?${t.toString()}`)}async function tNe(e){return et(`/spaces/${e}`)}async function nNe(e){return et("/spaces/",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}async function rNe(e,t){return et(`/spaces/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function iNe(e){return et(`/spaces/${e}`,{method:"DELETE"})}async function sNe(e,t){const n=new URLSearchParams;return n.append("page",(t?.page||1).toString()),n.append("per_page",(t?.per_page||100).toString()),et(`/spaces/${e}/items?${n.toString()}`)}async function pqe(e,t){return et(`/spaces/${e}/items`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}async function mqe(e,t){return et(`/spaces/${e}/items/${t}`,{method:"DELETE"})}async function gqe(e,t){return et(`/spaces/${e}/items/reorder`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:t})})}const d2={list:e=>["spaces","list",e??null],detail:e=>["spaces","detail",e]};function oNe(e){return hr({queryKey:d2.list(e),queryFn:()=>eNe({...e,per_page:100})})}function vqe(e){return hr({queryKey:d2.detail(e||""),queryFn:()=>tNe(e),enabled:!!e})}function aNe(){const e=Dr();return os({mutationFn:t=>nNe(t),onSuccess:()=>{e.invalidateQueries({queryKey:["spaces"]})}})}function yqe(){const e=Dr();return os({mutationFn:({id:t,data:n})=>rNe(t,n),onSuccess:t=>{e.setQueryData(d2.detail(t.id),t),e.invalidateQueries({queryKey:["spaces"]})}})}function bqe(){const e=Dr();return os({mutationFn:t=>iNe(t),onSuccess:()=>{e.invalidateQueries({queryKey:["spaces"]})}})}function f2(){const{data:e,isLoading:t}=oNe(),n=b.useMemo(()=>e?.data??[],[e]),r=Uue({queries:n.map(f=>({queryKey:["spaces","items",f.id],queryFn:()=>sNe(f.id,{per_page:100}),staleTime:6e4}))}),i=r.map(f=>f.dataUpdatedAt).join("|"),{parentByChildId:s,childIdsByParent:o}=b.useMemo(()=>{const f=new Map,d=new Map;return n.forEach((p,m)=>{const _=[...r[m]?.data?.data??[]].sort((x,S)=>x.position-S.position),w=[];for(const x of _)x.entity_type==="SPACE"&&(w.push(x.entity_id),f.has(x.entity_id)||f.set(x.entity_id,p.id));w.length>0&&d.set(p.id,w)}),{parentByChildId:f,childIdsByParent:d}},[n,i]),a=b.useMemo(()=>{const f=new Set;for(const d of n)s.has(d.id)||f.add(d.id);return f},[n,s]),l=b.useMemo(()=>new Map(n.map(f=>
130[f.id,f])),[n]),u=t||r.some(f=>f.isLoading);return{allSpaces:n,spaceById:l,parentByChildId:s,childIdsByParent:o,topLevelIds:a,isLoading:u}}function lNe(e){const{allSpaces:t,topLevelIds:n,isLoading:r}=f2();return{spaces:b.useMemo(()=>t.filter(s=>!(!n.has(s.id)||e?.space_type&&s.space_type!==e.space_type||s.status!==e.status)),[t,n,e?.space_type,e?.status]),isLoading:r}}function _qe(e){const{spaceById:t,parentByChildId:n,isLoading:r}=f2();if(!e)return{parent:null,isLoading:r};const i=n.get(e);return{parent:i?t.get(i)??null:null,isLoading:r}}function wqe(){const{spaceById:e,childIdsByParent:t,parentByChildId:n,isLoading:r}=f2();return{spaceById:e,childIdsByParent:t,parentByChildId:n,rootOf:s=>{if(!s)return null;let o=s,a=n.get(o);for(;a;)o=a,a=n.get(o);return e.get(o)??null},isLoading:r}}const Dg=b.forwardRef(({className:e,type:t,...n},r)=>g.jsx("input",{type:t,className:_e("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...n}));Dg.displayName="Input";var uNe=Object.defineProperty,cNe=(e,t)=>uNe(e,"name",{value:t,configurable:!0}),dNe=b.forwardRef(cNe(function(t,n){return g.jsx(Vt.label,{...t,ref:n,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(t.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}})},"Label")),rZ=dNe;const fNe=Jf("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),sm=b.forwardRef(({className:e,...t},n)=>g.jsx(rZ,{ref:n,className:_e(fNe(),e),...t}));sm.displayName=rZ.displayName;var hNe=Object.defineProperty,pNe=(e,t)=>hNe(e,"name",{value:t,configurable:!0});function iZ(e){const t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}pNe(iZ,"usePrevious");var mNe=Object.defineProperty,Gt=(e,t)=>mNe(e,"name",{value:t,configurable:!0}),gNe=[" ","Enter","ArrowUp","ArrowDown"],vNe=[" ","Enter"],Wf="Select",[mw,gw,yNe]=Q_(Wf),[Wc,xqe]=$s(Wf,[yNe,rh]),h2=rh(),[bNe,lu]=Wc(Wf),[_Ne,wNe]=Wc(Wf);function sZ(e){const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:o,defaultValue:a,onValueChange:l,dir:u,name:f,autoComplete:d,disabled:p,required:m,form:v,internal_do_not_use_render:_}=e,w=h2(t),[x,S]=b.useState(null),[C,R]=b.useState(null),[P,k]=b.useState(!1),I=vg(u),[D,L]=_c({prop:r,defaultProp:i??!1,onChange:s,caller:Wf}),[A,$]=_c({prop:o,defaultProp:a,onChange:l,caller:Wf}),j=b.useRef(null),V=b.useRef(A);b.useEffect(()=>{const z=v?x?.ownerDocument.getElementById(v):x?.form;if(z instanceof HTMLFormElement){const N=Gt(()=>$(V.current),"reset");return z.addEventListener("reset",N),()=>z.removeEventListener("reset",N)}},[v,x,$]);const B=x?!!v||!!x.closest("form"):!0,[H,te]=b.useState(new Set),G=Vl(),Z=Array.from(H).map(z=>z.props.value).join(";"),Y=b.useCallback(z=>{te(N=>new Set(N).add(z))},[]),M=b.useCallback(z=>{te(N=>{const ee=new Set(N);return ee.delete(z),ee})},[]),q={required:m,trigger:x,onTriggerChange:S,valueNode:C,onValueNodeChange:R,valueNodeHasChildren:P,onValueNodeHasChildrenChange:k,contentId:G,value:A,onValueChange:$,open:D,onOpenChange:L,dir:I,triggerPointerDownPosRef:j,disabled:p,name:f,autoComplete:d,form:v,nativeOptions:H,nativeSelectKey:Z,isFormControl:B};return g.jsx(uR,{...w,children:g.jsx(bNe,{scope:t,...q,children:g.jsx(mw.Provider,{scope:t,children:g.jsx(_Ne,{scope:t,onNativeOptionAdd:Y,onNativeOptionRemove:M,children:gZ(_)?_(q):n})})})})}Gt(sZ,"SelectProvider");var xNe=Gt(e=>{const{__scopeSelect:t,children:n,...r}=e;return g.jsx(sZ,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:i})=>g.jsxs(g.Fragment,{children:[n,i?g.jsx(qNe,{__scopeSelect:t}):null]})})},"Select"),SNe="SelectTrigger",oZ=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,disabled:i=!1,...s}=t,o=h2(r),a=lu(SNe,r),l=a.disabled||i,u=At(n,a.onTriggerChange),f=gw(r),d=b.useRef("touch"),[p,m,v]=m2(w=>{const x=f().filter(R=>!R.disabled),S=x.find(R=>R.value===a.value),C=g2(x,w,S);C!==void 0&&a.onValueChange(C.value)}),_=Gt(w=>{l||(a.onOpenChange(!0),v()),w&&(a.triggerPointerDownPosRef.current={x:Math.round(w.pageX),y:Math.round(w.pageY)})},"handleOpen");return g.jsx(cR,{asChild:!0,...o,children:g.jsx(Vt.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Ag(a.value)?"":void 0,...s,ref:u,onClick:Ue(s.onClick,w=>
130{w.currentTarget.focus(),d.current!=="mouse"&&_(w)}),onPointerDown:Ue(s.onPointerDown,w=>{d.current=w.pointerType;const x=w.target;x.hasPointerCapture(w.pointerId)&&x.releasePointerCapture(w.pointerId),w.button===0&&w.ctrlKey===!1&&w.pointerType==="mouse"&&(_(w),w.preventDefault())}),onKeyDown:Ue(s.onKeyDown,w=>{const x=p.current!=="";!(w.ctrlKey||w.altKey||w.metaKey)&&w.key.length===1&&m(w.key),!(x&&w.key===" ")&&gNe.includes(w.key)&&(_(),w.preventDefault())})})})},"SelectTrigger")),ENe="SelectValue",CNe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,className:i,style:s,children:o,placeholder:a="",...l}=t,u=lu(ENe,r),{onValueNodeHasChildrenChange:f}=u,d=o!==void 0,p=At(n,u.onValueNodeChange);$n(()=>{f(d)},[f,d]);const m=Ag(u.value);return g.jsx(Vt.span,{...l,asChild:m?!1:l.asChild,ref:p,style:{pointerEvents:"none"},children:g.jsx(b.Fragment,{children:m?a:o},m?"placeholder":"value")})},"SelectValue")),kNe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,children:i,...s}=t;return g.jsx(Vt.span,{"aria-hidden":!0,...s,ref:n,children:i||"▼"})},"SelectIcon")),TNe="SelectPortal",[PNe,RNe]=Wc(TNe,{forceMount:void 0}),INe=Gt(e=>{const{__scopeSelect:t,forceMount:n,...r}=e;return g.jsx(PNe,{scope:e.__scopeSelect,forceMount:n,children:g.jsx(fR,{asChild:!0,...r})})},"SelectPortal"),Pc="SelectContent",aZ=b.forwardRef(Gt(function(t,n){const r=RNe(Pc,t.__scopeSelect),{forceMount:i=r.forceMount,...s}=t,o=lu(Pc,t.__scopeSelect),[a,l]=b.useState();return $n(()=>{l(new DocumentFragment)},[]),g.jsx(as,{present:i||o.open,children:({present:u})=>u?g.jsx(ANe,{...s,ref:n}):g.jsx(ONe,{...s,fragment:a})})},"SelectContent")),ONe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,children:i,fragment:s}=t;return s?Ba.createPortal(g.jsx(lZ,{scope:r,children:g.jsx(mw.Slot,{scope:r,children:g.jsx("div",{ref:n,children:i})})}),s):null},"SelectContentFragment")),eo=10,[lZ,Gc]=Wc(Pc),DNe=Zo("SelectContent.RemoveScroll"),ANe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r}=t,{position:i="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:o,onPointerDownOutside:a,side:l,sideOffset:u,align:f,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:_,hideWhenDetached:w,avoidCollisions:x,...S}=t,C=lu(Pc,r),[R,P]=b.useState(null),[k,I]=b.useState(null),D=At(n,P),[L,A]=b.useState(null),[$,j]=b.useState(null),V=gw(r),[B,H]=b.useState(!1),te=b.useRef(!1);b.useEffect(()=>{if(R)return _g(R)},[R]),Sg();const G=b.useCallback(se=>{const[ce,...fe]=V().map(Se=>Se.ref.current),[ke]=fe.slice(-1),Ce=document.activeElement;for(const Se of se)if(Se===Ce||(Se?.scrollIntoView({block:"nearest"}),Se===ce&&k&&(k.scrollTop=0),Se===ke&&k&&(k.scrollTop=k.scrollHeight),Se?.focus(),document.activeElement!==Ce))return},[V,k]),Z=b.useCallback(()=>G([L,R]),[G,L,R]);b.useEffect(()=>{B&&Z()},[B,Z]);const{onOpenChange:Y,triggerPointerDownPosRef:M}=C;b.useEffect(()=>{if(R){let se={x:0,y:0};const ce=Gt(ke=>{se={x:Math.abs(Math.round(ke.pageX)-(M.current?.x??0)),y:Math.abs(Math.round(ke.pageY)-(M.current?.y??0))}},"handlePointerMove"),fe=Gt(ke=>{se.x<=10&&se.y<=10?ke.preventDefault():ke.composedPath().includes(R)||Y(!1),document.removeEventListener("pointermove",ce),M.current=null},"handlePointerUp");return M.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",fe,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",fe,{capture:!0})}}},[R,Y,M]),b.useEffect(()=>{const se=Gt(()=>Y(!1),"close");return window.addEventListener("blur",se),window.addEventListener("resize",se),()=>{window.removeEventListener("blur",se),window.removeEventListener("resize",se)}},[Y]);const[q,z]=m2(se=>{const ce=V().filter(Ce=>!Ce.disabled),fe=ce.find(Ce=>Ce.ref.current===document.activeElement),ke=g2(ce,se,fe);ke&&setTimeout(()=>ke.ref.current?.focus())}),N=b.useCallback((se,ce,fe)=>{const ke=!te.current&&!fe;(C.value!==void 0&&C.value===ce||ke)&&(A(se),ke&&(te.current=!0))},[C.value]),ee=b.useCallback(()=>R?.focus(),[R]),X=b.useCallback((se,ce,fe)=>{const ke=!te.current&&!fe;(C.value!==void 0&&C.value===ce||ke)&&j(se)},[C.value]),ne=i==="popper"?i$:MNe,ae=ne===i$?{side:l,sideOffset:u,align:f,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:v,sticky:_,hideWhenDetached:w,avoidCollisions:x}:{};return g.jsx(lZ,{scope:r,content:R,viewport:k,onViewportChange:I,itemRefCallback:N,selectedItem:L,onItemLeave:ee,itemTextRefCallback:X,focusSelectedItem:Z,selectedItemText:$,position:i,isPositioned:B,searchRef:q,children:g.jsx(ew,{as:DNe,allowPinchZoom:!0,children:g.jsx(MI,{asChild:!0,trapped:C.open,onMountAutoFocus:se=>{se.preventDefault()},onUnmountAutoFocus:Ue(s,se=>{C.trigger?.focus({preventScroll:!0}),se.preventDefault()}),children:g.jsx(x_,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:se=>se.preventDefault(),onDismiss:()=>C.onOpenChange(!1),children:g.jsx(ne,{role:"listbox",id:C.contentId,"data-state":C.open?"open":"closed",dir:C.dir,onContextMenu:se=>se.preventDefault(),...S,...ae,onPlaced:()=>H(!0),ref:D,style:{display:"flex",flexDirection:"column",outline:"none",...S.style},onKeyDown:Ue(S.onKeyDown,se=>{const ce=se.ctrlKey||se.altKey||se.metaKey;if(se.key==="Tab"&&se.preventDefault(),!ce&&se.key.length===1&&z(se.key),["ArrowUp","ArrowDown","Home","End"].includes(se.ke
vendor: 5,714 bytes, line 130
130y)){let ke=V().filter(Ce=>!Ce.disabled).map(Ce=>Ce.ref.current);if(["ArrowUp","End"].includes(se.key)&&(ke=ke.slice().reverse()),["ArrowUp","ArrowDown"].includes(se.key)){const Ce=se.target,Se=ke.indexOf(Ce);ke=ke.slice(Se+1)}setTimeout(()=>G(ke)),se.preventDefault()}})})})})})})},"SelectContentImpl")),MNe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,onPlaced:i,...s}=t,o=lu(Pc,r),a=Gc(Pc,r),[l,u]=b.useState(null),[f,d]=b.useState(null),p=At(n,d),m=gw(r),v=b.useRef(!1),_=b.useRef(!0),{viewport:w,selectedItem:x,selectedItemText:S,focusSelectedItem:C}=a,R=b.useCallback(()=>{if(o.trigger&&o.valueNode&&l&&f&&w&&x&&S){const D=o.trigger.getBoundingClientRect(),L=f.getBoundingClientRect(),A=o.valueNode.getBoundingClientRect(),$=S.getBoundingClientRect();if(o.dir!=="rtl"){const Ce=$.left-L.left,Se=A.left-Ce,Fe=D.left-Se,Be=D.width+Fe,wt=Math.max(Be,L.width),ht=window.innerWidth-eo,W=xb(Se,[eo,Math.max(eo,ht-wt)]);l.style.minWidth=Be+"px",l.style.left=W+"px"}else{const Ce=L.right-$.right,Se=window.innerWidth-A.right-Ce,Fe=window.innerWidth-D.right-Se,Be=D.width+Fe,wt=Math.max(Be,L.width),ht=window.innerWidth-eo,W=xb(Se,[eo,Math.max(eo,ht-wt)]);l.style.minWidth=Be+"px",l.style.right=W+"px"}const j=m(),V=window.innerHeight-eo*2,B=w.scrollHeight,H=window.getComputedStyle(f),te=parseInt(H.borderTopWidth,10),G=parseInt(H.paddingTop,10),Z=parseInt(H.borderBottomWidth,10),Y=parseInt(H.paddingBottom,10),M=te+G+B+Y+Z,q=Math.min(x.offsetHeight*5,M),z=window.getComputedStyle(w),N=parseInt(z.paddingTop,10),ee=parseInt(z.paddingBottom,10),X=D.top+D.height/2-eo,ne=V-X,ae=x.offsetHeight/2,se=x.offsetTop+ae,ce=te+G+se,fe=M-ce;if(ce<=X){const Ce=j.length>0&&x===j[j.length-1].ref.current;l.style.bottom="0px";const Se=f.clientHeight-w.offsetTop-w.offsetHeight,Fe=Math.max(ne,ae+(Ce?ee:0)+Se+Z),Be=ce+Fe;l.style.height=Be+"px"}else{const Ce=j.length>0&&x===j[0].ref.current;l.style.top="0px";const Fe=Math.max(X,te+w.offsetTop+(Ce?N:0)+ae)+fe;l.style.height=Fe+"px",w.scrollTop=ce-X+w.offsetTop}l.style.margin=`${eo}px 0`,l.style.minHeight=q+"px",l.style.maxHeight=V+"px",i?.(),requestAnimationFrame(()=>v.current=!0)}},[m,o.trigger,o.valueNode,l,f,w,x,S,o.dir,i]);$n(()=>R(),[R]);const[P,k]=b.useState();$n(()=>{f&&k(window.getComputedStyle(f).zIndex)},[f]);const I=b.useCallback(D=>{D&&_.current===!0&&(R(),C?.(),_.current=!1)},[R,C]);return g.jsx(NNe,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:I,children:g.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:P},children:g.jsx(Vt.div,{...s,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})},"SelectItemAlignedPosition")),i$=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,align:i="start",collisionPadding:s=eo,...o}=t,a=h2(r);return g.jsx(dR,{...a,...o,ref:n,align:i,collisionPadding:s,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[NNe,p2]=Wc(Pc,{}),s$="SelectViewport",jNe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,nonce:i,...s}=t,o=Gc(s$,r),a=p2(s$,r),l=At(n,o.onViewportChange),u=b.useRef(0);return g.jsxs(g.Fragment,{children:[g.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),g.jsx(mw.Slot,{scope:r,children:g.jsx(Vt.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Ue(s.onScroll,f=>{const d=f.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=a;if(m?.current&&p){const v=Math.abs(u.current-d.scrollTop);if(v>0){const _=window.innerHeight-eo*2,w=parseFloat(p.style.minHeight),x=parseFloat(p.style.height),S=Math.max(w,x);if(S<_){const C=S+v,R=Math.min(_,C),P=C-R;p.style.height=R+"px",p.style.bottom==="0px"&&(d.scrollTop=P>0?P:0,p.style.justifyContent="flex-end")}}}u.current=d.scrollTop})})})]})},"SelectViewport")),LNe="SelectGroup",[Sqe,FNe]=Wc(LNe),$Ne="SelectLabel",uZ=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,...i}=t,s=FNe($Ne,r);return g.jsx(Vt.div,{id:s.id,...i,ref:n})},"SelectLabel")),tT="SelectItem",[zNe,cZ]=Wc(tT),dZ=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,value:i,disabled:s=!1,textValue:o,...a}=t,l=lu(tT,r),u=Gc(tT,r),f=l.value===i,[d,p]=b.useState(o??""),[m,v]=b.useState(!1),_=Sr(R=>u.itemRefCallback?.(R,i,s)),w=At(n,_),x=Vl(),S=b.useRef("touch"),C=Gt(()=>{s||(l.onValueChange(i),l.onOpenChange(!1))},"handleSelect");return g.jsx(zNe,{scope:r,value:i,disabled:s,textId:x,isSelected:f,onItemTextChange:b.useCallback(R=>{p(P=>P||(R?.textContent??"").trim())},[]),children:g.jsx(mw.ItemSlot,{scope:r,value:i,disabled:s,textValue:d,children:g.jsx(Vt.div,{role:"option","aria-labelledby":x,"data-highlighted":m?"":void 0,"aria-selected":f&&m,"data-state":f?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:w,onFocus:Ue(a.onFocus,()=>v(!0)),onBlur:Ue(a.onBlur,()=>v(!1)),onClick:Ue(a.onClick,()=>{S.current!=="mouse"&&C()}),onPointerUp:Ue(a.onPointerUp,()=>{S.current==="mouse"&&C()}),onPointerDown:Ue(a.onPointerDown,R=>{S.current=R.pointerType}),onPointerMove:Ue(a.onPointerMove,R=>{S.current=R.pointerType,s?u.onItemLeave?.():S.current==="mouse"&&R.currentTarget.focu
130s({preventScroll:!0})}),onPointerLeave:Ue(a.onPointerLeave,R=>{R.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:Ue(a.onKeyDown,R=>{s||R.target!==R.currentTarget||u.searchRef?.current!==""&&R.key===" "||(vNe.includes(R.key)&&C(),R.key===" "&&R.preventDefault())})})})})},"SelectItem")),Ny="SelectItemText",VNe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,className:i,style:s,...o}=t,a=lu(Ny,r),l=Gc(Ny,r),u=cZ(Ny,r),f=wNe(Ny,r),[d,p]=b.useState(null),m=Sr(C=>l.itemTextRefCallback?.(C,u.value,u.disabled)),v=At(n,p,u.onItemTextChange,m),_=d?.textContent,w=b.useMemo(()=>g.jsx("option",{value:u.value,disabled:u.disabled,children:_},u.value),[u.disabled,u.value,_]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=f;return $n(()=>(x(w),()=>S(w)),[x,S,w]),g.jsxs(g.Fragment,{children:[g.jsx(Vt.span,{id:u.textId,...o,ref:v}),u.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!Ag(a.value)?Ba.createPortal(o.children,a.valueNode):null]})},"SelectItemText")),UNe="SelectItemIndicator",BNe=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,...i}=t;return cZ(UNe,r).isSelected?g.jsx(Vt.span,{"aria-hidden":!0,...i,ref:n}):null},"SelectItemIndicator")),o$="SelectScrollUpButton",fZ=b.forwardRef(Gt(function(t,n){const r=Gc(o$,t.__scopeSelect),i=p2(o$,t.__scopeSelect),[s,o]=b.useState(!1),a=At(n,i.onScrollButtonChange);return $n(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=u.scrollTop>0;o(f)};Gt(l,"handleScroll");const u=r.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?g.jsx(pZ,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=r;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null},"SelectScrollUpButton")),a$="SelectScrollDownButton",hZ=b.forwardRef(Gt(function(t,n){const r=Gc(a$,t.__scopeSelect),i=p2(a$,t.__scopeSelect),[s,o]=b.useState(!1),a=At(n,i.onScrollButtonChange);return $n(()=>{if(r.viewport&&r.isPositioned){let l=function(){const f=u.scrollHeight-u.clientHeight,d=Math.ceil(u.scrollTop)<f;o(d)};Gt(l,"handleScroll");const u=r.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),s?g.jsx(pZ,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=r;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null},"SelectScrollDownButton")),pZ=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,onAutoScroll:i,...s}=t,o=Gc("SelectScrollButton",r),a=b.useRef(null),l=gw(r),u=b.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return b.useEffect(()=>()=>u(),[u]),$n(()=>{l().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),g.jsx(Vt.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:Ue(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(i,50))}),onPointerMove:Ue(s.onPointerMove,()=>{o.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(i,50))}),onPointerLeave:Ue(s.onPointerLeave,()=>{u()})})},"SelectScrollButtonImpl")),mZ=b.forwardRef(Gt(function(t,n){const{__scopeSelect:r,...i}=t;return g.jsx(Vt.div,{"aria-hidden":!0,...i,ref:n})},"SelectSeparator")),HNe="SelectBubbleInput",qNe=b.forwardRef(Gt(function({__scopeSelect:t,...n},r){const i=lu(HNe,t),{value:s,onValueChange:o,required:a,disabled:l,name:u,autoComplete:f,form:d}=i,{nativeOptions:p,nativeSelectKey:m}=i,v=b.useRef(null),_=At(r,v),w=s??"",x=iZ(w),S=Array.from(p).some(C=>(C.props.value??"")==="");return b.useEffect(()=>{const C=v.current;if(!C)return;const R=window.HTMLSelectElement.prototype,k=Object.getOwnPropertyDescriptor(R,"value").set;if(x!==w&&k){const I=new Event("change",{bubbles:!0});k.call(C,w),C.dispatchEvent(I)}},[x,w]),g.jsxs(Vt.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:u,autoComplete:f,disabled:l,form:d,onChange:C=>o(C.target.value),...n,style:{...i7,...n.style},ref:_,defaultValue:w,children:[Ag(s)&&!S?g.jsx("option",{value:""}):null,Array.from(p)]},m)},"SelectBubbleInput"));function gZ(e){return typeof e=="function"}Gt(gZ,"isFunction");function Ag(e){return e===""||e===void 0}Gt(Ag,"shouldShowPlaceholder");function m2(e){const t=Sr(e),n=b.useRef(""),r=b.useRef(0),i=b.useCallback(o=>{const a=n.current+o;
130t(a),Gt((function l(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>l(""),1e3))}),"updateSearch")(a)},[t]),s=b.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}Gt(m2,"useTypeaheadSearch");function g2(e,t,n){const i=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,s=n?e.indexOf(n):-1;let o=vZ(e,Math.max(s,0));i.length===1&&(o=o.filter(u=>u!==n));const l=o.find(u=>u.textValue.toLowerCase().startsWith(i.toLowerCase()));return l!==n?l:void 0}Gt(g2,"findNextItem");function vZ(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Gt(vZ,"wrapArray");const yZ=xNe,bZ=CNe,v2=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(oZ,{ref:r,className:_e("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,g.jsx(kNe,{asChild:!0,children:g.jsx(Lne,{className:"size-4 opacity-50"})})]}));v2.displayName=oZ.displayName;const _Z=b.forwardRef(({className:e,...t},n)=>g.jsx(fZ,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(Pz,{className:"size-4"})}));_Z.displayName=fZ.displayName;const wZ=b.forwardRef(({className:e,...t},n)=>g.jsx(hZ,{ref:n,className:_e("flex cursor-default items-center justify-center py-1",e),...t,children:g.jsx(kz,{className:"size-4"})}));wZ.displayName=hZ.displayName;const y2=b.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>g.jsx(INe,{children:g.jsxs(aZ,{ref:i,className:_e("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[g.jsx(_Z,{}),g.jsx(jNe,{className:_e("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),g.jsx(wZ,{})]})}));y2.displayName=aZ.displayName;const WNe=b.forwardRef(({className:e,...t},n)=>g.jsx(uZ,{ref:n,className:_e("px-2 py-1.5 text-sm font-semibold",e),...t}));WNe.displayName=uZ.displayName;const Ob=b.forwardRef(({className:e,children:t,...n},r)=>g.jsxs(dZ,{ref:r,className:_e("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[g.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:g.jsx(BNe,{children:g.jsx(ng,{className:"size-4"})})}),g.jsx(VNe,{children:t})]}));Ob.displayName=dZ.displayName;const GNe=b.forwardRef(({className:e,...t},n)=>g.jsx(mZ,{ref:n,className:_e("-mx-1 my-1 h-px bg-muted",e),...t}));GNe.displayName=mZ.displayName;const xZ=b.forwardRef(({className:e,...t},n)=>g.jsx("textarea",{className:_e("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));xZ.displayName="Textarea";const KNe={PROJECT:"Project",INITIATIVE:"Initiative",ROADMAP:"Roadmap",COLLECTION:"Collection"},Eqe={ACTIVE:"Active",PAUSED:"Paused",COMPLETED:"Completed",ARCHIVED:"Archived"},ZNe=["PROJECT","INITIATIVE","ROADMAP","COLLECTION"],Cqe=["ACTIVE","PAUSED","COMPLETED","ARCHIVED"],kqe={SPACE:{label:"Space",icon:Mz,href:e=>`/spaces/${e}`},TASK:{label:"Task",icon:Wz,href:e=>`/tasks/${e}`},NOTE:{label:"Note",icon:e_,href:e=>`/notes/${e}`},LINK:{label:"Link",icon:jz,href:e=>`/read/${e}`},FILE:{label:"File",icon:Xre,href:()=>"/files"},COMPONENT:{label:"Component",icon:kne,href:()=>null}
130,AGENT:{label:"Agent",icon:tg,href:()=>"/agents"}};function Tqe(e){return e.map((t,n)=>({id:t,position:(n+1)*1e3}))}function YNe({open:e,onOpenChange:t,defaultType:n="PROJECT"}){const r=wi(),i=aNe(),[s,o]=b.useState(""),[a,l]=b.useState(""),[u,f]=b.useState(n),[d,p]=b.useState(null);b.useEffect(()=>{e&&(o(""),l(""),f(n),p(null))},[e,n]);const m=async()=>{if(p(null),!s.trim()){p("Title is required");return}try{const v=await i.mutateAsync({title:s.trim(),description:a.trim()||null,space_type:u});t(!1),r(`/spaces/${v.id}`)}catch(v){p(v.message)}};return g.jsx(KI,{open:e,onOpenChange:t,children:g.jsxs(iw,{className:"sm:max-w-[480px]",children:[g.jsx(ZI,{children:g.jsx(QI,{children:"New space"})}),g.jsxs("div",{className:"space-y-4",children:[g.jsxs("div",{className:"space-y-1.5",children:[g.jsx(sm,{htmlFor:"space-title",children:"Title"}),g.jsx(Dg,{id:"space-title",value:s,onChange:v=>o(v.target.value),placeholder:"What's this space about?",autoFocus:!0})]}),g.jsxs("div",{className:"space-y-1.5",children:[g.jsx(sm,{children:"Type"}),g.jsxs(yZ,{value:u,onValueChange:v=>f(v),children:[g.jsx(v2,{children:g.jsx(bZ,{})}),g.jsx(y2,{children:ZNe.map(v=>g.jsx(Ob,{value:v,children:KNe[v]},v))})]})]}),g.jsxs("div",{className:"space-y-1.5",children:[g.jsx(sm,{htmlFor:"space-description",children:"Description"}),g.jsx(xZ,{id:"space-description",value:a,onChange:v=>l(v.target.value),placeholder:"Optional",rows:3})]}),d&&g.jsx("p",{className:"text-sm text-destructive",children:d})]}),g.jsxs(YI,{children:[g.jsx(fn,{variant:"ghost",onClick:()=>t(!1),disabled:i.isPending,children:"Cancel"}),g.jsx(fn,{onClick:m,disabled:i.isPending,children:i.isPending?"Creating...":"Create"})]})]})})}const QNe=5;function XNe(){const e=wi(),t=Qn(),[n,r]=b.useState(!1),{spaces:i,isLoading:s}=lNe({status:"ACTIVE"}),o=i.slice(0,QNe),a=t.pathname.startsWith("/spaces");return g.jsxs(g.Fragment,{children:[g.jsxs("div",{className:"mb-1 mt-2 flex items-center justify-between",children:[g.jsx("button",{onClick:()=>e("/spaces"),className:_e("text-xs font-medium uppercase tracking-wider transition-colors hover:text-foreground",a?"text-foreground":"text-muted-foreground"),children:"Spaces"}),g.jsx("button",{onClick:()=>r(!0),className:"rounded-2xl p-1 text-muted-foreground hover:bg-accent hover:text-foreground","aria-label":"New space",children:g.jsx(Er.PlusCircle,{className:"size-4"})})]}),g.jsx("div",{className:"space-y-0.5",children:s?g.jsxs(g.Fragment,{children:[g.jsx(jo,{className:"h-6 w-full"}),g.jsx(jo,{className:"h-6 w-3/4"}),g.jsx(jo,{className:"h-6 w-5/6"})]}):o.length===0?g.jsxs("button",{onClick:()=>r(!0),className:"flex w-full items-center gap-2 rounded-2xl px-2 py-1 text-left text-sm text-muted-foreground hover:bg-accent hover:text-foreground",children:[g.jsx(Xf,{className:"size-3.5"}),"Create your first space"]}):o.map(l=>{const u=t.pathname===`/spaces/${l.id}`;return g.jsx(fo,{to:`/spaces/${l.id}`,className:_e("block truncate rounded-2xl px-2 py-1 text-sm transition-colors",u?"bg-primary/10 text-foreground":"text-muted-foreground hover:bg-accent hover:text-foreground"),children:l.title},l.id)})}),g.jsx(YNe,{open:n,onOpenChange:r})]})}function SZ(){const e=wi(),n=Qn().pathname,{user:r}=eh(),i=lI();return g.jsx(g.Fragment,{children:g.jsxs("aside",{className:_e("flex w-full flex-col overflow-hidden rounded-md bg-secondary/50 px-6 py-4",i?"h-full":"h-screen"),children:[g.jsxs(fo,{to:"/",className:"mb-4 flex items-center space-x-2",children:[g.jsx(Er.logo,{className:"size-6"}),g.jsx("span",{className:"text-lg font-semibold md:text-xl",children:qo.name})]}),g.jsxs("nav",{"aria-label":"Sidebar",className:"flex flex-1 flex-col overflow-x-hidden",children:[i?g.jsx(Xs,{iconName:"Search",text:"Search",isMobile:i,onClick:()=>e("/search"),className:n.startsWith("/search")?"rounded-2xl bg-primary/10":""}):g.jsx(JMe,{}),g.jsx(Xs,{iconName:"Home",text:"Home",isMobile:i,onClick:()=>e("/"),className:n==="/"?"rounded-2xl bg-primary/10":""}),g.jsx(Xs,{iconName:"Chat",text:"Chat",isMobile:i,onClick:()=>e("/chat"),className:n.startsWith("/chat")?"rounded-2xl bg-primary/10":""}
130),g.jsx(Xs,{iconName:"Calendar",text:"Journal",isMobile:i,onClick:()=>e("/journal"),className:n.startsWith("/journal")?"rounded-2xl bg-primary/10":""}),g.jsx(Xs,{iconName:"Library",text:"Library",isMobile:i,onClick:()=>e("/library"),className:n.startsWith("/library")?"rounded-2xl bg-primary/10":""}),g.jsx(Xs,{iconName:"Tasks",text:"Tasks",isMobile:i,onClick:()=>e("/tasks"),className:n.startsWith("/tasks")?"rounded-2xl bg-primary/10":""}),g.jsx(Xs,{iconName:"Whiteboard",text:"Whiteboards",isMobile:i,onClick:()=>e("/board"),className:n.startsWith("/board")?"rounded-2xl bg-primary/10":""}),g.jsx(Xs,{iconName:"Bot",text:"Agents",isMobile:i,onClick:()=>e("/agents"),className:n.startsWith("/agents")?"rounded-2xl bg-primary/10":""}),r?.is_superuser&&g.jsx(Xs,{iconName:"Admin",text:"Admin",isMobile:i,onClick:()=>e("/admin/usage"),className:n.startsWith("/admin")?"rounded-2xl bg-primary/10":""}),g.jsx(Xs,{iconName:"Gear",text:"Settings",isMobile:i,onClick:()=>e("/settings"),className:n.startsWith("/settings")?"rounded-2xl bg-primary/10":""}),g.jsx(uI,{className:"my-4 md:my-2"}),g.jsx("div",{className:"flex-1 overflow-hidden",children:g.jsx(Cc,{className:"h-full pr-4",children:g.jsx(XNe,{})})})]}),g.jsx("div",{className:"mt-auto border-t border-border pt-4",children:g.jsxs("div",{className:"flex items-center justify-between",children:[r?g.jsx(OI,{user:r}):g.jsx(fo,{to:"/auth/signin",className:_e(dc({variant:"ghost",size:"sm"})),children:"Sign In"}),g.jsx(pI,{})]})})]})})}const l$=10,JNe=8,u$=.35,eje={type:"spring",stiffness:420,damping:38};function c$(){return Math.min(window.innerWidth*.86,352)}function tje(e){let t=e;for(;t&&t!==document.body;){if(t.scrollWidth>t.clientWidth+1){const n=getComputedStyle(t).overflowX;if(n==="auto"||n==="scroll")return!0}t=t.parentElement}return!1}function nje({progress:e,isOpenRef:t,setOpen:n,enabled:r}){b.useEffect(()=>{if(!r)return;let i=!1,s=!1,o=!1,a=0,l=0,u=0,f=0,d=0,p=c$(),m=!1;const v=()=>{i=!1,s=!1,o=!1,d=0},_=S=>{if(S.touches.length!==1){o=!0;return}v();const C=S.touches[0];a=u=C.clientX,l=C.clientY,f=S.timeStamp,p=c$(),m=t.current,!m&&a<JNe&&(o=!0),!m&&tje(C.target)&&(o=!0)},w=S=>{if(o||S.touches.length!==1)return;const C=S.touches[0],R=C.clientX-a,P=C.clientY-l;if(!s){if(Math.abs(R)<l$&&Math.abs(P)<l$)return;s=!0;const D=Math.abs(R)>Math.abs(P),L=!m&&R>0,A=m&&R<0;if(!D||!L&&!A){o=!0;return}i=!0,e.stop()}if(!i)return;S.preventDefault();const k=S.timeStamp-f;k>0&&(d=(C.clientX-u)/k),u=C.clientX,f=S.timeStamp;const I=m?1+R/p:R/p;e.set(Math.max(0,Math.min(1,I)))},x=()=>{if(!i){v();return}const S=e.get();let C;d>u$?C=!0:d<-u$?C=!1:C=S>.5,n(C),eH(e,C?1:0,eje),v()};return document.addEventListener("touchstart",_,{passive:!0}),document.addEventListener("touchmove",w,{passive:!1}),document.addEventListener("touchend",x,{passive:!0}),document.addEventListener("touchcancel",x,{passive:!0}),()=>{document.removeEventListener("touchstart",_),document.removeEventListener("touchmove",w),document.removeEventListener("touchend",x),document.removeEventListener("touchcancel",x)}},[r,e,t,n])}const rje={type:"spring",stiffness:420,damping:38};function ije(e){return/^\/board\/[^/]+/.test(e)||e==="/knowledge-graph"||e==="/tasks/graph"}function sje({open:e,onOpenChange:t}){const{pathname:n}=Qn(),r=ZB(0),i=b.useRef(e);i.current=e,nje({progress:r,isOpenRef:i,setOpen:t,enabled:!ije(n)}),b.useEffect(()=>{const a=eH(r,e?1:0,rje);return()=>a.stop()},[e,r]),b.useEffect(()=>{t(!1)},[n]);const s=BF(r,[0,1],[0,.5]),o=BF(r,[0,1],["-100%","0%"]);return g.jsxs(g.Fragment,{children:[g.jsx(vb.div,{"aria-hidden":!0,onClick:()=>t(!1),style:{opacity:s},className:_e("fixed inset-0 z-40 bg-black",e?"pointer-events-auto":"pointer-events-none")}),g.jsx(vb.div,{role:"dialog","aria-label":"Navigation",style:{x:o,width:"min(86vw, 22rem)"},className:"fixed inset-y-0 left-0 z-50 flex flex-col overflow-hidden rounded-r-[2.5rem] bg-background pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pt-[env(safe-area-inset-top)]",children:g.jsx(SZ,{})})]})}const nT={};function oje(){const e=new Map;let t=nT;const n=new Set,r=()=>{if(e.size===0){t=nT;return}const s={};for(const o of e.values())o.title!==void 0&&(s.title=o.title),o.right!==void 0&&(s.right=o.right),o.left!==void 0&&(s.left
130=o.left);t=s},i=()=>n.forEach(s=>s());return{get:()=>t,set:(s,o)=>{e.set(s,o),r(),i()},remove:s=>{e.delete(s)&&(r(),i())},subscribe:s=>(n.add(s),()=>n.delete(s))}}const b2=b.createContext(null);function aje({onMenuClick:e,children:t}){const n=b.useRef();n.current||(n.current=oje());const r=b.useMemo(()=>({store:n.current,onMenuClick:e}),[e]);return g.jsx(b2.Provider,{value:r,children:t})}function lje(e){const n=b.useContext(b2)?.store,{title:r,right:i,left:s}=e,o=b.useRef();o.current||(o.current={});const a=o.current;b.useEffect(()=>{if(n)return n.set(a,{title:r,right:i,left:s}),()=>n.remove(a)},[n,a,r,i,s])}const uje=()=>()=>{},cje=()=>nT;function dje(){const e=b.useContext(b2),t=e?.store,n=b.useSyncExternalStore(t?t.subscribe:uje,t?t.get:cje),{title:r,right:i,left:s}=n;return g.jsx("header",{className:"shrink-0 border-b border-border bg-background pt-[env(safe-area-inset-top)]",children:g.jsxs("div",{className:"grid h-12 grid-cols-[1fr_auto_1fr] items-center gap-2 px-2",children:[g.jsx("div",{className:"flex items-center justify-self-start",children:s??g.jsx("button",{type:"button","aria-label":"Open navigation",onClick:e?.onMenuClick,className:"flex size-9 items-center justify-center rounded-full text-foreground transition-colors hover:bg-accent",children:g.jsx($z,{className:"size-5"})})}),g.jsx("div",{className:"min-w-0 max-w-[60vw] justify-self-center truncate text-sm font-medium text-foreground",children:r}),g.jsx("div",{className:"flex items-center justify-self-end",children:i})]})})}function EZ({children:e}){return lI()?g.jsx(pje,{children:e}):g.jsx(fje,{children:e})}function fje({children:e}){return g.jsx("div",{className:"flex h-screen overflow-hidden",children:g.jsx(hje,{children:e})})}function hje({children:e}){const t=b.useRef(null),[n,r]=b.useState(!1),i=XH()?SH:wH,s=()=>{const l=t.current;l&&(n?l.expand():l.collapse())},o=g.jsx(fn,{variant:"outline",className:"w-fit p-0",onClick:s,children:n?g.jsx(Iz,{className:"size-6"}):g.jsx(Rz,{className:"size-4"})}),a={open:{y:0,opacity:1},closed:{y:-20,opacity:0}};return g.jsx(lH,{backend:i,children:g.jsxs(GH,{direction:"horizontal",className:"min-h-[220px] rounded-lg",autoSaveId:"sidebar-panel-layout",children:[g.jsx(wb,{ref:t,collapsible:!0,onCollapse:()=>r(!0),onExpand:()=>r(!1),className:"duration-300 ease-in-out data-[state=open]:translate-x-0",collapsedSize:.5,defaultSize:20,minSize:15,maxSize:30,order:1,children:g.jsx(vb.div,{initial:"closed",animate:n?"closed":"open",variants:a,children:g.jsx(SZ,{})})}),g.jsx(KH,{className:_e("w-px bg-border/60 transition-colors hover:bg-border"),handle:o,withHandle:!0}),g.jsx(wb,{defaultSize:70,minSize:15,maxSize:100,order:2,children:e})]})})}function pje({children:e}){const t=XH()?SH:wH,[n,r]=b.useState(!1),i=b.useCallback(()=>r(!0),[]);return g.jsx(lH,{backend:t,children:g.jsx(aje,{onMenuClick:i,children:g.jsxs("div",{className:"flex h-[100dvh] flex-col overflow-hidden",children:[g.jsx(dje,{}),g.jsx("div",{className:"flex-1 overflow-auto pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]",children:e}),g.jsx(sje,{open:n,onOpenChange:r})]})})})}function _2({children:e}){const{isAuthenticated:t,isLoading:n}=eh(),r=Qn();if(n)return g.jsx("div",{className:"flex min-h-screen items-center justify-center",children:g.jsx("div",{className:"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});if(!t){const i=`${r.pathname}${r.search}${r.hash}`;return g.jsx(wp,{to:`/auth/signin?callbackUrl=${encodeURIComponent(i)}`,replace:!0})}return g.jsx(g.Fragment,{children:e})}function mje(){return g.jsx(_2,{children:g.jsx(NP,{client:wr,children:g.jsx(Lf,{children:g.jsx(YP,{children:g.jsx(EZ,{children:g.jsx(Ko,{})})})})})})}const gje=[{label:"Journal",to:"/study/j",match:["/study/j"]},{label:"Chat",to:"/study/d",match:["/study/d"]},{label:"Library",to:"/study/search",match:["/study/search"]}];function vje(){const{pathname:e}=Qn();return g.jsx("nav",{"aria-label":"Rooms",className:"flex items-center gap-5",children:gje.map(t=>{const n=t.match.some(r=>e===r||e.startsWith(`${r}/`));return g.jsx(fo,{to:t.to,"aria-current":n?"page":void 0,className:_e("text-sm transition-colors",n?"font-medium text-foreground":"text-muted-foreground hover:text-foreground"),children:t.label},t.to)})})}function yje({children:e}){const{user:t}=eh();return g.jsxs("div",{className:"flex h-[100dvh] flex-col pb-[env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)] pt-[env(safe-area-inset-top)]",children:[g.jsxs("header",{className:"flex shrink-0 items-center justify-between px-6 py-4",children:[g.jsxs("div",{className:"flex items-center gap-8",children:[g.jsxs(fo,{to:"/study","aria-label":"Home",className:"flex items-center gap-2 text-foreground",children:[g.jsx(Er.logo,{className:"size-5"}),g.jsx("span",{className:"text-sm font-semibold",children:qo.name})]}),g.jsx(vje,{})]}),g.jsxs("div",{className:"flex items-center gap-1",children:[g.jsx(bje,{}),g.jsx(pI,{}),t&&g.jsx(OI,{user:t})]})]}),g.jsx("main",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto",children:e}),g.jsx("footer",{className:"flex shrink-0 justify-center pb-3",children:g.jsx(fo,{to:"/",className:"text-xs text-muted-foreground transition-colors hover:text-foreground",children:"Classic layout"})})]})}function bje(){const[e,t]=b.useState(!1);return b.useEffect(()=>{const n=r=>
130{r.key==="k"&&(r.metaKey||r.ctrlKey)&&(r.preventDefault(),t(i=>!i))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),g.jsxs(g.Fragment,{children:[g.jsxs("button",{type:"button",onClick:()=>t(!0),className:"mr-1 inline-flex items-center gap-2 rounded-full border border-border px-3 py-1.5 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[g.jsx(Tf,{className:"size-3.5","aria-hidden":"true"}),g.jsx("span",{children:"Search"}),g.jsx("kbd",{className:"pointer-events-none font-mono text-xs text-muted-foreground",children:"⌘K"})]}),g.jsx(nZ,{open:e,onOpenChange:t})]})}const _je=b.lazy(()=>_t(()=>import("./DashboardPage-Cx5ERdUg.js"),__vite__mapDeps([0,1,2,3,4,5])));function wje(){const e=lI(),{pathname:t}=Qn(),n=t==="/study"?g.jsx(b.Suspense,{fallback:null,children:g.jsx(_je,{})}):g.jsx(Ko,{});return g.jsx(_2,{children:g.jsx(NP,{client:wr,children:g.jsx(Lf,{children:e?g.jsx(YP,{children:g.jsx(EZ,{children:n})}):g.jsx(XAe,{shell:"study",children:g.jsx(yje,{children:g.jsx(Ko,{})})})})})})}function xje(){return g.jsx("div",{className:"min-h-screen w-full bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] dark:bg-zinc-900 dark:bg-[radial-gradient(#333333_1px,transparent_1px)]",children:g.jsx(Ko,{})})}function Sje({items:e}){return g.jsx("div",{className:"flex gap-4 xl:gap-6",children:g.jsxs(fo,{to:"/",className:"flex items-center space-x-2",children:[g.jsx(Er.logo,{className:"size-6"}),g.jsx("span",{className:"inline-block text-lg font-semibold md:text-xl",children:qo.name})]})})}function Eje(){return g.jsx("header",{className:"flex-end shrink-1 sticky top-0 z-50 flex h-16 w-full items-center border-b bg-secondary/50 px-0 dark:border-b-0",children:g.jsxs("div",{className:"flex h-16 w-full items-center space-x-4 px-6 sm:justify-between sm:space-x-0",children:[g.jsx(Sje,{items:qo.mainNav}),g.jsx(Cje,{}),g.jsx(kje,{})]})})}const Cje=()=>g.jsx("div",{className:"flex flex-1 items-center justify-end space-x-4",children:g.jsxs("nav",{className:"flex items-center space-x-1",children:[g.jsxs("a",{href:qo.links.feedback,target:"_blank",rel:"noreferrer",className:`hidden sm:flex ${dc({size:"icon",variant:"ghost"})}`,children:[g.jsx(Er.Feedback,{className:"size-5"}),g.jsx("span",{className:"sr-only",children:"Feedback"})]}),g.jsxs("a",{href:qo.links.discord,target:"_blank",rel:"noreferrer",className:`hidden sm:flex ${dc({size:"icon",variant:"ghost"})}`,children:[g.jsx(Er.discord,{className:"size-5"}),g.jsx("span",{className:"sr-only",children:"Discord"})]}),g.jsxs("a",{href:qo.links.twitter,target:"_blank",rel:"noreferrer",className:`hidden sm:flex ${dc({size:"icon",variant:"ghost"})}`,children:[g.jsx(Er.twitter,{className:"size-5"}),g.jsx("span",{className:"sr-only",children:"Twitter"})]}),g.jsx(pI,{})]})});function kje(){const{user:e,isLoading:t}=eh();return t?g.jsxs("div",{className:"flex items-center",children:[g.jsx(Er.seperator,{className:"size-6 text-muted-foreground/50"}),g.jsx("div",{className:"ml-2 size-6 animate-pulse rounded-full bg-muted"})]}):g.jsxs("div",{className:"flex items-center",children:[g.jsx(Er.seperator,{className:"size-6 text-muted-foreground/50"}),e?g.jsx(OI,{user:e}):g.jsx(fn,{variant:"link",asChild:!0,className:"-ml-2",children:g.jsx(fo,{to:"/auth/signin",children:"Login"})})]})}function Tje(){return g.jsx(_2,{children:g.jsx(NP,{client:iU,children:g.jsxs(YP,{children:[g.jsx(Eje,{}),g.jsx(Ko,{})]})})})}const Da={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_URL:"https://api.mentes.ai",VITE_GOOGLE_CLIENT_ID:"265396989594-2naqejd1dvrs5scqpb0lovrv76hokbpc.apps.googleusercontent.com",VITE_POSTHOG_KEY:"phc_lSFMpjp0hun7tYOf877qMzlXQVCS8psflN0O9PJ8ttc",VITE_VERCEL_BRANCH_URL:"mentes-web-git-main-sri-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_6Nku8QhbuksrSKVMMn6rk1NLkw8W",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"ramsrib",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"Sri",VITE_VERCEL_GIT_COMMIT_MESSAGE:`Task Management block: prettier-stable layout (same content)
131
132Regenerated from mentes-ai agents-md/task-management.md (143f8cb) so formatters that rewrite markdown leave it unchanged.`,VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"7228e21f233378493dded6d8c304cf4936d49640",V
132ITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"749277532",VITE_VERCEL_GIT_REPO_OWNER:"ramsrib",VITE_VERCEL_GIT_REPO_SLUG:"mentes-web",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"73c92d25b065f873/script.js","viewEndpoint":"73c92d25b065f873/view","eventEndpoint":"73c92d25b065f873/event","sessionEndpoint":"73c92d25b065f873/session"},"speedInsights":{"scriptSrc":"56005d7377100aec/script.js","endpoint":"56005d7377100aec/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_CZo8r6cAAR4BJMe23gPR6qzVQ6oL",VITE_VERCEL_PROJECT_PRODUCTION_URL:"app.mentes.ai",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"mentes-1i8zm4ap9-sri-projects.vercel.app"};function CZ(e){return"init"in e}function rT(e){return typeof e.write=="function"}function Pje(e){return!!e.onMount}function d$(e){return"v"in e||"e"in e}function Db(e){if("e"in e)throw e.e;if((Da?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v}function Ab(e){return typeof e?.then=="function"}function Rje(e){if(!(e instanceof Error))return!1;const t=e.name,n=e.message.toLowerCase();return(t==="RangeError"||t==="InternalError")&&(n.includes("call stack")||n.includes("too much recursion")||n.includes("stack overflow"))}function kZ(e,t,n){if(!n.p.has(e)){n.p.add(e);const r=()=>n.p.delete(e);t.then(r,r)}}function TZ(e,t,n){const r=n.get(e),i=r?.t,s=t.p;if(!i?.size)return s;if(!s.size)return i;const o=new Set(i);for(const a of s)o.add(a);return o}function Ije(e){return!!e.INTERNAL_onInit}const Oje=(e,t,n,...r)=>n.read(...r),Dje=(e,t,n,...r)=>n.write(...r),Aje=(e,t,n)=>n.INTERNAL_onInit(t),Mje=(e,t,n,r)=>{var i;return(i=n.onMount)==null?void 0:i.call(n,r)},Nje=(e,t,n)=>{var r;const i=e[0];let s=i.get(n);if(!s){const o=e[6],a=e[9];s={d:new Map,p:new Set,n:0},i.set(n,s),(r=o.i)==null||r.call(o,n),Ije(n)&&a(e,t,n)}return s},jje=(e,t)=>{var n;const r=e[1],i=e[3],s=e[4],o=e[5],a=e[6],l=e[13];if(!a.f&&!i.size&&!s.size&&!o.size)return;const u=[],f=d=>{try{d()}catch(p){u.push(p)}};do{a.f&&f(a.f);const d=new Set;for(const p of i){const m=(n=r.get(p))==null?void 0:n.l;if(m)for(const v of m)d.add(v)}i.clear();for(const p of o)d.add(p);o.clear();for(const p of s)d.add(p);s.clear();for(const p of d)f(p);i.size&&l(e,t)}while(i.size||o.size||s.size);if(u.length)throw new AggregateError(u)},Lje=(e,t)=>{const n=e[1],r=e[2],i=e[3],s=e[11],o=e[14],a=e[17];if(!i.size)return;const l=[],u=[],f=new WeakSet,d=new WeakSet,p=[],m=[];for(const v of i)p.push(v),m.push(s(e,t,v));for(;p.length;){const v=p.length-1,_=p[v],w=m[v];if(d.has(_)){p.pop(),m.pop();continue}if(f.has(_)){if(r.get(_)===w.n)l.push(_),u.push(w);else if((Da?"production":void 0)!=="production"&&r.has(_))throw new Error("[Bug] invalidated atom exists");d.add(_),p.pop(),m.pop();continue}f.add(_);for(const x of TZ(_,w,n))f.has(x)||(p.push(x),m.push(s(e,t,x)))}for(let v=l.length-1;v>=0;--v){const _=l[v],w=u[v];let x=!1;for(const S of w.d.keys())if(S!==_&&i.has(S)){x=!0;break}x&&(r.set(_,w.n),o(e,t,_),a(e,t,_)),r.delete(_)}},iT=new WeakSet,Fje=(e,t,n)=>{var r,i;const s=e[1],o=e[2],a=e[3],l=e[6],u=e[7],f=e[11],d=e[12],p=e[13],m=e[14],v=e[16],_=e[17],w=e[20],x=e[26],S=e[28],C=f(e,t,n),R=S[0];if(d$(C)){if(s.has(n)&&o.get(n)!==C.n||C.m===R)return C.m=R,C;let H=!1;for(const[te,G]of C.d)if(m(e,t,te).n!==G){H=!0;break}if(!H)return C.m=R,C}let P=!0;const k=new Set(C.d.keys()),I=()=>{for(const H of k)C.d.delete(H)},D=()=>{if(s.has(n)){const H=!a.size;_(e,t,n),H&&(p(e,t),d(e,t))}},L=H=>{var te;if(H===n){const Z=f(e,t,H);if(!d$(Z))if(CZ(H))w(e,t,H,H.init);else throw new Error("no atom init");return Db(Z)}const G=m(e,t,H);try{return Db(G)}finally{k.delete(H),C.d.set(H,G.n),Ab(C.v)&&kZ(n,C.v,G),s.has(n)&&((te=s.get(H))==null||te.t.add(n)),P||D()}};let A,$;const j={get signal(){return A||(A=new AbortController),A.signal},get setSelf(){return(Da?"production":void 0)!=="production"&&console.warn("[DEPRECATED] setSelf is deprecated and will be removed in v3."),(Da?"production":void 0)!=="production"&&!rT(n)&&console.warn("setSelf function cannot be used with read-only atom"),
132!$&&rT(n)&&($=(...H)=>{if((Da?"production":void 0)!=="production"&&P&&console.warn("setSelf function cannot be called in sync"),!P)try{return v(e,t,n,H)}finally{p(e,t),d(e,t)}}),$}},V=C.n,B=o.get(n)===V;try{(Da?"production":void 0)!=="production"&&iT.delete(t);const H=u(e,t,n,L,j);if((Da?"production":void 0)!=="production"&&iT.has(t)&&console.warn("Detected store mutation during atom read. This is not supported."),w(e,t,n,H),Ab(H)){x(e,t,H,()=>A?.abort());const te=()=>{I(),D()};H.then(te,te)}else I();return(r=l.r)==null||r.call(l,n),C.m=R,C}catch(H){if(Rje(H))throw H;return delete C.v,C.e=H,++C.n,C.m=R,C}finally{P=!1,C.n!==V&&B&&(o.set(n,C.n),a.add(n),(i=l.c)==null||i.call(l,n))}},$je=(e,t,n)=>{const r=e[1],i=e[2],s=e[11],o=[n];for(;o.length;){const a=o.pop(),l=s(e,t,a);for(const u of TZ(a,l,r)){const f=s(e,t,u);i.get(u)!==f.n&&(i.set(u,f.n),o.push(u))}}},zje=(e,t,n,r)=>{const i=e[3],s=e[6],o=e[8],a=e[11],l=e[12],u=e[13],f=e[14],d=e[15],p=e[16],m=e[17],v=e[20],_=e[28];let w=!0;const x=C=>Db(f(e,t,C)),S=(C,...R)=>{var P;const k=a(e,t,C);try{if(C===n){if(!CZ(C))throw new Error("atom not writable");(Da?"production":void 0)!=="production"&&iT.add(t);const I=k.n,D=R[0];v(e,t,C,D),m(e,t,C),I!==k.n&&(++_[0],i.add(C),d(e,t,C),(P=s.c)==null||P.call(s,C));return}else return p(e,t,C,R)}finally{w||(u(e,t),l(e,t))}};try{return o(e,t,n,x,S,...r)}finally{w=!1}},Vje=(e,t,n)=>{var r;const i=e[1],s=e[3],o=e[6],a=e[11],l=e[15],u=e[18],f=e[19],d=a(e,t,n),p=i.get(n);if(p&&d.d.size>0){for(const[m,v]of d.d)if(!p.d.has(m)){const _=a(e,t,m);u(e,t,m).t.add(n),p.d.add(m),v!==_.n&&(s.add(m),l(e,t,m),(r=o.c)==null||r.call(o,m))}for(const m of p.d)if(!d.d.has(m)){p.d.delete(m);const v=f(e,t,m);v?.t.delete(n)}}},Uje=(e,t,n)=>{var r;const i=e[1],s=e[4],o=e[6],a=e[10],l=e[11],u=e[12],f=e[13],d=e[14],p=e[16],m=e[18],v=l(e,t,n);let _=i.get(n);if(!_){d(e,t,n);for(const w of v.d.keys())m(e,t,w).t.add(n);if(_={l:new Set,d:new Set(v.d.keys()),t:new Set},i.set(n,_),rT(n)&&Pje(n)){const w=()=>{let x=!0;const S=(...C)=>{try{return p(e,t,n,C)}finally{x||(f(e,t),u(e,t))}};try{const C=a(e,t,n,S);C&&(_.u=()=>{x=!0;try{C()}finally{x=!1}})}finally{x=!1}};s.add(w)}(r=o.m)==null||r.call(o,n)}return _},Bje=(e,t,n)=>{var r,i;const s=e[1],o=e[5],a=e[6],l=e[11],u=e[19],f=l(e,t,n);let d=s.get(n);if(!d||d.l.size)return d;let p=!1;for(const m of d.t)if((r=s.get(m))!=null&&r.d.has(n)){p=!0;break}if(!p){d.u&&o.add(d.u),d=void 0,s.delete(n);for(const m of f.d.keys()){const v=u(e,t,m);v?.t.delete(n)}(i=a.u)==null||i.call(a,n);return}return d},Hje=(e,t,n,r)=>{const i=e[11],s=e[27],o=i(e,t,n),a="v"in o,l=o.v;if(Ab(r))for(const u of o.d.keys())kZ(n,r,i(e,t,u));o.v=r,delete o.e,(!a||!Object.is(l,o.v))&&(++o.n,Ab(l)&&s(e,t,l))},qje=(e,t,n)=>{const r=e[14];return Db(r(e,t,n))},Wje=(e,t,n,...r)=>{const i=e[3],s=e[12],o=e[13],a=e[16],l=i.size;try{return a(e,t,n,r)}finally{i.size!==l&&(o(e,t),s(e,t))}},Gje=(e,t,n,r)=>{const i=e[12],s=e[13],o=e[18],a=e[19],u=o(e,t,n).l;return u.add(r),s(e,t),i(e,t),()=>{u.delete(r),a(e,t,n),s(e,t),i(e,t)}},Kje=(e,t,n,r)=>{const i=e[25];let s=i.get(n);if(!s){s=new Set,i.set(n,s);const o=()=>i.delete(n);n.then(o,o)}s.add(r)},Zje=(e,t,n)=>{const i=e[25].get(n);i?.forEach(s=>s())},PZ=new WeakMap;function Yje(e){const t=PZ.get(e);if((Da?"production":void 0)!=="production"&&!t)throw new Error("Store must be created by buildStore to read its building blocks");const n=t[24];return n?n(t,e):t}function Qje(...e){const t={get(o){return r(n,t,o)},set(o,...a){return i(n,t,o,...a)},sub(o,a){return s(n,t,o,a)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Oje,Dje,Aje,Mje,Nje,jje,Lje,Fje,$je,zje,Vje,Uje,Bje,Hje,qje,Wje,Gje,void 0,new WeakMap,Kje,Zje,[0]].map((o,a)=>e[a]||o);PZ.set(t,Object.freeze(n));const r=n[21],i=n[22],s=n[23];return t}const RZ={};let Xje=0;function vw(e,t){const n=`atom${++Xje}`,r={toString(){return(RZ?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=Jje,r.write=eLe),r}function Jje(e){return e(this)}function eLe(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}function tLe(){return Qje()}let up;function nLe(){return up||(up=tLe(),(RZ?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=up),globalThis.__JOTAI_DEFAULT_STORE__!==up&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),up}const rLe={},iLe=b.createContext(void 0);function IZ(e){return b.useContext(iLe)||nLe()}const sT=e=>typeof e?.then=="function",oT=e=>{e.status||(e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}))},sLe=ve.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(oT(e),e)}),KS=new WeakMap,f$=(e,t,n)=>{const r=Yje(e),i=r[26];let s=KS.get(t);return s||(s=new Promise((o,a)=>{let l=t;const u=p=>m=>{l===p&&o(m)},f=p=>m=>{l===p&&a(m)},d=()=>{try{const p=n();sT(p)?(KS.set(p,s),l=p,p.then(u(p),f(p)),i(r,e,p,d)):o(p)}catch(p){a(p)}};t.then(u(t),f(t)),i(r,e,t,d)}),KS.set(t,s)),s};function OZ(e,t){const{delay:n,unstable_promiseStatus:r=!ve.use}={},i=IZ(),[[s,o,a],l]=b.useReducer(f=>{const d=i.get(e);return Object.is(f[0],d)&&f[1]===i&&f[2]===e?f:[d,i,e]},void 0,()=>[i.get(e),i,e]);let u=s;if((o!==i||a!==e)&&(l(),u=i.get(e)),b.useEffect(()=>{const f=i.sub(e,()=>{if(r)try{const d=i.get(e);sT(d)&&oT(f$(i,d,()=>i.get(e)))}catch{}if(typeof n=="number"){console.warn(`[DEPRECATED] delay option is deprecated and will be removed in v3.
133
134Migration guide:
135
136Create a custom hook like the following.
137
138function useAtomValueWithDelay<Value>(
139  atom: Atom<Value>,
140  options: { delay: number },
141): Value {
142  const { delay } = options
143  const store = useStore(options)
144  const [value, setValue] = useState(() => store.get(atom))
145  useEffect(() => {
146    const unsub = store.sub(atom, () => {
147      setTimeout(() => setValue(store.get(atom)), delay)
148    })
149    return unsub
150  }, [store, atom, delay])
151  return value
152}
153`),setTimeout(l,n);return}l()});return l(),f},[i,e,n,r]),b.useDebugValue(u),sT(u)){const f=f$(i,u,()=>i.get(e));return r&&oT(f),sLe(f)}
153return u}function DZ(e,t){const n=IZ();return b.useCallback((...i)=>{if((rLe?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function h$(e,t){return[OZ(e),DZ(e)]}function S0({label:e,keys:t,side:n="top",children:r}){return g.jsx(Lf,{delayDuration:300,children:g.jsxs(ab,{children:[g.jsx(lb,{asChild:!0,children:r}),g.jsxs(Dm,{side:n,className:"flex items-center gap-2",children:[g.jsx("span",{children:e}),t&&t.length>0&&g.jsx("span",{className:"flex items-center gap-0.5",children:t.map(i=>g.jsx("kbd",{className:"inline-flex h-4 min-w-4 items-center justify-center rounded border border-primary-foreground/30 px-1 font-mono text-[10px] text-primary-foreground/90",children:i},i))})]})]})})}const aT=e=>e.updated_at||e.created_at,p$=(e,t)=>(Xo(aT(t))?.getTime()??0)-(Xo(aT(e))?.getTime()??0),oLe=[{key:"today",label:"Today"},{key:"yesterday",label:"Yesterday"},{key:"week",label:"This week"},{key:"month",label:"This month"},{key:"older",label:"Older"}];function aLe(e){const t=Xo(aT(e));return t?qc(t)?"today":hw(t)?"yesterday":zK(t)?"week":$K(t)?"month":"older":"older"}function AZ(e){return e.source==="agent"}function lLe(e,t){return t==="all"||AZ(e)}function uLe(e){const t=[],n={today:[],yesterday:[],week:[],month:[],older:[]},r=new Set;for(const s of e)!s.id||r.has(s.id)||(r.add(s.id),s.is_starred?t.push(s):n[aLe(s)].push(s));const i=[];t.length&&i.push({key:"starred",label:"Starred",chats:t.sort(p$)});for(const{key:s,label:o}of oLe){const a=n[s];a.length&&i.push({key:s,label:o,chats:a.sort(p$)})}return i}function MZ(e,t,n){var r=this,i=b.useRef(null),s=b.useRef(0),o=b.useRef(null),a=b.useRef([]),l=b.useRef(),u=b.useRef(),f=b.useRef(e),d=b.useRef(!0);f.current=e;var p=typeof window<"u",m=!t&&t!==0&&p;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(n=n||{}).leading,_=!("trailing"in n)||!!n.trailing,w="maxWait"in n,x="debounceOnServer"in n&&!!n.debounceOnServer,S=w?Math.max(+n.maxWait||0,t):null;b.useEffect(function(){return d.current=!0,function(){d.current=!1}},[]);var C=b.useMemo(function(){var R=function(A){var $=a.current,j=l.current;return a.current=l.current=null,s.current=A,u.current=f.current.apply(j,$)},P=function(A,$){m&&cancelAnimationFrame(o.current),o.current=m?requestAnimationFrame(A):setTimeout(A,$)},k=function(A){if(!d.current)return!1;var $=A-i.current;return!i.current||$>=t||$<0||w&&A-s.current>=S},I=function(A){return o.current=null,_&&a.current?R(A):(a.current=l.current=null,u.current)},D=function A(){var $=Date.now();if(k($))return I($);if(d.current){var j=t-($-i.current),V=w?Math.min(j,S-($-s.current)):j;P(A,V)}},L=function(){if(p||x){var A=Date.now(),$=k(A);if(a.current=[].slice.call(arguments),l.current=r,i.current=A,$){if(!o.current&&d.current)return s.current=i.current,P(D,t),v?R(i.current):u.current;if(w)return P(D,t),R(i.current)}return o.current||P(D,t),u.current}};return L.cancel=function(){o.current&&(m?cancelAnimationFrame(o.current):clearTimeout(o.current)),s.current=0,a.current=i.current=l.current=o.current=null},L.isPending=function(){return!!o.current},L.flush=function(){return o.current?I(Date.now()):u.current},L},[v,w,t,S,_,m,p,x]);return C}function Mb(e,t,n){e.setQueryData(["infinite-chats"],r=>r&&{...r,pages:r.pages.map(i=>i.map(s=>s.id===t?{...s,...n}:s))}),e.setQueryData(["chat",t],r=>r&&{...r,...n})}function NZ(e,t){e.setQueryData(["infinite-chats"],n=>n&&{...n,pages:n.pages.map(r=>r.filter(i=>i.id!==t))})}const cLe=()=>{const{data:e,isLoading:t,error:n,fetchNextPage:r,hasNextPage:i,isFetching:s,isFetchingNextPage:o,refetch:a}=O8({queryKey:["infinite-chats"],queryFn:async({pageParam:l})=>await GP(20,l),initialPageParam:1,getNextPageParam:(l,u,f)=>{const d=l.serverCount;if(!(d!==void 0&&d<20))return f+1},getPreviousPageParam:(l,u,f)=>{if(!(f<=1))return f-1}});return{chats:e,error:n,isLoading:t,fetchNextPage:r,hasNextPage:i,isFetching:s,isFetchingNextPage:o,refetch:a}},dLe=e=>{const{data:t,isLoading:n,error:r}=hr({queryKey:["chat",e?.toString()],queryFn:()=>nb(e),enabled:!!e});return{chat:t,isLoading:n,error:r}},fLe=e=>{const{data:t,isLoading:n,error:r}=hr({queryKey:["chats",e],queryFn:()=>KV(e)});return{chats:t,isLoading:n,error:r}}
153,hLe=(e="",t=500)=>{const[n,r]=b.useState(e),{chats:i}=fLe(n),s=MZ(a=>{r(a)},t),o=b.useCallback(()=>{r("")},[]);return{searchResults:i,debouncedSearch:s,clearSearch:o}},jZ=()=>{const e=Dr();return os({mutationFn:t=>bge(t.id,t),onMutate:t=>{if(!t.id||t.title===void 0)return;const n=t.id,r=e.getQueryData(["chat",n])?.title??e.getQueryData(["infinite-chats"])?.pages.flat().find(i=>i.id===n)?.title;return Mb(e,n,{title:t.title}),{previous:r}},onError:(t,n,r)=>{n.id&&r?.previous!==void 0&&Mb(e,n.id,{title:r.previous}),e.invalidateQueries({queryKey:["infinite-chats"]})},onSuccess:()=>{e.invalidateQueries({queryKey:["chat"]}),e.invalidateQueries({queryKey:["infinite-chats"]})}})},LZ=()=>{const e=Dr();return os({mutationFn:_ge,onSuccess:(t,n)=>{tU(n),rU(n),e.removeQueries({queryKey:["chat",n],exact:!0}),NZ(e,n),e.invalidateQueries({queryKey:["chats"]}),e.invalidateQueries({queryKey:["infinite-chats"]})}})},FZ=()=>{const e=Dr();return os({mutationFn:Ege,onSuccess:(t,n)=>{NZ(e,n),e.invalidateQueries({queryKey:["infinite-chats"]})}})},$Z=()=>{const e=Dr();return os({mutationFn:({id:t,starred:n})=>n?xge(t):Sge(t),onMutate:({id:t,starred:n})=>{Mb(e,t,{is_starred:n})},onError:(t,{id:n,starred:r})=>{Mb(e,n,{is_starred:!r})},onSettled:()=>{e.invalidateQueries({queryKey:["infinite-chats"]})}})};function m$(e){switch(e){case"active":return"text-foreground font-medium";case"success":return"text-foreground";case"warning":return"text-foreground font-medium";case"idle":return"text-muted-foreground";case"offline":return"text-muted-foreground/60";case"error":return"text-destructive font-medium";case"neutral":default:return"text-muted-foreground"}}function Pqe(e){switch(e){case"active":case"success":case"warning":return"text-foreground";case"idle":return"text-muted-foreground";case"offline":return"text-muted-foreground/40";case"error":return"text-destructive";case"neutral":default:return"text-muted-foreground/60"}}
153function Rqe(e){switch(e){case"active":return"bg-foreground/10 text-foreground font-medium";case"success":case"warning":return"bg-muted text-foreground";case"idle":return"bg-muted text-muted-foreground";case"offline":return"bg-muted/60 text-muted-foreground/70";case"error":return"bg-destructive/10 text-destructive font-medium";case"neutral":default:return"bg-muted text-muted-foreground"}}function pLe(e){const t=Xo(e);return t?qc(t)?Jl(t,"h:mm a"):Jl(t,"MMM d"):""}const mLe=b.memo(function({chat:t,isSelected:n,isMobile:r,onSelect:i,onToggleStar:s,onRename:o,onArchive:a,onDelete:l}){const u=t.title||"New chat",f=pLe(t.updated_at||t.created_at),d=AZ(t);b.useSyncExternalStore(Wge,Gge);const p=!!t.id&&Kge(t.id),m=!!t.id&&!n&&Zge(t.id),[v,_]=b.useState(!1),[w,x]=b.useState(!1),[S,C]=b.useState(u),R=b.useRef(null);b.useEffect(()=>{w&&(C(u),requestAnimationFrame(()=>{R.current?.focus(),R.current?.select()}))},[w,u]);const P=()=>{x(!1);const k=S.trim();k&&k!==u&&o(k)};return g.jsxs("div",{role:"option",id:`chat-row-${t.id}`,"aria-selected":n,tabIndex:-1,onClick:()=>{w||i()},onKeyDown:k=>{k.target===k.currentTarget&&(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),i())},className:_e("relative flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-md px-2 text-left text-sm outline-none transition-colors",!r&&"group",n?"bg-accent":"hover:bg-accent/50","focus-visible:ring-1 focus-visible:ring-ring"),children:[g.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:d?g.jsx(tg,{className:"size-3.5 text-muted-foreground","aria-label":"Agent"}):g.jsx("span",{className:"size-1.5 rounded-full bg-muted-foreground/30"})}),w?g.jsx("input",{ref:R,value:S,onChange:k=>C(k.target.value),onClick:k=>k.stopPropagation(),onBlur:P,onKeyDown:k=>{k.stopPropagation(),k.key==="Enter"?P():k.key==="Escape"&&x(!1)},"aria-label":"Chat title",className:"h-6 min-w-0 flex-1 rounded border border-border bg-background px-1.5 text-sm outline-none focus-visible:ring-1 focus-visible:ring-ring"}):g.jsx("span",{className:_e("min-w-0 flex-1 truncate text-foreground/90",m&&m$("active")),children:u}),p&&g.jsx(QE,{"aria-label":"Working",className:_e("size-3 shrink-0 animate-spin",m$("idle"))}),g.jsxs("span",{className:_e("flex shrink-0 items-center gap-1.5 text-[11px] tabular-nums text-muted-foreground/60",!r&&!v&&"group-hover:opacity-0"),children:[t.is_starred&&g.jsx(i0,{className:"size-3 fill-muted-foreground/60 text-muted-foreground/60","aria-label":"Starred"}),g.jsx("span",{children:f})]}),!r&&g.jsxs("div",{className:_e("absolute right-1.5 flex items-center gap-0.5 transition-opacity",v?"opacity-100":"opacity-0 group-hover:opacity-100"),children:[g.jsx("button",{type:"button",onClick:k=>{k.stopPropagation(),s()},className:"rounded p-1 text-muted-foreground/70 hover:bg-background hover:text-foreground","aria-label":t.is_starred?"Unstar chat":"Star chat",title:t.is_starred?"Unstar":"Star",children:g.jsx(i0,{className:_e("size-3",t.is_starred&&"fill-foreground text-foreground")})}),g.jsxs(RI,{open:v,onOpenChange:_,children:[g.jsx(II,{asChild:!0,children:g.jsx("button",{type:"button",onClick:k=>k.stopPropagation(),className:"rounded p-1 text-muted-foreground/70 hover:bg-background hover:text-foreground","aria-label":"Chat options",children:g.jsx(Az,{className:"size-3.5"})})}),g.jsxs(Y_,{align:"end",onClick:k=>k.stopPropagation(),className:"w-40",children:[g.jsxs(Qr,{onSelect:()=>x(!0),children:[g.jsx(Uz,{className:"mr-2 size-3.5"}),"Rename"]}),g.jsxs(Qr,{onSelect:s,children:[g.jsx(i0,{className:"mr-2 size-3.5"}),t.is_starred?"Unstar":"Star"]}),g.jsxs(Qr,{onSelect:a,children:[g.jsx(Ez,{className:"mr-2 size-3.5"}),"Archive"]}),g.jsx(Ef,{}),g.jsxs(Qr,{onSelect:l,children:[g.jsx(t_,{className:"mr-2 size-3.5"}),"Delete"]})]})]})]})]})});function gLe({isSelected:e}){return g.jsxs("div",{role:"option","aria-selected":e,className:_e("flex h-9 items-center gap-2.5 rounded-md px-2 text-sm text-muted-foreground",e&&"bg-accent text-foreground/90"),children:[g.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:g.jsx(R0,{className:"size-3.5"})}),g.jsx("span",{className:"truncate",children:"Temporary chat"})]})}const vLe=vw("all"),yLe=vw({}),zZ=vw([]),Iqe=vw({}),bLe=[{key:"all",label:"All"},{key:"agents",label:"Agents"}];function _Le({view:e,onViewChange:t}){return g.jsx("div",{role:"tablist",className:"flex items-center gap-1.5",children:bLe.map(n=>{const r=e===n.key;return g.jsx("button",{type:"button",role:"tab","aria-selected":r,onClick:()=>t(n.key),className:_e("flex h-7 items-center rounded-full border px-3 text-xs leading-none transition-colors duration-150",r?"border-transparent bg-muted font-medium text-foreground":"border-border text-muted-foreground hover:text-foreground"),children:n.label},n.key)})})}const wLe=240;function xLe({selectedChatId:e,temporaryOpen:t=!1,onChatSelect:n,onCompose:r,onComposeTemporary:i}){const s=ah(),o=Dr(),[a,l]=h$(vLe),[u,f]=h$(yLe),d=DZ(zZ),[p,m]=b.useState(!1),[v,_]=b.useState(""),[w,x]=b.useState(null),S=b.useRef(null),C=b.useRef(null),{chats:R,isLoading:P,fetchNextPage:k,hasNextPage:I,isFetching:D,isFetchingNextPage:L,refetch:A}=cLe(),{searchResults:$,debouncedSearch:j,clearSearch:V}=hLe(),B=$Z(),H=jZ(),te=FZ(),G=LZ(),Z=b.useMemo(()=>R?.pages.flatMap(fe=>fe)??[],[R]),Y=v.trim().length>0,M=b.useMemo(()=>(Y?$??[]:Z).filter(ke=>lLe(ke,a)),[Y,$,Z,a]),q=b.useMemo(()=>uLe(M),[M]),z=b.useCallback(fe=>u[fe]??!1,[u]),N=b.useMemo(()=>q.filter(fe=>!z(fe.key)).flatMap(fe=>fe.chats),[q,z]);b.useEffect(()=>{d(N.map(fe=>fe.id))}
153,[N,d]);const ee=b.useRef(null);b.useEffect(()=>{if(!e){ee.current=null;return}if(ee.current===e)return;const fe=q.find(ke=>ke.chats.some(Ce=>Ce.id===e));fe&&(ee.current=e,z(fe.key)&&f(ke=>({...ke,[fe.key]:!1})))},[e,q,z,f]),b.useEffect(()=>{e&&document.getElementById(`chat-row-${e}`)?.scrollIntoView({block:"nearest"})},[e]);const X=b.useCallback(()=>{if(Y||!I||L)return;const fe=S.current;fe&&fe.scrollHeight-fe.scrollTop-fe.clientHeight<wLe&&k()},[Y,I,L,k]);b.useEffect(()=>{X()},[X,Z.length]);const ne=fe=>{_(fe),j(fe)},ae=()=>{m(!1),_(""),V()};b.useEffect(()=>{p&&C.current?.focus()},[p]);const se=fe=>{if(fe.target!==fe.currentTarget&&fe.target.closest("input")||N.length===0)return;const ke=N.findIndex(Ce=>Ce.id===e);fe.key==="ArrowDown"||fe.key==="j"?(fe.preventDefault(),n(N[Math.min(ke+1,N.length-1)].id,{viaKeyboard:!0})):fe.key==="ArrowUp"||fe.key==="k"?(fe.preventDefault(),n(N[Math.max(ke-1,0)].id,{viaKeyboard:!0})):fe.key==="Escape"&&n(null)},ce=Y?"No chats match your search":a==="agents"?"No agent chats yet":"No chats yet";return g.jsxs("div",{className:"relative flex h-full flex-col",children:[g.jsxs("div",{className:"flex items-center justify-between gap-6 px-4 pb-2 pt-3",children:[g.jsx(_Le,{view:a,onViewChange:l}),g.jsxs("div",{className:"flex items-center gap-0.5",children:[g.jsx(S0,{label:"Refresh",children:g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Refresh chats",onClick:()=>{A(),o.invalidateQueries({queryKey:["chats"]})},disabled:D,className:"size-7 text-muted-foreground hover:text-foreground disabled:opacity-100",children:g.jsx(Hz,{className:_e("size-3.5",D&&"animate-spin")})})}),g.jsx(S0,{label:"New temporary chat",keys:["⇧","N"],children:g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"New temporary chat",onClick:i,className:"size-7 text-muted-foreground hover:text-foreground",children:g.jsx(R0,{className:"size-4"})})}),g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Search chats",onClick:()=>p?ae():m(!0),className:_e("size-7 text-muted-foreground hover:text-foreground",p&&"text-foreground"),children:g.jsx(Tf,{className:"size-4"})})]})]}),p&&g.jsxs("div",{className:"relative px-4 pb-2",children:[g.jsx(Tf,{className:"pointer-events-none absolute left-6 top-2 size-3.5 text-muted-foreground"}),g.jsx(Dg,{ref:C,value:v,onChange:fe=>ne(fe.target.value),onKeyDown:fe=>{fe.key==="Escape"&&(fe.stopPropagation(),ae())},placeholder:"Search chats","aria-label":"Search chats",className:"h-8 rounded-md pl-8 pr-8 text-sm"}),v&&g.jsx("button",{type:"button",onClick:()=>ne(""),"aria-label":"Clear search",className:"absolute right-6 top-2 text-muted-foreground hover:text-foreground",children:g.jsx(Jo,{className:"size-3.5"})})]}),g.jsx("div",{ref:S,onScroll:X,className:"flex-1 overflow-y-auto [scrollbar-width:thin]",children:g.jsxs("div",{className:"flex flex-col px-3 pb-20",onKeyDown:se,tabIndex:0,role:"listbox","aria-label":"Chats","aria-activedescendant":e?`chat-row-${e}`:void 0,children:[t&&g.jsx("div",{className:"pt-2",children:g.jsx(gLe,{isSelected:!0})}),P?g.jsx("div",{className:"flex items-center justify-center py-12",children:g.jsx(QE,{className:"size-4 animate-spin text-muted-foreground/50"})}):M.length===0?g.jsxs("div",{className:"flex flex-col items-center gap-3 py-16 text-center",children:[g.jsx("p",{className:"text-xs text-muted-foreground",children:ce}),!Y&&a==="all"&&g.jsxs("button",{onClick:r,className:"text-xs text-muted-foreground transition-colors hover:text-foreground",children:["Press"," ",g.jsx("kbd",{className:"rounded border border-border px-1.5 py-0.5 font-mono text-xs",children:"N"})," ","to start one"]})]}):q.map(fe=>{const ke=z(fe.key);return g.jsxs("div",{className:"flex flex-col gap-px",children:[g.jsxs("button",{type:"button","aria-expanded":!ke,onClick:()=>f(Ce=>({...Ce,[fe.key]:!ke})),className:"sticky top-0 z-10 mt-2 flex h-8 w-full items-center gap-2 rounded-md bg-muted px-2 text-xs text-foreground",children:[g.jsx(Jb,{className:_e("size-3 text-muted-foreground transition-transform duration-150",!ke&&"rotate-90")}),g.jsx("span",{className:"font-medium",children:fe.label}),g.jsx("span",{className:"ml-auto text-[11px] tabular-nums text-muted-foreground
153/70",children:fe.chats.length})]}),!ke&&g.jsx("div",{className:"flex flex-col gap-px pt-1",children:fe.chats.map(Ce=>g.jsx(mLe,{chat:Ce,isSelected:e===Ce.id,isMobile:s,onSelect:()=>n(Ce.id),onToggleStar:()=>B.mutate({id:Ce.id,starred:!Ce.is_starred}),onRename:Se=>H.mutate({id:Ce.id,title:Se}),onArchive:()=>{te.mutate(Ce.id),e===Ce.id&&n(null)},onDelete:()=>x(Ce)},Ce.id))})]},fe.key)}),L&&g.jsx("div",{className:"flex items-center justify-center py-4",children:g.jsx(QE,{className:"size-3.5 animate-spin text-muted-foreground/50"})})]})}),!s&&g.jsx(S0,{label:"New chat",keys:["N"],side:"left",children:g.jsx(fn,{size:"icon",onClick:r,"aria-label":"New chat",className:"absolute bottom-5 right-5 z-20 size-10 rounded-full shadow-sm",children:g.jsx(Xf,{className:"size-5"})})}),g.jsx(JI,{open:!!w,onOpenChange:fe=>!fe&&x(null),children:g.jsxs(sw,{children:[g.jsxs(ow,{children:[g.jsx(lw,{children:"Delete chat"}),g.jsxs(uw,{children:["“",w?.title||"New chat","” will be deleted. This cannot be undone."]})]}),g.jsxs(aw,{children:[g.jsx(dw,{children:"Cancel"}),g.jsx(cw,{onClick:()=>{const fe=w;x(null),fe?.id&&(G.mutate(fe.id),e===fe.id&&n(null))},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function SLe(){return!!document.querySelector('[data-radix-popper-content-wrapper],[role="dialog"][data-state="open"],[role="alertdialog"][data-state="open"],[role="menu"]')}function ELe(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLElement&&e.isContentEditable}function CLe({chatId:e,temporary:t=!1,children:n,mode:r,position:i,onPrev:s,onNext:o,onClose:a,onOpenFull:l,onShowList:u,onMakeTemporary:f,onReload:d}){const p=b.useRef(null),{chat:m}=dLe(e||""),v=$Z(),_=jZ(),w=FZ(),x=LZ(),[S,C]=b.useState(!1),[R,P]=b.useState(""),[k,I]=b.useState(!1),D=b.useRef(null);b.useEffect(()=>{C(!1),I(!1)},[e]);const L=e?m?.title?.trim()||"Untitled chat":t?"Temporary chat":"New chat";b.useEffect(()=>{S&&(P(m?.title??""),requestAnimationFrame(()=>{D.current?.focus(),D.current?.select()}))},[S,m?.title]);const A=()=>{C(!1);const j=R.trim();e&&j&&j!==m?.title&&_.mutate({id:e,title:j})},$=j=>{if(j.key==="Escape"&&!SLe()){if(ELe(j.target)){j.preventDefault(),j.stopPropagation(),j.target.blur(),p.current?.focus();return}j.preventDefault(),j.stopPropagation(),r==="full"?u():a()}};return g.jsxs("div",{ref:p,tabIndex:-1,onKeyDown:$,className:"flex h-full flex-col outline-none",children:[g.jsxs("div",{className:"flex h-11 shrink-0 items-center gap-2 border-b border-border px-3",children:[g.jsx(fn,{variant:"ghost",size:"icon","aria-label":r==="full"?"Show list":"Hide list",title:r==="full"?"Show list":"Hide list",onClick:r==="full"?u:l,className:"size-7 shrink-0 text-muted-foreground hover:text-foreground",children:r==="full"?g.jsx(zz,{className:"size-3.5"}):g.jsx(Fz,{className:"size-3.5"})}),S?g.jsx("input",{ref:D,value:R,onChange:j=>P(j.target.value),onBlur:A,onKeyDown:j=>{j.stopPropagation(),j.key==="Enter"?A():j.key==="Escape"&&C(!1)},"aria-label":"Chat title",className:"h-7 min-w-0 flex-1 rounded border border-border bg-background px-2 text-sm font-medium outline-none focus-visible:ring-1 focus-visible:ring-ring"}):g.jsxs("span",{className:_e("min-w-0 flex-1 truncate text-sm font-medium",!e&&"text-muted-foreground"),title:L,onDoubleClick:()=>e&&C(!0),children:[t&&!e&&g.jsx(R0,{className:"mr-1.5 inline size-3.5 align-[-2px]"}),L]}),g.jsxs("div",{className:"flex shrink-0 items-center gap-1 text-xs tabular-nums text-muted-foreground",children:[i&&g.jsxs(g.Fragment,{children:[g.jsxs("span",{className:"mr-1",children:[i.index+1," / ",i.total]}),g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Previous chat",disabled:!s,onClick:()=>s?.(),className:"size-7 text-muted-foreground hover:text-foreground",children:g.jsx(Pz,{className:"size-4"})}),g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Next chat",disabled:!o,onClick:()=>o?.(),className:"size-7 text-muted-foreground hover:text-foreground",children:g.jsx(kz,{className:"size-4"})})]}),!e&&!t&&f&&g.jsx(S0,{label:"New temporary chat",keys:["⇧","N"],children:g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Make this a temporary chat",onClick:f,className:"size-7 text-muted-foreground hover:text-foreground",children:g.jsx(R0,{className:"size-4"})})}),e&&g.jsxs(RI,{modal:!1,children:[g.jsx(II,{asChild:!0,children:g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Chat options",className:"size-7 text-muted-foreground hover:text-foreground",children:g.jsx(Az,{className:"size-4"})})}),g.jsxs(Y_,{align:"end",className:"w-40",children:[d&&g.jsxs(Qr,{onSelect:d,children:[g.jsx(Hz,{className:"mr-2 size-3.5"}),"Refresh"]}),g.jsxs(Qr,{onSelect:()=>C(!0),children:[g.jsx(Uz,{className:"mr-2 size-3.5"}),"Rename"]}),g.jsxs(Qr,{onSelect:()=>v.mutate({id:e,starred:!m?.is_starred}),children:[g.jsx(i0,{className:"mr-2 size-3.5"}),m?.is_starred?"Unstar":"Star"]}),g.jsxs(Qr,{onSelect:()=>{w.mutate(e),a()},children:[g.jsx(Ez,{className:"mr-2 size-3.5"}),"Archive"]}),g.jsx(Ef,{}),g.jsxs(Qr,{onSelect:()=>I(!0),children:[g.jsx(t_,{className:"mr-2 size-3.5"}),"Delete"]})]})]}),g.jsx(fn,{variant:"ghost",size:"icon","aria-label":"Close",title:"Close",onClick:a,className:"size-7 text-muted-foreground hover:text-foreground",children:g.jsx(Jo,{className:"size-4"})})]})]}),g.jsx("div",{className:"flex-1 overflow-hidden duration-200 animate-in fade-in-0",children:n}),g.jsx(JI,{open:k,onOpenChange:I,children:g.jsxs(sw,{children:[g.jsxs(ow,{children:[g.jsx(lw,{children:"Delete chat"}),g.jsxs(uw,{children:["“",L,"” will be deleted. This cannot be undone."]})]}),g.jsxs(aw,{children:[g.jsx(dw,{children:"Cancel"}),g.jsx(cw,{onClick:()=>{I(!1),e&&(x.mutate(e),a())},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete"})]})]})})]})}function w2({sidebar:e,children:t,storageKey:n,className:r,defaultSidebarSize:i=30,minSidebarSize:s=20,maxSidebarSize:o=80,minMainSize:a=40,maxMainSize:l=100,autoExpandSidebar:u=!1,sidebarCollapsed:f,mainCollapsed:d}){const p=b.useRef(null),m=b.useRef(null),[v,_]=b.useState(!1),[w,x]=b.useState(!1),S=b.useRef(!1);b.useRef(new WeakMap);const C=b.useRef(null),R=(D,L,A)=>{if(!(L===void 0||!D.current)){if(S.current&&(x(!0),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>x(!1),320)),L){D.current.collapse();return}D.current.expand(),D.current.getSize()<A-10&&D.current.resize(A)}};b.useEffect(()=>{R(p,f,i)},[f]),b.useEffect(()=>{R(m,d,100-i)},[d]),b.useEffect(()=>(S.current=!0,()=>{C.current&&clearTimeout(C.current)}),[]);const P=w?"transition-[flex] duration-300 ease-in-out":void 0;b.useEffect(()=>{u&&p.current?.expand()},[u]);const k=()=>{const D=p.current;
153D&&(v?D.expand():D.collapse())},I=g.jsx(fn,{variant:"outline",className:"absolute left-1/2 top-[53%] z-10 size-6 -translate-x-1/2 -translate-y-1/2 rounded-full bg-background p-0 shadow-sm hover:bg-secondary/80",onClick:k,children:v?g.jsx(Iz,{className:"size-5"}):g.jsx(Rz,{className:"size-4"})});return g.jsxs(GH,{direction:"horizontal",className:_e("min-h-[220px] rounded-lg pt-1",r),autoSaveId:n,children:[g.jsx(wb,{ref:p,collapsible:!0,onCollapse:()=>_(!0),onExpand:()=>_(!1),collapsedSize:.5,defaultSize:i,minSize:s,maxSize:d?100:o,className:P,children:e}),g.jsx(KH,{withHandle:!d,handle:I,className:_e(d&&"pointer-events-none w-0 opacity-0",w&&"transition-opacity duration-300")}),g.jsx(wb,{ref:m,collapsible:d!==void 0,collapsedSize:0,defaultSize:100-i,minSize:a,maxSize:l,className:P,children:g.jsx("div",{className:"flex h-full flex-col overflow-hidden",children:t})})]})}function VZ({list:e,detail:t,isDetailActive:n,onBack:r,title:i,createAction:s,storageKey:o,className:a,defaultSidebarSize:l,minSidebarSize:u,maxSidebarSize:f,minMainSize:d,maxMainSize:p}){const m=ah();return lje(m&&n?{left:g.jsxs("button",{type:"button",onClick:r,"aria-label":"Back",className:"flex items-center gap-1 rounded p-1 text-sm text-muted-foreground transition-colors hover:text-foreground",children:[g.jsx(Tz,{className:"size-4"}),i]})}:{}),m?g.jsxs("div",{className:"relative flex h-full flex-col overflow-hidden",children:[g.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:n?t:e}),!n&&s&&g.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 flex justify-end px-4 pb-4",children:g.jsx("div",{className:"pointer-events-auto",children:s})})]}):g.jsx(w2,{sidebar:e,storageKey:o,className:a,defaultSidebarSize:l,minSidebarSize:u,maxSidebarSize:f,minMainSize:d,maxMainSize:p,children:t})}const UZ=b.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const i=t?XP:"button";return g.jsx(i,{ref:r,className:_e("flex size-14 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm transition-colors hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",e),...n})});UZ.displayName="Fab";function BZ(e){const t=e;return t?t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t.isContentEditable?!0:!!t.closest('[role="combobox"],[role="menu"],[role="dialog"],[role="alertdialog"],[data-radix-popper-content-wrapper]'):!1}function kLe(e){if(BZ(e))return!0;const t=e;return t?t instanceof HTMLButtonElement?!0:!!t.closest('[role="listbox"],[role="option"]'):!1}function TLe(){const e=wi(),t=Qn(),{pathname:n,search:r}
153=t,[i]=Jm(),s=ah(),a=Bee("/chat/:id")?.params.id,l=a==="new",u=a&&!l?a:null,f=l&&i.get("temporary")==="1",d=i.get("view")==="full",p=!!a,m=typeof t.state?.chatSessionRouteKey=="string"?t.state.chatSessionRouteKey:t.key,v=()=>({chatSessionRouteKey:m,...f&&{temporary:!0}}),_=(A,$=d,j=!1)=>{const V=new URLSearchParams;$&&V.set("view","full"),j&&V.set("temporary","1");const B=V.toString();return`/chat/${A}${B?`?${B}`:""}`},w=(A,$)=>{e(A?_(A):"/chat",{state:A?$?.viaKeyboard?{viaKeyboard:!0}:null:l?v():null})},x=(A=!1)=>{if(l&&f===A){document.querySelector('[aria-label="Chat message input"]')?.focus();return}e(_("new",d,A),{state:!l&&t.state?.chatSessionRouteKey&&A===(t.state?.temporary===!0)?v():void 0})},S=Dr(),C=async A=>{const $=Ia(A);$?await $.refreshFromServer():await S.invalidateQueries({queryKey:["chat",A]})},R=OZ(zZ),P=u?R.indexOf(u):-1,k=P>0?R[P-1]:null,I=P>=0&&P<R.length-1?R[P+1]:null;b.useEffect(()=>{const A=$=>{const j=$.metaKey||$.ctrlKey;if(j&&$.shiftKey&&$.key.toLowerCase()==="n"){$.preventDefault(),x(!0);return}j||$.altKey||BZ($.target)||($.key==="n"?($.preventDefault(),x(!1)):$.key==="N"?($.preventDefault(),x(!0)):!s&&d&&u&&!kLe($.target)&&(($.key==="ArrowUp"||$.key==="k")&&k?($.preventDefault(),e(_(k),{state:{viaKeyboard:!0}})):($.key==="ArrowDown"||$.key==="j")&&I&&($.preventDefault(),e(_(I),{state:{viaKeyboard:!0}}))))};return window.addEventListener("keydown",A),()=>window.removeEventListener("keydown",A)},[l,f,d,u,k,I,s,n,r]);const D=g.jsx(xLe,{selectedChatId:u,temporaryOpen:f,onChatSelect:w,onCompose:()=>x(!1),onComposeTemporary:()=>x(!0)});if(s)return g.jsx(VZ,{list:D,detail:g.jsx(Ko,{}),isDetailActive:p,onBack:()=>w(null),title:"Chats",createAction:g.jsx(UZ,{asChild:!0,children:g.jsx(fo,{to:"/chat/new","aria-label":"New chat",onClick:A=>{A.preventDefault(),x(!1)},children:g.jsx(Xf,{className:"size-6"})})}),storageKey:"chats-panel-layout-v2",className:"h-full overflow-hidden"});const L=p?g.jsx(CLe,{chatId:u??void 0,temporary:f,mode:d?"full":"split",position:u&&P>=0?{index:P,total:R.length}:null,onPrev:k?()=>e(_(k)):null,onNext:I?()=>e(_(I)):null,onClose:()=>w(null),onOpenFull:()=>e(_(a,!0,f),{state:l?v():null}),onShowList:()=>e(_(a,!1,f),{state:l?v():null}),onMakeTemporary:l?()=>x(!0):void 0,onReload:u?()=>void C(u):void 0,children:g.jsx(Ko,{})}):null;return g.jsx("div",{className:"size-full",children:g.jsx(w2,{sidebar:D,storageKey:"chats-panel-layout-v2",className:"h-full overflow-hidden",defaultSidebarSize:34,minSidebarSize:24,maxSidebarSize:60,minMainSize:40,sidebarCollapsed:!!L&&d,mainCollapsed:!L,children:L})})}function PLe(e,t){const[n,r]=b.useState(e);return b.useEffect(()=>{const i=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(i)}},[e,t]),n}const RLe=(e="")=>{const[t,n]=b.useState(e),r=PLe(t,500),{data:i,isLoading:s,error:o,fetchNextPage:a,hasNextPage:l,isFetching:u,isFetchingNextPage:f,refetch:d}=O8({queryKey:["infinite-whiteboards",r],queryFn:async({pageParam:p})=>await cMe(p,10,r),initialPageParam:1,getNextPageParam:(p,m,v)=>{if(!(p&&p.length===0))return v+1},getPreviousPageParam:(p,m,v)=>{if(!(v<=1))return v-1}});return{whiteboards:i,error:o,isLoading:s,fetchNextPage:a,hasNextPage:l,isFetching:u,isFetchingNextPage:f,refetch:d,searchQuery:t,setSearchQuery:n}},Oqe=e=>{const{data:t,isLoading:n,error:r,refetch:i}=hr({queryKey:["whiteboard",e?.toString()],queryFn:()=>dMe(e||"-1"),enabled:!!e});return{whiteboard:t,isLoading:n,error:r,refetch:i}},ILe=()=>{const e=Dr();return os({mutationFn:fMe,onSuccess:(t,n,r)=>{e.setQueryData(["whiteboards"],i=>i?.length>0?[t,...i]:[t]),e.setQueryData(["infinite-whiteboards",""],i=>({pages:i?.pages?[[t],...i.pages]:[[t]],pageParams:i?.pageParams?[0,...i.pageParams]:[0]}))}})},OLe=()=>{const e=Dr();return os({mutationFn:t=>hMe(t.id,t),onSuccess:async(t,n,r)=>{const i={id:n.id,...t};await e.setQueryData(["whiteboard",n.id?.toString()],i),e.setQueryData(["infinite-whiteboards",""],s=>({...s,pages:s.pages.map(o=>o.map(a=>a.id===n.id?i:a))})),e.setQueryData(["whiteboards"],s=>s?s.map(o=>o.id===n.id?i:o):[])}})},DLe=()=>{const e=Dr();return os({mutationFn:pMe,onSuccess:(t,n,r)=>{e.setQueryData(["whiteboards"],i=>i?i.filter(s=>s.id!==n):[]),e.setQueryData(["infinite-whiteboards",""],i=>({...i,pages:i.pages.map(s=>s.filter(o=>o.id!==n))}))}})},HZ=({searchQuery:e,onChange:t,onClear:n})=>g.jsx("div",{className:"border-b bg-background px-4 py-2",children:g.jsx("form",{children:g.jsxs("div",{className:"relative",children:[g.jsx(Tf,{className:"absolute left-2 top-2.5 size-4 text-muted-foreground"}),g.jsx(Dg,{placeholder:"Search",className:"rounded-2xl pl-8",value:e,onCh
153ange:r=>{t(r.target.value)},onKeyDown:r=>{if(r.key==="Enter"){r.preventDefault();const i=r.target.value;t(i)}}}),e&&g.jsxs(fn,{variant:"ghost",type:"submit",size:"icon",className:"absolute inset-y-0 right-0 rounded-md",onClick:r=>{r.preventDefault(),n()},children:[g.jsx(Jo,{className:"size-5"}),g.jsx("span",{className:"sr-only",children:"Clear search"})]})]})})}),ALe=b.memo(function({selectedId:t,onSelect:n}={}){const r=ah(),[i]=Jm(),s=i.get("search")??"",{whiteboards:o,fetchNextPage:a,hasNextPage:l,isFetchingNextPage:u,searchQuery:f,setSearchQuery:d}=RLe(s),p=wi(),v=Qn().pathname,_=b.useRef(null);b.useEffect(()=>{if(!l||u)return;const P=_.current?.querySelector("[data-radix-scroll-area-viewport]");P&&P.scrollHeight<=P.clientHeight&&a()},[o,l,u,a]);const w=b.useCallback((P,k)=>{const I=new URLSearchParams(i.toString());return I.set(P,k),I.toString()},[i]),x=f&&f.length>0;b.useEffect(()=>{if(x)p(`${v}?${w("search",f)}`,{replace:!0});else if(i.toString().length>0){const P=new URLSearchParams(i.toString());P.delete("search"),p(`${v}?${P.toString()}`,{replace:!0})}},[f,i,x,w,p,v]);const S=()=>{d(""),p("/board")},C=b.useMemo(()=>o?.pages.flatMap(P=>P)??[],[o]),R=b.useMemo(()=>yMe(C,P=>P.updated_at||P.created_at),[C]);return g.jsxs("div",{className:"flex h-full flex-col",children:[!r&&g.jsxs("div",{className:"flex items-center justify-between px-4 py-2",children:[g.jsx("h1",{className:"text-lg font-semibold leading-none",children:"Whiteboards"}),g.jsx(MLe,{})]}),g.jsx(HZ,{searchQuery:f,onChange:d,onClear:S}),g.jsx(Cc,{ref:_,className:"flex-1",onScrollCapture:P=>{const k=P.target;l&&Math.abs(k.scrollHeight-k.scrollTop-k.clientHeight)<1&&a()},children:g.jsx("div",{className:"px-2 py-1",children:x?C.length===0?g.jsx("div",{className:"pt-4 text-center text-sm text-muted-foreground",children:"No results found"}):g.jsx("div",{className:"flex flex-col gap-2 px-2",children:C.map(P=>g.jsx(g$,{whiteboard:P,selectedId:t,onSelect:n},P.id))}):vMe.map(P=>{const k=R[P];return k.length===0?null:g.jsxs("div",{className:"mb-4",children:[g.jsx("h3",{className:"mb-1.5 px-2 text-xs font-medium text-muted-foreground/60",children:gMe[P]}),g.jsx("div",{className:"flex flex-col gap-2 px-2",children:k.map(I=>g.jsx(g$,{whiteboard:I,selectedId:t,onSelect:n},I.id))})]},P)})})})]})}),g$=b.memo(function({whiteboard:t,selectedId:n,onSelect:r}){const i=wi(),o=Qn().pathname,[a]=Jm(),l=ah(),u=b.useRef(null),[f,d]=b.useState(!1),[p,m]=b.useState(t.title),{mutate:v}=OLe(),{mutate:_}=DLe(),w=b.useRef(null),[x,S]=b.useState(!1),C=n!==void 0?n===t.id:o===`/board/${t.id}`;b.useEffect(()=>{if(u?.current&&C){const H=u.current.getBoundingClientRect();(H.top<0||H.bottom>window.innerHeight)&&u.current.scrollIntoView({behavior:"instant"})}},[u,t.id,C]),b.useEffect(()=>{f&&w.current&&(w.current.focus(),w.current.select())},[f]);const P=(H=>{const te=Xo(H)??new Date;return WDe(te,{addSuffix:!1}).replace("less than a minute","<1m").replace("about ","").replace(" minutes","m").replace(" minute","m").replace(" hours","h").replace(" hour","h").replace(" days","d").replace(" day","d").replace(" months","mo").replace(" month","mo").replace(" years","y").replace(" year","y").replace("almost ","~")})(t?.updated_at||t?.created_at),k=H=>{m(H.target.value)},I=()=>{p.trim()!==t.title.trim()&&t.id&&v({...t,title:p.trim()}),d(!1)},D=()=>{m(t.title),d(!1)},L=H=>{H.key==="Enter"?I():H.key==="Escape"&&D()},A=H=>{f&&H.stopPropagation()},$=H=>{H.stopPropagation(),d(!0)},j=H=>{H.stopPropagation(),S(!0)},V=()=>{t.id&&_(t.id,{onSuccess:()=>{C&&i("/board")}}),S(!1)},B=b.useCallback(()=>{if(r){r(t.id);return}i(`/board/${t.id}?${a.toString()}`)},[i,t.id,a,r]);return g.jsxs(g.Fragment,{children:[g.jsxs("button",{className:_e("flex flex-col items-start gap-2 rounded-lg border p-3 text-left text-sm transition-all hover:bg-secondary/50",!l&&"group",C&&"bg-secondary/50"),onClick:B,ref:u,children:[g.jsx("div",{className:"flex w-full flex-col gap-1",children:f?g.jsxs("div",{className:"flex items-center gap-1",onClick:A,children:[g.jsx("input",{ref:w,type:"text",value:p,onChange:k,onKeyDown:L,className:"flex h-7 w-full rounded-md border border-input bg-transparent px-2 py-1 text-sm font-semibold shadow-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",onClick:H=>H.stopPropagation()}),g.jsx(fn,{variant:"ghost",size:"icon",className:"size-6 p-0",onClick:H=>{H.stopPropagation(),I()},"aria-label":"Save title",children:g.jsx(ng,{className:"size-4"})}),g.jsx(fn,{variant:"ghost",size:"icon",className:"size-6 p-0",onClick:H=>{H.stopPropagation(),D()},"aria-label":"Cancel editing",children:g.jsx(Jo,{className:"size-4"})})]}):g.jsxs("div",{className:"flex w-full items-center justify-between",children:[g.jsx("div",{className:"font-semibold",children:t.title}),g.jsxs("div",{className:_e("flex gap-1",l&&"hidden"),children:[g.jsx(Lf,{children:g.jsxs(ab,{children:[g.jsx(lb,{asChild:!0,children:g.jsx(fn,{variant:"ghost",size:"icon",className:"size-6 p-0 opacity-0 transition-opacity hover:opacity-100 group-hover:opacity-100",onClick:$,"aria-label":"Edit whiteboard title",children:g.jsx(Sie,{className:"size-3"})})}),g.jsx(Dm,{children:g.jsx("p",{children:"Edit title"})})]})}),g.jsx(Lf,{children:g.jsxs(ab,{children:[g.jsx(lb,{asChild:!0,children:g.jsx(fn,{variant:"ghost",size:"icon",className:"size-6 p-0 text-destructive opacity-0 transition-opacity hover:opacity-100 group-hover:opacity-100",onClick:j,"aria-label":"Delete whiteboard",children:g.jsx(t_,{className:"size-3"})})}),g.jsx(Dm,{children:g.jsx("p",{children:"Delete"})})]})})]})]})}),g.jsxs("div",{className:"w-full",children:[g.jsx("div",{className:_e("h-24 w-full overflow-hidden rounded-md",t.thumbnail?"bg-white dark:[filter:invert(0.91)_hue-rotate(180deg)]":"bg-muted"),children:t.thumbnail&&g.jsx("img",{src:t.thumbnail,alt:t.title,className:"size-full object-contain"})}),g.jsx("div",{className:"mt-1 flex justify-end",children:g.jsxs("div",{className:_e("text-xs",C?"text-foreground":"text-muted-foreground"),children:[P," ago"]})})]})]}),g.jsx(JI,{open:x,onOpenChange:S,children:g.jsxs(sw,{className:"md:rounded-2xl",children:[g.jsxs(ow,{children:[g.jsx(lw,{children:"Delete Whiteboard"}),g.jsxs(uw,{children:["Are you sure you want to delete “",t.title,"”? This action cannot be undone."]})]}),g.jsxs(aw,{children:[g.jsx(dw,{children:"Cancel"}),g.jsx(cw,{onClick:V,className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})})]})}),MLe=()=>{const{mutate:e,isPending:t}=ILe(),n=wi(),[r]=Jm(),i=async()=>{e({title:"Untitled",content:[]},{onSuccess:o=>{n(`/board/${o.id}?${r.toString()}`)}})};return g.jsx(fn,{variant:"ghost",size:"icon",className:"size-8",onClick:i,disabled:t,children:g.jsx(Xf,{className:"size-4"})})};function NLe(){const e=wi(),{pathname:t}=Qn(),n=/^\/board\/[^/]+/.test(t);return g.jsx(VZ,{list:g.jsx(ALe,{}),detail:g.jsx(Ko,{}
153),isDetailActive:n,onBack:()=>e("/board"),title:"Whiteboards",storageKey:"whiteboards-panel-layout",className:"max-h-full"})}function jLe(){var e=b.useRef(!1),t=b.useCallback(function(){return e.current},[]);return b.useEffect(function(){return e.current=!0,function(){e.current=!1}},[]),t}var LLe=function(e){e===void 0&&(e={});var t=b.useState(e),n=t[0],r=t[1],i=b.useCallback(function(s){r(function(o){return Object.assign({},o,s instanceof Function?s(o):s)})},[]);return[n,i]},ZS,v$;function FLe(){return v$||(v$=1,ZS=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null;break}return e.removeAllRanges(),function(){e.type==="Caret"&&e.removeAllRanges(),e.rangeCount||n.forEach(function(i){e.addRange(i)}),t&&t.focus()}}),ZS}var YS,y$;function $Le(){if(y$)return YS;y$=1;var e=FLe(),t={"text/plain":"Text","text/html":"Url",default:"Text"},n="Copy to clipboard: #{key}, Enter";function r(s){var o=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return s.replace(/#{\s*key\s*}/g,o)}function i(s,o){var a,l,u,f,d,p,m=!1;o||(o={}),a=o.debug||!1;try{u=e(),f=document.createRange(),d=document.getSelection(),p=document.createElement("span"),p.textContent=s,p.ariaHidden="true",p.style.all="unset",p.style.position="fixed",p.style.top=0,p.style.clip="rect(0, 0, 0, 0)",p.style.whiteSpace="pre",p.style.webkitUserSelect="text",p.style.MozUserSelect="text",p.style.msUserSelect="text",p.style.userSelect="text",p.addEventListener("copy",function(_){if(_.stopPropagation(),o.format)if(_.preventDefault(),typeof _.clipboardData>"u"){a&&console.warn("unable to use e.clipboardData"),a&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var w=t[o.format]||t.default;window.clipboardData.setData(w,s)}else _.clipboardData.clearData(),_.clipboardData.setData(o.format,s);o.onCopy&&(_.preventDefault(),o.onCopy(_.clipboardData))}),document.body.appendChild(p),f.selectNodeContents(p),d.addRange(f);var v=document.execCommand("copy");if(!v)throw new Error("copy command was unsuccessful");m=!0}catch(_){a&&console.error("unable to copy using execCommand: ",_),a&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(o.format||"text",s),o.onCopy&&o.onCopy(window.clipboardData),m=!0}catch(w){a&&console.error("unable to copy using clipboardData: ",w),a&&console.error("falling back to prompt"),l=r("message"in o?o.message:n),window.prompt(l,s)}}finally{d&&(typeof d.removeRange=="function"?d.removeRange(f):d.removeAllRanges()),p&&document.body.removeChild(p),u()}return m}return YS=i,YS}var zLe=$Le();const VLe=vo(zLe);var ULe=function(){var e=jLe(),t=LLe({value:void 0,error:void 0,noUserInteraction:!0}),n=t[0],r=t[1],i=b.useCallback(function(s){if(e()){var o,a;try{if(typeof s!="string"&&typeof s!="number"){var l=new Error("Cannot copy typeof "+typeof s+" to clipboard, must be a string");r({value:s,error:l,noUserInteraction:!0});return}else if(s===""){var l=new Error("Cannot copy empty string to clipboard.");r({value:s,error:l,noUserInteraction:!0});return}a=s.toString(),o=VLe(a),r({value:a,error:void 0,noUserInteraction:o})}catch(u){r({value:a,error:u,noUserInteraction:o})}}},[]);return[n,i]};const BLe=()=>g.jsx("div",{className:"flex h-full flex-col items-center justify-center bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] dark:bg-zinc-900 dark:bg-[radial-gradient(#333333_1px,transparent_1px)]",children:g.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[g.jsx(eg,{className:"size-8 text-muted-foreground/30"}),g.jsx("p",{className:"text-sm text-muted-foreground",children:"Save your first link to get started"}),g.jsxs("p",{className:"text-xs text-muted-foreground/60",children:["Press"," ",g.jsx("kbd",{className:"rounded border border-border/50 bg-muted/50 px-1.5 py-0.5 font-mono text-[10px]",children:"⌘K"})," ","to search"]})]})}),HLe=()=>g.jsx("div",{className:"flex flex-1 flex-col items-center justify-center",children:g.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[g.jsx(eg,{className:"size-8 text-muted-foreground
153/30"}),g.jsx("p",{className:"text-sm text-muted-foreground",children:"No links yet"})]})}),Dqe=()=>g.jsx("div",{className:"mt-6 flex flex-col items-center justify-center p-10",children:g.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[g.jsx(eg,{className:"size-8 text-muted-foreground/30"}),g.jsx("p",{className:"text-sm text-muted-foreground",children:"No links yet"})]})}),qLe=Jf("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),WLe=b.forwardRef(({className:e,variant:t,...n},r)=>g.jsx("div",{ref:r,role:"alert",className:_e(qLe({variant:t}),e),...n}));WLe.displayName="Alert";const GLe=b.forwardRef(({className:e,...t},n)=>g.jsx("h5",{ref:n,className:_e("mb-1 font-medium leading-none tracking-tight",e),...t}));GLe.displayName="AlertTitle";const KLe=b.forwardRef(({className:e,...t},n)=>g.jsx("div",{ref:n,className:_e("text-sm [&_p]:leading-relaxed",e),...t}));KLe.displayName="AlertDescription";const x2=()=>g.jsx("div",{className:"flex h-full flex-col items-center justify-center bg-white bg-[radial-gradient(#e5e7eb_1px,transparent_1px)] [background-size:16px_16px] dark:bg-zinc-900 dark:bg-[radial-gradient(#333333_1px,transparent_1px)]",children:g.jsx("div",{className:"flex flex-col items-center justify-center text-muted-foreground",children:g.jsxs("p",{className:"text-sm",children:["Press"," ",g.jsx("kbd",{className:"rounded border border-border/50 bg-muted/50 px-1.5 py-0.5 font-mono text-xs",children:"⌘K"})," ","to search"]})})}),ZLe=({link:e})=>g.jsx("div",{children:g.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center space-x-4 px-8 text-center",children:[g.jsx("p",{className:"line-clamp-2",children:"Oops! This page can't be shown in a preview. It might be due to restrictions set by the site."}),g.jsx("br",{}),g.jsxs("p",{className:"line-clamp-2",children:["Try viewing directly: ",g.jsx("a",{href:e.url.toString(),target:"_blank",rel:"noopener noreferrer",className:"text-foreground underline underline-offset-4 hover:opacity-70",children:"Open in a new tab"}),"."]})]})});var Mg=e=>e.type==="checkbox",ac=e=>e instanceof Date,fi=e=>e==null;const qZ=e=>typeof e=="object";var ir=e=>!fi(e)&&!Array.isArray(e)&&qZ(e)&&!ac(e),WZ=e=>ir(e)&&e.target?Mg(e.target)?e.target.checked:e.target.value:e,YLe=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,GZ=(e,t)=>e.has(YLe(t)),QLe=e=>{const t=e.constructor&&e.constructor.prototype;return ir(t)&&t.hasOwnProperty("isPrototypeOf")},S2=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Oi(e){let t;const n=Array.isArray(e),r=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(S2&&(e instanceof Blob||r))&&(n||ir(e)))if(t=n?[]:{},!n&&!QLe(e))t=e;else for(const i in e)e.hasOwnProperty(i)&&(t[i]=Oi(e[i]));else return e;return t}var yw=e=>Array.isArray(e)?e.filter(Boolean):[],er=e=>e===void 0,$e=(e,t,n)=>{if(!t||!ir(e))return n;const r=yw(t.split(/[,[\].]+?/)).reduce((i,s)=>fi(i)?i:i[s],e);return er(r)||r===e?er(e[t])?n:e[t]:r},ks=e=>typeof e=="boolean",E2=e=>/^\w*$/.test(e),KZ=e=>yw(e.replace(/["|']|\]/g,"").split(/\.|\[/)),rn=(e,t,n)=>{let r=-1;const i=E2(t)?[t]:KZ(t),s=i.length,o=s-1;for(;++r<s;){const a=i[r];let l=n;if(r!==o){const u=e[a];l=ir(u)||Array.isArray(u)?u:isNaN(+i[r+1])?{}:[]}if(a==="__proto__"||a==="constructor"||a==="prototype")return;e[a]=l,e=e[a]}return e};const Nb={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},so={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ma={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},ZZ=ve.createContext(null),bw=()=>ve.useContext(ZZ),XLe=e=>{const{children:t,...n}=e;return ve.createElement(ZZ.Provider,{value:n},t)};var YZ=(e,t,n,r=!0)=>{const i={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(i,s,{get:()=>{const o=s;return t._proxyFormState[o]!==so.all&&(t._proxyFormState[o]=!r||so.all),n&&(n[o]=!0),e[o]}});return i},Di=e=>ir(e)&&!Object.keys(e).length,QZ=(e,t,n,r)=>{n(e);const{name:i,...s}=e;return Di(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(o=>t[o]===(!r||so.all))},om=e=>Array.isArray(e)?e:[e],XZ=(e,t,n)=>!e||!t||e===t||om(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function C2(e){const t=ve.useRef(e);t.current=e,ve.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function JLe(e){const t=bw(),{control:n=t.control,disabled:r,name:i,exact:s}=e||{},[o,a]=ve.useState(n._formState),l=ve.useRef(!0),u=ve.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),f=ve.useRef(i);return f.current=i,C2({disabled:r,next:d=>l.current&&XZ(f.current,d.name,s)&&QZ(d,u.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),ve.useEffect(()=>
vendor: 24,600 bytes, line 153
153(l.current=!0,u.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),ve.useMemo(()=>YZ(o,n,u.current,!1),[o,n])}var Lo=e=>typeof e=="string",JZ=(e,t,n,r,i)=>Lo(e)?(r&&t.watch.add(e),$e(n,e,i)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),$e(n,s))):(r&&(t.watchAll=!0),n);function eFe(e){const t=bw(),{control:n=t.control,name:r,defaultValue:i,disabled:s,exact:o}=e||{},a=ve.useRef(r);a.current=r,C2({disabled:s,subject:n._subjects.values,next:f=>{XZ(a.current,f.name,o)&&u(Oi(JZ(a.current,n._names,f.values||n._formValues,!1,i)))}});const[l,u]=ve.useState(n._getWatch(r,i));return ve.useEffect(()=>n._removeUnmounted()),l}function tFe(e){const t=bw(),{name:n,disabled:r,control:i=t.control,shouldUnregister:s}=e,o=GZ(i._names.array,n),a=eFe({control:i,name:n,defaultValue:$e(i._formValues,n,$e(i._defaultValues,n,e.defaultValue)),exact:!0}),l=JLe({control:i,name:n,exact:!0}),u=ve.useRef(i.register(n,{...e.rules,value:a,...ks(e.disabled)?{disabled:e.disabled}:{}})),f=ve.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!$e(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!$e(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!$e(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!$e(l.validatingFields,n)},error:{enumerable:!0,get:()=>$e(l.errors,n)}}),[l,n]),d=ve.useMemo(()=>({name:n,value:a,...ks(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:p=>u.current.onChange({target:{value:WZ(p),name:n},type:Nb.CHANGE}),onBlur:()=>u.current.onBlur({target:{value:$e(i._formValues,n),name:n},type:Nb.BLUR}),ref:p=>{const m=$e(i._fields,n);m&&p&&(m._f.ref={focus:()=>p.focus(),select:()=>p.select(),setCustomValidity:v=>p.setCustomValidity(v),reportValidity:()=>p.reportValidity()})}}),[n,i._formValues,r,l.disabled,a,i._fields]);return ve.useEffect(()=>{const p=i._options.shouldUnregister||s,m=(v,_)=>{const w=$e(i._fields,v);w&&w._f&&(w._f.mount=_)};if(m(n,!0),p){const v=Oi($e(i._options.defaultValues,n));rn(i._defaultValues,n,v),er($e(i._formValues,n))&&rn(i._formValues,n,v)}return!o&&i.register(n),()=>{(o?p&&!i._state.action:p)?i.unregister(n):m(n,!1)}},[n,i,o,s]),ve.useEffect(()=>{i._updateDisabledField({disabled:r,fields:i._fields,name:n})},[r,n,i]),ve.useMemo(()=>({field:d,formState:l,fieldState:f}),[d,l,f])}const nFe=e=>e.render(tFe(e));var eY=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},b$=e=>({isOnSubmit:!e||e===so.onSubmit,isOnBlur:e===so.onBlur,isOnChange:e===so.onChange,isOnAll:e===so.all,isOnTouch:e===so.onTouched}),_$=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const am=(e,t,n,r)=>{for(const i of n||Object.keys(e)){const s=$e(e,i);if(s){const{_f:o,...a}=s;if(o){if(o.refs&&o.refs[0]&&t(o.refs[0],i)&&!r)return!0;if(o.ref&&t(o.ref,o.name)&&!r)return!0;if(am(a,t))break}else if(ir(a)&&am(a,t))break}}};var rFe=(e,t,n)=>{const r=om($e(e,n));return rn(r,"root",t[n]),rn(e,n,r),e},k2=e=>e.type==="file",Ao=e=>typeof e=="function",jb=e=>{if(!S2)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},E0=e=>Lo(e),T2=e=>e.type==="radio",Lb=e=>e instanceof RegExp;const w$={value:!1,isValid:!1},x$={value:!0,isValid:!0};var tY=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!er(e[0].attributes.value)?er(e[0].value)||e[0].value===""?x$:{value:e[0].value,isValid:!0}:x$:w$}return w$};const S$={isValid:!1,value:null};var nY=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,S$):S$;function E$(e,t,n="validate"){if(E0(e)||Array.isArray(e)&&e.every(E0)||ks(e)&&!e)return{type:n,message:E0(e)?e:"",ref:t}}var Md=e=>ir(e)&&!Lb(e)?e:{value:e,message:""},C$=async(e,t,n,r,i,s)=>{const{ref:o,refs:a,required:l,maxLength:u,minLength:f,min:d,max:p,pattern:m,validate:v,name:_,valueAsNumber:w,mount:x}=e._f,S=$e(n,_);if(!x||t.has(_))return{};const C=a?a[0]:o,R=j=>{i&&C.reportValidity&&(C.setCustomValidity(ks(j)?"":j||""),C.reportValidity())},P={},k=T2(o),I=Mg(o),D=k||I,L=(w||k2(o))&&er(o.value)&&er(S)||jb(o)&&o.value===""||S===""||Array.isArray(S)&&!S.length,A=eY.bind(null,_,r,P),$=(j,V,B,H=ma.maxLength,te=ma.minLength)=>{const G=j?V:B;P[_]={type:j?H:te,message:G,ref:o,...A(j?H:te,G)}};if(s?!Array.isArray(S)||!S.length:l&&(!D&&(L||fi(S))||ks(S)&&!S||I&&!tY(a).isValid||k&&!nY(a).isValid)){const{value:j,message:V}=E0(l)?{value:!!l,message:l}:Md(l);if(j&&(P[_]={type:ma.required,message:V,ref:C,...A(ma.required,V)},!r))return R(V),P}if(!L&&(!fi(d)||!fi(p))){let j,V;const B=Md(p),H=Md(d);if(!fi(S)&&!isNaN(S)){const te=o.valueAsNumber||S&&+S;fi(B.value)||(j=te>B.value),fi(H.value)||(V=te<H.value)}else{const te=o.valueAsDate||new Date(S),G=M=>new Date(new Date().toDateString()+" "+M),Z=o.type=="time",Y=o.type=="week";Lo(B.value)&&S&&(j=Z?G(S)>G(B.value):Y?S>B.value:te>new Date(B.value)),Lo(H.value)&&S&&(V=Z?G(S)<G(H.value):Y?S<H.value:te<new Date(H.value))}if((j||V)&&($(!!j,B.message,H.message,ma.max,ma.min),!r))return R(P[_].message),P}if((u||f)&&!L&&(Lo(S)||s&&Array.isArray(S))){const j=Md(u),V=Md(f),B=!fi(j.value)&&S.length>+j.value,H=!fi(V.value)&&S.length<+V.value;if((B||H)&&($(B,j.message,V.message),!r))return R(P[_].message),P}if(m&&!L&&Lo(S)){const{value:j,message:V}=Md(m);if(Lb(j)&&!S.match(j)&&(P[_]={type:ma.pattern,message:V,ref:o,...A(ma.pattern,V)},!r))return R(V),P}if(v){if(Ao(v)){const j=await v(S,n),V=E$(j,C);if(V&&(P[_]={...V,...A(ma.validate,V.message)},!r))return R(V.message),P}else if(ir(v)){let j={};for(const V in v){if(!Di(j)&&!r)break;const B=E$(await v[V](S,n),C,V);B&&(j={...B,...A(V,B.message)},R(B.message),r&&(P[_]=j))}if(!Di(j)&&(P[_]={ref:C,...j},!r))return P}}return R(!0),P};function iFe(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=er(e)?r++:e[t[r++]];return e}function sFe(e){for(const t in e)if(e.hasOwnProperty(t)&&!er(e[t]))return!1;return!0}function _r(e,t){const n=Array.isArray(t)?t:E2(t)?[t]:KZ(t),r=n.length===1?e:iFe(e,n),i=n.length-1,s=n[i];return r&&delete r[s],i!==0&&(ir(r)&&Di(r)||Array.isArray(r)&&sFe(r))&&_r(e,n.slice(0,-1)),e}var QS=()=>{let e=[];return{get observers(){return e},next:i=>{for(const s of e)s.next&&s.next(i)},subscribe:i=>(e.push(i),{unsubscribe:()=>{e=e.filter(s=>s!==i)}}),unsubscribe:()=>{e=[]}}},lT=e=>fi(e)||!qZ(e);function Al(e,t){if(lT(e)||lT(t))return e===t;if(ac(e)&&ac(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const o=t[i];if(ac(s)&&ac(o)||ir(s)&&ir(o)||Array.isArray(s)&&Array.isArray(o)?!Al(s,o):s!==o)return!1}}return!0}var rY=e=>e.type==="select-multiple",oFe=e=>T2(e)||Mg(e),XS=e=>jb(e)&&e.isConnected,iY=e=>{for(const t in e)if(Ao(e[t]))return!0;return!1};function Fb(e,t={}){const n=Array.isArray(e);if(ir(e)||n)for(const r in e)Array.isArray(e[r])||ir(e[r])&&!iY(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Fb(e[r],t[r])):fi(e[r])||(t[r]=!0);return t}function sY(e,t,n){const r=Array.isArray(e);if(ir(e)||r)for(const i in e)Array.isArray(e[i])||ir(e[i])&&!iY(e[i])?er(t)||lT(n[i])?n[i]=Array.isArray(e[i])?Fb(e[i],[]):{...Fb(e[i])}:sY(e[i],fi(t)?{}:t[i],n[i]):n[i]=!Al(e[i],t[i]);return n}var cp=(e,t)=>sY(e,t,Fb(t)),oY=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>er(e)?e:t?e===""?NaN:e&&+e:n&&Lo(e)?new Date(e):r?r(e):e;function JS(e){const t=e.ref;return k2(t)?t.files:T2(t)?nY(e.refs).value:rY(t)?[...t.selectedOptions].map(({value:n})=>n):Mg(t)?tY(e.refs).value:oY(er(t.value)?e.ref.value:t.value,e)}var aFe=(e,t,n,r)=>{const i={};for(const s of e){const o=$e(t,s);o&&rn(i,s,o._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},dp=e=>er(e)?e:Lb(e)?e.source:ir(e)?Lb(e.value)?e.value.source:e.value:e;const k$="AsyncFunction";var lFe=e=>!!e&&!!e.validate&&!!(Ao(e.validate)&&e.validate.constructor.name===k$||ir(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===k$)),uFe=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function T$(e,t,n){const r=$e(e,n);if(r||E2(n))return{error:r,name:n};const i=n.split(".");for(;i.length;){const s=i.join("."),o=$e(t,s),a=$e(e,s);if(o&&!Array.isArray(o)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};i.pop()}return{name:n}}var cFe=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:(n?r.isOnChange:i.isOnChange)?e:!0,dFe=(e,t)=>!yw($e(e,t)).length&&_r(e,t);const fFe={mode:so.onSubmit,reValidateMode:so.onChange,shouldFocusError:!0};function hFe(e={}){let t={...fFe,...e},n={submitCount:0,isDirty:!1,isLoading:Ao(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},i=ir(t.defaultValues)||ir(t.values)?Oi(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:Oi(i),o={action:!1,mount:!1,watch:!1},a={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},l,u=0;const f={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:QS(),array:QS(),state:QS()},p=b$(t.mode),m=b$(t.reValidateMode),v=t.criteriaMode===so.all,_=W=>ie=>{clearTimeout(u),u=setTimeout(W,ie)},w=async W=>{if(!t.disabled&&(f.isValid||W)){const ie=t.resolver?Di((await D()).errors):await A(r,!0);ie!==n.isValid&&d.state.next({isValid:ie})}},x=(W,ie)=>{!t.disabled&&(f.isValidating||f.validatingFields)&&((W||Array.from(a.mount)).forEach(ue=>{ue&&(ie?rn(n.validatingFields,ue,ie):_r(n.validatingFields,ue))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Di(n.validatingFields)}))},S=(W,ie=[],ue,Re,Ee=!0,xe=!0)=>{if(Re&&ue&&!t.disabled){if(o.action=!0,xe&&Array.isArray($e(r,W))){const ze=ue($e(r,W),Re.argA,Re.argB);Ee&&rn(r,W,ze)}if(xe&&Array.isArray($e(n.errors,W))){const ze=ue($e(n.errors,W),Re.argA,Re.argB);Ee&&rn(n.errors,W,ze),dFe(n.errors,W)}if(f.touchedFields&&xe&&Array.isArray($e(n.touchedFields,W))){const ze=ue($e(n.touchedFields,W),Re.argA,Re.argB);Ee&&rn(n.touchedFields,W,ze)}f.dirtyFields&&(n.dirtyFields=cp(i,s)),d.state.next({name:W,isDirty:j(W,ie),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else rn(s,W,ie)},C=(W,ie)=>{rn(n.errors,W,ie),d.state.next({errors:n.errors})},R=W=>{n.errors=W,d.state.next({errors:n.errors,isValid:!1})},P=(W,ie,ue,Re)=>{const Ee=$e(r,W);if(Ee){const xe=$e(s,W,er(ue)?$e(i,W):ue);er(xe)||Re&&Re.defaultChecked||ie?rn(s,W,ie?xe:JS(Ee._f)):H(W,xe),o.mount&&w()}},k=(W,ie,ue,Re,Ee)=>{let xe=!1,ze=!1;const Ze={name:W};if(!t.disabled){const he=!!($e(r,W)&&$e(r,W)._f&&$e(r,W)._f.disabled);if(!ue||Re){f.isDirty&&(ze=n.isDirty,n.isDirty=Ze.isDirty=j(),xe=ze!==Ze.isDirty);const we=he||Al($e(i,W),ie);ze=!!(!he&&$e(n.dirtyFields,W)),we||he?_r(n.dirtyFields,W):rn(n.dirtyFields,W,!0),Ze.dirtyFields=n.dirtyFields,xe=xe||f.dirtyFields&&ze!==!we}if(ue){const we=$e(n.touchedFields,W);we||(rn(n.touchedFields,W,ue),Ze.touchedFields=n.touchedFields,xe=xe||f.touchedFields&&we!==ue)}xe&&Ee&&d.state.next(Ze)}return xe?Ze:{}},I=(W,ie,ue,Re)=>{const Ee=$e(n.errors,W),xe=f.isValid&&ks(ie)&&n.isValid!==ie;if(t.delayError&&ue?(l=_(()=>C(W,ue)),l(t.delayError)):(clearTimeout(u),l=null,ue?rn(n.errors,W,ue):_r(n.errors,W)),(ue?!Al(Ee,ue):Ee)||!Di(Re)||xe){const ze={...Re,...xe&&ks(ie)?{isValid:ie}:{},errors:n.errors,name:W};n={...n,...ze},d.state.next(ze)}},D=async W=>{x(W,!0);const ie=await t.resolver(s,t.context,aFe(W||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return x(W),ie},L=async W=>{const{errors:ie}=await D(W);if(W)for(const ue of W){const Re=$e(ie,ue);Re?rn(n.errors,ue,Re):_r(n.errors,ue)}else n.errors=ie;return ie},A=async(W,ie,ue={valid:!0})=>{for(const Re in W){const Ee=W[Re];if(Ee){const{_f:xe,...ze}=Ee;if(xe){const Ze=a.array.has(xe.name),he=Ee._f&&lFe(Ee._f);he&&f.validatingFields&&x([Re],!0);const we=await C$(Ee,a.disabled,s,v,t.shouldUseNativeValidation&&!ie,Ze);if(he&&f.validatingFields&&x([Re]),we[xe.name]&&(ue.valid=!1,ie))break;!ie&&($e(we,xe.name)?Ze?rFe(n.errors,we,xe.name):rn(n.errors,xe.name,we[xe.name]):_r(n.errors,xe.name))}!Di(ze)&&await A(ze,ie,ue)}}return ue.valid},$=()=>{for(const W of a.unMount){const ie=$e(r,W);ie&&(ie._f.refs?ie._f.refs.every(ue=>!XS(ue)):!XS(ie._f.ref))&&ne(W)}a.unMount=new Set},j=(W,ie)=>!t.disabled&&(W&&ie&&rn(s,W,ie),!Al(q(),i)),V=(W,ie,ue)=>JZ(W,a,{...o.mount?s:er(ie)?i:Lo(W)?{[W]:ie}:ie},ue,ie),B=W=>yw($e(o.mount?s:i,W,t.shouldUnregister?$e(i,W,[]):[])),H=(W,ie,ue={})=>{const Re=$e(r,W);let Ee=ie;if(Re){const xe=Re._f;xe&&(!xe.disabled&&rn(s,W,oY(ie,xe)),Ee=jb(xe.ref)&&fi(ie)?"":ie,rY(xe.ref)?[...xe.ref.options].forEach(ze=>ze.selected=Ee.includes(ze.value)):xe.refs?Mg(xe.ref)?xe.refs.length>1?xe.refs.forEach(ze=>(!ze.defaultChecked||!ze.disabled)&&(ze.checked=Array.isArray(Ee)?!!Ee.find(Ze=>Ze===ze.value):Ee===ze.value)):xe.refs[0]&&(xe.refs[0].checked=!!Ee):xe.refs.forEach(ze=>ze.checked=ze.value===Ee):k2(xe.ref)?xe.ref.value="":(xe.ref.value=Ee,xe.ref.type||d.values.next({name:W,values:{...s}})))}(ue.shouldDirty||ue.shouldTouch)&&k(W,Ee,ue.shouldTouch,ue.shouldDirty,!0),ue.shouldValidate&&M(W)},te=(W,ie,ue)=>{for(const Re in ie){const Ee=ie[Re],xe=`${W}.${Re}`,ze=$e(r,xe);(a.array.has(W)||ir(Ee)||ze&&!ze._f)&&!ac(Ee)?te(xe,Ee,ue):H(xe,Ee,ue)}},G=(W,ie,ue={})=>{const Re=$e(r,W),Ee=a.array.has(W),xe=Oi(ie);rn(s,W,xe),Ee?(d.array.next({name:W,values:{...s}}),(f.isDirty||f.dirtyFields)&&ue.shouldDirty&&d.state.next({name:W,dirtyFields:cp(i,s),isDirty:j(W,xe)})):Re&&!Re._f&&!fi(xe)?te(W,xe,ue):H(W,xe,ue),_$(W,a)&&d.state.next({...n}),d.values.next({name:o.mount?W:void 0,values:{...s}})},Z=async W=>{o.mount=!0;const ie=W.target;let ue=ie.name,Re=!0;const Ee=$e(r,ue),xe=()=>ie.type?JS(Ee._f):WZ(W),ze=Ze=>{Re=Number.isNaN(Ze)||ac(Ze)&&isNaN(Ze.getTime())||Al(Ze,$e(s,ue,Ze))};if(Ee){let Ze,he;const we=xe(),We=W.type===Nb.BLUR||W.type===Nb.FOCUS_OUT,Et=!uFe(Ee._f)&&!t.resolver&&!$e(n.errors,ue)&&!Ee._f.deps||cFe(We,$e(n.touchedFields,ue),n.isSubmitted,m,p),jt=_$(ue,a,We);rn(s,ue,we),We?(Ee._f.onBlur&&Ee._f.onBlur(W),l&&l(0)):Ee._f.onChange&&Ee._f.onChange(W);const Sn=k(ue,we,We,!1),zi=!Di(Sn)||jt;if(!We&&d.values.next({name:ue,type:W.type,values:{...s}}),Et)return f.isValid&&(t.mode==="onBlur"&&We?w():We||w()),zi&&d.state.next({name:ue,...jt?{}:Sn});if(!We&&jt&&d.state.next({...n}),t.resolver){const{errors:En}=await D([ue]);if(ze(we),Re){const Vi=T$(n.errors,r,ue),Ui=T$(En,r,Vi.name||ue);Ze=Ui.error,ue=Ui.name,he=Di(En)}}else x([ue],!0),Ze=(await C$(Ee,a.disabled,s,v,t.shouldUseNativeValidation))[ue],x([ue]),ze(we),Re&&(Ze?he=!1:f.isValid&&(he=await A(r,!0)));Re&&(Ee._f.deps&&M(Ee._f.deps),I(ue,he,Ze,Sn))}},Y=(W,ie)=>{if($e(n.errors,ie)&&W.focus)return W.focus(),1},M=async(W,ie={})=>{let ue,Re;const Ee=om(W);if(t.resolver){const xe=await L(er(W)?W:Ee);ue=Di(xe),Re=W?!Ee.some(ze=>$e(xe,ze)):ue}else W?(Re=(await Promise.all(Ee.map(async xe=>{const ze=$e(r,xe);return await A(ze&&ze._f?{[xe]:ze}:ze)}))).every(Boolean),!(!Re&&!n.isValid)&&w()):Re=ue=await A(r);return d.state.next({...!Lo(W)||f.isValid&&ue!==n.isValid?{}:{name:W},...t.resolver||!W?{isValid:ue}:{},errors:n.errors}),ie.shouldFocus&&!Re&&am(r,Y,W?Ee:a.mount),Re},q=W=>{const ie={...o.mount?s:i};return er(W)?ie:Lo(W)?$e(ie,W):W.map(ue=>$e(ie,ue))},z=(W,ie)=>({invalid:!!$e((ie||n).errors,W),isDirty:!!$e((ie||n).dirtyFields,W),error:$e((ie||n).errors,W),isValidating:!!$e(n.validatingFields,W),isTouched:!!$e((ie||n).touchedFields,W)}),N=W=>{W&&om(W).forEach(ie=>_r(n.errors,ie)),d.state.next({errors:W?n.errors:{}})},ee=(W,ie,ue)=>{const Re=($e(r,W,{_f:{}})._f||{}).ref,Ee=$e(n.errors,W)||{},{ref:xe,message:ze,type:Ze,...he}=Ee;rn(n.errors,W,{...he,...ie,ref:Re}),d.state.next({name:W,errors:n.errors,isValid:!1}),ue&&ue.shouldFocus&&Re&&Re.focus&&Re.focus()},X=(W,ie)=>Ao(W)?d.values.subscribe({next:ue=>W(V(void 0,ie),ue)}):V(W,ie,!0),ne=(W,ie={})=>{for(const ue of W?om(W):a.mount)a.mount.delete(ue),a.array.delete(ue),ie.keepValue||(_r(r,ue),_r(s,ue)),!ie.keepError&&_r(n.errors,ue),!ie.keepDirty&&_r(n.dirtyFields,ue),!ie.keepTouched&&_r(n.touchedFields,ue),!ie.keepIsValidating&&_r(n.validatingFields,ue),!t.shouldUnregister&&!ie.keepDefaultValue&&_r(i,ue);d.values.next({values:{...s}}),d.state.next({...n,...ie.keepDirty?{isDirty:j()}:{}}),!ie.keepIsValid&&w()},ae=({disabled:W,name:ie,field:ue,fields:Re})=>{(ks(W)&&o.mount||W||a.disabled.has(ie))&&(W?a.disabled.add(ie):a.disabled.delete(ie),k(ie,JS(ue?ue._f:$e(Re,ie)._f),!1,!1,!0))},se=(W,ie={})=>{let ue=$e(r,W);const Re=ks(ie.disabled)||ks(t.disabled);return rn(r,W,{...ue||{},_f:{...ue&&ue._f?ue._f:{ref:{name:W}},name:W,mount:!0,...ie}}),a.mount.add(W),ue?ae({field:ue,disabled:ks(ie.disabled)?ie.disabled:t.disabled,name:W}):P(W,!0,ie.value),{...Re?{disabled:ie.disabled||t.disabled}:{},...t.progressive?{required:!!ie.required,min:dp(ie.min),max:dp(ie.max),minLength:dp(ie.minLength),maxLength:dp(ie.maxLength),pattern:dp(ie.pattern)}:{},name:W,onChange:Z,onBlur:Z,ref:Ee=>{if(Ee){se(W,ie),ue=$e(r,W);const xe=er(Ee.value)&&Ee.querySelectorAll&&Ee.querySelectorAll("input,select,textarea")[0]||Ee,ze=oFe(xe),Ze=ue._f.refs||[];if(ze?Ze.find(he=>he===xe):xe===ue._f.ref)return;rn(r,W,{_f:{...ue._f,...ze?{refs:[...Ze.filter(XS),xe,...Array.isArray($e(i,W))?[{}]:[]],ref:{type:xe.type,name:W}}:{ref:xe}}}),P(W,!1,void 0,xe)}else ue=$e(r,W,{}),ue._f&&(ue._f.mount=!1),(t.shouldUnregister||ie.shouldUnregister)&&!(GZ(a.array,W)&&o.action)&&a.unMount.add(W)}}},ce=()=>t.shouldFocusError&&am(r,Y,a.mount),fe=W=>{ks(W)&&(d.state.next({disabled:W}),am(r,(ie,ue)=>{const Re=$e(r,ue);Re&&(ie.disabled=Re._f.disabled||W,Array.isArray(Re._f.refs)&&Re._f.refs.forEach(Ee=>{Ee.disabled=Re._f.disabled||W}))},0,!1))},ke=(W,ie)=>async ue=>{let Re;ue&&(ue.preventDefault&&ue.preventDefault(),ue.persist&&ue.persist());let Ee=Oi(s);if(a.disabled.size)for(const xe of a.disabled)rn(Ee,xe,void 0);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:xe,values:ze}=await D();n.errors=xe,Ee=ze}else await A(r);if(_r(n.errors,"root"),Di(n.errors)){d.state.next({errors:{}});try{await W(Ee,ue)}catch(xe){Re=xe}}else ie&&await ie({...n.errors},ue),ce(),setTimeout(ce);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Di(n.errors)&&!Re,submitCount:n.submitCount+1,errors:n.errors}),Re)throw Re},Ce=(W,ie={})=>{$e(r,W)&&(er(ie.defaultValue)?G(W,Oi($e(i,W))):(G(W,ie.defaultValue),rn(i,W,Oi(ie.defaultValue))),ie.keepTouched||_r(n.touchedFields,W),ie.keepDirty||(_r(n.dirtyFields,W),n.isDirty=ie.defaultValue?j(W,Oi($e(i,W))):j()),ie.keepError||(_r(n.errors,W),f.isValid&&w()),d.state.next({...n}))},Se=(W,ie={})=>{const ue=W?Oi(W):i,Re=Oi(ue),Ee=Di(W),xe=Ee?i:Re;if(ie.keepDefaultValues||(i=ue),!ie.keepValues){if(ie.keepDirtyValues){const ze=new Set([...a.mount,...Object.keys(cp(i,s))]);for(const Ze of Array.from(ze))$e(n.dirtyFields,Ze)?rn(xe,Ze,$e(s,Ze)):G(Ze,$e(xe,Ze))}else{if(S2&&er(W))for(const ze of a.mount){const Ze=$e(r,ze);if(Ze&&Ze._f){const he=Array.isArray(Ze._f.refs)?Ze._f.refs[0]:Ze._f.ref;if(jb(he)){const we=he.closest("form");if(we){we.reset();break}}}}r={}}s=t.shouldUnregister?ie.keepDefaultValues?Oi(i):{}:Oi(xe),d.array.next({values:{...xe}}),d.values.next({values:{...xe}})}a={mount:ie.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!f.isValid||!!ie.keepIsValid||!!ie.keepDirtyValues,o.watch=!!t.shouldUnregister,d.state.next({submitCount:ie.keepSubmitCount?n.submitCount:0,isDirty:Ee?!1:ie.keepDirty?n.isDirty:!!(ie.keepDefaultValues&&!Al(W,i)),isSubmitted:ie.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Ee?{}:ie.keepDirtyValues?ie.keepDefaultValues&&s?cp(i,s):n.dirtyFields:ie.keepDefaultValues&&W?cp(i,W):ie.keepDirty?n.dirtyFields:{},touchedFields:ie.keepTouched?n.touchedFields:{},errors:ie.keepErrors?n.errors:{},isSubmitSuccessful:ie.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Fe=(W,ie)=>Se(Ao(W)?W(s):W,ie);return{control:{register:se,unregister:ne,getFieldState:z,handleSubmit:ke,setError:ee,_executeSchema:D,_getWatch:V,_getDirty:j,_updateValid:w,_removeUnmounted:$,_updateFieldArray:S,_updateDisabledField:ae,_getFieldArray:B,_reset:Se,_resetDefaultValues:()=>Ao(t.defaultValues)&&t.defaultValues().then(W=>{Fe(W,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:W=>{n={...n,...W}},_disableForm:fe,_subjects:d,_proxyFormState:f,_setErrors:R,get _fields(){return r},get _formValues(){return s},get _state(){return o},set _state(W){o=W},get _defaultValues(){return i},get _names(){return a},set _names(W){a=W},get _formState(){return n},set _formState(W){n=W},get _options(){return t},set _options(W){t={...t,...W}}},trigger:M,register:se,handleSubmit:ke,watch:X,setValue:G,getValues:q,reset:Fe,resetField:Ce,clearErrors:N,unregister:ne,setError:ee,setFocus:(W,ie={})=>{const ue=$e(r,W),Re=ue&&ue._f;if(Re){const Ee=Re.refs?Re.refs[0]:Re.ref;Ee.focus&&(Ee.focus(),ie.shouldSelect&&Ao(Ee.select)&&Ee.select())}},getFieldState:z}}function pFe(e={}){const t=ve.useRef(void 0),n=ve.useRef(void 0),[r,i]=ve.useState({isDirty:!1,isValidating:!1,isLoading:Ao(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Ao(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...hFe(e),formState:r});const s=t.current.control;return s._options=e,C2({subject:s._subjects.state,next:o=>{QZ(o,s._proxyFormState,s._updateFormState,!0)&&i({...s._formState})}}),ve.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),ve.useEffect(()=>{if(s._proxyFormState.isDirty){const o=s._getDirty();o!==r.isDirty&&s._subjects.state.next({isDirty:o})}},[s,r.isDirty]),ve.useEffect(()=>{e.values&&!Al(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,i(o=>({...o}))):s._resetDefaultValues()},[e.values,s]),ve.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),ve.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),ve.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=YZ(r,s),t.current}const P$=(e,t,n)=>{if(e&&"reportValidity"in e){const r=$e(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},aY=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?P$(r.ref,n,e):r.refs&&r.refs.forEach(i=>P$(i,n,e))}},mFe=(e,t)=>{t.shouldUseNativeValidation&&aY(e,t);const n={};for(const r in e){const i=$e(t.fields,r),s=Object.assign(e[r]||{},{ref:i&&i.ref});if(gFe(t.names||Object.keys(e),r)){const o=Object.assign({},$e(n,r));rn(o,"root",s),rn(n,r,o)}else rn(n,r,s)}return n},gFe=(e,t)=>e.some(n=>n.startsWith(t+"."));var vFe=function(e,t){for(var n={};e.length;){var r=e[0],i=r.code,s=r.message,o=r.path.join(".");if(!n[o])if("unionErrors"in r){var a=r.unionErrors[0].errors[0];n[o]={message:a.message,type:a.code}}else n[o]={message:s,type:i};if("unionErrors"in r&&r.unionErrors.forEach(function(f){return f.errors.forEach(function(d){return e.push(d)})}),t){var l=n[o].types,u=l&&l[r.code];n[o]=eY(o,t,n,i,u?[].concat(u,r.message):r.message)}e.shift()}return n},yFe=function(e,t,n){return n===void 0&&(n={}),function(r,i,s){try{return Promise.resolve((function(o,a){try{var l=Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(u){return s.shouldUseNativeValidation&&aY({},s),{errors:{},values:n.raw?r:u}})}catch(u){return a(u)}return l&&l.then?l.then(void 0,a):l})(0,function(o){if((function(a){return Array.isArray(a?.errors)})(o))return{values:{},errors:mFe(vFe(o.errors,!s.shouldUseNativeValidation&&s.criteriaMode==="all"),s)};throw o}))}catch(o){return Promise.reject(o)}}},Jt;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const s={};for(const o of i)s[o]=o;return s},e.getValidEnumValues=i=>{const s=e.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(const a of s)o[a]=i[a];return e.objectValues(o)},e.objectValues=i=>e.objectKeys(i).map(function(s){return i[s]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const s=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&s.push(o);return s},e.find=(i,s)=>{for(const o of i)if(s(o))return o}
vendor: 15,888 bytes, line 153
153,e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,s=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(i,s)=>typeof s=="bigint"?s.toString():s})(Jt||(Jt={}));var R$;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(R$||(R$={}));const rt=Jt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pl=e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return Number.isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},Me=Jt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Va extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(s){return s.message},r={_errors:[]},i=s=>{for(const o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return i(this),r}static assert(t){if(!(t instanceof Va))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const s=i.path[0];n[s]=n[s]||[],n[s].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Va.create=e=>new Va(e);const uT=(e,t)=>{let n;switch(e.code){case Me.invalid_type:e.received===rt.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Me.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Jt.jsonStringifyReplacer)}`;break;case Me.unrecognized_keys:n=`Unrecognized key(s) in object: ${Jt.joinValues(e.keys,", ")}`;break;case Me.invalid_union:n="Invalid input";break;case Me.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Jt.joinValues(e.options)}`;break;case Me.invalid_enum_value:n=`Invalid enum value. Expected ${Jt.joinValues(e.options)}, received '${e.received}'`;break;case Me.invalid_arguments:n="Invalid function arguments";break;case Me.invalid_return_type:n="Invalid function return type";break;case Me.invalid_date:n="Invalid date";break;case Me.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Jt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Me.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Me.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Me.custom:n="Invalid input";break;case Me.invalid_intersection_types:n="Intersection results could not be merged";break;case Me.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Me.not_finite:n="Number must be finite";break;default:n=t.defaultError,Jt.assertNever(e)}return{message:n}};let bFe=uT;function _Fe(){return bFe}const wFe=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,s=[...n,...i.path||[]],o={...i,path:s};if(i.message!==void 0)return{...i,path:s,message:i.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...i,path:s,message:a}};function qe(e,t){const n=_Fe(),r=wFe({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===uT?void 0:uT].filter(i=>!!i)});e.common.issues.push(r)}class ss{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return Pt;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const s=await i.key,o=await i.value;r.push({key:s,value:o})}return ss.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:s,value:o}=i;if(s.status==="aborted"||o.status==="aborted")return Pt;s.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),s.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[s.value]=o.value)}return{status:t.value,value:r}}}const Pt=Object.freeze({status:"aborted"}),Hp=e=>({status:"dirty",value:e}),Us=e=>({status:"valid",value:e}),I$=e=>e.status==="aborted",O$=e=>e.status==="dirty",Gf=e=>e.status==="valid",$b=e=>typeof Promise<"u"&&e instanceof Promise;var lt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(lt||(lt={}));class eu{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const D$=(e,t)=>{if(Gf(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Va(e.common.issues);return this._error=n,this._error}}};function zt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>{const{message:l}=e;return o.code==="invalid_enum_value"?{message:l??a.defaultError}:typeof a.data>"u"?{message:l??r??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:l??n??a.defaultError}},description:i}}class Qt{get description(){return this._def.description}_getType(t){return Pl(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Pl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ss,ctx:{common:t.parent.common,data:t.data,parsedType:Pl(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if($b(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pl(t)},i=this._parseSync({data:t,path:r.path,parent:r});return D$(r,i)}"~validate"(t){const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pl(t)};if(!this["~standard"].async)try{const r=this._parseSync({data:t,path:[],parent:n});return Gf(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(r=>Gf(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Pl(t)},i=this._parse({data:t,path:r.path,parent:r}),s=await($b(i)?i:Promise.resolve(i));return D$(r,s)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,s)=>{const o=t(i),a=()=>s.addIssue({code:Me.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Zf({schema:this,typeName:Rt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return ql.create(this,this._def)}nullable(){return Yf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Wo.create(this)}promise(){return Bb.create(this,this._def)}or(t){return Vb.create([this,t],this._def)}and(t){return Ub.create(this,t,this._def)}transform(t){return new Zf({...zt(this._def),schema:this,typeName:Rt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new fT({...zt(this._def),innerType:this,defaultValue:n,typeName:Rt.ZodDefault})}brand(){return new HFe({typeName:Rt.ZodBranded,type:this,...zt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new hT({...zt(this._def),innerType:this,catchValue:n,typeName:Rt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return P2.create(this,t)}readonly(){return pT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const xFe=/^c[^\s-]{8,}$/i,SFe=/^[0-9a-z]+$/,EFe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,CFe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,kFe=/^[a-z0-9_-]{21}$/i,TFe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PFe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,RFe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,IFe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let eE;const OFe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,DFe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,AFe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,MFe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,NFe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jFe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,lY="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",LFe=new RegExp(`^${lY}$`);function uY(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function FFe(e){return new RegExp(`^${uY(e)}$`)}function $Fe(e){let t=`${lY}
153T${uY(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function zFe(e,t){return!!((t==="v4"||!t)&&OFe.test(e)||(t==="v6"||!t)&&AFe.test(e))}function VFe(e,t){if(!TFe.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function UFe(e,t){return!!((t==="v4"||!t)&&DFe.test(e)||(t==="v6"||!t)&&MFe.test(e))}class Ll extends Qt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==rt.string){const s=this._getOrReturnCtx(t);return qe(s,{code:Me.invalid_type,expected:rt.string,received:s.parsedType}),Pt}const r=new ss;let i;for(const s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")t.data.length>s.value&&(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){const o=t.data.length>s.value,a=t.data.length<s.value;(o||a)&&(i=this._getOrReturnCtx(t,i),o?qe(i,{code:Me.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&qe(i,{code:Me.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")RFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"email",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")eE||(eE=new RegExp(IFe,"u")),eE.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"emoji",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")CFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"uuid",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")kFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"nanoid",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")xFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"cuid",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")SFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"cuid2",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")EFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"ulid",code:Me.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),qe(i,{validation:"url",code:Me.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"regex",code:Me.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="includes"?t.data.includes(s.value,s.position)||(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?t.data=t.data.toLowerCase():s.kind==="toUpperCase"?t.data=t.data.toUpperCase():s.kind==="startsWith"?t.data.startsWith(s.value)||(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?$Fe(s).test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?LFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?FFe(s).test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?PFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"duration",code:Me.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?zFe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"ip",code:Me.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?VFe(t.data,s.alg)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"jwt",code:Me.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?UFe(t.data,s.version)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"cidr",code:Me.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?NFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"base64",code:Me.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?jFe.test(t.data)||(i=this._getOrReturnCtx(t,i),qe(i,{validation:"base64url",code:Me.invalid_string,message:s.message}),r.dirty()):Jt.assertNever(s);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:Me.invalid_string,...lt.errToObj(r)})}_addCheck(t){return new Ll({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...lt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...lt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...lt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...lt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...lt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...lt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...lt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...lt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...lt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...lt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...lt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...lt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...lt.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...lt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...lt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...lt.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...lt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...lt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...lt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...lt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...lt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...lt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...lt.errToObj(n)})}nonempty(t){return this.min(1,lt.errToObj(t))}trim(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ll({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}
vendor: 26,797 bytes, line 153
153get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Ll.create=e=>new Ll({checks:[],typeName:Rt.ZodString,coerce:e?.coerce??!1,...zt(e)});function BFe(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,s=Number.parseInt(e.toFixed(i).replace(".","")),o=Number.parseInt(t.toFixed(i).replace(".",""));return s%o/10**i}class qm extends Qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==rt.number){const s=this._getOrReturnCtx(t);return qe(s,{code:Me.invalid_type,expected:rt.number,received:s.parsedType}),Pt}let r;const i=new ss;for(const s of this._def.checks)s.kind==="int"?Jt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.invalid_type,expected:"integer",received:"float",message:s.message}),i.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),i.dirty()):s.kind==="multipleOf"?BFe(t.data,s.value)!==0&&(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.not_finite,message:s.message}),i.dirty()):Jt.assertNever(s);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,lt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,lt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,lt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,lt.toString(n))}setLimit(t,n,r,i){return new qm({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:lt.toString(i)}]})}_addCheck(t){return new qm({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:lt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:lt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:lt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:lt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:lt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:lt.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Jt.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}qm.create=e=>new qm({checks:[],typeName:Rt.ZodNumber,coerce:e?.coerce||!1,...zt(e)});class Wm extends Qt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==rt.bigint)return this._getInvalidInput(t);let r;const i=new ss;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),i.dirty()):s.kind==="multipleOf"?t.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),qe(r,{code:Me.not_multiple_of,multipleOf:s.value,message:s.message}),i.dirty()):Jt.assertNever(s);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return qe(n,{code:Me.invalid_type,expected:rt.bigint,received:n.parsedType}),Pt}gte(t,n){return this.setLimit("min",t,!0,lt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,lt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,lt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,lt.toString(n))}setLimit(t,n,r,i){return new Wm({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:lt.toString(i)}]})}_addCheck(t){return new Wm({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:lt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:lt.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}Wm.create=e=>new Wm({checks:[],typeName:Rt.ZodBigInt,coerce:e?.coerce??!1,...zt(e)});class A$ extends Qt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==rt.boolean){const r=this._getOrReturnCtx(t);return qe(r,{code:Me.invalid_type,expected:rt.boolean,received:r.parsedType}),Pt}return Us(t.data)}}A$.create=e=>new A$({typeName:Rt.ZodBoolean,coerce:e?.coerce||!1,...zt(e)});class zb extends Qt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==rt.date){const s=this._getOrReturnCtx(t);return qe(s,{code:Me.invalid_type,expected:rt.date,received:s.parsedType}),Pt}if(Number.isNaN(t.data.getTime())){const s=this._getOrReturnCtx(t);return qe(s,{code:Me.invalid_date}),Pt}const r=new ss;let i;for(const s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(i=this._getOrReturnCtx(t,i),qe(i,{code:Me.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):Jt.assertNever(s);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new zb({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:lt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:lt.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}zb.create=e=>new zb({checks:[],coerce:e?.coerce||!1,typeName:Rt.ZodDate,...zt(e)});class M$ extends Qt{_parse(t){if(this._getType(t)!==rt.symbol){const r=this._getOrReturnCtx(t);return qe(r,{code:Me.invalid_type,expected:rt.symbol,received:r.parsedType}),Pt}return Us(t.data)}}M$.create=e=>new M$({typeName:Rt.ZodSymbol,...zt(e)});class N$ extends Qt{_parse(t){if(this._getType(t)!==rt.undefined){const r=this._getOrReturnCtx(t);return qe(r,{code:Me.invalid_type,expected:rt.undefined,received:r.parsedType}),Pt}return Us(t.data)}}N$.create=e=>new N$({typeName:Rt.ZodUndefined,...zt(e)});class j$ extends Qt{_parse(t){if(this._getType(t)!==rt.null){const r=this._getOrReturnCtx(t);return qe(r,{code:Me.invalid_type,expected:rt.null,received:r.parsedType}),Pt}return Us(t.data)}}j$.create=e=>new j$({typeName:Rt.ZodNull,...zt(e)});class L$ extends Qt{constructor(){super(...arguments),this._any=!0}_parse(t){return Us(t.data)}}L$.create=e=>new L$({typeName:Rt.ZodAny,...zt(e)});class F$ extends Qt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Us(t.data)}}F$.create=e=>new F$({typeName:Rt.ZodUnknown,...zt(e)});class tu extends Qt{_parse(t){const n=this._getOrReturnCtx(t);return qe(n,{code:Me.invalid_type,expected:rt.never,received:n.parsedType}),Pt}}tu.create=e=>new tu({typeName:Rt.ZodNever,...zt(e)});class $$ extends Qt{_parse(t){if(this._getType(t)!==rt.undefined){const r=this._getOrReturnCtx(t);return qe(r,{code:Me.invalid_type,expected:rt.void,received:r.parsedType}),Pt}return Us(t.data)}}$$.create=e=>new $$({typeName:Rt.ZodVoid,...zt(e)});class Wo extends Qt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==rt.array)return qe(n,{code:Me.invalid_type,expected:rt.array,received:n.parsedType}),Pt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,a=n.data.length<i.exactLength.value;(o||a)&&(qe(n,{code:o?Me.too_big:Me.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(qe(n,{code:Me.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(qe(n,{code:Me.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>i.type._parseAsync(new eu(n,o,n.path,a)))).then(o=>ss.mergeArray(r,o));const s=[...n.data].map((o,a)=>i.type._parseSync(new eu(n,o,n.path,a)));return ss.mergeArray(r,s)}get element(){return this._def.type}min(t,n){return new Wo({...this._def,minLength:{value:t,message:lt.toString(n)}})}max(t,n){return new Wo({...this._def,maxLength:{value:t,message:lt.toString(n)}})}length(t,n){return new Wo({...this._def,exactLength:{value:t,message:lt.toString(n)}})}nonempty(t){return this.min(1,t)}}Wo.create=(e,t)=>new Wo({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Rt.ZodArray,...zt(t)});function Yd(e){if(e instanceof cr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=ql.create(Yd(r))}return new cr({...e._def,shape:()=>t})}else return e instanceof Wo?new Wo({...e._def,type:Yd(e.element)}):e instanceof ql?ql.create(Yd(e.unwrap())):e instanceof Yf?Yf.create(Yd(e.unwrap())):e instanceof Rc?Rc.create(e.items.map(t=>Yd(t))):e}class cr extends Qt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Jt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==rt.object){const u=this._getOrReturnCtx(t);return qe(u,{code:Me.invalid_type,expected:rt.object,received:u.parsedType}),Pt}const{status:r,ctx:i}=this._processInputParams(t),{shape:s,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof tu&&this._def.unknownKeys==="strip"))for(const u in i.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const f=s[u],d=i.data[u];l.push({key:{status:"valid",value:u},value:f._parse(new eu(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof tu){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of a)l.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")a.length>0&&(qe(i,{code:Me.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of a){const d=i.data[f];l.push({key:{status:"valid",value:f},value:u._parse(new eu(i,d,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of l){const d=await f.key,p=await f.value;u.push({key:d,value:p,alwaysSet:f.alwaysSet})}return u}).then(u=>ss.mergeObjectSync(r,u)):ss.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return lt.errToObj,new cr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{const i=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:lt.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new cr({...this._def,unknownKeys:"strip"})}passthrough(){return new cr({...this._def,unknownKeys:"passthrough"})}extend(t){return new cr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new cr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Rt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new cr({...this._def,catchall:t})}pick(t){const n={};for(const r of Jt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new cr({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Jt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new cr({...this._def,shape:()=>n})}deepPartial(){return Yd(this)}partial(t){const n={};for(const r of Jt.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new cr({...this._def,shape:()=>n})}required(t){const n={};for(const r of Jt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof ql;)s=s._def.innerType;n[r]=s}return new cr({...this._def,shape:()=>n})}keyof(){return cY(Jt.objectKeys(this.shape))}}cr.create=(e,t)=>new cr({shape:()=>e,unknownKeys:"strip",catchall:tu.create(),typeName:Rt.ZodObject,...zt(t)});cr.strictCreate=(e,t)=>new cr({shape:()=>e,unknownKeys:"strict",catchall:tu.create(),typeName:Rt.ZodObject,...zt(t)});cr.lazycreate=(e,t)=>new cr({shape:e,unknownKeys:"strip",catchall:tu.create(),typeName:Rt.ZodObject,...zt(t)});class Vb extends Qt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(s){for(const a of s)if(a.result.status==="valid")return a.result;for(const a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=s.map(a=>new Va(a.ctx.common.issues));return qe(n,{code:Me.invalid_union,unionErrors:o}),Pt}if(n.common.async)return Promise.all(r.map(async s=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let s;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},f=l._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!s&&(s={result:f,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(l=>new Va(l));return qe(n,{code:Me.invalid_union,unionErrors:a}),Pt}}get options(){return this._def.options}}Vb.create=(e,t)=>new Vb({options:e,typeName:Rt.ZodUnion,...zt(t)});function cT(e,t){const n=Pl(e),r=Pl(t);if(e===t)return{valid:!0,data:e};if(n===rt.object&&r===rt.object){const i=Jt.objectKeys(t),s=Jt.objectKeys(e).filter(a=>i.indexOf(a)!==-1),o={...e,...t};for(const a of s){const l=cT(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===rt.array&&r===rt.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s],l=cT(o,a);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===rt.date&&r===rt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ub extends Qt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(s,o)=>{if(I$(s)||I$(o))return Pt;const a=cT(s.value,o.value);return a.valid?((O$(s)||O$(o))&&n.dirty(),{status:n.value,value:a.data}):(qe(r,{code:Me.invalid_intersection_types}),Pt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>i(s,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ub.create=(e,t,n)=>new Ub({left:e,right:t,typeName:Rt.ZodIntersection,...zt(n)});class Rc extends Qt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.array)return qe(r,{code:Me.invalid_type,expected:rt.array,received:r.parsedType}),Pt;if(r.data.length<this._def.items.length)return qe(r,{code:Me.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Pt;!this._def.rest&&r.data.length>this._def.items.length&&(qe(r,{code:Me.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const s=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new eu(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>ss.mergeArray(n,o)):ss.mergeArray(n,s)}get items(){return this._def.items}rest(t){return new Rc({...this._def,rest:t})}}Rc.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rc({items:e,typeName:Rt.ZodTuple,rest:null,...zt(t)})};class z$ extends Qt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.map)return qe(r,{code:Me.invalid_type,expected:rt.map,received:r.parsedType}),Pt;const i=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:i._parse(new eu(r,a,r.path,[u,"key"])),value:s._parse(new eu(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,f=await l.value;if(u.status==="aborted"||f.status==="aborted")return Pt;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(u.value,f.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,f=l.value;if(u.status==="aborted"||f.status==="aborted")return Pt;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),a.set(u.value,f.value)}return{status:n.value,value:a}}}}z$.create=(e,t,n)=>new z$({valueType:t,keyType:e,typeName:Rt.ZodMap,...zt(n)});class Gm extends Qt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==rt.set)return qe(r,{code:Me.invalid_type,expected:rt.set,received:r.parsedType}),Pt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(qe(r,{code:Me.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(qe(r,{code:Me.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const s=this._def.valueType;function o(l){const u=new Set;for(const f of l){if(f.status==="aborted")return Pt;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>s._parse(new eu(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Gm({...this._def,minSize:{value:t,message:lt.toString(n)}})}max(t,n){return new Gm({...this._def,maxSize:{value:t,message:lt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Gm.create=(e,t)=>new Gm({valueType:e,minSize:null,maxSize:null,typeName:Rt.ZodSet,...zt(t)});class V$ extends Qt{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}V$.create=(e,t)=>new V$({getter:e,typeName:Rt.ZodLazy,...zt(t)});class dT extends Qt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return qe(n,{received:n.data,code:Me.invalid_literal,expected:this._def.value}),Pt}return{status:"valid",value:t.data}}get value(){return this._def.value}}dT.create=(e,t)=>new dT({value:e,typeName:Rt.ZodLiteral,...zt(t)});function cY(e,t){return new Kf({values:e,typeName:Rt.ZodEnum,...zt(t)})}class Kf extends Qt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return qe(n,{expected:Jt.joinValues(r),received:n.parsedType,code:Me.invalid_type}),Pt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return qe(n,{received:n.data,code:Me.invalid_enum_value,options:r}),Pt}return Us(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Kf.create(t,{...this._def,...n})}exclude(t,n=this._def){return Kf.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Kf.create=cY;class U$ extends Qt{_parse(t){const n=Jt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){const i=Jt.objectValues(n);return qe(r,{expected:Jt.joinValues(i),received:r.parsedType,code:Me.invalid_type}),Pt}if(this._cache||(this._cache=new Set(Jt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=Jt.objectValues(n);return qe(r,{received:r.data,code:Me.invalid_enum_value,options:i}),Pt}return Us(t.data)}get enum(){return this._def.values}}U$.create=(e,t)=>new U$({values:e,typeName:Rt.ZodNativeEnum,...zt(t)});class Bb extends Qt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==rt.promise&&n.common.async===!1)return qe(n,{code:Me.invalid_type,expected:rt.promise,received:n.parsedType}),Pt;const r=n.parsedType===rt.promise?n.data:Promise.resolve(n.data);return Us(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Bb.create=(e,t)=>new Bb({type:e,typeName:Rt.ZodPromise,...zt(t)});class Zf extends Qt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Rt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,s={addIssue:o=>{qe(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),i.type==="preprocess"){const o=i.transform(r.data,s);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return Pt;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?Pt:l.status==="dirty"||n.value==="dirty"?Hp(l.value):l});{if(n.value==="aborted")return Pt;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?Pt:a.status==="dirty"||n.value==="dirty"?Hp(a.value):a}}if(i.type==="refinement"){const o=a=>{const l=i.refinement(a,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Pt:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Pt:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Gf(o))return Pt;const a=i.transform(o.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Gf(o)?Promise.resolve(i.transform(o.value,s)).then(a=>({status:n.value,value:a})):Pt);Jt.assertNever(i)}}Zf.create=(e,t,n)=>new Zf({schema:e,typeName:Rt.ZodEffects,effect:t,...zt(n)});Zf.createWithPreprocess=(e,t,n)=>new Zf({schema:t,effect:{type:"preprocess",transform:e},typeName:Rt.ZodEffects,...zt(n)});class ql extends Qt{_parse(t){return this._getType(t)===rt.undefined?Us(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ql.create=(e,t)=>new ql({innerType:e,typeName:Rt.ZodOptional,...zt(t)});class Yf extends Qt{_parse(t){return this._getType(t)===rt.null?Us(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Yf.create=(e,t)=>new Yf({innerType:e,typeName:Rt.ZodNullable,...zt(t)});class fT extends Qt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}fT.create=(e,t)=>new fT({innerType:e,typeName:Rt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zt(t)});class hT extends Qt{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return $b(i)?i.then(s=>
153({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Va(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Va(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}hT.create=(e,t)=>new hT({innerType:e,typeName:Rt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...zt(t)});class B$ extends Qt{_parse(t){if(this._getType(t)!==rt.nan){const r=this._getOrReturnCtx(t);return qe(r,{code:Me.invalid_type,expected:rt.nan,received:r.parsedType}),Pt}return{status:"valid",value:t.data}}}B$.create=e=>new B$({typeName:Rt.ZodNaN,...zt(e)});class HFe extends Qt{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class P2 extends Qt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Pt:s.status==="dirty"?(n.dirty(),Hp(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Pt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new P2({in:t,out:n,typeName:Rt.ZodPipeline})}}class pT extends Qt{_parse(t){const n=this._def.innerType._parse(t),r=i=>(Gf(i)&&(i.value=Object.freeze(i.value)),i);return $b(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}pT.create=(e,t)=>new pT({innerType:e,typeName:Rt.ZodReadonly,...zt(t)});var Rt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Rt||(Rt={}));const H$=Ll.create;tu.create;Wo.create;const qFe=cr.create;Vb.create;Ub.create;Rc.create;const Aqe=dT.create,Mqe=Kf.create;Bb.create;ql.create;Yf.create;async function WFe(e=1,t=10){return(await et(`/collections/?page=${e}&per_page=${t}`)).data||[]}const GFe=(e=1,t=50)=>{const{data:n,isLoading:r,error:i}=hr({queryKey:["collections"],queryFn:()=>WFe(e,t)});return{collections:n,isLoading:r,error:i}},KFe=XLe,dY=b.createContext({}),q$=({...e})=>g.jsx(dY.Provider,{value:{name:e.name},children:g.jsx(nFe,{...e})}),_w=()=>{const e=b.useContext(dY),t=b.useContext(fY),{getFieldState:n,formState:r}=bw(),i=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:s}=t;return{id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...i}},fY=b.createContext({}),mT=b.forwardRef(({className:e,...t},n)=>{const r=b.useId();return g.jsx(fY.Provider,{value:{id:r},children:g.jsx("div",{ref:n,className:_e("space-y-2",e),...t})})});mT.displayName="FormItem";const gT=b.forwardRef(({className:e,...t},n)=>{const{error:r,formItemId:i}=_w();return g.jsx(sm,{ref:n,className:_e(r&&"text-destructive",e),htmlFor:i,...t})});gT.displayName="FormLabel";const vT=b.forwardRef(({...e},t)=>{const{error:n,formItemId:r,formDescriptionId:i,formMessageId:s}=_w();return g.jsx(XP,{ref:t,id:r,"aria-describedby":n?`${i} ${s}`:`${i}`,"aria-invalid":!!n,...e})});vT.displayName="FormControl";const ZFe=b.forwardRef(({className:e,...t},n)=>{const{formDescriptionId:r}=_w();return g.jsx("p",{ref:n,id:r,className:_e("text-[0.8rem] text-muted-foreground",e),...t})});ZFe.displayName="FormDescription";const hY=b.forwardRef(({className:e,children:t,...n},r)=>{const{error:i,formMessageId:s}=_w(),o=i?String(i?.message):t;return o?g.jsx("p",{ref:r,id:s,className:_e("text-[0.8rem] font-medium text-destructive",e),...n,children:o}):null});hY.displayName="FormMessage";const YFe=qFe({url:H$().url({message:"A valid URL is required."}),collection_id:H$().optional()}),QFe={},XFe=({link:e,closeDialog:t,onComplete:n})=>{const{collections:r,isLoading:i}=GFe(),s=JIe(),o=MG(),a=BT(),l=async d=>{try{const p={};e?p.id=e.id:p.url=d.url.trim(),d.collection_id&&d.collection_id!=="-1"&&(p.c
153ollection={id:d.collection_id}),e?(p.id=e.id,await o.mutateAsync(p)):await s.mutateAsync(p),n(),df({title:`Successfully ${e?"updated":"created"} link`}),t()}catch(p){console.error(p),df({title:`Error ${e?"updating":"creating"} link`,variant:"destructive"})}},u=pFe({resolver:yFe(YFe),defaultValues:{...QFe,url:e?e.url:"",collection_id:e?.collection?.id?e?.collection?.id.toString():a?.id||"-1"}});function f(d){l(d)}return i?g.jsx(I2e,{}):g.jsx(KFe,{...u,children:g.jsxs("form",{onSubmit:u.handleSubmit(f),className:"space-y-8",children:[g.jsx(q$,{name:"url",control:u.control,render:({field:d})=>g.jsxs(mT,{children:[g.jsx(gT,{children:"URL"}),g.jsx(vT,{children:g.jsx(Dg,{...d,disabled:!!e,autoFocus:!e})}),g.jsx(hY,{})]})}),g.jsx(q$,{name:"collection_id",control:u.control,render:({field:d})=>g.jsxs(mT,{children:[g.jsx(gT,{children:"Collection"}),g.jsxs(yZ,{onValueChange:d.onChange,value:d.value,children:[g.jsx(vT,{children:g.jsx(v2,{children:g.jsx(bZ,{placeholder:"Select a collection"})})}),g.jsxs(y2,{children:[g.jsx(Ob,{value:"-1",children:"Inbox"},"-1"),r?.map(p=>g.jsx(Ob,{value:p.id.toString(),children:p.title},p.id))]})]})]})}),g.jsx(fn,{type:"submit",disabled:u.formState.isSubmitting||!u.formState.isValid,children:"Save"})]})})};function JFe({children:e,isLinkWidgetOpen:t,setLinkWidgetOpen:n,currentEditingLink:r,setCurrentEditingLink:i,onComplete:s}){const o=b.useRef(null),a=u=>{n(u),u||i(null)},l=()=>{a(!1)};return g.jsxs(KI,{open:t,onOpenChange:a,children:[g.jsx(f2e,{asChild:!0,children:e}),g.jsxs(iw,{className:"sm:max-w-md md:rounded-2xl",children:[g.jsxs(ZI,{children:[g.jsx(QI,{children:r&&r.id?"Edit Link":"Post Link"}),g.jsx(UG,{children:"Save a link to your collection library."})]}),g.jsx(XFe,{link:r,closeDialog:l,onComplete:s}),g.jsx(YI,{className:"hidden sm:justify-start",children:g.jsx(p2e,{asChild:!0,children:g.jsx(fn,{ref:o,type:"button",variant:"secondary",children:"Close"})})})]})]})}const e4e=b.memo(function(){const n=BT()?.id,{links:r,isLoading:i}=Wk(n),[s,o]=b.useState(""),[a,l]=b.useState(!1),[u,f]=b.useState(null),{refetch:d}=Wk(n),p=s?r?.filter(_=>_?.title?.toLowerCase().includes(s.toLowerCase())||_?.url?.toLowerCase().includes(s.toLowerCase())):r,m=()=>{setTimeout(()=>{d()},1e3)},v=()=>{o("")};return i?g.jsx("div",{className:"flex h-full items-center justify-center",children:g.jsx("div",{className:"size-6 animate-spin rounded-full border-2 border-primary border-t-transparent"})}):g.jsxs("div",{className:"flex h-full flex-col",children:[g.jsxs("div",{className:"flex items-center justify-between px-4 py-2",children:[g.jsx("h1",{className:"text-lg font-semibold leading-none",children:"Links"}),g.jsx(fn,{variant:"ghost",size:"icon",className:"size-8",onClick:()=>l(!0),children:g.jsx(Xf,{className:"size-4"})})]}),g.jsx(HZ,{searchQuery:s,onChange:o,onClear:v,"aria-label":"Search links"}),g.jsx(t4e,{links:p,setLinkWidgetOpen:l,setCurrentEditingLink:f}),g.jsx(JFe,{isLinkWidgetOpen:a,setLinkWidgetOpen:l,currentEditingLink:u,setCurrentEditingLink:f,onComplete:m})]})});function t4e({links:e,setLinkWidgetOpen:t,setCurrentEditingLink:n}){const{selectedLink:r,setSelectedLink:i}=ug(),s=b.useRef(null),o=b.useRef(!0);return b.useEffect(()=>{const a=d=>{if(!o.current||!e||!s.current||!s.current.contains(document.activeElement))return;const p=e.findIndex(m=>m&&m.id===r?.id);if(d.key==="ArrowDown"){const m=p>=0&&p<e.length-1?p+1:0;i(e[m])}else if(d.key==="ArrowUp"){const m=p>0?p-1:e.length-1;i(e[m])}},l=s.current,u=()=>{o.current=!0},f=()=>{o.current=!1};return l?.addEventListener("focus",u,!0),l?.addEventListener("blur",f,!0),window.addEventListener("keydown",a),()=>{l?.removeEventListener("focus",u,!0),l?.removeEventListener("blur",f,!0),window.removeEventListener("keydown",a)}},[e,r,i]),!e||e.length<1?g.jsx(HLe,{}):g.jsx(Cc,{className:"flex-1",children:g.jsx("div",{className:"relative mx-auto w-full max-w-2xl",ref:s,tabIndex:-1,children:g.jsx("ul",{className:"divide-y",children:g.jsx(G0e,{children:e.map((a,l)=>a?g.jsx(vb.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},children:g.jsx(r4e,{link:a,setLinkWidgetOpen:t,setCurrentEditingLink:n,children:g.jsx(n4e,{link:a,isSelected:r===a})})},a?.id):null)})})})})}const n4e=b.memo(function({link:t,isSelected:n}){const{setSelectedLink:r}=ug(),i=BT(),{refetch:s}=Wk(i?.id?i.id:"-1"),[{isDragging:o},a,l]=gEe(()=>({type:NG.LINK,item:t,end:(u,f)=>{const d=f.getDropResult();u&&d&&setTimeout(()=>{s()},500)},collect:u=>({opacity:u.isDragging()?.5:1,isDragging:u.isDragging()})}),[]);return g.jsxs(g.Fragment,{children:[g.jsx(KSe,{connect:l,src:"/img/drag-file.svg"},new Date().getTime()),g.jsxs("li",{ref:a,onClick:()=>r(t),className:_e("flex w-full items-center overflow-visible rounded border border-transparent px-2 py-4 transition-colors duration-150 hover:bg-accent",n&&"bg-primary/10",o&&"opacity-50"),children:[g.jsx(i4e,{url:t.icon_url}),g.jsx(s4e,{link:t})]})]})}),r4e=({children:e,link:t,setLinkWidgetOpen:n,setCurrentEditingLink:r})=>{const{toast:i}=xz(),s=wi(),o=e2e(),[a,l]=ULe(),u=b.useCallback(()=>{r(t),n(!0)},[t,r,n]),f=b.useCallback(async()=>{try{await o.mutateAsync(t.id),i({title:"Link deleted"})}catch{i({title:"Error deleting link",variant:"destructive"})}},[t?.id,i,o]);return g.jsxs($Ie,{children:[g.jsx(zIe,{children:e}),t&&g.jsxs(AG,{className:"dark:bg-secondary",children:[g.jsx(Up,{onSelect:u,children:g.jsxs("div",{className:"flex items-center",children:[g.jsx(Er.Edit,{className:"pr-2"}),"Edit"]})}),g.jsx(Up,{onSelect:f,children:g.jsxs("div",{className:"flex items-center",children:[g.jsx(Er.Delete,{className:"pr-2"}),"Delete"]})}),g.jsx(Up,{onSelect:()=>{l(t.url),i({title:"Link copied!"})},children:g.jsxs("div",{className:"flex items-center",children:[g.jsx(Er.Copy,{className:"pr-2"}),"Copy Link"]})}),g.jsx(Up,{onSelect:()=>s("/read/"+t.id),children:g.jsxs("div",{className:"flex items-center",children:[g.jsx(Er.Preview,{className:"pr-2"}),"View in Reader"]})})]})]})},i4e=({url:e})=>e?g.jsx("img",{loading:"lazy",src:e,alt:"Favicon",className:"ml-1 mr-3 size-6"}):g.jsx(Er.Bookmark,{className:"ml-1 mr-3 size-6"}),s4e=({link:e})=>g.jsxs("div",{children:[g.jsx("p",{className:"text-md truncate",children:e.title}),g.jsx("div",{className:"truncate text-sm text-gray-500",children:e.url})]});function o4e({url:e,onRefresh:t,className:n}){const r=()=>{e&&window.open(e,"_blank","noopener,noreferrer")},i=e?new URL(e).hostname:"about:blank";return g.jsxs("div",{className:_e("flex h-10 shrink-0 items-center gap-3 border-b bg-secondary/50 px-3",n),children:[g.jsxs("div",{className:"flex items-center gap-1.5",children:[g.jsx("div",{className:"size-3 rounded-full bg-[#FF5F56]"}),g.jsx("div",{className:"size-3 rounded-full bg-[#FFBD2E]"}),g.jsx("div",{className:"size-3 rounded-full bg-[#27C93F]"})]}),g.jsx("div",{className:"flex flex-1 items-center justify-center",children:g.jsx("div",{className:"flex h-6 max-w-md flex-1 items-center justify-center rounded-md bg-background/80 px-3 text-xs text-muted-foreground",children:g.jsx("span",{className:"truncate",children:i})})}),g.jsxs("div",{className:"flex items-center gap-1",children:[t&&g.jsx("button",{onClick:t,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",title:"Refresh",children:g.jsx(qz,{className:"size-3.5"})}),e&&g.jsx("button",{onClick:r,className:"rounded p-1 text-muted-foreground hover:bg-accent hover:text-foreground",title:"Open in browser",children:g.jsx(ere,{className:"size-3.5"})})]})]})}const a4e="_verified_lvyh0_1",R2={verified:a4e},l4e=()=>g.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:R2.verified,children:g.jsx("g",{children:g.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),u4e=()=>g.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:R2.verified,children:g.jsxs("g",{children:[g.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[g.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),g.jsx("stop",{offset:".539",stopColor:"#cd8105"}),g.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),g.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),g.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),g.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[g.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),g.jsx("stop",{offset:".406",stopColor:"#e2b719"}),g.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),g.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[g.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),g.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),g.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),c4e=()=>g.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:R2.verified,children:g.jsx("g",{children:g.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.45
1535l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),d4e="_root_98iqw_1",f4e="_article_98iqw_21",W$={root:d4e,article:f4e},I2=({className:e,children:t})=>g.jsx("div",{className:$o("react-tweet-theme",W$.root,e),children:g.jsx("article",{className:W$.article,children:t})}),pY=e=>g.jsx("img",{...e}),h4e="_header_nqq4j_1",p4e="_avatar_nqq4j_11",m4e="_avatarOverflow_nqq4j_16",g4e="_avatarSquare_nqq4j_23",v4e="_avatarShadow_nqq4j_26",y4e="_author_nqq4j_37",b4e="_authorLink_nqq4j_44",_4e="_authorVerified_nqq4j_53",w4e="_authorLinkText_nqq4j_56",x4e="_authorMeta_nqq4j_63",S4e="_authorFollow_nqq4j_66",E4e="_username_nqq4j_69",C4e="_follow_nqq4j_74",k4e="_separator_nqq4j_82",T4e="_brand_nqq4j_86",P4e="_twitterIcon_nqq4j_90",jr={header:h4e,avatar:p4e,avatarOverflow:m4e,avatarSquare:g4e,avatarShadow:v4e,author:y4e,authorLink:b4e,authorVerified:_4e,authorLinkText:w4e,authorMeta:x4e,authorFollow:S4e,username:E4e,follow:C4e,separator:k4e,brand:T4e,twitterIcon:P4e},R4e="_verifiedOld_lcna5_1",I4e="_verifiedBlue_lcna5_4",O4e="_verifiedGovernment_lcna5_7",tE={verifiedOld:R4e,verifiedBlue:I4e,verifiedGovernment:O4e},mY=({user:e,className:t})=>{const n=e.verified||e.is_blue_verified||e.verified_type;let r=g.jsx(l4e,{}),i=tE.verifiedBlue;if(n)switch(e.is_blue_verified||(i=tE.verifiedOld),e.verified_type){case"Government":r=g.jsx(c4e,{}),i=tE.verifiedGovernment;break;case"Business":r=g.jsx(u4e,{}),i=null;break}return n?g.jsx("div",{className:$o(t,i),children:r}):null},D4e=({tweet:e,components:t})=>{var n;const r=(n=t?.AvatarImg)!=null?n:pY,{user:i}=e;return g.jsxs("div",{className:jr.header,children:[g.jsxs("a",{href:e.url,className:jr.avatar,target:"_blank",rel:"noopener noreferrer",children:[g.jsx("div",{className:$o(jr.avatarOverflow,i.profile_image_shape==="Square"&&jr.avatarSquare),children:g.jsx(r,{src:i.profile_image_url_https,alt:i.name,width:48,height:48})}),g.jsx("div",{className:jr.avatarOverflow,children:g.jsx("div",{className:jr.avatarShadow})})]}),g.jsxs("div",{className:jr.author,children:[g.jsxs("a",{href:e.url,className:jr.authorLink,target:"_blank",rel:"noopener noreferrer",children:[g.jsx("div",{className:jr.authorLinkText,children:g.jsx("span",{title:i.name,children:i.name})}),g.jsx(mY,{user:i,className:jr.authorVerified})]}),g.jsxs("div",{className:jr.authorMeta,children:[g.jsx("a",{href:e.url,className:jr.username,target:"_blank",rel:"noopener noreferrer",children:g.jsxs("span",{title:`@${i.screen_name}`,children:["@",i.screen_name]})}),g.jsxs("div",{className:jr.authorFollow,children:[g.jsx("span",{className:jr.separator,children:"·"}),g.jsx("a",{href:i.follow_url,className:jr.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),g.jsx("a",{href:e.url,className:jr.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:g.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:jr.twitterIcon,children:g.jsx("g",{children:g.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},A4e="_root_1ec15_1",M4e={root:A4e},N4e=({tweet:e})=>g.jsxs("a",{href:e.in_reply_to_url,className:M4e.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),j4e="_root_eihfa_1",L4e={root:j4e},F4e=({href:e,children:t})=>g.jsx("a",{href:e,className:L4e.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),$4e="_root_1xq52_1",z4e={root:$4e},V4e=({tweet:e})=>g.jsx("p",{className:z4e.root,lang:e.lang,dir:"auto",children:e.entities.map((t,n)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return g.jsx(F4e,{href:t.href,children:t.text},n);case"media":return;default:return g.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},n)}})}),G$=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,gY=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,U4e=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,B4e=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,H4e=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,q4e=e=>`https://x.com/hashtag/${e.text}`,W4e=e=>`https://x.com/search?q=%24${e.text}`,G4e=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vY=(e,t)=>
153{const n=new URL(e.media_url_https),r=n.pathname.split(".").pop();return r?(n.pathname=n.pathname.replace(`.${r}`,""),n.searchParams.set("format",r),n.searchParams.set("name",t),n.toString()):e.media_url_https},K4e=e=>{const{variants:t}=e.video_info;return t.filter(r=>r.content_type==="video/mp4").sort((r,i)=>{var s,o;return((s=i.bitrate)!=null?s:0)-((o=r.bitrate)!=null?o:0)})},Z4e=e=>{const t=K4e(e);return t.length>1?t[1]:t[0]},yT=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function K$(e){const t=Array.from(e.text),n=[{indices:e.display_text_range,type:"text"}];return fp(n,"hashtag",e.entities.hashtags),fp(n,"mention",e.entities.user_mentions),fp(n,"url",e.entities.urls),fp(n,"symbol",e.entities.symbols),e.entities.media&&fp(n,"media",e.entities.media),Y4e(e,n),n.map(r=>{const i=t.slice(r.indices[0],r.indices[1]).join("");switch(r.type){case"hashtag":return Object.assign(r,{href:q4e(r),text:i});case"mention":return Object.assign(r,{href:gY(r.screen_name),text:i});case"url":case"media":return Object.assign(r,{href:r.expanded_url,text:r.display_url});case"symbol":return Object.assign(r,{href:W4e(r),text:i});default:return Object.assign(r,{text:i})}})}function fp(e,t,n){for(const r of n)for(const[i,s]of e.entries()){if(s.indices[
1530]>r.indices[0]||s.indices[1]<r.indices[1])continue;const o=[{...r,type:t}];s.indices[0]<r.indices[0]&&o.unshift({indices:[s.indices[0],r.indices[0]],type:"text"}),s.indices[1]>r.indices[1]&&o.push({indices:[r.indices[1],s.indices[1]],type:"text"}),e.splice(i,1,...o);break}}function Y4e(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const n=t.at(-1);n&&n.indices[1]>e.display_text_range[1]&&(n.indices[1]=e.display_text_range[1])}const Q4e=e=>({...e,url:G$(e),user:{...e.user,url:gY(e),follow_url:H4e(e)},like_url:U4e(e),reply_url:B4e(e),in_reply_to_url:e.in_reply_to_screen_name?G4e(e):void 0,entities:K$(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:G$(e.quoted_tweet),entities:K$(e.quoted_tweet)}:void 0}),X4e="_root_g9tkv_1",J4e="_rounded_g9tkv_6",e$e="_mediaWrapper_g9tkv_10",t$e="_grid2Columns_g9tkv_17",n$e="_grid3_g9tkv_20",r$e="_grid2x2_g9tkv_23",i$e="_mediaContainer_g9tkv_26",s$e="_mediaLink_g9tkv_34",o$e="_skeleton_g9tkv_38",a$e="_image_g9tkv_43",Gi={root:X4e,rounded:J4e,mediaWrapper:e$e,grid2Columns:t$e,grid3:n$e,grid2x2:r$e,mediaContainer:i$e,mediaLink:s$e,skeleton:o$e,image:a$e},l$e="_anchor_fp31d_1",u$e="_videoButton_fp31d_17",c$e="_videoButtonIcon_fp31d_35",d$e="_watchOnTwitter_fp31d_44",f$e="_viewReplies_fp31d_60",Nd={anchor:l$e,videoButton:u$e,videoButtonIcon:c$e,watchOnTwitter:d$e,viewReplies:f$e},h$e=({tweet:e,media:t})=>{const[n,r]=b.useState(!0),[i,s]=b.useState(!1),[o,a]=b.useState(!1),l=Z4e(t);let u=0;return g.jsxs(g.Fragment,{children:[g.jsx("video",{className:Gi.image,poster:vY(t,"small"),controls:!n,playsInline:!0,preload:"none",tabIndex:n?-1:0,onPlay:()=>{u&&window.clearTimeout(u),i||s(!0),o&&a(!1)},onPause:()=>{u&&window.clearTimeout(u),u=window.setTimeout(()=>{i&&s(!1),u=0},100)},onEnded:()=>{a(!0)},children:g.jsx("source",{src:l.url,type:l.content_type})}),n&&g.jsx("button",{type:"button",className:Nd.videoButton,"aria-label":"View video on X",onClick:f=>{const d=f.currentTarget.previousSibling;f.preventDefault(),r(!1),d.load(),d.play().then(()=>{s(!0),d.focus()}).catch(p=>{console.error("Error playing video:",p),r(!0),s(!1)})},children:g.jsx("svg",{viewBox:"0 0 24 24",className:Nd.videoButtonIcon,"aria-hidden":"true",children:g.jsx("g",{children:g.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!i&&!o&&g.jsx("div",{className:Nd.watchOnTwitter,children:g.jsx("a",{href:e.url,className:Nd.anchor,target:"_blank",rel:"noopener noreferrer",children:n?"Watch on X":"Continue watching on X"})}),o&&g.jsx("a",{href:e.url,className:$o(Nd.anchor,Nd.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},p$e=e=>g.jsx("img",{...e}),Z$=(e,t)=>{let n=56.25;return t===1&&(n=100/e.original_info.width*e.original_info.height),t===2&&(n=n*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${n}%`}},yY=({tweet:e,components:t,quoted:n})=>{var r,i,s;const o=(s=(r=e.mediaDetails)==null?void 0:r.length)!=null?s:0;var a;const l=(a=t?.MediaImg)!=null?a:p$e;return g.jsx("div",{className:$o(Gi.root,!n&&Gi.rounded),children:g.jsx("div",{className:$o(Gi.mediaWrapper,o>1&&Gi.grid2Columns,o===3&&Gi.grid3,o>4&&Gi.grid2x2),children:(i=e.mediaDetails)==null?void 0:i.map(u=>g.jsx(b.Fragment,{children:u.type==="photo"?g.jsxs("a",{href:e.url,className:$o(Gi.mediaContainer,Gi.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[g.jsx("div",{className:Gi.skeleton,style:Z$(u,o)}),g.jsx(l,{src:vY(u,"small"),alt:u.ext_alt_text||"Image",className:Gi.image,draggable:!0})]},u.media_url_https):g.jsxs("div",{className:Gi.mediaContainer,children:[g.jsx("div",{className:Gi.skeleton,style:Z$(u,o)}),g.jsx(h$e,{tweet:e,media:u})]},u.media_url_https)},u.media_url_https))})})},m$e={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},g$e=new Intl.DateTimeFormat("en-US",m$e),v$e=e=>{const t={};for(const n of e)t[n.type]=n.value;return t},y$e=e=>{const t=v$e(g$e.formatToParts(e)),n=`${t.hour}:${t.minute} ${t.dayPeriod}`,r=`${t.month} ${t.day}, ${t.year}`;return`${n} · ${r}`},b$e="_root_i24yn_1",_$e={root:b$e},w$e=({tweet:e})=>{const t=new Date(e.created_at),n=y$e(t);return g.jsx("a",{className:_$e.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":n,children:g.jsx("time",{dateTime:t.toISOString(),children:n})})},x$e="_info_19qcj_1",S$e="_infoLink_19qcj_10",E$e="_infoIcon_19qcj_30",nE={info:x$e,infoLink:S$e,infoIcon:E$e},C$e=({tweet:e})=>g.jsxs("div",{className:nE.info,children:[g.jsx(w$e,{tweet:e}),g.jsx("a",{className:nE.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:g.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:nE.infoIcon,children:g.jsx("g",{children:g.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),k$e="_actions_n2anf_1",T$e="_like_n2anf_13",P$e="_reply_n2anf_14",R$e="_copy_n2anf_15",I$e="_likeIconWrapper_n2anf_27",O$e="_likeCount_n2anf_30",D$e="_replyIconWrapper_n2anf_35",A$e="_copyIconWrapper_n2anf_36",M$e="_likeIcon_n2anf_27",N$e="_replyIcon_n2anf_35",j$e="_copyIcon_n2anf_36",L$e="_replyText_n2anf_56",F$e="_copyText_n2anf_57",Ai={actions:k$e,like:T$e,reply:P$e,copy:R$e,likeIconWrapper:I$e,likeCount:O$e,replyIconWrapper:D$e,copyIconWrapper:A$e,likeIcon:M$e,replyIcon:N$e,copyIcon:j$e,replyText:L$e,copyText:F$e},$$e=({tweet:e})=>{const[t,n]=b.useState(!1),r=()=>{navigator.clipboard.writeText(e.url),n(!0)};return b.useEffect(()=>{if(t){const i=setTimeout(()=>{n(!1)},6e3);return()=>clearTimeout(i)}},[t]),g.jsxs("button",{type:"button",className:Ai.copy,"aria-label":"Copy link",onClick:r,children:[g.jsx("div",{className:Ai.copyIconWrapper,children:t?g.jsx("svg",{viewBox:"0 0 24 24",className:Ai.copyIcon,"aria-hidden":"true",children:g.jsx("g",{children:g.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):g.jsx("svg",{viewBox:"0 0 24 24",className:Ai.copyIcon,"aria-hidden":"true",children:g.jsx("g",{children:g.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),g.jsx("span",{className:Ai.copyText,children:t?"Copied!":"Copy link"})]})},z$e=({tweet:e})=>{const t=yT(e.favorite_count);return g.jsxs("div",{className:Ai.actions,children:[g.jsxs("a",{className:Ai.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[g.jsx("div",{className:Ai.likeIconWrapper,children:g.jsx("svg",{viewBox:"0 0 24 24",className:Ai.likeIcon,"aria-hidden":"true",children:g.jsx("g",{children:g.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),g.jsx("span",{className:Ai.likeCount,children:t})]}),g.jsxs("a",{className:Ai.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[g.jsx("div",{className:Ai.replyIconWrapper,children:g.jsx("svg",{viewBox:"0 0 24 24",className:Ai.replyIcon,"aria-hidden":"true",children:g.jsx("g",{children:g.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),g.jsx("span",{className:Ai.replyText,children:"Reply"})]}),g.jsx($$e,{tweet:e})]})},V$e="_replies_1cutb_1",U$e="_link_1cutb_4",B$e="_text_1cutb_23",rE={replies:V$e,link:U$e,text:B$e},H$e=({tweet:e})=>g.jsx("div",{className:rE.replies,children:g.jsx("a",{className:rE.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:g.jsx("span",{className:rE.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${yT(e.conversation_count)} reply`:`Read ${yT(e.conversation_count)} replies`})})}),q$e="_root_q5799_1",W$e="_article_q5799_16",Y$={root:q$e,article:W$e},G$e=({tweet:e,children:t})=>g.jsx("div",{className:Y$.root,onClick:n=>{n.preventDefault(),window.open(e.url,"_blank")},children:g.jsx("article",{className:Y$.article,children:t})}),K$e="_header_r31i5_1",Z$e="_avatar_r31i5_11",Y$e="_avatarSquare_r31i5_17",Q$e="_author_r31i5_21",X$e="_authorText_r31i5_26",J$e="_username_r31i5_33",Vu={header:K$e,avatar:Z$e,avatarSquare:Y$e,author:Q$e,authorText:X$e,username:J$e},e3e=({tweet:e})=>{const{user:t}=e;return g.jsxs("div",{className:Vu.header,children:[g.jsx("a",{href:e.url,className:Vu.avatar,target:"_blank",rel:"noopener noreferrer",children:g.jsx("div",{className:$o(Vu.avatarOverflow,t.profile_image_shape==="Square"&&Vu.avatarSquare),children:g.jsx(pY,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),g.jsxs("div",{className:Vu.author,children:[g.jsx("div",{className:Vu.authorText,children:g.jsx("span",{title:t.name,children:t.name})}),g.jsx(mY,{user:t}),g.jsx("div",{className:Vu.username,children:g.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},t3e="_root_175ot_1",n3e={root:t3e},r3e=({tweet:e})=>g.jsx("p",{className:n3e.root,lang:e.lang,dir:"auto",children:e.entities.map((t,n)=>g.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},n))}),i3e=({tweet:e})=>{var t;return g.jsxs(G$e,{tweet:e,children:[g.jsx(e3e,{tweet:e}),g.jsx(r3e,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?g.jsx(yY,{quoted:!0,tweet:e}):null]})},s3e=({tweet:e,components:t})=>{var n;const r=b.useMemo(()=>Q4e(e),[e]);return g.jsxs(I2,{children:[g.jsx(D4e,{tweet:r,components:t}),r.in_reply_to_status_id_str&&g.jsx(N4e,{tweet:r}),g.jsx(V4e,{tweet:r}),(n=r.mediaDetails)!=null&&n.length?g.jsx(yY,{tweet:r,components:t}):null,r.quoted_tweet&&g.jsx(i3e,{tweet:r.quoted_tweet}),g.jsx(C$e,{tweet:r}),g.jsx(z$e,{tweet:r}),g.jsx(H$e,{tweet:r})]})},o3e="_root_16yxa_1",a3e={root:o3e},l3e=e=>g.jsx(I2,{children:g.jsxs("div",{className:a3e.root,children:[g.jsx("h3",{children:"Tweet not found"}),g.jsx("p",{children:"The embedded tweet could not be found…"})]})}),u3e="_skeleton_oi7hr_1",c3e={skeleton:u3e},jy=({style:e})=>g.jsx("span",{className:c3e.skeleton,style:e}),d3e="_root_17qqv_1",f3e={root:d3e},h3e=()=>g.jsxs(I2,{className:f3e.root,children:[g.jsx(jy,{style:{height:"3rem",marginBottom:"0.75rem"}}),g.jsx(jy,{style:{height:"6rem",margin:"0.5rem 0"}}),g.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),g.jsx(jy,{style:{height:"2rem"}}),g.jsx(jy,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]});var iE={exports:{}},sE={};var Q$;function p3e(){if(Q$)return sE;Q$=1;var e=zr();function t(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,i=e.useEffect,s=e.useLayoutEffect,o=e.useDebugValue;function a(d,p){var m=p(),v=r({inst:{value:m,getSnapshot:p}}),_=v[0].inst,w=v[1];return s(function(){_.value=m,_.getSnapshot=p,l(_)&&w({inst:_})},[d,m,p]),i(function(){return l(_)&&w({inst:_}),d(function(){l(_)&&w({inst:_})})},[d]),o(m),m}function l(d){var p=d.getSnapshot;d=d.value;try{var m=p();return!n(d,m)}catch{return!0}}function u(d,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return sE.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,sE}var X$;function m3e(){return X$||(X$=1,iE.exports=p3e()),iE.exports}var g3e=m3e();const bY=0,_Y=1,wY=2,J$=3,Aa=new WeakMap,Fl=()=>{},mi=Fl(),bT=Object,Yt=e=>e===mi,Mo=e=>typeof e=="function",nu=(e,t)=>({...e,...t}),xY=e=>Mo(e.then),oE={},Ly={},O2="undefined",Ng=typeof window!=O2,_T=typeof document!=O2,v3e=Ng&&"Deno"in window,y3e=()=>Ng&&typeof window.requestAnimationFrame!=O2,SY=(e,t)=>{const n=Aa.get(e);return[()=>!Yt(t)&&e.get(t)||oE,r=>{if(!Yt(t)){const i=e.get(t);t in Ly||(Ly[t]=i),n[5](t,nu(i,r),i||oE)}},n[6],()=>
153!Yt(t)&&t in Ly?Ly[t]:!Yt(t)&&e.get(t)||oE]};let wT=!0;const b3e=()=>wT,[xT,ST]=Ng&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Fl,Fl],_3e=()=>{const e=_T&&document.visibilityState;return Yt(e)||e!=="hidden"},w3e=e=>(_T&&document.addEventListener("visibilitychange",e),xT("focus",e),()=>{_T&&document.removeEventListener("visibilitychange",e),ST("focus",e)}),x3e=e=>{const t=()=>{wT=!0,e()},n=()=>{wT=!1};return xT("online",t),xT("offline",n),()=>{ST("online",t),ST("offline",n)}},S3e={isOnline:b3e,isVisible:_3e},E3e={initFocus:w3e,initReconnect:x3e},e3=!ve.useId,Km=!Ng||v3e,C3e=e=>y3e()?window.requestAnimationFrame(e):setTimeout(e,1),aE=Km?b.useEffect:b.useLayoutEffect,lE=typeof navigator<"u"&&navigator.connection,t3=!Km&&lE&&(["slow-2g","2g"].includes(lE.effectiveType)||lE.saveData),Fy=new WeakMap,uE=(e,t)=>bT.prototype.toString.call(e)===`[object ${t}]`;let k3e=0;const ET=e=>{const t=typeof e,n=uE(e,"Date"),r=uE(e,"RegExp"),i=uE(e,"Object");let s,o;if(bT(e)===e&&!n&&!r){if(s=Fy.get(e),s)return s;if(s=++k3e+"~",Fy.set(e,s),Array.isArray(e)){for(s="@",o=0;o<e.length;o++)s+=ET(e[o])+",";Fy.set(e,s)}if(i){s="#";const a=bT.keys(e).sort();for(;!Yt(o=a.pop());)Yt(e[o])||(s+=o+":"+ET(e[o])+",");Fy.set(e,s)}}else s=n?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return s},D2=e=>{if(Mo(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?ET(e):"",[e,t]};let T3e=0;const CT=()=>++T3e;async function EY(...e){const[t,n,r,i]=e,s=nu({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let o=s.populateCache;const a=s.rollbackOnError;let l=s.optimisticData;const u=p=>typeof a=="function"?a(p):a!==!1,f=s.throwOnError;if(Mo(n)){const p=n,m=[],v=t.keys();for(const _ of v)!/^\$(inf|sub)\$/.test(_)&&p(t.get(_)._k)&&m.push(_);return Promise.all(m.map(d))}return d(n);async function d(p){const[m]=D2(p);if(!m)return;const[v,_]=SY(t,m),[w,x,S,C]=Aa.get(t),R=()=>{const V=w[m];return(Mo(s.revalidate)?s.revalidate(v().data,p):s.revalidate!==!1)&&(delete S[m],delete C[m],V&&V[0])?V[0](wY).then(()=>v().data):v().data};if(e.length<3)return R();let P=r,k;const I=CT();x[m]=[I,0];const D=!Yt(l),L=v(),A=L.data,$=L._c,j=Yt($)?A:$;if(D&&(l=Mo(l)?l(j,A):l,_({data:l,_c:j})),Mo(P))try{P=P(j)}catch(V){k=V}if(P&&xY(P))if(P=await P.catch(V=>{k=V}),I!==x[m][0]){if(k)throw k;return P}else k&&D&&u(k)&&(o=!0,_({data:j,_c:mi}));if(o&&!k)if(Mo(o)){const V=o(P,j);_({data:V,error:mi,_c:mi})}else _({data:P,error:mi,_c:mi});if(x[m][1]=CT(),Promise.resolve(R()).then(()=>{_({_c:mi})}),k){if(f)throw k;return}return P}}const n3=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},P3e=(e,t)=>{if(!Aa.has(e)){const n=nu(E3e,t),r=Object.create(null),i=EY.bind(mi,e);let s=Fl;const o=Object.create(null),a=(f,d)=>{const p=o[f]||[];return o[f]=p,p.push(d),()=>p.splice(p.indexOf(d),1)},l=(f,d,p)=>{e.set(f,d);const m=o[f];if(m)for(const v of m)v(d,p)},u=()=>{if(!Aa.has(e)&&(Aa.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,l,a]),!Km)){const f=n.initFocus(setTimeout.bind(mi,n3.bind(mi,r,bY))),d=n.initReconnect(setTimeout.bind(mi,n3.bind(mi,r,_Y)));s=()=>{f&&f(),d&&d(),Aa.delete(e)}}};return u(),[e,i,u,s]}return[e,Aa.get(e)[4]]},R3e=(e,t,n,r,i)=>{const s=n.errorRetryCount,o=i.retryCount,a=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Yt(s)&&o>s||setTimeout(r,a,i)},I3e=YC,[CY,O3e]=P3e(new Map),D3e=nu({onLoadingSlow:Fl,onSuccess:Fl,onError:Fl,onErrorRetry:R3e,onDiscarded:Fl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:t3?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:t3?5e3:3e3,compare:I3e,isPaused:()=>!1,cache:CY,mutate:O3e,fallback:{}},S3e),A3e=(e,t)=>{const n=nu(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:o}=t;r&&s&&(n.use=r.concat(s)),i&&o&&(n.fallback=nu(i,o))}return n},M3e=b.createContext({}),N3e="$inf$",kY=Ng&&window.__SWR_DEVTOOLS_USE__,j3e=kY?window.__SWR_DEVTOOLS_USE__:[],L3e=()=>{kY&&(window.__SWR_DEVTOOLS_REACT__=ve)},F3e=e=>Mo(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],$3e=()=>nu(D3e,b.useContext(M3e)),z3e=e=>(t,n,r)=>e(t,n&&((...s)=>{const[o]=D2(t),[,,,a]=Aa.get(CY);if(o.startsWith(N3e))return n(...s);const l=a[o];return Yt(l)?n(...s):(delete a[o],l)}),r),V3e=j3e.concat(z3e),U3e=e=>function(...n){const r=$3e(),[i,s,o]=F3e(n),a=A3e(r,o);let l=e;const{use:u}=a,f=(u||[]).concat(V3e);for(let d=f.length;d--;)l=f[d](l);return l(i,s||a.fetcher||null,a)}
153,B3e=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i>=0&&(r[i]=r[r.length-1],r.pop())}};L3e();const cE=ve.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),dE={dedupe:!0},H3e=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:o,revalidateOnMount:a,revalidateIfStale:l,refreshInterval:u,refreshWhenHidden:f,refreshWhenOffline:d,keepPreviousData:p}=n,[m,v,_,w]=Aa.get(r),[x,S]=D2(e),C=b.useRef(!1),R=b.useRef(!1),P=b.useRef(x),k=b.useRef(t),I=b.useRef(n),D=()=>I.current,L=()=>D().isVisible()&&D().isOnline(),[A,$,j,V]=SY(r,x),B=b.useRef({}).current,H=Yt(o)?Yt(n.fallback)?mi:n.fallback[x]:o,te=(Se,Fe)=>{for(const Be in B){const wt=Be;if(wt==="data"){if(!i(Se[wt],Fe[wt])&&(!Yt(Se[wt])||!i(X,Fe[wt])))return!1}else if(Fe[wt]!==Se[wt])return!1}return!0},G=b.useMemo(()=>{const Se=!x||!t?!1:Yt(a)?D().isPaused()||s?!1:l!==!1:a,Fe=ue=>{const Re=nu(ue);return delete Re._k,Se?{isValidating:!0,isLoading:!0,...Re}:Re},Be=A(),wt=V(),ht=Fe(Be),W=Be===wt?ht:Fe(wt);let ie=ht;return[()=>{const ue=Fe(A());return te(ue,ie)?(ie.data=ue.data,ie.isLoading=ue.isLoading,ie.isValidating=ue.isValidating,ie.error=ue.error,ie):(ie=ue,ue)},()=>W]},[r,x]),Z=g3e.useSyncExternalStore(b.useCallback(Se=>j(x,(Fe,Be)=>{te(Be,Fe)||Se()}),[r,x]),G[0],G[1]),Y=!C.current,M=m[x]&&m[x].length>0,q=Z.data,z=Yt(q)?H&&xY(H)?cE(H):H:q,N=Z.error,ee=b.useRef(z),X=p?Yt(q)?Yt(ee.current)?z:ee.current:q:z,ne=M&&!Yt(N)?!1:Y&&!Yt(a)?a:D().isPaused()?!1:s?Yt(z)?!1:l:Yt(z)||l,ae=!!(x&&t&&Y&&ne),se=Yt(Z.isValidating)?ae:Z.isValidating,ce=Yt(Z.isLoading)?ae:Z.isLoading,fe=b.useCallback(async Se=>{const Fe=k.current;if(!x||!Fe||R.current||D().isPaused())return!1;let Be,wt,ht=!0;const W=Se||{},ie=!_[x]||!W.dedupe,ue=()=>e3?!R.current&&x===P.current&&C.current:x===P.current,Re={isValidating:!1,isLoading:!1},Ee=()=>{$(Re)},xe=()=>{const Ze=_[x];Ze&&Ze[1]===wt&&delete _[x]},ze={isValidating:!0};Yt(A().data)&&(ze.isLoading=!0);try{if(ie&&($(ze),n.loadingTimeout&&Yt(A().data)&&setTimeout(()=>{ht&&ue()&&D().onLoadingSlow(x,n)},n.loadingTimeout),_[x]=[Fe(S),CT()]),[Be,wt]=_[x],Be=await Be,ie&&setTimeout(xe,n.dedupingInterval),!_[x]||_[x][1]!==wt)return ie&&ue()&&D().onDiscarded(x),!1;Re.error=mi;const Ze=v[x];if(!Yt(Ze)&&(wt<=Ze[0]||wt<=Ze[1]||Ze[1]===0))return Ee(),ie&&ue()&&D().onDiscarded(x),!1;const he=A().data;Re.data=i(he,Be)?he:Be,ie&&ue()&&D().onSuccess(Be,x,n)}catch(Ze){xe();const he=D(),{shouldRetryOnError:we}=he;he.isPaused()||(Re.error=Ze,ie&&ue()&&(he.onError(Ze,x,he),(we===!0||Mo(we)&&we(Ze))&&(!D().revalidateOnFocus||!D().revalidateOnReconnect||L())&&he.onErrorRetry(Ze,x,he,We=>{const Et=m[x];Et&&Et[0]&&Et[0](J$,We)},{retryCount:(W.retryCount||0)+1,dedupe:!0})))}return ht=!1,Ee(),!0},[x,r]),ke=b.useCallback((...Se)=>EY(r,P.current,...Se),[]);if(aE(()=>{k.current=t,I.current=n,Yt(q)||(ee.current=q)}),aE(()=>{if(!x)return;const Se=fe.bind(mi,dE);let Fe=0;D().revalidateOnFocus&&(Fe=Date.now()+D().focusThrottleInterval);const wt=B3e(x,m,(ht,W={})=>{if(ht==bY){const ie=Date.now();D().revalidateOnFocus&&ie>Fe&&L()&&(Fe=ie+D().focusThrottleInterval,Se())}else if(ht==_Y)D().revalidateOnReconnect&&L()&&Se();else{if(ht==wY)return fe();if(ht==J$)return fe(W)}});return R.current=!1,P.current=x,C.current=!0,$({_k:S}),ne&&(Yt(z)||Km?Se():C3e(Se)),()=>{R.current=!0,wt()}},[x]),aE(()=>{let Se;function Fe(){const wt=Mo(u)?u(A().data):u;wt&&Se!==-1&&(Se=setTimeout(Be,wt))}function Be(){!A().error&&(f||D().isVisible())&&(d||D().isOnline())?fe(dE).then(Fe):Fe()}return Fe(),()=>{Se&&(clearTimeout(Se),Se=-1)}},[u,f,d,x]),b.useDebugValue(X),s&&Yt(z)&&x){if(!e3&&Km)throw new Error("Fallback data is required when using Suspense in SSR.");k.current=t,I.current=n,R.current=!1;const Se=w[x];if(!Yt(Se)){const Fe=ke(Se);cE(Fe)}if(Yt(N)){const Fe=fe(dE);Yt(X)||(Fe.status="fulfilled",Fe.value=!0),cE(Fe)}else throw N}return{mutate:ke,get data(){return B.data=!0,X},get error(){return B.error=!0,N},get isValidating(){return B.isValidating=!0,se},get isLoading(){return B.isLoading=!0,ce}}},r3=U3e(H3e);
153class q3e extends Error{constructor({message:t,status:n,data:r}){super(t),this.name="TwitterApiError",this.status=n,this.data=r}}const W3e=r3.default||r3,G3e="https://react-tweet.vercel.app";async function K3e([e,t]){const n=await fetch(e,t),r=await n.json();if(n.ok)return r.data||null;throw new q3e({message:`Failed to fetch tweet at "${e}" with "${n.status}".`,data:r,status:n.status})}const Z3e=(e,t,n)=>{const{isLoading:r,data:i,error:s}=W3e(()=>t||e?[t||e&&`${G3e}/api/tweet/${e}`,n]:null,K3e,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(r||i===void 0&&!s),data:i,error:s}},Y3e=({id:e,apiUrl:t,fallback:n=g.jsx(h3e,{}),components:r,fetchOptions:i,onError:s})=>{const{data:o,error:a,isLoading:l}=Z3e(e,t,i);if(l)return n;if(a||!o){const u=r?.TweetNotFound||l3e;return g.jsx(u,{error:s?s(a):a})}return g.jsx(s3e,{tweet:o,components:r})};function Q3e({tweetId:e}){return g.jsx("div",{className:"flex size-full items-center justify-center",children:g.jsx(Y3e,{id:e})})}function X3e(e){const t=e.match(/twitter.com\/[^/]+\/status\/(\d+)/);return t?t[1]:null}function Nqe(e){const t=[],n=String(e||"");let r=n.indexOf(","),i=0,s=!1;for(;!s;){r===-1&&(r=n.length,s=!0);const o=n.slice(i,r).trim();(o||!s)&&t.push(o),i=r+1,r=n.indexOf(",",i)}return t}function J3e(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const e5e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,t5e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,n5e={};function i3(e,t){return(n5e.jsx?t5e:e5e).test(e)}const r5e=/[ \t\n\f\r]/g;function i5e(e){return typeof e=="object"?e.type==="text"?s3(e.value):!1:s3(e)}function s3(e){return e.replace(r5e,"")===""}class jg{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}jg.prototype.normal={};jg.prototype.property={};jg.prototype.space=void 0;function TY(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new jg(n,r,t)}function kT(e){return e.toLowerCase()}class $i{constructor(t,n){this.attribute=n,this.property=t}}$i.prototype.attribute="";$i.prototype.booleanish=!1;$i.prototype.boolean=!1;$i.prototype.commaOrSpaceSeparated=!1;$i.prototype.commaSeparated=!1;$i.prototype.defined=!1;$i.prototype.mustUseProperty=!1;$i.prototype.number=!1;$i.prototype.overloadedBoolean=!1;$i.prototype.property="";$i.prototype.spaceSeparated=!1;$i.prototype.space=void 0;let s5e=0;const Ot=Kc(),lr=Kc(),PY=Kc(),De=Kc(),bn=Kc(),Cf=Kc(),Ki=Kc();function Kc(){return 2**++s5e}const TT=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ot,booleanish:lr,commaOrSpaceSeparated:Ki,commaSeparated:Cf,number:De,overloadedBoolean:PY,spaceSeparated:bn},Symbol.toStringTag,{value:"Module"})),fE=Object.keys(TT);class A2 extends $i{constructor(t,n,r,i){let s=-1;if(super(t,n),o3(this,"space",i),typeof r=="number")for(;++s<fE.length;){const o=fE[s];o3(this,fE[s],(r&TT[o])===TT[o])}}}A2.prototype.defined=!0;function o3(e,t,n){n&&(e[t]=n)}function lh(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new A2(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[kT(r)]=r,n[kT(s.attribute)]=r}return new jg(t,n,e.space)}const RY=lh({properties:{ariaActiveDescendant:null,ariaAtomic:lr,ariaAutoComplete:null,ariaBusy:lr,ariaChecked:lr,ariaColCount:De,ariaColIndex:De,ariaColSpan:De,ariaControls:bn,ariaCurrent:null,ariaDescribedBy:bn,ariaDetails:null,ariaDisabled:lr,ariaDropEffect:bn,ariaErrorMessage:null,ariaExpanded:lr,ariaFlowTo:bn,ariaGrabbed:lr,ariaHasPopup:null,ariaHidden:lr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:bn,ariaLevel:De,ariaLive:null,ariaModal:lr,ariaMultiLine:lr,ariaMultiSelectable:lr,ariaOrientation:null,ariaOwns:bn,ariaPlaceholder:null,ariaPosInSet:De,ariaPressed:lr,ariaReadOnly:lr,ariaRelevant:null,ariaRequired:lr,ariaRoleDescription:bn,ariaRowCount:De,ariaRowIndex:De,ariaRowSpan:De,ariaSelected:lr,ariaSetSize:De,ariaSort:null,ariaValueMax:De,ariaValueMin:De,ariaValueNow:De,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function IY(e,t){return t in e?e[t]:t}function OY(e,t){return IY(e,t.toLowerCase())}const o5e=lh({attributes:{acceptcharset:"accept-charset",classname:"
153class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Cf,acceptCharset:bn,accessKey:bn,action:null,allow:null,allowFullScreen:Ot,allowPaymentRequest:Ot,allowUserMedia:Ot,alt:null,as:null,async:Ot,autoCapitalize:null,autoComplete:bn,autoFocus:Ot,autoPlay:Ot,blocking:bn,capture:null,charSet:null,checked:Ot,cite:null,className:bn,cols:De,colSpan:null,content:null,contentEditable:lr,controls:Ot,controlsList:bn,coords:De|Cf,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ot,defer:Ot,dir:null,dirName:null,disabled:Ot,download:PY,draggable:lr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ot,formTarget:null,headers:bn,height:De,hidden:Ot,high:De,href:null,hrefLang:null,htmlFor:bn,httpEquiv:bn,id:null,imageSizes:null,imageSrcSet:null,inert:Ot,inputMode:null,integrity:null,is:null,isMap:Ot,itemId:null,itemProp:bn,itemRef:bn,itemScope:Ot,itemType:bn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ot,low:De,manifest:null,max:null,maxLength:De,media:null,method:null,min:null,minLength:De,multiple:Ot,muted:Ot,name:null,nonce:null,noModule:Ot,noValidate:Ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ot,optimum:De,pattern:null,ping:bn,placeholder:null,playsInline:Ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ot,referrerPolicy:null,rel:bn,required:Ot,reversed:Ot,rows:De,rowSpan:De,sandbox:bn,scope:null,scoped:Ot,seamless:Ot,selected:Ot,shadowRootClonable:Ot,shadowRootDelegatesFocus:Ot,shadowRootMode:null,shape:null,size:De,sizes:null,slot:null,span:De,spellCheck:lr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:De,step:null,style:null,tabIndex:De,target:null,title:null,translate:null,type:null,typeMustMatch:Ot,useMap:null,value:lr,width:De,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:bn,axis:null,background:null,bgColor:null,border:De,borderColor:null,bottomMargin:De,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ot,declare:Ot,event:null,face:null,frame:null,frameBorder:null,hSpace:De,leftMargin:De,link:null,longDesc:null,lowSrc:null,marginHeight:De,marginWidth:De,noResize:Ot,noHref:Ot,noShade:Ot,noWrap:Ot,object:null,profile:null,prompt:null,rev:null,rightMargin:De,rules:null,scheme:null,scrolling:lr,standby:null,summary:null,text:null,topMargin:De,valueType:null,version:null,vAlign:null,vLink:null,vSpace:De,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ot,disableRemotePlayback:Ot,prefix:null,property:null,results:De,security:null,unselectable:null},space:"html",transform:OY}),a5e=lh({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRen
153dering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ki,accentHeight:De,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:De,amplitude:De,arabicForm:null,ascent:De,attributeName:null,attributeType:null,azimuth:De,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:De,by:null,calcMode:null,capHeight:De,className:bn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRen
153dering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:De,diffuseConstant:De,direction:null,display:null,dur:null,divisor:De,dominantBaseline:null,download:Ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:De,enableBackground:null,end:null,event:null,exponent:De,externalResourcesRequired:null,fill:null,fillOpacity:De,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Cf,g2:Cf,glyphName:Cf,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:De,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:De,horizOriginX:De,horizOriginY:De,id:null,ideographic:De,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:De,k:De,k1:De,k2:De,k3:De,k4:De,kernelMatrix:Ki,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:De,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:De,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:De,overlineThickness:De,paintOrder:null,panose1:null,path:null,pathLength:De,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:bn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:De,pointsAtY:De,pointsAtZ:De,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ki,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ki,rev:Ki,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ki,requiredFeatures:Ki,requiredFonts:Ki,requiredFormats:Ki,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:De,specularExponent:De,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:De,strikethroughThickness:De,string:null,stroke:null,strokeDashArray:Ki,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:
vendor: 7,985 bytes, lines 153-154
153De,strokeOpacity:De,strokeWidth:null,style:null,surfaceScale:De,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ki,tabIndex:De,tableValues:null,target:null,targetX:De,targetY:De,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ki,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:De,underlineThickness:De,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:De,values:null,vAlphabetic:De,vMathematical:De,vectorEffect:null,vHanging:De,vIdeographic:De,version:null,vertAdvY:De,vertOriginX:De,vertOriginY:De,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:De,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:IY}),DY=lh({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),AY=lh({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:OY}),MY=lh({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),l5e={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},u5e=/[A-Z]/g,a3=/-[a-z]/g,c5e=/^data[-\w.:]+$/i;function d5e(e,t){const n=kT(t);let r=t,i=$i;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&c5e.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(a3,h5e);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!a3.test(s)){let o=s.replace(u5e,f5e);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=A2}return new i(r,t)}function f5e(e){return"-"+e.toLowerCase()}function h5e(e){return e.charAt(1).toUpperCase()}const p5e=TY([RY,o5e,DY,AY,MY],"html"),M2=TY([RY,a5e,DY,AY,MY],"svg");function jqe(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function m5e(e){return e.join(" ").trim()}var jd={},hE,l3;function g5e(){if(l3)return hE;l3=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,a=/^\s+|\s+$/g,l=`
154`,u="/",f="*",d="",p="comment",m="declaration";hE=function(_,w){if(typeof _!="string")throw new TypeError("First argument must be a string");if(!_)return[];w=w||{};var x=1,S=1;function C(V){var B=V.match(t);B&&(x+=B.length);var H=V.lastIndexOf(l);S=~H?V.length-H:S+V.length}function R(){var V={line:x,column:S};return function(B){return B.position=new P(V),D(),B}}function P(V){this.start=V,this.end={line:x,column:S},this.source=w.source}P.prototype.content=_;function k(V){var B=new Error(w.source+":"+x+":"+S+": "+V);if(B.reason=V,B.filename=w.source,B.line=x,B.column=S,B.source=_,!w.silent)throw B}function I(V){var B=V.exec(_);if(B){var H=B[0];return C(H),_=_.slice(H.length),B}}function D(){I(n)}function L(V){var B;for(V=V||[];B=A();)B!==!1&&V.push(B);return V}function A(){var V=R();if(!(u!=_.charAt(0)||f!=_.charAt(1))){for(var B=2;d!=_.charAt(B)&&(f!=_.charAt(B)||u!=_.charAt(B+1));)++B;if(B+=2,d===_.charAt(B-1))return k("End of comment missing");var H=_.slice(2,B-2);return S+=2,C(H),_=_.slice(B),S+=2,V({type:p,comment:H})}}function $(){var V=R(),B=I(r);if(B){if(A(),!I(i))return k("property missing ':'");var H=I(s),te=V({type:m,property:v(B[0].replace(e,d)),value:H?v(H[0].replace(e,d)):d});return I(o),te}}function j(){var V=[];L(V);for(var B;B=$();)B!==!1&&(V.push(B),L(V));return V}return D(),j()};function v(_){return _?_.replace(a,d):d}return hE}var u3;function v5e(){if(u3)return jd;u3=1;var e=jd&&jd.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(jd,"__esModule",{value:!0}),jd.default=n;var t=e(g5e());function n(r,i){var s=null;if(!r||typeof r!="string")return s;var o=(0,t.default)(r),a=typeof i=="function";return o.forEach(function(l){if(l.type==="declaration"){var u=l.property,f=l.value;a?i(u,f,l):f&&(s=s||{},s[u]=f)}}),s}return jd}var hp={},c3;function y5e(){if(c3)return hp;c3=1,Object.defineProperty(hp,"__esModule",{value:!0}),hp.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(u){return!u||n.test(u)||e.test(u)},o=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},l=function(u,f){return f===void 0&&(f={}),s(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,o))};return hp.camelCase=l,hp}var pp,d3;function b5e(){if(d3)return pp;d3=1;var e=pp&&pp.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(v5e()),n=y5e();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(a,l){a&&l&&(o[(0,n.camelCase)(a,s)]=l)}),o}return r.default=r,pp=r,pp}var _5e=b5e();const w5e=vo(_5e),NY=jY("end"),N2=jY("start");function jY(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function x5e(e){const t=N2(e),n=NY(e);if(t&&n)return{start:t,end:n}}function lm(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?f3(e.position):"start"in e||"end"in e?f3(e):"line"in e||"column"in e?PT(e):""}function PT(e){return h3(e&&e.line)+":"+h3(e&&e.column)}function f3(e){return PT(e&&e.start)+"-"+PT(e&&e.end)}function h3(e){return e&&typeof e=="number"?e:1}class ti extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const l=r.indexOf(":");l===-1?s.ruleId=r:(s.source=r.slice(0,l),s.ruleId=r.slice(l+1))}if(!s.place&&s.ancestors&&s.ancestors){const l=s.ancestors[s.ancestors.length-1];l&&(s.place=l.position)}const a=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=lm(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}}ti.prototype.file="";ti.prototype.name="";ti.prototype.reason="";ti.prototype.message="";ti.prototype.stack="";ti.prototype.column=void 0;ti.prototype.line=void 0;ti.prototype.ancestors=void 0;ti.prototype.cause=void 0;ti.prototype.fatal=void 0;ti.prototype.place=void 0;ti.prototype.ruleId=void 0;ti.prototype.source=void 0;const j2={}.hasOwnProperty,S5e=new Map,E5e=/[A-Z]/g,C5e=new Set(["table","tbody","thead","tfoot","tr"]),k5e=new Set(["td","th"]),LY="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function T5e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=N5e(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 6,346 bytes, line 154
154if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=M5e(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?M2:p5e,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=FY(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function FY(e,t,n){if(t.type==="element")return P5e(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return R5e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return O5e(e,t,n);if(t.type==="mdxjsEsm")return I5e(e,t);if(t.type==="root")return D5e(e,t,n);if(t.type==="text")return A5e(e,t)}function P5e(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=M2,e.schema=i),e.ancestors.push(t);const s=zY(e,t.tagName,!1),o=j5e(e,t);let a=F2(e,t);return C5e.has(t.tagName)&&(a=a.filter(function(l){return typeof l=="string"?!i5e(l):!0})),$Y(e,o,s,t),L2(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function R5e(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Zm(e,t.position)}function I5e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Zm(e,t.position)}function O5e(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=M2,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:zY(e,t.name,!0),o=L5e(e,t),a=F2(e,t);return $Y(e,o,s,t),L2(o,a),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function D5e(e,t,n){const r={};return L2(r,F2(e,t)),e.create(t,e.Fragment,r,n)}function A5e(e,t){return t.value}function $Y(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function L2(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function M5e(e,t,n){return r;function r(i,s,o,a){const u=Array.isArray(o.children)?n:t;return a?u(s,o,a):u(s,o)}}function N5e(e,t){return n;function n(r,i,s,o){const a=Array.isArray(s.children),l=N2(r);return t(i,s,o,a,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function j5e(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&j2.call(t.properties,i)){const s=F5e(e,i,t.properties[i]);if(s){const[o,a]=s;e.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&k5e.has(t.tagName)?r=a:n[o]=a}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function L5e(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const a=o.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Zm(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,s=e.evaluater.evaluateExpression(a.expression)}else Zm(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function F2(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:S5e;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const l=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(l){const u=i.get(l)||0;o=l+"-"+u,i.set(l,u+1)}}const a=FY(e,s,o);a!==void 0&&n.push(a)}return n}function F5e(e,t,n){const r=d5e(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?J3e(n):m5e(n)),r.property==="style"){let i=typeof n=="object"?n:$5e(e,String(n));return e.stylePropertyNameCase==="css"&&(i=z5e(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?l5e[r.property]||r.property:r.attribute,n]}}function $5e(e,t){try{return w5e(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ti("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=LY+"#cannot-parse-style-attribute",i}}function zY(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const a=i3(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:a,computed:!!(s&&a.type==="Literal"),optional:!1}:a}r=o}else r=i3(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return j2.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Zm(e)}function Zm(e,t){const n=new ti("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=LY+"#cannot-handle-mdx-estrees-without-createevaluater",n}function z5e(e){const t={};let n;for(n in e)j2.call(e,n)&&(t[V5e(n)]=e[n]);return t}function V5e(e){let t=e.replace(E5e,U5e);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function U5e(e){return"-"+e.toLowerCase()}const pE={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},B5e={};function $2(e,t){const n=B5e,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return VY(e,r,i)}function VY(e,t,n){if(H5e(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return p3(e.children,t,n)}return Array.isArray(e)?p3(e,t,n):""}function p3(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=VY(e[i],t,n);return r.join("")}function H5e(e){return!!(e&&typeof e=="object")}const m3=document.createElement("i");function z2(e){const t="&"+e+";";m3.innerHTML=t;const n=m3.textContent;
vendor: 10,920 bytes, line 154
154return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ts(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function Ps(e,t){return e.length>0?(ts(e,e.length,0,t),e):t}const g3={}.hasOwnProperty;function UY(e){const t={};let n=-1;for(;++n<e.length;)q5e(t,e[n]);return t}function q5e(e,t){let n;for(n in t){const i=(g3.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){g3.call(i,o)||(i[o]=[]);const a=s[o];W5e(i[o],Array.isArray(a)?a:a?[a]:[])}}}function W5e(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ts(e,0,0,r)}function BY(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function co(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const gi=uu(/[A-Za-z]/),Jr=uu(/[\dA-Za-z]/),G5e=uu(/[#-'*+\--9=?A-Z^-~]/);function Hb(e){return e!==null&&(e<32||e===127)}const RT=uu(/\d/),K5e=uu(/[\dA-Fa-f]/),Z5e=uu(/[!-/:-@[-`{-~]/);function vt(e){return e!==null&&e<-2}function gn(e){return e!==null&&(e<0||e===32)}function Bt(e){return e===-2||e===-1||e===32}const ww=uu(new RegExp("\\p{P}|\\p{S}","u")),Ic=uu(/\s/);function uu(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function uh(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Jr(e.charCodeAt(n+1))&&Jr(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const a=e.charCodeAt(n+1);s<56320&&a>56319&&a<57344?(o=String.fromCharCode(s,a),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Kt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(l){return Bt(l)?(e.enter(n),a(l)):t(l)}function a(l){return Bt(l)&&s++<i?(e.consume(l),a):(e.exit(n),t(l))}}const Y5e={tokenize:Q5e};function Q5e(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Kt(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),s(a)}function s(a){const l=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=l),n=l,o(a)}function o(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return vt(a)?(e.consume(a),e.exit("chunkText"),s):(e.consume(a),o)}}const X5e={tokenize:J5e},v3={tokenize:eze};function J5e(e){const t=this,n=[];let r=0,i,s,o;return a;function a(C){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,l,u)(C)}return u(C)}function l(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const R=t.events.length;let P=R,k;for(;P--;)if(t.events[P][0]==="exit"&&t.events[P][1].type==="chunkFlow"){k=t.events[P][1].end;break}x(r);let I=R;for(;I<t.events.length;)t.events[I][1].end={...k},I++;return ts(t.events,P+1,0,t.events.slice(R)),t.events.length=I,u(C)}return a(C)}function u(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return v(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(v3,f,d)(C)}function f(C){return i&&S(),x(r),p(C)}function d(C){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,v(C)}function p(C){return t.containerState={},e.attempt(v3,m,v)(C)}function m(C){return r++,n.push([t.currentConstruct,t.containerState]),p(C)}function v(C){if(C===null){i&&S(),x(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),_(C)}function _(C){if(C===null){w(e.exit("chunkFlow"),!0),x(0),e.consume(C);return}return vt(C)?(e.consume(C),w(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),_)}function w(C,R){const P=t.sliceStream(C);if(R&&P.push(null),C.previous=s,s&&(s.next=C),s=C,i.defineSkip(C.start),i.write(P),t.parser.lazy[C.start.line]){let k=i.events.length;for(;k--;)if(i.events[k][1].start.offset<o&&(!i.events[k][1].end||i.events[k][1].end.offset>o))return;const I=t.events.length;let D=I,L,A;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){if(L){A=t.events[D][1].end;break}L=!0}for(x(r),k=I;k<t.events.length;)t.events[k][1].end={...A},k++;ts(t.events,D+1,0,t.events.slice(I)),t.events.length=k}}function x(C){let R=n.length;for(;R-- >C;){const P=n[R];t.containerState=P[1],P[0].exit.call(t,e)}n.length=C}function S(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function eze(e,t,n){return Kt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Qf(e){if(e===null||gn(e)||Ic(e))return 1;if(ww(e))return 2}function xw(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const IT={name:"attention",resolveAll:tze,tokenize:nze};function tze(e,t){let n=-1,r,i,s,o,a,l,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},p={...e[n][1].start};y3(d,-l),y3(p,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},a={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...o.start},end:{...a.end}},e[r][1].end={...o.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ps(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ps(u,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),u=Ps(u,xw(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ps(u,[["exit",s,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Ps(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,ts(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function nze(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Qf(r);let s;return o;function o(l){return s=l,e.enter("attentionSequence"),a(l)}function a(l){if(l===s)return e.consume(l),a;const u=e.exit("attentionSequence"),f=Qf(l),d=!f||f===2&&i||n.includes(l),p=!i||i===2&&f||n.includes(r);return u._open=!!(s===42?d:d&&(i||!p)),u._close=!!(s===42?p:p&&(f||!d)),t(l)}}function y3(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const rze={name:"autolink",tokenize:ize};function ize(e,t,n){let r=0;return i;function i(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(m){return gi(m)?(e.consume(m),o):m===64?n(m):u(m)}function o(m){return m===43||m===45||m===46||Jr(m)?(r=1,a(m)):u(m)}function a(m){return m===58?(e.consume(m),r=0,l):(m===43||m===45||m===46||Jr(m))&&r++<32?(e.consume(m),a):(r=0,u(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||Hb(m)?n(m):(e.consume(m),l)}function u(m){return m===64?(e.consume(m),f):G5e(m)?(e.consume(m),u):n(m)}function f(m){return Jr(m)?d(m):n(m)}function d(m){return m===46?(e.consume(m),r=0,f):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):p(m)}function p(m){if((m===45||Jr(m))&&r++<63){const v=m===45?p:d;return e.consume(m),v}return n(m)}}const Lg={partial:!0,tokenize:sze};function sze(e,t,n){return r;function r(s){return Bt(s)?Kt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||vt(s)?t(s):n(s)}}const HY={continuation:{tokenize:aze},exit:lze,name:"blockQuote",tokenize:oze};function oze(e,t,n){const r=this;return i;function i(o){if(o===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Bt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function aze(e,t,n){const r=this;return i;function i(o){return Bt(o)?Kt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(HY,t,n)(o)}}function lze(e){e.exit("blockQuote")}const qY={name:"characterEscape",tokenize:uze};function uze(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return Z5e(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const WY={name:"characterReference",tokenize:cze};function cze(e,t,n){const r=this;let i=0,s,o;return a;function a(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),l}function l(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),s=31,o=Jr,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=K5e,f):(e.enter("characterReferenceValue"),s=7,o=RT,f(d))}function f(d){if(d===59&&i){const p=e.exit("characterReferenceValue");return o===Jr&&!z2(r.sliceSerialize(p))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(d)&&i++<s?(e.consume(d),f):n(d)}}const b3={partial:!0,tokenize:fze},_3={concrete:!0,name:"codeFenced",tokenize:dze};function dze(e,t,n){const r=this,i={partial:!0,tokenize:P};let s=0,o=0,a;return l;function l(k){return u(k)}function u(k){const I=r.events[r.events.length-1];return s=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,a=k,e.enter("co
154deFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(k)}function f(k){return k===a?(o++,e.consume(k),f):o<3?n(k):(e.exit("codeFencedFenceSequence"),Bt(k)?Kt(e,d,"whitespace")(k):d(k))}function d(k){return k===null||vt(k)?(e.exit("codeFencedFence"),r.interrupt?t(k):e.check(b3,_,R)(k)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||vt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(k)):Bt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Kt(e,m,"whitespace")(k)):k===96&&k===a?n(k):(e.consume(k),p)}function m(k){return k===null||vt(k)?d(k):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),v(k))}function v(k){return k===null||vt(k)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(k)):k===96&&k===a?n(k):(e.consume(k),v)}function _(k){return e.attempt(i,R,w)(k)}function w(k){return e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),x}function x(k){return s>0&&Bt(k)?Kt(e,S,"linePrefix",s+1)(k):S(k)}function S(k){return k===null||vt(k)?e.check(b3,_,R)(k):(e.enter("codeFlowValue"),C(k))}function C(k){return k===null||vt(k)?(e.exit("codeFlowValue"),S(k)):(e.consume(k),C)}function R(k){return e.exit("codeFenced"),t(k)}function P(k,I,D){let L=0;return A;function A(H){return k.enter("lineEnding"),k.consume(H),k.exit("lineEnding"),$}function $(H){return k.enter("codeFencedFence"),Bt(H)?Kt(k,j,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):j(H)}function j(H){return H===a?(k.enter("codeFencedFenceSequence"),V(H)):D(H)}function V(H){return H===a?(L++,k.consume(H),V):L>=o?(k.exit("codeFencedFenceSequence"),Bt(H)?Kt(k,B,"whitespace")(H):B(H)):D(H)}function B(H){return H===null||vt(H)?(k.exit("codeFencedFence"),I(H)):D(H)}}}function fze(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const mE={name:"codeIndented",tokenize:pze},hze={partial:!0,tokenize:mze};function pze(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),Kt(e,s,"linePrefix",5)(u)}function s(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?o(u):n(u)}function o(u){return u===null?l(u):vt(u)?e.attempt(hze,o,l)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||vt(u)?(e.exit("codeFlowValue"),o(u)):(e.consume(u),a)}function l(u){return e.exit("codeIndented"),t(u)}}function mze(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):vt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Kt(e,s,"linePrefix",5)(o)}function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):vt(o)?i(o):n(o)}}const gze={name:"codeText",previous:yze,resolve:vze,tokenize:bze};function vze(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function yze(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function bze(e,t,n){let r=0,i,s;return o;function o(d){return e.enter("codeText"),e.enter("codeTextSequence"),a(d)}function a(d){return d===96?(e.consume(d),r++,a):(e.exit("codeTextSequence"),l(d))}function l(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),l):d===96?(s=e.enter("codeTextSequence"),i=0,f(d)):vt(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),l):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||vt(d)?(e.exit("codeTextData"),l(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(s.type="codeTextData",u(
vendor: 4,240 bytes, line 154
154d))}}class _ze{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&mp(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),mp(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mp(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);mp(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);mp(this.left,n.reverse())}}}function mp(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function GY(e){const t={};let n=-1,r,i,s,o,a,l,u;const f=new _ze(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(l=r[1]._tokenizer.events,s=0,s<l.length&&l[s][1].type==="lineEndingBlank"&&(s+=2),s<l.length&&l[s][1].type==="content"))for(;++s<l.length&&l[s][1].type!=="content";)l[s][1].type==="chunkText"&&(l[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,wze(f,n)),n=t[n],u=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=f.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return ts(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function wze(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const a=o.events,l=[],u={};let f,d,p=-1,m=n,v=0,_=0;const w=[_];for(;m;){for(;e.get(++i)[1]!==m;);s.push(i),m._tokenizer||(f=r.sliceStream(m),m.next||f.push(null),d&&o.defineSkip(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(f),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=m,m=m.next}for(m=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(_=p+1,w.push(_),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):w.pop(),p=w.length;p--;){const x=a.slice(w[p],w[p+1]),S=s.pop();l.push([S,S+x.length-1]),e.splice(S,2,x)}for(l.reverse(),p=-1;++p<l.length;)u[v+l[p][0]]=v+l[p][1],v+=l[p][1]-l[p][0]-1;return u}const xze={resolve:Eze,tokenize:Cze},Sze={partial:!0,tokenize:kze};function Eze(e){return GY(e),e}function Cze(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?s(a):vt(a)?e.check(Sze,o,s)(a):(e.consume(a),i)}function s(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function o(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function kze(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Kt
vendor: 17,364 bytes, line 154
154(e,s,"linePrefix")}function s(o){if(o===null||vt(o))return n(o);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function KY(e,t,n,r,i,s,o,a,l){const u=l||Number.POSITIVE_INFINITY;let f=0;return d;function d(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),p):x===null||x===32||x===41||Hb(x)?n(x):(e.enter(r),e.enter(o),e.enter(a),e.enter("chunkString",{contentType:"string"}),_(x))}function p(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),m(x))}function m(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||vt(x)?n(x):(e.consume(x),x===92?v:m)}function v(x){return x===60||x===62||x===92?(e.consume(x),m):m(x)}function _(x){return!f&&(x===null||x===41||gn(x))?(e.exit("chunkString"),e.exit(a),e.exit(o),e.exit(r),t(x)):f<u&&x===40?(e.consume(x),f++,_):x===41?(e.consume(x),f--,_):x===null||x===32||x===40||Hb(x)?n(x):(e.consume(x),x===92?w:_)}function w(x){return x===40||x===41||x===92?(e.consume(x),_):_(x)}}function ZY(e,t,n,r,i,s){const o=this;let a=0,l;return u;function u(m){return e.enter(r),e.enter(i),e.consume(m),e.exit(i),e.enter(s),f}function f(m){return a>999||m===null||m===91||m===93&&!l||m===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):vt(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||vt(m)||a++>999?(e.exit("chunkString"),f(m)):(e.consume(m),l||(l=!Bt(m)),m===92?p:d)}function p(m){return m===91||m===92||m===93?(e.consume(m),a++,d):d(m)}}function YY(e,t,n,r,i,s){let o;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),o=p===40?41:p,l):n(p)}function l(p){return p===o?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(s),u(p))}function u(p){return p===o?(e.exit(s),l(o)):p===null?n(p):vt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),Kt(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===o||p===null||vt(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?d:f)}function d(p){return p===o||p===92?(e.consume(p),f):f(p)}}function um(e,t){let n;return r;function r(i){return vt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Bt(i)?Kt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Tze={name:"definition",tokenize:Rze},Pze={partial:!0,tokenize:Ize};function Rze(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),o(m)}function o(m){return ZY.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function a(m){return i=co(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return gn(m)?um(e,u)(m):u(m)}function u(m){return KY(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function f(m){return e.attempt(Pze,d,d)(m)}function d(m){return Bt(m)?Kt(e,p,"whitespace")(m):p(m)}function p(m){return m===null||vt(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function Ize(e,t,n){return r;function r(a){return gn(a)?um(e,i)(a):n(a)}function i(a){return YY(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function s(a){return Bt(a)?Kt(e,o,"whitespace")(a):o(a)}function o(a){return a===null||vt(a)?t(a):n(a)}}const Oze={name:"hardBreakEscape",tokenize:Dze};function Dze(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return vt(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const Aze={name:"headingAtx",resolve:Mze,tokenize:Nze};function Mze(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ts(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function Nze(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),s(f)}function s(f){return e.enter("atxHeadingSequence"),o(f)}function o(f){return f===35&&r++<6?(e.consume(f),o):f===null||gn(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),l(f)):f===null||vt(f)?(e.exit("atxHeading"),t(f)):Bt(f)?Kt(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function l(f){return f===35?(e.consume(f),l):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||gn(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const jze=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],w3=["pre","script","style","textarea"],Lze={concrete:!0,name:"htmlFlow",resolveTo:zze,tokenize:Vze},Fze={partial:!0,tokenize:Bze},$ze={partial:!0,tokenize:Uze};function zze(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Vze(e,t,n){const r=this;let i,s,o,a,l;return u;function u(N){return f(N)}function f(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),d}function d(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),s=!0,_):N===63?(e.consume(N),i=3,r.interrupt?t:M):gi(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function p(N){return N===45?(e.consume(N),i=2,m):N===91?(e.consume(N),i=5,a=0,v):gi(N)?(e.consume(N),i=4,r.interrupt?t:M):n(N)}function m(N){return N===45?(e.consume(N),r.interrupt?t:M):n(N)}function v(N){const ee="CDATA[";return N===ee.charCodeAt(a++)?(e.consume(N),a===ee.length?r.interrupt?t:j:v):n(N)}function _(N){return gi(N)?(e.consume(N),o=String.fromCharCode(N),w):n(N)}function w(N){if(N===null||N===47||N===62||gn(N)){const ee=N===47,X=o.toLowerCase();return!ee&&!s&&w3.includes(X)?(i=1,r.interrupt?t(N):j(N)):jze.includes(o.toLowerCase())?(i=6,ee?(e.consume(N),x):r.interrupt?t(N):j(N)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):s?S(N):C(N))}return N===45||Jr(N)?(e.consume(N),o+=String.fromCharCode(N),w):n(N)}function x(N){return N===62?(e.consume(N),r.interrupt?t:j):n(N)}function S(N){return Bt(N)?(e.consume(N),S):A(N)}function C(N){return N===47?(e.consume(N),A):N===58||N===95||gi(N)?(e.consume(N),R):Bt(N)?(e.consume(N),C):A(N)}function R(N){return N===45||N===46||N===58||N===95||Jr(N)?(e.consume(N),R):P(N)}function P(N){return N===61?(e.consume(N),k):Bt(N)?(e.consume(N),P):C(N)}function k(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),l=N,I):Bt(N)?(e.consume(N),k):D(N)}function I(N){return N===l?(e.consume(N),l=null,L):N===null||vt(N)?n(N):(e.consume(N),I)}function D(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||gn(N)?P(N):(e.consume(N),D)}function L(N){return N===47||N===62||Bt(N)?C(N):n(N)}function A(N){return N===62?(e.consume(N),$):n(N)}function $(N){return N===null||vt(N)?j(N):Bt(N)?(e.consume(N),$):n(N)}function j(N){return N===45&&i===2?(e.consume(N),te):N===60&&i===1?(e.consume(N),G):N===62&&i===4?(e.consume(N),q):N===63&&i===3?(e.consume(N),M):N===93&&i===5?(e.consume(N),Y):vt(N)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Fze,z,V)(N)):N===null||vt(N)?(e.exit("htmlFlowData"),V(N)):(e.consume(N),j)}function V(N){return e.check($ze,B,z)(N)}function B(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),H}function H(N){return N===null||vt(N)?V(N):(e.enter("htmlFlowData"),j(N))}function te(N){return N===45?(e.consume(N),M):j(N)}function G(N){return N===47?(e.consume(N),o="",Z):j(N)}function Z(N){if(N===62){const ee=o.toLowerCase();return w3.includes(ee)?(e.consume(N),q):j(N)}return gi(N)&&o.length<8?(e.consume(N),o+=String.fromCharCode(N),Z):j(N)}function Y(N){return N===93?(e.consume(N),M):j(N)}function M(N){return N===62?(e.consume(N),q):N===45&&i===2?(e.consume(N),M):j(N)}function q(N){return N===null||vt(N)?(e.exit("htmlFlowData"),z(N)):(e.consume(N),q)}function z(N){return e.exit("htmlFlow"),t(N)}}function Uze(e,t,n){const r=this;return i;function i(o){return vt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function Bze(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Lg,t,n)}}const Hze={name:"htmlText",tokenize:qze};function qze(e,t,n){const r=this;let i,s,o;return a;function a(M){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(M),l}function l(M){return M===33?(e.consume(M),u):M===47?(e.consume(M),P):M===63?(e.consume(M),C):gi(M)?(e.consume(M),D):n(M)}function u(M){return M===45?(e.consume(M),f):M===91?(e.consume(M),s=0,v):gi(M)?(e.consume(M),S):n(M)}function f(M){return M===45?(e.consume(M),m):n(M)}function d(M){return M===null?n(M):M===45?(e.consume(M),p):vt(M)?(o=d,G(M)):(e.consume(M),d)}function p(M){return M===45?(e.consume(M),m):d(M)}function m(M){return M===62?te(M):M===45?p(M):d(M)}function v(M){const q="CDATA[";return M===q.charCodeAt(s++)?(e.consume(M),s===q.length?_:v):n(M)}function _(M){return M===null?n(M):M===93?(e.consume(M),w):vt(M)?(o=_,G(M)):(e.consume(M),_)}function w(M){return M===93?(e.consume(M),x):_(M)}function x(M){return M===62?te(M):M===93?(e.consume(M),x):_(M)}function S(M){return M===null||M===62?te(M):vt(M)?(o=S,G(M)):(e.consume(M),S)}function C(M){return M===null?n(M):M===63?(e.consume(M),R):vt(M)?(o=C,G(M)):(e.consume(M),C)}function R(M){return M===62?te(M):C(M)}function P(M){return gi(M)?(e.consume(M),k):n(M)}function k(M){return M===45||Jr(M)?(e.consume(M),k):I(M)}function I(M){return vt(M)?(o=I,G(M)):Bt(M)?(e.consume(M),I):te(M)}function D(M){return M===45||Jr(M)?(e.consume(M),D):M===47||M===62||gn(M)?L(M):n(M)}function L(M){return M===47?(e.consume(M),te):M===58||M===95||gi(M)?(e.consume(M),A):vt(M)?(o=L,G(M)):Bt(M)?(e.consume(M),L):te(M)}function A(M){return M===45||M===46||M===58||M===95||Jr(M)?(e.consume(M),A):$(M)}function $(M){return M===61?(e.consume(M),j):vt(M)?(o=$,G(M)):Bt(M)?(e.consume(M),$):L(M)}function j(M){return M===null||M===60||M===61||M===62||M===96?n(M):M===34||M===39?(e.consume(M),i=M,V):vt(M)?(o=j,G(M)):Bt(M)?(e.consume(M),j):(e.consume(M),B)}function V(M){return M===i?(e.consume(M),i=void 0,H):M===null?n(M):vt(M)?(o=V,G(M)):(e.consume(M),V)}function B(M){return M===null||M===34||M===39||M===60||M===61||M===96?n(M):M===47||M===62||gn(M)?L(M):(e.consume(M),B)}function H(M){return M===47||M===62||gn(M)?L(M):n(M)}function te(M){return M===62?(e.consume(M),e.exit("htmlTextData"),e.exit("htmlText"),t):n(M)}function G(M){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),Z}function Z(M){return Bt(M)?Kt(e,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):Y(M)}function Y(M){return e.enter("htmlTextData"),o(M)}}const V2={name:"labelEnd",resolveAll:Zze,resolveTo:Yze,tokenize:Qze},Wze={tokenize:Xze},Gze={tokenize:Jze},Kze={tokenize:e6e};function Zze(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ts(e,0,e.length,n),e}function Yze(e,t){let n=e.length,r=0,i,s,o,a;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const l={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},f={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return a=[["enter",l,t],["enter",u,t]],a=Ps(a,e.slice(s+1,s+r+3)),a=Ps(a,[["enter",f,t]]),a=Ps(a,xw(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),a=Ps(a,[["exit",f,t],e[o-2],e[o-1],["exit",u,t]]),a=Ps(a,e.slice(o+1)),a=Ps(a,[["exit",l,t]]),ts(e,s,e.length,a),e}function Qze(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return a;function a(p){return s?s._inactive?d(p):(o=r.parser.defined.includes(co(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),l):n(p)}function l(p){return p===40?e.attempt(Wze,f,o?f:d)(p):p===91?e.attempt(Gze,f,o?u:d)(p):o?f(p):d(p)}function u(p){return e.attempt(Kze,f,d)(p)}function f(p){return t(p)}function d(p){return s._balanced=!0,n(p)}}function Xze(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return gn(d)?um(e,s)(d):s(d)}function s(d){return d===41?f(d):KY(e,o,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function o(d){return gn(d)?um(e,l)(d):f(d)}function a(d){return n(d)}function l(d){return d===34||d===39||d===40?YY(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return gn(d)?um(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function Jze(e,t,n){const r=this;return i;function i(a){return ZY.call(r,e,s,o,"reference","referenceMarker","referenceString")(a)}function s(a){return r.parser.defined.includes(co(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function o(a){return n(a)}}function e6e(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const t6e={name:"labelStartImage",resolveAll:V2.resolveAll,tokenize:n6e};function n6e(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),s}function s(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),o):n(a)}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const r6e={name:"labelStartLink",resolveAll:V2.resolveAll,tokenize:i6e};function i6e(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const gE={name:"lineEnding",tokenize:s6e};function s6e(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Kt(e,t,"linePrefix")}}const C0={name:"thematicBreak",tokenize:o6e};function o6e(e,t,n){let r=0,i;return s;function s(u){return e.enter("thematicBreak"),o(u)}function o(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),l(u)):r>=3&&(u===null||vt(u))?(e.exit("thematicBreak"),t(u)):n(u)}function l(u){return u===i?(e.consume(u),r++,l):(e.exit("thematicBreakSequence"),Bt(u)?Kt(e,a,"whitespace")(u):a(u))}}const Ii={continuation:{tokenize:c6e},exit:f6e,name:"list",tokenize:u6e},a6e={partial:!0,tokenize:h6e},l6e={partial:!0,tokenize:d6e};function u6e(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(m){const v=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:RT(m)){if(r.containerState.type||(r.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(C0,n,u)(m):u(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return RT(m)&&++o<10?(e.consume(m),l):(!r.interrupt||o<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),u(m)):n(m)}function u(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(Lg,r.interrupt?n:f,e.attempt(a6e,p,d))}
vendor: 9,858 bytes, lines 154-156
154function f(m){return r.containerState.initialBlankLine=!0,s++,p(m)}function d(m){return Bt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),p):n(m)}function p(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function c6e(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Lg,i,s);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Kt(e,t,"listItemIndent",r.containerState.size+1)(a)}function s(a){return r.containerState.furtherBlankLines||!Bt(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(l6e,t,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,Kt(e,e.attempt(Ii,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function d6e(e,t,n){const r=this;return Kt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function f6e(e){e.exit(this.containerState.type)}function h6e(e,t,n){const r=this;return Kt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Bt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const x3={name:"setextUnderline",resolveTo:p6e,tokenize:m6e};function p6e(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function m6e(e,t,n){const r=this;let i;return s;function s(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,o(u)):n(u)}function o(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),Bt(u)?Kt(e,l,"lineSuffix")(u):l(u))}function l(u){return u===null||vt(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const g6e={tokenize:v6e};function v6e(e){const t=this,n=e.attempt(Lg,r,e.attempt(this.parser.constructs.flowInitial,i,Kt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(xze,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const y6e={resolveAll:XY()},b6e=QY("string"),_6e=QY("text");function QY(e){return{resolveAll:XY(e==="text"?w6e:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,a);return o;function o(f){return u(f)?s(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),l}function l(f){return u(f)?(n.exit("data"),s(f)):(n.consume(f),l)}function u(f){if(f===null)return!0;const d=i[f];let p=-1;if(d)for(;++p<d.length;){const m=d[p];if(!m.previous||m.previous.call(r,r.previous))return!0}return!1}}}function XY(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function w6e(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,a=0,l;for(;s--;){const u=i[s];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)a++,o--;if(o)break;o=-1}else if(u===-2)l=!0,a++;else if(u!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||l||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const x6e={42:Ii,43:Ii,45:Ii,48:Ii,49:Ii,50:Ii,51:Ii,52:Ii,53:Ii,54:Ii,55:Ii,56:Ii,57:Ii,62:HY},S6e={91:Tze},E6e={[-2]:mE,[-1]:mE,32:mE},C6e={35:Aze,42:C0,45:[x3,C0],60:Lze,61:x3,95:C0,96:_3,126:_3},k6e={38:WY,92:qY},T6e={[-5]:gE,[-4]:gE,[-3]:gE,33:t6e,38:WY,42:IT,60:[rze,Hze],91:r6e,92:[Oze,qY],93:V2,95:IT,96:gze},P6e={null:[IT,y6e]},R6e={null:[42,95]},I6e={null:[]},O6e=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:R6e,contentInitial:S6e,disable:I6e,document:x6e,flow:C6e,flowInitial:E6e,insideSpan:P6e,string:k6e,text:T6e},Symbol.toStringTag,{value:"Module"}));function D6e(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],a=[];const l={attempt:I(P),check:I(k),consume:S,enter:C,exit:R,interrupt:I(k,{interrupt:!0})},u={code:null,containerState:{},defineSkip:_,events:[],now:v,parser:e,previous:null,sliceSerialize:p,sliceStream:m,write:d};let f=t.tokenize.call(u,l);return t.resolveAll&&s.push(t),u;function d($){return o=Ps(o,$),w(),o[o.length-1]!==null?[]:(D(t,0),u.events=xw(s,u.events,u),u.events)}function p($,j){return M6e(m($),j)}function m($){return A6e(o,$)}function v(){const{_bufferIndex:$,_index:j,line:V,column:B,offset:H}=r;return{_bufferIndex:$,_index:j,line:V,column:B,offset:H}}function _($){i[$.line]=$.column,A()}function w(){let $;for(;r._index<o.length;){const j=o[r._index];if(typeof j=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<j.length;)x(j.charCodeAt(r._bufferIndex));else x(j)}}function x($){f=f($)}function S($){vt($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,A()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=$}function C($,j){const V=j||{};return V.type=$,V.start=v(),u.events.push(["enter",V,u]),a.push(V),V}function R($){const j=a.pop();return j.end=v(),u.events.push(["exit",j,u]),j}function P($,j){D($,j.from)}function k($,j){j.restore()}function I($,j){return V;function V(B,H,te){let G,Z,Y,M;return Array.isArray(B)?z(B):"tokenize"in B?z([B]):q(B);function q(ne){return ae;function ae(se){const ce=se!==null&&ne[se],fe=se!==null&&ne.null,ke=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(fe)?fe:fe?[fe]:[]];return z(ke)(se)}}function z(ne){return G=ne,Z=0,ne.length===0?te:N(ne[Z])}function N(ne){return ae;function ae(se){return M=L(),Y=ne,ne.partial||(u.currentConstruct=ne),ne.name&&u.parser.constructs.disable.null.includes(ne.name)?X():ne.tokenize.call(j?Object.assign(Object.create(u),j):u,l,ee,X)(se)}}function ee(ne){return $(Y,M),H}function X(ne){return M.restore(),++Z<G.length?N(G[Z]):te}}}function D($,j){$.resolveAll&&!s.includes($)&&s.push($),$.resolve&&ts(u.events,j,u.events.length-j,$.resolve(u.events.slice(j),u)),$.resolveTo&&(u.events=$.resolveTo(u.events,u))}function L(){const $=v(),j=u.previous,V=u.currentConstruct,B=u.events.length,H=Array.from(a);return{from:B,restore:te};function te(){r=$,u.previous=j,u.currentConstruct=V,u.events.length=B,a=H,A()}}function A(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function A6e(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function M6e(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
155`;break}case-3:{o=`\r
156`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function N6e(e){const r={constructs:UY([O6e,...(e||{}).extensions||[]]),content:i(Y5e),defined:[],document:i(X5e),flow:i(g6e),lazy:{},string:i(b6e),text:i(_6e)};return r;function i(s){return o;function o(a){return D6e(r,s,a)}}}function j6e(e){for(;!GY(e););return e}const S3=/[\0\t\n\r]/g;function L6e(){let e=1,t="",n=!0,r;return i;function i(s,o,a){const l=[];let u,f,d,p,m;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),d=0,t="",n&&(s.charCodeAt(0)===65279&&d++,n=void 0);d<s.length;){if(S3.lastIndex=d,u=S3.exec(s),p=u&&u.index!==void 0?u.index:s.length,m=s.charCodeAt(p),!u){t=s.slice(d);break}if(m===10&&d===p&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<p&&(l.push(s.slice(d,p)),e+=p-d),m){case 0:{l.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,l.push(-2);e++<f;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=p+1}return a&&(r&&l.push(-5),t&&l.push(t),l.push(null)),l}}const F6e=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $6e(e){return e.replace(F6e,z6e)}function z6e(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return BY(n.slice(s?2:1),s?16:10)}return z2(n)||e}const JY={}.hasOwnProperty;function V6e(e,t,n){return typeof t!="string"&&(n=t,t=void 0),U6e(n)(j6e(N6e(n).document().write(L6e()(e,t,!0))
vendor: 14,555 bytes, lines 156-158
156))}function U6e(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(ie),autolinkProtocol:L,autolinkEmail:L,atxHeading:s(Be),blockQuote:s(fe),characterEscape:L,characterReference:L,codeFenced:s(ke),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ke,o),codeText:s(Ce,o),codeTextData:L,data:L,codeFlowValue:L,definition:s(Se),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Fe),hardBreakEscape:s(wt),hardBreakTrailing:s(wt),htmlFlow:s(ht,o),htmlFlowData:L,htmlText:s(ht,o),htmlTextData:L,image:s(W),label:o,link:s(ie),listItem:s(Re),listItemValue:p,listOrdered:s(ue,d),listUnordered:s(ue),paragraph:s(Ee),reference:N,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Be),strong:s(xe),thematicBreak:s(Ze)},exit:{atxHeading:l(),atxHeadingSequence:P,autolink:l(),autolinkEmail:ce,autolinkProtocol:se,blockQuote:l(),characterEscapeValue:A,characterReferenceMarkerHexadecimal:X,characterReferenceMarkerNumeric:X,characterReferenceValue:ne,characterReference:ae,codeFenced:l(w),codeFencedFence:_,codeFencedFenceInfo:m,codeFencedFenceMeta:v,codeFlowValue:A,codeIndented:l(x),codeText:l(H),codeTextData:A,data:A,definition:l(),definitionDestinationString:R,definitionLabelString:S,definitionTitleString:C,emphasis:l(),hardBreakEscape:l(j),hardBreakTrailing:l(j),htmlFlow:l(V),htmlFlowData:A,htmlText:l(B),htmlTextData:A,image:l(G),label:Y,labelText:Z,lineEnding:$,link:l(te),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:ee,resourceDestinationString:M,resourceTitleString:q,resource:z,setextHeading:l(D),setextHeadingLineSequence:I,setextHeadingText:k,strong:l(),thematicBreak:l()}};eQ(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(he){let we={type:"root",children:[]};const We={stack:[we],tokenStack:[],config:t,enter:a,exit:u,buffer:o,resume:f,data:n},Et=[];let jt=-1;for(;++jt<he.length;)if(he[jt][1].type==="listOrdered"||he[jt][1].type==="listUnordered")if(he[jt][0]==="enter")Et.push(jt);else{const Sn=Et.pop();jt=i(he,Sn,jt)}for(jt=-1;++jt<he.length;){const Sn=t[he[jt][0]];JY.call(Sn,he[jt][1].type)&&Sn[he[jt][1].type].call(Object.assign({sliceSerialize:he[jt][2].sliceSerialize},We),he[jt][1])}if(We.tokenStack.length>0){const Sn=We.tokenStack[We.tokenStack.length-1];(Sn[1]||E3).call(We,void 0,Sn[0])}for(we.position={start:xl(he.length>0?he[0][1].start:{line:1,column:1,offset:0}),end:xl(he.length>0?he[he.length-2][1].end:{line:1,column:1,offset:0})},jt=-1;++jt<t.transforms.length;)we=t.transforms[jt](we)||we;return we}function i(he,we,We){let Et=we-1,jt=-1,Sn=!1,zi,En,Vi,Ui;for(;++Et<=We;){const sr=he[Et];switch(sr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{sr[0]==="enter"?jt++:jt--,Ui=void 0;break}case"lineEndingBlank":{sr[0]==="enter"&&(zi&&!Ui&&!jt&&!Vi&&(Vi=Et),Ui=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ui=void 0}if(!jt&&sr[0]==="enter"&&sr[1].type==="listItemPrefix"||jt===-1&&sr[0]==="exit"&&(sr[1].type==="listUnordered"||sr[1].type==="listOrdered")){if(zi){let us=Et;for(En=void 0;us--;){const Vr=he[us];if(Vr[1].type==="lineEnding"||Vr[1].type==="lineEndingBlank"){if(Vr[0]==="exit")continue;En&&(he[En][1].type="lineEndingBlank",Sn=!0),Vr[1].type="lineEnding",En=us}else if(!(Vr[1].type==="linePrefix"||Vr[1].type==="blockQuotePrefix"||Vr[1].type==="blockQuotePrefixWhitespace"||Vr[1].type==="blockQuoteMarker"||Vr[1].type==="listItemIndent"))break}Vi&&(!En||Vi<En)&&(zi._spread=!0),zi.end=Object.assign({},En?he[En][1].start:sr[1].end),he.splice(En||Et,0,["exit",zi,sr[2]]),Et++,We++}if(sr[1].type==="listItemPrefix"){const us={type:"listItem",_spread:!1,start:Object.assign({},sr[1].start),end:void 0};zi=us,he.splice(Et,0,["enter",us,sr[2]]),Et++,We++,Vi=void 0,Ui=!0}}}return he[we][1]._spread=Sn,We}function s(he,we){return We;function We(Et){a.call(this,he(Et),Et),we&&we.call(this,Et)}}function o(){this.stack.push({type:"fragment",children:[]})}function a(he,we,We){this.stack[this.stack.length-1].children.push(he),this.stack.push(he),this.tokenStack.push([we,We||void 0]),he.position={start:xl(we.start),end:void 0}}function l(he){return we;function we(We){he&&he.call(this,We),u.call(this,We)}}function u(he,we){const We=this.stack.pop(),Et=this.tokenStack.pop();if(Et)Et[0].type!==he.type&&(we?we.call(this,he,Et[0]):(Et[1]||E3).call(this,he,Et[0]));else throw new Error("Cannot close `"+he.type+"` ("+lm({start:he.start,end:he.end})+"): it’s not open");We.position.end=xl(he.end)}function f(){return $2(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function p(he){if(this.data.expectingFirstListItemValue){const we=this.stack[this.stack.length-2];we.start=Number.parseInt(this.sliceSerialize(he),10),this.data.expectingFirstListItemValue=void 0}}function m(){const he=this.resume(),we=this.stack[this.stack.length-1];we.lang=he}function v(){const he=this.resume(),we=this.stack[this.stack.length-1];we.meta=he}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function w(){const he=this.resume(),we=this.stack[this.stack.length-1];we.value=he.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const he=this.resume(),we=this.stack[this.stack.length-1];we.value=he.replace(/(\r?\n|\r)$/g,"")}function S(he){const we=this.resume(),We=this.stack[this.stack.length-1];We.label=we,We.identifier=co(this.sliceSerialize(he)).toLowerCase()}function C(){const he=this.resume(),we=this.stack[this.stack.length-1];we.title=he}function R(){const he=this.resume(),we=this.stack[this.stack.length-1];we.url=he}function P(he){const we=this.stack[this.stack.length-1];if(!we.depth){const We=this.sliceSerialize(he).length;we.depth=We}}function k(){this.data.setextHeadingSlurpLineEnding=!0}function I(he){const we=this.stack[this.stack.length-1];we.depth=this.sliceSerialize(he).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function L(he){const We=this.stack[this.stack.length-1].children;let Et=We[We.length-1];(!Et||Et.type!=="text")&&(Et=ze(),Et.position={start:xl(he.start),end:void 0},We.push(Et)),this.stack.push(Et)}function A(he){const we=this.stack.pop();we.value+=this.sliceSerialize(he),we.position.end=xl(he.end)}function $(he){const we=this.stack[this.stack.length-1];if(this.data.atHardBreak){const We=we.children[we.children.length-1];We.position.end=xl(he.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(we.type)&&(L.call(this,he),A.call(this,he))}function j(){this.data.atHardBreak=!0}function V(){const he=this.resume(),we=this.stack[this.stack.length-1];we.value=he}function B(){const he=this.resume(),we=this.stack[this.stack.length-1];we.value=he}function H(){const he=this.resume(),we=this.stack[this.stack.length-1];we.value=he}function te(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=we,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function G(){const he=this.stack[this.stack.length-1];if(this.data.inReference){const we=this.data.referenceType||"shortcut";he.type+="Reference",he.referenceType=we,delete he.url,delete he.title}else delete he.identifier,delete he.label;this.data.referenceType=void 0}function Z(he){const we=this.sliceSerialize(he),We=this.stack[this.stack.length-2];We.label=$6e(we),We.identifier=co(we).toLowerCase()}function Y(){const he=this.stack[this.stack.length-1],we=this.resume(),We=this.stack[this.stack.length-1];if(this.data.inReference=!0,We.type==="link"){const Et=he.children;We.children=Et}else We.alt=we}function M(){const he=this.resume(),we=this.stack[this.stack.length-1];we.url=he}function q(){const he=this.resume(),we=this.stack[this.stack.length-1];we.title=he}function z(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ee(he){const we=this.resume(),We=this.stack[this.stack.length-1];We.label=we,We.identifier=co(this.sliceSerialize(he)).toLowerCase(),this.data.referenceType="full"}function X(he){this.data.characterReferenceType=he.type}function ne(he){const we=this.sliceSerialize(he),We=this.data.characterReferenceType;let Et;We?(Et=BY(we,We==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Et=z2(we);const jt=this.stack[this.stack.length-1];jt.value+=Et}function ae(he){const we=this.stack.pop();we.position.end=xl(he.end)}function se(he){A.call(this,he);const we=this.stack[this.stack.length-1];we.url=this.sliceSerialize(he)}function ce(he){A.call(this,he);const we=this.stack[this.stack.length-1];we.url="mailto:"+this.sliceSerialize(he)}function fe(){return{type:"blockquote",children:[]}}function ke(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function Se(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Fe(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function wt(){return{type:"break"}}function ht(){return{type:"html",value:""}}function W(){return{type:"image",title:null,url:"",alt:null}}function ie(){return{type:"link",title:null,url:"",children:[]}}function ue(he){return{type:"list",ordered:he.type==="listOrdered",start:null,spread:he._spread,children:[]}}function Re(he){return{type:"listItem",spread:he._spread,checked:null,children:[]}}function Ee(){return{type:"paragraph",children:[]}}function xe(){return{type:"strong",children:[]}}function ze(){return{type:"text",value:""}}function Ze(){return{type:"thematicBreak"}}}function xl(e){return{line:e.line,column:e.column,offset:e.offset}}function eQ(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?eQ(e,r):B6e(e,r)}}function B6e(e,t){let n;for(n in t)if(JY.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function E3(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+lm({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+lm({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+lm({start:t.start,end:t.end})+") is still open")}function H6e(e){const t=this;t.parser=n;function n(r){return V6e(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function q6e(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function W6e(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
157`}]}function G6e(e,t){const n=t.value?t.value+`
158`:"",r={};t.lang&&(r.className=["language-"+t.lang]);let i={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(i.data={meta:t.meta}),e.patch(t,i),i=e.applyData(t,i),i={type:"element",tagName:"pre",properties:{},children:[i]},e.patch(t,i),i}function K6e(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z6e(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y6e(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=uh(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,a=e.footnoteCounts.get(r);a===void 0?(a=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,a+=1,e.footnoteCounts.set(r,a);const l={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(a>1?"-"+a:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,l);const u={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,u),e.applyData(t,u)}function Q6e(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function X6e(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function tQ(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function J6e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tQ(e,t);const i={src:uh(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function e9e(e,t){const n={src:uh(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function t9e(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function n9e(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tQ(e,t);const i={href:uh(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function r9e(e,t){const n={href:uh(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function i9e(e,t,n){const r=e.all(t),i=n?s9e(n):nQ(t),s={},o=[];if(typeof t.checked=="boolean"){const f=r[0];let d;f&&f.type==="element"&&f.tagName==="p"?d=f:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let a=-1;for(;++a<r.length;
vendor: 8,018 bytes, lines 158-161
158){const f=r[a];(i||a!==0||f.type!=="element"||f.tagName!=="p")&&o.push({type:"text",value:`
159`}),f.type==="element"&&f.tagName==="p"&&!i?o.push(...f.children):o.push(f)}const l=r[r.length-1];l&&(i||l.type!=="element"||l.tagName!=="p")&&o.push({type:"text",value:`
160`});const u={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,u),e.applyData(t,u)}function s9e(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=nQ(n[r])}return t}function nQ(e){const t=e.spread;return t??e.children.length>1}function o9e(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function a9e(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l9e(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function u9e(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function c9e(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=N2(t.children[1]),l=NY(t.children[t.children.length-1]);a&&l&&(o.position={start:a,end:l}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function d9e(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,a=o?o.length:t.children.length;let l=-1;const u=[];for(;++l<a;){const d=t.children[l],p={},m=o?o[l]:void 0;m&&(p.align=m);let v={type:"element",tagName:s,properties:p,children:[]};d&&(v.children=e.all(d),e.patch(d,v),v=e.applyData(d,v)),u.push(v)}const f={type:"element",tagName:"tr",properties:{},children:e.wrap(u,!0)};return e.patch(t,f),e.applyData(t,f)}function f9e(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const C3=9,k3=32;function h9e(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(T3(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(T3(t.slice(i),i>0,!1)),s.join("")}function T3(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===C3||s===k3;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===C3||s===k3;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function p9e(e,t){const n={type:"text",value:h9e(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function m9e(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const g9e={blockquote:q6e,break:W6e,code:G6e,delete:K6e,emphasis:Z6e,footnoteReference:Y6e,heading:Q6e,html:X6e,imageReference:J6e,image:e9e,inlineCode:t9e,linkReference:n9e,link:r9e,listItem:i9e,list:o9e,paragraph:a9e,root:l9e,strong:u9e,table:c9e,tableCell:f9e,tableRow:d9e,text:p9e,thematicBreak:m9e,toml:$y,yaml:$y,definition:$y,footnoteDefinition:$y};function $y(){}const rQ=-1,Sw=0,cm=1,qb=2,U2=3,B2=4,H2=5,q2=6,iQ=7,sQ=8,P3=typeof self=="object"?self:globalThis,v9e=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Sw:case rQ:return n(o,i);case cm:{const a=n([],i);for(const l of o)a.push(r(l));return a}case qb:{const a=n({},i);for(const[l,u]of o)a[r(l)]=r(u);return a}case U2:return n(new Date(o),i);case B2:{const{source:a,flags:l}=o;return n(new RegExp(a,l),i)}case H2:{const a=n(new Map,i);for(const[l,u]of o)a.set(r(l),r(u));return a}case q2:{const a=n(new Set,i);for(const l of o)a.add(r(l));return a}case iQ:{const{name:a,message:l}=o;return n(new P3[a](l),i)}case sQ:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:a}=new Uint8Array(o);return n(new DataView(a),o)}}return n(new P3[s](o),i)};return r},R3=e=>v9e(new Map,e)(0),Ld="",{toString:y9e}={},{keys:b9e}=Object,gp=e=>{const t=typeof e;if(t!=="object"||!e)return[Sw,t];const n=y9e.call(e).slice(8,-1);switch(n){case"Array":return[cm,Ld];case"Object":return[qb,Ld];case"Date":return[U2,Ld];case"RegExp":return[B2,Ld];case"Map":return[H2,Ld];case"Set":return[q2,Ld];case"DataView":return[cm,n]}return n.includes("Array")?[cm,n]:n.includes("Error")?[iQ,n]:[qb,n]},zy=([e,t])=>e===Sw&&(t==="function"||t==="symbol"),_9e=(e,t,n,r)=>{const i=(o,a)=>{const l=r.push(o)-1;return n.set(a,l),l},s=o=>{if(n.has(o))return n.get(o);let[a,l]=gp(o);switch(a){case Sw:{let f=o;switch(l){case"bigint":a=sQ,f=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);f=null;break;case"undefined":return i([rQ],o)}return i([a,f],o)}case cm:{if(l){let p=o;return l==="DataView"?p=new Uint8Array(o.buffer):l==="ArrayBuffer"&&(p=new Uint8Array(o)),i([l,[...p]],o)}const f=[],d=i([a,f],o);for(const p of o)f.push(s(p));return d}case qb:{if(l)switch(l){case"BigInt":return i([l,o.toString()],o);case"Boolean":case"Number":case"String":return i([l,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const f=[],d=i([a,f],o);for(const p of b9e(o))(e||!zy(gp(o[p])))&&f.push([s(p),s(o[p])]);return d}case U2:return i([a,o.toISOString()],o);case B2:{const{source:f,flags:d}=o;return i([a,{source:f,flags:d}],o)}case H2:{const f=[],d=i([a,f],o);for(const[p,m]of o)(e||!(zy(gp(p))||zy(gp(m))))&&f.push([s(p),s(m)]);return d}case q2:{const f=[],d=i([a,f],o);for(const p of o)(e||!zy(gp(p)))&&f.push(s(p));return d}}const{message:u}=o;return i([a,{name:l,message:u}],o)};return s},I3=(e,{json:t,lossy:n}={})=>{const r=[];return _9e(!(t||n),!!t,new Map,r)(e),r},Wb=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?R3(I3(e,t)):structuredClone(e):(e,t)=>R3(I3(e,t));function w9e(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function x9e(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function S9e(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||w9e,r=e.options.footnoteBackLabel||x9e,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},a=[];let l=-1;for(;++l<e.footnoteOrder.length;){const u=e.footnoteById.get(e.footnoteOrder[l]);if(!u)continue;const f=e.all(u),d=String(u.identifier).toUpperCase(),p=uh(d.toLowerCase());let m=0;const v=[],_=e.footnoteCounts.get(d);for(;_!==void 0&&++m<=_;){v.length>0&&v.push({type:"text",value:" "});let S=typeof n=="string"?n:n(l,m);typeof S=="string"&&(S={type:"text",value:S}),v.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+p+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const w=f[f.length-1];if(w&&w.type==="element"&&w.tagName==="p"){const S=w.children[w.children.length-1];S&&S.type==="text"?S.value+=" ":w.children.push({type:"text",value:" "}),w.children.push(...v)}else f.push(...v);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+p},children:e.wrap(f,!0)};e.patch(u,x),a.push(x)}if(a.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Wb(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
161`},{type:"element",tagName:"ol",properties:{},children:e.wrap(a,!0)}
vendor: 4,329 bytes, lines 161-166
161,{type:"text",value:`
162`}]}}const Ew=(function(e){if(e==null)return T9e;if(typeof e=="function")return Cw(e);if(typeof e=="object")return Array.isArray(e)?E9e(e):C9e(e);if(typeof e=="string")return k9e(e);throw new Error("Expected function, string, or object as test")});function E9e(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ew(e[n]);return Cw(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function C9e(e){const t=e;return Cw(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function k9e(e){return Cw(t);function t(n){return n&&n.type===e}}function Cw(e){return t;function t(n,r,i){return!!(P9e(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function T9e(){return!0}function P9e(e){return e!==null&&typeof e=="object"&&"type"in e}const oQ=[],R9e=!0,OT=!1,I9e="skip";function aQ(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Ew(i),o=r?-1:1;a(e,void 0,[])();function a(l,u,f){const d=l&&typeof l=="object"?l:{};if(typeof d.type=="string"){const m=typeof d.tagName=="string"?d.tagName:typeof d.name=="string"?d.name:void 0;Object.defineProperty(p,"name",{value:"node ("+(l.type+(m?"<"+m+">":""))+")"})}return p;function p(){let m=oQ,v,_,w;if((!t||s(l,u,f[f.length-1]||void 0))&&(m=O9e(n(l,f)),m[0]===OT))return m;if("children"in l&&l.children){const x=l;if(x.children&&m[0]!==I9e)for(_=(r?x.children.length:-1)+o,w=f.concat(x);_>-1&&_<x.children.length;){const S=x.children[_];if(v=a(S,_,w)(),v[0]===OT)return v;_=typeof v[1]=="number"?v[1]:_+o}}return m}}}function O9e(e){return Array.isArray(e)?e:typeof e=="number"?[R9e,e]:e==null?oQ:[e]}function W2(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),aQ(e,s,a,i);function a(l,u){const f=u[u.length-1],d=f?f.children.indexOf(l):void 0;return o(l,d,f)}}const DT={}.hasOwnProperty,D9e={};function A9e(e,t){const n=t||D9e,r=new Map,i=new Map,s=new Map,o={...g9e,...n.handlers},a={all:u,applyData:N9e,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:l,options:n,patch:M9e,wrap:L9e};return W2(e,function(f){if(f.type==="definition"||f.type==="footnoteDefinition"){const d=f.type==="definition"?r:i,p=String(f.identifier).toUpperCase();d.has(p)||d.set(p,f)}}),a;function l(f,d){const p=f.type,m=a.handlers[p];if(DT.call(a.handlers,p)&&m)return m(a,f,d);if(a.options.passThrough&&a.options.passThrough.includes(p)){if("children"in f){const{children:_,...w}=f,x=Wb(w);return x.children=a.all(f),x}return Wb(f)}return(a.options.unknownHandler||j9e)(a,f,d)}function u(f){const d=[];if("children"in f){const p=f.children;let m=-1;for(;++m<p.length;){const v=a.one(p[m],f);if(v){if(m&&p[m-1].type==="break"&&(!Array.isArray(v)&&v.type==="text"&&(v.value=O3(v.value)),!Array.isArray(v)&&v.type==="element")){const _=v.children[0];_&&_.type==="text"&&(_.value=O3(_.value))}Array.isArray(v)?d.push(...v):d.push(v)}}}return d}}function M9e(e,t){e.position&&(t.position=x5e(e))}function N9e(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,Wb(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function j9e(e,t){const n=t.data||{},r="value"in t&&!(DT.call(n,"hProperties")||DT.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function L9e(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
163`});++r<e.length;)r&&n.push({type:"text",value:`
164`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
165`}),n}function O3(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function D3(e,t){const n=A9e(e,t),r=n.one(e,void 0),i=S9e(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
166`},i),s}function F9e(e,t){return e&&"run"in e?async function(n,r){const i=D3(n,{file:r,...t});await e.run(i,r)}:function(n,r){return D3(n,{file:r,...e||t})}}function A3(e){if(e)throw e}var vE,M3;function $9e(){if(M3)return vE;
vendor: 10,662 bytes, line 166
166M3=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=function(u){return typeof Array.isArray=="function"?Array.isArray(u):t.call(u)==="[object Array]"},s=function(u){if(!u||t.call(u)!=="[object Object]")return!1;var f=e.call(u,"constructor"),d=u.constructor&&u.constructor.prototype&&e.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!f&&!d)return!1;var p;for(p in u);return typeof p>"u"||e.call(u,p)},o=function(u,f){n&&f.name==="__proto__"?n(u,f.name,{enumerable:!0,configurable:!0,value:f.newValue,writable:!0}):u[f.name]=f.newValue},a=function(u,f){if(f==="__proto__")if(e.call(u,f)){if(r)return r(u,f).value}else return;return u[f]};return vE=function l(){var u,f,d,p,m,v,_=arguments[0],w=1,x=arguments.length,S=!1;for(typeof _=="boolean"&&(S=_,_=arguments[1]||{},w=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});w<x;++w)if(u=arguments[w],u!=null)for(f in u)d=a(_,f),p=a(u,f),_!==p&&(S&&p&&(s(p)||(m=i(p)))?(m?(m=!1,v=d&&i(d)?d:[]):v=d&&s(d)?d:{},o(_,{name:f,newValue:l(S,v,p)})):typeof p<"u"&&o(_,{name:f,newValue:p}));return _},vE}var z9e=$9e();const yE=vo(z9e);function AT(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function V9e(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);a(null,...i);function a(l,...u){const f=e[++s];let d=-1;if(l){o(l);return}for(;++d<i.length;)(u[d]===null||u[d]===void 0)&&(u[d]=i[d]);i=u,f?U9e(f,a)(...u):o(null,...u)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function U9e(e,t){let n;return r;function r(...o){const a=e.length>o.length;let l;a&&o.push(i);try{l=e.apply(this,o)}catch(u){const f=u;if(a&&n)throw f;return i(f)}a||(l&&l.then&&typeof l.then=="function"?l.then(s,i):l instanceof Error?i(l):s(l))}function i(o,...a){n||(n=!0,t(o,...a))}function s(o){i(null,o)}}const Io={basename:B9e,dirname:H9e,extname:q9e,join:W9e,sep:"/"};function B9e(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Fg(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,a=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),a>-1&&(e.codePointAt(i)===t.codePointAt(a--)?a<0&&(r=i):(a=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function H9e(e){if(Fg(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function q9e(e){Fg(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const a=e.codePointAt(t);if(a===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),a===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function W9e(...e){let t=-1,n;for(;++t<e.length;)Fg(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":G9e(n)}function G9e(e){Fg(e);const t=e.codePointAt(0)===47;let n=K9e(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function K9e(e,t){let n="",r=0,i=-1,s=0,o=-1,a,l;for(;++o<=e.length;){if(o<e.length)a=e.codePointAt(o);else{if(a===47)break;a=47}if(a===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(l=n.lastIndexOf("/"),l!==n.length-1){l<0?(n="",r=0):(n=n.slice(0,l),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else a===46&&s>-1?s++:s=-1}return n}function Fg(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Z9e={cwd:Y9e};function Y9e(){return"/"}function MT(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Q9e(e){if(typeof e=="string")e=new URL(e);else if(!MT(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return X9e(e)}function X9e(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const bE=["history","path","basename","stem","extname","dirname"];class lQ{constructor(t){let n;t?MT(t)?n={path:t}:typeof t=="string"||J9e(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Z9e.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<bE.length;){const s=bE[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)bE.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Io.basename(this.path):void 0}set basename(t){wE(t,"basename"),_E(t,"basename"),this.path=Io.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Io.dirname(this.path):void 0}set dirname(t){N3(this.basename,"dirname"),this.path=Io.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Io.extname(this.path):void 0}set extname(t){if(_E(t,"extname"),N3(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Io.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){MT(t)&&(t=Q9e(t)),wE(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Io.basename(this.path,this.extname):void 0}set stem(t){wE(t,"stem"),_E(t,"stem"),this.path=Io.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new ti(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function _E(e,t){if(e&&e.includes(Io.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Io.sep+"`")}function wE(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function N3(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function J9e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e8e=(function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),t8e={}.hasOwnProperty;class G2 extends e8e{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=V9e()}copy(){const t=new G2;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(yE(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(EE("data",this.frozen),this.namespace[t]=n,this):t8e.call(this.namespace,t)&&this.namespace[t]||void 0:t?(EE("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Vy(t),r=this.parser||this.Parser;return xE("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),xE("process",this.parser||this.Parser),SE("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const a=Vy(t),l=r.parse(a);r.run(l,a,function(f,d,p){if(f||!d||!p)return u(f);const m=d,v=r.stringify(m,p);i8e(v)?p.value=v:p.result=v,u(f,p)});function u(f,d){f||!d?o(f):s?s(d):n(void 0,d)}}}processSync(t){let n=!1,r;return this.freeze(),xE("processSync",this.parser||this.Parser),SE("processSync",this.compiler||this.Compiler),this.process(t,i),L3("processSync","process",n),r;function i(s,o){n=!0,A3(s),r=o}}run(t,n,r){j3(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,a){const l=Vy(n);i.run(t,l,u);function u(f,d,p){const m=d||t;f?a(f):o?o(m):r(void 0,m,p)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),L3("runSync","run",r),i;function s(o,a){A3(o),i=a,r=!0}}stringify(t,n){this.freeze();const r=Vy(n),i=this.compiler||this.Compiler;return SE("stringify",i),j3(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(EE("use",this.frozen),t!=null)if(typeof t=="function")l(t,n);else if(typeof t=="object")Array.isArray(t)?a(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(u){if(typeof u=="function")l(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[f,...d]=u;l(f,d)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");a(u.plugins),u.settings&&(i.settings=yE(!0,i.settings,u.settings))}function a(u){let f=-1;if(u!=null)if(Array.isArray(u))for(;++f<u.length;){const d=u[f];s(d)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function l(u,f){let d=-1,p=-1;for(;++d<r.length;)if(r[d][0]===u){p=d;break}if(p===-1)r.push([u,...f]);else if(f.length>0){let[m,...v]=f;
vendor: 3,852 bytes, line 166
166const _=r[p][1];AT(_)&&AT(m)&&(m=yE(!0,_,m)),r[p]=[u,m,...v]}}}}const n8e=new G2().freeze();function xE(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function SE(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function EE(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function j3(e){if(!AT(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function L3(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Vy(e){return r8e(e)?e:new lQ(e)}function r8e(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function i8e(e){return typeof e=="string"||s8e(e)}function s8e(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const o8e="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",F3=[],$3={allowDangerousHtml:!0},a8e=/^(https?|ircs?|mailto|xmpp)$/i,l8e=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function K2(e){const t=u8e(e),n=c8e(e);return d8e(t.runSync(t.parse(n),n),e)}function u8e(e){const t=e.rehypePlugins||F3,n=e.remarkPlugins||F3,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...$3}:$3;return n8e().use(H6e).use(n).use(F9e,r).use(t)}function c8e(e){const t=e.children||"",n=new lQ;return typeof t=="string"&&(n.value=t),n}function d8e(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,a=t.unwrapDisallowed,l=t.urlTransform||f8e;for(const f of l8e)Object.hasOwn(t,f.from)&&(""+f.from+(f.to?"use `"+f.to+"` instead":"remove it")+o8e+f.id,void 0);return W2(e,u),T5e(e,{Fragment:g.Fragment,components:i,ignoreInvalidStyle:!0,jsx:g.jsx,jsxs:g.jsxs,passKeys:!0,passNode:!0});function u(f,d,p){if(f.type==="raw"&&p&&typeof d=="number")return o?p.children.splice(d,1):p.children[d]={type:"text",value:f.value},d;if(f.type==="element"){let m;for(m in pE)if(Object.hasOwn(pE,m)&&Object.hasOwn(f.properties,m)){const v=f.properties[m],_=pE[m];(_===null||_.includes(f.tagName))&&(f.properties[m]=l(String(v||""),m,f))}}if(f.type==="element"){let m=n?!n.includes(f.tagName):s?s.includes(f.tagName):!1;if(!m&&r&&typeof d=="number"&&(m=!r(f,d,p)),m&&p&&typeof d=="number")return a&&f.children?p.children.splice(d,1,...f.children):p.children.splice(d,1),d}}}function f8e(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||a8e.test(e.slice(0,t))?e:""}function z3(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}
vendor: 10,326 bytes, lines 166-174
166function h8e(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function p8e(e,t,n){const i=Ew((n||{}).ignore||[]),s=m8e(t);let o=-1;for(;++o<s.length;)aQ(e,"text",a);function a(u,f){let d=-1,p;for(;++d<f.length;){const m=f[d],v=p?p.children:void 0;if(i(m,v?v.indexOf(m):void 0,p))return;p=m}if(p)return l(u,f)}function l(u,f){const d=f[f.length-1],p=s[o][0],m=s[o][1];let v=0;const w=d.children.indexOf(u);let x=!1,S=[];p.lastIndex=0;let C=p.exec(u.value);for(;C;){const R=C.index,P={index:C.index,input:C.input,stack:[...f,u]};let k=m(...C,P);if(typeof k=="string"&&(k=k.length>0?{type:"text",value:k}:void 0),k===!1?p.lastIndex=R+1:(v!==R&&S.push({type:"text",value:u.value.slice(v,R)}),Array.isArray(k)?S.push(...k):k&&S.push(k),v=R+C[0].length,x=!0),!p.global)break;C=p.exec(u.value)}return x?(v<u.value.length&&S.push({type:"text",value:u.value.slice(v)}),d.children.splice(w,1,...S)):S=[u],w+S.length}}function m8e(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const i=n[r];t.push([g8e(i[0]),v8e(i[1])])}return t}function g8e(e){return typeof e=="string"?new RegExp(h8e(e),"g"):e}function v8e(e){return typeof e=="function"?e:function(){return e}}const CE="phrasing",kE=["autolink","link","image","label"];function y8e(){return{transforms:[C8e],enter:{literalAutolink:_8e,literalAutolinkEmail:TE,literalAutolinkHttp:TE,literalAutolinkWww:TE},exit:{literalAutolink:E8e,literalAutolinkEmail:S8e,literalAutolinkHttp:w8e,literalAutolinkWww:x8e}}}function b8e(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:CE,notInConstruct:kE},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:CE,notInConstruct:kE},{character:":",before:"[ps]",after:"\\/",inConstruct:CE,notInConstruct:kE}]}}function _8e(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function TE(e){this.config.enter.autolinkProtocol.call(this,e)}function w8e(e){this.config.exit.autolinkProtocol.call(this,e)}function x8e(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function S8e(e){this.config.exit.autolinkEmail.call(this,e)}function E8e(e){this.exit(e)}function C8e(e){p8e(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,k8e],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),T8e]],{ignore:["link","linkReference"]})}function k8e(e,t,n,r,i){let s="";if(!uQ(i)||(/^w/i.test(t)&&(n=t+n,t="",s="http://"),!P8e(n)))return!1;const o=R8e(n+r);if(!o[0])return!1;const a={type:"link",title:null,url:s+t+o[0],children:[{type:"text",value:t+o[0]}]};return o[1]?[a,{type:"text",value:o[1]}]:a}function T8e(e,t,n,r){return!uQ(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function P8e(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function R8e(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const i=z3(e,"(");let s=z3(e,")");for(;r!==-1&&i>s;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),s++;return[e,n]}function uQ(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Ic(n)||ww(n))&&(!t||n!==47)}cQ.peek=F8e;function I8e(){this.buffer()}function O8e(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function D8e(){this.buffer()}function A8e(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function M8e(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=co(this.sliceSerialize(e)).toLowerCase(),n.label=t}function N8e(e){this.exit(e)}function j8e(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=co(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L8e(e){this.exit(e)}function F8e(){return"["}function cQ(e,t,n,r){const i=n.createTracker(r);let s=i.move("[^");const o=n.enter("footnoteReference"),a=n.enter("reference");return s+=i.move(n.safe(n.associationId(e),{after:"]",before:s})),a(),o(),s+=i.move("]"),s}function $8e(){return{enter:{gfmFootnoteCallString:I8e,gfmFootnoteCall:O8e,gfmFootnoteDefinitionLabelString:D8e,gfmFootnoteDefinition:A8e},exit:{gfmFootnoteCallString:M8e,gfmFootnoteCall:N8e,gfmFootnoteDefinitionLabelString:j8e,gfmFootnoteDefinition:L8e}}}function z8e(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:cQ},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,i,s,o){const a=s.createTracker(o);let l=a.move("[^");const u=s.enter("footnoteDefinition"),f=s.enter("label");return l+=a.move(s.safe(s.associationId(r),{before:l,after:"]"})),f(),l+=a.move("]:"),r.children&&r.children.length>0&&(a.shift(4),l+=a.move((t?`
167`:" ")+s.indentLines(s.containerFlow(r,a.current()),t?dQ:V8e))),u(),l}}function V8e(e,t,n){return t===0?e:dQ(e,t,n)}function dQ(e,t,n){return(n?"":"    ")+e}const U8e=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];fQ.peek=G8e;function B8e(){return{canContainEols:["delete"],enter:{strikethrough:q8e},exit:{strikethrough:W8e}}}function H8e(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:U8e}],handlers:{delete:fQ}}}function q8e(e){this.enter({type:"delete",children:[]},e)}function W8e(e){this.exit(e)}function fQ(e,t,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(e,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function G8e(){return"~"}function K8e(e){return e.length}function Z8e(e,t){const n=t||{},r=(n.align||[]).concat(),i=n.stringLength||K8e,s=[],o=[],a=[],l=[];let u=0,f=-1;for(;++f<e.length;){const _=[],w=[];let x=-1;for(e[f].length>u&&(u=e[f].length);++x<e[f].length;){const S=Y8e(e[f][x]);if(n.alignDelimiters!==!1){const C=i(S);w[x]=C,(l[x]===void 0||C>l[x])&&(l[x]=C)}_.push(S)}o[f]=_,a[f]=w}let d=-1;if(typeof r=="object"&&"length"in r)for(;++d<u;)s[d]=V3(r[d]);else{const _=V3(r);for(;++d<u;)s[d]=_}d=-1;const p=[],m=[];for(;++d<u;){const _=s[d];let w="",x="";_===99?(w=":",x=":"):_===108?w=":":_===114&&(x=":");let S=n.alignDelimiters===!1?1:Math.max(1,l[d]-w.length-x.length);const C=w+"-".repeat(S)+x;n.alignDelimiters!==!1&&(S=w.length+S+x.length,S>l[d]&&(l[d]=S),m[d]=S),p[d]=C}o.splice(1,0,p),a.splice(1,0,m),f=-1;const v=[];for(;++f<o.length;){const _=o[f],w=a[f];d=-1;const x=[];for(;++d<u;){const S=_[d]||"";let C="",R="";if(n.alignDelimiters!==!1){const P=l[d]-(w[d]||0),k=s[d];k===114?C=" ".repeat(P):k===99?P%2?(C=" ".repeat(P/2+.5),R=" ".repeat(P/2-.5)):(C=" ".repeat(P/2),R=C):R=" ".repeat(P)}n.delimiterStart!==!1&&!d&&x.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&S==="")&&(n.delimiterStart!==!1||d)&&x.push(" "),n.alignDelimiters!==!1&&x.push(C),x.push(S),n.alignDelimiters!==!1&&x.push(R),n.padding!==!1&&x.push(" "),(n.delimiterEnd!==!1||d!==u-1)&&x.push("|")}v.push(n.delimiterEnd===!1?x.join("").replace(/ +$/,""):x.join(""))}return v.join(`
168`)}function Y8e(e){return e==null?"":String(e)}function V3(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function Q8e(e,t,n,r){const i=n.enter("blockquote"),s=n.createTracker(r);s.move("> "),s.shift(2);const o=n.indentLines(n.containerFlow(e,s.current()),X8e);return i(),o}function X8e(e,t,n){return">"+(n?"":" ")+e}function J8e(e,t){return U3(e,t.inConstruct,!0)&&!U3(e,t.notInConstruct,!1)}function U3(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function B3(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
169`&&J8e(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?"":" ";return`\\
170`}function eVe(e,t){const n=String(e);let r=n.indexOf(t),i=r,s=0,o=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===i?++s>o&&(o=s):s=1,i=r+t.length,r=n.indexOf(t,i);return o}function tVe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function nVe(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function rVe(e,t,n,r){const i=nVe(n),s=e.value||"",o=i==="`"?"GraveAccent":"Tilde";if(tVe(e,n)){const d=n.enter("codeIndented"),p=n.indentLines(s,iVe);return d(),p}const a=n.createTracker(r),l=i.repeat(Math.max(eVe(s,i)+1,3)),u=n.enter("codeFenced");let f=a.move(l);if(e.lang){const d=n.enter(`codeFencedLang${o}`);f+=a.move(n.safe(e.lang,{before:f,after:" ",encode:["`"],...a.current()})),d()}if(e.lang&&e.meta){const d=n.enter(`codeFencedMeta${o}`);f+=a.move(" "),f+=a.move(n.safe(e.meta,{before:f,after:`
171`,encode:["`"],...a.current()})),d()}return f+=a.move(`
172`),s&&(f+=a.move(s+`
173`)),f+=a.move(l),u(),f}function iVe(e,t,n){return(n?"":"    ")+e}function Z2(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function sVe(e,t,n,r){const i=Z2(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("definition");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("[");return u+=l.move(n.safe(n.associationId(e),{before:u,after:"]",...l.current()})),u+=l.move("]: "),a(),!e.url||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":`
174`,...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),o(),u}function oVe(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ym(e){return"&#x"+e.toString(16).toUpperCase()+";"}
vendor: 6,843 bytes, lines 174-179
174function Gb(e,t,n){const r=Qf(e),i=Qf(t);return r===void 0?i===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}hQ.peek=aVe;function hQ(e,t,n,r){const i=oVe(n),s=n.enter("emphasis"),o=n.createTracker(r),a=o.move(i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),f=Gb(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Ym(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Gb(r.after.charCodeAt(0),d,i);p.inside&&(l=l.slice(0,-1)+Ym(d));const m=o.move(i);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+l+m}function aVe(e,t,n){return n.options.emphasis||"*"}function lVe(e,t){let n=!1;return W2(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,OT}),!!((!e.depth||e.depth<3)&&$2(e)&&(t.options.setext||n))}function uVe(e,t,n,r){const i=Math.max(Math.min(6,e.depth||1),1),s=n.createTracker(r);if(lVe(e,n)){const f=n.enter("headingSetext"),d=n.enter("phrasing"),p=n.containerPhrasing(e,{...s.current(),before:`
175`,after:`
176`});return d(),f(),p+`
177`+(i===1?"=":"-").repeat(p.length-(Math.max(p.lastIndexOf("\r"),p.lastIndexOf(`
178`))+1))}const o="#".repeat(i),a=n.enter("headingAtx"),l=n.enter("phrasing");s.move(o+" ");let u=n.containerPhrasing(e,{before:"# ",after:`
179`,...s.current()});return/^[\t ]/.test(u)&&(u=Ym(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,n.options.closeAtx&&(u+=" "+o),l(),a(),u}pQ.peek=cVe;function pQ(e){return e.value||""}function cVe(){return"<"}mQ.peek=dVe;function mQ(e,t,n,r){const i=Z2(n),s=i==='"'?"Quote":"Apostrophe",o=n.enter("image");let a=n.enter("label");const l=n.createTracker(r);let u=l.move("![");return u+=l.move(n.safe(e.alt,{before:u,after:"]",...l.current()})),u+=l.move("]("),a(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(a=n.enter("destinationLiteral"),u+=l.move("<"),u+=l.move(n.safe(e.url,{before:u,after:">",...l.current()})),u+=l.move(">")):(a=n.enter("destinationRaw"),u+=l.move(n.safe(e.url,{before:u,after:e.title?" ":")",...l.current()}))),a(),e.title&&(a=n.enter(`title${s}`),u+=l.move(" "+i),u+=l.move(n.safe(e.title,{before:u,after:i,...l.current()})),u+=l.move(i),a()),u+=l.move(")"),o(),u}function dVe(){return"!"}gQ.peek=fVe;function gQ(e,t,n,r){const i=e.referenceType,s=n.enter("imageReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("![");const u=n.safe(e.alt,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=f,s(),i==="full"||!u||u!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function fVe(){return"!"}vQ.peek=hVe;function vQ(e,t,n){let r=e.value||"",i="`",s=-1;for(;new RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<n.unsafe.length;){const o=n.unsafe[s],a=n.compilePattern(o);let l;if(o.atBreak)for(;l=a.exec(r);){let u=l.index;r.charCodeAt(u)===10&&r.charCodeAt(u-1)===13&&u--,r=r.slice(0,u)+" "+r.slice(l.index+1)}}return i+r+i}function hVe(){return"`"}function yQ(e,t){const n=$2(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}bQ.peek=pVe;function bQ(e,t,n,r){const i=Z2(n),s=i==='"'?"Quote":"Apostrophe",o=n.createTracker(r);let a,l;if(yQ(e,n)){const f=n.stack;n.stack=[],a=n.enter("autolink");let d=o.move("<");return d+=o.move(n.containerPhrasing(e,{before:d,after:">",...o.current()})),d+=o.move(">"),a(),n.stack=f,d}a=n.enter("link"),l=n.enter("label");let u=o.move("[");return u+=o.move(n.containerPhrasing(e,{before:u,after:"](",...o.current()})),u+=o.move("]("),l(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(l=n.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(n.safe(e.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(l=n.enter("destinationRaw"),u+=o.move(n.safe(e.url,{before:u,after:e.title?" ":")",...o.current()}))),l(),e.title&&(l=n.enter(`title${s}`),u+=o.move(" "+i),u+=o.move(n.safe(e.title,{before:u,after:i,...o.current()})),u+=o.move(i),l()),u+=o.move(")"),a(),u}function pVe(e,t,n){return yQ(e,n)?"<":"["}_Q.peek=mVe;function _Q(e,t,n,r){const i=e.referenceType,s=n.enter("linkReference");let o=n.enter("label");const a=n.createTracker(r);let l=a.move("[");const u=n.containerPhrasing(e,{before:l,after:"]",...a.current()});l+=a.move(u+"]["),o();const f=n.stack;n.stack=[],o=n.enter("reference");const d=n.safe(n.associationId(e),{before:l,after:"]",...a.current()});return o(),n.stack=f,s(),i==="full"||!u||u!==d?l+=a.move(d+"]"):i==="shortcut"?l=l.slice(0,-1):l+=a.move("]"),l}function mVe(){return"["}function Y2(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gVe(e){const t=Y2(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function vVe(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function wQ(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function yVe(e,t,n,r){const i=n.enter("list"),s=n.bulletCurrent;let o=e.ordered?vVe(n):Y2(n);const a=e.ordered?o==="."?")":".":gVe(n);let l=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){const f=e.children?e.children[0]:void 0;if((o==="*"||o==="-")&&f&&(!f.children||!f.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(l=!0),wQ(n)===o&&f){let d=-1;for(;++d<e.children.length;){const p=e.children[d];if(p&&p.type==="listItem"&&p.children&&p.children[0]&&p.children[0].type==="thematicBreak"){l=!0;break}}}}l&&(o=a),n.bulletCurrent=o;const u=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=s,i(),u}function bVe(e){const t=e.options.listItemIndent||"one";
vendor: 5,682 bytes, lines 179-181
179if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function _Ve(e,t,n,r){const i=bVe(n);let s=n.bulletCurrent||Y2(n);t&&t.type==="list"&&t.ordered&&(s=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let o=s.length+1;(i==="tab"||i==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);const a=n.createTracker(r);a.move(s+" ".repeat(o-s.length)),a.shift(o);const l=n.enter("listItem"),u=n.indentLines(n.containerFlow(e,a.current()),f);return l(),u;function f(d,p,m){return p?(m?"":" ".repeat(o))+d:(m?s:s+" ".repeat(o-s.length))+d}}function wVe(e,t,n,r){const i=n.enter("paragraph"),s=n.enter("phrasing"),o=n.containerPhrasing(e,r);return s(),i(),o}const xVe=Ew(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SVe(e,t,n,r){return(e.children.some(function(o){return xVe(o)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function EVe(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}xQ.peek=CVe;function xQ(e,t,n,r){const i=EVe(n),s=n.enter("strong"),o=n.createTracker(r),a=o.move(i+i);let l=o.move(n.containerPhrasing(e,{after:i,before:a,...o.current()}));const u=l.charCodeAt(0),f=Gb(r.before.charCodeAt(r.before.length-1),u,i);f.inside&&(l=Ym(u)+l.slice(1));const d=l.charCodeAt(l.length-1),p=Gb(r.after.charCodeAt(0),d,i);p.inside&&(l=l.slice(0,-1)+Ym(d));const m=o.move(i+i);return s(),n.attentionEncodeSurroundingInfo={after:p.outside,before:f.outside},a+l+m}function CVe(e,t,n){return n.options.strong||"*"}function kVe(e,t,n,r){return n.safe(e.value,r)}function TVe(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function PVe(e,t,n){const r=(wQ(n)+(n.options.ruleSpaces?" ":"")).repeat(TVe(n));return n.options.ruleSpaces?r.slice(0,-1):r}const SQ={blockquote:Q8e,break:B3,code:rVe,definition:sVe,emphasis:hQ,hardBreak:B3,heading:uVe,html:pQ,image:mQ,imageReference:gQ,inlineCode:vQ,link:bQ,linkReference:_Q,list:yVe,listItem:_Ve,paragraph:wVe,root:SVe,strong:xQ,text:kVe,thematicBreak:PVe};function RVe(){return{enter:{table:IVe,tableData:H3,tableHeader:H3,tableRow:DVe},exit:{codeText:AVe,table:OVe,tableData:PE,tableHeader:PE,tableRow:PE}}}function IVe(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function OVe(e){this.exit(e),this.data.inTable=void 0}function DVe(e){this.enter({type:"tableRow",children:[]},e)}function PE(e){this.exit(e)}function H3(e){this.enter({type:"tableCell",children:[]},e)}function AVe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,MVe));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function MVe(e,t){return t==="|"?t:e}function NVe(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
180`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[	 :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:p,table:o,tableCell:l,tableRow:a}};function o(m,v,_,w){return u(f(m,_,w),m.align)}function a(m,v,_,w){const x=d(m,_,w),S=u([x]);return S.slice(0,S.indexOf(`
181`))}function l(m,v,_,w){const x=_.enter("tableCell"),S=_.enter("phrasing"),C=_.containerPhrasing(m,{...w,before:s,after:s});return S(),x(),C}function u(m,v){return Z8e(m,{align:v,alignDelimiters:r,padding:n,stringLength:i})}function f(m,v,_){const w=m.children;let x=-1;const S=[],C=v.enter("table");for(;++x<w.length;)S[x]=d(w[x],v,_);return C(),S}function d(m,v,_){const w=m.children;let x=-1;const S=[],C=v.enter("tableRow");for(;++x<w.length;)S[x]=l(w[x],m,v,_);return C(),S}function p(m,v,_){let w=SQ.inlineCode(m,v,_);return _.stack.includes("tableCell")&&(w=w.replace(/\|/g,"\\$&")),w}}function jVe(){return{exit:{taskListCheckValueChecked:q3,taskListCheckValueUnchecked:q3,paragraph:FVe}}}function LVe(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:$Ve}}}function q3(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function FVe(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=t.children;let s=-1,o;for(;++s<i.length;){const a=i[s];if(a.type==="paragraph"){o=a;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function $Ve(e,t,n,r){const i=e.children[0],s=typeof e.checked=="boolean"&&i&&i.type==="paragraph",o="["+(e.checked?"x":" ")+"] ",a=n.createTracker(r);s&&a.move(o);let l=SQ.listItem(e,t,n,{...r,...a.current()});return s&&(l=l.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),l;function u(f){return f+o}}function zVe(){return[y8e(),$8e(),B8e(),RVe(),jVe()]}function VVe(e){return{extensions:[b8e(),z8e(e),H8e(),NVe(e),LVe()]}}const UVe={tokenize:KVe,partial:!0},EQ={tokenize:ZVe,partial:!0}
vendor: 8,602 bytes, line 181
181,CQ={tokenize:YVe,partial:!0},kQ={tokenize:QVe,partial:!0},BVe={tokenize:XVe,partial:!0},TQ={name:"wwwAutolink",tokenize:WVe,previous:RQ},PQ={name:"protocolAutolink",tokenize:GVe,previous:IQ},Ka={name:"emailAutolink",tokenize:qVe,previous:OQ},na={};function HVe(){return{text:na}}let Uu=48;for(;Uu<123;)na[Uu]=Ka,Uu++,Uu===58?Uu=65:Uu===91&&(Uu=97);na[43]=Ka;na[45]=Ka;na[46]=Ka;na[95]=Ka;na[72]=[Ka,PQ];na[104]=[Ka,PQ];na[87]=[Ka,TQ];na[119]=[Ka,TQ];function qVe(e,t,n){const r=this;let i,s;return o;function o(d){return!NT(d)||!OQ.call(r,r.previous)||Q2(r.events)?n(d):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),a(d))}function a(d){return NT(d)?(e.consume(d),a):d===64?(e.consume(d),l):n(d)}function l(d){return d===46?e.check(BVe,f,u)(d):d===45||d===95||Jr(d)?(s=!0,e.consume(d),l):f(d)}function u(d){return e.consume(d),i=!0,l}function f(d){return s&&i&&gi(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(d)):n(d)}}function WVe(e,t,n){const r=this;return i;function i(o){return o!==87&&o!==119||!RQ.call(r,r.previous)||Q2(r.events)?n(o):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(UVe,e.attempt(EQ,e.attempt(CQ,s),n),n)(o))}function s(o){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(o)}}function GVe(e,t,n){const r=this;let i="",s=!1;return o;function o(d){return(d===72||d===104)&&IQ.call(r,r.previous)&&!Q2(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),i+=String.fromCodePoint(d),e.consume(d),a):n(d)}function a(d){if(gi(d)&&i.length<5)return i+=String.fromCodePoint(d),e.consume(d),a;if(d===58){const p=i.toLowerCase();if(p==="http"||p==="https")return e.consume(d),l}return n(d)}function l(d){return d===47?(e.consume(d),s?u:(s=!0,l)):n(d)}function u(d){return d===null||Hb(d)||gn(d)||Ic(d)||ww(d)?n(d):e.attempt(EQ,e.attempt(CQ,f),n)(d)}function f(d){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(d)}}function KVe(e,t,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,e.consume(o),i):o===46&&r===3?(e.consume(o),s):n(o)}function s(o){return o===null?n(o):t(o)}}function ZVe(e,t,n){let r,i,s;return o;function o(u){return u===46||u===95?e.check(kQ,l,a)(u):u===null||gn(u)||Ic(u)||u!==45&&ww(u)?l(u):(s=!0,e.consume(u),o)}function a(u){return u===95?r=!0:(i=r,r=void 0),e.consume(u),o}function l(u){return i||r||!s?n(u):t(u)}}function YVe(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?s(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(kQ,t,s)(o):o===null||gn(o)||Ic(o)?t(o):(e.consume(o),i)}function s(o){return o===41&&r++,e.consume(o),i}}function QVe(e,t,n){return r;function r(a){return a===33||a===34||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===63||a===95||a===126?(e.consume(a),r):a===38?(e.consume(a),s):a===93?(e.consume(a),i):a===60||a===null||gn(a)||Ic(a)?t(a):n(a)}function i(a){return a===null||a===40||a===91||gn(a)||Ic(a)?t(a):r(a)}function s(a){return gi(a)?o(a):n(a)}function o(a){return a===59?(e.consume(a),r):gi(a)?(e.consume(a),o):n(a)}}function XVe(e,t,n){return r;function r(s){return e.consume(s),i}function i(s){return Jr(s)?n(s):t(s)}}function RQ(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gn(e)}function IQ(e){return!gi(e)}function OQ(e){return!(e===47||NT(e))}function NT(e){return e===43||e===45||e===46||e===95||Jr(e)}function Q2(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const JVe={tokenize:aUe,partial:!0};function eUe(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:iUe,continuation:{tokenize:sUe},exit:oUe}},text:{91:{name:"gfmFootnoteCall",tokenize:rUe},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:tUe,resolveTo:nUe}}}}function tUe(e,t,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const l=r.events[i][1];if(l.type==="labelImage"){o=l;break}if(l.type==="gfmFootnoteCall"||l.type==="labelLink"||l.type==="label"||l.type==="image"||l.type==="link")break}return a;function a(l){if(!o||!o._balanced)return n(l);const u=co(r.sliceSerialize({start:o.end,end:r.now()}));return u.codePointAt(0)!==94||!s.includes(u.slice(1))?n(l):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),t(l))}}function nUe(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},a=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",i,t],["exit",i,t],["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...a),e}function rUe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return a;function a(d){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),l}function l(d){return d!==94?n(d):(e.enter("gfmFootnoteCallMarker"),e.consume(d),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",u)}function u(d){if(s>999||d===93&&!o||d===null||d===91||gn(d))return n(d);if(d===93){e.exit("chunkString");const p=e.exit("gfmFootnoteCallString");return i.includes(co(r.sliceSerialize(p)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(d)}return gn(d)||(o=!0),s++,e.consume(d),d===92?f:u}function f(d){return d===91||d===92||d===93?(e.consume(d),s++,u):u(d)}}function iUe(e,t,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,a;return l;function l(v){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(v){return v===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",f):n(v)}function f(v){if(o>999||v===93&&!a||v===null||v===91||gn(v))return n(v);if(v===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return s=co(r.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(v),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),p}return gn(v)||(a=!0),o++,e.consume(v),v===92?d:f}function d(v){return v===91||v===92||v===93?(e.consume(v),o++,f):f(v)}function p(v){return v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),i.includes(s)||i.push(s),Kt(e,m,"gfmFootnoteDefinitionWhitespace")):n(v)}function m(v){return t(v)}}function sUe(e,t,n){return e.check(Lg,t,e.attempt(JVe,t,n))}function oUe(e){e.exit("gfmFootnoteDefinition")}function aUe(e,t,n){const r=this;return Kt(e,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?t(s):n(s)}}function lUe(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,a){let l=-1;for(;++l<o.length;)if(o[l][0]==="enter"&&o[l][1].type==="strikethroughSequenceTemporary"&&o[l][1]._close){let u=l;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[l][1].end.offset-o[l][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[l][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[l][1].end)},d={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[l][1].start)}
vendor: 5,177 bytes, line 181
181,p=[["enter",f,a],["enter",o[u][1],a],["exit",o[u][1],a],["enter",d,a]],m=a.parser.constructs.insideSpan.null;m&&ts(p,p.length,0,xw(m,o.slice(u+1,l),a)),ts(p,p.length,0,[["exit",d,a],["enter",o[l][1],a],["exit",o[l][1],a],["exit",f,a]]),ts(o,u-1,l-u+3,p),l=u+p.length-2;break}}for(l=-1;++l<o.length;)o[l][1].type==="strikethroughSequenceTemporary"&&(o[l][1].type="data");return o}function s(o,a,l){const u=this.previous,f=this.events;let d=0;return p;function p(v){return u===126&&f[f.length-1][1].type!=="characterEscape"?l(v):(o.enter("strikethroughSequenceTemporary"),m(v))}function m(v){const _=Qf(u);if(v===126)return d>1?l(v):(o.consume(v),d++,m);if(d<2&&!n)return l(v);const w=o.exit("strikethroughSequenceTemporary"),x=Qf(v);return w._open=!x||x===2&&!!_,w._close=!_||_===2&&!!x,a(v)}}}class uUe{constructor(){this.map=[]}add(t,n,r){cUe(this,t,n,r)}consume(t){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let i=r.pop();for(;i;){for(const s of i)t.push(s);i=r.pop()}this.map.length=0}}function cUe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function dUe(e,t){let n=!1;const r=[];for(;t<e.length;){const i=e[t];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function fUe(){return{flow:{null:{name:"table",tokenize:hUe,resolveAll:pUe}}}}function hUe(e,t,n){const r=this;let i=0,s=0,o;return a;function a(A){let $=r.events.length-1;for(;$>-1;){const B=r.events[$][1].type;if(B==="lineEnding"||B==="linePrefix")$--;else break}const j=$>-1?r.events[$][1].type:null,V=j==="tableHead"||j==="tableRow"?k:l;return V===k&&r.parser.lazy[r.now().line]?n(A):V(A)}function l(A){return e.enter("tableHead"),e.enter("tableRow"),u(A)}function u(A){return A===124||(o=!0,s+=1),f(A)}function f(A){return A===null?n(A):vt(A)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),m):n(A):Bt(A)?Kt(e,f,"whitespace")(A):(s+=1,o&&(o=!1,i+=1),A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),o=!0,f):(e.enter("data"),d(A)))}function d(A){return A===null||A===124||gn(A)?(e.exit("data"),f(A)):(e.consume(A),A===92?p:d)}function p(A){return A===92||A===124?(e.consume(A),d):d(A)}function m(A){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(A):(e.enter("tableDelimiterRow"),o=!1,Bt(A)?Kt(e,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):v(A))}function v(A){return A===45||A===58?w(A):A===124?(o=!0,e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),_):P(A)}function _(A){return Bt(A)?Kt(e,w,"whitespace")(A):w(A)}function w(A){return A===58?(s+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),x):A===45?(s+=1,x(A)):A===null||vt(A)?R(A):P(A)}function x(A){return A===45?(e.enter("tableDelimiterFiller"),S(A)):P(A)}function S(A){return A===45?(e.consume(A),S):A===58?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(A),e.exit("tableDelimiterMarker"),C):(e.exit("tableDelimiterFiller"),C(A))}function C(A){return Bt(A)?Kt(e,R,"whitespace")(A):R(A)}function R(A){return A===124?v(A):A===null||vt(A)?!o||i!==s?P(A):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(A)):P(A)}function P(A){return n(A)}function k(A){return e.enter("tableRow"),I(A)}function I(A){return A===124?(e.enter("tableCellDivider"),e.consume(A),e.exit("tableCellDivider"),I):A===null||vt(A)?(e.exit("tableRow"),t(A)):Bt(A)?Kt(e,I,"whitespace")(A):(e.enter("data"),D(A))}function D(A){return A===null||A===124||gn(A)?(e.exit("data"),I(A)):(e.consume(A),A===92?L:D)}function L(A){return A===92||A===124?(e.consume(A),D):D(A)}}function pUe(e,t){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],a=!1,l=0,u,f,d;const p=new uUe;for(;++n<e.length;){const m=e[n],v=m[1];m[0]==="enter"?v.type==="tableHead"?(a=!1,l!==0&&(W3(p,t,l,u,f),f=void 0,l=0),u={type:"table",start:Object.assign({},v.start),end:Object.assign({},v.end)},p.add(n,0,[["enter",u,t]])):v.type==="tableRow"||v.type==="tableDelimiterRow"?(r=!0,d=void 0,s=[0,0,0,0],o=[0,n+1,0,0],a&&(a=!1,f={type:"tableBody",start:Object.assign({},v.start),end:Object.assign({},v.end)},p.add(n,0,[["enter",f,t]])),i=v.type==="tableDelimiterRow"?2:f?3:1):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],d=Uy(p,t,s,i,void 0,d),s=[0,0,0,0]),o[2]=n)):v.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],d=Uy(p,t,s,i,void 0,d)),s=o,o=[s[1],n,0,0])):v.type==="tableHead"?(a=!0,l=n):v.type==="tableRow"||v.type==="tableDelimiterRow"?(l=n,s[1]!==0?(o[0]=o[1],d=Uy(p,t,s,i,n,d)):o[1]!==0&&(
181d=Uy(p,t,o,i,n,d)),i=0):i&&(v.type==="data"||v.type==="tableDelimiterMarker"||v.type==="tableDelimiterFiller")&&(o[3]=n)}for(l!==0&&W3(p,t,l,u,f),p.consume(t.events),n=-1;++n<t.events.length;){const m=t.events[n];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=dUe(t.events,n))}return e}function Uy(e,t,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",a="tableContent";n[0]!==0&&(s.end=Object.assign({},Qd(t.events,n[0])),e.add(n[0],0,[["exit",s,t]]));const l=Qd(t.events,n[1]);if(s={type:o,start:Object.assign({},l),end:Object.assign({},l)},e.add(n[1],0,[["enter",s,t]]),n[2]!==0){const u=Qd(t.events,n[2]),f=Qd(t.events,n[3]),d={type:a,start:Object.assign({},u),end:Object.assign({},f)};if(e.add(n[2],0,[["enter",d,t]]),r!==2){const p=t.events[n[2]],m=t.events[n[3]];if(p[1].end=Object.assign({},m[1].end),p[1].type="chunkText",p[1].contentType="text",n[3]>n[2]+1){const v=n[2]+1,_=n[3]-n[2]-1;e.add(v,_,[])}}e.add(n[3]+1,0,[["exit",d,t]])}return i!==void 0&&(s.end=Object.assign({},Qd(t.events,i)),e.add(i,0,[["exit",s,t]]),s=void 0),s}function W3(e,t,n,r,i){const s=[],o=Qd(t.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,t])),r.end=Object.assign({},o),s.push(["exit",r,t]),e.add(n+1,0,s)}function Qd(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const mUe={name:"tasklistCheck",tokenize:vUe};function gUe(){return{text:{91:mUe}}}function vUe(e,t,n){const r=this;return i;function i(l){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(l):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),s)}function s(l){return gn(l)?(e.enter("taskListCheckValueUnchecked"),e.consume(l),e.exit("taskListCheckValueUnchecked"),o):l===88||l===120?(e.enter("taskListCheckValueChecked"),e.consume(l),e.exit("taskListCheckValueChecked"),o):n(l)}function o(l){return l===93?(e.enter("taskListCheckMarker"),e.consume(l),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),a):n(l)}function a(l){return vt(l)?t(l):Bt(l)?e.check({tokenize:yUe},t,n)(l):n(l)}}function yUe(e,t,n){return Kt(e,r,"whitespace");function r(i){return i===null?n(i):t(i)}}function bUe(e){return UY([HVe(),eUe(),lUe(e),fUe(),gUe()])}const _Ue={};function X2(e){const t=this,n=e||_Ue,r=t.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(bUe(n)),s.push(zVe()),o.push(VVe(n))}const G3=new Map;async function wUe(e){const t=G3.get(e);if(t)return console.log("returning data from in-memory cache..."),t;const n=`${G9}/${e}`;try{const r=await fetch(n),i=await r.text();return r.ok?(G3.set(e,i),i):(console.error("get markdown article failed",i),null)}catch(r){return console.error("Error fetching markdown article:",r),null}}function xUe(e){const t=e.match(/^Title: (.+)$/m),n=t?t[1]:"",r=e.split("Markdown Content:"),i=r.length>1?r[1].trim():"";return{title:n,content:i}}const SUe=({link:e})=>{const[t,n]=b.useState(),[r,i]=b.useState();return b.useEffect(()=>{e?.url&&wUe(e.url).then(s=>{const{title:o,content:a}=xUe(s);n(o),i(a)})},[]),g.jsx(g.Fragment,{children:r?g.jsxs("div",{className:"rounded-md border p-4",children:[t&&g.jsx("h1",{className:"mb-4 text-2xl font-bold",children:t}),g.jsx("div",{className:"prose mt-1 w-full break-words prose-p:leading-relaxed dark:text-white",children:g.jsx(K2,{remarkPlugins:[X2],components:{a:s=>g.jsx("a",{...s,target:"_blank",rel:"noopener noreferrer"}),li:s=>g.jsx("li",{...s,className:"mb-2"}),ul:s=>g.jsx("ul",{...s,className:"list-disc pl-4"}),ol:s=>g.jsx("ol",{...s,className:"list-decimal pl-4"})},children:r})})]}):g.jsx(ZLe,{link:e})})};var Bu={},ga={},RE={exports:{}};var K3;function Bs(){return K3||(K3=1,(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=i(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)t.call(s,a)&&s[a]&&(o=i(o,a));return o}function i(s,o){return o?s?s+" "+o:s+o:s}e.exports?(n.default=n,e.exports=n):window.classNames=n}
181)()})(RE)),RE.exports}var Hu={},Z3;function J2(){if(Z3)return Hu;Z3=1;var e=Hu&&Hu.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hu,"__esModule",{value:!0}),Hu.useFrame=void 0;const t=e(zr()),n=r=>t.default.useMemo(()=>r||{document:typeof document<"u"?document:void 0,window:typeof window<"u"?window:void 0},[r]);return Hu.useFrame=n,Hu}var va={},ya={},Y3;function cu(){if(Y3)return ya;Y3=1;var e=ya&&ya.__rest||function(s,o){var a={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&o.indexOf(l)<0&&(a[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,l=Object.getOwnPropertySymbols(s);u<l.length;u++)o.indexOf(l[u])<0&&Object.prototype.propertyIsEnumerable.call(s,l[u])&&(a[l[u]]=s[l[u]]);return a},t=ya&&ya.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ya,"__esModule",{value:!0}),ya.EmbedStyle=void 0;const n=t(Bs()),r=t(zr()),i=s=>{var o=e(s,[]);return r.default.createElement("style",Object.assign({},o,{className:(0,n.default)(o.className),style:Object.assign({},o.style)}),`
182        .rsme-embed .rsme-d-none {
183          display: none;
184        }
185    
186        .rsme-embed .twitter-tweet {
187          margin: 0 !important;
188        }
189    
190        .rsme-embed blockquote {
191          margin: 0 !important;
192          padding: 0 !important;
193        }
194
195        .rsme-embed.rsme-facebook-embed .fb-post iframe {
196          width: 100% !important;
197        }
198
199        .rsme-embed.rsme-facebook-embed .fb-post span {
200          width: 100% !important;
201        }
202      `)};return ya.EmbedStyle=i,ya}var ba={},Q3;function DQ(){if(Q3)return ba;Q3=1;var e=ba&&ba.__rest||function(s,o){var a={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&o.indexOf(l)<0&&(a[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,l=Object.getOwnPropertySymbols(s);u<l.length;u++)o.indexOf(l[u])<0&&Object.prototype.propertyIsEnumerable.call(s,l[u])&&(a[l[u]]=s[l[u]]);return a},t=ba&&ba.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ba,"__esModule",{value:!0}),ba.BorderSpinner=void 0;const n=t(Bs()),r=t(zr()),i=s=>{var o=e(s,[]);return r.default.createElement(r.default.Fragment,null,r.default.createElement("style",null,`
203        .rsme-spinner {
204          border: 3px solid rgba(0,0,0,0.75);
205          border-right-color: transparent;
206          border-radius: 50%;
207          animation: rsme-spin 1s linear infinite;
208        }
209        @keyframes rsme-spin {
210          0% {
211            transform: rotate(0deg);
212          }
213          100% {
214            transform: rotate(360deg);
215          }
216        }  
217      `),r.default.createElement("div",Object.assign({},o,{className:(0,n.default)("rsme-spinner",o.className),style:Object.assign({width:10,height:10},o.style)})))};return ba.BorderSpinner=i,ba}var qu={},X3;function EUe(){return X3||(X3=1,(function(e){var t=qu&&qu.__rest||function(u,f){var d={};for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&f.indexOf(p)<0&&(d[p]=u[p]);if(u!=null&&typeof Object.getOwnPropertySymbols=="function")for(var m=0,p=Object.getOwnPropertySymbols(u);m<p.length;m++)f.indexOf(p[m])<0&&Object.prototype.propertyIsEnumerable.call(u,p[m])&&(d[p[m]]=u[p[m]]);return d},n=qu&&qu.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(e,"__esModule",{value:!0}),e.ShareArrowIcon=e.ChatBubbleIcon=e.HeartIcon=e.EngagementIconsPlaceholder=void 0;const r=n(Bs()),i=n(zr()),s=u=>{var f=t(u,[]);return i.default.createElement("div",Object.assign({},f,{className:(0,r.default)(f.className),style:Object.assign({display:"flex",alignItems:"center",columnGap:14},f.style)}),i.default.createElement(e.HeartIcon,null),i.default.createElement(e.ChatBubbleIcon,null),i.default.createElement(e.ShareArrowIcon,null))};e.EngagementIconsPlaceholder=s;const o=u=>i.default.createElement("div",Object.assign({},u),i.default.createElement("div",{style:{backgroundColor:"#F4F4F4",borderRadius:"50%",height:"12.5px",width:"12.5px",transform:"translateX(0px) translateY(7px)"}}),i.default.createElement("div",{style:{backgroundColor:"#F4F4F4",height:"12.5px",transform:"rotate(-45deg) translateX(3px) translateY(1px)",width:"12.5px",flexGrow:0,marginRight:"6px",marginLeft:"2px"}}),i.default.createElement("div",{style:{backgroundColor:"#F4F4F4",borderRadius:"50%",height:"12.5px",width:"12.5px",transform:"translateX(9px) translateY(-18px)"}}));e.HeartIcon=o;const a=u=>i.default.createElement("div",Object.assign({},u),i.default.createElement("div",{style:{backgroundColor:"#F4F4F4",borderRadius:"50%",height:"20px",width:"20px"}}),i.default.createElement("div",{style:{width:0,height:0,borderTop:"2px solid transparent",borderLeft:"6px solid #f4f4f4",borderBottom:"2px s
217olid transparent",transform:"translateX(16px) translateY(-4px) rotate(30deg)"}}));e.ChatBubbleIcon=a;const l=u=>i.default.createElement("div",Object.assign({},u,{style:{height:25,width:25,transform:"translateX(0px) translateY(-2px)"}}),i.default.createElement("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512 512",xmlSpace:"preserve"},i.default.createElement("path",{style:{fill:"#F4F4F4"},d:`M295.204,180.593C132.168,180.593,0,312.759,0,475.796
218c51.398-130.047,184.869-203.22,317.483-183.603L295.204,180.593z`}),i.default.createElement("path",{style:{fill:"#F4F4F4"},d:`M512,253L295.204,36.204v217.818C159.946,249.655,34.992,339.262,0,475.794
219c59.905-109.171,178.724-165.463,295.204-151.033v145.035L512,253z`})));e.ShareArrowIcon=l})(qu)),qu}var _a={},J3;function CUe(){if(J3)return _a;J3=1;var e=_a&&_a.__rest||function(s,o){var a={};for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&o.indexOf(l)<0&&(a[l]=s[l]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,l=Object.getOwnPropertySymbols(s);u<l.length;u++)o.indexOf(l[u])<0&&Object.prototype.propertyIsEnumerable.call(s,l[u])&&(a[l[u]]=s[l[u]]);return a},t=_a&&_a.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(_a,"__esModule",{value:!0}),_a.ProfilePlaceholder=void 0;const n=t(Bs()),r=t(zr()),i=s=>{var o=e(s,[]);return r.default.createElement("div",Object.assign({},o,{className:(0,n.default)(o.className),style:Object.assign({},o.style)}),r.default.createElement("div",{style:{display:"flex",columnGap:14}},r.default.createElement("div",{style:{backgroundColor:"#F4F4F4",borderRadius:"50%",width:40,height:40}}),r.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",rowGap:6}},r.default.createElement("div",{style:{backgroundColor:"#F4F4F4",borderRadius:4,width:100,height:14}}),r.default.createElement("div",{style:{backgroundColor:"#F4F4F4",borderRadius:4,width:60,height:14}}))))};return _a.ProfilePlaceholder=i,_a}var e5;function du(){if(e5)return va;e5=1;var e=va&&va.__rest||function(f,d){var p={};for(var m in f)Object.prototype.hasOwnProperty.call(f,m)&&d.indexOf(m)<0&&(p[m]=f[m]);if(f!=null&&typeof Object.getOwnPropertySymbols=="function")for(var v=0,m=Object.getOwnPropertySymbols(f);v<m.length;v++)d.indexOf(m[v])<0&&Object.prototype.propertyIsEnumerable.call(f,m[v])&&(p[m[v]]=f[m[v]]);return p},t=va&&va.__importDefault||function(f){return f&&f.__esModule?f:{default:f}};Object.defineProperty(va,"__esModule",{value:!0}),va.PlaceholderEmbed=void 0;const n=t(Bs()),r=t(zr()),i=cu(),s=DQ(),o=EUe(),a=CUe(),l=/^[\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,u=f=>{var d,{url:p,linkText:m="View post",imageUrl:v,spinner:_=r.default.createElement(s.BorderSpinner,null),allowJavaScriptUrls:w=!0,spinnerDisabled:x}=f,S=e(f,["url","linkText","imageUrl","spinner","allowJavaScriptUrls","spinnerDisabled"]);return l.test(p)&&!w?(console.warn("PlaceholderEmbed has blocked a javascript: URL as a security precaution"),null):r.default.createElement("div",Object.assign({},S,{className:(0,n.default)(S.className),style:Object.assign({overflow:"hidden",border:"1px solid #dee2e6",backgroundColor:"#ffffff",borderRadius:0,boxSizing:"border-box",position:"relative"},S.style)}),r.default.createElement(i.EmbedStyle,null),r.default.createElement("a",{href:p,style:{textDecoration:"none"},target:"_blank",rel:"noopener noreferrer"},!v&&r.default.createElement("div",{style:{position:"absolute",top:0,left:0,display:"flex",justifyContent:"space-between",alignItems:"start",paddingLeft:16,paddingRight:16,paddingTop:16,paddingBottom:16,zIndex:2,backgroundColor:"#ffffff"}},r.default.createElement(a.ProfilePlaceholder,null)),r.default.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:v?"start":"center",height:"100%",width:"100%"}},!v&&r.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",rowGap:16,zIndex:3,padding:8,backgroundColor:"#ffffff"}},!x&&_,!!m&&r.default.createElement("div",{style:{color:"#000000",fontFamily:"Arial,sans-serif",fontSize:"14px",fontStyle:"normal",fontWeight:550,lineHeight:"18px",textAlign:"center"}},m)),v&&(typeof((d=S.style)===null||d===void 0?void 0:d.height)<"u"?r.default.createElement("div",{style:{width:"100%",height:"100%",background:`url("${v}")`,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",marginBottom:"40"}}):r.default.createElement("div",{style:{width:"100%",marginBottom:40}},r.default.createElement("img",{src:v,style:{width:"100%"}})))),r.default.createElement("div",{style:{position:"absolute",bottom:0,left:0,height:40,width:"100%",backgroundColor:"#ffffff",zIndex:1}},!v&&r.default.createElement(o.EngagementIconsPlaceholder,{style:{marginLeft:16}}),v&&r.default.createElement("div",{style:{display:"flex",height:"100%",alignItems:"center",justifyContent:"space-between",columnGap:16}},r.default.createElement("div",{style:{color:"#0095f6",fontWeight:600,fontFamily:"Arial,sans-serif",fontSize:"14px",fontStyle:"normal",whiteSpace:"nowrap",marginLeft:16}},m),!x&&r.default.createElement("div",{style:{marginRight:16}},_)))))};return va.PlaceholderEmbed=u,va}var vp={},t5;function eO(){if(t5)return vp;t5=1,Object.defineProperty(vp,"__esModule",{value:!0}),vp.generateUUID=void 0;const e=()=>{let t=new Date().getTime(),n=typeof performance<"u"&&performance.now&&performance.now()*1e3||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){let i=Math.random()*16;return t>0?(i=(t+i)%16|0,t=Math.floor(t/16)):(i=(n+i)%16|0,n=Math.floor(n/16)),(r==="x"?i:i&3|8).toString(16)})};return vp.generateUUID=e,vp}var Wu={},n5;function tO(){if(n5)return Wu;
219n5=1,Object.defineProperty(Wu,"__esModule",{value:!0}),Wu.Subs=Wu.Subscribe=void 0;class e{static subscribe(r){try{return r()}catch(i){console.error(i)}return()=>{}}static subscribeEvent(r,i,s){return r.addListener(i,s),()=>{r.removeListener(i,s)}}static subscribeDOMEvent(r,i,s,o){return r.addEventListener(i,s,o),()=>{r.removeEventListener(i,s,o)}}static setTimeout(r,i,...s){const o=setTimeout(r,i,s);return()=>clearTimeout(o)}static setInterval(r,i,...s){const o=setInterval(r,i,s);return()=>clearInterval(o)}static unsubAll(r){if(Array.isArray(r))r.forEach(i=>{try{i()}catch(s){console.error(s)}});else try{r()}catch(i){console.error(i)}}static createCleanup(r){return()=>e.unsubAll(r)}}Wu.Subscribe=e;class t{constructor(r=[]){this.list=r}subscribe(r){const i=e.subscribe(r);return this.push(i),i}subscribeEvent(r,i,s){const o=e.subscribeEvent(r,i,s);return this.push(o),o}subscribeDOMEvent(r,i,s){const o=e.subscribeDOMEvent(r,i,s);return this.push(o),o}setTimeout(r,i,...s){const o=setTimeout(r,i,s),a=()=>clearTimeout(o);return this.push(a),a}setInterval(r,i,...s){const o=setInterval(r,i,s),a=()=>clearInterval(o);return this.push(a),a}push(r){this.list.push(r)}unsubAll(){e.unsubAll(this.list),this.list.splice(0,this.list.length)}createCleanup(){return()=>{this.unsubAll()}}}return Wu.Subs=t,Wu}var r5;function kUe(){if(r5)return ga;r5=1;var e=ga&&ga.__rest||function(k,I){var D={};for(var L in k)Object.prototype.hasOwnProperty.call(k,L)&&I.indexOf(L)<0&&(D[L]=k[L]);if(k!=null&&typeof Object.getOwnPropertySymbols=="function")for(var A=0,L=Object.getOwnPropertySymbols(k);A<L.length;A++)I.indexOf(L[A])<0&&Object.prototype.propertyIsEnumerable.call(k,L[A])&&(D[L[A]]=k[L[A]]);return D},t=ga&&ga.__importDefault||function(k){return k&&k.__esModule?k:{default:k}};Object.defineProperty(ga,"__esModule",{value:!0}),ga.FacebookEmbed=void 0;const n=t(Bs()),r=t(zr()),i=J2(),s=du(),o=eO(),a=cu(),l=tO(),u="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v16.0",f=550,d=f,p=372,m=3,v="check-script",_="load-script",w="confirm-script-loaded",x="process-embed",S="confirm-embed-success",C="retrying",R="embed-success",P=k=>{var I,D,{url:L,width:A,height:$,linkText:j="View post on Facebook",placeholderImageUrl:V,placeholderSpinner:B,placeholderSpinnerDisabled:H=!1,placeholderProps:te,embedPlaceholder:G,placeholderDisabled:Z=!1,scriptLoadDisabled:Y=!1,retryDelay:M=5e3,retryDisabled:q=!1,frame:z=void 0,debug:N=!1}=k,ee=e(k,["url","width","height","linkText","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled","scriptLoadDisabled","retryDelay","retryDisabled","frame","debug"]);const[X,ne]=r.default.useState(v),ae=r.default.useMemo(()=>X===R,[X]),se=r.default.useRef((0,o.generateUUID)()),[ce,fe]=r.default.useState(Date.now()),ke=r.default.useMemo(()=>`${se.current}-${ce}`,[ce]),Ce=(0,i.useFrame)(z);r.default.useEffect(()=>{N&&console.log(`[${new Date().toISOString()}]: ${X}`)},[N,X]),r.default.useEffect(()=>{var ht,W,ie;X===v&&(!((ie=(W=(ht=Ce.window)===null||ht===void 0?void 0:ht.FB)===null||W===void 0?void 0:W.XFBML)===null||ie===void 0)&&ie.parse?ne(x):Y?console.error("Facebook embed script not found. Unable to process Facebook embed:",L):ne(_))},[Y,X,L,Ce.window]),r.default.useEffect(()=>{if(X===_&&Ce.document){const ht=Ce.document.createElement("script");ht.setAttribute("src",u),Ce.document.head.appendChild(ht),ne(w)}},[X,Ce.document]),r.default.useEffect(()=>{const ht=new l.Subs;return X===w&&ht.setInterval(()=>{var W,ie,ue;!((ue=(ie=(W=Ce.window)===null||W===void 0?void 0:W.FB)===null||ie===void 0?void 0:ie.XFBML)===null||ue===void 0)&&ue.parse&&ne(x)},1),ht.createCleanup()},[X,Ce.window]),r.default.useEffect(()=>{var ht,W,ie;if(X===x){const ue=(ie=(W=(ht=Ce.window)===null||ht===void 0?void 0:ht.FB)===null||W===void 0?void 0:W.XFBML)===null||ie===void 0?void 0:ie.parse;ue?(ue(),ne(S)):console.error("Facebook embed script not found. Unable to process Facebook embed:",L)}},[X,L,Ce.window]),r.default.useEffect(()=>{const ht=new l.Subs;return X===S&&(ht.setInterval(()=>{if(Ce.document){const W=Ce.document.getElementById(se.current);if(W){const ie=W.getElementsByClassName("fb-post")[0];ie&&ie.children.length>0&&ne(R)}}},1),q||ht.setTimeout(()=>{ne(C)},M)),ht.createCleanup()},[q,M,X,Ce.document]),r.default.useEffect(()=>{X===C&&(fe(Date.now()),ne(x))},[X]);const Se=!!A?.toString().includes("%"),Fe=!!$?.toString().includes("%"),Be={maxWidth:Se?void 0:d,width:typeof A<"u"?Se?"100%":A:"100%",height:Fe?"100%":typeof $<"u"?$:typeof((I=ee.style)===null||I===void 0?void 0:I.height)<"u"||typeof((D=ee.
219style)===null||D===void 0?void 0:D.maxHeight)<"u"?"100%":p,border:"1px solid #dee2e6",borderRadius:m},wt=G??r.default.createElement(s.PlaceholderEmbed,Object.assign({url:L,imageUrl:V,linkText:j,spinner:B,spinnerDisabled:H},te,{style:Object.assign(Object.assign({},Be),te?.style)}));return r.default.createElement("div",Object.assign({},ee,{className:(0,n.default)("rsme-embed rsme-facebook-embed",ee.className),style:Object.assign({overflow:"hidden",width:A??void 0,height:$??void 0,borderRadius:m},ee.style)}),r.default.createElement(a.EmbedStyle,null),r.default.createElement("div",{id:se.current,className:(0,n.default)(!ae&&"rsme-d-none")},r.default.createElement("div",{key:ke,className:"fb-post","data-href":L,"data-width":Se?"100%":A??f,style:{width:Se?"100%":A??f,height:Fe?"100%":$??void 0}})),!ae&&!Z&&wt)};return ga.FacebookEmbed=P,ga}var si={},i5;function TUe(){if(i5)return si;i5=1;var e=si&&si.__createBinding||(Object.create?(function(D,L,A,$){$===void 0&&($=A);var j=Object.getOwnPropertyDescriptor(L,A);(!j||("get"in j?!L.__esModule:j.writable||j.configurable))&&(j={enumerable:!0,get:function(){return L[A]}}),Object.defineProperty(D,$,j)}):(function(D,L,A,$){$===void 0&&($=A),D[$]=L[A]})),t=si&&si.__setModuleDefault||(Object.create?(function(D,L){Object.defineProperty(D,"default",{enumerable:!0,value:L})}):function(D,L){D.default=L}),n=si&&si.__importStar||function(D){if(D&&D.__esModule)return D;var L={};if(D!=null)for(var A in D)A!=="default"&&Object.prototype.hasOwnProperty.call(D,A)&&e(L,D,A);return t(L,D),L},r=si&&si.__rest||function(D,L){var A={};for(var $ in D)Object.prototype.hasOwnProperty.call(D,$)&&L.indexOf($)<0&&(A[$]=D[$]);if(D!=null&&typeof Object.getOwnPropertySymbols=="function")for(var j=0,$=Object.getOwnPropertySymbols(D);j<$.length;j++)L.indexOf($[j])<0&&Object.prototype.propertyIsEnumerable.call(D,$[j])&&(A[$[j]]=D[$[j]]);return A},i=si&&si.__importDefault||function(D){return D&&D.__esModule?D:{default:D}};Object.defineProperty(si,"__esModule",{value:!0}),si.InstagramEmbed=void 0;const s=i(Bs()),o=n(zr()),a=tO(),l=J2(),u=du(),f=eO(),d=cu(),p="https://www.instagram.com/embed.js",m=328,v=372,_=3,w="check-script",x="load-script",S="confirm-script-loaded",C="process-embed",R="confirm-embed-success",P="retrying",k="embed-success",I=D=>{var L,A,{url:$,width:j,height:V,linkText:B="View post on Instagram",captioned:H=!1,placeholderImageUrl:te,placeholderSpinner:G,placeholderSpinnerDisabled:Z=!1,placeholderProps:Y,embedPlaceholder:M,placeholderDisabled:q=!1,scriptLoadDisabled:z=!1,retryDelay:N=5e3,retryDisabled:ee=!1,igVersion:X="14",frame:ne=void 0,debug:ae=!1}=D,se=r(D,["url","width","height","linkText","captioned","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled","scriptLoadDisabled","retryDelay","retryDisabled","igVersion","frame","debug"]);const[ce,fe]=o.useState(w),ke=o.useRef((0,f.generateUUID)()),[Ce,Se]=o.useState(Date.now()),Fe=o.useMemo(()=>`${ke.current}-${Ce}`,[Ce]),Be=(0,l.useFrame)(ne);o.useEffect(()=>{ae&&console.log(`[${new Date().toISOString()}]: ${ce}`)},[ae,ce]),o.useEffect(()=>{var Ee,xe,ze;ce===w&&(!((ze=(xe=(Ee=Be.window)===null||Ee===void 0?void 0:Ee.instgrm)===null||xe===void 0?void 0:xe.Embeds)===null||ze===void 0)&&ze.process?fe(C):z?console.error("Instagram embed script not found. Unable to process Instagram embed:",$):fe(x))},[z,ce,$,Be.window]),o.useEffect(()=>{if(ce===x&&Be.document){const Ee=Be.document.createElement("script");Ee.setAttribute("src",p),Be.document.head.appendChild(Ee),fe(S)}},[ce,Be.document]),o.useEffect(()=>{const Ee=new a.Subs;return ce===S&&Ee.setInterval(()=>{var xe,ze,Ze;!((Ze=(ze=(xe=Be.window)===null||xe===void 0?void 0:xe.instgrm)===null||ze===void 0?void 0:ze.Embeds)===null||Ze===void 0)&&Ze.process&&fe(C)},1),Ee.createCleanup()},[ce,Be.window]),o.useEffect(()=>{var Ee,xe,ze;if(ce===C){const Ze=(ze=(xe=(Ee=Be.window)===null||Ee===void 0?void 0:Ee.instgrm)===null||xe===void 0?void 0:xe.Embeds)===null||ze===void 0?void 0:ze.process;Ze?(Ze(),fe(R)):console.error("Instagram embed script not found. Unable to process Instagram embed:",$)}},[ce,Be.window,$]),o.useEffect(()=>{const Ee=new a.Subs;return ce===R&&(Ee.setInterval(()=>{Be.document&&(Be.document.getElementById(ke.current)||fe(k))},1),ee||Ee.setTimeout(()=>{fe(P)},N)),Ee.createCleanup()},[N,ee,ce,Be.document]),o.useEffect(()=>{ce===P&&(Se(Date.now()),fe(C))},[ce]);const wt=$.split(/[?#]/)[0].replace(/\.com\/.*?\/p/,".com/p").replace(/\.com\/.*?\/reel/,".com/reel"),ht=`${wt}${wt.endsWith("/")?"":"/"}`,W=!!j?.toString().includes("%"),ie=!!V?.toString().includes("%"),ue={minWidth:W?void 0:m,width:typeof j<"u"?W?"100%":j:"100%",height:ie?"100%":typeof V<"u"?V:typeof((L=se.style)===null||L===void 0?void 0:L.height)<"u"||typeof((A=se.style)===null||A===void 0?void 0:A.maxHeight)<"u"?"100%":v,border:"1px solid #dee2e6",borderRadius:_},Re=M??o.createElement(u.PlaceholderEmbed,Object.assign({url:ht,
219imageUrl:te,linkText:B,spinner:G,spinnerDisabled:Z},Y,{style:Object.assign(Object.assign({},ue),Y?.style)}));return o.createElement("div",Object.assign({},se,{className:(0,s.default)("rsme-embed rsme-instagram-embed",ke.current,se.className),style:Object.assign(Object.assign({overflow:"hidden",width:j??void 0,height:V??void 0,borderRadius:_},se.style),{position:"relative"})}),o.createElement(d.EmbedStyle,null),o.createElement("blockquote",{key:Fe,className:"instagram-media","data-instgrm-permalink":`${ht}?utm_source=ig_embed&utm_campaign=loading`,"data-instgrm-version":X,"data-instgrm-captioned":H||void 0,"data-width":W?"100%":j??void 0,style:{width:"calc(100% - 2px)"}},!q&&Re,o.createElement("div",{id:ke.current,className:"instagram-media-pre-embed rsme-d-none"}," ")))};return si.InstagramEmbed=I,si}var oi={},s5;function PUe(){if(s5)return oi;s5=1;var e=oi&&oi.__createBinding||(Object.create?(function(v,_,w,x){x===void 0&&(x=w);var S=Object.getOwnPropertyDescriptor(_,w);(!S||("get"in S?!_.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(v,x,S)}):(function(v,_,w,x){x===void 0&&(x=w),v[x]=_[w]})),t=oi&&oi.__setModuleDefault||(Object.create?(function(v,_){Object.defineProperty(v,"default",{enumerable:!0,value:_})}):function(v,_){v.default=_}),n=oi&&oi.__importStar||function(v){if(v&&v.__esModule)return v;var _={};if(v!=null)for(var w in v)w!=="default"&&Object.prototype.hasOwnProperty.call(v,w)&&e(_,v,w);return t(_,v),_},r=oi&&oi.__rest||function(v,_){var w={};for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&_.indexOf(x)<0&&(w[x]=v[x]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,x=Object.getOwnPropertySymbols(v);S<x.length;S++)_.indexOf(x[S])<0&&Object.prototype.propertyIsEnumerable.call(v,x[S])&&(w[x[S]]=v[x[S]]);return w},i=oi&&oi.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(oi,"__esModule",{value:!0}),oi.LinkedInEmbed=void 0;const s=i(Bs()),o=n(zr()),a=du(),l=cu(),u=250,f=550,d=550,p=8,m=v=>{var _,w,{url:x,postUrl:S,width:C,height:R=500,linkText:P="View post on LinkedIn",placeholderImageUrl:k,placeholderSpinner:I,placeholderSpinnerDisabled:D=!1,placeholderProps:L,embedPlaceholder:A,placeholderDisabled:$=!1}=v,j=r(v,["url","postUrl","width","height","linkText","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled"]);const[V,B]=o.useState(!1),H={minWidth:u,maxWidth:f,width:typeof C<"u"?C:"100%",height:typeof R<"u"?R:typeof((_=j.style)===null||_===void 0?void 0:_.height)<"u"||typeof((w=j.style)===null||w===void 0?void 0:w.maxHeight)<"u"?"100%":d,border:"solid 1px rgba(0, 0, 0, 0.15)",borderRadius:p},te=A??o.createElement(a.PlaceholderEmbed,Object.assign({url:S??x,imageUrl:k,linkText:P,spinner:I,spinnerDisabled:D},L,{style:Object.assign(Object.assign({},H),L?.style)}));return o.createElement("div",Object.assign({},j,{className:(0,s.default)("rsme-embed rsme-linkedin-embed",j.className),style:Object.assign({overflow:"hidden",width:C??void 0,height:R??void 0,borderRadius:p},j.style)}),o.createElement(l.EmbedStyle,null),o.createElement("iframe",{className:(0,s.default)("linkedin-post",!V&&"rsme-d-none"),src:x,width:"100%",height:V?R:0,frameBorder:"0",onLoad:()=>B(!0)}),!V&&!$&&te)};return oi.LinkedInEmbed=m,oi}var ai={},o5;function RUe(){if(o5)return ai;o5=1;var e=ai&&ai.__createBinding||(Object.create?(function(v,_,w,x){x===void 0&&(x=w);var S=Object.getOwnPropertyDescriptor(_,w);(!S||("get"in S?!_.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(v,x,S)}):(function(v,_,w,x){x===void 0&&(x=w),v[x]=_[w]})),t=ai&&ai.__setModuleDefault||(Object.create?(function(v,_){Object.defineProperty(v,"default",{enumerable:!0,value:_})}):function(v,_){v.default=_}),n=ai&&ai.__importStar||function(v){if(v&&v.__esModule)return v;var _={};if(v!=null)for(var w in v)w!=="default"&&Object.prototype.hasOwnProperty.call(v,w)&&e(_,v,w);return t(_,v),_},r=ai&&ai.__rest||function(v,_){var w={};for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&_.indexOf(x)<0&&(w[x]=v[x]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,x=Object.getOwnPropertySymbols(v);S<x.length;S++)_.indexOf(x[S])<0&&Object.prototype.propertyIsEnumerable.call(v,x[S])&&(w[x[S]]=v[x[S]]);return w}
219,i=ai&&ai.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(ai,"__esModule",{value:!0}),ai.PinterestEmbed=void 0;const s=i(Bs()),o=n(zr()),a=du(),l=cu(),u=250,f=550,d=550,p=8,m=v=>{var _,w,x,{url:S,postUrl:C,width:R,height:P=500,linkText:k="View post on Pinterest",placeholderImageUrl:I,placeholderSpinner:D,placeholderSpinnerDisabled:L=!1,placeholderProps:A,embedPlaceholder:$,placeholderDisabled:j=!1}=v,V=r(v,["url","postUrl","width","height","linkText","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled"]);const[B,H]=o.useState(!1),te={minWidth:u,maxWidth:f,width:typeof R<"u"?R:"100%",height:typeof P<"u"?P:typeof((_=V.style)===null||_===void 0?void 0:_.height)<"u"||typeof((w=V.style)===null||w===void 0?void 0:w.maxHeight)<"u"?"100%":d,border:"solid 1px rgba(0, 0, 0, 0.15)",borderRadius:p},G=$??o.createElement(a.PlaceholderEmbed,Object.assign({url:C??S,imageUrl:I,linkText:k,spinner:D,spinnerDisabled:L},A,{style:Object.assign(Object.assign({},te),A?.style)})),Z=(x=S.match(/pin\/([\w\d_-]+)/))===null||x===void 0?void 0:x[1],Y=Z??"000000000000000000";return o.createElement("div",Object.assign({},V,{className:(0,s.default)("rsme-embed rsme-pinterest-embed",V.className),style:Object.assign({overflow:"hidden",width:R??void 0,height:P??void 0,borderRadius:p},V.style)}),o.createElement(l.EmbedStyle,null),o.createElement("iframe",{className:(0,s.default)("pinterest-post",!B&&"rsme-d-none"),src:`https://assets.pinterest.com/ext/embed.html?id=${Y}`,width:"100%",height:B?P:0,frameBorder:"0",scrolling:"no",onLoad:()=>H(!0)}),!B&&!j&&G)};return ai.PinterestEmbed=m,ai}var wa={},a5;function IUe(){if(a5)return wa;a5=1;var e=wa&&wa.__rest||function(C,R){var P={};for(var k in C)Object.prototype.hasOwnProperty.call(C,k)&&R.indexOf(k)<0&&(P[k]=C[k]);if(C!=null&&typeof Object.getOwnPropertySymbols=="function")for(var I=0,k=Object.getOwnPropertySymbols(C);I<k.length;I++)R.indexOf(k[I])<0&&Object.prototype.propertyIsEnumerable.call(C,k[I])&&(P[k[I]]=C[k[I]]);return P},t=wa&&wa.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(wa,"__esModule",{value:!0}),wa.TikTokEmbed=void 0;const n=t(Bs()),r=t(zr()),i=tO(),s=J2(),o=du(),a=eO(),l=cu(),u="https://www.tiktok.com/embed.js",f=325,d=480,p=550,m=8,v="process-embed",_="confirm-embed-success",w="retrying",x="embed-success",S=C=>{var R,P,{url:k,width:I,height:D,linkText:L="View post on TikTok",placeholderImageUrl:A,placeholderSpinner:$,placeholderSpinnerDisabled:j=!1,placeholderProps:V,embedPlaceholder:B,placeholderDisabled:H=!1,scriptLoadDisabled:te=!1,retryDelay:G=5e3,retryDisabled:Z=!1,frame:Y=void 0,debug:M=!1}=C,q=e(C,["url","width","height","linkText","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled","scriptLoadDisabled","retryDelay","retryDisabled","frame","debug"]);const[z,N]=r.default.useState(v),ee=r.default.useRef((0,a.generateUUID)()),[X,ne]=r.default.useState(Date.now()),ae=r.default.useMemo(()=>`${ee.current}-${X}`,[X]),se=(0,s.useFrame)(Y);r.default.useEffect(()=>{M&&console.log(`[${new Date().toISOString()}]: ${z}`)},[M,z]),r.default.useEffect(()=>{if(z===v&&se.document&&!te){const Ce="tiktok-embed-script",Se=se.document.getElementById(Ce);Se&&Se.remove();const Fe=se.document.createElement("script");Fe.setAttribute("src",`${u}?t=${Date.now()}`),Fe.setAttribute("id",Ce),se.document.head.appendChild(Fe),N(_)}},[te,z,se.document]),r.default.useEffect(()=>{const Ce=new i.Subs;return z===_&&(Ce.setInterval(()=>{se.document&&(se.document.getElementById(ee.current)||N(x))},1),Z||Ce.setTimeout(()=>{N(w)},G)),Ce.createCleanup()},[G,Z,z,se.document]),r.default.useEffect(()=>{z===w&&(ne(Date.now()),N(v))},[z]);const ce=k.replace(/[?].*$/,"").replace(/^.+\//,""),fe={minWidth:f,maxWidth:d,width:typeof I<"u"?I:"100%",height:typeof D<"u"?D:typeof((R=q.style)===null||R===void 0?void 0:R.height)<"u"||typeof((P=q.style)===null||P===void 0?void 0:P.maxHeight)<"u"?"100%":p,border:"solid 1px rgba(22,24,35,0.12)",borderRadius:m},ke=B??r.default.createElement(o.PlaceholderEmbed,Object.assign({url:k,imageUrl:A,linkText:L,spinner:$,spinnerDisabled:j},V,{style:Object.assign(Object.assign({},fe),V?.style)}
219));return r.default.createElement("div",Object.assign({},q,{className:(0,n.default)("rsme-embed rsme-tiktok-embed",q.className),style:Object.assign({overflow:"hidden",width:I??void 0,height:D??void 0,borderRadius:m},q.style)}),r.default.createElement(l.EmbedStyle,null),r.default.createElement("div",{className:"tiktok-embed-container"},r.default.createElement("blockquote",{key:ae,className:"tiktok-embed",cite:k,"data-video-id":ce},H?r.default.createElement("div",{id:ee.current,style:{display:"none"}}," "):r.default.createElement("div",{id:ee.current,style:{display:"flex",justifyContent:"center"}},ke))))};return wa.TikTokEmbed=S,wa}var yp={},li={},ra="https://platform.twitter.com/widgets.js",IE="createTimeline",OUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1],o=function(){var u=Object.assign({},t.options);if(t!=null&&t.autoHeight){var f,d;u.height=(f=n.current)===null||f===void 0||(d=f.parentNode)===null||d===void 0?void 0:d.offsetHeight}return u=Object.assign({},u,{theme:t?.theme,linkColor:t?.linkColor,borderColor:t?.borderColor,lang:t?.lang,tweetLimit:t?.tweetLimit,ariaPolite:t?.ariaPolite}),u},a=function(u){return u.chrome="",t.noHeader&&(u.chrome=u.chrome+" noheader"),t.noFooter&&(u.chrome=u.chrome+" nofooter"),t.noBorders&&(u.chrome=u.chrome+" noborders"),t.noScrollbar&&(u.chrome=u.chrome+" noscrollbar"),t.transparent&&(u.chrome=u.chrome+" transparent"),u};return ve.useEffect(function(){var l=!0,u=require("scriptjs");return u(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(l){if(!window.twttr.widgets[IE]){console.error("Method "+IE+" is not present anymore in twttr.widget api");return}var f=o();f=a(f),window.twttr.widgets[IE]({sourceType:t.sourceType,screenName:t.screenName,userId:t.userId,ownerScreenName:t.ownerScreenName,slug:t.slug,id:t.id||t.widgetId,url:t.url},n?.current,f).then(function(d){s(!1),t.onLoad&&t.onLoad(d)})}}),function(){l=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},OE="createShareButton",DUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[OE]){console.error("Method "+OE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[OE](t.url,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},DE="createFollowButton",AUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[DE]){console.error("Method "+DE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[DE](t.screenName,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},AE="createHashtagButton",MUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[AE]){console.error("Method "+AE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[AE](t.tag,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},ME="createMentionButton",NUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[ME]){console.error("Method "+ME+" is not present anymore in twttr.widget api");return}window.twttr.widgets[ME](t.screenName,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}
219},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},NE="createTweet",jUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[NE]){console.error("Method "+NE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[NE](t.tweetId,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},jE="createMoment",LUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[jE]){console.error("Method "+jE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[jE](t.momentId,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},LE="createDMButton",FUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[LE]){console.error("Method "+LE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[LE](t.id,n?.current,t.options).then(function(l){o&&(s(!1),t.onLoad&&t.onLoad(l))})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},FE="createVideo",$Ue=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[FE]){console.error("Method "+FE+" is not present anymore in twttr.widget api");return}window.twttr.widgets[FE](t.id,n?.current).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))},$E="createPeriscopeOnAirButton",zUe=function(t){var n=ve.useRef(null),r=ve.useState(!0),i=r[0],s=r[1];return ve.useEffect(function(){var o=!0,a=require("scriptjs");return a(ra,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(o){if(!window.twttr.widgets[$E]){console.error("Method "+$E+" is not present anymore in twttr.widget api");return}window.twttr.widgets[$E](t.username,n?.current,t.options).then(function(l){s(!1),t.onLoad&&t.onLoad(l)})}}),function(){o=!1}},[]),ve.createElement(ve.Fragment,null,i&&ve.createElement(ve.Fragment,null,t.placeholder),ve.createElement("div",{ref:n}))};const VUe=Object.freeze(Object.defineProperty({__proto__:null,TwitterDMButton:FUe,TwitterFollowButton:AUe,TwitterHashtagButton:MUe,TwitterMentionButton:NUe,TwitterMomentShare:LUe,TwitterOnAirButton:zUe,TwitterShareButton:DUe,TwitterTimelineEmbed:OUe,TwitterTweetEmbed:jUe,TwitterVideoEmbed:$Ue},Symbol.toStringTag,{value:"Module"})),UUe=$5(VUe);var l5;function AQ(){if(l5)return li;l5=1;var e=li&&li.__createBinding||(Object.create?(function(_,w,x,S){S===void 0&&(S=x);var C=Object.getOwnPropertyDescriptor(w,x);(!C||("get"in C?!w.__esModule:C.writable||C.configurable))&&(C={enumerable:!0,get:function(){return w[x]}}),Object.defineProperty(_,S,C)}):(function(_,w,x,S){S===void 0&&(S=x),_[S]=w[x]})),t=li&&li.__setModuleDefault||(Object.create?(function(_,w){Object.defineProperty(_,"default",{enumerable:!0,value:w})}):function(_,w){_.default=w}
219),n=li&&li.__importStar||function(_){if(_&&_.__esModule)return _;var w={};if(_!=null)for(var x in _)x!=="default"&&Object.prototype.hasOwnProperty.call(_,x)&&e(w,_,x);return t(w,_),w},r=li&&li.__rest||function(_,w){var x={};for(var S in _)Object.prototype.hasOwnProperty.call(_,S)&&w.indexOf(S)<0&&(x[S]=_[S]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function")for(var C=0,S=Object.getOwnPropertySymbols(_);C<S.length;C++)w.indexOf(S[C])<0&&Object.prototype.propertyIsEnumerable.call(_,S[C])&&(x[S[C]]=_[S[C]]);return x},i=li&&li.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(li,"__esModule",{value:!0}),li.XEmbed=void 0;const s=i(Bs()),o=n(zr()),a=UUe,l=du(),u=cu(),f=250,d=550,p=350,m=12,v=_=>{var w,x,{url:S,width:C,height:R,linkText:P="View post on X",placeholderImageUrl:k,placeholderSpinner:I,placeholderSpinnerDisabled:D=!1,placeholderProps:L,embedPlaceholder:A,placeholderDisabled:$,twitterTweetEmbedProps:j}=_,V=r(_,["url","width","height","linkText","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled","twitterTweetEmbedProps"]);const B=S.substring(S.lastIndexOf("/")+1).replace(/[?].*$/,""),H=!!C?.toString().includes("%"),te=!!R?.toString().includes("%"),G={minWidth:f,maxWidth:d,width:typeof C<"u"?H?"100%":C:"100%",height:te?"100%":typeof R<"u"?R:typeof((w=V.style)===null||w===void 0?void 0:w.height)<"u"||typeof((x=V.style)===null||x===void 0?void 0:x.maxHeight)<"u"?"100%":p,border:"solid 1px #c9d4d9",borderRadius:m},Z=A??o.createElement(l.PlaceholderEmbed,Object.assign({url:S,imageUrl:k,linkText:P,spinner:I,spinnerDisabled:D},L,{style:Object.assign(Object.assign({},G),L?.style)}));return o.createElement("div",Object.assign({},V,{className:(0,s.default)("rsme-embed rsme-twitter-embed",V.className),style:Object.assign({overflow:"hidden",width:C??void 0,height:R??void 0,borderRadius:m},V.style)}),o.createElement(u.EmbedStyle,null),o.createElement(a.TwitterTweetEmbed,Object.assign({tweetId:B,placeholder:$?void 0:Z},j)))};return li.XEmbed=v,li}var u5;function BUe(){if(u5)return yp;u5=1,Object.defineProperty(yp,"__esModule",{value:!0}),yp.TwitterEmbed=void 0;const e=AQ();return yp.TwitterEmbed=e.XEmbed,yp}var ui={},By={exports:{}},zE,c5;function HUe(){if(c5)return zE;c5=1;var e;return e=function(){var t={},n={};return t.on=function(r,i){var s={name:r,handler:i};return n[r]=n[r]||[],n[r].unshift(s),s},t.off=function(r){var i=n[r.name].indexOf(r);i!==-1&&n[r.name].splice(i,1)},t.trigger=function(r,i){var s=n[r],o;if(s)for(o=s.length;o--;)s[o].handler(i)},t},zE=e,zE}var Hy={exports:{}},VE,d5;function qUe(){if(d5)return VE;d5=1,VE=function(i,s,o){var a=document.head||document.getElementsByTagName("head")[0],l=document.createElement("script");typeof s=="function"&&(o=s,s={}),s=s||{},o=o||function(){},l.type=s.type||"text/javascript",l.charset=s.charset||"utf8",l.async="async"in s?!!s.async:!0,l.src=i,s.attrs&&e(l,s.attrs),s.text&&(l.text=""+s.text);var u="onload"in l?t:n;u(l,o),l.onload||t(l,o),a.appendChild(l)};function e(r,i){for(var s in i)r.setAttribute(s,i[s])}function t(r,i){r.onload=function(){this.onerror=this.onload=null,i(null,r)},r.onerror=function(){this.onerror=this.onload=null,i(new Error("Failed to load "+this.src),r)}}function n(r,i){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,i(null,r))}}return VE}var f5;function WUe(){return f5||(f5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=qUe(),r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}t.default=function(s){var o=new Promise(function(a){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){a(window.YT);return}else{var l=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(l+"//www.youtube.com/iframe_api",function(f){f&&s.trigger("error",f)})}var u=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){u&&u(),a(window.YT)}});return o},e.exports=t.default})(Hy,Hy.exports)),Hy.exports}
219var qy={exports:{}},Wy={exports:{}},Gy={exports:{}},UE,h5;function GUe(){if(h5)return UE;h5=1;var e=1e3,t=e*60,n=t*60,r=n*24,i=r*365.25;UE=function(u,f){f=f||{};var d=typeof u;if(d==="string"&&u.length>0)return s(u);if(d==="number"&&isNaN(u)===!1)return f.long?a(u):o(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function s(u){if(u=String(u),!(u.length>100)){var f=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(u);if(f){var d=parseFloat(f[1]),p=(f[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return d*i;case"days":case"day":case"d":return d*r;case"hours":case"hour":case"hrs":case"hr":case"h":return d*n;case"minutes":case"minute":case"mins":case"min":case"m":return d*t;case"seconds":case"second":case"secs":case"sec":case"s":return d*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}}}function o(u){return u>=r?Math.round(u/r)+"d":u>=n?Math.round(u/n)+"h":u>=t?Math.round(u/t)+"m":u>=e?Math.round(u/e)+"s":u+"ms"}function a(u){return l(u,r,"day")||l(u,n,"hour")||l(u,t,"minute")||l(u,e,"second")||u+" ms"}function l(u,f,d){if(!(u<f))return u<f*1.5?Math.floor(u/f)+" "+d:Math.ceil(u/f)+" "+d+"s"}return UE}var p5;function KUe(){return p5||(p5=1,(function(e,t){t=e.exports=i.debug=i.default=i,t.coerce=l,t.disable=o,t.enable=s,t.enabled=a,t.humanize=GUe(),t.names=[],t.skips=[],t.formatters={};var n;function r(u){var f=0,d;for(d in u)f=(f<<5)-f+u.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}function i(u){function f(){if(f.enabled){var d=f,p=+new Date,m=p-(n||p);d.diff=m,d.prev=n,d.curr=p,n=p;for(var v=new Array(arguments.length),_=0;_<v.length;_++)v[_]=arguments[_];v[0]=t.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");var w=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,function(S,C){if(S==="%%")return S;w++;var R=t.formatters[C];if(typeof R=="function"){var P=v[w];S=R.call(d,P),v.splice(w,1),w--}return S}),t.formatArgs.call(d,v);var x=f.log||t.log||console.log.bind(console);x.apply(d,v)}}return f.namespace=u,f.enabled=t.enabled(u),f.useColors=t.useColors(),f.color=r(u),typeof t.init=="function"&&t.init(f),f}function s(u){t.save(u),t.names=[],t.skips=[];for(var f=(typeof u=="string"?u:"").split(/[\s,]+/),d=f.length,p=0;p<d;p++)f[p]&&(u=f[p].replace(/\*/g,".*?"),u[0]==="-"?t.skips.push(new RegExp("^"+u.substr(1)+"$")):t.names.push(new RegExp("^"+u+"$")))}function o(){t.enable("")}function a(u){var f,d;for(f=0,d=t.skips.length;f<d;f++)if(t.skips[f].test(u))return!1;for(f=0,d=t.names.length;f<d;f++)if(t.names[f].test(u))return!0;return!1}function l(u){return u instanceof Error?u.stack||u.message:u}})(Gy,Gy.exports)),Gy.exports}var m5;function ZUe(){return m5||(m5=1,(function(e,t){var n={};t=e.exports=KUe(),t.log=s,t.formatArgs=i,t.save=o,t.load=a,t.useColors=r,t.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:l(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function r(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(u){try{return JSON.stringify(u)}catch(f){return"[UnexpectedJSONParseError]: "+f.message}};function i(u){var f=this.useColors;if(u[0]=(f?"%c":"")+this.namespace+(f?" %c":" ")+u[0]+(f?"%c ":" ")+"+"+t.humanize(this.diff),!!f){var d="color: "+this.color;u.splice(1,0,d,"color: inherit");var p=0,m=0;u[0].replace(/%[a-zA-Z%]/g,function(v){v!=="%%"&&(p++,v==="%c"&&(m=p))}),u.splice(m,0,d)}}function s(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function o(u){try{u==null?t.storage.removeItem("debug"):t.storage.debug=u}catch{}}function a(){var u;
219try{u=t.storage.debug}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}t.enable(a());function l(){try{return window.localStorage}catch{}}})(Wy,Wy.exports)),Wy.exports}var Ky={exports:{}},g5;function YUe(){return g5||(g5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],e.exports=t.default})(Ky,Ky.exports)),Ky.exports}var Zy={exports:{}},v5;function QUe(){return v5||(v5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],e.exports=t.default})(Zy,Zy.exports)),Zy.exports}var Yy={exports:{}},Qy={exports:{}},y5;function XUe(){return y5||(y5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},e.exports=t.default})(Qy,Qy.exports)),Qy.exports}var b5;function JUe(){return b5||(b5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=XUe(),r=i(n);function i(s){return s&&s.__esModule?s:{default:s}}t.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},e.exports=t.default})(Yy,Yy.exports)),Yy.exports}var _5;function e7e(){return _5||(_5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=ZUe(),r=f(n),i=YUe(),s=f(i),o=QUe(),a=f(o),l=JUe(),u=f(l);function f(m){return m&&m.__esModule?m:{default:m}}var d=(0,r.default)("youtube-player"),p={};p.proxyEvents=function(m){var v={},_=function(I){var D="on"+I.slice(0,1).toUpperCase()+I.slice(1);v[D]=function(L){d('event "%s"',D,L),m.trigger(I,L)}},w=!0,x=!1,S=void 0;try{for(var C=a.default[Symbol.iterator](),R;!(w=(R=C.next()).done);w=!0){var P=R.value;_(P)}}catch(k){x=!0,S=k}finally{try{!w&&C.return&&C.return()}finally{if(x)throw S}}return v},p.promisifyPlayer=function(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_={},w=function(D){v&&u.default[D]?_[D]=function(){for(var L=arguments.length,A=Array(L),$=0;$<L;$++)A[$]=arguments[$];return m.then(function(j){var V=u.default[D],B=j.getPlayerState(),H=j[D].apply(j,A);return V.stateChangeRequired||Array.isArray(V.acceptableStates)&&V.acceptableStates.indexOf(B)===-1?new Promise(function(te){var G=function Z(){var Y=j.getPlayerState(),M=void 0;typeof V.timeout=="number"&&(M=setTimeout(function(){j.removeEventListener("onStateChange",Z),te()},V.timeout)),Array.isArray(V.acceptableStates)&&V.acceptableStates.indexOf(Y)!==-1&&(j.removeEventListener("onStateChange",Z),clearTimeout(M),te())};j.addEventListener("onStateChange",G)}).then(function(){return H}):H})}:_[D]=function(){for(var L=arguments.length,A=Array(L),$=0;$<L;$++)A[$]=arguments[$];return m.then(function(j){return j[D].apply(j,A)})}},x=!0,S=!1,C=void 0;try{for(var R=s.default[Symbol.iterator](),P;!(x=(P=R.next()).done);x=!0){var k=P.value;w(k)}}catch(I){S=!0,C=I}finally{try{!x&&R.return&&R.return()}finally{if(S)throw C}}return _},t.default=p,e.exports=t.default})(qy,qy.exports)),qy.exports}var w5;function t7e(){return w5||(w5=1,(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},r=HUe(),i=u(r),s=WUe(),o=u(s),a=e7e(),l=u(a);function u(d){return d&&d.__esModule?d:{default:d}}var f=void 0;t.default=function(d){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,v=(0,i.default)();if(f||(f=(0,o.default)(v)),p.events)throw new Error("Event handlers cannot be overwritten.");
219if(typeof d=="string"&&!document.getElementById(d))throw new Error('Element "'+d+'" does not exist.');p.events=l.default.proxyEvents(v);var _=new Promise(function(x){if((typeof d>"u"?"undefined":n(d))==="object"&&d.playVideo instanceof Function){var S=d;x(S)}else f.then(function(C){var R=new C.Player(d,p);return v.on("ready",function(){x(R)}),null})}),w=l.default.promisifyPlayer(_,m);return w.on=v.on,w.off=v.off,w},e.exports=t.default})(By,By.exports)),By.exports}var n7e=t7e();const r7e=vo(n7e);var i7e=Object.defineProperty,s7e=Object.defineProperties,o7e=Object.getOwnPropertyDescriptors,x5=Object.getOwnPropertySymbols,a7e=Object.prototype.hasOwnProperty,l7e=Object.prototype.propertyIsEnumerable,S5=(e,t,n)=>t in e?i7e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jT=(e,t)=>{for(var n in t||(t={}))a7e.call(t,n)&&S5(e,n,t[n]);if(x5)for(var n of x5(t))l7e.call(t,n)&&S5(e,n,t[n]);return e},LT=(e,t)=>s7e(e,o7e(t)),u7e=(e,t,n)=>new Promise((r,i)=>{var s=l=>{try{a(n.next(l))}catch(u){i(u)}},o=l=>{try{a(n.throw(l))}catch(u){i(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,o);a((n=n.apply(e,t)).next())});function c7e(e,t){var n,r;if(e.videoId!==t.videoId)return!0;const i=((n=e.opts)==null?void 0:n.playerVars)||{},s=((r=t.opts)==null?void 0:r.playerVars)||{};return i.start!==s.start||i.end!==s.end}function E5(e={}){return LT(jT({},e),{height:0,width:0,playerVars:LT(jT({},e.playerVars),{autoplay:0,start:0,end:0})})}function d7e(e,t){return e.videoId!==t.videoId||!cH(E5(e.opts),E5(t.opts))}function f7e(e,t){var n,r,i,s;return e.id!==t.id||e.className!==t.className||((n=e.opts)==null?void 0:n.width)!==((r=t.opts)==null?void 0:r.width)||((i=e.opts)==null?void 0:i.height)!==((s=t.opts)==null?void 0:s.height)||e.iframeClassName!==t.iframeClassName||e.title!==t.title}var h7e={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},p7e={videoId:St.string,id:St.string,className:St.string,iframeClassName:St.string,style:St.object,title:St.string,loading:St.oneOf(["lazy","eager"]),opts:St.objectOf(St.any),onReady:St.func,onError:St.func,onPlay:St.func,onPause:St.func,onEnd:St.func,onStateChange:St.func,onPlaybackRateChange:St.func,onPlaybackQualityChange:St.func},k0=class extends ve.Component{constructor(e){super(e),this.destroyPlayerPromise=void 0,this.onPlayerReady=t=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,t)},this.onPlayerError=t=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,t)},this.onPlayerStateChange=t=>{var n,r,i,s,o,a,l,u;switch((r=(n=this.props).onStateChange)==null||r.call(n,t),t.data){case k0.PlayerState.ENDED:(s=(i=this.props).onEnd)==null||s.call(i,t);break;case k0.PlayerState.PLAYING:(a=(o=this.props).onPlay)==null||a.call(o,t);break;case k0.PlayerState.PAUSED:(u=(l=this.props).onPause)==null||u.call(l,t);break}},this.onPlayerPlaybackRateChange=t=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,t)},this.onPlayerPlaybackQualityChange=t=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,t)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const t=LT(jT({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=r7e(this.container,t),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var t;(t=this.internalPlayer)==null||t.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var t,n,r,i;if(typeof this.props.videoId>"u"||this.props.videoId===null){(t=this.internalPlayer)==null||t.stopVideo();return}let s=!1;const o={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(s=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(o.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(o.endSeconds=this.props.opts.playerVars.end)),s){(r=this.internalPlayer)==null||r.loadVideoById(o);return}(i=this.internalPlayer)==null||i.cueVideoById(o)},this.refContainer=t=>{this.container=t},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(e){return u7e(this,null,function*(){f7e(e,this.props)&&this.updatePlayer(),d7e(e,this.props)&&(yield this.resetPlayer()),c7e(e,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return ve.createElement("div",{className:this.props.className,style:this.props.style},ve.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},kw=k0;kw.propTypes=p7e;kw.defaultProps=h7e;kw.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var m7e=kw;const g7e=Object.freeze(Object.defineProperty({__proto__:null,default:m7e},Symbol.toStringTag,{value:"Module"})),v7e=$5(g7e);var C5;
219function y7e(){if(C5)return ui;C5=1;var e=ui&&ui.__createBinding||(Object.create?(function(v,_,w,x){x===void 0&&(x=w);var S=Object.getOwnPropertyDescriptor(_,w);(!S||("get"in S?!_.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(v,x,S)}):(function(v,_,w,x){x===void 0&&(x=w),v[x]=_[w]})),t=ui&&ui.__setModuleDefault||(Object.create?(function(v,_){Object.defineProperty(v,"default",{enumerable:!0,value:_})}):function(v,_){v.default=_}),n=ui&&ui.__importStar||function(v){if(v&&v.__esModule)return v;var _={};if(v!=null)for(var w in v)w!=="default"&&Object.prototype.hasOwnProperty.call(v,w)&&e(_,v,w);return t(_,v),_},r=ui&&ui.__rest||function(v,_){var w={};for(var x in v)Object.prototype.hasOwnProperty.call(v,x)&&_.indexOf(x)<0&&(w[x]=v[x]);if(v!=null&&typeof Object.getOwnPropertySymbols=="function")for(var S=0,x=Object.getOwnPropertySymbols(v);S<x.length;S++)_.indexOf(x[S])<0&&Object.prototype.propertyIsEnumerable.call(v,x[S])&&(w[x[S]]=v[x[S]]);return w},i=ui&&ui.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(ui,"__esModule",{value:!0}),ui.YouTubeEmbed=void 0;const s=i(Bs()),o=n(zr()),a=i(v7e),l=du(),u=cu(),f=640,d=360,p=0,m=v=>{var _,w,x,S,C,R,P,k,I,D,L,A,$,{url:j,width:V,height:B,linkText:H="Watch on YouTube",placeholderImageUrl:te,placeholderSpinner:G,placeholderSpinnerDisabled:Z=!1,placeholderProps:Y,embedPlaceholder:M,placeholderDisabled:q,youTubeProps:z}=v,N=r(v,["url","width","height","linkText","placeholderImageUrl","placeholderSpinner","placeholderSpinnerDisabled","placeholderProps","embedPlaceholder","placeholderDisabled","youTubeProps"]);const[ee,X]=o.useState(!1),ne=(_=j.match(/[?&]v=(.+?)(?:$|[&?])/))===null||_===void 0?void 0:_[1],ae=(w=j.match(/https:\/\/(?:www\.)?youtube\.com\/shorts\/(.+?)(?:$|[&?])/))===null||w===void 0?void 0:w[1],se=(x=j.match(/https:\/\/youtu\.be\/(.+?)(?:$|[&?])/))===null||x===void 0?void 0:x[1],ce=(S=j.match(/https:\/\/(?:www\.)youtube(-nocookie)?\.com\/embed\/(.+?)(?:$|[&?])/))===null||S===void 0?void 0:S[2],fe=(P=(R=(C=ne??ae)!==null&&C!==void 0?C:se)!==null&&R!==void 0?R:ce)!==null&&P!==void 0?P:"00000000",ke=+((I=(k=j.match(/(.+?)(?:$|[&?])start=(\d+)/))===null||k===void 0?void 0:k[2])!==null&&I!==void 0?I:0),Ce=!!V?.toString().includes("%"),Se=!!B?.toString().includes("%");let Fe={};ke&&(Fe.playerVars={start:ke}),typeof V<"u"&&(Fe.width=Ce?"100%":`${V}`),typeof B<"u"&&(Fe.height=Se?"100%":`${B}`),Fe=Object.assign(Object.assign({},Fe),z?.opts);const Be={maxWidth:Ce?void 0:f,width:typeof V<"u"?Ce?"100%":V:"100%",height:Se?"100%":typeof B<"u"?B:typeof((D=N.style)===null||D===void 0?void 0:D.height)<"u"||typeof((L=N.style)===null||L===void 0?void 0:L.maxHeight)<"u"?"100%":d,border:"1px solid #dee2e6",borderRadius:p},wt=M??o.createElement(l.PlaceholderEmbed,Object.assign({url:j,imageUrl:te,linkText:H,spinner:G,spinnerDisabled:Z},Y,{style:Object.assign(Object.assign({},Be),Y?.style)}));return o.createElement("div",Object.assign({},N,{className:(0,s.default)("rsme-embed rsme-youtube-embed",N.className),style:Object.assign({overflow:"hidden",width:V??void 0,height:B??void 0,borderRadius:p},N.style)}),o.createElement(u.EmbedStyle,null),o.createElement("div",{className:(0,s.default)(!ee&&"rsme-d-none")},o.createElement(a.default,Object.assign({},z,{className:(A=z?.className)!==null&&A!==void 0?A:"youtube-iframe",videoId:($=z?.videoId)!==null&&$!==void 0?$:fe,opts:Fe,onReady:ht=>{X(!0),z&&z.onReady&&z?.onReady(ht)}}))),!ee&&!q&&wt)};return ui.YouTubeEmbed=m,ui}var k5;function b7e(){return k5||(k5=1,(function(e){var t=Bu&&Bu.__createBinding||(Object.create?(function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}):(function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]})),n=Bu&&Bu.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,r,s)};Object.defineProperty(e,"__esModule",{value:!0}),n(kUe(),e),n(TUe(),e),n(PUe(),e),n(RUe(),e),n(IUe(),e),n(BUe(),e),n(AQ(),e),n(y7e(),e),n(du(),e),n(DQ(),e)})(Bu)),Bu}var Gu=b7e();const T5={"youtube.com":Gu.YouTubeEmbed,"twitter.com":Gu.XEmbed,"facebook.com":Gu.FacebookEmbed,"instagram.com":Gu.InstagramEmbed,"linkedin.com":Gu.LinkedInEmbed,"pinterest.com":Gu.PinterestEmbed,"tiktok.com":Gu.TikTokEmbed},_7e=({link:e})=>{const t=e?.url,[n,r]=b.useState("lg"),i=MZ(()=>{window.innerWidth<450?r("xs"):window.innerWidth>=450&&window.innerWidth<640?r("sm"):window.innerWidth>=640&&window.innerWidth<1024?r("md"):r("lg")},100);if(b.useEffect(()=>(window.addEventListener("resize",i),i(),()=>window.removeEventListener("resize",i)),[]),!t)return g.jsx(x2,{});const s=Object.keys(T5).find(l=>t.includes(l));if(!s)return g.jsx(g.Fragment,{});const o=T5[s],a={url:t};return s==="youtube.com"&&(a.linkText="Loading...",n==="xs"?(a.width="325",a.height="220"):n==="sm"?(a.width="480",a.height="270"):n==="md"?(a.width="640",a.height="360"):(a.width="854",a.height="480")),g.jsx("div",{className:"flex size-full flex-col items-center justify-center",children:g.jsxs("div",{className:"flex flex-col items-start",children:[s==="youtube.com"&&g.jsx("p",{className:"size-fit text-wrap py-4 text-lg font-semibold",children:e.title}),g.jsx(o,{...a})]})})},w7e=["youtube.com","twitter.com","facebook.com","instagram.com","pinterest.com","tiktok.com"],x7e=e=>w7e.some(t=>e.includes(t)),S7e=({link:e})=>{const n=Qn().pathname,[r,i]=b.useState(!1),s=n==="/"||n==="/c"||n==="/c/"||n.includes("/c/-1");if(b.useEffect(()=>{localStorage.getItem("mentes_onboarding_seen")==="true"&&i(!0)},[]),!e?.url)return s&&!r?g.jsx(BLe,{}):g.jsx(x2,{});if(e?.url.includes("twitter.com")){const o=X3e(e.url);if(o)return g.jsx(Cc,{className:"relative h-full",children:g.jsx(Q3e,{tweetId:o})})}return x7e(e.url)?g.jsx(Cc,{className:"relative h-full ",children:g.jsx(_7e,{link:e})}):g.jsx(C7e,{link:e})},E7e=()=>{const{selectedLink:e}=ug();return g.jsxs("div",{className:"flex h-full flex-col overflow-hidden rounded-lg border",children:[g.jsx(o4e,{url:e?.url}),g.jsx("div",{className:"flex-1 overflow-hidden",children:g.jsx(S7e,{link:e})})]})};function C7e({link:e}){const[t,n]=b.useState(!0),[r,i]=b.useState(!1),s=b.useRef(null),{resolvedTheme:o}=wz(),a=b.useRef(t);b.useEffect(()=>{a.current=t},[t]),b.useEffect(()=>{n(!0),i(!1);const d=setTimeout(()=>{a.current&&(i(!0),n(!1))},5e3);return()=>clearTimeout(d)},[e?.url]);const l=()=>{const d=s.current;d&&d.contentWindow&&d.contentWindow.postMessage({theme:o},"*")};if(b.useEffect(()=>{l()}
219,[o]),!e?.url)return g.jsx(x2,{});const u=new URL("https://view-web.page/browse/");u.searchParams.append("page",encodeURI(e.url));const f={id:"previewFrame",ref:s,src:u.toString(),title:"Preview",className:"h-full w-full",frameBorder:"0",allowFullScreen:!0,onLoad:()=>{n(!1),i(!1),l()}};return g.jsxs("div",{className:"relative h-full",children:[t&&!r&&g.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:g.jsx("div",{className:"size-12 animate-spin rounded-full border-y-2 border-primary"})}),r&&g.jsx(SUe,{link:e}),g.jsx("iframe",{...f,style:{display:r?"none":"block"}})]})}const k7e=Jf("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function T7e({className:e,variant:t,...n}){return g.jsx("div",{className:_e(k7e({variant:t}),e),...n})}const P7e=qI,R7e=WI,I7e=GI,MQ=b.forwardRef(({className:e,...t},n)=>g.jsx(Cg,{className:_e("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));MQ.displayName=Cg.displayName;const O7e=Jf("fixed z-50 gap-4 bg-background p-6 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),NQ=b.forwardRef(({side:e="right",className:t,children:n,...r},i)=>g.jsxs(I7e,{children:[g.jsx(MQ,{}),g.jsxs(kg,{ref:i,className:_e(O7e({side:e}),t),...r,children:[g.jsxs(Rg,{className:"absolute right-4 top-4 roun
219ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[g.jsx(Jo,{className:"size-4"}),g.jsx("span",{className:"sr-only",children:"Close"})]}),n]})]}));NQ.displayName=kg.displayName;const jQ=({className:e,...t})=>g.jsx("div",{className:_e("flex flex-col space-y-2 text-center sm:text-left",e),...t});jQ.displayName="SheetHeader";const LQ=({className:e,...t})=>g.jsx("div",{className:_e("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});LQ.displayName="SheetFooter";const FQ=b.forwardRef(({className:e,...t},n)=>g.jsx(Tg,{ref:n,className:_e("text-lg font-semibold text-foreground",e),...t}));FQ.displayName=Tg.displayName;const $Q=b.forwardRef(({className:e,...t},n)=>g.jsx(Pg,{ref:n,className:_e("text-sm text-muted-foreground",e),...t}));$Q.displayName=Pg.displayName;const D7e=({link:e})=>g.jsx(Cc,{className:"size-full  ",children:g.jsxs("div",{className:"px-3",children:[g.jsxs("div",{className:"py-4",children:[g.jsx("p",{className:"pb-4 text-lg font-semibold",children:"Keywords"}),e.keywords?e.keywords?.slice(0,10).map(t=>g.jsx("p",{children:g.jsx(T7e,{className:"mb-2 mr-2",children:t},t)},t)):g.jsx("p",{className:"text-muted-foreground",children:"No keywords available"})]}),g.jsx("p",{className:"pb-4 text-lg font-semibold",children:"Summary"}),e.summary?g.jsx("div",{className:"prose-sm mt-1 w-full break-words prose-p:leading-relaxed",children:g.jsx(K2,{remarkPlugins:[X2],components:{a:t=>g.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer"}),li:t=>g.jsx("li",{...t,className:"mb-2"}),ul:t=>g.jsx("ul",{...t,className:"list-disc pl-4"}),ol:t=>g.jsx("ol",{...t,className:"list-decimal pl-4"})},children:e.summary})}):g.jsx("p",{className:"text-muted-foreground",children:"No summary available"})]})}),A7e=({children:e})=>{const{selectedLink:t}=ug(),[n,r]=b.useState(!1);return t?g.jsxs(P7e,{children:[g.jsx(R7e,{asChild:!0,children:e}),g.jsxs(NQ,{className:"w-[900px] items-start justify-between px-0 sm:w-[840px]",children:[g.jsxs(jQ,{className:"px-4",children:[g.jsx(FQ,{children:"Details"}),g.jsxs($Q,{children:[g.jsx("p",{className:"text-ellipsis pb-2 text-sm",children:t.title}),g.jsx(uI,{})]})]}),g.jsx("div",{className:"h-[95%] border-s-black",children:!n&&g.jsx(D7e,{link:t})}),g.jsx(LQ,{className:"sm:invisible sm:justify-center lg:visible",children:g.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"fixed bottom-3 inline-flex items-center justify-between text-ellipsis text-xs ",children:[g.jsx(zp,{className:"ml-1 mr-2 size-4"}),t.url]})})]})]}):null},M7e=()=>g.jsx(A7e,{children:g.jsxs(fn,{variant:"outline",className:"h-25 fixed bottom-2/3 right-0 flex w-10 translate-y-1/2 flex-col rounded-2xl shadow-sm",children:[g.jsx(Er.ChevronLeft,{className:"size-4"}),g.jsx("div",{className:"text-md rotate-90 py-7",children:"Summary"})]})});function N7e({input:e,handleInputChange:t,handleSubmit:n,isLoading:r,isExpanded:i}){return g.jsx("div",{className:_e("flex h-16 min-h-16 items-center justify-center gap-2 px-4",i?"container w-4/5":"w-full"),children:g.jsxs("form",{className:"flex w-full gap-2",onSubmit:n,children:[g.jsx("input",{autoFocus:!0,t
219ype:"text",name:"Query Field",autoComplete:"off",value:e,onChange:t,className:"w-full rounded-full border px-4 py-2 text-sm outline-none focus:ring-1 focus:ring-accent-foreground",placeholder:"Type your message here."}),g.jsx("button",{"aria-label":"Send",type:"submit",disabled:r||!e,children:g.jsx(fie,{className:"size-6"})})]})})}function j7e({windowHeading:e,onClearButtonClick:t,onCollapseButtonClick:n,onExpandClick:r,isExpanded:i}){return g.jsxs("div",{className:"flex h-12 min-h-12 items-center justify-between border-b px-4",children:[g.jsx("div",{className:"truncate text-lg font-medium",children:e}),g.jsxs("div",{className:"flex gap-4",children:[g.jsx("button",{onClick:t,"aria-label":"Clear",children:g.jsx(Kre,{className:"size-4"})}),g.jsx("button",{onClick:r,"aria-label":i?"Minimize":"Expand",children:i?g.jsx(zz,{className:"size-4"}):g.jsx(Fz,{className:"size-4"})}),g.jsx("button",{onClick:n,"aria-label":"Collapse",children:g.jsx(Jo,{className:"size-4"})})]})]})}function L7e(){return g.jsxs("div",{className:"mb-2 mt-1 box-border grid w-4 grid-cols-3 items-center gap-1",children:[g.jsx("div",{className:"animate-bubble size-1.5 rounded-full bg-gray-400"}),g.jsx("div",{className:"animate-bubble animation-delay-200 size-1.5 rounded-full bg-gray-400"}),g.jsx("div",{className:"animate-bubble animation-delay-400 size-1.5 rounded-full bg-gray-400"})]})}function F7e({message:e,isLoading:t,isFirst:n,isLast:r,isExpanded:i}){return g.jsxs("div",{className:_e("flex items-center",e.role!=="assistant"?"flex-row-reverse":"justify-start",i?"container w-4/5":"w-full"),children:[e.role!=="assistant"?g.jsx(Kz,{width:20}):g.jsx(tg,{width:20}),g.jsxs("div",{className:`max-w-4/5 mx-2 w-fit rounded-lg p-3 text-sm ${e.role!=="assistant"?"cursor-default bg-zinc-200 dark:bg-primary/60 dark:text-primary-foreground":"bg-white dark:bg-primary/80 dark:text-primary-foreground"}`,children:[g.jsx("div",{className:"prose-sm mt-1 w-full break-words prose-p:leading-relaxed",children:g.jsx(K2,{remarkPlugins:[X2],components:{a:s=>g.jsx("a",{...s,target:"_blank",rel:"noopener noreferrer"}),li:s=>g.jsx("li",{...s,className:"mb-2"}),ul:s=>g.jsx("ul",{...s,className:"list-disc pl-4"}),ol:s=>g.jsx("ol",{...s,className:"list-decimal pl-4"})},children:$ge(e)})}),e.role==="assistant"&&t&&r&&g.jsx(L7e,{})]})]})}function $7e({id:e,initialMessages:t,onMessagesChange:n,handleClearConversation:r,handleCollapseButtonClick:i}){const s=b.useRef(null),[o,a]=b.useState(!1),{selectedLink:l,selectedCollection:u}=ug(),[f,d]=b.useState("Chat"),p={};if(u){const j=u.toString();j!=="-1"&&(p.collection_id=j)}l&&(p.link_id=l.id.toString()),b.useEffect(()=>{d(l?l.title:"Chat")},[l]);const[m,v]=b.useState(""),_=b.useRef(p);_.current=p;const w=b.useMemo(()=>new y_({api:`${K9.API_URL}/chats/`,fetch:vge(),prepareSendMessagesRequest:({id:j,messages:V,trigger:B,messageId:H,headers:te,body:G})=>({headers:{...te,...Age},body:{id:j,messages:V,trigger:B,...H?{messageId:H}:{},...Object.keys(_.current).length>0&&{filter:_.current},...G}})}),[]),{messages:x,sendMessage:S,status:C,error:R,regenerate:P}=nge({id:e,messages:t,transport:w}),k=C==="submitted"||C==="streaming",I=j=>{v(j.target.value)},D=j=>{j.preventDefault();const V=m.trim();V&&(S({text:V}),v(""))};b.useEffect(()=>{x.length>0&&n(x)},[x]),b.useEffect(()=>{L()},[x]);function L(){s.current&&s.current.scrollIntoView({behavior:"smooth"})}const A=!!R,$=b.useMemo(()=>hge(R),[R]);return g.jsxs("div",{className:`z-50 flex flex-col overflow-hidden rounded-lg border border-border bg-primary-foreground shadow-sm dark:bg-secondary ${o?"fixed inset-0":"fixed bottom-20 right-8 h-[650px] w-96"}`,children:[g.jsx(j7e,{windowHeading:f,onClearButtonClick:r,onExpandClick:()=>a(!o),isExpanded:o,onCollapseButtonClick:i}),g.jsxs("div",{className:"box-border flex w-full grow flex-col gap-2 overflow-scroll bg-accent p-3",children:[x.map((j,V)=>g.jsx(F7e,{message:j,isFirst:V===0,isLast:x.length-1===V,isLoading:C==="streaming",isExpanded:o},j.id)),A&&!k&&g.jsxs("div",{className:"flex flex-col items-end gap-1.5 px-2",children:[g.jsx("p",{className:"text-right text-xs text-muted-foreground",children:$.message}),$.debug&&g.jsx("p",{className:"break-all text-right font-mono text-[11px] text-muted-foreground opacity-60",children:$.debug}),g.jsxs("button",{onClick:()=>P(),className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-background px-3 py-1.5 text-xs font-medium text-foreground shadow-sm transition-colors hover:bg-muted",children:[g.jsx(qz,{className:"h-3.5 w-3.5"}),"Retry"]})]}),g.jsx("div",{ref:s})]}
219),g.jsx(N7e,{input:m,handleInputChange:I,handleSubmit:D,isLoading:k,isExpanded:o})]})}function z7e({isOpen:e,setIsOpen:t,hasInteracted:n,setHasInteracted:r}){const i="Try <b>AI-powered</b> chat!";function s(){t(!e),r(!0),localStorage.setItem("has-interacted","true")}return g.jsxs("button",{className:"duration-250 absolute bottom-6 right-6 box-border flex size-16 cursor-pointer items-center justify-center rounded-full border-none bg-primary p-3 opacity-100 shadow-sm transition-all ease-in-out",onClick:s,children:[g.jsxs("div",{className:"relative flex size-full items-center justify-center",children:[g.jsx(Jo,{className:`absolute left-1/2 top-1/2 size-full -translate-x-1/2 -translate-y-1/2 stroke-secondary transition-opacity duration-100 ease-in-out ${e?"":"opacity-0"}`}),g.jsx(Ire,{className:`absolute left-1/2 top-1/2 size-full -translate-x-1/2 -translate-y-1/2 -rotate-90 stroke-secondary transition-opacity duration-100 ease-in-out ${e?"opacity-0":""}`})]}),!n&&g.jsx("div",{className:"absolute right-0 top-0 size-4 rounded-full border-2 border-background bg-foreground"}),!n&&g.jsx("p",{className:"right-18 absolute bottom-5 flex flex-row gap-0.5 whitespace-nowrap rounded-lg border border-border bg-background p-1.5 px-3 text-xs text-foreground shadow-sm",dangerouslySetInnerHTML:{__html:i}})]})}const kf=[{id:"welcome",role:"assistant",parts:[{type:"text",text:"Hey! How can i help you?"}]}];function V7e(){const e=localStorage.getItem("chat-history");if(e)try{const t=KP(JSON.parse(e));return t.length>0?t:kf}catch{return kf}return kf}function U7e(){const e=localStorage.getItem("chat-session-id");if(e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return e;const n=b_();return localStorage.setItem("chat-session-id",n),n}function B7e(){const[e,t]=b.useState(!0),[n,r]=b.useState(""),[i,s]=b.useState(kf),{isChatWidgetOpen:o,setChatWidgetOpen:a}=Bve();b.useEffect(()=>{r(U7e()),s(V7e()),localStorage.getItem("has-interacted")||t(!1)},[]);function l(){const f=b_();r(f),localStorage.setItem("chat-session-id",f),s(kf),localStorage.setItem("chat-history",JSON.stringify(kf))}function u(f){s(f),localStorage.setItem("chat-history",JSON.stringify(f))}return g.jsxs(g.Fragment,{children:[o&&n&&g.jsx($7e,{id:n,initialMessages:i,onMessagesChange:u,handleClearConversation:l,handleCollapseButtonClick:()=>a(!1)}),g.jsx(z7e,{isOpen:o,setIsOpen:a,hasInteracted:e,setHasInteracted:t})]})}function H7e(){const e=ah();return g.jsxs(qve,{children:[e?g.jsx(q7e,{}):g.jsx(w2,{sidebar:g.jsx(e4e,{}),storageKey:"links-panel-layout",className:"max-h-full",maxMainSize:90,children:g.jsx(E7e,{})}),g.jsx(M7e,{}),g.jsx(B7e,{})]})}function q7e(){return g.jsx("div",{className:"flex size-full flex-col overflow-hidden",children:g.jsx(Ko,{})})}function W7e(){const e=az(),t=e instanceof TypeError&&e.message.includes("dynamically imported module");return g.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 p-8 text-center",children:[g.jsx("h1",{className:"text-xl font-semibold",children:t?"A new version is available":"Something went wrong"}),g.jsx("p",{className:"max-w-md text-muted-foreground",children:t?"The app has been updated. Please reload to get the latest version.":"An unexpected error occurred. Try reloading the page."}),g.jsx("button",{onClick:()=>window.location.reload(),className:"rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:"Reload page"})]})}const G7e=()=>g.jsx("div",{className:"flex min-h-[50vh] items-center justify-center",children:g.jsx("div",{className:"size-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})});function xt(e){return b.lazy(()=>e().catch(t=>{const n="chunk_reload_"+window.location.pathname;if(!sessionStorage.getItem(n))return sessionStorage.setItem(n,"1"),window.location.reload(),new Promise(()=>{});throw sessionStorage.removeItem(n),t}))}const K7e=xt(()=>_t(()=>import("./DashboardPage-Cx5ERdUg.js"),__vite__mapDeps([0,1,2,3,4,5]))),Z7e=xt(()=>_t(()=>import("./HomePage-7fQEG0vE.js"),__vite__mapDeps([6,1,2,3,7,8]))),Y7e=xt(()=>_t(()=>import("./TaskDoorPage-Bi5raLCH.js"),__vite__mapDeps([9,10,11,12]))),P5=xt(()=>_t(()=>import("./ChatPage-WPqoL2OA.js"),__vite__mapDeps([13,14,15,16,2,17,18,19,20,21,22,23,24,25,26,27,11,12]))),R5=xt(()=>_t(()=>import("./ChatDetailPage-UCl8GWV2.js"),__vite__mapDeps([28,14,15,16,2,17,18,19,20,21,22,23,24,25,26,27,11,12]))),I5=xt(()=>_t(()=>
219import("./NoteDetailPage-De806_bq.js"),__vite__mapDeps([29,30,8,5,11,7,31,32,2,15,33,34,35,25,12]))),Q7e=xt(()=>_t(()=>import("./LibraryPage-B4jR1WgB.js"),__vite__mapDeps([36,4,5]))),X7e=xt(()=>_t(()=>import("./LibraryShelfPage-s-AP7H1f.js"),__vite__mapDeps([37,5,30,8,15,38,3]))),O5=xt(()=>_t(()=>import("./SearchPage-CwN41ZkN.js"),__vite__mapDeps([39,8]))),J7e=xt(()=>_t(()=>import("./BoardPage-vD55XGSO.js"),__vite__mapDeps([40,41]))),D5=xt(()=>_t(()=>import("./BoardDetailPage-Cc6QNU-S.js"),__vite__mapDeps([42,11,41,12]))),eBe=xt(()=>_t(()=>import("./CollectionsPage-UYgosCtr.js"),__vite__mapDeps([43,44]))),tBe=xt(()=>_t(()=>import("./CollectionDetailPage-DxwYFv23.js"),__vite__mapDeps([45,44]))),nBe=xt(()=>_t(()=>import("./MobileCollectionsPage-FGCCmDlD.js"),[])),rBe=xt(()=>_t(()=>import("./MobileCollectionDetailPage-c5fxcnKj.js"),__vite__mapDeps([46,44]))),A5=xt(()=>_t(()=>import("./CaptureDetailPage-Pe48ZvgO.js"),__vite__mapDeps([47,11,7,38,3,12]))),iBe=xt(()=>_t(()=>import("./FeedPage-DPtgVL-N.js"),__vite__mapDeps([48,26,34,35,49,50,20]))),M5=xt(()=>_t(()=>import("./FilesPage-D6mCSuxI.js"),__vite__mapDeps([51,18,19,21,52]))),N5=xt(()=>_t(()=>import("./TasksPage-HtWl8eku.js"),__vite__mapDeps([53,26,18,19,54,10,22,23,24,55,56,49,57,58,50]))),sBe=xt(()=>_t(()=>import("./TaskGraphPage-D_cgNUSG.js"),__vite__mapDeps([59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,10,22,23,24,75,54,55,56,18,19,26,49,57,58]))),oBe=xt(()=>_t(()=>import("./AgentsLayout-H_tc8dVl.js"),__vite__mapDeps([76,77,78,19,56,55,10,79,80,81,82,83]))),BE=xt(()=>_t(()=>import("./fleet-overview-0-kj49Gi.js"),__vite__mapDeps([84,80,56,55,81,85,20,38,86,87,88,89]))),aBe=xt(()=>_t(()=>import("./activity-pane-Bsfjtj0l.js"),__vite__mapDeps([90,91,88,80,56,92,50,38,93,86,87,24,57,85,20,17]))),lBe=xt(()=>_t(()=>import("./agent-detail-pLwd1Kfe.js"),__vite__mapDeps([94,95,91,55,56,79,75,77,78,19,10,80,81,82,24,27,96,92,88,89,97]))),uBe=xt(()=>_t(()=>import("./runner-detail-DbGHVQeC.js"),__vite__mapDeps([98,80,56,55,81,82,79,96,92,88]))),cBe=xt(()=>_t(()=>import("./component-detail-ClzUdR1_.js"),__vite__mapDeps([99,75,78,19,56,83,100,93,96,82,81,80,55,92,88,97]))),dBe=xt(()=>_t(()=>import("./AdminUsagePage-Bhyx9PjU.js"),__vite__mapDeps([101,91,102,103,104,105,73,72,106,70,107,108,74,109]))),j5=xt(()=>_t(()=>import("./JournalPage-DSQl3Nto.js"),__vite__mapDeps([110,30,8,33,34,35,25,5,111]))),L5=xt(()=>_t(()=>import("./JournalDetailPage-BHFaCT9y.js"),__vite__mapDeps([112,30,8,33,34,35,25,5,11,7,111,31,32,2,15,12]))),fBe=xt(()=>_t(()=>import("./KnowledgeGraphPage-DgpnVKs6.js"),__vite__mapDeps([113,102,52]))),hBe=xt(()=>_t(()=>import("./ThreadsPage-LxelYRLJ.js"),__vite__mapDeps([114,115,58]))),pBe=xt(()=>_t(()=>import("./ThreadDetailPage-oBS1Qa5z.js"),__vite__mapDeps([116,115,12,58]))),HE=xt(()=>_t(()=>import("./SpacesPage-BczeGi3X.js"),__vite__mapDeps([117,54,10,22,23,24,55,56,18,19,26,49,57,58,91,78]))),F5=xt(()=>_t(()=>import("./ReadPage-Cs0utxGJ.js"),__vite__mapDeps([118,11,12,32,20]))),mBe=xt(()=>_t(()=>import("./RedirectPage-BgZRl0mo.js"),[])),gBe=xt(()=>_t(()=>import("./SettingsPage-CUk_ge1z.js"),__vite__mapDeps([119,109,52]))),vBe=xt(()=>_t(()=>import("./NotFoundPage-_jxydfjh.js"),__vite__mapDeps([120,12]))),yBe=xt(()=>_t(()=>import("./SignInPage-DOyqEDTf.js"),__vite__mapDeps([121,102,122]))),bBe=xt(()=>_t(()=>import("./SignUpPage-ME7L_Ybf.js"),__vite__mapDeps([123,102,122,124]))),_Be=xt(()=>_t(()=>import("./ForgotPasswordPage-PwRbw4EB.js"),__vite__mapDeps([125,102,122]))),wBe=xt(()=>_t(()=>import("./ResetPasswordPage-CWmQlcPQ.js"),__vite__mapDeps([126,102,122]))),xBe=xt(()=>_t(()=>import("./CheckEmailPage-BevGhzWK.js"),__vite__mapDeps([127,102]))),SBe=xt(()=>_t(()=>import("./VerifyEmailPage-CKOMdGdN.js"),__vite__mapDeps([128,102,122]))),EBe=xt(()=>_t(()=>import("./UnauthorizedPage-g-8Edeq3.js"),[])),CBe=xt(()=>_t(()=>import("./DeviceAuthorizePage-CN25TcJW.js"),__vite__mapDeps([129,102]))),kBe=xt(()=>_t(()=>import("./GoogleAuthPage-DcVKNZ_E.js"),__vite__mapDeps([130,122]))),TBe=xt(()=>_t(()=>import("./SubscriptionPage-CrllyJML.js"),__vite__mapDeps([131,102,91]))),PBe=xt(()=>_t(()=>import("./SuccessPage-CH5Ga6kK.js"),__vite__mapDeps([132,23]))),RBe=xt(()=>_t(()=>import("./CancelPage-CDDgUjJr.js"),__vite__mapDeps([133,86]))),Je=e=>g.jsx(b.Suspense,{fallback:g.jsx(G7e,{}),children:g.jsx(e,{})}),IBe=Mte([{element:g.jsx(Uve,{}),errorElement:g.jsx(W7e,{}),children:[{element:g.jsx(xje,{}),children:[{path:"/auth/signin",element:Je(yBe)},{path:"/auth/signup",element:Je(bBe)},{path:"/auth/forgot-password",element:Je(_Be)},{path:"/auth/reset-password",element:Je(wBe)},{path:"/auth/check-email",element:Je(xBe)},{path:"/auth/verify-email",element:Je(SBe)},{path:"/auth/unauthorized",element:Je(EBe)},{path:"/auth/device",element:Je(CBe)},{path:"/auth/google",element:Je(kBe)}]},{element:g.jsx(wje,{}),children:[{path:"/study",element:Je(Z7e)},{path:"/study/n/:id",element:Je(I5)},{path:"/study/t/:id",element:Je(Y7e)},{path:"/study/j",element:Je(j5)},{path:"/study/j/:id",element:Je(L5)},{path:"/study/d",element:Je(P5)},{path:"/study/d/:id",element:Je(R5)},{path:"/study/w/:id",element:Je(D5)},{path:"/study/r/:id",element:Je(F5)},{path:"/study/cap/:id",element:Je(A5)},{path:"/study/search",element:Je(O5)}]},{element:g.jsx(mje,{}),children:[{path:"/",element:Je(K7e)},{path:"/classic",element:g.jsx(wp,{to:"/",replace:!0})},{path:"/search",element:Je(O5)},{path:"/chat",element:g.jsx(TLe,{}),children:[{path:"new",element:Je(P5)},{path:":id",element:Je(R5)}]},{path:"/library",element:Je(Q7e)},{path:"/library/:shelf",element:Je(X7e)},{path:"/notes",element:g.jsx(wp,{to:"/library/notes",replace:!0})},{path:"/notes/:id",element:Je(I5)},{path:"/board",element:g.jsx(NLe,{}),children:[{index:!0,element:Je(J7e)},{path:":id",element:Je(D5)}]},{path:"/c",element:g.jsx(H7e,{}),children:[{index:!0,element:Je(eBe)},{path:":id",element:Je(tBe)}]},{path:"/collections",element:Je(nBe)},{path:"/collections/:id",element:Je(rBe)},{path:"/capture",element:g.jsx(wp,{to:"/",replace:!0})},{path:"/capture/:id",element:Je(A5)},{path:"/feed",element:Je(iBe)},{path:"/files",element:Je(M5)},{path:"/files/:id",element:Je(M5)}
219,{path:"/tasks",element:Je(N5)},{path:"/tasks/graph",element:Je(sBe)},{path:"/tasks/:id",element:Je(N5)},{path:"/agents",element:Je(oBe),children:[{index:!0,element:Je(BE)},{path:"activity",element:Je(aBe)},{path:"runners",element:Je(BE)},{path:"runners/:runnerId",element:Je(uBe)},{path:"components",element:Je(BE)},{path:"components/:componentId",element:Je(cBe)},{path:":agentId",element:Je(lBe)}]},{path:"/agents/configuration",element:g.jsx(wp,{to:"/agents",replace:!0})},{path:"/admin/usage",element:Je(dBe)},{path:"/journal",element:Je(j5)},{path:"/journal/:id",element:Je(L5)},{path:"/threads",element:Je(hBe)},{path:"/threads/:id",element:Je(pBe)},{path:"/spaces",element:Je(HE)},{path:"/spaces/:id",element:Je(HE)},{path:"/spaces/:id/t/:taskId",element:Je(HE)},{path:"/knowledge-graph",element:Je(fBe)},{path:"/read/:id",element:Je(F5)},{path:"/auth/redirect",element:Je(mBe)},{path:"/settings/:section?",element:Je(gBe)}]},{element:g.jsx(Tje,{}),children:[{path:"/subscription",element:Je(TBe)},{path:"/subscription/success",element:Je(PBe)},{path:"/subscription/cancel",element:Je(RBe)}]},{path:"*",element:Je(vBe)}]}]);IJ.createRoot(document.getElementById("root")).render(g.jsx(ve.StrictMode,{children:g.jsx(one,{children:g.jsx(Mle,{children:g.jsx(Ove,{children:g.jsxs(une,{attribute:"class",defaultTheme:"system",enableSystem:!0,disableTransitionOnChange:!0,children:[g.jsx(Gte,{router:IBe}),g.jsx(Soe,{}),g.jsx(Eoe,{})]})})})})}));export{Qr as $,Wk as A,GIe as B,G0e as C,vb as D,Ne as E,pre as F,et as G,eHe as H,Er as I,fo as J,QE as K,zMe as L,Dqe as M,wp as N,EHe as O,oqe as P,fn as Q,BMe as R,Cc as S,Oz as T,Pqe as U,m$ as V,RI as W,II as X,Xf as Y,Y_ as Z,_t as _,Qn as a,NBe as a$,qz as a0,JI as a1,sw as a2,ow as a3,lw as a4,uw as a5,aw as a6,dw as a7,cw as a8,KI as a9,bre as aA,Ha as aB,eh as aC,pn as aD,qne as aE,UBe as aF,jBe as aG,qBe as aH,WBe as aI,MBe as aJ,HBe as aK,kt as aL,zBe as aM,r8 as aN,u8 as aO,l8 as aP,H1 as aQ,f_ as aR,J9 as aS,X9 as aT,ZBe as aU,FBe as aV,LBe as aW,$Be as aX,VBe as aY,W9 as aZ,BBe as a_,iw as aa,ZI as ab,QI as ac,sm as ad,Dg as ae,xZ as af,YI as ag,Tz as ah,J4 as ai,Jb as aj,nMe as ak,AHe as al,Dr as am,os as an,jHe as ao,qK as ap,LHe as aq,FHe as ar,MHe as as,NHe as at,$He as au,WDe as av,ve as aw,ng as ax,qP as ay,df as az,Jm as b,ZAe as b$,pFe as b0,yFe as b1,qFe as b2,CHe as b3,KFe as b4,q$ as b5,mT as b6,gT as b7,vT as b8,hY as b9,KK as bA,FMe as bB,eT as bC,cqe as bD,LMe as bE,Rqe as bF,VHe as bG,BHe as bH,UHe as bI,gie as bJ,e_ as bK,Ez as bL,yZ as bM,v2 as bN,bZ as bO,y2 as bP,Ob as bQ,GNe as bR,$s as bS,Vt as bT,At as bU,qU as bV,Ue as bW,_c as bX,Uue as bY,RHe as bZ,RMe as b_,H$ as ba,Aqe as bb,xoe as bc,SHe as bd,THe as be,t_ as bf,xz as bg,HK as bh,GHe as bi,qHe as bj,uMe as bk,HHe as bl,lqe as bm,KIe as bn,eg as bo,oMe as bp,Cz as bq,qc as br,ZT as bs,uqe as bt,ZMe as bu,GK as bv,Tf as bw,Jo as bx,jMe as by,Xu as bz,_e as c,WLe as c$,MZ as c0,tMe as c1,Uz as c2,DHe as c3,zHe as c4,eie as c5,fie as c6,iMe as c7,rMe as c8,sMe as c9,uR as cA,Vl as cB,hq as cC,rg as cD,iu as cE,Ms as cF,qt as cG,Rq as cH,rTe as cI,iTe as cJ,yt as cK,ea as cL,pr as cM,Wl as cN,ere as cO,TP as cP,zle as cQ,GBe as cR,KBe as cS,jo as cT,x2e as cU,S2e as cV,k2e as cW,T2e as cX,E2e as cY,P2e as cZ,eqe as c_,aMe as ca,YT as cb,Lz as cc,Gz as cd,TMe as ce,iqe as cf,rqe as cg,CMe as ch,QHe as ci,XHe as cj,PMe as ck,nqe as cl,Ib as cm,tqe as cn,JHe as co,rh as cp,cR as cq,as as cr,fR as cs,_g as ct,ew as cu,Zo as cv,Sg as cw,MI as cx,x_ as cy,dR as cz,JAe as d,gqe as d$,KLe as d0,WFe as d1,Pz as d2,kz as d3,T7e as d4,uI as d5,GH as d6,wb as d7,KH as d8,Iz as d9,c2 as dA,yMe as dB,vMe as dC,gMe as dD,WHe as dE,hqe as dF,dqe as dG,fqe as dH,Rb as dI,zr as dJ,m3e as dK,Kz as dL,pie as dM,dc as dN,xn as dO,ILe as dP,GP as dQ,Dz as dR,UG as dS,HZ as dT,Wz as dU,are as dV,UZ as dW,Bee as dX,VZ as dY,Ko as dZ,sNe as d_,Rz as da,Bre as db,Hz as dc,nre as dd,Pne as de,m2e as df,vq as dg,wz as dh,ZFe as di,Mqe as dj,lje as dk,wre as dl,XP as dm,xHe as dn,S7e as d
219p,qve as dq,B7e as dr,vo as ds,aqe as dt,VK as du,$Ie as dv,zIe as dw,AG as dx,Up as dy,O8 as dz,bf as e,Zne as e$,pqe as e0,mqe as e1,Tqe as e2,kqe as e3,oNe as e4,vqe as e5,_qe as e6,yqe as e7,bqe as e8,KNe as e9,qf as eA,CK as eB,Bc as eC,ZOe as eD,Tb as eE,o2 as eF,qOe as eG,WAe as eH,PK as eI,GAe as eJ,TK as eK,JOe as eL,Hf as eM,IK as eN,OK as eO,HOe as eP,Oie as eQ,tg as eR,g3e as eS,Wte as eT,hge as eU,Bz as eV,sHe as eW,lve as eX,nf as eY,$ge as eZ,$o as e_,Cqe as ea,Eqe as eb,Az as ec,Ef as ed,wqe as ee,YNe as ef,w2 as eg,FW as eh,Ba as ei,St as ej,Fz as ek,SMe as el,KHe as em,xMe as en,vw as eo,h$ as ep,DZ as eq,ZHe as er,YHe as es,EMe as et,zz as eu,OZ as ev,zn as ew,s2 as ex,Hc as ey,Qo as ez,Jl as f,XBe as f0,wK as f1,xK as f2,SK as f3,EK as f4,Bp as f5,kb as f6,SOe as f7,Xre as f8,dLe as f9,d5e as fA,Nqe as fB,kT as fC,p5e as fD,M2 as fE,z2 as fF,K2 as fG,X2 as fH,bq as fI,Bke as fJ,Hke as fK,Wke as fL,_I as fM,Pf as fN,pq as fO,mI as fP,n_ as fQ,qke as fR,r_ as fS,Ua as fT,OLe as fU,DLe as fV,hMe as fW,ABe as fX,$5 as fY,LZ as fa,oHe as fb,lHe as fc,aHe as fd,xve as fe,tHe as ff,nHe as fg,nge as fh,rHe as fi,iHe as fj,K9 as fk,Iqe as fl,Jye as fm,Xye as fn,Qye as fo,SL as fp,e0e as fq,uHe as fr,t0e as fs,cHe as ft,r0e as fu,jz as fv,DBe as fw,W2 as fx,jqe as fy,Wb as fz,hr as g,nb as h,sqe as i,g as j,wi as k,AMe as l,YAe as m,DMe as n,OMe as o,Xo as p,IHe as q,b as r,pw as s,KP as t,BT as u,UMe as v,qMe as w,ah as x,Oqe as y,OHe as z};
220//# sourceMappingURL=index-B5baMg1b.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.