rails-profiler 0.35.3 → 0.36.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3e60e3a338360fd499866e03f8ab6c30208f18882a3a13dd892cc04aaac9aca
4
- data.tar.gz: 0bf4ff094c9b03b179531086676f1077fbcfb3218f402ecc5d5f0677d598dead
3
+ metadata.gz: '0807af8c2469a24ab547cc295678acea816cb51f02a8975fd420d2fd2dfa8311'
4
+ data.tar.gz: 6eec3e7dc0245496d254dd72ae1b65247d44cbf6ab107cf79671acbba25cfbf3
5
5
  SHA512:
6
- metadata.gz: 0255bdc1eae2817e7a606d2c76eacd849b91dd30d518eb36a86e8ceb64356ef065c7f87a30f3ea8992866fff47616f5fc6ec3eb1a79fa513bf509dae6553c5a7
7
- data.tar.gz: 9c5a33a03d2655be62d6d13607b4cf4f09e5322ea84dc2198cf2ef41f61cdc261aa8e56cc5ad6964aff4c8565c82961535ca977b15d3e16f4737f58f8d2ec766
6
+ metadata.gz: b92743541a4ecd0d12177a813e07a8d0c8ca455f2a9edf468e46f35807d3ebf968053bd0c82a1e565d724bcd8db91f13941abbe13d86d0b42883b305d16eaea1
7
+ data.tar.gz: 32c9fbea2e9555b061adb5d27be1816056d974431e69960aa1537f28ab87c2db3cd68b5edfa373943b28dbddec43edfe85497ee729d4bac5d0cdf8739bf7ed2e
data/CHANGELOG.md CHANGED
@@ -19,6 +19,46 @@ every commit of every tag interval is accounted for one way or the other.
19
19
 
20
20
  ## [Unreleased]
21
21
 
22
+ ## [0.36.1] - 2026-10-17
23
+
24
+ <!-- stamped -->
25
+
26
+ ### Changed
27
+
28
+ - **Compatibility:** The gem now declares `rails >= 7.1` instead of `rails >= 7.0`. This is a
29
+ correction announced, not a new restriction: the gem already relied on
30
+ `ActiveSupport::BroadcastLogger` and `Rack::Headers`, which Rails 7.0 does not provide, and
31
+ the suite fails on 7.0 (271 failures out of 1904). Bundler now refuses to install the gem on
32
+ Rails 7.0 instead of installing a version that cannot work.
33
+
34
+ ## [0.36.0] - 2026-10-17
35
+
36
+ <!-- stamped -->
37
+
38
+ ### Changed
39
+
40
+ - **Dashboard:** The profiler selector now uses the generated `useListClusterSlaves` client
41
+ instead of a hand-written `fetch`; the cluster endpoints are always asked of the master, also
42
+ while a slave is being viewed.
43
+
44
+ ### Fixed
45
+
46
+ - **Toolbar:** The toolbar keeps rendering and working when `localStorage` is refused (strict
47
+ private mode, storage disabled by a policy): the collapsed state and the theme are kept in
48
+ memory for the page instead of failing silently.
49
+ - **Toolbar:** After a Turbo Drive visit to a page the profiler leaves alone, AJAX requests are no
50
+ longer linked to the profile of the last profiled page.
51
+ - **Toolbar:** When the toolbar data cannot be loaded (network error, 500, timeout), the bar shows
52
+ an error with a Retry button instead of staying empty, and a component that throws shows a
53
+ minimal error, with a Retry button, instead of blanking the whole toolbar.
54
+ - **Toolbar:** `Alt+P` (`Option+P` on macOS) now toggles the toolbar on every platform, as the
55
+ shortcut is matched on the physical key (`event.code`) and not on the character it produces.
56
+ - **Dashboard:** The copy buttons work over plain HTTP on a non-local address, where
57
+ `navigator.clipboard` does not exist, through a `document.execCommand('copy')` fallback, and
58
+ say so when copying is not available.
59
+ - **Toolbar:** The last rule of the toolbar CSS that was not scoped to the toolbar elements
60
+ (`.profiler-toggle-icon`) is now scoped, so that no style of the toolbar reaches the host page.
61
+
22
62
  ## [0.35.3] - 2026-10-17
23
63
 
24
64
  <!-- stamped -->
