@lakphy/local-router 0.5.5 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.schema.json +2 -2
- package/dist/cli.js +1239 -693
- package/dist/entry.js +1081 -639
- package/dist/web/assets/index-D1WTE7QU.js +192 -0
- package/dist/web/assets/index-DrH6dT5r.css +2 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-BxjdLPIh.js +0 -190
- package/dist/web/assets/index-Dc2P7nS-.css +0 -2
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n&&t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(u||{});function d({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}var f=0,p=0,m=0,h=[],{link:g,unlink:_,propagate:v,checkDirty:y,shallowPropagate:b}=d({update(e){return e.depsTail===void 0?T(e):w(e)},notify(e){let t=m,n=t;do if(h[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(m=t;n<--t;){let e=h[n];h[n++]=h[t],h[t]=e}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,O(e)):D.call(e)}});function x(){return f}function S(){++f}function C(){--f||ee()}function w(e){e.depsTail=void 0,e.flags=5;try{let t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,O(e)}}function T(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function E(e){let t=e.flags;if(t&16||t&32&&y(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,O(e)}}else e.flags=2}function ee(){try{for(;p<m;){let e=h[p];h[p++]=void 0,E(e)}}finally{for(;p<m;){let e=h[p];h[p++]=void 0,e.flags|=10}p=0,m=0}}function D(){this.depsTail=void 0,this.flags=0,O(this);let e=this.subs;e!==void 0&&_(e)}function O(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=_(n,e)}function k(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var te=[],A=0,{link:j,unlink:M,propagate:ne,checkDirty:N,shallowPropagate:re}=d({update(e){return e._update()},notify(e){te[ae++]=e,e.flags&=~u.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=u.Mutable|u.Dirty,F(e))}}),ie=0,ae=0,P;function F(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=M(n,e)}function oe(){if(!(x()>0)){for(;ie<ae;){let e=te[ie];te[ie++]=void 0,e.notify()}ie=0,ae=0}}function se(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?u.None:u.Mutable,get(){return P!==void 0&&j(i,P,A),i._snapshot},subscribe(e){let t=k(e),n={current:!1},r=ce(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=P,o=t?.compare??Object.is;P=i,++A,i.depsTail=void 0,n&&(i.flags=u.Mutable|u.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{P=a,n&&(i.flags&=~u.RecursedCheck),F(i)}}};return n?(i.flags=u.Mutable|u.Dirty,i.get=function(){let e=i.flags;if(e&u.Dirty||e&u.Pending&&N(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&re(e)}}else e&u.Pending&&(i.flags=e&~u.Pending);return P!==void 0&&j(i,P,A),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ne(e),re(e),oe())}},i}function ce(e){let t=()=>{let t=P;P=n,++A,n.depsTail=void 0,n.flags=u.Watching|u.RecursedCheck;try{return e()}finally{P=t,n.flags&=~u.RecursedCheck,F(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:u.Watching|u.RecursedCheck,notify(){let e=this.flags;e&u.Dirty||e&u.Pending&&N(this.deps,this)?t():this.flags=u.Watching},stop(){this.flags=u.None,this.depsTail=void 0,F(this)}};return t(),n}var le=class{constructor(e){this.atom=se(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(k(e))}},ue=class{constructor(e){this.atom=se(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(k(e))}};function de(e){return typeof e==`function`?new ue(e):new le(e)}function fe(e){try{S(),e()}finally{C(),oe()}}var pe=`__TSR_index`,me=`popstate`,he=`beforeunload`;function ge(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=be(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[pe];i=_e(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[pe];i=_e(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[pe]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function _e(e,t){t||={};let n=xe();return{...t,key:n,__TSR_key:n,[pe]:e}}function ve(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>be(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=xe();t.history.replaceState({[pe]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=be(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[pe]-l.state[pe],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=ge({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(he,S,{capture:!0}),t.removeEventListener(me,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(he,S,{capture:!0}),t.addEventListener(me,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function ye(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function be(e,t){let n=ye(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=xe();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[pe]:0,key:a,__TSR_key:a}}}function xe(){return(Math.random()+1).toString(36).substring(7)}function Se(e){let t;return fe(()=>{t=e()}),t}function Ce(e){return e[e.length-1]}function we(e){return typeof e==`function`}function Te(e,t){return we(e)?e(t):e}var Ee=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable;function Oe(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=t,i=Me(e)&&Me(r);if(!i&&!(Ae(e)&&Ae(r)))return r;let a=i?e:ke(e);if(!a)return r;let o=i?r:ke(r);if(!o)return r;let s=a.length,c=o.length,l=i?Array(c):{},u=0;for(let t=0;t<c;t++){let a=i?t:o[t],c=e[a],d=r[a];if(c===d){l[a]=c,(i?t<s:Ee.call(e,a))&&u++;continue}if(c===null||d===null||typeof c!=`object`||typeof d!=`object`){l[a]=d;continue}let f=Oe(c,d,n+1);l[a]=f,f===c&&u++}return s===c&&u===s?e:l}function ke(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!De.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!De.call(e,t))return!1;r.push(t)}return r}function Ae(e){if(!je(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!je(n)||!n.hasOwnProperty(`isPrototypeOf`))}function je(e){return Object.prototype.toString.call(e)===`[object Object]`}function Me(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ne(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Ne(e[r],t[r],n))return!1;return!0}if(Ae(e)&&Ae(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Ne(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Ne(e[o],t[o],n)))return!1;return i===a}return!1}function Pe(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function Fe(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Ie(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Le(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Ie(t)}var Re=[`http:`,`https:`,`mailto:`,`tel:`];function ze(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}var Be={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Ve=/[&><\u2028\u2029]/g;function He(e){return e.replace(Ve,e=>Be[e])}function Ue(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Le(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Le(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function We(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var Ge=!0,Ke=`Invariant failed`;function qe(e,t){if(!e){if(Ge)throw Error(Ke);var n=typeof t==`function`?t():t,r=n?`${Ke}: ${n}`:Ke;throw Error(r)}}function Je(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Ye=4,Xe=5;function Ze(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Qe(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Ze(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function $e(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Qe(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=nt(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=nt(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=rt(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=rt(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=rt(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=nt(n.fullPath??n.from);e.kind=Xe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=nt(n.fullPath??n.from);e.kind=Ye,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)$e(e,t,r,s,i,a,o)}function et(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function tt(e){if(e.pathless)for(let t of e.pathless)tt(t);if(e.static)for(let t of e.static.values())tt(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())tt(t);if(e.dynamic?.length){e.dynamic.sort(et);for(let t of e.dynamic)tt(t)}if(e.optional?.length){e.optional.sort(et);for(let t of e.optional)tt(t)}if(e.wildcard?.length){e.wildcard.sort(et);for(let t of e.wildcard)tt(t)}}function nt(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function rt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function it(e,t){let n=nt(`/`),r=new Uint16Array(6);for(let t of e)$e(!1,r,t,1,n,0);tt(n),t.masksTree=n,t.flatCache=Je(1e3)}function at(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=ut(e,t.masksTree);return t.flatCache.set(e,r),r}function ot(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=nt(`/`),$e(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),ut(r,o,n)}function st(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=ut(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=ft(a.route)),t.matchCache.set(r,a),a}function ct(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function lt(e,t=!1,n){let r=nt(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return $e(t,i,e,1,r,0,e=>{if(n?.(e,s),qe(!(e.id in a),`Duplicate routes found with id: ${String(e.id)}`),a[e.id]=e,s!==0&&e.path){let t=ct(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),tt(r),{processedTree:{segmentTree:r,singleCache:Je(1e3),matchCache:Je(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function ut(e,t,n=!1){let r=e.split(`/`),i=mt(e,r,t,n);if(!i)return null;let[a]=dt(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function dt(e,t,n){let r=pt(n.node),i=null,a={},o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Ye)break;if(u.kind===Xe){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function ft(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function pt(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function mt(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!Ce(t),a=i&&e!==`/`,o=t.length-(i?1:0),s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!ht(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==Ye&>(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&>(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(ht(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;gt(u,n)&&(u=n)}}if(i.wildcard&>(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!ht(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return gt(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??={},l.rawParams[`**`]=decodeURIComponent(r),l}return null}function ht(e,t,n){try{let[r,i]=dt(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function gt(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ye)>(e.node.kind===Ye)||t.node.kind===Ye==(e.node.kind===Ye)&&t.depth>e.depth))):!0}function _t(e){return vt(e.filter(e=>e!==void 0).join(`/`))}function vt(e){return e.replace(/\/{2,}/g,`/`)}function yt(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function bt(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function xt(e){return bt(yt(e))}function St(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ct(e,t,n){return St(e,n)===St(t,n)}function wt({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&Ce(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(Ce(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Qe(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=vt(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function Tt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Et(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ot(e,n)).join(`/`):Ot(r,n):r}function Dt({path:e,params:t,decoder:n,...r}){let i=!1,a={};if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Qe(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=Et(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Et(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=Et(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function Ot(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function kt(e){return!!e?.isNotFound}function At(){try{if(typeof window<`u`&&typeof window.sessionStorage==`object`)return window.sessionStorage}catch{}}var jt=`tsr-scroll-restoration-v1_3`,Mt=(e,t)=>{let n;return(...r)=>{n||=setTimeout(()=>{e(...r),n=null},t)}};function Nt(){let e=At();if(!e)return null;let t=e.getItem(jt),n=t?JSON.parse(t):{};return{state:n,set:t=>{n=Te(t,n)||n;try{e.setItem(jt,JSON.stringify(n))}catch{console.warn(`[ts-router] Could not persist scroll restoration state to sessionStorage.`)}}}}var Pt=Nt(),Ft=e=>e.state.__TSR_key||e.href;function It(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var Lt=!1;function Rt({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:i,location:a}){let o;try{o=JSON.parse(sessionStorage.getItem(e)||`{}`)}catch(e){console.error(e);return}let s=t||window.history.state?.__TSR_key,c=o[s];Lt=!0;scroll:{if(r&&c&&Object.keys(c).length>0){for(let e in c){let t=c[e];if(e===`window`)window.scrollTo({top:t.scrollY,left:t.scrollX,behavior:n});else if(e){let n=document.querySelector(e);n&&(n.scrollLeft=t.scrollX,n.scrollTop=t.scrollY)}}break scroll}let e=(a??window.location).hash.split(`#`,2)[1];if(e){let t=window.history.state?.__hashScrollIntoViewOptions??!0;if(t){let n=document.getElementById(e);n&&n.scrollIntoView(t)}break scroll}let t={top:0,left:0,behavior:n};if(window.scrollTo(t),i)for(let e of i){if(e===`window`)continue;let n=typeof e==`function`?e():document.querySelector(e);n&&n.scrollTo(t)}}Lt=!1}function zt(e,t){if(!Pt||((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Pt))return;e.isScrollRestorationSetup=!0,Lt=!1;let n=e.options.getScrollRestorationKey||Ft;window.history.scrollRestoration=`manual`,typeof document<`u`&&document.addEventListener(`scroll`,Mt(t=>{if(Lt||!e.isScrollRestoring)return;let r=``;if(t.target===document||t.target===window)r=`window`;else{let e=t.target.getAttribute(`data-scroll-restoration-id`);r=e?`[data-scroll-restoration-id="${e}"]`:It(t.target)}let i=n(e.state.location);Pt.set(e=>{let t=e[i]||={},n=t[r]||={};if(r===`window`)n.scrollX=window.scrollX||0,n.scrollY=window.scrollY||0;else if(r){let e=document.querySelector(r);e&&(n.scrollX=e.scrollLeft||0,n.scrollY=e.scrollTop||0)}return e})},100),!0),e.subscribe(`onRendered`,t=>{let r=n(t.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation})||(Rt({storageKey:jt,key:r,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Pt.set(e=>(e[r]||={},e)))})}function Bt(e){if(typeof document<`u`&&document.querySelector){let t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==``){let n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function Vt(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Ht(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ut(e){let t=new URLSearchParams(e),n={};for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Ht(r):Array.isArray(t)?t.push(Ht(r)):n[e]=[t,Ht(r)]}return n}var Wt=Kt(JSON.parse),Gt=qt(JSON.stringify,JSON.parse);function Kt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ut(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function qt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Vt(e,r);return t?`?${t}`:``}}var Jt=`__root__`;function Yt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Xt(e){return e instanceof Response&&!!e.options}var Zt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Qt=(e,t)=>!!(e.preload&&!e.router.state.matches.some(e=>e.id===t)),$t=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},en=(e,t,n)=>{let r=e.router.routesById[t.routeId??``]??e.router.routeTree;!r.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(r.options.notFoundComponent=e.router.options.defaultNotFoundComponent);let i=n===`BEFORE_LOAD`&&r.parentRoute;i||qe(r.options.notFoundComponent,`No notFoundComponent found. Please set a notFoundComponent on your route or provide a defaultNotFoundComponent to the router.`);let a=e.matches.find(e=>e.routeId===r.id);qe(a,`Could not find match for route: `+r.id),e.updateMatch(a.id,e=>({...e,status:`notFound`,error:t,isFetching:!1})),i&&(t.routeId=r.parentRoute.id,en(e,t,n))},tn=(e,t,n,r)=>{if(!(!Xt(n)&&!kt(n))){if(Xt(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;let r=Xt(n)?`redirected`:`notFound`;t._nonReactive.error=n,e.updateMatch(t.id,i=>({...i,status:r,context:$t(e,t.index),isFetching:!1,error:n})),kt(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Xt(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(en(e,n,r),n)}},nn=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,rn=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,tn(e,e.router.getMatch(i),n,r);try{o.options.onError?.(n)}catch(t){n=t,tn(e,e.router.getMatch(i),n,r)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},an=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Qt(e,t)&&(n.options.loader||n.options.beforeLoad||hn(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Zt(e)},i);r._nonReactive.pendingTimeout=t}},on=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;an(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&tn(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},sn=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Pe(()=>{a?.resolve()});let{paramsError:o,searchError:s}=i;o&&rn(e,n,o,`PARSE_PARAMS`),s&&rn(e,n,s,`VALIDATE_SEARCH`),an(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){Se(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Pe();let f={...$t(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Qt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){Se(()=>{u(),d()});return}(Xt(r)||kt(r))&&(u(),rn(e,n,r,`BEFORE_LOAD`)),Se(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),Fe(y))return u(),y.catch(t=>{rn(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),rn(e,n,t,`BEFORE_LOAD`)}v(y)},cn=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>sn(e,n,t,i),s=()=>{if(nn(e,n))return;let t=on(e,n,i);return Fe(t)?t.then(o):o()};return a()},ln=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},un=(e,t,n,r)=>{let i=e.matchPromises[n-1],{params:a,loaderDeps:o,abortController:s,cause:c}=e.router.getMatch(t),l=$t(e,n),u=Qt(e,t);return{params:a,deps:o,preload:!!u,parentMatchPromise:i,abortController:s,context:l,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:u?`preload`:c,route:r,...e.router.options.additionalContext}},dn=async(e,t,n,r)=>{try{let i=e.router.getMatch(t);try{mn(r);let a=r.options.loader?.(un(e,t,n,r)),o=r.options.loader&&Fe(a);if((o||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,e=>({...e,isFetching:`loader`})),r.options.loader){let n=o?await a:a;tn(e,e.router.getMatch(t),n),n!==void 0&&e.updateMatch(t,e=>({...e,loaderData:n}))}r._lazyPromise&&await r._lazyPromise;let s=i._nonReactive.minPendingPromise;s&&await s,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,t=>({...t,error:void 0,context:$t(e,n),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(a){let o=a;if(o?.name===`AbortError`){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:$t(e,n)}));return}let s=i._nonReactive.minPendingPromise;s&&await s,kt(a)&&await r.options.notFoundComponent?.preload?.(),tn(e,e.router.getMatch(t),a);try{r.options.onError?.(a)}catch(n){o=n,tn(e,e.router.getMatch(t),n)}e.updateMatch(t,t=>({...t,error:o,context:$t(e,n),status:`error`,isFetching:!1}))}}catch(n){let r=e.router.getMatch(t);r&&(r._nonReactive.loaderPromise=void 0),tn(e,r,n)}},fn=async(e,t)=>{async function n(n,i,s,c){let l=Date.now()-i.updatedAt,u=n?c.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.router.options.defaultStaleTime??0,d=c.options.shouldReload,f=typeof d==`function`?d(un(e,r,t,c)):d,{status:p,invalid:m}=s;a=p===`success`&&(m||(f??l>u)),n&&c.options.preload===!1||(a&&!e.sync?(o=!0,(async()=>{try{await dn(e,r,t,c);let n=e.router.getMatch(r);n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loadPromise?.resolve(),n._nonReactive.loaderPromise=void 0}catch(t){Xt(t)&&await e.router.navigate(t.options)}})()):(p!==`success`||a&&e.sync)&&await dn(e,r,t,c))}let{id:r,routeId:i}=e.matches[t],a=!1,o=!1,s=e.router.looseRoutesById[i];if(!nn(e,r)){let t=e.router.getMatch(r),i=Qt(e,r);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload)return t;await t._nonReactive.loaderPromise;let a=e.router.getMatch(r),o=a._nonReactive.error||a.error;o&&tn(e,a,o),a.status===`pending`&&await n(i,t,a,s)}else{let a=i&&!e.router.state.matches.some(e=>e.id===r),o=e.router.getMatch(r);o._nonReactive.loaderPromise=Pe(),a!==o.preload&&e.updateMatch(r,e=>({...e,preload:a})),await n(i,t,o,s)}}let c=e.router.getMatch(r);o||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,o||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;let l=o?c.isFetching:!1;return l!==c.isFetching||c.invalid!==!1?(e.updateMatch(r,e=>({...e,isFetching:l,invalid:!1})),e.router.getMatch(r)):c};async function pn(e){let t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(e=>e._forcePending)&&Zt(t);try{for(let e=0;e<t.matches.length;e++){let n=cn(t,e);Fe(n)&&await n}let e=t.firstBadMatchIndex??t.matches.length;for(let n=0;n<e;n++)t.matchPromises.push(fn(t,n));let n=(await Promise.allSettled(t.matchPromises)).filter(e=>e.status===`rejected`).map(e=>e.reason),r;for(let e of n){if(Xt(e))throw e;!r&&kt(e)&&(r=e)}for(let e of t.matches){let{id:n,routeId:r}=e,i=t.router.looseRoutesById[r];try{let e=ln(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}if(r)throw r;let i=Zt(t);Fe(i)&&await i}catch(e){if(kt(e)&&!t.preload){let n=Zt(t);throw Fe(n)&&await n,e}if(Xt(e))throw e}return t.matches}async function mn(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){let t=()=>{let t=[];for(let n of gn){let r=e.options[n]?.preload;r&&t.push(r())}if(t.length)return Promise.all(t).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function hn(e){for(let t of gn)if(e.options[t]?.preload)return!0;return!1}var gn=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`];function _n(e){return{input:({url:t})=>{for(let n of e)t=yn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=bn(e[n],t);return t}}}function vn(e){let t=xt(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=_t([`/`,t,e.pathname]),e)}}function yn(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function bn(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xn(e){let t=e.resolvedLocation,n=e.location;return{fromLocation:t,toLocation:n,pathChanged:t?.pathname!==n.pathname,hrefChanged:t?.href!==n.href,hashChanged:t?.hash!==n.hash}}function Sn(e){let t=e.filter(e=>e.status!==`redirected`);return t.length===e.length?e:t}var Cn=class{constructor(e){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Tt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=ve()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Je(1e3),e=this.buildRouteTree(),this.setRoutes(e)}!this.__store&&this.latestLocation&&(this.__store=de(En(this.latestLocation)),zt(this));let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=xt(o);t&&t!==`/`&&e.push(vn({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:_n(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&this.__store.setState(e=>({...e,location:this.latestLocation})),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=lt(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&it(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let o=this.options.parseSearch(n),s=this.options.stringifySearch(o);return{href:e+s+r,publicHref:i,pathname:Ue(e).path,external:!1,searchStr:s,search:Oe(t?.search,o),hash:Ue(r.slice(1)).path,state:Oe(t?.state,a)}}let o=new URL(i,this.origin),s=yn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:Ue(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:Oe(t?.search,c),hash:Ue(s.hash.slice(1)).path,state:Oe(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>wt({base:e,to:vt(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>On({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{let e=this.state.matches.filter(e=>e.status===`pending`),t=this.state.matches.filter(e=>e.isFetching===`loader`);new Set([...this.state.pendingMatches??[],...e,...t]).forEach(e=>{this.cancelMatch(e.id)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s={...r.params},c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?{}:(t.params??!0)===!0?s:Object.assign(s,Te(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:Ue(Dt({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Dn(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=kn({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=Oe(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?Te(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?Te(t.state,n.state):{};_=Oe(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=bn(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=We(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n={};if(this.options.routeMasks){let o=at(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?{}:(s??!0)===!0?n:Object.assign(n,Te(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Ne(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=bt(this.latestLocation.href)===bt(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Pe(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=be(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=yn(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ze(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation);this.__store.setState(t=>({...t,status:`pending`,statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:t.cachedMatches.filter(t=>!e.some(e=>e.id===t.id))}))},this.load=async e=>{let t,n,r;for(r=new Promise(i=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.state.resolvedLocation;this.state.redirect||this.emit({type:`onBeforeNavigate`,...xn({resolvedLocation:n,location:t})}),this.emit({type:`onBeforeLoad`,...xn({resolvedLocation:n,location:t})}),await pn({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=[],t=[],n=[],r=[];Se(()=>{this.__store.setState(i=>{let a=i.matches,o=i.pendingMatches||i.matches;return e=a.filter(e=>!o.some(t=>t.id===e.id)),t=a.filter(e=>!o.some(t=>t.routeId===e.routeId)),n=o.filter(e=>!a.some(t=>t.routeId===e.routeId)),r=o.filter(e=>a.some(t=>t.routeId===e.routeId)),{...i,isLoading:!1,loadedAt:Date.now(),matches:o,pendingMatches:void 0,cachedMatches:[...i.cachedMatches,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]}}),this.clearExpiredCache()}),[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]].forEach(([e,t])=>{e.forEach(e=>{this.looseRoutesById[e.routeId].options[t]?.(e)})})})})}})}catch(e){Xt(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):kt(e)&&(n=e),this.__store.setState(e=>({...e,statusCode:t?t.status:n?404:e.matches.some(e=>e.status===`error`)?500:200,redirect:t}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),i()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(e=>e.status===`error`)&&(i=500),i!==void 0&&this.__store.setState(e=>({...e,statusCode:i}))},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.state.resolvedLocation,a=typeof t.types==`function`?t.types(xn({resolvedLocation:i,location:r})):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.state.pendingMatches?.some(t=>t.id===e)?`pendingMatches`:this.state.matches.some(t=>t.id===e)?`matches`:this.state.cachedMatches.some(t=>t.id===e)?`cachedMatches`:``;n&&(n===`cachedMatches`?this.__store.setState(n=>({...n,cachedMatches:Sn(n.cachedMatches.map(n=>n.id===e?t(n):n))})):this.__store.setState(r=>({...r,[n]:r[n]?.map(n=>n.id===e?t(n):n)})))})},this.getMatch=e=>{let t=t=>t.id===e;return this.state.cachedMatches.find(t)??this.state.pendingMatches?.find(t)??this.state.matches.find(t)},this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.__store.setState(e=>({...e,matches:e.matches.map(t),cachedMatches:e.cachedMatches.map(t),pendingMatches:e.pendingMatches?.map(t)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&ze(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.__store.setState(e=>({...e,cachedMatches:[]})):this.__store.setState(e=>({...e,cachedMatches:e.cachedMatches.filter(e=>!t(e))}))},this.clearExpiredCache=()=>{this.clearCache({filter:e=>{let t=this.looseRoutesById[e.routeId];if(!t.options.loader)return!0;let n=(e.preload?t.options.preloadGcTime??this.options.defaultPreloadGcTime:t.options.gcTime??this.options.defaultGcTime)??300*1e3;return e.status===`error`?!0:Date.now()-e.updatedAt>=n}})},this.loadRouteChunk=mn,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(e=>e.id)),i=new Set([...r,...this.state.cachedMatches.map(e=>e.id)]);Se(()=>{n.forEach(e=>{i.has(e.id)||this.__store.setState(t=>({...t,cachedMatches:[...t.cachedMatches,e]}))})});try{return n=await pn({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Xt(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});kt(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.state.status!==`pending`)return!1;let i=(t?.pending===void 0?!this.state.isLoading:t.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=ot(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Ne(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Ne(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status===`notFound`||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Gt,parseSearch:e.parseSearch??Wt,protocolAllowlist:e.protocolAllowlist??Re}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:bt(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?jn(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map(this.state.matches.map(e=>[e.routeId,e]));for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=Dn(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof wn||(r=new wn(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=Dt({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{Mn(r,_,a,x)}catch(e){if(S=kt(e)||Xt(e)?e:new Tn(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:Oe(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||hn(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?Oe(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:Pe()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?Oe(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?Oe(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=Ce(t),a={...e.search};for(let e of t)try{Object.assign(a,Dn(e.options.validateSearch,a))}catch{}let o=Ce(this.state.matches),s=o&&o.routeId===i.id&&e.pathname===this.state.location.pathname,c;if(s)c=o.params;else{let e={...n};for(let i of t)try{Mn(i,n,r??{},e)}catch{}c=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:c}}},wn=class extends Error{},Tn=class extends Error{};function En(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Dn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new wn(`Async validation not supported`);if(n.issues)throw new wn(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function On({pathname:e,routesById:t,processedTree:n}){let r={},i=bt(e),a,o,s=st(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign({},s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function kn({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return An(n)(e,t,r??!1)}function An(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...Dn(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:Te(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function jn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Jt}function Mn(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var Nn=`Error preloading route! ☝️`,Pn=class{constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Jt:this.parentRoute||qe(!1,`Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);let r=n?Jt:t?.path;r&&r!==`/`&&(r=yt(r));let i=t?.id||r,a=n?Jt:_t([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=_t([`/`,a]));let o=a===`__root__`?`/`:_t([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=bt(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Yt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}},Fn=class extends Pn{constructor(e){super(e)}},In=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),Ln=o(((e,t)=>{t.exports=In()})),Rn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function ee(e,t){return E(e.type,t,e.props)}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function te(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function A(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function j(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,j(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+te(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(k,`$&/`)+`/`),j(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=ee(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+te(a,u),c+=j(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+te(a,u++),c+=j(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return j(A(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function M(e,t,n){if(e==null)return e;var r=[],i=0;return j(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function ne(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var N=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},re={map:M,forEach:function(e,t,n){M(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return M(e,function(){t++}),t},toArray:function(e){return M(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=re,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:ne}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,N)}catch(e){N(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),zn=o(((e,t)=>{t.exports=Rn()})),I=l(zn(),1);I.use;var Bn=typeof window<`u`?I.useLayoutEffect:I.useEffect;function Vn(e){let t=I.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function Hn(e,t,n={},r={}){I.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function Un(e){let t=I.useRef(null);return I.useImperativeHandle(e,()=>t.current,[]),t}var L=l(Ln(),1);function Wn(e){let t=e.errorComponent??Kn;return(0,L.jsx)(Gn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?I.createElement(t,{error:n,reset:r}):e.children})}var Gn=class extends I.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function Kn({error:e}){let[t,n]=I.useState(!1);return(0,L.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,L.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,L.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,L.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,L.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,L.jsx)(`div`,{children:(0,L.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,L.jsx)(`code`,{children:e.message}):null})}):null]})}function qn({children:e,fallback:t=null}){return Jn()?(0,L.jsx)(I.Fragment,{children:e}):(0,L.jsx)(I.Fragment,{children:t})}function Jn(){return I.useSyncExternalStore(Yn,()=>!0,()=>!1)}function Yn(){return()=>{}}var Xn=!0;function Zn(e,t){if(!Xn){if(e)return;var n=`Warning: `+t;typeof console<`u`&&console.warn(n);try{throw Error(n)}catch{}}}var Qn=Zn,$n=o((e=>{var t=zn();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),er=o(((e,t)=>{t.exports=$n()})),tr=o((e=>{var t=zn(),n=er();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),nr=o(((e,t)=>{t.exports=tr()}))();function rr(e,t){return e===t}function ir(e,t,n=rr){let r=(0,I.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,I.useCallback)(()=>e?.get(),[e]);return(0,nr.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var ar=I.createContext(null);function or(e){let t=I.useContext(ar);return Qn(!((e?.warn??!0)&&!t),`useRouter must be used inside a <RouterProvider> component!`),t}function sr(e){let t=or({warn:e?.router===void 0}),n=e?.router||t,r=(0,I.useRef)(void 0);return ir(n.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=Oe(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var cr=I.createContext(void 0),lr=I.createContext(void 0);function ur(e){let t=I.useContext(e.from?lr:cr);return sr({select:n=>{let r=n.matches.find(n=>e.from?e.from===n.routeId:n.id===t);if(qe(!((e.shouldThrow??!0)&&!r),`Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`),r!==void 0)return e.select?e.select(r):r},structuralSharing:e.structuralSharing})}function dr(e){return ur({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function fr(e){let{select:t,...n}=e;return ur({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function pr(e){return ur({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function mr(e){return ur({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function hr(e){let t=or();return I.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function gr(e){let t=or(),n=hr(),r=I.useRef(null);return Bn(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}var _r=o((e=>{var t=zn();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),vr=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=_r()})),yr=vr();function br(e,t){let n=or(),r=Un(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,children:h,target:g,disabled:_,style:v,className:y,onClick:b,onBlur:x,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:T,ignoreBlocker:E,params:ee,search:D,hash:O,state:k,mask:te,reloadDocument:A,unsafeRelative:j,from:M,_fromLocation:ne,...N}=e,re=Jn(),ie=sr({select:e=>{let t=e.matches[e.matches.length-1];return{search:t?.search,hash:e.location.hash,path:t?.pathname}},structuralSharing:!0}),ae=e.from,P=I.useMemo(()=>({...e,from:ae}),[n,ie,ae,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),F=I.useMemo(()=>n.buildLocation({...P}),[n,P]),oe=F.maskedLocation?F.maskedLocation.publicHref:F.publicHref,se=F.maskedLocation?F.maskedLocation.external:F.external,ce=I.useMemo(()=>kr(oe,se,n.history,_),[_,se,oe,n.history]),le=I.useMemo(()=>{if(ce?.external)return ze(ce.href,n.protocolAllowlist)?void 0:ce.href;if(!Ar(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),ze(s,n.protocolAllowlist)?void 0:s}catch{}},[s,ce,n.protocolAllowlist]),ue=sr({select:e=>{if(le)return!1;if(o?.exact){if(!Ct(e.location.pathname,F.pathname,n.basepath))return!1}else{let t=St(e.location.pathname,n.basepath),r=St(F.pathname,n.basepath);if(!(t.startsWith(r)&&(t.length===r.length||t[r.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!Ne(e.location.search,F.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?re&&e.location.hash===F.hash:!0}}),de=ue?Te(i,{})??Sr:xr,fe=ue?xr:Te(a,{})??xr,pe=[y,de.className,fe.className].filter(Boolean).join(` `),me=(v||de.style||fe.style)&&{...v,...de.style,...fe.style},[he,ge]=I.useState(!1),_e=I.useRef(!1),ve=e.reloadDocument||le?!1:c??n.options.defaultPreload,ye=l??n.options.defaultPreloadDelay??0,be=I.useCallback(()=>{n.preloadRoute({...P,_builtLocation:F}).catch(e=>{console.warn(e),console.warn(Nn)})},[n,P,F]);Hn(r,I.useCallback(e=>{e?.isIntersecting&&be()},[be]),Dr,{disabled:!!_||ve!==`viewport`}),I.useEffect(()=>{_e.current||!_&&ve===`render`&&(be(),_e.current=!0)},[_,be,ve]);let xe=e=>{let t=e.currentTarget.getAttribute(`target`),r=g===void 0?t:g;if(!_&&!Mr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,yr.flushSync)(()=>{ge(!0)});let t=n.subscribe(`onResolved`,()=>{t(),ge(!1)});n.navigate({...P,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:E})}};if(le)return{...N,ref:r,href:le,...h&&{children:h},...g&&{target:g},..._&&{disabled:_},...v&&{style:v},...y&&{className:y},...b&&{onClick:b},...x&&{onBlur:x},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...T&&{onTouchStart:T}};let Se=e=>{if(_||ve!==`intent`)return;if(!ye){be();return}let t=e.currentTarget;if(Er.has(t))return;let n=setTimeout(()=>{Er.delete(t),be()},ye);Er.set(t,n)},Ce=e=>{_||ve!==`intent`||be()},we=e=>{if(_||!ve||!ye)return;let t=e.currentTarget,n=Er.get(t);n&&(clearTimeout(n),Er.delete(t))};return{...N,...de,...fe,href:ce?.href,ref:r,onClick:Or([b,xe]),onBlur:Or([x,we]),onFocus:Or([S,Se]),onMouseEnter:Or([C,Se]),onMouseLeave:Or([w,we]),onTouchStart:Or([T,Ce]),disabled:!!_,target:g,...me&&{style:me},...pe&&{className:pe},..._&&Cr,...ue&&wr,...re&&he&&Tr}}var xr={},Sr={className:`active`},Cr={role:`link`,"aria-disabled":!0},wr={"data-status":`active`,"aria-current":`page`},Tr={"data-transitioning":`transitioning`},Er=new WeakMap,Dr={rootMargin:`100px`},Or=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function kr(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Ar(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var jr=I.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=br(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return I.createElement(`a`,t,o)}return I.createElement(n,a,o)});function Mr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Nr=class extends Pn{constructor(e){super(e),this.useMatch=e=>ur({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ur({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>mr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>fr({...e,from:this.id}),this.useLoaderData=e=>dr({...e,from:this.id}),this.useNavigate=()=>hr({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(jr,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Pr(e){return new Nr(e)}var Fr=class extends Fn{constructor(e){super(e),this.useMatch=e=>ur({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ur({...e,from:this.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>mr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>fr({...e,from:this.id}),this.useLoaderData=e=>dr({...e,from:this.id}),this.useNavigate=()=>hr({from:this.fullPath}),this.Link=I.forwardRef((e,t)=>(0,L.jsx)(jr,{ref:t,from:this.fullPath,...e})),this.$$typeof=Symbol.for(`react.memo`)}};function Ir(e){return new Fr(e)}function Lr(e){return typeof e==`object`?new Rr(e,{silent:!0}).createRoute(e):new Rr(e,{silent:!0}).createRoute}var Rr=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Pr(e);return t.isRoot=!1,t},this.silent=t?.silent}},zr=class{constructor(e){this.useMatch=e=>ur({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>ur({from:this.options.id,select:t=>e?.select?e.select(t.context):t.context}),this.useSearch=e=>mr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>pr({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>fr({...e,from:this.options.id}),this.useLoaderData=e=>dr({...e,from:this.options.id}),this.useNavigate=()=>hr({from:or().routesById[this.options.id].fullPath}),this.options=e,this.$$typeof=Symbol.for(`react.memo`)}};function Br(e){return typeof e==`object`?new zr(e):t=>new zr({id:e,...t})}function Vr(){let e=or(),t=I.useRef({router:e,mounted:!1}),[n,r]=I.useState(!1),{hasPendingMatches:i,isLoading:a}=sr({select:e=>({isLoading:e.isLoading,hasPendingMatches:e.matches.some(e=>e.status===`pending`)}),structuralSharing:!0}),o=Vn(a),s=a||n||i,c=Vn(s),l=a||i,u=Vn(l);return e.startTransition=e=>{r(!0),I.startTransition(()=>{e(),r(!1)})},I.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return bt(e.latestLocation.publicHref)!==bt(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),Bn(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),Bn(()=>{o&&!a&&e.emit({type:`onLoad`,...xn(e.state)})},[o,e,a]),Bn(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...xn(e.state)})},[l,u,e]),Bn(()=>{if(c&&!s){let t=xn(e.state);e.emit({type:`onResolved`,...t}),e.__store.setState(e=>({...e,status:`idle`,resolvedLocation:e.location})),t.hrefChanged&&Bt(e)}},[s,c,e]),null}function Hr(e){let t=sr({select:e=>`not-found-${e.location.pathname}-${e.status}`});return(0,L.jsx)(Wn,{getResetKey:()=>t,onCatch:(t,n)=>{if(kt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(kt(t))return e.fallback?.(t);throw t},children:e.children})}function Ur(){return(0,L.jsx)(`p`,{children:`Not Found`})}function Wr(e){return(0,L.jsx)(L.Fragment,{children:e.children})}function Gr(e,t,n){return t.options.notFoundComponent?(0,L.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,L.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,L.jsx)(Ur,{})}function Kr({children:e}){return or(),null}function qr(){let e=or();if(!e.isScrollRestoring||!0)return null;let t=(e.options.getScrollRestorationKey||Ft)(e.latestLocation),n=t===Ft(e.latestLocation)?void 0:t,r={storageKey:jt,shouldScrollRestoration:!0};return n&&(r.key=n),(0,L.jsx)(Kr,{children:`(${Rt.toString()})(${He(JSON.stringify(r))})`})}var Jr=I.memo(function({matchId:e}){let t=or(),n=sr({select:t=>{let n=t.matches.findIndex(t=>t.id===e),r=t.matches[n];return qe(r,`Could not find match for matchId "${e}". Please file an issue!`),{routeId:r.routeId,ssr:r.ssr,_displayPending:r._displayPending,resetKey:t.loadedAt,parentRouteId:t.matches[n-1]?.routeId}},structuralSharing:!0}),r=t.routesById[n.routeId],i=r.options.pendingComponent??t.options.defaultPendingComponent,a=i?(0,L.jsx)(i,{}):null,o=r.options.errorComponent??t.options.defaultErrorComponent,s=r.options.onCatch??t.options.defaultOnCatch,c=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=n.ssr===!1||n.ssr===`data-only`,u=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||l))?I.Suspense:Wr,d=o?Wn:Wr,f=c?Hr:Wr;return(0,L.jsxs)(r.isRoot?r.options.shellComponent??Wr:Wr,{children:[(0,L.jsx)(cr.Provider,{value:e,children:(0,L.jsx)(u,{fallback:a,children:(0,L.jsx)(d,{getResetKey:()=>n.resetKey,errorComponent:o||Kn,onCatch:(t,n)=>{if(kt(t))throw t;Qn(!1,`Error in route match: ${e}`),s?.(t,n)},children:(0,L.jsx)(f,{fallback:e=>{if(!c||e.routeId&&e.routeId!==n.routeId||!e.routeId&&!r.isRoot)throw e;return I.createElement(c,e)},children:l||n._displayPending?(0,L.jsx)(qn,{fallback:a,children:(0,L.jsx)(Xr,{matchId:e})}):(0,L.jsx)(Xr,{matchId:e})})})})}),n.parentRouteId===`__root__`&&t.options.scrollRestoration?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Yr,{}),(0,L.jsx)(qr,{})]}):null]})});function Yr(){let e=or(),t=I.useRef(void 0);return(0,L.jsx)(`script`,{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:`onRendered`,...xn(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}var Xr=I.memo(function({matchId:e}){let t=or(),{match:n,key:r,routeId:i}=sr({select:n=>{let r=n.matches.find(t=>t.id===e),i=r.routeId,a=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return{key:a?JSON.stringify(a):void 0,routeId:i,match:{id:r.id,status:r.status,error:r.error,invalid:r.invalid,_forcePending:r._forcePending,_displayPending:r._displayPending}}},structuralSharing:!0}),a=t.routesById[i],o=I.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,L.jsx)(e,{},r):(0,L.jsx)(Zr,{})},[r,a.options.component,t.options.defaultComponent]);if(n._displayPending)throw t.getMatch(n.id)?._nonReactive.displayPendingPromise;if(n._forcePending)throw t.getMatch(n.id)?._nonReactive.minPendingPromise;if(n.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let r=t.getMatch(n.id);if(r&&!r._nonReactive.minPendingPromise){let t=Pe();r._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),r._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(n.id)?._nonReactive.loadPromise}if(n.status===`notFound`)return qe(kt(n.error),`Expected a notFound error`),Gr(t,a,n.error);if(n.status===`redirected`)throw qe(Xt(n.error),`Expected a redirect error`),t.getMatch(n.id)?._nonReactive.loadPromise;if(n.status===`error`)throw n.error;return o}),Zr=I.memo(function(){let e=or(),t=I.useContext(cr),n=sr({select:e=>e.matches.find(e=>e.id===t)?.routeId}),r=e.routesById[n],i=sr({select:e=>{let n=e.matches.find(e=>e.id===t);return qe(n,`Could not find parent match for matchId "${t}"`),n.globalNotFound}}),a=sr({select:e=>{let n=e.matches;return n[n.findIndex(e=>e.id===t)+1]?.id}}),o=e.options.defaultPendingComponent?(0,L.jsx)(e.options.defaultPendingComponent,{}):null;if(i)return Gr(e,r,void 0);if(!a)return null;let s=(0,L.jsx)(Jr,{matchId:a});return n===`__root__`?(0,L.jsx)(I.Suspense,{fallback:o,children:s}):s});function Qr(){let e=or(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,L.jsx)(t,{}):null,r=(0,L.jsxs)(typeof document<`u`&&e.ssr?Wr:I.Suspense,{fallback:n,children:[(0,L.jsx)(Vr,{}),(0,L.jsx)($r,{})]});return e.options.InnerWrap?(0,L.jsx)(e.options.InnerWrap,{children:r}):r}function $r(){let e=or(),t=sr({select:e=>e.matches[0]?.id}),n=sr({select:e=>e.loadedAt}),r=t?(0,L.jsx)(Jr,{matchId:t}):null;return(0,L.jsx)(cr.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,L.jsx)(Wn,{getResetKey:()=>n,errorComponent:Kn,onCatch:void 0,children:r})})}var ei=e=>new ti(e),ti=class extends Cn{constructor(e){super(e)}};typeof globalThis<`u`?(globalThis.createFileRoute=Lr,globalThis.createLazyFileRoute=Br):typeof window<`u`&&(window.createFileRoute=Lr,window.createLazyFileRoute=Br);function ni({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,L.jsx)(ar.Provider,{value:e,children:t});return e.options.Wrap?(0,L.jsx)(e.options.Wrap,{children:r}):r}function ri({router:e,...t}){return(0,L.jsx)(ni,{router:e,...t,children:(0,L.jsx)(Qr,{})})}var ii=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function ee(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(ee)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,k=O.port2;O.port1.onmessage=ee,D=function(){k.postMessage(null)}}else D=function(){_(ee,0)};function te(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ai=o(((e,t)=>{t.exports=ii()})),oi=o((e=>{var t=ai(),n=zn(),r=vr();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),ee=Symbol.for(`react.memo_cache_sentinel`),D=Symbol.iterator;function O(e){return typeof e!=`object`||!e?null:(e=D&&e[D]||e[`@@iterator`],typeof e==`function`?e:null)}var k=Symbol.for(`react.client.reference`);function te(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===k?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?te(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var A=Array.isArray,j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},N=[],re=-1;function ie(e){return{current:e}}function ae(e){0>re||(e.current=N[re],N[re]=null,re--)}function P(e,t){re++,N[re]=e.current,e.current=t}var F=ie(null),oe=ie(null),se=ie(null),ce=ie(null);function le(e,t){switch(P(se,t),P(oe,e),P(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Qd(t),e=$d(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ae(F),P(F,e)}function ue(){ae(F),ae(oe),ae(se)}function de(e){e.memoizedState!==null&&P(ce,e);var t=F.current,n=$d(t,e.type);t!==n&&(P(oe,e),P(F,n))}function fe(e){oe.current===e&&(ae(F),ae(oe)),ce.current===e&&(ae(ce),lp._currentValue=ne)}var pe,me;function he(e){if(pe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);pe=t&&t[1]||``,me=-1<e.stack.indexOf(`
|
|
2
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
-
`+pe+e+me}var ge=!1;function _e(e,t){if(!e||ge)return``;ge=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
-
`),l=s.split(`
|
|
5
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ge=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?he(n):``}function ve(e,t){switch(e.tag){case 26:case 27:case 5:return he(e.type);case 16:return he(`Lazy`);case 13:return e.child!==t&&t!==null?he(`Suspense Fallback`):he(`Suspense`);case 19:return he(`SuspenseList`);case 0:case 15:return _e(e.type,!1);case 11:return _e(e.type.render,!1);case 1:return _e(e.type,!0);case 31:return he(`Activity`);default:return``}}function ye(e){try{var t=``,n=null;do t+=ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
-
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var be=Object.prototype.hasOwnProperty,xe=t.unstable_scheduleCallback,Se=t.unstable_cancelCallback,Ce=t.unstable_shouldYield,we=t.unstable_requestPaint,Te=t.unstable_now,Ee=t.unstable_getCurrentPriorityLevel,De=t.unstable_ImmediatePriority,Oe=t.unstable_UserBlockingPriority,ke=t.unstable_NormalPriority,Ae=t.unstable_LowPriority,je=t.unstable_IdlePriority,Me=t.log,Ne=t.unstable_setDisableYieldValue,Pe=null,Fe=null;function Ie(e){if(typeof Me==`function`&&Ne(e),Fe&&typeof Fe.setStrictMode==`function`)try{Fe.setStrictMode(Pe,e)}catch{}}var Le=Math.clz32?Math.clz32:Be,Re=Math.log,ze=Math.LN2;function Be(e){return e>>>=0,e===0?32:31-(Re(e)/ze|0)|0}var Ve=256,He=262144,Ue=4194304;function We(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ge(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=We(n))):i=We(o):i=We(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=We(n))):i=We(o)):i=We(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Ke(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function qe(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Je(){var e=Ue;return Ue<<=1,!(Ue&62914560)&&(Ue=4194304),e}function Ye(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ze(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Le(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Qe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Qe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Le(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function $e(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Le(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function et(e,t){var n=t&-t;return n=n&42?1:tt(n),(n&(e.suspendedLanes|t))===0?n:0}function tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function nt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function rt(){var e=M.p;return e===0?(e=window.event,e===void 0?32:Tp(e.type)):e}function it(e,t){var n=M.p;try{return M.p=e,t()}finally{M.p=n}}var at=Math.random().toString(36).slice(2),ot=`__reactFiber$`+at,st=`__reactProps$`+at,ct=`__reactContainer$`+at,lt=`__reactEvents$`+at,ut=`__reactListeners$`+at,dt=`__reactHandles$`+at,ft=`__reactResources$`+at,pt=`__reactMarker$`+at;function mt(e){delete e[ot],delete e[st],delete e[lt],delete e[ut],delete e[dt]}function ht(e){var t=e[ot];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ct]||n[ot]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sf(e);e!==null;){if(n=e[ot])return n;e=Sf(e)}return t}e=n,n=e.parentNode}return null}function gt(e){if(e=e[ot]||e[ct]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _t(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function vt(e){var t=e[ft];return t||=e[ft]={hoistableStyles:new Map,hoistableScripts:new Map},t}function yt(e){e[pt]=!0}var bt=new Set,xt={};function St(e,t){Ct(e,t),Ct(e+`Capture`,t)}function Ct(e,t){for(xt[e]=t,e=0;e<t.length;e++)bt.add(t[e])}var wt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Tt={},Et={};function Dt(e){return be.call(Et,e)?!0:be.call(Tt,e)?!1:wt.test(e)?Et[e]=!0:(Tt[e]=!0,!1)}function Ot(e,t,n){if(Dt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function kt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function At(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function jt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Mt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Nt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pt(e){if(!e._valueTracker){var t=Mt(e)?`checked`:`value`;e._valueTracker=Nt(e,t,``+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Mt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function It(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Lt=/[\n"\\]/g;function Rt(e){return e.replace(Lt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function zt(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+jt(t)):e.value!==``+jt(t)&&(e.value=``+jt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Vt(e,o,jt(n)):Vt(e,o,jt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+jt(s):e.removeAttribute(`name`)}function Bt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Pt(e);return}n=n==null?``:``+jt(n),t=t==null?n:``+jt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Pt(e)}function Vt(e,t,n){t===`number`&&It(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ht(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+jt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ut(e,t,n){if(t!=null&&(t=``+jt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+jt(n)}function Wt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(A(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=jt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Pt(e)}function Gt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Kt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function qt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Kt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Jt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&qt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&qt(e,o,t[o])}function Yt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Xt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Zt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qt(e){return Zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function $t(){}var en=null;function tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nn=null,rn=null;function an(e){var t=gt(e);if(t&&(e=t.stateNode)){var n=e[st]||null;a:switch(e=t.stateNode,t.type){case`input`:if(zt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Rt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[st]||null;if(!a)throw Error(i(90));zt(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Ft(r)}break a;case`textarea`:Ut(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ht(e,!!n.multiple,t,!1)}}}var on=!1;function sn(e,t,n){if(on)return e(t,n);on=!0;try{return e(t)}finally{if(on=!1,(nn!==null||rn!==null)&&(Ou(),nn&&(t=nn,e=rn,rn=nn=null,an(t),e)))for(t=0;t<e.length;t++)an(e[t])}}function cn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[st]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var ln=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),un=!1;if(ln)try{var dn={};Object.defineProperty(dn,`passive`,{get:function(){un=!0}}),window.addEventListener(`test`,dn,dn),window.removeEventListener(`test`,dn,dn)}catch{un=!1}var fn=null,pn=null,mn=null;function hn(){if(mn)return mn;var e,t=pn,n=t.length,r,i=`value`in fn?fn.value:fn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return mn=i.slice(e,1<r?1-r:void 0)}function gn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function _n(){return!0}function vn(){return!1}function yn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?_n:vn,this.isPropagationStopped=vn,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=_n)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=_n)},persist:function(){},isPersistent:_n}),t}var bn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xn=yn(bn),Sn=f({},bn,{view:0,detail:0}),Cn=yn(Sn),wn,Tn,En,Dn=f({},Sn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==En&&(En&&e.type===`mousemove`?(wn=e.screenX-En.screenX,Tn=e.screenY-En.screenY):Tn=wn=0,En=e),wn)},movementY:function(e){return`movementY`in e?e.movementY:Tn}}),On=yn(Dn),kn=yn(f({},Dn,{dataTransfer:0})),An=yn(f({},Sn,{relatedTarget:0})),jn=yn(f({},bn,{animationName:0,elapsedTime:0,pseudoElement:0})),Mn=yn(f({},bn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Nn=yn(f({},bn,{data:0})),Pn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Fn={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`},In={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Ln(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=In[e])?!!t[e]:!1}function Rn(){return Ln}var I=yn(f({},Sn,{key:function(e){if(e.key){var t=Pn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=gn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Fn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rn,charCode:function(e){return e.type===`keypress`?gn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?gn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Bn=yn(f({},Dn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Vn=yn(f({},Sn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rn})),Hn=yn(f({},bn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Un=yn(f({},Dn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),L=yn(f({},bn,{newState:0,oldState:0})),Wn=[9,13,27,32],Gn=ln&&`CompositionEvent`in window,Kn=null;ln&&`documentMode`in document&&(Kn=document.documentMode);var qn=ln&&`TextEvent`in window&&!Kn,Jn=ln&&(!Gn||Kn&&8<Kn&&11>=Kn),Yn=` `,Xn=!1;function Zn(e,t){switch(e){case`keyup`:return Wn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Qn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var $n=!1;function er(e,t){switch(e){case`compositionend`:return Qn(t);case`keypress`:return t.which===32?(Xn=!0,Yn):null;case`textInput`:return e=t.data,e===Yn&&Xn?null:e;default:return null}}function tr(e,t){if($n)return e===`compositionend`||!Gn&&Zn(e,t)?(e=hn(),mn=pn=fn=null,$n=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Jn&&t.locale!==`ko`?null:t.data;default:return null}}var nr={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 rr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!nr[e.type]:t===`textarea`}function ir(e,t,n,r){nn?rn?rn.push(r):rn=[r]:nn=r,t=Id(t,`onChange`),0<t.length&&(n=new xn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ar=null,or=null;function sr(e){Od(e,0)}function cr(e){if(Ft(_t(e)))return e}function lr(e,t){if(e===`change`)return t}var ur=!1;if(ln){var dr;if(ln){var fr=`oninput`in document;if(!fr){var pr=document.createElement(`div`);pr.setAttribute(`oninput`,`return;`),fr=typeof pr.oninput==`function`}dr=fr}else dr=!1;ur=dr&&(!document.documentMode||9<document.documentMode)}function mr(){ar&&(ar.detachEvent(`onpropertychange`,hr),or=ar=null)}function hr(e){if(e.propertyName===`value`&&cr(or)){var t=[];ir(t,or,e,tn(e)),sn(sr,t)}}function gr(e,t,n){e===`focusin`?(mr(),ar=t,or=n,ar.attachEvent(`onpropertychange`,hr)):e===`focusout`&&mr()}function _r(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return cr(or)}function yr(e,t){if(e===`click`)return cr(t)}function br(e,t){if(e===`input`||e===`change`)return cr(t)}function xr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Sr=typeof Object.is==`function`?Object.is:xr;function Cr(e,t){if(Sr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!be.call(t,i)||!Sr(e[i],t[i]))return!1}return!0}function wr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Tr(e,t){var n=wr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=wr(n)}}function Er(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Er(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=It(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=It(e.document)}return t}function Or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var kr=ln&&`documentMode`in document&&11>=document.documentMode,Ar=null,jr=null,Mr=null,Nr=!1;function Pr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Nr||Ar==null||Ar!==It(r)||(r=Ar,`selectionStart`in r&&Or(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Mr&&Cr(Mr,r)||(Mr=r,r=Id(jr,`onSelect`),0<r.length&&(t=new xn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Ar)))}function Fr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Ir={animationend:Fr(`Animation`,`AnimationEnd`),animationiteration:Fr(`Animation`,`AnimationIteration`),animationstart:Fr(`Animation`,`AnimationStart`),transitionrun:Fr(`Transition`,`TransitionRun`),transitionstart:Fr(`Transition`,`TransitionStart`),transitioncancel:Fr(`Transition`,`TransitionCancel`),transitionend:Fr(`Transition`,`TransitionEnd`)},Lr={},Rr={};ln&&(Rr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Ir.animationend.animation,delete Ir.animationiteration.animation,delete Ir.animationstart.animation),`TransitionEvent`in window||delete Ir.transitionend.transition);function zr(e){if(Lr[e])return Lr[e];if(!Ir[e])return e;var t=Ir[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Rr)return Lr[e]=t[n];return e}var Br=zr(`animationend`),Vr=zr(`animationiteration`),Hr=zr(`animationstart`),Ur=zr(`transitionrun`),Wr=zr(`transitionstart`),Gr=zr(`transitioncancel`),Kr=zr(`transitionend`),qr=new Map,Jr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Jr.push(`scrollEnd`);function Yr(e,t){qr.set(e,t),St(t,[e])}var Xr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Zr=[],Qr=0,$r=0;function ei(){for(var e=Qr,t=$r=Qr=0;t<e;){var n=Zr[t];Zr[t++]=null;var r=Zr[t];Zr[t++]=null;var i=Zr[t];Zr[t++]=null;var a=Zr[t];if(Zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ii(n,i,a)}}function ti(e,t,n,r){Zr[Qr++]=e,Zr[Qr++]=t,Zr[Qr++]=n,Zr[Qr++]=r,$r|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ni(e,t,n,r){return ti(e,t,n,r),oi(e)}function ri(e,t){return ti(e,null,null,t),oi(e)}function ii(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Le(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function oi(e){if(50<yu)throw yu=0,bu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var si={};function ci(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function li(e,t,n,r){return new ci(e,t,n,r)}function ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function di(e,t){var n=e.alternate;return n===null?(n=li(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function fi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function pi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ui(e)&&(s=1);else if(typeof e==`string`)s=ep(e,n,F.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=li(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return mi(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=li(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=li(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=li(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=li(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function mi(e,t,n,r){return e=li(7,e,r,t),e.lanes=n,e}function hi(e,t,n){return e=li(6,e,null,t),e.lanes=n,e}function gi(e){var t=li(18,null,null,0);return t.stateNode=e,t}function _i(e,t,n){return t=li(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var vi=new WeakMap;function yi(e,t){if(typeof e==`object`&&e){var n=vi.get(e);return n===void 0?(t={value:e,source:t,stack:ye(t)},vi.set(e,t),t):n}return{value:e,source:t,stack:ye(t)}}var bi=[],xi=0,Si=null,Ci=0,wi=[],Ti=0,Ei=null,Di=1,Oi=``;function ki(e,t){bi[xi++]=Ci,bi[xi++]=Si,Si=e,Ci=t}function Ai(e,t,n){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Ei=e;var r=Di;e=Oi;var i=32-Le(r)-1;r&=~(1<<i),n+=1;var a=32-Le(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Di=1<<32-Le(t)+i|n<<i|r,Oi=a+e}else Di=1<<a|n<<i|r,Oi=e}function ji(e){e.return!==null&&(ki(e,1),Ai(e,1,0))}function Mi(e){for(;e===Si;)Si=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null;for(;e===Ei;)Ei=wi[--Ti],wi[Ti]=null,Oi=wi[--Ti],wi[Ti]=null,Di=wi[--Ti],wi[Ti]=null}function Ni(e,t){wi[Ti++]=Di,wi[Ti++]=Oi,wi[Ti++]=Ei,Di=t.id,Oi=t.overflow,Ei=e}var Pi=null,Fi=null,Ii=!1,Li=null,Ri=!1,zi=Error(i(519));function Bi(e){throw Ki(yi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),zi}function Vi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[ot]=e,t[st]=r,n){case`dialog`:kd(`cancel`,t),kd(`close`,t);break;case`iframe`:case`object`:case`embed`:kd(`load`,t);break;case`video`:case`audio`:for(n=0;n<Ed.length;n++)kd(Ed[n],t);break;case`source`:kd(`error`,t);break;case`img`:case`image`:case`link`:kd(`error`,t),kd(`load`,t);break;case`details`:kd(`toggle`,t);break;case`input`:kd(`invalid`,t),Bt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:kd(`invalid`,t);break;case`textarea`:kd(`invalid`,t),Wt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Hd(t.textContent,n)?(r.popover!=null&&(kd(`beforetoggle`,t),kd(`toggle`,t)),r.onScroll!=null&&kd(`scroll`,t),r.onScrollEnd!=null&&kd(`scrollend`,t),r.onClick!=null&&(t.onclick=$t),t=!0):t=!1,t||Bi(e,!0)}function Hi(e){for(Pi=e.return;Pi;)switch(Pi.tag){case 5:case 31:case 13:Ri=!1;return;case 27:case 3:Ri=!0;return;default:Pi=Pi.return}}function Ui(e){if(e!==Pi)return!1;if(!Ii)return Hi(e),Ii=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||ef(e.type,e.memoizedProps)),n=!n),n&&Fi&&Bi(e),Hi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=xf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Fi=xf(e)}else t===27?(t=Fi,lf(e.type)?(e=bf,bf=null,Fi=e):Fi=t):Fi=Pi?yf(e.stateNode.nextSibling):null;return!0}function Wi(){Fi=Pi=null,Ii=!1}function Gi(){var e=Li;return e!==null&&(au===null?au=e:au.push.apply(au,e),Li=null),e}function Ki(e){Li===null?Li=[e]:Li.push(e)}var qi=ie(null),Ji=null,Yi=null;function Xi(e,t,n){P(qi,t._currentValue),t._currentValue=n}function Zi(e){e._currentValue=qi.current,ae(qi)}function Qi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function $i(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Qi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Qi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function ea(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Sr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===ce.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[lp]:e.push(lp))}a=a.return}e!==null&&$i(t,e,n,r),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Sr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function na(e){Ji=e,Yi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ra(e){return aa(Ji,e)}function ia(e,t){return Ji===null&&na(e),aa(e,t)}function aa(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Yi===null){if(e===null)throw Error(i(308));Yi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Yi=Yi.next=t;return n}var oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},sa=t.unstable_scheduleCallback,R=t.unstable_NormalPriority,ca={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function la(){return{controller:new oa,data:new Map,refCount:0}}function ua(e){e.refCount--,e.refCount===0&&sa(R,function(){e.controller.abort()})}var da=null,fa=0,pa=0,ma=null;function ha(e,t){if(da===null){var n=da=[];fa=0,pa=bd(),ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return fa++,t.then(ga,ga),t}function ga(){if(--fa===0&&da!==null){ma!==null&&(ma.status=`fulfilled`);var e=da;da=null,pa=0,ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function _a(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var va=j.S;j.S=function(e,t){cu=Te(),typeof t==`object`&&t&&typeof t.then==`function`&&ha(e,t),va!==null&&va(e,t)};var ya=ie(null);function ba(){var e=ya.current;return e===null?Ul.pooledCache:e}function xa(e,t){t===null?P(ya,ya.current):P(ya,t.pool)}function Sa(){var e=ba();return e===null?null:{parent:ca._currentValue,pool:e}}var Ca=Error(i(460)),wa=Error(i(474)),Ta=Error(i(542)),Ea={then:function(){}};function Da(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Oa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then($t,$t),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e;default:if(typeof t.status==`string`)t.then($t,$t);else{if(e=Ul,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ma(e),e}throw Aa=t,Ca}}function ka(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Aa=e,Ca):e}}var Aa=null;function ja(){if(Aa===null)throw Error(i(459));var e=Aa;return Aa=null,e}function Ma(e){if(e===Ca||e===Ta)throw Error(i(483))}var Na=null,Pa=0;function Fa(e){var t=Pa;return Pa+=1,Na===null&&(Na=[]),Oa(Na,e,t)}function Ia(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function La(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ra(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=di(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=hi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ka(i)===t.type)?(t=a(t,n.props),Ia(t,n),t.return=e,t):(t=pi(n.type,n.key,n.props,null,e.mode,r),Ia(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=_i(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=mi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=pi(t.type,t.key,t.props,null,e.mode,n),Ia(n,t),n.return=e,n;case h:return t=_i(t,e.mode,n),t.return=e,t;case T:return t=ka(t),f(e,t,n)}if(A(t)||O(t))return t=mi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Fa(t),n);if(t.$$typeof===b)return f(e,ia(e,t),n);La(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=ka(n),p(e,t,n,r)}if(A(n)||O(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Fa(n),r);if(n.$$typeof===b)return p(e,t,ia(e,n),r);La(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ka(r),_(e,t,n,r,i)}if(A(r)||O(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Fa(r),i);if(r.$$typeof===b)return _(e,t,n,ia(t,r),i);La(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ii&&ki(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ii&&ki(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ii&&ki(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ii&&ki(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ii&&ki(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ii&&ki(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ka(l)===r.type){n(e,r.sibling),c=a(r,o.props),Ia(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Ia(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ka(o),x(e,r,o,c)}if(A(o))return v(e,r,o,c);if(O(o)){if(l=O(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Fa(o),c);if(o.$$typeof===b)return x(e,r,ia(e,o),c);La(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Pa=0;var i=x(e,t,n,r);return Na=null,i}catch(t){if(t===Ca||t===Ta)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var za=Ra(!0),Ba=Ra(!1),Va=!1;function Ha(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ua(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Wa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Hl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ii(e,null,n),t}return ti(e,r,t,n),oi(e)}function Ka(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}function qa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ja=!1;function Ya(){if(Ja){var e=ma;if(e!==null)throw e}}function Xa(e,t,n,r){Ja=!1;var i=e.updateQueue;Va=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Gl&p)===p:(r&p)===p){p!==0&&p===pa&&(Ja=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Va=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),$l|=o,e.lanes=o,e.memoizedState=d}}function Za(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Za(n[e],t)}var $a=ie(null),eo=ie(0);function to(e,t){e=Zl,P(eo,e),P($a,t),Zl=e|t.baseLanes}function no(){P(eo,Zl),P($a,$a.current)}function ro(){Zl=eo.current,ae($a),ae(eo)}var io=ie(null),ao=null;function oo(e){var t=e.alternate;P(fo,fo.current&1),P(io,e),ao===null&&(t===null||$a.current!==null||t.memoizedState!==null)&&(ao=e)}function so(e){P(fo,fo.current),P(io,e),ao===null&&(ao=e)}function co(e){e.tag===22?(P(fo,fo.current),P(io,e),ao===null&&(ao=e)):lo(e)}function lo(){P(fo,fo.current),P(io,io.current)}function uo(e){ae(io),ao===e&&(ao=null),ae(fo)}var fo=ie(0);function po(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gf(n)||_f(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var z=0,B=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,V=0;function So(){throw Error(i(321))}function Co(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Sr(e[n],t[n]))return!1;return!0}function wo(e,t,n,r,i,a){return z=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Bs:Vs,vo=!1,a=n(r,i),vo=!1,_o&&(a=Eo(t,n,r,i)),To(e),a}function To(e){j.H=zs;var t=mo!==null&&mo.next!==null;if(z=0,ho=mo=B=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||ic||(e=e.dependencies,e!==null&&ta(e)&&(ic=!0))}function Eo(e,t,n,r){B=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Hs,o=t(n,r)}while(_o);return o}function Do(){var e=j.H,t=e.useState()[0];return t=typeof t.then==`function`?No(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(B.flags|=1024),t}function Oo(){var e=yo!==0;return yo=0,e}function ko(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ao(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}z=0,ho=mo=B=null,_o=!1,bo=yo=0,xo=null}function H(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?B.memoizedState=ho=e:ho=ho.next=e,ho}function jo(){if(mo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?B.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?B.memoizedState=ho=e:ho=ho.next=e}return ho}function Mo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function No(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Oa(xo,e,t),t=B,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Bs:Vs),e}function Po(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return No(e);if(e.$$typeof===b)return ra(e)}throw Error(i(438,String(e)))}function Fo(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Mo(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ee;return t.index++,n}function Io(e,t){return typeof t==`function`?t(e):t}function Lo(e){return Ro(jo(),mo,e)}function Ro(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(z&f)===f:(Gl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===pa&&(d=!0);else if((z&p)===p){u=u.next,p===pa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,$l|=p;f=u.action,vo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,$l|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Sr(o,e.memoizedState)&&(ic=!0,d&&(n=ma,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function zo(e){var t=jo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Sr(o,t.memoizedState)||(ic=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Bo(e,t,n){var r=B,a=jo(),o=Ii;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Sr((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,ic=!0),a=a.queue,ds(Uo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,a,n,t),null),Ul===null)throw Error(i(349));o||z&127||Vo(r,t,n)}return n}function Vo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=Mo(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ho(e,t,n,r){t.value=n,t.getSnapshot=r,Wo(t)&&Go(e)}function Uo(e,t,n){return n(function(){Wo(t)&&Go(e)})}function Wo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Sr(e,n)}catch{return!0}}function Go(e){var t=ri(e,2);t!==null&&Cu(t,e,2)}function Ko(e){var t=H();if(typeof e==`function`){var n=e;if(e=n(),vo){Ie(!0);try{n()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:e},t}function qo(e,t,n,r){return e.baseState=n,Ro(e,mo,typeof r==`function`?r:Io)}function Jo(e,t,n,r,a){if(Is(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};j.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Yo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Yo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=j.T,o={};j.T=o;try{var s=n(i,r),c=j.S;c!==null&&c(o,s),Xo(e,t,s)}catch(n){Qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),j.T=a}}else try{a=n(i,r),Xo(e,t,a)}catch(n){Qo(e,t,n)}}function Xo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Zo(e,t,n)},function(n){return Qo(e,t,n)}):Zo(e,t,n)}function Zo(e,t,n){t.status=`fulfilled`,t.value=n,$o(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Yo(e,n)))}function Qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,$o(t),t=t.next;while(t!==r)}e.action=null}function $o(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function es(e,t){return t}function ts(e,t){if(Ii){var n=Ul.formState;if(n!==null){a:{var r=B;if(Ii){if(Fi){b:{for(var i=Fi,a=Ri;i.nodeType!==8;){if(!a){i=null;break b}if(i=yf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Fi=yf(i.nextSibling),r=i.data===`F!`;break a}}Bi(r)}r=!1}r&&(t=n[0])}}return n=H(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:es,lastRenderedState:t},n.queue=r,n=Ns.bind(null,B,r),r.dispatch=n,r=Ko(!1),a=Fs.bind(null,B,!1,r.queue),r=H(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Jo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function ns(e){return rs(jo(),mo,e)}function rs(e,t,n){if(t=Ro(e,t,es)[0],e=Lo(Io)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=No(t)}catch(e){throw e===Ca?Ta:e}else r=t;t=jo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,os(9,{destroy:void 0},is.bind(null,i,n),null)),[r,a,e]}function is(e,t){e.action=t}function as(e){var t=jo(),n=mo;if(n!==null)return rs(t,n,e);jo(),t=t.memoizedState,n=jo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function os(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=Mo(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ss(){return jo().memoizedState}function cs(e,t,n,r){var i=H();B.flags|=e,i.memoizedState=os(1|t,{destroy:void 0},n,r===void 0?null:r)}function ls(e,t,n,r){var i=jo();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&Co(r,mo.memoizedState.deps)?i.memoizedState=os(t,a,n,r):(B.flags|=e,i.memoizedState=os(1|t,a,n,r))}function us(e,t){cs(8390656,8,e,t)}function ds(e,t){ls(2048,8,e,t)}function fs(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=Mo(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ps(e){var t=jo().memoizedState;return fs({ref:t,nextImpl:e}),function(){if(Hl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ms(e,t){return ls(4,2,e,t)}function hs(e,t){return ls(4,4,e,t)}function gs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function _s(e,t,n){n=n==null?null:n.concat([e]),ls(4,4,gs.bind(null,t,e),n)}function vs(){}function ys(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Co(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function bs(e,t){var n=jo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Co(t,r[1]))return r[0];if(r=e(),vo){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r}function xs(e,t,n){return n===void 0||z&1073741824&&!(Gl&261930)?e.memoizedState=t:(e.memoizedState=n,e=Su(),B.lanes|=e,$l|=e,n)}function Ss(e,t,n,r){return Sr(n,t)?n:$a.current===null?!(z&42)||z&1073741824&&!(Gl&261930)?(ic=!0,e.memoizedState=n):(e=Su(),B.lanes|=e,$l|=e,t):(e=xs(e,n,r),Sr(e,t)||(ic=!0),e)}function Cs(e,t,n,r,i){var a=M.p;M.p=a!==0&&8>a?a:8;var o=j.T,s={};j.T=s,Fs(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ps(e,t,_a(c,r),xu(e)):Ps(e,t,r,xu(e))}catch(n){Ps(e,t,{then:function(){},status:`rejected`,reason:n},xu())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,ne,n===null?ws:function(){return Ds(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:ne},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Io,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ds(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ps(e,t.next.queue,{},xu())}function Os(){return ra(lp)}function ks(){return jo().memoizedState}function As(){return jo().memoizedState}function js(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=xu();e=Wa(n);var r=Ga(t,e,n);r!==null&&(Cu(r,t,n),Ka(r,t,n)),t={cache:la()},e.payload=t;return}t=t.return}}function Ms(e,t,n){var r=xu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Is(e)?Ls(t,n):(n=ni(e,t,n,r),n!==null&&(Cu(n,e,r),Rs(n,t,r)))}function Ns(e,t,n){Ps(e,t,n,xu())}function Ps(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Is(e))Ls(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Sr(s,o))return ti(e,t,i,0),Ul===null&&ei(),!1}catch{}if(n=ni(e,t,i,r),n!==null)return Cu(n,e,r),Rs(n,t,r),!0}return!1}function Fs(e,t,n,r){if(r={lane:2,revertLane:bd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Is(e)){if(t)throw Error(i(479))}else t=ni(e,n,r,2),t!==null&&Cu(t,e,2)}function Is(e){var t=e.alternate;return e===B||t!==null&&t===B}function Ls(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Rs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,$e(e,n)}}var zs={readContext:ra,use:Po,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};zs.useEffectEvent=So;var Bs={readContext:ra,use:Po,useCallback:function(e,t){return H().memoizedState=[e,t===void 0?null:t],e},useContext:ra,useEffect:us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),cs(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var n=H();t=t===void 0?null:t;var r=e();if(vo){Ie(!0);try{e()}finally{Ie(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=H();if(n!==void 0){var i=n(t);if(vo){Ie(!0);try{n(t)}finally{Ie(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ms.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=H();return e={current:e},t.memoizedState=e},useState:function(e){e=Ko(e);var t=e.queue,n=Ns.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(H(),e,t)},useTransition:function(){var e=Ko(!1);return e=Cs.bind(null,B,e.queue,!0,!1),H().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=H();if(Ii){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ul===null)throw Error(i(349));Gl&127||Vo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,us(Uo.bind(null,r,o,e),[e]),r.flags|=2048,os(9,{destroy:void 0},Ho.bind(null,r,o,n,t),null),n},useId:function(){var e=H(),t=Ul.identifierPrefix;if(Ii){var n=Oi,r=Di;n=(r&~(1<<32-Le(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=V++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Os,useFormState:ts,useActionState:ts,useOptimistic:function(e){var t=H();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Fs.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Fo,useCacheRefresh:function(){return H().memoizedState=js.bind(null,B)},useEffectEvent:function(e){var t=H(),n={impl:e};return t.memoizedState=n,function(){if(Hl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Vs={readContext:ra,use:Po,useCallback:ys,useContext:ra,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:Lo,useRef:ss,useState:function(){return Lo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){return Ss(jo(),mo.memoizedState,e,t)},useTransition:function(){var e=Lo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:ns,useActionState:ns,useOptimistic:function(e,t){return qo(jo(),mo,e,t)},useMemoCache:Fo,useCacheRefresh:As};Vs.useEffectEvent=ps;var Hs={readContext:ra,use:Po,useCallback:ys,useContext:ra,useEffect:ds,useImperativeHandle:_s,useInsertionEffect:ms,useLayoutEffect:hs,useMemo:bs,useReducer:zo,useRef:ss,useState:function(){return zo(Io)},useDebugValue:vs,useDeferredValue:function(e,t){var n=jo();return mo===null?xs(n,e,t):Ss(n,mo.memoizedState,e,t)},useTransition:function(){var e=zo(Io)[0],t=jo().memoizedState;return[typeof e==`boolean`?e:No(e),t]},useSyncExternalStore:Bo,useId:ks,useHostTransitionStatus:Os,useFormState:as,useActionState:as,useOptimistic:function(e,t){var n=jo();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):qo(n,mo,e,t)},useMemoCache:Fo,useCacheRefresh:As};Hs.useEffectEvent=ps;function Us(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ws={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Wa(r);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Cu(t,e,r),Ka(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=xu(),i=Wa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,r),t!==null&&(Cu(t,e,r),Ka(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=xu(),r=Wa(n);r.tag=2,t!=null&&(r.callback=t),t=Ga(e,r,n),t!==null&&(Cu(t,e,n),Ka(t,e,n))}};function Gs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Cr(n,r)||!Cr(i,a):!0}function Ks(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ws.enqueueReplaceState(t,t.state,null)}function qs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Js(e){Xr(e)}function Ys(e){console.error(e)}function Xs(e){Xr(e)}function Zs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){return n=Wa(n),n.tag=3,n.payload={element:null},n.callback=function(){Zs(e,t)},n}function ec(e){return e=Wa(e),e.tag=3,e}function tc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Qs(t,n,r),typeof i!=`function`&&(du===null?du=new Set([this]):du.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function nc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ea(t,n,a,!0),n=io.current,n!==null){switch(n.tag){case 31:case 13:return ao===null?Fu():n.alternate===null&&Ql===0&&(Ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),ed(e,r,a)),!1;case 22:return n.flags|=65536,r===Ea?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),ed(e,r,a)),!1}throw Error(i(435,n.tag))}return ed(e,r,a),Fu(),!1}if(Ii)return t=io.current,t===null?(r!==zi&&(t=Error(i(423),{cause:r}),Ki(yi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=yi(r,n),a=$s(e.stateNode,r,a),qa(e,a),Ql!==4&&(Ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==zi&&(e=Error(i(422),{cause:r}),Ki(yi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=yi(o,n),iu===null?iu=[o]:iu.push(o),Ql!==4&&(Ql=2),t===null)return!0;r=yi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=$s(n.stateNode,r,e),qa(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(du===null||!du.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=ec(a),tc(a,e,n,r),qa(n,a),!1}n=n.return}while(n!==null);return!1}var rc=Error(i(461)),ic=!1;function ac(e,t,n,r){t.child=e===null?Ba(t,null,n,r):za(t,e.child,n,r)}function oc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return na(t),r=wo(e,t,n,o,a,i),s=Oo(),e!==null&&!ic?(ko(e,t,i),Ac(e,t,i)):(Ii&&s&&ji(t),t.flags|=1,ac(e,t,r,i),t.child)}function sc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ui(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,cc(e,t,a,r,i)):(e=pi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Cr:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=di(a,r),e.ref=t.ref,e.return=t,t.child=e}function cc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Cr(a,r)&&e.ref===t.ref)if(ic=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ic=!0);else return t.lanes=e.lanes,Ac(e,t,i)}return gc(e,t,n,r,i)}function lc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return dc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&xa(t,a===null?null:a.cachePool),a===null?no():to(t,a),co(t);else return r=t.lanes=536870912,dc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&xa(t,null),no(),lo(t)):(xa(t,a.cachePool),to(t,a),lo(t),t.memoizedState=null);return ac(e,t,i,n),t.child}function uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function dc(e,t,n,r,i){var a=ba();return a=a===null?null:{parent:ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&xa(t,null),no(),co(t),e!==null&&ea(e,t,r,!0),t.childLanes=i,null}function fc(e,t){return t=Tc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function pc(e,t,n){return za(t,e.child,null,n),e=fc(t,t.pendingProps),e.flags|=2,uo(t),t.memoizedState=null,e}function mc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ii){if(r.mode===`hidden`)return e=fc(t,r),t.lanes=536870912,uc(null,e);if(so(t),(e=Fi)?(e=hf(e,Ri),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return t.lanes=536870912,null}return fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(so(t),a)if(t.flags&256)t.flags&=-257,t=pc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ic||ea(e,t,n,!1),a=(n&e.childLanes)!==0,ic||a){if(r=Ul,r!==null&&(s=et(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ri(e,s),Cu(r,e,s),rc;Fu(),t=pc(e,t,n)}else e=o.treeContext,Fi=yf(s.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=fc(t,r),t.flags|=4096;return t}return e=di(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gc(e,t,n,r,i){return na(t),n=wo(e,t,n,r,void 0,i),r=Oo(),e!==null&&!ic?(ko(e,t,i),Ac(e,t,i)):(Ii&&r&&ji(t),t.flags|=1,ac(e,t,n,i),t.child)}function _c(e,t,n,r,i,a){return na(t),t.updateQueue=null,n=Eo(t,r,n,i),To(e),r=Oo(),e!==null&&!ic?(ko(e,t,a),Ac(e,t,a)):(Ii&&r&&ji(t),t.flags|=1,ac(e,t,n,a),t.child)}function vc(e,t,n,r,i){if(na(t),t.stateNode===null){var a=si,o=n.contextType;typeof o==`object`&&o&&(a=ra(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ws,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Ha(t),o=n.contextType,a.context=typeof o==`object`&&o?ra(o):si,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Us(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ws.enqueueReplaceState(a,a.state,null),Xa(t,r,a,i),Ya(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=qs(n,s);a.props=c;var l=a.context,u=n.contextType;o=si,typeof u==`object`&&u&&(o=ra(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Ks(t,a,r,o),Va=!1;var f=t.memoizedState;a.state=f,Xa(t,r,a,i),Ya(),l=t.memoizedState,s||f!==l||Va?(typeof d==`function`&&(Us(t,n,d,r),l=t.memoizedState),(c=Va||Gs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ua(e,t),o=t.memoizedProps,u=qs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=si,typeof l==`object`&&l&&(c=ra(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Ks(t,a,r,c),Va=!1,f=t.memoizedState,a.state=f,Xa(t,r,a,i),Ya();var p=t.memoizedState;o!==d||f!==p||Va||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof s==`function`&&(Us(t,n,s,r),p=t.memoizedState),(u=Va||Gs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,hc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=za(t,e.child,null,i),t.child=za(t,null,n,i)):ac(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function yc(e,t,n,r){return Wi(),t.flags|=256,ac(e,t,n,r),t.child}var bc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xc(e){return{baseLanes:e,cachePool:Sa()}}function Sc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=nu),e}function Cc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(fo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ii){if(a?oo(t):lo(t),(e=Fi)?(e=hf(e,Ri),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ei===null?null:{id:Di,overflow:Oi},retryLane:536870912,hydrationErrors:null},n=gi(e),n.return=t,t.child=n,Pi=t,Fi=null)):e=null,e===null)throw Bi(t);return _f(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(lo(t),a=t.mode,c=Tc({mode:`hidden`,children:c},a),r=mi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(null,r)):(oo(t),wc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(oo(t),t.flags&=-257,t=Ec(e,t,n)):t.memoizedState===null?(lo(t),c=r.fallback,a=t.mode,r=Tc({mode:`visible`,children:r.children},a),c=mi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,za(t,e.child,null,n),r=t.child,r.memoizedState=xc(n),r.childLanes=Sc(e,s,n),t.memoizedState=bc,t=uc(null,r)):(lo(t),t.child=e.child,t.flags|=128,t=null);else if(oo(t),_f(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ki({value:r,source:null,stack:null}),t=Ec(e,t,n)}else if(ic||ea(e,t,n,!1),s=(n&e.childLanes)!==0,ic||s){if(s=Ul,s!==null&&(r=et(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ri(e,r),Cu(s,e,r),rc;gf(c)||Fu(),t=Ec(e,t,n)}else gf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Fi=yf(c.nextSibling),Pi=t,Ii=!0,Li=null,Ri=!1,e!==null&&Ni(t,e),t=wc(t,r.children),t.flags|=4096);return t}return a?(lo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=di(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=mi(c,a,n,null),c.flags|=2):c=di(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,uc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=xc(n):(a=c.cachePool,a===null?a=Sa():(l=ca._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=Sc(e,s,n),t.memoizedState=bc,uc(e.child,r)):(oo(t),n=e.child,e=n.sibling,n=di(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function wc(e,t){return t=Tc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Tc(e,t){return e=li(22,e,null,t),e.lanes=0,e}function Ec(e,t,n){return za(t,e.child,null,n),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qi(e.return,t,n)}function Oc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function kc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=fo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,P(fo,o),ac(e,t,r,n),r=Ii?Ci:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dc(e,n,t);else if(e.tag===19)Dc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&po(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Oc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&po(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Oc(t,!0,n,null,a,r);break;case`together`:Oc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),$l|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=di(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=di(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&ta(e))):!0}function Mc(e,t,n){switch(t.tag){case 3:le(t,t.stateNode.containerInfo),Xi(t,ca,e.memoizedState.cache),Wi();break;case 27:case 5:de(t);break;case 4:le(t,t.stateNode.containerInfo);break;case 10:Xi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,so(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(oo(t),e=Ac(e,t,n),e===null?null:e.sibling):Cc(e,t,n):(oo(t),t.flags|=128,null);oo(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return kc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),P(fo,fo.current),r)break;return null;case 22:return t.lanes=0,lc(e,t,n,t.pendingProps);case 24:Xi(t,ca,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ic=!0;else{if(!jc(e,n)&&!(t.flags&128))return ic=!1,Mc(e,t,n);ic=!!(e.flags&131072)}else ic=!1,Ii&&t.flags&1048576&&Ai(t,Ci,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ka(t.elementType),t.type=e,typeof e==`function`)ui(e)?(r=qs(e,r),t.tag=1,t=vc(null,t,e,r,n)):(t.tag=0,t=gc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=oc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=sc(null,t,e,r,n);break a}}throw t=te(e)||e,Error(i(306,t,``))}}return t;case 0:return gc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=qs(r,t.pendingProps),vc(e,t,r,a,n);case 3:a:{if(le(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ua(e,t),Xa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Xi(t,ca,r),r!==o.cache&&$i(t,[ca],n,!0),Ya(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=yc(e,t,r,n);break a}else if(r!==a){a=yi(Error(i(424)),t),Ki(a),t=yc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Fi=yf(e.firstChild),Pi=t,Ii=!0,Li=null,Ri=!0,n=Ba(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Wi(),r===a){t=Ac(e,t,n);break a}ac(e,t,r,n)}t=t.child}return t;case 26:return hc(e,t),e===null?(n=Bf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ii||(n=t.type,e=t.pendingProps,r=Zd(se.current).createElement(n),r[ot]=t,r[st]=e,Gd(r,n,e),yt(r),t.stateNode=r):t.memoizedState=Bf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return de(t),e===null&&Ii&&(r=t.stateNode=Cf(t.type,t.pendingProps,se.current),Pi=t,Ri=!0,a=Fi,lf(t.type)?(bf=a,Fi=yf(r.firstChild)):Fi=a),ac(e,t,t.pendingProps.children,n),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ii&&((a=r=Fi)&&(r=pf(r,t.type,t.pendingProps,Ri),r===null?a=!1:(t.stateNode=r,Pi=t,Fi=yf(r.firstChild),Ri=!1,a=!0)),a||Bi(t)),de(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,ef(a,o)?r=null:s!==null&&ef(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=wo(e,t,Do,null,null,n),lp._currentValue=a),hc(e,t),ac(e,t,r,n),t.child;case 6:return e===null&&Ii&&((e=n=Fi)&&(n=mf(n,t.pendingProps,Ri),n===null?e=!1:(t.stateNode=n,Pi=t,Fi=null,e=!0)),e||Bi(t)),null;case 13:return Cc(e,t,n);case 4:return le(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=za(t,null,r,n):ac(e,t,r,n),t.child;case 11:return oc(e,t,t.type,t.pendingProps,n);case 7:return ac(e,t,t.pendingProps,n),t.child;case 8:return ac(e,t,t.pendingProps.children,n),t.child;case 12:return ac(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Xi(t,t.type,r.value),ac(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,na(t),a=ra(a),r=r(a),t.flags|=1,ac(e,t,r,n),t.child;case 14:return sc(e,t,t.type,t.pendingProps,n);case 15:return cc(e,t,t.type,t.pendingProps,n);case 19:return kc(e,t,n);case 31:return mc(e,t,n);case 22:return lc(e,t,n,t.pendingProps);case 24:return na(t),r=ra(ca),e===null?(a=ba(),a===null&&(a=Ul,o=la(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Ha(t),Xi(t,ca,a)):((e.lanes&n)!==0&&(Ua(e,t),Xa(t,null,null,n),Ya()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Xi(t,ca,r),r!==a.cache&&$i(t,[ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Xi(t,ca,r))),ac(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Mu())e.flags|=8192;else throw Aa=Ea,wa}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!tp(t))if(Mu())e.flags|=8192;else throw Aa=Ea,wa}function Lc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Je(),e.lanes|=t,ru|=t)}function Rc(e,t){if(!Ii)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function zc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Bc(e,t,n){var r=t.pendingProps;switch(Mi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return zc(t),null;case 1:return zc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Zi(ca),ue(),n.pendingContext&&=(n.context=n.pendingContext,null),(e===null||e.child===null)&&(Ui(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Gi())),zc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Pc(t),o===null?(zc(t),Fc(t,a,null,r,n)):(zc(t),Ic(t,o))):o?o===e.memoizedState?(zc(t),t.flags&=-16777217):(Pc(t),zc(t),Ic(t,o)):(e=e.memoizedProps,e!==r&&Pc(t),zc(t),Fc(t,a,e,r,n)),null;case 27:if(fe(t),n=se.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}e=F.current,Ui(t)?Vi(t,e):(e=Cf(a,r,n),t.stateNode=e,Pc(t))}return zc(t),null;case 5:if(fe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return zc(t),null}if(o=F.current,Ui(t))Vi(t,o);else{var s=Zd(se.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ot]=t,o[st]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Gd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return zc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=se.current,Ui(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ot]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Hd(e.nodeValue,n)),e||Bi(t,!0)}else e=Zd(e).createTextNode(r),e[ot]=t,t.stateNode=e}return zc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ui(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ot]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),e=!1}else n=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(uo(t),t):(uo(t),null);if(t.flags&128)throw Error(i(558))}return zc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ui(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ot]=t}else Wi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;zc(t),a=!1}else a=Gi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(uo(t),t):(uo(t),null)}return uo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lc(t,t.updateQueue),zc(t),null);case 4:return ue(),e===null&&Md(t.stateNode.containerInfo),zc(t),null;case 10:return Zi(t.type),zc(t),null;case 19:if(ae(fo),r=t.memoizedState,r===null)return zc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Rc(r,!1);else{if(Ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=po(e),o!==null){for(t.flags|=128,Rc(r,!1),e=o.updateQueue,t.updateQueue=e,Lc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return P(fo,fo.current&1|2),Ii&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Te()>lu&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304)}else{if(!a)if(e=po(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lc(t,e),Rc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ii)return zc(t),null}else 2*Te()-r.renderingStartTime>lu&&n!==536870912&&(t.flags|=128,a=!0,Rc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(zc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Te(),e.sibling=null,n=fo.current,P(fo,a?n&1|2:n&1),Ii&&ki(t,r.treeForkCount),e);case 22:case 23:return uo(t),ro(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(zc(t),t.subtreeFlags&6&&(t.flags|=8192)):zc(t),n=t.updateQueue,n!==null&&Lc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ae(ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Zi(ca),zc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Vc(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Zi(ca),ue(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fe(t),null;case 31:if(t.memoizedState!==null){if(uo(t),t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(uo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ae(fo),null;case 4:return ue(),null;case 10:return Zi(t.type),null;case 22:case 23:return uo(t),ro(),e!==null&&ae(ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Zi(ca),null;case 25:return null;default:return null}}function Hc(e,t){switch(Mi(t),t.tag){case 3:Zi(ca),ue();break;case 26:case 27:case 5:fe(t);break;case 4:ue();break;case 31:t.memoizedState!==null&&uo(t);break;case 13:uo(t);break;case 19:ae(fo);break;case 10:Zi(t.type);break;case 22:case 23:uo(t),ro(),e!==null&&ae(ya);break;case 24:Zi(ca)}}function Uc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){$u(t,t.return,e)}}function Wc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){$u(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){$u(t,t.return,e)}}function Gc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Qa(t,n)}catch(t){$u(e,e.return,t)}}}function Kc(e,t,n){n.props=qs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){$u(e,t,n)}}function qc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){$u(e,t,n)}}function Jc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){$u(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){$u(e,t,n)}else n.current=null}function Yc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){$u(e,e.return,t)}}function Xc(e,t,n){try{var r=e.stateNode;Kd(r,e.type,n,t),r[st]=t}catch(t){$u(e,e.return,t)}}function Zc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lf(e.type)||e.tag===4}function Qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Zc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&lf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=$t));else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&lf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(el(e,t,n),e=e.sibling;e!==null;)el(e,t,n),e=e.sibling}function tl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Gd(t,r,n),t[ot]=e,t[st]=n}catch(t){$u(e,e.return,t)}}var nl=!1,rl=!1,il=!1,al=typeof WeakSet==`function`?WeakSet:Set,ol=null;function sl(e,t){if(e=e.containerInfo,Yd=vp,e=Dr(e),Or(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Xd={focusedElem:e,selectionRange:n},vp=!1,ol=t;ol!==null;)if(t=ol,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,ol=e;else for(;ol!==null;){switch(t=ol,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=qs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){$u(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ff(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ff(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,ol=e;break}ol=t.return}}function cl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Cl(e,n),r&4&&Uc(5,n);break;case 1:if(Cl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){$u(n,n.return,e)}else{var i=qs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){$u(n,n.return,e)}}r&64&&Gc(n),r&512&&qc(n,n.return);break;case 3:if(Cl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Qa(e,t)}catch(e){$u(n,n.return,e)}}break;case 27:t===null&&r&4&&tl(n);case 26:case 5:Cl(e,n),t===null&&r&4&&Yc(n),r&512&&qc(n,n.return);break;case 12:Cl(e,n);break;case 31:Cl(e,n),r&4&&ml(e,n);break;case 13:Cl(e,n),r&4&&hl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=rd.bind(null,n),vf(e,n))));break;case 22:if(r=n.memoizedState!==null||nl,!r){t=t!==null&&t.memoizedState!==null||rl,i=nl;var a=rl;nl=r,(rl=t)&&!a?Tl(e,n,(n.subtreeFlags&8772)!=0):Cl(e,n),nl=i,rl=a}break;case 30:break;default:Cl(e,n)}}function ll(e){var t=e.alternate;t!==null&&(e.alternate=null,ll(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&mt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var ul=null,dl=!1;function fl(e,t,n){for(n=n.child;n!==null;)pl(e,t,n),n=n.sibling}function pl(e,t,n){if(Fe&&typeof Fe.onCommitFiberUnmount==`function`)try{Fe.onCommitFiberUnmount(Pe,n)}catch{}switch(n.tag){case 26:rl||Jc(n,t),fl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:rl||Jc(n,t);var r=ul,i=dl;lf(n.type)&&(ul=n.stateNode,dl=!1),fl(e,t,n),wf(n.stateNode),ul=r,dl=i;break;case 5:rl||Jc(n,t);case 6:if(r=ul,i=dl,ul=null,fl(e,t,n),ul=r,dl=i,ul!==null)if(dl)try{(ul.nodeType===9?ul.body:ul.nodeName===`HTML`?ul.ownerDocument.body:ul).removeChild(n.stateNode)}catch(e){$u(n,t,e)}else try{ul.removeChild(n.stateNode)}catch(e){$u(n,t,e)}break;case 18:ul!==null&&(dl?(e=ul,uf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Wp(e)):uf(ul,n.stateNode));break;case 4:r=ul,i=dl,ul=n.stateNode.containerInfo,dl=!0,fl(e,t,n),ul=r,dl=i;break;case 0:case 11:case 14:case 15:Wc(2,n,t),rl||Wc(4,n,t),fl(e,t,n);break;case 1:rl||(Jc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Kc(n,t,r)),fl(e,t,n);break;case 21:fl(e,t,n);break;case 22:rl=(r=rl)||n.memoizedState!==null,fl(e,t,n),rl=r;break;default:fl(e,t,n)}}function ml(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wp(e)}catch(e){$u(t,t.return,e)}}}function hl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wp(e)}catch(e){$u(t,t.return,e)}}function gl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new al),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new al),t;default:throw Error(i(435,e.tag))}}function _l(e,t){var n=gl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=id.bind(null,e,t);t.then(r,r)}})}function vl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(lf(c.type)){ul=c.stateNode,dl=!1;break a}break;case 5:ul=c.stateNode,dl=!1;break a;case 3:case 4:ul=c.stateNode.containerInfo,dl=!0;break a}c=c.return}if(ul===null)throw Error(i(160));pl(o,s,a),ul=null,dl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)bl(t,e),t=t.sibling}var yl=null;function bl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:vl(t,e),xl(e),r&4&&(Wc(3,e,e.return),Uc(3,e),Wc(5,e,e.return));break;case 1:vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&64&&nl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=yl;if(vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[pt]||o[ot]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Gd(o,r,n),o[ot]=e,yt(o),r=o;break a;case`link`:var s=Qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Gd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[ot]=e,yt(o),r=o}e.stateNode=r}else $f(a,e.type,e.stateNode);else e.stateNode=qf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Xc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?$f(a,e.type,e.stateNode):qf(a,r,e.memoizedProps))}break;case 27:vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),n!==null&&r&4&&Xc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(vl(t,e),xl(e),r&512&&(rl||n===null||Jc(n,n.return)),e.flags&32){a=e.stateNode;try{Gt(a,``)}catch(t){$u(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Xc(e,a,n===null?a:n.memoizedProps)),r&1024&&(il=!0);break;case 6:if(vl(t,e),xl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){$u(e,e.return,t)}}break;case 3:if(Zf=null,a=yl,yl=Df(t.containerInfo),vl(t,e),yl=a,xl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Wp(t.containerInfo)}catch(t){$u(e,e.return,t)}il&&(il=!1,Sl(e));break;case 4:r=yl,yl=Df(e.stateNode.containerInfo),vl(t,e),xl(e),yl=r;break;case 12:vl(t,e),xl(e);break;case 31:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 13:vl(t,e),xl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(su=Te()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=nl,d=rl;if(nl=u||a,rl=d||l,vl(t,e),rl=d,nl=u,xl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||nl||rl||wl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){$u(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){$u(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?df(m,!0):df(l.stateNode,!1)}catch(e){$u(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,_l(e,n))));break;case 19:vl(t,e),xl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,_l(e,r)));break;case 30:break;case 21:break;default:vl(t,e),xl(e)}}function xl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Zc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;el(e,Qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Gt(o,``),n.flags&=-33),el(e,Qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;$c(e,Qc(e),s);break;default:throw Error(i(161))}}catch(t){$u(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Sl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Sl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Cl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)cl(e,t.alternate,t),t=t.sibling}function wl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Wc(4,t,t.return),wl(t);break;case 1:Jc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Kc(t,t.return,n),wl(t);break;case 27:wf(t.stateNode);case 26:case 5:Jc(t,t.return),wl(t);break;case 22:t.memoizedState===null&&wl(t);break;case 30:wl(t);break;default:wl(t)}e=e.sibling}}function Tl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Tl(i,a,n),Uc(4,a);break;case 1:if(Tl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){$u(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Za(c[i],s)}catch(e){$u(r,r.return,e)}}n&&o&64&&Gc(a),qc(a,a.return);break;case 27:tl(a);case 26:case 5:Tl(i,a,n),n&&r===null&&o&4&&Yc(a),qc(a,a.return);break;case 12:Tl(i,a,n);break;case 31:Tl(i,a,n),n&&o&4&&ml(i,a);break;case 13:Tl(i,a,n),n&&o&4&&hl(i,a);break;case 22:a.memoizedState===null&&Tl(i,a,n),qc(a,a.return);break;case 30:break;default:Tl(i,a,n)}t=t.sibling}}function El(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ua(n))}function Dl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e))}function Ol(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kl(e,t,n,r),t=t.sibling}function kl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Ol(e,t,n,r),i&2048&&Uc(9,t);break;case 1:Ol(e,t,n,r);break;case 3:Ol(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ua(e)));break;case 12:if(i&2048){Ol(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){$u(t,t.return,e)}}else Ol(e,t,n,r);break;case 31:Ol(e,t,n,r);break;case 13:Ol(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Ol(e,t,n,r):(a._visibility|=2,Al(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Ol(e,t,n,r):jl(e,t),i&2048&&El(o,t);break;case 24:Ol(e,t,n,r),i&2048&&Dl(t.alternate,t);break;default:Ol(e,t,n,r)}}function Al(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Al(a,o,s,c,i),Uc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Al(a,o,s,c,i)):u._visibility&2?Al(a,o,s,c,i):jl(a,o),i&&l&2048&&El(o.alternate,o);break;case 24:Al(a,o,s,c,i),i&&l&2048&&Dl(o.alternate,o);break;default:Al(a,o,s,c,i)}t=t.sibling}}function jl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:jl(n,r),i&2048&&El(r.alternate,r);break;case 24:jl(n,r),i&2048&&Dl(r.alternate,r);break;default:jl(n,r)}t=t.sibling}}var Ml=8192;function Nl(e,t,n){if(e.subtreeFlags&Ml)for(e=e.child;e!==null;)Pl(e,t,n),e=e.sibling}function Pl(e,t,n){switch(e.tag){case 26:Nl(e,t,n),e.flags&Ml&&e.memoizedState!==null&&np(n,yl,e.memoizedState,e.memoizedProps);break;case 5:Nl(e,t,n);break;case 3:case 4:var r=yl;yl=Df(e.stateNode.containerInfo),Nl(e,t,n),yl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ml,Ml=16777216,Nl(e,t,n),Ml=r):Nl(e,t,n));break;default:Nl(e,t,n)}}function Fl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Il(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,zl(r,e)}Fl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ll(e),e=e.sibling}function Ll(e){switch(e.tag){case 0:case 11:case 15:Il(e),e.flags&2048&&Wc(9,e,e.return);break;case 3:Il(e);break;case 12:Il(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Rl(e)):Il(e);break;default:Il(e)}}function Rl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];ol=r,zl(r,e)}Fl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Wc(8,t,t.return),Rl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Rl(t));break;default:Rl(t)}e=e.sibling}}function zl(e,t){for(;ol!==null;){var n=ol;switch(n.tag){case 0:case 11:case 15:Wc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,ol=r;else a:for(n=e;ol!==null;){r=ol;var i=r.sibling,a=r.return;if(ll(r),r===n){ol=null;break a}if(i!==null){i.return=a,ol=i;break a}ol=a}}}var Bl={getCacheForType:function(e){var t=ra(ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ra(ca).controller.signal}},Vl=typeof WeakMap==`function`?WeakMap:Map,Hl=0,Ul=null,Wl=null,Gl=0,Kl=0,ql=null,Jl=!1,Yl=!1,Xl=!1,Zl=0,Ql=0,$l=0,eu=0,tu=0,nu=0,ru=0,iu=null,au=null,ou=!1,su=0,cu=0,lu=1/0,uu=null,du=null,fu=0,pu=null,mu=null,hu=0,gu=0,_u=null,vu=null,yu=0,bu=null;function xu(){return Hl&2&&Gl!==0?Gl&-Gl:j.T===null?rt():bd()}function Su(){if(nu===0)if(!(Gl&536870912)||Ii){var e=He;He<<=1,!(He&3932160)&&(He=262144),nu=e}else nu=536870912;return e=io.current,e!==null&&(e.flags|=32),nu}function Cu(e,t,n){(e===Ul&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)&&(Au(e,0),Du(e,Gl,nu,!1)),Xe(e,n),(!(Hl&2)||e!==Ul)&&(e===Ul&&(!(Hl&2)&&(eu|=n),Ql===4&&Du(e,Gl,nu,!1)),fd(e))}function wu(e,t,n){if(Hl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ke(e,t),a=r?Ru(e,t):Iu(e,t,!0),o=r;do{if(a===0){Yl&&!r&&Du(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Eu(n)){a=Iu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=iu;var l=c.current.memoizedState.isDehydrated;if(l&&(Au(c,s).flags|=256),s=Iu(c,s,!1),s!==2){if(Xl&&!l){c.errorRecoveryDisabledLanes|=o,eu|=o,a=4;break a}o=au,au=a,o!==null&&(au===null?au=o:au.push.apply(au,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Au(e,0),Du(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Du(r,t,nu,!Jl);break a;case 2:au=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=su+300-Te(),10<a)){if(Du(r,t,nu,!Jl),Ge(r,0,!0)!==0)break a;hu=t,r.timeoutHandle=rf(Tu.bind(null,r,n,au,uu,ou,t,nu,eu,ru,Jl,o,`Throttled`,-0,0),a);break a}Tu(r,n,au,uu,ou,t,nu,eu,ru,Jl,o,null,-0,0)}}break}while(1);fd(e)}function Tu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$t},Pl(t,a,d);var m=(a&62914560)===a?su-Te():(a&4194048)===a?cu-Te():0;if(m=ip(d,m),m!==null){hu=a,e.cancelPendingCommit=m(Gu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Du(e,a,o,!l);return}}Gu(e,t,a,n,r,i,o,s,c)}function Eu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Sr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Du(e,t,n,r){t&=~tu,t&=~eu,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Le(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Qe(e,n,t)}function Ou(){return Hl&6?!0:(pd(0,!1),!1)}function ku(){if(Wl!==null){if(Kl===0)var e=Wl.return;else e=Wl,Yi=Ji=null,Ao(e),Na=null,Pa=0,e=Wl;for(;e!==null;)Hc(e.alternate,e),e=e.return;Wl=null}}function Au(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,af(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),hu=0,ku(),Ul=e,Wl=n=di(e.current,null),Gl=t,Kl=0,ql=null,Jl=!1,Yl=Ke(e,t),Xl=!1,ru=nu=tu=eu=$l=Ql=0,au=iu=null,ou=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Le(r),a=1<<i;t|=e[i],r&=~a}return Zl=t,ei(),n}function ju(e,t){B=null,j.H=zs,t===Ca||t===Ta?(t=ja(),Kl=3):t===wa?(t=ja(),Kl=4):Kl=t===rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ql=t,Wl===null&&(Ql=1,Zs(e,yi(t,e.current)))}function Mu(){var e=io.current;return e===null?!0:(Gl&4194048)===Gl?ao===null:(Gl&62914560)===Gl||Gl&536870912?e===ao:!1}function Nu(){var e=j.H;return j.H=zs,e===null?zs:e}function Pu(){var e=j.A;return j.A=Bl,e}function Fu(){Ql=4,Jl||(Gl&4194048)!==Gl&&io.current!==null||(Yl=!0),!($l&134217727)&&!(eu&134217727)||Ul===null||Du(Ul,Gl,nu,!1)}function Iu(e,t,n){var r=Hl;Hl|=2;var i=Nu(),a=Pu();(Ul!==e||Gl!==t)&&(uu=null,Au(e,t)),t=!1;var o=Ql;a:do try{if(Kl!==0&&Wl!==null){var s=Wl,c=ql;switch(Kl){case 8:ku(),o=6;break a;case 3:case 2:case 9:case 6:io.current===null&&(t=!0);var l=Kl;if(Kl=0,ql=null,Hu(e,s,c,l),n&&Yl){o=0;break a}break;default:l=Kl,Kl=0,ql=null,Hu(e,s,c,l)}}Lu(),o=Ql;break}catch(t){ju(e,t)}while(1);return t&&e.shellSuspendCounter++,Yi=Ji=null,Hl=r,j.H=i,j.A=a,Wl===null&&(Ul=null,Gl=0,ei()),o}function Lu(){for(;Wl!==null;)Bu(Wl)}function Ru(e,t){var n=Hl;Hl|=2;var r=Nu(),a=Pu();Ul!==e||Gl!==t?(uu=null,lu=Te()+500,Au(e,t)):Yl=Ke(e,t);a:do try{if(Kl!==0&&Wl!==null){t=Wl;var o=ql;b:switch(Kl){case 1:Kl=0,ql=null,Hu(e,t,o,1);break;case 2:case 9:if(Da(o)){Kl=0,ql=null,Vu(t);break}t=function(){Kl!==2&&Kl!==9||Ul!==e||(Kl=7),fd(e)},o.then(t,t);break a;case 3:Kl=7;break a;case 4:Kl=5;break a;case 7:Da(o)?(Kl=0,ql=null,Vu(t)):(Kl=0,ql=null,Hu(e,t,o,7));break;case 5:var s=null;switch(Wl.tag){case 26:s=Wl.memoizedState;case 5:case 27:var c=Wl;if(s?tp(s):c.stateNode.complete){Kl=0,ql=null;var l=c.sibling;if(l!==null)Wl=l;else{var u=c.return;u===null?Wl=null:(Wl=u,Uu(u))}break b}}Kl=0,ql=null,Hu(e,t,o,5);break;case 6:Kl=0,ql=null,Hu(e,t,o,6);break;case 8:ku(),Ql=6;break a;default:throw Error(i(462))}}zu();break}catch(t){ju(e,t)}while(1);return Yi=Ji=null,j.H=r,j.A=a,Hl=n,Wl===null?(Ul=null,Gl=0,ei(),Ql):0}function zu(){for(;Wl!==null&&!Ce();)Bu(Wl)}function Bu(e){var t=Nc(e.alternate,e,Zl);e.memoizedProps=e.pendingProps,t===null?Uu(e):Wl=t}function Vu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=_c(n,t,t.pendingProps,t.type,void 0,Gl);break;case 11:t=_c(n,t,t.pendingProps,t.type.render,t.ref,Gl);break;case 5:Ao(t);default:Hc(n,t),t=Wl=fi(t,Zl),t=Nc(n,t,Zl)}e.memoizedProps=e.pendingProps,t===null?Uu(e):Wl=t}function Hu(e,t,n,r){Yi=Ji=null,Ao(t),Na=null,Pa=0;var i=t.return;try{if(nc(e,i,t,n,Gl)){Ql=1,Zs(e,yi(n,e.current)),Wl=null;return}}catch(t){if(i!==null)throw Wl=i,t;Ql=1,Zs(e,yi(n,e.current)),Wl=null;return}t.flags&32768?(Ii||r===1?e=!0:Yl||Gl&536870912?e=!1:(Jl=e=!0,(r===2||r===9||r===3||r===6)&&(r=io.current,r!==null&&r.tag===13&&(r.flags|=16384))),Wu(t,e)):Uu(t)}function Uu(e){var t=e;do{if(t.flags&32768){Wu(t,Jl);return}e=t.return;var n=Bc(t.alternate,t,Zl);if(n!==null){Wl=n;return}if(t=t.sibling,t!==null){Wl=t;return}Wl=t=e}while(t!==null);Ql===0&&(Ql=5)}function Wu(e,t){do{var n=Vc(e.alternate,e);if(n!==null){n.flags&=32767,Wl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Wl=e;return}Wl=e=n}while(e!==null);Ql=6,Wl=null}function Gu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Xu();while(fu!==0);if(Hl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=$r,Ze(e,n,o,s,c,l),e===Ul&&(Wl=Ul=null,Gl=0),mu=t,pu=e,hu=n,gu=o,_u=a,vu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ad(ke,function(){return Zu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=j.T,j.T=null,a=M.p,M.p=2,s=Hl,Hl|=4;try{sl(e,t,n)}finally{Hl=s,M.p=a,j.T=r}}fu=1,Ku(),qu(),Ju()}}function Ku(){if(fu===1){fu=0;var e=pu,t=mu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Hl;Hl|=4;try{bl(t,e);var a=Xd,o=Dr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Er(s.ownerDocument.documentElement,s)){if(c!==null&&Or(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Tr(s,h),v=Tr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}vp=!!Yd,Xd=Yd=null}finally{Hl=i,M.p=r,j.T=n}}e.current=t,fu=2}}function qu(){if(fu===2){fu=0;var e=pu,t=mu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=j.T,j.T=null;var r=M.p;M.p=2;var i=Hl;Hl|=4;try{cl(e,t.alternate,t)}finally{Hl=i,M.p=r,j.T=n}}fu=3}}function Ju(){if(fu===4||fu===3){fu=0,we();var e=pu,t=mu,n=hu,r=vu;t.subtreeFlags&10256||t.flags&10256?fu=5:(fu=0,mu=pu=null,Yu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(du=null),nt(n),t=t.stateNode,Fe&&typeof Fe.onCommitFiberRoot==`function`)try{Fe.onCommitFiberRoot(Pe,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=j.T,i=M.p,M.p=2,j.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{j.T=t,M.p=i}}hu&3&&Xu(),fd(e),i=e.pendingLanes,n&261930&&i&42?e===bu?yu++:(yu=0,bu=e):yu=0,pd(0,!1)}}function Yu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ua(t)))}function Xu(){return Ku(),qu(),Ju(),Zu()}function Zu(){if(fu!==5)return!1;var e=pu,t=gu;gu=0;var n=nt(hu),r=j.T,a=M.p;try{M.p=32>n?32:n,j.T=null,n=_u,_u=null;var o=pu,s=hu;if(fu=0,mu=pu=null,hu=0,Hl&6)throw Error(i(331));var c=Hl;if(Hl|=4,Ll(o.current),kl(o,o.current,s,n),Hl=c,pd(0,!1),Fe&&typeof Fe.onPostCommitFiberRoot==`function`)try{Fe.onPostCommitFiberRoot(Pe,o)}catch{}return!0}finally{M.p=a,j.T=r,Yu(e,t)}}function Qu(e,t,n){t=yi(n,t),t=$s(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Xe(e,2),fd(e))}function $u(e,t,n){if(e.tag===3)Qu(e,e,n);else for(;t!==null;){if(t.tag===3){Qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(du===null||!du.has(r))){e=yi(n,e),n=ec(2),r=Ga(t,n,2),r!==null&&(tc(n,r,t,e),Xe(r,2),fd(r));break}}t=t.return}}function ed(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Vl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Xl=!0,i.add(n),e=td.bind(null,e,t,n),t.then(e,e))}function td(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ul===e&&(Gl&n)===n&&(Ql===4||Ql===3&&(Gl&62914560)===Gl&&300>Te()-su?!(Hl&2)&&Au(e,0):tu|=n,ru===Gl&&(ru=0)),fd(e)}function nd(e,t){t===0&&(t=Je()),e=ri(e,t),e!==null&&(Xe(e,t),fd(e))}function rd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nd(e,n)}function id(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),nd(e,n)}function ad(e,t){return xe(e,t)}var od=null,sd=null,cd=!1,ld=!1,ud=!1,dd=0;function fd(e){e!==sd&&e.next===null&&(sd===null?od=sd=e:sd=sd.next=e),ld=!0,cd||(cd=!0,yd())}function pd(e,t){if(!ud&&ld){ud=!0;do for(var n=!1,r=od;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Le(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,vd(r,a))}else a=Gl,a=Ge(r,r===Ul?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ke(r,a)||(n=!0,vd(r,a));r=r.next}while(n);ud=!1}}function md(){hd()}function hd(){ld=cd=!1;var e=0;dd!==0&&nf()&&(e=dd);for(var t=Te(),n=null,r=od;r!==null;){var i=r.next,a=gd(r,t);a===0?(r.next=null,n===null?od=i:n.next=i,i===null&&(sd=n)):(n=r,(e!==0||a&3)&&(ld=!0)),r=i}fu!==0&&fu!==5||pd(e,!1),dd!==0&&(dd=0)}function gd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Le(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=qe(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ul,n=Gl,n=Ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Kl===2||Kl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Se(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ke(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Se(r),nt(n)){case 2:case 8:n=Oe;break;case 32:n=ke;break;case 268435456:n=je;break;default:n=ke}return r=_d.bind(null,e),n=xe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Se(r),e.callbackPriority=2,e.callbackNode=null,2}function _d(e,t){if(fu!==0&&fu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Xu()&&e.callbackNode!==n)return null;var r=Gl;return r=Ge(e,e===Ul?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wu(e,r,t),gd(e,Te()),e.callbackNode!=null&&e.callbackNode===n?_d.bind(null,e):null)}function vd(e,t){if(Xu())return null;wu(e,t,!0)}function yd(){sf(function(){Hl&6?xe(De,md):hd()})}function bd(){if(dd===0){var e=pa;e===0&&(e=Ve,Ve<<=1,!(Ve&261888)&&(Ve=256)),dd=e}return dd}function xd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Qt(``+e)}function Sd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Cd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=xd((i[st]||null).action),o=r.submitter;o&&(t=(t=o[st]||null)?xd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new xn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dd!==0){var e=o?Sd(i,o):new FormData(i);Ts(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?Sd(i,o):new FormData(i),Ts(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var wd=0;wd<Jr.length;wd++){var Td=Jr[wd];Yr(Td.toLowerCase(),`on`+(Td[0].toUpperCase()+Td.slice(1)))}Yr(Br,`onAnimationEnd`),Yr(Vr,`onAnimationIteration`),Yr(Hr,`onAnimationStart`),Yr(`dblclick`,`onDoubleClick`),Yr(`focusin`,`onFocus`),Yr(`focusout`,`onBlur`),Yr(Ur,`onTransitionRun`),Yr(Wr,`onTransitionStart`),Yr(Gr,`onTransitionCancel`),Yr(Kr,`onTransitionEnd`),Ct(`onMouseEnter`,[`mouseout`,`mouseover`]),Ct(`onMouseLeave`,[`mouseout`,`mouseover`]),Ct(`onPointerEnter`,[`pointerout`,`pointerover`]),Ct(`onPointerLeave`,[`pointerout`,`pointerover`]),St(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),St(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),St(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),St(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),St(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Ed=`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(` `),Dd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Ed));function Od(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Xr(e)}i.currentTarget=null,a=c}}}}function kd(e,t){var n=t[lt];n===void 0&&(n=t[lt]=new Set);var r=e+`__bubble`;n.has(r)||(Nd(t,e,2,!1),n.add(r))}function Ad(e,t,n){var r=0;t&&(r|=4),Nd(n,e,r,t)}var jd=`_reactListening`+Math.random().toString(36).slice(2);function Md(e){if(!e[jd]){e[jd]=!0,bt.forEach(function(t){t!==`selectionchange`&&(Dd.has(t)||Ad(t,!1,e),Ad(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[jd]||(t[jd]=!0,Ad(`selectionchange`,!1,t))}}function Nd(e,t,n,r){switch(Tp(t)){case 2:var i=yp;break;case 8:i=bp;break;default:i=xp}n=i.bind(null,t,n,e),i=void 0,!un||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Pd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ht(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}sn(function(){var r=a,i=tn(n),s=[];a:{var c=qr.get(e);if(c!==void 0){var l=xn,u=e;switch(e){case`keypress`:if(gn(n)===0)break a;case`keydown`:case`keyup`:l=I;break;case`focusin`:u=`focus`,l=An;break;case`focusout`:u=`blur`,l=An;break;case`beforeblur`:case`afterblur`:l=An;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=On;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=kn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Vn;break;case Br:case Vr:case Hr:l=jn;break;case Kr:l=Hn;break;case`scroll`:case`scrollend`:l=Cn;break;case`wheel`:l=Un;break;case`copy`:case`cut`:case`paste`:l=Mn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Bn;break;case`toggle`:case`beforetoggle`:l=L}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=cn(m,p),g!=null&&d.push(Fd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==en&&(u=n.relatedTarget||n.fromElement)&&(ht(u)||u[ct]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ht(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=On,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Bn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:_t(l),h=u==null?c:_t(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ht(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ld,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Rd(s,c,l,d,!1),u!==null&&f!==null&&Rd(s,f,u,d,!0)}}a:{if(c=r?_t(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=lr;else if(rr(c))if(ur)v=br;else{v=_r;var y=gr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Yt(r.elementType)&&(v=lr):v=yr;if(v&&=v(e,r)){ir(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Vt(c,`number`,c.value)}switch(y=r?_t(r):window,e){case`focusin`:(rr(y)||y.contentEditable===`true`)&&(Ar=y,jr=r,Mr=null);break;case`focusout`:Mr=jr=Ar=null;break;case`mousedown`:Nr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Nr=!1,Pr(s,n,i);break;case`selectionchange`:if(kr)break;case`keydown`:case`keyup`:Pr(s,n,i)}var b;if(Gn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else $n?Zn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Jn&&n.locale!==`ko`&&($n||x!==`onCompositionStart`?x===`onCompositionEnd`&&$n&&(b=hn()):(fn=i,pn=`value`in fn?fn.value:fn.textContent,$n=!0)),y=Id(r,x),0<y.length&&(x=new Nn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Qn(n),b!==null&&(x.data=b)))),(b=qn?er(e,n):tr(e,n))&&(x=Id(r,`onBeforeInput`),0<x.length&&(y=new Nn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),Cd(s,e,r,n,i)}Od(s,t)})}function Fd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Id(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=cn(e,n),i!=null&&r.unshift(Fd(e,i,a)),i=cn(e,t),i!=null&&r.push(Fd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ld(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Rd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=cn(n,a),l!=null&&o.unshift(Fd(n,l,c))):i||(l=cn(n,a),l!=null&&o.push(Fd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var zd=/\r\n?/g,Bd=/\u0000|\uFFFD/g;function Vd(e){return(typeof e==`string`?e:``+e).replace(zd,`
|
|
9
|
-
`).replace(Bd,``)}function Hd(e,t){return t=Vd(t),Vd(e)===t}function Ud(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Gt(e,``+r);break;case`className`:kt(e,`class`,r);break;case`tabIndex`:kt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:kt(e,n,r);break;case`style`:Jt(e,r,o);break;case`data`:if(t!==`object`){kt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Ud(e,t,`name`,a.name,a,null),Ud(e,t,`formEncType`,a.formEncType,a,null),Ud(e,t,`formMethod`,a.formMethod,a,null),Ud(e,t,`formTarget`,a.formTarget,a,null)):(Ud(e,t,`encType`,a.encType,a,null),Ud(e,t,`method`,a.method,a,null),Ud(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Qt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Qt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:kd(`beforetoggle`,e),kd(`toggle`,e),Ot(e,`popover`,r);break;case`xlinkActuate`:At(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:At(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:At(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:At(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:At(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:At(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Ot(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Xt.get(n)||n,Ot(e,n,r))}}function Wd(e,t,n,r,a,o){switch(n){case`style`:Jt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Gt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Gt(e,``+r);break;case`onScroll`:r!=null&&kd(`scroll`,e);break;case`onScrollEnd`:r!=null&&kd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=$t);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!xt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[st]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Ot(e,n,r)}}}function Gd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:kd(`error`,e),kd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ud(e,t,o,s,n,null)}}a&&Ud(e,t,`srcSet`,n.srcSet,n,null),r&&Ud(e,t,`src`,n.src,n,null);return;case`input`:kd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Ud(e,t,r,d,n,null)}}Bt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in kd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Ud(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ht(e,!!r,n,!0):Ht(e,!!r,t,!1);return;case`textarea`:for(s in kd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Ud(e,t,s,c,n,null)}Wt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Ud(e,t,l,r,n,null)}return;case`dialog`:kd(`beforetoggle`,e),kd(`toggle`,e),kd(`cancel`,e),kd(`close`,e);break;case`iframe`:case`object`:kd(`load`,e);break;case`video`:case`audio`:for(r=0;r<Ed.length;r++)kd(Ed[r],e);break;case`image`:kd(`error`,e),kd(`load`,e);break;case`details`:kd(`toggle`,e);break;case`embed`:case`source`:case`link`:kd(`error`,e),kd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Ud(e,t,u,r,n,null)}return;default:if(Yt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Wd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Ud(e,t,c,r,n,null))}function Kd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Ud(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Ud(e,t,p,m,r,f)}}zt(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Ud(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Ud(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ht(e,!!n,n?[]:``,!1):Ht(e,!!n,t,!0)):Ht(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Ud(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Ud(e,t,s,a,r,o)}Ut(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Ud(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Ud(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Ud(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Ud(e,t,u,p,r,m)}return;default:if(Yt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Wd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Wd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Ud(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Ud(e,t,f,p,r,m)}function qd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Jd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&qd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&qd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Yd=null,Xd=null;function Zd(e){return e.nodeType===9?e:e.ownerDocument}function Qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function $d(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function ef(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var tf=null;function nf(){var e=window.event;return e&&e.type===`popstate`?e===tf?!1:(tf=e,!0):(tf=null,!1)}var rf=typeof setTimeout==`function`?setTimeout:void 0,af=typeof clearTimeout==`function`?clearTimeout:void 0,of=typeof Promise==`function`?Promise:void 0,sf=typeof queueMicrotask==`function`?queueMicrotask:of===void 0?rf:function(e){return of.resolve(null).then(e).catch(cf)};function cf(e){setTimeout(function(){throw e})}function lf(e){return e===`head`}function uf(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Wp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)wf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,wf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&wf(e.ownerDocument.body);n=i}while(n);Wp(t)}function df(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ff(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ff(n),mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(r){if(!e[pt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}}else if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;if(e=yf(e.nextSibling),e===null)break}return null}function mf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=yf(e.nextSibling),e===null))return null;return e}function hf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=yf(e.nextSibling),e===null))return null;return e}function gf(e){return e.data===`$?`||e.data===`$~`}function _f(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function yf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var bf=null;function xf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return yf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Cf(e,t,n){switch(t=Zd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function wf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);mt(e)}var Tf=new Map,Ef=new Set;function Df(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Of=M.d;M.d={f:kf,r:Af,D:Nf,C:Pf,L:Ff,m:If,X:Rf,S:Lf,M:zf};function kf(){var e=Of.f(),t=Ou();return e||t}function Af(e){var t=gt(e);t!==null&&t.tag===5&&t.type===`form`?Ds(t):Of.r(e)}var jf=typeof document>`u`?null:document;function Mf(e,t,n){var r=jf;if(r&&typeof t==`string`&&t){var i=Rt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ef.has(i)||(Ef.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Gd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function Nf(e){Of.D(e),Mf(`dns-prefetch`,e,null)}function Pf(e,t){Of.C(e,t),Mf(`preconnect`,e,t)}function Ff(e,t,n){Of.L(e,t,n);var r=jf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Rt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Rt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Rt(n.imageSizes)+`"]`)):i+=`[href="`+Rt(e)+`"]`;var a=i;switch(t){case`style`:a=Vf(e);break;case`script`:a=Gf(e)}Tf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Tf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Hf(a))||t===`script`&&r.querySelector(Kf(a))||(t=r.createElement(`link`),Gd(t,`link`,e),yt(t),r.head.appendChild(t)))}}function If(e,t){Of.m(e,t);var n=jf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Rt(r)+`"][href="`+Rt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Gf(e)}if(!Tf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),Tf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Kf(a)))return}r=n.createElement(`link`),Gd(r,`link`,e),yt(r),n.head.appendChild(r)}}}function Lf(e,t,n){Of.S(e,t,n);var r=jf;if(r&&e){var i=vt(r).hoistableStyles,a=Vf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Hf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Tf.get(a))&&Yf(e,n);var c=o=r.createElement(`link`);yt(c),Gd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Jf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Rf(e,t){Of.X(e,t);var n=jf;if(n&&e){var r=vt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=f({src:e,async:!0},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),yt(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zf(e,t){Of.M(e,t);var n=jf;if(n&&e){var r=vt(n).hoistableScripts,i=Gf(e),a=r.get(i);a||(a=n.querySelector(Kf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=Tf.get(i))&&Xf(e,t),a=n.createElement(`script`),yt(a),Gd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Bf(e,t,n,r){var a=(a=se.current)?Df(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Vf(n.href),n=vt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Vf(n.href);var o=vt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Hf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Tf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Tf.set(e,n),o||Wf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Gf(n),n=vt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Vf(e){return`href="`+Rt(e)+`"`}function Hf(e){return`link[rel="stylesheet"][`+e+`]`}function Uf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function Wf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Gd(t,`link`,n),yt(t),e.head.appendChild(t))}function Gf(e){return`[src="`+Rt(e)+`"]`}function Kf(e){return`script[async]`+e}function qf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Rt(n.href)+`"]`);if(r)return t.instance=r,yt(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),yt(r),Gd(r,`style`,a),Jf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Vf(n.href);var o=e.querySelector(Hf(a));if(o)return t.state.loading|=4,t.instance=o,yt(o),o;r=Uf(n),(a=Tf.get(a))&&Yf(r,a),o=(e.ownerDocument||e).createElement(`link`),yt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Gd(o,`link`,r),t.state.loading|=4,Jf(o,n.precedence,e),t.instance=o;case`script`:return o=Gf(n.src),(a=e.querySelector(Kf(o)))?(t.instance=a,yt(a),a):(r=n,(a=Tf.get(o))&&(r=f({},n),Xf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),yt(a),Gd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Jf(r,n.precedence,e));return t.instance}function Jf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Yf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Xf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Zf=null;function Qf(e,t,n){if(Zf===null){var r=new Map,i=Zf=new Map;i.set(n,r)}else i=Zf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[pt]||a[ot]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function $f(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function ep(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function tp(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function np(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Vf(r.href),a=t.querySelector(Hf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ap.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,yt(a);return}a=t.ownerDocument||t,r=Uf(r),(i=Tf.get(i))&&Yf(r,i),a=a.createElement(`link`),yt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Gd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ap.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var rp=0;function ip(e,t){return e.stylesheets&&e.count===0&&sp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&rp===0&&(rp=62500*Jd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>rp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ap(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var op=null;function sp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,op=new Map,t.forEach(cp,e),op=null,ap.call(e))}function cp(e,t){if(!(t.state.loading&4)){var n=op.get(e);if(n)var r=n.get(null);else{n=new Map,op.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ap.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var lp={$$typeof:b,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function up(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ye(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ye(0),this.hiddenUpdates=Ye(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function dp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new up(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=li(3,null,null,t),e.current=a,a.stateNode=e,t=la(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Ha(a),e}function fp(e){return e?(e=si,e):si}function pp(e,t,n,r,i,a){i=fp(i),r.context===null?r.context=i:r.pendingContext=i,r=Wa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ga(e,r,t),n!==null&&(Cu(n,e,t),Ka(n,e,t))}function mp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function hp(e,t){mp(e,t),(e=e.alternate)&&mp(e,t)}function gp(e){if(e.tag===13||e.tag===31){var t=ri(e,67108864);t!==null&&Cu(t,e,67108864),hp(e,67108864)}}function _p(e){if(e.tag===13||e.tag===31){var t=xu();t=tt(t);var n=ri(e,t);n!==null&&Cu(n,e,t),hp(e,t)}}var vp=!0;function yp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=2,xp(e,t,n,r)}finally{M.p=a,j.T=i}}function bp(e,t,n,r){var i=j.T;j.T=null;var a=M.p;try{M.p=8,xp(e,t,n,r)}finally{M.p=a,j.T=i}}function xp(e,t,n,r){if(vp){var i=Sp(r);if(i===null)Pd(e,t,r,Cp,n),Pp(e,r);else if(Ip(i,e,t,n,r))r.stopPropagation();else if(Pp(e,r),t&4&&-1<Np.indexOf(e)){for(;i!==null;){var a=gt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=We(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Le(o);s.entanglements[1]|=c,o&=~c}fd(a),!(Hl&6)&&(lu=Te()+500,pd(0,!1))}}break;case 31:case 13:s=ri(a,2),s!==null&&Cu(s,a,2),Ou(),hp(a,2)}if(a=Sp(r),a===null&&Pd(e,t,r,Cp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Pd(e,t,r,null,n)}}function Sp(e){return e=tn(e),wp(e)}var Cp=null;function wp(e){if(Cp=null,e=ht(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Cp=e,null}function Tp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ee()){case De:return 2;case Oe:return 8;case ke:case Ae:return 32;case je:return 268435456;default:return 32}default:return 32}}var Ep=!1,Dp=null,Op=null,kp=null,Ap=new Map,jp=new Map,Mp=[],Np=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Pp(e,t){switch(e){case`focusin`:case`focusout`:Dp=null;break;case`dragenter`:case`dragleave`:Op=null;break;case`mouseover`:case`mouseout`:kp=null;break;case`pointerover`:case`pointerout`:Ap.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:jp.delete(t.pointerId)}}function Fp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=gt(t),t!==null&&gp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ip(e,t,n,r,i){switch(t){case`focusin`:return Dp=Fp(Dp,e,t,n,r,i),!0;case`dragenter`:return Op=Fp(Op,e,t,n,r,i),!0;case`mouseover`:return kp=Fp(kp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ap.set(a,Fp(Ap.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,jp.set(a,Fp(jp.get(a)||null,e,t,n,r,i)),!0}return!1}function Lp(e){var t=ht(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,it(e.priority,function(){_p(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,it(e.priority,function(){_p(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Rp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);en=r,n.target.dispatchEvent(r),en=null}else return t=gt(n),t!==null&&gp(t),e.blockedOn=n,!1;t.shift()}return!0}function zp(e,t,n){Rp(e)&&n.delete(t)}function Bp(){Ep=!1,Dp!==null&&Rp(Dp)&&(Dp=null),Op!==null&&Rp(Op)&&(Op=null),kp!==null&&Rp(kp)&&(kp=null),Ap.forEach(zp),jp.forEach(zp)}function Vp(e,n){e.blockedOn===n&&(e.blockedOn=null,Ep||(Ep=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Bp)))}var Hp=null;function Up(e){Hp!==e&&(Hp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Hp===e&&(Hp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(wp(r||n)===null)continue;break}var a=gt(n);a!==null&&(e.splice(t,3),t-=3,Ts(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Wp(e){function t(t){return Vp(t,e)}Dp!==null&&Vp(Dp,e),Op!==null&&Vp(Op,e),kp!==null&&Vp(kp,e),Ap.forEach(t),jp.forEach(t);for(var n=0;n<Mp.length;n++){var r=Mp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Mp.length&&(n=Mp[0],n.blockedOn===null);)Lp(n),n.blockedOn===null&&Mp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[st]||null;if(typeof a==`function`)o||Up(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[st]||null)s=o.formAction;else if(wp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Up(n)}}}function Gp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Kp(e){this._internalRoot=e}qp.prototype.render=Kp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;pp(n,xu(),e,t,null,null)},qp.prototype.unmount=Kp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;pp(e.current,2,null,e,null,null),Ou(),t[ct]=null}};function qp(e){this._internalRoot=e}qp.prototype.unstable_scheduleHydration=function(e){if(e){var t=rt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Mp.length&&t!==0&&t<Mp[n].priority;n++);Mp.splice(n,0,e),n===0&&Lp(e)}};var Jp=n.version;if(Jp!==`19.2.4`)throw Error(i(527,Jp,`19.2.4`));M.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Yp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:j,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Xp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xp.isDisabled&&Xp.supportsFiber)try{Pe=Xp.inject(Yp),Fe=Xp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Js,s=Ys,c=Xs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=dp(e,1,!1,null,null,n,r,null,o,s,c,Gp),e[ct]=t.current,Md(e),new Kp(t)}})),si=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=oi()}))(),ci=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},li=[`light`,`dark`],ui=`(prefers-color-scheme: dark)`,di=typeof window>`u`,fi=I.createContext(void 0),pi={setTheme:e=>{},themes:[]},mi=()=>I.useContext(fi)??pi,hi=e=>I.useContext(fi)?I.createElement(I.Fragment,null,e.children):I.createElement(_i,{...e}),gi=[`light`,`dark`],_i=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:i=`theme`,themes:a=gi,defaultTheme:o=n?`system`:`light`,attribute:s=`data-theme`,value:c,children:l,nonce:u,scriptProps:d})=>{let[f,p]=I.useState(()=>yi(i,o)),[m,h]=I.useState(()=>f===`system`?xi():f),g=c?Object.values(c):a,_=I.useCallback(e=>{let i=e;if(!i)return;e===`system`&&n&&(i=xi());let a=c?c[i]:i,l=t?bi(u):null,d=document.documentElement,f=e=>{e===`class`?(d.classList.remove(...g),a&&d.classList.add(a)):e.startsWith(`data-`)&&(a?d.setAttribute(e,a):d.removeAttribute(e))};if(Array.isArray(s)?s.forEach(f):f(s),r){let e=li.includes(o)?o:null,t=li.includes(i)?i:e;d.style.colorScheme=t}l?.()},[u]),v=I.useCallback(e=>{let t=typeof e==`function`?e(f):e;p(t);try{localStorage.setItem(i,t)}catch{}},[f]),y=I.useCallback(t=>{h(xi(t)),f===`system`&&n&&!e&&_(`system`)},[f,e]);I.useEffect(()=>{let e=window.matchMedia(ui);return e.addListener(y),y(e),()=>e.removeListener(y)},[y]),I.useEffect(()=>{let e=e=>{e.key===i&&(e.newValue?p(e.newValue):v(o))};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[v]),I.useEffect(()=>{_(e??f)},[e,f]);let b=I.useMemo(()=>({theme:f,setTheme:v,forcedTheme:e,resolvedTheme:f===`system`?m:f,themes:n?[...a,`system`]:a,systemTheme:n?m:void 0}),[f,v,e,m,n,a]);return I.createElement(fi.Provider,{value:b},I.createElement(vi,{forcedTheme:e,storageKey:i,attribute:s,enableSystem:n,enableColorScheme:r,defaultTheme:o,value:c,themes:a,nonce:u,scriptProps:d}),l)},vi=I.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:l})=>{let u=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return I.createElement(`script`,{...l,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${ci.toString()})(${u})`}})}),yi=(e,t)=>{if(di)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},bi=e=>{let t=document.createElement(`style`);return e&&t.setAttribute(`nonce`,e),t.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}`)),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},xi=e=>(e||=window.matchMedia(ui),e.matches?`dark`:`light`);function Si({children:e,...t}){return(0,L.jsx)(hi,{...t,children:e})}var Ci=l(vr(),1);function wi(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Ti=e=>{switch(e){case`success`:return Oi;case`info`:return Ai;case`warning`:return ki;case`error`:return ji;default:return null}},Ei=Array(12).fill(0),Di=({visible:e,className:t})=>I.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},I.createElement(`div`,{className:`sonner-spinner`},Ei.map((e,t)=>I.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Oi=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),ki=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Ai=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),ji=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},I.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Mi=I.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},I.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),I.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Ni=()=>{let[e,t]=I.useState(document.hidden);return I.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Pi=1,Fi=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:Pi++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],I.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(Li(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!I.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Pi++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Ii=(e,t)=>{let n=t?.id||Pi++;return Fi.addToast({title:e,...t,id:n}),n},Li=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Ri=Ii,zi=Object.assign(Ri,{success:Fi.success,info:Fi.info,warning:Fi.warning,error:Fi.error,custom:Fi.custom,message:Fi.message,promise:Fi.promise,dismiss:Fi.dismiss,loading:Fi.loading},{getHistory:()=>Fi.toasts,getToasts:()=>Fi.getActiveToasts()});wi(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Bi(e){return e.label!==void 0}var Vi=3,Hi=`24px`,Ui=`16px`,Wi=4e3,Gi=356,Ki=14,qi=45,Ji=200;function Yi(...e){return e.filter(Boolean).join(` `)}function Xi(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Zi=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:_=``,descriptionClassName:v=``,duration:y,position:b,gap:x,expandByDefault:S,classNames:C,icons:w,closeButtonAriaLabel:T=`Close toast`}=e,[E,ee]=I.useState(null),[D,O]=I.useState(null),[k,te]=I.useState(!1),[A,j]=I.useState(!1),[M,ne]=I.useState(!1),[N,re]=I.useState(!1),[ie,ae]=I.useState(!1),[P,F]=I.useState(0),[oe,se]=I.useState(0),ce=I.useRef(n.duration||y||Wi),le=I.useRef(null),ue=I.useRef(null),de=c===0,fe=c+1<=o,pe=n.type,me=n.dismissible!==!1,he=n.className||``,ge=n.descriptionClassName||``,_e=I.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ve=I.useMemo(()=>n.closeButton??p,[n.closeButton,p]),ye=I.useMemo(()=>n.duration||y||Wi,[n.duration,y]),be=I.useRef(0),xe=I.useRef(0),Se=I.useRef(0),Ce=I.useRef(null),[we,Te]=b.split(`-`),Ee=I.useMemo(()=>s.reduce((e,t,n)=>n>=_e?e:e+t.height,0),[s,_e]),De=Ni(),Oe=n.invert||t,ke=pe===`loading`;xe.current=I.useMemo(()=>_e*x+Ee,[_e,Ee]),I.useEffect(()=>{ce.current=ye},[ye]),I.useEffect(()=>{te(!0)},[]),I.useEffect(()=>{let e=ue.current;if(e){let t=e.getBoundingClientRect().height;return se(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),I.useLayoutEffect(()=>{if(!k)return;let e=ue.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,se(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ae=I.useCallback(()=>{j(!0),F(xe.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Ji)},[n,d,a,xe]);I.useEffect(()=>{if(n.promise&&pe===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||De?(()=>{if(Se.current<be.current){let e=new Date().getTime()-be.current;ce.current-=e}Se.current=new Date().getTime()})():ce.current!==1/0&&(be.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ae()},ce.current)),()=>clearTimeout(e)},[u,i,n,pe,De,Ae]),I.useEffect(()=>{n.delete&&(Ae(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ae,n.delete]);function je(){return w?.loading?I.createElement(`div`,{className:Yi(C?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":pe===`loading`},w.loading):I.createElement(Di,{className:Yi(C?.loader,n?.classNames?.loader),visible:pe===`loading`})}let Me=n.icon||w?.[pe]||Ti(pe);return I.createElement(`li`,{tabIndex:0,ref:ue,className:Yi(_,he,C?.toast,n?.classNames?.toast,C?.default,C?.[pe],n?.classNames?.[pe]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":ie,"data-removed":A,"data-visible":fe,"data-y-position":we,"data-x-position":Te,"data-index":c,"data-front":de,"data-swiping":M,"data-dismissible":me,"data-type":pe,"data-invert":Oe,"data-swipe-out":N,"data-swipe-direction":D,"data-expanded":!!(u||S&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${A?P:xe.current}px`,"--initial-height":S?`auto`:`${oe}px`,...m,...n.style},onDragEnd:()=>{ne(!1),ee(null),Ce.current=null},onPointerDown:e=>{e.button!==2&&(ke||!me||(le.current=new Date,F(xe.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(ne(!0),Ce.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(N||!me)return;Ce.current=null;let e=Number(ue.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ue.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-le.current?.getTime(),i=E===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=qi||a>.11){F(xe.current),n.onDismiss==null||n.onDismiss.call(n,n),O(E===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ae(),re(!0);return}else{var o,s;(o=ue.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ue.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}ae(!1),ne(!1),ee(null)},onPointerMove:t=>{var n,r;if(!Ce.current||!me||window.getSelection()?.toString().length>0)return;let i=t.clientY-Ce.current.y,a=t.clientX-Ce.current.x,o=e.swipeDirections??Xi(b);!E&&(Math.abs(a)>1||Math.abs(i)>1)&&ee(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(E===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(E===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&ae(!0),(n=ue.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ue.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ve&&!n.jsx&&pe!==`loading`?I.createElement(`button`,{"aria-label":T,"data-disabled":ke,"data-close-button":!0,onClick:ke||!me?()=>{}:()=>{Ae(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Yi(C?.closeButton,n?.classNames?.closeButton)},w?.close??Mi):null,(pe||n.icon||n.promise)&&n.icon!==null&&(w?.[pe]!==null||n.icon)?I.createElement(`div`,{"data-icon":``,className:Yi(C?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||je():null,n.type===`loading`?null:Me):null,I.createElement(`div`,{"data-content":``,className:Yi(C?.content,n?.classNames?.content)},I.createElement(`div`,{"data-title":``,className:Yi(C?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?I.createElement(`div`,{"data-description":``,className:Yi(v,ge,C?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),I.isValidElement(n.cancel)?n.cancel:n.cancel&&Bi(n.cancel)?I.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Bi(n.cancel)&&me&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ae())},className:Yi(C?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,I.isValidElement(n.action)?n.action:n.action&&Bi(n.action)?I.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Bi(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ae())},className:Yi(C?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Qi(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function $i(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ui:Hi;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var ea=I.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Vi,toastOptions:g,dir:_=Qi(),gap:v=Ki,icons:y,containerAriaLabel:b=`Notifications`}=e,[x,S]=I.useState([]),C=I.useMemo(()=>n?x.filter(e=>e.toasterId===n):x.filter(e=>!e.toasterId),[x,n]),w=I.useMemo(()=>Array.from(new Set([i].concat(C.filter(e=>e.position).map(e=>e.position)))),[C,i]),[T,E]=I.useState([]),[ee,D]=I.useState(!1),[O,k]=I.useState(!1),[te,A]=I.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),j=I.useRef(null),M=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ne=I.useRef(null),N=I.useRef(!1),re=I.useCallback(e=>{S(t=>(t.find(t=>t.id===e.id)?.delete||Fi.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return I.useEffect(()=>Fi.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{S(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{Ci.flushSync(()=>{S(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[x]),I.useEffect(()=>{if(d!==`system`){A(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?A(`dark`):A(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{A(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{A(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),I.useEffect(()=>{x.length<=1&&D(!1)},[x]),I.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;D(!0),(t=j.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===j.current||j.current?.contains(document.activeElement))&&D(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),I.useEffect(()=>{if(j.current)return()=>{ne.current&&(ne.current.focus({preventScroll:!0}),ne.current=null,N.current=!1)}},[j.current]),I.createElement(`section`,{ref:t,"aria-label":`${b} ${M}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},w.map((t,n)=>{let[i,a]=t.split(`-`);return C.length?I.createElement(`ol`,{key:t,dir:_===`auto`?Qi():_,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":te,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${T[0]?.height||0}px`,"--width":`${Gi}px`,"--gap":`${v}px`,...m,...$i(l,u)},onBlur:e=>{N.current&&!e.currentTarget.contains(e.relatedTarget)&&(N.current=!1,ne.current&&=(ne.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N.current||(N.current=!0,ne.current=e.relatedTarget)},onMouseEnter:()=>D(!0),onMouseMove:()=>D(!0),onMouseLeave:()=>{O||D(!1)},onDragEnd:()=>D(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||k(!0)},onPointerUp:()=>k(!1)},C.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>I.createElement(Zi,{key:n.id,icons:y,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:O,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:re,toasts:C.filter(e=>e.position==n.position),heights:T.filter(e=>e.position==n.position),setHeights:E,expandByDefault:o,gap:v,expanded:ee,swipeDirections:e.swipeDirections}))):null}))}),ta=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),na=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ra=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ia=e=>{let t=ra(e);return t.charAt(0).toUpperCase()+t.slice(1)},aa={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`},oa=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},sa=(0,I.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,I.createElement)(`svg`,{ref:c,...aa,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ta(`lucide`,i),...!a&&!oa(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,I.createElement)(e,t)),...Array.isArray(a)?a:[a]])),R=(e,t)=>{let n=(0,I.forwardRef)(({className:n,...r},i)=>(0,I.createElement)(sa,{ref:i,iconNode:t,className:ta(`lucide-${na(ia(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ia(e),n},ca=R(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),la=R(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),ua=R(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),da=R(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),fa=R(`arrow-up-down`,[[`path`,{d:`m21 16-4 4-4-4`,key:`f6ql7i`}],[`path`,{d:`M17 20V4`,key:`1ejh1v`}],[`path`,{d:`m3 8 4-4 4 4`,key:`11wl7u`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}]]),pa=R(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),ma=R(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),ha=R(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ga=R(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),_a=R(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),va=R(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ya=R(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),ba=R(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]),xa=R(`copy`,[[`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`}]]),Sa=R(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Ca=R(`expand`,[[`path`,{d:`m15 15 6 6`,key:`1s409w`}],[`path`,{d:`m15 9 6-6`,key:`ko1vev`}],[`path`,{d:`M21 16v5h-5`,key:`1ck2sf`}],[`path`,{d:`M21 8V3h-5`,key:`1qoq8a`}],[`path`,{d:`M3 16v5h5`,key:`1t08am`}],[`path`,{d:`m3 21 6-6`,key:`wwnumi`}],[`path`,{d:`M3 8V3h5`,key:`1ln10m`}],[`path`,{d:`M9 9 3 3`,key:`v551iv`}]]),wa=R(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ta=R(`eye`,[[`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`}]]),Ea=R(`file-code-corner`,[[`path`,{d:`M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35`,key:`1wthlu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m5 16-3 3 3 3`,key:`331omg`}],[`path`,{d:`m9 22 3-3-3-3`,key:`lsp7cz`}]]),Da=R(`file-cog`,[[`path`,{d:`M15 8a1 1 0 0 1-1-1V2a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8z`,key:`1ckgky`}],[`path`,{d:`M20 8v12a2 2 0 0 1-2 2h-4.182`,key:`1726p0`}],[`path`,{d:`m3.305 19.53.923-.382`,key:`ao1pio`}],[`path`,{d:`M4 10.592V4a2 2 0 0 1 2-2h8`,key:`1foop0`}],[`path`,{d:`m4.228 16.852-.924-.383`,key:`1fv9zy`}],[`path`,{d:`m5.852 15.228-.383-.923`,key:`1a9hc2`}],[`path`,{d:`m5.852 20.772-.383.924`,key:`1sh9ke`}],[`path`,{d:`m8.148 15.228.383-.923`,key:`4yu6lf`}],[`path`,{d:`m8.53 21.696-.382-.924`,key:`18b0s9`}],[`path`,{d:`m9.773 16.852.922-.383`,key:`ti6xop`}],[`path`,{d:`m9.773 19.148.922.383`,key:`rws47d`}],[`circle`,{cx:`7`,cy:`18`,r:`3`,key:`lvkj7j`}]]),Oa=R(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),ka=R(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Aa=R(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),ja=R(`grip-vertical`,[[`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`}]]),Ma=R(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Na=R(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Pa=R(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Fa=R(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Ia=R(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),La=R(`network`,[[`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`}]]),Ra=R(`panel-left-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),za=R(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),Ba=R(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Va=R(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Ha=R(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Ua=R(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Wa=R(`route`,[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]),Ga=R(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Ka=R(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),qa=R(`send`,[[`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`}]]),Ja=R(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Ya=R(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Xa=R(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Za=R(`shrink`,[[`path`,{d:`m15 15 6 6m-6-6v4.8m0-4.8h4.8`,key:`17vawe`}],[`path`,{d:`M9 19.8V15m0 0H4.2M9 15l-6 6`,key:`chjx8e`}],[`path`,{d:`M15 4.2V9m0 0h4.8M15 9l6-6`,key:`lav6yq`}],[`path`,{d:`M9 4.2V9m0 0H4.2M9 9 3 3`,key:`1pxi2q`}]]),Qa=R(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),$a=R(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),eo=R(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),to=R(`sun`,[[`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`}]]),no=R(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),ro=R(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),io=R(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),ao=R(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function oo(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=oo(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function so(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=oo(e))&&(r&&(r+=` `),r+=t);return r}var co=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e;const lo=so,uo=(e,t)=>n=>{if(t?.variants==null)return lo(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=co(t)||co(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return lo(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)};function fo(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function po(...e){return t=>{let n=!1,r=e.map(e=>{let r=fo(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():fo(e[t],null)}}}}function z(...e){return I.useCallback(po(...e),e)}function B(e){let t=ho(e),n=I.forwardRef((e,n)=>{let{children:r,...i}=e,a=I.Children.toArray(r),o=a.find(vo);if(o){let e=o.props.children,r=a.map(t=>t===o?I.Children.count(e)>1?I.Children.only(null):I.isValidElement(e)?e.props.children:null:t);return(0,L.jsx)(t,{...i,ref:n,children:I.isValidElement(e)?I.cloneElement(e,void 0,r):null})}return(0,L.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var mo=B(`Slot`);function ho(e){let t=I.forwardRef((e,t)=>{let{children:n,...r}=e;if(I.isValidElement(n)){let e=bo(n),i=yo(r,n.props);return n.type!==I.Fragment&&(i.ref=t?po(t,e):e),I.cloneElement(n,i)}return I.Children.count(n)>1?I.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var go=Symbol(`radix.slottable`);function _o(e){let t=({children:e})=>(0,L.jsx)(L.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=go,t}function vo(e){return I.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===go}function yo(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function bo(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)}var xo=l(vr(),1),V=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=B(`Primitive.${t}`),r=I.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function So(e,t){e&&xo.flushSync(()=>e.dispatchEvent(t))}var Co=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`}),wo=`VisuallyHidden`,To=I.forwardRef((e,t)=>(0,L.jsx)(V.span,{...e,ref:t,style:{...Co,...e.style}}));To.displayName=wo;var Eo=To;function Do(e,t){let n=I.createContext(t),r=e=>{let{children:t,...r}=e,i=I.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=I.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Oo(e,t=[]){let n=[];function r(t,r){let i=I.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=I.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=I.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>I.createContext(e));return function(n){let r=n?.[e]||t;return I.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,ko(i,...t)]}function ko(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return I.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Ao(e){let t=e+`CollectionProvider`,[n,r]=Oo(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=I.useRef(null),a=I.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=B(s),l=I.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,L.jsx)(c,{ref:z(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=B(u),p=I.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=I.useRef(null),s=z(t,o),c=a(u,n);return I.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return I.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}typeof window<`u`&&window.document&&window.document.createElement;function H(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var jo=globalThis?.document?I.useLayoutEffect:()=>{},Mo=I.useInsertionEffect||jo;function No({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Po({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=I.useRef(e!==void 0);I.useEffect(()=>{let e=t.current;if(e!==s){let t=e?`controlled`:`uncontrolled`,n=s?`controlled`:`uncontrolled`;console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}return[c,I.useCallback(t=>{if(s){let n=Fo(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Po({defaultProp:e,onChange:t}){let[n,r]=I.useState(e),i=I.useRef(n),a=I.useRef(t);return Mo(()=>{a.current=t},[t]),I.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Fo(e){return typeof e==`function`}function Io(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var Lo=e=>{let{present:t,children:n}=e,r=Ro(t),i=typeof n==`function`?n({present:r.isPresent}):I.Children.only(n),a=z(r.ref,Bo(i));return typeof n==`function`||r.isPresent?I.cloneElement(i,{ref:a}):null};Lo.displayName=`Presence`;function Ro(e){let[t,n]=I.useState(),r=I.useRef(null),i=I.useRef(e),a=I.useRef(`none`),[o,s]=Io(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return I.useEffect(()=>{let e=zo(r.current);a.current=o===`mounted`?e:`none`},[o]),jo(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=zo(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),jo(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=zo(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=zo(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:I.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function zo(e){return e?.animationName||`none`}function Bo(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)}var Vo=I.useId||(()=>void 0),Ho=0;function Uo(e){let[t,n]=I.useState(Vo());return jo(()=>{e||n(e=>e??String(Ho++))},[e]),e||(t?`radix-${t}`:``)}var Wo=`Collapsible`,[Go,Ko]=Oo(Wo),[qo,Jo]=Go(Wo),Yo=I.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=No({prop:r,defaultProp:i??!1,onChange:o,caller:Wo});return(0,L.jsx)(qo,{scope:n,disabled:a,contentId:Uo(),open:c,onOpenToggle:I.useCallback(()=>l(e=>!e),[l]),children:(0,L.jsx)(V.div,{"data-state":ts(c),"data-disabled":a?``:void 0,...s,ref:t})})});Yo.displayName=Wo;var Xo=`CollapsibleTrigger`,Zo=I.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=Jo(Xo,n);return(0,L.jsx)(V.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ts(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:H(e.onClick,i.onOpenToggle)})});Zo.displayName=Xo;var Qo=`CollapsibleContent`,$o=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Jo(Qo,e.__scopeCollapsible);return(0,L.jsx)(Lo,{present:n||i.open,children:({present:e})=>(0,L.jsx)(es,{...r,ref:t,present:e})})});$o.displayName=Qo;var es=I.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Jo(Qo,n),[s,c]=I.useState(r),l=I.useRef(null),u=z(t,l),d=I.useRef(0),f=d.current,p=I.useRef(0),m=p.current,h=o.open||s,g=I.useRef(h),_=I.useRef(void 0);return I.useEffect(()=>{let e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),jo(()=>{let e=l.current;if(e){_.current=_.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,g.current||(e.style.transitionDuration=_.current.transitionDuration,e.style.animationName=_.current.animationName),c(r)}},[o.open,r]),(0,L.jsx)(V.div,{"data-state":ts(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!h,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":m?`${m}px`:void 0,...e.style},children:h&&i})});function ts(e){return e?`open`:`closed`}var ns=Yo,rs=I.createContext(void 0);function is(e){let t=I.useContext(rs);return e||t||`ltr`}function as(e){let t=I.useRef(e);return I.useEffect(()=>{t.current=e}),I.useMemo(()=>(...e)=>t.current?.(...e),[])}function os(e,t=globalThis?.document){let n=as(e);I.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ss=`DismissableLayer`,cs=`dismissableLayer.update`,ls=`dismissableLayer.pointerDownOutside`,us=`dismissableLayer.focusOutside`,ds,fs=I.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ps=I.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=I.useContext(fs),[u,d]=I.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=I.useState({}),m=z(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=gs(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=_s(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return os(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),I.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(ds=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vs(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=ds)}},[u,f,n,l]),I.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vs())},[u,l]),I.useEffect(()=>{let e=()=>p({});return document.addEventListener(cs,e),()=>document.removeEventListener(cs,e)},[]),(0,L.jsx)(V.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:H(e.onFocusCapture,S.onFocusCapture),onBlurCapture:H(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:H(e.onPointerDownCapture,x.onPointerDownCapture)})});ps.displayName=ss;var ms=`DismissableLayerBranch`,hs=I.forwardRef((e,t)=>{let n=I.useContext(fs),r=I.useRef(null),i=z(t,r);return I.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,L.jsx)(V.div,{...e,ref:i})});hs.displayName=ms;function gs(e,t=globalThis?.document){let n=as(e),r=I.useRef(!1),i=I.useRef(()=>{});return I.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){ys(ls,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _s(e,t=globalThis?.document){let n=as(e),r=I.useRef(!1);return I.useEffect(()=>{let e=e=>{e.target&&!r.current&&ys(us,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vs(){let e=new CustomEvent(cs);document.dispatchEvent(e)}function ys(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?So(i,a):i.dispatchEvent(a)}var bs=`focusScope.autoFocusOnMount`,xs=`focusScope.autoFocusOnUnmount`,Ss={bubbles:!1,cancelable:!0},Cs=`FocusScope`,ws=I.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=I.useState(null),l=as(i),u=as(a),d=I.useRef(null),f=z(t,e=>c(e)),p=I.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;I.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:js(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||js(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&js(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),I.useEffect(()=>{if(s){Ms.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(bs,Ss);s.addEventListener(bs,l),s.dispatchEvent(t),t.defaultPrevented||(Ts(Fs(Ds(s)),{select:!0}),document.activeElement===e&&js(s))}return()=>{s.removeEventListener(bs,l),setTimeout(()=>{let t=new CustomEvent(xs,Ss);s.addEventListener(xs,u),s.dispatchEvent(t),t.defaultPrevented||js(e??document.body,{select:!0}),s.removeEventListener(xs,u),Ms.remove(p)},0)}}},[s,l,u,p]);let m=I.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Es(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&js(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&js(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(V.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});ws.displayName=Cs;function Ts(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(js(r,{select:t}),document.activeElement!==n)return}function Es(e){let t=Ds(e);return[Os(t,e),Os(t.reverse(),e)]}function Ds(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Os(e,t){for(let n of e)if(!ks(n,{upTo:t}))return n}function ks(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 As(e){return e instanceof HTMLInputElement&&`select`in e}function js(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&As(e)&&t&&e.select()}}var Ms=Ns();function Ns(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Ps(e,t),e.unshift(t)},remove(t){e=Ps(e,t),e[0]?.resume()}}}function Ps(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fs(e){return e.filter(e=>e.tagName!==`A`)}var Is=l(vr(),1),Ls=`Portal`,Rs=I.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=I.useState(!1);jo(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Is.createPortal((0,L.jsx)(V.div,{...r,ref:t}),o):null});Rs.displayName=Ls;var zs=0;function Bs(){I.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Vs()),document.body.insertAdjacentElement(`beforeend`,e[1]??Vs()),zs++,()=>{zs===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),zs--}},[])}function Vs(){let 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 Hs=function(){return Hs=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Hs.apply(this,arguments)};function Us(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 Ws(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Gs=`right-scroll-bar-position`,Ks=`width-before-scroll-bar`,qs=`with-scroll-bars-hidden`,Js=`--removed-body-scroll-bar-size`;function Ys(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Xs(e,t){var n=(0,I.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Zs=typeof window<`u`?I.useLayoutEffect:I.useEffect,Qs=new WeakMap;function $s(e,t){var n=Xs(t||null,function(t){return e.forEach(function(e){return Ys(e,t)})});return Zs(function(){var t=Qs.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Ys(e,null)}),i.forEach(function(e){r.has(e)||Ys(e,a)})}Qs.set(n,e)},[e]),n}function ec(e){return e}function tc(e,t){t===void 0&&(t=ec);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function nc(e){e===void 0&&(e={});var t=tc(null);return t.options=Hs({async:!0,ssr:!1},e),t}var rc=function(e){var t=e.sideCar,n=Us(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return I.createElement(r,Hs({},n))};rc.isSideCarExport=!0;function ic(e,t){return e.useMedium(t),rc}var ac=nc(),oc=function(){},sc=I.forwardRef(function(e,t){var n=I.useRef(null),r=I.useState({onScrollCapture:oc,onWheelCapture:oc,onTouchMoveCapture:oc}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=Us(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=$s([n,t]),C=Hs(Hs({},b),i);return I.createElement(I.Fragment,null,u&&I.createElement(x,{sideCar:ac,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?I.cloneElement(I.Children.only(s),Hs(Hs({},C),{ref:S})):I.createElement(v,Hs({},C,{className:c,ref:S}),s))});sc.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},sc.classNames={fullWidth:Ks,zeroRight:Gs};var cc,lc=function(){if(cc)return cc;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function uc(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lc();return t&&e.setAttribute(`nonce`,t),e}function dc(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fc(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pc=function(){var e=0,t=null;return{add:function(n){e==0&&(t=uc())&&(dc(t,n),fc(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mc=function(){var e=pc();return function(t,n){I.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hc=function(){var e=mc();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gc={left:0,top:0,right:0,gap:0},_c=function(e){return parseInt(e||``,10)||0},vc=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[_c(n),_c(r),_c(i)]},yc=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gc;var t=vc(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])}},bc=hc(),xc=`data-scroll-locked`,Sc=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
10
|
-
.${qs} {
|
|
11
|
-
overflow: hidden ${r};
|
|
12
|
-
padding-right: ${s}px ${r};
|
|
13
|
-
}
|
|
14
|
-
body[${xc}] {
|
|
15
|
-
overflow: hidden ${r};
|
|
16
|
-
overscroll-behavior: contain;
|
|
17
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
18
|
-
padding-left: ${i}px;
|
|
19
|
-
padding-top: ${a}px;
|
|
20
|
-
padding-right: ${o}px;
|
|
21
|
-
margin-left:0;
|
|
22
|
-
margin-top:0;
|
|
23
|
-
margin-right: ${s}px ${r};
|
|
24
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${Gs} {
|
|
28
|
-
right: ${s}px ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${Ks} {
|
|
32
|
-
margin-right: ${s}px ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.${Gs} .${Gs} {
|
|
36
|
-
right: 0 ${r};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.${Ks} .${Ks} {
|
|
40
|
-
margin-right: 0 ${r};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
body[${xc}] {
|
|
44
|
-
${Js}: ${s}px;
|
|
45
|
-
}
|
|
46
|
-
`},Cc=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},wc=function(){I.useEffect(function(){return document.body.setAttribute(xc,(Cc()+1).toString()),function(){var e=Cc()-1;e<=0?document.body.removeAttribute(xc):document.body.setAttribute(xc,e.toString())}},[])},Tc=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;wc();var a=I.useMemo(function(){return yc(i)},[i]);return I.createElement(bc,{styles:Sc(a,!t,i,n?``:`!important`)})},Ec=!1;if(typeof window<`u`)try{var Dc=Object.defineProperty({},`passive`,{get:function(){return Ec=!0,!0}});window.addEventListener(`test`,Dc,Dc),window.removeEventListener(`test`,Dc,Dc)}catch{Ec=!1}var Oc=Ec?{passive:!1}:!1,kc=function(e){return e.tagName===`TEXTAREA`},Ac=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!kc(e)&&n[t]===`visible`)},jc=function(e){return Ac(e,`overflowY`)},Mc=function(e){return Ac(e,`overflowX`)},Nc=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ic(e,r)){var i=Lc(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Pc=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Fc=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ic=function(e,t){return e===`v`?jc(t):Mc(t)},Lc=function(e,t){return e===`v`?Pc(t):Fc(t)},Rc=function(e,t){return e===`h`&&t===`rtl`?-1:1},zc=function(e,t,n,r,i){var a=Rc(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Lc(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ic(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Bc=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vc=function(e){return[e.deltaX,e.deltaY]},Hc=function(e){return e&&`current`in e?e.current:e},Uc=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wc=function(e){return`
|
|
47
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
48
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
|
-
`},Gc=0,Kc=[];function qc(e){var t=I.useRef([]),n=I.useRef([0,0]),r=I.useRef(),i=I.useState(Gc++)[0],a=I.useState(hc)[0],o=I.useRef(e);I.useEffect(function(){o.current=e},[e]),I.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ws([e.lockRef.current],(e.shards||[]).map(Hc),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=I.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bc(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Nc(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Nc(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zc(h,t,e,h===`h`?s:c,!0)},[]),c=I.useCallback(function(e){var n=e;if(!(!Kc.length||Kc[Kc.length-1]!==a)){var r=`deltaY`in n?Vc(n):Bc(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Uc(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Hc).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=I.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Jc(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=I.useCallback(function(e){n.current=Bc(e),r.current=void 0},[]),d=I.useCallback(function(t){l(t.type,Vc(t),t.target,s(t,e.lockRef.current))},[]),f=I.useCallback(function(t){l(t.type,Bc(t),t.target,s(t,e.lockRef.current))},[]);I.useEffect(function(){return Kc.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Oc),document.addEventListener(`touchmove`,c,Oc),document.addEventListener(`touchstart`,u,Oc),function(){Kc=Kc.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Oc),document.removeEventListener(`touchmove`,c,Oc),document.removeEventListener(`touchstart`,u,Oc)}},[]);var p=e.removeScrollBar,m=e.inert;return I.createElement(I.Fragment,null,m?I.createElement(a,{styles:Wc(i)}):null,p?I.createElement(Tc,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jc(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Yc=ic(ac,qc),Xc=I.forwardRef(function(e,t){return I.createElement(sc,Hs({},e,{ref:t,sideCar:Yc}))});Xc.classNames=sc.classNames;var Zc=Xc,Qc=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},$c=new WeakMap,el=new WeakMap,tl={},nl=0,rl=function(e){return e&&(e.host||rl(e.parentNode))},il=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=rl(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},al=function(e,t,n,r){var i=il(t,Array.isArray(e)?e:[e]);tl[n]||(tl[n]=new WeakMap);var a=tl[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=($c.get(e)||0)+1,l=(a.get(e)||0)+1;$c.set(e,c),a.set(e,l),o.push(e),c===1&&i&&el.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),nl++,function(){o.forEach(function(e){var t=$c.get(e)-1,i=a.get(e)-1;$c.set(e,t),a.set(e,i),t||(el.has(e)||e.removeAttribute(r),el.delete(e)),i||e.removeAttribute(n)}),nl--,nl||($c=new WeakMap,$c=new WeakMap,el=new WeakMap,tl={})}},ol=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Qc(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),al(r,i,n,`aria-hidden`)):function(){return null}},sl=`Dialog`,[cl,ll]=Oo(sl),[ul,dl]=cl(sl),fl=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=I.useRef(null),c=I.useRef(null),[l,u]=No({prop:r,defaultProp:i??!1,onChange:a,caller:sl});return(0,L.jsx)(ul,{scope:t,triggerRef:s,contentRef:c,contentId:Uo(),titleId:Uo(),descriptionId:Uo(),open:l,onOpenChange:u,onOpenToggle:I.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};fl.displayName=sl;var pl=`DialogTrigger`,ml=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=dl(pl,n),a=z(t,i.triggerRef);return(0,L.jsx)(V.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Pl(i.open),...r,ref:a,onClick:H(e.onClick,i.onOpenToggle)})});ml.displayName=pl;var hl=`DialogPortal`,[gl,_l]=cl(hl,{forceMount:void 0}),vl=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=dl(hl,t);return(0,L.jsx)(gl,{scope:t,forceMount:n,children:I.Children.map(r,e=>(0,L.jsx)(Lo,{present:n||a.open,children:(0,L.jsx)(Rs,{asChild:!0,container:i,children:e})}))})};vl.displayName=hl;var yl=`DialogOverlay`,bl=I.forwardRef((e,t)=>{let n=_l(yl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=dl(yl,e.__scopeDialog);return a.modal?(0,L.jsx)(Lo,{present:r||a.open,children:(0,L.jsx)(Sl,{...i,ref:t})}):null});bl.displayName=yl;var xl=B(`DialogOverlay.RemoveScroll`),Sl=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=dl(yl,n);return(0,L.jsx)(Zc,{as:xl,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(V.div,{"data-state":Pl(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Cl=`DialogContent`,wl=I.forwardRef((e,t)=>{let n=_l(Cl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=dl(Cl,e.__scopeDialog);return(0,L.jsx)(Lo,{present:r||a.open,children:a.modal?(0,L.jsx)(Tl,{...i,ref:t}):(0,L.jsx)(El,{...i,ref:t})})});wl.displayName=Cl;var Tl=I.forwardRef((e,t)=>{let n=dl(Cl,e.__scopeDialog),r=I.useRef(null),i=z(t,n.contentRef,r);return I.useEffect(()=>{let e=r.current;if(e)return ol(e)},[]),(0,L.jsx)(Dl,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:H(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:H(e.onFocusOutside,e=>e.preventDefault())})}),El=I.forwardRef((e,t)=>{let n=dl(Cl,e.__scopeDialog),r=I.useRef(!1),i=I.useRef(!1);return(0,L.jsx)(Dl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),Dl=I.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=dl(Cl,n),c=I.useRef(null),l=z(t,c);return Bs(),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ws,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(ps,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Pl(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Rl,{titleId:s.titleId}),(0,L.jsx)(Bl,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Ol=`DialogTitle`,kl=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=dl(Ol,n);return(0,L.jsx)(V.h2,{id:i.titleId,...r,ref:t})});kl.displayName=Ol;var Al=`DialogDescription`,jl=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=dl(Al,n);return(0,L.jsx)(V.p,{id:i.descriptionId,...r,ref:t})});jl.displayName=Al;var Ml=`DialogClose`,Nl=I.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=dl(Ml,n);return(0,L.jsx)(V.button,{type:`button`,...r,ref:t,onClick:H(e.onClick,()=>i.onOpenChange(!1))})});Nl.displayName=Ml;function Pl(e){return e?`open`:`closed`}var Fl=`DialogTitleWarning`,[Il,Ll]=Do(Fl,{contentName:Cl,titleName:Ol,docsSlug:`dialog`}),Rl=({titleId:e})=>{let t=Ll(Fl),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
50
|
-
|
|
51
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
52
|
-
|
|
53
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return I.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},zl=`DialogDescriptionWarning`,Bl=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Ll(zl).contentName}}.`;return I.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Vl=fl,Hl=ml,Ul=vl,Wl=bl,Gl=wl,Kl=kl,ql=jl,Jl=Nl,Yl=`AlertDialog`,[Xl,Zl]=Oo(Yl,[ll]),Ql=ll(),$l=e=>{let{__scopeAlertDialog:t,...n}=e,r=Ql(t);return(0,L.jsx)(Vl,{...r,...n,modal:!0})};$l.displayName=Yl;var eu=`AlertDialogTrigger`,tu=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ql(n);return(0,L.jsx)(Hl,{...i,...r,ref:t})});tu.displayName=eu;var nu=`AlertDialogPortal`,ru=e=>{let{__scopeAlertDialog:t,...n}=e,r=Ql(t);return(0,L.jsx)(Ul,{...r,...n})};ru.displayName=nu;var iu=`AlertDialogOverlay`,au=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ql(n);return(0,L.jsx)(Wl,{...i,...r,ref:t})});au.displayName=iu;var ou=`AlertDialogContent`,[su,cu]=Xl(ou),lu=_o(`AlertDialogContent`),uu=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Ql(n),o=I.useRef(null),s=z(t,o),c=I.useRef(null);return(0,L.jsx)(Il,{contentName:ou,titleName:du,docsSlug:`alert-dialog`,children:(0,L.jsx)(su,{scope:n,cancelRef:c,children:(0,L.jsxs)(Gl,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:H(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,L.jsx)(lu,{children:r}),(0,L.jsx)(yu,{contentRef:o})]})})})});uu.displayName=ou;var du=`AlertDialogTitle`,fu=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ql(n);return(0,L.jsx)(Kl,{...i,...r,ref:t})});fu.displayName=du;var pu=`AlertDialogDescription`,mu=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ql(n);return(0,L.jsx)(ql,{...i,...r,ref:t})});mu.displayName=pu;var hu=`AlertDialogAction`,gu=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Ql(n);return(0,L.jsx)(Jl,{...i,...r,ref:t})});gu.displayName=hu;var _u=`AlertDialogCancel`,vu=I.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=cu(_u,n),a=Ql(n),o=z(t,i);return(0,L.jsx)(Jl,{...a,...r,ref:o})});vu.displayName=_u;var yu=({contentRef:e})=>{let t=`\`${ou}\` requires a description for the component to be accessible for screen reader users.
|
|
54
|
-
|
|
55
|
-
You can add a description to the \`${ou}\` by passing a \`${pu}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
56
|
-
|
|
57
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${ou}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
58
|
-
|
|
59
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return I.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},bu=$l,xu=tu,Su=ru,Cu=au,wu=uu,Tu=gu,Eu=vu,Du=fu,Ou=mu;function ku(e){let t=I.useRef({value:e,previous:e});return I.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function Au(e){let[t,n]=I.useState(void 0);return jo(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var ju=[`top`,`right`,`bottom`,`left`],Mu=Math.min,Nu=Math.max,Pu=Math.round,Fu=Math.floor,Iu=e=>({x:e,y:e}),Lu={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Ru(e,t,n){return Nu(e,Mu(t,n))}function zu(e,t){return typeof e==`function`?e(t):e}function Bu(e){return e.split(`-`)[0]}function Vu(e){return e.split(`-`)[1]}function Hu(e){return e===`x`?`y`:`x`}function Uu(e){return e===`y`?`height`:`width`}function Wu(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Gu(e){return Hu(Wu(e))}function Ku(e,t,n){n===void 0&&(n=!1);let r=Vu(e),i=Gu(e),a=Uu(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=td(o)),[o,td(o)]}function qu(e){let t=td(e);return[Ju(e),t,Ju(t)]}function Ju(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Yu=[`left`,`right`],Xu=[`right`,`left`],Zu=[`top`,`bottom`],Qu=[`bottom`,`top`];function $u(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Xu:Yu:t?Yu:Xu;case`left`:case`right`:return t?Zu:Qu;default:return[]}}function ed(e,t,n,r){let i=Vu(e),a=$u(Bu(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ju)))),a}function td(e){let t=Bu(e);return Lu[t]+e.slice(t.length)}function nd(e){return{top:0,right:0,bottom:0,left:0,...e}}function rd(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:nd(e)}function id(e){let{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 ad(e,t,n){let{reference:r,floating:i}=e,a=Wu(t),o=Gu(t),s=Uu(o),c=Bu(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(Vu(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function od(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=zu(t,e),p=rd(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=id(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=id(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var sd=50,cd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:od},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=ad(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<sd&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=ad(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},ld=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=zu(e,t)||{};if(l==null)return{};let d=rd(u),f={x:n,y:r},p=Gu(i),m=Uu(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Mu(d[_],T),ee=Mu(d[v],T),D=E,O=C-h[m]-ee,k=C/2-h[m]/2+w,te=Ru(D,k,O),A=!c.arrow&&Vu(i)!=null&&k!==te&&a.reference[m]/2-(k<D?E:ee)-h[m]/2<0,j=A?k<D?k-D:k-O:0;return{[p]:f[p]+j,data:{[p]:te,centerOffset:k-te-j,...A&&{alignmentOffset:j}},reset:A}}}),ud=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=zu(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Bu(r),_=Wu(o),v=Bu(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[td(o)]:qu(o)),x=p!==`none`;!d&&x&&b.push(...ed(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Ku(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Wu(t))||T.every(e=>Wu(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Wu(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function dd(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function fd(e){return ju.some(t=>e[t]>=0)}var pd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=zu(e,t);switch(i){case`referenceHidden`:{let e=dd(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:fd(e)}}}case`escaped`:{let e=dd(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:fd(e)}}}default:return{}}}}},md=new Set([`left`,`top`]);async function hd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Bu(n),s=Vu(n),c=Wu(n)===`y`,l=md.has(o)?-1:1,u=a&&c?-1:1,d=zu(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var gd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await hd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},_d=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=zu(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Wu(Bu(i)),p=Hu(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Ru(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Ru(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},vd=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=zu(e,t),u={x:n,y:r},d=Wu(i),f=Hu(d),p=u[f],m=u[d],h=zu(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=md.has(Bu(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},yd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=zu(e,t),u=await o.detectOverflow(t,l),d=Bu(i),f=Vu(i),p=Wu(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Mu(h-u[g],v),x=Mu(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=Nu(u.left,0),t=Nu(u.right,0),n=Nu(u.top,0),r=Nu(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Nu(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Nu(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function bd(){return typeof window<`u`}function xd(e){return wd(e)?(e.nodeName||``).toLowerCase():`#document`}function Sd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cd(e){return((wd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function wd(e){return bd()?e instanceof Node||e instanceof Sd(e).Node:!1}function Td(e){return bd()?e instanceof Element||e instanceof Sd(e).Element:!1}function Ed(e){return bd()?e instanceof HTMLElement||e instanceof Sd(e).HTMLElement:!1}function Dd(e){return!bd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Sd(e).ShadowRoot}function Od(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zd(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function kd(e){return/^(table|td|th)$/.test(xd(e))}function Ad(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var jd=/transform|translate|scale|rotate|perspective|filter/,Md=/paint|layout|strict|content/,Nd=e=>!!e&&e!==`none`,Pd;function Fd(e){let t=Td(e)?zd(e):e;return Nd(t.transform)||Nd(t.translate)||Nd(t.scale)||Nd(t.rotate)||Nd(t.perspective)||!Ld()&&(Nd(t.backdropFilter)||Nd(t.filter))||jd.test(t.willChange||``)||Md.test(t.contain||``)}function Id(e){let t=Vd(e);for(;Ed(t)&&!Rd(t);){if(Fd(t))return t;if(Ad(t))return null;t=Vd(t)}return null}function Ld(){return Pd??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Pd}function Rd(e){return/^(html|body|#document)$/.test(xd(e))}function zd(e){return Sd(e).getComputedStyle(e)}function Bd(e){return Td(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vd(e){if(xd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Dd(e)&&e.host||Cd(e);return Dd(t)?t.host:t}function Hd(e){let t=Vd(e);return Rd(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ed(t)&&Od(t)?t:Hd(t)}function Ud(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Hd(e),i=r===e.ownerDocument?.body,a=Sd(r);if(i){let e=Wd(a);return t.concat(a,a.visualViewport||[],Od(r)?r:[],e&&n?Ud(e):[])}else return t.concat(r,Ud(r,[],n))}function Wd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Gd(e){let t=zd(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ed(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Pu(n)!==a||Pu(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Kd(e){return Td(e)?e:e.contextElement}function qd(e){let t=Kd(e);if(!Ed(t))return Iu(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Gd(t),o=(a?Pu(n.width):n.width)/r,s=(a?Pu(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Jd=Iu(0);function Yd(e){let t=Sd(e);return!Ld()||!t.visualViewport?Jd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Xd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sd(e)?!1:t}function Zd(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Kd(e),o=Iu(1);t&&(r?Td(r)&&(o=qd(r)):o=qd(e));let s=Xd(a,n,r)?Yd(a):Iu(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=Sd(a),t=r&&Td(r)?Sd(r):r,n=e,i=Wd(n);for(;i&&r&&t!==n;){let e=qd(i),t=i.getBoundingClientRect(),r=zd(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Sd(i),i=Wd(n)}}return id({width:u,height:d,x:c,y:l})}function Qd(e,t){let n=Bd(e).scrollLeft;return t?t.left+n:Zd(Cd(e)).left+n}function $d(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Qd(e,n),y:n.top+t.scrollTop}}function ef(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Cd(r),s=t?Ad(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Iu(1),u=Iu(0),d=Ed(r);if((d||!d&&!a)&&((xd(r)!==`body`||Od(o))&&(c=Bd(r)),d)){let e=Zd(r);l=qd(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?$d(o,c):Iu(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function tf(e){return Array.from(e.getClientRects())}function nf(e){let t=Cd(e),n=Bd(e),r=e.ownerDocument.body,i=Nu(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Nu(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Qd(e),s=-n.scrollTop;return zd(r).direction===`rtl`&&(o+=Nu(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var rf=25;function af(e,t){let n=Sd(e),r=Cd(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Ld();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Qd(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=rf&&(a-=o)}else l<=rf&&(a+=l);return{width:a,height:o,x:s,y:c}}function of(e,t){let n=Zd(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ed(e)?qd(e):Iu(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function sf(e,t,n){let r;if(t===`viewport`)r=af(e,n);else if(t===`document`)r=nf(Cd(e));else if(Td(t))r=of(t,n);else{let n=Yd(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return id(r)}function cf(e,t){let n=Vd(e);return n===t||!Td(n)||Rd(n)?!1:zd(n).position===`fixed`||cf(n,t)}function lf(e,t){let n=t.get(e);if(n)return n;let r=Ud(e,[],!1).filter(e=>Td(e)&&xd(e)!==`body`),i=null,a=zd(e).position===`fixed`,o=a?Vd(e):e;for(;Td(o)&&!Rd(o);){let t=zd(o),n=Fd(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Od(o)&&!n&&cf(e,o))?r=r.filter(e=>e!==o):i=t,o=Vd(o)}return t.set(e,r),r}function uf(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ad(t)?[]:lf(t,this._c):[].concat(n),r],o=sf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=sf(t,a[e],i);s=Nu(n.top,s),c=Mu(n.right,c),l=Mu(n.bottom,l),u=Nu(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function df(e){let{width:t,height:n}=Gd(e);return{width:t,height:n}}function ff(e,t,n){let r=Ed(t),i=Cd(t),a=n===`fixed`,o=Zd(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Iu(0);function l(){c.x=Qd(i)}if(r||!r&&!a)if((xd(t)!==`body`||Od(i))&&(s=Bd(t)),r){let e=Zd(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?$d(i,s):Iu(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function pf(e){return zd(e).position===`static`}function mf(e,t){if(!Ed(e)||zd(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Cd(e)===n&&(n=n.ownerDocument.body),n}function hf(e,t){let n=Sd(e);if(Ad(e))return n;if(!Ed(e)){let t=Vd(e);for(;t&&!Rd(t);){if(Td(t)&&!pf(t))return t;t=Vd(t)}return n}let r=mf(e,t);for(;r&&kd(r)&&pf(r);)r=mf(r,t);return r&&Rd(r)&&pf(r)&&!Fd(r)?n:r||Id(e)||n}var gf=async function(e){let t=this.getOffsetParent||hf,n=this.getDimensions,r=await n(e.floating);return{reference:ff(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function _f(e){return zd(e).direction===`rtl`}var vf={convertOffsetParentRelativeRectToViewportRelativeRect:ef,getDocumentElement:Cd,getClippingRect:uf,getOffsetParent:hf,getElementRects:gf,getClientRects:tf,getDimensions:df,getScale:qd,isElement:Td,isRTL:_f};function yf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function bf(e,t){let n=null,r,i=Cd(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Fu(d),h=Fu(i.clientWidth-(u+f)),g=Fu(i.clientHeight-(d+p)),_=Fu(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Nu(0,Mu(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!yf(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function xf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Kd(e),u=i||a?[...l?Ud(l):[],...t?Ud(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?bf(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Zd(e):null;c&&g();function g(){let t=Zd(e);h&&!yf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Sf=gd,Cf=_d,wf=ud,Tf=yd,Ef=pd,Df=ld,Of=vd,kf=(e,t,n)=>{let r=new Map,i={platform:vf,...n},a={...i.platform,_c:r};return cd(e,t,{...i,platform:a})},Af=l(vr(),1),jf=typeof document<`u`?I.useLayoutEffect:function(){};function Mf(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(!Mf(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;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Mf(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Nf(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pf(e,t){let n=Nf(e);return Math.round(t*n)/n}function Ff(e){let t=I.useRef(e);return jf(()=>{t.current=e}),t}function If(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=I.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=I.useState(r);Mf(f,r)||p(r);let[m,h]=I.useState(null),[g,_]=I.useState(null),v=I.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=I.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=I.useRef(null),C=I.useRef(null),w=I.useRef(u),T=c!=null,E=Ff(c),ee=Ff(i),D=Ff(l),O=I.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),kf(S.current,C.current,e).then(e=>{let t={...e,isPositioned:D.current!==!1};k.current&&!Mf(w.current,t)&&(w.current=t,Af.flushSync(()=>{d(t)}))})},[f,t,n,ee,D]);jf(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=I.useRef(!1);jf(()=>(k.current=!0,()=>{k.current=!1}),[]),jf(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let te=I.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),A=I.useMemo(()=>({reference:b,floating:x}),[b,x]),j=I.useMemo(()=>{let e={position:n,left:0,top:0};if(!A.floating)return e;let t=Pf(A.floating,u.x),r=Pf(A.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Nf(A.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,A.floating,u.x,u.y]);return I.useMemo(()=>({...u,update:O,refs:te,elements:A,floatingStyles:j}),[u,O,te,A,j])}var Lf=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Df({element:r.current,padding:i}).fn(n):r?Df({element:r,padding:i}).fn(n):{}}}},Rf=(e,t)=>{let n=Sf(e);return{name:n.name,fn:n.fn,options:[e,t]}},zf=(e,t)=>{let n=Cf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bf=(e,t)=>({fn:Of(e).fn,options:[e,t]}),Vf=(e,t)=>{let n=wf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hf=(e,t)=>{let n=Tf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uf=(e,t)=>{let n=Ef(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wf=(e,t)=>{let n=Lf(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gf=`Arrow`,Kf=I.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,L.jsx)(V.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,L.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Kf.displayName=Gf;var qf=Kf,Jf=`Popper`,[Yf,Xf]=Oo(Jf),[Zf,Qf]=Yf(Jf),$f=e=>{let{__scopePopper:t,children:n}=e,[r,i]=I.useState(null);return(0,L.jsx)(Zf,{scope:t,anchor:r,onAnchorChange:i,children:n})};$f.displayName=Jf;var ep=`PopperAnchor`,tp=I.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Qf(ep,n),o=I.useRef(null),s=z(t,o),c=I.useRef(null);return I.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,L.jsx)(V.div,{...i,ref:s})});tp.displayName=ep;var np=`PopperContent`,[rp,ip]=Yf(np),ap=I.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=Qf(np,n),[_,v]=I.useState(null),y=z(t,e=>v(e)),[b,x]=I.useState(null),S=Au(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],D=ee.length>0,O={padding:E,boundary:ee.filter(lp),altBoundary:D},{refs:k,floatingStyles:te,placement:A,isPositioned:j,middlewareData:M}=If({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>xf(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Rf({mainAxis:i+w,alignmentAxis:o}),c&&zf({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Bf():void 0,...O}),c&&Vf({...O}),Hf({...O,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Wf({element:b,padding:s}),up({arrowWidth:C,arrowHeight:w}),f&&Uf({strategy:`referenceHidden`,...O})]}),[ne,N]=dp(A),re=as(m);jo(()=>{j&&re?.()},[j,re]);let ie=M.arrow?.x,ae=M.arrow?.y,P=M.arrow?.centerOffset!==0,[F,oe]=I.useState();return jo(()=>{_&&oe(window.getComputedStyle(_).zIndex)},[_]),(0,L.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:j?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:F,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(rp,{scope:n,placedSide:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:P,children:(0,L.jsx)(V.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:j?void 0:`none`}})})})});ap.displayName=np;var op=`PopperArrow`,sp={top:`bottom`,right:`left`,bottom:`top`,left:`right`},cp=I.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=ip(op,n),a=sp[i.placedSide];return(0,L.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,L.jsx)(qf,{...r,ref:t,style:{...r.style,display:`block`}})})});cp.displayName=op;function lp(e){return e!==null}var up=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=dp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function dp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var fp=$f,pp=tp,mp=ap,hp=cp,gp=`rovingFocusGroup.onEntryFocus`,_p={bubbles:!1,cancelable:!0},vp=`RovingFocusGroup`,[yp,bp,xp]=Ao(vp),[Sp,Cp]=Oo(vp,[xp]),[wp,Tp]=Sp(vp),Ep=I.forwardRef((e,t)=>(0,L.jsx)(yp.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(yp.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,L.jsx)(Dp,{...e,ref:t})})}));Ep.displayName=vp;var Dp=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=I.useRef(null),p=z(t,f),m=is(a),[h,g]=No({prop:o,defaultProp:s??null,onChange:c,caller:vp}),[_,v]=I.useState(!1),y=as(l),b=bp(n),x=I.useRef(!1),[S,C]=I.useState(0);return I.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(gp,y),()=>e.removeEventListener(gp,y)},[y]),(0,L.jsx)(wp,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:I.useCallback(e=>g(e),[g]),onItemShiftTab:I.useCallback(()=>v(!0),[]),onFocusableItemAdd:I.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:I.useCallback(()=>C(e=>e-1),[]),children:(0,L.jsx)(V.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:H(e.onMouseDown,()=>{x.current=!0}),onFocus:H(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(gp,_p);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);Np([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:H(e.onBlur,()=>v(!1))})})}),Op=`RovingFocusGroupItem`,kp=I.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Uo(),l=a||c,u=Tp(Op,n),d=u.currentTabStopId===l,f=bp(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return I.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,L.jsx)(yp.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,L.jsx)(V.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:H(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:H(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:H(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Mp(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?Pp(n,r+1):n.slice(r+1)}setTimeout(()=>Np(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});kp.displayName=Op;var Ap={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function jp(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Mp(e,t,n){let r=jp(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ap[r]}function Np(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Pp(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Fp=Ep,Ip=kp,Lp=[`Enter`,` `],Rp=[`ArrowDown`,`PageUp`,`Home`],zp=[`ArrowUp`,`PageDown`,`End`],Bp=[...Rp,...zp],Vp={ltr:[...Lp,`ArrowRight`],rtl:[...Lp,`ArrowLeft`]},Hp={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Up=`Menu`,[Wp,Gp,Kp]=Ao(Up),[qp,Jp]=Oo(Up,[Kp,Xf,Cp]),Yp=Xf(),Xp=Cp(),[Zp,Qp]=qp(Up),[$p,em]=qp(Up),tm=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Yp(t),[c,l]=I.useState(null),u=I.useRef(!1),d=as(a),f=is(i);return I.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,L.jsx)(fp,{...s,children:(0,L.jsx)(Zp,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,L.jsx)($p,{scope:t,onClose:I.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};tm.displayName=Up;var nm=`MenuAnchor`,rm=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Yp(n);return(0,L.jsx)(pp,{...i,...r,ref:t})});rm.displayName=nm;var im=`MenuPortal`,[am,om]=qp(im,{forceMount:void 0}),sm=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Qp(im,t);return(0,L.jsx)(am,{scope:t,forceMount:n,children:(0,L.jsx)(Lo,{present:n||a.open,children:(0,L.jsx)(Rs,{asChild:!0,container:i,children:r})})})};sm.displayName=im;var cm=`MenuContent`,[lm,um]=qp(cm),dm=I.forwardRef((e,t)=>{let n=om(cm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Qp(cm,e.__scopeMenu),o=em(cm,e.__scopeMenu);return(0,L.jsx)(Wp.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(Lo,{present:r||a.open,children:(0,L.jsx)(Wp.Slot,{scope:e.__scopeMenu,children:o.modal?(0,L.jsx)(fm,{...i,ref:t}):(0,L.jsx)(pm,{...i,ref:t})})})})}),fm=I.forwardRef((e,t)=>{let n=Qp(cm,e.__scopeMenu),r=I.useRef(null),i=z(t,r);return I.useEffect(()=>{let e=r.current;if(e)return ol(e)},[]),(0,L.jsx)(hm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:H(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),pm=I.forwardRef((e,t)=>{let n=Qp(cm,e.__scopeMenu);return(0,L.jsx)(hm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mm=B(`MenuContent.ScrollLock`),hm=I.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Qp(cm,n),_=em(cm,n),v=Yp(n),y=Xp(n),b=Gp(n),[x,S]=I.useState(null),C=I.useRef(null),w=z(t,C,g.onContentChange),T=I.useRef(0),E=I.useRef(``),ee=I.useRef(0),D=I.useRef(null),O=I.useRef(`right`),k=I.useRef(0),te=m?Zc:I.Fragment,A=m?{as:mm,allowPinchZoom:!0}:void 0,j=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=$m(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};I.useEffect(()=>()=>window.clearTimeout(T.current),[]),Bs();let M=I.useCallback(e=>O.current===D.current?.side&&th(e,D.current?.area),[]);return(0,L.jsx)(lm,{scope:n,searchRef:E,onItemEnter:I.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:I.useCallback(e=>{M(e)||(C.current?.focus(),S(null))},[M]),onTriggerLeave:I.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:ee,onPointerGraceIntentChange:I.useCallback(e=>{D.current=e},[]),children:(0,L.jsx)(te,{...A,children:(0,L.jsx)(ws,{asChild:!0,trapped:i,onMountAutoFocus:H(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,L.jsx)(ps,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,L.jsx)(Fp,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:H(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,L.jsx)(mp,{role:`menu`,"aria-orientation":`vertical`,"data-state":Jm(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:H(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&j(e.key));let i=C.current;if(e.target!==i||!Bp.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);zp.includes(e.key)&&a.reverse(),Zm(a)}),onBlur:H(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:H(e.onPointerMove,nh(e=>{let t=e.target,n=k.current!==e.clientX;e.currentTarget.contains(t)&&n&&(O.current=e.clientX>k.current?`right`:`left`,k.current=e.clientX)}))})})})})})})});dm.displayName=cm;var gm=`MenuGroup`,_m=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(V.div,{role:`group`,...r,ref:t})});_m.displayName=gm;var vm=`MenuLabel`,ym=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(V.div,{...r,ref:t})});ym.displayName=vm;var bm=`MenuItem`,xm=`menu.itemSelect`,Sm=I.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=I.useRef(null),o=em(bm,e.__scopeMenu),s=um(bm,e.__scopeMenu),c=z(t,a),l=I.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(xm,{bubbles:!0,cancelable:!0});e.addEventListener(xm,e=>r?.(e),{once:!0}),So(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,L.jsx)(Cm,{...i,ref:c,disabled:n,onClick:H(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:H(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:H(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Lp.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Sm.displayName=bm;var Cm=I.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=um(bm,n),s=Xp(n),c=I.useRef(null),l=z(t,c),[u,d]=I.useState(!1),[f,p]=I.useState(``);return I.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,L.jsx)(Wp.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,L.jsx)(Ip,{asChild:!0,...s,focusable:!r,children:(0,L.jsx)(V.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:H(e.onPointerMove,nh(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:H(e.onPointerLeave,nh(e=>o.onItemLeave(e))),onFocus:H(e.onFocus,()=>d(!0)),onBlur:H(e.onBlur,()=>d(!1))})})})}),wm=`MenuCheckboxItem`,Tm=I.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,L.jsx)(Nm,{scope:e.__scopeMenu,checked:n,children:(0,L.jsx)(Sm,{role:`menuitemcheckbox`,"aria-checked":Ym(n)?`mixed`:n,...i,ref:t,"data-state":Xm(n),onSelect:H(i.onSelect,()=>r?.(Ym(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Tm.displayName=wm;var Em=`MenuRadioGroup`,[Dm,Om]=qp(Em,{value:void 0,onValueChange:()=>{}}),km=I.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=as(r);return(0,L.jsx)(Dm,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,L.jsx)(_m,{...i,ref:t})})});km.displayName=Em;var Am=`MenuRadioItem`,jm=I.forwardRef((e,t)=>{let{value:n,...r}=e,i=Om(Am,e.__scopeMenu),a=n===i.value;return(0,L.jsx)(Nm,{scope:e.__scopeMenu,checked:a,children:(0,L.jsx)(Sm,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":Xm(a),onSelect:H(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});jm.displayName=Am;var Mm=`MenuItemIndicator`,[Nm,Pm]=qp(Mm,{checked:!1}),Fm=I.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Pm(Mm,n);return(0,L.jsx)(Lo,{present:r||Ym(a.checked)||a.checked===!0,children:(0,L.jsx)(V.span,{...i,ref:t,"data-state":Xm(a.checked)})})});Fm.displayName=Mm;var Im=`MenuSeparator`,Lm=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,L.jsx)(V.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Lm.displayName=Im;var Rm=`MenuArrow`,zm=I.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=Yp(n);return(0,L.jsx)(hp,{...i,...r,ref:t})});zm.displayName=Rm;var Bm=`MenuSub`,[Vm,Hm]=qp(Bm),Um=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Qp(Bm,t),o=Yp(t),[s,c]=I.useState(null),[l,u]=I.useState(null),d=as(i);return I.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,L.jsx)(fp,{...o,children:(0,L.jsx)(Zp,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,L.jsx)(Vm,{scope:t,contentId:Uo(),triggerId:Uo(),trigger:s,onTriggerChange:c,children:n})})})};Um.displayName=Bm;var Wm=`MenuSubTrigger`,Gm=I.forwardRef((e,t)=>{let n=Qp(Wm,e.__scopeMenu),r=em(Wm,e.__scopeMenu),i=Hm(Wm,e.__scopeMenu),a=um(Wm,e.__scopeMenu),o=I.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=I.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return I.useEffect(()=>u,[u]),I.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,L.jsx)(rm,{asChild:!0,...l,children:(0,L.jsx)(Cm,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":Jm(n.open),...e,ref:po(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:H(e.onPointerMove,nh(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:H(e.onPointerLeave,nh(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:H(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Vp[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Gm.displayName=Wm;var Km=`MenuSubContent`,qm=I.forwardRef((e,t)=>{let n=om(cm,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Qp(cm,e.__scopeMenu),o=em(cm,e.__scopeMenu),s=Hm(Km,e.__scopeMenu),c=I.useRef(null),l=z(t,c);return(0,L.jsx)(Wp.Provider,{scope:e.__scopeMenu,children:(0,L.jsx)(Lo,{present:r||a.open,children:(0,L.jsx)(Wp.Slot,{scope:e.__scopeMenu,children:(0,L.jsx)(hm,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:H(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:H(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:H(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Hp[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});qm.displayName=Km;function Jm(e){return e?`open`:`closed`}function Ym(e){return e===`indeterminate`}function Xm(e){return Ym(e)?`indeterminate`:e?`checked`:`unchecked`}function Zm(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Qm(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function $m(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Qm(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function eh(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function th(e,t){return t?eh({x:e.clientX,y:e.clientY},t):!1}function nh(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rh=tm,ih=rm,ah=sm,oh=dm,sh=_m,ch=ym,lh=Sm,uh=Tm,dh=km,fh=jm,ph=Fm,mh=Lm,hh=zm,gh=Um,_h=Gm,vh=qm,yh=`ContextMenu`,[bh,xh]=Oo(yh,[Jp]),Sh=Jp(),[Ch,wh]=bh(yh),Th=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=I.useState(!1),c=Sh(t),l=as(r),u=I.useCallback(e=>{s(e),l(e)},[l]);return(0,L.jsx)(Ch,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,L.jsx)(rh,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};Th.displayName=yh;var Eh=`ContextMenuTrigger`,Dh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=wh(Eh,n),o=Sh(n),s=I.useRef({x:0,y:0}),c=I.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=I.useRef(0),u=I.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return I.useEffect(()=>u,[u]),I.useEffect(()=>void(r&&u()),[r,u]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ih,{...o,virtualRef:c}),(0,L.jsx)(V.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:H(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:H(e.onPointerDown,ng(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:H(e.onPointerMove,ng(u)),onPointerCancel:r?e.onPointerCancel:H(e.onPointerCancel,ng(u)),onPointerUp:r?e.onPointerUp:H(e.onPointerUp,ng(u))})]})});Dh.displayName=Eh;var Oh=`ContextMenuPortal`,kh=e=>{let{__scopeContextMenu:t,...n}=e,r=Sh(t);return(0,L.jsx)(ah,{...r,...n})};kh.displayName=Oh;var Ah=`ContextMenuContent`,jh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=wh(Ah,n),a=Sh(n),o=I.useRef(!1);return(0,L.jsx)(oh,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.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)`}})});jh.displayName=Ah;var Mh=`ContextMenuGroup`,Nh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(sh,{...i,...r,ref:t})});Nh.displayName=Mh;var Ph=`ContextMenuLabel`,Fh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(ch,{...i,...r,ref:t})});Fh.displayName=Ph;var Ih=`ContextMenuItem`,Lh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(lh,{...i,...r,ref:t})});Lh.displayName=Ih;var Rh=`ContextMenuCheckboxItem`,zh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(uh,{...i,...r,ref:t})});zh.displayName=Rh;var Bh=`ContextMenuRadioGroup`,Vh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(dh,{...i,...r,ref:t})});Vh.displayName=Bh;var Hh=`ContextMenuRadioItem`,Uh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(fh,{...i,...r,ref:t})});Uh.displayName=Hh;var Wh=`ContextMenuItemIndicator`,Gh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(ph,{...i,...r,ref:t})});Gh.displayName=Wh;var Kh=`ContextMenuSeparator`,qh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(mh,{...i,...r,ref:t})});qh.displayName=Kh;var Jh=`ContextMenuArrow`,Yh=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(hh,{...i,...r,ref:t})});Yh.displayName=Jh;var Xh=`ContextMenuSub`,Zh=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=Sh(t),[s,c]=No({prop:i,defaultProp:a??!1,onChange:r,caller:Xh});return(0,L.jsx)(gh,{...o,open:s,onOpenChange:c,children:n})};Zh.displayName=Xh;var Qh=`ContextMenuSubTrigger`,$h=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(_h,{...i,...r,ref:t})});$h.displayName=Qh;var eg=`ContextMenuSubContent`,tg=I.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=Sh(n);return(0,L.jsx)(vh,{...i,...r,ref:t,style:{...e.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)`}})});tg.displayName=eg;function ng(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var rg=Th,ig=Dh,ag=kh,og=jh,sg=Lh,cg=qh,lg=`Label`,ug=I.forwardRef((e,t)=>(0,L.jsx)(V.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));ug.displayName=lg;var dg=ug;function fg(e,[t,n]){return Math.min(n,Math.max(t,e))}function pg(e,t){return I.useReducer((e,n)=>t[e][n]??e,e)}var mg=`ScrollArea`,[hg,gg]=Oo(mg),[_g,vg]=hg(mg),yg=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=I.useState(null),[l,u]=I.useState(null),[d,f]=I.useState(null),[p,m]=I.useState(null),[h,g]=I.useState(null),[_,v]=I.useState(0),[y,b]=I.useState(0),[x,S]=I.useState(!1),[C,w]=I.useState(!1),T=z(t,e=>c(e)),E=is(i);return(0,L.jsx)(_g,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,L.jsx)(V.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});yg.displayName=mg;var bg=`ScrollAreaViewport`,xg=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=vg(bg,n),s=z(t,I.useRef(null),o.onViewportChange);return(0,L.jsxs)(L.Fragment,{children:[(0,L.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:i}),(0,L.jsx)(V.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,L.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});xg.displayName=bg;var Sg=`ScrollAreaScrollbar`,Cg=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=vg(Sg,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return I.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,L.jsx)(wg,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,L.jsx)(Tg,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,L.jsx)(Eg,{...r,ref:t,forceMount:n}):i.type===`always`?(0,L.jsx)(Dg,{...r,ref:t}):null});Cg.displayName=Sg;var wg=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=vg(Sg,e.__scopeScrollArea),[a,o]=I.useState(!1);return I.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,L.jsx)(Lo,{present:n||a,children:(0,L.jsx)(Eg,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),Tg=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=vg(Sg,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=qg(()=>c(`SCROLL_END`),100),[s,c]=pg(`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 I.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),I.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,L.jsx)(Lo,{present:n||s!==`hidden`,children:(0,L.jsx)(Dg,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:H(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:H(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),Eg=I.forwardRef((e,t)=>{let n=vg(Sg,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=I.useState(!1),s=e.orientation===`horizontal`,c=qg(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return Jg(n.viewport,c),Jg(n.content,c),(0,L.jsx)(Lo,{present:r||a,children:(0,L.jsx)(Dg,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),Dg=I.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=vg(Sg,e.__scopeScrollArea),a=I.useRef(null),o=I.useRef(0),[s,c]=I.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Bg(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return Hg(e,o.current,s,t)}return n===`horizontal`?(0,L.jsx)(Og,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=Ug(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,L.jsx)(kg,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=Ug(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),Og=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=vg(Sg,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=z(t,c,a.onScrollbarXChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,L.jsx)(Mg,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":Vg(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),Gg(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:zg(o.paddingLeft),paddingEnd:zg(o.paddingRight)}})}})}),kg=I.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=vg(Sg,e.__scopeScrollArea),[o,s]=I.useState(),c=I.useRef(null),l=z(t,c,a.onScrollbarYChange);return I.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,L.jsx)(Mg,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":Vg(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),Gg(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:zg(o.paddingTop),paddingEnd:zg(o.paddingBottom)}})}})}),[Ag,jg]=hg(Sg),Mg=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=vg(Sg,n),[m,h]=I.useState(null),g=z(t,e=>h(e)),_=I.useRef(null),v=I.useRef(``),y=p.viewport,b=r.content-r.viewport,x=as(u),S=as(c),C=qg(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return I.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),I.useEffect(S,[r,S]),Jg(m,C),Jg(p.content,C),(0,L.jsx)(Ag,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:as(a),onThumbPointerUp:as(o),onThumbPositionChange:S,onThumbPointerDown:as(s),children:(0,L.jsx)(V.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:H(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:H(e.onPointerMove,w),onPointerUp:H(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),Ng=`ScrollAreaThumb`,Pg=I.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=jg(Ng,e.__scopeScrollArea);return(0,L.jsx)(Lo,{present:n||i.hasThumb,children:(0,L.jsx)(Fg,{ref:t,...r})})}),Fg=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=vg(Ng,n),o=jg(Ng,n),{onThumbPositionChange:s}=o,c=z(t,e=>o.onThumbChange(e)),l=I.useRef(void 0),u=qg(()=>{l.current&&=(l.current(),void 0)},100);return I.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=Kg(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,L.jsx)(V.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:H(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:H(e.onPointerUp,o.onThumbPointerUp)})});Pg.displayName=Ng;var Ig=`ScrollAreaCorner`,Lg=I.forwardRef((e,t)=>{let n=vg(Ig,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,L.jsx)(Rg,{...e,ref:t}):null});Lg.displayName=Ig;var Rg=I.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=vg(Ig,n),[a,o]=I.useState(0),[s,c]=I.useState(0),l=!!(a&&s);return Jg(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),Jg(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,L.jsx)(V.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function zg(e){return e?parseInt(e,10):0}function Bg(e,t){let n=e/t;return isNaN(n)?0:n}function Vg(e){let t=Bg(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Hg(e,t,n,r=`ltr`){let i=Vg(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return Wg([c,l],d)(e)}function Ug(e,t,n=`ltr`){let r=Vg(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=fg(e,n===`ltr`?[0,o]:[o*-1,0]);return Wg([0,o],[0,s])(c)}function Wg(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function Gg(e,t){return e>0&&e<t}var Kg=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function qg(e,t){let n=as(e),r=I.useRef(0);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),I.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Jg(e,t){let n=as(t);jo(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var Yg=yg,Xg=xg,Zg=Lg,Qg=l(vr(),1),$g=[` `,`Enter`,`ArrowUp`,`ArrowDown`],e_=[` `,`Enter`],t_=`Select`,[n_,r_,i_]=Ao(t_),[a_,o_]=Oo(t_,[i_,Xf]),s_=Xf(),[c_,l_]=a_(t_),[u_,d_]=a_(t_),f_=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m}=e,h=s_(t),[g,_]=I.useState(null),[v,y]=I.useState(null),[b,x]=I.useState(!1),S=is(l),[C,w]=No({prop:r,defaultProp:i??!1,onChange:a,caller:t_}),[T,E]=No({prop:o,defaultProp:s,onChange:c,caller:t_}),ee=I.useRef(null),D=g?m||!!g.closest(`form`):!0,[O,k]=I.useState(new Set),te=Array.from(O).map(e=>e.props.value).join(`;`);return(0,L.jsx)(fp,{...h,children:(0,L.jsxs)(c_,{required:p,scope:t,trigger:g,onTriggerChange:_,valueNode:v,onValueNodeChange:y,valueNodeHasChildren:b,onValueNodeHasChildrenChange:x,contentId:Uo(),value:T,onValueChange:E,open:C,onOpenChange:w,dir:S,triggerPointerDownPosRef:ee,disabled:f,children:[(0,L.jsx)(n_.Provider,{scope:t,children:(0,L.jsx)(u_,{scope:e.__scopeSelect,onNativeOptionAdd:I.useCallback(e=>{k(t=>new Set(t).add(e))},[]),onNativeOptionRemove:I.useCallback(e=>{k(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),D?(0,L.jsxs)(sv,{"aria-hidden":!0,required:p,tabIndex:-1,name:u,autoComplete:d,value:T,onChange:e=>E(e.target.value),disabled:f,form:m,children:[T===void 0?(0,L.jsx)(`option`,{value:``}):null,Array.from(O)]},te):null]})})};f_.displayName=t_;var p_=`SelectTrigger`,m_=I.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=s_(n),o=l_(p_,n),s=o.disabled||r,c=z(t,o.onTriggerChange),l=r_(n),u=I.useRef(`touch`),[d,f,p]=lv(e=>{let t=l().filter(e=>!e.disabled),n=uv(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,L.jsx)(pp,{asChild:!0,...a,children:(0,L.jsx)(V.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":cv(o.value)?``:void 0,...i,ref:c,onClick:H(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:H(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:H(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&$g.includes(e.key)&&(m(),e.preventDefault())})})})});m_.displayName=p_;var h_=`SelectValue`,g_=I.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=l_(h_,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=z(t,c.onValueNodeChange);return jo(()=>{l(u)},[l,u]),(0,L.jsx)(V.span,{...s,ref:d,style:{pointerEvents:`none`},children:cv(c.value)?(0,L.jsx)(L.Fragment,{children:o}):a})});g_.displayName=h_;var __=`SelectIcon`,v_=I.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(V.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});v_.displayName=__;var y_=`SelectPortal`,b_=e=>(0,L.jsx)(Rs,{asChild:!0,...e});b_.displayName=y_;var x_=`SelectContent`,S_=I.forwardRef((e,t)=>{let n=l_(x_,e.__scopeSelect),[r,i]=I.useState();if(jo(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?Qg.createPortal((0,L.jsx)(w_,{scope:e.__scopeSelect,children:(0,L.jsx)(n_.Slot,{scope:e.__scopeSelect,children:(0,L.jsx)(`div`,{children:e.children})})}),t):null}return(0,L.jsx)(O_,{...e,ref:t})});S_.displayName=x_;var C_=10,[w_,T_]=a_(x_),E_=`SelectContentImpl`,D_=B(`SelectContent.RemoveScroll`),O_=I.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=l_(x_,n),[y,b]=I.useState(null),[x,S]=I.useState(null),C=z(t,e=>b(e)),[w,T]=I.useState(null),[E,ee]=I.useState(null),D=r_(n),[O,k]=I.useState(!1),te=I.useRef(!1);I.useEffect(()=>{if(y)return ol(y)},[y]),Bs();let A=I.useCallback(e=>{let[t,...n]=D().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[D,x]),j=I.useCallback(()=>A([w,y]),[A,w,y]);I.useEffect(()=>{O&&j()},[O,j]);let{onOpenChange:M,triggerPointerDownPosRef:ne}=v;I.useEffect(()=>{if(y){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(ne.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(ne.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():y.contains(n.target)||M(!1),document.removeEventListener(`pointermove`,t),ne.current=null};return ne.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,M,ne]),I.useEffect(()=>{let e=()=>M(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[M]);let[N,re]=lv(e=>{let t=D().filter(e=>!e.disabled),n=uv(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ie=I.useCallback((e,t,n)=>{let r=!te.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(te.current=!0))},[v.value]),ae=I.useCallback(()=>y?.focus(),[y]),P=I.useCallback((e,t,n)=>{let r=!te.current&&!n;(v.value!==void 0&&v.value===t||r)&&ee(e)},[v.value]),F=r===`popper`?M_:A_,oe=F===M_?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(w_,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ie,selectedItem:w,onItemLeave:ae,itemTextRefCallback:P,focusSelectedItem:j,selectedItemText:E,position:r,isPositioned:O,searchRef:N,children:(0,L.jsx)(Zc,{as:D_,allowPinchZoom:!0,children:(0,L.jsx)(ws,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:H(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(ps,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,L.jsx)(F,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...oe,onPlaced:()=>k(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:H(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=D().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>A(t)),e.preventDefault()}})})})})})})});O_.displayName=E_;var k_=`SelectItemAlignedPosition`,A_=I.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=l_(x_,n),o=T_(x_,n),[s,c]=I.useState(null),[l,u]=I.useState(null),d=z(t,e=>u(e)),f=r_(n),p=I.useRef(!1),m=I.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=I.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-C_,d=fg(a,[C_,Math.max(C_,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-C_,d=fg(a,[C_,Math.max(C_,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-C_*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-C_,ee=c-E,D=g.offsetHeight/2,O=g.offsetTop+D,k=m+v+O,te=x-k;if(k<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=k+Math.max(ee,D+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+D)+te;s.style.height=t+`px`,h.scrollTop=k-E+h.offsetTop}s.style.margin=`${C_}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);jo(()=>y(),[y]);let[b,x]=I.useState();return jo(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]),(0,L.jsx)(N_,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:I.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,L.jsx)(V.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});A_.displayName=k_;var j_=`SelectPopperPosition`,M_=I.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=C_,...a}=e,o=s_(n);return(0,L.jsx)(mp,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})});M_.displayName=j_;var[N_,P_]=a_(x_,{}),F_=`SelectViewport`,I_=I.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=T_(F_,n),o=P_(F_,n),s=z(t,a.onViewportChange),c=I.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.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:r}),(0,L.jsx)(n_.Slot,{scope:n,children:(0,L.jsx)(V.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:H(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-C_*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});I_.displayName=F_;var L_=`SelectGroup`,[R_,z_]=a_(L_),B_=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Uo();return(0,L.jsx)(R_,{scope:n,id:i,children:(0,L.jsx)(V.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});B_.displayName=L_;var V_=`SelectLabel`,H_=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=z_(V_,n);return(0,L.jsx)(V.div,{id:i.id,...r,ref:t})});H_.displayName=V_;var U_=`SelectItem`,[W_,G_]=a_(U_),K_=I.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=l_(U_,n),c=T_(U_,n),l=s.value===r,[u,d]=I.useState(a??``),[f,p]=I.useState(!1),m=z(t,e=>c.itemRefCallback?.(e,r,i)),h=Uo(),g=I.useRef(`touch`),_=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,L.jsx)(W_,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:I.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(n_.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(V.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:H(o.onFocus,()=>p(!0)),onBlur:H(o.onBlur,()=>p(!1)),onClick:H(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:H(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:H(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:H(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:H(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:H(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(e_.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})});K_.displayName=U_;var q_=`SelectItemText`,J_=I.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=l_(q_,n),s=T_(q_,n),c=G_(q_,n),l=d_(q_,n),[u,d]=I.useState(null),f=z(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=I.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:g}=l;return jo(()=>(h(m),()=>g(m)),[h,g,m]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(V.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Qg.createPortal(a.children,o.valueNode):null]})});J_.displayName=q_;var Y_=`SelectItemIndicator`,X_=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return G_(Y_,n).isSelected?(0,L.jsx)(V.span,{"aria-hidden":!0,...r,ref:t}):null});X_.displayName=Y_;var Z_=`SelectScrollUpButton`,Q_=I.forwardRef((e,t)=>{let n=T_(Z_,e.__scopeSelect),r=P_(Z_,e.__scopeSelect),[i,a]=I.useState(!1),o=z(t,r.onScrollButtonChange);return jo(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,L.jsx)(tv,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Q_.displayName=Z_;var $_=`SelectScrollDownButton`,ev=I.forwardRef((e,t)=>{let n=T_($_,e.__scopeSelect),r=P_($_,e.__scopeSelect),[i,a]=I.useState(!1),o=z(t,r.onScrollButtonChange);return jo(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,L.jsx)(tv,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ev.displayName=$_;var tv=I.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=T_(`SelectScrollButton`,n),o=I.useRef(null),s=r_(n),c=I.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return I.useEffect(()=>()=>c(),[c]),jo(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(V.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:H(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:H(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:H(i.onPointerLeave,()=>{c()})})}),nv=`SelectSeparator`,rv=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,L.jsx)(V.div,{"aria-hidden":!0,...r,ref:t})});rv.displayName=nv;var iv=`SelectArrow`,av=I.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=s_(n),a=l_(iv,n),o=T_(iv,n);return a.open&&o.position===`popper`?(0,L.jsx)(hp,{...i,...r,ref:t}):null});av.displayName=iv;var ov=`SelectBubbleInput`,sv=I.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=I.useRef(null),a=z(r,i),o=ku(t);return I.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,L.jsx)(V.select,{...n,style:{...Co,...n.style},ref:a,defaultValue:t})});sv.displayName=ov;function cv(e){return e===``||e===void 0}function lv(e){let t=as(e),n=I.useRef(``),r=I.useRef(0),i=I.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=I.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return I.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function uv(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=dv(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function dv(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var fv=f_,pv=m_,mv=g_,hv=v_,gv=b_,_v=S_,vv=I_,yv=B_,bv=H_,xv=K_,Sv=J_,Cv=X_,wv=Q_,Tv=ev,Ev=`Separator`,Dv=`horizontal`,Ov=[`horizontal`,`vertical`],kv=I.forwardRef((e,t)=>{let{decorative:n,orientation:r=Dv,...i}=e,a=Av(r)?r:Dv,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,L.jsx)(V.div,{"data-orientation":a,...s,...i,ref:t})});kv.displayName=Ev;function Av(e){return Ov.includes(e)}var jv=kv,Mv=`Switch`,[Nv,Pv]=Oo(Mv),[Fv,Iv]=Nv(Mv),Lv=I.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:u,...d}=e,[f,p]=I.useState(null),m=z(t,e=>p(e)),h=I.useRef(!1),g=f?u||!!f.closest(`form`):!0,[_,v]=No({prop:i,defaultProp:a??!1,onChange:l,caller:Mv});return(0,L.jsxs)(Fv,{scope:n,checked:_,disabled:s,children:[(0,L.jsx)(V.button,{type:`button`,role:`switch`,"aria-checked":_,"aria-required":o,"data-state":Hv(_),"data-disabled":s?``:void 0,disabled:s,value:c,...d,ref:m,onClick:H(e.onClick,e=>{v(e=>!e),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,L.jsx)(Vv,{control:f,bubbles:!h.current,name:r,value:c,checked:_,required:o,disabled:s,form:u,style:{transform:`translateX(-100%)`}})]})});Lv.displayName=Mv;var Rv=`SwitchThumb`,zv=I.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Iv(Rv,n);return(0,L.jsx)(V.span,{"data-state":Hv(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});zv.displayName=Rv;var Bv=`SwitchBubbleInput`,Vv=I.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=I.useRef(null),s=z(o,a),c=ku(n),l=Au(t);return I.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,L.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Vv.displayName=Bv;function Hv(e){return e?`checked`:`unchecked`}var Uv=Lv,Wv=zv,Gv=`Tabs`,[Kv,qv]=Oo(Gv,[Cp]),Jv=Cp(),[Yv,Xv]=Kv(Gv),Zv=I.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=is(s),[d,f]=No({prop:r,onChange:i,defaultProp:a??``,caller:Gv});return(0,L.jsx)(Yv,{scope:n,baseId:Uo(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,L.jsx)(V.div,{dir:u,"data-orientation":o,...l,ref:t})})});Zv.displayName=Gv;var Qv=`TabsList`,$v=I.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Xv(Qv,n),o=Jv(n);return(0,L.jsx)(Fp,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,L.jsx)(V.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});$v.displayName=Qv;var ey=`TabsTrigger`,ty=I.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Xv(ey,n),s=Jv(n),c=iy(o.baseId,r),l=ay(o.baseId,r),u=r===o.value;return(0,L.jsx)(Ip,{asChild:!0,...s,focusable:!i,active:u,children:(0,L.jsx)(V.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:H(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:H(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:H(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});ty.displayName=ey;var ny=`TabsContent`,ry=I.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Xv(ny,n),c=iy(s.baseId,r),l=ay(s.baseId,r),u=r===s.value,d=I.useRef(u);return I.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,L.jsx)(Lo,{present:i||u,children:({present:n})=>(0,L.jsx)(V.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});ry.displayName=ny;function iy(e,t){return`${e}-trigger-${t}`}function ay(e,t){return`${e}-content-${t}`}var oy=Zv,sy=$v,cy=ty,ly=ry,[uy,dy]=Oo(`Tooltip`,[Xf]),fy=Xf(),py=`TooltipProvider`,my=700,hy=`tooltip.open`,[gy,_y]=uy(py),vy=e=>{let{__scopeTooltip:t,delayDuration:n=my,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=I.useRef(!0),s=I.useRef(!1),c=I.useRef(0);return I.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,L.jsx)(gy,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:I.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:I.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:I.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};vy.displayName=py;var yy=`Tooltip`,[by,xy]=uy(yy),Sy=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=_y(yy,e.__scopeTooltip),l=fy(t),[u,d]=I.useState(null),f=Uo(),p=I.useRef(0),m=o??c.disableHoverableContent,h=s??c.delayDuration,g=I.useRef(!1),[_,v]=No({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(hy))):c.onClose(),a?.(e)},caller:yy}),y=I.useMemo(()=>_?g.current?`delayed-open`:`instant-open`:`closed`,[_]),b=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g.current=!1,v(!0)},[v]),x=I.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v(!1)},[v]),S=I.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{g.current=!0,v(!0),p.current=0},h)},[h,v]);return I.useEffect(()=>()=>{p.current&&=(window.clearTimeout(p.current),0)},[]),(0,L.jsx)(fp,{...l,children:(0,L.jsx)(by,{scope:t,contentId:f,open:_,stateAttribute:y,trigger:u,onTriggerChange:d,onTriggerEnter:I.useCallback(()=>{c.isOpenDelayedRef.current?S():b()},[c.isOpenDelayedRef,S,b]),onTriggerLeave:I.useCallback(()=>{m?x():(window.clearTimeout(p.current),p.current=0)},[x,m]),onOpen:b,onClose:x,disableHoverableContent:m,children:n})})};Sy.displayName=yy;var Cy=`TooltipTrigger`,wy=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=xy(Cy,n),a=_y(Cy,n),o=fy(n),s=z(t,I.useRef(null),i.onTriggerChange),c=I.useRef(!1),l=I.useRef(!1),u=I.useCallback(()=>c.current=!1,[]);return I.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,L.jsx)(pp,{asChild:!0,...o,children:(0,L.jsx)(V.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:H(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:H(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:H(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:H(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:H(e.onBlur,i.onClose),onClick:H(e.onClick,i.onClose)})})});wy.displayName=Cy;var Ty=`TooltipPortal`,[Ey,Dy]=uy(Ty,{forceMount:void 0}),Oy=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=xy(Ty,t);return(0,L.jsx)(Ey,{scope:t,forceMount:n,children:(0,L.jsx)(Lo,{present:n||a.open,children:(0,L.jsx)(Rs,{asChild:!0,container:i,children:r})})})};Oy.displayName=Ty;var ky=`TooltipContent`,Ay=I.forwardRef((e,t)=>{let n=Dy(ky,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=xy(ky,e.__scopeTooltip);return(0,L.jsx)(Lo,{present:r||o.open,children:o.disableHoverableContent?(0,L.jsx)(Fy,{side:i,...a,ref:t}):(0,L.jsx)(jy,{side:i,...a,ref:t})})}),jy=I.forwardRef((e,t)=>{let n=xy(ky,e.__scopeTooltip),r=_y(ky,e.__scopeTooltip),i=I.useRef(null),a=z(t,i),[o,s]=I.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=I.useCallback(()=>{s(null),d(!1)},[d]),p=I.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=zy(r,Ry(r,n.getBoundingClientRect())),a=By(t.getBoundingClientRect());s(Hy([...i,...a])),d(!0)},[d]);return I.useEffect(()=>()=>f(),[f]),I.useEffect(()=>{if(c&&u){let e=e=>p(e,u),t=e=>p(e,c);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),I.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Vy(n,o);r?f():i&&(f(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,L.jsx)(Fy,{...e,ref:a})}),[My,Ny]=uy(yy,{isInside:!1}),Py=_o(`TooltipContent`),Fy=I.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=xy(ky,n),l=fy(n),{onClose:u}=c;return I.useEffect(()=>(document.addEventListener(hy,u),()=>document.removeEventListener(hy,u)),[u]),I.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&u()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,u]),(0,L.jsx)(ps,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:u,children:(0,L.jsxs)(mp,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,L.jsx)(Py,{children:r}),(0,L.jsx)(My,{scope:n,isInside:!0,children:(0,L.jsx)(Eo,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Ay.displayName=ky;var Iy=`TooltipArrow`,Ly=I.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=fy(n);return Ny(Iy,n).isInside?null:(0,L.jsx)(hp,{...i,...r,ref:t})});Ly.displayName=Iy;function Ry(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function zy(e,t,n=5){let 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}function By(e){let{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}]}function Vy(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Hy(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),Uy(t)}function Uy(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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)}var Wy=vy,Gy=Sy,Ky=wy,qy=Oy,Jy=Ay,Yy=Ly,Xy=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Zy=(e,t)=>({classGroupId:e,validator:t}),Qy=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),$y=`-`,eb=[],tb=`arbitrary..`,nb=e=>{let t=ab(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ib(e);let n=e.split($y);return rb(n,n[0]===``&&n.length>1?1:0,t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Xy(i,t):t:i||eb}return n[e]||eb}}},rb=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=rb(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join($y):e.slice(t).join($y),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ib=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?tb+r:void 0})(),ab=e=>{let{theme:t,classGroups:n}=e;return ob(n,t)},ob=(e,t)=>{let n=Qy();for(let r in e){let i=e[r];sb(i,n,r,t)}return n},sb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];cb(i,t,n,r)}},cb=(e,t,n,r)=>{if(typeof e==`string`){lb(e,t,n);return}if(typeof e==`function`){ub(e,t,n,r);return}db(e,t,n,r)},lb=(e,t,n)=>{let r=e===``?t:fb(t,e);r.classGroupId=n},ub=(e,t,n,r)=>{if(pb(e)){sb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Zy(n,e))},db=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];sb(o,fb(t,a),n,r)}},fb=(e,t)=>{let n=e,r=t.split($y),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Qy(),n.nextPart.set(t,i)),n=i}return n},pb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,mb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},hb=`!`,gb=`:`,_b=[],vb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),yb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===gb){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(hb)?(c=s.slice(0,-1),l=!0):s.startsWith(hb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return vb(t,l,c,u)};if(t){let e=t+gb,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):vb(_b,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},bb=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},xb=e=>({cache:mb(e.cacheSize),parseClassName:yb(e),sortModifiers:bb(e),...nb(e)}),Sb=/\s+/,Cb=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(Sb),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+hb:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},wb=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Tb(n))&&(i&&(i+=` `),i+=r);return i},Tb=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Tb(e[r]))&&(n&&(n+=` `),n+=t);return n},Eb=(e,...t)=>{let n,r,i,a,o=o=>(n=xb(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Cb(e,n);return i(e,a),a};return a=o,(...e)=>a(wb(...e))},Db=[],Ob=e=>{let t=t=>t[e]||Db;return t.isThemeGetter=!0,t},kb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ab=/^\((?:(\w[\w-]*):)?(.+)\)$/i,jb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Mb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Nb=/\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$/,Pb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ib=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Lb=e=>jb.test(e),Rb=e=>!!e&&!Number.isNaN(Number(e)),zb=e=>!!e&&Number.isInteger(Number(e)),Bb=e=>e.endsWith(`%`)&&Rb(e.slice(0,-1)),Vb=e=>Mb.test(e),Hb=()=>!0,Ub=e=>Nb.test(e)&&!Pb.test(e),Wb=()=>!1,Gb=e=>Fb.test(e),Kb=e=>Ib.test(e),qb=e=>!U(e)&&!W(e),Jb=e=>lx(e,px,Wb),U=e=>kb.test(e),Yb=e=>lx(e,mx,Ub),Xb=e=>lx(e,hx,Rb),Zb=e=>lx(e,_x,Hb),Qb=e=>lx(e,gx,Wb),$b=e=>lx(e,dx,Wb),ex=e=>lx(e,fx,Kb),tx=e=>lx(e,vx,Gb),W=e=>Ab.test(e),nx=e=>ux(e,mx),rx=e=>ux(e,gx),ix=e=>ux(e,dx),ax=e=>ux(e,px),ox=e=>ux(e,fx),sx=e=>ux(e,vx,!0),cx=e=>ux(e,_x,!0),lx=(e,t,n)=>{let r=kb.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},ux=(e,t,n=!1)=>{let r=Ab.exec(e);return r?r[1]?t(r[1]):n:!1},dx=e=>e===`position`||e===`percentage`,fx=e=>e===`image`||e===`url`,px=e=>e===`length`||e===`size`||e===`bg-size`,mx=e=>e===`length`,hx=e=>e===`number`,gx=e=>e===`family-name`,_x=e=>e===`number`||e===`weight`,vx=e=>e===`shadow`,yx=Eb(()=>{let e=Ob(`color`),t=Ob(`font`),n=Ob(`text`),r=Ob(`font-weight`),i=Ob(`tracking`),a=Ob(`leading`),o=Ob(`breakpoint`),s=Ob(`container`),c=Ob(`spacing`),l=Ob(`radius`),u=Ob(`shadow`),d=Ob(`inset-shadow`),f=Ob(`text-shadow`),p=Ob(`drop-shadow`),m=Ob(`blur`),h=Ob(`perspective`),g=Ob(`aspect`),_=Ob(`ease`),v=Ob(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),W,U],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[W,U,c],T=()=>[Lb,`full`,`auto`,...w()],E=()=>[zb,`none`,`subgrid`,W,U],ee=()=>[`auto`,{span:[`full`,zb,W,U]},zb,W,U],D=()=>[zb,`auto`,W,U],O=()=>[`auto`,`min`,`max`,`fr`,W,U],k=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],te=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],A=()=>[`auto`,...w()],j=()=>[Lb,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],M=()=>[Lb,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[Lb,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,W,U],re=()=>[...b(),ix,$b,{position:[W,U]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,ax,Jb,{size:[W,U]}],P=()=>[Bb,nx,Yb],F=()=>[``,`none`,`full`,l,W,U],oe=()=>[``,Rb,nx,Yb],se=()=>[`solid`,`dashed`,`dotted`,`double`],ce=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],le=()=>[Rb,Bb,ix,$b],ue=()=>[``,`none`,m,W,U],de=()=>[`none`,Rb,W,U],fe=()=>[`none`,Rb,W,U],pe=()=>[Rb,W,U],me=()=>[Lb,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Vb],breakpoint:[Vb],color:[Hb],container:[Vb],"drop-shadow":[Vb],ease:[`in`,`out`,`in-out`],font:[qb],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Vb],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Vb],shadow:[Vb],spacing:[`px`,Rb],text:[Vb],"text-shadow":[Vb],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Lb,U,W,g]}],container:[`container`],columns:[{columns:[Rb,U,W,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"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:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[zb,`auto`,W,U]}],basis:[{basis:[Lb,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Rb,Lb,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,Rb,W,U]}],shrink:[{shrink:[``,Rb,W,U]}],order:[{order:[zb,`first`,`last`,`none`,W,U]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":O()}],"auto-rows":[{"auto-rows":O()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...k(),`normal`]}],"justify-items":[{"justify-items":[...te(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...te()]}],"align-content":[{content:[`normal`,...k()]}],"align-items":[{items:[...te(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...te(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...te(),`baseline`]}],"place-self":[{"place-self":[`auto`,...te()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mbs:[{mbs:A()}],mbe:[{mbe:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:j()}],"inline-size":[{inline:[`auto`,...M()]}],"min-inline-size":[{"min-inline":[`auto`,...M()]}],"max-inline-size":[{"max-inline":[`none`,...M()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...j()]}],"min-w":[{"min-w":[s,`screen`,`none`,...j()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...j()]}],h:[{h:[`screen`,`lh`,...j()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...j()]}],"max-h":[{"max-h":[`screen`,`lh`,...j()]}],"font-size":[{text:[`base`,n,nx,Yb]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,cx,Zb]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Bb,U]}],"font-family":[{font:[rx,Qb,t]}],"font-features":[{"font-features":[U]}],"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,W,U]}],"line-clamp":[{"line-clamp":[Rb,`none`,W,Xb]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,W,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,W,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...se(),`wavy`]}],"text-decoration-thickness":[{decoration:[Rb,`from-font`,`auto`,W,Yb]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[Rb,`auto`,W,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,W,U]}],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`,W,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},zb,W,U],radial:[``,W,U],conic:[zb,W,U]},ox,ex]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...se(),`hidden`,`none`]}],"divide-style":[{divide:[...se(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...se(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Rb,W,U]}],"outline-w":[{outline:[``,Rb,nx,Yb]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,sx,tx]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,sx,tx]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:oe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[Rb,Yb]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,sx,tx]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[Rb,W,U]}],"mix-blend":[{"mix-blend":[...ce(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ce()}],"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":[Rb]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[W,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":b()}],"mask-image-conic-pos":[{"mask-conic":[Rb]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,W,U]}],filter:[{filter:[``,`none`,W,U]}],blur:[{blur:ue()}],brightness:[{brightness:[Rb,W,U]}],contrast:[{contrast:[Rb,W,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,sx,tx]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,Rb,W,U]}],"hue-rotate":[{"hue-rotate":[Rb,W,U]}],invert:[{invert:[``,Rb,W,U]}],saturate:[{saturate:[Rb,W,U]}],sepia:[{sepia:[``,Rb,W,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,W,U]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[Rb,W,U]}],"backdrop-contrast":[{"backdrop-contrast":[Rb,W,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Rb,W,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Rb,W,U]}],"backdrop-invert":[{"backdrop-invert":[``,Rb,W,U]}],"backdrop-opacity":[{"backdrop-opacity":[Rb,W,U]}],"backdrop-saturate":[{"backdrop-saturate":[Rb,W,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,Rb,W,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,W,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Rb,`initial`,W,U]}],ease:[{ease:[`linear`,`initial`,_,W,U]}],delay:[{delay:[Rb,W,U]}],animate:[{animate:[`none`,v,W,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,W,U]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:de()}],"rotate-x":[{"rotate-x":de()}],"rotate-y":[{"rotate-y":de()}],"rotate-z":[{"rotate-z":de()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":[`scale-3d`],skew:[{skew:pe()}],"skew-x":[{"skew-x":pe()}],"skew-y":[{"skew-y":pe()}],transform:[{transform:[W,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":[`translate-none`],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"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`,W,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"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`,W,U]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[Rb,nx,Yb,Xb]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{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`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function G(...e){return yx(so(e))}var bx=uo(`cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function K({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,L.jsx)(r?mo:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:G(bx({variant:t,size:n,className:e})),...i})}var xx=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e))},o=t=e(r,i,a);return a},Sx=(e=>e?xx(e):xx),Cx=e=>e;function wx(e,t=Cx){let n=I.useSyncExternalStore(e.subscribe,I.useCallback(()=>t(e.getState()),[e,t]),I.useCallback(()=>t(e.getInitialState()),[e,t]));return I.useDebugValue(n),n}var Tx=e=>{let t=Sx(e),n=e=>wx(t,e);return Object.assign(n,t),n},Ex=(e=>e?Tx(e):Tx),Dx={name:`ECDH`,namedCurve:`P-256`};function Ox(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n)}function kx(e){let t=atob(e),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n.buffer}var Ax=class{keyPair=null;aesKey=null;async generateKeyPair(){return this.keyPair=await crypto.subtle.generateKey(Dx,!1,[`deriveKey`]),Ox(await crypto.subtle.exportKey(`raw`,this.keyPair.publicKey))}async deriveKey(e){if(!this.keyPair)throw Error(`请先调用 generateKeyPair()`);let t=kx(e),n=await crypto.subtle.importKey(`raw`,t,Dx,!1,[]);this.aesKey=await crypto.subtle.deriveKey({name:`ECDH`,public:n},this.keyPair.privateKey,{name:`AES-GCM`,length:256},!1,[`encrypt`,`decrypt`])}get ready(){return this.aesKey!==null}async encrypt(e){if(!this.aesKey)throw Error(`密钥尚未派生`);let t=crypto.getRandomValues(new Uint8Array(12)),n=new TextEncoder().encode(e),r=await crypto.subtle.encrypt({name:`AES-GCM`,iv:t},this.aesKey,n);return{iv:Ox(t.buffer),data:Ox(r)}}async decrypt(e){if(!this.aesKey)throw Error(`密钥尚未派生`);let t=new Uint8Array(kx(e.iv)),n=kx(e.data),r=await crypto.subtle.decrypt({name:`AES-GCM`,iv:t},this.aesKey,n);return new TextDecoder().decode(r)}};async function jx(){let e=new Ax,t=await e.generateKeyPair(),n=await fetch(`/api/crypto/handshake`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({clientPublicKey:t})});if(!n.ok)throw Error(`加密握手失败`);let r=await n.json();return await e.deriveKey(r.serverPublicKey),{client:e,sessionId:r.sessionId}}async function Mx(e,t=!0){let n=await jx();try{return await e(n)}catch(n){let r=typeof n==`object`&&n&&`status`in n?n.status:void 0;if(t&&r===401)return e(await jx());throw n}}async function Nx(){return Mx(async({client:e,sessionId:t})=>{let n=await fetch(`/api/config`,{headers:{"x-crypto-session":t}});if(!n.ok){let e=Error(`获取配置失败: ${n.status}`);throw e.status=n.status,e}let r=await n.json(),i=await e.decrypt(r);return JSON.parse(i)})}async function Px(e){await Mx(async({client:t,sessionId:n})=>{let r=await t.encrypt(JSON.stringify(e)),i=await fetch(`/api/config`,{method:`PUT`,headers:{"Content-Type":`application/json`,"x-crypto-session":n},body:JSON.stringify(r)});if(!i.ok){let e=await i.json().catch(()=>({})),t=Error(e.error??`保存配置失败: ${i.status}`);throw t.status=i.status,t}})}async function Fx(){let e=await fetch(`/api/config/apply`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`应用配置失败: ${e.status}`)}return(await e.json()).summary}async function Ix(){let e=await fetch(`/api/config/meta`);if(!e.ok)throw Error(`获取配置元信息失败: ${e.status}`);return e.json()}async function Lx(){let e=await fetch(`/api/config/schema`);if(!e.ok)throw Error(`获取配置 schema 失败: ${e.status}`);return e.json()}async function Rx(){try{let e=await fetch(`/api/health`);return e.ok?(await e.json()).status===`ok`:!1}catch{return!1}}async function zx(e=`24h`,t=!1){let n=new URLSearchParams({window:e,refresh:t?`1`:`0`}),r=await fetch(`/api/metrics/logs?${n.toString()}`);if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`获取日志统计失败: ${r.status}`)}return r.json()}async function Bx(e=!1){let t=new URLSearchParams({refresh:e?`1`:`0`}),n=await fetch(`/api/logs/storage?${t.toString()}`);if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`获取日志存储统计失败: ${n.status}`)}return n.json()}function Vx(e,t,n){!n||n.length===0||e.set(t,n.join(`,`))}function Hx(e){let t=new URLSearchParams;return e.window&&t.set(`window`,e.window),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),Vx(t,`levels`,e.levels),e.provider&&t.set(`provider`,e.provider),e.routeType&&t.set(`routeType`,e.routeType),e.model&&t.set(`model`,e.model),e.modelIn&&t.set(`modelIn`,e.modelIn),e.modelOut&&t.set(`modelOut`,e.modelOut),e.user&&t.set(`user`,e.user),e.session&&t.set(`session`,e.session),Vx(t,`statusClass`,e.statusClass),typeof e.hasError==`boolean`&&t.set(`hasError`,e.hasError?`true`:`false`),e.q&&t.set(`q`,e.q),e.sort&&t.set(`sort`,e.sort),e.limit&&t.set(`limit`,String(e.limit)),e.cursor&&t.set(`cursor`,e.cursor),t.toString()}function Ux(e){let t=new URLSearchParams;return e.window&&t.set(`window`,e.window),e.from&&t.set(`from`,e.from),e.to&&t.set(`to`,e.to),e.user&&t.set(`user`,e.user),e.session&&t.set(`session`,e.session),e.q&&t.set(`q`,e.q),t.toString()}async function Wx(e={}){let t=Ux(e),n=await fetch(`/api/logs/sessions${t?`?${t}`:``}`);if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`获取用户会话失败: ${n.status}`)}return n.json()}async function Gx(e={},t={}){let n=Hx(e),r=await fetch(`/api/logs/events${n?`?${n}`:``}`,{signal:t.signal});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`获取日志列表失败: ${r.status}`)}return r.json()}async function Kx(e){let t=await fetch(`/api/logs/events/${encodeURIComponent(e)}`);if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`获取日志详情失败: ${t.status}`)}return t.json()}async function qx(e,t){let n=Hx(e),r=`/api/logs/export?format=${t}${n?`&${n}`:``}`,i=await fetch(r);if(!i.ok){let e=await i.json().catch(()=>({}));throw Error(e.error??`导出日志失败: ${i.status}`)}return i.blob()}async function Jx(){let e=await fetch(`/api/autostart`);if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`获取自启动状态失败: ${e.status}`)}return e.json()}async function Yx(e){let t=await fetch(`/api/autostart`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({enabled:e})});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`设置自启动失败: ${t.status}`)}}function Xx(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Zx(e){return JSON.parse(JSON.stringify(e))}const Qx=Ex((e,t)=>({config:null,draft:null,loading:!0,saving:!1,applying:!1,error:null,loadConfig:async()=>{e({loading:!0,error:null});try{let t=await Nx();e({config:t,draft:Zx(t),loading:!1})}catch(t){e({error:t instanceof Error?t.message:`加载配置失败`,loading:!1})}},updateDraft:n=>{let{draft:r}=t();r&&e({draft:n(Zx(r))})},setDraft:t=>{e({draft:Zx(t)})},save:async n=>{let r=n??t().draft;if(!r)return!1;e({saving:!0});try{await Px(r);let t=Zx(r);return e({config:t,draft:Zx(t),saving:!1}),!0}catch(t){throw e({saving:!1}),t}},apply:async()=>{e({applying:!0});try{return await Fx(),e({applying:!1}),!0}catch(t){throw e({applying:!1}),t}},saveAndApply:async e=>await t().save(e)?t().apply():!1,reset:()=>{let{config:n}=t();n&&e({draft:Zx(n)})}})),$x=e=>e.config!==null&&e.draft!==null&&!Xx(e.config,e.draft),eS=Ex(e=>({diffOpen:!1,diffMode:`view`,rawOpen:!1,rawValue:`{}`,rawParseError:null,schema:null,openDiff:t=>e({diffOpen:!0,diffMode:t}),setDiffOpen:t=>e({diffOpen:t}),openRaw:t=>e({rawOpen:!0,rawValue:t,rawParseError:null}),setRawOpen:t=>e({rawOpen:t}),setRawValue:t=>e({rawValue:t,rawParseError:null}),setRawParseError:t=>e({rawParseError:t}),loadSchema:async()=>{try{e({schema:await Lx()})}catch(e){console.warn(`加载 JSON Schema 失败:`,e)}}}));function tS(){let e=Qx($x),t=Qx(e=>e.saving),n=Qx(e=>e.applying),r=Qx(e=>e.config),i=Qx(e=>e.draft),a=Qx(e=>e.reset),o=eS(e=>e.openDiff),s=eS(e=>e.openRaw),c=t||n;function l(){o(`view`)}function u(){s(JSON.stringify(i??r??{},null,2))}function d(){a(),zi.info(`已重置为上次保存的配置`)}function f(){o(`save`)}function p(){o(`saveAndApply`)}return(0,L.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,L.jsx)(`div`,{className:`hidden md:flex items-center gap-2 text-sm`,children:e?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(ba,{className:`h-4 w-4 text-amber-500`}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`有未保存的更改`})]}):(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`配置已同步`})}),(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(K,{variant:`outline`,size:`sm`,onClick:l,disabled:c,children:[(0,L.jsx)(Aa,{className:`h-4 w-4 mr-1`}),`查看 Diff`]}),(0,L.jsxs)(K,{variant:`outline`,size:`sm`,onClick:u,disabled:c,children:[(0,L.jsx)(Ea,{className:`h-4 w-4 mr-1`}),`查看 Raw`]}),(0,L.jsxs)(K,{variant:`ghost`,size:`sm`,onClick:d,disabled:!e||c,children:[(0,L.jsx)(Ua,{className:`h-4 w-4 mr-1`}),`重置`]}),(0,L.jsxs)(K,{variant:`outline`,size:`sm`,onClick:f,disabled:!e||c,children:[t?(0,L.jsx)(Pa,{className:`h-4 w-4 mr-1 animate-spin`}):(0,L.jsx)(Ga,{className:`h-4 w-4 mr-1`}),`保存`]}),(0,L.jsxs)(K,{size:`sm`,onClick:p,disabled:!e||c,children:[n?(0,L.jsx)(Pa,{className:`h-4 w-4 mr-1 animate-spin`}):(0,L.jsx)(ao,{className:`h-4 w-4 mr-1`}),`保存并应用`]})]})]})}var nS=l(o(((e,t)=>{(function(){var e={}.hasOwnProperty;function n(){for(var e=``,t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,r(n)))}return e}function r(t){if(typeof t==`string`||typeof t==`number`)return t;if(typeof t!=`object`)return``;if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes(`[native code]`))return t.toString();var r=``;for(var a in t)e.call(t,a)&&t[a]&&(r=i(r,a));return r}function i(e,t){return t?e?e+` `+t:e+t:e}t!==void 0&&t.exports?(n.default=n,t.exports=n):typeof define==`function`&&typeof define.amd==`object`&&define.amd?define(`classnames`,[],function(){return n}):window.classNames=n})()}))(),1),rS=Number.isNaN||function(e){return typeof e==`number`&&e!==e};function iS(e,t){return!!(e===t||rS(e)&&rS(t))}function aS(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!iS(e[n],t[n]))return!1;return!0}function oS(e,t){t===void 0&&(t=aS);var n=null;function r(){var r=[...arguments];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var i=e.apply(this,r);return n={lastResult:i,lastArgs:r,lastThis:this},i}return r.clear=function(){n=null},r}function sS(e,t,n){let r=0,i,a={},o=[];return e.forEach((e,s)=>{let c=t.some(e=>e>=s-n&&e<=s+n);!c&&i===void 0?(i={index:r,startLine:s,endLine:s,lines:1},o.push(i),a[s]=i.index,r++):!c&&i?(i.endLine=s,i.lines++,a[s]=i.index):i=void 0}),{lineBlocks:a,blocks:o}}var cS=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};const lS=new class extends cS{};function uS(e,t,n){return lS.diff(e,t,n)}function dS(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function fS(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function pS(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function mS(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function hS(e,t){return pS(e,t,``)}function gS(e,t){return mS(e,t,``)}function _S(e,t){return t.slice(0,vS(e,t))}function vS(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function yS(e){return e.includes(`\r
|
|
60
|
-
`)&&!e.startsWith(`
|
|
61
|
-
`)&&!e.match(/[^\r]\n/)}function bS(e){return!e.includes(`\r
|
|
62
|
-
`)&&e.includes(`
|
|
63
|
-
`)}function xS(e){let t;for(t=e.length-1;t>=0&&e[t].match(/\s/);t--);return e.substring(t+1)}function SS(e){let t=e.match(/^\s*/);return t?t[0]:``}var CS=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,wS=RegExp(`[${CS}]+|\\s+|[^${CS}]`,`ug`);const TS=new class extends cS{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=[];for(let t of Array.from(r.segment(e))){let e=t.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}}else n=e.match(wS)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&DS(n,i,r,e),n=e,r=null,i=null)}),(r||i)&&DS(n,i,r,null),e}};function ES(e,t,n){return n?.ignoreWhitespace!=null&&!n.ignoreWhitespace?kS(e,t,n):TS.diff(e,t,n)}function DS(e,t,n,r){if(t&&n){let i=SS(t.value),a=xS(t.value),o=SS(n.value),s=xS(n.value);if(e){let r=dS(i,o);e.value=mS(e.value,o,r),t.value=hS(t.value,r),n.value=hS(n.value,r)}if(r){let e=fS(a,s);r.value=pS(r.value,s,e),t.value=gS(t.value,e),n.value=gS(n.value,e)}}else if(n){if(e){let e=SS(n.value);n.value=n.value.substring(e.length)}if(r){let e=SS(r.value);r.value=r.value.substring(e.length)}}else if(e&&r){let n=SS(r.value),i=SS(t.value),a=xS(t.value),o=dS(n,i);t.value=hS(t.value,o);let s=fS(hS(n,o),a);t.value=gS(t.value,s),r.value=pS(r.value,n,s),e.value=mS(e.value,n,n.slice(0,n.length-s.length))}else if(r){let e=SS(r.value),n=_S(xS(t.value),e);t.value=gS(t.value,n)}else if(e){let n=_S(xS(e.value),SS(t.value));t.value=hS(t.value,n)}}const OS=new class extends cS{tokenize(e){let t=RegExp(`(\\r?\\n)|[${CS}]+|[^\\S\\n\\r]+|[^${CS}]`,`ug`);return e.match(t)||[]}};function kS(e,t,n){return OS.diff(e,t,n)}function AS(e,t){if(typeof e==`function`)t.callback=e;else if(e)for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}const jS=new class extends cS{constructor(){super(...arguments),this.tokenize=PS}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
64
|
-
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
65
|
-
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
66
|
-
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
67
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function MS(e,t,n){return jS.diff(e,t,n)}function NS(e,t,n){return n=AS(n,{ignoreWhitespace:!0}),jS.diff(e,t,n)}function PS(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
68
|
-
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function FS(e){return e==`.`||e==`!`||e==`?`}const IS=new class extends cS{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(FS(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}};function LS(e,t,n){return IS.diff(e,t,n)}const RS=new class extends cS{tokenize(e){return e.split(/([{}:;,]|\s+)/)}};function zS(e,t,n){return RS.diff(e,t,n)}const BS=new class extends cS{constructor(){super(...arguments),this.tokenize=PS}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(HS(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function VS(e,t,n){return BS.diff(e,t,n)}function HS(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=HS(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=HS(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}const US=new class extends cS{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function WS(e,t,n){return US.diff(e,t,n)}function GS(e){return Array.isArray(e)?e.map(e=>GS(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map((t,n)=>t.startsWith(`\\`)||t.endsWith(`\r`)||e.lines[n+1]?.startsWith(`\\`)?t:t+`\r`)}))})}function KS(e){return Array.isArray(e)?e.map(e=>KS(e)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(e=>Object.assign(Object.assign({},e),{lines:e.lines.map(e=>e.endsWith(`\r`)?e.substring(0,e.length-1):e)}))})}function qS(e){return Array.isArray(e)||(e=[e]),!e.some(e=>e.hunks.some(e=>e.lines.some(e=>!e.startsWith(`\\`)&&e.endsWith(`\r`))))}function JS(e){return Array.isArray(e)||(e=[e]),e.some(e=>e.hunks.some(e=>e.lines.some(e=>e.endsWith(`\r`))))&&e.every(e=>e.hunks.every(e=>e.lines.every((t,n)=>t.startsWith(`\\`)||t.endsWith(`\r`)||e.lines[n+1]?.startsWith(`\\`))))}function YS(e){let t=e.split(/\n/),n=[],r=0;function i(){let e={};for(n.push(e);r<t.length;){let n=t[r];if(/^(---|\+\+\+|@@)\s/.test(n))break;let i=/^(?:Index:|diff(?: -r \w+)+)\s+/.exec(n);i&&(e.index=n.substring(i[0].length).trim()),r++}for(a(e),a(e),e.hunks=[];r<t.length;){let n=t[r];if(/^(Index:\s|diff\s|---\s|\+\+\+\s|===================================================================)/.test(n))break;if(/^@@/.test(n))e.hunks.push(o());else if(n)throw Error(`Unknown line `+(r+1)+` `+JSON.stringify(n));else r++}}function a(e){let n=/^(---|\+\+\+)\s+/.exec(t[r]);if(n){let i=n[1],a=t[r].substring(3).trim().split(` `,2),o=(a[1]||``).trim(),s=a[0].replace(/\\\\/g,`\\`);s.startsWith(`"`)&&s.endsWith(`"`)&&(s=s.substr(1,s.length-2)),i===`---`?(e.oldFileName=s,e.oldHeader=o):(e.newFileName=s,e.newHeader=o),r++}}function o(){let e=r,n=t[r++].split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),i={oldStart:+n[1],oldLines:n[2]===void 0?1:+n[2],newStart:+n[3],newLines:n[4]===void 0?1:+n[4],lines:[]};i.oldLines===0&&(i.oldStart+=1),i.newLines===0&&(i.newStart+=1);let a=0,o=0;for(;r<t.length&&(o<i.oldLines||a<i.newLines||t[r]?.startsWith(`\\`));r++){let n=t[r].length==0&&r!=t.length-1?` `:t[r][0];if(n===`+`||n===`-`||n===` `||n===`\\`)i.lines.push(t[r]),n===`+`?a++:n===`-`?o++:n===` `&&(a++,o++);else throw Error(`Hunk at line ${e+1} contained invalid line ${t[r]}`)}if(!a&&i.newLines===1&&(i.newLines=0),!o&&i.oldLines===1&&(i.oldLines=0),a!==i.newLines)throw Error(`Added line count did not match for hunk at line `+(e+1));if(o!==i.oldLines)throw Error(`Removed line count did not match for hunk at line `+(e+1));return i}for(;r<t.length;)i();return n}function XS(e,t,n){let r=!0,i=!1,a=!1,o=1;return function s(){if(r&&!a){if(i?o++:r=!1,e+o<=n)return e+o;a=!0}if(!i)return a||(r=!0),t<=e-o?e-o++:(i=!0,s())}}function ZS(e,t,n={}){let r;if(r=typeof t==`string`?YS(t):Array.isArray(t)?t:[t],r.length>1)throw Error(`applyPatch only works with a single input.`);return QS(e,r[0],n)}function QS(e,t,n={}){(n.autoConvertLineEndings||n.autoConvertLineEndings==null)&&(yS(e)&&qS(t)?t=GS(t):bS(e)&&JS(t)&&(t=KS(t)));let r=e.split(`
|
|
69
|
-
`),i=t.hunks,a=n.compareLine||((e,t,n,r)=>t===r),o=n.fuzzFactor||0,s=0;if(o<0||!Number.isInteger(o))throw Error(`fuzzFactor must be a non-negative integer`);if(!i.length)return e;let c=``,l=!1,u=!1;for(let e=0;e<i[i.length-1].lines.length;e++){let t=i[i.length-1].lines[e];t[0]==`\\`&&(c[0]==`+`?l=!0:c[0]==`-`&&(u=!0)),c=t}if(l){if(u){if(!o&&r[r.length-1]==``)return!1}else if(r[r.length-1]==``)r.pop();else if(!o)return!1}else if(u){if(r[r.length-1]!=``)r.push(``);else if(!o)return!1}function d(e,t,n,i=0,o=!0,s=[],c=0){let l=0,u=!1;for(;i<e.length;i++){let f=e[i],p=f.length>0?f[0]:` `,m=f.length>0?f.substr(1):f;if(p===`-`)if(a(t+1,r[t],p,m))t++,l=0;else return!n||r[t]==null?null:(s[c]=r[t],d(e,t+1,n-1,i,!1,s,c+1));if(p===`+`){if(!o)return null;s[c]=m,c++,l=0,u=!0}if(p===` `)if(l++,s[c]=r[t],a(t+1,r[t],p,m))c++,o=!0,u=!1,t++;else return u||!n?null:r[t]&&(d(e,t+1,n-1,i+1,!1,s,c+1)||d(e,t+1,n-1,i,!1,s,c+1))||d(e,t,n-1,i+1,!1,s,c)}return c-=l,t-=l,s.length=c,{patchedLines:s,oldLineLastI:t-1}}let f=[],p=0;for(let e=0;e<i.length;e++){let t=i[e],n,a=r.length-t.oldLines+o,c;for(let e=0;e<=o;e++){c=t.oldStart+p-1;let r=XS(c,s,a);for(;c!==void 0&&(n=d(t.lines,c,e),!n);c=r());if(n)break}if(!n)return!1;for(let e=s;e<c;e++)f.push(r[e]);for(let e=0;e<n.patchedLines.length;e++){let t=n.patchedLines[e];f.push(t)}s=n.oldLineLastI+1,p=c+1-t.oldStart}for(let e=s;e<r.length;e++)f.push(r[e]);return f.join(`
|
|
70
|
-
`)}function $S(e,t){let n=typeof e==`string`?YS(e):e,r=0;function i(){let e=n[r++];if(!e)return t.complete();t.loadFile(e,function(n,r){if(n)return t.complete(n);let a=ZS(r,e,t);t.patched(e,a,function(e){if(e)return t.complete(e);i()})})}i()}function eC(e){return Array.isArray(e)?e.map(e=>eC(e)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(e=>({oldLines:e.newLines,oldStart:e.newStart,newLines:e.oldLines,newStart:e.oldStart,lines:e.lines.map(e=>e.startsWith(`-`)?`+${e.slice(1)}`:e.startsWith(`+`)?`-${e.slice(1)}`:e)}))})}const tC={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},nC={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},rC={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function iC(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;MS(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(MS(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||cC(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
71
|
-
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function aC(e,t){if(t||=tC,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>aC(e,t)).join(`
|
|
72
|
-
`)}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`),t.includeFileHeaders&&(n.push(`--- `+e.oldFileName+(e.oldHeader===void 0?``:` `+e.oldHeader)),n.push(`+++ `+e.newFileName+(e.newHeader===void 0?``:` `+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t];r.oldLines===0&&--r.oldStart,r.newLines===0&&--r.newStart,n.push(`@@ -`+r.oldStart+`,`+r.oldLines+` +`+r.newStart+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
73
|
-
`)+`
|
|
74
|
-
`}function oC(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;iC(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?aC(e,o.headerOptions):void 0)}}))}else{let s=iC(e,t,n,r,i,a,o);return s?aC(s,o?.headerOptions):void 0}}function sC(e,t,n,r,i,a){return oC(e,e,t,n,r,i,a)}function cC(e){let t=e.endsWith(`
|
|
75
|
-
`),n=e.split(`
|
|
76
|
-
`).map(e=>e+`
|
|
77
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function lC(e){let t=[],n,r;for(let i=0;i<e.length;i++)n=e[i],r=n.added?1:n.removed?-1:0,t.push([r,n.value]);return t}function uC(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];r.added?t.push(`<ins>`):r.removed&&t.push(`<del>`),t.push(dC(r.value)),r.added?t.push(`</ins>`):r.removed&&t.push(`</del>`)}return t.join(``)}function dC(e){let t=e;return t=t.replace(/&/g,`&`),t=t.replace(/</g,`<`),t=t.replace(/>/g,`>`),t=t.replace(/"/g,`"`),t}var fC=s({Diff:()=>cS,FILE_HEADERS_ONLY:()=>nC,INCLUDE_HEADERS:()=>tC,OMIT_HEADERS:()=>rC,applyPatch:()=>ZS,applyPatches:()=>$S,arrayDiff:()=>US,canonicalize:()=>HS,characterDiff:()=>lS,convertChangesToDMP:()=>lC,convertChangesToXML:()=>uC,createPatch:()=>sC,createTwoFilesPatch:()=>oC,cssDiff:()=>RS,diffArrays:()=>WS,diffChars:()=>uS,diffCss:()=>zS,diffJson:()=>VS,diffLines:()=>MS,diffSentences:()=>LS,diffTrimmedLines:()=>NS,diffWords:()=>ES,diffWordsWithSpace:()=>kS,formatPatch:()=>aC,jsonDiff:()=>BS,lineDiff:()=>jS,parsePatch:()=>YS,reversePatch:()=>eC,sentenceDiff:()=>IS,structuredPatch:()=>iC,wordDiff:()=>TS,wordsWithSpaceDiff:()=>OS},1);function pC(e){return e==null}function mC(e){return typeof e==`object`&&!!e}function hC(e){return Array.isArray(e)?e:pC(e)?[]:[e]}function gC(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function _C(e,t){var n=``,r;for(r=0;r<t;r+=1)n+=e;return n}function vC(e){return e===0&&1/e==-1/0}var yC={isNothing:pC,isObject:mC,toArray:hC,repeat:_C,isNegativeZero:vC,extend:gC};function bC(e,t){var n=``,r=e.reason||`(unknown reason)`;return e.mark?(e.mark.name&&(n+=`in "`+e.mark.name+`" `),n+=`(`+(e.mark.line+1)+`:`+(e.mark.column+1)+`)`,!t&&e.mark.snippet&&(n+=`
|
|
78
|
-
|
|
79
|
-
`+e.mark.snippet),r+` `+n):r}function xC(e,t){Error.call(this),this.name=`YAMLException`,this.reason=e,this.mark=t,this.message=bC(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack||``}xC.prototype=Object.create(Error.prototype),xC.prototype.constructor=xC,xC.prototype.toString=function(e){return this.name+`: `+bC(this,e)};var SC=xC;function CC(e,t,n,r,i){var a=``,o=``,s=Math.floor(i/2)-1;return r-t>s&&(a=` ... `,t=r-s+a.length),n-r>s&&(o=` ...`,n=r+s-o.length),{str:a+e.slice(t,n).replace(/\t/g,`→`)+o,pos:r-t+a.length}}function wC(e,t){return yC.repeat(` `,t-e.length)+e}function TC(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||=79,typeof t.indent!=`number`&&(t.indent=1),typeof t.linesBefore!=`number`&&(t.linesBefore=3),typeof t.linesAfter!=`number`&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=n.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s=``,c,l,u=Math.min(e.line+t.linesAfter,i.length).toString().length,d=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)l=CC(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),d),s=yC.repeat(` `,t.indent)+wC((e.line-c+1).toString(),u)+` | `+l.str+`
|
|
80
|
-
`+s;for(l=CC(e.buffer,r[o],i[o],e.position,d),s+=yC.repeat(` `,t.indent)+wC((e.line+1).toString(),u)+` | `+l.str+`
|
|
81
|
-
`,s+=yC.repeat(`-`,t.indent+u+3+l.pos)+`^
|
|
82
|
-
`,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)l=CC(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),d),s+=yC.repeat(` `,t.indent)+wC((e.line+c+1).toString(),u)+` | `+l.str+`
|
|
83
|
-
`;return s.replace(/\n$/,``)}var EC=TC,DC=[`kind`,`multi`,`resolve`,`construct`,`instanceOf`,`predicate`,`represent`,`representName`,`defaultStyle`,`styleAliases`],OC=[`scalar`,`sequence`,`mapping`];function kC(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(e){t[String(e)]=n})}),t}function AC(e,t){if(t||={},Object.keys(t).forEach(function(t){if(DC.indexOf(t)===-1)throw new SC(`Unknown option "`+t+`" is met in definition of "`+e+`" YAML type.`)}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(e){return e},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=kC(t.styleAliases||null),OC.indexOf(this.kind)===-1)throw new SC(`Unknown kind "`+this.kind+`" is specified for "`+e+`" YAML type.`)}var jC=AC;function MC(e,t){var n=[];return e[t].forEach(function(e){var t=n.length;n.forEach(function(n,r){n.tag===e.tag&&n.kind===e.kind&&n.multi===e.multi&&(t=r)}),n[t]=e}),n}function NC(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(t){t.multi?(e.multi[t.kind].push(t),e.multi.fallback.push(t)):e[t.kind][t.tag]=e.fallback[t.tag]=t}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function PC(e){return this.extend(e)}PC.prototype.extend=function(e){var t=[],n=[];if(e instanceof jC)n.push(e);else if(Array.isArray(e))n=n.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(n=n.concat(e.explicit));else throw new SC(`Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })`);t.forEach(function(e){if(!(e instanceof jC))throw new SC(`Specified list of YAML types (or a single Type object) contains a non-Type object.`);if(e.loadKind&&e.loadKind!==`scalar`)throw new SC(`There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.`);if(e.multi)throw new SC(`There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.`)}),n.forEach(function(e){if(!(e instanceof jC))throw new SC(`Specified list of YAML types (or a single Type object) contains a non-Type object.`)});var r=Object.create(PC.prototype);return r.implicit=(this.implicit||[]).concat(t),r.explicit=(this.explicit||[]).concat(n),r.compiledImplicit=MC(r,`implicit`),r.compiledExplicit=MC(r,`explicit`),r.compiledTypeMap=NC(r.compiledImplicit,r.compiledExplicit),r};var FC=new PC({explicit:[new jC(`tag:yaml.org,2002:str`,{kind:`scalar`,construct:function(e){return e===null?``:e}}),new jC(`tag:yaml.org,2002:seq`,{kind:`sequence`,construct:function(e){return e===null?[]:e}}),new jC(`tag:yaml.org,2002:map`,{kind:`mapping`,construct:function(e){return e===null?{}:e}})]});function IC(e){if(e===null)return!0;var t=e.length;return t===1&&e===`~`||t===4&&(e===`null`||e===`Null`||e===`NULL`)}function LC(){return null}function RC(e){return e===null}var zC=new jC(`tag:yaml.org,2002:null`,{kind:`scalar`,resolve:IC,construct:LC,predicate:RC,represent:{canonical:function(){return`~`},lowercase:function(){return`null`},uppercase:function(){return`NULL`},camelcase:function(){return`Null`},empty:function(){return``}},defaultStyle:`lowercase`});function BC(e){if(e===null)return!1;var t=e.length;return t===4&&(e===`true`||e===`True`||e===`TRUE`)||t===5&&(e===`false`||e===`False`||e===`FALSE`)}function VC(e){return e===`true`||e===`True`||e===`TRUE`}function HC(e){return Object.prototype.toString.call(e)===`[object Boolean]`}var UC=new jC(`tag:yaml.org,2002:bool`,{kind:`scalar`,resolve:BC,construct:VC,predicate:HC,represent:{lowercase:function(e){return e?`true`:`false`},uppercase:function(e){return e?`TRUE`:`FALSE`},camelcase:function(e){return e?`True`:`False`}},defaultStyle:`lowercase`});function WC(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function GC(e){return 48<=e&&e<=55}function KC(e){return 48<=e&&e<=57}function qC(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i===`-`||i===`+`)&&(i=e[++n]),i===`0`){if(n+1===t)return!0;if(i=e[++n],i===`b`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(i!==`0`&&i!==`1`)return!1;r=!0}return r&&i!==`_`}if(i===`x`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!WC(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}if(i===`o`){for(n++;n<t;n++)if(i=e[n],i!==`_`){if(!GC(e.charCodeAt(n)))return!1;r=!0}return r&&i!==`_`}}if(i===`_`)return!1;for(;n<t;n++)if(i=e[n],i!==`_`){if(!KC(e.charCodeAt(n)))return!1;r=!0}return!(!r||i===`_`)}function JC(e){var t=e,n=1,r;if(t.indexOf(`_`)!==-1&&(t=t.replace(/_/g,``)),r=t[0],(r===`-`||r===`+`)&&(r===`-`&&(n=-1),t=t.slice(1),r=t[0]),t===`0`)return 0;if(r===`0`){if(t[1]===`b`)return n*parseInt(t.slice(2),2);if(t[1]===`x`)return n*parseInt(t.slice(2),16);if(t[1]===`o`)return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function YC(e){return Object.prototype.toString.call(e)===`[object Number]`&&e%1==0&&!yC.isNegativeZero(e)}var XC=new jC(`tag:yaml.org,2002:int`,{kind:`scalar`,resolve:qC,construct:JC,predicate:YC,represent:{binary:function(e){return e>=0?`0b`+e.toString(2):`-0b`+e.toString(2).slice(1)},octal:function(e){return e>=0?`0o`+e.toString(8):`-0o`+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?`0x`+e.toString(16).toUpperCase():`-0x`+e.toString(16).toUpperCase().slice(1)}},defaultStyle:`decimal`,styleAliases:{binary:[2,`bin`],octal:[8,`oct`],decimal:[10,`dec`],hexadecimal:[16,`hex`]}}),ZC=RegExp(`^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$`);function QC(e){return!(e===null||!ZC.test(e)||e[e.length-1]===`_`)}function $C(e){var t=e.replace(/_/g,``).toLowerCase(),n=t[0]===`-`?-1:1;return`+-`.indexOf(t[0])>=0&&(t=t.slice(1)),t===`.inf`?n===1?1/0:-1/0:t===`.nan`?NaN:n*parseFloat(t,10)}var ew=/^[-+]?[0-9]+e/;function tw(e,t){var n;if(isNaN(e))switch(t){case`lowercase`:return`.nan`;case`uppercase`:return`.NAN`;case`camelcase`:return`.NaN`}else if(e===1/0)switch(t){case`lowercase`:return`.inf`;case`uppercase`:return`.INF`;case`camelcase`:return`.Inf`}else if(e===-1/0)switch(t){case`lowercase`:return`-.inf`;case`uppercase`:return`-.INF`;case`camelcase`:return`-.Inf`}else if(yC.isNegativeZero(e))return`-0.0`;return n=e.toString(10),ew.test(n)?n.replace(`e`,`.e`):n}function nw(e){return Object.prototype.toString.call(e)===`[object Number]`&&(e%1!=0||yC.isNegativeZero(e))}var rw=new jC(`tag:yaml.org,2002:float`,{kind:`scalar`,resolve:QC,construct:$C,predicate:nw,represent:tw,defaultStyle:`lowercase`}),iw=FC.extend({implicit:[zC,UC,XC,rw]}),aw=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$`),ow=RegExp(`^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$`);function sw(e){return e===null?!1:aw.exec(e)!==null||ow.exec(e)!==null}function cw(e){var t,n,r,i,a,o,s,c=0,l=null,u,d,f;if(t=aw.exec(e),t===null&&(t=ow.exec(e)),t===null)throw Error(`Date resolve error`);if(n=+t[1],r=t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+=`0`;c=+c}return t[9]&&(u=+t[10],d=+(t[11]||0),l=(u*60+d)*6e4,t[9]===`-`&&(l=-l)),f=new Date(Date.UTC(n,r,i,a,o,s,c)),l&&f.setTime(f.getTime()-l),f}function lw(e){return e.toISOString()}var uw=new jC(`tag:yaml.org,2002:timestamp`,{kind:`scalar`,resolve:sw,construct:cw,instanceOf:Date,represent:lw});function dw(e){return e===`<<`||e===null}var fw=new jC(`tag:yaml.org,2002:merge`,{kind:`scalar`,resolve:dw}),pw=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
84
|
-
\r`;function mw(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=pw;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8==0}function hw(e){var t,n,r=e.replace(/[\r\n=]/g,``),i=r.length,a=pw,o=0,s=[];for(t=0;t<i;t++)t%4==0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),new Uint8Array(s)}function gw(e){var t=``,n=0,r,i,a=e.length,o=pw;for(r=0;r<a;r++)r%3==0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function _w(e){return Object.prototype.toString.call(e)===`[object Uint8Array]`}var vw=new jC(`tag:yaml.org,2002:binary`,{kind:`scalar`,resolve:mw,construct:hw,predicate:_w,represent:gw}),yw=Object.prototype.hasOwnProperty,bw=Object.prototype.toString;function xw(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,bw.call(i)!==`[object Object]`)return!1;for(a in i)if(yw.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function Sw(e){return e===null?[]:e}var Cw=new jC(`tag:yaml.org,2002:omap`,{kind:`sequence`,resolve:xw,construct:Sw}),ww=Object.prototype.toString;function Tw(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],ww.call(r)!==`[object Object]`||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function Ew(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var Dw=new jC(`tag:yaml.org,2002:pairs`,{kind:`sequence`,resolve:Tw,construct:Ew}),Ow=Object.prototype.hasOwnProperty;function kw(e){if(e===null)return!0;var t,n=e;for(t in n)if(Ow.call(n,t)&&n[t]!==null)return!1;return!0}function Aw(e){return e===null?{}:e}var jw=new jC(`tag:yaml.org,2002:set`,{kind:`mapping`,resolve:kw,construct:Aw}),Mw=iw.extend({implicit:[uw,fw],explicit:[vw,Cw,Dw,jw]}),Nw=Object.prototype.hasOwnProperty,Pw=1,Fw=2,Iw=3,Lw=4,Rw=1,zw=2,Bw=3,Vw=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Hw=/[\x85\u2028\u2029]/,Uw=/[,\[\]\{\}]/,Ww=/^(?:!|!!|![a-z\-]+!)$/i,Gw=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Kw(e){return Object.prototype.toString.call(e)}function qw(e){return e===10||e===13}function Jw(e){return e===9||e===32}function Yw(e){return e===9||e===32||e===10||e===13}function Xw(e){return e===44||e===91||e===93||e===123||e===125}function Zw(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Qw(e){return e===120?2:e===117?4:e===85?8:0}function $w(e){return 48<=e&&e<=57?e-48:-1}function eT(e){return e===48?`\0`:e===97?`\x07`:e===98?`\b`:e===116||e===9?` `:e===110?`
|
|
85
|
-
`:e===118?`\v`:e===102?`\f`:e===114?`\r`:e===101?`\x1B`:e===32?` `:e===34?`"`:e===47?`/`:e===92?`\\`:e===78?`
`:e===95?`\xA0`:e===76?`\u2028`:e===80?`\u2029`:``}function tT(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function nT(e,t,n){t===`__proto__`?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}for(var rT=Array(256),iT=Array(256),aT=0;aT<256;aT++)rT[aT]=eT(aT)?1:0,iT[aT]=eT(aT);function oT(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||Mw,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function sT(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=EC(n),new SC(t,n)}function q(e,t){throw sT(e,t)}function cT(e,t){e.onWarning&&e.onWarning.call(null,sT(e,t))}var lT={YAML:function(e,t,n){var r,i,a;e.version!==null&&q(e,`duplication of %YAML directive`),n.length!==1&&q(e,`YAML directive accepts exactly one argument`),r=/^([0-9]+)\.([0-9]+)$/.exec(n[0]),r===null&&q(e,`ill-formed argument of the YAML directive`),i=parseInt(r[1],10),a=parseInt(r[2],10),i!==1&&q(e,`unacceptable YAML version of the document`),e.version=n[0],e.checkLineBreaks=a<2,a!==1&&a!==2&&cT(e,`unsupported YAML version of the document`)},TAG:function(e,t,n){var r,i;n.length!==2&&q(e,`TAG directive accepts exactly two arguments`),r=n[0],i=n[1],Ww.test(r)||q(e,`ill-formed tag handle (first argument) of the TAG directive`),Nw.call(e.tagMap,r)&&q(e,`there is a previously declared suffix for "`+r+`" tag handle`),Gw.test(i)||q(e,`ill-formed tag prefix (second argument) of the TAG directive`);try{i=decodeURIComponent(i)}catch{q(e,`tag prefix is malformed: `+i)}e.tagMap[r]=i}};function uT(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||q(e,`expected valid JSON character`);else Vw.test(s)&&q(e,`the stream contains non-printable characters`);e.result+=s}}function dT(e,t,n,r){var i,a,o,s;for(yC.isObject(n)||q(e,`cannot merge mappings; the provided source object is unacceptable`),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Nw.call(t,a)||(nT(t,a,n[a]),r[a]=!0)}function fT(e,t,n,r,i,a,o,s,c){var l,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),l=0,u=i.length;l<u;l+=1)Array.isArray(i[l])&&q(e,`nested arrays are not supported inside keys`),typeof i==`object`&&Kw(i[l])===`[object Object]`&&(i[l]=`[object Object]`);if(typeof i==`object`&&Kw(i)===`[object Object]`&&(i=`[object Object]`),i=String(i),t===null&&(t={}),r===`tag:yaml.org,2002:merge`)if(Array.isArray(a))for(l=0,u=a.length;l<u;l+=1)dT(e,t,a[l],n);else dT(e,t,a,n);else !e.json&&!Nw.call(n,i)&&Nw.call(t,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=c||e.position,q(e,`duplicated mapping key`)),nT(t,i,a),delete n[i];return t}function pT(e){var t=e.input.charCodeAt(e.position);t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):q(e,`a line break is expected`),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function mT(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;Jw(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(qw(i))for(pT(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&cT(e,`deficient indentation`),r}function hT(e){var t=e.position,n=e.input.charCodeAt(t);return!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Yw(n)))}function gT(e,t){t===1?e.result+=` `:t>1&&(e.result+=yC.repeat(`
|
|
86
|
-
`,t-1))}function _T(e,t,n){var r,i,a,o,s,c,l,u,d=e.kind,f=e.result,p=e.input.charCodeAt(e.position);if(Yw(p)||Xw(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),Yw(i)||n&&Xw(i)))return!1;for(e.kind=`scalar`,e.result=``,a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),Yw(i)||n&&Xw(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),Yw(r))break}else if(e.position===e.lineStart&&hT(e)||n&&Xw(p))break;else if(qw(p))if(c=e.line,l=e.lineStart,u=e.lineIndent,mT(e,!1,-1),e.lineIndent>=t){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=l,e.lineIndent=u;break}s&&=(uT(e,a,o,!1),gT(e,e.line-c),a=o=e.position,!1),Jw(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return uT(e,a,o,!1),e.result?!0:(e.kind=d,e.result=f,!1)}function vT(e,t){var n=e.input.charCodeAt(e.position),r,i;if(n!==39)return!1;for(e.kind=`scalar`,e.result=``,e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(uT(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else qw(n)?(uT(e,r,i,!0),gT(e,mT(e,!1,t)),r=i=e.position):e.position===e.lineStart&&hT(e)?q(e,`unexpected end of the document within a single quoted scalar`):(e.position++,i=e.position);q(e,`unexpected end of the stream within a single quoted scalar`)}function yT(e,t){var n,r,i,a,o,s=e.input.charCodeAt(e.position);if(s!==34)return!1;for(e.kind=`scalar`,e.result=``,e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;)if(s===34)return uT(e,n,e.position,!0),e.position++,!0;else if(s===92){if(uT(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),qw(s))mT(e,!1,t);else if(s<256&&rT[s])e.result+=iT[s],e.position++;else if((o=Qw(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=Zw(s))>=0?a=(a<<4)+o:q(e,`expected hexadecimal character`);e.result+=tT(a),e.position++}else q(e,`unknown escape sequence`);n=r=e.position}else qw(s)?(uT(e,n,r,!0),gT(e,mT(e,!1,t)),n=r=e.position):e.position===e.lineStart&&hT(e)?q(e,`unexpected end of the document within a double quoted scalar`):(e.position++,r=e.position);q(e,`unexpected end of the stream within a double quoted scalar`)}function bT(e,t){var n=!0,r,i,a,o=e.tag,s,c=e.anchor,l,u,d,f,p,m=Object.create(null),h,g,_,v=e.input.charCodeAt(e.position);if(v===91)u=93,p=!1,s=[];else if(v===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(mT(e,!0,t),v=e.input.charCodeAt(e.position),v===u)return e.position++,e.tag=o,e.anchor=c,e.kind=p?`mapping`:`sequence`,e.result=s,!0;n?v===44&&q(e,`expected the node content, but found ','`):q(e,`missed comma between flow collection entries`),g=h=_=null,d=f=!1,v===63&&(l=e.input.charCodeAt(e.position+1),Yw(l)&&(d=f=!0,e.position++,mT(e,!0,t))),r=e.line,i=e.lineStart,a=e.position,DT(e,t,Pw,!1,!0),g=e.tag,h=e.result,mT(e,!0,t),v=e.input.charCodeAt(e.position),(f||e.line===r)&&v===58&&(d=!0,v=e.input.charCodeAt(++e.position),mT(e,!0,t),DT(e,t,Pw,!1,!0),_=e.result),p?fT(e,s,m,g,h,_,r,i,a):d?s.push(fT(e,null,m,g,h,_,r,i,a)):s.push(h),mT(e,!0,t),v=e.input.charCodeAt(e.position),v===44?(n=!0,v=e.input.charCodeAt(++e.position)):n=!1}q(e,`unexpected end of the stream within a flow collection`)}function xT(e,t){var n,r,i=Rw,a=!1,o=!1,s=t,c=0,l=!1,u,d=e.input.charCodeAt(e.position);if(d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind=`scalar`,e.result=``;d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Rw===i?i=d===43?Bw:zw:q(e,`repeat of a chomping mode identifier`);else if((u=$w(d))>=0)u===0?q(e,`bad explicit indentation width of a block scalar; it cannot be less than one`):o?q(e,`repeat of an indentation width identifier`):(s=t+u-1,o=!0);else break;if(Jw(d)){do d=e.input.charCodeAt(++e.position);while(Jw(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!qw(d)&&d!==0)}for(;d!==0;){for(pT(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&d===32;)e.lineIndent++,d=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),qw(d)){c++;continue}if(e.lineIndent<s){i===Bw?e.result+=yC.repeat(`
|
|
87
|
-
`,a?1+c:c):i===Rw&&a&&(e.result+=`
|
|
88
|
-
`);break}for(r?Jw(d)?(l=!0,e.result+=yC.repeat(`
|
|
89
|
-
`,a?1+c:c)):l?(l=!1,e.result+=yC.repeat(`
|
|
90
|
-
`,c+1)):c===0?a&&(e.result+=` `):e.result+=yC.repeat(`
|
|
91
|
-
`,c):e.result+=yC.repeat(`
|
|
92
|
-
`,a?1+c:c),a=!0,o=!0,c=0,n=e.position;!qw(d)&&d!==0;)d=e.input.charCodeAt(++e.position);uT(e,n,e.position,!1)}return!0}function ST(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,q(e,`tab characters must not be used in indentation`)),!(c!==45||(o=e.input.charCodeAt(e.position+1),!Yw(o))));){if(s=!0,e.position++,mT(e,!0,-1)&&e.lineIndent<=t){a.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,DT(e,t,Iw,!1,!0),a.push(e.result),mT(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)q(e,`bad indentation of a sequence entry`);else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind=`sequence`,e.result=a,!0):!1}function CT(e,t,n){var r,i,a,o,s,c,l=e.tag,u=e.anchor,d={},f=Object.create(null),p=null,m=null,h=null,g=!1,_=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),v=e.input.charCodeAt(e.position);v!==0;){if(!g&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,q(e,`tab characters must not be used in indentation`)),r=e.input.charCodeAt(e.position+1),a=e.line,(v===63||v===58)&&Yw(r))v===63?(g&&(fT(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!0,i=!0):g?(g=!1,i=!0):q(e,`incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line`),e.position+=1,v=r;else{if(o=e.line,s=e.lineStart,c=e.position,!DT(e,n,Fw,!1,!0))break;if(e.line===a){for(v=e.input.charCodeAt(e.position);Jw(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),Yw(v)||q(e,`a whitespace character is expected after the key-value separator within a block mapping`),g&&(fT(e,d,f,p,m,null,o,s,c),p=m=h=null),_=!0,g=!1,i=!1,p=e.tag,m=e.result;else if(_)q(e,`can not read an implicit mapping pair; a colon is missed`);else return e.tag=l,e.anchor=u,!0}else if(_)q(e,`can not read a block mapping entry; a multiline key may not be an implicit key`);else return e.tag=l,e.anchor=u,!0}if((e.line===a||e.lineIndent>t)&&(g&&(o=e.line,s=e.lineStart,c=e.position),DT(e,t,Lw,!0,i)&&(g?m=e.result:h=e.result),g||(fT(e,d,f,p,m,h,o,s,c),p=m=h=null),mT(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>t)&&v!==0)q(e,`bad indentation of a mapping entry`);else if(e.lineIndent<t)break}return g&&fT(e,d,f,p,m,null,o,s,c),_&&(e.tag=l,e.anchor=u,e.kind=`mapping`,e.result=d),_}function wT(e){var t,n=!1,r=!1,i,a,o=e.input.charCodeAt(e.position);if(o!==33)return!1;if(e.tag!==null&&q(e,`duplication of a tag property`),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i=`!!`,o=e.input.charCodeAt(++e.position)):i=`!`,t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):q(e,`unexpected end of the stream within a verbatim tag`)}else{for(;o!==0&&!Yw(o);)o===33&&(r?q(e,`tag suffix cannot contain exclamation marks`):(i=e.input.slice(t-1,e.position+1),Ww.test(i)||q(e,`named tag handle cannot contain such characters`),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),Uw.test(a)&&q(e,`tag suffix cannot contain flow indicator characters`)}a&&!Gw.test(a)&&q(e,`tag name cannot contain such characters: `+a);try{a=decodeURIComponent(a)}catch{q(e,`tag name is malformed: `+a)}return n?e.tag=a:Nw.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i===`!`?e.tag=`!`+a:i===`!!`?e.tag=`tag:yaml.org,2002:`+a:q(e,`undeclared tag handle "`+i+`"`),!0}function TT(e){var t,n=e.input.charCodeAt(e.position);if(n!==38)return!1;for(e.anchor!==null&&q(e,`duplication of an anchor property`),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Yw(n)&&!Xw(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&q(e,`name of an anchor node must contain at least one character`),e.anchor=e.input.slice(t,e.position),!0}function ET(e){var t,n,r=e.input.charCodeAt(e.position);if(r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Yw(r)&&!Xw(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&q(e,`name of an alias node must contain at least one character`),n=e.input.slice(t,e.position),Nw.call(e.anchorMap,n)||q(e,`unidentified alias "`+n+`"`),e.result=e.anchorMap[n],mT(e,!0,-1),!0}function DT(e,t,n,r,i){var a,o,s,c=1,l=!1,u=!1,d,f,p,m,h,g;if(e.listener!==null&&e.listener(`open`,e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Lw===n||Iw===n,r&&mT(e,!0,-1)&&(l=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;wT(e)||TT(e);)mT(e,!0,-1)?(l=!0,s=a,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):s=!1;if(s&&=l||i,(c===1||Lw===n)&&(h=Pw===n||Fw===n?t:t+1,g=e.position-e.lineStart,c===1?s&&(ST(e,g)||CT(e,g,h))||bT(e,h)?u=!0:(o&&xT(e,h)||vT(e,h)||yT(e,h)?u=!0:ET(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&q(e,`alias node should not have any properties`)):_T(e,h,Pw===n)&&(u=!0,e.tag===null&&(e.tag=`?`)),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=s&&ST(e,g))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag===`?`){for(e.result!==null&&e.kind!==`scalar`&&q(e,`unacceptable node kind for !<?> tag; it should be "scalar", not "`+e.kind+`"`),d=0,f=e.implicitTypes.length;d<f;d+=1)if(m=e.implicitTypes[d],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!==`!`){if(Nw.call(e.typeMap[e.kind||`fallback`],e.tag))m=e.typeMap[e.kind||`fallback`][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||`fallback`],d=0,f=p.length;d<f;d+=1)if(e.tag.slice(0,p[d].tag.length)===p[d].tag){m=p[d];break}m||q(e,`unknown tag !<`+e.tag+`>`),e.result!==null&&m.kind!==e.kind&&q(e,`unacceptable node kind for !<`+e.tag+`> tag; it should be "`+m.kind+`", not "`+e.kind+`"`),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):q(e,`cannot resolve a node with !<`+e.tag+`> explicit tag`)}return e.listener!==null&&e.listener(`close`,e),e.tag!==null||e.anchor!==null||u}function OT(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(mT(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Yw(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&q(e,`directive name must not be less than one character in length`);o!==0;){for(;Jw(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!qw(o));break}if(qw(o))break;for(n=e.position;o!==0&&!Yw(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&pT(e),Nw.call(lT,r)?lT[r](e,r,i):cT(e,`unknown document directive "`+r+`"`)}if(mT(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,mT(e,!0,-1)):a&&q(e,`directives end mark is expected`),DT(e,e.lineIndent-1,Lw,!1,!0),mT(e,!0,-1),e.checkLineBreaks&&Hw.test(e.input.slice(t,e.position))&&cT(e,`non-ASCII line breaks are interpreted as content`),e.documents.push(e.result),e.position===e.lineStart&&hT(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,mT(e,!0,-1));return}if(e.position<e.length-1)q(e,`end of the stream or a document separator is expected`);else return}function kT(e,t){e=String(e),t||={},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
|
|
93
|
-
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new oT(e,t),r=e.indexOf(`\0`);for(r!==-1&&(n.position=r,q(n,`null byte is not allowed in input`)),n.input+=`\0`;n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)OT(n);return n.documents}function AT(e,t,n){typeof t==`object`&&t&&n===void 0&&(n=t,t=null);var r=kT(e,n);if(typeof t!=`function`)return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function jT(e,t){var n=kT(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new SC(`expected a single document in the stream, but found more`)}}var MT={loadAll:AT,load:jT},NT=Object.prototype.toString,PT=Object.prototype.hasOwnProperty,FT=65279,IT=9,LT=10,RT=13,zT=32,BT=33,VT=34,HT=35,UT=37,WT=38,GT=39,KT=42,qT=44,JT=45,YT=58,XT=61,ZT=62,QT=63,$T=64,eE=91,tE=93,nE=96,rE=123,iE=124,aE=125,oE={};oE[0]=`\\0`,oE[7]=`\\a`,oE[8]=`\\b`,oE[9]=`\\t`,oE[10]=`\\n`,oE[11]=`\\v`,oE[12]=`\\f`,oE[13]=`\\r`,oE[27]=`\\e`,oE[34]=`\\"`,oE[92]=`\\\\`,oE[133]=`\\N`,oE[160]=`\\_`,oE[8232]=`\\L`,oE[8233]=`\\P`;var sE=[`y`,`Y`,`yes`,`Yes`,`YES`,`on`,`On`,`ON`,`n`,`N`,`no`,`No`,`NO`,`off`,`Off`,`OFF`],cE=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function lE(e,t){var n,r,i,a,o,s,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)===`!!`&&(o=`tag:yaml.org,2002:`+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&PT.call(c.styleAliases,s)&&(s=c.styleAliases[s]),n[o]=s;return n}function uE(e){var t=e.toString(16).toUpperCase(),n,r;if(e<=255)n=`x`,r=2;else if(e<=65535)n=`u`,r=4;else if(e<=4294967295)n=`U`,r=8;else throw new SC(`code point within a string may not be greater than 0xFFFFFFFF`);return`\\`+n+yC.repeat(`0`,r-t.length)+t}var dE=1,fE=2;function pE(e){this.schema=e.schema||Mw,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=yC.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=lE(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===`"`?fE:dE,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==`function`?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result=``,this.duplicates=[],this.usedDuplicates=null}function mE(e,t){for(var n=yC.repeat(` `,t),r=0,i=-1,a=``,o,s=e.length;r<s;)i=e.indexOf(`
|
|
94
|
-
`,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
|
|
95
|
-
`&&(a+=n),a+=o;return a}function hE(e,t){return`
|
|
96
|
-
`+yC.repeat(` `,e.indent*t)}function gE(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function _E(e){return e===zT||e===IT}function vE(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==FT||65536<=e&&e<=1114111}function yE(e){return vE(e)&&e!==FT&&e!==RT&&e!==LT}function bE(e,t,n){var r=yE(e),i=r&&!_E(e);return(n?r:r&&e!==qT&&e!==eE&&e!==tE&&e!==rE&&e!==aE)&&e!==HT&&!(t===YT&&!i)||yE(t)&&!_E(t)&&e===HT||t===YT&&i}function xE(e){return vE(e)&&e!==FT&&!_E(e)&&e!==JT&&e!==QT&&e!==YT&&e!==qT&&e!==eE&&e!==tE&&e!==rE&&e!==aE&&e!==HT&&e!==WT&&e!==KT&&e!==BT&&e!==iE&&e!==XT&&e!==ZT&&e!==GT&&e!==VT&&e!==UT&&e!==$T&&e!==nE}function SE(e){return!_E(e)&&e!==YT}function CE(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function wE(e){return/^\n* /.test(e)}var TE=1,EE=2,DE=3,OE=4,kE=5;function AE(e,t,n,r,i,a,o,s){var c,l=0,u=null,d=!1,f=!1,p=r!==-1,m=-1,h=xE(CE(e,0))&&SE(CE(e,e.length-1));if(t||o)for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=CE(e,c),!vE(l))return kE;h&&=bE(l,u,s),u=l}else{for(c=0;c<e.length;l>=65536?c+=2:c++){if(l=CE(e,c),l===LT)d=!0,p&&(f||=c-m-1>r&&e[m+1]!==` `,m=c);else if(!vE(l))return kE;h&&=bE(l,u,s),u=l}f||=p&&c-m-1>r&&e[m+1]!==` `}return!d&&!f?h&&!o&&!i(e)?TE:a===fE?kE:EE:n>9&&wE(e)?kE:o?a===fE?kE:EE:f?OE:DE}function jE(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===fE?`""`:`''`;if(!e.noCompatMode&&(sE.indexOf(t)!==-1||cE.test(t)))return e.quotingType===fE?`"`+t+`"`:`'`+t+`'`;var a=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&n>=e.flowLevel;function c(t){return gE(e,t)}switch(AE(t,s,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case TE:return t;case EE:return`'`+t.replace(/'/g,`''`)+`'`;case DE:return`|`+ME(t,e.indent)+NE(mE(t,a));case OE:return`>`+ME(t,e.indent)+NE(mE(PE(t,o),a));case kE:return`"`+IE(t)+`"`;default:throw new SC(`impossible error: invalid scalar style`)}}()}function ME(e,t){var n=wE(e)?String(t):``,r=e[e.length-1]===`
|
|
97
|
-
`;return n+(r&&(e[e.length-2]===`
|
|
98
|
-
`||e===`
|
|
99
|
-
`)?`+`:r?``:`-`)+`
|
|
100
|
-
`}function NE(e){return e[e.length-1]===`
|
|
101
|
-
`?e.slice(0,-1):e}function PE(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var r=e.indexOf(`
|
|
102
|
-
`);return r=r===-1?e.length:r,n.lastIndex=r,FE(e.slice(0,r),t)}(),i=e[0]===`
|
|
103
|
-
`||e[0]===` `,a,o;o=n.exec(e);){var s=o[1],c=o[2];a=c[0]===` `,r+=s+(!i&&!a&&c!==``?`
|
|
104
|
-
`:``)+FE(c,t),i=a}return r}function FE(e,t){if(e===``||e[0]===` `)return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,c=``;r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,c+=`
|
|
105
|
-
`+e.slice(i,a),i=a+1),o=s;return c+=`
|
|
106
|
-
`,e.length-i>t&&o>i?c+=e.slice(i,o)+`
|
|
107
|
-
`+e.slice(o+1):c+=e.slice(i),c.slice(1)}function IE(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=CE(e,i),r=oE[n],!r&&vE(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||uE(n);return t}function LE(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(HE(e,t,s,!1,!1)||s===void 0&&HE(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}function RE(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(HE(e,t+1,c,!0,!0,!1,!0)||c===void 0&&HE(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=hE(e,t)),e.dump&<===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}function zE(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),HE(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),HE(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}function BE(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new SC(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=hE(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),HE(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&<===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=hE(e,t)),HE(e,t+1,u,!0,d)&&(e.dump&<===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}function VE(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,NT.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(PT.call(s.represent,c))r=s.represent[c](t,c);else throw new SC(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}function HE(e,t,n,r,i,a,o){e.tag=null,e.dump=n,VE(e,n,!1)||VE(e,n,!0);var s=NT.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(BE(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(zE(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?RE(e,t-1,e.dump,i):RE(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(LE(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&jE(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new SC(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}function UE(e,t){var n=[],r=[],i,a;for(WE(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}function WE(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)WE(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)WE(e[r[i]],t,n)}function GE(e,t){t||={};var n=new pE(t);n.noRefs||UE(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),HE(n,0,r,!0,!0)?n.dump+`
|
|
108
|
-
`:``}var KE={dump:GE},qE=MT.load;MT.loadAll;var JE=KE.dump,YE=fC,XE;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.ADDED=1]=`ADDED`,e[e.REMOVED=2]=`REMOVED`,e[e.CHANGED=3]=`CHANGED`})(XE||={});function ZE(e,t){return t===`yaml`?JE(e,{indent:2,lineWidth:-1,noRefs:!0}).trimEnd():JSON.stringify(e,null,2)}function QE(e,t,n=`json`){let r=ZE(e,n);return r===ZE(t,n)?[{value:r}]:nD(e,t,0,n)}function $E(e,t){return QE(e,t,`json`)}function eD(e,t){try{let n=JSON.parse(e),r=JSON.parse(t);return JSON.stringify(n)===JSON.stringify(r)?[{value:e}]:MS(e,t,{newlineIsToken:!1})}catch{return MS(e,t,{newlineIsToken:!1})}}function tD(e,t){let n=qE(e),r=qE(t);return JE(n,{indent:2,lineWidth:-1,noRefs:!0})===JE(r,{indent:2,lineWidth:-1,noRefs:!0})?[{value:e}]:MS(e,t,{newlineIsToken:!1})}function nD(e,t,n,r=`json`){let i=ZE(e,r),a=ZE(t,r);return i===a?[{value:oD(i,n,r)}]:typeof e==`object`&&e&&typeof t==`object`&&t&&!Array.isArray(e)&&!Array.isArray(t)?rD(e,t,n,r):Array.isArray(e)&&Array.isArray(t)?iD(e,t,n,r):aD(i,a,n,r)}function rD(e,t,n,r=`json`){let i=[],a=` `.repeat(n),o=` `.repeat(n+1),s=new Set(Object.keys(e)),c=Object.keys(t),l=[...s].filter(e=>!(e in t)),u=[...c,...l];i.push({value:`{
|
|
109
|
-
`});for(let a=0;a<u.length;a++){let s=u[a],c=a===u.length-1?``:`,`,l=s in e,d=s in t;if(l&&d){let a=ZE(e[s],r);if(a===ZE(t[s],r)){let e=oD(a,n+1);i.push({value:o+JSON.stringify(s)+`: `+e+c+`
|
|
110
|
-
`})}else{let a=o+JSON.stringify(s)+`: `,l=nD(e[s],t[s],n+1,r);if(l.length>0)if(!l[0].removed&&!l[0].added)l[0].value=a+l[0].value;else{let e=l.find(e=>e.removed),t=l.find(e=>e.added);e&&(e.value=a+e.value),t&&(t.value=a+t.value)}if(c&&l.length>0){let e=l[l.length-1];e.value=e.value.replace(/\n$/,c+`
|
|
111
|
-
`)}i.push(...l)}}else if(l){let t=oD(ZE(e[s],r),n+1);i.push({removed:!0,value:o+JSON.stringify(s)+`: `+t+c+`
|
|
112
|
-
`})}else{let e=oD(ZE(t[s],r),n+1);i.push({added:!0,value:o+JSON.stringify(s)+`: `+e+c+`
|
|
113
|
-
`})}}return i.push({value:a+`}
|
|
114
|
-
`}),i}function iD(e,t,n,r=`json`){let i=[],a=` `.repeat(n),o=` `.repeat(n+1);i.push({value:`[
|
|
115
|
-
`});let s=Math.max(e.length,t.length);for(let a=0;a<s;a++){let c=a===s-1?``:`,`;if(a>=e.length){let e=oD(ZE(t[a],r),n+1);i.push({added:!0,value:o+e+c+`
|
|
116
|
-
`})}else if(a>=t.length){let t=oD(ZE(e[a],r),n+1);i.push({removed:!0,value:o+t+c+`
|
|
117
|
-
`})}else{let s=ZE(e[a],r);if(s===ZE(t[a],r)){let e=oD(s,n+1);i.push({value:o+e+c+`
|
|
118
|
-
`})}else{let s=nD(e[a],t[a],n+1,r);if(s.length>0&&(s[0].value=o+s[0].value),c&&s.length>0){let e=s[s.length-1];e.value=e.value.replace(/\n$/,c+`
|
|
119
|
-
`)}i.push(...s)}}}return i.push({value:a+`]
|
|
120
|
-
`}),i}function aD(e,t,n,r=`json`){return MS(oD(e,n),oD(t,n)).map(e=>({value:e.value,added:e.added,removed:e.removed}))}function oD(e,t,n=`json`){if(t===0)return e;let r=` `.repeat(t);return e.split(`
|
|
121
|
-
`).map((e,t)=>t===0?e:r+e).join(`
|
|
122
|
-
`)}var sD;(function(e){e.CHARS=`diffChars`,e.WORDS=`diffWords`,e.WORDS_WITH_SPACE=`diffWordsWithSpace`,e.LINES=`diffLines`,e.TRIMMED_LINES=`diffTrimmedLines`,e.SENTENCES=`diffSentences`,e.CSS=`diffCss`,e.JSON=`diffJson`,e.YAML=`diffYaml`})(sD||={});var cD=e=>e===``?[]:e.replace(/\n$/,``).split(`
|
|
123
|
-
`),lD=(e,t,n=sD.CHARS)=>{let r=(typeof n==`string`?YE[n]:n)(e,t),i={left:[],right:[]};return r.forEach(({added:e,removed:t,value:n})=>{let r={};return e&&(r.type=XE.ADDED,r.value=n,i.right.push(r)),t&&(r.type=XE.REMOVED,r.value=n,i.left.push(r)),!t&&!e&&(r.type=XE.DEFAULT,r.value=n,i.right.push(r),i.left.push(r)),r}),i},uD=(e,t,n=!1,r=sD.CHARS,i=0,a=[],o=!1)=>{let s=[];if(typeof e==`string`&&typeof t==`string`)if(r===sD.JSON)s=eD(e,t);else if(r===sD.YAML)try{s=tD(e,t)}catch{s=MS(e,t,{newlineIsToken:!1})}else s=MS(e,t,{newlineIsToken:!1});else s=$E(e,t);let c=i,l=i,u=[],d=0,f=[],p=[],m=(e,t,i,u,h)=>cD(e).map((e,g)=>{let _={},v={};if(!(p.includes(`${t}-${g}`)||h&&g!==0)){if(i||u){let i=!0;if(u){l+=1,_.lineNumber=l,_.type=XE.REMOVED,_.value=e||` `;let a=s[t+1];if(a?.added){let s=cD(a.value)[g];if(s){let{value:a,lineNumber:c,type:l}=m(s,t,!0,!1,!0)[0].right;if(p.push(`${t+1}-${g}`),v.lineNumber=c,_.value===a)i=!1,v.type=0,_.type=0,v.value=a;else{v.type=l;let t=e.length>500||a.length>500;if(n||t)v.value=a;else if(o)_.rawValue=e,_.value=e,v.rawValue=a,v.value=a;else{let t=lD(e,a,r);v.value=t.right,_.value=t.left}}}}}else c+=1,v.lineNumber=c,v.type=XE.ADDED,v.value=e;i&&!h&&(f.includes(d)||f.push(d))}else l+=1,c+=1,_.lineNumber=l,_.type=XE.DEFAULT,_.value=e,v.lineNumber=c,v.type=XE.DEFAULT,v.value=e;return(a?.includes(`L-${_.lineNumber}`)||a?.includes(`R-${v.lineNumber}`)&&!f.includes(d))&&f.push(d),h||(d+=1),{right:v,left:_}}}).filter(Boolean);return s.forEach(({added:e,removed:t,value:n},r)=>{u=[...u,...m(n,r,e,t)]}),{lineInformation:u,diffLines:f}},dD=null,fD=()=>{if(dD!==null)return dD;if(typeof Worker>`u`||typeof Blob>`u`||typeof URL>`u`)return null;try{let e=new Blob(['(()=>{var Si=Object.defineProperty;var bi=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,i)=>(typeof require<"u"?require:n)[i]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error(\'Dynamic require of "\'+e+\'" is not supported\')});var _i=(e,n)=>{for(var i in n)Si(e,i,{get:n[i],enumerable:!0})};var $e={};_i($e,{Diff:()=>b,FILE_HEADERS_ONLY:()=>_n,INCLUDE_HEADERS:()=>Ue,OMIT_HEADERS:()=>Ln,applyPatch:()=>je,applyPatches:()=>bn,arrayDiff:()=>Pe,canonicalize:()=>V,characterDiff:()=>ye,convertChangesToDMP:()=>On,convertChangesToXML:()=>In,createPatch:()=>Fn,createTwoFilesPatch:()=>Ye,cssDiff:()=>Ne,diffArrays:()=>wn,diffChars:()=>sn,diffCss:()=>yn,diffJson:()=>An,diffLines:()=>N,diffSentences:()=>vn,diffTrimmedLines:()=>xn,diffWords:()=>mn,diffWordsWithSpace:()=>Le,formatPatch:()=>ee,jsonDiff:()=>Re,lineDiff:()=>ce,parsePatch:()=>Z,reversePatch:()=>Be,sentenceDiff:()=>ke,structuredPatch:()=>ae,wordDiff:()=>be,wordsWithSpaceDiff:()=>_e});var b=class{diff(n,i,r={}){let l;typeof r=="function"?(l=r,r={}):"callback"in r&&(l=r.callback);let t=this.castInput(n,r),o=this.castInput(i,r),u=this.removeEmpty(this.tokenize(t,r)),f=this.removeEmpty(this.tokenize(o,r));return this.diffWithOptionsObj(u,f,r,l)}diffWithOptionsObj(n,i,r,l){var t;let o=m=>{if(m=this.postProcess(m,r),l){setTimeout(function(){l(m)},0);return}else return m},u=i.length,f=n.length,c=1,s=u+f;r.maxEditLength!=null&&(s=Math.min(s,r.maxEditLength));let a=(t=r.timeout)!==null&&t!==void 0?t:1/0,p=Date.now()+a,d=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(d[0],i,n,0,r);if(d[0].oldPos+1>=f&&h+1>=u)return o(this.buildValues(d[0].lastComponent,i,n));let g=-1/0,y=1/0,w=()=>{for(let m=Math.max(g,-c);m<=Math.min(y,c);m+=2){let x,A=d[m-1],C=d[m+1];A&&(d[m-1]=void 0);let F=!1;if(C){let S=C.oldPos-m;F=C&&0<=S&&S<u}let E=A&&A.oldPos+1<f;if(!F&&!E){d[m]=void 0;continue}if(!E||F&&A.oldPos<C.oldPos?x=this.addToPath(C,!0,!1,0,r):x=this.addToPath(A,!1,!0,1,r),h=this.extractCommon(x,i,n,m,r),x.oldPos+1>=f&&h+1>=u)return o(this.buildValues(x.lastComponent,i,n))||!0;d[m]=x,x.oldPos+1>=f&&(y=Math.min(y,m-1)),h+1>=u&&(g=Math.max(g,m+1))}c++};if(l)(function m(){setTimeout(function(){if(c>s||Date.now()>p)return l(void 0);w()||m()},0)})();else for(;c<=s&&Date.now()<=p;){let m=w();if(m)return m}}addToPath(n,i,r,l,t){let o=n.lastComponent;return o&&!t.oneChangePerToken&&o.added===i&&o.removed===r?{oldPos:n.oldPos+l,lastComponent:{count:o.count+1,added:i,removed:r,previousComponent:o.previousComponent}}:{oldPos:n.oldPos+l,lastComponent:{count:1,added:i,removed:r,previousComponent:o}}}extractCommon(n,i,r,l,t){let o=i.length,u=r.length,f=n.oldPos,c=f-l,s=0;for(;c+1<o&&f+1<u&&this.equals(r[f+1],i[c+1],t);)c++,f++,s++,t.oneChangePerToken&&(n.lastComponent={count:1,previousComponent:n.lastComponent,added:!1,removed:!1});return s&&!t.oneChangePerToken&&(n.lastComponent={count:s,previousComponent:n.lastComponent,added:!1,removed:!1}),n.oldPos=f,c}equals(n,i,r){return r.comparator?r.comparator(n,i):n===i||!!r.ignoreCase&&n.toLowerCase()===i.toLowerCase()}removeEmpty(n){let i=[];for(let r=0;r<n.length;r++)n[r]&&i.push(n[r]);return i}castInput(n,i){return n}tokenize(n,i){return Array.from(n)}join(n){return n.join("")}postProcess(n,i){return n}get useLongestToken(){return!1}buildValues(n,i,r){let l=[],t;for(;n;)l.push(n),t=n.previousComponent,delete n.previousComponent,n=t;l.reverse();let o=l.length,u=0,f=0,c=0;for(;u<o;u++){let s=l[u];if(s.removed)s.value=this.join(r.slice(c,c+s.count)),c+=s.count;else{if(!s.added&&this.useLongestToken){let a=i.slice(f,f+s.count);a=a.map(function(p,d){let h=r[c+d];return h.length>p.length?h:p}),s.value=this.join(a)}else s.value=this.join(i.slice(f,f+s.count));f+=s.count,s.added||(c+=s.count)}}return l}};var ve=class extends b{},ye=new ve;function sn(e,n,i){return ye.diff(e,n,i)}function Ae(e,n){let i;for(i=0;i<e.length&&i<n.length;i++)if(e[i]!=n[i])return e.slice(0,i);return e.slice(0,i)}function we(e,n){let i;if(!e||!n||e[e.length-1]!=n[n.length-1])return"";for(i=0;i<e.length&&i<n.length;i++)if(e[e.length-(i+1)]!=n[n.length-(i+1)])return e.slice(-i);return e.slice(-i)}function te(e,n,i){if(e.slice(0,n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn\'t start with prefix ${JSON.stringify(n)}; this is a bug`);return i+e.slice(n.length)}function ue(e,n,i){if(!n)return e+i;if(e.slice(-n.length)!=n)throw Error(`string ${JSON.stringify(e)} doesn\'t end with suffix ${JSON.stringify(n)}; this is a bug`);return e.slice(0,-n.length)+i}function q(e,n){return te(e,n,"")}function X(e,n){return ue(e,n,"")}function Ce(e,n){return n.slice(0,Li(e,n))}function Li(e,n){let i=0;e.length>n.length&&(i=e.length-n.length);let r=n.length;e.length<n.length&&(r=e.length);let l=Array(r),t=0;l[0]=0;for(let o=1;o<r;o++){for(n[o]==n[t]?l[o]=l[t]:l[o]=t;t>0&&n[o]!=n[t];)t=l[t];n[o]==n[t]&&t++}t=0;for(let o=i;o<e.length;o++){for(;t>0&&e[o]!=n[t];)t=l[t];e[o]==n[t]&&t++}return t}function pn(e){return e.includes(`\\r\n`)&&!e.startsWith(`\n`)&&!e.match(/[^\\r]\\n/)}function dn(e){return!e.includes(`\\r\n`)&&e.includes(`\n`)}function z(e){let n;for(n=e.length-1;n>=0&&e[n].match(/\\s/);n--);return e.substring(n+1)}function M(e){let n=e.match(/^\\s*/);return n?n[0]:""}var fe="a-zA-Z0-9_\\\\u{AD}\\\\u{C0}-\\\\u{D6}\\\\u{D8}-\\\\u{F6}\\\\u{F8}-\\\\u{2C6}\\\\u{2C8}-\\\\u{2D7}\\\\u{2DE}-\\\\u{2FF}\\\\u{1E00}-\\\\u{1EFF}",Fi=new RegExp(`[${fe}]+|\\\\s+|[^${fe}]`,"ug"),Ee=class extends b{equals(n,i,r){return r.ignoreCase&&(n=n.toLowerCase(),i=i.toLowerCase()),n.trim()===i.trim()}tokenize(n,i={}){let r;if(i.intlSegmenter){let o=i.intlSegmenter;if(o.resolvedOptions().granularity!="word")throw new Error(\'The segmenter passed must have a granularity of "word"\');r=[];for(let u of Array.from(o.segment(n))){let f=u.segment;r.length&&/\\s/.test(r[r.length-1])&&/\\s/.test(f)?r[r.length-1]+=f:r.push(f)}}else r=n.match(Fi)||[];let l=[],t=null;return r.forEach(o=>{/\\s/.test(o)?t==null?l.push(o):l.push(l.pop()+o):t!=null&&/\\s/.test(t)?l[l.length-1]==t?l.push(l.pop()+o):l.push(t+o):l.push(o),t=o}),l}join(n){return n.map((i,r)=>r==0?i:i.replace(/^\\s+/,"")).join("")}postProcess(n,i){if(!n||i.oneChangePerToken)return n;let r=null,l=null,t=null;return n.forEach(o=>{o.added?l=o:o.removed?t=o:((l||t)&&hn(r,t,l,o),r=o,l=null,t=null)}),(l||t)&&hn(r,t,l,null),n}},be=new Ee;function mn(e,n,i){return i?.ignoreWhitespace!=null&&!i.ignoreWhitespace?Le(e,n,i):be.diff(e,n,i)}function hn(e,n,i,r){if(n&&i){let l=M(n.value),t=z(n.value),o=M(i.value),u=z(i.value);if(e){let f=Ae(l,o);e.value=ue(e.value,o,f),n.value=q(n.value,f),i.value=q(i.value,f)}if(r){let f=we(t,u);r.value=te(r.value,u,f),n.value=X(n.value,f),i.value=X(i.value,f)}}else if(i){if(e){let l=M(i.value);i.value=i.value.substring(l.length)}if(r){let l=M(r.value);r.value=r.value.substring(l.length)}}else if(e&&r){let l=M(r.value),t=M(n.value),o=z(n.value),u=Ae(l,t);n.value=q(n.value,u);let f=we(q(l,u),o);n.value=X(n.value,f),r.value=te(r.value,l,f),e.value=ue(e.value,l,l.slice(0,l.length-f.length))}else if(r){let l=M(r.value),t=z(n.value),o=Ce(t,l);n.value=X(n.value,o)}else if(e){let l=z(e.value),t=M(n.value),o=Ce(l,t);n.value=q(n.value,o)}}var Se=class extends b{tokenize(n){let i=new RegExp(`(\\\\r?\\\\n)|[${fe}]+|[^\\\\S\\\\n\\\\r]+|[^${fe}]`,"ug");return n.match(i)||[]}},_e=new Se;function Le(e,n,i){return _e.diff(e,n,i)}function gn(e,n){if(typeof e=="function")n.callback=e;else if(e)for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i]);return n}var Fe=class extends b{constructor(){super(...arguments),this.tokenize=Oe}equals(n,i,r){return r.ignoreWhitespace?((!r.newlineIsToken||!n.includes(`\n`))&&(n=n.trim()),(!r.newlineIsToken||!i.includes(`\n`))&&(i=i.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(n.endsWith(`\n`)&&(n=n.slice(0,-1)),i.endsWith(`\n`)&&(i=i.slice(0,-1))),super.equals(n,i,r)}},ce=new Fe;function N(e,n,i){return ce.diff(e,n,i)}function xn(e,n,i){return i=gn(i,{ignoreWhitespace:!0}),ce.diff(e,n,i)}function Oe(e,n){n.stripTrailingCr&&(e=e.replace(/\\r\\n/g,`\n`));let i=[],r=e.split(/(\\n|\\r\\n)/);r[r.length-1]||r.pop();for(let l=0;l<r.length;l++){let t=r[l];l%2&&!n.newlineIsToken?i[i.length-1]+=t:i.push(t)}return i}function Oi(e){return e=="."||e=="!"||e=="?"}var Ie=class extends b{tokenize(n){var i;let r=[],l=0;for(let t=0;t<n.length;t++){if(t==n.length-1){r.push(n.slice(l));break}if(Oi(n[t])&&n[t+1].match(/\\s/)){for(r.push(n.slice(l,t+1)),t=l=t+1;!((i=n[t+1])===null||i===void 0)&&i.match(/\\s/);)t++;r.push(n.slice(l,t+1)),l=t+1}}return r}},ke=new Ie;function vn(e,n,i){return ke.diff(e,n,i)}var Te=class extends b{tokenize(n){return n.split(/([{}:;,]|\\s+)/)}},Ne=new Te;function yn(e,n,i){return Ne.diff(e,n,i)}var De=class extends b{constructor(){super(...arguments),this.tokenize=Oe}get useLongestToken(){return!0}castInput(n,i){let{undefinedReplacement:r,stringifyReplacer:l=(t,o)=>typeof o>"u"?r:o}=i;return typeof n=="string"?n:JSON.stringify(V(n,null,null,l),null," ")}equals(n,i,r){return super.equals(n.replace(/,([\\r\\n])/g,"$1"),i.replace(/,([\\r\\n])/g,"$1"),r)}},Re=new De;function An(e,n,i){return Re.diff(e,n,i)}function V(e,n,i,r,l){n=n||[],i=i||[],r&&(e=r(l===void 0?"":l,e));let t;for(t=0;t<n.length;t+=1)if(n[t]===e)return i[t];let o;if(Object.prototype.toString.call(e)==="[object Array]"){for(n.push(e),o=new Array(e.length),i.push(o),t=0;t<e.length;t+=1)o[t]=V(e[t],n,i,r,String(t));return n.pop(),i.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e=="object"&&e!==null){n.push(e),o={},i.push(o);let u=[],f;for(f in e)Object.prototype.hasOwnProperty.call(e,f)&&u.push(f);for(u.sort(),t=0;t<u.length;t+=1)f=u[t],o[f]=V(e[f],n,i,r,f);n.pop(),i.pop()}else o=e;return o}var Me=class extends b{tokenize(n){return n.slice()}join(n){return n}removeEmpty(n){return n}},Pe=new Me;function wn(e,n,i){return Pe.diff(e,n,i)}function We(e){return Array.isArray(e)?e.map(n=>We(n)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(n=>Object.assign(Object.assign({},n),{lines:n.lines.map((i,r)=>{var l;return i.startsWith("\\\\")||i.endsWith("\\r")||!((l=n.lines[r+1])===null||l===void 0)&&l.startsWith("\\\\")?i:i+"\\r"})}))})}function He(e){return Array.isArray(e)?e.map(n=>He(n)):Object.assign(Object.assign({},e),{hunks:e.hunks.map(n=>Object.assign(Object.assign({},n),{lines:n.lines.map(i=>i.endsWith("\\r")?i.substring(0,i.length-1):i)}))})}function Cn(e){return Array.isArray(e)||(e=[e]),!e.some(n=>n.hunks.some(i=>i.lines.some(r=>!r.startsWith("\\\\")&&r.endsWith("\\r"))))}function En(e){return Array.isArray(e)||(e=[e]),e.some(n=>n.hunks.some(i=>i.lines.some(r=>r.endsWith("\\r"))))&&e.every(n=>n.hunks.every(i=>i.lines.every((r,l)=>{var t;return r.startsWith("\\\\")||r.endsWith("\\r")||((t=i.lines[l+1])===null||t===void 0?void 0:t.startsWith("\\\\"))})))}function Z(e){let n=e.split(/\\n/),i=[],r=0;function l(){let u={};for(i.push(u);r<n.length;){let f=n[r];if(/^(---|\\+\\+\\+|@@)\\s/.test(f))break;let c=/^(?:Index:|diff(?: -r \\w+)+)\\s+/.exec(f);c&&(u.index=f.substring(c[0].length).trim()),r++}for(t(u),t(u),u.hunks=[];r<n.length;){let f=n[r];if(/^(Index:\\s|diff\\s|---\\s|\\+\\+\\+\\s|===================================================================)/.test(f))break;if(/^@@/.test(f))u.hunks.push(o());else{if(f)throw new Error("Unknown line "+(r+1)+" "+JSON.stringify(f));r++}}}function t(u){let f=/^(---|\\+\\+\\+)\\s+/.exec(n[r]);if(f){let c=f[1],s=n[r].substring(3).trim().split(" ",2),a=(s[1]||"").trim(),p=s[0].replace(/\\\\\\\\/g,"\\\\");p.startsWith(\'"\')&&p.endsWith(\'"\')&&(p=p.substr(1,p.length-2)),c==="---"?(u.oldFileName=p,u.oldHeader=a):(u.newFileName=p,u.newHeader=a),r++}}function o(){var u;let f=r,c=n[r++],s=c.split(/@@ -(\\d+)(?:,(\\d+))? \\+(\\d+)(?:,(\\d+))? @@/),a={oldStart:+s[1],oldLines:typeof s[2]>"u"?1:+s[2],newStart:+s[3],newLines:typeof s[4]>"u"?1:+s[4],lines:[]};a.oldLines===0&&(a.oldStart+=1),a.newLines===0&&(a.newStart+=1);let p=0,d=0;for(;r<n.length&&(d<a.oldLines||p<a.newLines||!((u=n[r])===null||u===void 0)&&u.startsWith("\\\\"));r++){let h=n[r].length==0&&r!=n.length-1?" ":n[r][0];if(h==="+"||h==="-"||h===" "||h==="\\\\")a.lines.push(n[r]),h==="+"?p++:h==="-"?d++:h===" "&&(p++,d++);else throw new Error(`Hunk at line ${f+1} contained invalid line ${n[r]}`)}if(!p&&a.newLines===1&&(a.newLines=0),!d&&a.oldLines===1&&(a.oldLines=0),p!==a.newLines)throw new Error("Added line count did not match for hunk at line "+(f+1));if(d!==a.oldLines)throw new Error("Removed line count did not match for hunk at line "+(f+1));return a}for(;r<n.length;)l();return i}function Sn(e,n,i){let r=!0,l=!1,t=!1,o=1;return function u(){if(r&&!t){if(l?o++:r=!1,e+o<=i)return e+o;t=!0}if(!l)return t||(r=!0),n<=e-o?e-o++:(l=!0,u())}}function je(e,n,i={}){let r;if(typeof n=="string"?r=Z(n):Array.isArray(n)?r=n:r=[n],r.length>1)throw new Error("applyPatch only works with a single input.");return Ii(e,r[0],i)}function Ii(e,n,i={}){(i.autoConvertLineEndings||i.autoConvertLineEndings==null)&&(pn(e)&&Cn(n)?n=We(n):dn(e)&&En(n)&&(n=He(n)));let r=e.split(`\n`),l=n.hunks,t=i.compareLine||((h,g,y,w)=>g===w),o=i.fuzzFactor||0,u=0;if(o<0||!Number.isInteger(o))throw new Error("fuzzFactor must be a non-negative integer");if(!l.length)return e;let f="",c=!1,s=!1;for(let h=0;h<l[l.length-1].lines.length;h++){let g=l[l.length-1].lines[h];g[0]=="\\\\"&&(f[0]=="+"?c=!0:f[0]=="-"&&(s=!0)),f=g}if(c){if(s){if(!o&&r[r.length-1]=="")return!1}else if(r[r.length-1]=="")r.pop();else if(!o)return!1}else if(s){if(r[r.length-1]!="")r.push("");else if(!o)return!1}function a(h,g,y,w=0,m=!0,x=[],A=0){let C=0,F=!1;for(;w<h.length;w++){let E=h[w],S=E.length>0?E[0]:" ",$=E.length>0?E.substr(1):E;if(S==="-")if(t(g+1,r[g],S,$))g++,C=0;else return!y||r[g]==null?null:(x[A]=r[g],a(h,g+1,y-1,w,!1,x,A+1));if(S==="+"){if(!m)return null;x[A]=$,A++,C=0,F=!0}if(S===" ")if(C++,x[A]=r[g],t(g+1,r[g],S,$))A++,m=!0,F=!1,g++;else return F||!y?null:r[g]&&(a(h,g+1,y-1,w+1,!1,x,A+1)||a(h,g+1,y-1,w,!1,x,A+1))||a(h,g,y-1,w+1,!1,x,A)}return A-=C,g-=C,x.length=A,{patchedLines:x,oldLineLastI:g-1}}let p=[],d=0;for(let h=0;h<l.length;h++){let g=l[h],y,w=r.length-g.oldLines+o,m;for(let x=0;x<=o;x++){m=g.oldStart+d-1;let A=Sn(m,u,w);for(;m!==void 0&&(y=a(g.lines,m,x),!y);m=A());if(y)break}if(!y)return!1;for(let x=u;x<m;x++)p.push(r[x]);for(let x=0;x<y.patchedLines.length;x++){let A=y.patchedLines[x];p.push(A)}u=y.oldLineLastI+1,d=m+1-g.oldStart}for(let h=u;h<r.length;h++)p.push(r[h]);return p.join(`\n`)}function bn(e,n){let i=typeof e=="string"?Z(e):e,r=0;function l(){let t=i[r++];if(!t)return n.complete();n.loadFile(t,function(o,u){if(o)return n.complete(o);let f=je(u,t,n);n.patched(t,f,function(c){if(c)return n.complete(c);l()})})}l()}function Be(e){return Array.isArray(e)?e.map(n=>Be(n)).reverse():Object.assign(Object.assign({},e),{oldFileName:e.newFileName,oldHeader:e.newHeader,newFileName:e.oldFileName,newHeader:e.oldHeader,hunks:e.hunks.map(n=>({oldLines:n.newLines,oldStart:n.newStart,newLines:n.oldLines,newStart:n.oldStart,lines:n.lines.map(i=>i.startsWith("-")?`+${i.slice(1)}`:i.startsWith("+")?`-${i.slice(1)}`:i)}))})}var Ue={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0},_n={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!0},Ln={includeIndex:!1,includeUnderline:!1,includeFileHeaders:!1};function ae(e,n,i,r,l,t,o){let u;o?typeof o=="function"?u={callback:o}:u=o:u={},typeof u.context>"u"&&(u.context=4);let f=u.context;if(u.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(u.callback){let{callback:s}=u;N(i,r,Object.assign(Object.assign({},u),{callback:a=>{let p=c(a);s(p)}}))}else return c(N(i,r,u));function c(s){if(!s)return;s.push({value:"",lines:[]});function a(m){return m.map(function(x){return" "+x})}let p=[],d=0,h=0,g=[],y=1,w=1;for(let m=0;m<s.length;m++){let x=s[m],A=x.lines||ki(x.value);if(x.lines=A,x.added||x.removed){if(!d){let C=s[m-1];d=y,h=w,C&&(g=f>0?a(C.lines.slice(-f)):[],d-=g.length,h-=g.length)}for(let C of A)g.push((x.added?"+":"-")+C);x.added?w+=A.length:y+=A.length}else{if(d)if(A.length<=f*2&&m<s.length-2)for(let C of a(A))g.push(C);else{let C=Math.min(A.length,f);for(let E of a(A.slice(0,C)))g.push(E);let F={oldStart:d,oldLines:y-d+C,newStart:h,newLines:w-h+C,lines:g};p.push(F),d=0,h=0,g=[]}y+=A.length,w+=A.length}}for(let m of p)for(let x=0;x<m.lines.length;x++)m.lines[x].endsWith(`\n`)?m.lines[x]=m.lines[x].slice(0,-1):(m.lines.splice(x+1,0,"\\\"),x++);return{oldFileName:e,newFileName:n,oldHeader:l,newHeader:t,hunks:p}}}function ee(e,n){if(n||(n=Ue),Array.isArray(e)){if(e.length>1&&!n.includeFileHeaders)throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(r=>ee(r,n)).join(`\n`)}let i=[];n.includeIndex&&e.oldFileName==e.newFileName&&i.push("Index: "+e.oldFileName),n.includeUnderline&&i.push("==================================================================="),n.includeFileHeaders&&(i.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),i.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let r=0;r<e.hunks.length;r++){let l=e.hunks[r];l.oldLines===0&&(l.oldStart-=1),l.newLines===0&&(l.newStart-=1),i.push("@@ -"+l.oldStart+","+l.oldLines+" +"+l.newStart+","+l.newLines+" @@");for(let t of l.lines)i.push(t)}return i.join(`\n`)+`\n`}function Ye(e,n,i,r,l,t,o){if(typeof o=="function"&&(o={callback:o}),o?.callback){let{callback:u}=o;ae(e,n,i,r,l,t,Object.assign(Object.assign({},o),{callback:f=>{u(f?ee(f,o.headerOptions):void 0)}}))}else{let u=ae(e,n,i,r,l,t,o);return u?ee(u,o?.headerOptions):void 0}}function Fn(e,n,i,r,l,t){return Ye(e,e,n,i,r,l,t)}function ki(e){let n=e.endsWith(`\n`),i=e.split(`\n`).map(r=>r+`\n`);return n?i.pop():i.push(i.pop().slice(0,-1)),i}function On(e){let n=[],i,r;for(let l=0;l<e.length;l++)i=e[l],i.added?r=1:i.removed?r=-1:r=0,n.push([r,i.value]);return n}function In(e){let n=[];for(let i=0;i<e.length;i++){let r=e[i];r.added?n.push("<ins>"):r.removed&&n.push("<del>"),n.push(Ti(r.value)),r.added?n.push("</ins>"):r.removed&&n.push("</del>")}return n.join("")}function Ti(e){let n=e;return n=n.replace(/&/g,"&"),n=n.replace(/</g,"<"),n=n.replace(/>/g,">"),n=n.replace(/"/g,"""),n}function zn(e){return typeof e>"u"||e===null}function Ni(e){return typeof e=="object"&&e!==null}function Di(e){return Array.isArray(e)?e:zn(e)?[]:[e]}function Ri(e,n){var i,r,l,t;if(n)for(t=Object.keys(n),i=0,r=t.length;i<r;i+=1)l=t[i],e[l]=n[l];return e}function Mi(e,n){var i="",r;for(r=0;r<n;r+=1)i+=e;return i}function Pi(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Wi=zn,Hi=Ni,ji=Di,Bi=Mi,Ui=Pi,Yi=Ri,L={isNothing:Wi,isObject:Hi,toArray:ji,repeat:Bi,isNegativeZero:Ui,extend:Yi};function Gn(e,n){var i="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(i+=\'in "\'+e.mark.name+\'" \'),i+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(i+=`\n\n`+e.mark.snippet),r+" "+i):r}function ie(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Gn(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ie.prototype=Object.create(Error.prototype);ie.prototype.constructor=ie;ie.prototype.toString=function(n){return this.name+": "+Gn(this,n)};var k=ie;function qe(e,n,i,r,l){var t="",o="",u=Math.floor(l/2)-1;return r-n>u&&(t=" ... ",n=r-u+t.length),i-r>u&&(o=" ...",i=r+u-o.length),{str:t+e.slice(n,i).replace(/\\t/g,"\\u2192")+o,pos:r-n+t.length}}function ze(e,n){return L.repeat(" ",n-e.length)+e}function $i(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var i=/\\r?\\n|\\r|\\0/g,r=[0],l=[],t,o=-1;t=i.exec(e.buffer);)l.push(t.index),r.push(t.index+t[0].length),e.position<=t.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var u="",f,c,s=Math.min(e.line+n.linesAfter,l.length).toString().length,a=n.maxLength-(n.indent+s+3);for(f=1;f<=n.linesBefore&&!(o-f<0);f++)c=qe(e.buffer,r[o-f],l[o-f],e.position-(r[o]-r[o-f]),a),u=L.repeat(" ",n.indent)+ze((e.line-f+1).toString(),s)+" | "+c.str+`\n`+u;for(c=qe(e.buffer,r[o],l[o],e.position,a),u+=L.repeat(" ",n.indent)+ze((e.line+1).toString(),s)+" | "+c.str+`\n`,u+=L.repeat("-",n.indent+s+3+c.pos)+`^\n`,f=1;f<=n.linesAfter&&!(o+f>=l.length);f++)c=qe(e.buffer,r[o+f],l[o+f],e.position-(r[o]-r[o+f]),a),u+=L.repeat(" ",n.indent)+ze((e.line+f+1).toString(),s)+" | "+c.str+`\n`;return u.replace(/\\n$/,"")}var qi=$i,zi=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Gi=["scalar","sequence","mapping"];function Ji(e){var n={};return e!==null&&Object.keys(e).forEach(function(i){e[i].forEach(function(r){n[String(r)]=i})}),n}function Ki(e,n){if(n=n||{},Object.keys(n).forEach(function(i){if(zi.indexOf(i)===-1)throw new k(\'Unknown option "\'+i+\'" is met in definition of "\'+e+\'" YAML type.\')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(i){return i},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Ji(n.styleAliases||null),Gi.indexOf(this.kind)===-1)throw new k(\'Unknown kind "\'+this.kind+\'" is specified for "\'+e+\'" YAML type.\')}var O=Ki;function kn(e,n){var i=[];return e[n].forEach(function(r){var l=i.length;i.forEach(function(t,o){t.tag===r.tag&&t.kind===r.kind&&t.multi===r.multi&&(l=o)}),i[l]=r}),i}function Qi(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,i;function r(l){l.multi?(e.multi[l.kind].push(l),e.multi.fallback.push(l)):e[l.kind][l.tag]=e.fallback[l.tag]=l}for(n=0,i=arguments.length;n<i;n+=1)arguments[n].forEach(r);return e}function Je(e){return this.extend(e)}Je.prototype.extend=function(n){var i=[],r=[];if(n instanceof O)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(i=i.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new k("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");i.forEach(function(t){if(!(t instanceof O))throw new k("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(t.loadKind&&t.loadKind!=="scalar")throw new k("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(t.multi)throw new k("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(t){if(!(t instanceof O))throw new k("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var l=Object.create(Je.prototype);return l.implicit=(this.implicit||[]).concat(i),l.explicit=(this.explicit||[]).concat(r),l.compiledImplicit=kn(l,"implicit"),l.compiledExplicit=kn(l,"explicit"),l.compiledTypeMap=Qi(l.compiledImplicit,l.compiledExplicit),l};var Xi=Je,Vi=new O("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Zi=new O("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),er=new O("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),nr=new Xi({explicit:[Vi,Zi,er]});function ir(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function rr(){return null}function lr(e){return e===null}var or=new O("tag:yaml.org,2002:null",{kind:"scalar",resolve:ir,construct:rr,predicate:lr,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function tr(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function ur(e){return e==="true"||e==="True"||e==="TRUE"}function fr(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var cr=new O("tag:yaml.org,2002:bool",{kind:"scalar",resolve:tr,construct:ur,predicate:fr,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function ar(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function sr(e){return 48<=e&&e<=55}function pr(e){return 48<=e&&e<=57}function dr(e){if(e===null)return!1;var n=e.length,i=0,r=!1,l;if(!n)return!1;if(l=e[i],(l==="-"||l==="+")&&(l=e[++i]),l==="0"){if(i+1===n)return!0;if(l=e[++i],l==="b"){for(i++;i<n;i++)if(l=e[i],l!=="_"){if(l!=="0"&&l!=="1")return!1;r=!0}return r&&l!=="_"}if(l==="x"){for(i++;i<n;i++)if(l=e[i],l!=="_"){if(!ar(e.charCodeAt(i)))return!1;r=!0}return r&&l!=="_"}if(l==="o"){for(i++;i<n;i++)if(l=e[i],l!=="_"){if(!sr(e.charCodeAt(i)))return!1;r=!0}return r&&l!=="_"}}if(l==="_")return!1;for(;i<n;i++)if(l=e[i],l!=="_"){if(!pr(e.charCodeAt(i)))return!1;r=!0}return!(!r||l==="_")}function hr(e){var n=e,i=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(i=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return i*parseInt(n.slice(2),2);if(n[1]==="x")return i*parseInt(n.slice(2),16);if(n[1]==="o")return i*parseInt(n.slice(2),8)}return i*parseInt(n,10)}function mr(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!L.isNegativeZero(e)}var gr=new O("tag:yaml.org,2002:int",{kind:"scalar",resolve:dr,construct:hr,predicate:mr,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),xr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\\\.(?:inf|Inf|INF)|\\\\.(?:nan|NaN|NAN))$");function vr(e){return!(e===null||!xr.test(e)||e[e.length-1]==="_")}function yr(e){var n,i;return n=e.replace(/_/g,"").toLowerCase(),i=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:i*parseFloat(n,10)}var Ar=/^[-+]?[0-9]+e/;function wr(e,n){var i;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(L.isNegativeZero(e))return"-0.0";return i=e.toString(10),Ar.test(i)?i.replace("e",".e"):i}function Cr(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||L.isNegativeZero(e))}var Er=new O("tag:yaml.org,2002:float",{kind:"scalar",resolve:vr,construct:yr,predicate:Cr,represent:wr,defaultStyle:"lowercase"}),Sr=nr.extend({implicit:[or,cr,gr,Er]}),br=Sr,Jn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Kn=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\\\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\\\.([0-9]*))?(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function _r(e){return e===null?!1:Jn.exec(e)!==null||Kn.exec(e)!==null}function Lr(e){var n,i,r,l,t,o,u,f=0,c=null,s,a,p;if(n=Jn.exec(e),n===null&&(n=Kn.exec(e)),n===null)throw new Error("Date resolve error");if(i=+n[1],r=+n[2]-1,l=+n[3],!n[4])return new Date(Date.UTC(i,r,l));if(t=+n[4],o=+n[5],u=+n[6],n[7]){for(f=n[7].slice(0,3);f.length<3;)f+="0";f=+f}return n[9]&&(s=+n[10],a=+(n[11]||0),c=(s*60+a)*6e4,n[9]==="-"&&(c=-c)),p=new Date(Date.UTC(i,r,l,t,o,u,f)),c&&p.setTime(p.getTime()-c),p}function Fr(e){return e.toISOString()}var Or=new O("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:_r,construct:Lr,instanceOf:Date,represent:Fr});function Ir(e){return e==="<<"||e===null}var kr=new O("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Ir}),Ze=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\\r`;function Tr(e){if(e===null)return!1;var n,i,r=0,l=e.length,t=Ze;for(i=0;i<l;i++)if(n=t.indexOf(e.charAt(i)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function Nr(e){var n,i,r=e.replace(/[\\r\\n=]/g,""),l=r.length,t=Ze,o=0,u=[];for(n=0;n<l;n++)n%4===0&&n&&(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)),o=o<<6|t.indexOf(r.charAt(n));return i=l%4*6,i===0?(u.push(o>>16&255),u.push(o>>8&255),u.push(o&255)):i===18?(u.push(o>>10&255),u.push(o>>2&255)):i===12&&u.push(o>>4&255),new Uint8Array(u)}function Dr(e){var n="",i=0,r,l,t=e.length,o=Ze;for(r=0;r<t;r++)r%3===0&&r&&(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]),i=(i<<8)+e[r];return l=t%3,l===0?(n+=o[i>>18&63],n+=o[i>>12&63],n+=o[i>>6&63],n+=o[i&63]):l===2?(n+=o[i>>10&63],n+=o[i>>4&63],n+=o[i<<2&63],n+=o[64]):l===1&&(n+=o[i>>2&63],n+=o[i<<4&63],n+=o[64],n+=o[64]),n}function Rr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Mr=new O("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Tr,construct:Nr,predicate:Rr,represent:Dr}),Pr=Object.prototype.hasOwnProperty,Wr=Object.prototype.toString;function Hr(e){if(e===null)return!0;var n=[],i,r,l,t,o,u=e;for(i=0,r=u.length;i<r;i+=1){if(l=u[i],o=!1,Wr.call(l)!=="[object Object]")return!1;for(t in l)if(Pr.call(l,t))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(t)===-1)n.push(t);else return!1}return!0}function jr(e){return e!==null?e:[]}var Br=new O("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Hr,construct:jr}),Ur=Object.prototype.toString;function Yr(e){if(e===null)return!0;var n,i,r,l,t,o=e;for(t=new Array(o.length),n=0,i=o.length;n<i;n+=1){if(r=o[n],Ur.call(r)!=="[object Object]"||(l=Object.keys(r),l.length!==1))return!1;t[n]=[l[0],r[l[0]]]}return!0}function $r(e){if(e===null)return[];var n,i,r,l,t,o=e;for(t=new Array(o.length),n=0,i=o.length;n<i;n+=1)r=o[n],l=Object.keys(r),t[n]=[l[0],r[l[0]]];return t}var qr=new O("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Yr,construct:$r}),zr=Object.prototype.hasOwnProperty;function Gr(e){if(e===null)return!0;var n,i=e;for(n in i)if(zr.call(i,n)&&i[n]!==null)return!1;return!0}function Jr(e){return e!==null?e:{}}var Kr=new O("tag:yaml.org,2002:set",{kind:"mapping",resolve:Gr,construct:Jr}),Qn=br.extend({implicit:[Or,kr],explicit:[Mr,Br,qr,Kr]}),j=Object.prototype.hasOwnProperty,se=1,Xn=2,Vn=3,pe=4,Ge=1,Qr=2,Tn=3,Xr=/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/,Vr=/[\\x85\\u2028\\u2029]/,Zr=/[,\\[\\]\\{\\}]/,Zn=/^(?:!|!!|![a-z\\-]+!)$/i,ei=/^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*\'\\(\\)\\[\\]])*$/i;function Nn(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function Y(e){return e===9||e===32}function T(e){return e===9||e===32||e===10||e===13}function J(e){return e===44||e===91||e===93||e===123||e===125}function el(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function nl(e){return e===120?2:e===117?4:e===85?8:0}function il(e){return 48<=e&&e<=57?e-48:-1}function Dn(e){return e===48?"\\0":e===97?"\\x07":e===98?"\\b":e===116||e===9?" ":e===110?`\n`:e===118?"\\v":e===102?"\\f":e===114?"\\r":e===101?"\\x1B":e===32?" ":e===34?\'"\':e===47?"/":e===92?"\\\\":e===78?"\\x85":e===95?"\\xA0":e===76?"\\u2028":e===80?"\\u2029":""}function rl(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function ni(e,n,i){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:i}):e[n]=i}var ii=new Array(256),ri=new Array(256);for(U=0;U<256;U++)ii[U]=Dn(U)?1:0,ri[U]=Dn(U);var U;function ll(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Qn,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function li(e,n){var i={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return i.snippet=qi(i),new k(n,i)}function v(e,n){throw li(e,n)}function de(e,n){e.onWarning&&e.onWarning.call(null,li(e,n))}var Rn={YAML:function(n,i,r){var l,t,o;n.version!==null&&v(n,"duplication of %YAML directive"),r.length!==1&&v(n,"YAML directive accepts exactly one argument"),l=/^([0-9]+)\\.([0-9]+)$/.exec(r[0]),l===null&&v(n,"ill-formed argument of the YAML directive"),t=parseInt(l[1],10),o=parseInt(l[2],10),t!==1&&v(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&de(n,"unsupported YAML version of the document")},TAG:function(n,i,r){var l,t;r.length!==2&&v(n,"TAG directive accepts exactly two arguments"),l=r[0],t=r[1],Zn.test(l)||v(n,"ill-formed tag handle (first argument) of the TAG directive"),j.call(n.tagMap,l)&&v(n,\'there is a previously declared suffix for "\'+l+\'" tag handle\'),ei.test(t)||v(n,"ill-formed tag prefix (second argument) of the TAG directive");try{t=decodeURIComponent(t)}catch{v(n,"tag prefix is malformed: "+t)}n.tagMap[l]=t}};function H(e,n,i,r){var l,t,o,u;if(n<i){if(u=e.input.slice(n,i),r)for(l=0,t=u.length;l<t;l+=1)o=u.charCodeAt(l),o===9||32<=o&&o<=1114111||v(e,"expected valid JSON character");else Xr.test(u)&&v(e,"the stream contains non-printable characters");e.result+=u}}function Mn(e,n,i,r){var l,t,o,u;for(L.isObject(i)||v(e,"cannot merge mappings; the provided source object is unacceptable"),l=Object.keys(i),o=0,u=l.length;o<u;o+=1)t=l[o],j.call(n,t)||(ni(n,t,i[t]),r[t]=!0)}function K(e,n,i,r,l,t,o,u,f){var c,s;if(Array.isArray(l))for(l=Array.prototype.slice.call(l),c=0,s=l.length;c<s;c+=1)Array.isArray(l[c])&&v(e,"nested arrays are not supported inside keys"),typeof l=="object"&&Nn(l[c])==="[object Object]"&&(l[c]="[object Object]");if(typeof l=="object"&&Nn(l)==="[object Object]"&&(l="[object Object]"),l=String(l),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(t))for(c=0,s=t.length;c<s;c+=1)Mn(e,n,t[c],i);else Mn(e,n,t,i);else!e.json&&!j.call(i,l)&&j.call(n,l)&&(e.line=o||e.line,e.lineStart=u||e.lineStart,e.position=f||e.position,v(e,"duplicated mapping key")),ni(n,l,t),delete i[l];return n}function en(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):v(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function _(e,n,i){for(var r=0,l=e.input.charCodeAt(e.position);l!==0;){for(;Y(l);)l===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),l=e.input.charCodeAt(++e.position);if(n&&l===35)do l=e.input.charCodeAt(++e.position);while(l!==10&&l!==13&&l!==0);if(R(l))for(en(e),l=e.input.charCodeAt(e.position),r++,e.lineIndent=0;l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);else break}return i!==-1&&r!==0&&e.lineIndent<i&&de(e,"deficient indentation"),r}function ge(e){var n=e.position,i;return i=e.input.charCodeAt(n),!!((i===45||i===46)&&i===e.input.charCodeAt(n+1)&&i===e.input.charCodeAt(n+2)&&(n+=3,i=e.input.charCodeAt(n),i===0||T(i)))}function nn(e,n){n===1?e.result+=" ":n>1&&(e.result+=L.repeat(`\n`,n-1))}function ol(e,n,i){var r,l,t,o,u,f,c,s,a=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),T(d)||J(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(l=e.input.charCodeAt(e.position+1),T(l)||i&&J(l)))return!1;for(e.kind="scalar",e.result="",t=o=e.position,u=!1;d!==0;){if(d===58){if(l=e.input.charCodeAt(e.position+1),T(l)||i&&J(l))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),T(r))break}else{if(e.position===e.lineStart&&ge(e)||i&&J(d))break;if(R(d))if(f=e.line,c=e.lineStart,s=e.lineIndent,_(e,!1,-1),e.lineIndent>=n){u=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=f,e.lineStart=c,e.lineIndent=s;break}}u&&(H(e,t,o,!1),nn(e,e.line-f),t=o=e.position,u=!1),Y(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return H(e,t,o,!1),e.result?!0:(e.kind=a,e.result=p,!1)}function tl(e,n){var i,r,l;if(i=e.input.charCodeAt(e.position),i!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=l=e.position;(i=e.input.charCodeAt(e.position))!==0;)if(i===39)if(H(e,r,e.position,!0),i=e.input.charCodeAt(++e.position),i===39)r=e.position,e.position++,l=e.position;else return!0;else R(i)?(H(e,r,l,!0),nn(e,_(e,!1,n)),r=l=e.position):e.position===e.lineStart&&ge(e)?v(e,"unexpected end of the document within a single quoted scalar"):(e.position++,l=e.position);v(e,"unexpected end of the stream within a single quoted scalar")}function ul(e,n){var i,r,l,t,o,u;if(u=e.input.charCodeAt(e.position),u!==34)return!1;for(e.kind="scalar",e.result="",e.position++,i=r=e.position;(u=e.input.charCodeAt(e.position))!==0;){if(u===34)return H(e,i,e.position,!0),e.position++,!0;if(u===92){if(H(e,i,e.position,!0),u=e.input.charCodeAt(++e.position),R(u))_(e,!1,n);else if(u<256&&ii[u])e.result+=ri[u],e.position++;else if((o=nl(u))>0){for(l=o,t=0;l>0;l--)u=e.input.charCodeAt(++e.position),(o=el(u))>=0?t=(t<<4)+o:v(e,"expected hexadecimal character");e.result+=rl(t),e.position++}else v(e,"unknown escape sequence");i=r=e.position}else R(u)?(H(e,i,r,!0),nn(e,_(e,!1,n)),i=r=e.position):e.position===e.lineStart&&ge(e)?v(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}v(e,"unexpected end of the stream within a double quoted scalar")}function fl(e,n){var i=!0,r,l,t,o=e.tag,u,f=e.anchor,c,s,a,p,d,h=Object.create(null),g,y,w,m;if(m=e.input.charCodeAt(e.position),m===91)s=93,d=!1,u=[];else if(m===123)s=125,d=!0,u={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),m=e.input.charCodeAt(++e.position);m!==0;){if(_(e,!0,n),m=e.input.charCodeAt(e.position),m===s)return e.position++,e.tag=o,e.anchor=f,e.kind=d?"mapping":"sequence",e.result=u,!0;i?m===44&&v(e,"expected the node content, but found \',\'"):v(e,"missed comma between flow collection entries"),y=g=w=null,a=p=!1,m===63&&(c=e.input.charCodeAt(e.position+1),T(c)&&(a=p=!0,e.position++,_(e,!0,n))),r=e.line,l=e.lineStart,t=e.position,Q(e,n,se,!1,!0),y=e.tag,g=e.result,_(e,!0,n),m=e.input.charCodeAt(e.position),(p||e.line===r)&&m===58&&(a=!0,m=e.input.charCodeAt(++e.position),_(e,!0,n),Q(e,n,se,!1,!0),w=e.result),d?K(e,u,h,y,g,w,r,l,t):a?u.push(K(e,null,h,y,g,w,r,l,t)):u.push(g),_(e,!0,n),m=e.input.charCodeAt(e.position),m===44?(i=!0,m=e.input.charCodeAt(++e.position)):i=!1}v(e,"unexpected end of the stream within a flow collection")}function cl(e,n){var i,r,l=Ge,t=!1,o=!1,u=n,f=0,c=!1,s,a;if(a=e.input.charCodeAt(e.position),a===124)r=!1;else if(a===62)r=!0;else return!1;for(e.kind="scalar",e.result="";a!==0;)if(a=e.input.charCodeAt(++e.position),a===43||a===45)Ge===l?l=a===43?Tn:Qr:v(e,"repeat of a chomping mode identifier");else if((s=il(a))>=0)s===0?v(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?v(e,"repeat of an indentation width identifier"):(u=n+s-1,o=!0);else break;if(Y(a)){do a=e.input.charCodeAt(++e.position);while(Y(a));if(a===35)do a=e.input.charCodeAt(++e.position);while(!R(a)&&a!==0)}for(;a!==0;){for(en(e),e.lineIndent=0,a=e.input.charCodeAt(e.position);(!o||e.lineIndent<u)&&a===32;)e.lineIndent++,a=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>u&&(u=e.lineIndent),R(a)){f++;continue}if(e.lineIndent<u){l===Tn?e.result+=L.repeat(`\n`,t?1+f:f):l===Ge&&t&&(e.result+=`\n`);break}for(r?Y(a)?(c=!0,e.result+=L.repeat(`\n`,t?1+f:f)):c?(c=!1,e.result+=L.repeat(`\n`,f+1)):f===0?t&&(e.result+=" "):e.result+=L.repeat(`\n`,f):e.result+=L.repeat(`\n`,t?1+f:f),t=!0,o=!0,f=0,i=e.position;!R(a)&&a!==0;)a=e.input.charCodeAt(++e.position);H(e,i,e.position,!1)}return!0}function Pn(e,n){var i,r=e.tag,l=e.anchor,t=[],o,u=!1,f;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=t),f=e.input.charCodeAt(e.position);f!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),!(f!==45||(o=e.input.charCodeAt(e.position+1),!T(o))));){if(u=!0,e.position++,_(e,!0,-1)&&e.lineIndent<=n){t.push(null),f=e.input.charCodeAt(e.position);continue}if(i=e.line,Q(e,n,Vn,!1,!0),t.push(e.result),_(e,!0,-1),f=e.input.charCodeAt(e.position),(e.line===i||e.lineIndent>n)&&f!==0)v(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return u?(e.tag=r,e.anchor=l,e.kind="sequence",e.result=t,!0):!1}function al(e,n,i){var r,l,t,o,u,f,c=e.tag,s=e.anchor,a={},p=Object.create(null),d=null,h=null,g=null,y=!1,w=!1,m;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),m=e.input.charCodeAt(e.position);m!==0;){if(!y&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,v(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),t=e.line,(m===63||m===58)&&T(r))m===63?(y&&(K(e,a,p,d,h,null,o,u,f),d=h=g=null),w=!0,y=!0,l=!0):y?(y=!1,l=!0):v(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,m=r;else{if(o=e.line,u=e.lineStart,f=e.position,!Q(e,i,Xn,!1,!0))break;if(e.line===t){for(m=e.input.charCodeAt(e.position);Y(m);)m=e.input.charCodeAt(++e.position);if(m===58)m=e.input.charCodeAt(++e.position),T(m)||v(e,"a whitespace character is expected after the key-value separator within a block mapping"),y&&(K(e,a,p,d,h,null,o,u,f),d=h=g=null),w=!0,y=!1,l=!1,d=e.tag,h=e.result;else if(w)v(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=s,!0}else if(w)v(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=s,!0}if((e.line===t||e.lineIndent>n)&&(y&&(o=e.line,u=e.lineStart,f=e.position),Q(e,n,pe,!0,l)&&(y?h=e.result:g=e.result),y||(K(e,a,p,d,h,g,o,u,f),d=h=g=null),_(e,!0,-1),m=e.input.charCodeAt(e.position)),(e.line===t||e.lineIndent>n)&&m!==0)v(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return y&&K(e,a,p,d,h,null,o,u,f),w&&(e.tag=c,e.anchor=s,e.kind="mapping",e.result=a),w}function sl(e){var n,i=!1,r=!1,l,t,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&v(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(i=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,l="!!",o=e.input.charCodeAt(++e.position)):l="!",n=e.position,i){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(t=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):v(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!T(o);)o===33&&(r?v(e,"tag suffix cannot contain exclamation marks"):(l=e.input.slice(n-1,e.position+1),Zn.test(l)||v(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);t=e.input.slice(n,e.position),Zr.test(t)&&v(e,"tag suffix cannot contain flow indicator characters")}t&&!ei.test(t)&&v(e,"tag name cannot contain such characters: "+t);try{t=decodeURIComponent(t)}catch{v(e,"tag name is malformed: "+t)}return i?e.tag=t:j.call(e.tagMap,l)?e.tag=e.tagMap[l]+t:l==="!"?e.tag="!"+t:l==="!!"?e.tag="tag:yaml.org,2002:"+t:v(e,\'undeclared tag handle "\'+l+\'"\'),!0}function pl(e){var n,i;if(i=e.input.charCodeAt(e.position),i!==38)return!1;for(e.anchor!==null&&v(e,"duplication of an anchor property"),i=e.input.charCodeAt(++e.position),n=e.position;i!==0&&!T(i)&&!J(i);)i=e.input.charCodeAt(++e.position);return e.position===n&&v(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function dl(e){var n,i,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!T(r)&&!J(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&v(e,"name of an alias node must contain at least one character"),i=e.input.slice(n,e.position),j.call(e.anchorMap,i)||v(e,\'unidentified alias "\'+i+\'"\'),e.result=e.anchorMap[i],_(e,!0,-1),!0}function Q(e,n,i,r,l){var t,o,u,f=1,c=!1,s=!1,a,p,d,h,g,y;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,t=o=u=pe===i||Vn===i,r&&_(e,!0,-1)&&(c=!0,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)),f===1)for(;sl(e)||pl(e);)_(e,!0,-1)?(c=!0,u=t,e.lineIndent>n?f=1:e.lineIndent===n?f=0:e.lineIndent<n&&(f=-1)):u=!1;if(u&&(u=c||l),(f===1||pe===i)&&(se===i||Xn===i?g=n:g=n+1,y=e.position-e.lineStart,f===1?u&&(Pn(e,y)||al(e,y,g))||fl(e,g)?s=!0:(o&&cl(e,g)||tl(e,g)||ul(e,g)?s=!0:dl(e)?(s=!0,(e.tag!==null||e.anchor!==null)&&v(e,"alias node should not have any properties")):ol(e,g,se===i)&&(s=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f===0&&(s=u&&Pn(e,y))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&v(e,\'unacceptable node kind for !<?> tag; it should be "scalar", not "\'+e.kind+\'"\'),a=0,p=e.implicitTypes.length;a<p;a+=1)if(h=e.implicitTypes[a],h.resolve(e.result)){e.result=h.construct(e.result),e.tag=h.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(j.call(e.typeMap[e.kind||"fallback"],e.tag))h=e.typeMap[e.kind||"fallback"][e.tag];else for(h=null,d=e.typeMap.multi[e.kind||"fallback"],a=0,p=d.length;a<p;a+=1)if(e.tag.slice(0,d[a].tag.length)===d[a].tag){h=d[a];break}h||v(e,"unknown tag !<"+e.tag+">"),e.result!==null&&h.kind!==e.kind&&v(e,"unacceptable node kind for !<"+e.tag+\'> tag; it should be "\'+h.kind+\'", not "\'+e.kind+\'"\'),h.resolve(e.result,e.tag)?(e.result=h.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):v(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||s}function hl(e){var n=e.position,i,r,l,t=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(_(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(t=!0,o=e.input.charCodeAt(++e.position),i=e.position;o!==0&&!T(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(i,e.position),l=[],r.length<1&&v(e,"directive name must not be less than one character in length");o!==0;){for(;Y(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!R(o));break}if(R(o))break;for(i=e.position;o!==0&&!T(o);)o=e.input.charCodeAt(++e.position);l.push(e.input.slice(i,e.position))}o!==0&&en(e),j.call(Rn,r)?Rn[r](e,r,l):de(e,\'unknown document directive "\'+r+\'"\')}if(_(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,_(e,!0,-1)):t&&v(e,"directives end mark is expected"),Q(e,e.lineIndent-1,pe,!1,!0),_(e,!0,-1),e.checkLineBreaks&&Vr.test(e.input.slice(n,e.position))&&de(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&ge(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,_(e,!0,-1));return}if(e.position<e.length-1)v(e,"end of the stream or a document separator is expected");else return}function oi(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`\n`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var i=new ll(e,n),r=e.indexOf("\\0");for(r!==-1&&(i.position=r,v(i,"null byte is not allowed in input")),i.input+="\\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)hl(i);return i.documents}function ml(e,n,i){n!==null&&typeof n=="object"&&typeof i>"u"&&(i=n,n=null);var r=oi(e,i);if(typeof n!="function")return r;for(var l=0,t=r.length;l<t;l+=1)n(r[l])}function gl(e,n){var i=oi(e,n);if(i.length!==0){if(i.length===1)return i[0];throw new k("expected a single document in the stream, but found more")}}var xl=ml,vl=gl,ti={loadAll:xl,load:vl},ui=Object.prototype.toString,fi=Object.prototype.hasOwnProperty,rn=65279,yl=9,re=10,Al=13,wl=32,Cl=33,El=34,Ke=35,Sl=37,bl=38,_l=39,Ll=42,ci=44,Fl=45,he=58,Ol=61,Il=62,kl=63,Tl=64,ai=91,si=93,Nl=96,pi=123,Dl=124,di=125,I={};I[0]="\\\\0";I[7]="\\\\a";I[8]="\\\\b";I[9]="\\\\t";I[10]="\\\\n";I[11]="\\\\v";I[12]="\\\\f";I[13]="\\\\r";I[27]="\\\\e";I[34]=\'\\\\"\';I[92]="\\\\\\\\";I[133]="\\\\N";I[160]="\\\\_";I[8232]="\\\\L";I[8233]="\\\\P";var Rl=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Ml=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;function Pl(e,n){var i,r,l,t,o,u,f;if(n===null)return{};for(i={},r=Object.keys(n),l=0,t=r.length;l<t;l+=1)o=r[l],u=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),f=e.compiledTypeMap.fallback[o],f&&fi.call(f.styleAliases,u)&&(u=f.styleAliases[u]),i[o]=u;return i}function Wl(e){var n,i,r;if(n=e.toString(16).toUpperCase(),e<=255)i="x",r=2;else if(e<=65535)i="u",r=4;else if(e<=4294967295)i="U",r=8;else throw new k("code point within a string may not be greater than 0xFFFFFFFF");return"\\\\"+i+L.repeat("0",r-n.length)+n}var Hl=1,le=2;function jl(e){this.schema=e.schema||Qn,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=L.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Pl(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType===\'"\'?le:Hl,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Wn(e,n){for(var i=L.repeat(" ",n),r=0,l=-1,t="",o,u=e.length;r<u;)l=e.indexOf(`\n`,r),l===-1?(o=e.slice(r),r=u):(o=e.slice(r,l+1),r=l+1),o.length&&o!==`\n`&&(t+=i),t+=o;return t}function Qe(e,n){return`\n`+L.repeat(" ",e.indent*n)}function Bl(e,n){var i,r,l;for(i=0,r=e.implicitTypes.length;i<r;i+=1)if(l=e.implicitTypes[i],l.resolve(n))return!0;return!1}function me(e){return e===wl||e===yl}function oe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==rn||65536<=e&&e<=1114111}function Hn(e){return oe(e)&&e!==rn&&e!==Al&&e!==re}function jn(e,n,i){var r=Hn(e),l=r&&!me(e);return(i?r:r&&e!==ci&&e!==ai&&e!==si&&e!==pi&&e!==di)&&e!==Ke&&!(n===he&&!l)||Hn(n)&&!me(n)&&e===Ke||n===he&&l}function Ul(e){return oe(e)&&e!==rn&&!me(e)&&e!==Fl&&e!==kl&&e!==he&&e!==ci&&e!==ai&&e!==si&&e!==pi&&e!==di&&e!==Ke&&e!==bl&&e!==Ll&&e!==Cl&&e!==Dl&&e!==Ol&&e!==Il&&e!==_l&&e!==El&&e!==Sl&&e!==Tl&&e!==Nl}function Yl(e){return!me(e)&&e!==he}function ne(e,n){var i=e.charCodeAt(n),r;return i>=55296&&i<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(i-55296)*1024+r-56320+65536:i}function hi(e){var n=/^\\n* /;return n.test(e)}var mi=1,Xe=2,gi=3,xi=4,G=5;function $l(e,n,i,r,l,t,o,u){var f,c=0,s=null,a=!1,p=!1,d=r!==-1,h=-1,g=Ul(ne(e,0))&&Yl(ne(e,e.length-1));if(n||o)for(f=0;f<e.length;c>=65536?f+=2:f++){if(c=ne(e,f),!oe(c))return G;g=g&&jn(c,s,u),s=c}else{for(f=0;f<e.length;c>=65536?f+=2:f++){if(c=ne(e,f),c===re)a=!0,d&&(p=p||f-h-1>r&&e[h+1]!==" ",h=f);else if(!oe(c))return G;g=g&&jn(c,s,u),s=c}p=p||d&&f-h-1>r&&e[h+1]!==" "}return!a&&!p?g&&!o&&!l(e)?mi:t===le?G:Xe:i>9&&hi(e)?G:o?t===le?G:Xe:p?xi:gi}function ql(e,n,i,r,l){e.dump=(function(){if(n.length===0)return e.quotingType===le?\'""\':"\'\'";if(!e.noCompatMode&&(Rl.indexOf(n)!==-1||Ml.test(n)))return e.quotingType===le?\'"\'+n+\'"\':"\'"+n+"\'";var t=e.indent*Math.max(1,i),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-t),u=r||e.flowLevel>-1&&i>=e.flowLevel;function f(c){return Bl(e,c)}switch($l(n,u,e.indent,o,f,e.quotingType,e.forceQuotes&&!r,l)){case mi:return n;case Xe:return"\'"+n.replace(/\'/g,"\'\'")+"\'";case gi:return"|"+Bn(n,e.indent)+Un(Wn(n,t));case xi:return">"+Bn(n,e.indent)+Un(Wn(zl(n,o),t));case G:return\'"\'+Gl(n)+\'"\';default:throw new k("impossible error: invalid scalar style")}})()}function Bn(e,n){var i=hi(e)?String(n):"",r=e[e.length-1]===`\n`,l=r&&(e[e.length-2]===`\n`||e===`\n`),t=l?"+":r?"":"-";return i+t+`\n`}function Un(e){return e[e.length-1]===`\n`?e.slice(0,-1):e}function zl(e,n){for(var i=/(\\n+)([^\\n]*)/g,r=(function(){var c=e.indexOf(`\n`);return c=c!==-1?c:e.length,i.lastIndex=c,Yn(e.slice(0,c),n)})(),l=e[0]===`\n`||e[0]===" ",t,o;o=i.exec(e);){var u=o[1],f=o[2];t=f[0]===" ",r+=u+(!l&&!t&&f!==""?`\n`:"")+Yn(f,n),l=t}return r}function Yn(e,n){if(e===""||e[0]===" ")return e;for(var i=/ [^ ]/g,r,l=0,t,o=0,u=0,f="";r=i.exec(e);)u=r.index,u-l>n&&(t=o>l?o:u,f+=`\n`+e.slice(l,t),l=t+1),o=u;return f+=`\n`,e.length-l>n&&o>l?f+=e.slice(l,o)+`\n`+e.slice(o+1):f+=e.slice(l),f.slice(1)}function Gl(e){for(var n="",i=0,r,l=0;l<e.length;i>=65536?l+=2:l++)i=ne(e,l),r=I[i],!r&&oe(i)?(n+=e[l],i>=65536&&(n+=e[l+1])):n+=r||Wl(i);return n}function Jl(e,n,i){var r="",l=e.tag,t,o,u;for(t=0,o=i.length;t<o;t+=1)u=i[t],e.replacer&&(u=e.replacer.call(i,String(t),u)),(P(e,n,u,!1,!1)||typeof u>"u"&&P(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=l,e.dump="["+r+"]"}function $n(e,n,i,r){var l="",t=e.tag,o,u,f;for(o=0,u=i.length;o<u;o+=1)f=i[o],e.replacer&&(f=e.replacer.call(i,String(o),f)),(P(e,n+1,f,!0,!0,!1,!0)||typeof f>"u"&&P(e,n+1,null,!0,!0,!1,!0))&&((!r||l!=="")&&(l+=Qe(e,n)),e.dump&&re===e.dump.charCodeAt(0)?l+="-":l+="- ",l+=e.dump);e.tag=t,e.dump=l||"[]"}function Kl(e,n,i){var r="",l=e.tag,t=Object.keys(i),o,u,f,c,s;for(o=0,u=t.length;o<u;o+=1)s="",r!==""&&(s+=", "),e.condenseFlow&&(s+=\'"\'),f=t[o],c=i[f],e.replacer&&(c=e.replacer.call(i,f,c)),P(e,n,f,!1,!1)&&(e.dump.length>1024&&(s+="? "),s+=e.dump+(e.condenseFlow?\'"\':"")+":"+(e.condenseFlow?"":" "),P(e,n,c,!1,!1)&&(s+=e.dump,r+=s));e.tag=l,e.dump="{"+r+"}"}function Ql(e,n,i,r){var l="",t=e.tag,o=Object.keys(i),u,f,c,s,a,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new k("sortKeys must be a boolean or a function");for(u=0,f=o.length;u<f;u+=1)p="",(!r||l!=="")&&(p+=Qe(e,n)),c=o[u],s=i[c],e.replacer&&(s=e.replacer.call(i,c,s)),P(e,n+1,c,!0,!0,!0)&&(a=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,a&&(e.dump&&re===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,a&&(p+=Qe(e,n)),P(e,n+1,s,!0,a)&&(e.dump&&re===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,l+=p));e.tag=t,e.dump=l||"{}"}function qn(e,n,i){var r,l,t,o,u,f;for(l=i?e.explicitTypes:e.implicitTypes,t=0,o=l.length;t<o;t+=1)if(u=l[t],(u.instanceOf||u.predicate)&&(!u.instanceOf||typeof n=="object"&&n instanceof u.instanceOf)&&(!u.predicate||u.predicate(n))){if(i?u.multi&&u.representName?e.tag=u.representName(n):e.tag=u.tag:e.tag="?",u.represent){if(f=e.styleMap[u.tag]||u.defaultStyle,ui.call(u.represent)==="[object Function]")r=u.represent(n,f);else if(fi.call(u.represent,f))r=u.represent[f](n,f);else throw new k("!<"+u.tag+\'> tag resolver accepts not "\'+f+\'" style\');e.dump=r}return!0}return!1}function P(e,n,i,r,l,t,o){e.tag=null,e.dump=i,qn(e,i,!1)||qn(e,i,!0);var u=ui.call(e.dump),f=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var s=u==="[object Object]"||u==="[object Array]",a,p;if(s&&(a=e.duplicates.indexOf(i),p=a!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&n>0)&&(l=!1),p&&e.usedDuplicates[a])e.dump="*ref_"+a;else{if(s&&p&&!e.usedDuplicates[a]&&(e.usedDuplicates[a]=!0),u==="[object Object]")r&&Object.keys(e.dump).length!==0?(Ql(e,n,e.dump,l),p&&(e.dump="&ref_"+a+e.dump)):(Kl(e,n,e.dump),p&&(e.dump="&ref_"+a+" "+e.dump));else if(u==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?$n(e,n-1,e.dump,l):$n(e,n,e.dump,l),p&&(e.dump="&ref_"+a+e.dump)):(Jl(e,n,e.dump),p&&(e.dump="&ref_"+a+" "+e.dump));else if(u==="[object String]")e.tag!=="?"&&ql(e,e.dump,n,t,f);else{if(u==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new k("unacceptable kind of an object to dump "+u)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Xl(e,n){var i=[],r=[],l,t;for(Ve(e,i,r),l=0,t=r.length;l<t;l+=1)n.duplicates.push(i[r[l]]);n.usedDuplicates=new Array(t)}function Ve(e,n,i){var r,l,t;if(e!==null&&typeof e=="object")if(l=n.indexOf(e),l!==-1)i.indexOf(l)===-1&&i.push(l);else if(n.push(e),Array.isArray(e))for(l=0,t=e.length;l<t;l+=1)Ve(e[l],n,i);else for(r=Object.keys(e),l=0,t=r.length;l<t;l+=1)Ve(e[r[l]],n,i)}function Vl(e,n){n=n||{};var i=new jl(n);i.noRefs||Xl(e,i);var r=e;return i.replacer&&(r=i.replacer.call({"":r},"",r)),P(i,0,r,!0,!0)?i.dump+`\n`:""}var Zl=Vl,eo={dump:Zl};function ln(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var on=ti.load,ut=ti.loadAll,xe=eo.dump;var ft=ln("safeLoad","load"),ct=ln("safeLoadAll","loadAll"),at=ln("safeDump","dump");var so=bi("./workerBundle"),io=$e;function D(e,n){return n==="yaml"?xe(e,{indent:2,lineWidth:-1,noRefs:!0}).trimEnd():JSON.stringify(e,null,2)}function ro(e,n,i="json"){let r=D(e,i),l=D(n,i);return r===l?[{value:r}]:tn(e,n,0,i)}function lo(e,n){return ro(e,n,"json")}function oo(e,n){try{let i=JSON.parse(e),r=JSON.parse(n),l=JSON.stringify(i),t=JSON.stringify(r);return l===t?[{value:e}]:N(e,n,{newlineIsToken:!1})}catch{return N(e,n,{newlineIsToken:!1})}}function to(e,n){let i=on(e),r=on(n),l=xe(i,{indent:2,lineWidth:-1,noRefs:!0}),t=xe(r,{indent:2,lineWidth:-1,noRefs:!0});return l===t?[{value:e}]:N(e,n,{newlineIsToken:!1})}function tn(e,n,i,r="json"){let l=D(e,r),t=D(n,r);return l===t?[{value:W(l,i,r)}]:typeof e=="object"&&e!==null&&typeof n=="object"&&n!==null&&!Array.isArray(e)&&!Array.isArray(n)?uo(e,n,i,r):Array.isArray(e)&&Array.isArray(n)?fo(e,n,i,r):co(l,t,i,r)}function uo(e,n,i,r="json"){let l=[],t=" ".repeat(i),o=" ".repeat(i+1),u=new Set(Object.keys(e)),f=Object.keys(n),c=[...u].filter(a=>!(a in n)),s=[...f,...c];l.push({value:`{\n`});for(let a=0;a<s.length;a++){let p=s[a],h=a===s.length-1?"":",",g=p in e,y=p in n;if(g&&y){let w=D(e[p],r),m=D(n[p],r);if(w===m){let x=W(w,i+1);l.push({value:o+JSON.stringify(p)+": "+x+h+`\n`})}else{let x=o+JSON.stringify(p)+": ",A=tn(e[p],n[p],i+1,r);if(A.length>0)if(!A[0].removed&&!A[0].added)A[0].value=x+A[0].value;else{let C=A.find(E=>E.removed),F=A.find(E=>E.added);C&&(C.value=x+C.value),F&&(F.value=x+F.value)}if(h&&A.length>0){let C=A[A.length-1];C.value=C.value.replace(/\\n$/,h+`\n`)}l.push(...A)}}else if(g){let w=W(D(e[p],r),i+1);l.push({removed:!0,value:o+JSON.stringify(p)+": "+w+h+`\n`})}else{let w=W(D(n[p],r),i+1);l.push({added:!0,value:o+JSON.stringify(p)+": "+w+h+`\n`})}}return l.push({value:t+`}\n`}),l}function fo(e,n,i,r="json"){let l=[],t=" ".repeat(i),o=" ".repeat(i+1);l.push({value:`[\n`});let u=Math.max(e.length,n.length);for(let f=0;f<u;f++){let s=f===u-1?"":",";if(f>=e.length){let a=W(D(n[f],r),i+1);l.push({added:!0,value:o+a+s+`\n`})}else if(f>=n.length){let a=W(D(e[f],r),i+1);l.push({removed:!0,value:o+a+s+`\n`})}else{let a=D(e[f],r),p=D(n[f],r);if(a===p){let d=W(a,i+1);l.push({value:o+d+s+`\n`})}else{let d=tn(e[f],n[f],i+1,r);if(d.length>0&&(d[0].value=o+d[0].value),s&&d.length>0){let h=d[d.length-1];h.value=h.value.replace(/\\n$/,s+`\n`)}l.push(...d)}}}return l.push({value:t+`]\n`}),l}function co(e,n,i,r="json"){let l=W(e,i),t=W(n,i);return N(l,t).map(u=>({value:u.value,added:u.added,removed:u.removed}))}function W(e,n,i="json"){if(n===0)return e;let r=" ".repeat(n);return e.split(`\n`).map((l,t)=>t===0?l:r+l).join(`\n`)}var vi=e=>e===""?[]:e.replace(/\\n$/,"").split(`\n`),ao=(e,n,i="diffChars")=>{let l=(typeof i=="string"?io[i]:i)(e,n),t={left:[],right:[]};return l.forEach(({added:o,removed:u,value:f})=>{let c={};return o&&(c.type=1,c.value=f,t.right.push(c)),u&&(c.type=2,c.value=f,t.left.push(c)),!u&&!o&&(c.type=0,c.value=f,t.right.push(c),t.left.push(c)),c}),t},yi=(e,n,i=!1,r="diffChars",l=0,t=[],o=!1)=>{let u=[];if(typeof e=="string"&&typeof n=="string")if(r==="diffJson")u=oo(e,n);else if(r==="diffYaml")try{u=to(e,n)}catch{u=N(e,n,{newlineIsToken:!1})}else u=N(e,n,{newlineIsToken:!1});else u=lo(e,n);let f=l,c=l,s=[],a=0,p=[],d=[],h=(g,y,w,m,x)=>vi(g).map((C,F)=>{let E={},S={};if(!(d.includes(`${y}-${F}`)||x&&F!==0)){if(w||m){let $=!0;if(m){c+=1,E.lineNumber=c,E.type=2,E.value=C||" ";let un=u[y+1];if(un?.added){let fn=vi(un.value)[F];if(fn){let Ai=h(fn,y,!0,!1,!0),{value:B,lineNumber:wi,type:Ci}=Ai[0].right;if(d.push(`${y+1}-${F}`),S.lineNumber=wi,E.value===B)$=!1,S.type=0,E.type=0,S.value=B;else{S.type=Ci;let cn=500,Ei=C.length>cn||B.length>cn;if(i||Ei)S.value=B;else if(o)E.rawValue=C,E.value=C,S.rawValue=B,S.value=B;else{let an=ao(C,B,r);S.value=an.right,E.value=an.left}}}}}else f+=1,S.lineNumber=f,S.type=1,S.value=C;$&&!x&&(p.includes(a)||p.push(a))}else c+=1,f+=1,E.lineNumber=c,E.type=0,E.value=C,S.lineNumber=f,S.type=0,S.value=C;return(t?.includes(`L-${E.lineNumber}`)||t?.includes(`R-${S.lineNumber}`)&&!p.includes(a))&&p.push(a),x||(a+=1),{right:S,left:E}}}).filter(Boolean);return u.forEach(({added:g,removed:y,value:w},m)=>{s=[...s,...h(w,m,g,y)]}),{lineInformation:s,diffLines:p}};self.onmessage=e=>{let{oldString:n,newString:i,disableWordDiff:r,lineCompareMethod:l,linesOffset:t,showLines:o,deferWordDiff:u}=e.data,f=yi(n,i,r,l,t,o,u);self.postMessage(f)};})();\n/*! Bundled license information:\n\njs-yaml/dist/js-yaml.mjs:\n (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)\n*/\n'],{type:`application/javascript`});dD=URL.createObjectURL(e)}catch{dD=null}return dD},pD=(e,t,n=!1,r=sD.CHARS,i=0,a=[],o=!1)=>{let s=()=>uD(e,t,n,r,i,a,o),c=fD();return c?new Promise(l=>{let u;try{u=new Worker(c)}catch{l(s());return}u.onmessage=e=>{l(e.data),u.terminate()},u.onerror=()=>{u.terminate(),l(s())},u.postMessage({oldString:e,newString:t,disableWordDiff:n,lineCompareMethod:r,linesOffset:i,showLines:a,deferWordDiff:o})}):Promise.resolve(s())};function mD(){return(0,L.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:[(0,L.jsx)(`title`,{children:`expand`}),(0,L.jsx)(`path`,{d:`m8.177.677 2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25a.75.75 0 0 1-1.5 0V4H5.104a.25.25 0 0 1-.177-.427L7.823.677a.25.25 0 0 1 .354 0ZM7.25 10.75a.75.75 0 0 1 1.5 0V12h2.146a.25.25 0 0 1 .177.427l-2.896 2.896a.25.25 0 0 1-.354 0l-2.896-2.896A.25.25 0 0 1 5.104 12H7.25v-1.25Zm-5-2a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z`})]})}var hD=!1;function gD(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function _D(e){var t=document.createElement(`style`);return t.setAttribute(`data-emotion`,e.key),e.nonce!==void 0&&t.setAttribute(`nonce`,e.nonce),t.appendChild(document.createTextNode(``)),t.setAttribute(`data-s`,``),t}var vD=function(){function e(e){var t=this;this._insertTag=function(e){var n=t.tags.length===0?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling;t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=e.speedy===void 0?!hD:e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(_D(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=gD(t);try{n.insertRule(e,n.cssRules.length)}catch{}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){return e.parentNode?.removeChild(e)}),this.tags=[],this.ctr=0},e}(),yD=`-ms-`,bD=`-moz-`,xD=`-webkit-`,SD=`comm`,CD=`rule`,wD=`decl`,TD=`@import`,ED=`@keyframes`,DD=`@layer`,OD=Math.abs,kD=String.fromCharCode,AD=Object.assign;function jD(e,t){return ID(e,0)^45?(((t<<2^ID(e,0))<<2^ID(e,1))<<2^ID(e,2))<<2^ID(e,3):0}function MD(e){return e.trim()}function ND(e,t){return(e=t.exec(e))?e[0]:e}function PD(e,t,n){return e.replace(t,n)}function FD(e,t){return e.indexOf(t)}function ID(e,t){return e.charCodeAt(t)|0}function LD(e,t,n){return e.slice(t,n)}function RD(e){return e.length}function zD(e){return e.length}function BD(e,t){return t.push(e),e}function VD(e,t){return e.map(t).join(``)}var HD=1,UD=1,WD=0,GD=0,KD=0,qD=``;function JD(e,t,n,r,i,a,o){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:HD,column:UD,length:o,return:``}}function YD(e,t){return AD(JD(``,null,null,``,null,null,0),e,{length:-e.length},t)}function XD(){return KD}function ZD(){return KD=GD>0?ID(qD,--GD):0,UD--,KD===10&&(UD=1,HD--),KD}function QD(){return KD=GD<WD?ID(qD,GD++):0,UD++,KD===10&&(UD=1,HD++),KD}function $D(){return ID(qD,GD)}function eO(){return GD}function tO(e,t){return LD(qD,e,t)}function nO(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function rO(e){return HD=UD=1,WD=RD(qD=e),GD=0,[]}function iO(e){return qD=``,e}function aO(e){return MD(tO(GD-1,cO(e===91?e+2:e===40?e+1:e)))}function oO(e){for(;(KD=$D())&&KD<33;)QD();return nO(e)>2||nO(KD)>3?``:` `}function sO(e,t){for(;--t&&QD()&&!(KD<48||KD>102||KD>57&&KD<65||KD>70&&KD<97););return tO(e,eO()+(t<6&&$D()==32&&QD()==32))}function cO(e){for(;QD();)switch(KD){case e:return GD;case 34:case 39:e!==34&&e!==39&&cO(KD);break;case 40:e===41&&cO(e);break;case 92:QD();break}return GD}function lO(e,t){for(;QD()&&e+KD!==57&&!(e+KD===84&&$D()===47););return`/*`+tO(t,GD-1)+`*`+kD(e===47?e:QD())}function uO(e){for(;!nO($D());)QD();return tO(e,GD)}function dO(e){return iO(fO(``,null,null,null,[``],e=rO(e),0,[0],e))}function fO(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=``,b=i,x=a,S=r,C=y;g;)switch(m=v,v=QD()){case 40:if(m!=108&&ID(C,d-1)==58){FD(C+=PD(aO(v),`&`,`&\f`),`&\f`)!=-1&&(_=-1);break}case 34:case 39:case 91:C+=aO(v);break;case 9:case 10:case 13:case 32:C+=oO(m);break;case 92:C+=sO(eO()-1,7);continue;case 47:switch($D()){case 42:case 47:BD(mO(lO(QD(),eO()),t,n),c);break;default:C+=`/`}break;case 123*h:s[l++]=RD(C)*_;case 125*h:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:_==-1&&(C=PD(C,/\f/g,``)),p>0&&RD(C)-d&&BD(p>32?hO(C+`;`,r,n,d-1):hO(PD(C,` `,``)+`;`,r,n,d-2),c);break;case 59:C+=`;`;default:if(BD(S=pO(C,t,n,l,u,i,s,y,b=[],x=[],d),a),v===123)if(u===0)fO(C,t,S,S,b,a,d,s,x);else switch(f===99&&ID(C,3)===110?100:f){case 100:case 108:case 109:case 115:fO(e,S,S,r&&BD(pO(e,S,S,0,0,i,s,y,i,b=[],d),x),i,x,d,s,r?b:x);break;default:fO(C,S,S,S,[``],x,0,s,x)}}l=u=p=0,h=_=1,y=C=``,d=o;break;case 58:d=1+RD(C),p=m;default:if(h<1){if(v==123)--h;else if(v==125&&h++==0&&ZD()==125)continue}switch(C+=kD(v),v*h){case 38:_=u>0?1:(C+=`\f`,-1);break;case 44:s[l++]=(RD(C)-1)*_,_=1;break;case 64:$D()===45&&(C+=aO(QD())),f=$D(),u=d=RD(y=C+=uO(eO())),v++;break;case 45:m===45&&RD(C)==2&&(h=0)}}return a}function pO(e,t,n,r,i,a,o,s,c,l,u){for(var d=i-1,f=i===0?a:[``],p=zD(f),m=0,h=0,g=0;m<r;++m)for(var _=0,v=LD(e,d+1,d=OD(h=o[m])),y=e;_<p;++_)(y=MD(h>0?f[_]+` `+v:PD(v,/&\f/g,f[_])))&&(c[g++]=y);return JD(e,t,n,i===0?CD:s,c,l,u)}function mO(e,t,n){return JD(e,t,n,SD,kD(XD()),LD(e,2,-2),0)}function hO(e,t,n,r){return JD(e,t,n,wD,LD(e,0,r),LD(e,r+1,-1),r)}function gO(e,t){for(var n=``,r=zD(e),i=0;i<r;i++)n+=t(e[i],i,e,t)||``;return n}function _O(e,t,n,r){switch(e.type){case DD:if(e.children.length)break;case TD:case wD:return e.return=e.return||e.value;case SD:return``;case ED:return e.return=e.value+`{`+gO(e.children,r)+`}`;case CD:e.value=e.props.join(`,`)}return RD(n=gO(e.children,r))?e.return=e.value+`{`+n+`}`:``}function vO(e){var t=zD(e);return function(n,r,i,a){for(var o=``,s=0;s<t;s++)o+=e[s](n,r,i,a)||``;return o}}function yO(e){return function(t){t.root||(t=t.return)&&e(t)}}function bO(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var xO=function(e,t,n){for(var r=0,i=0;r=i,i=$D(),r===38&&i===12&&(t[n]=1),!nO(i);)QD();return tO(e,GD)},SO=function(e,t){var n=-1,r=44;do switch(nO(r)){case 0:r===38&&$D()===12&&(t[n]=1),e[n]+=xO(GD-1,t,n);break;case 2:e[n]+=aO(r);break;case 4:if(r===44){e[++n]=$D()===58?`&\f`:``,t[n]=e[n].length;break}default:e[n]+=kD(r)}while(r=QD());return e},CO=function(e,t){return iO(SO(rO(e),t))},wO=new WeakMap,TO=function(e){if(!(e.type!==`rule`||!e.parent||e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!==`rule`;)if(n=n.parent,!n)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!wO.get(n))&&!r){wO.set(e,!0);for(var i=[],a=CO(t,i),o=n.props,s=0,c=0;s<a.length;s++)for(var l=0;l<o.length;l++,c++)e.props[c]=i[s]?a[s].replace(/&\f/g,o[l]):o[l]+` `+a[s]}}},EO=function(e){if(e.type===`decl`){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return=``,e.value=``)}};function DO(e,t){switch(jD(e,t)){case 5103:return xD+`print-`+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return xD+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return xD+e+bD+e+yD+e+e;case 6828:case 4268:return xD+e+yD+e+e;case 6165:return xD+e+yD+`flex-`+e+e;case 5187:return xD+e+PD(e,/(\w+).+(:[^]+)/,xD+`box-$1$2`+yD+`flex-$1$2`)+e;case 5443:return xD+e+yD+`flex-item-`+PD(e,/flex-|-self/,``)+e;case 4675:return xD+e+yD+`flex-line-pack`+PD(e,/align-content|flex-|-self/,``)+e;case 5548:return xD+e+yD+PD(e,`shrink`,`negative`)+e;case 5292:return xD+e+yD+PD(e,`basis`,`preferred-size`)+e;case 6060:return xD+`box-`+PD(e,`-grow`,``)+xD+e+yD+PD(e,`grow`,`positive`)+e;case 4554:return xD+PD(e,/([^-])(transform)/g,`$1`+xD+`$2`)+e;case 6187:return PD(PD(PD(e,/(zoom-|grab)/,xD+`$1`),/(image-set)/,xD+`$1`),e,``)+e;case 5495:case 3959:return PD(e,/(image-set\([^]*)/,xD+"$1$`$1");case 4968:return PD(PD(e,/(.+:)(flex-)?(.*)/,xD+`box-pack:$3`+yD+`flex-pack:$3`),/s.+-b[^;]+/,`justify`)+xD+e+e;case 4095:case 3583:case 4068:case 2532:return PD(e,/(.+)-inline(.+)/,xD+`$1$2`)+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(RD(e)-1-t>6)switch(ID(e,t+1)){case 109:if(ID(e,t+4)!==45)break;case 102:return PD(e,/(.+:)(.+)-([^]+)/,`$1`+xD+`$2-$3$1`+bD+(ID(e,t+3)==108?`$3`:`$2-$3`))+e;case 115:return~FD(e,`stretch`)?DO(PD(e,`stretch`,`fill-available`),t)+e:e}break;case 4949:if(ID(e,t+1)!==115)break;case 6444:switch(ID(e,RD(e)-3-(~FD(e,`!important`)&&10))){case 107:return PD(e,`:`,`:`+xD)+e;case 101:return PD(e,/(.+:)([^;!]+)(;|!.+)?/,`$1`+xD+(ID(e,14)===45?`inline-`:``)+`box$3$1`+xD+`$2$3$1`+yD+`$2box$3`)+e}break;case 5936:switch(ID(e,t+11)){case 114:return xD+e+yD+PD(e,/[svh]\w+-[tblr]{2}/,`tb`)+e;case 108:return xD+e+yD+PD(e,/[svh]\w+-[tblr]{2}/,`tb-rl`)+e;case 45:return xD+e+yD+PD(e,/[svh]\w+-[tblr]{2}/,`lr`)+e}return xD+e+yD+e+e}return e}var OO=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case wD:e.return=DO(e.value,e.length);break;case ED:return gO([YD(e,{value:PD(e.value,`@`,`@`+xD)})],r);case CD:if(e.length)return VD(e.props,function(t){switch(ND(t,/(::plac\w+|:read-\w+)/)){case`:read-only`:case`:read-write`:return gO([YD(e,{props:[PD(t,/:(read-\w+)/,`:`+bD+`$1`)]})],r);case`::placeholder`:return gO([YD(e,{props:[PD(t,/:(plac\w+)/,`:`+xD+`input-$1`)]}),YD(e,{props:[PD(t,/:(plac\w+)/,`:`+bD+`$1`)]}),YD(e,{props:[PD(t,/:(plac\w+)/,yD+`input-$1`)]})],r)}return``})}}],kO=function(e){var t=e.key;if(t===`css`){var n=document.querySelectorAll(`style[data-emotion]:not([data-s])`);Array.prototype.forEach.call(n,function(e){e.getAttribute(`data-emotion`).indexOf(` `)!==-1&&(document.head.appendChild(e),e.setAttribute(`data-s`,``))})}var r=e.stylisPlugins||OO,i={},a,o=[];a=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll(`style[data-emotion^="`+t+` "]`),function(e){for(var t=e.getAttribute(`data-emotion`).split(` `),n=1;n<t.length;n++)i[t[n]]=!0;o.push(e)});var s,c=[TO,EO],l,u=[_O,yO(function(e){l.insert(e)})],d=vO(c.concat(r,u)),f=function(e){return gO(dO(e),d)};s=function(e,t,n,r){l=n,f(e?e+`{`+t.styles+`}`:t.styles),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new vD({key:t,container:a,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return p.sheet.hydrate(o),p};function AO(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var jO={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},MO=!1,NO=/[A-Z]|^ms/g,PO=/_EMO_([^_]+?)_([^]*?)_EMO_/g,FO=function(e){return e.charCodeAt(1)===45},IO=function(e){return e!=null&&typeof e!=`boolean`},LO=bO(function(e){return FO(e)?e:e.replace(NO,`-$&`).toLowerCase()}),RO=function(e,t){switch(e){case`animation`:case`animationName`:if(typeof t==`string`)return t.replace(PO,function(e,t,n){return UO={name:t,styles:n,next:UO},t})}return jO[e]!==1&&!FO(e)&&typeof t==`number`&&t!==0?t+`px`:t},zO=`Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.`;function BO(e,t,n){if(n==null)return``;var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case`boolean`:return``;case`object`:var i=n;if(i.anim===1)return UO={name:i.name,styles:i.styles,next:UO},i.name;var a=n;if(a.styles!==void 0){var o=a.next;if(o!==void 0)for(;o!==void 0;)UO={name:o.name,styles:o.styles,next:UO},o=o.next;return a.styles+`;`}return VO(e,t,n);case`function`:if(e!==void 0){var s=UO,c=n(e);return UO=s,BO(e,t,c)}break}var l=n;if(t==null)return l;var u=t[l];return u===void 0?l:u}function VO(e,t,n){var r=``;if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=BO(e,t,n[i])+`;`;else for(var a in n){var o=n[a];if(typeof o!=`object`){var s=o;t!=null&&t[s]!==void 0?r+=a+`{`+t[s]+`}`:IO(s)&&(r+=LO(a)+`:`+RO(a,s)+`;`)}else{if(a===`NO_COMPONENT_SELECTOR`&&MO)throw Error(zO);if(Array.isArray(o)&&typeof o[0]==`string`&&(t==null||t[o[0]]===void 0))for(var c=0;c<o.length;c++)IO(o[c])&&(r+=LO(a)+`:`+RO(a,o[c])+`;`);else{var l=BO(e,t,o);switch(a){case`animation`:case`animationName`:r+=LO(a)+`:`+l+`;`;break;default:r+=a+`{`+l+`}`}}}}return r}var HO=/label:\s*([^\s;{]+)\s*(;|$)/g,UO;function WO(e,t,n){if(e.length===1&&typeof e[0]==`object`&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i=``;UO=void 0;var a=e[0];a==null||a.raw===void 0?(r=!1,i+=BO(n,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=BO(n,t,e[o]),r&&(i+=a[o]);HO.lastIndex=0;for(var s=``,c;(c=HO.exec(i))!==null;)s+=`-`+c[1];return{name:AO(i)+s,styles:i,next:UO}}var GO=!0;function KO(e,t,n){var r=``;return n.split(` `).forEach(function(n){e[n]===void 0?n&&(r+=n+` `):t.push(e[n]+`;`)}),r}var qO=function(e,t,n){var r=e.key+`-`+t.name;(n===!1||GO===!1)&&e.registered[r]===void 0&&(e.registered[r]=t.styles)},JO=function(e,t,n){qO(e,t,n);var r=e.key+`-`+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?`.`+r:``,i,e.sheet,!0),i=i.next;while(i!==void 0)}};function YO(e,t){if(e.inserted[t.name]===void 0)return e.insert(``,t,e.sheet,!0)}function XO(e,t,n){var r=[],i=KO(e,r,n);return r.length<2?n:i+t(r)}var ZO=function(e){var t=kO(e);t.sheet.speedy=function(e){this.isSpeedy=e},t.compat=!0;var n=function(){var e=WO([...arguments],t.registered,void 0);return JO(t,e,!1),t.key+`-`+e.name};return{css:n,cx:function(){var e=[...arguments];return XO(t.registered,n,QO(e))},injectGlobal:function(){YO(t,WO([...arguments],t.registered))},keyframes:function(){var e=WO([...arguments],t.registered),n=`animation-`+e.name;return YO(t,{name:e.name,styles:`@keyframes `+n+`{`+e.styles+`}`}),n},hydrate:function(e){e.forEach(function(e){t.inserted[e]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:KO.bind(null,t.registered),merge:XO.bind(null,t.registered,n)}},QO=function e(t){for(var n=``,r=0;r<t.length;r++){var i=t[r];if(i!=null){var a=void 0;switch(typeof i){case`boolean`:break;case`object`:if(Array.isArray(i))a=e(i);else for(var o in a=``,i)i[o]&&o&&(a&&(a+=` `),a+=o);break;default:a=i}a&&(n&&(n+=` `),n+=a)}}return n},$O=(e,t=!1,n=``)=>{let{variables:r={},...i}=e,a={light:{diffViewerBackground:`#fff`,diffViewerColor:`#212529`,addedBackground:`#e6ffed`,addedColor:`#24292e`,removedBackground:`#ffeef0`,removedColor:`#24292e`,changedBackground:`#fffbdd`,wordAddedBackground:`#acf2bd`,wordRemovedBackground:`#fdb8c0`,addedGutterBackground:`#cdffd8`,removedGutterBackground:`#ffdce0`,gutterBackground:`#f7f7f7`,gutterBackgroundDark:`#f3f1f1`,highlightBackground:`#fffbdd`,highlightGutterBackground:`#fff5b1`,codeFoldGutterBackground:`#dbedff`,codeFoldBackground:`#f1f8ff`,emptyLineBackground:`#fafbfc`,gutterColor:`#212529`,addedGutterColor:`#212529`,removedGutterColor:`#212529`,codeFoldContentColor:`#212529`,diffViewerTitleBackground:`#fafbfc`,diffViewerTitleColor:`#212529`,diffViewerTitleBorderColor:`#eee`,...r.light||{}},dark:{diffViewerBackground:`#2e303c`,diffViewerColor:`#FFF`,addedBackground:`#2ea04326`,addedColor:`white`,removedBackground:`#f851491a`,removedColor:`white`,changedBackground:`#3e302c`,wordAddedBackground:`#2ea04366`,wordRemovedBackground:`#f8514966`,addedGutterBackground:`#3fb9504d`,removedGutterBackground:`#f851494d`,gutterBackground:`#2c2f3a`,gutterBackgroundDark:`#262933`,highlightBackground:`#2a3967`,highlightGutterBackground:`#2d4077`,codeFoldGutterBackground:`#262831`,codeFoldBackground:`#262831`,emptyLineBackground:`#363946`,gutterColor:`#f0f6fc`,addedGutterColor:`#f0f6fc`,removedGutterColor:`#f0f6fc`,codeFoldContentColor:`#9198a1`,diffViewerTitleBackground:`#2f323e`,diffViewerTitleColor:`#f0f6fc`,diffViewerTitleBorderColor:`#353846`,...r.dark||{}}},o=t?a.dark:a.light,{css:s,cx:c}=ZO({key:`react-diff`,nonce:n}),l=s({width:`auto`,overflow:`hidden`,label:`content`}),u=s({label:`split-view`}),d=s({position:`sticky`,top:0,zIndex:2,label:`sticky-header`}),f=s({background:o.diffViewerTitleBackground,color:o.diffViewerTitleColor,padding:`0.5em 1em`,display:`flex`,alignItems:`center`,gap:`0.5em`,fontFamily:`monospace`,fontSize:12,fill:o.diffViewerTitleColor}),p=s({display:`flex`,label:`column-headers`}),m=s({width:`100%`,minWidth:`1000px`,overflowX:`auto`,tableLayout:`fixed`,fontSize:12,background:o.diffViewerBackground,pre:{margin:0,whiteSpace:`pre-wrap`,lineHeight:`1.6em`,width:`fit-content`},label:`diff-container`,borderCollapse:`collapse`,"@media (max-width: 768px)":{minWidth:`unset`}}),h=s({overflow:`hidden`,width:`100%`}),g=s({color:o.diffViewerColor,whiteSpace:`pre-wrap`,fontFamily:`monospace`,lineBreak:`anywhere`,textDecoration:`none`,label:`content-text`}),_=s({userSelect:`none`,label:`unselectable`}),v=s({label:`no-wrap`,pre:{whiteSpace:`pre`},[`.${g}`]:{whiteSpace:`pre`,lineBreak:`auto`}}),y=s({background:`transparent`,border:`none`,cursor:`pointer`,display:`flex`,alignItems:`center`,justifyContent:`center`,margin:0,label:`all-expand-button`,":hover":{fill:o.addedGutterColor},":focus":{outline:`1px ${o.addedGutterColor} solid`}}),b=s({background:o.diffViewerTitleBackground,padding:`0.5em`,lineHeight:`1.4em`,height:`2.4em`,overflow:`hidden`,width:`50%`,borderBottom:`1px solid ${o.diffViewerTitleBorderColor}`,boxSizing:`border-box`,fontSize:12,label:`title-block`,":only-child":{width:`100%`},":last-child:not(:only-child)":{borderLeft:`1px solid ${o.diffViewerTitleBorderColor}`},[`.${g}`]:{color:o.diffViewerTitleColor}}),x=s({color:o.gutterColor,label:`line-number`}),S=s({background:o.removedBackground,color:o.removedColor,pre:{color:o.removedColor},[`.${x}`]:{color:o.removedGutterColor},label:`diff-removed`}),C=s({background:o.addedBackground,color:o.addedColor,pre:{color:o.addedColor},[`.${x}`]:{color:o.addedGutterColor},label:`diff-added`}),w=s({background:o.changedBackground,[`.${x}`]:{color:o.gutterColor},label:`diff-changed`}),T=s({display:`inline`,textDecoration:`none`,label:`word-diff`}),E=s({background:o.wordAddedBackground,label:`word-added`}),ee=s({background:o.wordRemovedBackground,label:`word-removed`}),D=s({backgroundColor:o.codeFoldGutterBackground,label:`code-fold-gutter`,minWidth:`50px`,width:`50px`,textAlign:`center`,fill:o.codeFoldContentColor}),O=s({padding:``}),k=s({background:o.codeFoldBackground,cursor:`pointer`,display:`inline`,margin:0,border:`none`,fill:o.codeFoldContentColor,label:`code-fold-expand-button`}),te=s({color:o.codeFoldContentColor,fontFamily:`monospace`,label:`code-fold-content`}),A=s({display:`block`,width:`10px`,height:`10px`,backgroundColor:`#ddd`,borderWidth:`1px`,borderStyle:`solid`,borderColor:o.diffViewerTitleBorderColor}),j=s({backgroundColor:o.wordAddedBackground}),M=s({backgroundColor:o.wordRemovedBackground}),ne=s({backgroundColor:o.codeFoldBackground,fontSize:12,alignItems:`center`,userSelect:`none`,fontWeight:700,cursor:`pointer`,label:`code-fold`,"&:hover":{color:o.diffViewerColor,fill:o.diffViewerColor,"& *":{color:o.diffViewerColor,fill:o.diffViewerColor}},a:{textDecoration:`underline !important`,cursor:`pointer`,pre:{display:`inline`}}}),N=s({backgroundColor:o.emptyLineBackground,label:`empty-line`}),re=s({width:28,paddingLeft:10,paddingRight:10,userSelect:`none`,label:`marker`,[`&.${C}`]:{pre:{color:o.addedColor}},[`&.${S}`]:{pre:{color:o.removedColor}}}),ie=s({background:o.highlightBackground,label:`highlighted-line`,[`.${E}, .${ee}`]:{backgroundColor:`initial`}}),ae=s({label:`highlighted-gutter`}),P=s({userSelect:`none`,minWidth:50,width:`50px`,padding:`0 10px`,whiteSpace:`nowrap`,label:`gutter`,textAlign:`center`,color:o.gutterColor,background:o.gutterBackground,"&:hover":{cursor:`pointer`,background:o.gutterBackgroundDark,pre:{opacity:1}},pre:{opacity:.5,textAlign:`center`,width:`100%`},[`&.${C}`]:{background:o.addedGutterBackground},[`&.${S}`]:{background:o.removedGutterBackground},[`&.${ae}`]:{background:o.highlightGutterBackground,"&:hover":{background:o.highlightGutterBackground}}}),F=s({"&:hover":{background:o.gutterBackground,cursor:`initial`},label:`empty-gutter`}),oe={diffContainer:m,diffRemoved:S,diffAdded:C,diffChanged:w,splitView:u,marker:re,highlightedGutter:ae,highlightedLine:ie,gutter:P,line:s({verticalAlign:`baseline`,label:`line`,textDecoration:`none`}),lineContent:h,wordDiff:T,wordAdded:E,summary:f,block:A,blockAddition:j,blockDeletion:M,wordRemoved:ee,noSelect:_,noWrap:v,codeFoldGutter:D,codeFoldExpandButton:k,codeFoldContentContainer:O,codeFold:ne,emptyGutter:F,emptyLine:N,lineNumber:x,contentText:g,content:l,column:s({}),codeFoldContent:te,stickyHeader:d,columnHeaders:p,titleBlock:b,allExpandButton:y},se=Object.keys(i).reduce((e,t)=>({...e,[t]:s(i[t])}),{});return Object.keys(oe).reduce((e,t)=>({...e,[t]:se[t]?c(oe[t],se[t]):oe[t]}),{})};function ek(){return(0,L.jsxs)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,width:`16`,height:`16`,children:[(0,L.jsx)(`title`,{children:`fold`}),(0,L.jsx)(`path`,{d:`M10.896 2H8.75V.75a.75.75 0 0 0-1.5 0V2H5.104a.25.25 0 0 0-.177.427l2.896 2.896a.25.25 0 0 0 .354 0l2.896-2.896A.25.25 0 0 0 10.896 2ZM8.75 15.25a.75.75 0 0 1-1.5 0V14H5.104a.25.25 0 0 1-.177-.427l2.896-2.896a.25.25 0 0 1 .354 0l2.896 2.896a.25.25 0 0 1-.177.427H8.75v1.25Zm-6.5-6.5a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM6 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 6 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5ZM12 8a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1 0-1.5h.5A.75.75 0 0 1 12 8Zm2.25.75a.75.75 0 0 0 0-1.5h-.5a.75.75 0 0 0 0 1.5h.5Z`})]})}function tk(e,t,n){let r=[],i=0;for(let e of t){let t=typeof e.value==`string`?e.value:``;t.length>0&&(r.push({start:i,end:i+t.length,type:e.type}),i+=t.length)}let a=[],o=0;for(;o<e.length;)if(e[o]===`<`){let t=e.indexOf(`>`,o);if(t===-1){a.push({type:`text`,content:e.slice(o)});break}a.push({type:`tag`,content:e.slice(o,t+1)}),o=t+1}else{let t=e.indexOf(`<`,o);t===-1&&(t=e.length),a.push({type:`text`,content:e.slice(o,t)}),o=t}function s(e){return e.replace(/</g,`<`).replace(/>/g,`>`).replace(/&/g,`&`).replace(/"/g,`"`).replace(/'/g,`'`).replace(/ /g,`\xA0`)}function c(e){return e===XE.ADDED?{open:`<ins class="${n.wordDiff} ${n.wordAdded}">`,close:`</ins>`}:e===XE.REMOVED?{open:`<del class="${n.wordDiff} ${n.wordRemoved}">`,close:`</del>`}:{open:`<span class="${n.wordDiff}">`,close:`</span>`}}let l=0,u=``;for(let e of a)if(e.type===`tag`)u+=e.content;else{let t=e.content,n=s(t),i=0,a=0;for(;i<n.length;){let e=l+i,o=r.find(t=>e>=t.start&&e<t.end);if(!o){let e=t[a];u+=e,a++,i++;continue}let s=o.end-e,d=n.length-i,f=Math.min(s,d),p=a,m=0;for(;m<f&&p<t.length;){if(t[p]===`&`){let e=t.indexOf(`;`,p);e!==-1&&e-p<10?p=e+1:p++}else p++;m++}let h=t.slice(a,p),g=c(o.type);g?u+=g.open+h+g.close:u+=h,a=p,i+=f}l+=n.length}return u}var nk;(function(e){e.LEFT=`L`,e.RIGHT=`R`})(nk||={});var rk=class e extends I.Component{styles;wordDiffCache=new Map;contentColumnRef=I.createRef();charMeasureRef=I.createRef();stickyHeaderRef=I.createRef();resizeObserver=null;static defaultProps={oldValue:``,newValue:``,splitView:!0,highlightLines:[],disableWordDiff:!1,compareMethod:sD.CHARS,styles:{},hideLineNumbers:!1,extraLinesSurroundingDiff:3,showDiffOnly:!0,useDarkTheme:!1,linesOffset:0,nonce:``};constructor(e){super(e),this.state={expandedBlocks:[],noSelect:void 0,scrollableContainerRef:I.createRef(),computedDiffResult:{},isLoading:!1,visibleStartRow:0,contentColumnWidth:null,charWidth:null,cumulativeOffsets:null}}getWordDiffValues=(e,t,n)=>{if(!e||!t)return{leftValue:e?.value,rightValue:t?.value};if(e.rawValue===void 0||t.rawValue===void 0)return{leftValue:e.value,rightValue:t.value};let r=`${n}-${e.rawValue}-${t.rawValue}`,i=this.wordDiffCache.get(r);if(!i){let n=this.props.compareMethod===sD.JSON||this.props.compareMethod===sD.YAML?sD.CHARS:this.props.compareMethod,a=lD(e.rawValue,t.rawValue,n);i={left:a.left,right:a.right},this.wordDiffCache.set(r,i)}return{leftValue:i.left,rightValue:i.right}};resetCodeBlocks=()=>this.state.expandedBlocks.length>0?(this.setState({expandedBlocks:[]}),!0):!1;onBlockExpand=e=>{let t=this.state.expandedBlocks.slice();t.push(e),this.setState({expandedBlocks:t},()=>this.recalculateOffsets())};getStickyHeaderHeight(){return this.stickyHeaderRef.current?.offsetHeight||0}measureCharWidth(){let e=this.charMeasureRef.current;return e&&e.getBoundingClientRect().width||7.2}measureContentColumnWidth(){let e=this.contentColumnRef.current;if(e&&e.clientWidth>0){let t=window.getComputedStyle(e),n=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),r=e.clientWidth-n;if(r>0)return r}let t=this.state.scrollableContainerRef.current;if(!t||t.clientWidth<=0)return null;let n=t.clientWidth,r=this.props.hideLineNumbers?0:50;this.props.splitView;let i=this.props.splitView?2:1,a=this.props.splitView?2:1,o=n-(2*r+i*28);return Math.max(100,o/a)}getTextLength(e){return e?typeof e==`string`?e.length:e.reduce((e,t)=>e+(typeof t.value==`string`?t.value.length:0),0):0}buildCumulativeOffsets(t,n,r,i,a,o,s,c){let l=[0],u=new Set;for(let d=0;d<t.length;d++){let f=t[d];if(a){let t=n[d];if(t!==void 0&&!i.includes(t)){let n=r[t].endLine===d;!u.has(t)&&n&&(u.add(t),l.push(l[l.length-1]+e.ESTIMATED_ROW_HEIGHT));continue}}let p=f.left?.value?this.getTextLength(f.left.value):0,m=f.right?.value?this.getTextLength(f.right.value):0,h=c?Math.max(p,m):p||m,g=Math.floor(s/o),_=g>0?Math.max(1,Math.ceil(h/g)):1;l.push(l[l.length-1]+_*e.ESTIMATED_ROW_HEIGHT)}return l}findLineAtOffset(e,t){let n=0,r=t.length-2;for(;n<r;){let i=Math.floor((n+r+1)/2);t[i]<=e?n=i:r=i-1}return n}recalculateOffsets=()=>{if(!this.props.infiniteLoading)return;let e=this.measureContentColumnWidth(),t=this.measureCharWidth();if(!e)return;let n=this.getMemoisedKey(),{lineInformation:r,lineBlocks:i,blocks:a}=this.state.computedDiffResult[n]??{};if(!r)return;let o=this.buildCumulativeOffsets(r,i,a,this.state.expandedBlocks,this.props.showDiffOnly,t,e,this.props.splitView);this.setState({cumulativeOffsets:o,contentColumnWidth:e,charWidth:t},()=>{this.onScroll()})};computeStyles=oS($O);onLineNumberClickProxy=e=>this.props.onLineNumberClick?t=>this.props.onLineNumberClick(e,t):()=>{};shouldHighlightWordDiff=()=>{let{compareMethod:e}=this.props;return e===sD.CHARS||e===sD.WORDS||e===sD.WORDS_WITH_SPACE||e===sD.JSON||e===sD.YAML};renderWordDiff=(e,t)=>{let n=this.shouldHighlightWordDiff(),r=e.map(e=>typeof e.value==`string`?e.value:``).join(``);if(r.length>500)return[(0,L.jsx)(`span`,{children:r},`long-line`)];if(t){let i=t(r),a=i?.props?.dangerouslySetInnerHTML?.__html;if(typeof a==`string`){let t=tk(a,e,{wordDiff:this.styles.wordDiff,wordAdded:n?this.styles.wordAdded:``,wordRemoved:n?this.styles.wordRemoved:``});return[I.cloneElement(i,{key:`highlighted-diff`,dangerouslySetInnerHTML:{__html:t}})]}}return e.map((e,t)=>{let r;return r=typeof e.value==`string`?e.value:void 0,e.type===XE.ADDED?(0,L.jsx)(`ins`,{className:(0,nS.default)(this.styles.wordDiff,{[this.styles.wordAdded]:n}),children:r},t):e.type===XE.REMOVED?(0,L.jsx)(`del`,{className:(0,nS.default)(this.styles.wordDiff,{[this.styles.wordRemoved]:n}),children:r},t):(0,L.jsx)(`span`,{className:(0,nS.default)(this.styles.wordDiff),children:r},t)})};renderLine=(e,t,n,r,i,a)=>{let o=`${n}-${e}`,s=`${a}-${i}`,c=this.props.highlightLines.includes(o)||this.props.highlightLines.includes(s),l=t===XE.ADDED,u=t===XE.REMOVED,d=t===XE.CHANGED,f,p=Array.isArray(r);f=p?this.renderWordDiff(r,this.props.renderContent):this.props.renderContent?this.props.renderContent(r):r;let m=`div`;return l&&!p?m=`ins`:u&&!p&&(m=`del`),(0,L.jsxs)(L.Fragment,{children:[!this.props.hideLineNumbers&&(0,L.jsx)(`td`,{onClick:e&&this.onLineNumberClickProxy(o),className:(0,nS.default)(this.styles.gutter,{[this.styles.emptyGutter]:!e,[this.styles.diffAdded]:l,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:d,[this.styles.highlightedGutter]:c}),children:(0,L.jsx)(`pre`,{className:this.styles.lineNumber,children:e})}),!this.props.splitView&&!this.props.hideLineNumbers&&(0,L.jsx)(`td`,{onClick:i&&this.onLineNumberClickProxy(s),className:(0,nS.default)(this.styles.gutter,{[this.styles.emptyGutter]:!i,[this.styles.diffAdded]:l,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:d,[this.styles.highlightedGutter]:c}),children:(0,L.jsx)(`pre`,{className:this.styles.lineNumber,children:i})}),this.props.renderGutter?this.props.renderGutter({lineNumber:e,type:t,prefix:n,value:r,additionalLineNumber:i,additionalPrefix:a,styles:this.styles}):null,(0,L.jsx)(`td`,{className:(0,nS.default)(this.styles.marker,{[this.styles.emptyLine]:!f,[this.styles.diffAdded]:l,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:d,[this.styles.highlightedLine]:c}),children:(0,L.jsxs)(`pre`,{children:[l&&`+`,u&&`-`]})}),(0,L.jsx)(`td`,{ref:n===nk.LEFT&&!this.state.cumulativeOffsets?this.contentColumnRef:void 0,className:(0,nS.default)(this.styles.content,{[this.styles.emptyLine]:!f,[this.styles.diffAdded]:l,[this.styles.diffRemoved]:u,[this.styles.diffChanged]:d,[this.styles.highlightedLine]:c,left:n===nk.LEFT,right:n===nk.RIGHT}),onMouseDown:()=>{let e=document.getElementsByClassName(n===nk.LEFT?`right`:`left`);for(let t=0;t<e.length;t++)e.item(t).classList.add(this.styles.noSelect)},title:l&&!p?`Added line`:u&&!p?`Removed line`:void 0,children:(0,L.jsx)(m,{className:this.styles.contentText,children:f})})]})};renderSplitView=({left:e,right:t},n)=>{let{leftValue:r,rightValue:i}=this.getWordDiffValues(e,t,n);return(0,L.jsxs)(`tr`,{className:this.styles.line,children:[this.renderLine(e.lineNumber,e.type,nk.LEFT,r),this.renderLine(t.lineNumber,t.type,nk.RIGHT,i)]},n)};renderInlineView=({left:e,right:t},n)=>{let{leftValue:r,rightValue:i}=this.getWordDiffValues(e,t,n),a;return e.type===XE.REMOVED&&t.type===XE.ADDED?(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(`tr`,{className:this.styles.line,children:this.renderLine(e.lineNumber,e.type,nk.LEFT,r,null)}),(0,L.jsx)(`tr`,{className:this.styles.line,children:this.renderLine(null,t.type,nk.RIGHT,i,t.lineNumber,nk.RIGHT)})]},n):(e.type===XE.REMOVED&&(a=this.renderLine(e.lineNumber,e.type,nk.LEFT,r,null)),e.type===XE.DEFAULT&&(a=this.renderLine(e.lineNumber,e.type,nk.LEFT,r,t.lineNumber,nk.RIGHT)),t.type===XE.ADDED&&(a=this.renderLine(null,t.type,nk.RIGHT,i,t.lineNumber)),(0,L.jsx)(`tr`,{className:this.styles.line,children:a},n))};onBlockClickProxy=e=>()=>this.onBlockExpand(e);renderSkippedLineIndicator=(e,t,n,r)=>{let{hideLineNumbers:i,splitView:a}=this.props,o=this.props.codeFoldMessageRenderer?this.props.codeFoldMessageRenderer(e,n,r):(0,L.jsxs)(`span`,{className:this.styles.codeFoldContent,children:[`@@ -`,n-e,`,`,e,` +`,r-e,`,`,e,` @@`]}),s=(0,L.jsx)(`td`,{className:this.styles.codeFoldContentContainer,children:(0,L.jsx)(`button`,{type:`button`,className:this.styles.codeFoldExpandButton,onClick:this.onBlockClickProxy(t),tabIndex:0,children:o})}),c=!a&&!i,l=(0,L.jsx)(`td`,{className:this.styles.codeFoldGutter,children:(0,L.jsx)(mD,{})});return(0,L.jsxs)(`tr`,{className:this.styles.codeFold,onClick:this.onBlockClickProxy(t),role:`button`,tabIndex:0,children:[!i&&l,this.props.renderGutter?(0,L.jsx)(`td`,{className:this.styles.codeFoldGutter}):null,(0,L.jsx)(`td`,{className:(0,nS.default)({[this.styles.codeFoldGutter]:c})}),c?(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(`td`,{}),s]}):(0,L.jsxs)(I.Fragment,{children:[s,this.props.renderGutter?(0,L.jsx)(`td`,{}):null,(0,L.jsx)(`td`,{}),(0,L.jsx)(`td`,{}),i?null:(0,L.jsx)(`td`,{})]})]},`${n}-${r}`)};getMemoisedKey=()=>{let{oldValue:e,newValue:t,disableWordDiff:n,compareMethod:r,linesOffset:i,alwaysShowLines:a,extraLinesSurroundingDiff:o}=this.props;return JSON.stringify({oldValue:e,newValue:t,disableWordDiff:n,compareMethod:r,linesOffset:i,alwaysShowLines:a,extraLinesSurroundingDiff:o})};memoisedCompute=async()=>{let{oldValue:e,newValue:t,disableWordDiff:n,compareMethod:r,linesOffset:i}=this.props,a=this.getMemoisedKey();if(this.state.computedDiffResult[a]){this.setState(e=>({...e,isLoading:!1}));return}let o=this.props.infiniteLoading?.containerHeight,s=o?typeof o==`number`?o:parseInt(o,10)||0:0,c=!n&&!!this.props.infiniteLoading&&s>0&&s<2e3,{lineInformation:l,diffLines:u}=await pD(e,t,n,r,i,this.props.alwaysShowLines,c),{lineBlocks:d,blocks:f}=sS(l,u,this.props.extraLinesSurroundingDiff<0?0:Math.round(this.props.extraLinesSurroundingDiff));this.state.computedDiffResult[a]={lineInformation:l,lineBlocks:d,blocks:f},this.setState(e=>({...e,computedDiffResult:this.state.computedDiffResult,isLoading:!1}),()=>{this.props.infiniteLoading&&requestAnimationFrame(()=>this.recalculateOffsets())})};static ESTIMATED_ROW_HEIGHT=19;onScroll=()=>{let t=this.state.scrollableContainerRef.current;if(!t||!this.props.infiniteLoading)return;let n=this.getStickyHeaderHeight(),r=Math.max(0,t.scrollTop-n),{cumulativeOffsets:i}=this.state,a=i?this.findLineAtOffset(r,i):Math.floor(r/e.ESTIMATED_ROW_HEIGHT);a!==this.state.visibleStartRow&&this.setState({visibleStartRow:a})};renderDiff=()=>{let{splitView:t,infiniteLoading:n,showDiffOnly:r}=this.props,{computedDiffResult:i,expandedBlocks:a,visibleStartRow:o,scrollableContainerRef:s,cumulativeOffsets:c}=this.state,{lineInformation:l=[],lineBlocks:u=[],blocks:d=[]}=i[this.getMemoisedKey()]??{},f=0,p=1/0;if(n&&s.current){let t=s.current,n=this.getStickyHeaderHeight(),r=Math.max(0,t.scrollTop-n);if(c){let n=c[c.length-1]||0,i=c.length-2;f=Math.max(0,this.findLineAtOffset(r,c)-5),p=this.findLineAtOffset(r+t.clientHeight,c)+5;let a=Math.ceil(t.clientHeight/e.ESTIMATED_ROW_HEIGHT);p=Math.max(p,f+a+5),r+t.clientHeight>=n-5*e.ESTIMATED_ROW_HEIGHT&&(p=i+5)}else{let n=Math.ceil(t.clientHeight/e.ESTIMATED_ROW_HEIGHT);f=Math.max(0,o-5),p=o+n+5}}let m=new Map,h=new Set,g=0;for(let e=0;e<l.length;e++){let t=u[e];if(r&&t!==void 0)if(a.includes(t))m.set(e,g),g++;else{let n=d[t].endLine===e;!h.has(t)&&n&&(h.add(t),m.set(e,g),g++)}else m.set(e,g),g++}let _=g,v=[],y=0,b=!1,x=-1;h.clear();for(let n=0;n<l.length;n++){let i=l[n],o=m.get(n);if(o!==void 0&&!(o<f)){if(o>p)break;if(b||=(y=c?c[o]||0:o*e.ESTIMATED_ROW_HEIGHT,!0),x=o,r){let e=u[n];if(e!==void 0){let t=d[e].endLine===n;if(!a.includes(e)&&t){v.push((0,L.jsx)(I.Fragment,{children:this.renderSkippedLineIndicator(d[e].lines,e,i.left.lineNumber,i.right.lineNumber)},n));continue}if(!a.includes(e))continue}}v.push(t?this.renderSplitView(i,n):this.renderInlineView(i,n))}}let S=c?c[c.length-1]||0:_*e.ESTIMATED_ROW_HEIGHT,C=c&&x>=0?S-(c[x+1]||S):0;return{diffNodes:v,blocks:d,lineInformation:l,totalRenderedRows:_,topPadding:y,bottomPadding:C,totalContentHeight:S,renderedCount:v.length,debug:{visibleRowStart:f,visibleRowEnd:p,totalRows:_,offsetsLength:c?.length??0,renderedCount:v.length,scrollTop:s.current?.scrollTop??0,headerHeight:this.getStickyHeaderHeight(),contentScrollTop:s.current?Math.max(0,s.current.scrollTop-this.getStickyHeaderHeight()):0,clientHeight:s.current?.clientHeight??0}}};componentDidUpdate(e){if(e.oldValue!==this.props.oldValue||e.newValue!==this.props.newValue||e.compareMethod!==this.props.compareMethod||e.disableWordDiff!==this.props.disableWordDiff||e.linesOffset!==this.props.linesOffset){this.wordDiffCache.clear();let e=this.state.scrollableContainerRef.current;e&&(e.scrollTop=0),this.setState(e=>({...e,isLoading:!0,visibleStartRow:0,cumulativeOffsets:null})),this.memoisedCompute()}}componentDidMount(){if(this.setState(e=>({...e,isLoading:!0})),this.memoisedCompute(),typeof ResizeObserver<`u`&&this.props.infiniteLoading){this.resizeObserver=new ResizeObserver(()=>{requestAnimationFrame(()=>this.recalculateOffsets())});let e=this.state.scrollableContainerRef.current;e&&this.resizeObserver.observe(e)}}componentWillUnmount(){this.resizeObserver?.disconnect()}render=()=>{let{oldValue:e,newValue:t,useDarkTheme:n,leftTitle:r,rightTitle:i,splitView:a,compareMethod:o,hideLineNumbers:s,nonce:c}=this.props;if(typeof o==`string`&&o!==sD.JSON&&(typeof e!=`string`||typeof t!=`string`))throw Error(`"oldValue" and "newValue" should be strings`);this.styles=this.computeStyles(this.props.styles,n,c);let l=this.renderDiff(),u=3,d=4;s&&(--u,--d),this.props.renderGutter&&(u+=1,d+=1);let f=0,p=0;for(let e of l.lineInformation)e.left.type===XE.ADDED&&p++,e.right.type===XE.ADDED&&p++,e.left.type===XE.REMOVED&&f++,e.right.type===XE.REMOVED&&f++;let m=f+p,h=Math.round(p/m*100),g=[];for(let e=0;e<5;e++)h>e*20?g.push((0,L.jsx)(`span`,{className:(0,nS.default)(this.styles.block,this.styles.blockAddition)},e)):g.push((0,L.jsx)(`span`,{className:(0,nS.default)(this.styles.block,this.styles.blockDeletion)},e));let _=this.state.expandedBlocks.length===l.blocks.length,v=this.props.loadingElement,y=this.props.infiniteLoading?{overflowY:`scroll`,overflowX:`hidden`,height:this.props.infiniteLoading.containerHeight}:{},b=!!this.props.infiniteLoading&&!this.state.cumulativeOffsets,x=(0,L.jsxs)(`table`,{className:(0,nS.default)(this.styles.diffContainer,{[this.styles.splitView]:a,[this.styles.noWrap]:b}),onMouseUp:()=>{let e=document.getElementsByClassName(`right`);for(let t=0;t<e.length;t++)e.item(t).classList.remove(this.styles.noSelect);let t=document.getElementsByClassName(`left`);for(let e=0;e<t.length;e++)t.item(e).classList.remove(this.styles.noSelect)},children:[(0,L.jsxs)(`colgroup`,{children:[!this.props.hideLineNumbers&&(0,L.jsx)(`col`,{width:`50px`}),!a&&!this.props.hideLineNumbers&&(0,L.jsx)(`col`,{width:`50px`}),this.props.renderGutter&&(0,L.jsx)(`col`,{width:`50px`}),(0,L.jsx)(`col`,{width:`28px`}),(0,L.jsx)(`col`,{width:`auto`}),a&&(0,L.jsxs)(L.Fragment,{children:[!this.props.hideLineNumbers&&(0,L.jsx)(`col`,{width:`50px`}),this.props.renderGutter&&(0,L.jsx)(`col`,{width:`50px`}),(0,L.jsx)(`col`,{width:`28px`}),(0,L.jsx)(`col`,{width:`auto`})]})]}),(0,L.jsx)(`tbody`,{children:l.diffNodes})]});return(0,L.jsxs)(`div`,{style:{...y,position:`relative`},onScroll:this.onScroll,ref:this.state.scrollableContainerRef,children:[(!this.props.hideSummary||r||i)&&(0,L.jsxs)(`div`,{ref:this.stickyHeaderRef,className:this.styles.stickyHeader,children:[!this.props.hideSummary&&(0,L.jsxs)(`div`,{className:this.styles.summary,role:`banner`,children:[(0,L.jsx)(`button`,{type:`button`,className:this.styles.allExpandButton,onClick:()=>{this.setState({expandedBlocks:_?[]:l.blocks.map(e=>e.index)},()=>this.recalculateOffsets())},children:_?(0,L.jsx)(ek,{}):(0,L.jsx)(mD,{})}),` `,m,(0,L.jsx)(`div`,{style:{display:`flex`,gap:`1px`},children:g}),this.props.summary?(0,L.jsx)(`span`,{children:this.props.summary}):null]}),(r||i)&&(0,L.jsxs)(`div`,{className:this.styles.columnHeaders,children:[(0,L.jsx)(`div`,{className:this.styles.titleBlock,children:r?(0,L.jsx)(`pre`,{className:this.styles.contentText,children:r}):null}),a&&(0,L.jsx)(`div`,{className:this.styles.titleBlock,children:i?(0,L.jsx)(`pre`,{className:this.styles.contentText,children:i}):null})]})]}),this.state.isLoading&&v&&(0,L.jsx)(v,{}),this.props.infiniteLoading?(0,L.jsx)(`div`,{style:{height:l.totalContentHeight,position:`relative`},children:(0,L.jsx)(`div`,{style:{position:`absolute`,top:l.topPadding,left:0,right:0},children:x})}):x,(0,L.jsx)(`span`,{ref:this.charMeasureRef,style:{position:`absolute`,top:0,left:`-9999px`,visibility:`hidden`,whiteSpace:`pre`,fontFamily:`monospace`,fontSize:12},"aria-hidden":`true`,children:`M`}),this.props.infiniteLoading&&this.props.showDebugInfo&&(0,L.jsxs)(`div`,{style:{position:`fixed`,top:10,right:10,background:`rgba(0,0,0,0.85)`,color:`#0f0`,padding:`10px`,fontFamily:`monospace`,fontSize:`11px`,zIndex:9999,borderRadius:`4px`,maxWidth:`300px`,lineHeight:1.4},children:[(0,L.jsx)(`div`,{style:{fontWeight:`bold`,marginBottom:`5px`,color:`#fff`},children:`Debug Info`}),(0,L.jsxs)(`div`,{children:[`scrollTop: `,l.debug.scrollTop]}),(0,L.jsxs)(`div`,{children:[`headerHeight: `,l.debug.headerHeight]}),(0,L.jsxs)(`div`,{children:[`contentScrollTop: `,l.debug.contentScrollTop]}),(0,L.jsxs)(`div`,{children:[`clientHeight: `,l.debug.clientHeight]}),(0,L.jsxs)(`div`,{style:{marginTop:`5px`,borderTop:`1px solid #444`,paddingTop:`5px`},children:[(0,L.jsxs)(`div`,{children:[`visibleRowStart: `,l.debug.visibleRowStart]}),(0,L.jsxs)(`div`,{children:[`visibleRowEnd: `,l.debug.visibleRowEnd]})]}),(0,L.jsxs)(`div`,{style:{marginTop:`5px`,borderTop:`1px solid #444`,paddingTop:`5px`},children:[(0,L.jsxs)(`div`,{children:[`totalRows: `,l.debug.totalRows]}),(0,L.jsxs)(`div`,{children:[`offsetsLength: `,l.debug.offsetsLength]}),(0,L.jsxs)(`div`,{children:[`renderedCount: `,l.debug.renderedCount]})]}),(0,L.jsxs)(`div`,{style:{marginTop:`5px`,borderTop:`1px solid #444`,paddingTop:`5px`},children:[(0,L.jsxs)(`div`,{children:[`topPadding: `,l.topPadding.toFixed(0)]}),(0,L.jsxs)(`div`,{children:[`bottomPadding: `,l.bottomPadding.toFixed(0)]}),(0,L.jsxs)(`div`,{children:[`totalContentHeight: `,l.totalContentHeight.toFixed(0)]})]}),(0,L.jsxs)(`div`,{style:{marginTop:`5px`,borderTop:`1px solid #444`,paddingTop:`5px`,color:`#ff0`},children:[(0,L.jsxs)(`div`,{children:[`cumulativeOffsets: `,this.state.cumulativeOffsets?`SET`:`NULL`]}),(0,L.jsxs)(`div`,{children:[`columnWidth: `,this.state.contentColumnWidth?.toFixed(0)??`N/A`,`px`]}),(0,L.jsxs)(`div`,{children:[`charWidth: `,this.state.charWidth?.toFixed(2)??`N/A`,`px`]}),(0,L.jsxs)(`div`,{children:[`charsPerRow: `,this.state.contentColumnWidth&&this.state.charWidth?Math.floor(this.state.contentColumnWidth/this.state.charWidth):`N/A`]})]}),this.state.cumulativeOffsets&&(0,L.jsxs)(`div`,{style:{marginTop:`5px`,borderTop:`1px solid #444`,paddingTop:`5px`,color:`#0ff`,fontSize:`10px`},children:[(0,L.jsxs)(`div`,{children:[`offsets[`,l.debug.visibleRowEnd,`]: `,this.state.cumulativeOffsets[l.debug.visibleRowEnd]?.toFixed(0)??`N/A`]}),(0,L.jsxs)(`div`,{children:[`offsets[`,l.debug.totalRows-1,`]: `,this.state.cumulativeOffsets[l.debug.totalRows-1]?.toFixed(0)??`N/A`]}),(0,L.jsxs)(`div`,{children:[`offsets[`,l.debug.totalRows,`]: `,this.state.cumulativeOffsets[l.debug.totalRows]?.toFixed(0)??`N/A`]}),(0,L.jsxs)(`div`,{style:{marginTop:`3px`},children:[`viewportEnd: `,(l.debug.contentScrollTop+l.debug.clientHeight).toFixed(0)]}),(0,L.jsxs)(`div`,{style:{marginTop:`3px`,color:`#f0f`},children:[`scrollHeight: `,this.state.scrollableContainerRef.current?.scrollHeight??`N/A`]}),(0,L.jsxs)(`div`,{children:[`maxScrollTop: `,(this.state.scrollableContainerRef.current?.scrollHeight??0)-l.debug.clientHeight]})]})]})]})}};function ik({...e}){return(0,L.jsx)(Vl,{"data-slot":`dialog`,...e})}function ak({...e}){return(0,L.jsx)(Hl,{"data-slot":`dialog-trigger`,...e})}function ok({...e}){return(0,L.jsx)(Ul,{"data-slot":`dialog-portal`,...e})}function sk({className:e,...t}){return(0,L.jsx)(Wl,{"data-slot":`dialog-overlay`,className:G(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function ck({className:e,children:t,showCloseButton:n=!0,...r}){return(0,L.jsxs)(ok,{"data-slot":`dialog-portal`,children:[(0,L.jsx)(sk,{}),(0,L.jsxs)(Gl,{"data-slot":`dialog-content`,className:G(`bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg`,e),...r,children:[t,n&&(0,L.jsxs)(Jl,{"data-slot":`dialog-close`,className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,L.jsx)(io,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function lk({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`dialog-header`,className:G(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function uk({className:e,showCloseButton:t=!1,children:n,...r}){return(0,L.jsxs)(`div`,{"data-slot":`dialog-footer`,className:G(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,L.jsx)(Jl,{asChild:!0,children:(0,L.jsx)(K,{variant:`outline`,children:`Close`})})]})}function dk({className:e,...t}){return(0,L.jsx)(Kl,{"data-slot":`dialog-title`,className:G(`text-lg leading-none font-semibold`,e),...t})}function fk({className:e,...t}){return(0,L.jsx)(ql,{"data-slot":`dialog-description`,className:G(`text-muted-foreground text-sm`,e),...t})}function pk({className:e,children:t,viewportRef:n,...r}){return(0,L.jsxs)(Yg,{"data-slot":`scroll-area`,className:G(`relative`,e),...r,children:[(0,L.jsx)(Xg,{"data-slot":`scroll-area-viewport`,ref:n,className:`focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1`,children:t}),(0,L.jsx)(mk,{}),(0,L.jsx)(mk,{orientation:`horizontal`}),(0,L.jsx)(Zg,{})]})}function mk({className:e,orientation:t=`vertical`,...n}){return(0,L.jsx)(Cg,{"data-slot":`scroll-area-scrollbar`,orientation:t,className:G(`flex touch-none select-none`,t===`vertical`&&`h-full w-[6px] border-l border-l-transparent p-0`,t===`horizontal`&&`h-[6px] flex-col border-t border-t-transparent p-0`,e),...n,children:(0,L.jsx)(Pg,{"data-slot":`scroll-area-thumb`,className:`bg-border hover:bg-muted-foreground/50 relative flex-1 rounded-[3px] transition-colors duration-200`})})}function hk(e){return e===`save`?`确认保存配置`:e===`saveAndApply`?`确认保存并应用配置`:`配置 Diff`}function gk(e){return e===`save`?`请先审核配置变更,再确认保存到配置文件。`:e===`saveAndApply`?`请先审核配置变更,再确认保存并热应用。`:`查看当前草稿与已保存配置的差异。`}function _k(){let{theme:e}=mi(),t=Qx(e=>e.config),n=Qx(e=>e.draft),r=Qx(e=>e.saving),i=Qx(e=>e.applying),a=Qx(e=>e.save),o=Qx(e=>e.saveAndApply),s=eS(e=>e.diffOpen),c=eS(e=>e.diffMode),l=eS(e=>e.setDiffOpen),u=r||i,d=JSON.stringify(t??{},null,2),f=JSON.stringify(n??{},null,2),p=d!==f,m=c===`save`||c===`saveAndApply`;async function h(){try{c===`save`?(await a(),zi.success(`配置已保存`)):c===`saveAndApply`&&(await o(),zi.success(`配置已保存并应用`)),l(!1)}catch(e){let t=c===`saveAndApply`?`保存并应用失败`:`保存失败`;zi.error(e instanceof Error?e.message:t)}}return(0,L.jsx)(ik,{open:s,onOpenChange:l,children:(0,L.jsxs)(ck,{className:`h-[92vh] w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)] sm:max-w-[calc(100vw-2rem)]!`,children:[(0,L.jsxs)(lk,{children:[(0,L.jsx)(dk,{children:hk(c)}),(0,L.jsx)(fk,{children:gk(c)})]}),(0,L.jsx)(`div`,{className:`h-[calc(92vh-170px)] rounded-lg border bg-background`,children:(0,L.jsx)(pk,{className:`h-full w-full`,children:p?(0,L.jsx)(rk,{oldValue:d,newValue:f,splitView:!0,showDiffOnly:!1,leftTitle:`已保存配置`,rightTitle:`当前草稿`,useDarkTheme:e===`dark`,styles:{variables:{light:{codeFoldGutterBackground:`transparent`}},diffContainer:{overflowX:`auto`}}}):(0,L.jsx)(`pre`,{className:`p-4 text-xs leading-5 whitespace-pre-wrap wrap-break-word font-mono`,children:f})})}),(0,L.jsx)(uk,{children:m?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(K,{variant:`outline`,onClick:()=>l(!1),disabled:u,children:`取消`}),(0,L.jsx)(K,{onClick:h,disabled:u||!p,children:c===`save`?`确认保存`:`确认保存并应用`})]}):(0,L.jsx)(K,{variant:`outline`,onClick:()=>l(!1),children:`关闭`})})]})})}function vk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yk(e){if(Array.isArray(e))return e}function bk(e,t,n){return(t=kk(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xk(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Sk(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
124
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Ck(Object(n),!0).forEach(function(t){bk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ck(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tk(e,t){if(e==null)return{};var n,r,i=Ek(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Ek(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Dk(e,t){return yk(e)||xk(e,t)||Ak(e,t)||Sk()}function Ok(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kk(e){var t=Ok(e,`string`);return typeof t==`symbol`?t:t+``}function Ak(e,t){if(e){if(typeof e==`string`)return vk(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vk(e,t):void 0}}function jk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Mk(Object(n),!0).forEach(function(t){jk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Pk(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function Fk(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function Ik(e){return{}.toString.call(e).includes(`Object`)}function Lk(e){return!Object.keys(e).length}function Rk(e){return typeof e==`function`}function zk(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Bk(e,t){return Ik(t)||Gk(`changeType`),Object.keys(t).some(function(t){return!zk(e,t)})&&Gk(`changeField`),t}function Vk(e){Rk(e)||Gk(`selectorType`)}function Hk(e){Rk(e)||Ik(e)||Gk(`handlerType`),Ik(e)&&Object.values(e).some(function(e){return!Rk(e)})&&Gk(`handlersType`)}function Uk(e){e||Gk(`initialIsRequired`),Ik(e)||Gk(`initialType`),Lk(e)&&Gk(`initialContent`)}function Wk(e,t){throw Error(e[t]||e.default)}var Gk=Fk(Wk)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),Kk={changes:Bk,selector:Vk,handler:Hk,initial:Uk};function qk(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Kk.initial(e),Kk.handler(t);var n={current:e},r=Fk(Xk)(n,t),i=Fk(Yk)(n),a=Fk(Kk.changes)(e),o=Fk(Jk)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return Kk.selector(e),e(n.current)}function c(e){Pk(r,i,a,o)(e)}return[s,c]}function Jk(e,t){return Rk(t)?t(e.current):t}function Yk(e,t){return e.current=Nk(Nk({},e.current),t),t}function Xk(e,t,n){return Rk(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var Zk={create:qk},Qk={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function $k(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function eA(e){return{}.toString.call(e).includes(`Object`)}function tA(e){return e||aA(`configIsRequired`),eA(e)||aA(`configType`),e.urls?(nA(),{paths:{vs:e.urls.monacoBase}}):e}function nA(){console.warn(iA.deprecation)}function rA(e,t){throw Error(e[t]||e.default)}var iA={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
|
|
125
|
-
You are using deprecated way of configuration.
|
|
126
|
-
|
|
127
|
-
Instead of using
|
|
128
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
129
|
-
use
|
|
130
|
-
monaco.config({ paths: { vs: '...' } })
|
|
131
|
-
|
|
132
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
133
|
-
`},aA=$k(rA)(iA),oA={config:tA},sA=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function cA(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],cA(e[n],t[n]))}),wk(wk({},e),t)}var lA={type:`cancelation`,msg:`operation is manually canceled`};function uA(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(lA):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var dA=[`monaco`],fA=Dk(Zk.create({config:Qk,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),pA=fA[0],mA=fA[1];function hA(e){var t=oA.config(e),n=t.monaco,r=Tk(t,dA);mA(function(e){return{config:cA(e.config,r),monaco:n}})}function gA(){var e=pA(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(mA({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),uA(CA);if(window.monaco&&window.monaco.editor)return xA(window.monaco),e.resolve(window.monaco),uA(CA);sA(_A,yA)(bA)}return uA(CA)}function _A(e){return document.body.appendChild(e)}function vA(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function yA(e){var t=pA(function(e){return{config:e.config,reject:e.reject}}),n=vA(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function bA(){var e=pA(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;xA(n),e.resolve(n)},function(t){e.reject(t)})}function xA(e){pA().monaco||mA({monaco:e})}function SA(){return pA(function(e){return e.monaco})}var CA=new Promise(function(e,t){return mA({resolve:e,reject:t})}),wA={config:hA,init:gA,__getMonacoInstance:SA},TA={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},EA={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function DA({children:e}){return I.createElement(`div`,{style:EA.container},e)}var OA=DA;function kA({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return I.createElement(`section`,{style:{...TA.wrapper,width:e,height:t},...o},!n&&I.createElement(OA,null,r),I.createElement(`div`,{ref:i,style:{...TA.fullWidth,...!n&&TA.hide},className:a}))}var AA=(0,I.memo)(kA);function jA(e){(0,I.useEffect)(e,[])}var MA=jA;function NA(e,t,n=!0){let r=(0,I.useRef)(!0);(0,I.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var PA=NA;function FA(){}function IA(e,t,n,r){return LA(e,r)||RA(e,t,n,r)}function LA(e,t){return e.editor.getModel(zA(e,t))}function RA(e,t,n,r){return e.editor.createModel(t,n,r?zA(e,r):void 0)}function zA(e,t){return e.Uri.parse(t)}function BA({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=FA,onMount:_=FA}){let[v,y]=(0,I.useState)(!1),[b,x]=(0,I.useState)(!0),S=(0,I.useRef)(null),C=(0,I.useRef)(null),w=(0,I.useRef)(null),T=(0,I.useRef)(_),E=(0,I.useRef)(g),ee=(0,I.useRef)(!1);MA(()=>{let e=wA.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?k():e.cancel()}),PA(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=IA(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),PA(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=IA(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),PA(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),PA(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),PA(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),PA(()=>{C.current?.editor.setTheme(l)},[l],v),PA(()=>{S.current?.updateOptions(d)},[d],v);let D=(0,I.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=IA(C.current,e||``,r||n||`text`,a||``),c=IA(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),O=(0,I.useCallback)(()=>{!ee.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),D(),C.current?.editor.setTheme(l),y(!0),ee.current=!0)},[d,l,D]);(0,I.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,I.useEffect)(()=>{!b&&!v&&O()},[b,v,O]);function k(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return I.createElement(AA,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}(0,I.memo)(BA);function VA(e){let t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e},[e]),t.current}var HA=VA,UA=new Map;function WA({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=FA,onMount:v=FA,onChange:y,onValidate:b=FA}){let[x,S]=(0,I.useState)(!1),[C,w]=(0,I.useState)(!0),T=(0,I.useRef)(null),E=(0,I.useRef)(null),ee=(0,I.useRef)(null),D=(0,I.useRef)(v),O=(0,I.useRef)(_),k=(0,I.useRef)(),te=(0,I.useRef)(r),A=HA(a),j=(0,I.useRef)(!1),M=(0,I.useRef)(!1);MA(()=>{let e=wA.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?N():e.cancel()}),PA(()=>{let o=IA(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&UA.set(A,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState(UA.get(a)))},[a],x),PA(()=>{E.current?.updateOptions(l)},[l],x),PA(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(M.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),M.current=!1))},[r],x),PA(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),PA(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),PA(()=>{T.current?.editor.setTheme(o)},[o],x);let ne=(0,I.useCallback)(()=>{if(!(!ee.current||!T.current)&&!j.current){O.current(T.current);let c=a||n,f=IA(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(ee.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState(UA.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),j.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,I.useEffect)(()=>{x&&D.current(E.current,T.current)},[x]),(0,I.useEffect)(()=>{!C&&!x&&ne()},[C,x,ne]),te.current=r,(0,I.useEffect)(()=>{x&&y&&(k.current?.dispose(),k.current=E.current?.onDidChangeModelContent(e=>{M.current||y(E.current.getValue(),e)}))},[x,y]),(0,I.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function N(){k.current?.dispose(),f?d&&UA.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return I.createElement(AA,{width:p,height:m,isEditorReady:x,loading:c,_ref:ee,className:h,wrapperProps:g})}var GA=(0,I.memo)(WA),KA=`inmemory://model/local-router-config.json`,qA=`local-router://schema/config.schema.json`;function JA(){let{theme:e}=mi(),t=Qx(e=>e.config),n=Qx(e=>e.saving),r=Qx(e=>e.applying),i=Qx(e=>e.save),a=Qx(e=>e.saveAndApply),o=Qx(e=>e.setDraft),s=Qx(e=>e.reset),c=eS(e=>e.rawOpen),l=eS(e=>e.setRawOpen),u=eS(e=>e.rawValue),d=eS(e=>e.setRawValue),f=eS(e=>e.rawParseError),p=eS(e=>e.setRawParseError),m=eS(e=>e.schema),h=n||r;function g(){try{let e=JSON.parse(u);return p(null),e}catch(e){return p(e instanceof Error?e.message:`JSON 解析失败`),null}}async function _(){let e=g();if(!e){zi.error(`JSON 格式错误,无法保存`);return}try{await i(e),o(e),l(!1),zi.success(`配置已保存`)}catch(e){zi.error(e instanceof Error?e.message:`保存失败`)}}async function v(){let e=g();if(!e){zi.error(`JSON 格式错误,无法保存并应用`);return}try{await a(e),o(e),l(!1),zi.success(`配置已保存并应用`)}catch(e){zi.error(e instanceof Error?e.message:`保存并应用失败`)}}function y(){s();let e=t??{};d(JSON.stringify(e,null,2)),p(null),zi.info(`已重置为上次保存的配置`)}return(0,L.jsx)(ik,{open:c,onOpenChange:l,children:(0,L.jsxs)(ck,{className:`h-[92vh] w-[calc(100vw-2rem)] max-w-[calc(100vw-2rem)] sm:max-w-[calc(100vw-2rem)]!`,children:[(0,L.jsxs)(lk,{children:[(0,L.jsx)(dk,{children:`Raw 配置编辑`}),(0,L.jsx)(fk,{children:`使用 Monaco 编辑 JSON。支持 schema 提示与校验,保存前请确认语法正确。`})]}),f&&(0,L.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-destructive/40 bg-destructive/5 p-3 text-sm text-destructive`,children:[(0,L.jsx)(ya,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,L.jsx)(`span`,{children:f})]}),(0,L.jsx)(`div`,{className:`h-[calc(92vh-210px)] overflow-hidden rounded-lg border`,children:(0,L.jsx)(GA,{height:`100%`,theme:e===`dark`?`vs-dark`:`light`,language:`json`,value:u,onChange:e=>d(e??``),path:KA,beforeMount:e=>{e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!1,allowComments:!0,schemaValidation:`error`,schemas:m?[{uri:qA,fileMatch:[KA],schema:m}]:[]})},options:{minimap:{enabled:!1},wordWrap:`on`,fontSize:13,tabSize:2,formatOnPaste:!0,formatOnType:!0,scrollBeyondLastLine:!1,automaticLayout:!0}})}),(0,L.jsxs)(uk,{children:[(0,L.jsx)(K,{variant:`outline`,onClick:y,disabled:h,children:`重置`}),(0,L.jsx)(K,{variant:`outline`,onClick:_,disabled:h||!!f,children:`保存`}),(0,L.jsx)(K,{onClick:v,disabled:h||!!f,children:`保存并应用`})]})]})})}function YA({delayDuration:e=0,...t}){return(0,L.jsx)(Wy,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function XA({...e}){return(0,L.jsx)(Gy,{"data-slot":`tooltip`,...e})}function ZA({...e}){return(0,L.jsx)(Ky,{"data-slot":`tooltip-trigger`,...e})}function QA({className:e,sideOffset:t=0,children:n,...r}){return(0,L.jsx)(qy,{children:(0,L.jsxs)(Jy,{"data-slot":`tooltip-content`,sideOffset:t,className:G(`bg-foreground text-background 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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance`,e),...r,children:[n,(0,L.jsx)(Yy,{className:`bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}var $A=`192px`,ej=`48px`,tj=`b`,nj=I.createContext(null);function rj(){let e=I.useContext(nj);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function ij({defaultOpen:e=!0,className:t,style:n,children:r,...i}){let[a,o]=I.useState(e),s=I.useCallback(()=>{o(e=>!e)},[]);return I.useEffect(()=>{let e=e=>{e.key===tj&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),s())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]),(0,L.jsx)(nj.Provider,{value:{open:a,toggleSidebar:s},children:(0,L.jsx)(YA,{delayDuration:0,children:(0,L.jsx)(`div`,{style:{"--sidebar-width":$A,"--sidebar-width-collapsed":ej,...n},className:G(`flex min-h-svh w-full bg-sidebar`,t),...i,children:r})})})}function aj({className:e,children:t,...n}){let{open:r}=rj();return(0,L.jsx)(`div`,{className:`shrink-0 transition-[width] duration-200 ease-in-out`,style:{width:r?`var(--sidebar-width)`:`var(--sidebar-width-collapsed)`},children:(0,L.jsx)(`div`,{className:G(`fixed top-14 bottom-0 left-0 z-10 flex flex-col overflow-hidden bg-sidebar transition-[width] duration-200 ease-in-out`,e),style:{width:r?`var(--sidebar-width)`:`var(--sidebar-width-collapsed)`},...n,children:t})})}function oj({className:e,onClick:t,...n}){let{open:r,toggleSidebar:i}=rj();return(0,L.jsxs)(K,{variant:`ghost`,size:`icon`,className:G(`size-7`,e),onClick:e=>{t?.(e),i()},...n,children:[r?(0,L.jsx)(Ra,{}):(0,L.jsx)(za,{}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function sj({className:e,...t}){return(0,L.jsx)(`main`,{className:G(`relative flex w-full flex-1 flex-col rounded-tl-2xl overflow-hidden bg-background`,e),...t})}function cj({className:e,...t}){return(0,L.jsx)(`div`,{className:G(`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overflow-x-hidden overscroll-y-contain`,e),...t})}function lj({className:e,...t}){return(0,L.jsx)(`div`,{className:G(`relative flex w-full min-w-0 flex-col p-2`,e),...t})}function uj({className:e,...t}){return(0,L.jsx)(`div`,{className:G(`w-full text-sm`,e),...t})}function dj({className:e,...t}){return(0,L.jsx)(`ul`,{className:G(`flex w-full min-w-0 flex-col gap-2`,e),...t})}function fj({className:e,...t}){return(0,L.jsx)(`li`,{className:G(`group/menu-item relative`,e),...t})}function pj({asChild:e=!1,isActive:t=!1,tooltip:n,className:r,children:i,...a}){let o=e?mo:`button`,{open:s}=rj(),c=(0,L.jsx)(o,{"data-active":t,className:G(`flex items-center overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-all duration-200`,`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,`focus-visible:ring-2 ring-sidebar-ring`,`disabled:pointer-events-none disabled:opacity-50`,`data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground`,`[&>svg]:size-4 [&>svg]:shrink-0`,s?`w-full h-8 gap-2 [&>span:last-child]:truncate`:`size-8 justify-center [&>span]:hidden`,r),...a,children:i});return!n||s?c:(0,L.jsxs)(XA,{children:[(0,L.jsx)(ZA,{asChild:!0,children:c}),(0,L.jsx)(QA,{side:`right`,align:`center`,...typeof n==`string`?{children:n}:n})]})}function mj(){let{theme:e,setTheme:t}=mi();return(0,L.jsxs)(K,{variant:`ghost`,size:`icon`,className:`size-7`,onClick:()=>t(e===`dark`?`light`:`dark`),title:e===`dark`?`切换到浅色模式`:`切换到深色模式`,children:[(0,L.jsx)(to,{className:`h-4 w-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0`}),(0,L.jsx)(Ia,{className:`absolute h-4 w-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`切换主题`})]})}function hj({title:e,actions:t}){return(0,L.jsxs)(`header`,{className:`sticky top-0 z-20 flex h-14 shrink-0 items-center gap-2 bg-sidebar px-4`,children:[(0,L.jsx)(oj,{className:`-ml-1`}),(0,L.jsx)(`h1`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`div`,{className:`flex-1`}),(0,L.jsx)(mj,{}),t]})}var gj=[{to:`/dashboard`,label:`仪表盘`,icon:Na},{to:`/chat`,label:`聊天面板`,icon:Fa},{to:`/logs`,label:`日志检索`,icon:Oa},{to:`/sessions`,label:`用户会话`,icon:ro}],_j=[{to:`/general-settings`,label:`通用设置`,icon:Ya},{to:`/providers`,label:`供应商配置`,icon:Ja},{to:`/routes`,label:`路由配置`,icon:Wa},{to:`/logs-settings`,label:`日志配置`,icon:Da}];function vj({title:e,items:t,pathname:n}){let{open:r}=rj();return(0,L.jsxs)(lj,{children:[(0,L.jsx)(`p`,{className:`px-2 text-xs text-muted-foreground/60 font-medium tracking-wide select-none overflow-hidden transition-[max-height,opacity,padding] duration-200`,style:{maxHeight:r?`2rem`:0,opacity:r?1:0,paddingTop:r?`0.75rem`:0,paddingBottom:r?`0.25rem`:0},children:e}),(0,L.jsx)(uj,{children:(0,L.jsx)(dj,{children:t.map(e=>(0,L.jsx)(fj,{children:(0,L.jsx)(pj,{asChild:!0,isActive:n===e.to||e.to===`/logs`&&n.startsWith(`/logs/`)||e.to===`/sessions`&&n.startsWith(`/sessions`),tooltip:e.label,children:(0,L.jsxs)(jr,{to:e.to,children:[(0,L.jsx)(e.icon,{}),(0,L.jsx)(`span`,{children:e.label})]})})},e.to))})})]})}function yj(){let e=sr({select:e=>e.location.pathname});return(0,L.jsx)(aj,{children:(0,L.jsxs)(cj,{children:[(0,L.jsx)(vj,{title:`观测`,items:gj,pathname:e}),(0,L.jsx)(vj,{title:`配置`,items:_j,pathname:e})]})})}function bj({title:e,headerActions:t,children:n,overlays:r}){return(0,L.jsxs)(ij,{className:`flex h-svh flex-col overflow-hidden`,children:[(0,L.jsx)(hj,{title:e,actions:t}),(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:[(0,L.jsx)(yj,{}),(0,L.jsx)(sj,{className:`flex min-h-0 flex-col`,children:(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-6`,children:n})})]}),r]})}function xj({title:e,description:t,loading:n=!1}){return(0,L.jsx)(`div`,{className:`flex h-screen items-center justify-center`,children:(0,L.jsxs)(`div`,{className:`text-center space-y-2`,children:[n&&(0,L.jsx)(`div`,{className:`flex justify-center pb-1`,children:(0,L.jsx)(Pa,{className:`h-8 w-8 animate-spin text-muted-foreground`})}),(0,L.jsx)(`p`,{className:n?`text-sm text-muted-foreground`:`text-destructive font-medium`,children:e}),t&&(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t})]})})}var Sj={"/dashboard":{title:`仪表盘`,configPage:!1},"/chat":{title:`聊天面板`,configPage:!1},"/providers":{title:`Providers`,configPage:!0},"/routes":{title:`路由`,configPage:!0},"/general-settings":{title:`通用设置`,configPage:!0},"/logs-settings":{title:`日志配置`,configPage:!0},"/logs":{title:`日志检索`,configPage:!1},"/sessions":{title:`用户会话`,configPage:!1}};function Cj(e){return e.startsWith(`/logs/`)?{title:`日志详情`,configPage:!1}:Sj[e]??Sj[`/dashboard`]}function wj(){let e=Cj(sr({select:e=>e.location.pathname})),t=Qx(e=>e.loading),n=Qx(e=>e.error),r=Qx(e=>e.draft),i=Qx($x),a=Qx(e=>e.loadConfig),o=eS(e=>e.loadSchema);return(0,I.useEffect)(()=>{a(),o()},[a,o]),(0,I.useEffect)(()=>{if(!i)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>{window.removeEventListener(`beforeunload`,e)}},[i]),t?(0,L.jsx)(xj,{loading:!0,title:`正在加载配置...`}):n?(0,L.jsx)(xj,{title:`加载配置失败`,description:n}):(0,L.jsx)(bj,{title:e.title,headerActions:e.configPage&&r?(0,L.jsx)(tS,{}):void 0,overlays:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(_k,{}),(0,L.jsx)(JA,{}),(0,L.jsx)(ea,{richColors:!0,position:`bottom-right`})]}),children:(0,L.jsx)(Zr,{})})}var Tj=wj;function Ej({...e}){return(0,L.jsx)(fv,{"data-slot":`select`,...e})}function Dj({...e}){return(0,L.jsx)(yv,{"data-slot":`select-group`,...e})}function Oj({...e}){return(0,L.jsx)(mv,{"data-slot":`select-value`,...e})}function kj({className:e,size:t=`default`,children:n,...r}){return(0,L.jsxs)(pv,{"data-slot":`select-trigger`,"data-size":t,className:G(`border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,L.jsx)(hv,{asChild:!0,children:(0,L.jsx)(ga,{className:`size-4 opacity-50`})})]})}function Aj({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,L.jsx)(gv,{children:(0,L.jsxs)(_v,{"data-slot":`select-content`,className:G(`bg-popover text-popover-foreground 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md`,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,align:r,...i,children:[(0,L.jsx)(Nj,{}),(0,L.jsx)(vv,{className:G(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,L.jsx)(Pj,{})]})})}function jj({className:e,...t}){return(0,L.jsx)(bv,{"data-slot":`select-label`,className:G(`text-muted-foreground px-2 py-1.5 text-xs`,e),...t})}function Mj({className:e,children:t,...n}){return(0,L.jsxs)(xv,{"data-slot":`select-item`,className:G(`focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,L.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,L.jsx)(Cv,{children:(0,L.jsx)(ha,{className:`size-4`})})}),(0,L.jsx)(Sv,{children:t})]})}function Nj({className:e,...t}){return(0,L.jsx)(wv,{"data-slot":`select-scroll-up-button`,className:G(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(va,{className:`size-4`})})}function Pj({className:e,...t}){return(0,L.jsx)(Tv,{"data-slot":`select-scroll-down-button`,className:G(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(ga,{className:`size-4`})})}function Fj(){return typeof crypto<`u`&&`randomUUID`in crypto?crypto.randomUUID():`msg_${Date.now()}_${Math.random().toString(36).slice(2,10)}`}function Ij(e){return e.base.trim().length>0&&e.apiKey.trim().length>0&&Object.keys(e.models??{}).length>0}function Lj(){let e=Qx(e=>e.draft??e.config),t=(0,I.useMemo)(()=>Object.entries(e?.providers??{}).filter(([,e])=>Ij(e)).map(([e,t])=>({key:e,config:t,models:Object.keys(t.models).sort((e,t)=>e.localeCompare(t))})).sort((e,t)=>e.key.localeCompare(t.key)),[e]),[n,r]=(0,I.useState)(t[0]?.key??``),i=t.find(e=>e.key===n)??t[0],a=(0,I.useMemo)(()=>i?.models??[],[i]),[o,s]=(0,I.useState)(a[0]??``),[c,l]=(0,I.useState)(``),[u,d]=(0,I.useState)([]),[f,p]=(0,I.useState)(!1),[m,h]=(0,I.useState)(!1),g=(0,I.useRef)(null),_=(0,I.useRef)(null);(0,I.useEffect)(()=>{if(!i){r(``),s(``);return}i.key!==n&&r(i.key)},[i,n]),(0,I.useEffect)(()=>{a.includes(o)||s(a[0]??``)},[o,a]),(0,I.useEffect)(()=>{let e=g.current;e&&(e.scrollTop=e.scrollHeight)});let v=!f&&c.trim().length>0&&!!i&&!!o;async function y(){let e=c.trim();if(!e||!i||!o||f)return;let t={id:Fj(),role:`user`,content:e,provider:i.key,model:o},n=Fj();d(e=>[...e,t,{id:n,role:`assistant`,content:``,provider:i.key,model:o}]),l(``),p(!0);let r=new AbortController;_.current=r;try{let e=[...u,t].map(e=>({role:e.role,content:e.content})),a=await fetch(`/api/chat/proxy`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({provider:i.key,model:o,messages:e}),signal:r.signal});if(!a.ok){let e=await a.text();throw Error(e||`请求失败: ${a.status}`)}if(!a.body)throw Error(`代理接口未返回流`);let s=a.body.getReader(),c=new TextDecoder,l=``;for(;;){let{done:e,value:t}=await s.read();if(e)break;l+=c.decode(t,{stream:!0}),d(e=>e.map(e=>e.id===n?{...e,content:l}:e))}l+=c.decode();let f=l.trim()||` `;d(e=>e.map(e=>e.id===n?{...e,content:f}:e))}catch(e){if(e instanceof Error&&e.name===`AbortError`){d(e=>e.map(e=>e.id===n?{...e,content:e.content||`已停止生成`}:e));return}let t=e instanceof Error?e.message:`请求失败`;d(e=>e.map(e=>e.id===n?{...e,content:e.content||`请求失败:${t}`,error:!0}:e)),zi.error(t)}finally{_.current=null,p(!1)}}function b(){_.current?.abort(),_.current=null}function x(){f&&(_.current?.abort(),_.current=null),d([])}return(0,L.jsx)(`div`,{className:`h-full`,children:(0,L.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,L.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,L.jsx)(pk,{className:`h-full`,viewportRef:g,children:(0,L.jsx)(`div`,{className:`mx-auto flex min-h-full w-full max-w-4xl flex-col gap-4 px-1 py-4`,children:u.length===0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,L.jsx)(`div`,{className:`w-full rounded-[2rem] border bg-linear-to-br from-background via-muted/10 to-muted/30 p-6 shadow-xs`,children:(0,L.jsx)(`div`,{className:`flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between`,children:(0,L.jsxs)(`div`,{className:`max-w-2xl`,children:[(0,L.jsxs)(`div`,{className:`mb-4 inline-flex items-center gap-2 rounded-full border bg-background/80 px-3 py-1 text-xs text-muted-foreground`,children:[(0,L.jsx)($a,{className:`size-3.5`}),`Chat Playground`]}),(0,L.jsx)(`h2`,{className:`text-3xl font-semibold tracking-tight`,children:`直接开始一轮真实对话`}),(0,L.jsx)(`p`,{className:`mt-3 max-w-xl text-sm leading-6 text-muted-foreground`,children:`当前聊天页通过本地代理统一转发到你配置的 provider。 不做消息持久化,适合临时验证模型、路由和响应体验。`}),(0,L.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[(0,L.jsxs)(`div`,{className:`rounded-full border bg-background px-3 py-1.5 text-xs text-muted-foreground`,children:[`Provider`,(0,L.jsx)(`span`,{className:`ml-2 font-medium text-foreground`,children:i?.key||`未配置`})]}),(0,L.jsxs)(`div`,{className:`rounded-full border bg-background px-3 py-1.5 text-xs text-muted-foreground`,children:[`Model`,(0,L.jsx)(`span`,{className:`ml-2 font-medium text-foreground`,children:o||`未选择`})]})]})]})})})}):u.map(e=>(0,L.jsxs)(`div`,{className:G(`w-full px-1 py-1`,e.role===`user`?`rounded-3xl border border-primary/20 bg-primary/5 px-4 py-3`:`px-4 py-3`,e.error&&`border-destructive/40`),children:[e.role===`assistant`?(0,L.jsxs)(`div`,{className:`mb-2 flex items-center gap-2 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:`Assistant`}),(0,L.jsx)(`span`,{children:e.provider}),(0,L.jsx)(`span`,{children:`/`}),(0,L.jsx)(`span`,{children:e.model})]}):null,(0,L.jsx)(`div`,{className:`whitespace-pre-wrap break-words text-sm leading-6`,children:e.content||(f&&e.role===`assistant`?`...`:``)}),e.role===`user`?(0,L.jsxs)(`div`,{className:`mt-2 text-right text-[11px] text-muted-foreground`,children:[e.provider,` / `,e.model]}):null]},e.id))})})}),(0,L.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-1`,children:(0,L.jsxs)(`div`,{className:`rounded-3xl border p-2`,children:[(0,L.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),y())},disabled:!i||!o,className:G(`w-full resize-none bg-transparent px-1 focus:outline-none`,m?`h-28`:`h-10`),placeholder:i?`发消息给 ${i.key} / ${o||`未选择模型`}`:`先配置可用 provider`}),(0,L.jsx)(YA,{children:(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(Ej,{value:n,onValueChange:r,disabled:t.length===0,children:[(0,L.jsx)(kj,{className:`h-9 w-64 rounded-full`,children:(0,L.jsx)(Oj,{placeholder:`选择 Provider`})}),(0,L.jsx)(Aj,{children:t.map(e=>(0,L.jsx)(Mj,{value:e.key,children:e.key},e.key))})]}),(0,L.jsxs)(Ej,{value:o,onValueChange:s,disabled:!i,children:[(0,L.jsx)(kj,{className:`h-9 w-48 rounded-full`,children:(0,L.jsx)(Oj,{placeholder:`选择 Model`})}),(0,L.jsx)(Aj,{children:a.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))})]}),(0,L.jsx)(`div`,{className:`flex-1 `}),(0,L.jsxs)(XA,{children:[(0,L.jsx)(ZA,{asChild:!0,children:(0,L.jsx)(K,{variant:`outline`,size:`icon`,className:`rounded-full`,onClick:()=>h(e=>!e),children:m?(0,L.jsx)(Za,{className:`w-4 h-4`}):(0,L.jsx)(Ca,{className:`w-4 h-4`})})}),(0,L.jsx)(QA,{side:`top`,children:m?`收起输入框`:`展开输入框`})]}),(0,L.jsxs)(XA,{children:[(0,L.jsx)(ZA,{asChild:!0,children:(0,L.jsx)(K,{variant:`outline`,size:`icon`,className:`rounded-full`,onClick:x,disabled:u.length===0&&!f,children:(0,L.jsx)(no,{className:`w-4 h-4`})})}),(0,L.jsx)(QA,{side:`top`,children:`清空消息`})]}),f?(0,L.jsxs)(XA,{children:[(0,L.jsx)(ZA,{asChild:!0,children:(0,L.jsx)(K,{variant:`outline`,size:`icon`,className:`rounded-full`,onClick:b,children:(0,L.jsx)(eo,{className:`w-4 h-4`})})}),(0,L.jsx)(QA,{side:`top`,children:`停止生成`})]}):(0,L.jsxs)(XA,{children:[(0,L.jsx)(ZA,{asChild:!0,children:(0,L.jsx)(K,{variant:`default`,size:`icon`,className:`rounded-full`,onClick:()=>void y(),disabled:!v,children:f?(0,L.jsx)(Pa,{className:`w-4 h-4 animate-spin`}):(0,L.jsx)(qa,{className:`w-4 h-4`})})}),(0,L.jsx)(QA,{side:`top`,children:`发送消息`})]})]})})]})})]})})}function Rj({title:e,description:t,action:n,children:r,className:i,contentClassName:a}){return(0,L.jsxs)(`section`,{className:`rounded-lg border bg-background ${i??``}`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3 border-b px-3 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:e}),t?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t}):null]}),n?(0,L.jsx)(`div`,{className:`shrink-0`,children:n}):null]}),(0,L.jsx)(`div`,{className:a??`px-3 py-2.5`,children:r})]})}function zj({title:e,content:t,copyLabel:n,onCopyText:r}){return(0,L.jsxs)(`div`,{className:`space-y-2 rounded-md border p-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsxs)(K,{size:`xs`,variant:`outline`,onClick:()=>r(t,n),children:[(0,L.jsx)(xa,{className:`mr-1 h-3.5 w-3.5`}),`复制`]})]}),(0,L.jsx)(pk,{className:`h-72 rounded-md bg-muted`,children:(0,L.jsx)(`pre`,{className:`p-3 text-xs leading-5`,children:(0,L.jsx)(`code`,{children:t})})})]})}function Bj(e){let{endpointLines:t,claudeEnvText:n,codexEnvText:r,opencodeConfigText:i,onCopyText:a}=e;return(0,L.jsxs)(Rj,{title:`客户端配置方式`,description:`可直接把 Claude Code / Codex 指向本地 local-router`,contentClassName:`space-y-3 px-3 py-2.5 text-sm`,children:[(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`服务入口`}),(0,L.jsx)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:t.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-2 rounded bg-muted p-2`,children:[(0,L.jsx)(`code`,{className:`block flex-1 truncate text-xs`,children:e}),(0,L.jsxs)(K,{size:`xs`,variant:`outline`,onClick:()=>a(e,`服务入口`),children:[(0,L.jsx)(xa,{className:`mr-1 h-3.5 w-3.5`}),`复制`]})]},e))})]}),(0,L.jsx)(`div`,{className:`h-px w-full bg-border`}),(0,L.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-3`,children:[(0,L.jsx)(zj,{title:`Claude Code 环境变量(示例)`,content:n,copyLabel:`Claude Code 环境变量`,onCopyText:a}),(0,L.jsx)(zj,{title:`Codex 环境变量(官方支持)`,content:r,copyLabel:`Codex 环境变量`,onCopyText:a}),(0,L.jsx)(zj,{title:`OpenCode 配置(opencode.json)`,content:i,copyLabel:`OpenCode 配置`,onCopyText:a})]})]})}var Vj=uo(`inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden`,{variants:{variant:{default:`bg-primary text-primary-foreground [a&]:hover:bg-primary/90`,secondary:`bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90`,destructive:`bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60`,outline:`border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,ghost:`[a&]:hover:bg-accent [a&]:hover:text-accent-foreground`,link:`text-primary underline-offset-4 [a&]:hover:underline`}},defaultVariants:{variant:`default`}});function J({className:e,variant:t=`default`,asChild:n=!1,...r}){return(0,L.jsx)(n?mo:`span`,{"data-slot":`badge`,"data-variant":t,className:G(Vj({variant:t}),e),...r})}function Hj({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty`,className:G(`flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12`,e),...t})}function Uj({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-header`,className:G(`flex max-w-sm flex-col items-center gap-2 text-center`,e),...t})}var Wj=uo(`flex shrink-0 items-center justify-center mb-2 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-10 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-6`}},defaultVariants:{variant:`default`}});function Gj({className:e,variant:t=`default`,...n}){return(0,L.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:G(Wj({variant:t,className:e})),...n})}function Kj({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-title`,className:G(`text-lg font-medium tracking-tight`,e),...t})}function qj({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`empty-description`,className:G(`text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4`,e),...t})}function Jj({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`skeleton`,className:G(`bg-accent animate-pulse rounded-md`,e),...t})}function Yj({hasConfig:e,routeTypeDistribution:t}){return(0,L.jsx)(Rj,{title:`路由类型分布`,description:`按协议入口统计规则数量与占比`,action:(0,L.jsx)(ma,{className:`h-4 w-4 text-muted-foreground`}),children:e?t.length===0?(0,L.jsx)(Hj,{className:`min-h-[180px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`暂无路由规则`}),(0,L.jsx)(qj,{children:`请先配置 routes 后查看分布信息。`})]})}):(0,L.jsx)(`div`,{className:`space-y-2.5`,children:t.map(e=>(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-sm`,children:[(0,L.jsx)(`span`,{className:`truncate font-medium`,title:e.type,children:e.type}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.count,` 条 · `,(e.ratio*100).toFixed(1),`%`]})]}),(0,L.jsx)(`div`,{className:`h-2 rounded-full bg-muted`,children:(0,L.jsx)(`div`,{className:`h-2 rounded-full bg-foreground/80`,style:{width:`${Math.max(e.ratio*100,2)}%`}})})]},e.type))}):(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Jj,{className:`h-4 w-full`}),(0,L.jsx)(Jj,{className:`h-4 w-[85%]`}),(0,L.jsx)(Jj,{className:`h-4 w-[70%]`})]})})}function Xj(e){let{isMetaLoading:t,meta:n,metaRouteTypes:r,configuredInMetaCount:i}=e;return(0,L.jsx)(Rj,{title:`配置摘要`,description:`当前加载配置与协议支持信息`,action:(0,L.jsx)(La,{className:`h-4 w-4 text-muted-foreground`}),contentClassName:`space-y-2.5 px-3 py-2.5 text-sm`,children:t?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Jj,{className:`h-4 w-full`}),(0,L.jsx)(Jj,{className:`h-4 w-[80%]`}),(0,L.jsx)(Jj,{className:`h-6 w-[70%]`})]}):n?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`配置路径`}),(0,L.jsx)(`code`,{className:`block truncate rounded bg-muted px-2 py-1 text-xs`,title:n.configPath,children:n.configPath})]}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`支持协议`}),(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:r.length>0?r.map(e=>(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:e},e)):(0,L.jsx)(J,{variant:`secondary`,className:`text-xs`,children:`未知协议`})})]}),(0,L.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`已配置协议覆盖:`,i,` / `,r.length||0]})]}):(0,L.jsx)(Hj,{className:`min-h-[180px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`暂无元信息`}),(0,L.jsx)(qj,{children:`服务尚未返回配置元数据。`})]})})})}function Zj(e){let{metricsLoading:t,metricsError:n,metrics:r,metricsWindow:i,onWindowChange:a}=e,o=r?.series.slice(-8)??[],s=r?.topProviders??[],c=r?.topRouteTypes??[],l=r?.warnings??[];return(0,L.jsx)(Rj,{title:`运行指标(日志聚合)`,description:`基于事件日志窗口聚合的请求量、成功率与延迟分布`,action:(0,L.jsx)(`div`,{className:`flex items-center gap-1`,children:[`1h`,`6h`,`24h`].map(e=>(0,L.jsx)(K,{size:`xs`,variant:i===e?`secondary`:`ghost`,onClick:()=>a(e),disabled:t,children:e},e))}),contentClassName:`space-y-3 px-3 py-2.5`,children:t?(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,L.jsx)(Jj,{className:`h-16 w-full`}),(0,L.jsx)(Jj,{className:`h-16 w-full`}),(0,L.jsx)(Jj,{className:`h-16 w-full`}),(0,L.jsx)(Jj,{className:`h-16 w-full`})]}),(0,L.jsx)(Jj,{className:`h-24 w-full`})]}):n?(0,L.jsx)(Hj,{className:`min-h-[220px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`运行指标加载失败`}),(0,L.jsx)(qj,{children:n})]})}):!r||r.summary.totalRequests===0?(0,L.jsxs)(Hj,{className:`min-h-[220px] p-6 md:p-6`,children:[(0,L.jsx)(Gj,{variant:`icon`,children:(0,L.jsx)(ma,{className:`h-5 w-5`})}),(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`暂无运行日志数据`}),(0,L.jsx)(qj,{children:r?.source.logEnabled===!1?`日志未启用,请先在日志配置中开启。`:`当前窗口内没有可统计的请求事件。`})]})]}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,L.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`总请求`}),(0,L.jsx)(`div`,{className:`text-xl font-semibold`,children:r.summary.totalRequests})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`成功率`}),(0,L.jsxs)(`div`,{className:`text-xl font-semibold`,children:[r.summary.successRate,`%`]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`错误请求`}),(0,L.jsx)(`div`,{className:`text-xl font-semibold`,children:r.summary.errorRequests})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border p-3`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`P95 延迟`}),(0,L.jsxs)(`div`,{className:`text-xl font-semibold`,children:[r.summary.p95LatencyMs,` ms`]})]})]}),l.length>0?(0,L.jsx)(`div`,{className:`rounded-md border border-dashed p-2 text-xs text-muted-foreground`,children:l.join(`;`)}):null,(0,L.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-2 lg:col-span-2`,children:[(0,L.jsxs)(`div`,{className:`text-sm font-medium`,children:[`请求趋势(最近 `,o.length,` 个时间桶)`]}),(0,L.jsx)(`div`,{className:`space-y-1.5`,children:o.map(e=>{let t=r.summary.totalRequests?e.requests/r.summary.totalRequests:0;return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,L.jsxs)(`span`,{children:[e.requests,` req · `,e.errors,` err · `,e.avgLatencyMs,` ms`]})]}),(0,L.jsx)(`div`,{className:`h-1.5 rounded-full bg-muted`,children:(0,L.jsx)(`div`,{className:`h-1.5 rounded-full bg-foreground/80`,style:{width:`${Math.max(t*100,e.requests>0?2:0)}%`}})})]},e.ts)})})]}),(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-sm font-medium`,children:`Top Providers`}),(0,L.jsx)(`div`,{className:`space-y-1.5 text-xs`,children:s.length>0?s.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate`,title:e.key,children:e.key}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.requests,` · `,e.errorRate,`%`]})]},e.key)):(0,L.jsx)(`div`,{className:`text-muted-foreground`,children:`暂无数据`})})]}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`mb-1 text-sm font-medium`,children:`Top 协议入口`}),(0,L.jsx)(`div`,{className:`space-y-1.5 text-xs`,children:c.length>0?c.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`span`,{className:`truncate`,title:e.key,children:e.key}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.requests,` · `,e.errorRate,`%`]})]},e.key)):(0,L.jsx)(`div`,{className:`text-muted-foreground`,children:`暂无数据`})})]})]})]})]})})}function Qj({title:e,icon:t,children:n}){return(0,L.jsxs)(`section`,{className:`rounded-lg border bg-background px-3 py-2.5`,children:[(0,L.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(t,{className:`h-4 w-4 text-muted-foreground`})]}),n]})}function $j(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=1024,r=Math.floor(Math.log(e)/Math.log(n)),i=e/n**r;return r===0?`${e} B`:`${i.toFixed(2)} ${t[r]}`}function eM(e){return e===`off`?`不记录`:e===`full`||e===`masked`?`完整记录`:e}function tM(e){let{isHealthLoading:t,healthy:n,isMetaLoading:r,providerCount:i,providersReferenced:a,totalRules:o,routeTypeCount:s,avgRulesPerType:c,logConfigured:l,logEnabled:u,bodyPolicy:d,streamsEnabled:f,logStorageLoading:p,logStorageTotalBytes:m,logStorageFileCount:h}=e;return(0,L.jsxs)(`div`,{className:`grid gap-2.5 sm:grid-cols-2 xl:grid-cols-5`,children:[(0,L.jsx)(Qj,{title:`服务状态`,icon:ca,children:(0,L.jsxs)(`div`,{className:`space-y-2`,children:[t?(0,L.jsx)(Jj,{className:`h-6 w-20`}):n?(0,L.jsx)(J,{variant:`default`,className:`bg-emerald-600 hover:bg-emerald-600`,children:`运行中`}):(0,L.jsx)(J,{variant:`destructive`,children:`离线`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:r?`等待元信息`:`配置元信息已就绪`})]})}),(0,L.jsx)(Qj,{title:`Providers`,icon:Ja,children:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(`div`,{className:`text-2xl font-bold`,children:i}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`已被路由引用 `,a,` / `,i||0]})]})}),(0,L.jsx)(Qj,{title:`Routing`,icon:Wa,children:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(`div`,{className:`text-2xl font-bold`,children:o}),(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[s,` 个协议入口 · 平均 `,c.toFixed(1),` 条/入口`]})]})}),(0,L.jsx)(Qj,{title:`日志`,icon:ka,children:(0,L.jsxs)(`div`,{className:`space-y-2`,children:[l?u?(0,L.jsx)(J,{variant:`default`,className:`bg-emerald-600 hover:bg-emerald-600`,children:`已启用`}):(0,L.jsx)(J,{variant:`secondary`,children:`已暂停`}):(0,L.jsx)(J,{variant:`secondary`,children:`未配置`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,L.jsxs)(J,{variant:`outline`,className:`text-xs`,children:[`body: `,eM(d)]}),(0,L.jsxs)(J,{variant:`outline`,className:`text-xs`,children:[`stream: `,f?`on`:`off`]})]})]})}),(0,L.jsx)(Qj,{title:`日志存储`,icon:Ma,children:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[p||m===void 0?(0,L.jsx)(Jj,{className:`h-6 w-24`}):(0,L.jsx)(`div`,{className:`text-2xl font-bold`,children:$j(m)}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:p||h===void 0?`计算中...`:`${h} 个文件 · 每小时自动更新`})]})})]})}function nM({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,L.jsx)(`table`,{"data-slot":`table`,className:G(`w-full caption-bottom text-sm`,e),...t})})}function rM({className:e,...t}){return(0,L.jsx)(`thead`,{"data-slot":`table-header`,className:G(`[&_tr]:border-b`,e),...t})}function iM({className:e,...t}){return(0,L.jsx)(`tbody`,{"data-slot":`table-body`,className:G(`[&_tr:last-child]:border-0`,e),...t})}function aM({className:e,...t}){return(0,L.jsx)(`tfoot`,{"data-slot":`table-footer`,className:G(`bg-muted/50 border-t font-medium [&>tr]:last:border-b-0`,e),...t})}function oM({className:e,...t}){return(0,L.jsx)(`tr`,{"data-slot":`table-row`,className:G(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,e),...t})}function sM({className:e,...t}){return(0,L.jsx)(`th`,{"data-slot":`table-head`,className:G(`text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function cM({className:e,...t}){return(0,L.jsx)(`td`,{"data-slot":`table-cell`,className:G(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,e),...t})}function lM({hasConfig:e,providerUsageRows:t}){return(0,L.jsx)(Rj,{title:`Provider 使用概览`,description:`按路由规则统计 provider 被引用次数`,children:e?t.length===0?(0,L.jsxs)(Hj,{className:`min-h-[200px] p-6 md:p-6`,children:[(0,L.jsx)(Gj,{variant:`icon`,children:(0,L.jsx)(Ja,{className:`h-5 w-5`})}),(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`未配置 Provider`}),(0,L.jsx)(qj,{children:`请先在 Providers 页面完成上游配置。`})]})]}):(0,L.jsxs)(nM,{children:[(0,L.jsx)(rM,{children:(0,L.jsxs)(oM,{children:[(0,L.jsx)(sM,{children:`Provider`}),(0,L.jsx)(sM,{className:`text-right`,children:`引用次数`}),(0,L.jsx)(sM,{className:`text-right`,children:`状态`})]})}),(0,L.jsx)(iM,{children:t.slice(0,8).map(e=>(0,L.jsxs)(oM,{children:[(0,L.jsx)(cM,{className:`max-w-[220px] truncate font-medium`,title:e.provider,children:e.provider}),(0,L.jsx)(cM,{className:`text-right`,children:e.count}),(0,L.jsx)(cM,{className:`text-right`,children:e.used?(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:`已使用`}):(0,L.jsx)(J,{variant:`secondary`,className:`text-xs`,children:`未使用`})})]},e.provider))})]}):(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Jj,{className:`h-8 w-full`}),(0,L.jsx)(Jj,{className:`h-8 w-full`}),(0,L.jsx)(Jj,{className:`h-8 w-full`})]})})}function uM({hasConfig:e,routeTypeDistribution:t,totalRules:n}){return(0,L.jsx)(Rj,{title:`协议类型速览`,description:`按协议入口查看规则数量与占比`,children:e?t.length===0?(0,L.jsxs)(Hj,{className:`min-h-[200px] p-6 md:p-6`,children:[(0,L.jsx)(Gj,{variant:`icon`,children:(0,L.jsx)(Wa,{className:`h-5 w-5`})}),(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`暂无协议规则`}),(0,L.jsx)(qj,{children:`当前还没有可统计的协议入口。`})]})]}):(0,L.jsxs)(nM,{children:[(0,L.jsx)(rM,{children:(0,L.jsxs)(oM,{children:[(0,L.jsx)(sM,{children:`协议类型`}),(0,L.jsx)(sM,{className:`text-right`,children:`规则数`}),(0,L.jsx)(sM,{className:`text-right`,children:`占比`})]})}),(0,L.jsx)(iM,{children:t.slice(0,8).map(e=>(0,L.jsxs)(oM,{children:[(0,L.jsx)(cM,{className:`max-w-[260px] truncate font-medium`,title:e.type,children:e.type}),(0,L.jsx)(cM,{className:`text-right`,children:e.count}),(0,L.jsxs)(cM,{className:`text-right`,children:[(e.ratio*100).toFixed(1),`%`]})]},e.type))}),(0,L.jsx)(aM,{children:(0,L.jsxs)(oM,{children:[(0,L.jsx)(cM,{children:`总计`}),(0,L.jsx)(cM,{className:`text-right`,children:n}),(0,L.jsx)(cM,{className:`text-right`,children:`100%`})]})})]}):(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Jj,{className:`h-8 w-full`}),(0,L.jsx)(Jj,{className:`h-8 w-full`}),(0,L.jsx)(Jj,{className:`h-8 w-full`})]})})}const dM=Ex((e,t)=>({healthy:null,meta:null,metrics:null,metricsLoading:!1,metricsError:null,metricsWindow:`24h`,logStorage:null,logStorageLoading:!1,logStorageError:null,fetchHealth:async()=>{e({healthy:await Rx()})},fetchMeta:async()=>{try{e({meta:await Ix()})}catch{}},fetchMetrics:async(n,r=!1)=>{let i=n??t().metricsWindow;e({metricsLoading:!0,metricsError:null,metricsWindow:i});try{e({metrics:await zx(i,r),metricsLoading:!1,metricsError:null})}catch(t){e({metricsLoading:!1,metricsError:t instanceof Error?t.message:`获取日志统计失败`})}},fetchLogStorage:async(t=!1)=>{e({logStorageLoading:!0,logStorageError:null});try{e({logStorage:await Bx(t),logStorageLoading:!1,logStorageError:null})}catch(t){e({logStorageLoading:!1,logStorageError:t instanceof Error?t.message:`获取日志存储统计失败`})}},setMetricsWindow:t=>{e({metricsWindow:t})},refresh:async()=>{await Promise.all([t().fetchHealth(),t().fetchMeta(),t().fetchMetrics(void 0,!0),t().fetchLogStorage(!0)])}}));var fM=[`http://localhost:4099/anthropic-messages`,`http://localhost:4099/openai-responses`,`http://localhost:4099/openai-completions`],pM=`ANTHROPIC_AUTH_TOKEN="DEFAULT_API_KEY"
|
|
134
|
-
ANTHROPIC_BASE_URL="http://localhost:4099/anthropic-messages"
|
|
135
|
-
ANTHROPIC_DEFAULT_HAIKU_MODEL=""
|
|
136
|
-
ANTHROPIC_DEFAULT_OPUS_MODEL=""
|
|
137
|
-
ANTHROPIC_DEFAULT_SONNET_MODEL=""
|
|
138
|
-
ANTHROPIC_MODEL=""`,mM=`OPENAI_API_KEY="DEFAULT_API_KEY"
|
|
139
|
-
OPENAI_BASE_URL="http://localhost:4099/openai-responses"
|
|
140
|
-
# 模型建议用: codex --model <model>
|
|
141
|
-
# 或在 ~/.codex/config.toml 里配置 model 字段`,hM=`{
|
|
142
|
-
"$schema": "https://opencode.ai/config.json",
|
|
143
|
-
"provider": {
|
|
144
|
-
"local-router-responses": {
|
|
145
|
-
"npm": "@ai-sdk/openai-compatible",
|
|
146
|
-
"name": "Local Router Responses",
|
|
147
|
-
"options": {
|
|
148
|
-
"baseURL": "http://localhost:4099/openai-responses",
|
|
149
|
-
"apiKey": "{env:OPENAI_API_KEY}"
|
|
150
|
-
},
|
|
151
|
-
"models": {
|
|
152
|
-
"your-model": {
|
|
153
|
-
"name": "Your Model"
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
"local-router-completions": {
|
|
158
|
-
"npm": "@ai-sdk/openai-compatible",
|
|
159
|
-
"name": "Local Router Completions",
|
|
160
|
-
"options": {
|
|
161
|
-
"baseURL": "http://localhost:4099/openai-completions",
|
|
162
|
-
"apiKey": "{env:OPENAI_API_KEY}"
|
|
163
|
-
},
|
|
164
|
-
"models": {
|
|
165
|
-
"your-model": {
|
|
166
|
-
"name": "Your Model"
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
},
|
|
170
|
-
"anthropic": {
|
|
171
|
-
"options": {
|
|
172
|
-
"baseURL": "http://localhost:4099/anthropic-messages",
|
|
173
|
-
"apiKey": "{env:ANTHROPIC_AUTH_TOKEN}"
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}`;function gM(){let e=Qx(e=>e.config),t=dM(e=>e.healthy),n=dM(e=>e.meta),r=dM(e=>e.metrics),i=dM(e=>e.metricsLoading),a=dM(e=>e.metricsError),o=dM(e=>e.metricsWindow),s=dM(e=>e.logStorage),c=dM(e=>e.logStorageLoading),l=dM(e=>e.fetchHealth),u=dM(e=>e.fetchMeta),d=dM(e=>e.fetchMetrics),f=dM(e=>e.fetchLogStorage),p=dM(e=>e.setMetricsWindow);(0,I.useEffect)(()=>{l(),u(),d(),f()},[l,u,d,f]);let{providerCount:m,routeTypeCount:h,totalRules:g,avgRulesPerType:_,providersReferenced:v,providerUsageRows:y,routeTypeDistribution:b,logConfigured:x,logEnabled:S,bodyPolicy:C,streamsEnabled:w}=(0,I.useMemo)(()=>{let t=e?.providers??{},n=e?.routes??{},r=Object.keys(t).length,i=Object.entries(n),a=i.length,o=new Map(Object.keys(t).map(e=>[e,0])),s=i.map(([e,t])=>{let n=Object.keys(t??{}).length;return Object.values(t??{}).forEach(e=>{e?.provider&&o.set(e.provider,(o.get(e.provider)??0)+1)}),{type:e,count:n}}).sort((e,t)=>t.count-e.count),c=s.reduce((e,t)=>e+t.count,0),l=a?c/a:0,u=Array.from(o.entries()).map(([e,t])=>({provider:e,count:t,used:t>0})).sort((e,t)=>t.count-e.count||e.provider.localeCompare(t.provider));return{providerCount:r,routeTypeCount:a,totalRules:c,avgRulesPerType:l,providersReferenced:u.filter(e=>e.used).length,providerUsageRows:u,routeTypeDistribution:s.map(e=>({...e,ratio:c?e.count/c:0})),logConfigured:!!e?.log,logEnabled:!!e?.log&&e.log.enabled!==!1,bodyPolicy:e?.log?.bodyPolicy??`off`,streamsEnabled:e?.log?e.log.streams?.enabled!==!1:!1}},[e]),T=Object.keys(e?.routes??{}),E=n?.routeTypes??[],ee=new Set(E),D=T.filter(e=>ee.has(e)).length,O=n===null,k=t===null;function te(e){p(e),d(e,!0)}async function A(e,t){try{await navigator.clipboard.writeText(e),zi.success(`已复制${t}`)}catch{zi.error(`复制${t}失败`)}}return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`仪表盘`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`Local Router 服务状态与配置概览`})]}),(0,L.jsx)(tM,{isHealthLoading:k,healthy:t,isMetaLoading:O,providerCount:m,providersReferenced:v,totalRules:g,routeTypeCount:h,avgRulesPerType:_,logConfigured:x,logEnabled:S,bodyPolicy:C,streamsEnabled:w,logStorageLoading:c,logStorageTotalBytes:s?.totalBytes,logStorageFileCount:s?.fileCount}),(0,L.jsx)(Bj,{endpointLines:fM,claudeEnvText:pM,codexEnvText:mM,opencodeConfigText:hM,onCopyText:A}),(0,L.jsx)(Zj,{metricsLoading:i,metricsError:a,metrics:r,metricsWindow:o,onWindowChange:te}),(0,L.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-3`,children:[(0,L.jsx)(`div`,{className:`lg:col-span-2`,children:(0,L.jsx)(Yj,{hasConfig:!!e,routeTypeDistribution:b})}),(0,L.jsx)(Xj,{isMetaLoading:O,meta:n,metaRouteTypes:E,configuredInMetaCount:D})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,L.jsx)(lM,{hasConfig:!!e,providerUsageRows:y}),(0,L.jsx)(uM,{hasConfig:!!e,routeTypeDistribution:b,totalRules:g})]})]})}function _M({className:e,type:t,...n}){return(0,L.jsx)(`input`,{type:t,"data-slot":`input`,className:G(`file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,e),...n})}function Y({className:e,...t}){return(0,L.jsx)(dg,{"data-slot":`label`,className:G(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function vM({className:e,size:t=`default`,...n}){return(0,L.jsx)(Uv,{"data-slot":`switch`,"data-size":t,className:G(`peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6`,e),...n,children:(0,L.jsx)(Wv,{"data-slot":`switch-thumb`,className:G(`bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0`)})})}function yM(e){return e.server??{}}function bM(){let e=Qx(e=>e.draft),t=Qx(e=>e.updateDraft),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(!1),o=(0,I.useCallback)(async()=>{try{r(await Jx())}catch{}},[]);if((0,I.useEffect)(()=>{o()},[o]),!e)return null;let s=e.server?.lanAccess?.enabled===!0;function c(e){t(t=>(t.server=e(yM(t)),t))}async function l(e){a(!0);try{await Yx(e),await o(),zi.success(e?`已启用开机自启动`:`已禁用开机自启动`)}catch(e){zi.error(e instanceof Error?e.message:`操作失败`)}finally{a(!1)}}return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-6 lg:overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`shrink-0`,children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`通用设置`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`管理服务访问范围与全局运行策略`})]}),(0,L.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-4 xl:grid-cols-[minmax(0,1fr)_320px]`,children:[(0,L.jsxs)(`div`,{className:`space-y-4 overflow-y-auto`,children:[(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsx)(`div`,{className:`flex items-start gap-4 border-b px-3 py-3`,children:(0,L.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,L.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-muted`,children:(0,L.jsx)(Ja,{className:`size-4 text-muted-foreground`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`启动参数`}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`配置服务监听地址和端口。修改后需重启生效。`})]})]})}),(0,L.jsxs)(`div`,{className:`grid gap-4 px-3 py-3 sm:grid-cols-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`监听地址`}),(0,L.jsx)(_M,{placeholder:`0.0.0.0`,value:e.server?.host??``,onChange:e=>c(t=>({...t,host:e.target.value||void 0}))})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`监听端口`}),(0,L.jsx)(_M,{type:`number`,placeholder:`4099`,min:1,max:65535,value:e.server?.port??``,onChange:e=>c(t=>({...t,port:e.target.value?Number(e.target.value):void 0}))})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`空闲超时(秒)`}),(0,L.jsx)(_M,{type:`number`,placeholder:`不限制`,min:0,value:e.server?.idleTimeout??``,onChange:e=>c(t=>({...t,idleTimeout:e.target.value?Number(e.target.value):void 0}))})]})]})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,L.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-muted`,children:(0,L.jsx)(La,{className:`size-4 text-muted-foreground`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`局域网服务`}),(0,L.jsx)(J,{variant:s?`default`:`secondary`,children:s?`已开启`:`已关闭`})]}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`关闭时只处理本机来源请求;开启后允许局域网内其他设备调用网关接口。`})]})]}),(0,L.jsx)(vM,{checked:s,onCheckedChange:e=>c(t=>({...t,lanAccess:{...t.lanAccess,enabled:e}})),"aria-label":`切换局域网服务`})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 px-3 py-3 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`关闭状态`}),(0,L.jsx)(`p`,{className:`text-sm`,children:`仅接受 127.0.0.1 和 ::1 等本机回环来源。`})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`开启状态`}),(0,L.jsx)(`p`,{className:`text-sm`,children:`接受本机来源与私有网段、链路本地地址来源。`})]})]})]}),n&&(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,L.jsx)(`div`,{className:`mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-md bg-muted`,children:(0,L.jsx)(Va,{className:`size-4 text-muted-foreground`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`开机自启动`}),(0,L.jsx)(J,{variant:n.systemInstalled?`default`:`secondary`,children:n.systemInstalled?`已启用`:`已禁用`})]}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`用户登录时自动以 daemon 模式启动,使用上方配置的启动参数。`})]})]}),(0,L.jsx)(vM,{checked:n.systemInstalled,onCheckedChange:l,disabled:i||n.platform===`unsupported`,"aria-label":`切换开机自启动`})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 px-3 py-3 sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`平台`}),(0,L.jsx)(`p`,{className:`text-sm`,children:n.platform})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{className:`text-xs text-muted-foreground`,children:`服务路径`}),(0,L.jsx)(`p`,{className:`break-all font-mono text-sm`,children:n.servicePath||`-`})]})]})]})]}),(0,L.jsx)(`aside`,{className:`rounded-lg border bg-background p-3`,children:(0,L.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,L.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-md bg-muted`,children:(0,L.jsx)(Xa,{className:`size-4 text-muted-foreground`})}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`说明`}),(0,L.jsxs)(`ul`,{className:`mt-2 space-y-2 text-sm text-muted-foreground`,children:[(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`启动参数`}),`修改后保存至配置文件,下次启动或重启时生效。开机自启动也读取此配置。`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`局域网服务`}),`保存并应用后立即生效,无需重启。`]}),(0,L.jsxs)(`li`,{children:[(0,L.jsx)(`strong`,{children:`开机自启动`}),`切换即时生效(安装/卸载系统服务),无需额外保存。`]})]})]})]})})]})]})}function xM({title:e,headers:t,emptyText:n}){let r=(0,I.useMemo)(()=>t?Object.entries(t).sort(([e],[t])=>e.localeCompare(t)):[],[t]);return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),r.length===0?(0,L.jsx)(`div`,{className:`rounded-md border bg-muted/30 p-3 text-xs text-muted-foreground`,children:n??`-`}):(0,L.jsx)(`div`,{className:`overflow-hidden rounded-md border bg-muted/10`,children:(0,L.jsx)(nM,{className:`text-xs`,children:(0,L.jsx)(iM,{children:r.map(([e,t])=>(0,L.jsxs)(oM,{className:`hover:bg-transparent`,children:[(0,L.jsx)(cM,{className:`w-[240px] max-w-[240px] align-top font-mono text-[11px] text-muted-foreground whitespace-normal break-all`,children:e}),(0,L.jsx)(cM,{className:`align-top font-mono whitespace-normal break-all`,children:t}),(0,L.jsx)(cM,{className:`w-10 align-top text-right`,children:(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`ghost`,onClick:async()=>{await navigator.clipboard.writeText(`${e}: ${t}`),zi.success(`已复制 ${e}`)},"aria-label":`复制 ${e}`,title:`复制 ${e}`,children:(0,L.jsx)(xa,{className:`h-3 w-3`})})})]},e))})})})]})}function X(){return X=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},X.apply(null,arguments)}function SM(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var CM={},wM=(0,I.createContext)(CM),TM=(e,t)=>X({},e,t),EM=()=>(0,I.useContext)(wM),DM=(0,I.createContext)(()=>{});DM.displayName=`JVR.DispatchShowTools`;function OM(){return(0,I.useReducer)(TM,CM)}function kM(){return(0,I.useContext)(DM)}var AM=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(wM.Provider,{value:t,children:(0,L.jsx)(DM.Provider,{value:n,children:r})})};AM.displayName=`JVR.ShowTools`;var jM={},MM=(0,I.createContext)(jM),NM=(e,t)=>X({},e,t),PM=()=>(0,I.useContext)(MM),FM=(0,I.createContext)(()=>{});FM.displayName=`JVR.DispatchExpands`;function IM(){return(0,I.useReducer)(NM,jM)}function LM(){return(0,I.useContext)(FM)}var RM=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(MM.Provider,{value:t,children:(0,L.jsx)(FM.Provider,{value:n,children:r})})};RM.displayName=`JVR.Expands`;var zM={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},BM=(0,I.createContext)(zM),VM=(e,t)=>X({},e,t),HM=()=>(0,I.useContext)(BM),UM=(0,I.createContext)(()=>{});UM.displayName=`JVR.DispatchTypes`;function WM(){return(0,I.useReducer)(VM,zM)}function GM(){return(0,I.useContext)(UM)}function KM(e){var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(BM.Provider,{value:t,children:(0,L.jsx)(UM.Provider,{value:n,children:r})})}KM.displayName=`JVR.Types`;var qM=[`style`];function JM(e){var{style:t}=e,n=SM(e,qM);return(0,L.jsx)(`svg`,X({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:X({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,L.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}JM.displayName=`JVR.TriangleArrow`;var YM={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,L.jsx)(JM,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},XM=(0,I.createContext)(YM),ZM=(e,t)=>X({},e,t),QM=()=>(0,I.useContext)(XM),$M=(0,I.createContext)(()=>{});$M.displayName=`JVR.DispatchSymbols`;function eN(){return(0,I.useReducer)(ZM,YM)}function tN(){return(0,I.useContext)($M)}var nN=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(XM.Provider,{value:t,children:(0,L.jsx)($M.Provider,{value:n,children:r})})};nN.displayName=`JVR.Symbols`;var rN={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},iN=(0,I.createContext)(rN),aN=(e,t)=>X({},e,t),oN=()=>(0,I.useContext)(iN),sN=(0,I.createContext)(()=>{});sN.displayName=`JVR.DispatchSection`;function cN(){return(0,I.useReducer)(aN,rN)}function lN(){return(0,I.useContext)(sN)}var uN=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,L.jsx)(iN.Provider,{value:t,children:(0,L.jsx)(sN.Provider,{value:n,children:r})})};uN.displayName=`JVR.Section`;var dN={objectSortKeys:!1,indentWidth:15},fN=(0,I.createContext)(dN);fN.displayName=`JVR.Context`;var pN=(0,I.createContext)(()=>{});pN.displayName=`JVR.DispatchContext`;function mN(e,t){return X({},e,t)}var hN=()=>(0,I.useContext)(fN),gN=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,I.useReducer)(mN,Object.assign({},dN,n)),[o,s]=OM(),[c,l]=IM(),[u,d]=WM(),[f,p]=eN(),[m,h]=cN();return(0,I.useEffect)(()=>a(X({},n)),[n]),(0,L.jsx)(fN.Provider,{value:i,children:(0,L.jsx)(pN.Provider,{value:a,children:(0,L.jsx)(AM,{initial:o,dispatch:s,children:(0,L.jsx)(RM,{initial:c,dispatch:l,children:(0,L.jsx)(KM,{initial:X({},u,r),dispatch:d,children:(0,L.jsx)(nN,{initial:f,dispatch:p,children:(0,L.jsx)(uN,{initial:m,dispatch:h,children:t})})})})})})})};gN.displayName=`JVR.Provider`;function _N(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var vN=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],yN=[`as`,`render`],bN=[`as`,`render`],xN=[`as`,`render`],SN=[`as`,`style`,`render`],CN=[`as`,`render`],wN=[`as`,`render`],TN=[`as`,`render`],EN=[`as`,`render`],DN=e=>{var{Quote:t={}}=QM(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=SM(e,vN);if(n)return null;var{as:c,render:l}=t,u=SM(t,yN),d=c||`span`,f=X({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,L.jsx)(d,X({},f))};DN.displayName=`JVR.Quote`;var ON=e=>{var{ValueQuote:t={}}=QM(),n=X({},(_N(e),e)),{as:r,render:i}=t,a=SM(t,bN),o=r||`span`,s=X({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,L.jsx)(o,X({},s))};ON.displayName=`JVR.ValueQuote`;var kN=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=QM(),{as:o,render:s}=a,c=SM(a,xN),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,L.jsx)(l,X({},c))};kN.displayName=`JVR.Colon`;var AN=e=>{var{Arrow:t={}}=QM(),n=PM(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=SM(t,SN),m=u||`span`,h=f&&typeof f==`function`,g=X({},p,{"data-expanded":l,style:X({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,L.jsx)(m,X({},p,{style:X({},d,i)}))};AN.displayName=`JVR.Arrow`;var jN=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=QM(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=SM(o,CN),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,L.jsx)(f,X({},d))}var{as:p,render:m}=s,h=SM(s,wN),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,L.jsx)(g,X({},h))};jN.displayName=`JVR.BracketsOpen`;var MN=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=QM();if(t){var{as:u,render:d}=c,f=SM(c,TN),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,L.jsx)(p,X({},f))}var{as:m,render:h}=l,g=SM(l,EN),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,L.jsx)(_,X({},g))};MN.displayName=`JVR.BracketsClose`;var NN=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=PM(),{collapsed:c,shouldExpandNodeInitially:l}=hN(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,L.jsx)(`div`,{style:m,children:(0,L.jsx)(MN,X({isBrackets:g||_},h,{isVisiable:!0}))})};NN.displayName=`JVR.NestedClose`;var PN=[`as`,`render`],FN=[`as`,`render`],IN=[`as`,`render`],LN=[`as`,`render`],RN=[`as`,`render`],zN=[`as`,`render`],BN=[`as`,`render`],VN=[`as`,`render`],HN=[`as`,`render`],UN=[`as`,`render`],WN=[`as`,`render`],GN=[`as`,`render`],KN=[`as`,`render`],qN=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},JN=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=HM();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=SM(r,PN);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,L.jsx)(a||`span`,X({},s))};JN.displayName=`JVR.SetComp`;var YN=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=HM();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=SM(r,FN);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,L.jsx)(a||`span`,X({},s))};YN.displayName=`JVR.MapComp`;var XN={opacity:.75,paddingRight:4},ZN=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=HM(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=hN(),{as:c,render:l}=i,u=SM(i,IN),d=t,[f,p]=(0,I.useState)(o&&d.length>o);(0,I.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=X({},XN,i.style||{});o>0&&(u.style=X({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var g=f?``+d.slice(0,o)+s:d,_=l&&typeof l==`function`,v=_&&l(X({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),y=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,b=_&&l(X({},u,{children:g,className:y}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(v||(0,L.jsx)(m,X({},u,{style:h}))),b||(0,L.jsxs)(I.Fragment,{children:[(0,L.jsx)(ON,{}),(0,L.jsx)(m,X({},u,{className:y,children:g})),(0,L.jsx)(ON,{})]})]})};ZN.displayName=`JVR.TypeString`;var QN=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,LN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p||(0,L.jsx)(l,X({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};QN.displayName=`JVR.TypeTrue`;var $N=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,RN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p||(0,L.jsx)(l,X({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};$N.displayName=`JVR.TypeFalse`;var eP=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,zN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p||(0,L.jsx)(l,X({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};eP.displayName=`JVR.TypeFloat`;var tP=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,BN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p||(0,L.jsx)(l,X({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};tP.displayName=`JVR.TypeInt`;var nP=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,VN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p||(0,L.jsx)(l,X({},c,{className:`w-rjv-value`,children:qN(t?.toString())}))]})};nP.displayName=`JVR.TypeFloat`;var rP=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,HN),l=o||`span`,u=X({},XN,i.style),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p||(0,L.jsxs)(`a`,X({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,L.jsx)(ON,{}),t?.href,(0,L.jsx)(ON,{})]}))]})};rP.displayName=`JVR.TypeUrl`;var iP=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,UN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(X({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),m||(0,L.jsx)(l,X({},c,{className:`w-rjv-value`,children:p}))]})};iP.displayName=`JVR.TypeDate`;var aP=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,WN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p]})};aP.displayName=`JVR.TypeUndefined`;var oP=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,GN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p]})};oP.displayName=`JVR.TypeNull`;var sP=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=HM(),{as:o,render:s}=i,c=SM(i,KN),l=o||`span`,u=X({},XN,i.style||{}),d=s&&typeof s==`function`,f=d&&s(X({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(X({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,L.jsxs)(I.Fragment,{children:[a&&(f||(0,L.jsx)(l,X({},c,{style:u}))),p]})};sP.displayName=`JVR.TypeNan`;var cP=e=>Number(e)===e&&e%1!=0||isNaN(e),lP=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,L.jsx)(rP,X({},i,{children:t})):typeof t==`string`?(0,L.jsx)(ZN,X({},i,{children:t})):t===!0?(0,L.jsx)(QN,X({},i,{children:t})):t===!1?(0,L.jsx)($N,X({},i,{children:t})):t===null?(0,L.jsx)(oP,X({},i,{children:t})):t===void 0?(0,L.jsx)(aP,X({},i,{children:t})):t instanceof Date?(0,L.jsx)(iP,X({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,L.jsx)(sP,X({},i,{children:t})):typeof t==`number`&&cP(t)?(0,L.jsx)(eP,X({},i,{children:t})):typeof t==`bigint`?(0,L.jsx)(nP,X({},i,{children:t})):typeof t==`number`?(0,L.jsx)(tP,X({},i,{children:t})):null};lP.displayName=`JVR.Value`;function uP(e,t,n){var r=tN(),i=X({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:X({},e.style,t.style),children:t.children||e.children});(0,I.useEffect)(()=>r({[n]:i}),[t])}function dP(e,t,n){var r=GM(),i=X({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:X({},e.style,t.style),children:t.children||e.children});(0,I.useEffect)(()=>r({[n]:i}),[t])}function fP(e,t,n){var r=lN(),i=X({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:X({},e.style,t.style),children:t.children||e.children});(0,I.useEffect)(()=>r({[n]:i}),[t])}var pP=[`as`,`render`],mP=e=>{var{KeyName:t={}}=oN();return fP(t,e,`KeyName`),null};mP.displayName=`JVR.KeyName`;var hP=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=oN(),{as:c,render:l}=s,u=SM(s,pP);u.style=X({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(X({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,L.jsx)(d,X({},u,{children:t}))};hP.displayName=`JVR.KeyNameComp`;var gP=[`children`,`value`,`parentValue`,`keyName`,`keys`],_P=[`as`,`render`,`children`],vP=e=>{var{Row:t={}}=oN();return fP(t,e,`Row`),null};vP.displayName=`JVR.Row`;var yP=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=SM(e,gP),{Row:s={}}=oN(),{as:c,render:l}=s,u=SM(s,_P),d=c||`div`;return l&&typeof l==`function`&&l(X({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,L.jsx)(d,X({},o,u,{children:t}))};yP.displayName=`JVR.RowComp`;function bP(e){var t=(0,I.useRef)();return(0,I.useEffect)(()=>{t.current=e}),t.current}function xP(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=bP(t),a=(0,I.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,I.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var SP=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],CP=[`as`,`render`],wP=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=SM(e,SP),{onCopied:c,enableClipboard:l,beforeCopy:u}=hN(),d=EM()[i],[f,p]=(0,I.useState)(!1),{Copied:m={}}=oN(),h=m?.beforeCopy;if(l===!1||!d)return null;var g={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?qN(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?qN(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:_}=m,v=SM(m,CP),y=X({},v,s,g,{style:X({},v.style,s.style,g.style)});return _&&typeof _==`function`&&_(X({},y,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,L.jsx)(`svg`,X({viewBox:`0 0 32 36`},y,{children:(0,L.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,L.jsx)(`svg`,X({viewBox:`0 0 32 36`},y,{children:(0,L.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};wP.displayName=`JVR.Copied`;function TP(){var e=(0,I.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var EP=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=PM(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=hN(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,L.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,L.jsx)(OP,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};EP.displayName=`JVR.KeyValues`;var DP=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=hN(),o=typeof t==`number`,s=(0,I.useRef)(null);xP({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,L.jsxs)(I.Fragment,{children:[(0,L.jsxs)(`span`,{ref:s,children:[(0,L.jsx)(DN,X({isNumber:o,"data-placement":`left`},c)),(0,L.jsx)(hP,X({},c,{children:t})),(0,L.jsx)(DN,X({isNumber:o,"data-placement":`right`},c))]}),(0,L.jsx)(kN,X({},c))]})};DP.displayName=`JVR.KayName`;var OP=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=kM(),s=TP(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,L.jsx)(HP,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,L.jsxs)(yP,X({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,L.jsx)(DP,{keyName:t,value:n,keys:a,parentValue:r}),(0,L.jsx)(lP,{keyName:t,value:n,keys:a}),(0,L.jsx)(wP,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};OP.displayName=`JVR.KeyValuesItem`;var kP=[`value`,`keyName`],AP=[`as`,`render`],jP=e=>{var{CountInfoExtra:t={}}=oN();return fP(t,e,`CountInfoExtra`),null};jP.displayName=`JVR.CountInfoExtra`;var MP=e=>{var{value:t={},keyName:n}=e,r=SM(e,kP),{CountInfoExtra:i={}}=oN(),{as:a,render:o}=i,s=SM(i,AP);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=X({},s,r);return l&&o(u,{value:t,keyName:n})||(0,L.jsx)(c,X({},u))};MP.displayName=`JVR.CountInfoExtraComps`;var NP=[`value`,`keyName`],PP=[`as`,`render`],FP=e=>{var{CountInfo:t={}}=oN();return fP(t,e,`CountInfo`),null};FP.displayName=`JVR.CountInfo`;var IP=e=>{var{value:t={},keyName:n}=e,r=SM(e,NP),{displayObjectSize:i}=hN(),{CountInfo:a={}}=oN();if(!i)return null;var{as:o,render:s}=a,c=SM(a,PP),l=o||`span`;c.style=X({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=X({},c,r);return s&&typeof s==`function`&&s(X({},d,{"data-length":u}),{value:t,keyName:n})||(0,L.jsx)(l,X({},d))};IP.displayName=`JVR.CountInfoComp`;var LP=[`as`,`render`],RP=e=>{var{Ellipsis:t={}}=oN();return fP(t,e,`Ellipsis`),null};RP.displayName=`JVR.Ellipsis`;var zP=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=oN(),{as:a,render:o}=i,s=SM(i,LP),c=a||`span`;return o&&typeof o==`function`&&o(X({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,L.jsx)(c,X({},s)))};zP.displayName=`JVR.EllipsisComp`;var BP=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=PM(),l=LM(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=hN(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),w={style:_};C&&(w.onClick=g);var T={keyName:t,value:a,keys:r,parentValue:o};return(0,L.jsxs)(`span`,X({},w,{children:[C&&(0,L.jsx)(AN,X({style:v,expandKey:n},T)),(t||typeof t==`number`)&&(0,L.jsx)(DP,X({},T)),(0,L.jsx)(JN,{value:i,keyName:t}),(0,L.jsx)(YN,{value:i,keyName:t}),(0,L.jsx)(jN,X({isBrackets:x||S},T)),(0,L.jsx)(zP,{keyName:t,value:a,isExpanded:m}),(0,L.jsx)(MN,X({isVisiable:m||!C,isBrackets:x||S},T)),(0,L.jsx)(IP,{value:a,keyName:t}),(0,L.jsx)(MP,{value:a,keyName:t}),(0,L.jsx)(wP,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};BP.displayName=`JVR.NestedOpen`;var VP=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],HP=(0,I.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=SM(e,VP),u=kM(),d=TP();return(0,L.jsxs)(`div`,X({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,L.jsx)(BP,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,L.jsx)(EP,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,L.jsx)(NN,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});HP.displayName=`JVR.Container`;var UP=e=>{var{BraceLeft:t={}}=QM();return uP(t,e,`BraceLeft`),null};UP.displayName=`JVR.BraceLeft`;var WP=e=>{var{BraceRight:t={}}=QM();return uP(t,e,`BraceRight`),null};WP.displayName=`JVR.BraceRight`;var GP=e=>{var{BracketsLeft:t={}}=QM();return uP(t,e,`BracketsLeft`),null};GP.displayName=`JVR.BracketsLeft`;var KP=e=>{var{BracketsRight:t={}}=QM();return uP(t,e,`BracketsRight`),null};KP.displayName=`JVR.BracketsRight`;var qP=e=>{var{Arrow:t={}}=QM();return uP(t,e,`Arrow`),null};qP.displayName=`JVR.Arrow`;var JP=e=>{var{Colon:t={}}=QM();return uP(t,e,`Colon`),null};JP.displayName=`JVR.Colon`;var YP=e=>{var{Quote:t={}}=QM();return uP(t,e,`Quote`),null};YP.displayName=`JVR.Quote`;var XP=e=>{var{ValueQuote:t={}}=QM();return uP(t,e,`ValueQuote`),null};XP.displayName=`JVR.ValueQuote`;var ZP=e=>{var{Bigint:t={}}=HM();return dP(t,e,`Bigint`),null};ZP.displayName=`JVR.Bigint`;var QP=e=>{var{Date:t={}}=HM();return dP(t,e,`Date`),null};QP.displayName=`JVR.Date`;var $P=e=>{var{False:t={}}=HM();return dP(t,e,`False`),null};$P.displayName=`JVR.False`;var eF=e=>{var{Float:t={}}=HM();return dP(t,e,`Float`),null};eF.displayName=`JVR.Float`;var tF=e=>{var{Int:t={}}=HM();return dP(t,e,`Int`),null};tF.displayName=`JVR.Int`;var nF=e=>{var{Map:t={}}=HM();return dP(t,e,`Map`),null};nF.displayName=`JVR.Map`;var rF=e=>{var{Nan:t={}}=HM();return dP(t,e,`Nan`),null};rF.displayName=`JVR.Nan`;var iF=e=>{var{Null:t={}}=HM();return dP(t,e,`Null`),null};iF.displayName=`JVR.Null`;var aF=e=>{var{Set:t={}}=HM();return dP(t,e,`Set`),null};aF.displayName=`JVR.Set`;var oF=e=>{var{Str:t={}}=HM();return dP(t,e,`Str`),null};oF.displayName=`JVR.StringText`;var sF=e=>{var{True:t={}}=HM();return dP(t,e,`True`),null};sF.displayName=`JVR.True`;var cF=e=>{var{Undefined:t={}}=HM();return dP(t,e,`Undefined`),null};cF.displayName=`JVR.Undefined`;var lF=e=>{var{Url:t={}}=HM();return dP(t,e,`Url`),null};lF.displayName=`JVR.Url`;var uF=e=>{var{Copied:t={}}=oN();return fP(t,e,`Copied`),null};uF.displayName=`JVR.Copied`;var dF=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],fF=(0,I.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=SM(e,dF),b=X({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,L.jsxs)(gN,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,L.jsx)(HP,X({value:i},y,{ref:t,className:x,style:b})),a]})});fF.Bigint=ZP,fF.Date=QP,fF.False=$P,fF.Float=eF,fF.Int=tF,fF.Map=nF,fF.Nan=rF,fF.Null=iF,fF.Set=aF,fF.String=oF,fF.True=sF,fF.Undefined=cF,fF.Url=lF,fF.ValueQuote=XP,fF.Arrow=qP,fF.Colon=JP,fF.Quote=YP,fF.Ellipsis=RP,fF.BraceLeft=UP,fF.BraceRight=WP,fF.BracketsLeft=GP,fF.BracketsRight=KP,fF.Copied=uF,fF.CountInfo=FP,fF.CountInfoExtra=jP,fF.KeyName=mP,fF.Row=vP,fF.displayName=`JVR.JsonView`;var pF=fF;function mF(e){return JSON.stringify(e,null,2)}const hF={"--w-rjv-font-family":`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,"--w-rjv-background-color":`transparent`,"--w-rjv-color":`var(--foreground)`,"--w-rjv-border-left":`1px dashed var(--border)`,"--w-rjv-line-color":`var(--border)`,"--w-rjv-arrow-color":`var(--muted-foreground)`,"--w-rjv-info-color":`var(--muted-foreground)`,"--w-rjv-curlybraces-color":`var(--foreground)`,"--w-rjv-brackets-color":`var(--foreground)`,"--w-rjv-colon-color":`var(--muted-foreground)`,"--w-rjv-key-string":`var(--foreground)`,"--w-rjv-type-string-color":`oklch(0.52 0.16 250)`,"--w-rjv-type-int-color":`oklch(0.56 0.16 145)`,"--w-rjv-type-float-color":`oklch(0.56 0.16 145)`,"--w-rjv-type-boolean-color":`oklch(0.58 0.19 30)`,"--w-rjv-type-null-color":`var(--muted-foreground)`,"--w-rjv-type-undefined-color":`var(--muted-foreground)`,"--w-rjv-type-date-color":`oklch(0.56 0.16 145)`,"--w-rjv-type-url-color":`oklch(0.52 0.16 250)`};function gF(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function _F(e){return e.startsWith(`openai`)?`openai`:e.startsWith(`anthropic`)?`anthropic`:e}function vF(e){if(!e)return!1;let t=e.toLowerCase();return t.includes(`application/json`)||t.includes(`+json`)}function yF(e){let t=e.trim();return t?/^(?:\{|\[|"|-?\d|true$|false$|null$)/.test(t):!1}function bF(e,t){if(e==null)return{kind:`empty`};if(typeof e==`string`){let n=e.trim();if(!n)return{kind:`text`,text:e};if(vF(t)||yF(n))try{let e=JSON.parse(n);return typeof e==`object`&&e?{kind:`json-tree`,value:e}:{kind:`json-primitive`,value:e}}catch{return{kind:`text`,text:e}}return{kind:`text`,text:e}}return typeof e==`object`?{kind:`json-tree`,value:e}:{kind:`json-primitive`,value:e}}function xF(e){let t=e.request.requestBody;return!t||typeof t!=`object`||Array.isArray(t)?t:{...t,model:e.summary.modelIn}}function SF(e){let t=e.split(`
|
|
178
|
-
`),n=[];return t.forEach((e,t)=>{let r=e.trim();if(!r)return;let i=t+1;if(r.startsWith(`data:`)){let e=r.slice(5).trim();if(!e)return;try{n.push({type:`json`,lineNo:i,value:JSON.parse(e)})}catch{n.push({type:`raw`,lineNo:i,value:r})}return}try{n.push({type:`json`,lineNo:i,value:JSON.parse(r)})}catch{n.push({type:`raw`,lineNo:i,value:r})}}),n}function CF({value:e,contentType:t,emptyText:n,className:r,noScroll:i=!1}){let a=(0,I.useMemo)(()=>bF(e,t),[t,e]);if(a.kind===`empty`)return(0,L.jsx)(`div`,{className:G(`rounded-md border bg-muted/30 p-3 text-xs text-muted-foreground`,r),children:n??`-`});if(a.kind===`json-tree`)return(0,L.jsx)(`div`,{className:G(i?`rounded-md border bg-muted/20 p-3 text-xs`:`max-h-[320px] overflow-auto rounded-md border bg-muted/20 p-3 text-xs`,r),children:(0,L.jsx)(pF,{value:a.value,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!0,shortenTextAfterLength:0,shouldExpandNodeInitially:(e,{level:t})=>t<2,style:hF})});let o=a.kind===`json-primitive`?mF(a.value):a.text??mF(e);return(0,L.jsx)(`pre`,{className:G(i?`rounded-md border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all`:`max-h-[320px] overflow-auto rounded-md border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all`,r),children:o})}function wF({title:e,value:t,contentType:n,emptyText:r}){let i=(0,I.useMemo)(()=>t==null?``:typeof t==`string`?t:JSON.stringify(t,null,2)??String(t),[t]);return(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:e}),(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`ghost`,disabled:!i,onClick:async()=>{i&&(await navigator.clipboard.writeText(i),zi.success(`已复制 ${e}`))},"aria-label":`复制 ${e}`,title:`复制 ${e}`,children:(0,L.jsx)(xa,{className:`h-3 w-3`})})]}),(0,L.jsx)(CF,{value:t,contentType:n,emptyText:r})]})}function TF({label:e,value:t,mono:n=!1}){return(0,L.jsxs)(`div`,{className:`rounded-md border bg-muted/20 px-2.5 py-1.5`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:e}),(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`ghost`,onClick:async()=>{await navigator.clipboard.writeText(t),zi.success(`已复制 ${e}`)},"aria-label":`复制 ${e}`,title:`复制 ${e}`,children:(0,L.jsx)(xa,{className:`h-3 w-3`})})]}),(0,L.jsx)(`div`,{className:`mt-0.5 break-all ${n?`font-mono text-xs`:`text-xs`}`,children:t})]})}function EF({detail:e}){let t=e.plugins,n=(e,t)=>`${e}-${t.name}-${t.package}-${JSON.stringify(t.params)}`;return!t||!t.request?.length&&!t.response?.length?null:(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`section`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`插件管线`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`请求/响应经过的插件处理链路(洋葱模型)`})]}),(0,L.jsxs)(`div`,{className:`space-y-3 px-3 py-3`,children:[t.request&&t.request.length>0?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`请求阶段(正序)`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:`用户请求`}),t.request.map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,L.jsx)(J,{variant:`secondary`,className:`text-xs`,children:e.name})]},n(`req`,e))),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:`Provider 请求`})]})]}):null,t.response&&t.response.length>0?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`响应阶段(逆序)`}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:`Provider 响应`}),[...t.response].reverse().map(e=>(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,L.jsx)(J,{variant:`secondary`,className:`text-xs`,children:e.name})]},n(`res`,e))),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:`用户响应`})]})]}):null]})]}),(0,L.jsxs)(`section`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`插件详情`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`各插件的包名与参数配置`})]}),(0,L.jsx)(`div`,{className:`space-y-3 px-3 py-3`,children:(t.request??t.response??[]).map(e=>(0,L.jsxs)(`div`,{className:`rounded-md border bg-muted/20 p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(J,{variant:`secondary`,className:`text-xs`,children:e.name}),(0,L.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.package})]}),Object.keys(e.params).length>0?(0,L.jsxs)(`div`,{className:`mt-2`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`params`}),(0,L.jsx)(`pre`,{className:`mt-1 rounded-md border bg-muted/30 p-2 text-xs`,children:JSON.stringify(e.params,null,2)})]}):null]},n(`detail`,e)))})]}),t.requestUrlAfterPlugins?(0,L.jsxs)(`section`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`插件修改记录`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`插件对请求/响应的修改`})]}),(0,L.jsx)(`div`,{className:`space-y-3 px-3 py-3`,children:(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`插件处理后 URL`}),(0,L.jsx)(`div`,{className:`rounded-md border bg-muted/30 p-2 font-mono text-xs break-all`,children:t.requestUrlAfterPlugins})]})})]}):null]})}function DF({label:e,value:t,mono:n=!1}){return(0,L.jsxs)(`div`,{className:`rounded-md border bg-background/90 px-2 py-1`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-1 text-[11px] leading-4 text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:e}),(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`ghost`,onClick:async()=>{await navigator.clipboard.writeText(t),zi.success(`已复制 ${e}`)},"aria-label":`复制 ${e}`,title:`复制 ${e}`,children:(0,L.jsx)(xa,{className:`h-3 w-3`})})]}),(0,L.jsx)(`div`,{className:`mt-0.5 break-all text-xs ${n?`font-mono`:``}`,children:t})]})}function OF({interfaceType:e,routeType:t,modelIn:n,provider:r,modelOut:i,routeRuleKey:a}){return(0,L.jsx)(`div`,{className:`rounded-xl border bg-linear-to-br from-muted/20 to-muted/40 p-3`,children:(0,L.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-[1fr_auto_1fr] lg:items-center`,children:[(0,L.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-background/70 p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:`入站请求`}),(0,L.jsx)(J,{variant:`outline`,children:`IN`})]}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(DF,{label:`接口类型`,value:e}),(0,L.jsx)(DF,{label:`routeType`,value:t,mono:!0})]}),(0,L.jsx)(DF,{label:`原始模型(model_in)`,value:n,mono:!0})]}),(0,L.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-1 py-1`,children:[(0,L.jsx)(`div`,{className:`hidden h-0.5 w-16 bg-border lg:block`}),(0,L.jsx)(`div`,{className:`rounded-full border bg-background px-3 py-1 text-xs text-muted-foreground`,children:`路由匹配并改写`}),(0,L.jsx)(`div`,{className:`text-xl leading-none text-muted-foreground`,children:`→`}),(0,L.jsx)(`div`,{className:`hidden h-0.5 w-16 bg-border lg:block`})]}),(0,L.jsxs)(`div`,{className:`space-y-2 rounded-lg border bg-background/70 p-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:`出站转发`}),(0,L.jsx)(J,{variant:`outline`,children:`OUT`})]}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,L.jsx)(DF,{label:`目标 provider`,value:r}),(0,L.jsx)(DF,{label:`命中规则`,value:a,mono:!0})]}),(0,L.jsx)(DF,{label:`路由模型(model_out)`,value:i,mono:!0})]})]})})}function kF({title:e,content:t,emptyText:n}){let r=(0,I.useMemo)(()=>t?SF(t):[],[t]),i=(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsxs)(K,{size:`sm`,variant:`outline`,disabled:!t,onClick:async()=>{t&&(await navigator.clipboard.writeText(t),zi.success(`已复制 stream content`))},children:[(0,L.jsx)(xa,{className:`h-3.5 w-3.5`}),`复制`]})]});return!t||r.length===0?(0,L.jsxs)(`div`,{className:`space-y-1`,children:[i,(0,L.jsx)(`pre`,{className:`rounded-md border bg-muted/30 p-3 text-xs whitespace-pre-wrap break-all`,children:n??`-`})]}):(0,L.jsxs)(`div`,{className:`space-y-1`,children:[i,(0,L.jsx)(`div`,{className:`space-y-2 rounded-md border bg-muted/30 p-3`,children:r.map(e=>(0,L.jsxs)(`div`,{className:`space-y-1 rounded-md border bg-background/80 p-2`,children:[(0,L.jsxs)(`div`,{className:`text-[11px] text-muted-foreground`,children:[`line `,e.lineNo]}),(0,L.jsx)(CF,{value:(e.type,e.value),className:`bg-muted/40`,noScroll:!0})]},`${e.lineNo}-${e.type}`))})]})}function AF({...e}){return(0,L.jsx)(ns,{"data-slot":`collapsible`,...e})}function jF({...e}){return(0,L.jsx)(Zo,{"data-slot":`collapsible-trigger`,...e})}function MF({...e}){return(0,L.jsx)($o,{"data-slot":`collapsible-content`,...e})}function NF({className:e,orientation:t=`horizontal`,...n}){return(0,L.jsx)(oy,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:G(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var PF=uo(`rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function FF({className:e,variant:t=`default`,...n}){return(0,L.jsx)(sy,{"data-slot":`tabs-list`,"data-variant":t,className:G(PF({variant:t}),e),...n})}function IF({className:e,...t}){return(0,L.jsx)(cy,{"data-slot":`tabs-trigger`,className:G(`focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground`,`after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function LF({className:e,...t}){return(0,L.jsx)(ly,{"data-slot":`tabs-content`,className:G(`flex-1 outline-none`,e),...t})}var RF=68,zF=560,BF=8;function VF(e){return JSON.stringify(e,null,2)}function HF(e){let t=Math.max(0,e.dataLength),n=Math.ceil(zF/RF)+BF*2,r=Math.max(0,t-n),i=Math.max(0,Math.floor(e.scrollTop/RF)-BF),a=Math.min(i,r);return{start:a,end:Math.min(t,a+n)}}function UF(e){return e===`assistant`?`border-sky-400/40 bg-sky-500/5`:e===`user`?`border-emerald-400/40 bg-emerald-500/5`:e===`system`?`border-violet-400/40 bg-violet-500/5`:`border-amber-400/40 bg-amber-500/5`}function WF(e){return e===`assistant`?`border-sky-400/40 bg-sky-500/10 text-sky-700 dark:text-sky-300`:e===`user`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300`:e===`system`?`border-violet-400/40 bg-violet-500/10 text-violet-700 dark:text-violet-300`:`border-amber-400/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`}function GF(e){return e===`assistant`?`bg-sky-500/70`:e===`user`?`bg-emerald-500/70`:e===`system`?`bg-violet-500/70`:`bg-amber-500/70`}function KF(e){return e.type===`text`?`text`:e.type===`thinking`?`thinking`:e.type===`tool_use`?e.name?`tool_use:${e.name}`:`tool_use`:e.type===`tool_result`?`tool_result`:e.type===`image`?`image`:e.label??`unknown`}function qF(e){return e.type===`text`?e.text:e.type===`thinking`?e.thinking:e.type===`tool_use`?e.input===void 0?e.rawInput??e.name??``:VF(e.input):e.type===`tool_result`?VF(e.content):e.type===`image`?e.url??e.mimeType??e.data??`image`:VF(e.raw)}function JF(e){return e.blocks.map(e=>qF(e).trim()).filter(Boolean).join(` `)||`(empty message)`}function YF(e,t=180){let n=e.replace(/\s+/g,` `).trim();return n.length<=t?n:`${n.slice(0,t)}...`}function XF(e){return`${e.type}-${KF(e)}-${YF(VF(e),160)}`}function ZF(e){return e===`assistant`?`助手`:e===`user`?`用户`:e===`system`?`系统`:`工具`}function QF(e){return e===`request`?`入站`:e===`response`?`出站`:`流式`}function $F({label:e,value:t}){return(0,L.jsxs)(`span`,{className:`rounded-full border bg-muted/20 px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground`,children:[e,`: `,t]})}function eI(e){return e===`text`?`文本`:e===`thinking`?`思考`:e===`tool_use`?`工具调用`:e===`tool_result`?`工具结果`:e===`image`?`图片`:`其他`}function tI(e){if(e.blocks.length===0)return`无内容`;let t=new Map;for(let n of e.blocks)t.set(n.type,(t.get(n.type)??0)+1);return[...t.entries()].map(([e,t])=>`${eI(e)}${t>1?`×${t}`:``}`).slice(0,3).join(` · `)}function nI(e,t){navigator.clipboard.writeText(t).then(()=>zi.success(`已复制 ${e}`)).catch(()=>zi.error(`复制 ${e} 失败`))}function rI({parsed:e}){let t=(0,I.useRef)(null),[n,r]=(0,I.useState)(0),[i,a]=(0,I.useState)(0),[o,s]=(0,I.useState)(`asc`),c=e.messages.length,l=(0,I.useCallback)((e,n=`smooth`)=>{let i=Math.max(0,e);t.current?.scrollTo({top:i,behavior:n}),r(i)},[]),u=(0,I.useCallback)(()=>{l(0)},[l]),d=(0,I.useCallback)(()=>{l(Math.max(0,c*RF-zF))},[c,l]);(0,I.useEffect)(()=>{a(e=>Math.min(e,Math.max(0,c-1))),l(0,`auto`)},[c,l]);let f=(0,I.useMemo)(()=>{let t=e.messages.map((e,t)=>({message:e,index:t}));return o===`desc`?t.reverse():t},[e.messages,o]),p=e.messages[i]??null,m=(0,I.useMemo)(()=>HF({dataLength:f.length,scrollTop:n}),[f.length,n]),h=(0,I.useMemo)(()=>f.slice(m.start,m.end),[f,m.end,m.start]);return(0,L.jsxs)(`section`,{className:`overflow-hidden rounded-md border bg-background`,children:[e.warnings.length>0?(0,L.jsx)(`div`,{className:`border-b bg-muted/10 px-2.5 py-1.5`,children:(0,L.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.warnings.map(e=>(0,L.jsx)(`span`,{className:`rounded-full border bg-muted/20 px-2 py-0.5 text-xs text-muted-foreground`,children:e},e))})}):null,e.messages.length===0?(0,L.jsx)(`div`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:`无可还原的消息历史。`}):(0,L.jsxs)(`div`,{className:`grid min-h-0 gap-0 lg:grid-cols-[360px_minmax(0,1fr)]`,children:[(0,L.jsxs)(`div`,{className:`border-b lg:border-r lg:border-b-0`,children:[(0,L.jsxs)(`div`,{className:`flex min-h-10 items-center justify-between gap-2 border-b px-2.5 py-1.5 text-xs`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(`span`,{className:`font-medium text-foreground`,children:`Messages`}),(0,L.jsxs)(`span`,{className:`text-muted-foreground`,children:[`#`,i+1,`/`,e.messages.length]}),(0,L.jsx)($F,{label:`in`,value:e.stats.inputCount}),(0,L.jsx)($F,{label:`out`,value:e.stats.outputCount}),e.stats.streamEventCount>0?(0,L.jsx)($F,{label:`stream`,value:e.stats.streamEventCount}):null,e.stats.streamPartial?(0,L.jsx)(J,{variant:`secondary`,children:`partial`}):null,e.warnings.length>0?(0,L.jsxs)(J,{variant:`secondary`,children:[`warnings: `,e.warnings.length]}):null]}),(0,L.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,L.jsxs)(K,{type:`button`,size:`xs`,variant:`outline`,onClick:()=>{s(e=>e===`asc`?`desc`:`asc`),l(0)},title:`切换时间排序`,children:[(0,L.jsx)(fa,{className:`h-3.5 w-3.5`}),o===`asc`?`正序`:`倒序`]}),(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`outline`,onClick:u,title:`到顶部`,"aria-label":`到顶部`,children:(0,L.jsx)(pa,{className:`h-3.5 w-3.5`})}),(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`outline`,onClick:d,title:`到底部`,"aria-label":`到底部`,children:(0,L.jsx)(la,{className:`h-3.5 w-3.5`})})]})]}),(0,L.jsx)(`div`,{ref:t,className:`h-[560px] overflow-auto`,onScroll:e=>r(e.currentTarget.scrollTop),children:(0,L.jsx)(`div`,{className:`relative`,style:{height:e.messages.length*RF},children:h.map((e,t)=>{let n=m.start+t;return(0,L.jsx)(iI,{message:e.message,index:e.index,position:n,selected:e.index===i,onSelect:()=>a(e.index)},`${e.index}-${e.message.role}-${e.message.source}`)})})})]}),(0,L.jsx)(`div`,{className:`min-w-0`,children:(0,L.jsx)(aI,{message:p,index:i})})]})]})}function iI({message:e,index:t,position:n,selected:r,onSelect:i}){return(0,L.jsxs)(`button`,{type:`button`,onClick:i,className:G(`absolute left-0 flex w-full items-stretch gap-1.5 border-b px-2.5 py-1.5 text-left transition-colors`,r?`bg-primary/8 ring-1 ring-primary/20`:`hover:bg-muted/50`),style:{top:n*RF,height:RF},children:[(0,L.jsx)(`span`,{className:G(`my-1 w-1 shrink-0 rounded-full`,GF(e.role))}),(0,L.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,L.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,L.jsxs)(`span`,{className:`w-8 shrink-0 font-mono text-[11px] text-muted-foreground`,children:[`#`,t+1]}),(0,L.jsx)(`span`,{className:G(`rounded-full border px-1.5 py-0.5 text-[10px] font-medium leading-none`,WF(e.role)),children:ZF(e.role)}),(0,L.jsx)(`span`,{className:`rounded-full border bg-background px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground`,children:QF(e.source)})]}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-[11px] text-muted-foreground`,children:tI(e)})]}),(0,L.jsx)(`span`,{className:`mt-1 block overflow-hidden text-xs leading-snug text-foreground/90`,style:{display:`-webkit-box`,WebkitBoxOrient:`vertical`,WebkitLineClamp:2},children:YF(JF(e),130)})]})]})}function aI({message:e,index:t}){let[n,r]=(0,I.useState)(`visual`);if(!e)return(0,L.jsx)(`div`,{className:`flex h-[560px] items-center justify-center text-sm text-muted-foreground`,children:`选择左侧消息查看内容。`});let i=VF({role:e.role,source:e.source,meta:e.meta??null,blocks:e.blocks});return(0,L.jsx)(NF,{value:n,onValueChange:e=>r(e),children:(0,L.jsxs)(`div`,{className:`h-[560px] overflow-auto`,children:[(0,L.jsx)(`div`,{className:G(`border-b px-2.5 py-2`,UF(e.role)),children:(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1.5`,children:[(0,L.jsxs)(J,{variant:`outline`,children:[`#`,t+1]}),(0,L.jsx)(J,{variant:`outline`,children:ZF(e.role)}),(0,L.jsx)(J,{variant:`outline`,children:e.source}),(0,L.jsxs)(J,{variant:`outline`,children:[`blocks: `,e.blocks.length]}),e.meta?.stopReason?(0,L.jsxs)(J,{variant:`secondary`,children:[`stop: `,e.meta.stopReason]}):null,e.meta?.partial?(0,L.jsx)(J,{variant:`secondary`,children:`partial`}):null]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(FF,{className:`h-7`,children:[(0,L.jsx)(IF,{value:`visual`,className:`h-6 px-2 text-xs`,children:`可视化`}),(0,L.jsx)(IF,{value:`json`,className:`h-6 px-2 text-xs`,children:`JSON`})]}),(0,L.jsx)(K,{type:`button`,size:`icon-xs`,variant:`outline`,onClick:()=>nI(`message JSON`,i),title:`复制 JSON`,"aria-label":`复制 JSON`,children:(0,L.jsx)(xa,{className:`h-3.5 w-3.5`})})]})]})}),(0,L.jsx)(LF,{value:`json`,className:`mt-0 pt-2`,children:(0,L.jsx)(cI,{text:i,copyLabel:`message JSON`})}),(0,L.jsx)(LF,{value:`visual`,className:`mt-0 space-y-2 px-2.5 py-2.5`,children:e.blocks.length>0?e.blocks.map((e,t)=>(0,L.jsx)(oI,{block:e,index:t},XF(e))):(0,L.jsx)(`div`,{className:`rounded-md border border-dashed bg-muted/20 px-3 py-6 text-center text-sm text-muted-foreground`,children:`当前消息没有内容块。`})})]})})}function oI({block:e,index:t}){let[n,r]=(0,I.useState)(!1),i=KF(e),a=qF(e);return(0,L.jsx)(AF,{open:n,onOpenChange:r,children:(0,L.jsxs)(`div`,{className:`rounded-md border bg-muted/15`,children:[(0,L.jsx)(jF,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-2.5 py-1.5 text-left`,children:[(0,L.jsxs)(`span`,{className:`min-w-0`,children:[(0,L.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(J,{variant:`outline`,className:`px-1.5 py-0 text-[10px]`,children:[`block `,t+1]}),(0,L.jsx)(`span`,{className:`text-sm font-medium`,children:i})]}),(0,L.jsx)(`span`,{className:`mt-0.5 block truncate text-xs text-muted-foreground`,children:YF(a,140)})]}),n?(0,L.jsx)(ga,{className:`h-4 w-4 shrink-0 text-muted-foreground`}):(0,L.jsx)(_a,{className:`h-4 w-4 shrink-0 text-muted-foreground`})]})}),(0,L.jsx)(MF,{children:(0,L.jsx)(sI,{block:e,label:i})})]})})}function sI({block:e,label:t}){return e.type===`text`?(0,L.jsx)(cI,{text:e.text||`(empty text)`,copyLabel:t}):e.type===`thinking`?(0,L.jsxs)(`div`,{className:`space-y-2 px-2.5 pb-2.5`,children:[(0,L.jsx)(cI,{text:e.thinking||`(empty thinking)`,copyLabel:t}),e.signature?(0,L.jsx)(cI,{text:e.signature,copyLabel:`thinking signature`}):null]}):e.type===`tool_use`?(0,L.jsxs)(`div`,{className:`space-y-2 px-2.5 pb-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-xs sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{children:[`id: `,e.id??`-`]}),(0,L.jsxs)(`div`,{children:[`name: `,e.name??`-`]})]}),(0,L.jsx)(cI,{text:e.input===void 0?e.rawInput??`(no input)`:VF(e.input),copyLabel:`tool input`})]}):e.type===`tool_result`?(0,L.jsxs)(`div`,{className:`space-y-2 px-2.5 pb-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-xs sm:grid-cols-2`,children:[(0,L.jsxs)(`div`,{children:[`tool_use_id: `,e.toolUseId??`-`]}),(0,L.jsxs)(`div`,{children:[`is_error: `,e.isError?`true`:`false`]})]}),(0,L.jsx)(cI,{text:VF(e.content),copyLabel:`tool result`})]}):e.type===`image`?(0,L.jsxs)(`div`,{className:`space-y-2 px-2.5 pb-2.5 text-xs`,children:[(0,L.jsxs)(`div`,{children:[`url: `,e.url??`-`]}),(0,L.jsxs)(`div`,{children:[`mime: `,e.mimeType??`-`]}),(0,L.jsxs)(`div`,{children:[`detail: `,e.detail??`-`]}),e.data?(0,L.jsx)(cI,{text:e.data,copyLabel:`image data`}):null]}):(0,L.jsx)(cI,{text:VF(e.raw),copyLabel:t})}function cI({text:e,copyLabel:t}){return(0,L.jsxs)(`div`,{className:`relative px-2.5 pb-2.5`,children:[(0,L.jsxs)(K,{type:`button`,size:`icon-xs`,variant:`ghost`,className:`absolute top-2 right-5 z-10`,onClick:()=>nI(t,e),children:[(0,L.jsx)(xa,{className:`h-3.5 w-3.5`}),(0,L.jsxs)(`span`,{className:`sr-only`,children:[`复制 `,t]})]}),(0,L.jsx)(`pre`,{className:`max-h-[440px] overflow-auto rounded-md border bg-background p-2 pr-10 text-xs whitespace-pre-wrap`,children:e})]})}function lI(e){let t=[],n=e.replace(/\r\n/g,`
|
|
179
|
-
`),r=[],i=n.includes(`[TRUNCATED]`),a=n.split(`
|
|
180
|
-
|
|
181
|
-
`);for(let e=0;e<a.length;e+=1){let n=a[e],o=n.trim();if(!o)continue;if(o===`[TRUNCATED]`){i=!0;continue}let s=n.split(`
|
|
182
|
-
`),c=null,l=[];for(let e of s){let t=e.trimEnd();if(t){if(t.startsWith(`event:`)){c=t.slice(6).trim()||null;continue}if(t.startsWith(`data:`)){l.push(t.slice(5).trimStart());continue}if(t===`[TRUNCATED]`){i=!0;continue}l.push(t)}}if(l.length===0){t.push(`SSE frame #${e+1} has no data.`);continue}r.push({event:c,data:l.join(`
|
|
183
|
-
`),frameNo:e+1,rawFrame:n})}if(r.length>0){let e=r[r.length-1]?.data?.trim();e&&e!==`[DONE]`&&!n.endsWith(`
|
|
184
|
-
|
|
185
|
-
`)&&!i&&(t.push(`SSE stream tail may be incomplete.`),i=!0)}return{frames:r,warnings:t,partial:i}}function uI(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function dI(e){return Array.isArray(e)?e:[]}function Z(e){return typeof e==`string`?e:null}function fI(e){try{return{value:JSON.parse(e),error:null}}catch(e){return{value:null,error:e instanceof Error?e.message:`JSON parse failed`}}}function pI(e){return uI(e)?e:null}function mI(e,t){return e===`user`||e===`assistant`||e===`system`||e===`tool`?e:t}function hI(e){if(!uI(e))return{type:`unknown`,raw:e,label:`anthropic.content`};let t=Z(e.type);if(t===`text`)return{type:`text`,text:Z(e.text)??``};if(t===`thinking`)return{type:`thinking`,thinking:Z(e.thinking)??``,signature:Z(e.signature)??void 0};if(t===`tool_use`)return{type:`tool_use`,id:Z(e.id)??void 0,name:Z(e.name)??void 0,input:e.input};if(t===`tool_result`)return{type:`tool_result`,toolUseId:Z(e.tool_use_id)??void 0,content:e.content,isError:e.is_error===!0};if(t===`image`){let t=pI(e.source);return{type:`image`,mimeType:Z(t?.media_type)??void 0,data:Z(t?.data)??void 0,detail:Z(t?.type)??void 0}}return{type:`unknown`,raw:e,label:`anthropic.content`}}function gI(e){if(typeof e==`string`)return[{type:`text`,text:e}];let t=dI(e).map(hI);return t.length>0?t:[{type:`unknown`,raw:e,label:`anthropic.content`}]}function _I(e,t){let n=pI(e);if(!n)return t.push(`Anthropic request body is missing or invalid.`),[];let r=[],i=n.system;if(typeof i==`string`)r.push({role:`system`,source:`request`,blocks:[{type:`text`,text:i}]});else if(Array.isArray(i)){let e=i.map(e=>{if(typeof e==`string`)return e;let t=pI(e);return t?Z(t.text)??``:``}).filter(Boolean).join(`
|
|
186
|
-
`);e&&r.push({role:`system`,source:`request`,blocks:[{type:`text`,text:e}]})}for(let e of dI(n.messages)){let t=pI(e);if(!t)continue;let n=mI(t.role,`user`),i=gI(t.content);r.push({role:n,source:`request`,blocks:i})}return r}function vI(e,t){if(!e)return t.push(`Anthropic non-stream response body is empty.`),[];let n=fI(e);return!n.value||!uI(n.value)?(t.push(`Anthropic response JSON parse failed: ${n.error??`invalid json`}`),[{role:`assistant`,source:`response`,blocks:[{type:`text`,text:e}],meta:{parseWarnings:[`fallback-to-raw-text`]}}]):[{role:`assistant`,source:`response`,blocks:gI(n.value.content),meta:{model:Z(n.value.model)??void 0,stopReason:Z(n.value.stop_reason),usage:n.value.usage}}]}function yI(e){return e.kind===`text`?{type:`text`,text:e.text}:e.kind===`thinking`?{type:`thinking`,thinking:e.thinking,signature:e.signature}:e.kind===`tool_use`?{type:`tool_use`,id:e.id,name:e.name,input:e.input,rawInput:e.inputRaw||void 0,partial:e.partial}:e.kind===`tool_result`?{type:`tool_result`,toolUseId:e.toolUseId,content:e.content,isError:e.isError}:e.kind===`image`?{type:`image`,mimeType:e.mimeType,data:e.data,detail:e.detail}:{type:`unknown`,raw:e.raw,label:`anthropic.stream`}}function bI(e){let t=pI(e);if(!t)return{kind:`unknown`,raw:e};let n=Z(t.type);if(n===`text`)return{kind:`text`,text:Z(t.text)??``};if(n===`thinking`)return{kind:`thinking`,thinking:Z(t.thinking)??``,signature:Z(t.signature)??void 0};if(n===`tool_use`)return{kind:`tool_use`,id:Z(t.id)??void 0,name:Z(t.name)??void 0,inputRaw:``,partial:!1,input:t.input};if(n===`tool_result`)return{kind:`tool_result`,toolUseId:Z(t.tool_use_id)??void 0,content:t.content,isError:t.is_error===!0};if(n===`image`){let e=pI(t.source);return{kind:`image`,mimeType:Z(e?.media_type)??void 0,data:Z(e?.data)??void 0,detail:Z(e?.type)??void 0}}return{kind:`unknown`,raw:e}}function xI(e,t){if(!e)return t.push(`Anthropic stream content is empty.`),{messages:[],streamEventCount:0,partial:!1};let n=lI(e);t.push(...n.warnings.map(e=>`Anthropic stream: ${e}`));let r=new Map,i=[],a=`assistant`,o,s,c;for(let e of n.frames){let n=e.data.trim();if(!n||n===`[DONE]`)continue;let l=fI(n);if(!l.value||!uI(l.value)){t.push(`Anthropic stream frame #${e.frameNo} JSON parse failed.`);continue}let u=Z(l.value.type);if(!u){t.push(`Anthropic stream frame #${e.frameNo} missing type.`);continue}if(u===`message_start`){let e=pI(l.value.message);a=mI(e?.role,`assistant`)===`tool`?`tool`:`assistant`,o=Z(e?.model)??o,c=e?.usage??c;continue}if(u===`content_block_start`){let e=typeof l.value.index==`number`?l.value.index:i.length,t=bI(l.value.content_block);r.set(e,t),i.includes(e)||i.push(e);continue}if(u===`content_block_delta`){let n=typeof l.value.index==`number`?l.value.index:i.length,a=pI(l.value.delta);if(!a){t.push(`Anthropic stream frame #${e.frameNo} has invalid delta.`);continue}let o=r.get(n);o||(o={kind:`unknown`,raw:{inferredFromDelta:!0,delta:a}},r.set(n,o),i.push(n));let s=Z(a.type);if(!s){t.push(`Anthropic stream frame #${e.frameNo} delta missing type.`);continue}if(s===`text_delta`){o.kind!==`text`&&(o={kind:`text`,text:``},r.set(n,o)),o.text+=Z(a.text)??``;continue}if(s===`thinking_delta`){o.kind!==`thinking`&&(o={kind:`thinking`,thinking:``},r.set(n,o)),o.thinking+=Z(a.thinking)??``;continue}if(s===`signature_delta`){o.kind!==`thinking`&&(o={kind:`thinking`,thinking:``},r.set(n,o)),o.signature=`${o.signature??``}${Z(a.signature)??``}`;continue}if(s===`input_json_delta`){o.kind!==`tool_use`&&(o={kind:`tool_use`,id:void 0,name:void 0,inputRaw:``,partial:!0},r.set(n,o)),o.inputRaw+=Z(a.partial_json)??``;continue}t.push(`Anthropic stream delta type not handled: ${s}`),r.set(n,{kind:`unknown`,raw:a});continue}if(u===`content_block_stop`){let e=typeof l.value.index==`number`?l.value.index:-1,n=r.get(e);if(n?.kind===`tool_use`&&n.inputRaw){let r=fI(n.inputRaw);r.value==null?(n.partial=!0,t.push(`Anthropic tool_use JSON parse failed at block ${e}: ${r.error}`)):(n.input=r.value,n.partial=!1)}continue}if(u===`message_delta`){let e=pI(l.value.delta);e&&(s=Z(e.stop_reason)??s),l.value.usage!==void 0&&(c=l.value.usage);continue}u===`message_stop`||u===`ping`||t.push(`Anthropic stream event not handled: ${u}`)}let l=i.sort((e,t)=>e-t).map(e=>r.get(e)).filter(e=>e!=null).map(yI);if(l.length===0)return t.push(`Anthropic stream produced no content blocks.`),{messages:[],streamEventCount:n.frames.length,partial:n.partial};let u=l.some(e=>e.type===`tool_use`&&e.partial===!0);return{messages:[{role:a,source:`stream`,blocks:l,meta:{model:o,stopReason:s,usage:c,partial:n.partial||u}}],streamEventCount:n.frames.length,partial:n.partial||u}}function SI(e){let t=[],n=_I(e.request.requestBody,t),r=[],i=0,a=!1;if(e.upstream.isStream){let n=xI(e.upstream.streamContent,t);r=n.messages,i=n.streamEventCount,a=n.partial}else r=vI(e.response.responseBody,t);return{inputMessages:n,outputMessages:r,warnings:t,streamEventCount:i,partial:a}}function CI(e){if(typeof e==`string`)return[{type:`text`,text:e}];if(!Array.isArray(e))return e==null?[]:[{type:`unknown`,raw:e,label:`openai.request.content`}];let t=[];for(let n of e){let e=pI(n);if(!e){t.push({type:`unknown`,raw:n,label:`openai.request.part`});continue}let r=Z(e.type);if(r===`text`||r===`input_text`){t.push({type:`text`,text:Z(e.text)??``});continue}if(r===`image_url`||r===`input_image`){let n=pI(e.image_url);t.push({type:`image`,url:Z(n?.url)??Z(e.image_url)??void 0,detail:Z(n?.detail)??void 0});continue}t.push({type:`unknown`,raw:n,label:`openai.request.part`})}return t}function wI(e,t){let n=pI(e);if(!n)return t.push(`OpenAI completions request body is missing or invalid.`),[];let r=[];for(let e of dI(n.messages)){let t=pI(e);if(!t)continue;let n=mI(t.role,`user`),i=CI(t.content);if(Array.isArray(t.tool_calls))for(let e of t.tool_calls){let t=pI(e);if(!t){i.push({type:`unknown`,raw:e,label:`openai.request.tool_call`});continue}let n=pI(t.function),r,a=Z(n?.arguments);a&&(r=fI(a).value??a),i.push({type:`tool_use`,id:Z(t.id)??void 0,name:Z(n?.name)??void 0,input:r,rawInput:a??void 0,partial:!1})}r.push({role:n,source:`request`,blocks:i.length>0?i:[{type:`text`,text:``}]})}return r}function TI(e){let t=[],n=e.content;typeof n==`string`?t.push({type:`text`,text:n}):Array.isArray(n)?t.push(...CI(n)):n!=null&&t.push({type:`unknown`,raw:n,label:`openai.response.content`});let r=dI(e.tool_calls);for(let e of r){let n=pI(e);if(!n){t.push({type:`unknown`,raw:e,label:`openai.response.tool_call`});continue}let r=pI(n.function),i=Z(r?.arguments),a,o=!1;if(i){let e=fI(i);a=e.value??i,o=e.value==null}t.push({type:`tool_use`,id:Z(n.id)??void 0,name:Z(r?.name)??void 0,input:a,rawInput:i??void 0,partial:o})}return t.length===0&&t.push({type:`text`,text:``}),t}function EI(e,t){if(!e)return t.push(`OpenAI completions non-stream response body is empty.`),[];let n=fI(e);if(!n.value||!uI(n.value))return t.push(`OpenAI completions response JSON parse failed: ${n.error??`invalid json`}`),[{role:`assistant`,source:`response`,blocks:[{type:`text`,text:e}],meta:{parseWarnings:[`fallback-to-raw-text`]}}];let r=pI(dI(n.value.choices)[0]),i=pI(r?.message);return i?[{role:mI(i.role,`assistant`),source:`response`,blocks:TI(i),meta:{model:Z(n.value.model)??void 0,stopReason:Z(r?.finish_reason),usage:n.value.usage}}]:(t.push(`OpenAI completions response missing choices[0].message.`),[])}function DI(e,t){if(!e)return t.push(`OpenAI completions stream content is empty.`),{messages:[],streamEventCount:0,partial:!1};let n=lI(e);t.push(...n.warnings.map(e=>`OpenAI completions stream: ${e}`));let r=``,i=`assistant`,a,o,s=new Map;for(let e of n.frames){let n=e.data.trim();if(!n||n===`[DONE]`)continue;let c=fI(n);if(!c.value||!uI(c.value)){t.push(`OpenAI completions frame #${e.frameNo} JSON parse failed.`);continue}a=Z(c.value.model)??a;for(let e of dI(c.value.choices)){let t=pI(e);if(!t)continue;o=Z(t.finish_reason)??o;let n=pI(t.delta);if(!n)continue;let a=Z(n.role);(a===`assistant`||a===`tool`)&&(i=a);let c=Z(n.content);c&&(r+=c);for(let e of dI(n.tool_calls)){let t=pI(e);if(!t)continue;let n=typeof t.index==`number`?t.index:s.size,r=s.get(n)??{argumentsRaw:``,partial:!1};r.id=Z(t.id)??r.id;let i=pI(t.function);r.name=Z(i?.name)??r.name,r.argumentsRaw+=Z(i?.arguments)??``,s.set(n,r)}}}let c=[];r&&c.push({type:`text`,text:r});let l=Array.from(s.entries()).sort((e,t)=>e[0]-t[0]);for(let[,e]of l){if(e.argumentsRaw){let n=fI(e.argumentsRaw);n.value==null?(e.parsedArguments=void 0,e.partial=!0,t.push(`OpenAI completions tool call arguments parse failed: ${n.error}`)):(e.parsedArguments=n.value,e.partial=!1)}c.push({type:`tool_use`,id:e.id,name:e.name,input:e.parsedArguments,rawInput:e.argumentsRaw||void 0,partial:e.partial})}if(c.length===0)return t.push(`OpenAI completions stream produced no assistant content.`),{messages:[],streamEventCount:n.frames.length,partial:n.partial};let u=c.some(e=>e.type===`tool_use`&&e.partial===!0);return{messages:[{role:i,source:`stream`,blocks:c,meta:{model:a,stopReason:o,partial:n.partial||u}}],streamEventCount:n.frames.length,partial:n.partial||u}}function OI(e){let t=[],n=wI(e.request.requestBody,t),r=[],i=0,a=!1;if(e.upstream.isStream){let n=DI(e.upstream.streamContent,t);r=n.messages,i=n.streamEventCount,a=n.partial}else r=EI(e.response.responseBody,t);return{inputMessages:n,outputMessages:r,warnings:t,streamEventCount:i,partial:a}}function kI(e){let t=pI(e);if(!t)return null;let n=mI(t.role,`user`);if(typeof t.content==`string`)return{role:n,source:`request`,blocks:[{type:`text`,text:t.content}]};let r=[];for(let e of dI(t.content)){let t=pI(e);if(!t){r.push({type:`unknown`,raw:e,label:`responses.input`});continue}let n=Z(t.type);if(n===`input_text`||n===`text`){r.push({type:`text`,text:Z(t.text)??``});continue}if(n===`input_image`||n===`image_url`){let e=pI(t.image_url);r.push({type:`image`,url:Z(e?.url)??Z(t.image_url)??void 0,detail:Z(e?.detail)??void 0});continue}if(n===`input_tool_result`){r.push({type:`tool_result`,toolUseId:Z(t.call_id)??void 0,content:t.output,isError:t.is_error===!0});continue}r.push({type:`unknown`,raw:e,label:`responses.input`})}return{role:n,source:`request`,blocks:r.length>0?r:[{type:`text`,text:``}]}}function AI(e,t){let n=pI(e);if(!n)return t.push(`OpenAI responses request body is missing or invalid.`),[];let r=n.input;if(typeof r==`string`)return[{role:`user`,source:`request`,blocks:[{type:`text`,text:r}]}];let i=[];for(let e of dI(r)){let t=kI(e);t&&i.push(t)}return i}function jI(e,t){let n=[];for(let t of e){let e=pI(t);if(!e){n.push({type:`unknown`,raw:t,label:`responses.output`});continue}let r=Z(e.type);if(r===`message`){for(let t of dI(e.content)){let e=pI(t);if(!e){n.push({type:`unknown`,raw:t,label:`responses.message.content`});continue}let r=Z(e.type);if(r===`output_text`||r===`text`)n.push({type:`text`,text:Z(e.text)??``});else if(r===`output_image`||r===`image_url`){let t=pI(e.image_url);n.push({type:`image`,url:Z(t?.url)??Z(e.image_url)??void 0,detail:Z(t?.detail)??void 0})}else n.push({type:`unknown`,raw:t,label:`responses.message.content`})}continue}if(r===`function_call`||r===`tool_call`){let t=Z(e.arguments)??Z(e.input)??``,r=t?fI(t):{value:void 0,error:null};n.push({type:`tool_use`,id:Z(e.call_id)??Z(e.id)??void 0,name:Z(e.name)??void 0,input:r.value??void 0,rawInput:t||void 0,partial:t?r.value==null:!1});continue}if(r===`function_call_output`||r===`tool_result`){n.push({type:`tool_result`,toolUseId:Z(e.call_id)??void 0,content:e.output,isError:e.is_error===!0});continue}n.push({type:`unknown`,raw:t,label:`responses.output`})}return n.length===0?[]:[{role:`assistant`,source:t,blocks:n}]}function MI(e,t){if(!e)return t.push(`OpenAI responses non-stream response body is empty.`),[];let n=fI(e);if(!n.value||!uI(n.value))return t.push(`OpenAI responses JSON parse failed: ${n.error??`invalid json`}`),[{role:`assistant`,source:`response`,blocks:[{type:`text`,text:e}],meta:{parseWarnings:[`fallback-to-raw-text`]}}];let r=n.value,i=jI(dI(r.output),`response`);return i.length===0?[]:i.map(e=>({...e,meta:{model:Z(r.model)??void 0,stopReason:Z(r.status)??null,usage:r.usage}}))}function NI(e,t){if(!e)return t.push(`OpenAI responses stream content is empty.`),{messages:[],streamEventCount:0,partial:!1};let n=lI(e);t.push(...n.warnings.map(e=>`OpenAI responses stream: ${e}`));let r={text:``,functionCalls:new Map,rawItems:[]};for(let e of n.frames){let n=e.data.trim();if(!n||n===`[DONE]`)continue;let i=fI(n);if(!i.value||!uI(i.value)){t.push(`OpenAI responses frame #${e.frameNo} JSON parse failed.`);continue}let a=Z(i.value.type)??e.event??``;if(a===`response.output_text.delta`){r.text+=Z(i.value.delta)??``;continue}if(a===`response.output_item.added`){let e=i.value.item;r.rawItems.push(e);continue}if(a===`response.function_call_arguments.delta`){let e=Z(i.value.call_id)??`unknown`,t=r.functionCalls.get(e)??{argumentsRaw:``,partial:!1};t.name=Z(i.value.name)??t.name,t.argumentsRaw+=Z(i.value.delta)??``,r.functionCalls.set(e,t);continue}if(a===`response.completed`){r.status=Z(i.value.status)??r.status,r.model=Z(i.value.model)??r.model;continue}a&&t.push(`OpenAI responses stream event not handled: ${a}`)}let i=[];r.text&&i.push({type:`text`,text:r.text});for(let[e,n]of r.functionCalls.entries()){if(n.argumentsRaw){let r=fI(n.argumentsRaw);r.value==null?(n.partial=!0,t.push(`OpenAI responses function_call arguments parse failed (${e}).`)):(n.parsed=r.value,n.partial=!1)}i.push({type:`tool_use`,id:e,name:n.name,input:n.parsed,rawInput:n.argumentsRaw||void 0,partial:n.partial})}if(r.rawItems.length>0){let e=jI(r.rawItems,`stream`)[0]?.blocks??[];i.push(...e)}if(i.length===0)return{messages:[],streamEventCount:n.frames.length,partial:n.partial};let a=n.partial||i.some(e=>e.type===`tool_use`&&e.partial);return{messages:[{role:`assistant`,source:`stream`,blocks:i,meta:{model:r.model,stopReason:r.status??null,partial:a}}],streamEventCount:n.frames.length,partial:a}}function PI(e){let t=[],n=AI(e.request.requestBody,t),r=[],i=0,a=!1;if(e.upstream.isStream){let n=NI(e.upstream.streamContent,t);r=n.messages,i=n.streamEventCount,a=n.partial}else r=MI(e.response.responseBody,t);return{inputMessages:n,outputMessages:r,warnings:t,streamEventCount:i,partial:a}}function FI(e){return{inputMessages:[],outputMessages:[],warnings:[e],streamEventCount:0,partial:!1}}function II(e){let t=e.summary.routeType;return t===`anthropic-messages`?SI(e):t===`openai-completions`?OI(e):t===`openai-responses`?PI(e):FI(`Route type not supported for chat history parse: ${t}`)}function LI(e){let t=II(e),n=[...t.warnings];return e.capture.requestBodyAvailable||n.unshift(`请求 body 不可用,输入历史可能不完整。`),e.capture.bodyPolicy===`off`&&n.unshift(`bodyPolicy=off,无法完整还原请求/响应消息体。`),e.upstream.isStream&&!e.capture.streamCaptured&&n.push(`流式请求未捕获 streamContent,输出消息可能缺失。`),{messages:[...t.inputMessages,...t.outputMessages],warnings:n,stats:{inputCount:t.inputMessages.length,outputCount:t.outputMessages.length,streamEventCount:t.streamEventCount,streamPartial:t.partial}}}var RI=[`overview`,`conversation`,`request`,`response`,`plugins`,`stream`,`raw`];function zI(e){return RI.includes(e)?e:`overview`}function BI(){return typeof window>`u`?`overview`:zI(window.location.hash.replace(/^#/,``))}function VI(){let e=hr(),{id:t}=pr({from:`/logs/$id`}),[n,r]=(0,I.useState)(null),[i,a]=(0,I.useState)(!0),[o,s]=(0,I.useState)(null),[c,l]=(0,I.useState)(()=>BI()),[u,d]=(0,I.useState)(()=>new Set([BI()]));(0,I.useEffect)(()=>{let e=!1;async function n(){a(!0),s(null);let n=BI();l(n),d(new Set([n]));try{let n=await Kx(t);e||(r(n),a(!1))}catch(t){e||(s(t instanceof Error?t.message:`日志详情加载失败`),a(!1))}}return n(),()=>{e=!0}},[t]),(0,I.useEffect)(()=>{function e(){let e=BI();l(e),d(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let f=(0,I.useCallback)(e=>{d(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),p=(0,I.useCallback)(e=>{let t=zI(e);l(t),f(t),window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${t}`)},[f]),m=(0,I.useMemo)(()=>n?_F(n.summary.routeType):`-`,[n]);if(i)return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsx)(Jj,{className:`h-8 w-56`}),(0,L.jsx)(Jj,{className:`h-24 w-full`}),(0,L.jsx)(Jj,{className:`h-56 w-full`})]});if(o||!n)return(0,L.jsxs)(Hj,{className:`min-h-[240px] p-6 md:p-6`,children:[(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`日志详情加载失败`}),(0,L.jsx)(qj,{children:o??`日志事件不存在`})]}),(0,L.jsx)(K,{variant:`outline`,onClick:()=>e({to:`/logs`,search:{user:void 0,session:void 0}}),children:`返回日志列表`})]});let h=!!(n.plugins&&(n.plugins.request?.length||n.plugins.response?.length)),g=(n.plugins?.request?.length??0)+(n.plugins?.response?.length??0),_=n.plugins?.requestBodyAfterPlugins!==void 0,v=n.plugins?.responseBodyBeforePlugins!==void 0;return(0,L.jsxs)(NF,{value:c,onValueChange:p,className:`min-w-[720px] space-y-3`,children:[(0,L.jsx)(HI,{detail:n,interfaceType:m,tabs:[{id:`overview`,label:`概览`,meta:n.summary.statusClass},{id:`conversation`,label:`对话`,meta:`derived`},{id:`request`,label:`请求`,meta:_?`plugin-after`:`captured`},{id:`response`,label:`响应`,meta:v?`plugin-before`:`captured`},{id:`plugins`,label:`插件`,meta:g>0?`${g} 个`:`无`},{id:`stream`,label:`Stream`,meta:n.upstream.isStream?n.capture.streamCaptured?`已采集`:`未采集`:`非流式`},{id:`raw`,label:`Raw`,meta:n.capture.bodyPolicy}],onBack:()=>e({to:`/logs`,search:{user:void 0,session:void 0}})}),(0,L.jsxs)(`main`,{className:`min-w-0 space-y-3`,children:[(0,L.jsx)(LF,{value:`overview`,className:`mt-0`,children:(0,L.jsx)(KI,{detail:n,interfaceType:m})}),(0,L.jsx)(ZI,{value:`conversation`,mounted:u.has(`conversation`),onMount:f,placeholder:`对话会在进入本 Tab 时解析,避免打开详情时一次性处理大消息。`,children:(0,L.jsx)(QI,{detail:n})}),(0,L.jsx)(LF,{value:`request`,className:`mt-0`,children:(0,L.jsx)(JI,{title:`请求`,description:`用户请求与实际发送给 Provider 的请求并排查看`,badges:[`reconstructed`,_?`plugin-after`:`captured`],children:(0,L.jsx)($I,{detail:n})})}),(0,L.jsx)(LF,{value:`response`,className:`mt-0`,children:(0,L.jsx)(JI,{title:`响应`,description:`Provider 原始响应与最终返回给用户的响应并排查看`,badges:[v?`plugin-before`:`captured`,`captured`],children:(0,L.jsx)(eL,{detail:n})})}),(0,L.jsx)(LF,{value:`plugins`,className:`mt-0`,children:(0,L.jsx)(JI,{title:`插件`,description:`请求阶段和响应阶段的插件顺序与已记录快照`,badges:[h?`${g} plugins`:`unavailable`],children:h?(0,L.jsx)(EF,{detail:n}):(0,L.jsx)(cL,{title:`无插件记录`,description:`本条日志没有记录请求或响应插件链路。`})})}),(0,L.jsx)(ZI,{value:`stream`,mounted:u.has(`stream`),onMount:f,placeholder:`Stream 内容会在进入本 Tab 时解析。`,children:(0,L.jsx)(qI,{title:`Stream`,description:`SSE 或流式响应内容`,badges:[n.upstream.isStream&&n.capture.streamCaptured?`raw`:`unavailable`],children:(0,L.jsx)(rL,{detail:n})})}),(0,L.jsx)(ZI,{value:`raw`,mounted:u.has(`raw`),onMount:f,placeholder:`Raw JSON 会在进入本 Tab 时格式化,避免首屏阻塞。`,children:(0,L.jsx)(qI,{title:`Raw`,description:`完整事件 JSON,作为事实源兜底查看`,badges:[`raw`],children:(0,L.jsx)(wF,{title:`event`,value:n.rawEvent})})})]})]})}function HI({detail:e,interfaceType:t,tabs:n,onBack:r}){return(0,L.jsxs)(`section`,{className:`overflow-hidden rounded-md border bg-background`,children:[(0,L.jsxs)(`div`,{className:`space-y-2 px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2 sm:flex-row sm:items-start sm:justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,L.jsxs)(K,{variant:`outline`,size:`xs`,onClick:r,className:`mt-0.5`,children:[(0,L.jsx)(ua,{className:`h-4 w-4`}),`返回`]}),(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,L.jsx)(J,{variant:e.summary.hasError?`secondary`:`outline`,children:e.summary.statusClass}),e.upstream.isStream?(0,L.jsx)(J,{variant:`outline`,children:`stream`}):null]}),(0,L.jsxs)(`h1`,{className:`mt-1 flex min-w-0 items-center gap-2 text-sm font-semibold`,children:[(0,L.jsx)(`span`,{className:`shrink-0 rounded-md border bg-muted/30 px-1.5 py-0.5 font-mono text-xs`,children:e.request.method}),(0,L.jsx)(`span`,{className:`truncate`,title:e.request.path,children:e.request.path})]})]})]}),(0,L.jsxs)(`div`,{className:`hidden min-w-0 text-right text-xs text-muted-foreground md:block`,children:[(0,L.jsx)(`div`,{className:`font-mono`,children:e.summary.requestId}),(0,L.jsx)(`div`,{className:`mt-1`,children:gF(e.summary.ts)})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-[minmax(0,1fr)_220px]`,children:[(0,L.jsx)(UI,{detail:e,interfaceType:t}),(0,L.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs`,children:[(0,L.jsx)(GI,{label:`HTTP`,value:String(e.summary.upstreamStatus)}),(0,L.jsx)(GI,{label:`Latency`,value:`${e.summary.latencyMs} ms`})]})]})]}),(0,L.jsx)(`div`,{className:`overflow-x-auto border-t px-3 py-1.5`,children:(0,L.jsx)(FF,{variant:`line`,className:`h-auto min-w-max justify-start`,children:n.map(e=>(0,L.jsxs)(IF,{value:e.id,className:`gap-1.5 px-2.5 py-1.5 text-xs`,children:[(0,L.jsx)(`span`,{children:e.label}),e.meta?(0,L.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 py-0.5 text-[10px] leading-none text-muted-foreground`,children:e.meta}):null]},e.id))})})]})}function UI({detail:e,interfaceType:t}){return(0,L.jsxs)(`div`,{className:`min-w-0 rounded-md border bg-muted/15 px-2.5 py-1.5`,children:[(0,L.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`Route`}),(0,L.jsxs)(`div`,{className:`mt-1 flex min-w-0 flex-wrap items-center gap-1.5 text-sm`,children:[(0,L.jsx)(WI,{value:e.summary.modelIn,mono:!0}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,L.jsx)(WI,{value:e.summary.provider}),(0,L.jsx)(`span`,{className:`text-muted-foreground`,children:`/`}),(0,L.jsx)(WI,{value:e.summary.modelOut,mono:!0}),(0,L.jsx)(WI,{value:e.summary.routeType,subtle:!0}),(0,L.jsx)(WI,{value:t,subtle:!0}),e.summary.routeRuleKey?(0,L.jsx)(WI,{value:e.summary.routeRuleKey,mono:!0,subtle:!0}):null]})]})}function WI({value:e,mono:t,subtle:n}){return(0,L.jsx)(`span`,{className:G(`max-w-full truncate rounded-full border px-2 py-0.5 text-xs`,t&&`font-mono`,n?`bg-background text-muted-foreground`:`bg-background text-foreground`),title:e,children:e})}function GI({label:e,value:t,mono:n}){return(0,L.jsxs)(`div`,{className:`min-w-0 rounded-md border bg-muted/15 px-2.5 py-1.5`,children:[(0,L.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e}),(0,L.jsx)(`div`,{className:G(`mt-0.5 truncate text-sm font-medium`,n?`font-mono`:`tabular-nums`),title:t,children:t})]})}function KI({detail:e,interfaceType:t}){return(0,L.jsx)(qI,{title:`概览`,description:`核心元信息、模型路由、用量和采集范围`,badges:[`captured`,e.usage.tokenUsage?e.usage.tokenUsage.source:`unavailable`],children:(0,L.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap gap-1.5`,children:[(0,L.jsx)(J,{variant:`outline`,children:e.summary.level}),(0,L.jsx)(J,{variant:`outline`,children:e.summary.provider}),(0,L.jsx)(J,{variant:`outline`,children:e.summary.routeType}),(0,L.jsx)(J,{variant:`outline`,children:e.summary.statusClass}),(0,L.jsx)(J,{variant:e.summary.hasError?`secondary`:`outline`,children:e.summary.upstreamStatus})]}),(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm sm:grid-cols-2 lg:grid-cols-3`,children:[(0,L.jsx)(TF,{label:`时间`,value:gF(e.summary.ts)}),(0,L.jsx)(TF,{label:`request_id`,value:e.summary.requestId,mono:!0}),(0,L.jsx)(TF,{label:`model_in`,value:e.summary.modelIn,mono:!0}),(0,L.jsx)(TF,{label:`model_out`,value:e.summary.modelOut,mono:!0}),(0,L.jsx)(TF,{label:`route_rule_key`,value:e.summary.routeRuleKey,mono:!0}),(0,L.jsx)(TF,{label:`latency`,value:`${e.summary.latencyMs} ms`}),(0,L.jsx)(TF,{label:`target_url`,value:e.upstream.targetUrl,mono:!0}),(0,L.jsx)(TF,{label:`proxy_url`,value:e.upstream.proxyUrl??`-`,mono:!0}),(0,L.jsx)(TF,{label:`定位`,value:`${e.location.file}:${e.location.line}`,mono:!0})]}),(0,L.jsx)(`div`,{className:`rounded-md border bg-muted/10 p-2`,children:(0,L.jsx)(OF,{interfaceType:t,routeType:e.summary.routeType,modelIn:e.summary.modelIn,provider:e.summary.provider,modelOut:e.summary.modelOut,routeRuleKey:e.summary.routeRuleKey})}),(0,L.jsx)(pL,{detail:e}),(0,L.jsx)(sL,{detail:e}),(0,L.jsx)(iL,{detail:e})]})})}function qI({title:e,description:t,badges:n,children:r}){return(0,L.jsxs)(`section`,{className:`rounded-md border bg-background`,children:[(0,L.jsx)(YI,{title:e,description:t,badges:n}),(0,L.jsx)(`div`,{className:`px-3 py-2.5`,children:r})]})}function JI({title:e,description:t,badges:n,children:r}){return(0,L.jsxs)(`section`,{className:`space-y-2.5`,children:[(0,L.jsx)(YI,{title:e,description:t,badges:n,bare:!0}),r]})}function YI({title:e,description:t,badges:n,bare:r}){return(0,L.jsxs)(`div`,{className:G(`flex flex-wrap items-start justify-between gap-2 px-3 py-2`,r?`rounded-md border bg-background`:`border-b`),children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:e}),t?(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),n&&n.length>0?(0,L.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:n.map(e=>(0,L.jsx)(XI,{value:e},e))}):null]})}function XI({value:e}){return(0,L.jsx)(J,{variant:`outline`,className:G(`text-[11px]`,e===`unavailable`&&`border-muted-foreground/30 text-muted-foreground`,e===`partial`&&`border-amber-500/40 text-amber-600 dark:text-amber-400`,e.startsWith(`plugin`)&&`border-blue-500/40 text-blue-600 dark:text-blue-400`),children:e})}function ZI({value:e,mounted:t,onMount:n,placeholder:r,children:i}){return(0,L.jsx)(LF,{value:e,className:`mt-0`,children:t?i:(0,L.jsxs)(`div`,{className:`rounded-md border border-dashed bg-background px-3 py-4`,children:[(0,L.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:r}),(0,L.jsx)(K,{type:`button`,variant:`outline`,size:`sm`,className:`mt-2`,onClick:()=>n(e),children:`查看本 Tab 内容`})]})})}function QI({detail:e}){return(0,L.jsx)(rI,{parsed:(0,I.useMemo)(()=>LI(e),[e])})}function $I({detail:e}){let t=xF(e),n=e.plugins?.requestBodyAfterPlugins!==void 0,r=n?e.plugins?.requestBodyAfterPlugins:e.request.requestBody,i=e.plugins?.requestUrlAfterPlugins??e.upstream.targetUrl;return(0,L.jsxs)(`div`,{className:`grid gap-2.5 xl:grid-cols-2`,children:[(0,L.jsx)(tL,{title:`用户请求`,description:`进入 local-router 的请求视图`,source:`reconstructed`,children:(0,L.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm sm:grid-cols-3`,children:[(0,L.jsx)(TF,{label:`method`,value:e.request.method}),(0,L.jsx)(TF,{label:`path`,value:e.request.path,mono:!0}),(0,L.jsx)(TF,{label:`content-type`,value:e.request.contentType??`-`,mono:!0})]}),(0,L.jsx)(xM,{title:`headers`,headers:e.request.requestHeaders}),(0,L.jsx)(wF,{title:`request_body`,value:t,contentType:e.request.contentType,emptyText:`无请求 body 或未采集。`})]})}),(0,L.jsx)(tL,{title:`Provider 请求`,description:`最终发送给 ${e.summary.provider} 的请求视图`,source:n?`plugin-after`:`captured`,children:(0,L.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm sm:grid-cols-2`,children:[(0,L.jsx)(TF,{label:`target_url`,value:i,mono:!0}),(0,L.jsx)(TF,{label:`provider`,value:e.summary.provider})]}),(0,L.jsx)(wF,{title:`request_body_after_plugins`,value:r,contentType:e.request.contentType,emptyText:`无请求 body 或未采集。`}),(0,L.jsx)(nL,{text:n?`已记录插件处理后的请求 body 快照。`:`未记录插件处理后的请求 body 快照;此处展示已采集的请求 body。`})]})})]})}function eL({detail:e}){let t=e.plugins?.responseBodyBeforePlugins!==void 0,n=e.plugins?.responseBodyAfterPlugins!==void 0,r=t?e.plugins?.responseBodyBeforePlugins:e.response.responseBody,i=n?e.plugins?.responseBodyAfterPlugins:e.response.responseBody;return(0,L.jsxs)(`div`,{className:`grid gap-2.5 xl:grid-cols-2`,children:[(0,L.jsx)(tL,{title:`Provider 响应`,description:`${e.summary.provider} 返回给 local-router 的响应视图`,source:t?`plugin-before`:`captured`,children:(0,L.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm sm:grid-cols-2`,children:[(0,L.jsx)(TF,{label:`upstream_status`,value:String(e.response.upstreamStatus)}),(0,L.jsx)(TF,{label:`content-type`,value:e.response.contentType??`-`,mono:!0})]}),(0,L.jsx)(xM,{title:`headers`,headers:e.response.responseHeaders}),(0,L.jsx)(wF,{title:`response_body_before_plugins`,value:r,contentType:e.response.contentType,emptyText:e.upstream.isStream?`流式响应内容在 Stream 区域查看。`:`无响应 body 或未采集。`})]})}),(0,L.jsx)(tL,{title:`最终响应`,description:`local-router 返回给用户的响应视图`,source:n?`plugin-after`:`captured`,children:(0,L.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm sm:grid-cols-2`,children:[(0,L.jsx)(TF,{label:`status`,value:String(e.response.upstreamStatus)}),(0,L.jsx)(TF,{label:`content-type`,value:e.response.contentType??`-`,mono:!0})]}),(0,L.jsx)(wF,{title:`response_body`,value:i,contentType:e.response.contentType,emptyText:e.upstream.isStream?`流式响应内容在 Stream 区域查看。`:`无响应 body 或未采集。`}),(0,L.jsx)(nL,{text:n?`已记录插件处理后的最终响应 body 快照。`:`未记录插件处理后的响应 body 快照;此处展示已采集的响应 body。`})]})})]})}function tL({title:e,description:t,source:n,children:r}){return(0,L.jsxs)(`section`,{className:`min-w-0 rounded-md border bg-background`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-2 border-b px-3 py-2`,children:[(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`h4`,{className:`text-sm font-semibold`,children:e}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t})]}),(0,L.jsx)(XI,{value:n})]}),(0,L.jsx)(`div`,{className:`px-3 py-2.5`,children:r})]})}function nL({text:e}){return(0,L.jsx)(`div`,{className:`rounded-md border bg-muted/20 px-2.5 py-1.5 text-xs text-muted-foreground`,children:e})}function rL({detail:e}){return(0,L.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,L.jsxs)(`div`,{className:`grid gap-2 text-sm sm:grid-cols-2 lg:grid-cols-3`,children:[(0,L.jsx)(TF,{label:`is_stream`,value:e.upstream.isStream?`true`:`false`}),(0,L.jsx)(TF,{label:`stream_file`,value:e.upstream.streamFile??`无 stream 数据`,mono:!0}),(0,L.jsx)(TF,{label:`stream bytes`,value:dL(e.usage.streamBytes)}),(0,L.jsx)(TF,{label:`stream file bytes`,value:dL(e.usage.streamFileBytes)}),(0,L.jsx)(TF,{label:`stream file truncated`,value:e.usage.streamFileTruncated?`true`:`false`})]}),(0,L.jsx)(kF,{title:`stream content`,content:e.upstream.streamContent,emptyText:e.upstream.isStream?`未捕获 stream 内容。`:`非流式请求,无 stream 内容。`})]})}function iL({detail:e}){let t=e.plugins?.requestBodyAfterPlugins!==void 0,n=e.plugins?.responseBodyBeforePlugins!==void 0;return(0,L.jsxs)(`div`,{className:`space-y-2 border-t pt-2.5`,children:[(0,L.jsx)(`div`,{className:`text-xs font-semibold`,children:`日志上下文`}),(0,L.jsxs)(`div`,{className:`grid gap-2 lg:grid-cols-3`,children:[(0,L.jsxs)(aL,{title:`Capture`,children:[(0,L.jsx)(oL,{label:`bodyPolicy`,value:e.capture.bodyPolicy,mono:!0}),(0,L.jsx)(oL,{label:`request body`,value:e.capture.requestBodyAvailable?`已采集`:`未采集`}),(0,L.jsx)(oL,{label:`response body`,value:e.capture.responseBodyAvailable?`已采集`:`未采集`}),(0,L.jsx)(oL,{label:`stream`,value:e.capture.streamCaptured?`已采集`:`未采集`}),e.capture.truncatedHints.length>0?(0,L.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,L.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:`truncated`}),(0,L.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1.5`,children:e.capture.truncatedHints.map(e=>(0,L.jsx)(`span`,{className:`rounded-md border bg-muted/20 px-2 py-1 text-xs`,children:e},e))})]}):null]}),(0,L.jsxs)(aL,{title:`Trace`,children:[(0,L.jsx)(oL,{label:`request_id`,value:e.summary.requestId,mono:!0}),(0,L.jsx)(oL,{label:`provider_request_id`,value:e.upstream.providerRequestId??`-`,mono:!0}),(0,L.jsx)(oL,{label:`date`,value:e.location.date,mono:!0}),(0,L.jsx)(oL,{label:`line`,value:String(e.location.line),mono:!0}),(0,L.jsx)(oL,{label:`file`,value:e.location.file,mono:!0})]}),(0,L.jsxs)(aL,{title:`Sources`,children:[(0,L.jsx)(oL,{label:`Overview`,value:`captured`}),(0,L.jsx)(oL,{label:`Conversation`,value:`derived`}),(0,L.jsx)(oL,{label:`Request`,value:t?`plugin-after`:`captured`}),(0,L.jsx)(oL,{label:`Response`,value:n?`plugin-before`:`captured`}),(0,L.jsx)(oL,{label:`Raw`,value:`raw`})]})]})]})}function aL({title:e,children:t}){return(0,L.jsxs)(`section`,{className:`rounded-md border bg-muted/10`,children:[(0,L.jsx)(`div`,{className:`border-b px-2.5 py-1.5 text-xs font-semibold`,children:e}),(0,L.jsx)(`div`,{className:`grid gap-2 px-2.5 py-2.5 sm:grid-cols-2`,children:t})]})}function oL({label:e,value:t,mono:n}){return(0,L.jsxs)(`div`,{className:`min-w-0`,children:[(0,L.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e}),(0,L.jsx)(`div`,{className:G(`truncate text-xs`,n&&`font-mono`),title:t,children:t})]})}function sL({detail:e}){let t=!!(e.plugins&&(e.plugins.request?.length||e.plugins.response?.length)),n=[{label:`Request body`,value:e.capture.requestBodyAvailable?`已采集`:`未采集`},{label:`Response body`,value:e.capture.responseBodyAvailable?`已采集`:`未采集`},{label:`Stream`,value:e.capture.streamCaptured?`已采集`:`未采集`},{label:`Plugin snapshots`,value:t?`已记录`:`未记录`}];return(0,L.jsxs)(`div`,{className:`space-y-2 border-t pt-2.5`,children:[(0,L.jsx)(`div`,{className:`text-xs font-semibold`,children:`采集范围`}),(0,L.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:n.map(e=>(0,L.jsxs)(`div`,{className:`rounded-md border bg-muted/10 px-2.5 py-1.5`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.label}),(0,L.jsx)(`div`,{className:`mt-0.5 text-xs font-medium`,children:e.value})]},e.label))})]})}function cL({title:e,description:t}){return(0,L.jsxs)(`div`,{className:`rounded-md border border-dashed bg-background px-3 py-4`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:t})]})}function lL(e){return e==null?`-`:Intl.NumberFormat(void 0,{notation:Math.abs(e)>=1e5?`compact`:`standard`,maximumFractionDigits:1}).format(e)}function uL(e){return e==null?`-`:`${e.toFixed(2).replace(/\.?0+$/,``)}%`}function dL(e){if(e==null)return`-`;if(e<1024)return`${e} B`;let t=[`KB`,`MB`,`GB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(n>=10?0:1)} ${t[r]}`}function fL(e){return e?[[`cached input`,lL(e.cachedInputTokens)],[`cache read`,lL(e.cacheReadInputTokens)],[`cache creation`,lL(e.cacheCreationInputTokens)],[`cache creation 5m`,lL(e.cacheCreationInputTokens5m)],[`cache creation 1h`,lL(e.cacheCreationInputTokens1h)],[`cache write`,lL(e.cacheWriteInputTokens)],[`cache miss`,lL(e.cacheMissInputTokens)],[`reasoning`,lL(e.reasoningTokens)],[`audio input`,lL(e.audioInputTokens)],[`audio output`,lL(e.audioOutputTokens)],[`text input`,lL(e.textInputTokens)],[`text output`,lL(e.textOutputTokens)],[`accepted prediction`,lL(e.acceptedPredictionTokens)],[`rejected prediction`,lL(e.rejectedPredictionTokens)],[`tool prompt`,lL(e.toolUsePromptTokens)],[`billable input`,lL(e.billableInputTokens)],[`billable output`,lL(e.billableOutputTokens)],[`credit usage`,lL(e.creditUsage)],[`cost`,lL(e.cost)],[`provider style`,e.providerStyle],[`source`,e.source],[`raw path`,e.rawUsagePath??`-`],[`cache formula`,e.cacheHitRateFormula??`-`]].filter(([,e])=>e!==`-`):[]}function pL({detail:e}){let t=e.usage.tokenUsage??e.summary.tokenUsage,n=fL(t);return(0,L.jsxs)(`div`,{className:`space-y-2.5 border-t pt-2.5`,children:[(0,L.jsxs)(`div`,{className:`mb-2 flex flex-wrap items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-xs font-semibold`,children:`Usage / Size`}),(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Token 用量与请求/响应体积`})]}),t?(0,L.jsx)(J,{variant:`outline`,children:t.providerStyle}):null]}),(0,L.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,L.jsx)(mL,{label:`Input`,value:lL(t?.inputTokens)}),(0,L.jsx)(mL,{label:`Output`,value:lL(t?.outputTokens)}),(0,L.jsx)(mL,{label:`Total`,value:lL(t?.totalTokens)}),(0,L.jsx)(mL,{label:`缓存命中率`,value:uL(t?.cacheHitRate)})]}),(0,L.jsxs)(`div`,{className:`grid gap-2 text-xs sm:grid-cols-2 lg:grid-cols-4`,children:[(0,L.jsx)(TF,{label:`request bytes`,value:dL(e.usage.requestBytes)}),(0,L.jsx)(TF,{label:`response bytes`,value:dL(e.usage.responseBytes)}),(0,L.jsx)(TF,{label:`stream bytes`,value:dL(e.usage.streamBytes)}),(0,L.jsx)(TF,{label:`stream file`,value:`${dL(e.usage.streamFileBytes)}${e.usage.streamFileTruncated?` · truncated`:``}`})]}),n.length>0?(0,L.jsx)(`div`,{className:`grid gap-x-4 gap-y-1 border-t pt-2.5 text-xs sm:grid-cols-2 lg:grid-cols-3`,children:n.map(([e,t])=>(0,L.jsxs)(`div`,{className:`flex min-w-0 justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:e}),(0,L.jsx)(`span`,{className:`min-w-0 truncate text-right font-mono`,title:t,children:t})]},e))}):(0,L.jsx)(`div`,{className:`border-t pt-2.5 text-xs text-muted-foreground`,children:`本条日志未包含 provider usage 字段。`})]})}function mL({label:e,value:t}){return(0,L.jsxs)(`div`,{className:`rounded-md border bg-background px-2.5 py-1.5`,children:[(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e}),(0,L.jsx)(`div`,{className:`mt-0.5 text-sm font-semibold tabular-nums`,children:t})]})}function hL(e,t){return typeof e==`function`?e(t):e}function gL(e,t){return n=>{t.setState(t=>({...t,[e]:hL(n,t[e])}))}}function _L(e){return e instanceof Function}function vL(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function yL(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function Q(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
187
|
-
font-size: .6rem;
|
|
188
|
-
font-weight: bold;
|
|
189
|
-
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function $(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function bL(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:Q(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),$(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function xL(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:Q(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],$(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:Q(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},$(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var SL=`debugHeaders`;function CL(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var wL={createTable:e=>{e.getHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return TL(t,[...a,...s,...o],e)},$(e.options,SL,`getHeaderGroups`)),e.getCenterHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),TL(t,n,e,`center`)),$(e.options,SL,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>TL(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),$(e.options,SL,`getLeftHeaderGroups`)),e.getRightHeaderGroups=Q(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>TL(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),$(e.options,SL,`getRightHeaderGroups`)),e.getFooterGroups=Q(()=>[e.getHeaderGroups()],e=>[...e].reverse(),$(e.options,SL,`getFooterGroups`)),e.getLeftFooterGroups=Q(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),$(e.options,SL,`getLeftFooterGroups`)),e.getCenterFooterGroups=Q(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),$(e.options,SL,`getCenterFooterGroups`)),e.getRightFooterGroups=Q(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),$(e.options,SL,`getRightFooterGroups`)),e.getFlatHeaders=Q(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),$(e.options,SL,`getFlatHeaders`)),e.getLeftFlatHeaders=Q(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),$(e.options,SL,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=Q(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),$(e.options,SL,`getCenterFlatHeaders`)),e.getRightFlatHeaders=Q(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),$(e.options,SL,`getRightFlatHeaders`)),e.getCenterLeafHeaders=Q(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),$(e.options,SL,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=Q(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),$(e.options,SL,`getLeftLeafHeaders`)),e.getRightLeafHeaders=Q(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),$(e.options,SL,`getRightLeafHeaders`)),e.getLeafHeaders=Q(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),$(e.options,SL,`getLeafHeaders`))}};function TL(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=CL(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>CL(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var EL=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>yL(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:Q(()=>[e.getAllLeafColumns()],t=>t.map(t=>bL(e,s,t,t.id)),$(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:Q(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),$(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},DL={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},OL=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};OL.autoRemove=e=>RL(e);var kL=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};kL.autoRemove=e=>RL(e);var AL=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};AL.autoRemove=e=>RL(e);var jL=(e,t,n)=>e.getValue(t)?.includes(n);jL.autoRemove=e=>RL(e);var ML=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});ML.autoRemove=e=>RL(e)||!(e!=null&&e.length);var NL=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));NL.autoRemove=e=>RL(e)||!(e!=null&&e.length);var PL=(e,t,n)=>e.getValue(t)===n;PL.autoRemove=e=>RL(e);var FL=(e,t,n)=>e.getValue(t)==n;FL.autoRemove=e=>RL(e);var IL=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};IL.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},IL.autoRemove=e=>RL(e)||RL(e[0])&&RL(e[1]);var LL={includesString:OL,includesStringSensitive:kL,equalsString:AL,arrIncludes:jL,arrIncludesAll:ML,arrIncludesSome:NL,equals:PL,weakEquals:FL,inNumberRange:IL};function RL(e){return e==null||e===``}var zL={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:gL(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?LL.includesString:typeof n==`number`?LL.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?LL.equals:Array.isArray(n)?LL.arrIncludes:LL.weakEquals},e.getFilterFn=()=>_L(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??LL[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=hL(n,i?i.value:void 0);if(BL(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>hL(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&BL(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function BL(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var VL={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!vL(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},HL={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:gL(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return VL.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return VL.extent},e.getAggregationFn=()=>{if(!e)throw Error();return _L(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??VL[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function UL(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var WL={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:gL(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=Q(e=>[tR(t,e)],t=>t.findIndex(t=>t.id===e.id),$(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>tR(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=tR(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=Q(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return UL(i,t,n)},$(e.options,`debugTable`,`_getOrderColumnsFn`))}},GL=()=>({left:[],right:[]}),KL={getInitialState:e=>({columnPinning:GL(),...e}),getDefaultOptions:e=>({onColumnPinningChange:gL(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},$(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),$(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=Q(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),$(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?GL():e.initialState?.columnPinning??GL()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),$(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),$(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=Q(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},$(e.options,`debugColumns`,`getCenterLeafColumns`))}};function qL(e){return e||(typeof document<`u`?document:null)}var JL={size:150,minSize:20,maxSize:2**53-1},YL=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),XL={getDefaultColumnDef:()=>JL,getInitialState:e=>({columnSizing:{},columnSizingInfo:YL(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:gL(`columnSizing`,e),onColumnSizingInfoChange:gL(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??JL.minSize,n??e.columnDef.size??JL.size),e.columnDef.maxSize??JL.maxSize)},e.getStart=Q(e=>[e,tR(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),$(t.options,`debugColumns`,`getStart`)),e.getAfter=Q(e=>[e,tR(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),$(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),$L(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=$L(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=qL(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=QL()?{passive:!1}:!1;$L(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?YL():e.initialState.columnSizingInfo??YL())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},ZL=null;function QL(){if(typeof ZL==`boolean`)return ZL;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return ZL=e,ZL}function $L(e){return e.type===`touchstart`}var eR={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:gL(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Q(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),$(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=Q(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],$(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>Q(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),$(e.options,`debugColumns`,t));e.getVisibleFlatColumns=t(`getVisibleFlatColumns`,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(`getVisibleLeafColumns`,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(`getLeftVisibleLeafColumns`,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(`getRightVisibleLeafColumns`,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(`getCenterVisibleLeafColumns`,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function tR(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var nR={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},rR={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:gL(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r==`string`||typeof r==`number`}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>LL.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return _L(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??LL[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},iR={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:gL(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.length))},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},aR=0,oR=10,sR=()=>({pageIndex:aR,pageSize:oR}),cR={getInitialState:e=>({...e,pagination:{...sR(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:gL(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>hL(t,e)),e.resetPagination=t=>{e.setPagination(t?sR():e.initialState.pagination??sR())},e.setPageIndex=t=>{e.setPagination(n=>{let r=hL(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?aR:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??aR)},e.resetPageSize=t=>{var n;e.setPageSize(t?oR:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??oR)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,hL(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=hL(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=Q(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},$(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},lR=()=>({top:[],bottom:[]}),uR={getInitialState:e=>({rowPinning:lR(),...e}),getDefaultOptions:e=>({onRowPinningChange:gL(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?lR():e.initialState?.rowPinning??lR()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),$(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),$(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=Q(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},$(e.options,`debugRows`,`getCenterRows`))}},dR={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:gL(`rowSelection`,e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{fR(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?pR(e,n):{rows:[],flatRows:[],rowsById:{}},$(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?pR(e,n):{rows:[],flatRows:[],rowsById:{}},$(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=Q(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?pR(e,n):{rows:[],flatRows:[],rowsById:{}},$(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return fR(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return mR(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return hR(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return hR(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},fR=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>fR(e,t.id,n,r,i))};function pR(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=mR(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function mR(e,t){return t[e.id]??!1}function hR(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(mR(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=hR(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var gR=/([0-9]+)/gm,_R=(e,t,n)=>TR(wR(e.getValue(n)).toLowerCase(),wR(t.getValue(n)).toLowerCase()),vR=(e,t,n)=>TR(wR(e.getValue(n)),wR(t.getValue(n))),yR=(e,t,n)=>CR(wR(e.getValue(n)).toLowerCase(),wR(t.getValue(n)).toLowerCase()),bR=(e,t,n)=>CR(wR(e.getValue(n)),wR(t.getValue(n))),xR=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},SR=(e,t,n)=>CR(e.getValue(n),t.getValue(n));function CR(e,t){return e===t?0:e>t?1:-1}function wR(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function TR(e,t){let n=e.split(gR).filter(Boolean),r=t.split(gR).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var ER={alphanumeric:_R,alphanumericCaseSensitive:vR,text:yR,textCaseSensitive:bR,datetime:xR,basic:SR},DR=[wL,eR,WL,KL,DL,zL,nR,rR,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:gL(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return ER.datetime;if(typeof n==`string`&&(r=!0,n.split(gR).length>1))return ER.alphanumeric}return r?ER.text:ER.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return _L(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??ER[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{e.setSorting(t?[]:e.initialState?.sorting??[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},HL,iR,cR,uR,dR,XL];function OR(e){let t=[...DR,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=i(hL(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:Q(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),$(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:Q(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=xL(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},$(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:Q(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),$(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:Q(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),$(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:Q(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),$(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function kR(){return e=>Q(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=EL(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},$(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function AR(e,t){return e?jR(e)?I.createElement(e,t):e:null}function jR(e){return MR(e)||typeof e==`function`||NR(e)}function MR(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function NR(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function PR(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=I.useState(()=>({current:OR(t)})),[r,i]=I.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),e.onStateChange==null||e.onStateChange(t)}})),n.current}function FR({level:e}){return e===`error`?(0,L.jsx)(J,{variant:`destructive`,children:`error`}):(0,L.jsx)(J,{variant:`outline`,children:`info`})}function IR({statusClass:e}){return e===`2xx`?(0,L.jsx)(J,{variant:`outline`,children:`2xx`}):e===`4xx`?(0,L.jsx)(J,{variant:`secondary`,children:`4xx`}):e===`5xx`?(0,L.jsx)(J,{variant:`destructive`,children:`5xx`}):(0,L.jsx)(J,{variant:`secondary`,children:`network`})}function LR(e){return e==null?`-`:Intl.NumberFormat(void 0,{notation:Math.abs(e)>=1e5?`compact`:`standard`,maximumFractionDigits:1}).format(e)}function RR(e){return e==null?`-`:`${e.toFixed(2).replace(/\.?0+$/,``)}%`}function zR(e){return[[`input`,LR(e.inputTokens)],[`output`,LR(e.outputTokens)],[`total`,LR(e.totalTokens)],[`cache hit rate`,RR(e.cacheHitRate)],[`cache hit input`,LR(e.cacheHitInputTokens)],[`cached input`,LR(e.cachedInputTokens)],[`cache read`,LR(e.cacheReadInputTokens)],[`cache creation`,LR(e.cacheCreationInputTokens)],[`cache creation 5m`,LR(e.cacheCreationInputTokens5m)],[`cache creation 1h`,LR(e.cacheCreationInputTokens1h)],[`cache write`,LR(e.cacheWriteInputTokens)],[`cache miss`,LR(e.cacheMissInputTokens)],[`reasoning`,LR(e.reasoningTokens)],[`audio input`,LR(e.audioInputTokens)],[`audio output`,LR(e.audioOutputTokens)],[`text input`,LR(e.textInputTokens)],[`text output`,LR(e.textOutputTokens)],[`accepted prediction`,LR(e.acceptedPredictionTokens)],[`rejected prediction`,LR(e.rejectedPredictionTokens)],[`tool prompt`,LR(e.toolUsePromptTokens)],[`billable input`,LR(e.billableInputTokens)],[`billable output`,LR(e.billableOutputTokens)],[`credit usage`,LR(e.creditUsage)],[`cost`,LR(e.cost)],[`style`,e.providerStyle],[`source`,e.source],[`path`,e.rawUsagePath??`-`],[`formula`,e.cacheHitRateFormula??`-`]].map(([e,t])=>`${e}: ${t}`).join(`
|
|
190
|
-
`)}function BR({usage:e}){return e?(0,L.jsxs)(`div`,{className:`min-w-[190px] text-xs leading-tight`,title:zR(e),children:[(0,L.jsxs)(`div`,{className:`font-medium tabular-nums`,children:[`in `,LR(e.inputTokens),` · out `,LR(e.outputTokens),` · total`,` `,LR(e.totalTokens)]}),(0,L.jsxs)(`div`,{className:`mt-0.5 text-muted-foreground tabular-nums`,children:[`cache `,RR(e.cacheHitRate),` · hit `,LR(e.cacheHitInputTokens),` · reason `,LR(e.reasoningTokens)]})]}):(0,L.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`-`})}function VR(e,t){return[{accessorKey:`ts`,header:()=>(0,L.jsxs)(K,{variant:`ghost`,size:`sm`,className:`h-7 px-1`,onClick:()=>e(t===`time_desc`?`time_asc`:`time_desc`),children:[`时间`,(0,L.jsx)(fa,{className:`h-3.5 w-3.5`})]}),cell:({row:e})=>{let t=e.original.ts;return(0,L.jsx)(`div`,{className:`text-xs tabular-nums`,children:new Date(t).toLocaleString()})}},{accessorKey:`level`,header:`级别`,cell:({row:e})=>(0,L.jsx)(FR,{level:e.original.level})},{accessorKey:`provider`,header:`Provider`,cell:({row:e})=>(0,L.jsx)(`div`,{className:`max-w-[140px] truncate text-xs`,title:e.original.provider,children:e.original.provider})},{accessorKey:`routeType`,header:`路由`,cell:({row:e})=>(0,L.jsx)(`div`,{className:`max-w-[160px] truncate text-xs`,title:e.original.routeType,children:e.original.routeType})},{accessorKey:`modelIn`,header:`模型链路`,cell:({row:e})=>(0,L.jsxs)(`div`,{className:`max-w-[260px] truncate font-mono text-xs`,title:`${e.original.modelIn} -> ${e.original.modelOut}`,children:[e.original.modelIn,` -> `,e.original.modelOut]})},{accessorKey:`message`,header:`消息`,cell:({row:e})=>(0,L.jsx)(`div`,{className:`max-w-[400px] truncate text-xs`,title:e.original.message,children:e.original.message})},{accessorKey:`latencyMs`,header:`延迟`,cell:({row:e})=>(0,L.jsxs)(`div`,{className:`text-xs tabular-nums`,children:[e.original.latencyMs,` ms`]})},{accessorKey:`tokenUsage`,header:`Usage`,cell:({row:e})=>(0,L.jsx)(BR,{usage:e.original.tokenUsage})},{accessorKey:`statusClass`,header:`状态`,cell:({row:e})=>(0,L.jsx)(IR,{statusClass:e.original.statusClass})},{accessorKey:`userKey`,header:`用户`,cell:({row:e})=>(0,L.jsx)(`div`,{className:`max-w-[180px] truncate font-mono text-xs`,title:e.original.userKey??`-`,children:e.original.userKey??`-`})},{accessorKey:`sessionId`,header:`会话`,cell:({row:e})=>(0,L.jsx)(`div`,{className:`max-w-[220px] truncate font-mono text-xs`,title:e.original.sessionId??`-`,children:e.original.sessionId??`-`})},{accessorKey:`requestId`,header:`Request ID`,cell:({row:e})=>(0,L.jsx)(`div`,{className:`max-w-[220px] truncate font-mono text-xs`,title:e.original.requestId,children:e.original.requestId})}]}var HR=44,UR=560,WR=8;function GR(e){let t=Math.max(0,e.dataLength),n=e.rowHeight??HR,r=e.viewportHeight??UR,i=e.overscanRows??WR,a=Math.ceil(r/n)+i*2,o=Math.max(0,t-a),s=Math.max(0,Math.floor(e.scrollTop/n)-i),c=Math.min(s,o);return{start:c,end:Math.min(t,c+a)}}function KR(e){let{data:t,sort:n,onSortChange:r,onRowClick:i}=e,[a,o]=(0,I.useState)({}),[s,c]=(0,I.useState)(0),l=(0,I.useMemo)(()=>GR({dataLength:t.length,scrollTop:s}),[t.length,s]),u=(0,I.useMemo)(()=>t.slice(l.start,l.end),[t,l.end,l.start]),d=l.start*HR,f=Math.max(0,(t.length-l.end)*HR),p=(0,I.useMemo)(()=>VR(r,n),[r,n]),m=PR({data:u,columns:p,getRowId:e=>e.id,getCoreRowModel:kR(),state:{columnVisibility:a},onColumnVisibilityChange:o});return(0,L.jsx)(`div`,{className:`max-h-[560px] overflow-auto rounded-md border`,onScroll:e=>c(e.currentTarget.scrollTop),children:(0,L.jsxs)(nM,{children:[(0,L.jsx)(rM,{className:`sticky top-0 z-10 bg-background`,children:m.getHeaderGroups().map(e=>(0,L.jsx)(oM,{children:e.headers.map(e=>(0,L.jsx)(sM,{children:e.isPlaceholder?null:AR(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,L.jsx)(iM,{children:t.length?(0,L.jsxs)(L.Fragment,{children:[d>0?(0,L.jsx)(oM,{"aria-hidden":`true`,children:(0,L.jsx)(cM,{colSpan:p.length,className:`p-0`,style:{height:d}})}):null,m.getRowModel().rows.map(e=>(0,L.jsx)(qR,{row:e,onClick:i},e.original.id)),f>0?(0,L.jsx)(oM,{"aria-hidden":`true`,children:(0,L.jsx)(cM,{colSpan:p.length,className:`p-0`,style:{height:f}})}):null]}):(0,L.jsx)(oM,{children:(0,L.jsx)(cM,{colSpan:p.length,className:`h-24 text-center text-sm text-muted-foreground`,children:`暂无日志数据`})})})]})})}function qR({row:e,onClick:t}){return(0,L.jsx)(oM,{className:`cursor-pointer`,style:{height:HR},onClick:()=>t(e.original),children:e.getVisibleCells().map(e=>(0,L.jsx)(cM,{children:AR(e.column.columnDef.cell,e.getContext())},e.id))})}function JR(){if(typeof window>`u`)throw Error(`当前运行环境不支持 WebSocket`);let e=new URL(`/api/logs/events/ws`,window.location.href);return e.protocol=e.protocol===`https:`?`wss:`:`ws:`,e.toString()}function YR(e){return{window:e.window,from:e.from,to:e.to,levels:e.levels,provider:e.provider,routeType:e.routeType,model:e.model,modelIn:e.modelIn,modelOut:e.modelOut,user:e.user,session:e.session,statusClass:e.statusClass,hasError:e.hasError,q:e.q,sort:e.sort}}async function XR(e){return typeof e==`string`?e:e instanceof Blob?e.text():e instanceof ArrayBuffer||ArrayBuffer.isView(e)?new TextDecoder().decode(e):String(e)}var ZR=class{socket=null;subscriptionId=null;closed=!1;bufferedItems=[];flushTimer=null;query;callbacks;constructor(e,t){this.query=e,this.callbacks=t}connect(){if(this.socket)return;if(typeof WebSocket>`u`)throw Error(`当前浏览器不支持 WebSocket`);this.closed=!1,this.callbacks.onStatus?.(`connecting`);let e=new WebSocket(JR());this.socket=e,e.addEventListener(`open`,()=>{e.send(JSON.stringify({type:`subscribe`,requestId:crypto.randomUUID(),query:YR(this.query)}))}),e.addEventListener(`message`,e=>{this.handleMessage(e.data)}),e.addEventListener(`error`,()=>{this.callbacks.onStatus?.(`error`),this.callbacks.onError?.(`实时日志连接失败`)}),e.addEventListener(`close`,()=>{this.flushBufferedItems(),this.socket=null,this.subscriptionId=null;let e=this.closed?`closed`:`connection-closed`;this.callbacks.onClose?.(e)})}close(e=`client-close`){this.closed=!0,this.flushTimer&&=(clearTimeout(this.flushTimer),null),this.flushBufferedItems();let t=this.socket;t&&(t.readyState===WebSocket.OPEN&&this.subscriptionId&&t.send(JSON.stringify({type:`unsubscribe`,subscriptionId:this.subscriptionId})),t.close(1e3,e),this.socket=null,this.subscriptionId=null)}async handleMessage(e){let t;try{t=JSON.parse(await XR(e))}catch{this.callbacks.onError?.(`实时日志消息解析失败`);return}if(t.type===`subscribed`){this.subscriptionId=t.subscriptionId,this.callbacks.onStatus?.(`active`),this.callbacks.onSubscribed?.(t);return}if(t.type===`log.event`){this.bufferedItems.push(t.item),this.scheduleFlush();return}if(t.type===`overflow`){this.callbacks.onOverflow?.(t);return}t.type===`error`&&(this.callbacks.onStatus?.(`error`),this.callbacks.onError?.(t.error))}scheduleFlush(){this.flushTimer||=setTimeout(()=>{this.flushTimer=null,this.flushBufferedItems()},50)}flushBufferedItems(){if(this.bufferedItems.length===0)return;let e=this.bufferedItems.splice(0,this.bufferedItems.length);this.callbacks.onEvents?.(e)}},QR={window:`24h`,from:``,to:``,levels:[],provider:``,routeType:``,modelIn:``,modelOut:``,user:``,session:``,statusClass:[],hasError:`all`,q:``},$R=null,ez=0,tz=null,nz=1e3,rz={enabled:!1,status:`idle`,subscriptionId:null,error:null,received:0,dropped:0};function iz(e={}){return{...rz,...e}}function az(e,t){return{window:e.filters.window,from:e.filters.from||void 0,to:e.filters.to||void 0,levels:e.filters.levels,provider:e.filters.provider||void 0,routeType:e.filters.routeType||void 0,modelIn:e.filters.modelIn||void 0,modelOut:e.filters.modelOut||void 0,user:e.filters.user||void 0,session:e.filters.session||void 0,statusClass:e.filters.statusClass,hasError:e.filters.hasError===`all`?void 0:e.filters.hasError===`true`,q:e.filters.q||void 0,sort:e.sort,limit:50,cursor:t??void 0}}function oz(e,t,n){let r=new Map;for(let t of e)r.set(t.id,t);for(let e of t)r.set(e.id,e);return Array.from(r.values()).sort((e,t)=>{let r=Date.parse(e.ts)-Date.parse(t.ts);return n===`time_asc`?r:-r}).slice(0,nz)}function sz(e){return e instanceof DOMException&&e.name===`AbortError`}function cz(e){let t=tz;tz=null,t?.close(e)}const lz=Ex((e,t)=>({filters:{...QR},sort:`time_desc`,appliedQuery:null,items:[],nextCursor:null,hasMore:!1,stats:null,meta:null,realtime:iz(),loading:!1,loadingMore:!1,error:null,setFilter:(t,n)=>{cz(`filter-changed`),e(e=>({filters:{...e.filters,[t]:n},appliedQuery:null,realtime:iz()}))},setSort:async n=>{t().sort!==n&&(cz(`sort-changed`),e({sort:n,appliedQuery:null,realtime:iz()}),await t().fetchFirstPage())},applyFilters:async()=>{await t().fetchFirstPage()},resetFilters:async()=>{cz(`reset-filters`),e({filters:{...QR},sort:`time_desc`,appliedQuery:null,realtime:iz()}),await t().fetchFirstPage()},fetchFirstPage:async()=>{cz(`query-refresh`),$R?.abort();let n=new AbortController;$R=n;let r=++ez,i=az(t());e({loading:!0,error:null,appliedQuery:null,realtime:iz()});try{let t=await Gx(i,{signal:n.signal});if(r!==ez)return;e({appliedQuery:i,items:t.items,nextCursor:t.nextCursor,hasMore:t.hasMore,stats:t.stats,meta:t.meta,loading:!1,loadingMore:!1})}catch(t){if(sz(t)||r!==ez)return;e({loading:!1,loadingMore:!1,error:t instanceof Error?t.message:`日志查询失败`})}finally{$R===n&&($R=null)}},fetchNextPage:async()=>{let n=t();if(!(!n.nextCursor||n.loadingMore)){e({loadingMore:!0,error:null});try{let r=await Gx(az(n,n.nextCursor)),i=t();e({items:oz(i.items,r.items,i.sort),nextCursor:r.nextCursor,hasMore:r.hasMore,stats:r.stats,meta:r.meta,loadingMore:!1})}catch(t){e({loadingMore:!1,error:t instanceof Error?t.message:`加载更多日志失败`})}}},startRealtime:async()=>{let n=t(),r=n.appliedQuery;if(!r){e({realtime:iz({status:`error`,error:`请先查询后再开启实时推送`})});return}if(n.sort!==`time_desc`){e({realtime:iz({status:`error`,error:`实时推送仅支持按时间倒序展示`})});return}if(r.to){e({realtime:iz({status:`error`,error:`固定结束时间不支持实时推送`})});return}cz(`realtime-restart`),e({realtime:iz({enabled:!0,status:`connecting`})});let i=new ZR(r,{onStatus:t=>{tz===i&&e(e=>({realtime:{...e.realtime,status:t,error:t===`error`?e.realtime.error:null}}))},onSubscribed:t=>{tz===i&&e(e=>({realtime:{...e.realtime,enabled:!0,status:`active`,subscriptionId:t.subscriptionId,error:null}}))},onEvents:e=>{tz===i&&t().receiveRealtimeLogEvents(e)},onOverflow:t=>{tz===i&&e(e=>({realtime:{...e.realtime,dropped:e.realtime.dropped+t.dropped,error:t.message}}))},onError:t=>{tz===i&&(cz(`realtime-error`),e({realtime:iz({status:`error`,error:t})}))},onClose:t=>{tz===i&&(tz=null,e({realtime:iz(t===`connection-closed`?{status:`error`,error:`实时日志连接已断开`}:{})}))}});tz=i;try{i.connect()}catch(t){tz===i&&(tz=null),e({realtime:iz({status:`error`,error:t instanceof Error?t.message:`实时日志连接失败`})})}},stopRealtime:(t=`manual-stop`)=>{cz(t),e({realtime:iz()})},receiveRealtimeLogEvents:t=>{t.length!==0&&e(e=>({items:oz(e.items,t,e.sort),realtime:{...e.realtime,received:e.realtime.received+t.length}}))}}));function uz(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}function dz(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}T${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function fz(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toISOString()}function pz(e){return Intl.NumberFormat(void 0,{notation:Math.abs(e??0)>=1e5?`compact`:`standard`,maximumFractionDigits:1}).format(e??0)}function mz(e){return`${(e??0).toFixed(2).replace(/\.?0+$/,``)}%`}function hz(){let e=hr(),t=mr({from:`/logs`}),[n,r]=(0,I.useState)(!1),i=lz(e=>e.filters),a=lz(e=>e.sort),o=lz(e=>e.appliedQuery),s=lz(e=>e.items),c=lz(e=>e.hasMore),l=lz(e=>e.stats),u=lz(e=>e.meta),d=lz(e=>e.loading),f=lz(e=>e.loadingMore),p=lz(e=>e.error),m=lz(e=>e.realtime),h=lz(e=>e.setFilter),g=lz(e=>e.setSort),_=lz(e=>e.applyFilters),v=lz(e=>e.resetFilters),y=lz(e=>e.fetchNextPage),b=lz(e=>e.startRealtime),x=lz(e=>e.stopRealtime);(0,I.useEffect)(()=>{t.user&&h(`user`,t.user),t.session&&h(`session`,t.session),_()},[_,t.user,t.session,h]),(0,I.useEffect)(()=>()=>x(`page-unmount`),[x]);let S=(0,I.useMemo)(()=>Array.from(new Set(s.map(e=>e.provider))).sort((e,t)=>e.localeCompare(t)),[s]),C=(0,I.useMemo)(()=>Array.from(new Set(s.map(e=>e.routeType))).sort((e,t)=>e.localeCompare(t)),[s]),w=(0,I.useMemo)(()=>Array.from(new Set(s.map(e=>e.modelIn).filter(Boolean))).sort((e,t)=>e.localeCompare(t)),[s]),T=(0,I.useMemo)(()=>Array.from(new Set(s.map(e=>e.modelOut).filter(Boolean))).sort((e,t)=>e.localeCompare(t)),[s]),E=(0,I.useMemo)(()=>{let e=[];return i.from&&e.push(`起始时间`),i.to&&e.push(`结束时间`),i.q&&e.push(`关键词`),i.levels.length>0&&e.push(`级别`),i.provider&&e.push(`Provider`),i.routeType&&e.push(`路由类型`),i.modelIn&&e.push(`原始模型`),i.modelOut&&e.push(`路由模型`),i.hasError!==`all`&&e.push(`是否错误`),i.user&&e.push(`用户标识`),i.statusClass.length>0&&e.push(`状态`),e},[i]),ee=(0,I.useMemo)(()=>u?[typeof u.queryMs==`number`?`查询 ${u.queryMs} ms`:null,u.indexUsed?`SQLite 索引`:`JSONL 回退`,u.fallbackReason].filter(Boolean).join(` · `):null,[u]),D=(0,I.useMemo)(()=>d?`查询中`:o?a===`time_desc`?o.to?`固定结束时间不支持`:null:`按时间倒序时可开启`:`查询后可开启`,[o,d,a]);async function O(e){try{uz(await qx({window:i.window,from:i.from||void 0,to:i.to||void 0,levels:i.levels,provider:i.provider||void 0,routeType:i.routeType||void 0,modelIn:i.modelIn||void 0,modelOut:i.modelOut||void 0,user:i.user||void 0,session:i.session||void 0,statusClass:i.statusClass,hasError:i.hasError===`all`?void 0:i.hasError===`true`,q:i.q||void 0,sort:a},e),`logs-export.${e}`),zi.success(`已导出 ${e.toUpperCase()} 文件`)}catch(e){zi.error(e instanceof Error?e.message:`导出失败`)}}function k(e){if(e){b();return}x(`manual-stop`)}return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`日志检索`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`多条件过滤、详情定位与导出`})]}),(0,L.jsx)(AF,{open:n,onOpenChange:r,className:`rounded-lg border bg-background`,children:(0,L.jsxs)(`div`,{className:`space-y-3 px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-end`,children:[(0,L.jsxs)(`div`,{className:`w-full space-y-1.5 sm:w-48`,children:[(0,L.jsx)(Y,{children:`时间窗口`}),(0,L.jsxs)(Ej,{value:i.window,onValueChange:e=>h(`window`,e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`1h`,children:`最近 1 小时`}),(0,L.jsx)(Mj,{value:`6h`,children:`最近 6 小时`}),(0,L.jsx)(Mj,{value:`24h`,children:`最近 24 小时`})]})]})]}),(0,L.jsxs)(`div`,{className:`w-full space-y-1.5 sm:w-64`,children:[(0,L.jsx)(Y,{htmlFor:`session-id`,children:`会话 ID`}),(0,L.jsx)(_M,{id:`session-id`,className:`h-8`,value:i.session,onChange:e=>h(`session`,e.target.value),placeholder:`sessionId`})]}),(0,L.jsx)(jF,{asChild:!0,children:(0,L.jsxs)(K,{type:`button`,size:`sm`,variant:`outline`,className:`w-full justify-between sm:w-auto`,children:[(0,L.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,L.jsx)(Qa,{className:`h-3.5 w-3.5`}),`高级筛选`,E.length>0?(0,L.jsx)(J,{variant:`secondary`,className:`ml-1`,children:E.length}):null]}),(0,L.jsx)(ga,{className:G(`h-3.5 w-3.5 transition-transform`,n&&`rotate-180`)})]})})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(`div`,{className:`flex h-8 items-center gap-2 rounded-md border px-2`,children:[(0,L.jsx)(Ha,{className:G(`h-3.5 w-3.5`,m.status===`active`?`text-emerald-600`:m.status===`error`?`text-destructive`:`text-muted-foreground`)}),(0,L.jsx)(vM,{id:`logs-realtime`,checked:m.enabled,disabled:!!D,onCheckedChange:k}),(0,L.jsx)(Y,{htmlFor:`logs-realtime`,className:`text-sm`,children:`实时`}),m.status===`active`?(0,L.jsxs)(J,{variant:`outline`,className:`hidden sm:inline-flex`,children:[`+`,m.received]}):null]}),(0,L.jsx)(K,{size:`sm`,onClick:()=>void _(),disabled:d,children:`查询`}),(0,L.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>void v(),disabled:d,children:`重置`}),(0,L.jsxs)(K,{size:`sm`,variant:`outline`,onClick:()=>void O(`csv`),children:[(0,L.jsx)(Sa,{className:`h-3.5 w-3.5`}),`导出 CSV`]}),(0,L.jsxs)(K,{size:`sm`,variant:`outline`,onClick:()=>void O(`json`),children:[(0,L.jsx)(Sa,{className:`h-3.5 w-3.5`}),`导出 JSON`]})]})]}),E.length>0?(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,L.jsx)(`span`,{children:`已启用`}),E.slice(0,6).map(e=>(0,L.jsx)(J,{variant:`outline`,children:e},e)),E.length>6?(0,L.jsxs)(J,{variant:`outline`,children:[`+`,E.length-6]}):null]}):null,(0,L.jsxs)(MF,{className:`space-y-3 border-t pt-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`from`,children:`起始时间`}),(0,L.jsx)(_M,{id:`from`,type:`datetime-local`,className:`h-8`,value:dz(i.from),onChange:e=>h(`from`,fz(e.target.value))})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`to`,children:`结束时间`}),(0,L.jsx)(_M,{id:`to`,type:`datetime-local`,className:`h-8`,value:dz(i.to),onChange:e=>h(`to`,fz(e.target.value))})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5 md:col-span-2`,children:[(0,L.jsx)(Y,{htmlFor:`keyword`,children:`关键词`}),(0,L.jsx)(_M,{id:`keyword`,className:`h-8`,value:i.q,onChange:e=>h(`q`,e.target.value),placeholder:`request id / path / message`})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-6`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`级别`}),(0,L.jsxs)(Ej,{value:i.levels.length===0?`all`:i.levels.join(`,`),onValueChange:e=>h(`levels`,e===`all`?[]:e.split(`,`)),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`all`,children:`全部`}),(0,L.jsx)(Mj,{value:`info`,children:`info`}),(0,L.jsx)(Mj,{value:`error`,children:`error`}),(0,L.jsx)(Mj,{value:`info,error`,children:`info + error`})]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`Provider`}),(0,L.jsxs)(Ej,{value:i.provider||`all`,onValueChange:e=>h(`provider`,e===`all`?``:e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`all`,children:`全部`}),S.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`路由类型`}),(0,L.jsxs)(Ej,{value:i.routeType||`all`,onValueChange:e=>h(`routeType`,e===`all`?``:e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`all`,children:`全部`}),C.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`原始模型`}),(0,L.jsxs)(Ej,{value:i.modelIn||`all`,onValueChange:e=>h(`modelIn`,e===`all`?``:e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`all`,children:`全部`}),w.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`路由模型`}),(0,L.jsxs)(Ej,{value:i.modelOut||`all`,onValueChange:e=>h(`modelOut`,e===`all`?``:e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`all`,children:`全部`}),T.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`是否错误`}),(0,L.jsxs)(Ej,{value:i.hasError,onValueChange:e=>h(`hasError`,e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`all`,children:`全部`}),(0,L.jsx)(Mj,{value:`true`,children:`仅错误`}),(0,L.jsx)(Mj,{value:`false`,children:`仅成功`})]})]})]})]}),(0,L.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`user-key`,children:`用户标识`}),(0,L.jsx)(_M,{id:`user-key`,className:`h-8`,value:i.user,onChange:e=>h(`user`,e.target.value),placeholder:`userKey 或原始 user_id`})]})})]})]})}),(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4 xl:grid-cols-8`,children:[(0,L.jsx)(gz,{title:`总条数`,value:l?.total??0}),(0,L.jsx)(gz,{title:`Total Token`,value:pz(l?.totalTokens)}),(0,L.jsx)(gz,{title:`Input Token`,value:pz(l?.inputTokens)}),(0,L.jsx)(gz,{title:`Output Token`,value:pz(l?.outputTokens)}),(0,L.jsx)(gz,{title:`缓存命中率`,value:mz(l?.cacheHitRate)}),(0,L.jsx)(gz,{title:`缓存命中 Token`,value:pz(l?.cacheHitInputTokens)}),(0,L.jsx)(gz,{title:`错误率`,value:mz(l?.errorRate)}),(0,L.jsx)(gz,{title:`P95`,value:`${l?.p95LatencyMs??0} ms`})]}),(0,L.jsxs)(`div`,{className:`space-y-3`,children:[ee?(0,L.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center justify-end gap-2 text-xs text-muted-foreground`,children:[m.status===`connecting`?(0,L.jsx)(`span`,{children:`实时连接中`}):null,m.error?(0,L.jsx)(`span`,{className:`text-destructive`,children:m.error}):null,!m.enabled&&D?(0,L.jsx)(`span`,{children:D}):null,(0,L.jsx)(`span`,{children:ee})]}):null,p?(0,L.jsx)(Hj,{className:`min-h-[160px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`日志检索失败`}),(0,L.jsx)(qj,{children:p})]})}):d&&s.length===0?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Jj,{className:`h-10 w-full`}),(0,L.jsx)(Jj,{className:`h-10 w-full`}),(0,L.jsx)(Jj,{className:`h-10 w-full`})]}):s.length===0?(0,L.jsx)(Hj,{className:`min-h-[200px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`没有匹配日志`}),(0,L.jsx)(qj,{children:`请调整筛选条件后重试`})]})}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(KR,{data:s,sort:a,onSortChange:e=>void g(e),onRowClick:t=>void e({to:`/logs/$id`,params:{id:t.id}})}),(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,L.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`已加载 `,s.length,` 条`]}),(0,L.jsx)(K,{size:`sm`,variant:`outline`,disabled:!c||f,onClick:()=>void y(),children:f?`加载中...`:c?`加载更多`:`已到底部`})]})]})]})]})}function gz({title:e,value:t}){return(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background px-3 py-3`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`div`,{className:`mt-1 text-lg font-semibold`,children:t})]})}function _z(e){return e.log??{}}function vz(){let e=Qx(e=>e.draft),t=Qx(e=>e.updateDraft);if(!e)return null;let n=e.log,r=n?.enabled!==!1&&n!==void 0;function i(e){t(t=>(t.log=e(_z(t)),t))}return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-6 lg:overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`shrink-0`,children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`日志配置`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`控制请求/响应日志的记录范围与存储策略`})]}),(0,L.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-4`,children:[(0,L.jsx)(`div`,{className:`rounded-lg border bg-background`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`启用日志`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`开启后将记录所有代理请求的元数据`})]}),(0,L.jsx)(vM,{checked:r,onCheckedChange:e=>{e?i(e=>({...e,enabled:!0})):n&&i(e=>({...e,enabled:!1}))}})]})}),n?(0,L.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`通用设置`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`日志目录、Body 记录范围等通用配置`})]}),(0,L.jsxs)(`div`,{className:`space-y-3 px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`Body 记录范围`}),(0,L.jsxs)(Ej,{value:n.bodyPolicy===`masked`?`full`:n.bodyPolicy??`off`,onValueChange:e=>i(t=>({...t,bodyPolicy:e})),children:[(0,L.jsx)(kj,{className:`h-8`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`off`,children:`off — 不记录 body(推荐)`}),(0,L.jsx)(Mj,{value:`full`,children:`full — 记录完整 body(仅调试)`})]})]}),(n.bodyPolicy===`full`||n.bodyPolicy===`masked`)&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`当前会保存完整 body,可能包含敏感信息,建议仅在排障时临时开启。`})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`log-basedir`,children:`日志目录`}),(0,L.jsx)(_M,{id:`log-basedir`,value:n.baseDir??``,onChange:e=>i(t=>({...t,baseDir:e.target.value||void 0})),placeholder:`默认: ~/.local-router/logs/`,className:`h-8`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`留空则使用默认路径`})]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`事件日志`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`按天分片的 JSONL 格式结构化日志`})]}),(0,L.jsx)(`div`,{className:`px-3 py-3`,children:(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`events-retain`,children:`保留天数`}),(0,L.jsx)(_M,{id:`events-retain`,type:`number`,min:1,value:n.events?.retainDays??14,onChange:e=>i(t=>({...t,events:{...t.events,retainDays:Number.parseInt(e.target.value,10)||14}})),className:`h-8`})]})})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsx)(`div`,{className:`border-b px-3 py-3`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`流式日志`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`SSE 原始响应文本`})]}),(0,L.jsx)(vM,{checked:n.streams?.enabled!==!1,onCheckedChange:e=>i(t=>({...t,streams:{...t.streams,enabled:e}}))})]})}),(0,L.jsxs)(`div`,{className:`space-y-3 px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`streams-retain`,children:`保留天数`}),(0,L.jsx)(_M,{id:`streams-retain`,type:`number`,min:1,value:n.streams?.retainDays??7,onChange:e=>i(t=>({...t,streams:{...t.streams,retainDays:Number.parseInt(e.target.value,10)||7}})),className:`h-8`})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`streams-maxbytes`,children:`单请求最大字节数`}),(0,L.jsx)(_M,{id:`streams-maxbytes`,type:`number`,min:1,value:n.streams?.maxBytesPerRequest??10485760,onChange:e=>i(t=>({...t,streams:{...t.streams,maxBytesPerRequest:Number.parseInt(e.target.value,10)||10485760}})),className:`h-8`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`默认 10MB (10485760),超出部分将被截断`})]})]})]})]})]}):(0,L.jsx)(`div`,{className:`rounded-lg border bg-background py-12 text-center text-sm text-muted-foreground`,children:`当前未启用日志配置,请先打开上方开关`})]})]})}function yz({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,L.jsx)(jv,{"data-slot":`separator`,decorative:n,orientation:t,className:G(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function bz({className:e,...t}){return(0,L.jsx)(`textarea`,{"data-slot":`textarea`,className:G(`border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),...t})}function xz({models:e,onChange:t}){let n=Object.entries(e),r=(0,I.useRef)(new Map),i=(0,I.useRef)(0),a=new Set(n.map(([e])=>e));for(let e of r.current.keys())a.has(e)||r.current.delete(e);function o(e){let t=r.current.get(e);if(t)return t;i.current+=1;let n=`model-row-${i.current}`;return r.current.set(e,n),n}function s(){let n=`model-${Date.now()}`;t({...e,[n]:{}})}function c(n){let r={...e};delete r[n],t(r)}function l(n,i){if(i===n)return;let a=r.current.get(n);a&&(r.current.delete(n),r.current.set(i,a));let o={};for(let[t,r]of Object.entries(e))o[t===n?i:t]=r;t(o)}function u(n,r,i){t({...e,[n]:{...e[n],[r]:i}})}return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsx)(Y,{className:`text-sm font-medium`,children:`模型列表`}),(0,L.jsxs)(K,{type:`button`,variant:`outline`,size:`sm`,onClick:s,children:[(0,L.jsx)(Ba,{className:`h-3.5 w-3.5 mr-1`}),`添加模型`]})]}),n.length===0?(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground py-4 text-center`,children:`暂无模型,点击上方按钮添加`}):(0,L.jsx)(`div`,{className:`rounded-md border`,children:(0,L.jsxs)(nM,{children:[(0,L.jsx)(rM,{children:(0,L.jsxs)(oM,{children:[(0,L.jsx)(sM,{children:`模型ID`}),(0,L.jsx)(sM,{className:`w-24 text-center`,children:`图像输入`}),(0,L.jsx)(sM,{className:`w-24 text-center`,children:`推理输出`}),(0,L.jsx)(sM,{className:`w-16`})]})}),(0,L.jsx)(iM,{children:n.map(([e,t])=>(0,L.jsxs)(oM,{children:[(0,L.jsx)(cM,{children:(0,L.jsx)(_M,{value:e,onChange:t=>l(e,t.target.value),className:`h-8 text-sm`})}),(0,L.jsx)(cM,{className:`text-center`,children:(0,L.jsx)(vM,{checked:t[`image-input`]??!1,onCheckedChange:t=>u(e,`image-input`,t)})}),(0,L.jsx)(cM,{className:`text-center`,children:(0,L.jsx)(vM,{checked:t.reasoning??!1,onCheckedChange:t=>u(e,`reasoning`,t)})}),(0,L.jsx)(cM,{children:(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 text-destructive hover:text-destructive`,onClick:()=>c(e),children:(0,L.jsx)(no,{className:`h-3.5 w-3.5`})})})]},o(e)))})]})})]})}var Sz=[{value:`openai-completions`,label:`OpenAI Completions`},{value:`openai-responses`,label:`OpenAI Responses`},{value:`anthropic-messages`,label:`Anthropic Messages`}],Cz={"openai-completions":`/v1/chat/completions`,"openai-responses":`/v1/responses`,"anthropic-messages":`/v1/messages`};function wz({name:e,config:t,isNew:n,onChange:r}){let[i,a]=(0,I.useState)(!1),o=`${t.base.replace(/\/+$/,``)}${Cz[t.type]}`;return(0,L.jsxs)(`div`,{className:`space-y-5`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`provider-name`,children:`Provider 名称`}),(0,L.jsx)(_M,{id:`provider-name`,value:e,disabled:!n,readOnly:!n,className:`font-mono`}),!n&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`名称在创建后不可修改`})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`协议类型`}),(0,L.jsxs)(Ej,{value:t.type,onValueChange:e=>r({...t,type:e}),children:[(0,L.jsx)(kj,{children:(0,L.jsx)(Oj,{})}),(0,L.jsx)(Aj,{children:Sz.map(e=>(0,L.jsx)(Mj,{value:e.value,children:e.label},e.value))})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`provider-base`,children:`Base URL`}),(0,L.jsx)(_M,{id:`provider-base`,value:t.base,onChange:e=>r({...t,base:e.target.value}),placeholder:`https://api.example.com`}),t.base&&(0,L.jsxs)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[`预览 URL: `,(0,L.jsx)(`span`,{className:`font-mono`,children:o})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`provider-proxy`,children:`Proxy URL(可选)`}),(0,L.jsx)(_M,{id:`provider-proxy`,value:t.proxy??``,onChange:e=>r({...t,proxy:e.target.value}),placeholder:`http://127.0.0.1:7890`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`留空表示直连上游;仅此 provider 生效,不读取环境变量代理。`})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`provider-apikey`,children:`API Key`}),(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(_M,{id:`provider-apikey`,type:i?`text`:`password`,value:t.apiKey,onChange:e=>r({...t,apiKey:e.target.value}),className:`pr-10 font-mono`,placeholder:`sk-...`}),(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`absolute right-0 top-0 h-full px-3 hover:bg-transparent`,onClick:()=>a(!i),children:i?(0,L.jsx)(wa,{className:`h-4 w-4`}):(0,L.jsx)(Ta,{className:`h-4 w-4`})})]})]}),(0,L.jsx)(yz,{}),(0,L.jsx)(xz,{models:t.models,onChange:e=>r({...t,models:e})}),(0,L.jsx)(yz,{}),(0,L.jsx)(Dz,{plugins:t.plugins??[],onChange:e=>r({...t,plugins:e.length>0?e:void 0})})]})}var Tz=0;function Ez(){return`plugin-${Date.now()}-${++Tz}`}function Dz({plugins:e,onChange:t}){let[n,r]=(0,I.useState)(()=>e.map(e=>({id:Ez(),config:e}))),i=(0,I.useRef)(e);(0,I.useEffect)(()=>{i.current!==e&&(i.current=e,(e.length!==n.length||e.some((e,t)=>e.package!==n[t]?.config.package||JSON.stringify(e.params)!==JSON.stringify(n[t]?.config.params)))&&r(e.map(e=>({id:Ez(),config:e}))))},[e,n]);function a(e){r(e),t(e.map(e=>e.config))}function o(){a([...n,{id:Ez(),config:{package:``}}])}function s(e){a(n.filter((t,n)=>n!==e))}function c(e,t){let r=[...n];r[e]={...r[e],config:t},a(r)}function l(e){if(e<=0)return;let t=[...n];[t[e-1],t[e]]=[t[e],t[e-1]],a(t)}function u(e){if(e>=n.length-1)return;let t=[...n];[t[e],t[e+1]]=[t[e+1],t[e]],a(t)}return(0,L.jsxs)(`div`,{className:`space-y-3`,children:[(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(Y,{children:`插件列表`}),(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`数组顺序决定洋葱模型层级:请求正序、响应逆序执行`})]}),(0,L.jsxs)(K,{type:`button`,variant:`outline`,size:`sm`,onClick:o,children:[(0,L.jsx)(Ba,{className:`h-3.5 w-3.5 mr-1`}),`添加插件`]})]}),n.length===0&&(0,L.jsx)(`p`,{className:`text-xs text-muted-foreground py-2`,children:`暂无插件配置`}),n.map((e,t)=>(0,L.jsx)(Oz,{plugin:e.config,index:t,total:n.length,onUpdate:e=>c(t,e),onRemove:()=>s(t),onMoveUp:()=>l(t),onMoveDown:()=>u(t)},e.id))]})}function Oz({plugin:e,index:t,total:n,onUpdate:r,onRemove:i,onMoveUp:a,onMoveDown:o}){let[s,c]=(0,I.useState)(e.params?JSON.stringify(e.params,null,2):``),[l,u]=(0,I.useState)(null),d=(0,I.useRef)(e.params);(0,I.useEffect)(()=>{d.current!==e.params&&(d.current=e.params,c(e.params?JSON.stringify(e.params,null,2):``),u(null))},[e.params]);function f(t){if(c(t),!t.trim()){u(null),r({...e,params:void 0});return}try{let n=JSON.parse(t);if(typeof n!=`object`||!n||Array.isArray(n)){u(`params 必须是 JSON 对象`);return}u(null),r({...e,params:n})}catch{u(`JSON 格式不正确`)}}return(0,L.jsxs)(`div`,{className:`rounded-lg border p-3 space-y-2`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(ja,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,L.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[`#`,t+1]}),(0,L.jsx)(_M,{value:e.package,onChange:t=>r({...e,package:t.target.value}),placeholder:`npm-package-name 或 ./local/path.ts`,className:`font-mono text-xs h-8`}),(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0`,onClick:a,disabled:t<=0,children:(0,L.jsx)(va,{className:`h-3.5 w-3.5`})}),(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0`,onClick:o,disabled:t>=n-1,children:(0,L.jsx)(ga,{className:`h-3.5 w-3.5`})}),(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 shrink-0 text-destructive hover:text-destructive`,onClick:i,children:(0,L.jsx)(no,{className:`h-3.5 w-3.5`})})]}),(0,L.jsxs)(`div`,{className:`space-y-1`,children:[(0,L.jsx)(Y,{className:`text-xs`,children:`params (JSON)`}),(0,L.jsx)(bz,{value:s,onChange:e=>f(e.target.value),placeholder:`{ "key": "value" }`,className:`font-mono text-xs min-h-[60px]`,rows:3}),l&&(0,L.jsx)(`p`,{className:`text-xs text-destructive`,children:l})]})]})}function kz({...e}){return(0,L.jsx)(bu,{"data-slot":`alert-dialog`,...e})}function Az({...e}){return(0,L.jsx)(xu,{"data-slot":`alert-dialog-trigger`,...e})}function jz({...e}){return(0,L.jsx)(Su,{"data-slot":`alert-dialog-portal`,...e})}function Mz({className:e,...t}){return(0,L.jsx)(Cu,{"data-slot":`alert-dialog-overlay`,className:G(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50`,e),...t})}function Nz({className:e,size:t=`default`,...n}){return(0,L.jsxs)(jz,{children:[(0,L.jsx)(Mz,{}),(0,L.jsx)(wu,{"data-slot":`alert-dialog-content`,"data-size":t,className:G(`bg-background 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 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg`,e),...n})]})}function Pz({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:G(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Fz({className:e,...t}){return(0,L.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:G(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Iz({className:e,...t}){return(0,L.jsx)(Du,{"data-slot":`alert-dialog-title`,className:G(`text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Lz({className:e,...t}){return(0,L.jsx)(Ou,{"data-slot":`alert-dialog-description`,className:G(`text-muted-foreground text-sm`,e),...t})}function Rz({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,L.jsx)(K,{variant:t,size:n,asChild:!0,children:(0,L.jsx)(Tu,{"data-slot":`alert-dialog-action`,className:G(e),...r})})}function zz({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,L.jsx)(K,{variant:t,size:n,asChild:!0,children:(0,L.jsx)(Eu,{"data-slot":`alert-dialog-cancel`,className:G(e),...r})})}function Bz({...e}){return(0,L.jsx)(rg,{"data-slot":`context-menu`,...e})}function Vz({...e}){return(0,L.jsx)(ig,{"data-slot":`context-menu-trigger`,...e})}function Hz({className:e,...t}){return(0,L.jsx)(ag,{children:(0,L.jsx)(og,{"data-slot":`context-menu-content`,className:G(`bg-popover text-popover-foreground 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 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md`,e),...t})})}function Uz({className:e,inset:t,variant:n=`default`,...r}){return(0,L.jsx)(sg,{"data-slot":`context-menu-item`,"data-inset":t,"data-variant":n,className:G(`focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r})}function Wz({className:e,...t}){return(0,L.jsx)(cg,{"data-slot":`context-menu-separator`,className:G(`bg-border -mx-1 my-1 h-px`,e),...t})}function Gz(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Kz(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function qz(e){return e/100*window.innerHeight}function Jz(e){return e/100*window.innerWidth}function Yz(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Xz({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=Yz(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Kz(t,i);break;case`em`:r=Gz(t,i);break;case`vh`:r=qz(i);break;case`vw`:r=Jz(i);break}return r}function Zz(e){return parseFloat(e.toFixed(3))}function Qz({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function $z(e){let{panels:t}=e,n=Qz({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Zz(Xz({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Zz(Xz({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Zz(Xz({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Zz(Xz({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function eB(e,t=`Assertion error`){if(!e)throw Error(t)}function tB(e,t){return Array.from(t).sort(e===`horizontal`?nB:rB)}function nB(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function rB(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function iB(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function aB(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function oB({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=aB(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return eB(i,`No rect found`),i}var sB;function cB(){return sB===void 0&&(sB=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),sB}function lB(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=tB(n,Array.from(t.children).filter(iB).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.ariaDisabled===null&&(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,oB({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=cB()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Qz({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var uB=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},dB=new Map,fB=new uB;function pB(e){dB=new Map(dB),dB.delete(e)}function mB(e,t){for(let[t]of dB)if(t.id===e)return t}function hB(e,t){for(let[t,n]of dB)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function gB(){return dB}function _B(e,t){return fB.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function vB(e,t){let n=dB.get(e);dB=new Map(dB),dB.set(e,t),fB.emit(`groupChange`,{group:e,prev:n,next:t})}function yB(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=aB(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function bB(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function xB(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:DB(e),b:DB(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();eB(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:EB(TB(n.a)),b:EB(TB(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var SB=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function CB(e){let t=getComputedStyle(OB(e)??e).display;return t===`flex`||t===`inline-flex`}function wB(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||CB(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`||SB.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function TB(e){let t=e.length;for(;t--;){let n=e[t];if(eB(n,`Missing node`),wB(n))return n}return null}function EB(e){return e&&Number(getComputedStyle(e).zIndex)||0}function DB(e){let t=[];for(;e;)t.push(e),e=OB(e);return t}function OB(e){let{parentNode:t}=e;return bB(t)?t.host:t}function kB(e,t){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 AB({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!iB(n)||n.contains(e)||e.contains(n))return!0;if(xB(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(kB(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function jB(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=lB(r),a=yB(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&AB({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function MB(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 NB(e,t,n=0){return Math.abs(Zz(e)-Zz(t))<=n}function PB(e,t){return NB(e,t)?0:e>t?1:-1}function FB({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(PB(r,c)<0)if(a){let e=(i+c)/2;r=PB(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Zz(r),r}function IB({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(NB(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;eB(u!=null,`Invalid first pivot index`),eB(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];eB(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(eB(n!=null,`Previous layout not found for panel index ${t}`),NB(n,i)){let t=o-n;PB(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];eB(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(eB(n!=null,`Previous layout not found for panel index ${t}`),NB(n,o)){let t=n-i;PB(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];eB(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&PB(i,c)<0)if(e>0){let t=c-o,n=t/2;PB(i+e,c)<0&&(e=PB(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;PB(i-e,c)<0&&(e=PB(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];eB(e!=null,`Previous layout not found for panel index ${r}`);let a=FB({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];eB(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=FB({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!NB(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(MB(c,l))return i;{let t=e<0?d:u,r=s[t];eB(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=FB({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!NB(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];eB(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=FB({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(NB(i,s)||(t-=s-i,l[r]=s),NB(t,0))break;e>0?r--:r++}}}if(!NB(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function LB(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||PB(e[n],t[n])!==0)return!1;return!0}function RB({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!NB(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];eB(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];eB(i!=null,`No layout data found for index ${e}`);let o=r[e];eB(o!=null,`No layout data found for index ${e}`);let s=FB({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!NB(a,0))for(let e=0;e<t.length;e++){let n=r[e];eB(n!=null,`No layout data found for index ${e}`);let i=n+a,o=FB({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,NB(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function zB({groupId:e,panelId:t}){let n=()=>{let t=gB();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=RB({layout:IB({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});LB(l,p)||vB(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&NB(t,n)},resize:e=>{if(a()!==e){let t;switch(typeof e){case`number`:{let{group:r}=n();t=Zz(e/Qz({group:r})*100);break}case`string`:t=parseFloat(e);break}o(t)}}}}function BB(e){e.defaultPrevented||jB(e,gB()).forEach(t=>{if(t.separator){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=zB({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function VB(e){let t=gB();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function HB({groupId:e}){let t=()=>{let t=gB();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=RB({layout:e,panelConstraints:r});return n?o:(LB(o,c)||vB(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function UB(e,t){let n=VB(e),r=hB(n.id,!0),i=n.separators.find(t=>t.element===e);eB(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);eB(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=HB({groupId:n.id}).getLayout(),c=RB({layout:IB({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});LB(s,c)||vB(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function WB(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=VB(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&UB(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&UB(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&UB(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&UB(t,-5);break;case`End`:e.preventDefault(),UB(t,100);break;case`Enter`:{e.preventDefault();let n=VB(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=hB(n.id,!0),o=n.separators.find(e=>e.element===t);eB(o,`Matching separator not found`);let s=a.get(o);eB(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(eB(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];UB(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=VB(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);eB(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus();break}case`Home`:e.preventDefault(),UB(t,-100);break}}var GB={cursorFlags:0,state:`inactive`},KB=new uB;function qB(){return GB}function JB(e){return KB.addListener(`change`,e)}function YB(e){let t=GB,n={...GB};n.cursorFlags=e,GB=n,KB.emit(`change`,{prev:t,next:n})}function XB(e){let t=GB;GB=e,KB.emit(`change`,{prev:t,next:e})}function ZB(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=gB(),n=jB(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus()));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),XB({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var QB=e=>e,$B=()=>{},eV=1,tV=2,nV=4,rV=8,iV=3,aV=12,oV;function sV(){return oV===void 0&&(oV=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(oV=!0)),oV}function cV({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&sV()){let t=(e&eV)!==0,n=(e&tV)!==0,r=(e&nV)!==0,i=(e&rV)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return sV()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var lV=new WeakMap;function uV(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=lV.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=qB();switch(r.state){case`active`:case`hover`:{let e=cV({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}lV.set(e,{prevStyle:t,styleSheet:n})}function dV({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=IB({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(LB(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?eV:tV;break;case`vertical`:s|=d<0?nV:rV;break}}else vB(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&iV:c|=s&iV,t.movementY===0?c|=o&aV:c|=s&aV,YB(c),uV(e)}function fV(e){let t=gB(),n=qB();switch(n.state){case`active`:dV({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function pV(e){if(e.defaultPrevented)return;let t=qB(),n=gB();switch(t.state){case`active`:if(e.buttons===0){XB({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=hB(e.group.id,!0);vB(e.group,t)});return}dV({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=jB(e,n);r.length===0?t.state!==`inactive`&&XB({cursorFlags:0,state:`inactive`}):XB({cursorFlags:0,hitRegions:r,state:`hover`}),uV(e.currentTarget);break}}}function mV(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(qB().state){case`hover`:XB({cursorFlags:0,state:`inactive`})}}function hV(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=qB();switch(t.state){case`active`:XB({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(uV(e.currentTarget),t.hitRegions.forEach(e=>{let t=hB(e.group.id,!0);vB(e.group,t)}),e.preventDefault())}}function gV(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Zz(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Zz((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function _V(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Qz({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Zz(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function vV(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function yV({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Zz(e/100*n/t*100);s.set(l.id,r),i+=r;break}case`preserve-relative-size`:default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Zz((r[e]??0)/a*l);else{let e=Zz(l/c.length);for(let t of c)u[t]=e}return u}function bV(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var xV=new Map;function SV(e){let t=!0;eB(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Qz({group:e});if(t===0)return;let n=hB(e.id);if(!n)return;let r=$z(e),i=n.defaultLayoutDeferred?gV(r):n.layout,a=RB({layout:yV({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&LB(n.layout,a)&&vV(n.derivedPanelConstraints,r)&&n.groupSize===t)return;vB(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else _V(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{eB(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Qz({group:e}),s=$z(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(bV(e.panels,l)||(l=void 0));let u=RB({layout:e.mutableState.layouts[c]??l??gV(s),panelConstraints:s}),d=e.element.ownerDocument;xV.set(d,(xV.get(d)??0)+1);let f=new Map;return lB(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),vB(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{eB(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,WB)}),xV.get(d)===1&&(d.addEventListener(`dblclick`,BB,!0),d.addEventListener(`pointerdown`,ZB,!0),d.addEventListener(`pointerleave`,fV),d.addEventListener(`pointermove`,pV),d.addEventListener(`pointerout`,mV),d.addEventListener(`pointerup`,hV,!0)),function(){t=!1,xV.set(d,Math.max(0,(xV.get(d)??0)-1)),pB(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,WB)}),xV.get(d)||(d.removeEventListener(`dblclick`,BB,!0),d.removeEventListener(`pointerdown`,ZB,!0),d.removeEventListener(`pointerleave`,fV),d.removeEventListener(`pointermove`,pV),d.removeEventListener(`pointerout`,mV),d.removeEventListener(`pointerup`,hV,!0)),a.disconnect()}}function CV(){let[e,t]=(0,I.useState)({});return[e,(0,I.useCallback)(()=>t({}),[])]}function wV(e){let t=(0,I.useId)();return`${e??t}`}var TV=typeof window<`u`?I.useLayoutEffect:I.useEffect;function EV(e){let t=(0,I.useRef)(e);return TV(()=>{t.current=e},[e]),(0,I.useCallback)((...e)=>t.current?.(...e),[t])}function DV(...e){return EV(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function OV(e){let t=(0,I.useRef)({...e});return TV(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var kV=(0,I.createContext)(null);function AV(e,t){let n=(0,I.useRef)({getLayout:()=>({}),setLayout:QB});(0,I.useImperativeHandle)(t,()=>n.current,[]),TV(()=>{Object.assign(n.current,HB({groupId:e}))})}function jV({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,I.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=EV(e=>{LB(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=EV(e=>{LB(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=wV(s),v=(0,I.useRef)(null),[y,b]=CV(),x=(0,I.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=DV(v,a);AV(_,o);let C=EV((e,t)=>{let r=qB(),i=mB(e),a=hB(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}return{flexGrow:n?.[t]??1}}),w=OV({defaultLayout:n,disableCursor:r}),T=(0,I.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=tB(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=tB(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},togglePanelDisabled:(e,t)=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=mB(_),i=hB(_);r&&i&&vB(r,{...i,derivedPanelConstraints:$z(r)})},toggleSeparatorDisabled:(e,t)=>{let n=x.current.separators.find(t=>t.id===e);n&&(n.disabled=t)}}),[C,_,b,u,w]),E=(0,I.useRef)(null);return TV(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=SV(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=hB(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=_B(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=NB(t.collapsedSize,i[t.panelId]),a=NB(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=qB().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,I.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,L.jsx)(kV.Provider,{value:T,children:(0,L.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}jV.displayName=`Group`;function MV(){let e=(0,I.useContext)(kV);return eB(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function NV(e,t){let{id:n}=MV(),r=(0,I.useRef)({collapse:$B,expand:$B,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:$B});(0,I.useImperativeHandle)(t,()=>r.current,[]),TV(()=>{Object.assign(r.current,zB({groupId:n,panelId:e}))})}function PV({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=wV(c),_=OV({disabled:a}),v=(0,I.useRef)(null),y=DV(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,togglePanelDisabled:w}=MV(),T=d!==null,E=EV((e,t,n)=>{d?.(e,c,n)});TV(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,I.useEffect)(()=>{w(g,!!a)},[a,g,w]),NV(g,f);let ee=(0,I.useSyncExternalStore)(e=>_B(x,e),()=>JSON.stringify(b(x,g)),()=>JSON.stringify(b(x,g)));return(0,L.jsx)(`div`,{...m,"aria-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...FV,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...JSON.parse(ee)},children:(0,L.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}PV.displayName=`Panel`;var FV={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function IV({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=RB({layout:IB({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=RB({layout:IB({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function LV({children:e,className:t,disabled:n,elementRef:r,id:i,style:a,...o}){let s=wV(i),c=OV({disabled:n}),[l,u]=(0,I.useState)({}),[d,f]=(0,I.useState)(`inactive`),p=(0,I.useRef)(null),m=DV(p,r),{disableCursor:h,id:g,orientation:_,registerSeparator:v,toggleSeparatorDisabled:y}=MV(),b=_===`horizontal`?`vertical`:`horizontal`;TV(()=>{let e=p.current;if(e!==null){let t={disabled:c.disabled,element:e,id:s},n=v(t),r=JB(e=>{f(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=_B(g,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);u(IV({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[g,s,v,c]),(0,I.useEffect)(()=>{y(s,!!n)},[n,s,y]);let x;return n&&!h&&(x=`not-allowed`),(0,L.jsx)(`div`,{...o,"aria-controls":l.valueControls,"aria-disabled":n||void 0,"aria-orientation":b,"aria-valuemax":l.valueMax,"aria-valuemin":l.valueMin,"aria-valuenow":l.valueNow,children:e,className:t,"data-separator":n?`disabled`:d,"data-testid":s,id:s,ref:m,role:`separator`,style:{flexBasis:`auto`,cursor:x,...a,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}LV.displayName=`Separator`;function RV({className:e,...t}){return(0,L.jsx)(jV,{"data-slot":`resizable-panel-group`,className:G(`flex h-full w-full aria-[orientation=vertical]:flex-col`,e),...t})}function zV({...e}){return(0,L.jsx)(PV,{"data-slot":`resizable-panel`,...e})}function BV({withHandle:e,className:t,...n}){return(0,L.jsx)(LV,{"data-slot":`resizable-handle`,className:G(`bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,t),...n,children:e&&(0,L.jsx)(`div`,{className:`bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border`,children:(0,L.jsx)(ja,{className:`size-2.5`})})})}var VV={type:`openai-completions`,base:``,apiKey:``,proxy:``,models:{}};function HV(e,t,n,r){let i=Object.keys(e);if(t===n)return e;let a=i.filter(e=>e!==t),o=a.indexOf(n);if(o===-1)return e;r===`after`&&(o+=1),a.splice(o,0,t);let s={};for(let t of a)s[t]=e[t];return s}function UV(e,t,n){let r=Object.keys(e),i=r.indexOf(t);if(i===-1)return e;let a=Math.max(0,Math.min(n,r.length-1));if(a===i)return e;let o=[...r];o.splice(i,1),o.splice(a,0,t);let s={};for(let t of o)s[t]=e[t];return s}function WV(){let e=Qx(e=>e.draft),t=Qx(e=>e.updateDraft),n=e?.providers??{},r=Object.keys(n),[i,a]=(0,I.useState)(r[0]??null),[o,s]=(0,I.useState)(``),[c,l]=(0,I.useState)(!1),[u,d]=(0,I.useState)(!1),[f,p]=(0,I.useState)(``),[m,h]=(0,I.useState)(null),[g,_]=(0,I.useState)(null),[v,y]=(0,I.useState)(null),[b,x]=(0,I.useState)(null);if(!e)return null;function S(){let e=o.trim().toLowerCase().replace(/[^a-z0-9-]/g,`-`);!e||n[e]||(t(t=>(t.providers[e]={...VV},t)),a(e),s(``),l(!1))}function C(e,n){t(t=>(t.providers[e]=n,t))}function w(e){t(t=>(delete t.providers[e],t)),a(r.find(t=>t!==e)??null),_(null)}function T(e){h(e),d(!0)}function E(){if(!m||!n[m])return;let e=f.trim().toLowerCase().replace(/[^a-z0-9-]/g,`-`);!e||n[e]||(t(t=>(t.providers[e]=structuredClone(t.providers[m]),t)),a(e),p(``),h(null),d(!1))}function ee(e,n){t(t=>(t.providers=UV(t.providers,e,n),t))}function D(e){let t=e.currentTarget.getBoundingClientRect();return e.clientY-t.top<t.height/2?`before`:`after`}function O(e,t){e.dataTransfer.effectAllowed=`move`,e.dataTransfer.setData(`text/plain`,t),y(t),x(null)}function k(e,t){v&&(e.preventDefault(),e.dataTransfer.dropEffect=`move`,x({name:t,position:D(e)}))}function te(){y(null),x(null)}function A(e,n){if(!v)return;e.preventDefault();let r=D(e);t(e=>(e.providers=HV(e.providers,v,n,r),e)),te()}return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-6 lg:overflow-hidden`,children:[(0,L.jsxs)(`div`,{className:`shrink-0`,children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`Providers`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`管理上游 API 服务商配置`})]}),(0,L.jsxs)(RV,{orientation:`horizontal`,className:`min-h-0 flex-1`,children:[(0,L.jsx)(zV,{defaultSize:`280px`,minSize:`180px`,maxSize:`50%`,className:`min-w-0`,children:(0,L.jsxs)(`div`,{className:`flex h-full min-w-0 min-h-0 flex-col gap-3 overflow-hidden`,children:[(0,L.jsx)(pk,{className:`min-h-0 min-w-0 flex-1 **:data-[slot=scroll-area-viewport]:min-w-0 **:data-[slot=scroll-area-viewport]:overflow-x-hidden [&_[data-slot=scroll-area-viewport]>div]:block! [&_[data-slot=scroll-area-viewport]>div]:min-w-0 [&_[data-slot=scroll-area-viewport]>div]:w-full`,children:(0,L.jsx)(`div`,{className:`w-full min-w-0 space-y-2 pr-2`,children:r.map(e=>{let t=n[e],o=Object.keys(t.models).length,s=b?.name===e&&b.position===`before`&&v!==e,c=b?.name===e&&b.position===`after`&&v!==e;return(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(`div`,{className:G(`pointer-events-none absolute inset-x-2 z-10 h-0.5 rounded-full bg-primary transition-opacity`,s?`top-0 opacity-100`:`top-0 opacity-0`)}),(0,L.jsxs)(Bz,{children:[(0,L.jsx)(Vz,{asChild:!0,children:(0,L.jsxs)(`button`,{type:`button`,draggable:!0,className:G(`w-full min-w-0 cursor-pointer overflow-hidden rounded-lg border p-3 text-left transition-colors hover:bg-accent`,i===e?`border-primary bg-accent`:`border-border`,v===e&&`opacity-60`),onClick:()=>a(e),onContextMenu:()=>a(e),onDragStart:t=>O(t,e),onDragOver:t=>k(t,e),onDrop:t=>A(t,e),onDragEnd:te,children:[(0,L.jsxs)(`div`,{className:`flex w-full min-w-0 items-center gap-2`,children:[(0,L.jsx)(ja,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,L.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-medium text-sm`,children:e})]}),(0,L.jsxs)(`div`,{className:`mt-1.5 flex w-full min-w-0 items-center gap-2`,children:[(0,L.jsx)(J,{variant:`outline`,className:`min-w-0 max-w-full overflow-hidden text-xs`,children:(0,L.jsx)(`span`,{className:`block min-w-0 truncate`,children:t.type})}),(0,L.jsxs)(`span`,{className:`shrink-0 whitespace-nowrap text-xs text-muted-foreground`,children:[o,` 个模型`]})]})]})}),(0,L.jsxs)(Hz,{className:`w-48`,children:[(0,L.jsxs)(Uz,{onSelect:()=>T(e),children:[(0,L.jsx)(xa,{className:`h-4 w-4`}),`复制`]}),(0,L.jsxs)(Uz,{onSelect:()=>_(e),variant:`destructive`,children:[(0,L.jsx)(no,{className:`h-4 w-4`}),`删除`]}),(0,L.jsx)(Wz,{}),(0,L.jsxs)(Uz,{onSelect:()=>ee(e,r.indexOf(e)-1),disabled:r.indexOf(e)<=0,children:[(0,L.jsx)(va,{className:`h-4 w-4`}),`上移`]}),(0,L.jsxs)(Uz,{onSelect:()=>ee(e,r.indexOf(e)+1),disabled:r.indexOf(e)>=r.length-1,children:[(0,L.jsx)(ga,{className:`h-4 w-4`}),`下移`]}),(0,L.jsxs)(Uz,{onSelect:()=>ee(e,0),disabled:r.indexOf(e)<=0,children:[(0,L.jsx)(va,{className:`h-4 w-4`}),`上移至顶部`]}),(0,L.jsxs)(Uz,{onSelect:()=>ee(e,r.length-1),disabled:r.indexOf(e)>=r.length-1,children:[(0,L.jsx)(ga,{className:`h-4 w-4`}),`下移至底部`]})]})]}),(0,L.jsx)(`div`,{className:G(`pointer-events-none absolute inset-x-2 bottom-0 z-10 h-0.5 rounded-full bg-primary transition-opacity`,c?`opacity-100`:`opacity-0`)})]},e)})})}),(0,L.jsx)(`div`,{className:`shrink-0 pr-2`,children:(0,L.jsxs)(ik,{open:c,onOpenChange:l,children:[(0,L.jsx)(ak,{asChild:!0,children:(0,L.jsxs)(K,{variant:`outline`,className:`w-full`,children:[(0,L.jsx)(Ba,{className:`h-4 w-4 mr-1`}),`添加 Provider`]})}),(0,L.jsxs)(ck,{children:[(0,L.jsxs)(lk,{children:[(0,L.jsx)(dk,{children:`添加 Provider`}),(0,L.jsx)(fk,{children:`输入新 Provider 的名称(kebab-case 格式)`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Y,{htmlFor:`new-provider-name`,children:`名称`}),(0,L.jsx)(_M,{id:`new-provider-name`,value:o,onChange:e=>s(e.target.value),placeholder:`my-provider`,className:`font-mono`,onKeyDown:e=>e.key===`Enter`&&S()})]}),(0,L.jsx)(uk,{children:(0,L.jsx)(K,{onClick:S,disabled:!o.trim(),children:`创建`})})]})]})})]})}),(0,L.jsx)(BV,{withHandle:!0,className:`bg-transparent transition-colors duration-200 hover:bg-border focus-visible:bg-border active:bg-border [&>div]:opacity-0 [&>div]:transition-opacity [&>div]:duration-200 hover:[&>div]:opacity-100 focus-visible:[&>div]:opacity-100 active:[&>div]:opacity-100`}),(0,L.jsx)(zV,{minSize:`400px`,children:(0,L.jsx)(`div`,{className:`flex h-full flex-col min-h-0 pl-2 pb-3 lg:pb-0`,children:(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background flex flex-col min-h-0 h-full`,children:[(0,L.jsx)(`div`,{className:`border-b px-3 py-3 shrink-0`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between gap-2 min-w-0`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold truncate`,children:i?`${i}`:`选择一个 Provider`}),i&&n[i]&&(0,L.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,L.jsxs)(ik,{open:u,onOpenChange:e=>{d(e),e||(p(``),h(null))},children:[(0,L.jsx)(ak,{asChild:!0,children:(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8`,"aria-label":`复制此 Provider`,onClick:()=>i&&T(i),children:(0,L.jsx)(xa,{className:`h-4 w-4`})})}),(0,L.jsxs)(ck,{children:[(0,L.jsxs)(lk,{children:[(0,L.jsx)(dk,{children:`复制 Provider`}),(0,L.jsx)(fk,{children:`输入新 Provider 的名称(kebab-case 格式)`})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Y,{htmlFor:`copy-provider-name`,children:`名称`}),(0,L.jsx)(_M,{id:`copy-provider-name`,value:f,onChange:e=>p(e.target.value),placeholder:`my-provider-copy`,className:`font-mono`,onKeyDown:e=>e.key===`Enter`&&E()})]}),(0,L.jsx)(uk,{children:(0,L.jsx)(K,{onClick:E,disabled:!f.trim(),children:`复制`})})]})]}),(0,L.jsxs)(kz,{open:g!==null,onOpenChange:e=>{e||_(null)},children:[(0,L.jsx)(Az,{asChild:!0,children:(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-8 w-8 text-destructive hover:text-destructive`,"aria-label":`删除此 Provider`,onClick:()=>i&&_(i),children:(0,L.jsx)(no,{className:`h-4 w-4`})})}),(0,L.jsxs)(Nz,{children:[(0,L.jsxs)(Pz,{children:[(0,L.jsx)(Iz,{children:`确认删除`}),(0,L.jsxs)(Lz,{children:[`确定要删除 Provider「`,g,`」吗?引用此 Provider 的路由规则将失效。`]})]}),(0,L.jsxs)(Fz,{children:[(0,L.jsx)(zz,{children:`取消`}),(0,L.jsx)(Rz,{onClick:()=>g&&w(g),children:`删除`})]})]})]})]})]})}),(0,L.jsx)(pk,{className:`min-h-0 flex-1`,children:(0,L.jsx)(`div`,{className:`px-3 py-3`,children:i&&n[i]?(0,L.jsx)(wz,{name:i,config:n[i],isNew:!1,onChange:e=>C(i,e)},i):(0,L.jsx)(`p`,{className:`text-muted-foreground text-sm py-8 text-center`,children:r.length===0?`暂无 Provider,点击左侧「添加 Provider」按钮创建`:`请从左侧列表中选择一个 Provider`})})})]})})})]})]})}var GV={"openai-completions":`OpenAI Completions`,"openai-responses":`OpenAI Responses`,"anthropic-messages":`Anthropic Messages`};function KV({modelMap:e,providers:t,onChange:n}){let r=Object.entries(e),i=r.filter(([e])=>e!==`*`),a=r.find(([e])=>e===`*`);function o(t){if(t===`*`)return;let r={...e};delete r[t],n(r)}function s(t,r){if(r===t)return;let i={};for(let[n,a]of Object.entries(e))i[n===t?r:n]=a;n(i)}function c(t,r,i){n({...e,[t]:{...e[t],[r]:i}})}function l(e){let n=t[e];return n?Object.keys(n.models):[]}return(0,L.jsxs)(`div`,{className:`relative space-y-3`,children:[(0,L.jsx)(`div`,{className:`absolute left-0 top-0 bottom-6 w-px bg-border`}),(0,L.jsxs)(`div`,{className:`ml-5 flex items-center gap-1.5 px-2 text-xs font-medium text-muted-foreground translate-x-[-0.5px] translate-y-[-1px]`,children:[(0,L.jsx)(`span`,{className:`w-[200px] min-w-[120px]`,children:`请求模型`}),(0,L.jsx)(`span`,{className:`w-5 shrink-0`}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1`,children:`路由目标`}),(0,L.jsx)(`span`,{className:`w-8 shrink-0`})]}),i.length>0&&(0,L.jsx)(`div`,{className:`space-y-1.5 translate-x-[-0.5px] translate-y-[-1px]`,children:i.map(([e,n])=>(0,L.jsxs)(`div`,{className:`relative pl-5`,children:[(0,L.jsx)(qV,{}),(0,L.jsx)(JV,{ruleKey:e,target:n,isWildcard:!1,providers:t,getModelsForProvider:l,onKeyCommit:t=>s(e,t),onTargetChange:(t,n)=>c(e,t,n),onRemove:()=>o(e)})]},e))}),a&&i.length>0&&(0,L.jsxs)(`div`,{className:`relative ml-5 translate-x-[-0.5px] translate-y-[-1px]`,children:[(0,L.jsx)(`div`,{className:`absolute inset-0 flex items-center`,children:(0,L.jsx)(`div`,{className:`w-full border-t border-dashed`})}),(0,L.jsx)(`div`,{className:`relative flex justify-center`,children:(0,L.jsx)(`span`,{className:`bg-background px-2 text-[11px] text-muted-foreground`,children:`兜底规则 — 未匹配的请求将路由至此`})})]}),a&&(0,L.jsxs)(`div`,{className:`relative pl-5 translate-x-[-0.5px] translate-y-[-1px]`,children:[(0,L.jsx)(qV,{}),(0,L.jsx)(JV,{ruleKey:a[0],target:a[1],isWildcard:!0,providers:t,getModelsForProvider:l,onKeyCommit:()=>{},onTargetChange:(e,t)=>c(`*`,e,t),onRemove:()=>{}})]})]})}function qV(){return(0,L.jsx)(`svg`,{className:`pointer-events-none absolute left-0 top-1/2 -translate-y-1/2 text-border`,width:`20`,height:`20`,viewBox:`0 0 20 20`,fill:`none`,"aria-hidden":`true`,children:(0,L.jsx)(`path`,{d:`M1 0A10 10 0 0 0 11 10H20`,className:`stroke-current`,strokeWidth:`1`,strokeLinecap:`round`})})}function JV({ruleKey:e,target:t,isWildcard:n,providers:r,getModelsForProvider:i,onKeyCommit:a,onTargetChange:o,onRemove:s}){let[c,l]=(0,I.useState)(e);(0,I.useEffect)(()=>{l(e)},[e]);function u(){c!==e&&a(c)}let d=i(t.provider),f=Object.entries(r).reduce((e,[t,n])=>(e[n.type].push(t),e),{"openai-completions":[],"openai-responses":[],"anthropic-messages":[]});return(0,L.jsxs)(`div`,{className:n?`grid grid-cols-[minmax(120px,200px)_20px_1fr_32px] items-center gap-x-1.5 rounded-lg border border-dashed bg-muted/30 p-2 transition-colors`:`grid grid-cols-[minmax(120px,200px)_20px_1fr_32px] items-center gap-x-1.5 rounded-lg border border-solid bg-background p-2 transition-colors`,children:[n?(0,L.jsxs)(`div`,{className:`flex w-full items-center gap-1.5 px-1`,children:[(0,L.jsx)(J,{variant:`secondary`,className:`text-xs font-mono`,children:`*`}),(0,L.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`所有`})]}):(0,L.jsx)(_M,{value:c,onChange:e=>l(e.target.value),onBlur:u,onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},className:`h-7 text-sm font-mono`}),(0,L.jsx)(da,{className:`h-3.5 w-3.5 text-muted-foreground mx-auto`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,L.jsxs)(Ej,{value:t.provider,onValueChange:e=>o(`provider`,e),children:[(0,L.jsx)(kj,{className:`h-7 text-sm w-[320px] shrink-0`,children:(0,L.jsx)(Oj,{placeholder:`Provider`})}),(0,L.jsx)(Aj,{children:Object.keys(GV).map(e=>{let t=f[e];return t.length===0?null:(0,L.jsxs)(Dj,{children:[(0,L.jsx)(jj,{children:GV[e]}),t.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))]},e)})})]}),(0,L.jsx)(`span`,{className:`text-muted-foreground text-xs shrink-0`,children:`/`}),d.length>0?(0,L.jsxs)(Ej,{value:t.model,onValueChange:e=>o(`model`,e),children:[(0,L.jsx)(kj,{className:`h-7 text-sm flex-1 min-w-0`,children:(0,L.jsx)(Oj,{placeholder:`模型`})}),(0,L.jsx)(Aj,{children:d.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))})]}):(0,L.jsx)(_M,{value:t.model,onChange:e=>o(`model`,e.target.value),className:`h-7 text-sm font-mono flex-1 min-w-0`,placeholder:`模型名称`})]}),(0,L.jsx)(K,{type:`button`,variant:`ghost`,size:`icon`,className:`h-7 w-7 text-destructive hover:text-destructive`,disabled:n,onClick:s,children:(0,L.jsx)(no,{className:`h-3 w-3`})})]})}var YV=[`openai-completions`,`openai-responses`,`anthropic-messages`];function XV(){let e=Qx(e=>e.draft),t=Qx(e=>e.updateDraft),n=Object.keys(e?.routes??{}),[r,i]=(0,I.useState)(``),a=YV.filter(e=>!n.includes(e));if(!e)return null;let o=e;function s(){if(!r)return;let e=Object.keys(o.providers)[0]??``,n=e?Object.keys(o.providers[e]?.models??{})[0]??``:``;t(t=>(t.routes[r]={"*":{provider:e,model:n}},t)),i(``)}function c(e){t(t=>(delete t.routes[e],t))}function l(e,n){t(t=>(t.routes[e]=n,t))}function u(e){let n=Object.keys(o.providers)[0]??``,r=n?Object.keys(o.providers[n]?.models??{})[0]??``:``;t(t=>{let i=t.routes[e]??{};return t.routes[e]={...i,[`alias-${Date.now()}`]:{provider:n,model:r}},t})}return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`路由`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`管理协议入口与模型路由映射`})]}),n.length===0?(0,L.jsx)(`div`,{className:`rounded-lg border bg-background py-12 text-center text-muted-foreground`,children:`暂无路由配置,请先添加一个协议入口`}):(0,L.jsx)(`div`,{className:`space-y-6`,children:n.map(t=>{let n=e.routes[t],r=Object.keys(n).length;return(0,L.jsxs)(`div`,{className:`relative`,children:[(0,L.jsx)(`div`,{className:`rounded-lg border bg-card text-card-foreground px-3 py-2`,children:(0,L.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsx)(`h3`,{className:`text-sm font-semibold`,children:t}),(0,L.jsxs)(J,{variant:`secondary`,className:`text-xs`,children:[r,` 个规则`]})]}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,L.jsxs)(K,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-2.5 text-xs`,onClick:()=>u(t),children:[(0,L.jsx)(Ba,{className:`mr-1 h-3.5 w-3.5`}),`添加规则`]}),(0,L.jsxs)(kz,{children:[(0,L.jsx)(Az,{asChild:!0,children:(0,L.jsx)(K,{variant:`ghost`,size:`icon`,className:`h-7 w-7 text-destructive hover:text-destructive`,children:(0,L.jsx)(no,{className:`h-3.5 w-3.5`})})}),(0,L.jsxs)(Nz,{children:[(0,L.jsxs)(Pz,{children:[(0,L.jsx)(Iz,{children:`确认删除`}),(0,L.jsxs)(Lz,{children:[`确定要删除协议入口「`,t,`」及其所有路由规则吗?`]})]}),(0,L.jsxs)(Fz,{children:[(0,L.jsx)(zz,{children:`取消`}),(0,L.jsx)(Rz,{onClick:()=>c(t),children:`删除`})]})]})]})]})]})}),(0,L.jsxs)(`div`,{className:`relative mt-3 ml-3`,children:[(0,L.jsx)(`div`,{className:`absolute left-0 -top-3 h-3 w-px bg-border`}),(0,L.jsx)(KV,{routeType:t,modelMap:e.routes[t],providers:e.providers,onChange:e=>l(t,e)})]})]},t)})}),a.length>0&&(0,L.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,L.jsxs)(Ej,{value:r,onValueChange:i,children:[(0,L.jsx)(kj,{className:`w-[240px]`,children:(0,L.jsx)(Oj,{placeholder:`选择协议类型...`})}),(0,L.jsx)(Aj,{children:a.map(e=>(0,L.jsx)(Mj,{value:e,children:e},e))})]}),(0,L.jsxs)(K,{onClick:s,disabled:!r,children:[(0,L.jsx)(Ba,{className:`h-4 w-4 mr-1`}),`添加协议入口`]})]})]})}var ZV={window:`24h`,from:``,to:``,user:``,session:``,q:``};const QV=Ex((e,t)=>({filters:{...ZV},summary:null,users:[],meta:null,from:``,to:``,loading:!1,error:null,setFilter:(t,n)=>{e(e=>({filters:{...e.filters,[t]:n}}))},fetchData:async()=>{e({loading:!0,error:null});try{let n=t(),r=await Wx({window:n.filters.window,from:n.filters.from||void 0,to:n.filters.to||void 0,user:n.filters.user||void 0,session:n.filters.session||void 0,q:n.filters.q||void 0});e({summary:r.summary,users:r.users,meta:r.meta,from:r.from,to:r.to,loading:!1,error:null})}catch(t){e({loading:!1,error:t instanceof Error?t.message:`用户会话查询失败`})}},resetFilters:async()=>{e({filters:{...ZV}}),await t().fetchData()}}));function $V(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}T${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`}function eH(e){if(!e)return``;let t=new Date(e);return Number.isNaN(t.getTime())?``:t.toISOString()}function tH(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString()}function nH(e){return e.length===0?`-`:e.slice(0,3).map(e=>`${e.key}(${e.count})`).join(`, `)}function rH(e,t=6){return e.length<=t*2+3?e:`${e.slice(0,t)}...${e.slice(-t)}`}function iH(){let e=hr(),t=QV(e=>e.filters),n=QV(e=>e.summary),r=QV(e=>e.users),i=QV(e=>e.meta),a=QV(e=>e.from),o=QV(e=>e.to),s=QV(e=>e.loading),c=QV(e=>e.error),l=QV(e=>e.setFilter),u=QV(e=>e.fetchData),d=QV(e=>e.resetFilters),[f,p]=(0,I.useState)({});(0,I.useEffect)(()=>{u()},[u]);let m=r.length>0,h=(0,I.useMemo)(()=>({users:n?.uniqueUsers??0,sessions:n?.uniqueSessions??0,requests:n?.totalRequests??0,metadataRequests:n?.metadataRequests??0}),[n]);return(0,L.jsxs)(`div`,{className:`space-y-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`用户会话`}),(0,L.jsx)(`p`,{className:`text-muted-foreground`,children:`解析日志 metadata 中的 user ↔ session 映射,查看活跃度并跳转日志检索`})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`检索条件`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`支持时间窗、范围、用户/会话精确筛选与关键词检索`})]}),(0,L.jsxs)(`div`,{className:`space-y-3 px-3 py-3`,children:[(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{children:`时间窗口`}),(0,L.jsxs)(Ej,{value:t.window,onValueChange:e=>l(`window`,e),children:[(0,L.jsx)(kj,{className:`h-8 w-full`,children:(0,L.jsx)(Oj,{})}),(0,L.jsxs)(Aj,{children:[(0,L.jsx)(Mj,{value:`1h`,children:`最近 1 小时`}),(0,L.jsx)(Mj,{value:`6h`,children:`最近 6 小时`}),(0,L.jsx)(Mj,{value:`24h`,children:`最近 24 小时`})]})]})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`sessions-from`,children:`起始时间`}),(0,L.jsx)(_M,{id:`sessions-from`,type:`datetime-local`,className:`h-8`,value:$V(t.from),onChange:e=>l(`from`,eH(e.target.value))})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`sessions-to`,children:`结束时间`}),(0,L.jsx)(_M,{id:`sessions-to`,type:`datetime-local`,className:`h-8`,value:$V(t.to),onChange:e=>l(`to`,eH(e.target.value))})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`sessions-q`,children:`关键词`}),(0,L.jsx)(_M,{id:`sessions-q`,className:`h-8`,value:t.q,onChange:e=>l(`q`,e.target.value),placeholder:`user/session/model/provider`})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-4`,children:[(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`sessions-user`,children:`用户标识`}),(0,L.jsx)(_M,{id:`sessions-user`,className:`h-8`,value:t.user,onChange:e=>l(`user`,e.target.value),placeholder:`userKey 或 raw user_id`})]}),(0,L.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,L.jsx)(Y,{htmlFor:`sessions-session`,children:`会话 ID`}),(0,L.jsx)(_M,{id:`sessions-session`,className:`h-8`,value:t.session,onChange:e=>l(`session`,e.target.value),placeholder:`sessionId`})]})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)(K,{size:`sm`,onClick:()=>void u(),disabled:s,children:[(0,L.jsx)(Ka,{className:`h-3.5 w-3.5`}),`查询`]}),(0,L.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>void d(),disabled:s,children:`重置`}),a&&o?(0,L.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`生效范围:`,tH(a),` - `,tH(o)]}):null]})]})]}),(0,L.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,L.jsx)(aH,{title:`用户数`,value:h.users}),(0,L.jsx)(aH,{title:`会话数`,value:h.sessions}),(0,L.jsx)(aH,{title:`请求数`,value:h.requests}),(0,L.jsx)(aH,{title:`含 metadata 请求`,value:h.metadataRequests})]}),(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background`,children:[(0,L.jsxs)(`div`,{className:`border-b px-3 py-3`,children:[(0,L.jsx)(`h3`,{className:`text-base font-semibold`,children:`用户与会话`}),(0,L.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i?`文件 ${i.scannedFiles} · 行 ${i.scannedLines} · 解析异常 ${i.parseErrors}${i.truncated?` · 已截断`:``}`:`等待查询`})]}),(0,L.jsx)(`div`,{className:`px-3 py-3`,children:c?(0,L.jsx)(Hj,{className:`min-h-[160px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`用户会话查询失败`}),(0,L.jsx)(qj,{children:c})]})}):s?(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsx)(Jj,{className:`h-10 w-full`}),(0,L.jsx)(Jj,{className:`h-10 w-full`}),(0,L.jsx)(Jj,{className:`h-10 w-full`})]}):m?(0,L.jsx)(`div`,{className:`rounded-md border`,children:(0,L.jsxs)(nM,{children:[(0,L.jsx)(rM,{children:(0,L.jsxs)(oM,{children:[(0,L.jsx)(sM,{className:`w-[46px]`}),(0,L.jsx)(sM,{children:`用户`}),(0,L.jsx)(sM,{children:`请求数`}),(0,L.jsx)(sM,{children:`会话数`}),(0,L.jsx)(sM,{children:`首次活跃`}),(0,L.jsx)(sM,{children:`最近活跃`}),(0,L.jsx)(sM,{children:`模型摘要`}),(0,L.jsx)(sM,{children:`Provider`}),(0,L.jsx)(sM,{children:`RouteType`}),(0,L.jsx)(sM,{className:`sticky right-0 z-10 bg-background text-right`,children:`操作`})]})}),(0,L.jsx)(iM,{children:r.map(t=>{let n=f[t.userKey]??!0;return(0,L.jsxs)(I.Fragment,{children:[(0,L.jsxs)(oM,{children:[(0,L.jsx)(cM,{children:(0,L.jsx)(K,{size:`icon-xs`,variant:`ghost`,onClick:()=>p(e=>({...e,[t.userKey]:!n})),children:n?(0,L.jsx)(ga,{className:`h-3.5 w-3.5`}):(0,L.jsx)(_a,{className:`h-3.5 w-3.5`})})}),(0,L.jsx)(cM,{className:`font-mono text-xs`,title:t.userKey,children:rH(t.userKey,10)}),(0,L.jsx)(cM,{children:t.requestCount}),(0,L.jsx)(cM,{children:t.sessionCount}),(0,L.jsx)(cM,{className:`text-xs`,children:tH(t.firstSeenAt)}),(0,L.jsx)(cM,{className:`text-xs`,children:tH(t.lastSeenAt)}),(0,L.jsx)(cM,{className:`max-w-[260px] truncate text-xs`,title:nH(t.models),children:nH(t.models)}),(0,L.jsx)(cM,{children:(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:t.providers.length})}),(0,L.jsx)(cM,{children:(0,L.jsx)(J,{variant:`outline`,className:`text-xs`,children:t.routeTypes.length})}),(0,L.jsx)(cM,{className:`sticky right-0 z-10 bg-background text-right`,children:(0,L.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>void e({to:`/logs`,search:{user:t.userKey,session:void 0}}),children:`查看日志`})})]},t.userKey),n?t.sessions.map(n=>(0,L.jsxs)(oM,{className:`bg-muted/20`,children:[(0,L.jsx)(cM,{}),(0,L.jsx)(cM,{className:`text-muted-foreground text-xs`,children:`↳ 会话`}),(0,L.jsx)(cM,{children:n.requestCount}),(0,L.jsx)(cM,{className:`text-xs text-muted-foreground`,children:n.sessionId}),(0,L.jsx)(cM,{className:`text-xs`,children:tH(n.firstSeenAt)}),(0,L.jsx)(cM,{className:`text-xs`,children:tH(n.lastSeenAt)}),(0,L.jsx)(cM,{className:`max-w-[260px] truncate text-xs`,title:nH(n.models),children:nH(n.models)}),(0,L.jsxs)(cM,{className:`text-xs text-muted-foreground`,colSpan:2,children:[`最近 requestId: `,rH(n.latestRequestId,8)]}),(0,L.jsx)(cM,{className:`sticky right-0 z-10 bg-background text-right`,children:(0,L.jsx)(K,{size:`sm`,variant:`outline`,onClick:()=>void e({to:`/logs`,search:{user:t.userKey,session:n.sessionId}}),children:`查看日志`})})]},`${t.userKey}-${n.sessionId}`)):null]},t.userKey)})})]})}):(0,L.jsx)(Hj,{className:`min-h-[220px] p-6 md:p-6`,children:(0,L.jsxs)(Uj,{children:[(0,L.jsx)(Kj,{children:`暂无可用用户会话`}),(0,L.jsx)(qj,{children:`请确认 bodyPolicy 不为 off,并调整筛选条件后重试`})]})})})]})]})}function aH({title:e,value:t}){return(0,L.jsxs)(`div`,{className:`rounded-lg border bg-background px-3 py-3`,children:[(0,L.jsx)(`div`,{className:`text-sm font-medium`,children:e}),(0,L.jsx)(`div`,{className:`mt-1 text-lg font-semibold`,children:t})]})}var oH=Ir({component:Tj}),sH=Pr({getParentRoute:()=>oH,path:`/`,component:()=>(0,L.jsx)(gr,{to:`/dashboard`,replace:!0})}),cH=Pr({getParentRoute:()=>oH,path:`/dashboard`,component:gM}),lH=Pr({getParentRoute:()=>oH,path:`/chat`,component:Lj}),uH=Pr({getParentRoute:()=>oH,path:`/providers`,component:WV}),dH=Pr({getParentRoute:()=>oH,path:`/routes`,component:XV}),fH=Pr({getParentRoute:()=>oH,path:`/general-settings`,component:bM}),pH=Pr({getParentRoute:()=>oH,path:`/logs`,validateSearch:e=>({user:typeof e.user==`string`?e.user:void 0,session:typeof e.session==`string`?e.session:void 0}),component:hz}),mH=Pr({getParentRoute:()=>oH,path:`/sessions`,component:iH}),hH=Pr({getParentRoute:()=>oH,path:`/logs/$id`,component:VI}),gH=Pr({getParentRoute:()=>oH,path:`/logs-settings`,component:vz});const _H=ei({routeTree:oH.addChildren([sH,cH,lH,uH,dH,fH,pH,mH,hH,gH]),basepath:`/admin`,defaultPreload:`intent`});(0,si.createRoot)(document.getElementById(`root`)).render((0,L.jsx)(I.StrictMode,{children:(0,L.jsx)(Si,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,children:(0,L.jsx)(ri,{router:_H})})}));
|