grab 0.0.92 → 0.0.93

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.
@@ -6,41 +6,43 @@ var ReactGrab=(function(exports){'use strict';/**
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- var Qa=(e,t)=>e===t,ht=Symbol("solid-proxy");var yn=Symbol("solid-track"),Gn={equals:Qa},pi=wi,Ve=1,gn=2,mi={owned:null,cleanups:null,context:null,owner:null},Fo={},ce=null,O=null,jt=null,he=null,Ne=null,Pe=null,Vn=0;function at(e,t){let n=he,o=ce,r=e.length===0,i=t===void 0?o:t,s=r?mi:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=r?e:()=>e(()=>De(()=>gt(s)));ce=s,he=null;try{return Ge(a,!0)}finally{he=n,ce=o;}}function V(e,t){t=t?Object.assign({},Gn,t):Gn;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},o=r=>(typeof r=="function"&&(r=r(n.value)),yi(n,r));return [bi.bind(n),o]}function ci(e,t,n){let o=Wn(e,t,true,Ve);Vt(o);}function le(e,t,n){let o=Wn(e,t,false,Ve);Vt(o);}function re(e,t,n){pi=rl;let o=Wn(e,t,false,Ve);(o.user=true),Pe?Pe.push(o):Vt(o);}function ee(e,t,n){n=n?Object.assign({},Gn,n):Gn;let o=Wn(e,t,true,0);return o.observers=null,o.observerSlots=null,o.comparator=n.equals||void 0,Vt(o),bi.bind(o)}function el(e){return e&&typeof e=="object"&&"then"in e}function Go(e,t,n){let o,r,i;typeof t=="function"?(o=e,r=t,i={}):(o=true,r=e,i=t||{});let s=null,a=Fo,f=false,d="initialValue"in i,p=typeof o=="function"&&ee(o),h=new Set,[g,E]=(i.storage||V)(i.initialValue),[T,M]=V(void 0),[A,v]=V(void 0,{equals:false}),[J,te]=V(d?"ready":"unresolved");function se(_,w,m,S){return s===_&&(s=null,S!==void 0&&(d=true),(_===a||w===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(S,{value:w})),a=Fo,pe(w,m)),w}function pe(_,w){Ge(()=>{w===void 0&&E(()=>_),te(w!==void 0?"errored":d?"ready":"unresolved"),M(w);for(let m of h.keys())m.decrement();h.clear();},false);}function ve(){let _=hn,w=g(),m=T();if(m!==void 0&&!s)throw m;return he&&!he.user&&_,w}function _e(_=true){if(_!==false&&f)return;f=false;let w=p?p():o;if(w==null||w===false){se(s,De(g));return}let m,S=a!==Fo?a:De(()=>{try{return r(w,{value:g(),refetching:_})}catch(I){m=I;}});if(m!==void 0){se(s,void 0,Hn(m),w);return}else if(!el(S))return se(s,S,void 0,w),S;return s=S,"v"in S?(S.s===1?se(s,S.v,void 0,w):se(s,void 0,Hn(S.v),w),S):(f=true,queueMicrotask(()=>f=false),Ge(()=>{te(d?"refreshing":"pending"),v();},false),S.then(I=>se(S,I,void 0,w),I=>se(S,void 0,Hn(I),w)))}Object.defineProperties(ve,{state:{get:()=>J()},error:{get:()=>T()},loading:{get(){let _=J();return _==="pending"||_==="refreshing"}},latest:{get(){if(!d)return ve();let _=T();if(_&&!s)throw _;return g()}}});let Ce=ce;return p?ci(()=>(Ce=ce,_e(false))):_e(false),[ve,{refetch:_=>gi(Ce,()=>_e(_)),mutate:E}]}function Kn(e){return Ge(e,false)}function De(e){if(he===null)return e();let t=he;he=null;try{return jt?jt.untrack(e):e()}finally{he=t;}}function Fe(e,t,n){let o=Array.isArray(e),r;return s=>{let a;if(o){a=Array(e.length);for(let l=0;l<e.length;l++)a[l]=e[l]();}else a=e();let c=De(()=>t(a,r,s));return r=a,c}}function qe(e){re(()=>De(e));}function fe(e){return ce===null||(ce.cleanups===null?ce.cleanups=[e]:ce.cleanups.push(e)),e}function Xn(){return he}function gi(e,t){let n=ce,o=he;ce=e,he=null;try{return Ge(t,!0)}catch(r){Yn(r);}finally{ce=n,he=o;}}var[vf,ui]=V(false);var hn;function bi(){let e=O;if(this.sources&&(this.state))if((this.state)===Ve)Vt(this);else {let t=Ne;Ne=null,Ge(()=>jn(this),false),Ne=t;}if(he){let t=this.observers?this.observers.length:0;he.sources?(he.sources.push(this),he.sourceSlots.push(t)):(he.sources=[this],he.sourceSlots=[t]),this.observers?(this.observers.push(he),this.observerSlots.push(he.sources.length-1)):(this.observers=[he],this.observerSlots=[he.sources.length-1]);}return e&&O.sources.has(this)?this.tValue:this.value}function yi(e,t,n){let o=e.value;if(!e.comparator||!e.comparator(o,t)){e.value=t;e.observers&&e.observers.length&&Ge(()=>{for(let r=0;r<e.observers.length;r+=1){let i=e.observers[r],s=O&&O.running;s&&O.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?Ne.push(i):Pe.push(i),i.observers&&Ei(i)),s?i.tState=Ve:i.state=Ve);}if(Ne.length>1e6)throw Ne=[],new Error},false);}return t}function Vt(e){if(!e.fn)return;gt(e);let t=Vn;di(e,e.value,t);}function di(e,t,n){let o,r=ce,i=he;he=ce=e;try{o=e.fn(t);}catch(s){return e.pure&&((e.state=Ve,e.owned&&e.owned.forEach(gt),e.owned=null)),e.updatedAt=n+1,Yn(s)}finally{he=i,ce=r;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?yi(e,o):e.value=o,e.updatedAt=n);}function Wn(e,t,n,o=Ve,r){let i={fn:e,state:o,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ce,context:ce?ce.context:null,pure:n};if(ce===null||ce!==mi&&(ce.owned?ce.owned.push(i):ce.owned=[i]),jt);return i}function bn(e){let t=O;if((e.state)===0)return;if((e.state)===gn)return jn(e);if(e.suspense&&De(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Vn);){(e.state)&&n.push(e);}for(let o=n.length-1;o>=0;o--){if(e=n[o],t);if((e.state)===Ve)Vt(e);else if((e.state)===gn){let r=Ne;Ne=null,Ge(()=>jn(e,n[0]),false),Ne=r;}}}function Ge(e,t){if(Ne)return e();let n=false;t||(Ne=[]),Pe?n=true:Pe=[],Vn++;try{let o=e();return nl(n),o}catch(o){n||(Pe=null),Ne=null,Yn(o);}}function nl(e){if(Ne&&(wi(Ne),Ne=null),e)return;let n=Pe;Pe=null,n.length&&Ge(()=>pi(n),false);}function wi(e){for(let t=0;t<e.length;t++)bn(e[t]);}function rl(e){let t,n=0;for(t=0;t<e.length;t++){let o=e[t];o.user?e[n++]=o:bn(o);}for(t=0;t<n;t++)bn(e[t]);}function jn(e,t){e.state=0;for(let o=0;o<e.sources.length;o+=1){let r=e.sources[o];if(r.sources){let i=r.state;i===Ve?r!==t&&(!r.updatedAt||r.updatedAt<Vn)&&bn(r):i===gn&&jn(r,t);}}}function Ei(e){for(let n=0;n<e.observers.length;n+=1){let o=e.observers[n];(!o.state)&&(o.state=gn,o.pure?Ne.push(o):Pe.push(o),o.observers&&Ei(o));}}function gt(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),o=e.sourceSlots.pop(),r=n.observers;if(r&&r.length){let i=r.pop(),s=n.observerSlots.pop();o<r.length&&(i.sourceSlots[s]=o,r[o]=i,n.observerSlots[o]=s);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)gt(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)gt(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Hn(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Yn(e,t=ce){let o=Hn(e);throw o;}var Ho=Symbol("fallback");function zn(e){for(let t=0;t<e.length;t++)e[t]();}function il(e,t,n={}){let o=[],r=[],i=[],s=0,a=t.length>1?[]:null;return fe(()=>zn(i)),()=>{let c=e()||[],l=c.length,f,d;return c[yn],De(()=>{let h,g,E,T,M,A,v,J,te;if(l===0)s!==0&&(zn(i),i=[],o=[],r=[],s=0,a&&(a=[])),n.fallback&&(o=[Ho],r[0]=at(se=>(i[0]=se,n.fallback())),s=1);else if(s===0){for(r=new Array(l),d=0;d<l;d++)o[d]=c[d],r[d]=at(p);s=l;}else {for(E=new Array(l),T=new Array(l),a&&(M=new Array(l)),A=0,v=Math.min(s,l);A<v&&o[A]===c[A];A++);for(v=s-1,J=l-1;v>=A&&J>=A&&o[v]===c[J];v--,J--)E[J]=r[v],T[J]=i[v],a&&(M[J]=a[v]);for(h=new Map,g=new Array(J+1),d=J;d>=A;d--)te=c[d],f=h.get(te),g[d]=f===void 0?-1:f,h.set(te,d);for(f=A;f<=v;f++)te=o[f],d=h.get(te),d!==void 0&&d!==-1?(E[d]=r[f],T[d]=i[f],a&&(M[d]=a[f]),d=g[d],h.set(te,d)):i[f]();for(d=A;d<l;d++)d in E?(r[d]=E[d],i[d]=T[d],a&&(a[d]=M[d],a[d](d))):r[d]=at(p);r=r.slice(0,s=l),o=c.slice(0);}return r});function p(h){if(i[d]=h,a){let[g,E]=V(d);return a[d]=E,t(c[d],g)}return t(c[d])}}}function sl(e,t,n={}){let o=[],r=[],i=[],s=[],a=0,c;return fe(()=>zn(i)),()=>{let l=e()||[],f=l.length;return l[yn],De(()=>{if(f===0)return a!==0&&(zn(i),i=[],o=[],r=[],a=0,s=[]),n.fallback&&(o=[Ho],r[0]=at(p=>(i[0]=p,n.fallback())),a=1),r;for(o[0]===Ho&&(i[0](),i=[],o=[],r=[],a=0),c=0;c<f;c++)c<o.length&&o[c]!==l[c]?s[c](()=>l[c]):c>=o.length&&(r[c]=at(d));for(;c<o.length;c++)i[c]();return a=s.length=i.length=f,o=l.slice(0),r=r.slice(0,a)});function d(p){i[c]=p;let[h,g]=V(l[c]);return s[c]=g,t(h,c)}}}function R(e,t){return De(()=>e(t||{}))}var ll=e=>`Stale read from <${e}>.`;function Kt(e){let t="fallback"in e&&{fallback:()=>e.fallback};return ee(il(()=>e.each,e.children,t||void 0))}function jo(e){let t="fallback"in e&&{fallback:()=>e.fallback};return ee(sl(()=>e.each,e.children,t||void 0))}function ie(e){let t=e.keyed,n=ee(()=>e.when,void 0,void 0),o=t?n:ee(n,void 0,{equals:(r,i)=>!r==!i});return ee(()=>{let r=o();if(r){let i=e.children;return typeof i=="function"&&i.length>0?De(()=>i(t?r:()=>{if(!De(o))throw ll("Show");return n()})):i}return e.fallback},void 0,void 0)}var Te=e=>ee(()=>e());function dl(e,t,n){let o=n.length,r=t.length,i=o,s=0,a=0,c=t[r-1].nextSibling,l=null;for(;s<r||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[r-1]===n[i-1];)r--,i--;if(r===s){let f=i<o?a?n[a-1].nextSibling:n[i-a]:c;for(;a<i;)e.insertBefore(n[a++],f);}else if(i===a)for(;s<r;)(!l||!l.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[r-1]){let f=t[--r].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],f),t[r]=n[i];}else {if(!l){l=new Map;let d=a;for(;d<i;)l.set(n[d],d++);}let f=l.get(t[s]);if(f!=null)if(a<f&&f<i){let d=s,p=1,h;for(;++d<r&&d<i&&!((h=l.get(t[d]))==null||h!==f+p);)p++;if(p>f-a){let g=t[s];for(;a<f;)e.insertBefore(n[a++],g);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}var xi="_$DX_DELEGATE";function _i(e,t,n,o={}){let r;return at(i=>{r=i,t===document?e():Y(t,e(),t.firstChild?null:void 0,n);},o.owner),()=>{r(),t.textContent="";}}function q(e,t,n,o){let r,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(r||(r=i())).cloneNode(true);return s.cloneNode=s,s}function $e(e,t=window.document){let n=t[xi]||(t[xi]=new Set);for(let o=0,r=e.length;o<r;o++){let i=e[o];n.has(i)||(n.add(i),t.addEventListener(i,fl));}}function Ee(e,t,n){(n==null?e.removeAttribute(t):e.setAttribute(t,n));}function Ke(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function Qe(e,t,n,o){Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;}function Ci(e,t,n){if(!t)return n?Ee(e,"style"):t;let o=e.style;if(typeof t=="string")return o.cssText=t;typeof n=="string"&&(o.cssText=n=void 0),n||(n={}),t||(t={});let r,i;for(i in n)t[i]==null&&o.removeProperty(i),delete n[i];for(i in t)r=t[i],r!==n[i]&&(o.setProperty(i,r),n[i]=r);return n}function Oe(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function et(e,t,n){return De(()=>e(t,n))}function Y(e,t,n,o){if(n!==void 0&&!o&&(o=[]),typeof t!="function")return qn(e,t,o,n);le(r=>qn(e,t(),r,n),o);}function fl(e){let t=e.target,n=`$$${e.type}`,o=e.target,r=e.currentTarget,i=c=>Object.defineProperty(e,"target",{configurable:true,value:c}),s=()=>{let c=t[n];if(c&&!t.disabled){let l=t[`${n}Data`];if(l!==void 0?c.call(t,l,e):c.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),true},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let c=e.composedPath();i(c[0]);for(let l=0;l<c.length-2&&(t=c[l],!!s());l++){if(t._$host){t=t._$host,a();break}if(t.parentNode===r)break}}else a();i(o);}function qn(e,t,n,o,r){for(;typeof n=="function";)n=n();if(t===n)return n;let s=typeof t,a=o!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let c=n[0];c&&c.nodeType===3?c.data!==t&&(c.data=t):c=document.createTextNode(t),n=Xt(e,n,o,c);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||s==="boolean"){n=Xt(e,n,o);}else {if(s==="function")return le(()=>{let c=t();for(;typeof c=="function";)c=c();n=qn(e,c,n,o);}),()=>n;if(Array.isArray(t)){let c=[],l=n&&Array.isArray(n);if(zo(c,t,n,r))return le(()=>n=qn(e,c,n,o,true)),()=>n;if(c.length===0){if(n=Xt(e,n,o),a)return n}else l?n.length===0?vi(e,c,o):dl(e,n,c):(n&&Xt(e),vi(e,c));n=c;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Xt(e,n,o,t);Xt(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function zo(e,t,n,o){let r=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],c=n&&n[e.length],l;if(!(a==null||a===true||a===false))if((l=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))r=zo(e,a,c)||r;else if(l==="function")if(o){for(;typeof a=="function";)a=a();r=zo(e,Array.isArray(a)?a:[a],Array.isArray(c)?c:[c])||r;}else e.push(a),r=true;else {let f=String(a);c&&c.nodeType===3&&c.data===f?e.push(c):e.push(document.createTextNode(f));}}return r}function vi(e,t,n=null){for(let o=0,r=t.length;o<r;o++)e.insertBefore(t[o],n);}function Xt(e,t,n,o){if(n===void 0)return e.textContent="";let r=o||document.createTextNode("");if(t.length){let i=false;for(let s=t.length-1;s>=0;s--){let a=t[s];if(r!==a){let c=a.parentNode===e;!i&&!s?c?e.replaceChild(r,a):e.insertBefore(r,n):c&&a.remove();}else i=true;}}else e.insertBefore(r,n);return [r]}var Ti=`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
10
- @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--font-weight-medium:500;--radius-sm:.25rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-grab-pink:#b21c8e;--color-grab-purple:#d239c0}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.top-0{top:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-2147483645{z-index:2147483645}.z-2147483646{z-index:2147483646}.z-2147483647{z-index:2147483647}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mt-px{margin-top:-1px}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.-ml-\\[2px\\]{margin-left:-2px}.ml-1{margin-left:calc(var(--spacing)*1)}.box-border{box-sizing:border-box}.flex{display:flex}.hidden{display:none}.size-fit{width:fit-content;height:fit-content}.h-0{height:calc(var(--spacing)*0)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-5\\.5{height:calc(var(--spacing)*5.5)}.h-\\[7px\\]{height:7px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-fit{height:fit-content}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-0\\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-\\[7px\\]{width:7px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[280px\\]{max-width:280px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-crosshair{cursor:crosshair}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\\[1px\\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-sm{border-bottom-right-radius:var(--radius-sm);border-bottom-left-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#7e0002\\]{border-color:#7e0002}.border-\\[\\#B3B3B3\\]{border-color:#b3b3b3}.border-black{border-color:var(--color-black)}.border-grab-purple\\/40{border-color:#d239c066}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/40{border-color:color-mix(in oklab,var(--color-grab-purple)40%,transparent)}}.border-grab-purple\\/50{border-color:#d239c080}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/50{border-color:color-mix(in oklab,var(--color-grab-purple)50%,transparent)}}.border-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-black{background-color:var(--color-black)}.bg-grab-pink{background-color:var(--color-grab-pink)}.bg-grab-purple\\/5{background-color:#d239c00d}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/5{background-color:color-mix(in oklab,var(--color-grab-purple)5%,transparent)}}.bg-grab-purple\\/8{background-color:#d239c014}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/8{background-color:color-mix(in oklab,var(--color-grab-purple)8%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-0\\.25{padding-inline:calc(var(--spacing)*.25)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\\.25{padding-block:calc(var(--spacing)*.25)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-\\[3px\\]{padding-block:3px}.py-\\[5px\\]{padding-block:5px}.py-px{padding-block:1px}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.pr-1{padding-right:calc(var(--spacing)*1)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-1\\.5{padding-left:calc(var(--spacing)*1.5)}.font-sans{font-family:var(--font-sans)}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.leading-3{--tw-leading:calc(var(--spacing)*3);line-height:calc(var(--spacing)*3)}.leading-3\\.5{--tw-leading:calc(var(--spacing)*3.5);line-height:calc(var(--spacing)*3.5)}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.wrap-break-word{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B3B3B3\\]{color:#b3b3b3}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-\\[\\#a1a1aa\\]{color:#a1a1aa}.text-\\[\\#c00002\\]{color:#c00002}.text-black{color:var(--color-black)}.text-black\\/50{color:#00000080}@supports (color:color-mix(in lab, red, red)){.text-black\\/50{color:color-mix(in oklab,var(--color-black)50%,transparent)}}.text-black\\/70{color:#000000b3}@supports (color:color-mix(in lab, red, red)){.text-black\\/70{color:color-mix(in oklab,var(--color-black)70%,transparent)}}.text-white{color:var(--color-white)}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-100{opacity:1}.opacity-\\[0\\.99\\]{opacity:.99}.brightness-125{--tw-brightness:brightness(125%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter-\\[drop-shadow\\(0px_0px_4px_\\#51515180\\)\\]{filter:drop-shadow(0 0 4px #51515180)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[transform\\,width\\,height\\]{will-change:transform,width,height}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,)var(--tw-contain-layout,)var(--tw-contain-paint,)var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEF2F2\\]:hover{background-color:#fef2f2}.hover\\:opacity-100:hover{opacity:1}}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}`;var Ko=Symbol("store-raw"),Wt=Symbol("store-node"),lt=Symbol("store-has"),Ai=Symbol("store-self");function Ii(e){let t=e[ht];if(!t&&(Object.defineProperty(e,ht,{value:t=new Proxy(e,hl)}),!Array.isArray(e))){let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let r=0,i=n.length;r<i;r++){let s=n[r];o[s].get&&Object.defineProperty(e,s,{enumerable:o[s].enumerable,get:o[s].get.bind(t)});}}return t}function Zn(e){let t;return e!=null&&typeof e=="object"&&(e[ht]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function En(e,t=new Set){let n,o,r,i;if(n=e!=null&&e[Ko])return n;if(!Zn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)r=e[s],(o=En(r,t))!==r&&(e[s]=o);}else {Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let c=0,l=s.length;c<l;c++)i=s[c],!a[i].get&&(r=e[i],(o=En(r,t))!==r&&(e[i]=o));}return e}function Jn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function Sn(e,t,n){if(e[t])return e[t];let[o,r]=V(n,{equals:false,internal:true});return o.$=r,e[t]=o}function ml(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return !n||n.get||!n.configurable||t===ht||t===Wt||(delete n.value,delete n.writable,n.get=()=>e[ht][t]),n}function ki(e){Xn()&&Sn(Jn(e,Wt),Ai)();}function gl(e){return ki(e),Reflect.ownKeys(e)}var hl={get(e,t,n){if(t===Ko)return e;if(t===ht)return n;if(t===yn)return ki(e),n;let o=Jn(e,Wt),r=o[t],i=r?r():e[t];if(t===Wt||t===lt||t==="__proto__")return i;if(!r){let s=Object.getOwnPropertyDescriptor(e,t);Xn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=Sn(o,t,i)());}return Zn(i)?Ii(i):i},has(e,t){return t===Ko||t===ht||t===yn||t===Wt||t===lt||t==="__proto__"?true:(Xn()&&Sn(Jn(e,lt),t)(),t in e)},set(){return true},deleteProperty(){return true},ownKeys:gl,getOwnPropertyDescriptor:ml};function Qn(e,t,n,o=false){if(!o&&e[t]===n)return;let r=e[t],i=e.length;n===void 0?(delete e[t],e[lt]&&e[lt][t]&&r!==void 0&&e[lt][t].$()):(e[t]=n,e[lt]&&e[lt][t]&&r===void 0&&e[lt][t].$());let s=Jn(e,Wt),a;if((a=Sn(s,t,r))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let c=e.length;c<i;c++)(a=s[c])&&a.$();(a=Sn(s,"length",i))&&a.$(e.length);}(a=s[Ai])&&a.$();}function Oi(e,t){let n=Object.keys(t);for(let o=0;o<n.length;o+=1){let r=n[o];Qn(e,r,t[r]);}}function bl(e,t){if(typeof t=="function"&&(t=t(e)),t=En(t),Array.isArray(t)){if(e===t)return;let n=0,o=t.length;for(;n<o;n++){let r=t[n];e[n]!==r&&Qn(e,n,r);}Qn(e,"length",o);}else Oi(e,t);}function wn(e,t,n=[]){let o,r=e;if(t.length>1){o=t.shift();let s=typeof o,a=Array.isArray(e);if(Array.isArray(o)){for(let c=0;c<o.length;c++)wn(e,[o[c]].concat(t),n);return}else if(a&&s==="function"){for(let c=0;c<e.length;c++)o(e[c],c)&&wn(e,[c].concat(t),n);return}else if(a&&s==="object"){let{from:c=0,to:l=e.length-1,by:f=1}=o;for(let d=c;d<=l;d+=f)wn(e,[d].concat(t),n);return}else if(t.length>1){wn(e[o],t,[o].concat(n));return}r=e[o],n=[o].concat(n);}let i=t[0];typeof i=="function"&&(i=i(r,n),i===r)||o===void 0&&i==null||(i=En(i),o===void 0||Zn(r)&&Zn(i)&&!Array.isArray(i)?Oi(r,i):Qn(e,o,i));}function Ri(...[e,t]){let n=En(e||{}),o=Array.isArray(n),r=Ii(n);function i(...s){Kn(()=>{o&&s.length===1?bl(n,s[0]):wn(n,s);});}return [r,i]}function yl(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function wl(){let e=yl();if(e.__xstate__)return e.__xstate__}var Ni=e=>{if(typeof window>"u")return;let t=wl();t&&t.register(e);};var eo=class{constructor(t){this._process=t,this._active=false,this._current=null,this._last=null;}start(){this._active=true,this.flush();}clear(){this._current&&(this._current.next=null,this._last=this._current);}enqueue(t){let n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush();}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next;}this._last=null;}},Qo=".",El="",er="",Sl="#",xl="*",Bi="xstate.init",Fi="xstate.error",Yo="xstate.stop";function vl(e,t){return {type:`xstate.after.${e}.${t}`}}function qo(e,t){return {type:`xstate.done.state.${e}`,output:t}}function _l(e,t){return {type:`xstate.done.actor.${e}`,output:t,actorId:e}}function tr(e,t){return {type:`xstate.error.actor.${e}`,error:t,actorId:e}}function nr(e){return {type:Bi,input:e}}function tt(e){setTimeout(()=>{throw e});}var Cl=typeof Symbol=="function"&&Symbol.observable||"@@observable";function or(e,t){let n=Mi(e),o=Mi(t);return typeof o=="string"?typeof n=="string"?o===n:false:typeof n=="string"?n in o:Object.keys(n).every(r=>r in o?or(n[r],o[r]):false)}function ro(e){if(Gi(e))return e;let t=[],n="";for(let o=0;o<e.length;o++){switch(e.charCodeAt(o)){case 92:n+=e[o+1],o++;continue;case 46:t.push(n),n="";continue}n+=e[o];}return t.push(n),t}function Mi(e){if(rs(e))return e.value;if(typeof e!="string")return e;let t=ro(e);return Ui(t)}function Ui(e){if(e.length===1)return e[0];let t={},n=t;for(let o=0;o<e.length-1;o++)if(o===e.length-2)n[e[o]]=e[o+1];else {let r=n;n={},r[e[o]]=n;}return t}function rr(e,t){let n={},o=Object.keys(e);for(let r=0;r<o.length;r++){let i=o[r];n[i]=t(e[i],i,e,r);}return n}function Hi(e){return Gi(e)?e:[e]}function nt(e){return e===void 0?[]:Hi(e)}function Zo(e,t,n,o){return typeof e=="function"?e({context:t,event:n,self:o}):e}function Gi(e){return Array.isArray(e)}function Tl(e){return e.type.startsWith("xstate.error.actor")}function kt(e){return Hi(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function ji(e){if(!(e===void 0||e===El))return nt(e)}function to(e,t,n){let o=typeof e=="object",r=o?e:void 0;return {next:(o?e.next:e)?.bind(r),error:(o?e.error:t)?.bind(r),complete:(o?e.complete:n)?.bind(r)}}function ir(e,t){return `${t}.${e}`}function vn(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,o,r]=n,s=e.getStateNodeById(r).config.invoke;return (Array.isArray(s)?s[o]:s).src}function zi(e,t){if(t===e||t===xl)return true;if(!t.endsWith(".*"))return false;let n=t.split("."),o=e.split(".");for(let r=0;r<n.length;r++){let i=n[r],s=o[r];if(i==="*")return r===n.length-1;if(i!==s)return false}return true}function Li(e,t){return `${e.sessionId}.${t}`}var Al=0;function Il(e,t){let n=new Map,o=new Map,r=new WeakMap,i=new Set,s={},{clock:a,logger:c}=t,l={schedule:(p,h,g,E,T=Math.random().toString(36).slice(2))=>{let M={source:p,target:h,event:g,delay:E,id:T,startedAt:Date.now()},A=Li(p,T);d._snapshot._scheduledEvents[A]=M;let v=a.setTimeout(()=>{delete s[A],delete d._snapshot._scheduledEvents[A],d._relay(p,h,g);},E);s[A]=v;},cancel:(p,h)=>{let g=Li(p,h),E=s[g];delete s[g],delete d._snapshot._scheduledEvents[g],E!==void 0&&a.clearTimeout(E);},cancelAll:p=>{for(let h in d._snapshot._scheduledEvents){let g=d._snapshot._scheduledEvents[h];g.source===p&&l.cancel(p,g.id);}}},f=p=>{if(!i.size)return;let h={...p,rootId:e.sessionId};i.forEach(g=>g.next?.(h));},d={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Al++}`,_register:(p,h)=>(n.set(p,h),p),_unregister:p=>{n.delete(p.sessionId);let h=r.get(p);h!==void 0&&(o.delete(h),r.delete(p));},get:p=>o.get(p),getAll:()=>Object.fromEntries(o.entries()),_set:(p,h)=>{let g=o.get(p);if(g&&g!==h)throw new Error(`Actor with system ID '${p}' already exists.`);o.set(p,h),r.set(h,p);},inspect:p=>{let h=to(p);return i.add(h),{unsubscribe(){i.delete(h);}}},_sendInspectionEvent:f,_relay:(p,h,g)=>{d._sendInspectionEvent({type:"@xstate.event",sourceRef:p,actorRef:h,event:g}),h._send(g);},scheduler:l,getSnapshot:()=>({_scheduledEvents:{...d._snapshot._scheduledEvents}}),start:()=>{let p=d._snapshot._scheduledEvents;d._snapshot._scheduledEvents={};for(let h in p){let{source:g,target:E,event:T,delay:M,id:A}=p[h];l.schedule(g,E,T,M,A);}},_clock:a,_logger:c};return d}var Xo=false,io=1,Ue=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({}),kl={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:false},no=class{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new eo(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=Ue.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let o={...kl,...n},{clock:r,logger:i,parent:s,syncSnapshot:a,id:c,systemId:l,inspect:f}=o;this.system=s?s.system:Il(this,{clock:r,logger:i}),f&&!s&&this.system.inspect(to(f)),this.sessionId=this.system._bookId(),this.id=c??this.sessionId,this.logger=n?.logger??this.system._logger,this.clock=n?.clock??this.system._clock,this._parent=s,this._syncSnapshot=a,this.options=o,this.src=o.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:d=>{this._deferred.push(d);},system:this.system,stopChild:d=>{if(d._parent!==this)throw new Error(`Cannot stop child actor ${d.id} of ${this.id} because it is not a child`);d._stop();},emit:d=>{let p=this.eventListeners.get(d.type),h=this.eventListeners.get("*");if(!p&&!h)return;let g=[...p?p.values():[],...h?h.values():[]];for(let E of g)try{E(d);}catch(T){tt(T);}},actionExecutor:d=>{let p=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:d.type,params:d.params}}),!d.exec)return;let h=Xo;try{Xo=!0,d.exec(d.info,d.params);}finally{Xo=h;}};this._processingStatus===Ue.Running?p():this._deferred.push(p);}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this.systemId=l,this.system._set(l,this)),this._initState(n?.snapshot??n?.state),l&&this._snapshot.status!=="active"&&this.system._unregister(this);}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input);}catch(n){this._snapshot={status:"error",output:void 0,error:n};}}update(t,n){this._snapshot=t;let o;for(;o=this._deferred.shift();)try{o();}catch(r){this._deferred.length=0,this._snapshot={...t,status:"error",error:r};}switch(this._snapshot.status){case "active":for(let r of this.observers)try{r.next?.(t);}catch(i){tt(i);}break;case "done":for(let r of this.observers)try{r.next?.(t);}catch(i){tt(i);}this._stopProcedure(),this._complete(),this._doneEvent=_l(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case "error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t});}subscribe(t,n,o){let r=to(t,n,o);if(this._processingStatus!==Ue.Stopped)this.observers.add(r);else switch(this._snapshot.status){case "done":try{r.complete?.();}catch(i){tt(i);}break;case "error":{let i=this._snapshot.error;if(!r.error)tt(i);else try{r.error(i);}catch(s){tt(s);}break}}return {unsubscribe:()=>{this.observers.delete(r);}}}on(t,n){let o=this.eventListeners.get(t);o||(o=new Set,this.eventListeners.set(t,o));let r=n.bind(void 0);return o.add(r),{unsubscribe:()=>{o.delete(r);}}}start(){if(this._processingStatus===Ue.Running)return this;this._syncSnapshot&&this.subscribe({next:o=>{o.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:o});},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=Ue.Running;let t=nr(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case "done":return this.update(this._snapshot,t),this;case "error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope);}catch(o){return this._snapshot={...this._snapshot,status:"error",error:o},this._error(o),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,o;try{n=this.logic.transition(this._snapshot,t,this._actorScope);}catch(r){o={err:r};}if(o){let{err:r}=o;this._snapshot={...this._snapshot,status:"error",error:r},this._error(r);return}this.update(n,t),t.type===Yo&&(this._stopProcedure(),this._complete());}_stop(){return this._processingStatus===Ue.Stopped?this:(this.mailbox.clear(),this._processingStatus===Ue.NotStarted?(this._processingStatus=Ue.Stopped,this):(this.mailbox.enqueue({type:Yo}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.();}catch(n){tt(n);}this.observers.clear();}_reportError(t){if(!this.observers.size){this._parent||tt(t);return}let n=false;for(let o of this.observers){let r=o.error;n||=!r;try{r?.(t);}catch(i){tt(i);}}this.observers.clear(),n&&tt(t);}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,tr(this.id,t));}_stopProcedure(){return this._processingStatus!==Ue.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new eo(this._process.bind(this)),this._processingStatus=Ue.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==Ue.Stopped&&this.mailbox.enqueue(t);}send(t){this.system._relay(void 0,this,t);}attachDevTools(){let{devTools:t}=this.options;t&&(typeof t=="function"?t:Ni)(this);}toJSON(){return {xstate$$type:io,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[Cl](){return this}getSnapshot(){return this._snapshot}};function ot(e,...[t]){return new no(e,t)}function Ol(e,t,n,o,{sendId:r}){let i=typeof r=="function"?r(n,o):r;return [t,{sendId:i},void 0]}function Rl(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId);});}function Jt(e){function t(n,o){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Ol,t.execute=Rl,t}function Nl(e,t,n,o,{id:r,systemId:i,src:s,input:a,syncSnapshot:c}){let l=typeof s=="string"?vn(t.machine,s):s,f=typeof r=="function"?r(n):r,d,p;return l&&(p=typeof a=="function"?a({context:t.context,event:n.event,self:e.self}):a,d=ot(l,{id:f,src:s,parent:e.self,syncSnapshot:c,systemId:i,input:p})),[wt(t,{children:{...t.children,[f]:d}}),{id:r,systemId:i,actorRef:d,src:s,input:p},void 0]}function Ml(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==Ue.Stopped&&t.start();});}function Qt(...[e,{id:t,systemId:n,input:o,syncSnapshot:r=false}={}]){function i(s,a){}return i.type="xstate.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=o,i.syncSnapshot=r,i.resolve=Nl,i.execute=Ml,i}function Ll(e,t,n,o,{actorRef:r}){let i=typeof r=="function"?r(n,o):r,s=typeof i=="string"?t.children[i]:i,a=t.children;return s&&(a={...a},delete a[s.id]),[wt(t,{children:a}),s,void 0]}function Pl(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==Ue.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t);});}}function Nt(e){function t(n,o){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Ll,t.execute=Pl,t}function en(e,t,n,o){let{machine:r}=o,i=typeof e=="function",s=i?e:r.implementations.guards[typeof e=="string"?e:e.type];if(!i&&!s)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof s!="function")return en(s,t,n,o);let a={context:t,event:n},c=i||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return "check"in s?s.check(o,a,s):s(a,c)}var sr=e=>e.type==="atomic"||e.type==="final";function qt(e){return Object.values(e.states).filter(t=>t.type!=="history")}function _n(e,t){let n=[];if(t===e)return n;let o=e.parent;for(;o&&o!==t;)n.push(o),o=o.parent;return n}function Cn(e){let t=new Set(e),n=Ki(t);for(let o of t)if(o.type==="compound"&&(!n.get(o)||!n.get(o).length))Pi(o).forEach(r=>t.add(r));else if(o.type==="parallel"){for(let r of qt(o))if(r.type!=="history"&&!t.has(r)){let i=Pi(r);for(let s of i)t.add(s);}}for(let o of t){let r=o.parent;for(;r;)t.add(r),r=r.parent;}return t}function Vi(e,t){let n=t.get(e);if(!n)return {};if(e.type==="compound"){let r=n[0];if(r){if(sr(r))return r.key}else return {}}let o={};for(let r of n)o[r.key]=Vi(r,t);return o}function Ki(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function Xi(e,t){let n=Cn(t);return Vi(e,Ki(n))}function so(e,t){return t.type==="compound"?qt(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?qt(t).every(n=>so(e,n)):t.type==="final"}var Tn=e=>e[0]===Sl;function Wi(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(o=>zi(t,o)).sort((o,r)=>r.length-o.length).flatMap(o=>e.transitions.get(o))}function Yi(e){let t=e.config.after;if(!t)return [];let n=r=>{let i=vl(r,e.id),s=i.type;return e.entry.push(nn(i,{id:s,delay:r})),e.exit.push(Jt(s)),s};return Object.keys(t).flatMap(r=>{let i=t[r],s=typeof i=="string"?{target:i}:i,a=Number.isNaN(+r)?r:+r,c=n(a);return nt(s).map(l=>({...l,event:c,delay:a}))}).map(r=>{let{delay:i}=r;return {...bt(e,r.event,r),delay:i}})}function bt(e,t,n){let o=ji(n.target),r=n.reenter??false,i=Dl(e,o),s={...n,actions:nt(n.actions),guard:n.guard,target:i,source:e,reenter:r,eventType:t,toJSON:()=>({...s,source:`#${e.id}`,target:i?i.map(a=>`#${a.id}`):void 0})};return s}function qi(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(n===er)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let o=e.config.on[n];t.set(n,kt(o).map(r=>bt(e,n,r)));}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,kt(e.config.onDone).map(o=>bt(e,n,o)));}for(let n of e.invoke){if(n.onDone){let o=`xstate.done.actor.${n.id}`;t.set(o,kt(n.onDone).map(r=>bt(e,o,r)));}if(n.onError){let o=`xstate.error.actor.${n.id}`;t.set(o,kt(n.onError).map(r=>bt(e,o,r)));}if(n.onSnapshot){let o=`xstate.snapshot.${n.id}`;t.set(o,kt(n.onSnapshot).map(r=>bt(e,o,r)));}}for(let n of e.after){let o=t.get(n.eventType);o||(o=[],t.set(n.eventType,o)),o.push(n);}return t}function Zi(e,t){let n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let o={source:e,actions:!t||typeof t=="string"?[]:nt(t.actions),eventType:null,reenter:false,target:n?[n]:[],toJSON:()=>({...o,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return o}function Dl(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(Tn(n))return e.machine.getStateNodeById(n);let o=n[0]===Qo;if(o&&!e.parent)return xn(e,n.slice(1));let r=o?e.key+n:n;if(e.parent)try{return xn(e.parent,r)}catch(i){throw new Error(`Invalid transition definition for state node '${e.id}':
11
- ${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Ji(e){let t=ji(e.config.target);return t?{target:t.map(n=>typeof n=="string"?xn(e.parent,n):n)}:e.parent.initial}function Ot(e){return e.type==="history"}function Pi(e){let t=ar(e);for(let n of t)for(let o of _n(n,e))t.add(o);return t}function ar(e){let t=new Set;function n(o){if(!t.has(o)){if(t.add(o),o.type==="compound")n(o.initial.target[0]);else if(o.type==="parallel")for(let r of qt(o))n(r);}}return n(e),t}function Zt(e,t){if(Tn(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function xn(e,t){if(typeof t=="string"&&Tn(t))try{return e.machine.getStateNodeById(t)}catch{}let n=ro(t).slice(),o=e;for(;n.length;){let r=n.shift();if(!r.length)break;o=Zt(o,r);}return o}function tn(e,t){if(typeof t=="string"){let r=e.states[t];if(!r)throw new Error(`State '${t}' does not exist on '${e.id}'`);return [e,r]}let n=Object.keys(t),o=n.map(r=>Zt(e,r)).filter(Boolean);return [e.machine.root,e].concat(o,n.reduce((r,i)=>{let s=Zt(e,i);if(!s)return r;let a=tn(s,t[i]);return r.concat(a)},[]))}function $l(e,t,n,o){let i=Zt(e,t).next(n,o);return !i||!i.length?e.next(n,o):i}function Bl(e,t,n,o){let r=Object.keys(t),i=Zt(e,r[0]),s=ao(i,t[r[0]],n,o);return !s||!s.length?e.next(n,o):s}function Fl(e,t,n,o){let r=[];for(let i of Object.keys(t)){let s=t[i];if(!s)continue;let a=Zt(e,i),c=ao(a,s,n,o);c&&r.push(...c);}return r.length?r:e.next(n,o)}function ao(e,t,n,o){return typeof t=="string"?$l(e,t,n,o):Object.keys(t).length===1?Bl(e,t,n,o):Fl(e,t,n,o)}function Ul(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function yt(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function Hl(e,t){let n=new Set(e),o=new Set(t);for(let r of n)if(o.has(r))return true;for(let r of o)if(n.has(r))return true;return false}function Qi(e,t,n){let o=new Set;for(let r of e){let i=false,s=new Set;for(let a of o)if(Hl(Jo([r],t,n),Jo([a],t,n)))if(yt(r.source,a.source))s.add(a);else {i=true;break}if(!i){for(let a of s)o.delete(a);o.add(r);}}return Array.from(o)}function Gl(e){let[t,...n]=e;for(let o of _n(t,void 0))if(n.every(r=>yt(r,o)))return o}function lr(e,t){if(!e.target)return [];let n=new Set;for(let o of e.target)if(Ot(o))if(t[o.id])for(let r of t[o.id])n.add(r);else for(let r of lr(Ji(o),t))n.add(r);else n.add(o);return [...n]}function es(e,t){let n=lr(e,t);if(!n)return;if(!e.reenter&&n.every(r=>r===e.source||yt(r,e.source)))return e.source;let o=Gl(n.concat(e.source));if(o)return o;if(!e.reenter)return e.source.machine.root}function Jo(e,t,n){let o=new Set;for(let r of e)if(r.target?.length){let i=es(r,n);r.reenter&&r.source===i&&o.add(i);for(let s of t)yt(s,i)&&o.add(s);}return [...o]}function jl(e,t){if(e.length!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function oo(e,t,n,o,r,i){if(!e.length)return t;let s=new Set(t._nodes),a=t.historyValue,c=Qi(e,s,a),l=t;r||([l,a]=Xl(l,o,n,c,s,a,i,n.actionExecutor)),l=Rt(l,o,n,c.flatMap(d=>d.actions),i,void 0),l=Vl(l,o,n,c,s,i,a,r);let f=[...s];l.status==="done"&&(l=Rt(l,o,n,f.sort((d,p)=>p.order-d.order).flatMap(d=>d.exit),i,void 0));try{return a===t.historyValue&&jl(t._nodes,s)?l:wt(l,{_nodes:f,historyValue:a})}catch(d){throw d}}function zl(e,t,n,o,r){if(o.output===void 0)return;let i=qo(r.id,r.output!==void 0&&r.parent?Zo(r.output,e.context,t,n.self):void 0);return Zo(o.output,e.context,i,n.self)}function Vl(e,t,n,o,r,i,s,a){let c=e,l=new Set,f=new Set;Kl(o,s,f,l),a&&f.add(e.machine.root);let d=new Set;for(let p of [...l].sort((h,g)=>h.order-g.order)){r.add(p);let h=[];h.push(...p.entry);for(let g of p.invoke)h.push(Qt(g.src,{...g,syncSnapshot:!!g.onSnapshot}));if(f.has(p)){let g=p.initial.actions;h.push(...g);}if(c=Rt(c,t,n,h,i,p.invoke.map(g=>g.id)),p.type==="final"){let g=p.parent,E=g?.type==="parallel"?g:g?.parent,T=E||p;for(g?.type==="compound"&&i.push(qo(g.id,p.output!==void 0?Zo(p.output,c.context,t,n.self):void 0));E?.type==="parallel"&&!d.has(E)&&so(r,E);)d.add(E),i.push(qo(E.id)),T=E,E=E.parent;if(E)continue;c=wt(c,{status:"done",output:zl(c,t,n,c.machine.root,T)});}}return c}function Kl(e,t,n,o){for(let r of e){let i=es(r,t);for(let a of r.target||[])!Ot(a)&&(r.source!==a||r.source!==i||r.reenter)&&(o.add(a),n.add(a)),Yt(a,t,n,o);let s=lr(r,t);for(let a of s){let c=_n(a,i);i?.type==="parallel"&&c.push(i),ts(o,t,n,c,!r.source.parent&&r.reenter?void 0:i);}}}function Yt(e,t,n,o){if(Ot(e))if(t[e.id]){let r=t[e.id];for(let i of r)o.add(i),Yt(i,t,n,o);for(let i of r)Wo(i,e.parent,o,t,n);}else {let r=Ji(e);for(let i of r.target)o.add(i),r===e.parent?.initial&&n.add(e.parent),Yt(i,t,n,o);for(let i of r.target)Wo(i,e.parent,o,t,n);}else if(e.type==="compound"){let[r]=e.initial.target;Ot(r)||(o.add(r),n.add(r)),Yt(r,t,n,o),Wo(r,e,o,t,n);}else if(e.type==="parallel")for(let r of qt(e).filter(i=>!Ot(i)))[...o].some(i=>yt(i,r))||(Ot(r)||(o.add(r),n.add(r)),Yt(r,t,n,o));}function ts(e,t,n,o,r){for(let i of o)if((!r||yt(i,r))&&e.add(i),i.type==="parallel")for(let s of qt(i).filter(a=>!Ot(a)))[...e].some(a=>yt(a,s))||(e.add(s),Yt(s,t,n,e));}function Wo(e,t,n,o,r){ts(n,o,r,_n(e,t));}function Xl(e,t,n,o,r,i,s,a){let c=e,l=Jo(o,r,i);l.sort((d,p)=>p.order-d.order);let f;for(let d of l)for(let p of Ul(d)){let h;p.history==="deep"?h=g=>sr(g)&&yt(g,d):h=g=>g.parent===d,f??={...i},f[p.id]=Array.from(r).filter(h);}for(let d of l)c=Rt(c,t,n,[...d.exit,...d.invoke.map(p=>Nt(p.id))],s,void 0),r.delete(d);return [c,f||i]}function Wl(e,t){return e.implementations.actions[t]}function ns(e,t,n,o,r,i){let{machine:s}=e,a=e;for(let c of o){let l=typeof c=="function",f=l?c:Wl(s,typeof c=="string"?c:c.type),d={context:a.context,event:t,self:n.self,system:n.system},p=l||typeof c=="string"?void 0:"params"in c?typeof c.params=="function"?c.params({context:a.context,event:t}):c.params:void 0;if(!f||!("resolve"in f)){n.actionExecutor({type:typeof c=="string"?c:typeof c=="object"?c.type:c.name||"(anonymous)",info:d,params:p,exec:f});continue}let h=f,[g,E,T]=h.resolve(n,a,d,p,f,r);a=g,"retryResolve"in h&&i?.push([h,E]),"execute"in h&&n.actionExecutor({type:h.type,info:d,params:E,exec:h.execute.bind(null,n,E)}),T&&(a=ns(a,t,n,T,r,i));}return a}function Rt(e,t,n,o,r,i){let s=i?[]:void 0,a=ns(e,t,n,o,{internalQueue:r,deferredActorIds:i},s);return s?.forEach(([c,l])=>{c.retryResolve(n,a,l);}),a}function lo(e,t,n,o){let r=e,i=[];function s(l,f,d){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:f,snapshot:l,_transitions:d}),i.push(l);}if(t.type===Yo)return r=wt(Di(r,t,n),{status:"stopped"}),s(r,t,[]),{snapshot:r,microstates:i};let a=t;if(a.type!==Bi){let l=a,f=Tl(l),d=$i(l,r);if(f&&!d.length)return r=wt(e,{status:"error",error:l.error}),s(r,l,[]),{snapshot:r,microstates:i};r=oo(d,e,n,a,false,o),s(r,l,d);}let c=true;for(;r.status==="active";){let l=c?Yl(r,a):[],f=l.length?r:void 0;if(!l.length){if(!o.length)break;a=o.shift(),l=$i(a,r);}r=oo(l,r,n,a,false,o),c=r!==f,s(r,a,l);}return r.status!=="active"&&Di(r,a,n),{snapshot:r,microstates:i}}function Di(e,t,n){return Rt(e,t,n,Object.values(e.children).map(o=>Nt(o)),[],void 0)}function $i(e,t){return t.machine.getTransitionData(t,e)}function Yl(e,t){let n=new Set,o=e._nodes.filter(sr);for(let r of o)e:for(let i of [r].concat(_n(r,void 0)))if(i.always){for(let s of i.always)if(s.guard===void 0||en(s.guard,e.context,t,e)){n.add(s);break e}}return Qi(Array.from(n),new Set(e._nodes),e.historyValue)}function os(e,t){let n=Cn(tn(e,t));return Xi(e,[...n])}function rs(e){return !!e&&typeof e=="object"&&"machine"in e&&"value"in e}var ql=function(t){return or(t,this.value)},Zl=function(t){return this.tags.has(t)},Jl=function(t){let n=this.machine.getTransitionData(this,t);return !!n?.length&&n.some(o=>o.target!==void 0||o.actions.length)},Ql=function(){let{_nodes:t,tags:n,machine:o,getMeta:r,toJSON:i,can:s,hasTag:a,matches:c,...l}=this;return {...l,tags:Array.from(n)}},ec=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function An(e,t){return {status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:Xi(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:ql,hasTag:Zl,can:Jl,getMeta:ec,toJSON:Ql}}function wt(e,t={}){return An({...e,...t},e.machine)}function tc(e){if(typeof e!="object"||e===null)return {};let t={};for(let n in e){let o=e[n];Array.isArray(o)&&(t[n]=o.map(r=>({id:r.id})));}return t}function is(e,t){let{_nodes:n,tags:o,machine:r,children:i,context:s,can:a,hasTag:c,matches:l,getMeta:f,toJSON:d,...p}=e,h={};for(let E in i){let T=i[E];h[E]={snapshot:T.getPersistedSnapshot(t),src:T.src,systemId:T.systemId,syncSnapshot:T._syncSnapshot};}return {...p,context:ss(s),children:h,historyValue:tc(p.historyValue)}}function ss(e){let t;for(let n in e){let o=e[n];if(o&&typeof o=="object")if("sessionId"in o&&"send"in o&&"ref"in o)t??=Array.isArray(e)?e.slice():{...e},t[n]={xstate$$type:io,id:o.id};else {let r=ss(o);r!==o&&(t??=Array.isArray(e)?e.slice():{...e},t[n]=r);}}return t??e}function nc(e,t,n,o,{event:r,id:i,delay:s},{internalQueue:a}){let c=t.machine.implementations.delays;if(typeof r=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${r}" }) instead`);let l=typeof r=="function"?r(n,o):r,f;if(typeof s=="string"){let d=c&&c[s];f=typeof d=="function"?d(n,o):d;}else f=typeof s=="function"?s(n,o):s;return typeof f!="number"&&a.push(l),[t,{event:l,id:i,delay:f},void 0]}function oc(e,t){let{event:n,delay:o,id:r}=t;if(typeof o=="number"){e.defer(()=>{let i=e.self;e.system.scheduler.schedule(i,i,n,o,r);});return}}function nn(e,t){function n(o,r){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=nc,n.execute=oc,n}function rc(e,{machine:t,context:n},o,r){let i=(s,a)=>{if(typeof s=="string"){let c=vn(t,s);if(!c)throw new Error(`Actor logic '${s}' not implemented in machine '${t.id}'`);let l=ot(c,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:typeof a?.input=="function"?a.input({context:n,event:o,self:e.self}):a?.input,src:s,systemId:a?.systemId});return r[l.id]=l,l}else return ot(s,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:s,systemId:a?.systemId})};return (s,a)=>{let c=i(s,a);return r[c.id]=c,e.defer(()=>{c._processingStatus!==Ue.Stopped&&c.start();}),c}}function ic(e,t,n,o,{assignment:r}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let i={},s={context:t.context,event:n.event,spawn:rc(e,t,n.event,i),self:e.self,system:e.system},a={};if(typeof r=="function")a=r(s,o);else for(let l of Object.keys(r)){let f=r[l];a[l]=typeof f=="function"?f(s,o):f;}let c=Object.assign({},t.context,a);return [wt(t,{context:c,children:Object.keys(i).length?{...t.children,...i}:t.children}),void 0,void 0]}function j(e){function t(n,o){}return t.type="xstate.assign",t.assignment=e,t.resolve=ic,t}var ls=new WeakMap;function on(e,t,n){let o=ls.get(e);return o?t in o||(o[t]=n()):(o={[t]:n()},ls.set(e,o)),o[t]}var sc={},In=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e,co=class e{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(Qo),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?rr(this.config.states,(o,r)=>new e(o,{_parent:this,_key:r,_machine:this.machine})):sc,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===true?"shallow":this.config.history||false,this.entry=nt(this.config.entry).slice(),this.exit=nt(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=nt(t.tags).slice();}_initialize(){this.transitions=qi(this),this.config.always&&(this.always=kt(this.config.always).map(t=>bt(this,er,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize();});}get definition(){return {id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(In),eventType:null,reenter:false,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(In),eventType:null})}:void 0,history:this.history,states:rr(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(In)})),entry:this.entry.map(In),exit:this.exit.map(In),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return on(this,"invoke",()=>nt(this.config.invoke).map((t,n)=>{let{src:o,systemId:r}=t,i=t.id??ir(this.id,n),s=typeof o=="string"?o:`xstate.invoke.${ir(this.id,n)}`;return {...t,src:s,id:i,systemId:r,toJSON(){let{onDone:a,onError:c,...l}=t;return {...l,type:"xstate.invoke",src:s,id:i}}}}))}get on(){return on(this,"on",()=>[...this.transitions].flatMap(([n,o])=>o.map(r=>[n,r])).reduce((n,[o,r])=>(n[o]=n[o]||[],n[o].push(r),n),{}))}get after(){return on(this,"delayedTransitions",()=>Yi(this))}get initial(){return on(this,"initial",()=>Zi(this,this.config.initial))}next(t,n){let o=n.type,r=[],i,s=on(this,`candidates-${o}`,()=>Wi(this,o));for(let a of s){let{guard:c}=a,l=t.context,f=false;try{f=!c||en(c,l,n,t);}catch(d){let p=typeof c=="string"?c:typeof c=="object"?c.type:void 0;throw new Error(`Unable to evaluate guard ${p?`'${p}' `:""}in transition for event '${o}' in state node '${this.id}':
12
- ${d.message}`)}if(f){r.push(...a.actions),i=a;break}}return i?[i]:void 0}get events(){return on(this,"events",()=>{let{states:t}=this,n=new Set(this.ownEvents);if(t)for(let o of Object.keys(t)){let r=t[o];if(r.states)for(let i of r.events)n.add(`${i}`);}return Array.from(n)})}get ownEvents(){let t=Object.keys(Object.fromEntries(this.transitions)),n=new Set(t.filter(o=>this.transitions.get(o).some(r=>!(!r.target&&!r.actions.length&&!r.reenter))));return Array.from(n)}},ac="#",uo=class e{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=true,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:n?.actors??{},actions:n?.actions??{},delays:n?.delays??{},guards:n?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new co(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events;}provide(t){let{actions:n,guards:o,actors:r,delays:i}=this.implementations;return new e(this.config,{actions:{...n,...t.actions},guards:{...o,...t.guards},actors:{...r,...t.actors},delays:{...i,...t.delays}})}resolveState(t){let n=os(this.root,t.value),o=Cn(tn(this.root,n));return An({_nodes:[...o],context:t.context||{},children:{},status:so(o,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,o){return lo(t,n,o,[]).snapshot}microstep(t,n,o){return lo(t,n,o,[]).microstates}getTransitionData(t,n){return ao(this.root,t.value,t,n)||[]}getPreInitialState(t,n,o){let{context:r}=this.config,i=An({context:typeof r!="function"&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return typeof r=="function"?Rt(i,n,t,[j(({spawn:a,event:c,self:l})=>r({spawn:a,input:c.input,self:l}))],o,void 0):i}getInitialSnapshot(t,n){let o=nr(n),r=[],i=this.getPreInitialState(t,o,r),s=oo([{target:[...ar(this.root)],source:this.root,reenter:true,actions:[],eventType:null,toJSON:null}],i,t,o,true,r),{snapshot:a}=lo(s,o,t,r);return a}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start();});}getStateNodeById(t){let n=ro(t),o=n.slice(1),r=Tn(n[0])?n[0].slice(ac.length):n[0],i=this.idMap.get(r);if(!i)throw new Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);return xn(i,o)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return is(t,n)}restoreSnapshot(t,n){let o={},r=t.children;Object.keys(r).forEach(d=>{let p=r[d],h=p.snapshot,g=p.src,E=typeof g=="string"?vn(this,g):g;if(!E)return;let T=ot(E,{id:d,parent:n.self,syncSnapshot:p.syncSnapshot,snapshot:h,src:g,systemId:p.systemId});o[d]=T;});function i(d,p){if(p instanceof co)return p;try{return d.machine.getStateNodeById(p.id)}catch{}}function s(d,p){if(!p||typeof p!="object")return {};let h={};for(let g in p){let E=p[g];for(let T of E){let M=i(d,T);M&&(h[g]??=[],h[g].push(M));}}return h}let a=s(this.root,t.historyValue),c=An({...t,children:o,_nodes:Array.from(Cn(tn(this.root,t.value))),historyValue:a},this),l=new Set;function f(d,p){if(!l.has(d)){l.add(d);for(let h in d){let g=d[h];if(g&&typeof g=="object"){if("xstate$$type"in g&&g.xstate$$type===io){d[h]=p[g.id];continue}f(g,p);}}}}return f(c.context,o),c}};function lc(e,t,n,o,{event:r}){let i=typeof r=="function"?r(n,o):r;return [t,{event:i},void 0]}function cc(e,{event:t}){e.defer(()=>e.emit(t));}function ur(e){function t(n,o){}return t.type="xstate.emit",t.event=e,t.resolve=lc,t.execute=cc,t}var cr=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function uc(e,t,n,o,{to:r,event:i,id:s,delay:a},c){let l=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);let f=typeof i=="function"?i(n,o):i,d;if(typeof a=="string"){let g=l&&l[a];d=typeof g=="function"?g(n,o):g;}else d=typeof a=="function"?a(n,o):a;let p=typeof r=="function"?r(n,o):r,h;if(typeof p=="string"){if(p===cr.Parent?h=e.self._parent:p===cr.Internal?h=e.self:p.startsWith("#_")?h=t.children[p.slice(2)]:h=c.deferredActorIds?.includes(p)?p:t.children[p],!h)throw new Error(`Unable to send event to actor '${p}' from machine '${t.machine.id}'.`)}else h=p||e.self;return [t,{to:h,targetId:typeof p=="string"?p:void 0,event:f,id:s,delay:d},void 0]}function dc(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to]);}function fc(e,t){e.defer(()=>{let{to:n,event:o,delay:r,id:i}=t;if(typeof r=="number"){e.system.scheduler.schedule(e.self,n,o,r,i);return}e.system._relay(e.self,n,o.type===Fi?tr(e.self.id,o.data):o);});}function fo(e,t,n){function o(r,i){}return o.type="xstate.sendTo",o.to=e,o.event=t,o.id=n?.id,o.delay=n?.delay,o.resolve=uc,o.retryResolve=dc,o.execute=fc,o}function pc(e,t){return fo(cr.Parent,e,t)}function mc(e,t,n,o,{collect:r}){let i=[],s=function(c){i.push(c);};return s.assign=(...a)=>{i.push(j(...a));},s.cancel=(...a)=>{i.push(Jt(...a));},s.raise=(...a)=>{i.push(nn(...a));},s.sendTo=(...a)=>{i.push(fo(...a));},s.sendParent=(...a)=>{i.push(pc(...a));},s.spawnChild=(...a)=>{i.push(Qt(...a));},s.stopChild=(...a)=>{i.push(Nt(...a));},s.emit=(...a)=>{i.push(ur(...a));},r({context:n.context,event:n.event,enqueue:s,check:a=>en(a,t.context,n.event,t),self:e.self,system:e.system},o),[t,void 0,i]}function cs(e){function t(n,o){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=mc,t}function gc(e,t,n,o,{value:r,label:i}){return [t,{value:typeof r=="function"?r(n,o):r,label:i},void 0]}function hc({logger:e},{value:t,label:n}){n?e(n,t):e(t);}function us(e=({context:n,event:o})=>({context:n,event:o}),t){function n(o,r){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=gc,n.execute=hc,n}function bc(e,t){return new uo(e,t)}function dr({schemas:e,actors:t,actions:n,guards:o,delays:r}){return {assign:j,sendTo:fo,raise:nn,log:us,cancel:Jt,stopChild:Nt,enqueueActions:cs,emit:ur,spawnChild:Qt,createStateConfig:i=>i,createAction:i=>i,createMachine:i=>bc({...i,schemas:e},{actors:t,actions:n,guards:o,delays:r}),extend:i=>dr({schemas:e,actors:t,actions:{...n,...i.actions},guards:{...o,...i.guards},delays:{...r,...i.delays}})}}function po(e){let t;return e!=null&&typeof e=="object"&&(!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}var fs=(e,t)=>{if(!po(e))return e;let n=!Array.isArray(e),[o,r]=n?[{},Object.keys(e)]:[[],e];t.set(e,o);for(let i=0;i<r.length;++i){let s=n?r[i]:i,a=e[s];t.has(a)?o[s]=t.get(a):o[s]=fs(a,t);}return o},yc=e=>fs(e,new WeakMap),wc=(e,t={})=>{let n=t;for(let o=0;o<e.length;o++)n=n?.[e[o]];return n},Ec=e=>po(e)?Array.isArray(e)?[]:{}:e,Sc=(e,t,n,o)=>{let r=new WeakMap,i=(s,a,c)=>{if(a!==s){if(r.has(s)){n(...c,r.get(s));return}if(!po(s)||!po(a)){c[c.length-1]!=="toString"&&n(...c,()=>s);return}if(r.set(s,wc(c,o)),Array.isArray(s)&&Array.isArray(a)){let l=s.length-a.length,f=Math.min(a.length,s.length),d=Math.max(s.length,a.length);if(l!==0)for(let p=f;p<=d-1;p++)n(...c,p,Ec(s[p]));for(let p=0,h=d-1;p<=h&&(i(s[p],a[p],[...c,p]),p!==h);p++,h--)i(s[h],a[h],[...c,h]);a.length!==s.length&&n(...c,"length",s.length);}else {let l=Object.keys(s);for(let d=0,p=l.length;d<p;d++)i(s[l[d]],a[l[d]],[...c,l[d]]);let f=Object.keys(a);for(let d=0,p=f.length;d<p;d++)s[f[d]]===void 0&&n(...c,f[d],void 0);}}};i(e,t,[]);};function xc(e){let[t,n]=Ri(yc(e)),o=e;return [t,i=>{Kn(()=>{Sc(i,o,n,t);}),o=i;}]}var ds=()=>{};function vc(e){let t=ee(()=>typeof e=="function"?e():e),[n,o]=xc({v:t()?.getSnapshot()});return re(r=>{let i=t();if(r||o({v:i?.getSnapshot()}),i){let{unsubscribe:s}=i.subscribe({next:a=>o({v:a}),error:ds,complete:ds});fe(s);}return false},true),()=>n.v}function _c(e,...[t]){let n=ot(e,t);return qe(()=>{n.start(),fe(()=>n.stop());}),n}function Cc(e,...[t]){let n=_c(e,t);return [vc(n)(),n.send,n]}function ps(e,...[t]){return Cc(e,t)}var ms="0.0.92";var gs="linear-gradient(in oklab 180deg, oklab(100% 0 0) 0%, oklab(96.1% 0 0) 5.92%)",mo=["Meta","Control","Shift","Alt"],hs='<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>';var Tc=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),Ac=e=>{let t=e.trim();if(!t)return null;let n=parseFloat(t);return Tc(n)?n:null},bs=(e,t)=>{let n=e.split(",");if(n.length!==t)return null;let o=[];for(let r of n){let i=Ac(r);if(i===null)return null;o.push(i);}return o},Ic=(e,t,n,o)=>e===1&&t===0&&n===0&&o===1,kc=e=>e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[15]===1,go=e=>{try{if(!(e instanceof Element))return "none";let t=window.getComputedStyle(e);if(!t)return "none";let n=t.transform;if(!n||n==="none")return "none";let o=n.match(/^matrix3d\(([^)]+)\)$/);if(o){let i=bs(o[1],16);if(i&&i.length===16){let s=[...i];return s[12]=0,s[13]=0,s[14]=0,kc(s)?"none":`matrix3d(${s.join(", ")})`}}let r=n.match(/^matrix\(([^)]+)\)$/);if(r){let i=bs(r[1],6);if(i&&i.length===6){let[s,a,c,l]=i;return Ic(s,a,c,l)?"none":`matrix(${s}, ${a}, ${c}, ${l}, 0, 0)`}}return "none"}catch{return "none"}};var Ae=e=>{let t=e.getBoundingClientRect();return {borderRadius:window.getComputedStyle(e).borderRadius||"0px",height:t.height,transform:go(e),width:t.width,x:t.left,y:t.top}};var Oc=e=>({isToggleMode:false,hasAgentProvider:false,keyHoldDuration:200,mousePosition:{x:-1e3,y:-1e3},dragStart:{x:-1e3,y:-1e3},copyStart:{x:-1e3,y:-1e3},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],lastGrabbedElement:null,lastCopiedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:"",pendingClickData:null,replySessionId:null,viewportVersion:0,grabbedBoxes:[],labelInstances:[],nativeSelectionCursor:{x:-1e3,y:-1e3},nativeSelectionElements:[],agentSessions:new Map,sessionElements:new Map,abortControllers:new Map,isTouchMode:false,theme:e,activationTimestamp:null,previouslyFocusedElement:null,canUndo:false,canRedo:false,isAgentConnected:false,supportsUndo:false,supportsFollowUp:false,dismissButtonText:void 0}),Rc=({context:e})=>e.hasAgentProvider,Nc=({context:e})=>e.frozenElement!==null||e.detectedElement!==null,Mc=({context:e})=>e.nativeSelectionElements.length>0,Lc=({context:e})=>e.inputText.trim().length>0,Pc=({context:e})=>e.isToggleMode,Dc=({context:e})=>e.pendingClickData!==null;var $c=({context:e})=>Array.from(e.agentSessions.values()).some(t=>t.isStreaming),Bc=({context:e})=>e.lastCopiedElement!==null&&document.contains(e.lastCopiedElement);var ys=dr({delays:{KEY_HOLD_DURATION:({context:e})=>e.keyHoldDuration,DOUBLE_CLICK_THRESHOLD:250,SUCCESS_LABEL_DURATION:1700,COPIED_LABEL_DURATION:1500},guards:{hasAgentProvider:Rc,hasElement:Nc,hasNativeSelection:Mc,hasInputText:Lc,isToggleMode:Pc,hasPendingClick:Dc,isAgentStreaming:$c,hasLastCopiedElement:Bc},actions:{setMousePosition:j({mousePosition:({event:e})=>e.type==="MOUSE_MOVE"?e.position:{x:-1e3,y:-1e3}}),setDetectedElement:j({detectedElement:({event:e})=>e.type==="ELEMENT_DETECTED"?e.element:null}),setFrozenElement:j({frozenElement:({event:e})=>e.type==="FREEZE_ELEMENT"?e.element:null,frozenElements:({event:e})=>e.type==="FREEZE_ELEMENT"?[e.element]:[]}),setFrozenElements:j({frozenElements:({event:e})=>e.type==="FREEZE_ELEMENTS"?e.elements:[],frozenElement:({event:e})=>e.type==="FREEZE_ELEMENTS"&&e.elements.length>0?e.elements[0]:null}),clearFrozenElement:j({frozenElement:()=>null,frozenElements:()=>[]}),setDragStart:j({dragStart:({event:e})=>e.type==="DRAG_START"?{x:e.position.x+window.scrollX,y:e.position.y+window.scrollY}:{x:-1e3,y:-1e3}}),resetDragStart:j({dragStart:()=>({x:-1e3,y:-1e3})}),setCopyStart:j({copyStart:({event:e})=>e.type==="SET_COPY_START"?e.position:{x:-1e3,y:-1e3},copyOffsetFromCenterX:({event:e})=>{if(e.type==="SET_COPY_START"&&e.element){let t=Ae(e.element),n=t.x+t.width/2;return e.position.x-n}return 0}}),setInputText:j({inputText:({event:e})=>e.type==="INPUT_CHANGE"?e.value:""}),clearInputText:j({inputText:()=>""}),enableToggleMode:j({isToggleMode:()=>true}),disableToggleMode:j({isToggleMode:()=>false}),setToggleMode:j({isToggleMode:({event:e})=>e.type==="SET_TOGGLE_MODE"?e.value:false}),setLastGrabbedElement:j({lastGrabbedElement:({event:e})=>e.type==="SET_LAST_GRABBED"?e.element:null}),setLastCopiedElement:j({lastCopiedElement:({event:e})=>e.type==="SET_LAST_COPIED"||e.type==="COPY_DONE"?e.element??null:null}),clearLastCopiedElement:j({lastCopiedElement:()=>null}),incrementViewportVersion:j({viewportVersion:({context:e})=>e.viewportVersion+1}),addGrabbedBox:j({grabbedBoxes:({context:e,event:t})=>t.type==="ADD_GRABBED_BOX"?[...e.grabbedBoxes,t.box]:e.grabbedBoxes}),removeGrabbedBox:j({grabbedBoxes:({context:e,event:t})=>t.type==="REMOVE_GRABBED_BOX"?e.grabbedBoxes.filter(n=>n.id!==t.boxId):e.grabbedBoxes}),clearGrabbedBoxes:j({grabbedBoxes:()=>[]}),addLabelInstance:j({labelInstances:({context:e,event:t})=>t.type==="ADD_LABEL_INSTANCE"?[...e.labelInstances,t.instance]:e.labelInstances}),updateLabelInstance:j({labelInstances:({context:e,event:t})=>t.type==="UPDATE_LABEL_INSTANCE"?e.labelInstances.map(n=>n.id===t.instanceId?{...n,status:t.status}:n):e.labelInstances}),removeLabelInstance:j({labelInstances:({context:e,event:t})=>t.type==="REMOVE_LABEL_INSTANCE"?e.labelInstances.filter(n=>n.id!==t.instanceId):e.labelInstances}),clearLabelInstances:j({labelInstances:()=>[]}),setNativeSelectionCursor:j({nativeSelectionCursor:({event:e})=>e.type==="TEXT_SELECTED"?e.cursor:{x:-1e3,y:-1e3}}),setNativeSelectionElements:j({nativeSelectionElements:({event:e})=>e.type==="TEXT_SELECTED"?e.elements:[]}),clearNativeSelection:j({nativeSelectionCursor:()=>({x:-1e3,y:-1e3}),nativeSelectionElements:()=>[]}),setTouchMode:j({isTouchMode:({event:e})=>e.type==="SET_TOUCH_MODE"?e.value:false}),setSelectionSource:j({selectionFilePath:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.filePath:null,selectionLineNumber:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.lineNumber:null}),clearSelectionSource:j({selectionFilePath:()=>null,selectionLineNumber:()=>null}),setPendingClickData:j({pendingClickData:({event:e})=>e.type==="SET_PENDING_CLICK"?e.data:null}),clearPendingClickData:j({pendingClickData:()=>null}),setReplySessionId:j({replySessionId:({event:e})=>e.type==="SET_REPLY_SESSION"?e.sessionId:null}),clearReplySessionId:j({replySessionId:()=>null}),addAgentSession:j({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.agentSessions;let n=new Map(e.agentSessions);return n.set(t.sessionId,t.session),n}}),setSessionElement:j({sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.sessionElements;let n=new Map(e.sessionElements);return n.set(t.sessionId,t.element),n}}),updateAgentSessionStatus:j({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_STATUS")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let o=new Map(e.agentSessions);return o.set(t.sessionId,{...n,lastStatus:t.status}),o}}),completeAgentSession:j({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_DONE")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let o=new Map(e.agentSessions);return o.set(t.sessionId,{...n,isStreaming:false,lastStatus:t.status??n.lastStatus}),o}}),setAgentSessionError:j({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_ERROR")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let o=new Map(e.agentSessions);return o.set(t.sessionId,{...n,isStreaming:false,error:t.error}),o}}),removeAgentSession:j({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.agentSessions;let n=new Map(e.agentSessions);return n.delete(t.sessionId),n},sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.sessionElements;let n=new Map(e.sessionElements);return n.delete(t.sessionId),n}}),storeActivationTimestamp:j({activationTimestamp:()=>Date.now(),previouslyFocusedElement:()=>document.activeElement}),clearActivationTimestamp:j({activationTimestamp:()=>null,previouslyFocusedElement:()=>null}),setKeyHoldDuration:j({keyHoldDuration:({event:e,context:t})=>e.type==="HOLD_START"&&e.duration!==void 0?e.duration:t.keyHoldDuration}),setHasAgentProvider:j({hasAgentProvider:({event:e})=>e.type==="SET_HAS_AGENT_PROVIDER"?e.value:false}),setUndoRedoState:j({canUndo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canUndo:false,canRedo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canRedo:false}),setAgentCapabilities:j({supportsUndo:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsUndo:false,supportsFollowUp:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsFollowUp:false,dismissButtonText:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.dismissButtonText:void 0,isAgentConnected:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.isAgentConnected:false}),resetActivationState:j({isToggleMode:()=>false,inputText:()=>"",frozenElement:()=>null,frozenElements:()=>[],pendingClickData:()=>null,activationTimestamp:()=>null}),updateSessionBounds:j({agentSessions:({context:e})=>{if(e.agentSessions.size===0)return e.agentSessions;let t=new Map(e.agentSessions),n=false;for(let[o,r]of e.agentSessions){let i=e.sessionElements.get(o);if(i&&document.contains(i)){let s=Ae(i),a=r.selectionBounds[0],c=r.position;if(a){let l=a.x+a.width/2,f=r.position.x-l,d=s.x+s.width/2;c={...r.position,x:d+f};}t.set(o,{...r,selectionBounds:[s],position:c}),n=true;}}return n?t:e.agentSessions}}),freezeCurrentElement:j({frozenElement:({context:e})=>e.frozenElement??e.detectedElement}),saveInputModePosition:j({copyStart:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.copyStart,copyOffsetFromCenterX:({event:e})=>{if(e.type==="INPUT_MODE_ENTER"&&e.element){let t=Ae(e.element),n=t.x+t.width/2;return e.position.x-n}return 0},mousePosition:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.mousePosition,frozenElement:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.element:t.frozenElement})}}).createMachine({id:"grabMachine",type:"parallel",context:({input:e})=>({...Oc(e.theme),hasAgentProvider:e.hasAgentProvider,keyHoldDuration:e.keyHoldDuration}),states:{activation:{initial:"idle",states:{idle:{on:{HOLD_START:{target:"holding",actions:["setKeyHoldDuration"]},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},holding:{after:{KEY_HOLD_DURATION:{target:"active",actions:["storeActivationTimestamp"]}},on:{RELEASE:{target:"idle"},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},active:{initial:"hovering",states:{hovering:{on:{FREEZE:{target:"frozen",actions:["freezeCurrentElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},frozen:{on:{UNFREEZE:{target:"hovering",actions:["clearFrozenElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},dragging:{on:{DRAG_END:{target:"justDragged",actions:["resetDragStart"]},DRAG_CANCEL:{target:"hovering",actions:["resetDragStart"]}}},justDragged:{on:{DRAG_START:{target:"dragging",actions:["setDragStart"]}},after:{SUCCESS_LABEL_DURATION:{target:"hovering"}}}},on:{DEACTIVATE:{target:"idle",actions:["resetActivationState","clearActivationTimestamp"]},MOUSE_MOVE:{actions:["setMousePosition"]},ELEMENT_DETECTED:{actions:["setDetectedElement"]},SET_TOUCH_MODE:{actions:["setTouchMode"]},SET_SELECTION_SOURCE:{actions:["setSelectionSource"]}}}},on:{TOGGLE:[{guard:({context:e})=>e.activationTimestamp!==null,target:".idle",actions:["resetActivationState","clearActivationTimestamp"]},{target:".active",actions:["enableToggleMode","storeActivationTimestamp"]}],VIEWPORT_CHANGE:{actions:["incrementViewportVersion","updateSessionBounds"]},ADD_GRABBED_BOX:{actions:["addGrabbedBox"]},REMOVE_GRABBED_BOX:{actions:["removeGrabbedBox"]},CLEAR_GRABBED_BOXES:{actions:["clearGrabbedBoxes"]},SET_LAST_GRABBED:{actions:["setLastGrabbedElement"]},SET_LAST_COPIED:{actions:["setLastCopiedElement"]},SET_HAS_AGENT_PROVIDER:{actions:["setHasAgentProvider"]},SET_UNDO_REDO_STATE:{actions:["setUndoRedoState"]},SET_AGENT_CAPABILITIES:{actions:["setAgentCapabilities"]},SET_TOGGLE_MODE:{actions:["setToggleMode"]},FREEZE_ELEMENT:{actions:["setFrozenElement"]},FREEZE_ELEMENTS:{actions:["setFrozenElements"]}}},interaction:{initial:"idle",states:{idle:{on:{CLICK:{target:"awaitingDoubleClick",actions:["setPendingClickData"]},INPUT_MODE_ENTER:{target:"inputMode",actions:["saveInputModePosition","enableToggleMode"]},COPY_START:{target:"copying"}}},awaitingDoubleClick:{after:{DOUBLE_CLICK_THRESHOLD:{target:"copying"}},on:{DOUBLE_CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]},CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]}}},copying:{on:{COPY_DONE:{target:"justCopied",actions:["clearPendingClickData","setLastCopiedElement"]}}},justCopied:{after:{COPIED_LABEL_DURATION:{target:"idle"}}},inputMode:{initial:"typing",states:{typing:{on:{ESC:[{target:"confirmingDismiss",guard:"hasInputText"},{target:"#grabMachine.interaction.idle"}],INPUT_SUBMIT:{target:"#grabMachine.interaction.copying"}}},confirmingDismiss:{on:{CANCEL_DISMISS:{target:"typing"},CONFIRM_DISMISS:{target:"#grabMachine.interaction.idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{INPUT_CHANGE:{actions:["setInputText"]},INPUT_CANCEL:{target:"idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{ADD_LABEL_INSTANCE:{actions:["addLabelInstance"]},UPDATE_LABEL_INSTANCE:{actions:["updateLabelInstance"]},REMOVE_LABEL_INSTANCE:{actions:["removeLabelInstance"]},SET_COPY_START:{actions:["setCopyStart"]},SET_PENDING_CLICK:{actions:["setPendingClickData"]},SET_REPLY_SESSION:{actions:["setReplySessionId"]},DEACTIVATE:{target:".idle",actions:["clearInputText","clearReplySessionId","clearPendingClickData"]}}},nativeSelection:{initial:"inactive",states:{inactive:{on:{TEXT_SELECTED:{target:"active",actions:["setNativeSelectionCursor","setNativeSelectionElements"]}}},active:{on:{SELECTION_CLEARED:{target:"inactive",actions:["clearNativeSelection"]},CLEAR_NATIVE_SELECTION:{target:"inactive",actions:["clearNativeSelection"]},TEXT_SELECTED:{actions:["setNativeSelectionCursor","setNativeSelectionElements"]}}}}},agentSessions:{initial:"idle",states:{idle:{on:{SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},streaming:{on:{STREAM_STATUS:{actions:["updateAgentSessionStatus"]},STREAM_DONE:{target:"completed",actions:["completeAgentSession"]},STREAM_ERROR:{target:"error",actions:["setAgentSessionError"]},SESSION_ABORT:{target:"idle",actions:["removeAgentSession"]}}},completed:{on:{SESSION_DISMISS:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},error:{on:{ERROR_ACKNOWLEDGE:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}}},on:{UPDATE_SESSION_BOUNDS:{actions:["updateSessionBounds"]}}},agentAbortConfirmation:{initial:"inactive",states:{inactive:{on:{ESC:{target:"confirming",guard:"isAgentStreaming"}}},confirming:{on:{CONFIRM_AGENT_ABORT:{target:"inactive"},CANCEL_AGENT_ABORT:{target:"inactive"}}}}}}});var Fc=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Uc=e=>Array.isArray(e),Hc=(e,t=false)=>{let{composed:n,target:o}=e,r,i;if(n){let a=e.composedPath()[0];a instanceof HTMLElement&&(r=a.tagName,i=a.role);}else o instanceof HTMLElement&&(r=o.tagName,i=o.role);return Uc(t)?!!(r&&t&&t.some(s=>typeof r=="string"&&s.toLowerCase()===r.toLowerCase()||s===i)):!!(r&&t&&t)},Xe=e=>Hc(e,Fc);var ws=e=>{let t=e.tagName.toLowerCase();return !!(t==="input"||t==="textarea"||e instanceof HTMLElement&&e.isContentEditable)},Es=(e,t)=>{let n=document.activeElement;if(n){let o=n;for(;o;){if(ws(o))return true;o=o.parentElement;}}if(e!==void 0&&t!==void 0){let o=document.elementsFromPoint(e,t);for(let r of o)if(ws(r))return true}return false};var rn="data-react-grab",Ss=e=>{let t=document.querySelector(`[${rn}]`);if(t){let s=t.shadowRoot?.querySelector(`[${rn}]`);if(s instanceof HTMLDivElement&&t.shadowRoot)return s}let n=document.createElement("div");n.setAttribute(rn,"true"),n.style.zIndex="2147483646",n.style.position="fixed",n.style.top="0",n.style.left="0";let o=n.attachShadow({mode:"open"});{let s=document.createElement("style");s.textContent=e,o.appendChild(s);}let r=document.createElement("div");r.setAttribute(rn,"true"),o.appendChild(r);let i=document.body??document.documentElement;return i.appendChild(n),setTimeout(()=>{i.contains(n)||i.appendChild(n);},1e3),r};var Gc="https://react-grab.com",ho=(e,t)=>{let n=t?`&line=${t}`:"";return `${Gc}/open-file?url=${encodeURIComponent(e)}${n}`};var Et=(e,t,n)=>e+(t-e)*n;function xs(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=xs(e[t]))&&(o&&(o+=" "),o+=n);}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function vs(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=xs(e))&&(o&&(o+=" "),o+=t);return o}var gr="-",jc=e=>{let t=Vc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return {getClassGroupId:s=>{let a=s.split(gr);return a[0]===""&&a.length!==1&&a.shift(),Ts(a,t)||zc(s)},getConflictingClassGroupIds:(s,a)=>{let c=n[s]||[];return a&&o[s]?[...c,...o[s]]:c}}},Ts=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],o=t.nextPart.get(n),r=o?Ts(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;let i=e.join(gr);return t.validators.find(({validator:s})=>s(i))?.classGroupId},_s=/^\[(.+)\]$/,zc=e=>{if(_s.test(e)){let t=_s.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return "arbitrary.."+n}},Vc=e=>{let{theme:t,prefix:n}=e,o={nextPart:new Map,validators:[]};return Xc(Object.entries(e.classGroups),n).forEach(([i,s])=>{mr(s,o,i,t);}),o},mr=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){let i=r===""?t:Cs(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(Kc(r)){mr(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{mr(s,Cs(t,i),n,o);});});},Cs=(e,t)=>{let n=e;return t.split(gr).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o);}),n},Kc=e=>e.isThemeGetter,Xc=(e,t)=>t?e.map(([n,o])=>{let r=o.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return [n,r]}):e,Wc=e=>{if(e<1)return {get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map,r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map);};return {get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s);}}},As="!",Yc=e=>{let{separator:t,experimentalParseClassName:n}=e,o=t.length===1,r=t[0],i=t.length,s=a=>{let c=[],l=0,f=0,d;for(let T=0;T<a.length;T++){let M=a[T];if(l===0){if(M===r&&(o||a.slice(T,T+i)===t)){c.push(a.slice(f,T)),f=T+i;continue}if(M==="/"){d=T;continue}}M==="["?l++:M==="]"&&l--;}let p=c.length===0?a:a.substring(f),h=p.startsWith(As),g=h?p.substring(1):p,E=d&&d>f?d-f:void 0;return {modifiers:c,hasImportantModifier:h,baseClassName:g,maybePostfixModifierPosition:E}};return n?a=>n({className:a,parseClassName:s}):s},qc=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(o=>{o[0]==="["?(t.push(...n.sort(),o),n=[]):n.push(o);}),t.push(...n.sort()),t},Zc=e=>({cache:Wc(e.cacheSize),parseClassName:Yc(e),...jc(e)}),Jc=/\s+/,Qc=(e,t)=>{let{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r}=t,i=[],s=e.trim().split(Jc),a="";for(let c=s.length-1;c>=0;c-=1){let l=s[c],{modifiers:f,hasImportantModifier:d,baseClassName:p,maybePostfixModifierPosition:h}=n(l),g=!!h,E=o(g?p.substring(0,h):p);if(!E){if(!g){a=l+(a.length>0?" "+a:a);continue}if(E=o(p),!E){a=l+(a.length>0?" "+a:a);continue}g=false;}let T=qc(f).join(":"),M=d?T+As:T,A=M+E;if(i.includes(A))continue;i.push(A);let v=r(E,g);for(let J=0;J<v.length;++J){let te=v[J];i.push(M+te);}a=l+(a.length>0?" "+a:a);}return a};function eu(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Is(t))&&(o&&(o+=" "),o+=n);return o}var Is=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Is(e[o]))&&(n&&(n+=" "),n+=t);return n};function tu(e,...t){let n,o,r,i=s;function s(c){let l=t.reduce((f,d)=>d(f),e());return n=Zc(l),o=n.cache.get,r=n.cache.set,i=a,a(c)}function a(c){let l=o(c);if(l)return l;let f=Qc(c,n);return r(c,f),f}return function(){return i(eu.apply(null,arguments))}}var Se=e=>{let t=n=>n[e]||[];return t.isThemeGetter=true,t},ks=/^\[(?:([a-z-]+):)?(.+)\]$/i,nu=/^\d+\/\d+$/,ou=new Set(["px","full","screen"]),ru=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iu=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,su=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,au=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ct=e=>sn(e)||ou.has(e)||nu.test(e),St=e=>an(e,"length",hu),sn=e=>!!e&&!Number.isNaN(Number(e)),pr=e=>an(e,"number",sn),Rn=e=>!!e&&Number.isInteger(Number(e)),cu=e=>e.endsWith("%")&&sn(e.slice(0,-1)),oe=e=>ks.test(e),xt=e=>ru.test(e),uu=new Set(["length","size","percentage"]),du=e=>an(e,uu,Os),fu=e=>an(e,"position",Os),pu=new Set(["image","url"]),mu=e=>an(e,pu,yu),gu=e=>an(e,"",bu),Nn=()=>true,an=(e,t,n)=>{let o=ks.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):n(o[2]):false},hu=e=>iu.test(e)&&!su.test(e),Os=()=>false,bu=e=>au.test(e),yu=e=>lu.test(e);var wu=()=>{let e=Se("colors"),t=Se("spacing"),n=Se("blur"),o=Se("brightness"),r=Se("borderColor"),i=Se("borderRadius"),s=Se("borderSpacing"),a=Se("borderWidth"),c=Se("contrast"),l=Se("grayscale"),f=Se("hueRotate"),d=Se("invert"),p=Se("gap"),h=Se("gradientColorStops"),g=Se("gradientColorStopPositions"),E=Se("inset"),T=Se("margin"),M=Se("opacity"),A=Se("padding"),v=Se("saturate"),J=Se("scale"),te=Se("sepia"),se=Se("skew"),pe=Se("space"),ve=Se("translate"),_e=()=>["auto","contain","none"],Ce=()=>["auto","hidden","clip","visible","scroll"],_=()=>["auto",oe,t],w=()=>[oe,t],m=()=>["",ct,St],S=()=>["auto",sn,oe],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],F=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],y=()=>["","0",oe],N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[sn,oe];return {cacheSize:500,separator:":",theme:{colors:[Nn],spacing:[ct,St],blur:["none","",xt,oe],brightness:L(),borderColor:[e],borderRadius:["none","","full",xt,oe],borderSpacing:w(),borderWidth:m(),contrast:L(),grayscale:y(),hueRotate:L(),invert:y(),gap:w(),gradientColorStops:[e],gradientColorStopPositions:[cu,St],inset:_(),margin:_(),opacity:L(),padding:w(),saturate:L(),scale:L(),sepia:y(),skew:L(),space:w(),translate:w()},classGroups:{aspect:[{aspect:["auto","square","video",oe]}],container:["container"],columns:[{columns:[xt]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...I(),oe]}],overflow:[{overflow:Ce()}],"overflow-x":[{"overflow-x":Ce()}],"overflow-y":[{"overflow-y":Ce()}],overscroll:[{overscroll:_e()}],"overscroll-x":[{"overscroll-x":_e()}],"overscroll-y":[{"overscroll-y":_e()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Rn,oe]}],basis:[{basis:_()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",oe]}],grow:[{grow:y()}],shrink:[{shrink:y()}],order:[{order:["first","last","none",Rn,oe]}],"grid-cols":[{"grid-cols":[Nn]}],"col-start-end":[{col:["auto",{span:["full",Rn,oe]},oe]}],"col-start":[{"col-start":S()}],"col-end":[{"col-end":S()}],"grid-rows":[{"grid-rows":[Nn]}],"row-start-end":[{row:["auto",{span:[Rn,oe]},oe]}],"row-start":[{"row-start":S()}],"row-end":[{"row-end":S()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",oe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",oe]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[A]}],px:[{px:[A]}],py:[{py:[A]}],ps:[{ps:[A]}],pe:[{pe:[A]}],pt:[{pt:[A]}],pr:[{pr:[A]}],pb:[{pb:[A]}],pl:[{pl:[A]}],m:[{m:[T]}],mx:[{mx:[T]}],my:[{my:[T]}],ms:[{ms:[T]}],me:[{me:[T]}],mt:[{mt:[T]}],mr:[{mr:[T]}],mb:[{mb:[T]}],ml:[{ml:[T]}],"space-x":[{"space-x":[pe]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[pe]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",oe,t]}],"min-w":[{"min-w":[oe,t,"min","max","fit"]}],"max-w":[{"max-w":[oe,t,"none","full","min","max","fit","prose",{screen:[xt]},xt]}],h:[{h:[oe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[oe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[oe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xt,St]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",pr]}],"font-family":[{font:[Nn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",oe]}],"line-clamp":[{"line-clamp":["none",sn,pr]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ct,oe]}],"list-image":[{"list-image":["none",oe]}],"list-style-type":[{list:["none","disc","decimal",oe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[M]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...F(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ct,St]}],"underline-offset":[{"underline-offset":["auto",ct,oe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",oe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",oe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[M]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),fu]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",du]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},mu]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[M]}],"border-style":[{border:[...F(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[M]}],"divide-style":[{divide:F()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...F()]}],"outline-offset":[{"outline-offset":[ct,oe]}],"outline-w":[{outline:[ct,St]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:m()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[M]}],"ring-offset-w":[{"ring-offset":[ct,St]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xt,gu]}],"shadow-color":[{shadow:[Nn]}],opacity:[{opacity:[M]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",xt,oe]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[f]}],invert:[{invert:[d]}],saturate:[{saturate:[v]}],sepia:[{sepia:[te]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[f]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[M]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",oe]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",oe]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",oe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[J]}],"scale-x":[{"scale-x":[J]}],"scale-y":[{"scale-y":[J]}],rotate:[{rotate:[Rn,oe]}],"translate-x":[{"translate-x":[ve]}],"translate-y":[{"translate-y":[ve]}],"skew-x":[{"skew-x":[se]}],"skew-y":[{"skew-y":[se]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",oe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",oe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",oe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ct,St,pr]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Rs=tu(wu);var Be=(...e)=>Rs(vs(e));var Su=q("<div style=overflow:visible>"),Mt=e=>{let[t,n]=V(e.bounds.x),[o,r]=V(e.bounds.y),[i,s]=V(e.bounds.width),[a,c]=V(e.bounds.height),[l,f]=V(1),d=false,p=null,h=null,g=e.bounds,E=false,T=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,M=()=>{if(E)return;E=true;let A=()=>{let v=Et(t(),g.x,T()),J=Et(o(),g.y,T()),te=Et(i(),g.width,T()),se=Et(a(),g.height,T());n(v),r(J),s(te),c(se),Math.abs(v-g.x)<.5&&Math.abs(J-g.y)<.5&&Math.abs(te-g.width)<.5&&Math.abs(se-g.height)<.5?(p=null,E=false):p=requestAnimationFrame(A);};p=requestAnimationFrame(A);};return re(Fe(()=>e.bounds,A=>{if(g=A,!d){n(g.x),r(g.y),s(g.width),c(g.height),d=true;return}M();})),re(()=>{e.variant==="grabbed"&&e.createdAt&&(h=window.setTimeout(()=>{f(0);},1700));}),fe(()=>{p!==null&&(cancelAnimationFrame(p),p=null),h!==null&&(window.clearTimeout(h),h=null),E=false;}),R(ie,{get when(){return e.visible!==false},get children(){var A=Su();return le(v=>{var J=Be("fixed box-border",e.variant==="drag"&&"pointer-events-none",e.variant!=="drag"&&"pointer-events-auto",e.variant==="grabbed"&&"z-2147483645",e.variant!=="grabbed"&&"z-2147483646",e.variant==="drag"&&"border border-solid border-grab-purple/40 bg-grab-purple/5 will-change-[transform,width,height] cursor-crosshair",e.variant==="selection"&&"border border-solid border-grab-purple/50 bg-grab-purple/8 transition-opacity duration-100 ease-out",e.variant==="grabbed"&&"border border-solid border-grab-purple/50 bg-grab-purple/8",e.variant==="processing"&&!e.isCompleted&&"border border-solid border-grab-purple/50 bg-grab-purple/8",e.variant==="processing"&&e.isCompleted&&"border border-solid border-grab-purple/50 bg-grab-purple/8"),te=`${o()}px`,se=`${t()}px`,pe=`${i()}px`,ve=`${a()}px`,_e=e.bounds.borderRadius,Ce=e.bounds.transform,_=e.isFading?0:l(),w=e.variant==="drag"?"layout paint size":void 0;return J!==v.e&&Ke(A,v.e=J),te!==v.t&&Oe(A,"top",v.t=te),se!==v.a&&Oe(A,"left",v.a=se),pe!==v.o&&Oe(A,"width",v.o=pe),ve!==v.i&&Oe(A,"height",v.i=ve),_e!==v.n&&Oe(A,"border-radius",v.n=_e),Ce!==v.s&&Oe(A,"transform",v.s=Ce),_!==v.h&&Oe(A,"opacity",v.h=_),w!==v.r&&Oe(A,"contain",v.r=w),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),A}})};var Ns=e=>{let t=e.lerpFactor??.3,n=e.convergenceThreshold??.5,[o,r]=V(e.x()),[i,s]=V(e.y()),a=e.x(),c=e.y(),l=null,f=false,d=()=>{let h=Et(o(),a,t),g=Et(i(),c,t);r(h),s(g),Math.abs(h-a)<n&&Math.abs(g-c)<n?l=null:l=requestAnimationFrame(d);},p=()=>{l===null&&(l=requestAnimationFrame(d));};return re(()=>{if(a=e.x(),c=e.y(),!f){r(a),s(c),f=true;return}p();}),fe(()=>{l!==null&&(cancelAnimationFrame(l),l=null);}),{x:o,y:i}};var xu=q("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),vu="rgba(210, 57, 192)",_u=.3,Ms=e=>{let t,n=null,o=0,r=0,i=1,s=Ns({x:()=>e.mouseX,y:()=>e.mouseY,lerpFactor:_u}),a=()=>{t&&(i=Math.max(window.devicePixelRatio||1,2),o=window.innerWidth,r=window.innerHeight,t.width=o*i,t.height=r*i,t.style.width=`${o}px`,t.style.height=`${r}px`,n=t.getContext("2d"),n&&n.scale(i,i));},c=()=>{n&&(n.clearRect(0,0,o,r),n.strokeStyle=vu,n.lineWidth=1,n.beginPath(),n.moveTo(s.x(),0),n.lineTo(s.x(),r),n.moveTo(0,s.y()),n.lineTo(o,s.y()),n.stroke());};return re(()=>{a(),c();let l=()=>{a(),c();};window.addEventListener("resize",l),fe(()=>{window.removeEventListener("resize",l);});}),re(()=>{s.x(),s.y(),c();}),R(ie,{get when(){return e.visible!==false},get children(){var l=xu(),f=t;return typeof f=="function"?et(f,l):t=l,l}})};var Cu=q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 19"fill=none><path d="M6.76263 18.6626C7.48251 18.6626 7.95474 18.1682 7.95474 17.4895C7.95474 17.1207 7.80474 16.8576 7.58683 16.6361L5.3018 14.4137L2.84621 12.3589L2.44374 13.0037L5.92137 13.1622H17.9232C20.4842 13.1622 21.593 12.021 21.593 9.47237V3.66983C21.593 1.10875 20.4842 0 17.9232 0H12.5414C11.8179 0 11.3018 0.545895 11.3018 1.21695C11.3018 1.888 11.8179 2.43389 12.5414 2.43389H17.8424C18.7937 2.43389 19.1897 2.83653 19.1897 3.78784V9.35747C19.1897 10.3257 18.7937 10.7314 17.8424 10.7314H5.92137L2.44374 10.8832L2.84621 11.5281L5.3018 9.47993L7.58683 7.2606C7.80474 7.03914 7.95474 6.7693 7.95474 6.40049C7.95474 5.72854 7.48251 5.22747 6.76263 5.22747C6.46129 5.22747 6.12975 5.36905 5.89231 5.6096L0.376815 11.0425C0.134921 11.2777 0 11.6141 0 11.9452C0 12.2728 0.134921 12.6158 0.376815 12.848L5.89231 18.2871C6.12975 18.5276 6.46129 18.6626 6.76263 18.6626Z"fill=currentColor>'),Lt=e=>{let t=()=>e.size??12;return (()=>{var n=Cu();return le(o=>{var r=t(),i=t()*19/22,s=e.class;return r!==o.e&&Ee(n,"width",o.e=r),i!==o.t&&Ee(n,"height",o.t=i),s!==o.a&&Ee(n,"class",o.a=s),o},{e:void 0,t:void 0,a:void 0}),n})()};var Tu=q('<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">'),Ls=e=>{let t=()=>e.color??"white";return (()=>{var n=Tu();return le(o=>Ci(n,{left:`${e.leftPx}px`,...e.position==="bottom"?{top:"0",transform:"translateX(-50%) translateY(-100%)"}:{bottom:"0",transform:"translateX(-50%) translateY(100%)"},...e.position==="bottom"?{"border-bottom":`8px solid ${t()}`}:{"border-top":`8px solid ${t()}`}},o)),n})()};var Au=q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><path d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6"></path><path d="M11 13l9-9"></path><path d="M15 4h5v5">'),Ps=e=>{let t=()=>e.size??12;return (()=>{var n=Au();return le(o=>{var r=t(),i=t(),s=e.class;return r!==o.e&&Ee(n,"width",o.e=r),i!==o.t&&Ee(n,"height",o.t=i),s!==o.a&&Ee(n,"class",o.a=s),o},{e:void 0,t:void 0,a:void 0}),n})()};var Iu=q("<div><span>"),hr=e=>{let[t,n]=V(false),o=()=>{n(true),e.onHoverChange?.(true);},r=()=>{n(false),e.onHoverChange?.(false);};return (()=>{var i=Iu(),s=i.firstChild;return Qe(i,"click",e.onClick),i.addEventListener("mouseleave",r),i.addEventListener("mouseenter",o),Y(s,()=>e.tagName),Y(i,R(ie,{get when(){return e.isClickable||e.forceShowIcon},get children(){return R(Ps,{size:10,get class(){return Be("text-white transition-all duration-100",t()||e.forceShowIcon?"opacity-100 scale-100":"opacity-0 scale-75 -ml-[2px] w-0")}})}}),null),le(a=>{var c=Be("contain-layout flex items-center px-[3px] py-0 h-4 rounded-sm gap-0.5 [border-width:0.5px] border-solid border-black bg-black",e.shrink&&"shrink-0 w-fit",e.isClickable&&"cursor-pointer"),l=Be("text-white text-[13px] leading-3.5 shrink-0 w-fit h-fit font-medium");return c!==a.e&&Ke(i,a.e=c),l!==a.t&&Ke(s,a.t=l),a},{e:void 0,t:void 0}),i})()};$e(["click"]);var ku=q("<span class=text-black/50>"),Ou=q('<div role=button><div class="text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit"><span class=text-black>'),br=e=>{let t=()=>e.hasAgent?e.isEditing?null:"Right click to ":"Click to ",n=()=>e.hasAgent?e.isEditing?"Editing":"Edit":"Copy";return (()=>{var o=Ou(),r=o.firstChild,i=r.firstChild;return Qe(o,"click",e.onClick),Y(r,R(ie,{get when(){return t()},get children(){var s=ku();return Y(s,t),s}}),i),Y(i,n),le(()=>Ke(o,Be("contain-layout shrink-0 flex items-center px-0 py-px w-fit h-[18px] rounded-sm gap-[3px]",e.asButton&&"cursor-pointer",e.dimmed&&"opacity-50 hover:opacity-100 transition-opacity"))),o})()};$e(["click"]);var Ru=q('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-[5px] w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] antialiased rounded-t-none rounded-b-sm -mt-px">'),rt=e=>(()=>{var t=Ru();return Oe(t,"background-image",gs),Y(t,()=>e.children),t})();var bo=null,He={claim:e=>{bo=e;},release:e=>{bo===e&&(bo=null);},isActive:e=>bo===e};var Nu=q('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">No</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Yes'),Mu=q('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Discard?'),yr=e=>{let t=Symbol(),n=r=>{He.isActive(t)&&(Xe(r)||(r.code==="Enter"||r.code==="Escape")&&(r.preventDefault(),r.stopPropagation(),e.onConfirm?.()));},o=()=>{He.claim(t);};return qe(()=>{He.claim(t),window.addEventListener("keydown",n,{capture:true});}),fe(()=>{He.release(t),window.removeEventListener("keydown",n,{capture:true});}),(()=>{var r=Mu();r.firstChild;return r.$$click=o,r.$$pointerdown=o,Y(r,R(rt,{get children(){var s=Nu(),a=s.firstChild,c=a.nextSibling;c.firstChild;return Qe(a,"click",e.onCancel),Qe(c,"click",e.onConfirm),Y(c,R(Lt,{size:10,class:"text-[#c00002]"}),null),s}}),null),r})()};$e(["pointerdown","click"]);var Lu=q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4C7.58 4 4.01 7.58 4.01 12C4.01 16.42 7.58 20 12 20C15.73 20 18.84 17.45 19.73 14H17.65C16.83 16.33 14.61 18 12 18C8.69 18 6 15.31 6 12C6 8.69 8.69 6 12 6C13.66 6 15.14 6.69 16.22 7.78L13 11H20V4L17.65 6.35Z"fill=currentColor>'),Ds=e=>{let t=()=>e.size??12;return (()=>{var n=Lu();return le(o=>{var r=t(),i=t(),s=e.class;return r!==o.e&&Ee(n,"width",o.e=r),i!==o.t&&Ee(n,"height",o.t=i),s!==o.a&&Ee(n,"class",o.a=s),o},{e:void 0,t:void 0,a:void 0}),n})()};var Pu=q('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Retry</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Ok'),Du=q('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-[#B91C1C] text-[13px] leading-4 font-sans font-medium">'),Bs=e=>{let t=Symbol(),n=i=>{He.isActive(t)&&(Xe(i)||(i.code==="Enter"?(i.preventDefault(),i.stopPropagation(),e.onRetry?.()):i.code==="Escape"&&(i.preventDefault(),i.stopPropagation(),e.onAcknowledge?.())));},o=()=>{He.claim(t);},r=()=>{let i=e.error;return i.length<=50?i:`${i.slice(0,50)}\u2026`};return qe(()=>{He.claim(t),window.addEventListener("keydown",n,{capture:true});}),fe(()=>{He.release(t),window.removeEventListener("keydown",n,{capture:true});}),(()=>{var i=Du(),s=i.firstChild,a=s.firstChild;return i.$$click=o,i.$$pointerdown=o,Y(a,r),Y(i,R(rt,{get children(){var c=Pu(),l=c.firstChild;l.firstChild;var d=l.nextSibling;return Qe(l,"click",e.onRetry),Y(l,R(Ds,{size:10,class:"text-black/50"}),null),Qe(d,"click",e.onAcknowledge),c}}),null),le(()=>Ee(a,"title",e.error)),i})()};$e(["pointerdown","click"]);var $u=q('<button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Undo'),Bu=q('<button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">'),Fu=q('<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums"></span><div class="contain-layout shrink-0 flex items-center gap-[5px] h-fit">'),Uu=q('<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums">'),Hu=q('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">'),Gu=q('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col justify-center items-end rounded-sm bg-white antialiased w-fit h-fit max-w-[280px]">'),Fs=e=>{let t=Symbol(),n,[o,r]=V(false),[i,s]=V(e.statusText),[a,c]=V(""),l=()=>{r(true),s("Copied"),e.onCopyStateChange?.(),setTimeout(()=>{e.onDismiss?.();},1500);},f=()=>{let g=a().trim();g&&e.onFollowUpSubmit&&e.onFollowUpSubmit(g);},d=g=>{g.code==="KeyZ"&&(g.metaKey||g.ctrlKey)||(g.stopPropagation(),g.stopImmediatePropagation()),g.code==="Enter"&&!g.shiftKey?(g.preventDefault(),f()):g.code==="Escape"&&(g.preventDefault(),l());},p=g=>{if(!He.isActive(t))return;if(g.code==="KeyZ"&&(g.metaKey||g.ctrlKey)&&!g.shiftKey&&e.supportsUndo&&e.onUndo){g.preventDefault(),g.stopPropagation(),e.onUndo();return}Xe(g)||(g.code==="Enter"||g.code==="Escape")&&(g.preventDefault(),g.stopPropagation(),l());},h=()=>{He.claim(t);};return re(()=>{o()||s(e.statusText);}),qe(()=>{He.claim(t),window.addEventListener("keydown",p,{capture:true}),e.supportsFollowUp&&e.onFollowUpSubmit&&n&&n.focus();}),fe(()=>{He.release(t),window.removeEventListener("keydown",p,{capture:true});}),(()=>{var g=Gu();return g.$$click=h,g.$$pointerdown=h,Y(g,R(ie,{get when(){return Te(()=>!o())()&&(e.onDismiss||e.onUndo)},get children(){var E=Fu(),T=E.firstChild,M=T.nextSibling;return Y(T,i),Y(M,R(ie,{get when(){return Te(()=>!!e.supportsUndo)()&&e.onUndo},get children(){var A=$u();return A.$$click=()=>e.onUndo?.(),A}}),null),Y(M,R(ie,{get when(){return e.onDismiss},get children(){var A=Bu(),v=A.firstChild;return A.$$click=l,Y(v,()=>e.dismissButtonText??"Keep"),Y(A,R(ie,{get when(){return !o()},get children(){return R(Lt,{size:10,class:"text-black/50"})}}),null),le(()=>A.disabled=o()),A}}),null),E}}),null),Y(g,R(ie,{get when(){return o()||!e.onDismiss&&!e.onUndo},get children(){var E=Uu(),T=E.firstChild;return Y(T,i),E}}),null),Y(g,R(ie,{get when(){return Te(()=>!!(!o()&&e.supportsFollowUp))()&&e.onFollowUpSubmit},get children(){return R(rt,{get children(){var E=Hu(),T=E.firstChild,M=T.nextSibling;T.$$keydown=d,T.$$input=v=>c(v.target.value);var A=n;return typeof A=="function"?et(A,T):n=T,M.$$click=f,Y(M,R(Lt,{size:10,class:"opacity-[0.99] text-black"})),le(()=>Ee(T,"placeholder",e.previousPrompt??"type follow-up")),le(()=>T.value=a()),E}})}}),null),g})()};$e(["pointerdown","click","input","keydown"]);var zu=q('<button data-react-grab-ignore-events class="contain-layout shrink-0 flex flex-col items-start rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] p-1 size-fit cursor-pointer ml-1 transition-none hover:scale-105"><div data-react-grab-ignore-events class="shrink-0 w-[7px] h-[7px] rounded-[1px] bg-black pointer-events-none">'),Vu=q('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 opacity-50 wrap-break-word overflow-y-auto"placeholder="type to edit"rows=1 disabled style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>'),Ku=q('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-auto h-fit"><div class="contain-layout flex items-center px-0 py-px w-auto h-fit rounded-sm gap-[3px]"><span class="text-[13px] leading-4 font-sans font-medium w-auto h-fit whitespace-normal text-[#71717a] animate-pulse tabular-nums">'),Xu=q('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">'),Wu=q('<div class="shrink-0 flex items-center gap-0.5 w-full mb-0.5 overflow-hidden"><span class="text-[#a1a1aa] text-[10px] leading-3 shrink-0">>previously:</span><span class="text-[#a1a1aa] text-[10px] leading-3 italic truncate whitespace-nowrap">'),Yu=q('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="type prompt"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">'),qu=q('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">'),Zu=q('<div data-react-grab-ignore-events class="fixed font-sans text-[13px] antialiased transition-opacity duration-300 ease-out filter-[drop-shadow(0px_0px_4px_#51515180)] select-none"style=z-index:2147483647><div class="[font-synthesis:none] contain-layout flex items-center gap-[5px] rounded-sm bg-white antialiased w-fit h-fit p-0">'),Dt=e=>{let t,n,o=false,r=null,i=null,[s,a]=V(0),[c,l]=V(0),[f,d]=V("bottom"),[p,h]=V(0),[g,E]=V(false),[T,M]=V(false),A=()=>e.status!=="copying"&&e.status!=="copied"&&e.status!=="fading",v=()=>{if(t&&!o){let y=t.getBoundingClientRect();a(y.width),l(y.height);}},J=y=>{o=y;},te=()=>{h(y=>y+1);},se,pe=()=>{E(false),se&&clearTimeout(se),se=setTimeout(()=>{E(true);},400);},ve=y=>{Xe(y)||(y.code==="Enter"&&g()&&!e.isInputMode&&A()?(y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation(),e.onToggleExpand?.()):y.code==="KeyC"&&y.ctrlKey&&e.status==="copying"&&e.onAbort&&(y.preventDefault(),y.stopPropagation(),y.stopImmediatePropagation(),e.onAbort()));};qe(()=>{v(),window.addEventListener("scroll",te,true),window.addEventListener("resize",te),window.addEventListener("keydown",ve,{capture:true}),pe();}),fe(()=>{window.removeEventListener("scroll",te,true),window.removeEventListener("resize",te),window.removeEventListener("keydown",ve,{capture:true}),se&&clearTimeout(se);}),re(()=>{let y=`${e.tagName??""}:${e.componentName??""}`;y!==i&&(i=y,pe());}),re(()=>{e.tagName,e.componentName,e.elementsCount,e.statusText,e.inputValue,e.hasAgent,e.isInputMode,e.isPendingDismiss,e.error,e.isPendingAbort,requestAnimationFrame(v);}),re(()=>{e.visible&&requestAnimationFrame(v);}),re(()=>{e.status,requestAnimationFrame(v);}),re(()=>{e.isInputMode&&n&&setTimeout(()=>{n?.focus();},0);});let _e=()=>{p();let y=e.selectionBounds,N=s(),L=c(),D=N>0&&L>0,Z=y&&y.width>0&&y.height>0;if(!D||!Z)return r??{left:-9999,top:-9999,arrowLeft:0};let z=window.innerWidth,K=window.innerHeight,ue=y.x+y.width/2,k=e.mouseX??ue,G=y.y+y.height,X=y.y,W=k-N/2,me=G+8+4;W+N>z-8&&(W=z-N-8),W<8&&(W=8);let ae=L+8+4;me+L<=K-8?d("bottom"):(me=X-ae,d("top")),me<8&&(me=8);let be=Math.max(12,Math.min(k-W,N-12)),Ie={left:W,top:me,arrowLeft:be};return r=Ie,M(true),Ie},Ce=y=>{y.stopPropagation(),y.stopImmediatePropagation(),y.code==="Enter"&&!y.shiftKey?(y.preventDefault(),e.onSubmit?.()):y.code==="Escape"&&(y.preventDefault(),e.onConfirmDismiss?.());},_=y=>{let N=y.target;e.onInputChange?.(N.value);},w=()=>e.elementsCount&&e.elementsCount>1?`${e.elementsCount} elements`:e.componentName&&e.tagName?`${e.componentName}.${e.tagName}`:e.componentName||e.tagName||"element",m=y=>{y.stopPropagation(),y.stopImmediatePropagation(),e.filePath&&e.onOpen&&e.onOpen();},S=()=>!!(e.filePath&&e.onOpen),I=y=>{y.stopPropagation(),y.stopImmediatePropagation();},F=y=>{I(y),A()&&e.isInputMode&&!e.isPendingDismiss&&n&&n.focus();},U=()=>{e.onSubmit?.();},C=()=>T()&&(e.status==="copied"||e.status==="fading");return R(ie,{get when(){return Te(()=>e.visible!==false)()&&(e.selectionBounds||C())},get children(){var y=Zu(),N=y.firstChild;y.$$click=I,y.$$mousedown=I,y.$$pointerdown=F;var L=t;return typeof L=="function"?et(L,y):t=y,Y(y,R(Ls,{get position(){return f()},get leftPx(){return _e().arrowLeft}}),N),Y(y,R(ie,{get when(){return Te(()=>e.status==="copied"||e.status==="fading")()&&!e.error},get children(){return R(Fs,{get statusText(){return Te(()=>!!e.hasAgent)()?e.statusText??"Completed":"Copied"},get supportsUndo(){return e.supportsUndo},get supportsFollowUp(){return e.supportsFollowUp},get dismissButtonText(){return e.dismissButtonText},get previousPrompt(){return e.previousPrompt},get onDismiss(){return e.onDismiss},get onUndo(){return e.onUndo},get onFollowUpSubmit(){return e.onFollowUpSubmit},onCopyStateChange:()=>requestAnimationFrame(v)})}}),N),Y(N,R(ie,{get when(){return Te(()=>e.status==="copying")()&&!e.isPendingAbort},get children(){var D=Ku(),Z=D.firstChild,z=Z.firstChild,K=z.firstChild;return Y(K,()=>e.statusText??"Grabbing\u2026"),Y(D,R(rt,{get children(){var ue=Vu(),k=ue.firstChild,G=n;return typeof G=="function"?et(G,k):n=k,Y(ue,R(ie,{get when(){return e.onAbort},get children(){var X=zu();return X.$$click=W=>{W.stopPropagation(),e.onAbort?.();},X.$$pointerup=W=>{W.stopPropagation(),e.onAbort?.();},X.$$mousedown=W=>W.stopPropagation(),X.$$pointerdown=W=>W.stopPropagation(),X}}),null),le(()=>k.value=e.inputValue??""),ue}}),null),D}}),null),Y(N,R(ie,{get when(){return Te(()=>e.status==="copying")()&&e.isPendingAbort},get children(){return R(yr,{get onConfirm(){return e.onConfirmAbort},get onCancel(){return e.onCancelAbort}})}}),null),Y(N,R(ie,{get when(){return Te(()=>!!A())()&&!e.isInputMode},get children(){var D=Xu(),Z=D.firstChild;return Y(Z,R(hr,{get tagName(){return w()},get isClickable(){return S()},onClick:m,onHoverChange:J,shrink:true})),Y(D,R(rt,{get children(){return R(br,{onClick:U,shrink:true,get hasAgent(){return e.hasAgent}})}}),null),D}}),null),Y(N,R(ie,{get when(){return Te(()=>!!(A()&&e.isInputMode))()&&!e.isPendingDismiss},get children(){var D=qu(),Z=D.firstChild;return Y(Z,R(br,{onClick:U,dimmed:true,shrink:true,get hasAgent(){return e.hasAgent},isEditing:true}),null),Y(Z,R(hr,{get tagName(){return w()},get isClickable(){return S()},onClick:m,onHoverChange:J,shrink:true,forceShowIcon:true}),null),Y(D,R(rt,{get children(){return [R(ie,{get when(){return e.replyToPrompt},get children(){var z=Wu(),K=z.firstChild,ue=K.nextSibling;return Y(ue,()=>e.replyToPrompt),z}}),(()=>{var z=Yu(),K=z.firstChild,ue=K.nextSibling;K.$$keydown=Ce,K.$$input=_;var k=n;return typeof k=="function"?et(k,K):n=K,ue.$$click=U,Y(ue,R(Lt,{size:10,class:"opacity-[0.99] text-black"})),le(()=>K.value=e.inputValue??""),z})()]}}),null),D}}),null),Y(N,R(ie,{get when(){return e.isPendingDismiss},get children(){return R(yr,{get onConfirm(){return e.onConfirmDismiss},get onCancel(){return e.onCancelDismiss}})}}),null),Y(N,R(ie,{get when(){return e.error},get children(){return R(Bs,{get error(){return e.error},get onAcknowledge(){return e.onAcknowledgeError},get onRetry(){return e.onRetry}})}}),null),le(D=>{var Z=`${_e().top}px`,z=`${_e().left}px`,K=e.isInputMode||e.status==="copied"&&e.onDismiss||e.status==="copying"&&e.onAbort?"auto":"none",ue=e.status==="fading"?0:1,k=(e.status==="copied"||e.status==="fading")&&!e.error?"none":void 0;return Z!==D.e&&Oe(y,"top",D.e=Z),z!==D.t&&Oe(y,"left",D.t=z),K!==D.a&&Oe(y,"pointer-events",D.a=K),ue!==D.o&&Oe(y,"opacity",D.o=ue),k!==D.i&&Oe(N,"display",D.i=k),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),y}})};$e(["pointerdown","mousedown","click","pointerup","input","keydown"]);var Qu=q('<div class="fixed z-2147483647"><button data-react-grab-selection-cursor>'),Gs=e=>{let[t,n]=V(false),[o,r]=V(false);re(()=>{let s=e.visible!==false;if(e.x,e.y,r(false),s){let a=setTimeout(()=>r(true),500);fe(()=>clearTimeout(a));}}),re(()=>{if(!o()||!e.onEnter)return;let s=a=>{Xe(a)||!(a.code==="Enter"||a.code==="NumpadEnter")||(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),e.onEnter?.());};window.addEventListener("keydown",s,true),fe(()=>{window.removeEventListener("keydown",s,true);});});let i=s=>{s.preventDefault(),s.stopPropagation(),e.onClick?.();};return R(ie,{get when(){return o()},get children(){return [R(ie,{get when(){return Te(()=>!!t())()&&e.elementBounds},get children(){return R(Mt,{variant:"selection",get bounds(){return e.elementBounds},visible:true})}}),(()=>{var s=Qu(),a=s.firstChild;return s.addEventListener("mouseleave",()=>n(false)),s.addEventListener("mouseenter",()=>n(true)),a.$$click=i,le(c=>{var l=`${e.x}px`,f=`${e.y}px`,d=Be("absolute left-0 top-0 -translate-x-1/2 -translate-y-1/2 bg-grab-pink cursor-pointer rounded-full transition-[width,height] duration-150",t()?"w-1 h-5.5 brightness-125":"w-0.5 h-5 animate-pulse");return l!==c.e&&Oe(s,"left",c.e=l),f!==c.t&&Oe(s,"top",c.t=f),d!==c.a&&Ke(a,c.a=d),c},{e:void 0,t:void 0,a:void 0}),s})(),R(ie,{get when(){return Te(()=>!!t())()&&e.elementBounds},get children(){return R(Dt,{get tagName(){return e.tagName},get componentName(){return e.componentName},get selectionBounds(){return e.elementBounds},get mouseX(){return e.x},visible:true,get onSubmit(){return e.onClick}})}})]}})};$e(["click"]);var js="react-grab-dock-state",zs=()=>{try{let e=localStorage.getItem(js);if(e)return JSON.parse(e)}catch{}return null},yo=e=>{try{localStorage.setItem(js,JSON.stringify(e));}catch{}};var ed=q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 18"fill=currentColor><path opacity=0.4 d="M7.65631 10.9565C7.31061 10.0014 7.54012 8.96635 8.25592 8.25195C8.74522 7.76615 9.38771 7.49951 10.0694 7.49951C10.3682 7.49951 10.6641 7.55171 10.9483 7.65381L16.0001 9.49902V4.75C16.0001 3.2334 14.7667 2 13.2501 2H4.75012C3.23352 2 2.00012 3.2334 2.00012 4.75V13.25C2.00012 14.7666 3.23352 16 4.75012 16H9.49962L7.65631 10.9565Z"></path><path d="M17.296 11.5694L10.4415 9.06545C10.0431 8.92235 9.61441 9.01658 9.31551 9.31338C9.01671 9.61168 8.92101 10.0429 9.06551 10.4413L11.5704 17.2948C11.7247 17.7191 12.128 18.0004 12.5772 18.0004C12.585 18.0004 12.5918 17.9999 12.5987 17.9999C13.0577 17.9906 13.4591 17.6913 13.5987 17.2543L14.4854 14.4857L17.2559 13.5985C17.6914 13.4589 17.9903 13.057 18 12.599C18.0097 12.141 17.7267 11.7276 17.296 11.5694Z">'),Vs=e=>{let t=()=>e.size??14;return (()=>{var n=ed();return le(o=>{var r=t(),i=t(),s=e.class;return r!==o.e&&Ee(n,"width",o.e=r),i!==o.t&&Ee(n,"height",o.t=i),s!==o.a&&Ee(n,"class",o.a=s),o},{e:void 0,t:void 0,a:void 0}),n})()};var td=q('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round><path d="m18 15-6-6-6 6">'),Ks=e=>{let t=()=>e.size??12;return (()=>{var n=td();return le(o=>{var r=t(),i=t(),s=e.class;return r!==o.e&&Ee(n,"width",o.e=r),i!==o.t&&Ee(n,"height",o.t=i),s!==o.a&&Ee(n,"class",o.a=s),o},{e:void 0,t:void 0,a:void 0}),n})()};var nd=q('<div data-react-grab-ignore-events style=z-index:2147483647><div><div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105"></button></div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105">'),xe=16,Xs=768,Ws=500,od=5,Ys=150,qs=14,Zs=e=>{let t,[n,o]=V(window.innerWidth<Xs),[r,i]=V(false),[s,a]=V(false),[c,l]=V(false),[f,d]=V(false),[p,h]=V(false),[g,E]=V("bottom"),[T,M]=V(.5),[A,v]=V({x:0,y:0}),[J,te]=V({x:0,y:0}),[se,pe]=V({x:0,y:0}),[ve,_e]=V(false),Ce={x:0,y:0,time:0},_={x:0,y:0},w=(k,G,X,W)=>{let me=window.innerWidth,ae=window.innerHeight;if(k==="top"||k==="bottom"){let je=me-X-xe*2,We=xe+je*G,Ht=k==="top"?xe:ae-W-xe;return {x:We,y:Ht}}let ne=ae-W-xe*2,be=xe+ne*G;return {x:k==="left"?xe:me-X-xe,y:be}},m=(k,G,X,W,me)=>{let ae=window.innerWidth,ne=window.innerHeight;if(k==="top"||k==="bottom"){let Ie=ae-W-xe*2;return Ie<=0?.5:Math.max(0,Math.min(1,(G-xe)/Ie))}let be=ne-me-xe*2;return be<=0?.5:Math.max(0,Math.min(1,(X-xe)/be))},S=()=>{let k=t?.getBoundingClientRect();if(!k)return;let G=w(g(),T(),k.width,k.height);v(G);},I=false,F=k=>{if(k.stopPropagation(),k.stopImmediatePropagation(),I){I=false;return}e.onToggle?.();},U=k=>{if(k.stopPropagation(),k.stopImmediatePropagation(),I){I=false;return}a(G=>{let X=!G;return yo({edge:g(),ratio:T(),collapsed:X}),X});},C=(k,G,X,W,me,ae)=>{let ne=window.innerWidth,be=window.innerHeight,Ie=k+me*Ys,je=G+ae*Ys,We=je+W/2,Ht=be-je-W/2,pn=Ie+X/2,Je=ne-Ie-X/2,vt=Math.min(We,Ht,pn,Je);return vt===We?{edge:"top",x:Math.max(xe,Math.min(Ie,ne-X-xe)),y:xe}:vt===pn?{edge:"left",x:xe,y:Math.max(xe,Math.min(je,be-W-xe))}:vt===Je?{edge:"right",x:ne-X-xe,y:Math.max(xe,Math.min(je,be-W-xe))}:{edge:"bottom",x:Math.max(xe,Math.min(Ie,ne-X-xe)),y:be-W-xe}},y=k=>{if(s())return;let G=t?.getBoundingClientRect();G&&(_={x:k.clientX,y:k.clientY},te({x:k.clientX-G.left,y:k.clientY-G.top}),l(true),_e(false),pe({x:0,y:0}),Ce={x:k.clientX,y:k.clientY,time:performance.now()},k.target.setPointerCapture(k.pointerId));},N=k=>{if(!c()||(Math.sqrt(Math.pow(k.clientX-_.x,2)+Math.pow(k.clientY-_.y,2))>od&&_e(true),!ve()))return;let X=performance.now(),W=X-Ce.time;if(W>0){let ne=(k.clientX-Ce.x)/W,be=(k.clientY-Ce.y)/W;pe({x:ne,y:be});}Ce={x:k.clientX,y:k.clientY,time:X};let me=k.clientX-J().x,ae=k.clientY-J().y;v({x:me,y:ae});},L=()=>{if(!c())return;let k=ve();if(l(false),!k)return;I=true;let G=t?.getBoundingClientRect();if(!G)return;let X=se(),W=C(A().x,A().y,G.width,G.height,X.x,X.y),me=m(W.edge,W.x,W.y,G.width,G.height);E(W.edge),M(me),d(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{v({x:W.x,y:W.y}),yo({edge:W.edge,ratio:me,collapsed:s()}),setTimeout(()=>{d(false);},300);});});},D=()=>{let k=g(),G=A();return k==="top"?{x:G.x,y:0}:k==="bottom"?{x:G.x,y:window.innerHeight-qs}:k==="left"?{x:0,y:G.y}:k==="right"?{x:window.innerWidth-qs,y:G.y}:G},Z=()=>{let k=g(),G=s();return k==="top"?G?"rotate-180":"rotate-0":k==="bottom"?G?"rotate-0":"rotate-180":k==="left"?G?"rotate-90":"-rotate-90":k==="right"?G?"-rotate-90":"rotate-90":"rotate-0"},z,K=()=>{o(window.innerWidth<Xs),!c()&&(h(true),i(false),S(),z&&clearTimeout(z),z=setTimeout(()=>{i(true),h(false);},Ws));};qe(()=>{let k=zs(),G=t?.getBoundingClientRect();if(k&&G){E(k.edge),M(k.ratio),a(k.collapsed);let W=w(k.edge,k.ratio,G.width,G.height);v(W);}else G&&(v({x:(window.innerWidth-G.width)/2,y:window.innerHeight-G.height-xe}),M(.5));window.addEventListener("resize",K);let X=setTimeout(()=>{i(true);},Ws);fe(()=>{clearTimeout(X);});}),fe(()=>{window.removeEventListener("resize",K),z&&clearTimeout(z);});let ue=()=>s()?D():A();return n()?null:(()=>{var k=nd(),G=k.firstChild,X=G.firstChild,W=X.firstChild,me=X.nextSibling;k.$$pointerup=L,k.$$pointermove=N,k.$$pointerdown=y;var ae=t;return typeof ae=="function"?et(ae,k):t=k,G.$$click=ne=>{s()&&(ne.stopPropagation(),a(false),yo({edge:g(),ratio:T(),collapsed:false}));},W.$$click=F,Y(W,R(Vs,{size:14,get class(){return Be("transition-colors",e.isActive?"text-black":"text-black/70")}})),me.$$click=U,Y(me,R(Ks,{get class(){return Be("text-[#B3B3B3] transition-transform duration-100",Z())}})),le(ne=>{var be=Be("fixed left-0 top-0 font-sans text-[13px] antialiased filter-[drop-shadow(0px_0px_4px_#51515180)] select-none",s()?"cursor-pointer":c()?"cursor-grabbing":"cursor-grab",p()?"":f()?"transition-[transform,opacity] duration-300 ease-out":"transition-opacity duration-300 ease-out",r()?"opacity-100":"opacity-0 pointer-events-none"),Ie=`translate(${ue().x}px, ${ue().y}px)`,je=Be("[font-synthesis:none] contain-layout flex items-center justify-center rounded-sm bg-white antialiased transition-all duration-100 ease-out",s()?"":"gap-1.5 px-2 py-1.5",s()&&g()==="top"&&"rounded-t-none",s()&&g()==="bottom"&&"rounded-b-none",s()&&g()==="left"&&"rounded-l-none",s()&&g()==="right"&&"rounded-r-none",s()&&(g()==="top"||g()==="bottom")&&"px-2 py-0.25",s()&&(g()==="left"||g()==="right")&&"px-0.25 py-2"),We=Be("flex items-center gap-1.5 transition-all duration-100 ease-out overflow-hidden",s()?"max-w-0 opacity-0":"max-w-[200px] opacity-100");return be!==ne.e&&Ke(k,ne.e=be),Ie!==ne.t&&Oe(k,"transform",ne.t=Ie),je!==ne.a&&Ke(G,ne.a=je),We!==ne.o&&Ke(X,ne.o=We),ne},{e:void 0,t:void 0,a:void 0,o:void 0}),k})()};$e(["pointerdown","pointermove","pointerup","click"]);var Js=e=>{let t=ee(()=>e.agentSessions?Array.from(e.agentSessions.values()):[]),n=ee(()=>e.selectionBoundsMultiple&&e.selectionBoundsMultiple.length>0?e.selectionBoundsMultiple:e.selectionBounds?[e.selectionBounds]:[]);return [R(ie,{get when(){return e.selectionVisible},get children(){return R(Kt,{get each(){return n()},children:o=>R(Mt,{variant:"selection",bounds:o,get visible(){return e.selectionVisible},get isFading(){return e.selectionLabelStatus==="fading"}})})}}),R(ie,{get when(){return Te(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return R(Ms,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),R(ie,{get when(){return Te(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return R(Mt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),R(Kt,{get each(){return e.grabbedBoxes??[]},children:o=>R(Mt,{variant:"grabbed",get bounds(){return o.bounds},get createdAt(){return o.createdAt}})}),R(jo,{get each(){return t()},children:o=>[R(Kt,{get each(){return o().selectionBounds},children:r=>R(Mt,{variant:"processing",bounds:r,visible:true,get isCompleted(){return !o().isStreaming}})}),R(ie,{get when(){return o().selectionBounds.length>0},get children(){return R(Dt,{get tagName(){return o().tagName},get componentName(){return o().componentName},get selectionBounds(){return o().selectionBounds[0]},get mouseX(){return o().position.x},visible:true,hasAgent:true,isAgentConnected:true,get status(){return o().isStreaming?"copying":"copied"},get statusText(){return o().lastStatus||"Thinking\u2026"},get inputValue(){return o().context.prompt},get previousPrompt(){return o().context.prompt},get supportsUndo(){return e.supportsUndo},get supportsFollowUp(){return e.supportsFollowUp},get dismissButtonText(){return e.dismissButtonText},onAbort:()=>e.onAbortSession?.(o().id),get onDismiss(){return o().isStreaming?void 0:()=>e.onDismissSession?.(o().id)},get onUndo(){return o().isStreaming?void 0:()=>e.onUndoSession?.(o().id)},get onFollowUpSubmit(){return o().isStreaming?void 0:r=>e.onFollowUpSubmitSession?.(o().id,r)},get error(){return o().error},onAcknowledgeError:()=>e.onAcknowledgeSessionError?.(o().id),onRetry:()=>e.onRetrySession?.(o().id),get isPendingAbort(){return Te(()=>!!o().isStreaming)()?e.isPendingAgentAbort:false},get onConfirmAbort(){return e.onConfirmAgentAbort},get onCancelAbort(){return e.onCancelAgentAbort}})}})]}),R(ie,{get when(){return Te(()=>!!e.selectionLabelVisible)()&&e.selectionBounds},get children(){return R(Dt,{get tagName(){return e.selectionTagName},get componentName(){return e.selectionComponentName},get elementsCount(){return e.selectionElementsCount},get selectionBounds(){return e.selectionBounds},get mouseX(){return e.mouseX},get visible(){return e.selectionLabelVisible},get isInputMode(){return e.isInputMode},get inputValue(){return e.inputValue},get replyToPrompt(){return e.replyToPrompt},get hasAgent(){return e.hasAgent},get isAgentConnected(){return e.isAgentConnected},get status(){return e.selectionLabelStatus},get filePath(){return e.selectionFilePath},get lineNumber(){return e.selectionLineNumber},get onInputChange(){return e.onInputChange},get onSubmit(){return e.onInputSubmit},get onCancel(){return e.onInputCancel},get onToggleExpand(){return e.onToggleExpand},get isPendingDismiss(){return e.isPendingDismiss},get onConfirmDismiss(){return e.onConfirmDismiss},get onCancelDismiss(){return e.onCancelDismiss},onOpen:()=>{if(e.selectionFilePath){let o=ho(e.selectionFilePath,e.selectionLineNumber);window.open(o,"_blank");}}})}}),R(Kt,{get each(){return e.labelInstances??[]},children:o=>R(Dt,{get tagName(){return o.tagName},get componentName(){return o.componentName},get selectionBounds(){return o.bounds},get mouseX(){return o.mouseX},visible:true,get status(){return o.status}})}),R(ie,{get when(){return Te(()=>!!(e.nativeSelectionCursorVisible&&e.nativeSelectionCursorX!==void 0))()&&e.nativeSelectionCursorY!==void 0},get children(){return R(Gs,{get x(){return e.nativeSelectionCursorX},get y(){return e.nativeSelectionCursorY},get tagName(){return e.nativeSelectionTagName},get componentName(){return e.nativeSelectionComponentName},get elementBounds(){return e.nativeSelectionBounds},get visible(){return e.nativeSelectionCursorVisible},get onClick(){return e.onNativeSelectionCopy},get onEnter(){return e.onNativeSelectionEnter}})}}),R(ie,{get when(){return e.dockVisible!==false},get children(){return R(Zs,{get isActive(){return e.isActive},get onToggle(){return e.onToggleActive}})}})]};var ta="0.5.27",So=`bippy-${ta}`,Qs=Object.defineProperty,rd=Object.prototype.hasOwnProperty,Mn=()=>{},na=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},xo=(e=ut())=>"getFiberRoots"in e,oa=false,ea,Ln=(e=ut())=>oa?true:(typeof e.inject=="function"&&(ea=e.inject.toString()),!!ea?.includes("(injected)")),wo=new Set,$t=new Set,ra=e=>{let t=new Map,n=0,o={_instrumentationIsActive:false,_instrumentationSource:So,checkDCE:na,hasUnsupportedRendererAttached:false,inject(r){let i=++n;return t.set(i,r),$t.add(r),o._instrumentationIsActive||(o._instrumentationIsActive=true,wo.forEach(s=>s())),i},on:Mn,onCommitFiberRoot:Mn,onCommitFiberUnmount:Mn,onPostCommitFiberRoot:Mn,renderers:t,supportsFiber:true,supportsFlight:true};try{Qs(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return o},set(s){if(s&&typeof s=="object"){let a=o.renderers;o=s,a.size>0&&(a.forEach((c,l)=>{$t.add(c),s.renderers.set(l,c);}),Eo(e));}}});let r=window.hasOwnProperty,i=!1;Qs(window,"hasOwnProperty",{configurable:!0,value:function(...s){try{if(!i&&s[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,i=!0,-0}catch{}return r.apply(this,s)},writable:!0});}catch{Eo(e);}return o},Eo=e=>{try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=na,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=So,t._instrumentationIsActive=!1;let n=xo(t);if(n||(t.on=Mn),t.renderers.size){t._instrumentationIsActive=!0,wo.forEach(i=>i());return}let o=t.inject,r=Ln(t);r&&!n&&(oa=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=o(i);return $t.add(i),r&&t.renderers.set(s,i),t._instrumentationIsActive=!0,wo.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||Ln())&&e?.();}catch{}},wr=()=>rd.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),ut=e=>wr()?(Eo(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):ra(e),ia=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Er=()=>{try{ia()&&ut();}catch{}};var Sr=0,xr=1;var vr=5;var _r=11,Cr=13;var Tr=15,Ar=16;var Ir=19;var kr=26,Or=27,Rr=28,Nr=30;function Mr(e,t,n=false){if(!e)return null;let o=t(e);if(o instanceof Promise)return (async()=>{if(await o===true)return e;let i=n?e.return:e.child;for(;i;){let s=await Pr(i,t,n);if(s)return s;i=n?null:i.sibling;}return null})();if(o===true)return e;let r=n?e.return:e.child;for(;r;){let i=Lr(r,t,n);if(i)return i;r=n?null:r.sibling;}return null}var Lr=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let o=n?e.return:e.child;for(;o;){let r=Lr(o,t,n);if(r)return r;o=n?null:o.sibling;}return null},Pr=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let o=n?e.return:e.child;for(;o;){let r=await Pr(o,t,n);if(r)return r;o=n?null:o.sibling;}return null};var Dr=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Dr(t.type||t.render):null},Pn=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let o=Dr(t);return o&&(o.displayName||o.name)||null};var ln=()=>!!ut()._instrumentationIsActive||xo()||Ln();var $r=e=>{let t=ut();for(let n of t.renderers.values())try{let o=n.findFiberByHostInstance?.(e);if(o)return o}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null};var pd=Object.create,pa=Object.defineProperty,md=Object.getOwnPropertyDescriptor,gd=Object.getOwnPropertyNames,hd=Object.getPrototypeOf,bd=Object.prototype.hasOwnProperty,yd=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),wd=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=gd(t),i=0,s=r.length,a;i<s;i++)a=r[i],!bd.call(e,a)&&a!==n&&pa(e,a,{get:(c=>t[c]).bind(null,a),enumerable:!(o=md(t,a))||o.enumerable});return e},Ed=(e,t,n)=>(n=e==null?{}:pd(hd(e)),wd(pa(n,"default",{value:e,enumerable:true}),e)),sa=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Sd=["rsc://","file:///","webpack://","webpack-internal://","node:","turbopack://","metro://","/app-pages-browser/"],aa="about://React/",xd=["<anonymous>","eval",""],vd=/\.(jsx|tsx|ts|js)$/,_d=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,Cd=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,ma="(at Server)",Td=/(^|@)\S+:\d+/,ga=/^\s*at .*(\S+:\d+|\(native\))/m,Ad=/^(eval@)?(\[native code\])?$/;var ha=(e,t)=>{{let n=e.split(`
13
- `),o=[];for(let r of n)if(/^\s*at\s+/.test(r)){let i=la(r,void 0)[0];i&&o.push(i);}else if(/^\s*in\s+/.test(r)){let i=r.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");o.push({functionName:i,source:r});}else if(r.match(Td)){let i=ca(r,void 0)[0];i&&o.push(i);}return Ur(o,t)}},ba=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,o=t.exec(n);return [o[1],o[2]||void 0,o[3]||void 0]},Ur=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e;var la=(e,t)=>Ur(e.split(`
14
- `).filter(o=>!!o.match(ga)),t).map(o=>{let r=o;r.includes("(eval ")&&(r=r.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=r.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;let a=ba(s?s[1]:i),c=s&&i||void 0,l=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {functionName:c,fileName:l,lineNumber:a[1]?+a[1]:void 0,columnNumber:a[2]?+a[2]:void 0,source:r}});var ca=(e,t)=>Ur(e.split(`
15
- `).filter(o=>!o.match(Ad)),t).map(o=>{let r=o;if(r.includes(" > eval")&&(r=r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!r.includes("@")&&!r.includes(":"))return {functionName:r};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=r.match(i),a=s&&s[1]?s[1]:void 0,c=ba(r.replace(i,""));return {functionName:a,fileName:c[0],lineNumber:c[1]?+c[1]:void 0,columnNumber:c[2]?+c[2]:void 0,source:r}}});var Id=yd((e,t)=>{(function(n,o){typeof e=="object"&&t!==void 0?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.sourcemapCodec={}));})(void 0,function(n){let o=44,r=59,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(64),a=new Uint8Array(128);for(let _=0;_<i.length;_++){let w=i.charCodeAt(_);s[_]=w,a[w]=_;}function c(_,w){let m=0,S=0,I=0;do{let U=_.next();I=a[U],m|=(I&31)<<S,S+=5;}while(I&32);let F=m&1;return m>>>=1,F&&(m=-2147483648|-m),w+m}function l(_,w,m){let S=w-m;S=S<0?-S<<1|1:S<<1;do{let I=S&31;S>>>=5,S>0&&(I|=32),_.write(s[I]);}while(S>0);return w}function f(_,w){return _.pos>=w?false:_.peek()!==o}let d=1024*16,p=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(_){return Buffer.from(_.buffer,_.byteOffset,_.byteLength).toString()}}:{decode(_){let w="";for(let m=0;m<_.length;m++)w+=String.fromCharCode(_[m]);return w}};class h{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(d);}write(w){let{buffer:m}=this;m[this.pos++]=w,this.pos===d&&(this.out+=p.decode(m),this.pos=0);}flush(){let{buffer:w,out:m,pos:S}=this;return S>0?m+p.decode(w.subarray(0,S)):m}}class g{constructor(w){this.pos=0,this.buffer=w;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(w){let{buffer:m,pos:S}=this,I=m.indexOf(w,S);return I===-1?m.length:I}}let E=[];function T(_){let{length:w}=_,m=new g(_),S=[],I=[],F=0;for(;m.pos<w;m.pos++){F=c(m,F);let U=c(m,0);if(!f(m,w)){let Z=I.pop();Z[2]=F,Z[3]=U;continue}let C=c(m,0),y=c(m,0),N=y&1,L=N?[F,U,0,0,C,c(m,0)]:[F,U,0,0,C],D=E;if(f(m,w)){D=[];do{let Z=c(m,0);D.push(Z);}while(f(m,w))}L.vars=D,S.push(L),I.push(L);}return S}function M(_){let w=new h;for(let m=0;m<_.length;)m=A(_,m,w,[0]);return w.flush()}function A(_,w,m,S){let I=_[w],{0:F,1:U,2:C,3:y,4:N,vars:L}=I;w>0&&m.write(o),S[0]=l(m,F,S[0]),l(m,U,0),l(m,N,0);let D=I.length===6?1:0;l(m,D,0),I.length===6&&l(m,I[5],0);for(let Z of L)l(m,Z,0);for(w++;w<_.length;){let Z=_[w],{0:z,1:K}=Z;if(z>C||z===C&&K>=y)break;w=A(_,w,m,S);}return m.write(o),S[0]=l(m,C,S[0]),l(m,y,0),w}function v(_){let{length:w}=_,m=new g(_),S=[],I=[],F=0,U=0,C=0,y=0,N=0,L=0,D=0,Z=0;do{let z=m.indexOf(";"),K=0;for(;m.pos<z;m.pos++){if(K=c(m,K),!f(m,z)){let ne=I.pop();ne[2]=F,ne[3]=K;continue}let ue=c(m,0),k=ue&1,G=ue&2,X=ue&4,W=null,me=E,ae;if(k){let ne=c(m,U);C=c(m,U===ne?C:0),U=ne,ae=[F,K,0,0,ne,C];}else ae=[F,K,0,0];if(ae.isScope=!!X,G){let ne=y,be=N;y=c(m,y);let Ie=ne===y;N=c(m,Ie?N:0),L=c(m,Ie&&be===N?L:0),W=[y,N,L];}if(ae.callsite=W,f(m,z)){me=[];do{D=F,Z=K;let ne=c(m,0),be;if(ne<-1){be=[[c(m,0)]];for(let Ie=-1;Ie>ne;Ie--){let je=D;D=c(m,D),Z=c(m,D===je?Z:0);let We=c(m,0);be.push([We,D,Z]);}}else be=[[ne]];me.push(be);}while(f(m,z))}ae.bindings=me,S.push(ae),I.push(ae);}F++,m.pos=z+1;}while(m.pos<w);return S}function J(_){if(_.length===0)return "";let w=new h;for(let m=0;m<_.length;)m=te(_,m,w,[0,0,0,0,0,0,0]);return w.flush()}function te(_,w,m,S){let I=_[w],{0:F,1:U,2:C,3:y,isScope:N,callsite:L,bindings:D}=I;S[0]<F?(se(m,S[0],F),S[0]=F,S[1]=0):w>0&&m.write(o),S[1]=l(m,I[1],S[1]);let Z=(I.length===6?1:0)|(L?2:0)|(N?4:0);if(l(m,Z,0),I.length===6){let{4:z,5:K}=I;z!==S[2]&&(S[3]=0),S[2]=l(m,z,S[2]),S[3]=l(m,K,S[3]);}if(L){let{0:z,1:K,2:ue}=I.callsite;z===S[4]?K!==S[5]&&(S[6]=0):(S[5]=0,S[6]=0),S[4]=l(m,z,S[4]),S[5]=l(m,K,S[5]),S[6]=l(m,ue,S[6]);}if(D)for(let z of D){z.length>1&&l(m,-z.length,0);let K=z[0][0];l(m,K,0);let ue=F,k=U;for(let G=1;G<z.length;G++){let X=z[G];ue=l(m,X[1],ue),k=l(m,X[2],k),l(m,X[0],0);}}for(w++;w<_.length;){let z=_[w],{0:K,1:ue}=z;if(K>C||K===C&&ue>=y)break;w=te(_,w,m,S);}return S[0]<C?(se(m,S[0],C),S[0]=C,S[1]=0):m.write(o),S[1]=l(m,y,S[1]),w}function se(_,w,m){do _.write(r);while(++w<m)}function pe(_){let{length:w}=_,m=new g(_),S=[],I=0,F=0,U=0,C=0,y=0;do{let N=m.indexOf(";"),L=[],D=true,Z=0;for(I=0;m.pos<N;){let z;I=c(m,I),I<Z&&(D=false),Z=I,f(m,N)?(F=c(m,F),U=c(m,U),C=c(m,C),f(m,N)?(y=c(m,y),z=[I,F,U,C,y]):z=[I,F,U,C]):z=[I],L.push(z),m.pos++;}D||ve(L),S.push(L),m.pos=N+1;}while(m.pos<=w);return S}function ve(_){_.sort(_e);}function _e(_,w){return _[0]-w[0]}function Ce(_){let w=new h,m=0,S=0,I=0,F=0;for(let U=0;U<_.length;U++){let C=_[U];if(U>0&&w.write(r),C.length===0)continue;let y=0;for(let N=0;N<C.length;N++){let L=C[N];N>0&&w.write(o),y=l(w,L[0],y),L.length!==1&&(m=l(w,L[1],m),S=l(w,L[2],S),I=l(w,L[3],I),L.length!==4&&(F=l(w,L[4],F)));}}return w.flush()}n.decode=pe,n.decodeGeneratedRanges=v,n.decodeOriginalScopes=T,n.encode=Ce,n.encodeGeneratedRanges=J,n.encodeOriginalScopes=M,Object.defineProperty(n,"__esModule",{value:true});});}),ya=Ed(Id()),wa=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,kd=/^data:application\/json[^,]+base64,/,Od=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Ea=typeof WeakRef<"u",Dn=new Map,vo=new Map,Rd=e=>Ea&&e instanceof WeakRef,ua=(e,t,n,o)=>{if(n<0||n>=e.length)return null;let r=e[n];if(!r||r.length===0)return null;let i=null;for(let f of r)if(f[0]<=o)i=f;else break;if(!i||i.length<4)return null;let[,s,a,c]=i;if(s===void 0||a===void 0||c===void 0)return null;let l=t[s];return l?{columnNumber:c,fileName:l,lineNumber:a+1}:null},Nd=(e,t,n)=>{if(e.sections){let o=null;for(let s of e.sections)if(t>s.offset.line||t===s.offset.line&&n>=s.offset.column)o=s;else break;if(!o)return null;let r=t-o.offset.line,i=t===o.offset.line?n-o.offset.column:n;return ua(o.map.mappings,o.map.sources,r,i)}return ua(e.mappings,e.sources,t-1,n)},Md=(e,t)=>{let n=t.split(`
16
- `),o;for(let i=n.length-1;i>=0&&!o;i--){let s=n[i].match(Od);s&&(o=s[1]||s[2]);}if(!o)return null;let r=wa.test(o);if(!(kd.test(o)||r||o.startsWith("/"))){let i=e.split("/");i[i.length-1]=o,o=i.join("/");}return o},Ld=e=>({file:e.file,mappings:(0, ya.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Pd=e=>{let t=e.sections.map(({map:o,offset:r})=>({map:{...o,mappings:(0, ya.decode)(o.mappings)},offset:r})),n=new Set;for(let o of t)for(let r of o.map.sources)n.add(r);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},da=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(wa);if(!n)return true;let o=n[0].toLowerCase();return o==="http:"||o==="https:"},Dd=async(e,t=fetch)=>{if(!da(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let o=Md(e,n);if(!o||!da(o))return null;try{let r=await t(o),i=await r.json();return "sections"in i?Pd(i):Ld(i)}catch{return null}},$d=async(e,t=true,n)=>{if(t&&Dn.has(e)){let i=Dn.get(e);if(i==null)return null;if(Rd(i)){let s=i.deref();if(s)return s;Dn.delete(e);}else return i}if(t&&vo.has(e))return vo.get(e);let o=Dd(e,n);t&&vo.set(e,o);let r=await o;return t&&vo.delete(e),t&&(r===null?Dn.set(e,null):Dn.set(e,Ea?new WeakRef(r):r)),r},Bd=async(e,t=true,n)=>await Promise.all(e.map(async o=>{if(!o.fileName)return o;let r=await $d(o.fileName,t,n);if(!r||typeof o.lineNumber!="number"||typeof o.columnNumber!="number")return o;let i=Nd(r,o.lineNumber,o.columnNumber);return i?{...o,source:i.fileName&&o.source?o.source.replace(o.fileName,i.fileName):o.source,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,isSymbolicated:true}:o})),Fd=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",Ud=()=>{let e=ut();for(let t of [...Array.from($t),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},fa=e=>{for(let t of $t){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},dt=e=>`
17
- in ${e}`,Hd=(e,t)=>{let n=dt(e);return t&&(n+=` (at ${t})`),n},Br=false,Fr=(e,t)=>{if(!e||Br)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Br=true;let o=Ud();fa(null);let r=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let c={DetermineComponentFrameRoot(){let p;try{if(t){let h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[]);}catch(g){p=g;}Reflect.construct(e,[],h);}else {try{h.call();}catch(g){p=g;}e.call(h.prototype);}}else {try{throw Error()}catch(g){p=g;}let h=e();h&&typeof h.catch=="function"&&h.catch(()=>{});}}catch(h){if(h instanceof Error&&p instanceof Error&&typeof h.stack=="string")return [h.stack,p.stack]}return [null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[f,d]=c.DetermineComponentFrameRoot();if(f&&d){let p=f.split(`
18
- `),h=d.split(`
19
- `),g=0,E=0;for(;g<p.length&&!p[g].includes("DetermineComponentFrameRoot");)g++;for(;E<h.length&&!h[E].includes("DetermineComponentFrameRoot");)E++;if(g===p.length||E===h.length)for(g=p.length-1,E=h.length-1;g>=1&&E>=0&&p[g]!==h[E];)E--;for(;g>=1&&E>=0;g--,E--)if(p[g]!==h[E]){if(g!==1||E!==1)do if(g--,E--,E<0||p[g]!==h[E]){let T=`
20
- ${p[g].replace(" at new "," at ")}`,M=Pn(e);return M&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",M)),T}while(g>=1&&E>=0);break}}}finally{Br=false,Error.prepareStackTrace=n,fa(o),console.error=r,console.warn=i;}let s=e?Pn(e):"";return s?dt(s):""},Gd=(e,t)=>{let n=e.tag,o="";switch(n){case Rr:o=dt("Activity");break;case xr:o=Fr(e.type,true);break;case _r:o=Fr(e.type.render,false);break;case Sr:case Tr:o=Fr(e.type,false);break;case vr:case kr:case Or:o=dt(e.type);break;case Ar:o=dt("Lazy");break;case Cr:o=e.child!==t&&t!==null?dt("Suspense Fallback"):dt("Suspense");break;case Ir:o=dt("SuspenseList");break;case Nr:o=dt("ViewTransition");break;default:return ""}return o},jd=e=>{try{let t="",n=e,o=null;do{t+=Gd(n,o);let r=n._debugInfo;if(r&&Array.isArray(r))for(let i=r.length-1;i>=0;i--){let s=r[i];typeof s.name=="string"&&(t+=Hd(s.name,s.env));}o=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
9
+ var gl=(e,t)=>e===t,at=Symbol("solid-proxy");var dn=Symbol("solid-track"),Bn={equals:gl},pi=wi,He=1,ln=2,mi={owned:null,cleanups:null,context:null,owner:null},$r={},ie=null,R=null,Nt=null,de=null,Ae=null,Ne=null,Hn=0;function et(e,t){let n=de,r=ie,o=e.length===0,i=t===void 0?r:t,s=o?mi:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>Le(()=>st(s)));ie=s,de=null;try{return Ue(a,!0)}finally{de=n,ie=r;}}function z(e,t){t=t?Object.assign({},Bn,t):Bn;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),yi(n,o));return [bi.bind(n),r]}function ci(e,t,n){let r=zn(e,t,true,He);Pt(r);}function oe(e,t,n){let r=zn(e,t,false,He);Pt(r);}function te(e,t,n){pi=El;let r=zn(e,t,false,He);(r.user=true),Ne?Ne.push(r):Pt(r);}function J(e,t,n){n=n?Object.assign({},Bn,n):Bn;let r=zn(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,Pt(r),bi.bind(r)}function hl(e){return e&&typeof e=="object"&&"then"in e}function Ur(e,t,n){let r,o,i;typeof t=="function"?(r=e,o=t,i={}):(r=true,o=e,i=t||{});let s=null,a=$r,d=false,u="initialValue"in i,p=typeof r=="function"&&J(r),m=new Set,[g,y]=(i.storage||z)(i.initialValue),[_,I]=z(void 0),[T,v]=z(void 0,{equals:false}),[Z,Q]=z(u?"ready":"unresolved");function Y(C,S,h,w){return s===C&&(s=null,w!==void 0&&(u=true),(C===a||S===a)&&i.onHydrated&&queueMicrotask(()=>i.onHydrated(w,{value:S})),a=$r,we(S,h)),S}function we(C,S){Ue(()=>{S===void 0&&y(()=>C),Q(S!==void 0?"errored":u?"ready":"unresolved"),I(S);for(let h of m.keys())h.decrement();m.clear();},false);}function Ee(){let C=cn,S=g(),h=_();if(h!==void 0&&!s)throw h;return de&&!de.user&&C,S}function ve(C=true){if(C!==false&&d)return;d=false;let S=p?p():r;if(S==null||S===false){Y(s,Le(g));return}let h,w=a!==$r?a:Le(()=>{try{return o(S,{value:g(),refetching:C})}catch(A){h=A;}});if(h!==void 0){Y(s,void 0,$n(h),S);return}else if(!hl(w))return Y(s,w,void 0,S),w;return s=w,"v"in w?(w.s===1?Y(s,w.v,void 0,S):Y(s,void 0,$n(w.v),S),w):(d=true,queueMicrotask(()=>d=false),Ue(()=>{Q(u?"refreshing":"pending"),v();},false),w.then(A=>Y(w,A,void 0,S),A=>Y(w,void 0,$n(A),S)))}Object.defineProperties(Ee,{state:{get:()=>Z()},error:{get:()=>_()},loading:{get(){let C=Z();return C==="pending"||C==="refreshing"}},latest:{get(){if(!u)return Ee();let C=_();if(C&&!s)throw C;return g()}}});let me=ie;return p?ci(()=>(me=ie,ve(false))):ve(false),[Ee,{refetch:C=>gi(me,()=>ve(C)),mutate:y}]}function Gn(e){return Ue(e,false)}function Le(e){if(de===null)return e();let t=de;de=null;try{return Nt?Nt.untrack(e):e()}finally{de=t;}}function $e(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let f=0;f<e.length;f++)a[f]=e[f]();}else a=e();let l=Le(()=>t(a,o,s));return o=a,l}}function Ve(e){te(()=>Le(e));}function le(e){return ie===null||(ie.cleanups===null?ie.cleanups=[e]:ie.cleanups.push(e)),e}function jn(){return de}function gi(e,t){let n=ie,r=de;ie=e,de=null;try{return Ue(t,!0)}catch(o){Vn(o);}finally{ie=n,de=r;}}var[$f,ui]=z(false);var cn;function bi(){let e=R;if(this.sources&&(this.state))if((this.state)===He)Pt(this);else {let t=Ae;Ae=null,Ue(()=>Fn(this),false),Ae=t;}if(de){let t=this.observers?this.observers.length:0;de.sources?(de.sources.push(this),de.sourceSlots.push(t)):(de.sources=[this],de.sourceSlots=[t]),this.observers?(this.observers.push(de),this.observerSlots.push(de.sources.length-1)):(this.observers=[de],this.observerSlots=[de.sources.length-1]);}return e&&R.sources.has(this)?this.tValue:this.value}function yi(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&Ue(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=R&&R.running;s&&R.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?Ae.push(i):Ne.push(i),i.observers&&Ei(i)),s?i.tState=He:i.state=He);}if(Ae.length>1e6)throw Ae=[],new Error},false);}return t}function Pt(e){if(!e.fn)return;st(e);let t=Hn;di(e,e.value,t);}function di(e,t,n){let r,o=ie,i=de;de=ie=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=He,e.owned&&e.owned.forEach(st),e.owned=null)),e.updatedAt=n+1,Vn(s)}finally{de=i,ie=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?yi(e,r):e.value=r,e.updatedAt=n);}function zn(e,t,n,r=He,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ie,context:ie?ie.context:null,pure:n};if(ie===null||ie!==mi&&(ie.owned?ie.owned.push(i):ie.owned=[i]),Nt);return i}function un(e){let t=R;if((e.state)===0)return;if((e.state)===ln)return Fn(e);if(e.suspense&&Le(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Hn);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===He)Pt(e);else if((e.state)===ln){let o=Ae;Ae=null,Ue(()=>Fn(e,n[0]),false),Ae=o;}}}function Ue(e,t){if(Ae)return e();let n=false;t||(Ae=[]),Ne?n=true:Ne=[],Hn++;try{let r=e();return yl(n),r}catch(r){n||(Ne=null),Ae=null,Vn(r);}}function yl(e){if(Ae&&(wi(Ae),Ae=null),e)return;let n=Ne;Ne=null,n.length&&Ue(()=>pi(n),false);}function wi(e){for(let t=0;t<e.length;t++)un(e[t]);}function El(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:un(r);}for(t=0;t<n;t++)un(e[t]);}function Fn(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=o.state;i===He?o!==t&&(!o.updatedAt||o.updatedAt<Hn)&&un(o):i===ln&&Fn(o,t);}}}function Ei(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=ln,r.pure?Ae.push(r):Ne.push(r),r.observers&&Ei(r));}}function st(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)st(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)st(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function $n(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Vn(e,t=ie){let r=$n(e);throw r;}var Fr=Symbol("fallback");function Un(e){for(let t=0;t<e.length;t++)e[t]();}function Sl(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return le(()=>Un(i)),()=>{let l=e()||[],f=l.length,d,u;return l[dn],Le(()=>{let m,g,y,_,I,T,v,Z,Q;if(f===0)s!==0&&(Un(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Fr],o[0]=et(Y=>(i[0]=Y,n.fallback())),s=1);else if(s===0){for(o=new Array(f),u=0;u<f;u++)r[u]=l[u],o[u]=et(p);s=f;}else {for(y=new Array(f),_=new Array(f),a&&(I=new Array(f)),T=0,v=Math.min(s,f);T<v&&r[T]===l[T];T++);for(v=s-1,Z=f-1;v>=T&&Z>=T&&r[v]===l[Z];v--,Z--)y[Z]=o[v],_[Z]=i[v],a&&(I[Z]=a[v]);for(m=new Map,g=new Array(Z+1),u=Z;u>=T;u--)Q=l[u],d=m.get(Q),g[u]=d===void 0?-1:d,m.set(Q,u);for(d=T;d<=v;d++)Q=r[d],u=m.get(Q),u!==void 0&&u!==-1?(y[u]=o[d],_[u]=i[d],a&&(I[u]=a[d]),u=g[u],m.set(Q,u)):i[d]();for(u=T;u<f;u++)u in y?(o[u]=y[u],i[u]=_[u],a&&(a[u]=I[u],a[u](u))):o[u]=et(p);o=o.slice(0,s=f),r=l.slice(0);}return o});function p(m){if(i[u]=m,a){let[g,y]=z(u);return a[u]=y,t(l[u],g)}return t(l[u])}}}function xl(e,t,n={}){let r=[],o=[],i=[],s=[],a=0,l;return le(()=>Un(i)),()=>{let f=e()||[],d=f.length;return f[dn],Le(()=>{if(d===0)return a!==0&&(Un(i),i=[],r=[],o=[],a=0,s=[]),n.fallback&&(r=[Fr],o[0]=et(p=>(i[0]=p,n.fallback())),a=1),o;for(r[0]===Fr&&(i[0](),i=[],r=[],o=[],a=0),l=0;l<d;l++)l<r.length&&r[l]!==f[l]?s[l](()=>f[l]):l>=r.length&&(o[l]=et(u));for(;l<r.length;l++)i[l]();return a=s.length=i.length=d,r=f.slice(0),o=o.slice(0,a)});function u(p){i[l]=p;let[m,g]=z(f[l]);return s[l]=g,t(m,l)}}}function N(e,t){return Le(()=>e(t||{}))}var _l=e=>`Stale read from <${e}>.`;function Dt(e){let t="fallback"in e&&{fallback:()=>e.fallback};return J(Sl(()=>e.each,e.children,t||void 0))}function Hr(e){let t="fallback"in e&&{fallback:()=>e.fallback};return J(xl(()=>e.each,e.children,t||void 0))}function re(e){let t=e.keyed,n=J(()=>e.when,void 0,void 0),r=t?n:J(n,void 0,{equals:(o,i)=>!o==!i});return J(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?Le(()=>i(t?o:()=>{if(!Le(r))throw _l("Show");return n()})):i}return e.fallback},void 0,void 0)}var xe=e=>J(()=>e());function Al(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,f=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){let d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i];}else {if(!f){f=new Map;let u=a;for(;u<i;)f.set(n[u],u++);}let d=f.get(t[s]);if(d!=null)if(a<d&&d<i){let u=s,p=1,m;for(;++u<o&&u<i&&!((m=f.get(t[u]))==null||m!==d+p);)p++;if(p>d-a){let g=t[s];for(;a<d;)e.insertBefore(n[a++],g);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}var xi="_$DX_DELEGATE";function _i(e,t,n,r={}){let o;return et(i=>{o=i,t===document?e():V(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function X(e,t,n,r){let o,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(true);return s.cloneNode=s,s}function Pe(e,t=window.document){let n=t[xi]||(t[xi]=new Set);for(let r=0,o=e.length;r<o;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,Il));}}function he(e,t,n){(n==null?e.removeAttribute(t):e.setAttribute(t,n));}function Ge(e,t){(t==null?e.removeAttribute("class"):e.className=t);}function Xe(e,t,n,r){Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;}function Ci(e,t,n){if(!t)return n?he(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function Ce(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function We(e,t,n){return Le(()=>e(t,n))}function V(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Kn(e,t,r,n);oe(o=>Kn(e,t(),o,n),r);}function Il(e){let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,i=l=>Object.defineProperty(e,"target",{configurable:true,value:l}),s=()=>{let l=t[n];if(l&&!t.disabled){let f=t[`${n}Data`];if(f!==void 0?l.call(t,f,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&i(t.host),true},a=()=>{for(;s()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let l=e.composedPath();i(l[0]);for(let f=0;f<l.length-2&&(t=l[f],!!s());f++){if(t._$host){t=t._$host,a();break}if(t.parentNode===o)break}}else a();i(r);}function Kn(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=$t(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||s==="boolean"){n=$t(e,n,r);}else {if(s==="function")return oe(()=>{let l=t();for(;typeof l=="function";)l=l();n=Kn(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(Gr(l,t,n,o))return oe(()=>n=Kn(e,l,n,r,true)),()=>n;if(l.length===0){if(n=$t(e,n,r),a)return n}else f?n.length===0?vi(e,l,r):Al(e,n,l):(n&&$t(e),vi(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=$t(e,n,r,t);$t(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function Gr(e,t,n,r){let o=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=Gr(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=Gr(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d));}}return o}function vi(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function $t(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=false;for(let s=t.length-1;s>=0;s--){let a=t[s];if(o!==a){let l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove();}else i=true;}}else e.insertBefore(o,n);return [o]}var Ti=`/*! tailwindcss v4.1.17 | MIT License | https://tailwindcss.com */
10
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--font-weight-medium:500;--radius-sm:.25rem;--ease-out:cubic-bezier(0,0,.2,1);--animate-pulse:pulse 2s cubic-bezier(.4,0,.6,1)infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-grab-pink:#b21c8e;--color-grab-purple:#d239c0}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.top-0{top:calc(var(--spacing)*0)}.left-0{left:calc(var(--spacing)*0)}.z-2147483645{z-index:2147483645}.z-2147483646{z-index:2147483646}.z-2147483647{z-index:2147483647}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:calc(var(--spacing)*0)}.-mt-px{margin-top:-1px}.mb-0\\.5{margin-bottom:calc(var(--spacing)*.5)}.-ml-\\[2px\\]{margin-left:-2px}.ml-1{margin-left:calc(var(--spacing)*1)}.box-border{box-sizing:border-box}.flex{display:flex}.hidden{display:none}.size-fit{width:fit-content;height:fit-content}.h-0{height:calc(var(--spacing)*0)}.h-4{height:calc(var(--spacing)*4)}.h-5{height:calc(var(--spacing)*5)}.h-5\\.5{height:calc(var(--spacing)*5.5)}.h-\\[7px\\]{height:7px}.h-\\[17px\\]{height:17px}.h-\\[18px\\]{height:18px}.h-fit{height:fit-content}.min-h-4{min-height:calc(var(--spacing)*4)}.w-0{width:calc(var(--spacing)*0)}.w-0\\.5{width:calc(var(--spacing)*.5)}.w-1{width:calc(var(--spacing)*1)}.w-\\[7px\\]{width:7px}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.max-w-0{max-width:calc(var(--spacing)*0)}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[280px\\]{max-width:280px}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.-translate-x-1\\/2{--tw-translate-x:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y:calc(calc(1/2*100%)*-1);translate:var(--tw-translate-x)var(--tw-translate-y)}.scale-75{--tw-scale-x:75%;--tw-scale-y:75%;--tw-scale-z:75%;scale:var(--tw-scale-x)var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x)var(--tw-scale-y)}.-rotate-90{rotate:-90deg}.rotate-0{rotate:none}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.animate-pulse{animation:var(--animate-pulse)}.cursor-crosshair{cursor:crosshair}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.flex-col{flex-direction:column}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\\.5{gap:calc(var(--spacing)*.5)}.gap-1{gap:calc(var(--spacing)*1)}.gap-1\\.5{gap:calc(var(--spacing)*1.5)}.gap-2{gap:calc(var(--spacing)*2)}.gap-\\[3px\\]{gap:3px}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded-\\[1px\\]{border-radius:1px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-b-sm{border-bottom-right-radius:var(--radius-sm);border-bottom-left-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[\\#7e0002\\]{border-color:#7e0002}.border-\\[\\#B3B3B3\\]{border-color:#b3b3b3}.border-black{border-color:var(--color-black)}.border-grab-purple\\/40{border-color:#d239c066}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/40{border-color:color-mix(in oklab,var(--color-grab-purple)40%,transparent)}}.border-grab-purple\\/50{border-color:#d239c080}@supports (color:color-mix(in lab, red, red)){.border-grab-purple\\/50{border-color:color-mix(in oklab,var(--color-grab-purple)50%,transparent)}}.border-t-\\[\\#D9D9D9\\]{border-top-color:#d9d9d9}.bg-black{background-color:var(--color-black)}.bg-grab-pink{background-color:var(--color-grab-pink)}.bg-grab-purple\\/5{background-color:#d239c00d}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/5{background-color:color-mix(in oklab,var(--color-grab-purple)5%,transparent)}}.bg-grab-purple\\/8{background-color:#d239c014}@supports (color:color-mix(in lab, red, red)){.bg-grab-purple\\/8{background-color:color-mix(in oklab,var(--color-grab-purple)8%,transparent)}}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.p-0{padding:calc(var(--spacing)*0)}.p-1{padding:calc(var(--spacing)*1)}.px-0{padding-inline:calc(var(--spacing)*0)}.px-0\\.25{padding-inline:calc(var(--spacing)*.25)}.px-1\\.5{padding-inline:calc(var(--spacing)*1.5)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing)*0)}.py-0\\.25{padding-block:calc(var(--spacing)*.25)}.py-1\\.5{padding-block:calc(var(--spacing)*1.5)}.py-2{padding-block:calc(var(--spacing)*2)}.py-\\[3px\\]{padding-block:3px}.py-\\[5px\\]{padding-block:5px}.py-px{padding-block:1px}.pt-1{padding-top:calc(var(--spacing)*1)}.pt-1\\.5{padding-top:calc(var(--spacing)*1.5)}.pr-1{padding-right:calc(var(--spacing)*1)}.pb-1{padding-bottom:calc(var(--spacing)*1)}.pl-1\\.5{padding-left:calc(var(--spacing)*1.5)}.font-sans{font-family:var(--font-sans)}.text-\\[10px\\]{font-size:10px}.text-\\[13px\\]{font-size:13px}.leading-3{--tw-leading:calc(var(--spacing)*3);line-height:calc(var(--spacing)*3)}.leading-3\\.5{--tw-leading:calc(var(--spacing)*3.5);line-height:calc(var(--spacing)*3.5)}.leading-4{--tw-leading:calc(var(--spacing)*4);line-height:calc(var(--spacing)*4)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.wrap-break-word{overflow-wrap:break-word}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.text-\\[\\#71717a\\]{color:#71717a}.text-\\[\\#B3B3B3\\]{color:#b3b3b3}.text-\\[\\#B91C1C\\]{color:#b91c1c}.text-\\[\\#a1a1aa\\]{color:#a1a1aa}.text-\\[\\#c00002\\]{color:#c00002}.text-black{color:var(--color-black)}.text-black\\/50{color:#00000080}@supports (color:color-mix(in lab, red, red)){.text-black\\/50{color:color-mix(in oklab,var(--color-black)50%,transparent)}}.text-black\\/70{color:#000000b3}@supports (color:color-mix(in lab, red, red)){.text-black\\/70{color:color-mix(in oklab,var(--color-black)70%,transparent)}}.text-white{color:var(--color-white)}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,)var(--tw-slashed-zero,)var(--tw-numeric-figure,)var(--tw-numeric-spacing,)var(--tw-numeric-fraction,)}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-100{opacity:1}.opacity-\\[0\\.99\\]{opacity:.99}.brightness-125{--tw-brightness:brightness(125%);filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.filter-\\[drop-shadow\\(0px_0px_4px_\\#51515180\\)\\]{filter:drop-shadow(0 0 4px #51515180)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[width\\,height\\]{transition-property:width,height;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-none{transition-property:none}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.will-change-\\[transform\\,width\\,height\\]{will-change:transform,width,height}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,)var(--tw-contain-layout,)var(--tw-contain-paint,)var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.hover\\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x)var(--tw-scale-y)}.hover\\:bg-\\[\\#F5F5F5\\]:hover{background-color:#f5f5f5}.hover\\:bg-\\[\\#FEF2F2\\]:hover{background-color:#fef2f2}.hover\\:opacity-100:hover{opacity:1}}}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}@keyframes pulse{50%{opacity:.5}}`;var zr=Symbol("store-raw"),Bt=Symbol("store-node"),tt=Symbol("store-has"),Ai=Symbol("store-self");function Ii(e){let t=e[at];if(!t&&(Object.defineProperty(e,at,{value:t=new Proxy(e,Ml)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let o=0,i=n.length;o<i;o++){let s=n[o];r[s].get&&Object.defineProperty(e,s,{enumerable:r[s].enumerable,get:r[s].get.bind(t)});}}return t}function Xn(e){let t;return e!=null&&typeof e=="object"&&(e[at]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function pn(e,t=new Set){let n,r,o,i;if(n=e!=null&&e[zr])return n;if(!Xn(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let s=0,a=e.length;s<a;s++)o=e[s],(r=pn(o,t))!==o&&(e[s]=r);}else {Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let s=Object.keys(e),a=Object.getOwnPropertyDescriptors(e);for(let l=0,f=s.length;l<f;l++)i=s[l],!a[i].get&&(o=e[i],(r=pn(o,t))!==o&&(e[i]=r));}return e}function Wn(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function mn(e,t,n){if(e[t])return e[t];let[r,o]=z(n,{equals:false,internal:true});return r.$=o,e[t]=r}function Ol(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return !n||n.get||!n.configurable||t===at||t===Bt||(delete n.value,delete n.writable,n.get=()=>e[at][t]),n}function ki(e){jn()&&mn(Wn(e,Bt),Ai)();}function Rl(e){return ki(e),Reflect.ownKeys(e)}var Ml={get(e,t,n){if(t===zr)return e;if(t===at)return n;if(t===dn)return ki(e),n;let r=Wn(e,Bt),o=r[t],i=o?o():e[t];if(t===Bt||t===tt||t==="__proto__")return i;if(!o){let s=Object.getOwnPropertyDescriptor(e,t);jn()&&(typeof i!="function"||e.hasOwnProperty(t))&&!(s&&s.get)&&(i=mn(r,t,i)());}return Xn(i)?Ii(i):i},has(e,t){return t===zr||t===at||t===dn||t===Bt||t===tt||t==="__proto__"?true:(jn()&&mn(Wn(e,tt),t)(),t in e)},set(){return true},deleteProperty(){return true},ownKeys:Rl,getOwnPropertyDescriptor:Ol};function Yn(e,t,n,r=false){if(!r&&e[t]===n)return;let o=e[t],i=e.length;n===void 0?(delete e[t],e[tt]&&e[tt][t]&&o!==void 0&&e[tt][t].$()):(e[t]=n,e[tt]&&e[tt][t]&&o===void 0&&e[tt][t].$());let s=Wn(e,Bt),a;if((a=mn(s,t,o))&&a.$(()=>n),Array.isArray(e)&&e.length!==i){for(let l=e.length;l<i;l++)(a=s[l])&&a.$();(a=mn(s,"length",i))&&a.$(e.length);}(a=s[Ai])&&a.$();}function Oi(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let o=n[r];Yn(e,o,t[o]);}}function Nl(e,t){if(typeof t=="function"&&(t=t(e)),t=pn(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let o=t[n];e[n]!==o&&Yn(e,n,o);}Yn(e,"length",r);}else Oi(e,t);}function fn(e,t,n=[]){let r,o=e;if(t.length>1){r=t.shift();let s=typeof r,a=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)fn(e,[r[l]].concat(t),n);return}else if(a&&s==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&fn(e,[l].concat(t),n);return}else if(a&&s==="object"){let{from:l=0,to:f=e.length-1,by:d=1}=r;for(let u=l;u<=f;u+=d)fn(e,[u].concat(t),n);return}else if(t.length>1){fn(e[r],t,[r].concat(n));return}o=e[r],n=[r].concat(n);}let i=t[0];typeof i=="function"&&(i=i(o,n),i===o)||r===void 0&&i==null||(i=pn(i),r===void 0||Xn(o)&&Xn(i)&&!Array.isArray(i)?Oi(o,i):Yn(e,r,i));}function Ri(...[e,t]){let n=pn(e||{}),r=Array.isArray(n),o=Ii(n);function i(...s){Gn(()=>{r&&s.length===1?Nl(n,s[0]):fn(n,s);});}return [o,i]}function Ll(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Pl(){let e=Ll();if(e.__xstate__)return e.__xstate__}var Mi=e=>{if(typeof window>"u")return;let t=Pl();t&&t.register(e);};var qn=class{constructor(t){this._process=t,this._active=false,this._current=null,this._last=null;}start(){this._active=true,this.flush();}clear(){this._current&&(this._current.next=null,this._last=this._current);}enqueue(t){let n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush();}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next;}this._last=null;}},Zr=".",Dl="",Jr="",$l="#",Bl="*",Bi="xstate.init",Fi="xstate.error",Xr="xstate.stop";function Fl(e,t){return {type:`xstate.after.${e}.${t}`}}function Wr(e,t){return {type:`xstate.done.state.${e}`,output:t}}function Ul(e,t){return {type:`xstate.done.actor.${e}`,output:t,actorId:e}}function Qr(e,t){return {type:`xstate.error.actor.${e}`,error:t,actorId:e}}function eo(e){return {type:Bi,input:e}}function Ye(e){setTimeout(()=>{throw e});}var Hl=typeof Symbol=="function"&&Symbol.observable||"@@observable";function to(e,t){let n=Ni(e),r=Ni(t);return typeof r=="string"?typeof n=="string"?r===n:false:typeof n=="string"?n in r:Object.keys(n).every(o=>o in r?to(n[o],r[o]):false)}function er(e){if(Gi(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r];}return t.push(n),t}function Ni(e){if(os(e))return e.value;if(typeof e!="string")return e;let t=er(e);return Ui(t)}function Ui(e){if(e.length===1)return e[0];let t={},n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else {let o=n;n={},o[e[r]]=n;}return t}function no(e,t){let n={},r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o];n[i]=t(e[i],i,e,o);}return n}function Hi(e){return Gi(e)?e:[e]}function qe(e){return e===void 0?[]:Hi(e)}function Yr(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function Gi(e){return Array.isArray(e)}function Gl(e){return e.type.startsWith("xstate.error.actor")}function bt(e){return Hi(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function ji(e){if(!(e===void 0||e===Dl))return qe(e)}function Zn(e,t,n){let r=typeof e=="object",o=r?e:void 0;return {next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}function ro(e,t){return `${t}.${e}`}function hn(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,r,o]=n,s=e.getStateNodeById(o).config.invoke;return (Array.isArray(s)?s[r]:s).src}function zi(e,t){if(t===e||t===Bl)return true;if(!t.endsWith(".*"))return false;let n=t.split("."),r=e.split(".");for(let o=0;o<n.length;o++){let i=n[o],s=r[o];if(i==="*")return o===n.length-1;if(i!==s)return false}return true}function Li(e,t){return `${e.sessionId}.${t}`}var jl=0;function zl(e,t){let n=new Map,r=new Map,o=new WeakMap,i=new Set,s={},{clock:a,logger:l}=t,f={schedule:(p,m,g,y,_=Math.random().toString(36).slice(2))=>{let I={source:p,target:m,event:g,delay:y,id:_,startedAt:Date.now()},T=Li(p,_);u._snapshot._scheduledEvents[T]=I;let v=a.setTimeout(()=>{delete s[T],delete u._snapshot._scheduledEvents[T],u._relay(p,m,g);},y);s[T]=v;},cancel:(p,m)=>{let g=Li(p,m),y=s[g];delete s[g],delete u._snapshot._scheduledEvents[g],y!==void 0&&a.clearTimeout(y);},cancelAll:p=>{for(let m in u._snapshot._scheduledEvents){let g=u._snapshot._scheduledEvents[m];g.source===p&&f.cancel(p,g.id);}}},d=p=>{if(!i.size)return;let m={...p,rootId:e.sessionId};i.forEach(g=>g.next?.(m));},u={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${jl++}`,_register:(p,m)=>(n.set(p,m),p),_unregister:p=>{n.delete(p.sessionId);let m=o.get(p);m!==void 0&&(r.delete(m),o.delete(p));},get:p=>r.get(p),getAll:()=>Object.fromEntries(r.entries()),_set:(p,m)=>{let g=r.get(p);if(g&&g!==m)throw new Error(`Actor with system ID '${p}' already exists.`);r.set(p,m),o.set(m,p);},inspect:p=>{let m=Zn(p);return i.add(m),{unsubscribe(){i.delete(m);}}},_sendInspectionEvent:d,_relay:(p,m,g)=>{u._sendInspectionEvent({type:"@xstate.event",sourceRef:p,actorRef:m,event:g}),m._send(g);},scheduler:f,getSnapshot:()=>({_scheduledEvents:{...u._snapshot._scheduledEvents}}),start:()=>{let p=u._snapshot._scheduledEvents;u._snapshot._scheduledEvents={};for(let m in p){let{source:g,target:y,event:_,delay:I,id:T}=p[m];f.schedule(g,y,_,I,T);}},_clock:a,_logger:l};return u}var Vr=false,tr=1,Be=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({}),Vl={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:false},Jn=class{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new qn(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=Be.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let r={...Vl,...n},{clock:o,logger:i,parent:s,syncSnapshot:a,id:l,systemId:f,inspect:d}=r;this.system=s?s.system:zl(this,{clock:o,logger:i}),d&&!s&&this.system.inspect(Zn(d)),this.sessionId=this.system._bookId(),this.id=l??this.sessionId,this.logger=n?.logger??this.system._logger,this.clock=n?.clock??this.system._clock,this._parent=s,this._syncSnapshot=a,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:u=>{this._deferred.push(u);},system:this.system,stopChild:u=>{if(u._parent!==this)throw new Error(`Cannot stop child actor ${u.id} of ${this.id} because it is not a child`);u._stop();},emit:u=>{let p=this.eventListeners.get(u.type),m=this.eventListeners.get("*");if(!p&&!m)return;let g=[...p?p.values():[],...m?m.values():[]];for(let y of g)try{y(u);}catch(_){Ye(_);}},actionExecutor:u=>{let p=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:u.type,params:u.params}}),!u.exec)return;let m=Vr;try{Vr=!0,u.exec(u.info,u.params);}finally{Vr=m;}};this._processingStatus===Be.Running?p():this._deferred.push(p);}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),f&&(this.systemId=f,this.system._set(f,this)),this._initState(n?.snapshot??n?.state),f&&this._snapshot.status!=="active"&&this.system._unregister(this);}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input);}catch(n){this._snapshot={status:"error",output:void 0,error:n};}}update(t,n){this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r();}catch(o){this._deferred.length=0,this._snapshot={...t,status:"error",error:o};}switch(this._snapshot.status){case "active":for(let o of this.observers)try{o.next?.(t);}catch(i){Ye(i);}break;case "done":for(let o of this.observers)try{o.next?.(t);}catch(i){Ye(i);}this._stopProcedure(),this._complete(),this._doneEvent=Ul(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case "error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t});}subscribe(t,n,r){let o=Zn(t,n,r);if(this._processingStatus!==Be.Stopped)this.observers.add(o);else switch(this._snapshot.status){case "done":try{o.complete?.();}catch(i){Ye(i);}break;case "error":{let i=this._snapshot.error;if(!o.error)Ye(i);else try{o.error(i);}catch(s){Ye(s);}break}}return {unsubscribe:()=>{this.observers.delete(o);}}}on(t,n){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));let o=n.bind(void 0);return r.add(o),{unsubscribe:()=>{r.delete(o);}}}start(){if(this._processingStatus===Be.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r});},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=Be.Running;let t=eo(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case "done":return this.update(this._snapshot,t),this;case "error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope);}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope);}catch(o){r={err:o};}if(r){let{err:o}=r;this._snapshot={...this._snapshot,status:"error",error:o},this._error(o);return}this.update(n,t),t.type===Xr&&(this._stopProcedure(),this._complete());}_stop(){return this._processingStatus===Be.Stopped?this:(this.mailbox.clear(),this._processingStatus===Be.NotStarted?(this._processingStatus=Be.Stopped,this):(this.mailbox.enqueue({type:Xr}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.();}catch(n){Ye(n);}this.observers.clear();}_reportError(t){if(!this.observers.size){this._parent||Ye(t);return}let n=false;for(let r of this.observers){let o=r.error;n||=!o;try{o?.(t);}catch(i){Ye(i);}}this.observers.clear(),n&&Ye(t);}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,Qr(this.id,t));}_stopProcedure(){return this._processingStatus!==Be.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new qn(this._process.bind(this)),this._processingStatus=Be.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==Be.Stopped&&this.mailbox.enqueue(t);}send(t){this.system._relay(void 0,this,t);}attachDevTools(){let{devTools:t}=this.options;t&&(typeof t=="function"?t:Mi)(this);}toJSON(){return {xstate$$type:tr,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[Hl](){return this}getSnapshot(){return this._snapshot}};function Ze(e,...[t]){return new Jn(e,t)}function Kl(e,t,n,r,{sendId:o}){let i=typeof o=="function"?o(n,r):o;return [t,{sendId:i},void 0]}function Xl(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId);});}function Gt(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Kl,t.execute=Xl,t}function Wl(e,t,n,r,{id:o,systemId:i,src:s,input:a,syncSnapshot:l}){let f=typeof s=="string"?hn(t.machine,s):s,d=typeof o=="function"?o(n):o,u,p;return f&&(p=typeof a=="function"?a({context:t.context,event:n.event,self:e.self}):a,u=Ze(f,{id:d,src:s,parent:e.self,syncSnapshot:l,systemId:i,input:p})),[ut(t,{children:{...t.children,[d]:u}}),{id:o,systemId:i,actorRef:u,src:s,input:p},void 0]}function Yl(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==Be.Stopped&&t.start();});}function jt(...[e,{id:t,systemId:n,input:r,syncSnapshot:o=false}={}]){function i(s,a){}return i.type="xstate.spawnChild",i.id=t,i.systemId=n,i.src=e,i.input=r,i.syncSnapshot=o,i.resolve=Wl,i.execute=Yl,i}function ql(e,t,n,r,{actorRef:o}){let i=typeof o=="function"?o(n,r):o,s=typeof i=="string"?t.children[i]:i,a=t.children;return s&&(a={...a},delete a[s.id]),[ut(t,{children:a}),s,void 0]}function Zl(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==Be.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t);});}}function Et(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=ql,t.execute=Zl,t}function zt(e,t,n,r){let{machine:o}=r,i=typeof e=="function",s=i?e:o.implementations.guards[typeof e=="string"?e:e.type];if(!i&&!s)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof s!="function")return zt(s,t,n,r);let a={context:t,event:n},l=i||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return "check"in s?s.check(r,a,s):s(a,l)}var oo=e=>e.type==="atomic"||e.type==="final";function Ut(e){return Object.values(e.states).filter(t=>t.type!=="history")}function bn(e,t){let n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function yn(e){let t=new Set(e),n=Ki(t);for(let r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))Pi(r).forEach(o=>t.add(o));else if(r.type==="parallel"){for(let o of Ut(r))if(o.type!=="history"&&!t.has(o)){let i=Pi(o);for(let s of i)t.add(s);}}for(let r of t){let o=r.parent;for(;o;)t.add(o),o=o.parent;}return t}function Vi(e,t){let n=t.get(e);if(!n)return {};if(e.type==="compound"){let o=n[0];if(o){if(oo(o))return o.key}else return {}}let r={};for(let o of n)r[o.key]=Vi(o,t);return r}function Ki(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function Xi(e,t){let n=yn(t);return Vi(e,Ki(n))}function nr(e,t){return t.type==="compound"?Ut(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?Ut(t).every(n=>nr(e,n)):t.type==="final"}var wn=e=>e[0]===$l;function Wi(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>zi(t,r)).sort((r,o)=>o.length-r.length).flatMap(r=>e.transitions.get(r))}function Yi(e){let t=e.config.after;if(!t)return [];let n=o=>{let i=Fl(o,e.id),s=i.type;return e.entry.push(Kt(i,{id:s,delay:o})),e.exit.push(Gt(s)),s};return Object.keys(t).flatMap(o=>{let i=t[o],s=typeof i=="string"?{target:i}:i,a=Number.isNaN(+o)?o:+o,l=n(a);return qe(s).map(f=>({...f,event:l,delay:a}))}).map(o=>{let{delay:i}=o;return {...lt(e,o.event,o),delay:i}})}function lt(e,t,n){let r=ji(n.target),o=n.reenter??false,i=Jl(e,r),s={...n,actions:qe(n.actions),guard:n.guard,target:i,source:e,reenter:o,eventType:t,toJSON:()=>({...s,source:`#${e.id}`,target:i?i.map(a=>`#${a.id}`):void 0})};return s}function qi(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(n===Jr)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=e.config.on[n];t.set(n,bt(r).map(o=>lt(e,n,o)));}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,bt(e.config.onDone).map(r=>lt(e,n,r)));}for(let n of e.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;t.set(r,bt(n.onDone).map(o=>lt(e,r,o)));}if(n.onError){let r=`xstate.error.actor.${n.id}`;t.set(r,bt(n.onError).map(o=>lt(e,r,o)));}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;t.set(r,bt(n.onSnapshot).map(o=>lt(e,r,o)));}}for(let n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n);}return t}function Zi(e,t){let n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let r={source:e,actions:!t||typeof t=="string"?[]:qe(t.actions),eventType:null,reenter:false,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function Jl(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(wn(n))return e.machine.getStateNodeById(n);let r=n[0]===Zr;if(r&&!e.parent)return gn(e,n.slice(1));let o=r?e.key+n:n;if(e.parent)try{return gn(e.parent,o)}catch(i){throw new Error(`Invalid transition definition for state node '${e.id}':
11
+ ${i.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function Ji(e){let t=ji(e.config.target);return t?{target:t.map(n=>typeof n=="string"?gn(e.parent,n):n)}:e.parent.initial}function yt(e){return e.type==="history"}function Pi(e){let t=io(e);for(let n of t)for(let r of bn(n,e))t.add(r);return t}function io(e){let t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(let o of Ut(r))n(o);}}return n(e),t}function Ht(e,t){if(wn(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function gn(e,t){if(typeof t=="string"&&wn(t))try{return e.machine.getStateNodeById(t)}catch{}let n=er(t).slice(),r=e;for(;n.length;){let o=n.shift();if(!o.length)break;r=Ht(r,o);}return r}function Vt(e,t){if(typeof t=="string"){let o=e.states[t];if(!o)throw new Error(`State '${t}' does not exist on '${e.id}'`);return [e,o]}let n=Object.keys(t),r=n.map(o=>Ht(e,o)).filter(Boolean);return [e.machine.root,e].concat(r,n.reduce((o,i)=>{let s=Ht(e,i);if(!s)return o;let a=Vt(s,t[i]);return o.concat(a)},[]))}function Ql(e,t,n,r){let i=Ht(e,t).next(n,r);return !i||!i.length?e.next(n,r):i}function ec(e,t,n,r){let o=Object.keys(t),i=Ht(e,o[0]),s=rr(i,t[o[0]],n,r);return !s||!s.length?e.next(n,r):s}function tc(e,t,n,r){let o=[];for(let i of Object.keys(t)){let s=t[i];if(!s)continue;let a=Ht(e,i),l=rr(a,s,n,r);l&&o.push(...l);}return o.length?o:e.next(n,r)}function rr(e,t,n,r){return typeof t=="string"?Ql(e,t,n,r):Object.keys(t).length===1?ec(e,t,n,r):tc(e,t,n,r)}function nc(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function ct(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function rc(e,t){let n=new Set(e),r=new Set(t);for(let o of n)if(r.has(o))return true;for(let o of r)if(n.has(o))return true;return false}function Qi(e,t,n){let r=new Set;for(let o of e){let i=false,s=new Set;for(let a of r)if(rc(qr([o],t,n),qr([a],t,n)))if(ct(o.source,a.source))s.add(a);else {i=true;break}if(!i){for(let a of s)r.delete(a);r.add(o);}}return Array.from(r)}function oc(e){let[t,...n]=e;for(let r of bn(t,void 0))if(n.every(o=>ct(o,r)))return r}function so(e,t){if(!e.target)return [];let n=new Set;for(let r of e.target)if(yt(r))if(t[r.id])for(let o of t[r.id])n.add(o);else for(let o of so(Ji(r),t))n.add(o);else n.add(r);return [...n]}function es(e,t){let n=so(e,t);if(!n)return;if(!e.reenter&&n.every(o=>o===e.source||ct(o,e.source)))return e.source;let r=oc(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function qr(e,t,n){let r=new Set;for(let o of e)if(o.target?.length){let i=es(o,n);o.reenter&&o.source===i&&r.add(i);for(let s of t)ct(s,i)&&r.add(s);}return [...r]}function ic(e,t){if(e.length!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function Qn(e,t,n,r,o,i){if(!e.length)return t;let s=new Set(t._nodes),a=t.historyValue,l=Qi(e,s,a),f=t;o||([f,a]=cc(f,r,n,l,s,a,i,n.actionExecutor)),f=wt(f,r,n,l.flatMap(u=>u.actions),i,void 0),f=ac(f,r,n,l,s,i,a,o);let d=[...s];f.status==="done"&&(f=wt(f,r,n,d.sort((u,p)=>p.order-u.order).flatMap(u=>u.exit),i,void 0));try{return a===t.historyValue&&ic(t._nodes,s)?f:ut(f,{_nodes:d,historyValue:a})}catch(u){throw u}}function sc(e,t,n,r,o){if(r.output===void 0)return;let i=Wr(o.id,o.output!==void 0&&o.parent?Yr(o.output,e.context,t,n.self):void 0);return Yr(r.output,e.context,i,n.self)}function ac(e,t,n,r,o,i,s,a){let l=e,f=new Set,d=new Set;lc(r,s,d,f),a&&d.add(e.machine.root);let u=new Set;for(let p of [...f].sort((m,g)=>m.order-g.order)){o.add(p);let m=[];m.push(...p.entry);for(let g of p.invoke)m.push(jt(g.src,{...g,syncSnapshot:!!g.onSnapshot}));if(d.has(p)){let g=p.initial.actions;m.push(...g);}if(l=wt(l,t,n,m,i,p.invoke.map(g=>g.id)),p.type==="final"){let g=p.parent,y=g?.type==="parallel"?g:g?.parent,_=y||p;for(g?.type==="compound"&&i.push(Wr(g.id,p.output!==void 0?Yr(p.output,l.context,t,n.self):void 0));y?.type==="parallel"&&!u.has(y)&&nr(o,y);)u.add(y),i.push(Wr(y.id)),_=y,y=y.parent;if(y)continue;l=ut(l,{status:"done",output:sc(l,t,n,l.machine.root,_)});}}return l}function lc(e,t,n,r){for(let o of e){let i=es(o,t);for(let a of o.target||[])!yt(a)&&(o.source!==a||o.source!==i||o.reenter)&&(r.add(a),n.add(a)),Ft(a,t,n,r);let s=so(o,t);for(let a of s){let l=bn(a,i);i?.type==="parallel"&&l.push(i),ts(r,t,n,l,!o.source.parent&&o.reenter?void 0:i);}}}function Ft(e,t,n,r){if(yt(e))if(t[e.id]){let o=t[e.id];for(let i of o)r.add(i),Ft(i,t,n,r);for(let i of o)Kr(i,e.parent,r,t,n);}else {let o=Ji(e);for(let i of o.target)r.add(i),o===e.parent?.initial&&n.add(e.parent),Ft(i,t,n,r);for(let i of o.target)Kr(i,e.parent,r,t,n);}else if(e.type==="compound"){let[o]=e.initial.target;yt(o)||(r.add(o),n.add(o)),Ft(o,t,n,r),Kr(o,e,r,t,n);}else if(e.type==="parallel")for(let o of Ut(e).filter(i=>!yt(i)))[...r].some(i=>ct(i,o))||(yt(o)||(r.add(o),n.add(o)),Ft(o,t,n,r));}function ts(e,t,n,r,o){for(let i of r)if((!o||ct(i,o))&&e.add(i),i.type==="parallel")for(let s of Ut(i).filter(a=>!yt(a)))[...e].some(a=>ct(a,s))||(e.add(s),Ft(s,t,n,e));}function Kr(e,t,n,r,o){ts(n,r,o,bn(e,t));}function cc(e,t,n,r,o,i,s,a){let l=e,f=qr(r,o,i);f.sort((u,p)=>p.order-u.order);let d;for(let u of f)for(let p of nc(u)){let m;p.history==="deep"?m=g=>oo(g)&&ct(g,u):m=g=>g.parent===u,d??={...i},d[p.id]=Array.from(o).filter(m);}for(let u of f)l=wt(l,t,n,[...u.exit,...u.invoke.map(p=>Et(p.id))],s,void 0),o.delete(u);return [l,d||i]}function uc(e,t){return e.implementations.actions[t]}function ns(e,t,n,r,o,i){let{machine:s}=e,a=e;for(let l of r){let f=typeof l=="function",d=f?l:uc(s,typeof l=="string"?l:l.type),u={context:a.context,event:t,self:n.self,system:n.system},p=f||typeof l=="string"?void 0:"params"in l?typeof l.params=="function"?l.params({context:a.context,event:t}):l.params:void 0;if(!d||!("resolve"in d)){n.actionExecutor({type:typeof l=="string"?l:typeof l=="object"?l.type:l.name||"(anonymous)",info:u,params:p,exec:d});continue}let m=d,[g,y,_]=m.resolve(n,a,u,p,d,o);a=g,"retryResolve"in m&&i?.push([m,y]),"execute"in m&&n.actionExecutor({type:m.type,info:u,params:y,exec:m.execute.bind(null,n,y)}),_&&(a=ns(a,t,n,_,o,i));}return a}function wt(e,t,n,r,o,i){let s=i?[]:void 0,a=ns(e,t,n,r,{internalQueue:o,deferredActorIds:i},s);return s?.forEach(([l,f])=>{l.retryResolve(n,a,f);}),a}function or(e,t,n,r){let o=e,i=[];function s(f,d,u){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:d,snapshot:f,_transitions:u}),i.push(f);}if(t.type===Xr)return o=ut(Di(o,t,n),{status:"stopped"}),s(o,t,[]),{snapshot:o,microstates:i};let a=t;if(a.type!==Bi){let f=a,d=Gl(f),u=$i(f,o);if(d&&!u.length)return o=ut(e,{status:"error",error:f.error}),s(o,f,[]),{snapshot:o,microstates:i};o=Qn(u,e,n,a,false,r),s(o,f,u);}let l=true;for(;o.status==="active";){let f=l?dc(o,a):[],d=f.length?o:void 0;if(!f.length){if(!r.length)break;a=r.shift(),f=$i(a,o);}o=Qn(f,o,n,a,false,r),l=o!==d,s(o,a,f);}return o.status!=="active"&&Di(o,a,n),{snapshot:o,microstates:i}}function Di(e,t,n){return wt(e,t,n,Object.values(e.children).map(r=>Et(r)),[],void 0)}function $i(e,t){return t.machine.getTransitionData(t,e)}function dc(e,t){let n=new Set,r=e._nodes.filter(oo);for(let o of r)e:for(let i of [o].concat(bn(o,void 0)))if(i.always){for(let s of i.always)if(s.guard===void 0||zt(s.guard,e.context,t,e)){n.add(s);break e}}return Qi(Array.from(n),new Set(e._nodes),e.historyValue)}function rs(e,t){let n=yn(Vt(e,t));return Xi(e,[...n])}function os(e){return !!e&&typeof e=="object"&&"machine"in e&&"value"in e}var fc=function(t){return to(t,this.value)},pc=function(t){return this.tags.has(t)},mc=function(t){let n=this.machine.getTransitionData(this,t);return !!n?.length&&n.some(r=>r.target!==void 0||r.actions.length)},gc=function(){let{_nodes:t,tags:n,machine:r,getMeta:o,toJSON:i,can:s,hasTag:a,matches:l,...f}=this;return {...f,tags:Array.from(n)}},hc=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function En(e,t){return {status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:Xi(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:fc,hasTag:pc,can:mc,getMeta:hc,toJSON:gc}}function ut(e,t={}){return En({...e,...t},e.machine)}function bc(e){if(typeof e!="object"||e===null)return {};let t={};for(let n in e){let r=e[n];Array.isArray(r)&&(t[n]=r.map(o=>({id:o.id})));}return t}function is(e,t){let{_nodes:n,tags:r,machine:o,children:i,context:s,can:a,hasTag:l,matches:f,getMeta:d,toJSON:u,...p}=e,m={};for(let y in i){let _=i[y];m[y]={snapshot:_.getPersistedSnapshot(t),src:_.src,systemId:_.systemId,syncSnapshot:_._syncSnapshot};}return {...p,context:ss(s),children:m,historyValue:bc(p.historyValue)}}function ss(e){let t;for(let n in e){let r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??=Array.isArray(e)?e.slice():{...e},t[n]={xstate$$type:tr,id:r.id};else {let o=ss(r);o!==r&&(t??=Array.isArray(e)?e.slice():{...e},t[n]=o);}}return t??e}function yc(e,t,n,r,{event:o,id:i,delay:s},{internalQueue:a}){let l=t.machine.implementations.delays;if(typeof o=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${o}" }) instead`);let f=typeof o=="function"?o(n,r):o,d;if(typeof s=="string"){let u=l&&l[s];d=typeof u=="function"?u(n,r):u;}else d=typeof s=="function"?s(n,r):s;return typeof d!="number"&&a.push(f),[t,{event:f,id:i,delay:d},void 0]}function wc(e,t){let{event:n,delay:r,id:o}=t;if(typeof r=="number"){e.defer(()=>{let i=e.self;e.system.scheduler.schedule(i,i,n,r,o);});return}}function Kt(e,t){function n(r,o){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=yc,n.execute=wc,n}function Ec(e,{machine:t,context:n},r,o){let i=(s,a)=>{if(typeof s=="string"){let l=hn(t,s);if(!l)throw new Error(`Actor logic '${s}' not implemented in machine '${t.id}'`);let f=Ze(l,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:typeof a?.input=="function"?a.input({context:n,event:r,self:e.self}):a?.input,src:s,systemId:a?.systemId});return o[f.id]=f,f}else return Ze(s,{id:a?.id,parent:e.self,syncSnapshot:a?.syncSnapshot,input:a?.input,src:s,systemId:a?.systemId})};return (s,a)=>{let l=i(s,a);return o[l.id]=l,e.defer(()=>{l._processingStatus!==Be.Stopped&&l.start();}),l}}function Sc(e,t,n,r,{assignment:o}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let i={},s={context:t.context,event:n.event,spawn:Ec(e,t,n.event,i),self:e.self,system:e.system},a={};if(typeof o=="function")a=o(s,r);else for(let f of Object.keys(o)){let d=o[f];a[f]=typeof d=="function"?d(s,r):d;}let l=Object.assign({},t.context,a);return [ut(t,{context:l,children:Object.keys(i).length?{...t.children,...i}:t.children}),void 0,void 0]}function j(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=Sc,t}var ls=new WeakMap;function Xt(e,t,n){let r=ls.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},ls.set(e,r)),r[t]}var xc={},Sn=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e,ir=class e{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(Zr),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?no(this.config.states,(r,o)=>new e(r,{_parent:this,_key:o,_machine:this.machine})):xc,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===true?"shallow":this.config.history||false,this.entry=qe(this.config.entry).slice(),this.exit=qe(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=qe(t.tags).slice();}_initialize(){this.transitions=qi(this),this.config.always&&(this.always=bt(this.config.always).map(t=>lt(this,Jr,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize();});}get definition(){return {id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(Sn),eventType:null,reenter:false,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(Sn),eventType:null})}:void 0,history:this.history,states:no(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(Sn)})),entry:this.entry.map(Sn),exit:this.exit.map(Sn),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Xt(this,"invoke",()=>qe(this.config.invoke).map((t,n)=>{let{src:r,systemId:o}=t,i=t.id??ro(this.id,n),s=typeof r=="string"?r:`xstate.invoke.${ro(this.id,n)}`;return {...t,src:s,id:i,systemId:o,toJSON(){let{onDone:a,onError:l,...f}=t;return {...f,type:"xstate.invoke",src:s,id:i}}}}))}get on(){return Xt(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(o=>[n,o])).reduce((n,[r,o])=>(n[r]=n[r]||[],n[r].push(o),n),{}))}get after(){return Xt(this,"delayedTransitions",()=>Yi(this))}get initial(){return Xt(this,"initial",()=>Zi(this,this.config.initial))}next(t,n){let r=n.type,o=[],i,s=Xt(this,`candidates-${r}`,()=>Wi(this,r));for(let a of s){let{guard:l}=a,f=t.context,d=false;try{d=!l||zt(l,f,n,t);}catch(u){let p=typeof l=="string"?l:typeof l=="object"?l.type:void 0;throw new Error(`Unable to evaluate guard ${p?`'${p}' `:""}in transition for event '${r}' in state node '${this.id}':
12
+ ${u.message}`)}if(d){o.push(...a.actions),i=a;break}}return i?[i]:void 0}get events(){return Xt(this,"events",()=>{let{states:t}=this,n=new Set(this.ownEvents);if(t)for(let r of Object.keys(t)){let o=t[r];if(o.states)for(let i of o.events)n.add(`${i}`);}return Array.from(n)})}get ownEvents(){let t=Object.keys(Object.fromEntries(this.transitions)),n=new Set(t.filter(r=>this.transitions.get(r).some(o=>!(!o.target&&!o.actions.length&&!o.reenter))));return Array.from(n)}},vc="#",sr=class e{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=true,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:n?.actors??{},actions:n?.actions??{},delays:n?.delays??{},guards:n?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new ir(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events;}provide(t){let{actions:n,guards:r,actors:o,delays:i}=this.implementations;return new e(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...o,...t.actors},delays:{...i,...t.delays}})}resolveState(t){let n=rs(this.root,t.value),r=yn(Vt(this.root,n));return En({_nodes:[...r],context:t.context||{},children:{},status:nr(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return or(t,n,r,[]).snapshot}microstep(t,n,r){return or(t,n,r,[]).microstates}getTransitionData(t,n){return rr(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){let{context:o}=this.config,i=En({context:typeof o!="function"&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return typeof o=="function"?wt(i,n,t,[j(({spawn:a,event:l,self:f})=>o({spawn:a,input:l.input,self:f}))],r,void 0):i}getInitialSnapshot(t,n){let r=eo(n),o=[],i=this.getPreInitialState(t,r,o),s=Qn([{target:[...io(this.root)],source:this.root,reenter:true,actions:[],eventType:null,toJSON:null}],i,t,r,true,o),{snapshot:a}=or(s,r,t,o);return a}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start();});}getStateNodeById(t){let n=er(t),r=n.slice(1),o=wn(n[0])?n[0].slice(vc.length):n[0],i=this.idMap.get(o);if(!i)throw new Error(`Child state node '#${o}' does not exist on machine '${this.id}'`);return gn(i,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return is(t,n)}restoreSnapshot(t,n){let r={},o=t.children;Object.keys(o).forEach(u=>{let p=o[u],m=p.snapshot,g=p.src,y=typeof g=="string"?hn(this,g):g;if(!y)return;let _=Ze(y,{id:u,parent:n.self,syncSnapshot:p.syncSnapshot,snapshot:m,src:g,systemId:p.systemId});r[u]=_;});function i(u,p){if(p instanceof ir)return p;try{return u.machine.getStateNodeById(p.id)}catch{}}function s(u,p){if(!p||typeof p!="object")return {};let m={};for(let g in p){let y=p[g];for(let _ of y){let I=i(u,_);I&&(m[g]??=[],m[g].push(I));}}return m}let a=s(this.root,t.historyValue),l=En({...t,children:r,_nodes:Array.from(yn(Vt(this.root,t.value))),historyValue:a},this),f=new Set;function d(u,p){if(!f.has(u)){f.add(u);for(let m in u){let g=u[m];if(g&&typeof g=="object"){if("xstate$$type"in g&&g.xstate$$type===tr){u[m]=p[g.id];continue}d(g,p);}}}}return d(l.context,r),l}};function _c(e,t,n,r,{event:o}){let i=typeof o=="function"?o(n,r):o;return [t,{event:i},void 0]}function Cc(e,{event:t}){e.defer(()=>e.emit(t));}function lo(e){function t(n,r){}return t.type="xstate.emit",t.event=e,t.resolve=_c,t.execute=Cc,t}var ao=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function Tc(e,t,n,r,{to:o,event:i,id:s,delay:a},l){let f=t.machine.implementations.delays;if(typeof i=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${i}" }) instead`);let d=typeof i=="function"?i(n,r):i,u;if(typeof a=="string"){let g=f&&f[a];u=typeof g=="function"?g(n,r):g;}else u=typeof a=="function"?a(n,r):a;let p=typeof o=="function"?o(n,r):o,m;if(typeof p=="string"){if(p===ao.Parent?m=e.self._parent:p===ao.Internal?m=e.self:p.startsWith("#_")?m=t.children[p.slice(2)]:m=l.deferredActorIds?.includes(p)?p:t.children[p],!m)throw new Error(`Unable to send event to actor '${p}' from machine '${t.machine.id}'.`)}else m=p||e.self;return [t,{to:m,targetId:typeof p=="string"?p:void 0,event:d,id:s,delay:u},void 0]}function Ac(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to]);}function Ic(e,t){e.defer(()=>{let{to:n,event:r,delay:o,id:i}=t;if(typeof o=="number"){e.system.scheduler.schedule(e.self,n,r,o,i);return}e.system._relay(e.self,n,r.type===Fi?Qr(e.self.id,r.data):r);});}function ar(e,t,n){function r(o,i){}return r.type="xstate.sendTo",r.to=e,r.event=t,r.id=n?.id,r.delay=n?.delay,r.resolve=Tc,r.retryResolve=Ac,r.execute=Ic,r}function kc(e,t){return ar(ao.Parent,e,t)}function Oc(e,t,n,r,{collect:o}){let i=[],s=function(l){i.push(l);};return s.assign=(...a)=>{i.push(j(...a));},s.cancel=(...a)=>{i.push(Gt(...a));},s.raise=(...a)=>{i.push(Kt(...a));},s.sendTo=(...a)=>{i.push(ar(...a));},s.sendParent=(...a)=>{i.push(kc(...a));},s.spawnChild=(...a)=>{i.push(jt(...a));},s.stopChild=(...a)=>{i.push(Et(...a));},s.emit=(...a)=>{i.push(lo(...a));},o({context:n.context,event:n.event,enqueue:s,check:a=>zt(a,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,i]}function cs(e){function t(n,r){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=Oc,t}function Rc(e,t,n,r,{value:o,label:i}){return [t,{value:typeof o=="function"?o(n,r):o,label:i},void 0]}function Mc({logger:e},{value:t,label:n}){n?e(n,t):e(t);}function us(e=({context:n,event:r})=>({context:n,event:r}),t){function n(r,o){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=Rc,n.execute=Mc,n}function Nc(e,t){return new sr(e,t)}function co({schemas:e,actors:t,actions:n,guards:r,delays:o}){return {assign:j,sendTo:ar,raise:Kt,log:us,cancel:Gt,stopChild:Et,enqueueActions:cs,emit:lo,spawnChild:jt,createStateConfig:i=>i,createAction:i=>i,createMachine:i=>Nc({...i,schemas:e},{actors:t,actions:n,guards:r,delays:o}),extend:i=>co({schemas:e,actors:t,actions:{...n,...i.actions},guards:{...r,...i.guards},delays:{...o,...i.delays}})}}function lr(e){let t;return e!=null&&typeof e=="object"&&(!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}var fs=(e,t)=>{if(!lr(e))return e;let n=!Array.isArray(e),[r,o]=n?[{},Object.keys(e)]:[[],e];t.set(e,r);for(let i=0;i<o.length;++i){let s=n?o[i]:i,a=e[s];t.has(a)?r[s]=t.get(a):r[s]=fs(a,t);}return r},Lc=e=>fs(e,new WeakMap),Pc=(e,t={})=>{let n=t;for(let r=0;r<e.length;r++)n=n?.[e[r]];return n},Dc=e=>lr(e)?Array.isArray(e)?[]:{}:e,$c=(e,t,n,r)=>{let o=new WeakMap,i=(s,a,l)=>{if(a!==s){if(o.has(s)){n(...l,o.get(s));return}if(!lr(s)||!lr(a)){l[l.length-1]!=="toString"&&n(...l,()=>s);return}if(o.set(s,Pc(l,r)),Array.isArray(s)&&Array.isArray(a)){let f=s.length-a.length,d=Math.min(a.length,s.length),u=Math.max(s.length,a.length);if(f!==0)for(let p=d;p<=u-1;p++)n(...l,p,Dc(s[p]));for(let p=0,m=u-1;p<=m&&(i(s[p],a[p],[...l,p]),p!==m);p++,m--)i(s[m],a[m],[...l,m]);a.length!==s.length&&n(...l,"length",s.length);}else {let f=Object.keys(s);for(let u=0,p=f.length;u<p;u++)i(s[f[u]],a[f[u]],[...l,f[u]]);let d=Object.keys(a);for(let u=0,p=d.length;u<p;u++)s[d[u]]===void 0&&n(...l,d[u],void 0);}}};i(e,t,[]);};function Bc(e){let[t,n]=Ri(Lc(e)),r=e;return [t,i=>{Gn(()=>{$c(i,r,n,t);}),r=i;}]}var ds=()=>{};function Fc(e){let t=J(()=>typeof e=="function"?e():e),[n,r]=Bc({v:t()?.getSnapshot()});return te(o=>{let i=t();if(o||r({v:i?.getSnapshot()}),i){let{unsubscribe:s}=i.subscribe({next:a=>r({v:a}),error:ds,complete:ds});le(s);}return false},true),()=>n.v}function Uc(e,...[t]){let n=Ze(e,t);return Ve(()=>{n.start(),le(()=>n.stop());}),n}function Hc(e,...[t]){let n=Uc(e,t);return [Fc(n)(),n.send,n]}function ps(e,...[t]){return Hc(e,t)}var ms="0.0.93";var gs="linear-gradient(in oklab 180deg, oklab(100% 0 0) 0%, oklab(96.1% 0 0) 5.92%)",cr=["Meta","Control","Shift","Alt"],hs='<svg width="294" height="294" viewBox="0 0 294 294" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_0_3)"><mask id="mask0_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="294" height="294"><path d="M294 0H0V294H294V0Z" fill="white"/></mask><g mask="url(#mask0_0_3)"><path d="M144.599 47.4924C169.712 27.3959 194.548 20.0265 212.132 30.1797C227.847 39.2555 234.881 60.3243 231.926 89.516C231.677 92.0069 231.328 94.5423 230.94 97.1058L228.526 110.14C228.517 110.136 228.505 110.132 228.495 110.127C228.486 110.165 228.479 110.203 228.468 110.24L216.255 105.741C216.256 105.736 216.248 105.728 216.248 105.723C207.915 103.125 199.421 101.075 190.82 99.5888L190.696 99.5588L173.526 97.2648L173.511 97.2631C173.492 97.236 173.467 97.2176 173.447 97.1905C163.862 96.2064 154.233 95.7166 144.599 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8624 138.391 86.939 147.193C90.8624 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245C115.749 197.245 115.758 197.246 115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.507 229.974L144.609 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.472 238.38C154.485 238.392 154.499 238.402 154.513 238.412L143.846 247.482L143.827 247.497C126.56 261.128 109.472 268.745 94.8019 268.745C88.5916 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3164 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3363 185.327 9.52301 167.51 9.52301 147.193C9.52301 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3164 60.3243 61.3496 39.2555 77.0657 30.1797C94.6494 20.0265 119.486 27.3959 144.599 47.4924ZM70.6423 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5176 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8516 207.742 83.0977 205.066 70.6423 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1787 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.9311 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.759 110.203C59.234 110.839 57.7378 111.475 56.27 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9104 147.193C67.822 135.23 63.7566 122.855 60.759 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.854 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.6291 47.6015 67.6975 64.5954 70.0424 87.9446L70.0416 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8263 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.773 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.29 38.512C183.321 38.512 169.34 44.4991 154.444 56.0153C163.93 64.9374 172.634 74.6557 180.462 85.064C193.375 86.6345 206.128 89.3102 218.584 93.0624C218.812 91.4325 219.003 89.8118 219.165 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.552 64.3097C138.104 70.2614 132.054 76.6306 126.443 83.3765C132.39 82.995 138.426 82.8046 144.552 82.8046C150.727 82.8046 156.778 83.0143 162.707 83.3765C157.08 76.6293 151.015 70.2596 144.552 64.3097Z" fill="white"/><path d="M144.598 47.4924C169.712 27.3959 194.547 20.0265 212.131 30.1797C227.847 39.2555 234.88 60.3243 231.926 89.516C231.677 92.0069 231.327 94.5423 230.941 97.1058L228.526 110.14L228.496 110.127C228.487 110.165 228.478 110.203 228.469 110.24L216.255 105.741L216.249 105.723C207.916 103.125 199.42 101.075 190.82 99.5888L190.696 99.5588L173.525 97.2648L173.511 97.263C173.492 97.236 173.468 97.2176 173.447 97.1905C163.863 96.2064 154.234 95.7166 144.598 95.7223C134.943 95.7162 125.295 96.219 115.693 97.2286C110.075 105.033 104.859 113.118 100.063 121.453C95.2426 129.798 90.8622 138.391 86.939 147.193C90.8622 155.996 95.2426 164.588 100.063 172.933C104.866 181.302 110.099 189.417 115.741 197.245L115.766 197.247L115.752 197.27L115.745 197.283L115.754 197.296L126.501 211.013L126.574 211.089C132.136 217.767 138.126 224.075 144.506 229.974L144.61 230.082L154.572 238.287C154.539 238.319 154.506 238.35 154.473 238.38L154.512 238.412L143.847 247.482L143.827 247.497C126.56 261.13 109.472 268.745 94.8018 268.745C88.5915 268.837 82.4687 267.272 77.0657 264.208C61.3496 255.132 54.3162 234.062 57.2707 204.871C57.528 202.307 57.8806 199.694 58.2904 197.054C28.3362 185.327 9.52298 167.51 9.52298 147.193C9.52298 129.042 24.2476 112.396 50.9901 100.375C53.3443 99.3163 55.7938 98.3058 58.2904 97.3526C57.8806 94.7023 57.528 92.0803 57.2707 89.516C54.3162 60.3243 61.3496 39.2555 77.0657 30.1797C94.6493 20.0265 119.486 27.3959 144.598 47.4924ZM70.6422 201.315C70.423 202.955 70.2229 204.566 70.0704 206.168C67.6686 229.567 72.5478 246.628 83.3615 252.988L83.5175 253.062C95.0399 259.717 114.015 254.426 134.782 238.38C125.298 229.45 116.594 219.725 108.764 209.314C95.8515 207.742 83.0977 205.066 70.6422 201.315ZM80.3534 163.438C77.34 171.677 74.8666 180.104 72.9484 188.664C81.1786 191.224 89.5657 193.247 98.0572 194.724L98.4618 194.813C95.2115 189.865 92.0191 184.66 88.931 179.378C85.8433 174.097 83.003 168.768 80.3534 163.438ZM60.7589 110.203C59.234 110.839 57.7378 111.475 56.2699 112.11C34.7788 121.806 22.3891 134.591 22.3891 147.193C22.3891 160.493 36.4657 174.297 60.7494 184.26C63.7439 171.581 67.8124 159.182 72.9103 147.193C67.822 135.23 63.7566 122.855 60.7589 110.203ZM98.4137 99.6404C89.8078 101.145 81.3075 103.206 72.9676 105.809C74.8539 114.203 77.2741 122.468 80.2132 130.554L80.3059 130.939C82.9938 125.6 85.8049 120.338 88.8834 115.008C91.9618 109.679 95.1544 104.569 98.4137 99.6404ZM94.9258 38.5215C90.9331 38.4284 86.9866 39.3955 83.4891 41.3243C72.629 47.6015 67.6975 64.5954 70.0424 87.9446L70.0415 88.2194C70.194 89.8208 70.3941 91.4325 70.6134 93.0624C83.0737 89.3364 95.8262 86.6703 108.736 85.0924C116.57 74.6779 125.28 64.9532 134.772 56.0249C119.877 44.5087 105.895 38.5215 94.9258 38.5215ZM205.737 41.3148C202.268 39.398 198.355 38.4308 194.394 38.5099L194.291 38.512C183.321 38.512 169.34 44.4991 154.443 56.0153C163.929 64.9374 172.634 74.6557 180.462 85.064C193.374 86.6345 206.129 89.3102 218.584 93.0624C218.813 91.4325 219.003 89.8118 219.166 88.2098C221.548 64.7099 216.65 47.6164 205.737 41.3148ZM144.551 64.3097C138.103 70.2614 132.055 76.6306 126.443 83.3765C132.389 82.995 138.427 82.8046 144.551 82.8046C150.727 82.8046 156.779 83.0143 162.707 83.3765C157.079 76.6293 151.015 70.2596 144.551 64.3097Z" fill="#FF40E0"/></g><mask id="mask1_0_3" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="102" y="84" width="161" height="162"><path d="M235.282 84.827L102.261 112.259L129.693 245.28L262.714 217.848L235.282 84.827Z" fill="white"/></mask><g mask="url(#mask1_0_3)"><path d="M136.863 129.916L213.258 141.224C220.669 142.322 222.495 152.179 215.967 155.856L187.592 171.843L184.135 204.227C183.339 211.678 173.564 213.901 169.624 207.526L129.021 141.831C125.503 136.14 130.245 128.936 136.863 129.916Z" fill="#FF40E0" stroke="#FF40E0" stroke-width="0.817337" stroke-linecap="round" stroke-linejoin="round"/></g></g><defs><clipPath id="clip0_0_3"><rect width="294" height="294" fill="white"/></clipPath></defs></svg>';var Gc=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),jc=e=>{let t=e.trim();if(!t)return null;let n=parseFloat(t);return Gc(n)?n:null},bs=(e,t)=>{let n=e.split(",");if(n.length!==t)return null;let r=[];for(let o of n){let i=jc(o);if(i===null)return null;r.push(i);}return r},zc=(e,t,n,r)=>e===1&&t===0&&n===0&&r===1,Vc=e=>e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[15]===1,ys=e=>{try{if(!(e instanceof Element))return "none";let t=window.getComputedStyle(e);if(!t)return "none";let n=t.transform;if(!n||n==="none")return "none";let r=n.match(/^matrix3d\(([^)]+)\)$/);if(r){let i=bs(r[1],16);if(i&&i.length===16){let s=[...i];return s[12]=0,s[13]=0,s[14]=0,Vc(s)?"none":`matrix3d(${s.join(", ")})`}}let o=n.match(/^matrix\(([^)]+)\)$/);if(o){let i=bs(o[1],6);if(i&&i.length===6){let[s,a,l,f]=i;return zc(s,a,l,f)?"none":`matrix(${s}, ${a}, ${l}, ${f}, 0, 0)`}}return "none"}catch{return "none"}};var Te=e=>{let t=e.getBoundingClientRect();return {borderRadius:window.getComputedStyle(e).borderRadius||"0px",height:t.height,transform:ys(e),width:t.width,x:t.left,y:t.top}};var Kc=e=>({isToggleMode:false,hasAgentProvider:false,keyHoldDuration:200,mousePosition:{x:-1e3,y:-1e3},dragStart:{x:-1e3,y:-1e3},copyStart:{x:-1e3,y:-1e3},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],lastGrabbedElement:null,lastCopiedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:"",pendingClickData:null,replySessionId:null,viewportVersion:0,grabbedBoxes:[],labelInstances:[],nativeSelectionCursor:{x:-1e3,y:-1e3},nativeSelectionElements:[],agentSessions:new Map,sessionElements:new Map,abortControllers:new Map,isTouchMode:false,theme:e,activationTimestamp:null,previouslyFocusedElement:null,canUndo:false,canRedo:false,isAgentConnected:false,supportsUndo:false,supportsFollowUp:false,dismissButtonText:void 0}),Xc=({context:e})=>e.hasAgentProvider,Wc=({context:e})=>e.frozenElement!==null||e.detectedElement!==null,Yc=({context:e})=>e.nativeSelectionElements.length>0,qc=({context:e})=>e.inputText.trim().length>0,Zc=({context:e})=>e.isToggleMode,Jc=({context:e})=>e.pendingClickData!==null;var Qc=({context:e})=>Array.from(e.agentSessions.values()).some(t=>t.isStreaming),eu=({context:e})=>e.lastCopiedElement!==null&&document.contains(e.lastCopiedElement);var ws=co({delays:{KEY_HOLD_DURATION:({context:e})=>e.keyHoldDuration,DOUBLE_CLICK_THRESHOLD:250,SUCCESS_LABEL_DURATION:1700,COPIED_LABEL_DURATION:1500},guards:{hasAgentProvider:Xc,hasElement:Wc,hasNativeSelection:Yc,hasInputText:qc,isToggleMode:Zc,hasPendingClick:Jc,isAgentStreaming:Qc,hasLastCopiedElement:eu},actions:{setMousePosition:j({mousePosition:({event:e})=>e.type==="MOUSE_MOVE"?e.position:{x:-1e3,y:-1e3}}),setDetectedElement:j({detectedElement:({event:e})=>e.type==="ELEMENT_DETECTED"?e.element:null}),setFrozenElement:j({frozenElement:({event:e})=>e.type==="FREEZE_ELEMENT"?e.element:null,frozenElements:({event:e})=>e.type==="FREEZE_ELEMENT"?[e.element]:[]}),setFrozenElements:j({frozenElements:({event:e})=>e.type==="FREEZE_ELEMENTS"?e.elements:[],frozenElement:({event:e})=>e.type==="FREEZE_ELEMENTS"&&e.elements.length>0?e.elements[0]:null}),clearFrozenElement:j({frozenElement:()=>null,frozenElements:()=>[]}),setDragStart:j({dragStart:({event:e})=>e.type==="DRAG_START"?{x:e.position.x+window.scrollX,y:e.position.y+window.scrollY}:{x:-1e3,y:-1e3}}),resetDragStart:j({dragStart:()=>({x:-1e3,y:-1e3})}),setCopyStart:j({copyStart:({event:e})=>e.type==="SET_COPY_START"?e.position:{x:-1e3,y:-1e3},copyOffsetFromCenterX:({event:e})=>{if(e.type==="SET_COPY_START"&&e.element){let t=Te(e.element),n=t.x+t.width/2;return e.position.x-n}return 0}}),setInputText:j({inputText:({event:e})=>e.type==="INPUT_CHANGE"?e.value:""}),clearInputText:j({inputText:()=>""}),enableToggleMode:j({isToggleMode:()=>true}),disableToggleMode:j({isToggleMode:()=>false}),setToggleMode:j({isToggleMode:({event:e})=>e.type==="SET_TOGGLE_MODE"?e.value:false}),setLastGrabbedElement:j({lastGrabbedElement:({event:e})=>e.type==="SET_LAST_GRABBED"?e.element:null}),setLastCopiedElement:j({lastCopiedElement:({event:e})=>e.type==="SET_LAST_COPIED"||e.type==="COPY_DONE"?e.element??null:null}),clearLastCopiedElement:j({lastCopiedElement:()=>null}),incrementViewportVersion:j({viewportVersion:({context:e})=>e.viewportVersion+1}),addGrabbedBox:j({grabbedBoxes:({context:e,event:t})=>t.type==="ADD_GRABBED_BOX"?[...e.grabbedBoxes,t.box]:e.grabbedBoxes}),removeGrabbedBox:j({grabbedBoxes:({context:e,event:t})=>t.type==="REMOVE_GRABBED_BOX"?e.grabbedBoxes.filter(n=>n.id!==t.boxId):e.grabbedBoxes}),clearGrabbedBoxes:j({grabbedBoxes:()=>[]}),addLabelInstance:j({labelInstances:({context:e,event:t})=>t.type==="ADD_LABEL_INSTANCE"?[...e.labelInstances,t.instance]:e.labelInstances}),updateLabelInstance:j({labelInstances:({context:e,event:t})=>t.type==="UPDATE_LABEL_INSTANCE"?e.labelInstances.map(n=>n.id===t.instanceId?{...n,status:t.status}:n):e.labelInstances}),removeLabelInstance:j({labelInstances:({context:e,event:t})=>t.type==="REMOVE_LABEL_INSTANCE"?e.labelInstances.filter(n=>n.id!==t.instanceId):e.labelInstances}),clearLabelInstances:j({labelInstances:()=>[]}),setNativeSelectionCursor:j({nativeSelectionCursor:({event:e})=>e.type==="TEXT_SELECTED"?e.cursor:{x:-1e3,y:-1e3}}),setNativeSelectionElements:j({nativeSelectionElements:({event:e})=>e.type==="TEXT_SELECTED"?e.elements:[]}),clearNativeSelection:j({nativeSelectionCursor:()=>({x:-1e3,y:-1e3}),nativeSelectionElements:()=>[]}),setTouchMode:j({isTouchMode:({event:e})=>e.type==="SET_TOUCH_MODE"?e.value:false}),setSelectionSource:j({selectionFilePath:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.filePath:null,selectionLineNumber:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.lineNumber:null}),clearSelectionSource:j({selectionFilePath:()=>null,selectionLineNumber:()=>null}),setPendingClickData:j({pendingClickData:({event:e})=>e.type==="SET_PENDING_CLICK"?e.data:null}),clearPendingClickData:j({pendingClickData:()=>null}),setReplySessionId:j({replySessionId:({event:e})=>e.type==="SET_REPLY_SESSION"?e.sessionId:null}),clearReplySessionId:j({replySessionId:()=>null}),addAgentSession:j({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.agentSessions;let n=new Map(e.agentSessions);return n.set(t.sessionId,t.session),n}}),setSessionElement:j({sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.sessionElements;let n=new Map(e.sessionElements);return n.set(t.sessionId,t.element),n}}),updateAgentSessionStatus:j({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_STATUS")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,lastStatus:t.status}),r}}),completeAgentSession:j({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_DONE")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,isStreaming:false,lastStatus:t.status??n.lastStatus}),r}}),setAgentSessionError:j({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_ERROR")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,isStreaming:false,error:t.error}),r}}),removeAgentSession:j({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.agentSessions;let n=new Map(e.agentSessions);return n.delete(t.sessionId),n},sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.sessionElements;let n=new Map(e.sessionElements);return n.delete(t.sessionId),n}}),storeActivationTimestamp:j({activationTimestamp:()=>Date.now(),previouslyFocusedElement:()=>document.activeElement}),clearActivationTimestamp:j({activationTimestamp:()=>null,previouslyFocusedElement:()=>null}),setKeyHoldDuration:j({keyHoldDuration:({event:e,context:t})=>e.type==="HOLD_START"&&e.duration!==void 0?e.duration:t.keyHoldDuration}),setHasAgentProvider:j({hasAgentProvider:({event:e})=>e.type==="SET_HAS_AGENT_PROVIDER"?e.value:false}),setUndoRedoState:j({canUndo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canUndo:false,canRedo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canRedo:false}),setAgentCapabilities:j({supportsUndo:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsUndo:false,supportsFollowUp:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsFollowUp:false,dismissButtonText:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.dismissButtonText:void 0,isAgentConnected:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.isAgentConnected:false}),resetActivationState:j({isToggleMode:()=>false,inputText:()=>"",frozenElement:()=>null,frozenElements:()=>[],pendingClickData:()=>null,activationTimestamp:()=>null}),updateSessionBounds:j({agentSessions:({context:e})=>{if(e.agentSessions.size===0)return e.agentSessions;let t=new Map(e.agentSessions),n=false;for(let[r,o]of e.agentSessions){let i=e.sessionElements.get(r);if(i&&document.contains(i)){let s=Te(i),a=o.selectionBounds[0],l=o.position;if(a){let f=a.x+a.width/2,d=o.position.x-f,u=s.x+s.width/2;l={...o.position,x:u+d};}t.set(r,{...o,selectionBounds:[s],position:l}),n=true;}}return n?t:e.agentSessions}}),freezeCurrentElement:j({frozenElement:({context:e})=>e.frozenElement??e.detectedElement}),saveInputModePosition:j({copyStart:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.copyStart,copyOffsetFromCenterX:({event:e})=>{if(e.type==="INPUT_MODE_ENTER"&&e.element){let t=Te(e.element),n=t.x+t.width/2;return e.position.x-n}return 0},mousePosition:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.mousePosition,frozenElement:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.element:t.frozenElement})}}).createMachine({id:"grabMachine",type:"parallel",context:({input:e})=>({...Kc(e.theme),hasAgentProvider:e.hasAgentProvider,keyHoldDuration:e.keyHoldDuration}),states:{activation:{initial:"idle",states:{idle:{on:{HOLD_START:{target:"holding",actions:["setKeyHoldDuration"]},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},holding:{after:{KEY_HOLD_DURATION:{target:"active",actions:["storeActivationTimestamp"]}},on:{RELEASE:{target:"idle"},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},active:{initial:"hovering",states:{hovering:{on:{FREEZE:{target:"frozen",actions:["freezeCurrentElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},frozen:{on:{UNFREEZE:{target:"hovering",actions:["clearFrozenElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},dragging:{on:{DRAG_END:{target:"justDragged",actions:["resetDragStart"]},DRAG_CANCEL:{target:"hovering",actions:["resetDragStart"]}}},justDragged:{on:{DRAG_START:{target:"dragging",actions:["setDragStart"]}},after:{SUCCESS_LABEL_DURATION:{target:"hovering"}}}},on:{DEACTIVATE:{target:"idle",actions:["resetActivationState","clearActivationTimestamp"]},MOUSE_MOVE:{actions:["setMousePosition"]},ELEMENT_DETECTED:{actions:["setDetectedElement"]},SET_TOUCH_MODE:{actions:["setTouchMode"]},SET_SELECTION_SOURCE:{actions:["setSelectionSource"]}}}},on:{TOGGLE:[{guard:({context:e})=>e.activationTimestamp!==null,target:".idle",actions:["resetActivationState","clearActivationTimestamp"]},{target:".active",actions:["enableToggleMode","storeActivationTimestamp"]}],VIEWPORT_CHANGE:{actions:["incrementViewportVersion","updateSessionBounds"]},ADD_GRABBED_BOX:{actions:["addGrabbedBox"]},REMOVE_GRABBED_BOX:{actions:["removeGrabbedBox"]},CLEAR_GRABBED_BOXES:{actions:["clearGrabbedBoxes"]},SET_LAST_GRABBED:{actions:["setLastGrabbedElement"]},SET_LAST_COPIED:{actions:["setLastCopiedElement"]},SET_HAS_AGENT_PROVIDER:{actions:["setHasAgentProvider"]},SET_UNDO_REDO_STATE:{actions:["setUndoRedoState"]},SET_AGENT_CAPABILITIES:{actions:["setAgentCapabilities"]},SET_TOGGLE_MODE:{actions:["setToggleMode"]},FREEZE_ELEMENT:{actions:["setFrozenElement"]},FREEZE_ELEMENTS:{actions:["setFrozenElements"]}}},interaction:{initial:"idle",states:{idle:{on:{CLICK:{target:"awaitingDoubleClick",actions:["setPendingClickData"]},INPUT_MODE_ENTER:{target:"inputMode",actions:["saveInputModePosition","enableToggleMode"]},COPY_START:{target:"copying"}}},awaitingDoubleClick:{after:{DOUBLE_CLICK_THRESHOLD:{target:"copying"}},on:{DOUBLE_CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]},CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]}}},copying:{on:{COPY_DONE:{target:"justCopied",actions:["clearPendingClickData","setLastCopiedElement"]}}},justCopied:{after:{COPIED_LABEL_DURATION:{target:"idle"}}},inputMode:{initial:"typing",states:{typing:{on:{ESC:[{target:"confirmingDismiss",guard:"hasInputText"},{target:"#grabMachine.interaction.idle"}],INPUT_SUBMIT:{target:"#grabMachine.interaction.copying"}}},confirmingDismiss:{on:{CANCEL_DISMISS:{target:"typing"},CONFIRM_DISMISS:{target:"#grabMachine.interaction.idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{INPUT_CHANGE:{actions:["setInputText"]},INPUT_CANCEL:{target:"idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{ADD_LABEL_INSTANCE:{actions:["addLabelInstance"]},UPDATE_LABEL_INSTANCE:{actions:["updateLabelInstance"]},REMOVE_LABEL_INSTANCE:{actions:["removeLabelInstance"]},SET_COPY_START:{actions:["setCopyStart"]},SET_PENDING_CLICK:{actions:["setPendingClickData"]},SET_REPLY_SESSION:{actions:["setReplySessionId"]},DEACTIVATE:{target:".idle",actions:["clearInputText","clearReplySessionId","clearPendingClickData"]}}},nativeSelection:{initial:"inactive",states:{inactive:{on:{TEXT_SELECTED:{target:"active",actions:["setNativeSelectionCursor","setNativeSelectionElements"]}}},active:{on:{SELECTION_CLEARED:{target:"inactive",actions:["clearNativeSelection"]},CLEAR_NATIVE_SELECTION:{target:"inactive",actions:["clearNativeSelection"]},TEXT_SELECTED:{actions:["setNativeSelectionCursor","setNativeSelectionElements"]}}}}},agentSessions:{initial:"idle",states:{idle:{on:{SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},streaming:{on:{STREAM_STATUS:{actions:["updateAgentSessionStatus"]},STREAM_DONE:{target:"completed",actions:["completeAgentSession"]},STREAM_ERROR:{target:"error",actions:["setAgentSessionError"]},SESSION_ABORT:{target:"idle",actions:["removeAgentSession"]}}},completed:{on:{SESSION_DISMISS:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},error:{on:{ERROR_ACKNOWLEDGE:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}}},on:{UPDATE_SESSION_BOUNDS:{actions:["updateSessionBounds"]}}},agentAbortConfirmation:{initial:"inactive",states:{inactive:{on:{ESC:{target:"confirming",guard:"isAgentStreaming"}}},confirming:{on:{CONFIRM_AGENT_ABORT:{target:"inactive"},CANCEL_AGENT_ABORT:{target:"inactive"}}}}}}});var tu=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],nu=e=>Array.isArray(e),ru=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(n){let a=e.composedPath()[0];a instanceof HTMLElement&&(o=a.tagName,i=a.role);}else r instanceof HTMLElement&&(o=r.tagName,i=r.role);return nu(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},je=e=>ru(e,tu);var Es=e=>{let t=e.tagName.toLowerCase();return !!(t==="input"||t==="textarea"||e instanceof HTMLElement&&e.isContentEditable)},Ss=(e,t)=>{let n=document.activeElement;if(n){let r=n;for(;r;){if(Es(r))return true;r=r.parentElement;}}if(e!==void 0&&t!==void 0){let r=document.elementsFromPoint(e,t);for(let o of r)if(Es(o))return true}return false};var Wt="data-react-grab",xs=e=>{let t=document.querySelector(`[${Wt}]`);if(t){let s=t.shadowRoot?.querySelector(`[${Wt}]`);if(s instanceof HTMLDivElement&&t.shadowRoot)return s}let n=document.createElement("div");n.setAttribute(Wt,"true"),n.style.zIndex="2147483646",n.style.position="fixed",n.style.top="0",n.style.left="0";let r=n.attachShadow({mode:"open"});{let s=document.createElement("style");s.textContent=e,r.appendChild(s);}let o=document.createElement("div");o.setAttribute(Wt,"true"),r.appendChild(o);let i=document.body??document.documentElement;return i.appendChild(n),setTimeout(()=>{i.contains(n)||i.appendChild(n);},1e3),o};var ou="https://react-grab.com",ur=(e,t)=>{let n=t?`&line=${t}`:"";return `${ou}/open-file?url=${encodeURIComponent(e)}${n}`};var dt=(e,t,n)=>e+(t-e)*n;function vs(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=vs(e[t]))&&(r&&(r+=" "),r+=n);}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function _s(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=vs(e))&&(r&&(r+=" "),r+=t);return r}var mo="-",iu=e=>{let t=au(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return {getClassGroupId:s=>{let a=s.split(mo);return a[0]===""&&a.length!==1&&a.shift(),As(a,t)||su(s)},getConflictingClassGroupIds:(s,a)=>{let l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},As=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),o=r?As(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let i=e.join(mo);return t.validators.find(({validator:s})=>s(i))?.classGroupId},Cs=/^\[(.+)\]$/,su=e=>{if(Cs.test(e)){let t=Cs.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return "arbitrary.."+n}},au=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return cu(Object.entries(e.classGroups),n).forEach(([i,s])=>{po(s,r,i,t);}),r},po=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){let i=o===""?t:Ts(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(lu(o)){po(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{po(s,Ts(t,i),n,r);});});},Ts=(e,t)=>{let n=e;return t.split(mo).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r);}),n},lu=e=>e.isThemeGetter,cu=(e,t)=>t?e.map(([n,r])=>{let o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return [n,o]}):e,uu=e=>{if(e<1)return {get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map,o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map);};return {get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s);}}},Is="!",du=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{let l=[],f=0,d=0,u;for(let _=0;_<a.length;_++){let I=a[_];if(f===0){if(I===o&&(r||a.slice(_,_+i)===t)){l.push(a.slice(d,_)),d=_+i;continue}if(I==="/"){u=_;continue}}I==="["?f++:I==="]"&&f--;}let p=l.length===0?a:a.substring(d),m=p.startsWith(Is),g=m?p.substring(1):p,y=u&&u>d?u-d:void 0;return {modifiers:l,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}};return n?a=>n({className:a,parseClassName:s}):s},fu=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r);}),t.push(...n.sort()),t},pu=e=>({cache:uu(e.cacheSize),parseClassName:du(e),...iu(e)}),mu=/\s+/,gu=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(mu),a="";for(let l=s.length-1;l>=0;l-=1){let f=s[l],{modifiers:d,hasImportantModifier:u,baseClassName:p,maybePostfixModifierPosition:m}=n(f),g=!!m,y=r(g?p.substring(0,m):p);if(!y){if(!g){a=f+(a.length>0?" "+a:a);continue}if(y=r(p),!y){a=f+(a.length>0?" "+a:a);continue}g=false;}let _=fu(d).join(":"),I=u?_+Is:_,T=I+y;if(i.includes(T))continue;i.push(T);let v=o(y,g);for(let Z=0;Z<v.length;++Z){let Q=v[Z];i.push(I+Q);}a=f+(a.length>0?" "+a:a);}return a};function hu(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=ks(t))&&(r&&(r+=" "),r+=n);return r}var ks=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=ks(e[r]))&&(n&&(n+=" "),n+=t);return n};function bu(e,...t){let n,r,o,i=s;function s(l){let f=t.reduce((d,u)=>u(d),e());return n=pu(f),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){let f=r(l);if(f)return f;let d=gu(l,n);return o(l,d),d}return function(){return i(hu.apply(null,arguments))}}var be=e=>{let t=n=>n[e]||[];return t.isThemeGetter=true,t},Os=/^\[(?:([a-z-]+):)?(.+)\]$/i,yu=/^\d+\/\d+$/,wu=new Set(["px","full","screen"]),Eu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Su=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,xu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,vu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_u=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,nt=e=>Yt(e)||wu.has(e)||yu.test(e),ft=e=>qt(e,"length",Mu),Yt=e=>!!e&&!Number.isNaN(Number(e)),fo=e=>qt(e,"number",Yt),_n=e=>!!e&&Number.isInteger(Number(e)),Cu=e=>e.endsWith("%")&&Yt(e.slice(0,-1)),ee=e=>Os.test(e),pt=e=>Eu.test(e),Tu=new Set(["length","size","percentage"]),Au=e=>qt(e,Tu,Rs),Iu=e=>qt(e,"position",Rs),ku=new Set(["image","url"]),Ou=e=>qt(e,ku,Lu),Ru=e=>qt(e,"",Nu),Cn=()=>true,qt=(e,t,n)=>{let r=Os.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):false},Mu=e=>Su.test(e)&&!xu.test(e),Rs=()=>false,Nu=e=>vu.test(e),Lu=e=>_u.test(e);var Pu=()=>{let e=be("colors"),t=be("spacing"),n=be("blur"),r=be("brightness"),o=be("borderColor"),i=be("borderRadius"),s=be("borderSpacing"),a=be("borderWidth"),l=be("contrast"),f=be("grayscale"),d=be("hueRotate"),u=be("invert"),p=be("gap"),m=be("gradientColorStops"),g=be("gradientColorStopPositions"),y=be("inset"),_=be("margin"),I=be("opacity"),T=be("padding"),v=be("saturate"),Z=be("scale"),Q=be("sepia"),Y=be("skew"),we=be("space"),Ee=be("translate"),ve=()=>["auto","contain","none"],me=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto",ee,t],S=()=>[ee,t],h=()=>["",nt,ft],w=()=>["auto",Yt,ee],A=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],$=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],L=()=>["start","end","center","between","around","evenly","stretch"],E=()=>["","0",ee],P=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>[Yt,ee];return {cacheSize:500,separator:":",theme:{colors:[Cn],spacing:[nt,ft],blur:["none","",pt,ee],brightness:M(),borderColor:[e],borderRadius:["none","","full",pt,ee],borderSpacing:S(),borderWidth:h(),contrast:M(),grayscale:E(),hueRotate:M(),invert:E(),gap:S(),gradientColorStops:[e],gradientColorStopPositions:[Cu,ft],inset:C(),margin:C(),opacity:M(),padding:S(),saturate:M(),scale:M(),sepia:E(),skew:M(),space:S(),translate:S()},classGroups:{aspect:[{aspect:["auto","square","video",ee]}],container:["container"],columns:[{columns:[pt]}],"break-after":[{"break-after":P()}],"break-before":[{"break-before":P()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...A(),ee]}],overflow:[{overflow:me()}],"overflow-x":[{"overflow-x":me()}],"overflow-y":[{"overflow-y":me()}],overscroll:[{overscroll:ve()}],"overscroll-x":[{"overscroll-x":ve()}],"overscroll-y":[{"overscroll-y":ve()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",_n,ee]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",ee]}],grow:[{grow:E()}],shrink:[{shrink:E()}],order:[{order:["first","last","none",_n,ee]}],"grid-cols":[{"grid-cols":[Cn]}],"col-start-end":[{col:["auto",{span:["full",_n,ee]},ee]}],"col-start":[{"col-start":w()}],"col-end":[{"col-end":w()}],"grid-rows":[{"grid-rows":[Cn]}],"row-start-end":[{row:["auto",{span:[_n,ee]},ee]}],"row-start":[{"row-start":w()}],"row-end":[{"row-end":w()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",ee]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",ee]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...L()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...L(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...L(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[T]}],px:[{px:[T]}],py:[{py:[T]}],ps:[{ps:[T]}],pe:[{pe:[T]}],pt:[{pt:[T]}],pr:[{pr:[T]}],pb:[{pb:[T]}],pl:[{pl:[T]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[we]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[we]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",ee,t]}],"min-w":[{"min-w":[ee,t,"min","max","fit"]}],"max-w":[{"max-w":[ee,t,"none","full","min","max","fit","prose",{screen:[pt]},pt]}],h:[{h:[ee,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[ee,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[ee,t,"auto","min","max","fit"]}],"font-size":[{text:["base",pt,ft]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fo]}],"font-family":[{font:[Cn]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",ee]}],"line-clamp":[{"line-clamp":["none",Yt,fo]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",nt,ee]}],"list-image":[{"list-image":["none",ee]}],"list-style-type":[{list:["none","disc","decimal",ee]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[I]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...$(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",nt,ft]}],"underline-offset":[{"underline-offset":["auto",nt,ee]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:S()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[I]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...A(),Iu]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Au]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Ou]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[I]}],"border-style":[{border:[...$(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[I]}],"divide-style":[{divide:$()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...$()]}],"outline-offset":[{"outline-offset":[nt,ee]}],"outline-w":[{outline:[nt,ft]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:h()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[I]}],"ring-offset-w":[{"ring-offset":[nt,ft]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",pt,Ru]}],"shadow-color":[{shadow:[Cn]}],opacity:[{opacity:[I]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",pt,ee]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[u]}],saturate:[{saturate:[v]}],sepia:[{sepia:[Q]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[u]}],"backdrop-opacity":[{"backdrop-opacity":[I]}],"backdrop-saturate":[{"backdrop-saturate":[v]}],"backdrop-sepia":[{"backdrop-sepia":[Q]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",ee]}],duration:[{duration:M()}],ease:[{ease:["linear","in","out","in-out",ee]}],delay:[{delay:M()}],animate:[{animate:["none","spin","ping","pulse","bounce",ee]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[Z]}],"scale-x":[{"scale-x":[Z]}],"scale-y":[{"scale-y":[Z]}],rotate:[{rotate:[_n,ee]}],"translate-x":[{"translate-x":[Ee]}],"translate-y":[{"translate-y":[Ee]}],"skew-x":[{"skew-x":[Y]}],"skew-y":[{"skew-y":[Y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",ee]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ee]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":S()}],"scroll-mx":[{"scroll-mx":S()}],"scroll-my":[{"scroll-my":S()}],"scroll-ms":[{"scroll-ms":S()}],"scroll-me":[{"scroll-me":S()}],"scroll-mt":[{"scroll-mt":S()}],"scroll-mr":[{"scroll-mr":S()}],"scroll-mb":[{"scroll-mb":S()}],"scroll-ml":[{"scroll-ml":S()}],"scroll-p":[{"scroll-p":S()}],"scroll-px":[{"scroll-px":S()}],"scroll-py":[{"scroll-py":S()}],"scroll-ps":[{"scroll-ps":S()}],"scroll-pe":[{"scroll-pe":S()}],"scroll-pt":[{"scroll-pt":S()}],"scroll-pr":[{"scroll-pr":S()}],"scroll-pb":[{"scroll-pb":S()}],"scroll-pl":[{"scroll-pl":S()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ee]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[nt,ft,fo]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var Ms=bu(Pu);var De=(...e)=>Ms(_s(e));var $u=X("<div style=overflow:visible>"),St=e=>{let[t,n]=z(e.bounds.x),[r,o]=z(e.bounds.y),[i,s]=z(e.bounds.width),[a,l]=z(e.bounds.height),[f,d]=z(1),u=false,p=null,m=null,g=e.bounds,y=false,_=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,I=()=>{if(y)return;y=true;let T=()=>{let v=dt(t(),g.x,_()),Z=dt(r(),g.y,_()),Q=dt(i(),g.width,_()),Y=dt(a(),g.height,_());n(v),o(Z),s(Q),l(Y),Math.abs(v-g.x)<.5&&Math.abs(Z-g.y)<.5&&Math.abs(Q-g.width)<.5&&Math.abs(Y-g.height)<.5?(p=null,y=false):p=requestAnimationFrame(T);};p=requestAnimationFrame(T);};return te($e(()=>e.bounds,T=>{if(g=T,!u){n(g.x),o(g.y),s(g.width),l(g.height),u=true;return}I();})),te(()=>{e.variant==="grabbed"&&e.createdAt&&(m=window.setTimeout(()=>{d(0);},1700));}),le(()=>{p!==null&&(cancelAnimationFrame(p),p=null),m!==null&&(window.clearTimeout(m),m=null),y=false;}),N(re,{get when(){return e.visible!==false},get children(){var T=$u();return oe(v=>{var Z=De("fixed box-border",e.variant==="drag"&&"pointer-events-none",e.variant!=="drag"&&"pointer-events-auto",e.variant==="grabbed"&&"z-2147483645",e.variant!=="grabbed"&&"z-2147483646",e.variant==="drag"&&"border border-solid border-grab-purple/40 bg-grab-purple/5 will-change-[transform,width,height] cursor-crosshair",e.variant==="selection"&&"border border-solid border-grab-purple/50 bg-grab-purple/8 transition-opacity duration-100 ease-out",e.variant==="grabbed"&&"border border-solid border-grab-purple/50 bg-grab-purple/8",e.variant==="processing"&&!e.isCompleted&&"border border-solid border-grab-purple/50 bg-grab-purple/8",e.variant==="processing"&&e.isCompleted&&"border border-solid border-grab-purple/50 bg-grab-purple/8"),Q=`${r()}px`,Y=`${t()}px`,we=`${i()}px`,Ee=`${a()}px`,ve=e.bounds.borderRadius,me=e.bounds.transform,C=e.isFading?0:f(),S=e.variant==="drag"?"layout paint size":void 0;return Z!==v.e&&Ge(T,v.e=Z),Q!==v.t&&Ce(T,"top",v.t=Q),Y!==v.a&&Ce(T,"left",v.a=Y),we!==v.o&&Ce(T,"width",v.o=we),Ee!==v.i&&Ce(T,"height",v.i=Ee),ve!==v.n&&Ce(T,"border-radius",v.n=ve),me!==v.s&&Ce(T,"transform",v.s=me),C!==v.h&&Ce(T,"opacity",v.h=C),S!==v.r&&Ce(T,"contain",v.r=S),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0}),T}})};var Ns=e=>{let t=e.lerpFactor??.3,n=e.convergenceThreshold??.5,[r,o]=z(e.x()),[i,s]=z(e.y()),a=e.x(),l=e.y(),f=null,d=false,u=()=>{let m=dt(r(),a,t),g=dt(i(),l,t);o(m),s(g),Math.abs(m-a)<n&&Math.abs(g-l)<n?f=null:f=requestAnimationFrame(u);},p=()=>{f===null&&(f=requestAnimationFrame(u));};return te(()=>{if(a=e.x(),l=e.y(),!d){o(a),s(l),d=true;return}p();}),le(()=>{f!==null&&(cancelAnimationFrame(f),f=null);}),{x:r,y:i}};var Bu=X("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),Fu="rgba(210, 57, 192)",Uu=.3,Ls=e=>{let t,n=null,r=0,o=0,i=1,s=Ns({x:()=>e.mouseX,y:()=>e.mouseY,lerpFactor:Uu}),a=()=>{t&&(i=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,o=window.innerHeight,t.width=r*i,t.height=o*i,t.style.width=`${r}px`,t.style.height=`${o}px`,n=t.getContext("2d"),n&&n.scale(i,i));},l=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle=Fu,n.lineWidth=1,n.beginPath(),n.moveTo(s.x(),0),n.lineTo(s.x(),o),n.moveTo(0,s.y()),n.lineTo(r,s.y()),n.stroke());};return te(()=>{a(),l();let f=()=>{a(),l();};window.addEventListener("resize",f),le(()=>{window.removeEventListener("resize",f);});}),te(()=>{s.x(),s.y(),l();}),N(re,{get when(){return e.visible!==false},get children(){var f=Bu(),d=t;return typeof d=="function"?We(d,f):t=f,f}})};var Hu=X('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 19"fill=none><path d="M6.76263 18.6626C7.48251 18.6626 7.95474 18.1682 7.95474 17.4895C7.95474 17.1207 7.80474 16.8576 7.58683 16.6361L5.3018 14.4137L2.84621 12.3589L2.44374 13.0037L5.92137 13.1622H17.9232C20.4842 13.1622 21.593 12.021 21.593 9.47237V3.66983C21.593 1.10875 20.4842 0 17.9232 0H12.5414C11.8179 0 11.3018 0.545895 11.3018 1.21695C11.3018 1.888 11.8179 2.43389 12.5414 2.43389H17.8424C18.7937 2.43389 19.1897 2.83653 19.1897 3.78784V9.35747C19.1897 10.3257 18.7937 10.7314 17.8424 10.7314H5.92137L2.44374 10.8832L2.84621 11.5281L5.3018 9.47993L7.58683 7.2606C7.80474 7.03914 7.95474 6.7693 7.95474 6.40049C7.95474 5.72854 7.48251 5.22747 6.76263 5.22747C6.46129 5.22747 6.12975 5.36905 5.89231 5.6096L0.376815 11.0425C0.134921 11.2777 0 11.6141 0 11.9452C0 12.2728 0.134921 12.6158 0.376815 12.848L5.89231 18.2871C6.12975 18.5276 6.46129 18.6626 6.76263 18.6626Z"fill=currentColor>'),xt=e=>{let t=()=>e.size??12;return (()=>{var n=Hu();return oe(r=>{var o=t(),i=t()*19/22,s=e.class;return o!==r.e&&he(n,"width",r.e=o),i!==r.t&&he(n,"height",r.t=i),s!==r.a&&he(n,"class",r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})()};var Gu=X('<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">'),Ps=e=>{let t=()=>e.color??"white";return (()=>{var n=Gu();return oe(r=>Ci(n,{left:`${e.leftPx}px`,...e.position==="bottom"?{top:"0",transform:"translateX(-50%) translateY(-100%)"}:{bottom:"0",transform:"translateX(-50%) translateY(100%)"},...e.position==="bottom"?{"border-bottom":`8px solid ${t()}`}:{"border-top":`8px solid ${t()}`}},r)),n})()};var ju=X('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><path d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6"></path><path d="M11 13l9-9"></path><path d="M15 4h5v5">'),Ds=e=>{let t=()=>e.size??12;return (()=>{var n=ju();return oe(r=>{var o=t(),i=t(),s=e.class;return o!==r.e&&he(n,"width",r.e=o),i!==r.t&&he(n,"height",r.t=i),s!==r.a&&he(n,"class",r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})()};var zu=X("<div><span>"),go=e=>{let[t,n]=z(false),r=()=>{n(true),e.onHoverChange?.(true);},o=()=>{n(false),e.onHoverChange?.(false);};return (()=>{var i=zu(),s=i.firstChild;return Xe(i,"click",e.onClick),i.addEventListener("mouseleave",o),i.addEventListener("mouseenter",r),V(s,()=>e.tagName),V(i,N(re,{get when(){return e.isClickable||e.forceShowIcon},get children(){return N(Ds,{size:10,get class(){return De("text-white transition-all duration-100",t()||e.forceShowIcon?"opacity-100 scale-100":"opacity-0 scale-75 -ml-[2px] w-0")}})}}),null),oe(a=>{var l=De("contain-layout flex items-center px-[3px] py-0 h-4 rounded-sm gap-0.5 [border-width:0.5px] border-solid border-black bg-black",e.shrink&&"shrink-0 w-fit",e.isClickable&&"cursor-pointer"),f=De("text-white text-[13px] leading-3.5 shrink-0 w-fit h-fit font-medium");return l!==a.e&&Ge(i,a.e=l),f!==a.t&&Ge(s,a.t=f),a},{e:void 0,t:void 0}),i})()};Pe(["click"]);var Vu=X("<span class=text-black/50>"),Ku=X('<div role=button><div class="text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit"><span class=text-black>'),ho=e=>{let t=()=>e.hasAgent?e.isEditing?null:"Right click to ":"Click to ",n=()=>e.hasAgent?e.isEditing?"Editing":"Edit":"Copy";return (()=>{var r=Ku(),o=r.firstChild,i=o.firstChild;return Xe(r,"click",e.onClick),V(o,N(re,{get when(){return t()},get children(){var s=Vu();return V(s,t),s}}),i),V(i,n),oe(()=>Ge(r,De("contain-layout shrink-0 flex items-center px-0 py-px w-fit h-[18px] rounded-sm gap-[3px]",e.asButton&&"cursor-pointer",e.dimmed&&"opacity-50 hover:opacity-100 transition-opacity"))),r})()};Pe(["click"]);var Xu=X('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-[5px] w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] antialiased rounded-t-none rounded-b-sm -mt-px">'),Je=e=>(()=>{var t=Xu();return Ce(t,"background-image",gs),V(t,()=>e.children),t})();var dr=null,Fe={claim:e=>{dr=e;},release:e=>{dr===e&&(dr=null);},isActive:e=>dr===e};var Wu=X('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">No</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Yes'),Yu=X('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Discard?'),bo=e=>{let t=Symbol(),n=o=>{Fe.isActive(t)&&(je(o)||(o.code==="Enter"||o.code==="Escape")&&(o.preventDefault(),o.stopPropagation(),e.onConfirm?.()));},r=()=>{Fe.claim(t);};return Ve(()=>{Fe.claim(t),window.addEventListener("keydown",n,{capture:true});}),le(()=>{Fe.release(t),window.removeEventListener("keydown",n,{capture:true});}),(()=>{var o=Yu();o.firstChild;return o.$$click=r,o.$$pointerdown=r,V(o,N(Je,{get children(){var s=Wu(),a=s.firstChild,l=a.nextSibling;l.firstChild;return Xe(a,"click",e.onCancel),Xe(l,"click",e.onConfirm),V(l,N(xt,{size:10,class:"text-[#c00002]"}),null),s}}),null),o})()};Pe(["pointerdown","click"]);var qu=X('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4C7.58 4 4.01 7.58 4.01 12C4.01 16.42 7.58 20 12 20C15.73 20 18.84 17.45 19.73 14H17.65C16.83 16.33 14.61 18 12 18C8.69 18 6 15.31 6 12C6 8.69 8.69 6 12 6C13.66 6 15.14 6.69 16.22 7.78L13 11H20V4L17.65 6.35Z"fill=currentColor>'),$s=e=>{let t=()=>e.size??12;return (()=>{var n=qu();return oe(r=>{var o=t(),i=t(),s=e.class;return o!==r.e&&he(n,"width",r.e=o),i!==r.t&&he(n,"height",r.t=i),s!==r.a&&he(n,"class",r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})()};var Zu=X('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Retry</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Ok'),Ju=X('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-[#B91C1C] text-[13px] leading-4 font-sans font-medium">'),Fs=e=>{let t=Symbol(),n=i=>{Fe.isActive(t)&&(je(i)||(i.code==="Enter"?(i.preventDefault(),i.stopPropagation(),e.onRetry?.()):i.code==="Escape"&&(i.preventDefault(),i.stopPropagation(),e.onAcknowledge?.())));},r=()=>{Fe.claim(t);},o=()=>{let i=e.error;return i.length<=50?i:`${i.slice(0,50)}\u2026`};return Ve(()=>{Fe.claim(t),window.addEventListener("keydown",n,{capture:true});}),le(()=>{Fe.release(t),window.removeEventListener("keydown",n,{capture:true});}),(()=>{var i=Ju(),s=i.firstChild,a=s.firstChild;return i.$$click=r,i.$$pointerdown=r,V(a,o),V(i,N(Je,{get children(){var l=Zu(),f=l.firstChild;f.firstChild;var u=f.nextSibling;return Xe(f,"click",e.onRetry),V(f,N($s,{size:10,class:"text-black/50"}),null),Xe(u,"click",e.onAcknowledge),l}}),null),oe(()=>he(a,"title",e.error)),i})()};Pe(["pointerdown","click"]);var Qu=X('<button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Undo'),ed=X('<button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">'),td=X('<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums"></span><div class="contain-layout shrink-0 flex items-center gap-[5px] h-fit">'),nd=X('<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums">'),rd=X('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">'),od=X('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col justify-center items-end rounded-sm bg-white antialiased w-fit h-fit max-w-[280px]">'),Us=e=>{let t=Symbol(),n,[r,o]=z(false),[i,s]=z(e.statusText),[a,l]=z(""),f=()=>{o(true),s("Copied"),e.onCopyStateChange?.(),setTimeout(()=>{e.onDismiss?.();},1500);},d=()=>{let g=a().trim();g&&e.onFollowUpSubmit&&e.onFollowUpSubmit(g);},u=g=>{g.code==="KeyZ"&&(g.metaKey||g.ctrlKey)||(g.stopPropagation(),g.stopImmediatePropagation()),g.code==="Enter"&&!g.shiftKey?(g.preventDefault(),a().trim()?d():f()):g.code==="Escape"&&(g.preventDefault(),f());},p=g=>{if(!Fe.isActive(t))return;if(g.code==="KeyZ"&&(g.metaKey||g.ctrlKey)&&!g.shiftKey&&e.supportsUndo&&e.onUndo){g.preventDefault(),g.stopPropagation(),e.onUndo();return}je(g)||(g.code==="Enter"||g.code==="Escape")&&(g.preventDefault(),g.stopPropagation(),f());},m=()=>{Fe.claim(t);};return te(()=>{r()||s(e.statusText);}),Ve(()=>{Fe.claim(t),window.addEventListener("keydown",p,{capture:true}),e.supportsFollowUp&&e.onFollowUpSubmit&&n&&n.focus();}),le(()=>{Fe.release(t),window.removeEventListener("keydown",p,{capture:true});}),(()=>{var g=od();return g.$$click=m,g.$$pointerdown=m,V(g,N(re,{get when(){return xe(()=>!r())()&&(e.onDismiss||e.onUndo)},get children(){var y=td(),_=y.firstChild,I=_.nextSibling;return V(_,i),V(I,N(re,{get when(){return xe(()=>!!e.supportsUndo)()&&e.onUndo},get children(){var T=Qu();return T.$$click=()=>e.onUndo?.(),T}}),null),V(I,N(re,{get when(){return e.onDismiss},get children(){var T=ed(),v=T.firstChild;return T.$$click=f,V(v,()=>e.dismissButtonText??"Keep"),V(T,N(re,{get when(){return !r()},get children(){return N(xt,{size:10,class:"text-black/50"})}}),null),oe(()=>T.disabled=r()),T}}),null),y}}),null),V(g,N(re,{get when(){return r()||!e.onDismiss&&!e.onUndo},get children(){var y=nd(),_=y.firstChild;return V(_,i),y}}),null),V(g,N(re,{get when(){return xe(()=>!!(!r()&&e.supportsFollowUp))()&&e.onFollowUpSubmit},get children(){return N(Je,{get children(){var y=rd(),_=y.firstChild,I=_.nextSibling;_.$$keydown=u,_.$$input=v=>l(v.target.value);var T=n;return typeof T=="function"?We(T,_):n=_,I.$$click=d,V(I,N(xt,{size:10,class:"opacity-[0.99] text-black"})),oe(()=>he(_,"placeholder",e.previousPrompt??"type follow-up")),oe(()=>_.value=a()),y}})}}),null),g})()};Pe(["pointerdown","click","input","keydown"]);var sd=X('<button data-react-grab-ignore-events class="contain-layout shrink-0 flex flex-col items-start rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] p-1 size-fit cursor-pointer ml-1 transition-none hover:scale-105"><div data-react-grab-ignore-events class="shrink-0 w-[7px] h-[7px] rounded-[1px] bg-black pointer-events-none">'),ad=X('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 opacity-50 wrap-break-word overflow-y-auto"placeholder="type to edit"rows=1 disabled style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>'),ld=X('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-auto h-fit"><div class="contain-layout flex items-center px-0 py-px w-auto h-fit rounded-sm gap-[3px]"><span class="text-[13px] leading-4 font-sans font-medium w-auto h-fit whitespace-normal text-[#71717a] animate-pulse tabular-nums">'),cd=X('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">'),ud=X('<div class="shrink-0 flex items-center gap-0.5 w-full mb-0.5 overflow-hidden"><span class="text-[#a1a1aa] text-[10px] leading-3 shrink-0">>previously:</span><span class="text-[#a1a1aa] text-[10px] leading-3 italic truncate whitespace-nowrap">'),dd=X('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="type prompt"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">'),fd=X('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">'),pd=X('<div data-react-grab-ignore-events class="fixed font-sans text-[13px] antialiased transition-opacity duration-300 ease-out filter-[drop-shadow(0px_0px_4px_#51515180)] select-none"style=z-index:2147483647><div class="[font-synthesis:none] contain-layout flex items-center gap-[5px] rounded-sm bg-white antialiased w-fit h-fit p-0">'),_t=e=>{let t,n,r=false,o=null,i=null,[s,a]=z(0),[l,f]=z(0),[d,u]=z("bottom"),[p,m]=z(0),[g,y]=z(false),[_,I]=z(false),T=()=>e.status!=="copying"&&e.status!=="copied"&&e.status!=="fading",v=()=>{if(t&&!r){let E=t.getBoundingClientRect();a(E.width),f(E.height);}},Z=E=>{r=E;},Q=()=>{m(E=>E+1);},Y,we=()=>{y(false),Y&&clearTimeout(Y),Y=setTimeout(()=>{y(true);},400);},Ee=E=>{je(E)||(E.code==="Enter"&&g()&&!e.isInputMode&&T()?(E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation(),e.onToggleExpand?.()):E.code==="KeyC"&&E.ctrlKey&&e.status==="copying"&&e.onAbort&&(E.preventDefault(),E.stopPropagation(),E.stopImmediatePropagation(),e.onAbort()));};Ve(()=>{v(),window.addEventListener("scroll",Q,true),window.addEventListener("resize",Q),window.addEventListener("keydown",Ee,{capture:true}),we();}),le(()=>{window.removeEventListener("scroll",Q,true),window.removeEventListener("resize",Q),window.removeEventListener("keydown",Ee,{capture:true}),Y&&clearTimeout(Y);}),te(()=>{let E=`${e.tagName??""}:${e.componentName??""}`;E!==i&&(i=E,we());}),te(()=>{e.tagName,e.componentName,e.elementsCount,e.statusText,e.inputValue,e.hasAgent,e.isInputMode,e.isPendingDismiss,e.error,e.isPendingAbort,requestAnimationFrame(v);}),te(()=>{e.visible&&requestAnimationFrame(v);}),te(()=>{e.status,requestAnimationFrame(v);}),te(()=>{e.isInputMode&&n&&setTimeout(()=>{n?.focus();},0);});let ve=()=>{p();let E=e.selectionBounds,P=s(),M=l(),D=P>0&&M>0,W=E&&E.width>0&&E.height>0;if(!D||!W)return o??{left:-9999,top:-9999,arrowLeft:0};let F=window.innerWidth,U=window.innerHeight,ae=E.x+E.width/2,k=e.mouseX??ae,G=E.y+E.height,q=E.y,K=k-P/2,pe=G+8+4;K+P>F-8&&(K=F-P-8),K<8&&(K=8);let Se=M+8+4;pe+M<=U-8?u("bottom"):(pe=q-Se,u("top")),pe<8&&(pe=8);let fe=Math.max(12,Math.min(k-K,P-12)),se={left:K,top:pe,arrowLeft:fe};return o=se,I(true),se},me=E=>{E.stopPropagation(),E.stopImmediatePropagation(),E.code==="Enter"&&!E.shiftKey?(E.preventDefault(),e.onSubmit?.()):E.code==="Escape"&&(E.preventDefault(),e.onConfirmDismiss?.());},C=E=>{let P=E.target;e.onInputChange?.(P.value);},S=()=>e.elementsCount&&e.elementsCount>1?`${e.elementsCount} elements`:e.componentName&&e.tagName?`${e.componentName}.${e.tagName}`:e.componentName||e.tagName||"element",h=E=>{E.stopPropagation(),E.stopImmediatePropagation(),e.filePath&&e.onOpen&&e.onOpen();},w=()=>!!(e.filePath&&e.onOpen),A=E=>{E.stopPropagation(),E.stopImmediatePropagation();},$=E=>{A(E),T()&&e.isInputMode&&!e.isPendingDismiss&&n&&n.focus();},B=()=>{e.onSubmit?.();},L=()=>_()&&(e.status==="copied"||e.status==="fading");return N(re,{get when(){return xe(()=>e.visible!==false)()&&(e.selectionBounds||L())},get children(){var E=pd(),P=E.firstChild;E.$$click=A,E.$$mousedown=A,E.$$pointerdown=$;var M=t;return typeof M=="function"?We(M,E):t=E,V(E,N(Ps,{get position(){return d()},get leftPx(){return ve().arrowLeft}}),P),V(E,N(re,{get when(){return xe(()=>e.status==="copied"||e.status==="fading")()&&!e.error},get children(){return N(Us,{get statusText(){return xe(()=>!!e.hasAgent)()?e.statusText??"Completed":"Copied"},get supportsUndo(){return e.supportsUndo},get supportsFollowUp(){return e.supportsFollowUp},get dismissButtonText(){return e.dismissButtonText},get previousPrompt(){return e.previousPrompt},get onDismiss(){return e.onDismiss},get onUndo(){return e.onUndo},get onFollowUpSubmit(){return e.onFollowUpSubmit},onCopyStateChange:()=>requestAnimationFrame(v)})}}),P),V(P,N(re,{get when(){return xe(()=>e.status==="copying")()&&!e.isPendingAbort},get children(){var D=ld(),W=D.firstChild,F=W.firstChild,U=F.firstChild;return V(U,()=>e.statusText??"Grabbing\u2026"),V(D,N(Je,{get children(){var ae=ad(),k=ae.firstChild,G=n;return typeof G=="function"?We(G,k):n=k,V(ae,N(re,{get when(){return e.onAbort},get children(){var q=sd();return q.$$click=K=>{K.stopPropagation(),e.onAbort?.();},q.$$pointerup=K=>{K.stopPropagation(),e.onAbort?.();},q.$$mousedown=K=>K.stopPropagation(),q.$$pointerdown=K=>K.stopPropagation(),q}}),null),oe(()=>k.value=e.inputValue??""),ae}}),null),D}}),null),V(P,N(re,{get when(){return xe(()=>e.status==="copying")()&&e.isPendingAbort},get children(){return N(bo,{get onConfirm(){return e.onConfirmAbort},get onCancel(){return e.onCancelAbort}})}}),null),V(P,N(re,{get when(){return xe(()=>!!T())()&&!e.isInputMode},get children(){var D=cd(),W=D.firstChild;return V(W,N(go,{get tagName(){return S()},get isClickable(){return w()},onClick:h,onHoverChange:Z,shrink:true})),V(D,N(Je,{get children(){return N(ho,{onClick:B,shrink:true,get hasAgent(){return e.hasAgent}})}}),null),D}}),null),V(P,N(re,{get when(){return xe(()=>!!(T()&&e.isInputMode))()&&!e.isPendingDismiss},get children(){var D=fd(),W=D.firstChild;return V(W,N(ho,{onClick:B,dimmed:true,shrink:true,get hasAgent(){return e.hasAgent},isEditing:true}),null),V(W,N(go,{get tagName(){return S()},get isClickable(){return w()},onClick:h,onHoverChange:Z,shrink:true,forceShowIcon:true}),null),V(D,N(Je,{get children(){return [N(re,{get when(){return e.replyToPrompt},get children(){var F=ud(),U=F.firstChild,ae=U.nextSibling;return V(ae,()=>e.replyToPrompt),F}}),(()=>{var F=dd(),U=F.firstChild,ae=U.nextSibling;U.$$keydown=me,U.$$input=C;var k=n;return typeof k=="function"?We(k,U):n=U,ae.$$click=B,V(ae,N(xt,{size:10,class:"opacity-[0.99] text-black"})),oe(()=>U.value=e.inputValue??""),F})()]}}),null),D}}),null),V(P,N(re,{get when(){return e.isPendingDismiss},get children(){return N(bo,{get onConfirm(){return e.onConfirmDismiss},get onCancel(){return e.onCancelDismiss}})}}),null),V(P,N(re,{get when(){return e.error},get children(){return N(Fs,{get error(){return e.error},get onAcknowledge(){return e.onAcknowledgeError},get onRetry(){return e.onRetry}})}}),null),oe(D=>{var W=`${ve().top}px`,F=`${ve().left}px`,U=e.isInputMode||e.status==="copied"&&e.onDismiss||e.status==="copying"&&e.onAbort?"auto":"none",ae=e.status==="fading"?0:1,k=(e.status==="copied"||e.status==="fading")&&!e.error?"none":void 0;return W!==D.e&&Ce(E,"top",D.e=W),F!==D.t&&Ce(E,"left",D.t=F),U!==D.a&&Ce(E,"pointer-events",D.a=U),ae!==D.o&&Ce(E,"opacity",D.o=ae),k!==D.i&&Ce(P,"display",D.i=k),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),E}})};Pe(["pointerdown","mousedown","click","pointerup","input","keydown"]);var gd=X('<div class="fixed z-2147483647"><button data-react-grab-selection-cursor>'),js=e=>{let[t,n]=z(false),[r,o]=z(false);te(()=>{let s=e.visible!==false;if(e.x,e.y,o(false),s){let a=setTimeout(()=>o(true),500);le(()=>clearTimeout(a));}}),te(()=>{if(!r()||!e.onEnter)return;let s=a=>{je(a)||!(a.code==="Enter"||a.code==="NumpadEnter")||(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),e.onEnter?.());};window.addEventListener("keydown",s,true),le(()=>{window.removeEventListener("keydown",s,true);});});let i=s=>{s.preventDefault(),s.stopPropagation(),e.onClick?.();};return N(re,{get when(){return r()},get children(){return [N(re,{get when(){return xe(()=>!!t())()&&e.elementBounds},get children(){return N(St,{variant:"selection",get bounds(){return e.elementBounds},visible:true})}}),(()=>{var s=gd(),a=s.firstChild;return s.addEventListener("mouseleave",()=>n(false)),s.addEventListener("mouseenter",()=>n(true)),a.$$click=i,oe(l=>{var f=`${e.x}px`,d=`${e.y}px`,u=De("absolute left-0 top-0 -translate-x-1/2 -translate-y-1/2 bg-grab-pink cursor-pointer rounded-full transition-[width,height] duration-150",t()?"w-1 h-5.5 brightness-125":"w-0.5 h-5 animate-pulse");return f!==l.e&&Ce(s,"left",l.e=f),d!==l.t&&Ce(s,"top",l.t=d),u!==l.a&&Ge(a,l.a=u),l},{e:void 0,t:void 0,a:void 0}),s})(),N(re,{get when(){return xe(()=>!!t())()&&e.elementBounds},get children(){return N(_t,{get tagName(){return e.tagName},get componentName(){return e.componentName},get selectionBounds(){return e.elementBounds},get mouseX(){return e.x},visible:true,get onSubmit(){return e.onClick}})}})]}})};Pe(["click"]);var zs="react-grab-toolbar-state",Vs=()=>{try{let e=localStorage.getItem(zs);if(e)return JSON.parse(e)}catch{}return null},fr=e=>{try{localStorage.setItem(zs,JSON.stringify(e));}catch{}};var hd=X('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 18"fill=currentColor><path opacity=0.4 d="M7.65631 10.9565C7.31061 10.0014 7.54012 8.96635 8.25592 8.25195C8.74522 7.76615 9.38771 7.49951 10.0694 7.49951C10.3682 7.49951 10.6641 7.55171 10.9483 7.65381L16.0001 9.49902V4.75C16.0001 3.2334 14.7667 2 13.2501 2H4.75012C3.23352 2 2.00012 3.2334 2.00012 4.75V13.25C2.00012 14.7666 3.23352 16 4.75012 16H9.49962L7.65631 10.9565Z"></path><path d="M17.296 11.5694L10.4415 9.06545C10.0431 8.92235 9.61441 9.01658 9.31551 9.31338C9.01671 9.61168 8.92101 10.0429 9.06551 10.4413L11.5704 17.2948C11.7247 17.7191 12.128 18.0004 12.5772 18.0004C12.585 18.0004 12.5918 17.9999 12.5987 17.9999C13.0577 17.9906 13.4591 17.6913 13.5987 17.2543L14.4854 14.4857L17.2559 13.5985C17.6914 13.4589 17.9903 13.057 18 12.599C18.0097 12.141 17.7267 11.7276 17.296 11.5694Z">'),Ks=e=>{let t=()=>e.size??14;return (()=>{var n=hd();return oe(r=>{var o=t(),i=t(),s=e.class;return o!==r.e&&he(n,"width",r.e=o),i!==r.t&&he(n,"height",r.t=i),s!==r.a&&he(n,"class",r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})()};var bd=X('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round><path d="m18 15-6-6-6 6">'),Xs=e=>{let t=()=>e.size??12;return (()=>{var n=bd();return oe(r=>{var o=t(),i=t(),s=e.class;return o!==r.e&&he(n,"width",r.e=o),i!==r.t&&he(n,"height",r.t=i),s!==r.a&&he(n,"class",r.a=s),r},{e:void 0,t:void 0,a:void 0}),n})()};var yd=X('<div data-react-grab-ignore-events style=z-index:2147483647><div><div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105"></button></div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105">'),ye=16,Ws=768,Ys=500,wd=5,qs=150,Zs=14,Js=e=>{let t,[n,r]=z(window.innerWidth<Ws),[o,i]=z(false),[s,a]=z(false),[l,f]=z(false),[d,u]=z(false),[p,m]=z(false),[g,y]=z("bottom"),[_,I]=z(.5),[T,v]=z({x:0,y:0}),[Z,Q]=z({x:0,y:0}),[Y,we]=z({x:0,y:0}),[Ee,ve]=z(false),me={x:0,y:0,time:0},C={x:0,y:0},S=(k,G,q,K)=>{let pe=window.innerWidth,Se=window.innerHeight;if(k==="top"||k==="bottom"){let ke=pe-q-ye*2,ze=ye+ke*G,on=k==="top"?ye:Se-K-ye;return {x:ze,y:on}}let ne=Se-K-ye*2,fe=ye+ne*G;return {x:k==="left"?ye:pe-q-ye,y:fe}},h=(k,G,q,K,pe)=>{let Se=window.innerWidth,ne=window.innerHeight;if(k==="top"||k==="bottom"){let se=Se-K-ye*2;return se<=0?.5:Math.max(0,Math.min(1,(G-ye)/se))}let fe=ne-pe-ye*2;return fe<=0?.5:Math.max(0,Math.min(1,(q-ye)/fe))},w=()=>{let k=t?.getBoundingClientRect();if(!k)return;let G=S(g(),_(),k.width,k.height);v(G);},A=false,$=k=>{if(k.stopPropagation(),k.stopImmediatePropagation(),A){A=false;return}e.onToggle?.();},B=k=>{if(k.stopPropagation(),k.stopImmediatePropagation(),A){A=false;return}a(G=>{let q=!G;return fr({edge:g(),ratio:_(),collapsed:q}),q});},L=(k,G,q,K,pe,Se)=>{let ne=window.innerWidth,fe=window.innerHeight,se=k+pe*qs,ke=G+Se*qs,ze=ke+K/2,on=fe-ke-K/2,Mn=se+q/2,sn=ne-se-q/2,Ot=Math.min(ze,on,Mn,sn);return Ot===ze?{edge:"top",x:Math.max(ye,Math.min(se,ne-q-ye)),y:ye}:Ot===Mn?{edge:"left",x:ye,y:Math.max(ye,Math.min(ke,fe-K-ye))}:Ot===sn?{edge:"right",x:ne-q-ye,y:Math.max(ye,Math.min(ke,fe-K-ye))}:{edge:"bottom",x:Math.max(ye,Math.min(se,ne-q-ye)),y:fe-K-ye}},E=k=>{if(s())return;let G=t?.getBoundingClientRect();G&&(C={x:k.clientX,y:k.clientY},Q({x:k.clientX-G.left,y:k.clientY-G.top}),f(true),ve(false),we({x:0,y:0}),me={x:k.clientX,y:k.clientY,time:performance.now()},k.target.setPointerCapture(k.pointerId));},P=k=>{if(!l()||(Math.sqrt(Math.pow(k.clientX-C.x,2)+Math.pow(k.clientY-C.y,2))>wd&&ve(true),!Ee()))return;let q=performance.now(),K=q-me.time;if(K>0){let ne=(k.clientX-me.x)/K,fe=(k.clientY-me.y)/K;we({x:ne,y:fe});}me={x:k.clientX,y:k.clientY,time:q};let pe=k.clientX-Z().x,Se=k.clientY-Z().y;v({x:pe,y:Se});},M=()=>{if(!l())return;let k=Ee();if(f(false),!k)return;A=true;let G=t?.getBoundingClientRect();if(!G)return;let q=Y(),K=L(T().x,T().y,G.width,G.height,q.x,q.y),pe=h(K.edge,K.x,K.y,G.width,G.height);y(K.edge),I(pe),u(true),requestAnimationFrame(()=>{requestAnimationFrame(()=>{v({x:K.x,y:K.y}),fr({edge:K.edge,ratio:pe,collapsed:s()}),setTimeout(()=>{u(false);},300);});});},D=()=>{let k=g(),G=T();return k==="top"?{x:G.x,y:0}:k==="bottom"?{x:G.x,y:window.innerHeight-Zs}:k==="left"?{x:0,y:G.y}:k==="right"?{x:window.innerWidth-Zs,y:G.y}:G},W=()=>{let k=g(),G=s();return k==="top"?G?"rotate-180":"rotate-0":k==="bottom"?G?"rotate-0":"rotate-180":k==="left"?G?"rotate-90":"-rotate-90":k==="right"?G?"-rotate-90":"rotate-90":"rotate-0"},F,U=()=>{r(window.innerWidth<Ws),!l()&&(m(true),i(false),w(),F&&clearTimeout(F),F=setTimeout(()=>{i(true),m(false);},Ys));};Ve(()=>{let k=Vs(),G=t?.getBoundingClientRect();if(k&&G){y(k.edge),I(k.ratio),a(k.collapsed);let K=S(k.edge,k.ratio,G.width,G.height);v(K);}else G&&(v({x:(window.innerWidth-G.width)/2,y:window.innerHeight-G.height-ye}),I(.5));window.addEventListener("resize",U);let q=setTimeout(()=>{i(true);},Ys);le(()=>{clearTimeout(q);});}),le(()=>{window.removeEventListener("resize",U),F&&clearTimeout(F);});let ae=()=>s()?D():T();return n()?null:(()=>{var k=yd(),G=k.firstChild,q=G.firstChild,K=q.firstChild,pe=q.nextSibling;k.$$pointerup=M,k.$$pointermove=P,k.$$pointerdown=E;var Se=t;return typeof Se=="function"?We(Se,k):t=k,G.$$click=ne=>{s()&&(ne.stopPropagation(),a(false),fr({edge:g(),ratio:_(),collapsed:false}));},K.$$click=$,V(K,N(Ks,{size:14,get class(){return De("transition-colors",e.isActive?"text-black":"text-black/70")}})),pe.$$click=B,V(pe,N(Xs,{get class(){return De("text-[#B3B3B3] transition-transform duration-100",W())}})),oe(ne=>{var fe=De("fixed left-0 top-0 font-sans text-[13px] antialiased filter-[drop-shadow(0px_0px_4px_#51515180)] select-none",s()?"cursor-pointer":l()?"cursor-grabbing":"cursor-grab",p()?"":d()?"transition-[transform,opacity] duration-300 ease-out":"transition-opacity duration-300 ease-out",o()?"opacity-100":"opacity-0 pointer-events-none"),se=`translate(${ae().x}px, ${ae().y}px)`,ke=De("[font-synthesis:none] contain-layout flex items-center justify-center rounded-sm bg-white antialiased transition-all duration-100 ease-out",s()?"":"gap-1.5 px-2 py-1.5",s()&&g()==="top"&&"rounded-t-none",s()&&g()==="bottom"&&"rounded-b-none",s()&&g()==="left"&&"rounded-l-none",s()&&g()==="right"&&"rounded-r-none",s()&&(g()==="top"||g()==="bottom")&&"px-2 py-0.25",s()&&(g()==="left"||g()==="right")&&"px-0.25 py-2"),ze=De("flex items-center gap-1.5 transition-all duration-100 ease-out overflow-hidden",s()?"max-w-0 opacity-0":"max-w-[200px] opacity-100");return fe!==ne.e&&Ge(k,ne.e=fe),se!==ne.t&&Ce(k,"transform",ne.t=se),ke!==ne.a&&Ge(G,ne.a=ke),ze!==ne.o&&Ge(q,ne.o=ze),ne},{e:void 0,t:void 0,a:void 0,o:void 0}),k})()};Pe(["pointerdown","pointermove","pointerup","click"]);var Qs=e=>{let t=J(()=>e.agentSessions?Array.from(e.agentSessions.values()):[]),n=J(()=>e.selectionBoundsMultiple&&e.selectionBoundsMultiple.length>0?e.selectionBoundsMultiple:e.selectionBounds?[e.selectionBounds]:[]);return [N(re,{get when(){return e.selectionVisible},get children(){return N(Dt,{get each(){return n()},children:r=>N(St,{variant:"selection",bounds:r,get visible(){return e.selectionVisible},get isFading(){return e.selectionLabelStatus==="fading"}})})}}),N(re,{get when(){return xe(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return N(Ls,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),N(re,{get when(){return xe(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return N(St,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),N(Dt,{get each(){return e.grabbedBoxes??[]},children:r=>N(St,{variant:"grabbed",get bounds(){return r.bounds},get createdAt(){return r.createdAt}})}),N(Hr,{get each(){return t()},children:r=>[N(Dt,{get each(){return r().selectionBounds},children:o=>N(St,{variant:"processing",bounds:o,visible:true,get isCompleted(){return !r().isStreaming}})}),N(re,{get when(){return r().selectionBounds.length>0},get children(){return N(_t,{get tagName(){return r().tagName},get componentName(){return r().componentName},get selectionBounds(){return r().selectionBounds[0]},get mouseX(){return r().position.x},visible:true,hasAgent:true,isAgentConnected:true,get status(){return r().isStreaming?"copying":"copied"},get statusText(){return r().lastStatus||"Thinking\u2026"},get inputValue(){return r().context.prompt},get previousPrompt(){return r().context.prompt},get supportsUndo(){return e.supportsUndo},get supportsFollowUp(){return e.supportsFollowUp},get dismissButtonText(){return e.dismissButtonText},onAbort:()=>e.onAbortSession?.(r().id),get onDismiss(){return r().isStreaming?void 0:()=>e.onDismissSession?.(r().id)},get onUndo(){return r().isStreaming?void 0:()=>e.onUndoSession?.(r().id)},get onFollowUpSubmit(){return r().isStreaming?void 0:o=>e.onFollowUpSubmitSession?.(r().id,o)},get error(){return r().error},onAcknowledgeError:()=>e.onAcknowledgeSessionError?.(r().id),onRetry:()=>e.onRetrySession?.(r().id),get isPendingAbort(){return xe(()=>!!r().isStreaming)()?e.isPendingAgentAbort:false},get onConfirmAbort(){return e.onConfirmAgentAbort},get onCancelAbort(){return e.onCancelAgentAbort}})}})]}),N(re,{get when(){return xe(()=>!!e.selectionLabelVisible)()&&e.selectionBounds},get children(){return N(_t,{get tagName(){return e.selectionTagName},get componentName(){return e.selectionComponentName},get elementsCount(){return e.selectionElementsCount},get selectionBounds(){return e.selectionBounds},get mouseX(){return e.mouseX},get visible(){return e.selectionLabelVisible},get isInputMode(){return e.isInputMode},get inputValue(){return e.inputValue},get replyToPrompt(){return e.replyToPrompt},get hasAgent(){return e.hasAgent},get isAgentConnected(){return e.isAgentConnected},get status(){return e.selectionLabelStatus},get filePath(){return e.selectionFilePath},get lineNumber(){return e.selectionLineNumber},get onInputChange(){return e.onInputChange},get onSubmit(){return e.onInputSubmit},get onCancel(){return e.onInputCancel},get onToggleExpand(){return e.onToggleExpand},get isPendingDismiss(){return e.isPendingDismiss},get onConfirmDismiss(){return e.onConfirmDismiss},get onCancelDismiss(){return e.onCancelDismiss},onOpen:()=>{if(e.selectionFilePath){let r=ur(e.selectionFilePath,e.selectionLineNumber);window.open(r,"_blank");}}})}}),N(Dt,{get each(){return e.labelInstances??[]},children:r=>N(_t,{get tagName(){return r.tagName},get componentName(){return r.componentName},get selectionBounds(){return r.bounds},get mouseX(){return r.mouseX},visible:true,get status(){return r.status}})}),N(re,{get when(){return xe(()=>!!(e.nativeSelectionCursorVisible&&e.nativeSelectionCursorX!==void 0))()&&e.nativeSelectionCursorY!==void 0},get children(){return N(js,{get x(){return e.nativeSelectionCursorX},get y(){return e.nativeSelectionCursorY},get tagName(){return e.nativeSelectionTagName},get componentName(){return e.nativeSelectionComponentName},get elementBounds(){return e.nativeSelectionBounds},get visible(){return e.nativeSelectionCursorVisible},get onClick(){return e.onNativeSelectionCopy},get onEnter(){return e.onNativeSelectionEnter}})}}),N(re,{get when(){return e.toolbarVisible!==false},get children(){return N(Js,{get isActive(){return e.isActive},get onToggle(){return e.onToggleActive}})}})]};var na="0.5.27",gr=`bippy-${na}`,ea=Object.defineProperty,Ed=Object.prototype.hasOwnProperty,Tn=()=>{},ra=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},hr=(e=rt())=>"getFiberRoots"in e,oa=false,ta,An=(e=rt())=>oa?true:(typeof e.inject=="function"&&(ta=e.inject.toString()),!!ta?.includes("(injected)")),pr=new Set,Ct=new Set,ia=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:gr,checkDCE:ra,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Ct.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,pr.forEach(s=>s())),i},on:Tn,onCommitFiberRoot:Tn,onCommitFiberUnmount:Tn,onPostCommitFiberRoot:Tn,renderers:t,supportsFiber:true,supportsFlight:true};try{ea(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(s){if(s&&typeof s=="object"){let a=r.renderers;r=s,a.size>0&&(a.forEach((l,f)=>{Ct.add(l),s.renderers.set(f,l);}),mr(e));}}});let o=window.hasOwnProperty,i=!1;ea(window,"hasOwnProperty",{configurable:!0,value:function(...s){try{if(!i&&s[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,i=!0,-0}catch{}return o.apply(this,s)},writable:!0});}catch{mr(e);}return r},mr=e=>{try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=ra,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=gr,t._instrumentationIsActive=!1;let n=hr(t);if(n||(t.on=Tn),t.renderers.size){t._instrumentationIsActive=!0,pr.forEach(i=>i());return}let r=t.inject,o=An(t);o&&!n&&(oa=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Ct.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,pr.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||An())&&e?.();}catch{}},yo=()=>Ed.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),rt=e=>yo()?(mr(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):ia(e),sa=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),wo=()=>{try{sa()&&rt();}catch{}};var Eo=0,So=1;var xo=5;var vo=11,_o=13;var Co=15,To=16;var Ao=19;var Io=26,ko=27,Oo=28,Ro=30;function Mo(e,t,n=false){if(!e)return null;let r=t(e);if(r instanceof Promise)return (async()=>{if(await r===true)return e;let i=n?e.return:e.child;for(;i;){let s=await Lo(i,t,n);if(s)return s;i=n?null:i.sibling;}return null})();if(r===true)return e;let o=n?e.return:e.child;for(;o;){let i=No(o,t,n);if(i)return i;o=n?null:o.sibling;}return null}var No=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=No(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Lo=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await Lo(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Po=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Po(t.type||t.render):null},In=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=Po(t);return r&&(r.displayName||r.name)||null};var Zt=()=>!!rt()._instrumentationIsActive||hr()||An();var Do=e=>{let t=rt();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null};var kd=Object.create,ma=Object.defineProperty,Od=Object.getOwnPropertyDescriptor,Rd=Object.getOwnPropertyNames,Md=Object.getPrototypeOf,Nd=Object.prototype.hasOwnProperty,Ld=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Pd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Rd(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Nd.call(e,a)&&a!==n&&ma(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=Od(t,a))||r.enumerable});return e},Dd=(e,t,n)=>(n=e==null?{}:kd(Md(e)),Pd(ma(n,"default",{value:e,enumerable:true}),e)),aa=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,$d=["rsc://","file:///","webpack://","webpack-internal://","node:","turbopack://","metro://","/app-pages-browser/"],la="about://React/",Bd=["<anonymous>","eval",""],Fd=/\.(jsx|tsx|ts|js)$/,Ud=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,Hd=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,ga="(at Server)",Gd=/(^|@)\S+:\d+/,ha=/^\s*at .*(\S+:\d+|\(native\))/m,jd=/^(eval@)?(\[native code\])?$/;var ba=(e,t)=>{{let n=e.split(`
13
+ `),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=ca(o,void 0)[0];i&&r.push(i);}else if(/^\s*in\s+/.test(o)){let i=o.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");r.push({functionName:i,source:o});}else if(o.match(Gd)){let i=ua(o,void 0)[0];i&&r.push(i);}return Fo(r,t)}},ya=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=e.startsWith("(")&&e.endsWith(")")?e.slice(1,-1):e,r=t.exec(n);return [r[1],r[2]||void 0,r[3]||void 0]},Fo=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e;var ca=(e,t)=>Fo(e.split(`
14
+ `).filter(r=>!!r.match(ha)),t).map(r=>{let o=r;o.includes("(eval ")&&(o=o.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=o.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;let a=ya(s?s[1]:i),l=s&&i||void 0,f=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {functionName:l,fileName:f,lineNumber:a[1]?+a[1]:void 0,columnNumber:a[2]?+a[2]:void 0,source:o}});var ua=(e,t)=>Fo(e.split(`
15
+ `).filter(r=>!r.match(jd)),t).map(r=>{let o=r;if(o.includes(" > eval")&&(o=o.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!o.includes("@")&&!o.includes(":"))return {functionName:o};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=o.match(i),a=s&&s[1]?s[1]:void 0,l=ya(o.replace(i,""));return {functionName:a,fileName:l[0],lineNumber:l[1]?+l[1]:void 0,columnNumber:l[2]?+l[2]:void 0,source:o}}});var zd=Ld((e,t)=>{(function(n,r){typeof e=="object"&&t!==void 0?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.sourcemapCodec={}));})(void 0,function(n){let r=44,o=59,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(64),a=new Uint8Array(128);for(let C=0;C<i.length;C++){let S=i.charCodeAt(C);s[C]=S,a[S]=C;}function l(C,S){let h=0,w=0,A=0;do{let B=C.next();A=a[B],h|=(A&31)<<w,w+=5;}while(A&32);let $=h&1;return h>>>=1,$&&(h=-2147483648|-h),S+h}function f(C,S,h){let w=S-h;w=w<0?-w<<1|1:w<<1;do{let A=w&31;w>>>=5,w>0&&(A|=32),C.write(s[A]);}while(w>0);return S}function d(C,S){return C.pos>=S?false:C.peek()!==r}let u=1024*16,p=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(C){return Buffer.from(C.buffer,C.byteOffset,C.byteLength).toString()}}:{decode(C){let S="";for(let h=0;h<C.length;h++)S+=String.fromCharCode(C[h]);return S}};class m{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(u);}write(S){let{buffer:h}=this;h[this.pos++]=S,this.pos===u&&(this.out+=p.decode(h),this.pos=0);}flush(){let{buffer:S,out:h,pos:w}=this;return w>0?h+p.decode(S.subarray(0,w)):h}}class g{constructor(S){this.pos=0,this.buffer=S;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(S){let{buffer:h,pos:w}=this,A=h.indexOf(S,w);return A===-1?h.length:A}}let y=[];function _(C){let{length:S}=C,h=new g(C),w=[],A=[],$=0;for(;h.pos<S;h.pos++){$=l(h,$);let B=l(h,0);if(!d(h,S)){let W=A.pop();W[2]=$,W[3]=B;continue}let L=l(h,0),E=l(h,0),P=E&1,M=P?[$,B,0,0,L,l(h,0)]:[$,B,0,0,L],D=y;if(d(h,S)){D=[];do{let W=l(h,0);D.push(W);}while(d(h,S))}M.vars=D,w.push(M),A.push(M);}return w}function I(C){let S=new m;for(let h=0;h<C.length;)h=T(C,h,S,[0]);return S.flush()}function T(C,S,h,w){let A=C[S],{0:$,1:B,2:L,3:E,4:P,vars:M}=A;S>0&&h.write(r),w[0]=f(h,$,w[0]),f(h,B,0),f(h,P,0);let D=A.length===6?1:0;f(h,D,0),A.length===6&&f(h,A[5],0);for(let W of M)f(h,W,0);for(S++;S<C.length;){let W=C[S],{0:F,1:U}=W;if(F>L||F===L&&U>=E)break;S=T(C,S,h,w);}return h.write(r),w[0]=f(h,L,w[0]),f(h,E,0),S}function v(C){let{length:S}=C,h=new g(C),w=[],A=[],$=0,B=0,L=0,E=0,P=0,M=0,D=0,W=0;do{let F=h.indexOf(";"),U=0;for(;h.pos<F;h.pos++){if(U=l(h,U),!d(h,F)){let ne=A.pop();ne[2]=$,ne[3]=U;continue}let ae=l(h,0),k=ae&1,G=ae&2,q=ae&4,K=null,pe=y,Se;if(k){let ne=l(h,B);L=l(h,B===ne?L:0),B=ne,Se=[$,U,0,0,ne,L];}else Se=[$,U,0,0];if(Se.isScope=!!q,G){let ne=E,fe=P;E=l(h,E);let se=ne===E;P=l(h,se?P:0),M=l(h,se&&fe===P?M:0),K=[E,P,M];}if(Se.callsite=K,d(h,F)){pe=[];do{D=$,W=U;let ne=l(h,0),fe;if(ne<-1){fe=[[l(h,0)]];for(let se=-1;se>ne;se--){let ke=D;D=l(h,D),W=l(h,D===ke?W:0);let ze=l(h,0);fe.push([ze,D,W]);}}else fe=[[ne]];pe.push(fe);}while(d(h,F))}Se.bindings=pe,w.push(Se),A.push(Se);}$++,h.pos=F+1;}while(h.pos<S);return w}function Z(C){if(C.length===0)return "";let S=new m;for(let h=0;h<C.length;)h=Q(C,h,S,[0,0,0,0,0,0,0]);return S.flush()}function Q(C,S,h,w){let A=C[S],{0:$,1:B,2:L,3:E,isScope:P,callsite:M,bindings:D}=A;w[0]<$?(Y(h,w[0],$),w[0]=$,w[1]=0):S>0&&h.write(r),w[1]=f(h,A[1],w[1]);let W=(A.length===6?1:0)|(M?2:0)|(P?4:0);if(f(h,W,0),A.length===6){let{4:F,5:U}=A;F!==w[2]&&(w[3]=0),w[2]=f(h,F,w[2]),w[3]=f(h,U,w[3]);}if(M){let{0:F,1:U,2:ae}=A.callsite;F===w[4]?U!==w[5]&&(w[6]=0):(w[5]=0,w[6]=0),w[4]=f(h,F,w[4]),w[5]=f(h,U,w[5]),w[6]=f(h,ae,w[6]);}if(D)for(let F of D){F.length>1&&f(h,-F.length,0);let U=F[0][0];f(h,U,0);let ae=$,k=B;for(let G=1;G<F.length;G++){let q=F[G];ae=f(h,q[1],ae),k=f(h,q[2],k),f(h,q[0],0);}}for(S++;S<C.length;){let F=C[S],{0:U,1:ae}=F;if(U>L||U===L&&ae>=E)break;S=Q(C,S,h,w);}return w[0]<L?(Y(h,w[0],L),w[0]=L,w[1]=0):h.write(r),w[1]=f(h,E,w[1]),S}function Y(C,S,h){do C.write(o);while(++S<h)}function we(C){let{length:S}=C,h=new g(C),w=[],A=0,$=0,B=0,L=0,E=0;do{let P=h.indexOf(";"),M=[],D=true,W=0;for(A=0;h.pos<P;){let F;A=l(h,A),A<W&&(D=false),W=A,d(h,P)?($=l(h,$),B=l(h,B),L=l(h,L),d(h,P)?(E=l(h,E),F=[A,$,B,L,E]):F=[A,$,B,L]):F=[A],M.push(F),h.pos++;}D||Ee(M),w.push(M),h.pos=P+1;}while(h.pos<=S);return w}function Ee(C){C.sort(ve);}function ve(C,S){return C[0]-S[0]}function me(C){let S=new m,h=0,w=0,A=0,$=0;for(let B=0;B<C.length;B++){let L=C[B];if(B>0&&S.write(o),L.length===0)continue;let E=0;for(let P=0;P<L.length;P++){let M=L[P];P>0&&S.write(r),E=f(S,M[0],E),M.length!==1&&(h=f(S,M[1],h),w=f(S,M[2],w),A=f(S,M[3],A),M.length!==4&&($=f(S,M[4],$)));}}return S.flush()}n.decode=we,n.decodeGeneratedRanges=v,n.decodeOriginalScopes=_,n.encode=me,n.encodeGeneratedRanges=Z,n.encodeOriginalScopes=I,Object.defineProperty(n,"__esModule",{value:true});});}),wa=Dd(zd()),Ea=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Vd=/^data:application\/json[^,]+base64,/,Kd=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,Sa=typeof WeakRef<"u",kn=new Map,br=new Map,Xd=e=>Sa&&e instanceof WeakRef,da=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let i=null;for(let d of o)if(d[0]<=r)i=d;else break;if(!i||i.length<4)return null;let[,s,a,l]=i;if(s===void 0||a===void 0||l===void 0)return null;let f=t[s];return f?{columnNumber:l,fileName:f,lineNumber:a+1}:null},Wd=(e,t,n)=>{if(e.sections){let r=null;for(let s of e.sections)if(t>s.offset.line||t===s.offset.line&&n>=s.offset.column)r=s;else break;if(!r)return null;let o=t-r.offset.line,i=t===r.offset.line?n-r.offset.column:n;return da(r.map.mappings,r.map.sources,o,i)}return da(e.mappings,e.sources,t-1,n)},Yd=(e,t)=>{let n=t.split(`
16
+ `),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Kd);s&&(r=s[1]||s[2]);}if(!r)return null;let o=Ea.test(r);if(!(Vd.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},qd=e=>({file:e.file,mappings:(0, wa.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Zd=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, wa.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},fa=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(Ea);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Jd=async(e,t=fetch)=>{if(!fa(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Yd(e,n);if(!r||!fa(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Zd(i):qd(i)}catch{return null}},Qd=async(e,t=true,n)=>{if(t&&kn.has(e)){let i=kn.get(e);if(i==null)return null;if(Xd(i)){let s=i.deref();if(s)return s;kn.delete(e);}else return i}if(t&&br.has(e))return br.get(e);let r=Jd(e,n);t&&br.set(e,r);let o=await r;return t&&br.delete(e),t&&(o===null?kn.set(e,null):kn.set(e,Sa?new WeakRef(o):o)),o},ef=async(e,t=true,n)=>await Promise.all(e.map(async r=>{if(!r.fileName)return r;let o=await Qd(r.fileName,t,n);if(!o||typeof r.lineNumber!="number"||typeof r.columnNumber!="number")return r;let i=Wd(o,r.lineNumber,r.columnNumber);return i?{...r,source:i.fileName&&r.source?r.source.replace(r.fileName,i.fileName):r.source,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,isSymbolicated:true}:r})),tf=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",nf=()=>{let e=rt();for(let t of [...Array.from(Ct),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},pa=e=>{for(let t of Ct){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},ot=e=>`
17
+ in ${e}`,rf=(e,t)=>{let n=ot(e);return t&&(n+=` (at ${t})`),n},$o=false,Bo=(e,t)=>{if(!e||$o)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,$o=true;let r=nf();pa(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let p;try{if(t){let m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[]);}catch(g){p=g;}Reflect.construct(e,[],m);}else {try{m.call();}catch(g){p=g;}e.call(m.prototype);}}else {try{throw Error()}catch(g){p=g;}let m=e();m&&typeof m.catch=="function"&&m.catch(()=>{});}}catch(m){if(m instanceof Error&&p instanceof Error&&typeof m.stack=="string")return [m.stack,p.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[d,u]=l.DetermineComponentFrameRoot();if(d&&u){let p=d.split(`
18
+ `),m=u.split(`
19
+ `),g=0,y=0;for(;g<p.length&&!p[g].includes("DetermineComponentFrameRoot");)g++;for(;y<m.length&&!m[y].includes("DetermineComponentFrameRoot");)y++;if(g===p.length||y===m.length)for(g=p.length-1,y=m.length-1;g>=1&&y>=0&&p[g]!==m[y];)y--;for(;g>=1&&y>=0;g--,y--)if(p[g]!==m[y]){if(g!==1||y!==1)do if(g--,y--,y<0||p[g]!==m[y]){let _=`
20
+ ${p[g].replace(" at new "," at ")}`,I=In(e);return I&&_.includes("<anonymous>")&&(_=_.replace("<anonymous>",I)),_}while(g>=1&&y>=0);break}}}finally{$o=false,Error.prepareStackTrace=n,pa(r),console.error=o,console.warn=i;}let s=e?In(e):"";return s?ot(s):""},of=(e,t)=>{let n=e.tag,r="";switch(n){case Oo:r=ot("Activity");break;case So:r=Bo(e.type,true);break;case vo:r=Bo(e.type.render,false);break;case Eo:case Co:r=Bo(e.type,false);break;case xo:case Io:case ko:r=ot(e.type);break;case To:r=ot("Lazy");break;case _o:r=e.child!==t&&t!==null?ot("Suspense Fallback"):ot("Suspense");break;case Ao:r=ot("SuspenseList");break;case Ro:r=ot("ViewTransition");break;default:return ""}return r},sf=e=>{try{let t="",n=e,r=null;do{t+=of(n,r);let o=n._debugInfo;if(o&&Array.isArray(o))for(let i=o.length-1;i>=0;i--){let s=o[i];typeof s.name=="string"&&(t+=rf(s.name,s.env));}r=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
21
21
  Error generating stack: ${t.message}
22
- ${t.stack}`:""}},zd=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return "";Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
23
- `)&&(n=n.slice(29));let o=n.indexOf(`
24
- `);if(o!==-1&&(n=n.slice(o+1)),o=Math.max(n.indexOf("react_stack_bottom_frame"),n.indexOf("react-stack-bottom-frame")),o!==-1&&(o=n.lastIndexOf(`
25
- `,o)),o!==-1)n=n.slice(0,o);else return "";return n},Vd=e=>!!(e.fileName?.startsWith("rsc://")&&e.functionName),Kd=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Xd=e=>{let t=new Map;for(let n of e)for(let o of n.stackFrames){if(!Vd(o))continue;let r=o.functionName,i=t.get(r)??[];i.some(a=>Kd(a,o))||(i.push(o),t.set(r,i));}return t},Wd=(e,t,n)=>{if(!e.functionName)return {...e,isServer:true};let o=t.get(e.functionName);if(!o||o.length===0)return {...e,isServer:true};let r=n.get(e.functionName)??0,i=o[r%o.length];return n.set(e.functionName,r+1),{...e,isServer:true,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,source:e.source?.replace(ma,`(${i.fileName}:${i.lineNumber}:${i.columnNumber})`)}},Yd=e=>{let t=[];return Mr(e,n=>{if(!Fd(n))return;let o=typeof n.type=="string"?n.type:Pn(n.type)||"<anonymous>";t.push({componentName:o,stackFrames:ha(zd(n._debugStack?.stack))});},true),t},Sa=async(e,t=true,n)=>{let o=Yd(e),r=ha(jd(e)),i=Xd(o),s=new Map,a=r.map(l=>l.source?.includes(ma)??false?Wd(l,i,s):l),c=a.filter((l,f,d)=>{if(f===0)return true;let p=d[f-1];return l.functionName!==p.functionName});return Bd(c,t,n)};var $n=e=>{if(!e||xd.some(r=>r===e))return "";let t=e;if(t.startsWith("http://")||t.startsWith("https://"))try{t=new URL(t).pathname;}catch{}if(t.startsWith(aa)){let r=t.slice(aa.length),i=r.indexOf("/"),s=r.indexOf(":");t=i!==-1&&(s===-1||i<s)?r.slice(i+1):r;}let n=true;for(;n;){n=false;for(let r of Sd)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`),n=true;break}}if(sa.test(t)){let r=t.match(sa);r&&(t=t.slice(r[0].length));}if(t.startsWith("//")){let r=t.indexOf("/",2);t=r===-1?"":t.slice(r);}let o=t.indexOf("?");if(o!==-1){let r=t.slice(o);Cd.test(r)&&(t=t.slice(0,o));}return t},_o=e=>{let t=$n(e);return !(!t||!vd.test(t)||_d.test(t))};var xa=e=>e.length>0&&/^[A-Z]/.test(e);Er();var qd=new Set(["InnerLayoutRouter","RedirectErrorBoundary","RedirectBoundary","HTTPAccessFallbackErrorBoundary","HTTPAccessFallbackBoundary","LoadingBoundary","ErrorBoundary","InnerScrollAndFocusHandler","ScrollAndFocusHandler","RenderFromTemplateContext","OuterLayoutRouter","body","html","DevRootHTTPAccessFallbackBoundary","AppDevOverlayErrorBoundary","AppDevOverlay","HotReload","Router","ErrorBoundaryHandler","AppRouter","ServerRoot","SegmentStateProvider","RootErrorBoundary","LoadableComponent","MotionDOMComponent"]),Zd=()=>typeof document>"u"?false:!!(document.getElementById("__NEXT_DATA__")||document.querySelector("nextjs-portal")),Jd=e=>!!(e.startsWith("_")||qd.has(e)),Hr=e=>!(e.length<=1||Jd(e)||!xa(e)||e.startsWith("Primitive.")||e.includes("Provider")&&e.includes("Context")),cn=async e=>{if(!ln())return [];let t=$r(e);return t?await Sa(t):null},it=async e=>{if(!ln())return null;let t=await cn(e);if(!t)return null;for(let n of t)if(n.functionName&&Hr(n.functionName))return n.functionName;return null},Co=async(e,t={})=>{let{maxLines:n=3}=t,o=Qd(e),r=await cn(e),i=Zd(),s=[];if(r)for(let a of r){if(s.length>=n)break;if(a.isServer&&(!a.functionName||Hr(a.functionName))){s.push(`
26
- in ${a.functionName||"<anonymous>"} (at Server)`);continue}if(a.fileName&&_o(a.fileName)){let c=`
27
- in `,l=a.functionName&&Hr(a.functionName);l&&(c+=`${a.functionName} (at `),c+=$n(a.fileName),i&&a.lineNumber&&a.columnNumber&&(c+=`:${a.lineNumber}:${a.columnNumber}`),l&&(c+=")"),s.push(c);}}return `${o}${s.join("")}`},Qd=e=>{let t=e.tagName.toLowerCase();if(!(e instanceof HTMLElement))return `<${t} />`;let n=e.innerText?.trim()??e.textContent?.trim()??"",o="",r=Array.from(e.attributes);for(let h of r){let g=h.name,E=h.value;E.length>20&&(E=`${E.slice(0,20)}...`),o+=` ${g}="${E}"`;}let i=[],s=[],a=false,c=Array.from(e.childNodes);for(let h of c)h.nodeType!==Node.COMMENT_NODE&&(h.nodeType===Node.TEXT_NODE?h.textContent&&h.textContent.trim().length>0&&(a=true):h instanceof Element&&(a?s.push(h):i.push(h)));let l=h=>h.length===0?"":h.length<=2?h.map(g=>`<${g.tagName.toLowerCase()} ...>`).join(`
28
- `):`(${h.length} elements)`,f="",d=l(i);if(d&&(f+=`
29
- ${d}`),n.length>0){let h=n.length>100?`${n.slice(0,100)}...`:n;f+=`
30
- ${h}`;}let p=l(s);return p&&(f+=`
31
- ${p}`),f.length>0?`<${t}${o}>${f}
32
- </${t}>`:`<${t}${o} />`};var Gr=e=>({activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{},copyElement:()=>Promise.resolve(false),getState:()=>({isActive:false,isDragging:false,isCopying:false,isInputMode:false,targetElement:null,dragBounds:null}),updateTheme:()=>{},getTheme:()=>e,setAgent:()=>{},updateOptions:()=>{}});var va=()=>{let e=new AbortController,t=(o,r,i={})=>{window.addEventListener(o,r,{...i,signal:e.signal});},n=(o,r,i={})=>{document.addEventListener(o,r,{...i,signal:e.signal});};return {signal:e.signal,abort:()=>e.abort(),addWindowListener:t,addDocumentListener:n}};var ef="application/x-react-grab",un=(e,t)=>{let n=JSON.stringify({version:ms,content:e,timestamp:Date.now(),...t?.prompt&&{prompt:t.prompt}}),o=i=>{i.preventDefault(),i.clipboardData?.setData("text/plain",e),i.clipboardData?.setData(ef,n);};document.addEventListener("copy",o);let r=document.createElement("textarea");r.value=e,r.style.position="fixed",r.style.left="-9999px",r.ariaHidden="true",document.body.appendChild(r),r.select();try{let i=document.execCommand("copy");return i&&t?.onSuccess?.(),i}finally{document.removeEventListener("copy",o),r.remove();}};var dn=async(e,t={})=>(await Promise.allSettled(e.map(r=>Co(r,t)))).map(r=>r.status==="fulfilled"?r.value:"").filter(r=>r.trim());var tf=e=>"innerText"in e,nf=e=>tf(e)?e.innerText:e.textContent??"",_a=e=>e.map(t=>nf(t).trim()).filter(t=>t.length>0).join(`
22
+ ${t.stack}`:""}},af=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return "";Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
23
+ `)&&(n=n.slice(29));let r=n.indexOf(`
24
+ `);if(r!==-1&&(n=n.slice(r+1)),r=Math.max(n.indexOf("react_stack_bottom_frame"),n.indexOf("react-stack-bottom-frame")),r!==-1&&(r=n.lastIndexOf(`
25
+ `,r)),r!==-1)n=n.slice(0,r);else return "";return n},lf=e=>!!(e.fileName?.startsWith("rsc://")&&e.functionName),cf=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,uf=e=>{let t=new Map;for(let n of e)for(let r of n.stackFrames){if(!lf(r))continue;let o=r.functionName,i=t.get(o)??[];i.some(a=>cf(a,r))||(i.push(r),t.set(o,i));}return t},df=(e,t,n)=>{if(!e.functionName)return {...e,isServer:true};let r=t.get(e.functionName);if(!r||r.length===0)return {...e,isServer:true};let o=n.get(e.functionName)??0,i=r[o%r.length];return n.set(e.functionName,o+1),{...e,isServer:true,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,source:e.source?.replace(ga,`(${i.fileName}:${i.lineNumber}:${i.columnNumber})`)}},ff=e=>{let t=[];return Mo(e,n=>{if(!tf(n))return;let r=typeof n.type=="string"?n.type:In(n.type)||"<anonymous>";t.push({componentName:r,stackFrames:ba(af(n._debugStack?.stack))});},true),t},xa=async(e,t=true,n)=>{let r=ff(e),o=ba(sf(e)),i=uf(r),s=new Map,a=o.map(f=>f.source?.includes(ga)??false?df(f,i,s):f),l=a.filter((f,d,u)=>{if(d===0)return true;let p=u[d-1];return f.functionName!==p.functionName});return ef(l,t,n)};var On=e=>{if(!e||Bd.some(o=>o===e))return "";let t=e;if(t.startsWith("http://")||t.startsWith("https://"))try{t=new URL(t).pathname;}catch{}if(t.startsWith(la)){let o=t.slice(la.length),i=o.indexOf("/"),s=o.indexOf(":");t=i!==-1&&(s===-1||i<s)?o.slice(i+1):o;}let n=true;for(;n;){n=false;for(let o of $d)if(t.startsWith(o)){t=t.slice(o.length),o==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`),n=true;break}}if(aa.test(t)){let o=t.match(aa);o&&(t=t.slice(o[0].length));}if(t.startsWith("//")){let o=t.indexOf("/",2);t=o===-1?"":t.slice(o);}let r=t.indexOf("?");if(r!==-1){let o=t.slice(r);Hd.test(o)&&(t=t.slice(0,r));}return t},yr=e=>{let t=On(e);return !(!t||!Fd.test(t)||Ud.test(t))};var va=e=>e.length>0&&/^[A-Z]/.test(e);wo();var pf=new Set(["InnerLayoutRouter","RedirectErrorBoundary","RedirectBoundary","HTTPAccessFallbackErrorBoundary","HTTPAccessFallbackBoundary","LoadingBoundary","ErrorBoundary","InnerScrollAndFocusHandler","ScrollAndFocusHandler","RenderFromTemplateContext","OuterLayoutRouter","body","html","DevRootHTTPAccessFallbackBoundary","AppDevOverlayErrorBoundary","AppDevOverlay","HotReload","Router","ErrorBoundaryHandler","AppRouter","ServerRoot","SegmentStateProvider","RootErrorBoundary","LoadableComponent","MotionDOMComponent"]),mf=()=>typeof document>"u"?false:!!(document.getElementById("__NEXT_DATA__")||document.querySelector("nextjs-portal")),gf=e=>!!(e.startsWith("_")||pf.has(e)),Uo=e=>!(e.length<=1||gf(e)||!va(e)||e.startsWith("Primitive.")||e.includes("Provider")&&e.includes("Context")),Jt=async e=>{if(!Zt())return [];let t=Do(e);return t?await xa(t):null},Qt=async e=>{if(!Zt())return null;let t=await Jt(e);if(!t)return null;for(let n of t)if(n.functionName&&Uo(n.functionName))return n.functionName;return null},wr=async(e,t={})=>{let{maxLines:n=3}=t,r=hf(e),o=await Jt(e),i=mf(),s=[];if(o)for(let a of o){if(s.length>=n)break;if(a.isServer&&(!a.functionName||Uo(a.functionName))){s.push(`
26
+ in ${a.functionName||"<anonymous>"} (at Server)`);continue}if(a.fileName&&yr(a.fileName)){let l=`
27
+ in `,f=a.functionName&&Uo(a.functionName);f&&(l+=`${a.functionName} (at `),l+=On(a.fileName),i&&a.lineNumber&&a.columnNumber&&(l+=`:${a.lineNumber}:${a.columnNumber}`),f&&(l+=")"),s.push(l);}}return `${r}${s.join("")}`},hf=e=>{let t=e.tagName.toLowerCase();if(!(e instanceof HTMLElement))return `<${t} />`;let n=e.innerText?.trim()??e.textContent?.trim()??"",r="",o=Array.from(e.attributes);for(let m of o){let g=m.name,y=m.value;y.length>20&&(y=`${y.slice(0,20)}...`),r+=` ${g}="${y}"`;}let i=[],s=[],a=false,l=Array.from(e.childNodes);for(let m of l)m.nodeType!==Node.COMMENT_NODE&&(m.nodeType===Node.TEXT_NODE?m.textContent&&m.textContent.trim().length>0&&(a=true):m instanceof Element&&(a?s.push(m):i.push(m)));let f=m=>m.length===0?"":m.length<=2?m.map(g=>`<${g.tagName.toLowerCase()} ...>`).join(`
28
+ `):`(${m.length} elements)`,d="",u=f(i);if(u&&(d+=`
29
+ ${u}`),n.length>0){let m=n.length>100?`${n.slice(0,100)}...`:n;d+=`
30
+ ${m}`;}let p=f(s);return p&&(d+=`
31
+ ${p}`),d.length>0?`<${t}${r}>${d}
32
+ </${t}>`:`<${t}${r} />`};var Ho=e=>({activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{},copyElement:()=>Promise.resolve(false),getState:()=>({isActive:false,isDragging:false,isCopying:false,isInputMode:false,targetElement:null,dragBounds:null}),updateTheme:()=>{},getTheme:()=>e,setAgent:()=>{},updateOptions:()=>{}});var _a=()=>{let e=new AbortController,t=(r,o,i={})=>{window.addEventListener(r,o,{...i,signal:e.signal});},n=(r,o,i={})=>{document.addEventListener(r,o,{...i,signal:e.signal});};return {signal:e.signal,abort:()=>e.abort(),addWindowListener:t,addDocumentListener:n}};var bf="application/x-react-grab",en=(e,t)=>{let n=JSON.stringify({version:ms,content:e,timestamp:Date.now(),...t?.prompt&&{prompt:t.prompt}}),r=i=>{i.preventDefault(),i.clipboardData?.setData("text/plain",e),i.clipboardData?.setData(bf,n);};document.addEventListener("copy",r);let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.left="-9999px",o.ariaHidden="true",document.body.appendChild(o),o.select();try{let i=document.execCommand("copy");return i&&t?.onSuccess?.(),i}finally{document.removeEventListener("copy",r),o.remove();}};var tn=async(e,t={})=>(await Promise.allSettled(e.map(o=>wr(o,t)))).map(o=>o.status==="fulfilled"?o.value:"").filter(o=>o.trim());var yf=e=>"innerText"in e,wf=e=>yf(e)?e.innerText:e.textContent??"",Ca=e=>e.map(t=>wf(t).trim()).filter(t=>t.length>0).join(`
33
33
 
34
- `),Ca=async(e,t,n)=>{let o=false,r="";await e.onBeforeCopy?.(t);try{if(e.getContent){let i=await e.getContent(t);if(i.trim()){let s=n?`${n}
34
+ `),Ta=async(e,t,n)=>{let r=false,o="";await e.onBeforeCopy?.(t);try{if(e.getContent){let i=await e.getContent(t);if(i.trim()){let s=n?`${n}
35
35
 
36
- ${i}`:i;r=s,o=un(s,{prompt:n});}}else {let i=await dn(t,{maxLines:e.maxContextLines});if(i.trim()){let s=n?`${n}
36
+ ${i}`:i;o=s,r=en(s,{prompt:n});}}else {let s=(await tn(t,{maxLines:e.maxContextLines})).join(`
37
37
 
38
- ${i}`:i;r=s,o=un(s,{prompt:n});}if(!o){let s=_a(t);if(s.length>0){let a=n?`${n}
38
+ `);if(s.trim()){let a=n?`${n}
39
39
 
40
- ${s}`:s;r=a,o=un(a,{prompt:n});}}}}catch(i){let s=i instanceof Error?i:new Error(String(i));e.onCopyError?.(s);let a=_a(t);if(a.length>0){let c=n?`${n}
40
+ ${s}`:s;o=a,r=en(a,{prompt:n});}if(!r){let a=Ca(t);if(a.length>0){let l=n?`${n}
41
41
 
42
- ${a}`:a;r=c,o=un(c,{prompt:n});}}return o&&e.onCopySuccess?.(t,r),e.onAfterCopy?.(t,o),o};var Ta=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var Ze=e=>{if(e.closest(`[${rn}]`))return false;let t=window.getComputedStyle(e);return !(!Ta(e,t)||t.pointerEvents==="none")};var To=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let o of n)if(Ze(o))return o;return null};var of=(e,t)=>{let n=Math.max(e.left,t.left),o=Math.max(e.top,t.top),r=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom),s=Math.max(0,r-n),a=Math.max(0,i-o);return s*a},rf=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,fn=(e,t,n)=>Math.min(n,Math.max(t,e)),sf=e=>e.sort((t,n)=>{if(t===n)return 0;let o=t.compareDocumentPosition(n);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0}),af=e=>{if(e.width<=0||e.height<=0)return [];let t=window.innerWidth,n=window.innerHeight,o=e.x,r=e.y,i=e.x+e.width,s=e.y+e.height,a=o+e.width/2,c=r+e.height/2,l=fn(Math.ceil(e.width/24),3,30),f=fn(Math.ceil(e.height/24),3,30),d=l*f,p=d>600?Math.sqrt(600/d):1,h=fn(Math.floor(l*p),3,30),g=fn(Math.floor(f*p),3,30),E=new Set,T=[],M=(v,J)=>{let te=fn(Math.round(v),0,t-1),se=fn(Math.round(J),0,n-1),pe=`${te}:${se}`;E.has(pe)||(E.add(pe),T.push({x:te,y:se}));},A=1;M(o+A,r+A),M(i-A,r+A),M(o+A,s-A),M(i-A,s-A),M(a,r+A),M(a,s-A),M(o+A,c),M(i-A,c),M(a,c);for(let v=0;v<h;v+=1){let J=o+(v+.5)/h*e.width;for(let te=0;te<g;te+=1){let se=r+(te+.5)/g*e.height;M(J,se);}}return T},lf=(e,t,n)=>{let o={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height},r=new Set,i=af(e);for(let a of i){let c=document.elementsFromPoint(a.x,a.y);for(let l of c)r.add(l);}let s=[];for(let a of r){if(!n){let f=(a.tagName||"").toUpperCase();if(f==="HTML"||f==="BODY")continue}if(!t(a))continue;let c=a.getBoundingClientRect();if(c.width<=0||c.height<=0)continue;let l={left:c.left,top:c.top,right:c.left+c.width,bottom:c.top+c.height};if(n){let f=of(o,l),d=c.width*c.height;d>0&&f/d>=.75&&s.push(a);}else rf(l,o)&&s.push(a);}return sf(s)},cf=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),jr=(e,t,n=true)=>{let o=lf(e,t,n);return cf(o)};var ft=e=>(e.tagName||"").toLowerCase();var zr=e=>{if(!e.anchorNode||!e.focusNode)return false;let t=e.anchorNode.compareDocumentPosition(e.focusNode);return t&Node.DOCUMENT_POSITION_FOLLOWING?false:t&Node.DOCUMENT_POSITION_PRECEDING?true:e.anchorOffset>e.focusOffset};var uf=new Set(["c","C","\u0441","\u0421","\u023C","\u023B","\u2184","\u2183","\u1D04","\u1D9C","\u2C7C","\u217D","\u216D","\xE7","\xC7","\u0107","\u0106","\u010D","\u010C","\u0109","\u0108","\u010B","\u010A"]),Ao=(e,t)=>t==="KeyC"?true:!e||e.length!==1?false:uf.has(e);var Io=(e,t)=>{let n=e.toLowerCase();return t.startsWith("Key")?t.slice(3).toLowerCase()===n:t.startsWith("Digit")?t.slice(5)===n:false};var Vr=(e,t)=>{if(t.activationShortcut)return t.activationShortcut(e);if(t.activationKey){let{key:o,metaKey:r,ctrlKey:i,shiftKey:s,altKey:a}=t.activationKey;if(!o){if(!mo.includes(e.key))return false;let p=r?e.metaKey||e.key==="Meta":true,h=i?e.ctrlKey||e.key==="Control":true,g=s?e.shiftKey||e.key==="Shift":true,E=a?e.altKey||e.key==="Alt":true,T=p&&h&&g&&E,M=[r,i,s,a].filter(Boolean).length,A=[e.metaKey||e.key==="Meta",e.ctrlKey||e.key==="Control",e.shiftKey||e.key==="Shift",e.altKey||e.key==="Alt"].filter(Boolean).length;return T&&A>=M}let l=e.key?.toLowerCase()===o.toLowerCase()||Io(o,e.code),d=r||i||s||a?(r?e.metaKey:true)&&(i?e.ctrlKey:true)&&(s?e.shiftKey:true)&&(a?e.altKey:true):e.metaKey||e.ctrlKey;return l&&d}let n=(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey;return !!(e.key&&n&&Ao(e.key,e.code))};var st=(e,t)=>{try{return e.composedPath().some(n=>n instanceof HTMLElement&&n.hasAttribute(t))}catch{return false}};var ko={enabled:true,hue:0,selectionBox:{enabled:true},dragBox:{enabled:true},grabbedBoxes:{enabled:true},elementLabel:{enabled:true},crosshair:{enabled:true},dock:{enabled:true}},Aa=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},crosshair:{enabled:t.crosshair?.enabled??e.crosshair.enabled},dock:{enabled:t.dock?.enabled??e.dock.enabled}}),Kr=e=>e?Aa(ko,e):ko,Ia=Aa;var Xr="react-grab:agent-sessions",df=()=>`session-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,ka=(e,t,n,o,r)=>{let i=Date.now();return {id:df(),context:e,lastStatus:"",isStreaming:true,createdAt:i,lastUpdatedAt:i,position:t,selectionBounds:n,tagName:o,componentName:r}},Bt=new Map,Oo=(e,t)=>{if(!t){Bt.clear(),e.forEach((n,o)=>Bt.set(o,n));return}try{let n=Object.fromEntries(e);t.setItem(Xr,JSON.stringify(n));}catch{Bt.clear(),e.forEach((n,o)=>Bt.set(o,n));}},Ro=(e,t)=>{let n=No(t);n.set(e.id,e),Oo(n,t);},No=e=>{if(!e)return new Map(Bt);try{let t=e.getItem(Xr);if(!t)return new Map;let n=JSON.parse(t);return new Map(Object.entries(n))}catch{return new Map}},Mo=e=>{if(!e){Bt.clear();return}try{e.removeItem(Xr);}catch{Bt.clear();}},Wr=(e,t)=>{let n=No(t);n.delete(e),Oo(n,t);},Ft=(e,t,n)=>{let o={...e,...t,lastUpdatedAt:Date.now()};return Ro(o,n),o};var Oa=e=>{let[t,n]=V(new Map),[o,r]=V(false),[i,s]=V(false),a=new Map,c=new Map,l=[],f=e,d=()=>{let m=f?.provider?.canUndo?.()??false,S=f?.provider?.canRedo?.()??false;r(m),s(S);},p=m=>{f=m,d();},h=()=>f,g=()=>Array.from(t().values()).some(m=>m.isStreaming),E=async(m,S)=>{let I=f?.storage,F=false;try{for await(let y of S){let L=t().get(m.id);if(!L)break;let D=Ft(L,{lastStatus:y},I);n(Z=>new Map(Z).set(m.id,D)),f?.onStatus?.(y,D);}let C=t().get(m.id);if(C){let y=f?.provider?.getCompletionMessage?.(),N=Ft(C,{isStreaming:!1,...y?{lastStatus:y}:{}},I);n(Z=>new Map(Z).set(m.id,N));let L=c.get(m.id)??[],D=await f?.onComplete?.(N,L);if(d(),l.length=0,D?.error){let Z=Ft(N,{error:D.error},I);n(z=>new Map(z).set(m.id,Z));}}}catch(U){let y=t().get(m.id);if(U instanceof Error&&U.name==="AbortError"){if(F=true,y){let N=c.get(m.id)??[];f?.onAbort?.(y,N);}}else {let N=U instanceof Error?U.message:"Unknown error";if(y){let L=Ft(y,{error:N,isStreaming:false},I);n(D=>new Map(D).set(m.id,L)),U instanceof Error&&f?.onError?.(U,L);}}}finally{a.delete(m.id),F&&(c.delete(m.id),Wr(m.id,I),n(U=>{let C=new Map(U);return C.delete(m.id),C}));}},T=m=>{let{selectionBounds:S,tagName:I}=m,F=S[0];if(!F)return;let U=F.x+F.width/2,C=F.y+F.height/2,y=document.elementFromPoint(U,C);if(!(!y||I&&!I.includes(" ")&&y.tagName.toLowerCase()!==I))return y},M=()=>{let m=f?.storage;if(!m)return;let S=No(m);if(S.size===0)return;let I=Date.now(),F=Array.from(S.values()).filter(C=>{if(C.isStreaming)return true;let y=C.lastUpdatedAt??C.createdAt;return I-y<1e4&&!!C.error});if(F.length===0){Mo(m);return}if(!f?.provider?.supportsResume||!f.provider.resume){Mo(m);return}let U=new Map(F.map(C=>[C.id,C]));n(U),Oo(U,m);for(let C of F){let y=T(C);y&&c.set(C.id,[y]);let N={...C,isStreaming:true,error:void 0,lastStatus:C.lastStatus||"Resuming...",position:C.position??{x:window.innerWidth/2,y:window.innerHeight/2}};n(Z=>new Map(Z).set(C.id,N)),f?.onResume?.(N);let L=new AbortController;a.set(C.id,L);let D=f.provider.resume(C.id,L.signal,m);E(C,D);}},A=async m=>{let{elements:S,prompt:I,position:F,selectionBounds:U,sessionId:C}=m,y=f?.storage;if(!f?.provider||S.length===0)return;let N=S[0],L=C?t().get(C):void 0,D=!!C,z={content:L?L.context.content:await dn(S,{maxLines:1/0}),prompt:I,options:f?.getOptions?.(),sessionId:D?C:void 0},K;if(L)K=Ft(L,{context:z,isStreaming:true,lastStatus:"Thinking\u2026"},y);else {let X=S.length>1?`${S.length} elements`:(N.tagName||"").toLowerCase()||void 0,W=S.length>1?void 0:await it(N)||void 0;K=ka(z,F,U,X,W),K.lastStatus="Thinking\u2026";}c.set(K.id,S),n(X=>new Map(X).set(K.id,K)),Ro(K,y),f.onStart?.(K,S);let ue=new AbortController;a.set(K.id,ue);let k={...z,sessionId:C??K.id},G=f.provider.send(k,ue.signal);E(K,G);},v=m=>{if(m){let S=a.get(m);S&&S.abort();}else a.forEach(S=>S.abort()),a.clear(),n(new Map),Mo(f?.storage);},J=m=>{let I=t().get(m),F=c.get(m)??[];I&&F.length>0&&f?.onDismiss?.(I,F);let U=f?.storage;c.delete(m),Wr(m,U),n(C=>{let y=new Map(C);return y.delete(m),y});};return {sessions:t,isProcessing:g,canUndo:o,canRedo:i,session:{start:A,abort:v,dismiss:J,retry:m=>{let I=t().get(m);if(!I||!f?.provider)return;let F=f.storage,U=c.get(m)??[],C=Ft(I,{error:void 0,isStreaming:true,lastStatus:"Retrying\u2026"},F);n(D=>new Map(D).set(m,C)),Ro(C,F),U.length>0&&f.onStart?.(C,U);let y=new AbortController;a.set(m,y);let N={...C.context,sessionId:m},L=f.provider.send(N,y.signal);E(C,L);},undo:m=>{let I=t().get(m);if(I){let F=c.get(m)??[];l.push({session:I,elements:F}),f?.onUndo?.(I,F),f?.provider?.undo?.();}J(m),d();},getElement:m=>c.get(m)?.[0],getElements:m=>c.get(m)??[],tryResume:M,acknowledgeError:m=>{let F=t().get(m)?.context.prompt;return J(m),F}},history:{undo:()=>{f?.provider?.undo?.(),d();},redo:()=>{let m=l.pop();if(f?.provider?.redo?.(),m){let{session:S,elements:I}=m,F=I.filter(U=>document.contains(U));if(F.length>0){let U=F.map(y=>Ae(y)),C={...S,selectionBounds:U};c.set(S.id,F),n(y=>new Map(y).set(S.id,C));}}d();}},_internal:{updateBoundsOnViewportChange:()=>{let m=t();if(m.size===0)return;let S=new Map(m),I=false;for(let[F,U]of m){let C=c.get(F)??[],y=C[0];if(y&&document.contains(y)){let N=C.filter(L=>document.contains(L)).map(L=>Ae(L));if(N.length>0){let L=U.selectionBounds[0],D=N[0],Z=U.position;if(L&&D){let z=L.x+L.width/2,K=U.position.x-z,ue=D.x+D.width/2;Z={...U.position,x:ue+K};}S.set(F,{...U,selectionBounds:N,position:Z}),I=true;}}}I&&n(S);},setOptions:p,getOptions:h}}};var yf=e=>"scheduler"in globalThis?globalThis.scheduler.postTask(e,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(e):setTimeout(e,0),qr=false,wf=()=>{if(typeof window>"u")return null;try{let e=document.currentScript?.getAttribute("data-options");return e?JSON.parse(e):null}catch{return null}},Zr=e=>{if(typeof window>"u")return Gr(Kr(e?.theme));let t=wf(),n={enabled:true,activationMode:"toggle",keyHoldDuration:200,allowActivationInsideInput:true,maxContextLines:3,...t,...e},o=Kr(n.theme);return n.enabled===false||qr?Gr(o):(qr=true,(()=>{try{let i="0.0.92",s=`data:image/svg+xml;base64,${btoa(hs)}`;console.log(`%cReact Grab${i?` v${i}`:""}%c
43
- https://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${s}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,""),navigator.onLine&&i&&fetch(`https://www.react-grab.com/api/version?source=browser&t=${Date.now()}`,{referrerPolicy:"origin",keepalive:!0,priority:"low",cache:"no-store"}).then(a=>a.text()).then(a=>{a&&a!==i&&console.warn(`[React Grab] v${i} is outdated (latest: v${a})`);}).catch(()=>null);}catch{}})(),at(i=>{let[s,a]=V(o),[,,c]=ps(ys,{input:{theme:o,hasAgentProvider:!!n.agent?.provider,keyHoldDuration:n.keyHoldDuration??200}}),[l,f]=V(c.getSnapshot());re(()=>{let u=c.subscribe(b=>{f(b);});fe(()=>u.unsubscribe());});let d=c.send.bind(c),p=ee(()=>l().matches({activation:"holding"})),h=ee(()=>l().matches({activation:"active"})||l().matches({activation:{active:"hovering"}})||l().matches({activation:{active:"frozen"}})||l().matches({activation:{active:"dragging"}})||l().matches({activation:{active:"justDragged"}})),g=ee(()=>l().matches({activation:{active:"frozen"}})),E=ee(()=>l().matches({activation:{active:"dragging"}})),T=ee(()=>l().matches({activation:{active:"justDragged"}})),M=ee(()=>l().matches({interaction:"copying"})),A=ee(()=>l().matches({interaction:"justCopied"})),v=ee(()=>l().matches({interaction:"inputMode"})||l().matches({interaction:{inputMode:"typing"}})||l().matches({interaction:{inputMode:"confirmingDismiss"}})),J=ee(()=>l().matches({interaction:{inputMode:"confirmingDismiss"}})),te=ee(()=>l().matches({agentAbortConfirmation:"confirming"})),se=false;re(()=>{let u=p(),b=h();se&&!u&&b&&(n.activationMode!=="hold"&&d({type:"SET_TOGGLE_MODE",value:true}),n.onActivate?.()),se=u;});let pe=new WeakMap,ve=ee(()=>l().context.nativeSelectionElements.length>0),_e=ee(()=>{let u=l().context.nativeSelectionElements;if(!(u.length===0||!u[0]))return ft(u[0])||void 0}),[Ce]=Go(()=>{let u=l().context.nativeSelectionElements;return u.length===0||!u[0]?null:u[0]},async u=>{if(u)return await it(u)||void 0}),_=()=>{d({type:"CLEAR_NATIVE_SELECTION"});},w=()=>{let u=l().context.frozenElement||ae();u&&d({type:"INPUT_MODE_ENTER",position:{x:l().context.mousePosition.x,y:l().context.mousePosition.y},element:u});},m=(u,b,x)=>(d({type:"SET_COPY_START",position:{x:b,y:x},element:u}),Ae(u)),S=()=>{let u=window.getSelection();if(!u||u.isCollapsed||u.rangeCount===0)return;let b=u.getRangeAt(0),x=b.getClientRects();if(x.length===0)return;let P=zr(u),B=P?x[0]:x[x.length-1],$=P?B.left:B.right,H=B.top+B.height/2,Q=b.commonAncestorContainer,de=Q.nodeType===Node.ELEMENT_NODE?Q:Q.parentElement;de&&Ze(de)&&d({type:"TEXT_SELECTED",elements:[de],cursor:{x:$,y:H}});};re(Fe(()=>l().context.viewportVersion,()=>{ve()&&S();}));let I=ee(()=>{l().context.viewportVersion;let u=l().context.nativeSelectionElements;if(!(u.length===0||!u[0]))return Ae(u[0])}),F=0,U=null,C=null,y=null,N=null,L=null,D=ee(()=>h()&&!M()),Z=(u,b)=>({top:b<25,bottom:b>window.innerHeight-25,left:u<25,right:u>window.innerWidth-25}),z=(u,b)=>{let x=`grabbed-${Date.now()}-${Math.random()}`,P=Date.now();d({type:"ADD_GRABBED_BOX",box:{id:x,bounds:u,createdAt:P,element:b}}),n.onGrabbedBox?.(u,b),setTimeout(()=>{d({type:"REMOVE_GRABBED_BOX",boxId:x});},1700);},K=u=>{let b=u.map(x=>({tagName:ft(x)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:b}}));},ue=(u,b,x,P,B,$)=>{let H=`label-${Date.now()}-${Math.random().toString(36).slice(2)}`,Q={id:H,bounds:u,tagName:b,componentName:x,status:P,createdAt:Date.now(),element:B,mouseX:$};return d({type:"ADD_LABEL_INSTANCE",instance:Q}),H},k=(u,b)=>{d({type:"UPDATE_LABEL_INSTANCE",instanceId:u,status:b});},G=u=>{d({type:"REMOVE_LABEL_INSTANCE",instanceId:u});},X=async(u,b,x,P,B,$,H,Q)=>{d({type:"COPY_START"}),Ra();let de=P&&B?ue(P,B,$,"copying",H,u):null;await x().finally(()=>{d({type:"COPY_DONE",element:H}),Bn(),de&&(k(de,"copied"),setTimeout(()=>{k(de,"fading"),setTimeout(()=>{G(de);},350);},1500)),(l().context.isToggleMode||Q)&&Le();});},W=(u,b)=>Ca(n,u,b),me=async(u,b)=>{if(u.length!==0){for(let x of u)n.onElementSelect?.(x),s().grabbedBoxes.enabled&&z(Ae(x),x);await new Promise(x=>requestAnimationFrame(x)),await W(u,b),K(u);}},ae=ee(()=>{if(!D()||E())return null;let u=l().context.detectedElement;return u&&!document.contains(u)?null:u}),ne=ee(()=>{if(g())return l().context.frozenElement;let u=l().context.frozenElement;return u||ae()});re(()=>{let u=l().context.detectedElement;if(!u)return;let b=setInterval(()=>{document.contains(u)||d({type:"ELEMENT_DETECTED",element:null});},100);fe(()=>clearInterval(b));});let be=ee(()=>{l().context.viewportVersion;let u=ne();if(u)return Ae(u)}),Ie=ee(()=>{l().context.viewportVersion;let u=l().context.frozenElements;return u.length===0?[]:u.map(b=>Ae(b))}),je=ee(()=>l().context.frozenElements.length),We=(u,b)=>{let x=u+window.scrollX,P=b+window.scrollY;return {x:Math.abs(x-l().context.dragStart.x),y:Math.abs(P-l().context.dragStart.y)}},Ht=ee(()=>{if(!E())return false;let u=We(l().context.mousePosition.x,l().context.mousePosition.y);return u.x>2||u.y>2}),pn=(u,b)=>{let x=u+window.scrollX,P=b+window.scrollY,B=Math.min(l().context.dragStart.x,x),$=Math.min(l().context.dragStart.y,P),H=Math.abs(x-l().context.dragStart.x),Q=Math.abs(P-l().context.dragStart.y);return {x:B-window.scrollX,y:$-window.scrollY,width:H,height:Q}},Je=ee(()=>{if(!Ht())return;let u=pn(l().context.mousePosition.x,l().context.mousePosition.y);return {borderRadius:"0px",height:u.height,transform:"none",width:u.width,x:u.x,y:u.y}}),vt=ee(()=>{if(M()||v()){l().context.viewportVersion;let u=l().context.frozenElement||ae();if(u){let b=Ae(u);return {x:b.x+b.width/2+l().context.copyOffsetFromCenterX,y:l().context.copyStart.y}}return {x:l().context.copyStart.x,y:l().context.copyStart.y}}return {x:l().context.mousePosition.x,y:l().context.mousePosition.y}});re(Fe(()=>[ae(),l().context.lastGrabbedElement],([u,b])=>{b&&u&&b!==u&&d({type:"SET_LAST_GRABBED",element:null}),u&&n.onElementHover?.(u);})),re(Fe(()=>ae(),u=>{let b=()=>{d({type:"SET_SELECTION_SOURCE",filePath:null,lineNumber:null});};if(!u){b();return}cn(u).then(x=>{if(x){for(let P of x)if(P.fileName&&_o(P.fileName)){d({type:"SET_SELECTION_SOURCE",filePath:$n(P.fileName),lineNumber:P.lineNumber??null});return}b();}}).catch(b);})),re(Fe(()=>l().context.viewportVersion,()=>ye._internal.updateBoundsOnViewportChange())),re(Fe(()=>[h(),E(),M(),v(),ae(),Je()],([u,b,x,P,B,$])=>{n.onStateChange?.({isActive:u,isDragging:b,isCopying:x,isInputMode:P,targetElement:B,dragBounds:$?{x:$.x,y:$.y,width:$.width,height:$.height}:null});})),re(Fe(()=>[v(),l().context.mousePosition.x,l().context.mousePosition.y,ae()],([u,b,x,P])=>{n.onInputModeChange?.(u,{x:b,y:x,targetElement:P});})),re(Fe(()=>[ri(),be(),ae()],([u,b,x])=>{n.onSelectionBox?.(!!u,b??null,x);})),re(Fe(()=>[ii(),Je()],([u,b])=>{n.onDragBox?.(!!u,b??null);})),re(Fe(()=>[si(),l().context.mousePosition.x,l().context.mousePosition.y],([u,b,x])=>{n.onCrosshair?.(!!u,{x:b,y:x});})),re(Fe(()=>[qa(),Ya(),vt()],([u,b,x])=>{n.onElementLabel?.(!!u,b,{x:x.x,y:x.y,content:""});}));let pt=null,_t=u=>{u?(pt||(pt=document.createElement("style"),pt.setAttribute("data-react-grab-cursor",""),document.head.appendChild(pt)),pt.textContent=`* { cursor: ${u} !important; }`):pt&&(pt.remove(),pt=null);};re(Fe(()=>[h(),M(),E(),v(),ae()],([u,b,x,P,B])=>{_t(b?"progress":P?null:u&&x?"crosshair":u&&B?"default":u?"crosshair":null);}));let Ra=()=>{let u=()=>{M()&&(U=requestAnimationFrame(u));};u();},Bn=()=>{U!==null&&(cancelAnimationFrame(U),U=null);},Na=()=>{let u=()=>{if(!E()){mn();return}let b=Z(l().context.mousePosition.x,l().context.mousePosition.y);b.top&&window.scrollBy(0,-10),b.bottom&&window.scrollBy(0,10),b.left&&window.scrollBy(-10,0),b.right&&window.scrollBy(10,0),b.top||b.bottom||b.left||b.right?y=requestAnimationFrame(u):y=null;};u();},mn=()=>{y!==null&&(cancelAnimationFrame(y),y=null);},mt=()=>{Bn();let u=p();d({type:"ACTIVATE"}),u||n.onActivate?.();},Le=()=>{let u=E(),b=l().context.previouslyFocusedElement;if(d({type:"DEACTIVATE"}),u&&(document.body.style.userSelect=""),C&&window.clearTimeout(C),N){window.clearTimeout(N),N=null;let x=L;if(L=null,x){d({type:"SET_LAST_GRABBED",element:x.element});let P=Ae(x.element),B=ft(x.element);it(x.element).then($=>{X(x.clientX,x.clientY,()=>me([x.element]),P,B,$??void 0,x.element);});}}mn(),Bn(),b instanceof HTMLElement&&document.contains(b)&&b.focus(),n.onDeactivate?.();},Fn=(u,b)=>{let x=b[0];if(x&&document.contains(x)){let P=x.getBoundingClientRect(),B=P.top+P.height/2;d({type:"MOUSE_MOVE",position:{x:u.position.x,y:B}}),d({type:"FREEZE_ELEMENTS",elements:b}),d({type:"INPUT_CHANGE",value:u.context.prompt}),d({type:"SET_TOGGLE_MODE",value:true}),h()||mt();}},Ma=n.agent?{...n.agent,onAbort:(u,b)=>{n.agent?.onAbort?.(u,b),Fn(u,b);},onUndo:(u,b)=>{n.agent?.onUndo?.(u,b),Fn(u,b);}}:void 0,ye=Oa(Ma),La=u=>{d({type:"INPUT_CHANGE",value:u});},Pa=()=>{d({type:"SET_LAST_COPIED",element:null});let u=l().context.frozenElements,b=l().context.frozenElement||ae(),x=v()?l().context.inputText.trim():"";if(!b){Le();return}let P=u.length>0?u:b?[b]:[],B=P.map(Re=>Ae(Re)),$=B[0],H=l().context.mousePosition.x,Q=$.x+$.width/2,de=$.y+$.height/2;if(l().context.hasAgentProvider&&x){pe.delete(b),Le();let Re=l().context.replySessionId;d({type:"SET_REPLY_SESSION",sessionId:null}),ye.session.start({elements:P,prompt:x,position:{x:H,y:de},selectionBounds:B,sessionId:Re??void 0});return}d({type:"MOUSE_MOVE",position:{x:Q,y:de}}),d({type:"INPUT_CANCEL"}),x?pe.set(b,x):pe.delete(b);let we=ft(b);it(b).then(Re=>{X(Q,de,()=>me(P,x||void 0),$,we,Re??void 0,b).then(()=>{Le();});});},$o=()=>{if(d({type:"SET_LAST_COPIED",element:null}),!v())return;let u=l().context.inputText.trim();if(u&&!J()){d({type:"ESC"});return}let b=l().context.frozenElement||ae();b&&u&&pe.set(b,u),d({type:"CONFIRM_DISMISS"}),Le();},Da=()=>{d({type:"CONFIRM_DISMISS"}),Le();},$a=()=>{d({type:"CANCEL_DISMISS"});},Ba=()=>{d({type:"CONFIRM_AGENT_ABORT"}),ye.session.abort();},Fa=()=>{d({type:"CANCEL_AGENT_ABORT"});},Ua=()=>{if(!l().context.hasAgentProvider)return;let u=l().context.frozenElement||ae();if(u){m(u,l().context.mousePosition.x,l().context.mousePosition.y);let b=pe.get(u);b&&d({type:"INPUT_CHANGE",value:b});}w();},Ha=async()=>{let u=l().context.nativeSelectionElements;if(u.length===0)return;let b=l().context.nativeSelectionCursor.x,x=l().context.nativeSelectionCursor.y,P=I(),B=_e();_(),window.getSelection()?.removeAllRanges();let $=Ce();await X(b,x,()=>me(u),P,B,$);},Ga=()=>{if(!l().context.hasAgentProvider)return;let u=l().context.nativeSelectionElements;if(u.length===0)return;let b=I(),x=b?b.x+b.width/2:l().context.nativeSelectionCursor.x,P=b?b.y+b.height/2:l().context.nativeSelectionCursor.y;_(),window.getSelection()?.removeAllRanges(),d({type:"MOUSE_MOVE",position:{x,y:P}}),d({type:"FREEZE_ELEMENT",element:u[0]}),w(),mt();},Jr=(u,b)=>{if(v()||g())return;d({type:"MOUSE_MOVE",position:{x:u,y:b}});let x=performance.now();if(x-F>=32&&(F=x,yf(()=>{let P=To(u,b);d({type:"ELEMENT_DETECTED",element:P});})),E()){let P=Z(u,b),B=P.top||P.bottom||P.left||P.right;B&&y===null?Na():!B&&y!==null&&mn();}},Qr=(u,b)=>!D()||M()?false:(d({type:"DRAG_START",position:{x:u,y:b}}),document.body.style.userSelect="none",n.onDragStart?.(u+window.scrollX,b+window.scrollY),true),ei=(u,b)=>{if(!E())return;let x=We(u,b),P=x.x>2||x.y>2,B=P?pn(u,b):null;if(d(P?{type:"DRAG_END",position:{x:u,y:b}}:{type:"DRAG_CANCEL",position:{x:u,y:b}}),mn(),document.body.style.userSelect="",B){let $=jr(B,Ze),H=$.length>0?$:jr(B,Ze,false);if(H.length>0){n.onDragEnd?.(H,B);let Q=H[0],de=Q.getBoundingClientRect(),we={x:de.left,y:de.top,width:de.width,height:de.height,borderRadius:"0px",transform:go(Q)},Re=ft(Q),ze=we.x+we.width/2,Ye=we.y+we.height/2;l().context.hasAgentProvider?(d({type:"MOUSE_MOVE",position:{x:ze,y:Ye}}),d({type:"FREEZE_ELEMENTS",elements:H}),w(),h()||mt()):it(Q).then(It=>{X(ze,Ye,()=>me(H),we,Re,It??void 0,Q,true);});}}else {let $=To(u,b);if(!$)return;if(l().context.hasAgentProvider){if(N!==null){window.clearTimeout(N),N=null;let H=L?.element??$;L=null,m(H,u,b);let Q=pe.get(H);Q&&d({type:"INPUT_CHANGE",value:Q}),d({type:"MOUSE_MOVE",position:{x:u,y:b}}),d({type:"FREEZE_ELEMENT",element:H}),w();return}L={clientX:u,clientY:b,element:$},N=window.setTimeout(()=>{N=null;let H=L;if(L=null,!H)return;d({type:"SET_LAST_GRABBED",element:H.element});let Q=Ae(H.element),de=ft(H.element);it(H.element).then(we=>{X(H.clientX,H.clientY,()=>me([H.element]),Q,de,we??void 0,H.element);});},250);}else {d({type:"SET_LAST_GRABBED",element:$});let H=Ae($),Q=ft($);it($).then(de=>{X(u,b,()=>me([$]),H,Q,de??void 0,$);});}}},ke=va(),ti=new WeakSet,Ct=u=>u==="Enter"||u==="NumpadEnter",Tt=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,"key"),ni=false;if(Tt?.get&&!Tt.get.__reactGrabPatched){ni=true;let u=Tt.get,b=function(){return ti.has(this)?"":u.call(this)};b.__reactGrabPatched=true,Object.defineProperty(KeyboardEvent.prototype,"key",{get:b,configurable:true});}let Gt=u=>{let b;try{b=Tt?.get?Tt.get.call(u):u.key;}catch{return false}let x=b==="Enter"||Ct(u.code),P=h()||p();return x&&P&&!v()&&!l().context.isToggleMode?(ti.add(u),u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation(),true):false};ke.addDocumentListener("keydown",Gt,{capture:true}),ke.addDocumentListener("keyup",Gt,{capture:true}),ke.addDocumentListener("keypress",Gt,{capture:true}),ke.addWindowListener("keydown",u=>{if(Gt(u),u.code==="KeyZ"&&(u.metaKey||u.ctrlKey)&&!Array.from(ye.sessions().values()).some($=>!$.isStreaming&&!$.error)){let $=u.shiftKey;if($&&ye.canRedo()){u.preventDefault(),u.stopPropagation(),ye.history.redo();return}else if(!$&&ye.canUndo()){u.preventDefault(),u.stopPropagation(),ye.history.undo();return}}let x=Ct(u.code)&&p()&&!v();if(v()&&Vr(u,n)&&!u.repeat){u.preventDefault(),u.stopPropagation(),d({type:"INPUT_CANCEL"});return}if(v()||st(u,"data-react-grab-ignore-events")&&!x){u.key==="Escape"&&(ye.isProcessing()&&!te()?(u.preventDefault(),u.stopPropagation(),d({type:"ESC"})):l().context.isToggleMode&&!v()&&Le());return}if(u.key==="Escape"){if(ye.isProcessing()){te()||(u.preventDefault(),u.stopPropagation(),d({type:"ESC"}));return}if(p()||l().context.isToggleMode){Le();return}}if(p()&&!v()){let B=l().context.frozenElement||ae();if(!B)return;let $=null;switch(u.key){case "ArrowUp":case "ArrowDown":{let H=Ae(B),Q=document.elementsFromPoint(H.x+H.width/2,H.y+H.height/2).filter(Ze),de=Q.indexOf(B);if(de!==-1){let we=u.key==="ArrowUp"?1:-1;$=Q[de+we]??null;}break}case "ArrowRight":case "ArrowLeft":{let H=u.key==="ArrowRight",Q=we=>{let Re=Array.from(we.children),ze=H?Re:Re.reverse();for(let Ye of ze)if(H){if(Ze(Ye))return Ye;let It=Q(Ye);if(It)return It}else {let It=Q(Ye);if(It)return It;if(Ze(Ye))return Ye}return null},de=we=>H?we.nextElementSibling:we.previousElementSibling;if(H&&($=Q(B)),!$){let we=B;for(;we;){let Re=de(we);for(;Re;){let Ye=Q(Re);if(Ye){$=Ye;break}if(Ze(Re)){$=Re;break}Re=de(Re);}if($)break;let ze=we.parentElement;if(!H&&ze&&Ze(ze)){$=ze;break}we=ze;}}break}}if($){u.preventDefault(),u.stopPropagation(),d({type:"FREEZE_ELEMENT",element:$}),d({type:"FREEZE"});let H=Ae($);d({type:"MOUSE_MOVE",position:{x:H.x+H.width/2,y:H.y+H.height/2}});return}}let P=l().context.lastCopiedElement;if(Ct(u.code)&&!p()&&!v()&&!h()&&P&&document.contains(P)&&l().context.hasAgentProvider&&!l().context.labelInstances.some(B=>B.status==="copied"||B.status==="fading")){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation();let B=Ae(P),$=B.x+B.width/2,H=B.y+B.height/2;d({type:"MOUSE_MOVE",position:{x:$,y:H}}),m(P,$,H),d({type:"FREEZE_ELEMENT",element:P}),d({type:"SET_LAST_COPIED",element:null});let Q=pe.get(P);Q&&d({type:"INPUT_CHANGE",value:Q}),w(),mt();return}if(Ct(u.code)&&p()&&!v()&&l().context.hasAgentProvider){u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation();let B=l().context.frozenElement||ae();if(B){m(B,l().context.mousePosition.x,l().context.mousePosition.y);let $=pe.get(B);$&&d({type:"INPUT_CHANGE",value:$});}w(),C!==null&&(window.clearTimeout(C),C=null),h()||mt();return}if(u.key?.toLowerCase()==="o"&&!v()&&h()&&(u.metaKey||u.ctrlKey)){let B=l().context.selectionFilePath,$=l().context.selectionLineNumber;if(B)if(u.preventDefault(),u.stopPropagation(),n.onOpenFile)n.onOpenFile(B,$??void 0);else {let H=ho(B,$??void 0);window.open(H,"_blank");}return}if(!(!n.allowActivationInsideInput&&Xe(u))&&!(!Vr(u,n)&&(h()&&!l().context.isToggleMode&&(u.metaKey||u.ctrlKey)&&!mo.includes(u.key)&&!Ct(u.code)&&Le(),!Ct(u.code)||!p()))){if((h()||p())&&!v()&&(u.preventDefault(),Ct(u.code)&&(u.stopPropagation(),u.stopImmediatePropagation())),h()){if(l().context.isToggleMode&&n.activationMode!=="hold"||u.repeat)return;C!==null&&window.clearTimeout(C),C=window.setTimeout(()=>{Le();},200);return}if(!(p()&&u.repeat)&&!p()){let B=n.keyHoldDuration??200,$=Xe(u)?B+150:B;d({type:"HOLD_START",duration:$});}}},{capture:true}),ke.addWindowListener("keyup",u=>{if(Gt(u)||!p()&&!h()||v())return;let b=!!(n.activationShortcut||n.activationKey),P=(()=>{if(n.activationKey){let{metaKey:H,ctrlKey:Q,shiftKey:de,altKey:we}=n.activationKey;return {metaKey:!!H,ctrlKey:!!Q,shiftKey:!!de,altKey:!!we}}return {metaKey:true,ctrlKey:true,shiftKey:false,altKey:false}})(),B=P.metaKey||P.ctrlKey?!u.metaKey&&!u.ctrlKey:P.shiftKey&&!u.shiftKey||P.altKey&&!u.altKey,$=n.activationShortcut?!n.activationShortcut(u):n.activationKey?n.activationKey.key?u.key?.toLowerCase()===n.activationKey.key.toLowerCase()||Io(n.activationKey.key,u.code):false:Ao(u.key,u.code);if(h()){if(B){if(l().context.isToggleMode&&n.activationMode!=="hold")return;Le();}else !b&&$&&C!==null&&(window.clearTimeout(C),C=null);return}if($||B){if(l().context.isToggleMode&&n.activationMode!=="hold")return;p()?d({type:"RELEASE"}):Le();}},{capture:true}),ke.addWindowListener("keypress",Gt,{capture:true}),ke.addWindowListener("mousemove",u=>{d({type:"SET_TOUCH_MODE",value:false}),!st(u,"data-react-grab-ignore-events")&&(p()&&!v()&&g()&&d({type:"UNFREEZE"}),Jr(u.clientX,u.clientY));}),ke.addWindowListener("mousedown",u=>{if(u.button!==0||st(u,"data-react-grab-ignore-events"))return;if(v()){$o();return}Qr(u.clientX,u.clientY)&&(u.preventDefault(),u.stopPropagation());},{capture:true}),ke.addWindowListener("pointerdown",u=>{u.button===0&&(st(u,"data-react-grab-ignore-events")||!D()||M()||v()||u.stopPropagation());},{capture:true}),ke.addWindowListener("mouseup",u=>{u.button===0&&ei(u.clientX,u.clientY);}),ke.addWindowListener("contextmenu",u=>{if(!D()||M()||v()||!l().context.hasAgentProvider||(u.preventDefault(),u.stopPropagation(),st(u,"data-react-grab-ignore-events")))return;let b=To(u.clientX,u.clientY);if(!b)return;N!==null&&(window.clearTimeout(N),N=null,L=null),m(b,u.clientX,u.clientY);let x=pe.get(b);x&&d({type:"INPUT_CHANGE",value:x}),d({type:"MOUSE_MOVE",position:{x:u.clientX,y:u.clientY}}),d({type:"FREEZE_ELEMENT",element:b}),w();},{capture:true}),ke.addWindowListener("touchmove",u=>{u.touches.length!==0&&(d({type:"SET_TOUCH_MODE",value:true}),!st(u,"data-react-grab-ignore-events")&&(p()&&!v()&&g()&&d({type:"UNFREEZE"}),Jr(u.touches[0].clientX,u.touches[0].clientY)));},{passive:true}),ke.addWindowListener("touchstart",u=>{if(u.touches.length===0||(d({type:"SET_TOUCH_MODE",value:true}),st(u,"data-react-grab-ignore-events")))return;if(v()){$o();return}Qr(u.touches[0].clientX,u.touches[0].clientY)&&u.preventDefault();},{passive:false}),ke.addWindowListener("touchend",u=>{u.changedTouches.length!==0&&ei(u.changedTouches[0].clientX,u.changedTouches[0].clientY);}),ke.addWindowListener("click",u=>{if(!st(u,"data-react-grab-ignore-events")&&(D()||M()||T())&&(u.preventDefault(),u.stopPropagation(),l().context.isToggleMode&&!M()&&!v())){if(N!==null)return;p()?d({type:"SET_TOGGLE_MODE",value:false}):Le();}},{capture:true}),ke.addDocumentListener("visibilitychange",()=>{if(document.hidden){d({type:"CLEAR_GRABBED_BOXES"});let u=l().context.activationTimestamp;h()&&!v()&&u!==null&&Date.now()-u>500&&Le();}}),ke.addWindowListener("scroll",()=>{d({type:"VIEWPORT_CHANGE"});},{capture:true}),ke.addWindowListener("resize",()=>{d({type:"VIEWPORT_CHANGE"});}),ke.addWindowListener("popstate",()=>{_();});let At=null,ja=()=>{let u=s().enabled&&(ve()||h()||M()||l().context.labelInstances.length>0||l().context.grabbedBoxes.length>0||ye.sessions().size>0);u&&At===null?At=window.setInterval(()=>{if(d({type:"VIEWPORT_CHANGE"}),ve()){let b=l().context.nativeSelectionElements;b.length>0&&b[0]&&document.body.contains(b[0])||_();}},100):!u&&At!==null&&(window.clearInterval(At),At=null);};re(()=>{s().enabled,ve(),h(),M(),l().context.labelInstances.length,l().context.grabbedBoxes.length,ye.sessions().size,ja();}),fe(()=>{At!==null&&window.clearInterval(At);}),ke.addDocumentListener("copy",u=>{v()||st(u,"data-react-grab-ignore-events")||(D()||M())&&u.preventDefault();},{capture:true});let Un=null;ke.addDocumentListener("selectionchange",()=>{if(D())return;Un!==null&&window.clearTimeout(Un),_();let u=window.getSelection();!u||u.isCollapsed||u.rangeCount===0||(Un=window.setTimeout(()=>{Un=null;let b=window.getSelection();if(!b||b.isCollapsed||b.rangeCount===0)return;let x=b.getRangeAt(0),P=x.getBoundingClientRect();if(P.width===0&&P.height===0||!b.toString().trim())return;let $=zr(b),H=x.getClientRects();if(H.length===0)return;let Q=$?H[0]:H[H.length-1],de=$?Q.left:Q.right,we=Q.top+Q.height/2;if(Es(de,we))return;let Re=x.commonAncestorContainer,ze=Re.nodeType===Node.ELEMENT_NODE?Re:Re.parentElement;ze&&Ze(ze)&&d({type:"TEXT_SELECTED",elements:[ze],cursor:{x:de,y:we}});},150));}),fe(()=>{ke.abort(),C&&window.clearTimeout(C),N&&window.clearTimeout(N),mn(),Bn(),document.body.style.userSelect="",_t(null),ni&&Tt&&Object.defineProperty(KeyboardEvent.prototype,"key",Tt),c.stop();});let Bo=Ss(Ti),oi=u=>ee(()=>!s()[u].enabled||A()?false:D()&&!E()&&!!ne()),ri=oi("selectionBox"),za=ee(()=>{let u=ne();if(u)return ft(u)||void 0}),[Va]=Go(()=>ne(),async u=>u?await it(u)??void 0:void 0),Ka=oi("elementLabel"),Xa=ee(()=>(l().context.viewportVersion,l().context.labelInstances.map(u=>!u.element||!document.body.contains(u.element)?u:{...u,bounds:Ae(u.element)}))),Wa=ee(()=>(l().context.viewportVersion,l().context.grabbedBoxes.map(u=>!u.element||!document.body.contains(u.element)?u:{...u,bounds:Ae(u.element)}))),ii=ee(()=>s().dragBox.enabled&&D()&&Ht()),Ya=ee(()=>M()?"processing":"hover"),qa=ee(()=>{let u=s().elementLabel.enabled,b=v(),x=M(),P=D(),B=E(),$=!!ne();return !u||b?false:x?true:P&&!B&&$}),si=ee(()=>s().crosshair.enabled&&D()&&!E()&&!l().context.isTouchMode&&!g()&&!v());return re(Fe(s,u=>{u.hue!==0?Bo.style.filter=`hue-rotate(${u.hue}deg)`:Bo.style.filter="";})),s().enabled&&_i(()=>R(Js,{get selectionVisible(){return ri()},get selectionBounds(){return be()},get selectionBoundsMultiple(){return Ie()},get selectionElementsCount(){return je()},get selectionFilePath(){return l().context.selectionFilePath??void 0},get selectionLineNumber(){return l().context.selectionLineNumber??void 0},get selectionTagName(){return za()},get selectionComponentName(){return Va()},get selectionLabelVisible(){return Ka()},selectionLabelStatus:"idle",get labelInstances(){return Xa()},get dragVisible(){return ii()},get dragBounds(){return Je()},get grabbedBoxes(){return Te(()=>!!s().grabbedBoxes.enabled)()?Wa():[]},labelZIndex:2147483647,get mouseX(){return vt().x},get mouseY(){return vt().y},get crosshairVisible(){return si()},get inputValue(){return l().context.inputText},get isInputMode(){return v()},get hasAgent(){return l().context.hasAgentProvider},get isAgentConnected(){return l().context.isAgentConnected},get agentSessions(){return ye.sessions()},get supportsUndo(){return l().context.supportsUndo},get supportsFollowUp(){return l().context.supportsFollowUp},get dismissButtonText(){return l().context.dismissButtonText},onAbortSession:u=>ye.session.abort(u),onDismissSession:u=>ye.session.dismiss(u),onUndoSession:u=>ye.session.undo(u),onFollowUpSubmitSession:(u,b)=>{let x=ye.sessions().get(u),P=ye.session.getElements(u),B=x?.selectionBounds??[],$=B[0];if(x&&P.length>0&&$){let H=x.position.x,Q=x.context.sessionId??u;ye.session.dismiss(u),ye.session.start({elements:P,prompt:b,position:{x:H,y:$.y+$.height/2},selectionBounds:B,sessionId:Q});}},onAcknowledgeSessionError:u=>{let b=ye.session.acknowledgeError(u);b&&d({type:"INPUT_CHANGE",value:b});},onRetrySession:u=>{ye.session.retry(u);},onInputChange:La,onInputSubmit:()=>void Pa(),onInputCancel:$o,onToggleExpand:Ua,get isPendingDismiss(){return J()},onConfirmDismiss:Da,onCancelDismiss:$a,get isPendingAgentAbort(){return te()},onConfirmAgentAbort:Ba,onCancelAgentAbort:Fa,get nativeSelectionCursorVisible(){return ve()},get nativeSelectionCursorX(){return l().context.nativeSelectionCursor.x},get nativeSelectionCursorY(){return l().context.nativeSelectionCursor.y},get nativeSelectionTagName(){return _e()},get nativeSelectionComponentName(){return Ce()},get nativeSelectionBounds(){return I()},onNativeSelectionCopy:()=>void Ha(),onNativeSelectionEnter:Ga,get theme(){return s()},get dockVisible(){return s().dock.enabled},get isActive(){return h()},onToggleActive:()=>{h()?Le():(d({type:"SET_TOGGLE_MODE",value:true}),mt());}}),Bo),l().context.hasAgentProvider&&ye.session.tryResume(),{activate:()=>{h()||(d({type:"SET_TOGGLE_MODE",value:true}),mt());},deactivate:()=>{h()&&Le();},toggle:()=>{h()?Le():(d({type:"SET_TOGGLE_MODE",value:true}),mt());},isActive:()=>h(),dispose:()=>{qr=false,i();},copyElement:async u=>{let b=Array.isArray(u)?u:[u];return b.length===0?false:await W(b)},getState:()=>({isActive:h(),isDragging:E(),isCopying:M(),isInputMode:v(),targetElement:ae(),dragBounds:Je()?{x:Je().x,y:Je().y,width:Je().width,height:Je().height}:null}),updateTheme:u=>{let b=s(),x=Ia(b,u);a(x);},getTheme:()=>s(),setAgent:u=>{let b=ye._internal.getOptions(),x={...b,...u,provider:u.provider??b?.provider,onAbort:(P,B)=>{u?.onAbort?.(P,B),Fn(P,B);},onUndo:(P,B)=>{u?.onUndo?.(P,B),Fn(P,B);},onDismiss:u?.onDismiss};ye._internal.setOptions(x),d({type:"SET_HAS_AGENT_PROVIDER",value:!!x.provider}),d({type:"SET_AGENT_CAPABILITIES",supportsUndo:!!x.provider?.undo,supportsFollowUp:!!x.provider?.supportsFollowUp,dismissButtonText:x.provider?.dismissButtonText,isAgentConnected:false}),x.provider?.checkConnection&&x.provider.checkConnection().then(P=>{d({type:"SET_AGENT_CAPABILITIES",supportsUndo:!!x.provider?.undo,supportsFollowUp:!!x.provider?.supportsFollowUp,dismissButtonText:x.provider?.dismissButtonText,isAgentConnected:P});}),ye.session.tryResume();},updateOptions:u=>{n={...n,...u};}}}))};var Ut=null,Rw=()=>typeof window>"u"?Ut:window.__REACT_GRAB__??Ut??null,Nw=e=>{Ut=e,typeof window<"u"&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?Ut=window.__REACT_GRAB__:(Ut=Zr(),window.__REACT_GRAB__=Ut,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:Ut}))));/*! Bundled license information:
42
+ ${a}`:a;o=l,r=en(l,{prompt:n});}}}}catch(i){let s=i instanceof Error?i:new Error(String(i));e.onCopyError?.(s);let a=Ca(t);if(a.length>0){let l=n?`${n}
43
+
44
+ ${a}`:a;o=l,r=en(l,{prompt:n});}}return r&&e.onCopySuccess?.(t,o),e.onAfterCopy?.(t,r),r};var Aa=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var mt=e=>{if(e.closest(`[${Wt}]`))return false;let t=window.getComputedStyle(e);return !(!Aa(e,t)||t.pointerEvents==="none")};var Er=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(mt(r))return r;return null};var Ef=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),o=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom),s=Math.max(0,o-n),a=Math.max(0,i-r);return s*a},Sf=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,nn=(e,t,n)=>Math.min(n,Math.max(t,e)),xf=e=>e.sort((t,n)=>{if(t===n)return 0;let r=t.compareDocumentPosition(n);return r&Node.DOCUMENT_POSITION_FOLLOWING?-1:r&Node.DOCUMENT_POSITION_PRECEDING?1:0}),vf=e=>{if(e.width<=0||e.height<=0)return [];let t=window.innerWidth,n=window.innerHeight,r=e.x,o=e.y,i=e.x+e.width,s=e.y+e.height,a=r+e.width/2,l=o+e.height/2,f=nn(Math.ceil(e.width/24),3,30),d=nn(Math.ceil(e.height/24),3,30),u=f*d,p=u>600?Math.sqrt(600/u):1,m=nn(Math.floor(f*p),3,30),g=nn(Math.floor(d*p),3,30),y=new Set,_=[],I=(v,Z)=>{let Q=nn(Math.round(v),0,t-1),Y=nn(Math.round(Z),0,n-1),we=`${Q}:${Y}`;y.has(we)||(y.add(we),_.push({x:Q,y:Y}));},T=1;I(r+T,o+T),I(i-T,o+T),I(r+T,s-T),I(i-T,s-T),I(a,o+T),I(a,s-T),I(r+T,l),I(i-T,l),I(a,l);for(let v=0;v<m;v+=1){let Z=r+(v+.5)/m*e.width;for(let Q=0;Q<g;Q+=1){let Y=o+(Q+.5)/g*e.height;I(Z,Y);}}return _},_f=(e,t,n)=>{let r={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height},o=new Set,i=vf(e);for(let a of i){let l=document.elementsFromPoint(a.x,a.y);for(let f of l)o.add(f);}let s=[];for(let a of o){if(!n){let d=(a.tagName||"").toUpperCase();if(d==="HTML"||d==="BODY")continue}if(!t(a))continue;let l=a.getBoundingClientRect();if(l.width<=0||l.height<=0)continue;let f={left:l.left,top:l.top,right:l.left+l.width,bottom:l.top+l.height};if(n){let d=Ef(r,f),u=l.width*l.height;u>0&&d/u>=.75&&s.push(a);}else Sf(f,r)&&s.push(a);}return xf(s)},Cf=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),Go=(e,t,n=true)=>{let r=_f(e,t,n);return Cf(r)};var Rn=e=>(e.tagName||"").toLowerCase();var rn=e=>({x:e.x+e.width/2,y:e.y+e.height/2});var Sr=e=>!!(e&&!e.isCollapsed&&e.rangeCount>0);var Ia=e=>{if(!e.anchorNode||!e.focusNode)return false;let t=e.anchorNode.compareDocumentPosition(e.focusNode);return t&Node.DOCUMENT_POSITION_FOLLOWING?false:t&Node.DOCUMENT_POSITION_PRECEDING?true:e.anchorOffset>e.focusOffset};var jo=e=>{let n=e.getRangeAt(0).getClientRects();if(n.length===0)return null;let r=Ia(e),o=r?n[0]:n[n.length-1];return {x:r?o.left:o.right,y:o.top+o.height/2}};var xr=e=>e.length>0&&e[0]!==void 0;var Tf=new Set(["c","C","\u0441","\u0421","\u023C","\u023B","\u2184","\u2183","\u1D04","\u1D9C","\u2C7C","\u217D","\u216D","\xE7","\xC7","\u0107","\u0106","\u010D","\u010C","\u0109","\u0108","\u010B","\u010A"]),vr=(e,t)=>t==="KeyC"?true:!e||e.length!==1?false:Tf.has(e);var _r=(e,t)=>{let n=e.toLowerCase();return t.startsWith("Key")?t.slice(3).toLowerCase()===n:t.startsWith("Digit")?t.slice(5)===n:false};var zo=(e,t)=>{if(t.activationShortcut)return t.activationShortcut(e);if(t.activationKey){let{key:r,metaKey:o,ctrlKey:i,shiftKey:s,altKey:a}=t.activationKey;if(!r){if(!cr.includes(e.key))return false;let p=o?e.metaKey||e.key==="Meta":true,m=i?e.ctrlKey||e.key==="Control":true,g=s?e.shiftKey||e.key==="Shift":true,y=a?e.altKey||e.key==="Alt":true,_=p&&m&&g&&y,I=[o,i,s,a].filter(Boolean).length,T=[e.metaKey||e.key==="Meta",e.ctrlKey||e.key==="Control",e.shiftKey||e.key==="Shift",e.altKey||e.key==="Alt"].filter(Boolean).length;return _&&T>=I}let f=e.key?.toLowerCase()===r.toLowerCase()||_r(r,e.code),u=o||i||s||a?(o?e.metaKey:true)&&(i?e.ctrlKey:true)&&(s?e.shiftKey:true)&&(a?e.altKey:true):e.metaKey||e.ctrlKey;return f&&u}let n=(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey;return !!(e.key&&n&&vr(e.key,e.code))};var Qe=(e,t)=>{try{return e.composedPath().some(n=>n instanceof HTMLElement&&n.hasAttribute(t))}catch{return false}};var Cr={enabled:true,hue:0,selectionBox:{enabled:true},dragBox:{enabled:true},grabbedBoxes:{enabled:true},elementLabel:{enabled:true},crosshair:{enabled:true},toolbar:{enabled:true}},ka=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},crosshair:{enabled:t.crosshair?.enabled??e.crosshair.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),Vo=e=>e?ka(Cr,e):Cr,Oa=ka;var Ko="react-grab:agent-sessions",Af=()=>`session-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,Ra=(e,t,n,r,o)=>{let i=Date.now();return {id:Af(),context:e,lastStatus:"",isStreaming:true,createdAt:i,lastUpdatedAt:i,position:t,selectionBounds:n,tagName:r,componentName:o}},Tt=new Map,Tr=(e,t)=>{if(!t){Tt.clear(),e.forEach((n,r)=>Tt.set(r,n));return}try{let n=Object.fromEntries(e);t.setItem(Ko,JSON.stringify(n));}catch{Tt.clear(),e.forEach((n,r)=>Tt.set(r,n));}},Ar=(e,t)=>{let n=Ir(t);n.set(e.id,e),Tr(n,t);},Ir=e=>{if(!e)return new Map(Tt);try{let t=e.getItem(Ko);if(!t)return new Map;let n=JSON.parse(t);return new Map(Object.entries(n))}catch{return new Map}},kr=e=>{if(!e){Tt.clear();return}try{e.removeItem(Ko);}catch{Tt.clear();}},Xo=(e,t)=>{let n=Ir(t);n.delete(e),Tr(n,t);},At=(e,t,n)=>{let r={...e,...t,lastUpdatedAt:Date.now()};return Ar(r,n),r};var Wo=e=>{let[t,n]=z(new Map),[r,o]=z(false),[i,s]=z(false),a=new Map,l=new Map,f=[],d=e,u=()=>{let h=d?.provider?.canUndo?.()??false,w=d?.provider?.canRedo?.()??false;o(h),s(w);},p=h=>{d=h,u();},m=()=>d,g=()=>Array.from(t().values()).some(h=>h.isStreaming),y=async(h,w)=>{let A=d?.storage,$=false;try{for await(let E of w){let M=t().get(h.id);if(!M)break;let D=At(M,{lastStatus:E},A);n(W=>new Map(W).set(h.id,D)),d?.onStatus?.(E,D);}let L=t().get(h.id);if(L){let E=d?.provider?.getCompletionMessage?.(),P=At(L,{isStreaming:!1,...E?{lastStatus:E}:{}},A);n(W=>new Map(W).set(h.id,P));let M=l.get(h.id)??[],D=await d?.onComplete?.(P,M);if(u(),f.length=0,D?.error){let W=At(P,{error:D.error},A);n(F=>new Map(F).set(h.id,W));}}}catch(B){let E=t().get(h.id);if(B instanceof Error&&B.name==="AbortError"){if($=true,E){let P=l.get(h.id)??[];d?.onAbort?.(E,P);}}else {let P=B instanceof Error?B.message:"Unknown error";if(E){let M=At(E,{error:P,isStreaming:false},A);n(D=>new Map(D).set(h.id,M)),B instanceof Error&&d?.onError?.(B,M);}}}finally{a.delete(h.id),$&&(l.delete(h.id),Xo(h.id,A),n(B=>{let L=new Map(B);return L.delete(h.id),L}));}},_=h=>{let{selectionBounds:w,tagName:A}=h,$=w[0];if(!$)return;let B=$.x+$.width/2,L=$.y+$.height/2,E=document.elementFromPoint(B,L);if(!(!E||A&&!A.includes(" ")&&E.tagName.toLowerCase()!==A))return E},I=()=>{let h=d?.storage;if(!h)return;let w=Ir(h);if(w.size===0)return;let A=Date.now(),$=Array.from(w.values()).filter(L=>{if(L.isStreaming)return true;let E=L.lastUpdatedAt??L.createdAt;return A-E<1e4&&!!L.error});if($.length===0){kr(h);return}if(!d?.provider?.supportsResume||!d.provider.resume){kr(h);return}let B=new Map($.map(L=>[L.id,L]));n(B),Tr(B,h);for(let L of $){let E=_(L);E&&l.set(L.id,[E]);let P={...L,isStreaming:true,error:void 0,lastStatus:L.lastStatus||"Resuming...",position:L.position??{x:window.innerWidth/2,y:window.innerHeight/2}};n(W=>new Map(W).set(L.id,P)),d?.onResume?.(P);let M=new AbortController;a.set(L.id,M);let D=d.provider.resume(L.id,M.signal,h);y(L,D);}},T=async h=>{let{elements:w,prompt:A,position:$,selectionBounds:B,sessionId:L}=h,E=d?.storage;if(!d?.provider||w.length===0)return;let P=w[0],M=L?t().get(L):void 0,D=!!L,F={content:M?M.context.content:await tn(w,{maxLines:1/0}),prompt:A,options:d?.getOptions?.(),sessionId:D?L:void 0},U;if(M)U=At(M,{context:F,isStreaming:true,lastStatus:"Thinking\u2026"},E);else {let q=w.length>1?`${w.length} elements`:(P.tagName||"").toLowerCase()||void 0,K=w.length>1?void 0:await Qt(P)||void 0;U=Ra(F,$,B,q,K),U.lastStatus="Thinking\u2026";}l.set(U.id,w),n(q=>new Map(q).set(U.id,U)),Ar(U,E),d.onStart?.(U,w);let ae=new AbortController;a.set(U.id,ae);let k={...F,sessionId:L??U.id},G=d.provider.send(k,ae.signal);y(U,G);},v=h=>{if(h){let w=a.get(h);w&&w.abort();}else a.forEach(w=>w.abort()),a.clear(),n(new Map),kr(d?.storage);},Z=h=>{let A=t().get(h),$=l.get(h)??[];A&&$.length>0&&d?.onDismiss?.(A,$);let B=d?.storage;l.delete(h),Xo(h,B),n(L=>{let E=new Map(L);return E.delete(h),E});};return {sessions:t,isProcessing:g,canUndo:r,canRedo:i,session:{start:T,abort:v,dismiss:Z,retry:h=>{let A=t().get(h);if(!A||!d?.provider)return;let $=d.storage,B=l.get(h)??[],L=At(A,{error:void 0,isStreaming:true,lastStatus:"Retrying\u2026"},$);n(D=>new Map(D).set(h,L)),Ar(L,$),B.length>0&&d.onStart?.(L,B);let E=new AbortController;a.set(h,E);let P={...L.context,sessionId:h},M=d.provider.send(P,E.signal);y(L,M);},undo:h=>{let A=t().get(h);if(A){let $=l.get(h)??[];f.push({session:A,elements:$}),d?.onUndo?.(A,$),d?.provider?.undo?.();}Z(h),u();},getElement:h=>l.get(h)?.[0],getElements:h=>l.get(h)??[],tryResume:I,acknowledgeError:h=>{let $=t().get(h)?.context.prompt;return Z(h),$}},history:{undo:()=>{d?.provider?.undo?.(),u();},redo:()=>{let h=f.pop();if(d?.provider?.redo?.(),h){let{session:w,elements:A}=h,$=A.filter(B=>document.contains(B));if($.length>0){let B=$.map(E=>Te(E)),L={...w,selectionBounds:B};l.set(w.id,$),n(E=>new Map(E).set(w.id,L));}}u();}},_internal:{updateBoundsOnViewportChange:()=>{let h=t();if(h.size===0)return;let w=new Map(h),A=false;for(let[$,B]of h){let L=l.get($)??[],E=L[0];if(E&&document.contains(E)){let P=L.filter(M=>document.contains(M)).map(M=>Te(M));if(P.length>0){let M=B.selectionBounds[0],D=P[0],W=B.position;if(M&&D){let F=M.x+M.width/2,U=B.position.x-F,ae=D.x+D.width/2;W={...B.position,x:ae+U};}w.set($,{...B,selectionBounds:P,position:W}),A=true;}}}A&&n(w);},setOptions:p,getOptions:m}}};var Ma=(e,t)=>{let n=[],r=(f,d)=>{let u=t(f),p=document.elementsFromPoint(u.x+u.width/2,u.y+u.height/2).filter(e),m=p.indexOf(f);return m===-1?null:p[m+d]??null},o=f=>{let d=r(f,1);return d&&n.push(f),d},i=f=>{if(n.length>0){let d=n.pop();if(document.contains(d))return d}return r(f,-1)},s=(f,d)=>{let u=g=>{let y=Array.from(g.children),_=d?y:y.reverse();for(let I of _)if(d){if(e(I))return I;let T=u(I);if(T)return T}else {let T=u(I);if(T)return T;if(e(I))return I}return null},p=g=>d?g.nextElementSibling:g.previousElementSibling,m=null;if(d&&(m=u(f)),!m){let g=f;for(;g;){let y=p(g);for(;y;){let I=u(y);if(I){m=I;break}if(e(y)){m=y;break}y=p(y);}if(m)break;let _=g.parentElement;if(!d&&_&&e(_)){m=_;break}g=_;}}return m};return {findNext:(f,d)=>{switch(f){case "ArrowUp":return o(d);case "ArrowDown":return i(d);case "ArrowRight":return s(d,true);case "ArrowLeft":return s(d,false);default:return null}},clearHistory:()=>{n=[];}}};var Na=e=>{if(e.activationKey){let{metaKey:t,ctrlKey:n,shiftKey:r,altKey:o}=e.activationKey;return {metaKey:!!t,ctrlKey:!!n,shiftKey:!!r,altKey:!!o}}return {metaKey:true,ctrlKey:true,shiftKey:false,altKey:false}},La=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,"key"),n=false;if(t?.get&&!t.get.__reactGrabPatched){n=true;let o=t.get,i=function(){return e.has(this)?"":o.call(this)};i.__reactGrabPatched=true,Object.defineProperty(KeyboardEvent.prototype,"key",{get:i,configurable:true});}return {claimedEvents:e,originalKeyDescriptor:t,didPatch:n,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,"key",t);}}};var Yo=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),Pa=(e,t)=>{let n=null,r=()=>{if(!t()){i();return}let a=e(),l=Yo(a.x,a.y);l.top&&window.scrollBy(0,-10),l.bottom&&window.scrollBy(0,10),l.left&&window.scrollBy(-10,0),l.right&&window.scrollBy(10,0),l.top||l.bottom||l.left||l.right?n=requestAnimationFrame(r):n=null;},o=()=>{r();},i=()=>{n!==null&&(cancelAnimationFrame(n),n=null);};return {start:o,stop:i,isActive:()=>n!==null}};var Da=()=>{try{let e="0.0.93",t=`data:image/svg+xml;base64,${btoa(hs)}`;console.log(`%cReact Grab${e?` v${e}`:""}%c
45
+ https://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${t}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,""),navigator.onLine&&e&&fetch(`https://www.react-grab.com/api/version?source=browser&t=${Date.now()}`,{referrerPolicy:"origin",keepalive:!0,priority:"low",cache:"no-store"}).then(n=>n.text()).then(n=>{n&&n!==e&&console.warn(`[React Grab] v${e} is outdated (latest: v${n})`);}).catch(()=>null);}catch{}};var $a=e=>"scheduler"in globalThis?globalThis.scheduler.postTask(e,{priority:"background"}):"requestIdleCallback"in window?requestIdleCallback(e):setTimeout(e,0);var Ba=()=>{if(typeof window>"u")return null;try{let e=document.currentScript?.getAttribute("data-options");return e?JSON.parse(e):null}catch{return null}};var It=e=>e==="Enter"||e==="NumpadEnter";var Zo=false,Jo=e=>{if(typeof window>"u")return Ho(Vo(e?.theme));let t=Ba(),n={enabled:true,activationMode:"toggle",keyHoldDuration:200,allowActivationInsideInput:true,maxContextLines:3,...t,...e},r=Vo(n.theme);return n.enabled===false||Zo?Ho(r):(Zo=true,Da(),et(o=>{let[i,s]=z(r),[,,a]=ps(ws,{input:{theme:r,hasAgentProvider:!!n.agent?.provider,keyHoldDuration:n.keyHoldDuration??200}}),[l,f]=z(a.getSnapshot());te(()=>{let c=a.subscribe(b=>{f(b);});le(()=>c.unsubscribe());});let d=a.send.bind(a),u=()=>l().context,p=J(()=>l().matches({activation:"holding"})),m=J(()=>l().matches({activation:"active"})||l().matches({activation:{active:"hovering"}})||l().matches({activation:{active:"frozen"}})||l().matches({activation:{active:"dragging"}})||l().matches({activation:{active:"justDragged"}})),g=J(()=>l().matches({activation:{active:"frozen"}})),y=J(()=>l().matches({activation:{active:"dragging"}})),_=J(()=>l().matches({activation:{active:"justDragged"}})),I=J(()=>l().matches({interaction:"copying"})),T=J(()=>l().matches({interaction:"justCopied"})),v=J(()=>l().matches({interaction:"inputMode"})||l().matches({interaction:{inputMode:"typing"}})||l().matches({interaction:{inputMode:"confirmingDismiss"}})),Z=J(()=>l().matches({interaction:{inputMode:"confirmingDismiss"}})),Q=J(()=>l().matches({agentAbortConfirmation:"confirming"})),Y=J(()=>u().hasAgentProvider),we=false;te(()=>{let c=p(),b=m();we&&!c&&b&&(n.activationMode!=="hold"&&d({type:"SET_TOGGLE_MODE",value:true}),n.onActivate?.()),we=c;});let Ee=new WeakMap,ve=c=>{let b=Ee.get(c);b&&d({type:"INPUT_CHANGE",value:b});},me=(c,b,x)=>{$(c,b,x),ve(c);},C=J(()=>u().nativeSelectionElements.length>0),S=J(()=>{let c=u().nativeSelectionElements;if(xr(c))return Rn(c[0])||void 0}),[h]=Ur(()=>{let c=u().nativeSelectionElements;return xr(c)?c[0]:null},async c=>{if(c)return await Qt(c)||void 0}),w=()=>{d({type:"CLEAR_NATIVE_SELECTION"});},A=()=>{let c=u().frozenElement||se();c&&d({type:"INPUT_MODE_ENTER",position:{x:u().mousePosition.x,y:u().mousePosition.y},element:c});},$=(c,b,x)=>(d({type:"SET_COPY_START",position:{x:b,y:x},element:c}),Te(c)),B=()=>{let c=window.getSelection();if(!Sr(c))return;let b=jo(c);if(!b)return;let O=c.getRangeAt(0).commonAncestorContainer,H=O instanceof Element?O:O.parentElement;H&&mt(H)&&d({type:"TEXT_SELECTED",elements:[H],cursor:b});};te($e(()=>u().viewportVersion,()=>{C()&&B();}));let L=J(()=>{u().viewportVersion;let c=u().nativeSelectionElements;if(xr(c))return Te(c[0])}),E=0,P=null,M=null,D=null,W=Ma(mt,Te),F=Pa(()=>u().mousePosition,()=>y()),U=J(()=>m()&&!I()),ae=(c,b)=>{let x=`grabbed-${Date.now()}-${Math.random()}`,O=Date.now();d({type:"ADD_GRABBED_BOX",box:{id:x,bounds:c,createdAt:O,element:b}}),n.onGrabbedBox?.(c,b),setTimeout(()=>{d({type:"REMOVE_GRABBED_BOX",boxId:x});},1700);},k=c=>{let b=c.map(x=>({tagName:Rn(x)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:b}}));},G=(c,b,x,O,H,ce)=>{let Re=`label-${Date.now()}-${Math.random().toString(36).slice(2)}`,Me={id:Re,bounds:c,tagName:b,componentName:x,status:O,createdAt:Date.now(),element:H,mouseX:ce};return d({type:"ADD_LABEL_INSTANCE",instance:Me}),Re},q=(c,b)=>{d({type:"UPDATE_LABEL_INSTANCE",instanceId:c,status:b});},K=c=>{d({type:"REMOVE_LABEL_INSTANCE",instanceId:c});},pe=async(c,b,x,O,H,ce,Re,Me)=>{d({type:"COPY_START"});let Ke=O&&H?G(O,H,ce,"copying",Re,c):null;await x().finally(()=>{d({type:"COPY_DONE",element:Re}),Ke&&(q(Ke,"copied"),setTimeout(()=>{q(Ke,"fading"),setTimeout(()=>{K(Ke);},350);},1500)),(u().isToggleMode||Me)&&Oe();});},Se=(c,b)=>Ta(n,c,b),ne=async(c,b)=>{if(c.length!==0){for(let x of c)n.onElementSelect?.(x),i().grabbedBoxes.enabled&&ae(Te(x),x);await new Promise(x=>requestAnimationFrame(x)),await Se(c,b),k(c);}},fe=({element:c,positionX:b,positionY:x,elements:O,extraPrompt:H,shouldDeactivateAfter:ce,onComplete:Re})=>{let Me=Te(c),Ke=Rn(c);Qt(c).then(an=>{pe(b,x,()=>ne(O??[c],H),Me,Ke,an??void 0,c,ce).then(()=>{Re?.();});});},se=J(()=>{if(!U()||y())return null;let c=u().detectedElement;return c&&!document.contains(c)?null:c}),ke=J(()=>u().frozenElement||(g()?null:se()));te(()=>{let c=u().detectedElement;if(!c)return;let b=setInterval(()=>{document.contains(c)||d({type:"ELEMENT_DETECTED",element:null});},100);le(()=>clearInterval(b));});let ze=J(()=>{u().viewportVersion;let c=ke();if(c)return Te(c)}),on=J(()=>{u().viewportVersion;let c=u().frozenElements;return c.length===0?[]:c.map(b=>Te(b))}),Mn=J(()=>u().frozenElements.length),sn=(c,b)=>{let x=c+window.scrollX,O=b+window.scrollY;return {x:Math.abs(x-u().dragStart.x),y:Math.abs(O-u().dragStart.y)}},Ot=J(()=>{if(!y())return false;let c=sn(u().mousePosition.x,u().mousePosition.y);return c.x>2||c.y>2}),Qo=(c,b)=>{let x=c+window.scrollX,O=b+window.scrollY,H=Math.min(u().dragStart.x,x),ce=Math.min(u().dragStart.y,O),Re=Math.abs(x-u().dragStart.x),Me=Math.abs(O-u().dragStart.y);return {x:H-window.scrollX,y:ce-window.scrollY,width:Re,height:Me}},Nn=J(()=>{if(!Ot())return;let c=Qo(u().mousePosition.x,u().mousePosition.y);return {borderRadius:"0px",height:c.height,transform:"none",width:c.width,x:c.x,y:c.y}}),Nr=J(()=>{if(I()||v()){u().viewportVersion;let c=u().frozenElement||se();if(c){let b=Te(c);return {x:rn(b).x+u().copyOffsetFromCenterX,y:u().copyStart.y}}return {x:u().copyStart.x,y:u().copyStart.y}}return {x:u().mousePosition.x,y:u().mousePosition.y}});te($e(()=>[se(),u().lastGrabbedElement],([c,b])=>{b&&c&&b!==c&&d({type:"SET_LAST_GRABBED",element:null}),c&&n.onElementHover?.(c);})),te($e(()=>se(),c=>{let b=()=>{d({type:"SET_SELECTION_SOURCE",filePath:null,lineNumber:null});};if(!c){b();return}Jt(c).then(x=>{if(x){for(let O of x)if(O.fileName&&yr(O.fileName)){d({type:"SET_SELECTION_SOURCE",filePath:On(O.fileName),lineNumber:O.lineNumber??null});return}b();}}).catch(b);})),te($e(()=>u().viewportVersion,()=>ge._internal.updateBoundsOnViewportChange())),te($e(()=>[m(),y(),I(),v(),se(),Nn()],([c,b,x,O,H,ce])=>{n.onStateChange?.({isActive:c,isDragging:b,isCopying:x,isInputMode:O,targetElement:H,dragBounds:ce?{x:ce.x,y:ce.y,width:ce.width,height:ce.height}:null});})),te($e(()=>[v(),u().mousePosition.x,u().mousePosition.y,se()],([c,b,x,O])=>{n.onInputModeChange?.(c,{x:b,y:x,targetElement:O});})),te($e(()=>[oi(),ze(),se()],([c,b,x])=>{n.onSelectionBox?.(!!c,b??null,x);})),te($e(()=>[ii(),Nn()],([c,b])=>{n.onDragBox?.(!!c,b??null);})),te($e(()=>[si(),u().mousePosition.x,u().mousePosition.y],([c,b,x])=>{n.onCrosshair?.(!!c,{x:b,y:x});})),te($e(()=>[fl(),dl(),Nr()],([c,b,x])=>{n.onElementLabel?.(!!c,b,{x:x.x,y:x.y,content:""});}));let it=null,gt=c=>{c?(it||(it=document.createElement("style"),it.setAttribute("data-react-grab-cursor",""),document.head.appendChild(it)),it.textContent=`* { cursor: ${c} !important; }`):it&&(it.remove(),it=null);};te($e(()=>[m(),I(),y(),v(),se()],([c,b,x,O,H])=>{gt(b?"progress":O?null:c&&x?"crosshair":c&&H?"default":c?"crosshair":null);}));let Rt=()=>{let c=p();d({type:"ACTIVATE"}),c||n.onActivate?.();},Oe=()=>{let c=y(),b=u().previouslyFocusedElement;if(d({type:"DEACTIVATE"}),W.clearHistory(),c&&(document.body.style.userSelect=""),P&&window.clearTimeout(P),M){window.clearTimeout(M),M=null;let x=D;D=null,x&&(d({type:"SET_LAST_GRABBED",element:x.element}),fe({element:x.element,positionX:x.clientX,positionY:x.clientY}));}F.stop(),b instanceof HTMLElement&&document.contains(b)&&b.focus(),n.onDeactivate?.();},Lr=()=>{d({type:"SET_TOGGLE_MODE",value:true}),Rt();},Ln=(c,b)=>{let x=b[0];if(x&&document.contains(x)){let O=x.getBoundingClientRect(),H=O.top+O.height/2;d({type:"MOUSE_MOVE",position:{x:c.position.x,y:H}}),d({type:"FREEZE_ELEMENTS",elements:b}),d({type:"INPUT_CHANGE",value:c.context.prompt}),d({type:"SET_TOGGLE_MODE",value:true}),m()||Rt();}},Fa=n.agent?{...n.agent,onAbort:(c,b)=>{n.agent?.onAbort?.(c,b),Ln(c,b);},onUndo:(c,b)=>{n.agent?.onUndo?.(c,b),Ln(c,b);}}:void 0,ge=Wo(Fa),Ua=c=>{d({type:"INPUT_CHANGE",value:c});},Ha=()=>{d({type:"SET_LAST_COPIED",element:null});let c=u().frozenElements,b=u().frozenElement||se(),x=v()?u().inputText.trim():"";if(!b){Oe();return}let O=c.length>0?c:b?[b]:[],H=O.map(an=>Te(an)),ce=H[0],Re=u().mousePosition.x,Me=ce.x+ce.width/2,Ke=ce.y+ce.height/2;if(Y()&&x){Ee.delete(b),Oe();let an=u().replySessionId;d({type:"SET_REPLY_SESSION",sessionId:null}),ge.session.start({elements:O,prompt:x,position:{x:Re,y:Ke},selectionBounds:H,sessionId:an??void 0});return}d({type:"MOUSE_MOVE",position:{x:Me,y:Ke}}),d({type:"INPUT_CANCEL"}),x?Ee.set(b,x):Ee.delete(b),fe({element:b,positionX:Me,positionY:Ke,elements:O,extraPrompt:x||void 0,onComplete:Oe});},Pr=()=>{if(d({type:"SET_LAST_COPIED",element:null}),!v())return;let c=u().inputText.trim();if(c&&!Z()){d({type:"ESC"});return}let b=u().frozenElement||se();b&&c&&Ee.set(b,c),d({type:"CONFIRM_DISMISS"}),Oe();},Ga=()=>{d({type:"CONFIRM_DISMISS"}),Oe();},ja=()=>{d({type:"CANCEL_DISMISS"});},za=()=>{d({type:"CONFIRM_AGENT_ABORT"}),ge.session.abort();},Va=()=>{d({type:"CANCEL_AGENT_ABORT"});},Ka=()=>{if(!Y())return;let c=u().frozenElement||se();c&&me(c,u().mousePosition.x,u().mousePosition.y),A();},Xa=async()=>{let c=u().nativeSelectionElements;if(c.length===0)return;let b=u().nativeSelectionCursor.x,x=u().nativeSelectionCursor.y,O=L(),H=S();w(),window.getSelection()?.removeAllRanges();let ce=h();await pe(b,x,()=>ne(c),O,H,ce);},Wa=()=>{if(!Y())return;let c=u().nativeSelectionElements;if(c.length===0)return;let b=L(),x=b?rn(b):null;w(),window.getSelection()?.removeAllRanges(),d({type:"MOUSE_MOVE",position:{x:x?.x??u().nativeSelectionCursor.x,y:x?.y??u().nativeSelectionCursor.y}}),d({type:"FREEZE_ELEMENT",element:c[0]}),A(),Rt();},Ya=(c,b)=>{let x=ge.sessions().get(c),O=ge.session.getElements(c),H=x?.selectionBounds??[],ce=H[0];if(x&&O.length>0&&ce){let Re=x.position.x,Me=x.context.sessionId??c;ge.session.dismiss(c),ge.session.start({elements:O,prompt:b,position:{x:Re,y:ce.y+ce.height/2},selectionBounds:H,sessionId:Me});}},qa=c=>{let b=ge.session.acknowledgeError(c);b&&d({type:"INPUT_CHANGE",value:b});},Za=()=>{m()?Oe():Lr();},ei=(c,b)=>{if(v()||g())return;d({type:"MOUSE_MOVE",position:{x:c,y:b}});let x=performance.now();if(x-E>=32&&(E=x,$a(()=>{let O=Er(c,b);d({type:"ELEMENT_DETECTED",element:O});})),y()){let O=Yo(c,b),H=O.top||O.bottom||O.left||O.right;H&&!F.isActive()?F.start():!H&&F.isActive()&&F.stop();}},ti=(c,b)=>!U()||I()?false:(d({type:"DRAG_START",position:{x:c,y:b}}),document.body.style.userSelect="none",n.onDragStart?.(c+window.scrollX,b+window.scrollY),true),Ja=c=>{let b=Go(c,mt),x=b.length>0?b:Go(c,mt,false);if(x.length===0)return;n.onDragEnd?.(x,c);let O=x[0],H=rn(Te(O));Y()?(d({type:"MOUSE_MOVE",position:H}),d({type:"FREEZE_ELEMENTS",elements:x}),A(),m()||Rt()):fe({element:O,positionX:H.x,positionY:H.y,elements:x,shouldDeactivateAfter:true});},Qa=(c,b)=>{let x=Er(c,b);if(x)if(Y()){if(M!==null){window.clearTimeout(M),M=null;let O=D?.element??x;D=null,me(O,c,b),d({type:"MOUSE_MOVE",position:{x:c,y:b}}),d({type:"FREEZE_ELEMENT",element:O}),A();return}D={clientX:c,clientY:b,element:x},M=window.setTimeout(()=>{M=null;let O=D;D=null,O&&(d({type:"SET_LAST_GRABBED",element:O.element}),fe({element:O.element,positionX:O.clientX,positionY:O.clientY}));},250);}else d({type:"SET_LAST_GRABBED",element:x}),fe({element:x,positionX:c,positionY:b});},ni=(c,b)=>{if(!y())return;let x=sn(c,b),O=x.x>2||x.y>2,H=O?Qo(c,b):null;d(O?{type:"DRAG_END",position:{x:c,y:b}}:{type:"DRAG_CANCEL",position:{x:c,y:b}}),F.stop(),document.body.style.userSelect="",H?Ja(H):Qa(c,b);},_e=_a(),Pn=La(),Mt=c=>{let b;try{b=Pn.originalKeyDescriptor?.get?Pn.originalKeyDescriptor.get.call(c):c.key;}catch{return false}let x=b==="Enter"||It(c.code),O=m()||p();return x&&O&&!v()&&!u().isToggleMode?(Pn.claimedEvents.add(c),c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),true):false};_e.addDocumentListener("keydown",Mt,{capture:true}),_e.addDocumentListener("keyup",Mt,{capture:true}),_e.addDocumentListener("keypress",Mt,{capture:true});let el=c=>{if(!(c.code==="KeyZ"&&(c.metaKey||c.ctrlKey))||Array.from(ge.sessions().values()).some(H=>!H.isStreaming&&!H.error))return false;let O=c.shiftKey;return O&&ge.canRedo()?(c.preventDefault(),c.stopPropagation(),ge.history.redo(),true):!O&&ge.canUndo()?(c.preventDefault(),c.stopPropagation(),ge.history.undo(),true):false},tl=c=>{if(!m()||v())return false;let b=ke();if(!b)return false;let x=W.findNext(c.key,b);if(!x)return false;c.preventDefault(),c.stopPropagation(),d({type:"FREEZE_ELEMENT",element:x}),d({type:"FREEZE"});let O=Te(x);return d({type:"MOUSE_MOVE",position:rn(O)}),true},nl=c=>{if(!It(c.code))return false;let b=u().lastCopiedElement;if(!p()&&!v()&&!m()&&b&&document.contains(b)&&Y()&&!u().labelInstances.some(H=>H.status==="copied"||H.status==="fading")&&b){c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation();let H=rn(Te(b));return d({type:"MOUSE_MOVE",position:H}),me(b,H.x,H.y),d({type:"FREEZE_ELEMENT",element:b}),d({type:"SET_LAST_COPIED",element:null}),A(),Rt(),true}if(p()&&!v()&&Y()){c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation();let H=u().frozenElement||se();return H&&me(H,u().mousePosition.x,u().mousePosition.y),A(),P!==null&&(window.clearTimeout(P),P=null),m()||Rt(),true}return false},rl=c=>{if(c.key?.toLowerCase()!=="o"||v()||!m()||!(c.metaKey||c.ctrlKey))return false;let b=u().selectionFilePath,x=u().selectionLineNumber;if(!b)return false;if(c.preventDefault(),c.stopPropagation(),n.onOpenFile)n.onOpenFile(b,x??void 0);else {let O=ur(b,x??void 0);window.open(O,"_blank");}return true},ol=c=>{if(!(!n.allowActivationInsideInput&&je(c))&&!(!zo(c,n)&&(m()&&!u().isToggleMode&&(c.metaKey||c.ctrlKey)&&!cr.includes(c.key)&&!It(c.code)&&Oe(),!It(c.code)||!p()))){if((m()||p())&&!v()&&(c.preventDefault(),It(c.code)&&(c.stopPropagation(),c.stopImmediatePropagation())),m()){if(u().isToggleMode&&n.activationMode!=="hold"||c.repeat)return;P!==null&&window.clearTimeout(P),P=window.setTimeout(()=>{Oe();},200);return}if(!(p()&&c.repeat)&&!p()){let b=n.keyHoldDuration??200,x=je(c)?b+150:b;d({type:"HOLD_START",duration:x});}}};_e.addWindowListener("keydown",c=>{if(Mt(c),el(c))return;let b=It(c.code)&&p()&&!v();if(v()&&zo(c,n)&&!c.repeat){c.preventDefault(),c.stopPropagation(),d({type:"INPUT_CANCEL"});return}if(v()||Qe(c,"data-react-grab-ignore-events")&&!b){c.key==="Escape"&&(ge.isProcessing()&&!Q()?(c.preventDefault(),c.stopPropagation(),d({type:"ESC"})):u().isToggleMode&&!v()&&Oe());return}if(c.key==="Escape"){if(ge.isProcessing()){Q()||(c.preventDefault(),c.stopPropagation(),d({type:"ESC"}));return}if(p()||u().isToggleMode){Oe();return}}tl(c)||nl(c)||rl(c)||ol(c);},{capture:true}),_e.addWindowListener("keyup",c=>{if(Mt(c)||!p()&&!m()||v())return;let b=!!(n.activationShortcut||n.activationKey),x=Na(n),O=x.metaKey||x.ctrlKey?!c.metaKey&&!c.ctrlKey:x.shiftKey&&!c.shiftKey||x.altKey&&!c.altKey,H=n.activationShortcut?!n.activationShortcut(c):n.activationKey?n.activationKey.key?c.key?.toLowerCase()===n.activationKey.key.toLowerCase()||_r(n.activationKey.key,c.code):false:vr(c.key,c.code);if(m()){if(O){if(u().isToggleMode&&n.activationMode!=="hold")return;Oe();}else !b&&H&&P!==null&&(window.clearTimeout(P),P=null);return}if(H||O){if(u().isToggleMode&&n.activationMode!=="hold")return;p()?d({type:"RELEASE"}):Oe();}},{capture:true}),_e.addWindowListener("keypress",Mt,{capture:true}),_e.addWindowListener("mousemove",c=>{d({type:"SET_TOUCH_MODE",value:false}),!Qe(c,"data-react-grab-ignore-events")&&(m()&&!v()&&g()&&(d({type:"UNFREEZE"}),W.clearHistory()),ei(c.clientX,c.clientY));}),_e.addWindowListener("mousedown",c=>{if(c.button!==0||Qe(c,"data-react-grab-ignore-events"))return;if(v()){Pr();return}ti(c.clientX,c.clientY)&&(c.preventDefault(),c.stopPropagation());},{capture:true}),_e.addWindowListener("pointerdown",c=>{c.button===0&&(Qe(c,"data-react-grab-ignore-events")||!U()||I()||v()||c.stopPropagation());},{capture:true}),_e.addWindowListener("mouseup",c=>{c.button===0&&ni(c.clientX,c.clientY);}),_e.addWindowListener("contextmenu",c=>{if(!U()||I()||v()||!Y()||(c.preventDefault(),c.stopPropagation(),Qe(c,"data-react-grab-ignore-events")))return;let b=Er(c.clientX,c.clientY);b&&(M!==null&&(window.clearTimeout(M),M=null,D=null),me(b,c.clientX,c.clientY),d({type:"MOUSE_MOVE",position:{x:c.clientX,y:c.clientY}}),d({type:"FREEZE_ELEMENT",element:b}),A());},{capture:true}),_e.addWindowListener("touchmove",c=>{c.touches.length!==0&&(d({type:"SET_TOUCH_MODE",value:true}),!Qe(c,"data-react-grab-ignore-events")&&(p()&&!v()&&g()&&d({type:"UNFREEZE"}),ei(c.touches[0].clientX,c.touches[0].clientY)));},{passive:true}),_e.addWindowListener("touchstart",c=>{if(c.touches.length===0||(d({type:"SET_TOUCH_MODE",value:true}),Qe(c,"data-react-grab-ignore-events")))return;if(v()){Pr();return}ti(c.touches[0].clientX,c.touches[0].clientY)&&c.preventDefault();},{passive:false}),_e.addWindowListener("touchend",c=>{c.changedTouches.length!==0&&ni(c.changedTouches[0].clientX,c.changedTouches[0].clientY);}),_e.addWindowListener("click",c=>{if(!Qe(c,"data-react-grab-ignore-events")&&(U()||I()||_())&&(c.preventDefault(),c.stopPropagation(),u().isToggleMode&&!I()&&!v())){if(M!==null)return;p()?d({type:"SET_TOGGLE_MODE",value:false}):Oe();}},{capture:true}),_e.addDocumentListener("visibilitychange",()=>{if(document.hidden){d({type:"CLEAR_GRABBED_BOXES"});let c=u().activationTimestamp;m()&&!v()&&c!==null&&Date.now()-c>500&&Oe();}}),_e.addWindowListener("scroll",()=>{d({type:"VIEWPORT_CHANGE"});},{capture:true}),_e.addWindowListener("resize",()=>{d({type:"VIEWPORT_CHANGE"});}),_e.addWindowListener("popstate",()=>{w();});let ht=null,il=()=>{let c=i().enabled&&(C()||m()||I()||u().labelInstances.length>0||u().grabbedBoxes.length>0||ge.sessions().size>0);c&&ht===null?ht=window.setInterval(()=>{if(d({type:"VIEWPORT_CHANGE"}),C()){let b=u().nativeSelectionElements;b.length>0&&b[0]&&document.body.contains(b[0])||w();}},100):!c&&ht!==null&&(window.clearInterval(ht),ht=null);};te(()=>{i().enabled,C(),m(),I(),u().labelInstances.length,u().grabbedBoxes.length,ge.sessions().size,il();}),le(()=>{ht!==null&&window.clearInterval(ht);}),_e.addDocumentListener("copy",c=>{v()||Qe(c,"data-react-grab-ignore-events")||(U()||I())&&c.preventDefault();},{capture:true});let Dn=null;_e.addDocumentListener("selectionchange",()=>{if(U())return;Dn!==null&&window.clearTimeout(Dn),w();let c=window.getSelection();Sr(c)&&(Dn=window.setTimeout(()=>{Dn=null;let b=window.getSelection();if(!Sr(b))return;let x=b.getRangeAt(0),O=x.getBoundingClientRect();if(O.width===0&&O.height===0||!b.toString().trim())return;let ce=jo(b);if(!ce||Ss(ce.x,ce.y))return;let Re=x.commonAncestorContainer,Me=Re instanceof Element?Re:Re.parentElement;Me&&mt(Me)&&d({type:"TEXT_SELECTED",elements:[Me],cursor:ce});},150));}),le(()=>{_e.abort(),P&&window.clearTimeout(P),M&&window.clearTimeout(M),F.stop(),document.body.style.userSelect="",gt(null),Pn.restore(),a.stop();});let Dr=xs(Ti),ri=c=>J(()=>!i()[c].enabled||T()?false:U()&&!y()&&!!ke()),oi=ri("selectionBox"),sl=J(()=>{let c=ke();if(c)return Rn(c)||void 0}),[al]=Ur(()=>ke(),async c=>c?await Qt(c)??void 0:void 0),ll=ri("elementLabel"),cl=J(()=>(u().viewportVersion,u().labelInstances.map(c=>!c.element||!document.body.contains(c.element)?c:{...c,bounds:Te(c.element)}))),ul=J(()=>(u().viewportVersion,u().grabbedBoxes.map(c=>!c.element||!document.body.contains(c.element)?c:{...c,bounds:Te(c.element)}))),ii=J(()=>i().dragBox.enabled&&U()&&Ot()),dl=J(()=>I()?"processing":"hover"),fl=J(()=>{let c=i().elementLabel.enabled,b=v(),x=I(),O=U(),H=y(),ce=!!ke();return !c||b?false:x?true:O&&!H&&ce}),si=J(()=>i().crosshair.enabled&&U()&&!y()&&!u().isTouchMode&&!g()&&!v());return te($e(i,c=>{c.hue!==0?Dr.style.filter=`hue-rotate(${c.hue}deg)`:Dr.style.filter="";})),i().enabled&&_i(()=>N(Qs,{get selectionVisible(){return oi()},get selectionBounds(){return ze()},get selectionBoundsMultiple(){return on()},get selectionElementsCount(){return Mn()},get selectionFilePath(){return u().selectionFilePath??void 0},get selectionLineNumber(){return u().selectionLineNumber??void 0},get selectionTagName(){return sl()},get selectionComponentName(){return al()},get selectionLabelVisible(){return ll()},selectionLabelStatus:"idle",get labelInstances(){return cl()},get dragVisible(){return ii()},get dragBounds(){return Nn()},get grabbedBoxes(){return xe(()=>!!i().grabbedBoxes.enabled)()?ul():[]},labelZIndex:2147483647,get mouseX(){return Nr().x},get mouseY(){return Nr().y},get crosshairVisible(){return si()},get inputValue(){return u().inputText},get isInputMode(){return v()},get hasAgent(){return Y()},get isAgentConnected(){return u().isAgentConnected},get agentSessions(){return ge.sessions()},get supportsUndo(){return u().supportsUndo},get supportsFollowUp(){return u().supportsFollowUp},get dismissButtonText(){return u().dismissButtonText},get onAbortSession(){return ge.session.abort},get onDismissSession(){return ge.session.dismiss},get onUndoSession(){return ge.session.undo},onFollowUpSubmitSession:Ya,onAcknowledgeSessionError:qa,get onRetrySession(){return ge.session.retry},onInputChange:Ua,onInputSubmit:()=>void Ha(),onInputCancel:Pr,onToggleExpand:Ka,get isPendingDismiss(){return Z()},onConfirmDismiss:Ga,onCancelDismiss:ja,get isPendingAgentAbort(){return Q()},onConfirmAgentAbort:za,onCancelAgentAbort:Va,get nativeSelectionCursorVisible(){return C()},get nativeSelectionCursorX(){return u().nativeSelectionCursor.x},get nativeSelectionCursorY(){return u().nativeSelectionCursor.y},get nativeSelectionTagName(){return S()},get nativeSelectionComponentName(){return h()},get nativeSelectionBounds(){return L()},onNativeSelectionCopy:()=>void Xa(),onNativeSelectionEnter:Wa,get theme(){return i()},get toolbarVisible(){return i().toolbar.enabled},get isActive(){return m()},onToggleActive:Za}),Dr),Y()&&ge.session.tryResume(),{activate:()=>{m()||Lr();},deactivate:()=>{m()&&Oe();},toggle:()=>{m()?Oe():Lr();},isActive:()=>m(),dispose:()=>{Zo=false,o();},copyElement:async c=>{let b=Array.isArray(c)?c:[c];return b.length===0?false:await Se(b)},getState:()=>({isActive:m(),isDragging:y(),isCopying:I(),isInputMode:v(),targetElement:se(),dragBounds:Nn()??null}),updateTheme:c=>{let b=i(),x=Oa(b,c);s(x);},getTheme:()=>i(),setAgent:c=>{let b=ge._internal.getOptions(),x={...b,...c,provider:c.provider??b?.provider,onAbort:(O,H)=>{c?.onAbort?.(O,H),Ln(O,H);},onUndo:(O,H)=>{c?.onUndo?.(O,H),Ln(O,H);},onDismiss:c?.onDismiss};ge._internal.setOptions(x),d({type:"SET_HAS_AGENT_PROVIDER",value:!!x.provider}),d({type:"SET_AGENT_CAPABILITIES",supportsUndo:!!x.provider?.undo,supportsFollowUp:!!x.provider?.supportsFollowUp,dismissButtonText:x.provider?.dismissButtonText,isAgentConnected:false}),x.provider?.checkConnection&&x.provider.checkConnection().then(O=>{d({type:"SET_AGENT_CAPABILITIES",supportsUndo:!!x.provider?.undo,supportsFollowUp:!!x.provider?.supportsFollowUp,dismissButtonText:x.provider?.dismissButtonText,isAgentConnected:O});}),ge.session.tryResume();},updateOptions:c=>{n={...n,...c};}}}))};var kt=null,h0=()=>typeof window>"u"?kt:window.__REACT_GRAB__??kt??null,b0=e=>{kt=e,typeof window<"u"&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__);};typeof window<"u"&&(window.__REACT_GRAB__?kt=window.__REACT_GRAB__:(kt=Jo(),window.__REACT_GRAB__=kt,window.dispatchEvent(new CustomEvent("react-grab:init",{detail:kt}))));/*! Bundled license information:
44
46
 
45
47
  bippy/dist/rdt-hook-BZMdLD7S.js:
46
48
  (**
@@ -91,4 +93,4 @@ bippy/dist/index.js:
91
93
  * This source code is licensed under the MIT license found in the
92
94
  * LICENSE file in the root directory of this source tree.
93
95
  *)
94
- */exports.DEFAULT_THEME=ko;exports.formatElementInfo=Co;exports.generateSnippet=dn;exports.getGlobalApi=Rw;exports.getStack=cn;exports.init=Zr;exports.isInstrumentationActive=ln;exports.setGlobalApi=Nw;return exports;})({});
96
+ */exports.DEFAULT_THEME=Cr;exports.formatElementInfo=wr;exports.generateSnippet=tn;exports.getGlobalApi=h0;exports.getStack=Jt;exports.init=Jo;exports.isInstrumentationActive=Zt;exports.setGlobalApi=b0;return exports;})({});