@@ -1,2 +1,2 @@
1
- "use strict";(()=>{var vr=t=>{throw TypeError(t)};var Dt=(t,e,r)=>e.has(t)||vr("Cannot "+r);var a=(t,e,r)=>(Dt(t,e,"read from private field"),r?r.call(t):e.get(t)),_=(t,e,r)=>e.has(t)?vr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),h=(t,e,r,n)=>(Dt(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),E=(t,e,r)=>(Dt(t,e,"access private method"),r);var Xe=(t,e,r,n)=>({set _(i){h(t,e,i,r)},get _(){return a(t,e,n)}});var vt,P,Rr,io,ue,gr,Er,wr,Cr,kt,Kt,Ft,Pr,mt={},Tt=[],ao=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,gt=Array.isArray;function oe(t,e){for(var r in e)t[r]=e[r];return t}function Lt(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function uo(t,e,r){var n,i,s,u={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:u[s]=e[s];if(arguments.length>2&&(u.children=arguments.length>3?vt.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)u[s]===void 0&&(u[s]=t.defaultProps[s]);return dt(t,u,n,i,null)}function dt(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Rr,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(s),s}function b(t){return t.children}function ht(t,e){this.props=t,this.context=e}function Me(t,e){if(e==null)return t.__?Me(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Me(t):null}function lo(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],i=[],s=oe({},e);s.__v=e.__v+1,P.vnode&&P.vnode(s),It(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??Me(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,qr(n,s,i),e.__e=e.__=null,s.__e!=r&&Ar(s)}}function Ar(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Ar(t)}function St(t){(!t.__d&&(t.__d=!0)&&ue.push(t)&&!_t.__r++||gr!=P.debounceRendering)&&((gr=P.debounceRendering)||Er)(_t)}function _t(){try{for(var t,e=1;ue.length;)ue.length>e&&ue.sort(wr),t=ue.shift(),e=ue.length,lo(t)}finally{ue.length=_t.__r=0}}function Or(t,e,r,n,i,s,u,p,f,c,y){var l,m,d,T,x,v,g,R=n&&n.__k||Tt,q=e.length;for(f=po(r,e,R,f,q),l=0;l<q;l++)(d=r.__k[l])!=null&&(m=d.__i!=-1&&R[d.__i]||mt,d.__i=l,v=It(t,d,m,i,s,u,p,f,c,y),T=d.__e,d.ref&&m.ref!=d.ref&&(m.ref&&Vt(m.ref,null,d),y.push(d.ref,d.__c||T,d)),x==null&&T!=null&&(x=T),(g=!!(4&d.__u))||m.__k===d.__k?f=Qr(d,f,t,g):typeof d.type=="function"&&v!==void 0?f=v:T&&(f=T.nextSibling),d.__u&=-7);return r.__e=x,f}function po(t,e,r,n,i){var s,u,p,f,c,y=r.length,l=y,m=0;for(t.__k=new Array(i),s=0;s<i;s++)(u=e[s])!=null&&typeof u!="boolean"&&typeof u!="function"?(typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?u=t.__k[s]=dt(null,u,null,null,null):gt(u)?u=t.__k[s]=dt(b,{children:u},null,null,null):u.constructor===void 0&&u.__b>0?u=t.__k[s]=dt(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):t.__k[s]=u,f=s+m,u.__=t,u.__b=t.__b+1,p=null,(c=u.__i=co(u,r,f,l))!=-1&&(l--,(p=r[c])&&(p.__u|=2)),p==null||p.__v==null?(c==-1&&(i>y?m--:i<y&&m++),typeof u.type!="function"&&(u.__u|=4)):c!=f&&(c==f-1?m--:c==f+1?m++:(c>f?m--:m++,u.__u|=4))):t.__k[s]=null;if(l)for(s=0;s<y;s++)(p=r[s])!=null&&(2&p.__u)==0&&(p.__e==n&&(n=Me(p)),Dr(p,p));return n}function Qr(t,e,r,n){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=Qr(i[s],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=Me(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function co(t,e,r,n){var i,s,u,p=t.key,f=t.type,c=e[r],y=c!=null&&(2&c.__u)==0;if(c===null&&p==null||y&&p==c.key&&f==c.type)return r;if(n>(y?1:0)){for(i=r-1,s=r+1;i>=0||s<e.length;)if((c=e[u=i>=0?i--:s++])!=null&&(2&c.__u)==0&&p==c.key&&f==c.type)return u}return-1}function xr(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||ao.test(e)?r:r+"px"}function yt(t,e,r,n,i){var s,u;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||xr(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||xr(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Cr,"$1")),u=e.toLowerCase(),e=u in t||e=="onFocusOut"||e=="onFocusIn"?u.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=kt,t.addEventListener(e,s?Ft:Kt,s)):t.removeEventListener(e,s?Ft:Kt,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function br(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=kt++;else if(e.t<r.u)return;return r(P.event?P.event(e):e)}}}function It(t,e,r,n,i,s,u,p,f,c){var y,l,m,d,T,x,v,g,R,q,F,L,W,j,H,Q=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(f=!!(32&r.__u),s=[p=e.__e=r.__e]),(y=P.__b)&&y(e);e:if(typeof Q=="function")try{if(g=e.props,R=Q.prototype&&Q.prototype.render,q=(y=Q.contextType)&&n[y.__c],F=y?q?q.props.value:y.__:n,r.__c?v=(l=e.__c=r.__c).__=l.__E:(R?e.__c=l=new Q(g,F):(e.__c=l=new ht(g,F),l.constructor=Q,l.render=yo),q&&q.sub(l),l.state||(l.state={}),l.__n=n,m=l.__d=!0,l.__h=[],l._sb=[]),R&&l.__s==null&&(l.__s=l.state),R&&Q.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=oe({},l.__s)),oe(l.__s,Q.getDerivedStateFromProps(g,l.__s))),d=l.props,T=l.state,l.__v=e,m)R&&Q.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),R&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(R&&Q.getDerivedStateFromProps==null&&g!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,F),e.__v==r.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,F)===!1){e.__v!=r.__v&&(l.props=g,l.state=l.__s,l.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(J){J&&(J.__=e)}),Tt.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&u.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,F),R&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,T,x)})}if(l.context=F,l.props=g,l.__P=t,l.__e=!1,L=P.__r,W=0,R)l.state=l.__s,l.__d=!1,L&&L(e),y=l.render(l.props,l.state,l.context),Tt.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,L&&L(e),y=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++W<25);l.state=l.__s,l.getChildContext!=null&&(n=oe(oe({},n),l.getChildContext())),R&&!m&&l.getSnapshotBeforeUpdate!=null&&(x=l.getSnapshotBeforeUpdate(d,T)),j=y!=null&&y.type===b&&y.key==null?Mr(y.props.children):y,p=Or(t,gt(j)?j:[j],e,r,n,i,s,u,p,f,c),l.base=e.__e,e.__u&=-161,l.__h.length&&u.push(l),v&&(l.__E=l.__=null)}catch(J){if(e.__v=null,f||s!=null)if(J.then){for(e.__u|=f?160:128;p&&p.nodeType==8&&p.nextSibling;)p=p.nextSibling;s[s.indexOf(p)]=null,e.__e=p}else{for(H=s.length;H--;)Lt(s[H]);Ut(e)}else e.__e=r.__e,e.__k=r.__k,J.then||Ut(e);P.__e(J,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):p=e.__e=fo(r.__e,e,r,n,i,s,u,f,c);return(y=P.diffed)&&y(e),128&e.__u?void 0:p}function Ut(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Ut))}function qr(t,e,r){for(var n=0;n<r.length;n++)Vt(r[n],r[++n],r[++n]);P.__c&&P.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){P.__e(s,i.__v)}})}function Mr(t){return typeof t!="object"||t==null||t.__b>0?t:gt(t)?t.map(Mr):oe({},t)}function fo(t,e,r,n,i,s,u,p,f){var c,y,l,m,d,T,x,v=r.props||mt,g=e.props,R=e.type;if(R=="svg"?i="http://www.w3.org/2000/svg":R=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(c=0;c<s.length;c++)if((d=s[c])&&"setAttribute"in d==!!R&&(R?d.localName==R:d.nodeType==3)){t=d,s[c]=null;break}}if(t==null){if(R==null)return document.createTextNode(g);t=document.createElementNS(i,R,g.is&&g),p&&(P.__m&&P.__m(e,s),p=!1),s=null}if(R==null)v===g||p&&t.data==g||(t.data=g);else{if(s=s&&vt.call(t.childNodes),!p&&s!=null)for(v={},c=0;c<t.attributes.length;c++)v[(d=t.attributes[c]).name]=d.value;for(c in v)d=v[c],c=="dangerouslySetInnerHTML"?l=d:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||yt(t,c,null,d,i);for(c in g)d=g[c],c=="children"?m=d:c=="dangerouslySetInnerHTML"?y=d:c=="value"?T=d:c=="checked"?x=d:p&&typeof d!="function"||v[c]===d||yt(t,c,d,v[c],i);if(y)p||l&&(y.__html==l.__html||y.__html==t.innerHTML)||(t.innerHTML=y.__html),e.__k=[];else if(l&&(t.innerHTML=""),Or(e.type=="template"?t.content:t,gt(m)?m:[m],e,r,n,R=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,u,s?s[0]:r.__k&&Me(r,0),p,f),s!=null)for(c=s.length;c--;)Lt(s[c]);p||(c="value",R=="progress"&&T==null?t.removeAttribute("value"):T!=null&&(T!==t[c]||R=="progress"&&!T||R=="option"&&T!=v[c])&&yt(t,c,T,v[c],i),c="checked",x!=null&&x!=t[c]&&yt(t,c,x,v[c],i))}return t}function Vt(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){P.__e(i,r)}}function Dr(t,e,r){var n,i;if(P.unmount&&P.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Vt(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){P.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Dr(n[i],e,r||typeof t.type!="function");r||Lt(t.__e),t.__c=t.__=t.__e=void 0}function yo(t,e,r){return this.constructor(t,r)}function Nt(t,e,r){var n,i,s,u;e==document&&(e=document.documentElement),P.__&&P.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],u=[],It(e,t=(!n&&r||e).__k=uo(b,null,[t]),i||mt,mt,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?vt.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,u),qr(s,t,u)}function De(t){function e(r){var n,i;return this.getChildContext||(n=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&n.forEach(function(u){u.__e=!0,St(u)})},this.sub=function(s){n.add(s);var u=s.componentWillUnmount;s.componentWillUnmount=function(){n&&n.delete(s),u&&u.call(s)}}),r.children}return e.__c="__cC"+Pr++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}vt=Tt.slice,P={__e:function(t,e,r,n){for(var i,s,u;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),u=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),u=i.__d),u)return i.__E=i}catch(p){t=p}throw t}},Rr=0,io=function(t){return t!=null&&t.constructor===void 0},ht.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=oe({},this.state),typeof t=="function"&&(t=t(oe({},r),this.props)),t&&oe(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),St(this))},ht.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),St(this))},ht.prototype.render=b,ue=[],Er=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wr=function(t,e){return t.__v.__b-e.__v.__b},_t.__r=0,Cr=/(PointerCapture)$|Capture$/i,kt=0,Kt=br(!1),Ft=br(!0),Pr=0;var _e,O,jt,Kr,Ye=0,Nr=[],D=P,Fr=D.__b,Sr=D.__r,Ur=D.diffed,kr=D.__c,Lr=D.unmount,Ir=D.__;function Ze(t,e){D.__h&&D.__h(O,t,Ye||e),Ye=0;var r=O.__H||(O.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ve(t){return Ye=1,ho(Hr,t)}function ho(t,e,r){var n=Ze(_e++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):Hr(void 0,e),function(p){var f=n.__N?n.__N[0]:n.__[0],c=n.t(f,p);f!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=O,!O.__f)){var i=function(p,f,c){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(m){return m.__c});if(y.every(function(m){return!m.__N}))return!s||s.call(this,p,f,c);var l=n.__c.props!==p;return y.some(function(m){if(m.__N){var d=m.__[0];m.__=m.__N,m.__N=void 0,d!==m.__[0]&&(l=!0)}}),s&&s.call(this,p,f,c)||l};O.__f=!0;var s=O.shouldComponentUpdate,u=O.componentWillUpdate;O.componentWillUpdate=function(p,f,c){if(this.__e){var y=s;s=void 0,i(p,f,c),s=y}u&&u.call(this,p,f,c)},O.shouldComponentUpdate=i}return n.__N||n.__}function B(t,e){var r=Ze(_e++,3);!D.__s&&Ht(r.__H,e)&&(r.__=t,r.u=e,O.__H.__h.push(r))}function bt(t,e){var r=Ze(_e++,4);!D.__s&&Ht(r.__H,e)&&(r.__=t,r.u=e,O.__h.push(r))}function ge(t){return Ye=5,jr(function(){return{current:t}},[])}function jr(t,e){var r=Ze(_e++,7);return Ht(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Gr(t,e){return Ye=8,jr(function(){return t},e)}function Ke(t){var e=O.context[t.__c],r=Ze(_e++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(O)),e.props.value):t.__}function mo(){for(var t;t=Nr.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(xt),e.__h.some(Gt),e.__h=[]}catch(r){e.__h=[],D.__e(r,t.__v)}}}D.__b=function(t){O=null,Fr&&Fr(t)},D.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ir&&Ir(t,e)},D.__r=function(t){Sr&&Sr(t),_e=0;var e=(O=t.__c).__H;e&&(jt===O?(e.__h=[],O.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(xt),e.__h.some(Gt),e.__h=[],_e=0)),jt=O},D.diffed=function(t){Ur&&Ur(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Nr.push(e)!==1&&Kr===D.requestAnimationFrame||((Kr=D.requestAnimationFrame)||To)(mo)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),jt=O=null},D.__c=function(t,e){e.some(function(r){try{r.__h.some(xt),r.__h=r.__h.filter(function(n){return!n.__||Gt(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],D.__e(n,r.__v)}}),kr&&kr(t,e)},D.unmount=function(t){Lr&&Lr(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{xt(n)}catch(i){e=i}}),r.__H=void 0,e&&D.__e(e,r.__v))};var Vr=typeof requestAnimationFrame=="function";function To(t){var e,r=function(){clearTimeout(n),Vr&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);Vr&&(e=requestAnimationFrame(r))}function xt(t){var e=O,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),O=e}function Gt(t){var e=O;t.__c=t.__(),O=e}function Ht(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Hr(t,e){return typeof e=="function"?e(t):e}var Y=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var xe,le,Fe,Jr,_o=(Jr=class extends Y{constructor(){super();_(this,xe);_(this,le);_(this,Fe);h(this,Fe,e=>{if(typeof window<"u"&&window.addEventListener){let r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){a(this,le)||this.setEventListener(a(this,Fe))}onUnsubscribe(){var e;this.hasListeners()||((e=a(this,le))==null||e.call(this),h(this,le,void 0))}setEventListener(e){var r;h(this,Fe,e),(r=a(this,le))==null||r.call(this),h(this,le,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){a(this,xe)!==e&&(h(this,xe,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof a(this,xe)=="boolean"?a(this,xe):globalThis.document?.visibilityState!=="hidden"}},xe=new WeakMap,le=new WeakMap,Fe=new WeakMap,Jr),Se=new _o;var vo={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},pe,Jt,Br,go=(Br=class{constructor(){_(this,pe,vo);_(this,Jt,!1)}setTimeoutProvider(t){h(this,pe,t)}setTimeout(t,e){return a(this,pe).setTimeout(t,e)}clearTimeout(t){a(this,pe).clearTimeout(t)}setInterval(t,e){return a(this,pe).setInterval(t,e)}clearInterval(t){a(this,pe).clearInterval(t)}},pe=new WeakMap,Jt=new WeakMap,Br),Z=new go;function $r(t){setTimeout(t,0)}var $t=typeof window>"u"||"Deno"in globalThis;function K(){}function Xr(t,e){return typeof t=="function"?t(e):t}function et(t){return typeof t=="number"&&t>=0&&t!==1/0}function Rt(t,e){return Math.max(t+(e||0)-Date.now(),0)}function z(t,e){return typeof t=="function"?t(e):t}function I(t,e){return typeof t=="function"?t(e):t}function Et(t,e){let{type:r="all",exact:n,fetchStatus:i,predicate:s,queryKey:u,stale:p}=t;if(u){if(n){if(e.queryHash!==tt(u,e.options))return!1}else if(!Re(e.queryKey,u))return!1}if(r!=="all"){let f=e.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof p=="boolean"&&e.isStale()!==p||i&&i!==e.state.fetchStatus||s&&!s(e))}function wt(t,e){let{exact:r,status:n,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(be(e.options.mutationKey)!==be(s))return!1}else if(!Re(e.options.mutationKey,s))return!1}return!(n&&e.state.status!==n||i&&!i(e))}function tt(t,e){return(e?.queryKeyHashFn||be)(t)}function be(t){return JSON.stringify(t,(e,r)=>Bt(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function Re(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>Re(t[r],e[r])):!1}var xo=Object.prototype.hasOwnProperty;function Wt(t,e,r=0){if(t===e)return t;if(r>500)return e;let n=Wr(t)&&Wr(e);if(!n&&!(Bt(t)&&Bt(e)))return e;let s=(n?t:Object.keys(t)).length,u=n?e:Object.keys(e),p=u.length,f=n?new Array(p):{},c=0;for(let y=0;y<p;y++){let l=n?y:u[y],m=t[l],d=e[l];if(m===d){f[l]=m,(n?y<s:xo.call(t,l))&&c++;continue}if(m===null||d===null||typeof m!="object"||typeof d!="object"){f[l]=d;continue}let T=Wt(m,d,r+1);f[l]=T,T===m&&c++}return s===p&&c===s?t:f}function Ct(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function Wr(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Bt(t){if(!zr(t))return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(!zr(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function zr(t){return Object.prototype.toString.call(t)==="[object Object]"}function Yr(t){return new Promise(e=>{Z.setTimeout(e,t)})}function rt(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Wt(t,e):e}function Zr(t,e,r=0){let n=[...t,e];return r&&n.length>r?n.slice(1):n}function en(t,e,r=0){let n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var Ue=Symbol();function Pt(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Ue?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function zt(t,e){return typeof t=="function"?t(...e):!!t}function tn(t,e,r){let n=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),t}var ee=(()=>{let t=()=>$t;return{isServer(){return t()},setIsServer(e){t=e}}})();function nt(){let t,e,r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},r.reject=i=>{n({status:"rejected",reason:i}),e(i)},r}var rn=$r;function bo(){let t=[],e=0,r=p=>{p()},n=p=>{p()},i=rn,s=p=>{e?t.push(p):i(()=>{r(p)})},u=()=>{let p=t;t=[],p.length&&i(()=>{n(()=>{p.forEach(f=>{r(f)})})})};return{batch:p=>{let f;e++;try{f=p()}finally{e--,e||u()}return f},batchCalls:p=>(...f)=>{s(()=>{p(...f)})},schedule:s,setNotifyFunction:p=>{r=p},setBatchNotifyFunction:p=>{n=p},setScheduler:p=>{i=p}}}var A=bo();var ke,ce,Le,nn,Ro=(nn=class extends Y{constructor(){super();_(this,ke,!0);_(this,ce);_(this,Le);h(this,Le,e=>{if(typeof window<"u"&&window.addEventListener){let r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){a(this,ce)||this.setEventListener(a(this,Le))}onUnsubscribe(){var e;this.hasListeners()||((e=a(this,ce))==null||e.call(this),h(this,ce,void 0))}setEventListener(e){var r;h(this,Le,e),(r=a(this,ce))==null||r.call(this),h(this,ce,e(this.setOnline.bind(this)))}setOnline(e){a(this,ke)!==e&&(h(this,ke,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return a(this,ke)}},ke=new WeakMap,ce=new WeakMap,Le=new WeakMap,nn),Ie=new Ro;function Eo(t){return Math.min(1e3*2**t,3e4)}function Xt(t){return(t??"online")==="online"?Ie.isOnline():!0}var At=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Ot(t){let e=!1,r=0,n,i=nt(),s=()=>i.status!=="pending",u=x=>{if(!s()){let v=new At(x);m(v),t.onCancel?.(v)}},p=()=>{e=!0},f=()=>{e=!1},c=()=>Se.isFocused()&&(t.networkMode==="always"||Ie.isOnline())&&t.canRun(),y=()=>Xt(t.networkMode)&&t.canRun(),l=x=>{s()||(n?.(),i.resolve(x))},m=x=>{s()||(n?.(),i.reject(x))},d=()=>new Promise(x=>{n=v=>{(s()||c())&&x(v)},t.onPause?.()}).then(()=>{n=void 0,s()||t.onContinue?.()}),T=()=>{if(s())return;let x,v=r===0?t.initialPromise:void 0;try{x=v??t.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(l).catch(g=>{if(s())return;let R=t.retry??(ee.isServer()?0:3),q=t.retryDelay??Eo,F=typeof q=="function"?q(r,g):q,L=R===!0||typeof R=="number"&&r<R||typeof R=="function"&&R(r,g);if(e||!L){m(g);return}r++,t.onFail?.(r,g),Yr(F).then(()=>c()?void 0:d()).then(()=>{e?m(g):T()})})};return{promise:i,status:()=>i.status,cancel:u,continue:()=>(n?.(),i),cancelRetry:p,continueRetry:f,canStart:y,start:()=>(y()?T():d().then(T),i)}}var Ee,on,Qt=(on=class{constructor(){_(this,Ee)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),et(this.gcTime)&&h(this,Ee,Z.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ee.isServer()?1/0:300*1e3))}clearGcTimeout(){a(this,Ee)!==void 0&&(Z.clearTimeout(a(this,Ee)),h(this,Ee,void 0))}},Ee=new WeakMap,on);function an(t){return{onFetch:(e,r)=>{let n=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],u=e.state.data?.pageParams||[],p={pages:[],pageParams:[]},f=0,c=async()=>{let y=!1,l=T=>{tn(T,()=>e.signal,()=>y=!0)},m=Pt(e.options,e.fetchOptions),d=async(T,x,v)=>{if(y)return Promise.reject(e.signal.reason);if(x==null&&T.pages.length)return Promise.resolve(T);let R=(()=>{let W={client:e.client,queryKey:e.queryKey,pageParam:x,direction:v?"backward":"forward",meta:e.options.meta};return l(W),W})(),q=await m(R),{maxPages:F}=e.options,L=v?en:Zr;return{pages:L(T.pages,q,F),pageParams:L(T.pageParams,x,F)}};if(i&&s.length){let T=i==="backward",x=T?wo:sn,v={pages:s,pageParams:u},g=x(n,v);p=await d(v,g,T)}else{let T=t??s.length;do{let x=f===0?u[0]??n.initialPageParam:sn(n,p);if(f>0&&x==null)break;p=await d(p,x),f++}while(f<T)}return p};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=c}}}function sn(t,{pages:e,pageParams:r}){let n=e.length-1;return e.length>0?t.getNextPageParam(e[n],e,r[n],r):void 0}function wo(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var Ve,we,Ne,$,Ce,S,ot,Pe,G,fn,se,pn,cn=(pn=class extends Qt{constructor(e){super();_(this,G);_(this,Ve);_(this,we);_(this,Ne);_(this,$);_(this,Ce);_(this,S);_(this,ot);_(this,Pe);h(this,Pe,!1),h(this,ot,e.defaultOptions),this.setOptions(e.options),this.observers=[],h(this,Ce,e.client),h(this,$,a(this,Ce).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,h(this,we,ln(this.options)),this.state=e.state??a(this,we),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return a(this,Ve)}get promise(){return a(this,S)?.promise}setOptions(e){if(this.options={...a(this,ot),...e},e?._type&&h(this,Ve,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let r=ln(this.options);r.data!==void 0&&(this.setState(un(r.data,r.dataUpdatedAt)),h(this,we,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&a(this,$).remove(this)}setData(e,r){let n=rt(this.state.data,e,this.options);return E(this,G,se).call(this,{data:n,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),n}setState(e){E(this,G,se).call(this,{type:"setState",state:e})}cancel(e){let r=a(this,S)?.promise;return a(this,S)?.cancel(e),r?r.then(K).catch(K):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return a(this,we)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>I(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ue||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>z(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Rt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),a(this,S)?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),a(this,S)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),a(this,$).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(a(this,S)&&(a(this,Pe)||E(this,G,fn).call(this)?a(this,S).cancel({revert:!0}):a(this,S).cancelRetry()),this.scheduleGc()),a(this,$).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||E(this,G,se).call(this,{type:"invalidate"})}async fetch(e,r){if(this.state.fetchStatus!=="idle"&&a(this,S)?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(a(this,S))return a(this,S).continueRetry(),a(this,S).promise}if(e&&this.setOptions(e),!this.options.queryFn){let c=this.observers.find(y=>y.options.queryFn);c&&this.setOptions(c.options)}let n=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(h(this,Pe,!0),n.signal)})},s=()=>{let c=Pt(this.options,r),l=(()=>{let m={client:a(this,Ce),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return h(this,Pe,!1),this.options.persister?this.options.persister(c,l,this):c(l)},p=(()=>{let c={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:a(this,Ce),state:this.state,fetchFn:s};return i(c),c})();(a(this,Ve)==="infinite"?an(this.options.pages):this.options.behavior)?.onFetch(p,this),h(this,Ne,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==p.fetchOptions?.meta)&&E(this,G,se).call(this,{type:"fetch",meta:p.fetchOptions?.meta}),h(this,S,Ot({initialPromise:r?.initialPromise,fn:p.fetchFn,onCancel:c=>{c instanceof At&&c.revert&&this.setState({...a(this,Ne),fetchStatus:"idle"}),n.abort()},onFail:(c,y)=>{E(this,G,se).call(this,{type:"failed",failureCount:c,error:y})},onPause:()=>{E(this,G,se).call(this,{type:"pause"})},onContinue:()=>{E(this,G,se).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{let c=await a(this,S).start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),a(this,$).config.onSuccess?.(c,this),a(this,$).config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof At){if(c.silent)return a(this,S).promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw E(this,G,se).call(this,{type:"error",error:c}),a(this,$).config.onError?.(c,this),a(this,$).config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}},Ve=new WeakMap,we=new WeakMap,Ne=new WeakMap,$=new WeakMap,Ce=new WeakMap,S=new WeakMap,ot=new WeakMap,Pe=new WeakMap,G=new WeakSet,fn=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},se=function(e){let r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Yt(n.data,this.options),fetchMeta:e.meta??null};case"success":let i={...n,...un(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return h(this,Ne,e.manual?i:void 0),i;case"error":let s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),A.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),a(this,$).notify({query:this,type:"updated",action:e})})},pn);function Yt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Xt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function un(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ln(t){let e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var N,w,it,V,Ae,je,ie,fe,at,Ge,He,Oe,Qe,ye,Je,C,st,Zt,er,tr,rr,nr,or,sr,mn,hn,ar=(hn=class extends Y{constructor(e,r){super();_(this,C);_(this,N);_(this,w);_(this,it);_(this,V);_(this,Ae);_(this,je);_(this,ie);_(this,fe);_(this,at);_(this,Ge);_(this,He);_(this,Oe);_(this,Qe);_(this,ye);_(this,Je,new Set);this.options=r,h(this,N,e),h(this,fe,null),h(this,ie,nt()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(a(this,w).addObserver(this),yn(a(this,w),this.options)?E(this,C,st).call(this):this.updateResult(),E(this,C,rr).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ir(a(this,w),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ir(a(this,w),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,E(this,C,nr).call(this),E(this,C,or).call(this),a(this,w).removeObserver(this)}setOptions(e){let r=this.options,n=a(this,w);if(this.options=a(this,N).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof I(this.options.enabled,a(this,w))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");E(this,C,sr).call(this),a(this,w).setOptions(this.options),r._defaulted&&!Ct(this.options,r)&&a(this,N).getQueryCache().notify({type:"observerOptionsUpdated",query:a(this,w),observer:this});let i=this.hasListeners();i&&dn(a(this,w),n,this.options,r)&&E(this,C,st).call(this),this.updateResult(),i&&(a(this,w)!==n||I(this.options.enabled,a(this,w))!==I(r.enabled,a(this,w))||z(this.options.staleTime,a(this,w))!==z(r.staleTime,a(this,w)))&&E(this,C,Zt).call(this);let s=E(this,C,er).call(this);i&&(a(this,w)!==n||I(this.options.enabled,a(this,w))!==I(r.enabled,a(this,w))||s!==a(this,ye))&&E(this,C,tr).call(this,s)}getOptimisticResult(e){let r=a(this,N).getQueryCache().build(a(this,N),e),n=this.createResult(r,e);return Po(this,n)&&(h(this,V,n),h(this,je,this.options),h(this,Ae,a(this,w).state)),n}getCurrentResult(){return a(this,V)}trackResult(e,r){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),r?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&a(this,ie).status==="pending"&&a(this,ie).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){a(this,Je).add(e)}getCurrentQuery(){return a(this,w)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let r=a(this,N).defaultQueryOptions(e),n=a(this,N).getQueryCache().build(a(this,N),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return E(this,C,st).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),a(this,V)))}createResult(e,r){let n=a(this,w),i=this.options,s=a(this,V),u=a(this,Ae),p=a(this,je),c=e!==n?e.state:a(this,it),{state:y}=e,l={...y},m=!1,d;if(r._optimisticResults){let Q=this.hasListeners(),J=!Q&&yn(e,r),pt=Q&&dn(e,n,r,i);(J||pt)&&(l={...l,...Yt(y.data,e.options)}),r._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:T,errorUpdatedAt:x,status:v}=l;d=l.data;let g=!1;if(r.placeholderData!==void 0&&d===void 0&&v==="pending"){let Q;s?.isPlaceholderData&&r.placeholderData===p?.placeholderData?(Q=s.data,g=!0):Q=typeof r.placeholderData=="function"?r.placeholderData(a(this,He)?.state.data,a(this,He)):r.placeholderData,Q!==void 0&&(v="success",d=rt(s?.data,Q,r),m=!0)}if(r.select&&d!==void 0&&!g)if(s&&d===u?.data&&r.select===a(this,at))d=a(this,Ge);else try{h(this,at,r.select),d=r.select(d),d=rt(s?.data,d,r),h(this,Ge,d),h(this,fe,null)}catch(Q){h(this,fe,Q)}a(this,fe)&&(T=a(this,fe),d=a(this,Ge),x=Date.now(),v="error");let R=l.fetchStatus==="fetching",q=v==="pending",F=v==="error",L=q&&R,W=d!==void 0,H={status:v,fetchStatus:l.fetchStatus,isPending:q,isSuccess:v==="success",isError:F,isInitialLoading:L,isLoading:L,data:d,dataUpdatedAt:l.dataUpdatedAt,error:T,errorUpdatedAt:x,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>c.dataUpdateCount||l.errorUpdateCount>c.errorUpdateCount,isFetching:R,isRefetching:R&&!q,isLoadingError:F&&!W,isPaused:l.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:F&&W,isStale:ur(e,r),refetch:this.refetch,promise:a(this,ie),isEnabled:I(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let Q=H.data!==void 0,J=H.status==="error"&&!Q,pt=ft=>{J?ft.reject(H.error):Q&&ft.resolve(H.data)},_r=()=>{let ft=h(this,ie,H.promise=nt());pt(ft)},ct=a(this,ie);switch(ct.status){case"pending":e.queryHash===n.queryHash&&pt(ct);break;case"fulfilled":(J||H.data!==ct.value)&&_r();break;case"rejected":(!J||H.error!==ct.reason)&&_r();break}}return H}updateResult(){let e=a(this,V),r=this.createResult(a(this,w),this.options);if(h(this,Ae,a(this,w).state),h(this,je,this.options),a(this,Ae).data!==void 0&&h(this,He,a(this,w)),Ct(r,e))return;h(this,V,r);let n=()=>{if(!e)return!0;let{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!a(this,Je).size)return!0;let u=new Set(s??a(this,Je));return this.options.throwOnError&&u.add("error"),Object.keys(a(this,V)).some(p=>{let f=p;return a(this,V)[f]!==e[f]&&u.has(f)})};E(this,C,mn).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&E(this,C,rr).call(this)}},N=new WeakMap,w=new WeakMap,it=new WeakMap,V=new WeakMap,Ae=new WeakMap,je=new WeakMap,ie=new WeakMap,fe=new WeakMap,at=new WeakMap,Ge=new WeakMap,He=new WeakMap,Oe=new WeakMap,Qe=new WeakMap,ye=new WeakMap,Je=new WeakMap,C=new WeakSet,st=function(e){E(this,C,sr).call(this);let r=a(this,w).fetch(this.options,e);return e?.throwOnError||(r=r.catch(K)),r},Zt=function(){E(this,C,nr).call(this);let e=z(this.options.staleTime,a(this,w));if(ee.isServer()||a(this,V).isStale||!et(e))return;let n=Rt(a(this,V).dataUpdatedAt,e)+1;h(this,Oe,Z.setTimeout(()=>{a(this,V).isStale||this.updateResult()},n))},er=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(a(this,w)):this.options.refetchInterval)??!1},tr=function(e){E(this,C,or).call(this),h(this,ye,e),!(ee.isServer()||I(this.options.enabled,a(this,w))===!1||!et(a(this,ye))||a(this,ye)===0)&&h(this,Qe,Z.setInterval(()=>{(this.options.refetchIntervalInBackground||Se.isFocused())&&E(this,C,st).call(this)},a(this,ye)))},rr=function(){E(this,C,Zt).call(this),E(this,C,tr).call(this,E(this,C,er).call(this))},nr=function(){a(this,Oe)!==void 0&&(Z.clearTimeout(a(this,Oe)),h(this,Oe,void 0))},or=function(){a(this,Qe)!==void 0&&(Z.clearInterval(a(this,Qe)),h(this,Qe,void 0))},sr=function(){let e=a(this,N).getQueryCache().build(a(this,N),this.options);if(e===a(this,w))return;let r=a(this,w);h(this,w,e),h(this,it,e.state),this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))},mn=function(e){A.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(a(this,V))}),a(this,N).getQueryCache().notify({query:a(this,w),type:"observerResultsUpdated"})})},hn);function Co(t,e){return I(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&I(e.retryOnMount,t)===!1)}function yn(t,e){return Co(t,e)||t.state.data!==void 0&&ir(t,e,e.refetchOnMount)}function ir(t,e,r){if(I(e.enabled,t)!==!1&&z(e.staleTime,t)!=="static"){let n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&ur(t,e)}return!1}function dn(t,e,r,n){return(t!==e||I(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&ur(t,r)}function ur(t,e){return I(e.enabled,t)!==!1&&t.isStaleByTime(z(e.staleTime,t))}function Po(t,e){return!Ct(t.getCurrentResult(),e)}var ut,te,k,qe,re,de,Tn,_n=(Tn=class extends Qt{constructor(e){super();_(this,re);_(this,ut);_(this,te);_(this,k);_(this,qe);h(this,ut,e.client),this.mutationId=e.mutationId,h(this,k,e.mutationCache),h(this,te,[]),this.state=e.state||Ao(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){a(this,te).includes(e)||(a(this,te).push(e),this.clearGcTimeout(),a(this,k).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){h(this,te,a(this,te).filter(r=>r!==e)),this.scheduleGc(),a(this,k).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){a(this,te).length||(this.state.status==="pending"?this.scheduleGc():a(this,k).remove(this))}continue(){return a(this,qe)?.continue()??this.execute(this.state.variables)}async execute(e){let r=()=>{E(this,re,de).call(this,{type:"continue"})},n={client:a(this,ut),meta:this.options.meta,mutationKey:this.options.mutationKey};h(this,qe,Ot({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(u,p)=>{E(this,re,de).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{E(this,re,de).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>a(this,k).canRun(this)}));let i=this.state.status==="pending",s=!a(this,qe).canStart();try{if(i)r();else{E(this,re,de).call(this,{type:"pending",variables:e,isPaused:s}),a(this,k).config.onMutate&&await a(this,k).config.onMutate(e,this,n);let p=await this.options.onMutate?.(e,n);p!==this.state.context&&E(this,re,de).call(this,{type:"pending",context:p,variables:e,isPaused:s})}let u=await a(this,qe).start();return await a(this,k).config.onSuccess?.(u,e,this.state.context,this,n),await this.options.onSuccess?.(u,e,this.state.context,n),await a(this,k).config.onSettled?.(u,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(u,null,e,this.state.context,n),E(this,re,de).call(this,{type:"success",data:u}),u}catch(u){try{await a(this,k).config.onError?.(u,e,this.state.context,this,n)}catch(p){Promise.reject(p)}try{await this.options.onError?.(u,e,this.state.context,n)}catch(p){Promise.reject(p)}try{await a(this,k).config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,n)}catch(p){Promise.reject(p)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,n)}catch(p){Promise.reject(p)}throw E(this,re,de).call(this,{type:"error",error:u}),u}finally{a(this,k).runNext(this)}}},ut=new WeakMap,te=new WeakMap,k=new WeakMap,qe=new WeakMap,re=new WeakSet,de=function(e){let r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),A.batch(()=>{a(this,te).forEach(n=>{n.onMutationUpdate(e)}),a(this,k).notify({mutation:this,type:"updated",action:e})})},Tn);function Ao(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ae,X,lt,vn,gn=(vn=class extends Y{constructor(e={}){super();_(this,ae);_(this,X);_(this,lt);this.config=e,h(this,ae,new Set),h(this,X,new Map),h(this,lt,0)}build(e,r,n){let i=new _n({client:e,mutationCache:this,mutationId:++Xe(this,lt)._,options:e.defaultMutationOptions(r),state:n});return this.add(i),i}add(e){a(this,ae).add(e);let r=qt(e);if(typeof r=="string"){let n=a(this,X).get(r);n?n.push(e):a(this,X).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(a(this,ae).delete(e)){let r=qt(e);if(typeof r=="string"){let n=a(this,X).get(r);if(n)if(n.length>1){let i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&a(this,X).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){let r=qt(e);if(typeof r=="string"){let i=a(this,X).get(r)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){let r=qt(e);return typeof r=="string"?a(this,X).get(r)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){A.batch(()=>{a(this,ae).forEach(e=>{this.notify({type:"removed",mutation:e})}),a(this,ae).clear(),a(this,X).clear()})}getAll(){return Array.from(a(this,ae))}find(e){let r={exact:!0,...e};return this.getAll().find(n=>wt(r,n))}findAll(e={}){return this.getAll().filter(r=>wt(e,r))}notify(e){A.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){let e=this.getAll().filter(r=>r.state.isPaused);return A.batch(()=>Promise.all(e.map(r=>r.continue().catch(K))))}},ae=new WeakMap,X=new WeakMap,lt=new WeakMap,vn);function qt(t){return t.options.scope?.id}var ne,xn,bn=(xn=class extends Y{constructor(e={}){super();_(this,ne);this.config=e,h(this,ne,new Map)}build(e,r,n){let i=r.queryKey,s=r.queryHash??tt(i,r),u=this.get(s);return u||(u=new cn({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(u)),u}add(e){a(this,ne).has(e.queryHash)||(a(this,ne).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let r=a(this,ne).get(e.queryHash);r&&(e.destroy(),r===e&&a(this,ne).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){A.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return a(this,ne).get(e)}getAll(){return[...a(this,ne).values()]}find(e){let r={exact:!0,...e};return this.getAll().find(n=>Et(r,n))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(n=>Et(e,n)):r}notify(e){A.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){A.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){A.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ne=new WeakMap,xn);var M,he,me,Be,$e,Te,We,ze,Rn,lr=(Rn=class{constructor(t={}){_(this,M);_(this,he);_(this,me);_(this,Be);_(this,$e);_(this,Te);_(this,We);_(this,ze);h(this,M,t.queryCache||new bn),h(this,he,t.mutationCache||new gn),h(this,me,t.defaultOptions||{}),h(this,Be,new Map),h(this,$e,new Map),h(this,Te,0)}mount(){Xe(this,Te)._++,a(this,Te)===1&&(h(this,We,Se.subscribe(async t=>{t&&(await this.resumePausedMutations(),a(this,M).onFocus())})),h(this,ze,Ie.subscribe(async t=>{t&&(await this.resumePausedMutations(),a(this,M).onOnline())})))}unmount(){var t,e;Xe(this,Te)._--,a(this,Te)===0&&((t=a(this,We))==null||t.call(this),h(this,We,void 0),(e=a(this,ze))==null||e.call(this),h(this,ze,void 0))}isFetching(t){return a(this,M).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return a(this,he).findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return a(this,M).get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=a(this,M).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(z(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return a(this,M).findAll(t).map(({queryKey:e,state:r})=>{let n=r.data;return[e,n]})}setQueryData(t,e,r){let n=this.defaultQueryOptions({queryKey:t}),s=a(this,M).get(n.queryHash)?.state.data,u=Xr(e,s);if(u!==void 0)return a(this,M).build(this,n).setData(u,{...r,manual:!0})}setQueriesData(t,e,r){return A.batch(()=>a(this,M).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return a(this,M).get(e.queryHash)?.state}removeQueries(t){let e=a(this,M);A.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){let r=a(this,M);return A.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let r={revert:!0,...e},n=A.batch(()=>a(this,M).findAll(t).map(i=>i.cancel(r)));return Promise.all(n).then(K).catch(K)}invalidateQueries(t,e={}){return A.batch(()=>(a(this,M).findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){let r={...e,cancelRefetch:e.cancelRefetch??!0},n=A.batch(()=>a(this,M).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(K)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(n).then(K)}fetchQuery(t){let e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);let r=a(this,M).build(this,e);return r.isStaleByTime(z(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(K).catch(K)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(K).catch(K)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Ie.isOnline()?a(this,he).resumePausedMutations():Promise.resolve()}getQueryCache(){return a(this,M)}getMutationCache(){return a(this,he)}getDefaultOptions(){return a(this,me)}setDefaultOptions(t){h(this,me,t)}setQueryDefaults(t,e){a(this,Be).set(be(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...a(this,Be).values()],r={};return e.forEach(n=>{Re(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){a(this,$e).set(be(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...a(this,$e).values()],r={};return e.forEach(n=>{Re(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...a(this,me).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=tt(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ue&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...a(this,me).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){a(this,M).clear(),a(this,he).clear()}},M=new WeakMap,he=new WeakMap,me=new WeakMap,Be=new WeakMap,$e=new WeakMap,Te=new WeakMap,We=new WeakMap,ze=new WeakMap,Rn);var En=De(!1),wn=()=>Ke(En),Ni=En.Provider;var Oo=0;function o(t,e,r,n,i,s){e||(e={});var u,p,f=e;if("ref"in f)for(p in f={},e)p=="ref"?u=e[p]:f[p]=e[p];var c={type:t,props:f,key:r,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Oo,__i:-1,__u:0,__source:i,__self:s};if(typeof t=="function"&&(u=t.defaultProps))for(p in u)f[p]===void 0&&(f[p]=u[p]);return P.vnode&&P.vnode(c),c}var pr=De(void 0),cr=t=>{let e=Ke(pr);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},fr=({client:t,children:e})=>(B(()=>(t.mount(),()=>{t.unmount()}),[t]),o(pr.Provider,{value:t,children:e}));function Qo(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var qo=De(Qo()),Cn=()=>Ke(qo);var Pn=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},An=t=>{B(()=>{t.clearReset()},[t])},On=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(i&&t.data===void 0||zt(r,[t.error,n]));var Qn=t=>{if(t.suspense){let r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},qn=(t,e)=>t.isLoading&&t.isFetching&&!e,Mn=(t,e)=>t?.suspense&&e.isPending,yr=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Dn(t,e){let r=e(),[{_instance:n},i]=ve({_instance:{_value:r,_getSnapshot:e}});return bt(()=>{n._value=r,n._getSnapshot=e,dr(n)&&i({_instance:n})},[t,r,e]),B(()=>(dr(n)&&i({_instance:n}),t(()=>{dr(n)&&i({_instance:n})})),[t]),r}function dr(t){let e=t._getSnapshot,r=t._value;try{let n=e();return!Object.is(r,n)}catch{return!0}}function Kn(t,e,r){let n=wn(),i=Cn(),s=cr(r),u=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(u),u._optimisticResults=n?"isRestoring":"optimistic",Qn(u),Pn(u,i),An(i);let p=!s.getQueryCache().get(u.queryHash),[f]=ve(()=>new e(s,u)),c=f.getOptimisticResult(u),y=!n&&t.subscribed!==!1;if(Dn(Gr(l=>{let m=y?f.subscribe(A.batchCalls(l)):K;return f.updateResult(),m},[f,y]),()=>f.getCurrentResult()),B(()=>{f.setOptions(u)},[u,f]),Mn(u,c))throw yr(u,f,i);if(On({result:c,errorResetBoundary:i,throwOnError:u.throwOnError,query:s.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw c.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(u,c),u.experimental_prefetchInRender&&!ee.isServer()&&qn(c,n)&&(p?yr(u,f,i):s.getQueryCache().get(u.queryHash)?.promise)?.catch(K).finally(()=>{f.updateResult()}),u.notifyOnChangeProps?c:f.trackResult(c)}function hr(t,e){return Kn(t,ar,e)}function U({children:t,panel:e,href:r,className:n,panelLarge:i}){let[s,u]=ve(!1),p=ge(null),f=ge(null),c=ge(null),y=()=>{c.current&&(clearTimeout(c.current),c.current=null),f.current=setTimeout(()=>u(!0),100)},l=()=>{f.current&&(clearTimeout(f.current),f.current=null),c.current=setTimeout(()=>u(!1),150)};bt(()=>{if(s&&p.current){let T=p.current;T.style.left="50%",T.style.right="auto",T.style.transform="translateX(-50%)";let x=T.getBoundingClientRect();x.left<8?(T.style.left="0",T.style.transform="none"):x.right>window.innerWidth-8&&(T.style.left="auto",T.style.right="0",T.style.transform="none")}},[s]);let m=["profiler-toolbar-item",e?"profiler-toolbar-hoverable":"",n||""].filter(Boolean).join(" "),d=e?o("div",{ref:p,class:`profiler-toolbar-panel${i?" profiler-toolbar-panel-large":""}${s?" is-visible":""}`,onMouseEnter:y,onMouseLeave:l,children:e}):null;return r?o("a",{href:r,class:m,onMouseEnter:y,onMouseLeave:l,children:[t,d]}):o("span",{class:m,onMouseEnter:y,onMouseLeave:l,children:[t,d]})}function Mo(t){return t>=200&&t<300?"profiler-text--success":t>=300&&t<400?"profiler-text--warning":t>=400?"profiler-text--error":""}function Fn({profile:t,requestData:e}){let r=Mo(t.status),n=e.controller_action,i=e.route_name,s=e.route_pattern,u=e.route_params;return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Request & Response",o("span",{class:"profiler-float-right",children:t.path})]}),o("div",{class:"profiler-toolbar-panel-content",children:[o("div",{class:"profiler-section__header",children:"Request"}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Method"}),o("strong",{class:"profiler-text--accent",children:t.method})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Path"}),o("strong",{children:t.path})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Status"}),o("strong",{class:r,children:t.status})]}),n&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Controller#Action"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:n})]}),i&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Route Name"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:i})]}),s&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Route Pattern"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:s})]}),u&&Object.keys(u).length>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Route Params"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:Object.entries(u).map(([p,f])=>`${p}: ${f}`).join(", ")})]}),t.params&&Object.keys(t.params).length>0&&o(b,{children:[o("div",{class:"profiler-section__header profiler-mt-3",children:"Parameters"}),Object.entries(t.params).map(([p,f])=>o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{class:"profiler-text--xs profiler-text--mono",children:p}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:String(f).substring(0,40)})]},p))]})]})]})}function Sn({dbData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Database",o("span",{class:"profiler-float-right",children:[t.total_queries," queries \xB7 ",t.total_duration.toFixed(2)," ms"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[t.queries.slice(0,10).map((e,r)=>o("div",{class:`profiler-toolbar-panel-query${e.slow?" profiler-toolbar-panel-query-slow":""}`,children:[o("div",{class:"profiler-flex profiler-flex--between profiler-mb-1",children:[o("span",{class:"profiler-text--xs profiler-text--muted",children:["#",r+1," ",e.name]}),o("span",{class:`${e.slow?"profiler-text--error":"profiler-text--success"} profiler-text--xs`,children:[e.duration.toFixed(2)," ms"]})]}),o("code",{children:e.sql})]},r)),t.total_queries>10&&o("div",{class:"profiler-more",children:["+ ",t.total_queries-10," more queries"]})]})]})}function Do(t){return{GET:"badge-info",POST:"badge-success",PUT:"badge-warning",PATCH:"badge-warning",DELETE:"badge-error"}[t]||""}var Ko={frame:"Turbo Frame request",stream:"Turbo Stream response"};function Un({ajaxData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["AJAX",o("span",{class:"profiler-float-right",children:[t.total_requests," requests \xB7 ",t.total_duration.toFixed(2)," ms"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[t.requests.slice(0,10).map((e,r)=>{let n=e.status>=200&&e.status<300?"profiler-ajax-card--success":"profiler-ajax-card--error";return o("div",{class:`profiler-ajax-card ${n}`,children:o("div",{class:"profiler-ajax-card__row",children:[o("div",{class:"profiler-flex profiler-flex--gap-2",children:[o("span",{class:`badge ${Do(e.method)}`,children:e.method}),e.turbo&&o("span",{class:"badge badge-default",title:Ko[e.turbo],children:e.turbo.toUpperCase()}),o("span",{class:"profiler-text--xs profiler-text--truncate",children:e.path})]}),o("div",{class:"profiler-flex profiler-flex--gap-2",children:[o("span",{class:`profiler-text--xs ${e.status>=200&&e.status<300?"profiler-text--success":"profiler-text--error"}`,children:e.status}),o("span",{class:"profiler-text--xs profiler-text--muted",children:[e.duration.toFixed(2)," ms"]})]})]})},r)}),t.total_requests>10&&o("div",{class:"profiler-more",children:["+ ",t.total_requests-10," more"]})]})]})}function kn({perfData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:"Events"}),o("div",{class:"profiler-toolbar-panel-content",children:t.events.slice(0,8).map((e,r)=>o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{class:"profiler-text--xs",children:e.name}),o("strong",{class:"profiler-text--accent",children:[e.duration.toFixed(2)," ms"]})]},r))})]})}function Ln({viewData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Views",o("span",{class:"profiler-float-right",children:[t.total_duration.toFixed(2)," ms"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[t.views&&t.views.length>0&&o(b,{children:[o("div",{class:"profiler-section__header",children:"Templates"}),t.views.map((e,r)=>o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{class:"profiler-text--xs",children:e.identifier}),o("strong",{class:"profiler-text--success",children:[e.duration.toFixed(2)," ms"]})]},r))]}),t.partials&&t.partials.length>0&&o(b,{children:[o("div",{class:"profiler-section__header profiler-mt-3",children:"Partials"}),t.partials.map((e,r)=>o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{class:"profiler-text--xs",children:e.identifier}),o("strong",{class:"profiler-text--success",children:[e.duration.toFixed(2)," ms"]})]},r))]})]})]})}function In({cacheData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Cache",o("span",{class:"profiler-float-right",children:["Hit rate: ",t.hit_rate,"%"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Reads"}),o("strong",{children:t.total_reads})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Writes"}),o("strong",{children:t.total_writes})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Hits"}),o("strong",{class:"profiler-text--success",children:t.hits})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Misses"}),o("strong",{class:"profiler-text--error",children:t.misses})]})]})]})}function Vn({dumpData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Dumps (",t.count,")"]}),o("div",{class:"profiler-toolbar-panel-content",children:[t.dumps.slice(0,5).map((e,r)=>o("div",{class:"profiler-dump-card",children:[o("div",{class:"profiler-dump-card__header",children:[o("span",{class:"profiler-text--xs profiler-text--muted",children:["#",r+1,e.label&&o(b,{children:[" \xB7 ",o("strong",{class:"profiler-text--warning",children:e.label})]})]}),o("span",{class:"profiler-text--xs profiler-text--muted",children:[e.file.split("/").pop(),":",e.line]})]}),o("pre",{class:"profiler-text--xs profiler-text--truncate profiler-text--warning",style:{margin:0,background:"none",border:"none",padding:0},children:(e.formatted.split(`
2
- `)[0]||e.formatted).trim()})]},r)),t.count>5&&o("div",{class:"profiler-more",children:["+ ",t.count-5," more dumps"]})]})]})}function Fo(t){return{GET:"badge-info",POST:"badge-success",PUT:"badge-warning",PATCH:"badge-warning",DELETE:"badge-error"}[t]||""}function Nn({httpData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Outbound HTTP",o("span",{class:"profiler-float-right",children:[t.total_requests," requests \xB7 ",t.total_duration.toFixed(2)," ms"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[t.requests.slice(0,10).map((r,n)=>{let i=r.status>=400||r.status===0,s=r.duration>=500,u=i?"profiler-ajax-card--error":s?"profiler-ajax-card--warning":"profiler-ajax-card--success",p=(()=>{try{return new URL(r.url).host}catch{return r.url}})();return o("div",{class:`profiler-ajax-card ${u}`,children:o("div",{class:"profiler-ajax-card__row",children:[o("div",{class:"profiler-flex profiler-flex--gap-2",children:[o("span",{class:`badge ${Fo(r.method)}`,children:r.method}),o("span",{class:"profiler-text--xs profiler-text--truncate",children:p})]}),o("div",{class:"profiler-flex profiler-flex--gap-2",children:[o("span",{class:`profiler-text--xs ${i?"profiler-text--error":"profiler-text--success"}`,children:r.status===0?"ERR":r.status}),o("span",{class:`profiler-text--xs ${s?"profiler-text--error":"profiler-text--muted"}`,children:[r.duration.toFixed(2)," ms"]})]})]})},n)}),t.total_requests>10&&o("div",{class:"profiler-more",children:["+ ",t.total_requests-10," more"]})]})]})}function So(t){switch(t){case"ERROR":case"FATAL":return"var(--profiler-error, #ef4444)";case"WARN":return"var(--profiler-warning, #f59e0b)";case"INFO":return"var(--profiler-success, #22c55e)";default:return"var(--profiler-muted, #6b7280)"}}function jn({logData:t}){let e=t.logs.slice(-5).reverse();return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Logs (",t.count,")",t.errors>0&&o("span",{style:"color:var(--profiler-error,#ef4444);margin-left:8px;",children:[t.errors," error",t.errors!==1?"s":""]}),t.warnings>0&&t.errors===0&&o("span",{style:"color:var(--profiler-warning,#f59e0b);margin-left:8px;",children:[t.warnings," warning",t.warnings!==1?"s":""]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[e.map((r,n)=>o("div",{class:"profiler-toolbar-panel-row",style:"align-items:flex-start;gap:6px;",children:[o("span",{class:"profiler-text--xs",style:`color:${So(r.level)};font-weight:600;min-width:40px;`,children:r.level}),o("span",{class:"profiler-text--xs profiler-text--truncate",style:"flex:1;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",children:r.message})]},n)),t.count>5&&o("div",{class:"profiler-more",children:["+ ",t.count-5," more messages"]})]})]})}function Gn({exceptionData:t}){let e=t.backtrace?.find(r=>r.app_frame);return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",style:"color:var(--profiler-error,#ef4444);",children:["\u{1F4A5} ",t.exception_class]}),o("div",{class:"profiler-toolbar-panel-content",children:o("div",{class:"profiler-toolbar-panel-row",style:"flex-direction:column;align-items:flex-start;gap:4px;",children:[o("span",{class:"profiler-text--xs",style:"max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",children:t.message}),e&&o("span",{class:"profiler-text--xs profiler-text--muted",style:"max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",children:e.location})]})})]})}function Hn({routesData:t}){let{total:e,matched:r}=t;return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Routes",o("span",{class:"profiler-float-right",children:[e," routes"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:r?o(b,{children:[o("div",{class:"profiler-section__header",children:"Matched Route"}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Pattern"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:r.pattern})]}),r.name&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Name"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:[r.name,"_path"]})]}),r.controller_action&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Controller#Action"}),o("strong",{class:"profiler-text--xs profiler-text--mono",children:r.controller_action})]})]}):o("div",{class:"profiler-toolbar-panel-row",children:o("span",{class:"profiler-text--muted",children:"No route matched"})})})]})}function Jn({i18nData:t}){let e=t.lookups.filter(s=>s.missing),r=t.lookups.filter(s=>!s.missing),n=[...e,...r].slice(0,5),i=t.total-5;return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["I18n",o("span",{style:"margin-left:6px;font-weight:400;color:var(--profiler-muted,#6b7280);",children:["[",t.locale,"]"]}),t.missing_count>0&&o("span",{style:"color:var(--profiler-error,#ef4444);margin-left:8px;",children:[t.missing_count," missing"]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[n.map((s,u)=>o("div",{class:"profiler-toolbar-panel-row",style:"align-items:flex-start;gap:6px;",children:[o("span",{class:"profiler-text--xs profiler-text--truncate",style:`flex:1;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;${s.missing?"color:var(--profiler-error,#ef4444);":""}`,children:s.key}),s.missing&&o("span",{class:"profiler-text--xs",style:"color:var(--profiler-error,#ef4444);font-weight:600;",children:"\u26A0"})]},u)),i>0&&o("div",{class:"profiler-more",children:["+ ",i," more keys"]})]})]})}function Uo({job:t}){if(t.status==="running")return o("strong",{class:"profiler-text--xs profiler-text--mono profiler-text--info",children:[o("span",{class:"profiler-spinner","aria-hidden":"true",children:"\u25D0"})," running"]});let e=t.status==="failed";return o("strong",{class:`profiler-text--xs profiler-text--mono ${e?"profiler-text--error":"profiler-text--success"}`,children:[e?"\u2717":"\u2713"," ",t.duration?.toFixed(0),"ms"]})}function Bn({jobs:t}){let e=t.filter(u=>u.status==="running").length,r=t.filter(u=>u.status==="completed").length,n=t.filter(u=>u.status==="failed").length,i=t.slice(0,5),s=t.length-5;return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Background Jobs",o("span",{class:"profiler-float-right",children:[t.length," job",t.length!==1?"s":""]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[o("div",{class:"profiler-section__header",children:"Summary"}),e>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Running"}),o("strong",{class:"profiler-text--info",children:e})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Completed"}),o("strong",{class:r>0?"profiler-text--success":"profiler-text--muted",children:r})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Failed"}),o("strong",{class:n>0?"profiler-text--error":"profiler-text--muted",children:n})]}),o("div",{class:"profiler-section__header profiler-mt-3",children:"Last jobs"}),i.map((u,p)=>o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{class:"profiler-text--xs profiler-text--mono",children:u.job_class}),o(Uo,{job:u})]},p)),s>0&&o("div",{class:"profiler-more",children:["+ ",s," more"]})]})]})}function $n({envData:t}){return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:"Environment"}),o("div",{class:"profiler-toolbar-panel-content",children:o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Variables"}),o("strong",{children:t.total})]})})]})}function Wn({mailerData:t}){let e=t.failed>0||t.loop_warnings.length>0;return o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:["Mailers",o("span",{class:"profiler-float-right",children:[t.total," email",t.total!==1?"s":""]})]}),o("div",{class:"profiler-toolbar-panel-content",children:[t.deliver_now>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"deliver_now"}),o("strong",{children:t.deliver_now})]}),t.deliver_later>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"deliver_later"}),o("strong",{children:t.deliver_later})]}),(t.queued_count??0)>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Queued"}),o("strong",{children:t.queued_count})]}),t.multi_part_count>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Multi-part"}),o("strong",{children:t.multi_part_count})]}),t.failed>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Errors"}),o("strong",{class:"profiler-text--error",children:t.failed})]}),t.loop_warnings.length>0&&o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{class:"profiler-text--warning",children:"\u26A0\uFE0F Loop detected"}),o("strong",{class:"profiler-text--warning",children:t.loop_warnings.length})]}),[...t.emails,...t.errors].slice(0,3).map((r,n)=>o("div",{class:"profiler-toolbar-panel-row profiler-text--sm",children:[o("span",{class:"profiler-text--muted",children:[r.mailer_class,"#",r.action]}),o("span",{class:r.error?"profiler-text--error":"profiler-text--success",children:r.error?"\u274C":"\u2705"})]},n)),t.total>3&&o("div",{class:"profiler-toolbar-panel-row profiler-text--muted profiler-text--xs",children:["+",t.total-3," more\u2026"]})]})]})}function mr(t){return t.allocated_objects!=null?t.allocated_objects:t.memory!=null?Math.round(t.memory/40):null}function zn(t){return t==null?"-":`${t.toLocaleString("en")} objects`}var Xn="Objects allocated by the whole process while this ran: on a multi-threaded server, it includes what other threads allocated meanwhile.";function ko(t){return t>=200&&t<300?"profiler-text--success":t>=300&&t<400?"profiler-text--warning":t>=400?"profiler-text--error":""}function Lo(t){return t<100?"profiler-text--success":t<500?"profiler-text--warning":"profiler-text--error"}function Io(t){return new Date(t).toLocaleTimeString("en",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Yn({profile:t,token:e}){let r=t.collectors_data||{},n=r.request,i=r.database,s=r.ajax,u=r.performance,p=r.view,f=r.cache,c=r.dump,y=r.http,l=r.logs,m=r.exception,d=r.routes,T=r.i18n,x=r.env,v=r.mailer,g=t.child_jobs??[],R=ko(t.status),q=Lo(t.duration),F=(i?.slow_queries??0)>0?"profiler-text--error":"profiler-text--success",L=(s?.total_requests??0)>20?"profiler-text--error":"profiler-text--success",W=(f?.hit_rate??0)>80?"profiler-text--success":"profiler-text--warning";return o(b,{children:o("div",{class:"profiler-toolbar-container",children:[n&&o(b,{children:[o(U,{href:`/_profiler/profiles/${e}?tab=request`,className:R,panelLarge:!0,panel:o(Fn,{profile:t,requestData:n}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:t.method}),o("span",{children:t.status})]}),o(U,{href:`/_profiler/profiles/${e}?tab=request`,className:q,panel:o(b,{children:[o("div",{class:"profiler-toolbar-panel-header",children:"Performance"}),o("div",{class:"profiler-toolbar-panel-content",children:[o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Duration"}),o("strong",{class:q,children:[t.duration.toFixed(2)," ms"]})]}),mr(t)!=null&&o("div",{class:"profiler-toolbar-panel-row",title:Xn,children:[o("span",{children:"Allocations"}),o("strong",{children:zn(mr(t))})]}),o("div",{class:"profiler-toolbar-panel-row",children:[o("span",{children:"Started"}),o("strong",{children:Io(t.started_at)})]})]})]}),children:[o("span",{class:q,children:t.duration.toFixed(2)}),o("span",{class:"profiler-text--muted profiler-text--xs",children:"ms"})]})]}),i?.total_queries!==void 0&&o(U,{href:`/_profiler/profiles/${e}?tab=database`,className:F,panelLarge:!0,panel:o(Sn,{dbData:i}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"DB"}),o("span",{children:i.total_queries}),(i.slow_queries??0)>0&&o("span",{class:"profiler-text--error profiler-text--xs",children:["\u25B2 ",i.slow_queries]}),o("span",{class:"profiler-text--muted profiler-text--xs",children:[i.total_duration.toFixed(1),"ms"]})]}),s&&s.total_requests>0&&o(U,{href:`/_profiler/profiles/${e}?tab=ajax`,className:L,panelLarge:!0,panel:o(Un,{ajaxData:s}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"XHR"}),o("span",{children:s.total_requests}),o("span",{class:"profiler-text--muted profiler-text--xs",children:[s.total_duration.toFixed(1),"ms"]})]}),u?.events&&u.total_events>0&&o(U,{href:`/_profiler/profiles/${e}?tab=timeline`,panel:o(kn,{perfData:u}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"EVT"}),o("span",{children:u.total_events})]}),p?.total_views!==void 0&&o(U,{href:`/_profiler/profiles/${e}?tab=views`,panel:o(Ln,{viewData:p}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"VIEW"}),o("span",{children:p.total_views}),p.total_partials>0&&o("span",{class:"profiler-text--muted profiler-text--xs",children:["+",p.total_partials,"p"]})]}),f&&f.total_reads>0&&o(U,{href:`/_profiler/profiles/${e}?tab=cache`,className:W,panel:o(In,{cacheData:f}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"CACHE"}),o("span",{class:W,children:[f.hit_rate,"%"]})]}),y&&y.total_requests>0&&o(U,{href:`/_profiler/profiles/${e}?tab=http`,className:y.error_requests>0||y.slow_requests>0?"profiler-text--error":"profiler-text--success",panelLarge:!0,panel:o(Nn,{httpData:y}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"HTTP"}),o("span",{children:y.total_requests}),y.slow_requests>0&&o("span",{class:"profiler-text--error profiler-text--xs",children:["\u25B2 ",y.slow_requests]}),o("span",{class:"profiler-text--muted profiler-text--xs",children:[y.total_duration.toFixed(1),"ms"]})]}),c&&c.count>0&&o(U,{href:`/_profiler/profiles/${e}?tab=dump`,className:"profiler-text--warning",panelLarge:!0,panel:o(Vn,{dumpData:c}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"DUMP"}),o("span",{class:"profiler-text--warning",children:c.count})]}),l&&l.count>0&&o(U,{href:`/_profiler/profiles/${e}?tab=logs`,className:l.errors>0?"profiler-text--error":l.warnings>0?"profiler-text--warning":"profiler-text--muted",panelLarge:!0,panel:o(jn,{logData:l}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"LOG"}),o("span",{class:l.errors>0?"profiler-text--error":l.warnings>0?"profiler-text--warning":"",children:l.errors>0?l.errors:l.warnings>0?l.warnings:l.count})]}),m&&m.exception_class&&o(U,{href:`/_profiler/profiles/${e}?tab=exception`,className:"profiler-text--error",panelLarge:!0,panel:o(Gn,{exceptionData:m}),children:[o("span",{class:"profiler-text--error profiler-text--xs",children:"\u{1F4A5}"}),o("span",{class:"profiler-text--error profiler-text--xs",children:m.exception_class.split("::").pop()})]}),d&&d.total>0&&o(U,{href:`/_profiler/profiles/${e}?tab=routes`,panelLarge:!0,panel:o(Hn,{routesData:d}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"ROUTE"}),o("span",{class:"profiler-text--xs profiler-text--mono",children:d.matched?.pattern??"-"})]}),T&&T.total>0&&o(U,{href:`/_profiler/profiles/${e}?tab=i18n`,className:T.missing_count>0?"profiler-text--error":"profiler-text--muted",panel:o(Jn,{i18nData:T}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"I18N"}),o("span",{class:"profiler-text--xs profiler-text--mono",children:T.locale}),T.missing_count>0&&o("span",{class:"profiler-text--error profiler-text--xs",children:["\u26A0 ",T.missing_count]})]}),g.length>0&&o(U,{href:`/_profiler/profiles/${e}?tab=jobs`,className:g.some(j=>j.status==="failed")?"profiler-text--error":g.some(j=>j.status==="running")?"profiler-text--info":"profiler-text--success",panelLarge:!0,panel:o(Bn,{jobs:g}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"JOB"}),o("span",{children:g.length}),g.some(j=>j.status==="failed")&&o("span",{class:"profiler-text--error profiler-text--xs",children:"\u2717"}),g.some(j=>j.status==="running")&&o("span",{class:"profiler-spinner profiler-text--info profiler-text--xs","aria-hidden":"true",children:"\u25D0"})]}),v&&(v.total>0||(v.queued_count??0)>0)&&o(U,{href:`/_profiler/profiles/${e}?tab=mailer`,className:v.failed>0?"profiler-text--error":"profiler-text--success",panelLarge:!0,panel:o(Wn,{mailerData:v}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"MAIL"}),v.total>0&&o("span",{children:v.total}),v.total===0&&(v.queued_count??0)>0&&o("span",{class:"profiler-text--muted",children:[v.queued_count,"q"]}),v.total>0&&(v.queued_count??0)>0&&o("span",{class:"profiler-text--muted profiler-text--xs",children:["+",v.queued_count,"q"]}),v.failed>0&&o("span",{class:"profiler-text--error profiler-text--xs",children:["\u25B2 ",v.failed]})]}),x&&x.total>0&&o(U,{href:`/_profiler/profiles/${e}?tab=env`,panel:o($n,{envData:x}),children:[o("span",{class:"profiler-text--muted profiler-text--xs",children:"ENV"}),o("span",{class:"profiler-text--muted",children:x.total})]}),o("a",{href:"/_profiler",class:"profiler-toolbar-item profiler-toolbar-logo",children:"\u2B21 Profiler"})]})})}var Vo="profiler-active-slave",No=(()=>{try{let t=sessionStorage.getItem(Vo);return t?`/slaves/${t}`:""}catch{return""}})();function Zn(){return No}async function Mt(t){let e=Zn(),r=e?t.url.replace("/_profiler/api",`/_profiler/api${e}`):t.url,{method:n,params:i,data:s,headers:u={},signal:p}=t,f=r,c=i?"?"+new URLSearchParams(Object.entries(i).map(([d,T])=>[d,String(T)])).toString():"",y={"X-Profiler-Request":"1",...u},l=await fetch(f+c,{method:n,signal:p,headers:s!==void 0?{"Content-Type":"application/json",...y}:y,body:s!==void 0?JSON.stringify(s):void 0});if(l.status===204)return{};let m=await l.json();if(!l.ok)throw Object.assign(new Error(m?.error??`HTTP ${l.status}`),{status:l.status,data:m});return m}var jo=(t,e)=>{let r={queryKey:e};for(let n of Object.keys(t))n!=="queryKey"&&Object.defineProperty(r,n,{enumerable:!0,configurable:!0,get:()=>t[n]});return r};var Go=(t,e)=>Mt({url:`/_profiler/api/toolbar/${t}`,method:"GET",signal:e}),Ho=t=>[`/_profiler/api/toolbar/${t}`],Jo=(t,e)=>{let{query:r}=e??{};return{queryKey:r?.queryKey??Ho(t),queryFn:({signal:s})=>Go(t,s),enabled:t!=null,...r}};function eo(t,e){let r=Jo(t,e),n=hr(r);return jo(n,r.queryKey)}var to=[1e3,1e3,2e3,2e3,4e3,4e3,8e3,8e3,15e3,15e3],Bo=3e4,$o=10*6e4;function Wo(t){return typeof t=="object"&&t!==null&&Number.isFinite(t.cursor)}function ro(t){let e=t.now??(()=>Date.now()),r=t.setTimer??((T,x)=>setTimeout(T,x)),n=t.clearTimer??(T=>clearTimeout(T)),i=t.cursor,s=0,u=e(),p=null,f=!1,c=!1,y=!1,l=()=>{p!==null&&(n(p),p=null)},m=()=>{if(l(),c||f||e()-u>=$o)return;let T=s<to.length?to[s]:Bo;s+=1,p=r(()=>{p=null,d()},T)},d=async()=>{if(!(c||y)){y=!0;try{let T=await t.check(i);if(c)return;Wo(T)&&(i=Math.max(i,T.cursor),T.updated===!0&&(s=0,u=e(),t.onUpdate()))}catch{}finally{y=!1}m()}};return m(),{pause(){f=!0,l()},resume(){c||(f=!1,l(),d())},stop(){c=!0,l()}}}var zo="/_profiler";function no(t,e,r){let n=ge(r);n.current=r,B(()=>{if(!t||e===void 0)return;let s=ro({cursor:e,check:p=>Mt({url:`${zo}/api/events/${encodeURIComponent(t)}`,method:"GET",params:{since:p}}),onUpdate:()=>n.current()}),u=()=>{document.hidden?s.pause():s.resume()};return document.addEventListener("visibilitychange",u),document.hidden&&s.pause(),()=>{document.removeEventListener("visibilitychange",u),s.stop()}},[t,e!==void 0])}var Tr=280;function oo(t){let e=localStorage.getItem("profiler-theme"),r=e==="light"?"light":e==="dark"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";t.forEach(n=>n.setAttribute("data-theme",r))}var Xo=new lr({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function Yo({token:t}){let{data:e,refetch:r}=eo(t,{query:{refetchOnWindowFocus:!1}});B(()=>{window.__PROFILER_REFRESH_TOOLBAR__=()=>{r()}},[r]),no(t,e?.events_cursor,()=>{r()});let n=e?.profile??null;return n?o(Yn,{profile:n,token:t}):null}function so(){let t=document.getElementById("profiler-toolbar"),e=document.getElementById("profiler-toolbar-toggle");if(!t||!e)return;let r=t.dataset.token;if(!r)return;window.__PROFILER_TOOLBAR_TEARDOWN__?.();let n=new AbortController,{signal:i}=n,s=()=>{n.abort(),Nt(null,t),window.__PROFILER_TOOLBAR_TEARDOWN__===s&&delete window.__PROFILER_TOOLBAR_TEARDOWN__};window.__PROFILER_TOOLBAR_TEARDOWN__=s,document.addEventListener("turbo:load",()=>{t.isConnected||s()},{signal:i});let u=[t,e];oo(u),window.addEventListener("storage",c=>{c.key==="profiler-theme"&&oo(u)},{signal:i}),window.addEventListener("profiler:theme-change",(c=>{c.detail?.theme&&u.forEach(y=>y.setAttribute("data-theme",c.detail.theme))}),{signal:i});let p=localStorage.getItem("profiler-toolbar-collapsed")==="true";e.dataset.collapsed=String(p),p&&!t.style.transform&&(t.style.animation="none",t.style.transform="translateX(calc(100% + 44px))"),p||setTimeout(()=>{t.style.animation="none"},400);function f(){let c=!p;p=c,localStorage.setItem("profiler-toolbar-collapsed",String(c)),e.dataset.collapsed=String(c),c?(t.style.transition=`transform ${Tr}ms cubic-bezier(0.4,0,0.2,1)`,t.style.transform="translateX(calc(100% + 44px))"):(t.style.transition="none",t.style.transform="translateX(calc(100% + 44px))",t.offsetWidth,t.style.transition=`transform ${Tr}ms cubic-bezier(0.4,0,0.2,1)`,t.style.transform="translateX(0)",setTimeout(()=>{t.style.transform="",t.style.transition=""},Tr+50))}e.addEventListener("click",f,{signal:i}),document.addEventListener("keydown",c=>{c.altKey&&c.key==="p"&&(c.preventDefault(),f())},{signal:i}),Nt(o(fr,{client:Xo,children:o(Yo,{token:r})}),t)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",so):so();})();
1
+ "use strict";(()=>{var br=t=>{throw TypeError(t)};var Kt=(t,e,r)=>e.has(t)||br("Cannot "+r);var a=(t,e,r)=>(Kt(t,e,"read from private field"),r?r.call(t):e.get(t)),_=(t,e,r)=>e.has(t)?br("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),h=(t,e,r,o)=>(Kt(t,e,"write to private field"),o?o.call(t,r):e.set(t,r),r),E=(t,e,r)=>(Kt(t,e,"access private method"),r);var Ye=(t,e,r,o)=>({set _(i){h(t,e,i,r)},get _(){return a(t,e,o)}});var vt,P,Cr,fo,ue,Rr,Pr,Ar,Or,Lt,Ft,St,Qr,mt={},Tt=[],yo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,gt=Array.isArray;function oe(t,e){for(var r in e)t[r]=e[r];return t}function It(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ho(t,e,r){var o,i,s,u={};for(s in e)s=="key"?o=e[s]:s=="ref"?i=e[s]:u[s]=e[s];if(arguments.length>2&&(u.children=arguments.length>3?vt.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)u[s]===void 0&&(u[s]=t.defaultProps[s]);return ht(t,u,o,i,null)}function ht(t,e,r,o,i){var s={type:t,props:e,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Cr,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(s),s}function b(t){return t.children}function Me(t,e){this.props=t,this.context=e}function De(t,e){if(e==null)return t.__?De(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?De(t):null}function mo(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,o=[],i=[],s=oe({},e);s.__v=e.__v+1,P.vnode&&P.vnode(s),Vt(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,o,r??De(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,Kr(o,s,i),e.__e=e.__=null,s.__e!=r&&qr(s)}}function qr(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),qr(t)}function Ut(t){(!t.__d&&(t.__d=!0)&&ue.push(t)&&!_t.__r++||Rr!=P.debounceRendering)&&((Rr=P.debounceRendering)||Pr)(_t)}function _t(){try{for(var t,e=1;ue.length;)ue.length>e&&ue.sort(Ar),t=ue.shift(),e=ue.length,mo(t)}finally{ue.length=_t.__r=0}}function Mr(t,e,r,o,i,s,u,p,f,c,y){var l,m,d,T,x,v,g,R=o&&o.__k||Tt,q=e.length;for(f=To(r,e,R,f,q),l=0;l<q;l++)(d=r.__k[l])!=null&&(m=d.__i!=-1&&R[d.__i]||mt,d.__i=l,v=Vt(t,d,m,i,s,u,p,f,c,y),T=d.__e,d.ref&&m.ref!=d.ref&&(m.ref&&Nt(m.ref,null,d),y.push(d.ref,d.__c||T,d)),x==null&&T!=null&&(x=T),(g=!!(4&d.__u))||m.__k===d.__k?f=Dr(d,f,t,g):typeof d.type=="function"&&v!==void 0?f=v:T&&(f=T.nextSibling),d.__u&=-7);return r.__e=x,f}function To(t,e,r,o,i){var s,u,p,f,c,y=r.length,l=y,m=0;for(t.__k=new Array(i),s=0;s<i;s++)(u=e[s])!=null&&typeof u!="boolean"&&typeof u!="function"?(typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?u=t.__k[s]=ht(null,u,null,null,null):gt(u)?u=t.__k[s]=ht(b,{children:u},null,null,null):u.constructor===void 0&&u.__b>0?u=t.__k[s]=ht(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):t.__k[s]=u,f=s+m,u.__=t,u.__b=t.__b+1,p=null,(c=u.__i=_o(u,r,f,l))!=-1&&(l--,(p=r[c])&&(p.__u|=2)),p==null||p.__v==null?(c==-1&&(i>y?m--:i<y&&m++),typeof u.type!="function"&&(u.__u|=4)):c!=f&&(c==f-1?m--:c==f+1?m++:(c>f?m--:m++,u.__u|=4))):t.__k[s]=null;if(l)for(s=0;s<y;s++)(p=r[s])!=null&&(2&p.__u)==0&&(p.__e==o&&(o=De(p)),Sr(p,p));return o}function Dr(t,e,r,o){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=Dr(i[s],e,r,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=De(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function _o(t,e,r,o){var i,s,u,p=t.key,f=t.type,c=e[r],y=c!=null&&(2&c.__u)==0;if(c===null&&p==null||y&&p==c.key&&f==c.type)return r;if(o>(y?1:0)){for(i=r-1,s=r+1;i>=0||s<e.length;)if((c=e[u=i>=0?i--:s++])!=null&&(2&c.__u)==0&&p==c.key&&f==c.type)return u}return-1}function Er(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||yo.test(e)?r:r+"px"}function dt(t,e,r,o,i){var s,u;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)r&&e in r||Er(t.style,e,"");if(r)for(e in r)o&&r[e]==o[e]||Er(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Or,"$1")),u=e.toLowerCase(),e=u in t||e=="onFocusOut"||e=="onFocusIn"?u.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?o?r.u=o.u:(r.u=Lt,t.addEventListener(e,s?St:Ft,s)):t.removeEventListener(e,s?St:Ft,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function wr(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Lt++;else if(e.t<r.u)return;return r(P.event?P.event(e):e)}}}function Vt(t,e,r,o,i,s,u,p,f,c){var y,l,m,d,T,x,v,g,R,q,F,L,W,G,H,Q=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(f=!!(32&r.__u),s=[p=e.__e=r.__e]),(y=P.__b)&&y(e);e:if(typeof Q=="function")try{if(g=e.props,R=Q.prototype&&Q.prototype.render,q=(y=Q.contextType)&&o[y.__c],F=y?q?q.props.value:y.__:o,r.__c?v=(l=e.__c=r.__c).__=l.__E:(R?e.__c=l=new Q(g,F):(e.__c=l=new Me(g,F),l.constructor=Q,l.render=go),q&&q.sub(l),l.state||(l.state={}),l.__n=o,m=l.__d=!0,l.__h=[],l._sb=[]),R&&l.__s==null&&(l.__s=l.state),R&&Q.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=oe({},l.__s)),oe(l.__s,Q.getDerivedStateFromProps(g,l.__s))),d=l.props,T=l.state,l.__v=e,m)R&&Q.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),R&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(R&&Q.getDerivedStateFromProps==null&&g!==d&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,F),e.__v==r.__v||!l.__e&&l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,F)===!1){e.__v!=r.__v&&(l.props=g,l.state=l.__s,l.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(B){B&&(B.__=e)}),Tt.push.apply(l.__h,l._sb),l._sb=[],l.__h.length&&u.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,F),R&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(d,T,x)})}if(l.context=F,l.props=g,l.__P=t,l.__e=!1,L=P.__r,W=0,R)l.state=l.__s,l.__d=!1,L&&L(e),y=l.render(l.props,l.state,l.context),Tt.push.apply(l.__h,l._sb),l._sb=[];else do l.__d=!1,L&&L(e),y=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++W<25);l.state=l.__s,l.getChildContext!=null&&(o=oe(oe({},o),l.getChildContext())),R&&!m&&l.getSnapshotBeforeUpdate!=null&&(x=l.getSnapshotBeforeUpdate(d,T)),G=y!=null&&y.type===b&&y.key==null?Fr(y.props.children):y,p=Mr(t,gt(G)?G:[G],e,r,o,i,s,u,p,f,c),l.base=e.__e,e.__u&=-161,l.__h.length&&u.push(l),v&&(l.__E=l.__=null)}catch(B){if(e.__v=null,f||s!=null)if(B.then){for(e.__u|=f?160:128;p&&p.nodeType==8&&p.nextSibling;)p=p.nextSibling;s[s.indexOf(p)]=null,e.__e=p}else{for(H=s.length;H--;)It(s[H]);kt(e)}else e.__e=r.__e,e.__k=r.__k,B.then||kt(e);P.__e(B,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):p=e.__e=vo(r.__e,e,r,o,i,s,u,f,c);return(y=P.diffed)&&y(e),128&e.__u?void 0:p}function kt(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(kt))}function Kr(t,e,r){for(var o=0;o<r.length;o++)Nt(r[o],r[++o],r[++o]);P.__c&&P.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){P.__e(s,i.__v)}})}function Fr(t){return typeof t!="object"||t==null||t.__b>0?t:gt(t)?t.map(Fr):oe({},t)}function vo(t,e,r,o,i,s,u,p,f){var c,y,l,m,d,T,x,v=r.props||mt,g=e.props,R=e.type;if(R=="svg"?i="http://www.w3.org/2000/svg":R=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(c=0;c<s.length;c++)if((d=s[c])&&"setAttribute"in d==!!R&&(R?d.localName==R:d.nodeType==3)){t=d,s[c]=null;break}}if(t==null){if(R==null)return document.createTextNode(g);t=document.createElementNS(i,R,g.is&&g),p&&(P.__m&&P.__m(e,s),p=!1),s=null}if(R==null)v===g||p&&t.data==g||(t.data=g);else{if(s=s&&vt.call(t.childNodes),!p&&s!=null)for(v={},c=0;c<t.attributes.length;c++)v[(d=t.attributes[c]).name]=d.value;for(c in v)d=v[c],c=="dangerouslySetInnerHTML"?l=d:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||dt(t,c,null,d,i);for(c in g)d=g[c],c=="children"?m=d:c=="dangerouslySetInnerHTML"?y=d:c=="value"?T=d:c=="checked"?x=d:p&&typeof d!="function"||v[c]===d||dt(t,c,d,v[c],i);if(y)p||l&&(y.__html==l.__html||y.__html==t.innerHTML)||(t.innerHTML=y.__html),e.__k=[];else if(l&&(t.innerHTML=""),Mr(e.type=="template"?t.content:t,gt(m)?m:[m],e,r,o,R=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,u,s?s[0]:r.__k&&De(r,0),p,f),s!=null)for(c=s.length;c--;)It(s[c]);p||(c="value",R=="progress"&&T==null?t.removeAttribute("value"):T!=null&&(T!==t[c]||R=="progress"&&!T||R=="option"&&T!=v[c])&&dt(t,c,T,v[c],i),c="checked",x!=null&&x!=t[c]&&dt(t,c,x,v[c],i))}return t}function Nt(t,e,r){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(i){P.__e(i,r)}}function Sr(t,e,r){var o,i;if(P.unmount&&P.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Nt(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(s){P.__e(s,e)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&Sr(o[i],e,r||typeof t.type!="function");r||It(t.__e),t.__c=t.__=t.__e=void 0}function go(t,e,r){return this.constructor(t,r)}function Gt(t,e,r){var o,i,s,u;e==document&&(e=document.documentElement),P.__&&P.__(t,e),i=(o=typeof r=="function")?null:r&&r.__k||e.__k,s=[],u=[],Vt(e,t=(!o&&r||e).__k=ho(b,null,[t]),i||mt,mt,e.namespaceURI,!o&&r?[r]:i?null:e.firstChild?vt.call(e.childNodes):null,s,!o&&r?r:i?i.__e:e.firstChild,o,u),Kr(s,t,u)}function Ke(t){function e(r){var o,i;return this.getChildContext||(o=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(s){this.props.value!=s.value&&o.forEach(function(u){u.__e=!0,Ut(u)})},this.sub=function(s){o.add(s);var u=s.componentWillUnmount;s.componentWillUnmount=function(){o&&o.delete(s),u&&u.call(s)}}),r.children}return e.__c="__cC"+Qr++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,o){return r.children(o)}).contextType=e,e}vt=Tt.slice,P={__e:function(t,e,r,o){for(var i,s,u;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),u=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,o||{}),u=i.__d),u)return i.__E=i}catch(p){t=p}throw t}},Cr=0,fo=function(t){return t!=null&&t.constructor===void 0},Me.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=oe({},this.state),typeof t=="function"&&(t=t(oe({},r),this.props)),t&&oe(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Ut(this))},Me.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ut(this))},Me.prototype.render=b,ue=[],Pr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ar=function(t,e){return t.__v.__b-e.__v.__b},_t.__r=0,Or=/(PointerCapture)$|Capture$/i,Lt=0,Ft=wr(!1),St=wr(!0),Qr=0;var Y=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};var _e,le,Fe,Ur,xo=(Ur=class extends Y{constructor(){super();_(this,_e);_(this,le);_(this,Fe);h(this,Fe,e=>{if(typeof window<"u"&&window.addEventListener){let r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){a(this,le)||this.setEventListener(a(this,Fe))}onUnsubscribe(){var e;this.hasListeners()||((e=a(this,le))==null||e.call(this),h(this,le,void 0))}setEventListener(e){var r;h(this,Fe,e),(r=a(this,le))==null||r.call(this),h(this,le,e(o=>{typeof o=="boolean"?this.setFocused(o):this.onFocus()}))}setFocused(e){a(this,_e)!==e&&(h(this,_e,e),this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(r=>{r(e)})}isFocused(){return typeof a(this,_e)=="boolean"?a(this,_e):globalThis.document?.visibilityState!=="hidden"}},_e=new WeakMap,le=new WeakMap,Fe=new WeakMap,Ur),Se=new xo;var bo={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},pe,jt,kr,Ro=(kr=class{constructor(){_(this,pe,bo);_(this,jt,!1)}setTimeoutProvider(t){h(this,pe,t)}setTimeout(t,e){return a(this,pe).setTimeout(t,e)}clearTimeout(t){a(this,pe).clearTimeout(t)}setInterval(t,e){return a(this,pe).setInterval(t,e)}clearInterval(t){a(this,pe).clearInterval(t)}},pe=new WeakMap,jt=new WeakMap,kr),Z=new Ro;function Lr(t){setTimeout(t,0)}var Bt=typeof window>"u"||"Deno"in globalThis;function K(){}function Nr(t,e){return typeof t=="function"?t(e):t}function Ze(t){return typeof t=="number"&&t>=0&&t!==1/0}function xt(t,e){return Math.max(t+(e||0)-Date.now(),0)}function z(t,e){return typeof t=="function"?t(e):t}function I(t,e){return typeof t=="function"?t(e):t}function bt(t,e){let{type:r="all",exact:o,fetchStatus:i,predicate:s,queryKey:u,stale:p}=t;if(u){if(o){if(e.queryHash!==et(u,e.options))return!1}else if(!ge(e.queryKey,u))return!1}if(r!=="all"){let f=e.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof p=="boolean"&&e.isStale()!==p||i&&i!==e.state.fetchStatus||s&&!s(e))}function Rt(t,e){let{exact:r,status:o,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(r){if(ve(e.options.mutationKey)!==ve(s))return!1}else if(!ge(e.options.mutationKey,s))return!1}return!(o&&e.state.status!==o||i&&!i(e))}function et(t,e){return(e?.queryKeyHashFn||ve)(t)}function ve(t){return JSON.stringify(t,(e,r)=>Ht(r)?Object.keys(r).sort().reduce((o,i)=>(o[i]=r[i],o),{}):r)}function ge(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>ge(t[r],e[r])):!1}var Eo=Object.prototype.hasOwnProperty;function Jt(t,e,r=0){if(t===e)return t;if(r>500)return e;let o=Ir(t)&&Ir(e);if(!o&&!(Ht(t)&&Ht(e)))return e;let s=(o?t:Object.keys(t)).length,u=o?e:Object.keys(e),p=u.length,f=o?new Array(p):{},c=0;for(let y=0;y<p;y++){let l=o?y:u[y],m=t[l],d=e[l];if(m===d){f[l]=m,(o?y<s:Eo.call(t,l))&&c++;continue}if(m===null||d===null||typeof m!="object"||typeof d!="object"){f[l]=d;continue}let T=Jt(m,d,r+1);f[l]=T,T===m&&c++}return s===p&&c===s?t:f}function Et(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let r in t)if(t[r]!==e[r])return!1;return!0}function Ir(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Ht(t){if(!Vr(t))return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(!Vr(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Vr(t){return Object.prototype.toString.call(t)==="[object Object]"}function Gr(t){return new Promise(e=>{Z.setTimeout(e,t)})}function tt(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?Jt(t,e):e}function jr(t,e,r=0){let o=[...t,e];return r&&o.length>r?o.slice(1):o}function Hr(t,e,r=0){let o=[e,...t];return r&&o.length>r?o.slice(0,-1):o}var Ue=Symbol();function wt(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===Ue?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function $t(t,e){return typeof t=="function"?t(...e):!!t}function Br(t,e,r){let o=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),o||(o=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),t}var ee=(()=>{let t=()=>Bt;return{isServer(){return t()},setIsServer(e){t=e}}})();function rt(){let t,e,r=new Promise((i,s)=>{t=i,e=s});r.status="pending",r.catch(()=>{});function o(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{o({status:"fulfilled",value:i}),t(i)},r.reject=i=>{o({status:"rejected",reason:i}),e(i)},r}var Jr=Lr;function wo(){let t=[],e=0,r=p=>{p()},o=p=>{p()},i=Jr,s=p=>{e?t.push(p):i(()=>{r(p)})},u=()=>{let p=t;t=[],p.length&&i(()=>{o(()=>{p.forEach(f=>{r(f)})})})};return{batch:p=>{let f;e++;try{f=p()}finally{e--,e||u()}return f},batchCalls:p=>(...f)=>{s(()=>{p(...f)})},schedule:s,setNotifyFunction:p=>{r=p},setBatchNotifyFunction:p=>{o=p},setScheduler:p=>{i=p}}}var A=wo();var ke,ce,Le,$r,Co=($r=class extends Y{constructor(){super();_(this,ke,!0);_(this,ce);_(this,Le);h(this,Le,e=>{if(typeof window<"u"&&window.addEventListener){let r=()=>e(!0),o=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",o,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",o)}}})}onSubscribe(){a(this,ce)||this.setEventListener(a(this,Le))}onUnsubscribe(){var e;this.hasListeners()||((e=a(this,ce))==null||e.call(this),h(this,ce,void 0))}setEventListener(e){var r;h(this,Le,e),(r=a(this,ce))==null||r.call(this),h(this,ce,e(this.setOnline.bind(this)))}setOnline(e){a(this,ke)!==e&&(h(this,ke,e),this.listeners.forEach(o=>{o(e)}))}isOnline(){return a(this,ke)}},ke=new WeakMap,ce=new WeakMap,Le=new WeakMap,$r),Ie=new Co;function Po(t){return Math.min(1e3*2**t,3e4)}function Wt(t){return(t??"online")==="online"?Ie.isOnline():!0}var Ct=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function Pt(t){let e=!1,r=0,o,i=rt(),s=()=>i.status!=="pending",u=x=>{if(!s()){let v=new Ct(x);m(v),t.onCancel?.(v)}},p=()=>{e=!0},f=()=>{e=!1},c=()=>Se.isFocused()&&(t.networkMode==="always"||Ie.isOnline())&&t.canRun(),y=()=>Wt(t.networkMode)&&t.canRun(),l=x=>{s()||(o?.(),i.resolve(x))},m=x=>{s()||(o?.(),i.reject(x))},d=()=>new Promise(x=>{o=v=>{(s()||c())&&x(v)},t.onPause?.()}).then(()=>{o=void 0,s()||t.onContinue?.()}),T=()=>{if(s())return;let x,v=r===0?t.initialPromise:void 0;try{x=v??t.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(l).catch(g=>{if(s())return;let R=t.retry??(ee.isServer()?0:3),q=t.retryDelay??Po,F=typeof q=="function"?q(r,g):q,L=R===!0||typeof R=="number"&&r<R||typeof R=="function"&&R(r,g);if(e||!L){m(g);return}r++,t.onFail?.(r,g),Gr(F).then(()=>c()?void 0:d()).then(()=>{e?m(g):T()})})};return{promise:i,status:()=>i.status,cancel:u,continue:()=>(o?.(),i),cancelRetry:p,continueRetry:f,canStart:y,start:()=>(y()?T():d().then(T),i)}}var xe,Wr,At=(Wr=class{constructor(){_(this,xe)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ze(this.gcTime)&&h(this,xe,Z.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(ee.isServer()?1/0:300*1e3))}clearGcTimeout(){a(this,xe)!==void 0&&(Z.clearTimeout(a(this,xe)),h(this,xe,void 0))}},xe=new WeakMap,Wr);function Xr(t){return{onFetch:(e,r)=>{let o=e.options,i=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],u=e.state.data?.pageParams||[],p={pages:[],pageParams:[]},f=0,c=async()=>{let y=!1,l=T=>{Br(T,()=>e.signal,()=>y=!0)},m=wt(e.options,e.fetchOptions),d=async(T,x,v)=>{if(y)return Promise.reject(e.signal.reason);if(x==null&&T.pages.length)return Promise.resolve(T);let R=(()=>{let W={client:e.client,queryKey:e.queryKey,pageParam:x,direction:v?"backward":"forward",meta:e.options.meta};return l(W),W})(),q=await m(R),{maxPages:F}=e.options,L=v?Hr:jr;return{pages:L(T.pages,q,F),pageParams:L(T.pageParams,x,F)}};if(i&&s.length){let T=i==="backward",x=T?Ao:zr,v={pages:s,pageParams:u},g=x(o,v);p=await d(v,g,T)}else{let T=t??s.length;do{let x=f===0?u[0]??o.initialPageParam:zr(o,p);if(f>0&&x==null)break;p=await d(p,x),f++}while(f<T)}return p};e.options.persister?e.fetchFn=()=>e.options.persister?.(c,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r):e.fetchFn=c}}}function zr(t,{pages:e,pageParams:r}){let o=e.length-1;return e.length>0?t.getNextPageParam(e[o],e,r[o],r):void 0}function Ao(t,{pages:e,pageParams:r}){return e.length>0?t.getPreviousPageParam?.(e[0],e,r[0],r):void 0}var Ve,be,Ne,J,Re,S,nt,Ee,j,rn,se,en,tn=(en=class extends At{constructor(e){super();_(this,j);_(this,Ve);_(this,be);_(this,Ne);_(this,J);_(this,Re);_(this,S);_(this,nt);_(this,Ee);h(this,Ee,!1),h(this,nt,e.defaultOptions),this.setOptions(e.options),this.observers=[],h(this,Re,e.client),h(this,J,a(this,Re).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,h(this,be,Zr(this.options)),this.state=e.state??a(this,be),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return a(this,Ve)}get promise(){return a(this,S)?.promise}setOptions(e){if(this.options={...a(this,nt),...e},e?._type&&h(this,Ve,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let r=Zr(this.options);r.data!==void 0&&(this.setState(Yr(r.data,r.dataUpdatedAt)),h(this,be,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&a(this,J).remove(this)}setData(e,r){let o=tt(this.state.data,e,this.options);return E(this,j,se).call(this,{data:o,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),o}setState(e){E(this,j,se).call(this,{type:"setState",state:e})}cancel(e){let r=a(this,S)?.promise;return a(this,S)?.cancel(e),r?r.then(K).catch(K):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return a(this,be)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>I(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ue||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>z(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!xt(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(r=>r.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),a(this,S)?.continue()}onOnline(){this.observers.find(r=>r.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),a(this,S)?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),a(this,J).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(a(this,S)&&(a(this,Ee)||E(this,j,rn).call(this)?a(this,S).cancel({revert:!0}):a(this,S).cancelRetry()),this.scheduleGc()),a(this,J).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||E(this,j,se).call(this,{type:"invalidate"})}async fetch(e,r){if(this.state.fetchStatus!=="idle"&&a(this,S)?.status()!=="rejected"){if(this.state.data!==void 0&&r?.cancelRefetch)this.cancel({silent:!0});else if(a(this,S))return a(this,S).continueRetry(),a(this,S).promise}if(e&&this.setOptions(e),!this.options.queryFn){let c=this.observers.find(y=>y.options.queryFn);c&&this.setOptions(c.options)}let o=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(h(this,Ee,!0),o.signal)})},s=()=>{let c=wt(this.options,r),l=(()=>{let m={client:a(this,Re),queryKey:this.queryKey,meta:this.meta};return i(m),m})();return h(this,Ee,!1),this.options.persister?this.options.persister(c,l,this):c(l)},p=(()=>{let c={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:a(this,Re),state:this.state,fetchFn:s};return i(c),c})();(a(this,Ve)==="infinite"?Xr(this.options.pages):this.options.behavior)?.onFetch(p,this),h(this,Ne,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==p.fetchOptions?.meta)&&E(this,j,se).call(this,{type:"fetch",meta:p.fetchOptions?.meta}),h(this,S,Pt({initialPromise:r?.initialPromise,fn:p.fetchFn,onCancel:c=>{c instanceof Ct&&c.revert&&this.setState({...a(this,Ne),fetchStatus:"idle"}),o.abort()},onFail:(c,y)=>{E(this,j,se).call(this,{type:"failed",failureCount:c,error:y})},onPause:()=>{E(this,j,se).call(this,{type:"pause"})},onContinue:()=>{E(this,j,se).call(this,{type:"continue"})},retry:p.options.retry,retryDelay:p.options.retryDelay,networkMode:p.options.networkMode,canRun:()=>!0}));try{let c=await a(this,S).start();if(c===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(c),a(this,J).config.onSuccess?.(c,this),a(this,J).config.onSettled?.(c,this.state.error,this),c}catch(c){if(c instanceof Ct){if(c.silent)return a(this,S).promise;if(c.revert){if(this.state.data===void 0)throw c;return this.state.data}}throw E(this,j,se).call(this,{type:"error",error:c}),a(this,J).config.onError?.(c,this),a(this,J).config.onSettled?.(this.state.data,c,this),c}finally{this.scheduleGc()}}},Ve=new WeakMap,be=new WeakMap,Ne=new WeakMap,J=new WeakMap,Re=new WeakMap,S=new WeakMap,nt=new WeakMap,Ee=new WeakMap,j=new WeakSet,rn=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},se=function(e){let r=o=>{switch(e.type){case"failed":return{...o,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...o,fetchStatus:"paused"};case"continue":return{...o,fetchStatus:"fetching"};case"fetch":return{...o,...zt(o.data,this.options),fetchMeta:e.meta??null};case"success":let i={...o,...Yr(e.data,e.dataUpdatedAt),dataUpdateCount:o.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return h(this,Ne,e.manual?i:void 0),i;case"error":let s=e.error;return{...o,error:s,errorUpdateCount:o.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:o.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...o,isInvalidated:!0};case"setState":return{...o,...e.state}}};this.state=r(this.state),A.batch(()=>{this.observers.forEach(o=>{o.onQueryUpdate()}),a(this,J).notify({query:this,type:"updated",action:e})})},en);function zt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Yr(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Zr(t){let e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,o=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?o??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var N,w,st,V,we,Ge,ie,fe,it,je,He,Ce,Pe,ye,Be,C,ot,Xt,Yt,Zt,er,tr,rr,nr,an,sn,sr=(sn=class extends Y{constructor(e,r){super();_(this,C);_(this,N);_(this,w);_(this,st);_(this,V);_(this,we);_(this,Ge);_(this,ie);_(this,fe);_(this,it);_(this,je);_(this,He);_(this,Ce);_(this,Pe);_(this,ye);_(this,Be,new Set);this.options=r,h(this,N,e),h(this,fe,null),h(this,ie,rt()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(a(this,w).addObserver(this),nn(a(this,w),this.options)?E(this,C,ot).call(this):this.updateResult(),E(this,C,er).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return or(a(this,w),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return or(a(this,w),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,E(this,C,tr).call(this),E(this,C,rr).call(this),a(this,w).removeObserver(this)}setOptions(e){let r=this.options,o=a(this,w);if(this.options=a(this,N).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof I(this.options.enabled,a(this,w))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");E(this,C,nr).call(this),a(this,w).setOptions(this.options),r._defaulted&&!Et(this.options,r)&&a(this,N).getQueryCache().notify({type:"observerOptionsUpdated",query:a(this,w),observer:this});let i=this.hasListeners();i&&on(a(this,w),o,this.options,r)&&E(this,C,ot).call(this),this.updateResult(),i&&(a(this,w)!==o||I(this.options.enabled,a(this,w))!==I(r.enabled,a(this,w))||z(this.options.staleTime,a(this,w))!==z(r.staleTime,a(this,w)))&&E(this,C,Xt).call(this);let s=E(this,C,Yt).call(this);i&&(a(this,w)!==o||I(this.options.enabled,a(this,w))!==I(r.enabled,a(this,w))||s!==a(this,ye))&&E(this,C,Zt).call(this,s)}getOptimisticResult(e){let r=a(this,N).getQueryCache().build(a(this,N),e),o=this.createResult(r,e);return Qo(this,o)&&(h(this,V,o),h(this,Ge,this.options),h(this,we,a(this,w).state)),o}getCurrentResult(){return a(this,V)}trackResult(e,r){return new Proxy(e,{get:(o,i)=>(this.trackProp(i),r?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&a(this,ie).status==="pending"&&a(this,ie).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(o,i))})}trackProp(e){a(this,Be).add(e)}getCurrentQuery(){return a(this,w)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let r=a(this,N).defaultQueryOptions(e),o=a(this,N).getQueryCache().build(a(this,N),r);return o.fetch().then(()=>this.createResult(o,r))}fetch(e){return E(this,C,ot).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),a(this,V)))}createResult(e,r){let o=a(this,w),i=this.options,s=a(this,V),u=a(this,we),p=a(this,Ge),c=e!==o?e.state:a(this,st),{state:y}=e,l={...y},m=!1,d;if(r._optimisticResults){let Q=this.hasListeners(),B=!Q&&nn(e,r),ct=Q&&on(e,o,r,i);(B||ct)&&(l={...l,...zt(y.data,e.options)}),r._optimisticResults==="isRestoring"&&(l.fetchStatus="idle")}let{error:T,errorUpdatedAt:x,status:v}=l;d=l.data;let g=!1;if(r.placeholderData!==void 0&&d===void 0&&v==="pending"){let Q;s?.isPlaceholderData&&r.placeholderData===p?.placeholderData?(Q=s.data,g=!0):Q=typeof r.placeholderData=="function"?r.placeholderData(a(this,He)?.state.data,a(this,He)):r.placeholderData,Q!==void 0&&(v="success",d=tt(s?.data,Q,r),m=!0)}if(r.select&&d!==void 0&&!g)if(s&&d===u?.data&&r.select===a(this,it))d=a(this,je);else try{h(this,it,r.select),d=r.select(d),d=tt(s?.data,d,r),h(this,je,d),h(this,fe,null)}catch(Q){h(this,fe,Q)}a(this,fe)&&(T=a(this,fe),d=a(this,je),x=Date.now(),v="error");let R=l.fetchStatus==="fetching",q=v==="pending",F=v==="error",L=q&&R,W=d!==void 0,H={status:v,fetchStatus:l.fetchStatus,isPending:q,isSuccess:v==="success",isError:F,isInitialLoading:L,isLoading:L,data:d,dataUpdatedAt:l.dataUpdatedAt,error:T,errorUpdatedAt:x,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>c.dataUpdateCount||l.errorUpdateCount>c.errorUpdateCount,isFetching:R,isRefetching:R&&!q,isLoadingError:F&&!W,isPaused:l.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:F&&W,isStale:ir(e,r),refetch:this.refetch,promise:a(this,ie),isEnabled:I(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let Q=H.data!==void 0,B=H.status==="error"&&!Q,ct=yt=>{B?yt.reject(H.error):Q&&yt.resolve(H.data)},xr=()=>{let yt=h(this,ie,H.promise=rt());ct(yt)},ft=a(this,ie);switch(ft.status){case"pending":e.queryHash===o.queryHash&&ct(ft);break;case"fulfilled":(B||H.data!==ft.value)&&xr();break;case"rejected":(!B||H.error!==ft.reason)&&xr();break}}return H}updateResult(){let e=a(this,V),r=this.createResult(a(this,w),this.options);if(h(this,we,a(this,w).state),h(this,Ge,this.options),a(this,we).data!==void 0&&h(this,He,a(this,w)),Et(r,e))return;h(this,V,r);let o=()=>{if(!e)return!0;let{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!a(this,Be).size)return!0;let u=new Set(s??a(this,Be));return this.options.throwOnError&&u.add("error"),Object.keys(a(this,V)).some(p=>{let f=p;return a(this,V)[f]!==e[f]&&u.has(f)})};E(this,C,an).call(this,{listeners:o()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&E(this,C,er).call(this)}},N=new WeakMap,w=new WeakMap,st=new WeakMap,V=new WeakMap,we=new WeakMap,Ge=new WeakMap,ie=new WeakMap,fe=new WeakMap,it=new WeakMap,je=new WeakMap,He=new WeakMap,Ce=new WeakMap,Pe=new WeakMap,ye=new WeakMap,Be=new WeakMap,C=new WeakSet,ot=function(e){E(this,C,nr).call(this);let r=a(this,w).fetch(this.options,e);return e?.throwOnError||(r=r.catch(K)),r},Xt=function(){E(this,C,tr).call(this);let e=z(this.options.staleTime,a(this,w));if(ee.isServer()||a(this,V).isStale||!Ze(e))return;let o=xt(a(this,V).dataUpdatedAt,e)+1;h(this,Ce,Z.setTimeout(()=>{a(this,V).isStale||this.updateResult()},o))},Yt=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(a(this,w)):this.options.refetchInterval)??!1},Zt=function(e){E(this,C,rr).call(this),h(this,ye,e),!(ee.isServer()||I(this.options.enabled,a(this,w))===!1||!Ze(a(this,ye))||a(this,ye)===0)&&h(this,Pe,Z.setInterval(()=>{(this.options.refetchIntervalInBackground||Se.isFocused())&&E(this,C,ot).call(this)},a(this,ye)))},er=function(){E(this,C,Xt).call(this),E(this,C,Zt).call(this,E(this,C,Yt).call(this))},tr=function(){a(this,Ce)!==void 0&&(Z.clearTimeout(a(this,Ce)),h(this,Ce,void 0))},rr=function(){a(this,Pe)!==void 0&&(Z.clearInterval(a(this,Pe)),h(this,Pe,void 0))},nr=function(){let e=a(this,N).getQueryCache().build(a(this,N),this.options);if(e===a(this,w))return;let r=a(this,w);h(this,w,e),h(this,st,e.state),this.hasListeners()&&(r?.removeObserver(this),e.addObserver(this))},an=function(e){A.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(a(this,V))}),a(this,N).getQueryCache().notify({query:a(this,w),type:"observerResultsUpdated"})})},sn);function Oo(t,e){return I(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&I(e.retryOnMount,t)===!1)}function nn(t,e){return Oo(t,e)||t.state.data!==void 0&&or(t,e,e.refetchOnMount)}function or(t,e,r){if(I(e.enabled,t)!==!1&&z(e.staleTime,t)!=="static"){let o=typeof r=="function"?r(t):r;return o==="always"||o!==!1&&ir(t,e)}return!1}function on(t,e,r,o){return(t!==e||I(o.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&ir(t,r)}function ir(t,e){return I(e.enabled,t)!==!1&&t.isStaleByTime(z(e.staleTime,t))}function Qo(t,e){return!Et(t.getCurrentResult(),e)}var at,te,k,Ae,re,de,un,ln=(un=class extends At{constructor(e){super();_(this,re);_(this,at);_(this,te);_(this,k);_(this,Ae);h(this,at,e.client),this.mutationId=e.mutationId,h(this,k,e.mutationCache),h(this,te,[]),this.state=e.state||qo(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){a(this,te).includes(e)||(a(this,te).push(e),this.clearGcTimeout(),a(this,k).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){h(this,te,a(this,te).filter(r=>r!==e)),this.scheduleGc(),a(this,k).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){a(this,te).length||(this.state.status==="pending"?this.scheduleGc():a(this,k).remove(this))}continue(){return a(this,Ae)?.continue()??this.execute(this.state.variables)}async execute(e){let r=()=>{E(this,re,de).call(this,{type:"continue"})},o={client:a(this,at),meta:this.options.meta,mutationKey:this.options.mutationKey};h(this,Ae,Pt({fn:()=>this.options.mutationFn?this.options.mutationFn(e,o):Promise.reject(new Error("No mutationFn found")),onFail:(u,p)=>{E(this,re,de).call(this,{type:"failed",failureCount:u,error:p})},onPause:()=>{E(this,re,de).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>a(this,k).canRun(this)}));let i=this.state.status==="pending",s=!a(this,Ae).canStart();try{if(i)r();else{E(this,re,de).call(this,{type:"pending",variables:e,isPaused:s}),a(this,k).config.onMutate&&await a(this,k).config.onMutate(e,this,o);let p=await this.options.onMutate?.(e,o);p!==this.state.context&&E(this,re,de).call(this,{type:"pending",context:p,variables:e,isPaused:s})}let u=await a(this,Ae).start();return await a(this,k).config.onSuccess?.(u,e,this.state.context,this,o),await this.options.onSuccess?.(u,e,this.state.context,o),await a(this,k).config.onSettled?.(u,null,this.state.variables,this.state.context,this,o),await this.options.onSettled?.(u,null,e,this.state.context,o),E(this,re,de).call(this,{type:"success",data:u}),u}catch(u){try{await a(this,k).config.onError?.(u,e,this.state.context,this,o)}catch(p){Promise.reject(p)}try{await this.options.onError?.(u,e,this.state.context,o)}catch(p){Promise.reject(p)}try{await a(this,k).config.onSettled?.(void 0,u,this.state.variables,this.state.context,this,o)}catch(p){Promise.reject(p)}try{await this.options.onSettled?.(void 0,u,e,this.state.context,o)}catch(p){Promise.reject(p)}throw E(this,re,de).call(this,{type:"error",error:u}),u}finally{a(this,k).runNext(this)}}},at=new WeakMap,te=new WeakMap,k=new WeakMap,Ae=new WeakMap,re=new WeakSet,de=function(e){let r=o=>{switch(e.type){case"failed":return{...o,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...o,isPaused:!0};case"continue":return{...o,isPaused:!1};case"pending":return{...o,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...o,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...o,data:void 0,error:e.error,failureCount:o.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),A.batch(()=>{a(this,te).forEach(o=>{o.onMutationUpdate(e)}),a(this,k).notify({mutation:this,type:"updated",action:e})})},un);function qo(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ae,X,ut,pn,cn=(pn=class extends Y{constructor(e={}){super();_(this,ae);_(this,X);_(this,ut);this.config=e,h(this,ae,new Set),h(this,X,new Map),h(this,ut,0)}build(e,r,o){let i=new ln({client:e,mutationCache:this,mutationId:++Ye(this,ut)._,options:e.defaultMutationOptions(r),state:o});return this.add(i),i}add(e){a(this,ae).add(e);let r=Ot(e);if(typeof r=="string"){let o=a(this,X).get(r);o?o.push(e):a(this,X).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(a(this,ae).delete(e)){let r=Ot(e);if(typeof r=="string"){let o=a(this,X).get(r);if(o)if(o.length>1){let i=o.indexOf(e);i!==-1&&o.splice(i,1)}else o[0]===e&&a(this,X).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){let r=Ot(e);if(typeof r=="string"){let i=a(this,X).get(r)?.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){let r=Ot(e);return typeof r=="string"?a(this,X).get(r)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){A.batch(()=>{a(this,ae).forEach(e=>{this.notify({type:"removed",mutation:e})}),a(this,ae).clear(),a(this,X).clear()})}getAll(){return Array.from(a(this,ae))}find(e){let r={exact:!0,...e};return this.getAll().find(o=>Rt(r,o))}findAll(e={}){return this.getAll().filter(r=>Rt(e,r))}notify(e){A.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){let e=this.getAll().filter(r=>r.state.isPaused);return A.batch(()=>Promise.all(e.map(r=>r.continue().catch(K))))}},ae=new WeakMap,X=new WeakMap,ut=new WeakMap,pn);function Ot(t){return t.options.scope?.id}var ne,fn,yn=(fn=class extends Y{constructor(e={}){super();_(this,ne);this.config=e,h(this,ne,new Map)}build(e,r,o){let i=r.queryKey,s=r.queryHash??et(i,r),u=this.get(s);return u||(u=new tn({client:e,queryKey:i,queryHash:s,options:e.defaultQueryOptions(r),state:o,defaultOptions:e.getQueryDefaults(i)}),this.add(u)),u}add(e){a(this,ne).has(e.queryHash)||(a(this,ne).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let r=a(this,ne).get(e.queryHash);r&&(e.destroy(),r===e&&a(this,ne).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){A.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return a(this,ne).get(e)}getAll(){return[...a(this,ne).values()]}find(e){let r={exact:!0,...e};return this.getAll().find(o=>bt(r,o))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(o=>bt(e,o)):r}notify(e){A.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){A.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){A.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ne=new WeakMap,fn);var M,he,me,Je,$e,Te,We,ze,dn,ar=(dn=class{constructor(t={}){_(this,M);_(this,he);_(this,me);_(this,Je);_(this,$e);_(this,Te);_(this,We);_(this,ze);h(this,M,t.queryCache||new yn),h(this,he,t.mutationCache||new cn),h(this,me,t.defaultOptions||{}),h(this,Je,new Map),h(this,$e,new Map),h(this,Te,0)}mount(){Ye(this,Te)._++,a(this,Te)===1&&(h(this,We,Se.subscribe(async t=>{t&&(await this.resumePausedMutations(),a(this,M).onFocus())})),h(this,ze,Ie.subscribe(async t=>{t&&(await this.resumePausedMutations(),a(this,M).onOnline())})))}unmount(){var t,e;Ye(this,Te)._--,a(this,Te)===0&&((t=a(this,We))==null||t.call(this),h(this,We,void 0),(e=a(this,ze))==null||e.call(this),h(this,ze,void 0))}isFetching(t){return a(this,M).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return a(this,he).findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return a(this,M).get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),r=a(this,M).build(this,e),o=r.state.data;return o===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(z(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(o))}getQueriesData(t){return a(this,M).findAll(t).map(({queryKey:e,state:r})=>{let o=r.data;return[e,o]})}setQueryData(t,e,r){let o=this.defaultQueryOptions({queryKey:t}),s=a(this,M).get(o.queryHash)?.state.data,u=Nr(e,s);if(u!==void 0)return a(this,M).build(this,o).setData(u,{...r,manual:!0})}setQueriesData(t,e,r){return A.batch(()=>a(this,M).findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,e,r)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return a(this,M).get(e.queryHash)?.state}removeQueries(t){let e=a(this,M);A.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){let r=a(this,M);return A.batch(()=>(r.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let r={revert:!0,...e},o=A.batch(()=>a(this,M).findAll(t).map(i=>i.cancel(r)));return Promise.all(o).then(K).catch(K)}invalidateQueries(t,e={}){return A.batch(()=>(a(this,M).findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){let r={...e,cancelRefetch:e.cancelRefetch??!0},o=A.batch(()=>a(this,M).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let s=i.fetch(void 0,r);return r.throwOnError||(s=s.catch(K)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(o).then(K)}fetchQuery(t){let e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);let r=a(this,M).build(this,e);return r.isStaleByTime(z(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(K).catch(K)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(K).catch(K)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Ie.isOnline()?a(this,he).resumePausedMutations():Promise.resolve()}getQueryCache(){return a(this,M)}getMutationCache(){return a(this,he)}getDefaultOptions(){return a(this,me)}setDefaultOptions(t){h(this,me,t)}setQueryDefaults(t,e){a(this,Je).set(ve(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...a(this,Je).values()],r={};return e.forEach(o=>{ge(t,o.queryKey)&&Object.assign(r,o.defaultOptions)}),r}setMutationDefaults(t,e){a(this,$e).set(ve(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...a(this,$e).values()],r={};return e.forEach(o=>{ge(t,o.mutationKey)&&Object.assign(r,o.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;let e={...a(this,me).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=et(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Ue&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...a(this,me).mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){a(this,M).clear(),a(this,he).clear()}},M=new WeakMap,he=new WeakMap,me=new WeakMap,Je=new WeakMap,$e=new WeakMap,Te=new WeakMap,We=new WeakMap,ze=new WeakMap,dn);var Oe,O,ur,hn,lt=0,Rn=[],D=P,mn=D.__b,Tn=D.__r,_n=D.diffed,vn=D.__c,gn=D.unmount,xn=D.__;function pt(t,e){D.__h&&D.__h(O,t,lt||e),lt=0;var r=O.__H||(O.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Qe(t){return lt=1,Mo(Cn,t)}function Mo(t,e,r){var o=pt(Oe++,2);if(o.t=t,!o.__c&&(o.__=[r?r(e):Cn(void 0,e),function(p){var f=o.__N?o.__N[0]:o.__[0],c=o.t(f,p);f!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=O,!O.__f)){var i=function(p,f,c){if(!o.__c.__H)return!0;var y=o.__c.__H.__.filter(function(m){return m.__c});if(y.every(function(m){return!m.__N}))return!s||s.call(this,p,f,c);var l=o.__c.props!==p;return y.some(function(m){if(m.__N){var d=m.__[0];m.__=m.__N,m.__N=void 0,d!==m.__[0]&&(l=!0)}}),s&&s.call(this,p,f,c)||l};O.__f=!0;var s=O.shouldComponentUpdate,u=O.componentWillUpdate;O.componentWillUpdate=function(p,f,c){if(this.__e){var y=s;s=void 0,i(p,f,c),s=y}u&&u.call(this,p,f,c)},O.shouldComponentUpdate=i}return o.__N||o.__}function $(t,e){var r=pt(Oe++,3);!D.__s&&pr(r.__H,e)&&(r.__=t,r.u=e,O.__H.__h.push(r))}function qt(t,e){var r=pt(Oe++,4);!D.__s&&pr(r.__H,e)&&(r.__=t,r.u=e,O.__h.push(r))}function qe(t){return lt=5,En(function(){return{current:t}},[])}function En(t,e){var r=pt(Oe++,7);return pr(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function wn(t,e){return lt=8,En(function(){return t},e)}function Xe(t){var e=O.context[t.__c],r=pt(Oe++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(O)),e.props.value):t.__}function Do(){for(var t;t=Rn.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Qt),e.__h.some(lr),e.__h=[]}catch(r){e.__h=[],D.__e(r,t.__v)}}}D.__b=function(t){O=null,mn&&mn(t)},D.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),xn&&xn(t,e)},D.__r=function(t){Tn&&Tn(t),Oe=0;var e=(O=t.__c).__H;e&&(ur===O?(e.__h=[],O.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(Qt),e.__h.some(lr),e.__h=[],Oe=0)),ur=O},D.diffed=function(t){_n&&_n(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Rn.push(e)!==1&&hn===D.requestAnimationFrame||((hn=D.requestAnimationFrame)||Ko)(Do)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ur=O=null},D.__c=function(t,e){e.some(function(r){try{r.__h.some(Qt),r.__h=r.__h.filter(function(o){return!o.__||lr(o)})}catch(o){e.some(function(i){i.__h&&(i.__h=[])}),e=[],D.__e(o,r.__v)}}),vn&&vn(t,e)},D.unmount=function(t){gn&&gn(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(o){try{Qt(o)}catch(i){e=i}}),r.__H=void 0,e&&D.__e(e,r.__v))};var bn=typeof requestAnimationFrame=="function";function Ko(t){var e,r=function(){clearTimeout(o),bn&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(r,35);bn&&(e=requestAnimationFrame(r))}function Qt(t){var e=O,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),O=e}function lr(t){var e=O;t.__c=t.__(),O=e}function pr(t,e){return!t||t.length!==e.length||e.some(function(r,o){return r!==t[o]})}function Cn(t,e){return typeof e=="function"?e(t):e}var Pn=Ke(!1),An=()=>Xe(Pn),$i=Pn.Provider;var Fo=0;function n(t,e,r,o,i,s){e||(e={});var u,p,f=e;if("ref"in f)for(p in f={},e)p=="ref"?u=e[p]:f[p]=e[p];var c={type:t,props:f,key:r,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fo,__i:-1,__u:0,__source:i,__self:s};if(typeof t=="function"&&(u=t.defaultProps))for(p in u)f[p]===void 0&&(f[p]=u[p]);return P.vnode&&P.vnode(c),c}var cr=Ke(void 0),fr=t=>{let e=Xe(cr);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},yr=({client:t,children:e})=>($(()=>(t.mount(),()=>{t.unmount()}),[t]),n(cr.Provider,{value:t,children:e}));function So(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var Uo=Ke(So()),On=()=>Xe(Uo);var Qn=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},qn=t=>{$(()=>{t.clearReset()},[t])},Mn=({result:t,errorResetBoundary:e,throwOnError:r,query:o,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&o&&(i&&t.data===void 0||$t(r,[t.error,o]));var Dn=t=>{if(t.suspense){let r=i=>i==="static"?i:Math.max(i??1e3,1e3),o=t.staleTime;t.staleTime=typeof o=="function"?(...i)=>r(o(...i)):r(o),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},Kn=(t,e)=>t.isLoading&&t.isFetching&&!e,Fn=(t,e)=>t?.suspense&&e.isPending,dr=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function Sn(t,e){let r=e(),[{_instance:o},i]=Qe({_instance:{_value:r,_getSnapshot:e}});return qt(()=>{o._value=r,o._getSnapshot=e,hr(o)&&i({_instance:o})},[t,r,e]),$(()=>(hr(o)&&i({_instance:o}),t(()=>{hr(o)&&i({_instance:o})})),[t]),r}function hr(t){let e=t._getSnapshot,r=t._value;try{let o=e();return!Object.is(r,o)}catch{return!0}}function Un(t,e,r){let o=An(),i=On(),s=fr(r),u=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(u),u._optimisticResults=o?"isRestoring":"optimistic",Dn(u),Qn(u,i),qn(i);let p=!s.getQueryCache().get(u.queryHash),[f]=Qe(()=>new e(s,u)),c=f.getOptimisticResult(u),y=!o&&t.subscribed!==!1;if(Sn(wn(l=>{let m=y?f.subscribe(A.batchCalls(l)):K;return f.updateResult(),m},[f,y]),()=>f.getCurrentResult()),$(()=>{f.setOptions(u)},[u,f]),Fn(u,c))throw dr(u,f,i);if(Mn({result:c,errorResetBoundary:i,throwOnError:u.throwOnError,query:s.getQueryCache().get(u.queryHash),suspense:u.suspense}))throw c.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(u,c),u.experimental_prefetchInRender&&!ee.isServer()&&Kn(c,o)&&(p?dr(u,f,i):s.getQueryCache().get(u.queryHash)?.promise)?.catch(K).finally(()=>{f.updateResult()}),u.notifyOnChangeProps?c:f.trackResult(c)}function mr(t,e){return Un(t,sr,e)}function U({children:t,panel:e,href:r,className:o,panelLarge:i}){let[s,u]=Qe(!1),p=qe(null),f=qe(null),c=qe(null),y=()=>{c.current&&(clearTimeout(c.current),c.current=null),f.current=setTimeout(()=>u(!0),100)},l=()=>{f.current&&(clearTimeout(f.current),f.current=null),c.current=setTimeout(()=>u(!1),150)};qt(()=>{if(s&&p.current){let T=p.current;T.style.left="50%",T.style.right="auto",T.style.transform="translateX(-50%)";let x=T.getBoundingClientRect();x.left<8?(T.style.left="0",T.style.transform="none"):x.right>window.innerWidth-8&&(T.style.left="auto",T.style.right="0",T.style.transform="none")}},[s]);let m=["profiler-toolbar-item",e?"profiler-toolbar-hoverable":"",o||""].filter(Boolean).join(" "),d=e?n("div",{ref:p,class:`profiler-toolbar-panel${i?" profiler-toolbar-panel-large":""}${s?" is-visible":""}`,onMouseEnter:y,onMouseLeave:l,children:e}):null;return r?n("a",{href:r,class:m,onMouseEnter:y,onMouseLeave:l,children:[t,d]}):n("span",{class:m,onMouseEnter:y,onMouseLeave:l,children:[t,d]})}function ko(t){return t>=200&&t<300?"profiler-text--success":t>=300&&t<400?"profiler-text--warning":t>=400?"profiler-text--error":""}function kn({profile:t,requestData:e}){let r=ko(t.status),o=e.controller_action,i=e.route_name,s=e.route_pattern,u=e.route_params;return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Request & Response",n("span",{class:"profiler-float-right",children:t.path})]}),n("div",{class:"profiler-toolbar-panel-content",children:[n("div",{class:"profiler-section__header",children:"Request"}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Method"}),n("strong",{class:"profiler-text--accent",children:t.method})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Path"}),n("strong",{children:t.path})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Status"}),n("strong",{class:r,children:t.status})]}),o&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Controller#Action"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:o})]}),i&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Route Name"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:i})]}),s&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Route Pattern"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:s})]}),u&&Object.keys(u).length>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Route Params"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:Object.entries(u).map(([p,f])=>`${p}: ${f}`).join(", ")})]}),t.params&&Object.keys(t.params).length>0&&n(b,{children:[n("div",{class:"profiler-section__header profiler-mt-3",children:"Parameters"}),Object.entries(t.params).map(([p,f])=>n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{class:"profiler-text--xs profiler-text--mono",children:p}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:String(f).substring(0,40)})]},p))]})]})]})}function Ln({dbData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Database",n("span",{class:"profiler-float-right",children:[t.total_queries," queries \xB7 ",t.total_duration.toFixed(2)," ms"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[t.queries.slice(0,10).map((e,r)=>n("div",{class:`profiler-toolbar-panel-query${e.slow?" profiler-toolbar-panel-query-slow":""}`,children:[n("div",{class:"profiler-flex profiler-flex--between profiler-mb-1",children:[n("span",{class:"profiler-text--xs profiler-text--muted",children:["#",r+1," ",e.name]}),n("span",{class:`${e.slow?"profiler-text--error":"profiler-text--success"} profiler-text--xs`,children:[e.duration.toFixed(2)," ms"]})]}),n("code",{children:e.sql})]},r)),t.total_queries>10&&n("div",{class:"profiler-more",children:["+ ",t.total_queries-10," more queries"]})]})]})}function Lo(t){return{GET:"badge-info",POST:"badge-success",PUT:"badge-warning",PATCH:"badge-warning",DELETE:"badge-error"}[t]||""}var Io={frame:"Turbo Frame request",stream:"Turbo Stream response"};function In({ajaxData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["AJAX",n("span",{class:"profiler-float-right",children:[t.total_requests," requests \xB7 ",t.total_duration.toFixed(2)," ms"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[t.requests.slice(0,10).map((e,r)=>{let o=e.status>=200&&e.status<300?"profiler-ajax-card--success":"profiler-ajax-card--error";return n("div",{class:`profiler-ajax-card ${o}`,children:n("div",{class:"profiler-ajax-card__row",children:[n("div",{class:"profiler-flex profiler-flex--gap-2",children:[n("span",{class:`badge ${Lo(e.method)}`,children:e.method}),e.turbo&&n("span",{class:"badge badge-default",title:Io[e.turbo],children:e.turbo.toUpperCase()}),n("span",{class:"profiler-text--xs profiler-text--truncate",children:e.path})]}),n("div",{class:"profiler-flex profiler-flex--gap-2",children:[n("span",{class:`profiler-text--xs ${e.status>=200&&e.status<300?"profiler-text--success":"profiler-text--error"}`,children:e.status}),n("span",{class:"profiler-text--xs profiler-text--muted",children:[e.duration.toFixed(2)," ms"]})]})]})},r)}),t.total_requests>10&&n("div",{class:"profiler-more",children:["+ ",t.total_requests-10," more"]})]})]})}function Vn({perfData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:"Events"}),n("div",{class:"profiler-toolbar-panel-content",children:t.events.slice(0,8).map((e,r)=>n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{class:"profiler-text--xs",children:e.name}),n("strong",{class:"profiler-text--accent",children:[e.duration.toFixed(2)," ms"]})]},r))})]})}function Nn({viewData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Views",n("span",{class:"profiler-float-right",children:[t.total_duration.toFixed(2)," ms"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[t.views&&t.views.length>0&&n(b,{children:[n("div",{class:"profiler-section__header",children:"Templates"}),t.views.map((e,r)=>n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{class:"profiler-text--xs",children:e.identifier}),n("strong",{class:"profiler-text--success",children:[e.duration.toFixed(2)," ms"]})]},r))]}),t.partials&&t.partials.length>0&&n(b,{children:[n("div",{class:"profiler-section__header profiler-mt-3",children:"Partials"}),t.partials.map((e,r)=>n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{class:"profiler-text--xs",children:e.identifier}),n("strong",{class:"profiler-text--success",children:[e.duration.toFixed(2)," ms"]})]},r))]})]})]})}function Gn({cacheData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Cache",n("span",{class:"profiler-float-right",children:["Hit rate: ",t.hit_rate,"%"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Reads"}),n("strong",{children:t.total_reads})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Writes"}),n("strong",{children:t.total_writes})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Hits"}),n("strong",{class:"profiler-text--success",children:t.hits})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Misses"}),n("strong",{class:"profiler-text--error",children:t.misses})]})]})]})}function jn({dumpData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Dumps (",t.count,")"]}),n("div",{class:"profiler-toolbar-panel-content",children:[t.dumps.slice(0,5).map((e,r)=>n("div",{class:"profiler-dump-card",children:[n("div",{class:"profiler-dump-card__header",children:[n("span",{class:"profiler-text--xs profiler-text--muted",children:["#",r+1,e.label&&n(b,{children:[" \xB7 ",n("strong",{class:"profiler-text--warning",children:e.label})]})]}),n("span",{class:"profiler-text--xs profiler-text--muted",children:[e.file.split("/").pop(),":",e.line]})]}),n("pre",{class:"profiler-text--xs profiler-text--truncate profiler-text--warning",style:{margin:0,background:"none",border:"none",padding:0},children:(e.formatted.split(`
2
+ `)[0]||e.formatted).trim()})]},r)),t.count>5&&n("div",{class:"profiler-more",children:["+ ",t.count-5," more dumps"]})]})]})}function Vo(t){return{GET:"badge-info",POST:"badge-success",PUT:"badge-warning",PATCH:"badge-warning",DELETE:"badge-error"}[t]||""}function Hn({httpData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Outbound HTTP",n("span",{class:"profiler-float-right",children:[t.total_requests," requests \xB7 ",t.total_duration.toFixed(2)," ms"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[t.requests.slice(0,10).map((r,o)=>{let i=r.status>=400||r.status===0,s=r.duration>=500,u=i?"profiler-ajax-card--error":s?"profiler-ajax-card--warning":"profiler-ajax-card--success",p=(()=>{try{return new URL(r.url).host}catch{return r.url}})();return n("div",{class:`profiler-ajax-card ${u}`,children:n("div",{class:"profiler-ajax-card__row",children:[n("div",{class:"profiler-flex profiler-flex--gap-2",children:[n("span",{class:`badge ${Vo(r.method)}`,children:r.method}),n("span",{class:"profiler-text--xs profiler-text--truncate",children:p})]}),n("div",{class:"profiler-flex profiler-flex--gap-2",children:[n("span",{class:`profiler-text--xs ${i?"profiler-text--error":"profiler-text--success"}`,children:r.status===0?"ERR":r.status}),n("span",{class:`profiler-text--xs ${s?"profiler-text--error":"profiler-text--muted"}`,children:[r.duration.toFixed(2)," ms"]})]})]})},o)}),t.total_requests>10&&n("div",{class:"profiler-more",children:["+ ",t.total_requests-10," more"]})]})]})}function No(t){switch(t){case"ERROR":case"FATAL":return"var(--profiler-error, #ef4444)";case"WARN":return"var(--profiler-warning, #f59e0b)";case"INFO":return"var(--profiler-success, #22c55e)";default:return"var(--profiler-muted, #6b7280)"}}function Bn({logData:t}){let e=t.logs.slice(-5).reverse();return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Logs (",t.count,")",t.errors>0&&n("span",{style:"color:var(--profiler-error,#ef4444);margin-left:8px;",children:[t.errors," error",t.errors!==1?"s":""]}),t.warnings>0&&t.errors===0&&n("span",{style:"color:var(--profiler-warning,#f59e0b);margin-left:8px;",children:[t.warnings," warning",t.warnings!==1?"s":""]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[e.map((r,o)=>n("div",{class:"profiler-toolbar-panel-row",style:"align-items:flex-start;gap:6px;",children:[n("span",{class:"profiler-text--xs",style:`color:${No(r.level)};font-weight:600;min-width:40px;`,children:r.level}),n("span",{class:"profiler-text--xs profiler-text--truncate",style:"flex:1;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",children:r.message})]},o)),t.count>5&&n("div",{class:"profiler-more",children:["+ ",t.count-5," more messages"]})]})]})}function Jn({exceptionData:t}){let e=t.backtrace?.find(r=>r.app_frame);return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",style:"color:var(--profiler-error,#ef4444);",children:["\u{1F4A5} ",t.exception_class]}),n("div",{class:"profiler-toolbar-panel-content",children:n("div",{class:"profiler-toolbar-panel-row",style:"flex-direction:column;align-items:flex-start;gap:4px;",children:[n("span",{class:"profiler-text--xs",style:"max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",children:t.message}),e&&n("span",{class:"profiler-text--xs profiler-text--muted",style:"max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",children:e.location})]})})]})}function $n({routesData:t}){let{total:e,matched:r}=t;return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Routes",n("span",{class:"profiler-float-right",children:[e," routes"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:r?n(b,{children:[n("div",{class:"profiler-section__header",children:"Matched Route"}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Pattern"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:r.pattern})]}),r.name&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Name"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:[r.name,"_path"]})]}),r.controller_action&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Controller#Action"}),n("strong",{class:"profiler-text--xs profiler-text--mono",children:r.controller_action})]})]}):n("div",{class:"profiler-toolbar-panel-row",children:n("span",{class:"profiler-text--muted",children:"No route matched"})})})]})}function Wn({i18nData:t}){let e=t.lookups.filter(s=>s.missing),r=t.lookups.filter(s=>!s.missing),o=[...e,...r].slice(0,5),i=t.total-5;return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["I18n",n("span",{style:"margin-left:6px;font-weight:400;color:var(--profiler-muted,#6b7280);",children:["[",t.locale,"]"]}),t.missing_count>0&&n("span",{style:"color:var(--profiler-error,#ef4444);margin-left:8px;",children:[t.missing_count," missing"]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[o.map((s,u)=>n("div",{class:"profiler-toolbar-panel-row",style:"align-items:flex-start;gap:6px;",children:[n("span",{class:"profiler-text--xs profiler-text--truncate",style:`flex:1;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;${s.missing?"color:var(--profiler-error,#ef4444);":""}`,children:s.key}),s.missing&&n("span",{class:"profiler-text--xs",style:"color:var(--profiler-error,#ef4444);font-weight:600;",children:"\u26A0"})]},u)),i>0&&n("div",{class:"profiler-more",children:["+ ",i," more keys"]})]})]})}function Go({job:t}){if(t.status==="running")return n("strong",{class:"profiler-text--xs profiler-text--mono profiler-text--info",children:[n("span",{class:"profiler-spinner","aria-hidden":"true",children:"\u25D0"})," running"]});let e=t.status==="failed";return n("strong",{class:`profiler-text--xs profiler-text--mono ${e?"profiler-text--error":"profiler-text--success"}`,children:[e?"\u2717":"\u2713"," ",t.duration?.toFixed(0),"ms"]})}function zn({jobs:t}){let e=t.filter(u=>u.status==="running").length,r=t.filter(u=>u.status==="completed").length,o=t.filter(u=>u.status==="failed").length,i=t.slice(0,5),s=t.length-5;return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Background Jobs",n("span",{class:"profiler-float-right",children:[t.length," job",t.length!==1?"s":""]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[n("div",{class:"profiler-section__header",children:"Summary"}),e>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Running"}),n("strong",{class:"profiler-text--info",children:e})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Completed"}),n("strong",{class:r>0?"profiler-text--success":"profiler-text--muted",children:r})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Failed"}),n("strong",{class:o>0?"profiler-text--error":"profiler-text--muted",children:o})]}),n("div",{class:"profiler-section__header profiler-mt-3",children:"Last jobs"}),i.map((u,p)=>n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{class:"profiler-text--xs profiler-text--mono",children:u.job_class}),n(Go,{job:u})]},p)),s>0&&n("div",{class:"profiler-more",children:["+ ",s," more"]})]})]})}function Xn({envData:t}){return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:"Environment"}),n("div",{class:"profiler-toolbar-panel-content",children:n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Variables"}),n("strong",{children:t.total})]})})]})}function Yn({mailerData:t}){let e=t.failed>0||t.loop_warnings.length>0;return n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:["Mailers",n("span",{class:"profiler-float-right",children:[t.total," email",t.total!==1?"s":""]})]}),n("div",{class:"profiler-toolbar-panel-content",children:[t.deliver_now>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"deliver_now"}),n("strong",{children:t.deliver_now})]}),t.deliver_later>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"deliver_later"}),n("strong",{children:t.deliver_later})]}),(t.queued_count??0)>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Queued"}),n("strong",{children:t.queued_count})]}),t.multi_part_count>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Multi-part"}),n("strong",{children:t.multi_part_count})]}),t.failed>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Errors"}),n("strong",{class:"profiler-text--error",children:t.failed})]}),t.loop_warnings.length>0&&n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{class:"profiler-text--warning",children:"\u26A0\uFE0F Loop detected"}),n("strong",{class:"profiler-text--warning",children:t.loop_warnings.length})]}),[...t.emails,...t.errors].slice(0,3).map((r,o)=>n("div",{class:"profiler-toolbar-panel-row profiler-text--sm",children:[n("span",{class:"profiler-text--muted",children:[r.mailer_class,"#",r.action]}),n("span",{class:r.error?"profiler-text--error":"profiler-text--success",children:r.error?"\u274C":"\u2705"})]},o)),t.total>3&&n("div",{class:"profiler-toolbar-panel-row profiler-text--muted profiler-text--xs",children:["+",t.total-3," more\u2026"]})]})]})}function Tr(t){return t.allocated_objects!=null?t.allocated_objects:t.memory!=null?Math.round(t.memory/40):null}function Zn(t){return t==null?"-":`${t.toLocaleString("en")} objects`}var eo="Objects allocated by the whole process while this ran: on a multi-threaded server, it includes what other threads allocated meanwhile.";function jo(t){return t>=200&&t<300?"profiler-text--success":t>=300&&t<400?"profiler-text--warning":t>=400?"profiler-text--error":""}function Ho(t){return t<100?"profiler-text--success":t<500?"profiler-text--warning":"profiler-text--error"}function Bo(t){return new Date(t).toLocaleTimeString("en",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function to({profile:t,token:e}){let r=t.collectors_data||{},o=r.request,i=r.database,s=r.ajax,u=r.performance,p=r.view,f=r.cache,c=r.dump,y=r.http,l=r.logs,m=r.exception,d=r.routes,T=r.i18n,x=r.env,v=r.mailer,g=t.child_jobs??[],R=jo(t.status),q=Ho(t.duration),F=(i?.slow_queries??0)>0?"profiler-text--error":"profiler-text--success",L=(s?.total_requests??0)>20?"profiler-text--error":"profiler-text--success",W=(f?.hit_rate??0)>80?"profiler-text--success":"profiler-text--warning";return n(b,{children:n("div",{class:"profiler-toolbar-container",children:[o&&n(b,{children:[n(U,{href:`/_profiler/profiles/${e}?tab=request`,className:R,panelLarge:!0,panel:n(kn,{profile:t,requestData:o}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:t.method}),n("span",{children:t.status})]}),n(U,{href:`/_profiler/profiles/${e}?tab=request`,className:q,panel:n(b,{children:[n("div",{class:"profiler-toolbar-panel-header",children:"Performance"}),n("div",{class:"profiler-toolbar-panel-content",children:[n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Duration"}),n("strong",{class:q,children:[t.duration.toFixed(2)," ms"]})]}),Tr(t)!=null&&n("div",{class:"profiler-toolbar-panel-row",title:eo,children:[n("span",{children:"Allocations"}),n("strong",{children:Zn(Tr(t))})]}),n("div",{class:"profiler-toolbar-panel-row",children:[n("span",{children:"Started"}),n("strong",{children:Bo(t.started_at)})]})]})]}),children:[n("span",{class:q,children:t.duration.toFixed(2)}),n("span",{class:"profiler-text--muted profiler-text--xs",children:"ms"})]})]}),i?.total_queries!==void 0&&n(U,{href:`/_profiler/profiles/${e}?tab=database`,className:F,panelLarge:!0,panel:n(Ln,{dbData:i}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"DB"}),n("span",{children:i.total_queries}),(i.slow_queries??0)>0&&n("span",{class:"profiler-text--error profiler-text--xs",children:["\u25B2 ",i.slow_queries]}),n("span",{class:"profiler-text--muted profiler-text--xs",children:[i.total_duration.toFixed(1),"ms"]})]}),s&&s.total_requests>0&&n(U,{href:`/_profiler/profiles/${e}?tab=ajax`,className:L,panelLarge:!0,panel:n(In,{ajaxData:s}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"XHR"}),n("span",{children:s.total_requests}),n("span",{class:"profiler-text--muted profiler-text--xs",children:[s.total_duration.toFixed(1),"ms"]})]}),u?.events&&u.total_events>0&&n(U,{href:`/_profiler/profiles/${e}?tab=timeline`,panel:n(Vn,{perfData:u}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"EVT"}),n("span",{children:u.total_events})]}),p?.total_views!==void 0&&n(U,{href:`/_profiler/profiles/${e}?tab=views`,panel:n(Nn,{viewData:p}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"VIEW"}),n("span",{children:p.total_views}),p.total_partials>0&&n("span",{class:"profiler-text--muted profiler-text--xs",children:["+",p.total_partials,"p"]})]}),f&&f.total_reads>0&&n(U,{href:`/_profiler/profiles/${e}?tab=cache`,className:W,panel:n(Gn,{cacheData:f}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"CACHE"}),n("span",{class:W,children:[f.hit_rate,"%"]})]}),y&&y.total_requests>0&&n(U,{href:`/_profiler/profiles/${e}?tab=http`,className:y.error_requests>0||y.slow_requests>0?"profiler-text--error":"profiler-text--success",panelLarge:!0,panel:n(Hn,{httpData:y}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"HTTP"}),n("span",{children:y.total_requests}),y.slow_requests>0&&n("span",{class:"profiler-text--error profiler-text--xs",children:["\u25B2 ",y.slow_requests]}),n("span",{class:"profiler-text--muted profiler-text--xs",children:[y.total_duration.toFixed(1),"ms"]})]}),c&&c.count>0&&n(U,{href:`/_profiler/profiles/${e}?tab=dump`,className:"profiler-text--warning",panelLarge:!0,panel:n(jn,{dumpData:c}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"DUMP"}),n("span",{class:"profiler-text--warning",children:c.count})]}),l&&l.count>0&&n(U,{href:`/_profiler/profiles/${e}?tab=logs`,className:l.errors>0?"profiler-text--error":l.warnings>0?"profiler-text--warning":"profiler-text--muted",panelLarge:!0,panel:n(Bn,{logData:l}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"LOG"}),n("span",{class:l.errors>0?"profiler-text--error":l.warnings>0?"profiler-text--warning":"",children:l.errors>0?l.errors:l.warnings>0?l.warnings:l.count})]}),m&&m.exception_class&&n(U,{href:`/_profiler/profiles/${e}?tab=exception`,className:"profiler-text--error",panelLarge:!0,panel:n(Jn,{exceptionData:m}),children:[n("span",{class:"profiler-text--error profiler-text--xs",children:"\u{1F4A5}"}),n("span",{class:"profiler-text--error profiler-text--xs",children:m.exception_class.split("::").pop()})]}),d&&d.total>0&&n(U,{href:`/_profiler/profiles/${e}?tab=routes`,panelLarge:!0,panel:n($n,{routesData:d}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"ROUTE"}),n("span",{class:"profiler-text--xs profiler-text--mono",children:d.matched?.pattern??"-"})]}),T&&T.total>0&&n(U,{href:`/_profiler/profiles/${e}?tab=i18n`,className:T.missing_count>0?"profiler-text--error":"profiler-text--muted",panel:n(Wn,{i18nData:T}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"I18N"}),n("span",{class:"profiler-text--xs profiler-text--mono",children:T.locale}),T.missing_count>0&&n("span",{class:"profiler-text--error profiler-text--xs",children:["\u26A0 ",T.missing_count]})]}),g.length>0&&n(U,{href:`/_profiler/profiles/${e}?tab=jobs`,className:g.some(G=>G.status==="failed")?"profiler-text--error":g.some(G=>G.status==="running")?"profiler-text--info":"profiler-text--success",panelLarge:!0,panel:n(zn,{jobs:g}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"JOB"}),n("span",{children:g.length}),g.some(G=>G.status==="failed")&&n("span",{class:"profiler-text--error profiler-text--xs",children:"\u2717"}),g.some(G=>G.status==="running")&&n("span",{class:"profiler-spinner profiler-text--info profiler-text--xs","aria-hidden":"true",children:"\u25D0"})]}),v&&(v.total>0||(v.queued_count??0)>0)&&n(U,{href:`/_profiler/profiles/${e}?tab=mailer`,className:v.failed>0?"profiler-text--error":"profiler-text--success",panelLarge:!0,panel:n(Yn,{mailerData:v}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"MAIL"}),v.total>0&&n("span",{children:v.total}),v.total===0&&(v.queued_count??0)>0&&n("span",{class:"profiler-text--muted",children:[v.queued_count,"q"]}),v.total>0&&(v.queued_count??0)>0&&n("span",{class:"profiler-text--muted profiler-text--xs",children:["+",v.queued_count,"q"]}),v.failed>0&&n("span",{class:"profiler-text--error profiler-text--xs",children:["\u25B2 ",v.failed]})]}),x&&x.total>0&&n(U,{href:`/_profiler/profiles/${e}?tab=env`,panel:n(Xn,{envData:x}),children:[n("span",{class:"profiler-text--muted profiler-text--xs",children:"ENV"}),n("span",{class:"profiler-text--muted",children:x.total})]}),n("a",{href:"/_profiler",class:"profiler-toolbar-item profiler-toolbar-logo",children:"\u2B21 Profiler"})]})})}var Jo="profiler-active-slave",$o=(()=>{try{let t=sessionStorage.getItem(Jo);return t?`/slaves/${t}`:""}catch{return""}})();function ro(){return $o}var Wo="/_profiler/api/cluster/";async function Mt(t){let e=t.url.startsWith(Wo)?"":ro(),r=e?t.url.replace("/_profiler/api",`/_profiler/api${e}`):t.url,{method:o,params:i,data:s,headers:u={},signal:p}=t,f=r,c=i?"?"+new URLSearchParams(Object.entries(i).map(([d,T])=>[d,String(T)])).toString():"",y={"X-Profiler-Request":"1",...u},l=await fetch(f+c,{method:o,signal:p,headers:s!==void 0?{"Content-Type":"application/json",...y}:y,body:s!==void 0?JSON.stringify(s):void 0});if(l.status===204)return{};let m=await l.json();if(!l.ok)throw Object.assign(new Error(m?.error??`HTTP ${l.status}`),{status:l.status,data:m});return m}var zo=(t,e)=>{let r={queryKey:e};for(let o of Object.keys(t))o!=="queryKey"&&Object.defineProperty(r,o,{enumerable:!0,configurable:!0,get:()=>t[o]});return r};var Xo=(t,e)=>Mt({url:`/_profiler/api/toolbar/${t}`,method:"GET",signal:e}),Yo=t=>[`/_profiler/api/toolbar/${t}`],Zo=(t,e)=>{let{query:r}=e??{};return{queryKey:r?.queryKey??Yo(t),queryFn:({signal:s})=>Xo(t,s),enabled:t!=null,...r}};function no(t,e){let r=Zo(t,e),o=mr(r);return zo(o,r.queryKey)}var oo=[1e3,1e3,2e3,2e3,4e3,4e3,8e3,8e3,15e3,15e3],es=3e4,ts=10*6e4;function rs(t){return typeof t=="object"&&t!==null&&Number.isFinite(t.cursor)}function so(t){let e=t.now??(()=>Date.now()),r=t.setTimer??((T,x)=>setTimeout(T,x)),o=t.clearTimer??(T=>clearTimeout(T)),i=t.cursor,s=0,u=e(),p=null,f=!1,c=!1,y=!1,l=()=>{p!==null&&(o(p),p=null)},m=()=>{if(l(),c||f||e()-u>=ts)return;let T=s<oo.length?oo[s]:es;s+=1,p=r(()=>{p=null,d()},T)},d=async()=>{if(!(c||y)){y=!0;try{let T=await t.check(i);if(c)return;rs(T)&&(i=Math.max(i,T.cursor),T.updated===!0&&(s=0,u=e(),t.onUpdate()))}catch{}finally{y=!1}m()}};return m(),{pause(){f=!0,l()},resume(){c||(f=!1,l(),d())},stop(){c=!0,l()}}}var ns="/_profiler";function io(t,e,r){let o=qe(r);o.current=r,$(()=>{if(!t||e===void 0)return;let s=so({cursor:e,check:p=>Mt({url:`${ns}/api/events/${encodeURIComponent(t)}`,method:"GET",params:{since:p}}),onUpdate:()=>o.current()}),u=()=>{document.hidden?s.pause():s.resume()};return document.addEventListener("visibilitychange",u),document.hidden&&s.pause(),()=>{document.removeEventListener("visibilitychange",u),s.stop()}},[t,e!==void 0])}function ao({token:t}){let{data:e,refetch:r,isError:o,isFetching:i}=no(t,{query:{refetchOnWindowFocus:!1}});$(()=>{window.__PROFILER_REFRESH_TOOLBAR__=()=>{r()}},[r]),io(t,e?.events_cursor,()=>{r()});let s=e?.profile??null;return s?n(to,{profile:s,token:t}):o?n("div",{class:"profiler-toolbar-container",children:n("span",{class:"profiler-toolbar-error",role:"alert",children:[n("span",{class:"profiler-text--error",children:"Profiler data could not be loaded."}),n("button",{type:"button",class:"profiler-toolbar-retry",disabled:i,onClick:()=>{r()},children:i?"Retrying...":"Retry"})]})}):null}var Dt=class extends Me{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(r){console.error("[Profiler] The toolbar failed to render:",r)}render(){return this.state.failed?n("div",{class:"profiler-toolbar-container",children:n("span",{class:"profiler-toolbar-error",role:"alert",children:[n("span",{class:"profiler-text--error",children:"Profiler toolbar error."}),n("button",{type:"button",class:"profiler-toolbar-retry",onClick:()=>this.setState({failed:!1}),children:"Retry"})]})}):this.props.children}};function uo(t){return t.altKey&&!t.ctrlKey&&!t.metaKey&&!t.shiftKey&&t.code==="KeyP"}var _r=new Map;function vr(t){try{return localStorage.getItem(t)}catch{return _r.has(t)?_r.get(t):null}}function lo(t,e){_r.set(t,e);try{localStorage.setItem(t,e)}catch{}}var gr=280;function po(t){let e=vr("profiler-theme"),r=e==="light"?"light":e==="dark"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";t.forEach(o=>o.setAttribute("data-theme",r))}var os=new ar({defaultOptions:{queries:{staleTime:3e4,retry:1}}});function co(){let t=document.getElementById("profiler-toolbar"),e=document.getElementById("profiler-toolbar-toggle");if(!t||!e)return;let r=t.dataset.token;if(!r)return;window.__PROFILER_TOOLBAR_TEARDOWN__?.();let o=new AbortController,{signal:i}=o,s=()=>{o.abort(),Gt(null,t),window.__PROFILER_TOOLBAR_TEARDOWN__===s&&delete window.__PROFILER_TOOLBAR_TEARDOWN__};window.__PROFILER_TOOLBAR_TEARDOWN__=s,document.addEventListener("turbo:load",()=>{t.isConnected||s()},{signal:i});let u=[t,e];po(u),window.addEventListener("storage",c=>{c.key==="profiler-theme"&&po(u)},{signal:i}),window.addEventListener("profiler:theme-change",(c=>{c.detail?.theme&&u.forEach(y=>y.setAttribute("data-theme",c.detail.theme))}),{signal:i});let p=vr("profiler-toolbar-collapsed")==="true";e.dataset.collapsed=String(p),p&&!t.style.transform&&(t.style.animation="none",t.style.transform="translateX(calc(100% + 44px))"),p||setTimeout(()=>{t.style.animation="none"},400);function f(){let c=!p;p=c,lo("profiler-toolbar-collapsed",String(c)),e.dataset.collapsed=String(c),c?(t.style.transition=`transform ${gr}ms cubic-bezier(0.4,0,0.2,1)`,t.style.transform="translateX(calc(100% + 44px))"):(t.style.transition="none",t.style.transform="translateX(calc(100% + 44px))",t.offsetWidth,t.style.transition=`transform ${gr}ms cubic-bezier(0.4,0,0.2,1)`,t.style.transform="translateX(0)",setTimeout(()=>{t.style.transform="",t.style.transition=""},gr+50))}e.addEventListener("click",f,{signal:i}),document.addEventListener("keydown",c=>{uo(c)&&(c.preventDefault(),f())},{signal:i}),Gt(n(yr,{client:os,children:n(Dt,{children:n(ao,{token:r})})}),t)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",co):co();})();