react-grab 0.1.48-dev.a036acc → 0.1.48-dev.c7c0198
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/copy-content-CACCoy_N.js +10 -0
- package/dist/{copy-content-BPB8MmpL.d.cts → copy-content-Ca2txV90.d.cts} +25 -15
- package/dist/{copy-content-C7lFyXsY.d.ts → copy-content-D6YIoJK4.d.ts} +25 -15
- package/dist/copy-content-DQ0_ITeM.cjs +10 -0
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +1 -1
- package/dist/{core-Cs4nKfRj.cjs → core-a0_RN3i0.cjs} +4 -4
- package/dist/{core-DtDBp7P-.js → core-cmGjioE9.js} +4 -4
- package/dist/{create-pointer-move-prompt-handoff-DRZp7pT5.js → create-pointer-move-prompt-handoff-BsTTt1Ah.js} +1 -1
- package/dist/{create-pointer-move-prompt-handoff-D4JZbeiE.cjs → create-pointer-move-prompt-handoff-CztPxi4A.cjs} +1 -1
- package/dist/freeze-updates-BRkI54pl.js +52 -0
- package/dist/freeze-updates-BoR9QPne.cjs +52 -0
- package/dist/{index-VkohC_Hw.d.ts → index-C_tGQJlm.d.ts} +1 -1
- package/dist/{index-DMyJsiaz.d.cts → index-CgWlIagV.d.cts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.global.js +17 -16
- package/dist/index.js +1 -1
- package/dist/primitives.cjs +2 -2
- package/dist/primitives.d.cts +1 -1
- package/dist/primitives.d.ts +1 -1
- package/dist/primitives.js +2 -2
- package/dist/{renderer-D07SadMO.cjs → renderer-BWZ-_wu3.cjs} +1 -1
- package/dist/renderer-sJ2xECuN.js +9 -0
- package/package.json +3 -3
- package/dist/copy-content-HtjEd7D4.js +0 -10
- package/dist/copy-content-i_57jcU1.cjs +0 -10
- package/dist/freeze-updates-2TTw39qB.js +0 -51
- package/dist/freeze-updates-m7dy-Od3.cjs +0 -51
- package/dist/renderer-DhsYpO42.js +0 -9
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license MIT
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2025 Aiden Bai
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import{$ as e,Ct as t,Et as n,F as r,G as i,I as a,J as o,K as s,L as c,Ot as l,Q as u,R as d,St as f,Tt as p,U as m,W as h,X as g,Y as _,_ as v,a as y,c as b,ct as x,d as S,dt as C,et as w,f as T,ft as E,g as D,gt as O,h as k,ht as A,i as ee,l as j,lt as M,m as N,mt as P,n as te,nt as F,ot as ne,p as re,pt as ie,q as I,r as L,rt as R,st as z,t as ae,tt as B,u as V,ut as oe,v as H,wt as U,yt as W}from"./create-pointer-move-prompt-handoff-BsTTt1Ah.js";import{$ as se,Ct as G,Dt as K,Ft as ce,Gt as le,H as q,Ht as ue,K as de,Kt as fe,Pt as pe,Q as me,St as he,Tt as ge,Ut as _e,V as ve,W as ye,X as be,Y as xe,Yt as Se,Z as Ce,_ as we,at as Te,bt as Ee,ct as De,et as J,g as Oe,ht as Y,i as ke,it as Ae,nt as X,q as je,r as Me,rt as Ne,s as Pe,st as Fe,t as Ie,tt as Le,ut as Re,wt as ze,zt as Be}from"./freeze-updates-BRkI54pl.js";const Ve=(e,t,n)=>e+(t-e)*n,He=(e,t)=>{let n=Math.max(t,1);return 1-(1-e)**(n/q)};var Ue=F(`<canvas data-react-grab-overlay-canvas style=position:fixed;top:0;left:0;pointer-events:none>`);const We={borderColor:he,fillColor:ze,lerpFactor:ce},Ge={drag:{borderColor:G,fillColor:ge,lerpFactor:je},selection:We,grabbed:We},Ke=n=>{let r,i=null,a=0,o=0,s=1,c=null,l=null,u={drag:{canvas:null,context:null},selection:{canvas:null,context:null},grabbed:{canvas:null,context:null}},d=[],f=null,m=[],h=Se()?`display-p3`:`srgb`,g=(e,t,n)=>{let r=new OffscreenCanvas(e*n,t*n),i=r.getContext(`2d`,{colorSpace:h});return i&&i.scale(n,n),{canvas:r,context:i}},_=()=>{if(r){s=Math.max(window.devicePixelRatio||1,2),a=document.documentElement.clientWidth||window.innerWidth,o=document.documentElement.clientHeight||window.innerHeight,r.width=a*s,r.height=o*s,r.style.width=`${a}px`,r.style.height=`${o}px`,i=r.getContext(`2d`,{colorSpace:h}),i&&i.scale(s,s);for(let e of Object.keys(u))u[e]=g(a,o,s)}},v=e=>{if(!e)return 0;let t=e.match(/^(\d+(?:\.\d+)?)/);return t?parseFloat(t[1]):0},y=(e,t,n)=>({id:e,current:{x:t.x,y:t.y,width:t.width,height:t.height},target:{x:t.x,y:t.y,width:t.width,height:t.height},borderRadius:v(t.borderRadius),opacity:n?.opacity??1,targetOpacity:n?.targetOpacity??n?.opacity??1,createdAt:n?.createdAt,fadeStartTimestamp:null,isInitialized:!0}),b=(e,t,n)=>{let r=e.target;r.x=t.x,r.y=t.y,r.width=t.width,r.height=t.height,e.borderRadius=v(t.borderRadius),n!==void 0&&(e.targetOpacity=n)},x=e=>e.boundsMultiple??[e.bounds],S=(e,t,n,r,i,a,o,s,c=1)=>{if(r<=0||i<=0)return;let l=Math.min(r/2,i/2),u=Math.min(a,l),d=c!==1;d&&(e.globalAlpha=c),e.beginPath(),u>0?e.roundRect(t,n,r,i,u):e.rect(t,n,r,i),e.fillStyle=o,e.fill(),e.strokeStyle=s,e.lineWidth=1,e.stroke(),d&&(e.globalAlpha=1)},C=()=>{let e=u.drag;if(!e.context)return;let t=e.context;if(t.clearRect(0,0,a,o),!n.dragVisible||!f)return;let r=Ge.drag;S(t,f.current.x,f.current.y,f.current.width,f.current.height,f.borderRadius,r.fillColor,r.borderColor)},w=()=>{let e=u.selection;if(!e.context)return;let t=e.context;if(t.clearRect(0,0,a,o),!n.selectionVisible)return;let r=Ge.selection;for(let e of d)S(t,e.current.x,e.current.y,e.current.width,e.current.height,e.borderRadius,r.fillColor,r.borderColor,e.opacity)},T=(e,t)=>{let n=u[e];if(!n.context)return;let r=n.context;r.clearRect(0,0,a,o);let i=Ge[e];for(let e of t)S(r,e.current.x,e.current.y,e.current.width,e.current.height,e.borderRadius,i.fillColor,i.borderColor,e.opacity)},E=()=>{if(!(!i||!r)&&!(a<=0||o<=0)){i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,r.width,r.height),i.setTransform(s,0,0,s,0,0),C(),w(),T(`grabbed`,m);for(let e of[`drag`,`selection`,`grabbed`]){let t=u[e];t.canvas&&i.drawImage(t.canvas,0,0,a,o)}}},D=(e,t,n)=>{let r=Ve(e.current.x,e.target.x,t),i=Ve(e.current.y,e.target.y,t),a=Ve(e.current.width,e.target.width,t),o=Ve(e.current.height,e.target.height,t),s=Math.abs(r-e.target.x)<.5&&Math.abs(i-e.target.y)<.5&&Math.abs(a-e.target.width)<.5&&Math.abs(o-e.target.height)<.5;e.current.x=s?e.target.x:r,e.current.y=s?e.target.y:i,e.current.width=s?e.target.width:a,e.current.height=s?e.target.height:o;let c=!0;if(n?.interpolateOpacity){let n=Ve(e.opacity,e.targetOpacity,t);c=Math.abs(n-e.targetOpacity)<Ee,e.opacity=c?e.targetOpacity:n}return!s||!c},k=()=>{let e=performance.now(),t=l===null?q:e-l;l=e;let n=He(Ge.drag.lerpFactor,t),r=He(Ge.selection.lerpFactor,t),i=He(Ge.grabbed.lerpFactor,t),a=!1;f?.isInitialized&&D(f,n)&&(a=!0);for(let e of d)e.isInitialized&&D(e,r)&&(a=!0);let o=Date.now();m=m.filter(t=>{let n=t.id.startsWith(`label-`);if(t.isInitialized&&D(t,i)&&(a=!0),n&&t.targetOpacity===0){t.fadeStartTimestamp===null&&(t.fadeStartTimestamp=e);let n=e-t.fadeStartTimestamp,r=Math.min(1,n/125),i=1-(1-r)*(1-r);return t.opacity=Math.max(0,1-i),r>=1?!1:(a=!0,!0)}else n&&(t.fadeStartTimestamp=null);if(t.createdAt){let e=o-t.createdAt;if(e>=1625)return!1;if(e>1500){let n=Math.min(1,(e-De)/125);t.opacity=1-(1-(1-n)*(1-n)),a=!0}return!0}return n?!0:t.opacity>0}),E(),a?c=we(k):(c=null,l=null)},A=()=>{c===null&&(c=we(k))},ee=()=>{_(),A()};return P(t(()=>[n.selectionVisible,n.selectionBounds,n.selectionBoundsMultiple,n.selectionShouldSnap],([e,t,n,r])=>{if(!e||!t&&(!n||n.length===0)){d=[],A();return}let i;i=n&&n.length>0?n:t?[t]:[];let a=new Map;for(let e of d)a.set(e.id,e);d=i.map((e,t)=>{let n=`selection-${t}`,i=a.get(n);return i?(b(i,e),r&&(i.current.x=i.target.x,i.current.y=i.target.y,i.current.width=i.target.width,i.current.height=i.target.height),i):y(n,e)}),A()})),P(t(()=>[n.dragVisible,n.dragBounds],([e,t])=>{if(!e||!t){f=null,A();return}f?b(f,t):f=y(`drag`,t),A()})),P(t(()=>[n.grabbedBoxes,n.labelInstances],([e,t])=>{let n=e??[],r=t??[],i=new Map;for(let e of n)i.set(e.id,e);let a=new Map;for(let e of m)a.set(e.id,e);for(let e of n)if(!a.has(e.id)){let t=y(e.id,e.bounds,{createdAt:e.createdAt});m.push(t),a.set(e.id,t)}for(let e of m){let t=i.get(e.id);t&&b(e,t.bounds)}let o=new Set;for(let e of r){let t=x(e),n=e.status===`fading`?0:1;for(let r=0;r<t.length;r++){let i=t[r],s=`label-${e.id}-${r}`;o.add(s);let c=a.get(s);if(c)b(c,i,n);else{let e=y(s,i,{opacity:1,targetOpacity:n});m.push(e),a.set(s,e)}}}m=m.filter(e=>e.id.startsWith(`label-`)?o.has(e.id):i.has(e.id)),A()})),p(()=>{_(),A(),window.addEventListener(`resize`,ee);let e=null,t=()=>{Math.max(window.devicePixelRatio||1,2)!==s&&(ee(),n())},n=()=>{e&&e.removeEventListener(`change`,t),e=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),e.addEventListener(`change`,t)};n(),U(()=>{window.removeEventListener(`resize`,ee),e&&e.removeEventListener(`change`,t),c!==null&&Oe(c)})}),(()=>{var t=Ue(),n=r;return typeof n==`function`?R(n,t):r=t,O(n=>e(t,`z-index`,String(_e))),t})()};var qe=F(`<div style=position:fixed;pointer-events:none;will-change:opacity;contain:strict;transform:translateZ(0)>`);const Je=t=>{let n=le(),r=n?getComputedStyle(n).borderRadius:`0px`,i=()=>n?.getBoundingClientRect()??null,[a,o]=W(i());if(n){let e=()=>o(i());p(()=>{let t=new ResizeObserver(e);t.observe(n),window.addEventListener(`scroll`,e,{capture:!0,passive:!0}),window.addEventListener(`resize`,e),U(()=>{t.disconnect(),window.removeEventListener(`scroll`,e,{capture:!0}),window.removeEventListener(`resize`,e)})}),P(()=>{t.visible&&e()})}let s=()=>{let e=a();return e?`${e.top}px`:`0`},c=()=>{let e=a();return e?`${e.left}px`:`0`},l=()=>{let e=a();return e?`${e.width}px`:`100%`},u=()=>{let e=a();return e?`${e.height}px`:`100%`};return(()=>{var n=qe();return e(n,`border-radius`,r),e(n,`z-index`,_e),e(n,`transition`,`opacity 125ms ease-out`),e(n,`box-shadow`,`inset 0 0 50px ${Re}`),O(r=>{var i=s(),a=c(),o=l(),d=u(),f=+!!t.visible;return i!==r.e&&e(n,`top`,r.e=i),a!==r.t&&e(n,`left`,r.t=a),o!==r.a&&e(n,`width`,r.a=o),d!==r.o&&e(n,`height`,r.o=d),f!==r.i&&e(n,`opacity`,r.i=f),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()},Ye=(e,t)=>{e.style.height=`auto`,e.style.height=`${Math.min(e.scrollHeight,t)}px`},Xe=(e,t)=>{e&&e.focus(t)},Ze=e=>{if(e<=0)return 8;let t=e*ve;return Math.round(Math.max(4,Math.min(8,t)))},Qe=()=>{let e=le();if(e){let t=e.getBoundingClientRect();return{width:t.width,height:t.height,offsetLeft:t.left,offsetTop:t.top}}let t=window.visualViewport;return t?{width:t.width,height:t.height,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop}:{width:window.innerWidth,height:window.innerHeight,offsetLeft:0,offsetTop:0}},$e=e=>{if(typeof e==`string`||typeof e==`number`)return String(e);if(!e||typeof e!=`object`)return``;if(Array.isArray(e)){let t=``;for(let n of e){if(!n)continue;let e=$e(n);e&&(t=t?`${t} ${e}`:e)}return t}let t=``;for(let n in e)e[n]&&(t=t?`${t} ${n}`:n);return t},Z=(...e)=>{let t=``;for(let n of e){if(!n)continue;let e=$e(n);e&&(t=t?`${t} ${e}`:e)}return t},et=e=>e.elementsCount&&e.elementsCount>1?{tagName:`${e.elementsCount} elements`,componentName:void 0}:{tagName:e.tagName||e.componentName||`element`,componentName:e.tagName?e.componentName:void 0};var tt=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M19.2929 12.7071C19.6834 13.0976 20.3166 13.0976 20.7071 12.7071C21.0976 12.3166 21.0976 11.6834 20.7071 11.2929L12.7071 3.29289C12.5196 3.10536 12.2652 3 12 3C11.7348 3 11.4804 3.10536 11.2929 3.29289L3.29289 11.2929C2.90237 11.6834 2.90237 12.3166 3.29289 12.7071C3.68342 13.0976 4.31658 13.0976 4.70711 12.7071L11 6.41421L11 20C11 20.5523 11.4477 21 12 21C12.5523 21 13 20.5523 13 20L13 6.41422L19.2929 12.7071Z">`);const nt=e=>{let t=()=>e.size??10;return(()=>{var n=tt();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var rt=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round><path class=icon-loader-bar d="M12 2v4"style=animation-delay:0ms></path><path class=icon-loader-bar d="M15 6.8l2-3.5"style=animation-delay:-42ms></path><path class=icon-loader-bar d="M17.2 9l3.5-2"style=animation-delay:-83ms></path><path class=icon-loader-bar d="M18 12h4"style=animation-delay:-125ms></path><path class=icon-loader-bar d="M17.2 15l3.5 2"style=animation-delay:-167ms></path><path class=icon-loader-bar d="M15 17.2l2 3.5"style=animation-delay:-208ms></path><path class=icon-loader-bar d="M12 18v4"style=animation-delay:-250ms></path><path class=icon-loader-bar d="M9 17.2l-2 3.5"style=animation-delay:-292ms></path><path class=icon-loader-bar d="M6.8 15l-3.5 2"style=animation-delay:-333ms></path><path class=icon-loader-bar d="M2 12h4"style=animation-delay:-375ms></path><path class=icon-loader-bar d="M6.8 9l-3.5-2"style=animation-delay:-417ms></path><path class=icon-loader-bar d="M9 6.8l-2-3.5"style=animation-delay:-458ms>`);const it=e=>{let t=()=>e.size??16;return(()=>{var n=rt();return n.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling,O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var at=F(`<svg data-react-grab-arrow class="absolute block z-10"><path>`);const ot=t=>{let n=()=>t.color??`var(--rg-panel-bg)`,r=()=>t.position===`bottom`,i=()=>Ze(t.labelWidth??0),a=()=>i()*2,o=()=>i(),s=()=>{let e=a(),t=o(),n=1*Math.SQRT1_2,i=e/2,s=r()?t:0,c=r()?n:t-n,l=+!!r();return`M0 ${s} L${i-n} ${c} A1 1 0 0 ${l} ${i+n} ${c} L${e} ${s} Z`};return(()=>{var i=at(),c=i.firstChild;return O(l=>{var d=a(),f=o(),p=`0 0 ${a()} ${o()}`,m=`calc(${t.leftPercent}% + ${t.leftOffsetPx}px)`,h=r()?`0`:void 0,g=r()?void 0:`0`,_=r()?`translateX(-50%) translateY(calc(-100% + 1px))`:`translateX(-50%) translateY(calc(100% - 1px))`,v=s(),y=n();return d!==l.e&&u(i,`width`,l.e=d),f!==l.t&&u(i,`height`,l.t=f),p!==l.a&&u(i,`viewBox`,l.a=p),m!==l.o&&e(i,`left`,l.o=m),h!==l.i&&e(i,`top`,l.i=h),g!==l.n&&e(i,`bottom`,l.n=g),_!==l.s&&e(i,`transform`,l.s=_),v!==l.h&&u(c,`d`,l.h=v),y!==l.r&&u(c,`fill`,l.r=y),l},{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}),i})()};var st=F(`<span class=text-[var(--rg-text-primary)]>`),ct=F(`<span class=text-[var(--rg-text-secondary)]>.`),lt=F(`<span class="text-[13px] leading-4 h-fit font-medium overflow-hidden text-ellipsis whitespace-nowrap min-w-0">`),ut=F(`<button type=button>`),dt=F(`<div>`);const ft=e=>{let t=()=>{e.onHoverChange?.(!0)},n=()=>{e.onHoverChange?.(!1)},r=()=>e.componentName?`${e.componentName}.${e.tagName}`:e.tagName,a=()=>(()=>{var t=lt();return _(t,E(M,{get when(){return e.componentName},get children(){return[(()=>{var t=st();return _(t,()=>e.componentName),t})(),(()=>{var t=ct();return t.firstChild,_(t,()=>e.tagName,null),t})()]}}),null),_(t,E(M,{get when(){return!e.componentName},get children(){var t=st();return _(t,()=>e.tagName),t}}),null),t})();return E(M,{get when(){return e.isClickable},get fallback(){return(()=>{var r=dt();return i(r,`click`,e.onClick,!0),r.addEventListener(`mouseleave`,n),r.addEventListener(`mouseenter`,t),_(r,a),O(()=>I(r,Z(`contain-layout flex items-center gap-1 max-w-[280px] overflow-hidden`,e.shrink&&`shrink-0`))),r})()},get children(){var o=ut();return i(o,`click`,e.onClick,!0),o.addEventListener(`mouseleave`,n),o.addEventListener(`mouseenter`,t),_(o,a),O(t=>{var n=`Open source for ${r()}`,i=Z(`contain-layout flex items-center gap-1 max-w-[280px] overflow-hidden cursor-pointer bg-transparent border-none p-0 m-0 text-left`,e.shrink&&`shrink-0`);return n!==t.e&&u(o,`aria-label`,t.e=n),i!==t.t&&I(o,t.t=i),t},{e:void 0,t:void 0}),o}})};o([`click`]);var pt=F(`<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-1.5 w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[var(--rg-border-subtle)] antialiased rounded-t-none rounded-b-[6px]">`);const mt=e=>(()=>{var t=pt();return _(t,()=>e.children),t})(),ht=(e,t={})=>(n={})=>{let r=t.variants;if(!r)return e;let i=[e];for(let e in r){let a=n[e]??t.defaultVariants?.[e];if(a===void 0)continue;let o=r[e][String(a)];o&&i.push(o)}return Z(...i)};var gt=F(`<div>`);const _t=ht(`contain-layout antialiased [font-synthesis:none] bg-[var(--rg-panel-bg)]`,{variants:{shape:{panel:`rounded-[14px] [corner-shape:superellipse(1.25)]`,pill:`rounded-full`}},defaultVariants:{shape:`panel`}}),vt=e=>{let[t,r]=n(e,[`shape`,`class`]);return(()=>{var e=gt();return w(e,f({get class(){return Z(_t({shape:t.shape}),t.class)}},r),!1,!1),e})()};let yt=null;const bt={claim:e=>{yt=e},release:e=>{yt===e&&(yt=null)},isActive:e=>yt===e},xt=e=>{let t=Symbol(),n=fe(n=>{bt.isActive(t)&&(m(n)||(n.code===`Enter`?e.onEnter?.(n):n.code===`Escape`&&e.onEscape?.(n)))});return p(()=>{bt.claim(t),window.addEventListener(`keydown`,n,{capture:!0})}),U(()=>{bt.release(t),window.removeEventListener(`keydown`,n,{capture:!0})}),{claimFocus:()=>bt.claim(t)}};var St=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M10.7071 21.2071C10.3166 21.5976 9.68342 21.5976 9.29289 21.2071L3.29289 15.2071C2.90237 14.8166 2.90237 14.1834 3.29289 13.7929L9.29289 7.79289C9.68342 7.40237 10.3166 7.40237 10.7071 7.79289C11.0976 8.18342 11.0976 8.81658 10.7071 9.20711L6.41421 13.5H16C16.5523 13.5 17 13.0523 17 12.5V3.5C17 2.94772 17.4477 2.5 18 2.5C18.5523 2.5 19 2.94772 19 3.5V12.5C19 14.1569 17.6569 15.5 16 15.5H6.41421L10.7071 19.7929C11.0976 20.1834 11.0976 20.8166 10.7071 21.2071Z">`);const Ct=e=>{let t=()=>e.size??10;return(()=>{var n=St();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var wt=F(`<button>`);const Tt=ht(`contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all press-scale`,{variants:{variant:{chip:`px-[3px] py-px h-[17px] rounded-sm bg-[var(--rg-surface-hover)] [border-width:0.5px] border-solid border-[var(--rg-border-button)] hover:bg-[var(--rg-surface-active)] text-[var(--rg-text-primary)]`,destructive:`px-[3px] py-px h-[17px] rounded-sm bg-[var(--rg-error-bg)] hover:bg-[var(--rg-error-bg-hover)] text-[var(--rg-error-text)]`,ghost:`rounded-sm bg-transparent hover:bg-[var(--rg-surface-hover)] border-none outline-none p-0`}},defaultVariants:{variant:`chip`}}),Et=e=>{let[t,r]=n(e,[`variant`,`class`,`type`]);return(()=>{var e=wt();return w(e,f({get type(){return t.type??`button`},get class(){return Z(Tt({variant:t.variant}),t.class)}},r),!1,!1),e})()};var Dt=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">No`),Ot=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Copy`),kt=F(`<span class="text-[var(--rg-error-text)] text-[13px] leading-3.5 font-sans font-medium">Yes`),At=F(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">`),jt=F(`<div data-react-grab-discard-prompt class="contain-layout shrink-0 flex flex-col justify-center items-end w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">`);const Mt=e=>{let t=()=>e.showCancel??!0,{claimFocus:n}=xt({onEnter:t=>{t.preventDefault(),t.stopPropagation();let n=t.composedPath()[0],r=n instanceof HTMLElement?n:null;if(r?.closest(`[data-react-grab-discard-copy]`)){e.onCopy?.();return}if(r?.closest(`[data-react-grab-discard-no]`)){e.onCancel?.();return}if(r?.closest(`[data-react-grab-discard-yes]`)){e.onConfirm?.();return}e.onConfirm?.()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.cancelOnEscape?e.onCancel?.():e.onConfirm?.()}});return(()=>{var r=jt(),a=r.firstChild.firstChild;return i(r,`click`,n,!0),i(r,`pointerdown`,n,!0),_(a,()=>e.label??`Discard?`),_(r,E(mt,{get children(){var n=At();return _(n,E(M,{get when(){return t()},get children(){return E(Et,{"data-react-grab-discard-no":!0,get onClick(){return e.onCancel},get children(){return Dt()}})}}),null),_(n,E(M,{get when(){return e.onCopy},get children(){return E(Et,{"data-react-grab-discard-copy":!0,get onClick(){return e.onCopy},get children(){return Ot()}})}}),null),_(n,E(Et,{variant:`destructive`,class:`gap-0.5`,"data-react-grab-discard-yes":!0,get onClick(){return e.onConfirm},get children(){return[kt(),E(Ct,{size:10,class:`text-[var(--rg-error-text)] opacity-50`})]}}),null),n}}),null),r})()};o([`pointerdown`,`click`]);var Nt=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M7 2C4.23858 2 2 4.23858 2 7V15C2 17.7614 4.23858 20 7 20H8C8.55228 20 9 19.5523 9 19C9 18.4477 8.55228 18 8 18H7C5.34315 18 4 16.6569 4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V15C20 16.6569 18.6569 18 17 18H14.4142L16.2071 16.2071C16.5976 15.8166 16.5976 15.1834 16.2071 14.7929C15.8166 14.4024 15.1834 14.4024 14.7929 14.7929L11.2929 18.2929C11.197 18.3888 11.1247 18.4993 11.0759 18.6172C11.027 18.7351 11 18.8644 11 19C11 19.2728 11.1093 19.5201 11.2864 19.7005C11.2889 19.7031 11.2914 19.7056 11.2939 19.7081L14.7929 23.2071C15.1834 23.5976 15.8166 23.5976 16.2071 23.2071C16.5976 22.8166 16.5976 22.1834 16.2071 21.7929L14.4142 20H17C19.7614 20 22 17.7614 22 15V7C22 4.23858 19.7614 2 17 2H7Z">`);const Pt=e=>{let t=()=>e.size??12;return(()=>{var n=Nt();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var Ft=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Retry`),It=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Ok`),Lt=F(`<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit">`),Rt=F(`<div data-react-grab-error role=alert aria-live=assertive class="contain-layout shrink-0 flex flex-col justify-center items-end w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-start gap-1 px-2 w-full h-fit"><span class="text-[var(--rg-error-text)] text-[13px] leading-4 font-sans font-medium overflow-hidden line-clamp-5">`);const zt=e=>{let{claimFocus:t}=xt({onEnter:t=>{t.preventDefault(),t.stopPropagation(),e.onRetry?.()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.onAcknowledge?.()}}),n=()=>!!(e.onRetry||e.onAcknowledge);return(()=>{var r=Rt(),a=r.firstChild,o=a.firstChild;return i(r,`click`,t,!0),i(r,`pointerdown`,t,!0),_(o,()=>e.error),_(r,E(M,{get when(){return n()},get children(){return E(mt,{get children(){var t=Lt();return _(t,E(M,{get when(){return e.onRetry},get children(){return E(Et,{"data-react-grab-retry":!0,class:`gap-1`,"aria-keyshortcuts":`Enter`,get onClick(){return e.onRetry},get children(){return[Ft(),E(Pt,{size:10,"aria-hidden":`true`,class:`text-[var(--rg-text-secondary)]`})]}})}}),null),_(t,E(M,{get when(){return e.onAcknowledge},get children(){return E(Et,{"data-react-grab-error-ok":!0,class:`gap-1`,"aria-keyshortcuts":`Escape`,get onClick(){return e.onAcknowledge},get children(){return It()}})}}),null),t}})}}),null),O(t=>{var r={"pt-1.5 pb-1":n(),"py-1.5":!n()},i=e.error;return t.e=s(a,r,t.e),i!==t.t&&u(o,`title`,t.t=i),t},{e:void 0,t:void 0}),r})()};o([`pointerdown`,`click`]);var Bt=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M7.5 12C7.5 13.3807 6.38071 14.5 5 14.5C3.61929 14.5 2.5 13.3807 2.5 12C2.5 10.6193 3.61929 9.5 5 9.5C6.38071 9.5 7.5 10.6193 7.5 12ZM14.5 12C14.5 13.3807 13.3807 14.5 12 14.5C10.6193 14.5 9.5 13.3807 9.5 12C9.5 10.6193 10.6193 9.5 12 9.5C13.3807 9.5 14.5 10.6193 14.5 12ZM19 14.5C20.3807 14.5 21.5 13.3807 21.5 12C21.5 10.6193 20.3807 9.5 19 9.5C17.6193 9.5 16.5 10.6193 16.5 12C16.5 13.3807 17.6193 14.5 19 14.5Z">`);const Vt=e=>{let t=()=>e.size??14;return(()=>{var n=Bt();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var Ht=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12ZM17.7071 10.7071C18.0976 10.3166 18.0976 9.68342 17.7071 9.29289C17.3166 8.90237 16.6834 8.90237 16.2929 9.29289L11 14.5858L8.70711 12.2929C8.31658 11.9024 7.68342 11.9024 7.29289 12.2929C6.90237 12.6834 6.90237 13.3166 7.29289 13.7071L10.2929 16.7071C10.6834 17.0976 11.3166 17.0976 11.7071 16.7071L17.7071 10.7071Z">`);const Ut=e=>{let t=()=>e.size??14;return(()=>{var n=Ht();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var Wt=F(`<button data-react-grab-ignore-events data-react-grab-more-options>`),Gt=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Keep`),Kt=F(`<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap min-w-0"></span><div class="contain-layout shrink-0 flex items-center gap-2 h-fit">`),qt=F(`<div class="contain-layout shrink-0 flex items-center gap-0.5 py-1.5 px-2 w-full h-fit"><span class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap min-w-0">`);const Jt=e=>(()=>{var t=Wt();return i(t,`click`,t=>{t.stopImmediatePropagation(),e.onClick()}),i(t,`pointerdown`,e=>{e.stopImmediatePropagation()}),_(t,E(Vt,{size:14,class:`opacity-50 group-hover:opacity-100 transition-opacity`})),O(()=>I(t,Z(Tt({variant:`ghost`}),`group size-4 text-[var(--rg-text-secondary)] hover:text-[var(--rg-text-primary)]`))),t})(),Yt=e=>{let t,n,[r,i]=W(!1),[a,o]=W(!1),s=()=>r()?`Copied`:e.statusText,c=()=>{t!==void 0&&window.clearTimeout(t),n!==void 0&&window.clearTimeout(n),o(!0),e.onFadingChange?.(!0),e.onShowContextMenu?.()},l=()=>{r()||(i(!0),t=window.setTimeout(()=>{o(!0),e.onFadingChange?.(!0),n=window.setTimeout(()=>{e.onDismiss?.()},125)},De-125))},{claimFocus:u}=xt({onEnter:e=>{e.preventDefault(),e.stopPropagation(),l()},onEscape:t=>{t.preventDefault(),t.stopPropagation(),e.onDismiss?.()}});return U(()=>{t!==void 0&&window.clearTimeout(t),n!==void 0&&window.clearTimeout(n)}),E(vt,{shape:`pill`,"data-react-grab-completion":!0,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,class:`shrink-0 flex flex-col justify-center items-end w-fit h-fit max-w-[280px] transition-opacity duration-100 ease-out`,get style(){return{opacity:+!a()}},onPointerDown:u,onClick:u,get children(){return[E(M,{get when(){return g(()=>!r())()&&e.onDismiss},get children(){var t=Kt(),n=t.firstChild,i=n.nextSibling;return _(n,s),_(i,E(M,{get when(){return e.onShowContextMenu},get children(){return E(Jt,{onClick:c})}}),null),_(i,E(M,{get when(){return e.onDismiss},get children(){return E(Et,{"data-react-grab-dismiss":!0,class:`gap-1`,"aria-keyshortcuts":`Enter`,onClick:l,get disabled(){return r()},get"aria-disabled"(){return r()},get children(){return[Gt(),E(M,{get when(){return!r()},get children(){return E(Ct,{size:10,class:`text-[var(--rg-text-secondary)]`})}})]}})}}),null),t}}),E(M,{get when(){return r()||!e.onDismiss},get children(){var t=qt(),n=t.firstChild;return _(t,E(Ut,{size:14,"aria-hidden":`true`,class:`text-[var(--rg-text-primary-85)] shrink-0`}),n),_(n,s),_(t,E(M,{get when(){return e.onShowContextMenu},get children(){return E(Jt,{onClick:c})}}),null),t}})]}})};var Xt=F(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 py-1.5 px-2 w-full h-fit"><span class="shimmer-text text-[13px] leading-4 font-sans font-medium h-fit tabular-nums overflow-hidden text-ellipsis whitespace-nowrap">`),Zt=F(`<div class="contain-layout shrink-0 flex flex-col items-start w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 w-fit h-fit px-2 py-1.5">`),Qt=F(`<button data-react-grab-submit type=button aria-label="Submit context"class="contain-layout shrink-0 flex items-center justify-center size-4 rounded-full bg-[var(--rg-submit-bg)] cursor-pointer ml-1 interactive-scale a11y-hitbox">`),$t=F(`<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events data-react-grab-input aria-label="Add context for selected element"aria-keyshortcuts="Enter Escape"class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-medium bg-transparent border-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="Add context"rows=1 style=field-sizing:content;min-height:16px;scrollbar-width:none>`),en=F(`<div class="contain-layout shrink-0 flex flex-col justify-center items-start w-fit h-fit min-w-[150px] max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2 max-w-full">`),tn=F(`<div data-react-grab-ignore-events data-react-grab-selection-label>`);const nn={left:pe,top:pe,arrowLeftPercent:50,arrowLeftOffset:0,edgeOffsetX:0},rn=n=>{let r,i,a,o=!1,[s,c]=W(0),[l,u]=W(0),[d,f]=W(0),[h,v]=W(0),[y,b]=W(!1),[x,S]=W(!1),C=()=>n.status!==`copying`&&n.status!==`copied`&&n.status!==`fading`&&n.status!==`error`,w=()=>n.status===`copied`||n.status===`fading`,T=()=>!!n.shouldToggleExpandOnClick&&!!n.onToggleExpand&&C()&&!n.discardPrompt&&!n.isPromptMode,D=()=>!!(n.isPromptMode||n.discardPrompt||T()||w()&&(n.onDismiss||n.onShowContextMenu)||n.status===`error`&&(n.onAcknowledgeError||n.onRetry)),k,ee=e=>{o=e},j=()=>{v(e=>e+1)},N=fe(e=>{m(e)||e.code===`Enter`&&!n.isPromptMode&&!n.discardPrompt&&C()&&(e.preventDefault(),e.stopImmediatePropagation(),n.onToggleExpand?.())});p(()=>{let e=le();if(k=new ResizeObserver(t=>{for(let n of t){let t=n.target.getBoundingClientRect();n.target===r&&!o?(c(t.width),u(t.height)):n.target===i?f(t.width):n.target===e&&j()}}),e&&k.observe(e),r){let e=r.getBoundingClientRect();c(e.width),u(e.height),k.observe(r)}i&&(f(i.getBoundingClientRect().width),k.observe(i)),window.addEventListener(`scroll`,j,!0),window.addEventListener(`resize`,j),window.visualViewport?.addEventListener(`resize`,j),window.visualViewport?.addEventListener(`scroll`,j),n.onToggleExpand&&window.addEventListener(`keydown`,N,{capture:!0})}),U(()=>{k?.disconnect(),window.removeEventListener(`scroll`,j,!0),window.removeEventListener(`resize`,j),window.visualViewport?.removeEventListener(`resize`,j),window.visualViewport?.removeEventListener(`scroll`,j),window.removeEventListener(`keydown`,N,{capture:!0})});let te=()=>`${n.tagName??``}:${n.componentName??``}`,F=A(e=>{h();let t=te(),r=t===e.elementIdentity?e:{position:nn,computedArrowPosition:null,hadValidBounds:!1,elementIdentity:t},i=n.selectionBounds,a=s(),o=l(),c=a>0&&o>0,u=i&&i.width>0&&i.height>0;if(!c||!u)return{position:r.hadValidBounds?r.position:nn,computedArrowPosition:r.computedArrowPosition,hadValidBounds:r.hadValidBounds,elementIdentity:t};let f=Qe(),p=f.offsetLeft,m=f.offsetTop,g=p+f.width,_=m+f.height;if(!(i.x+i.width>p&&i.x<g&&i.y+i.height>m&&i.y<_))return{position:nn,computedArrowPosition:r.computedArrowPosition,hadValidBounds:r.hadValidBounds,elementIdentity:t};let v=i.x+i.width/2,y=n.mouseX??v,b=i.y+i.height,x=i.y,S=n.hideArrow?0:Ze(d()),C=y,w=0,T=b+S+4;if(a>0){let e=C-a/2,t=C+a/2;t>g-8&&(w=g-8-t),e+w<p+8&&(w=p+8-e)}let E=o+S+4,D=T+o<=_-8;D||(T=x-E),T<m+8&&(T=m+8);let O=a/2,k=O-w,A=Math.min(16,O),ee=Math.max(a-16,O),j=Math.max(A,Math.min(ee,k))-O;return{position:{left:C,top:T,arrowLeftPercent:50,arrowLeftOffset:j,edgeOffsetX:w},computedArrowPosition:D?`bottom`:`top`,hadValidBounds:!0,elementIdentity:t}},{position:nn,computedArrowPosition:null,hadValidBounds:!1,elementIdentity:``}),ne=()=>F().computedArrowPosition??`bottom`,re=()=>F().hadValidBounds;P(t(()=>n.selectionLabelShakeCount,()=>S(!0),{defer:!0}));let ie=e=>{if(e.isComposing||e.keyCode===229)return;e.stopImmediatePropagation();let t=e.code===`Enter`&&!e.shiftKey,r=e.code===`Escape`;t?(e.preventDefault(),n.onSubmit?.()):r&&(e.preventDefault(),n.onConfirmDismiss?.())},L=e=>{let t=e.target;t instanceof HTMLTextAreaElement&&(Ye(t,95),n.onInputChange?.(t.value))},z=()=>et({tagName:n.tagName,componentName:n.componentName,elementsCount:n.elementsCount}),ae=A(()=>!(n.error||n.discardPrompt||C()&&n.isPromptMode)),B=e=>{if(e.stopImmediatePropagation(),n.filePath&&n.onOpen){n.onOpen();return}T()&&n.onToggleExpand?.()},V=e=>{e.stopImmediatePropagation(),C()&&n.isPromptMode&&!n.discardPrompt&&n.onSubmit&&a&&Xe(a,{preventScroll:!0})},oe=()=>re()&&(w()||n.status===`error`);return E(M,{get when(){return g(()=>n.visible!==!1)()&&(n.selectionBounds||oe())},get children(){var t=tn();t.addEventListener(`mouseleave`,()=>n.onHoverChange?.(!1)),t.addEventListener(`mouseenter`,()=>n.onHoverChange?.(!0)),t.$$click=e=>{e.stopImmediatePropagation()},t.$$pointerdown=V;var o=r;return typeof o==`function`?R(o,t):r=t,e(t,`z-index`,`${ue}`),e(t,`transition`,`opacity 125ms ease-out, filter 125ms ease-out`),_(t,E(M,{get when(){return!n.hideArrow},get children(){return E(ot,{get position(){return ne()},get leftPercent(){return F().position.arrowLeftPercent},get leftOffsetPx(){return F().position.arrowLeftOffset},get labelWidth(){return d()}})}}),null),_(t,E(M,{get when(){return g(()=>!!w())()&&!n.error},get children(){return E(Yt,{get statusText(){return n.statusText??`Copied`},get onDismiss(){return n.onDismiss},onFadingChange:b,get onShowContextMenu(){return n.onShowContextMenu}})}}),null),_(t,E(vt,{ref:e=>i=e,get shape(){return ae()?`pill`:`panel`},get class(){return Z(`flex items-center gap-[5px] w-fit h-fit p-0`,x()&&`animate-shake`)},get style(){return{display:w()&&!n.error?`none`:void 0}},onAnimationEnd:()=>S(!1),get children(){return[E(M,{get when(){return n.status===`copying`},get children(){var e=Xt(),t=e.firstChild,r=t.firstChild;return _(t,E(it,{size:13,class:`text-[var(--rg-text-secondary)] shrink-0`}),r),_(r,()=>n.statusText??`Grabbing…`),e}}),E(M,{get when(){return g(()=>!!(C()&&!n.isPromptMode))()&&!n.discardPrompt},get children(){var e=Zt(),t=e.firstChild;return _(t,E(ft,{get tagName(){return z().tagName},get componentName(){return z().componentName},get isClickable(){return!!(n.filePath&&n.onOpen)},onClick:B,onHoverChange:ee,shrink:!0})),e}}),E(M,{get when(){return g(()=>!!(C()&&n.isPromptMode))()&&!n.discardPrompt},get children(){var t=en(),r=t.firstChild;return _(r,E(ft,{get tagName(){return z().tagName},get componentName(){return z().componentName},get isClickable(){return!!(n.filePath&&n.onOpen)},onClick:B,onHoverChange:ee})),_(t,E(mt,{get children(){var t=$t(),r=t.firstChild;return r.$$keydown=ie,r.$$input=L,R(e=>{a=e,n.onSubmit&&queueMicrotask(()=>{Xe(e,{preventScroll:!0}),Ye(e,95)})},r),e(r,`max-height`,`95px`),_(t,E(M,{get when(){return n.onSubmit},get children(){var e=Qt();return e.$$click=()=>n.onSubmit?.(),_(e,E(nt,{size:10,"aria-hidden":`true`,class:`text-[var(--rg-submit-fg)]`})),e}}),null),O(()=>r.readOnly=!n.onSubmit),O(()=>r.value=n.inputValue??``),t}}),null),t}}),E(M,{get when(){return n.discardPrompt},keyed:!0,children:e=>E(Mt,{get label(){return g(()=>!!e.isKeyboardSelection)()?`Discard selection?`:e.label},get showCancel(){return!e.isKeyboardSelection},get cancelOnEscape(){return e.cancelOnEscape},get onConfirm(){return e.onConfirm},get onCopy(){return e.onCopy},onCancel:()=>{e.isKeyboardSelection||e.onCancel?.(),Xe(a,{preventScroll:!0})}})}),E(M,{get when(){return n.error},get children(){return E(zt,{get error(){return n.error},get onAcknowledge(){return n.onAcknowledgeError},get onRetry(){return n.onRetry}})}})]}}),null),O(r=>{var i=Z(`fixed font-sans text-[13px] antialiased select-none ease-out`),a=`${F().position.top}px`,o=`${F().position.left}px`,s=`translateX(calc(-50% + ${F().position.edgeOffsetX}px))`,c=D()?`auto`:`none`,l=n.status===`fading`||y()?0:1,u=`drop-shadow(${K}) blur(${n.status===`fading`||y()?`3px`:`0`})`;return i!==r.e&&I(t,r.e=i),a!==r.t&&e(t,`top`,r.t=a),o!==r.a&&e(t,`left`,r.a=o),s!==r.o&&e(t,`transform`,r.o=s),c!==r.i&&e(t,`pointer-events`,r.i=c),l!==r.n&&e(t,`opacity`,r.n=l),u!==r.s&&e(t,`filter`,r.s=u),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),t}})};o([`pointerdown`,`click`,`input`,`keydown`]);var an=F(`<span style="transition-property:transform;transition-timing-function:cubic-bezier(0.32, 0.72, 0, 1)"><svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M20.8977 4.02356L21.8277 4.39121C22.3784 2.99813 21.0382 1.60206 19.6238 2.09546L3.47334 7.72936C1.38661 8.45728 1.49021 11.443 3.6224 12.0245L10.1289 13.799L11.2331 19.8724C11.638 22.0991 14.7072 22.4019 15.5393 20.2972L21.8277 4.39121L20.8977 4.02356Z">`);const on=t=>{let n=()=>t.size??14,r=()=>t.rotationDeg??0;return(()=>{var i=an(),a=i.firstChild;return e(i,`transition-duration`,`180ms`),O(o=>{var s=Z(`inline-flex items-center justify-center will-change-transform`,t.class),c=`rotate(${r()}deg)`,l=n(),d=n();return s!==o.e&&I(i,o.e=s),c!==o.t&&e(i,`transform`,o.t=c),l!==o.a&&u(a,`width`,o.a=l),d!==o.o&&u(a,`height`,o.o=d),o},{e:void 0,t:void 0,a:void 0,o:void 0}),i})()};var sn=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 12 12"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M1 6C1 3.239 3.239 1 6 1C8.761 1 11 3.239 11 6C11 8.761 8.761 11 6 11C5.103 11 4.261 10.764 3.532 10.35C2.959 10.759 2.257 11 1.5 11C1.376 11 1.253 10.993 1.132 10.981C0.923 10.959 0.75 10.809 0.699 10.605C0.648 10.402 0.729 10.188 0.903 10.07C1.347 9.768 1.688 9.328 1.865 8.812C1.319 8.011 1 7.042 1 6Z">`);const cn=e=>{let t=()=>e.size??14;return(()=>{var n=sn();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var ln=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 13.867 20.345 14.992 18.77 14.992H16.029C14.739 14.992 13.823 16.248 14.218 17.476L14.48 18.295C14.751 19.139 14.643 20.041 14.211 20.751C13.769 21.479 12.985 22 12 22C6.477 22 2 17.523 2 12ZM12.21 6.783C12.416 7.585 11.933 8.403 11.131 8.609C10.328 8.815 9.511 8.332 9.305 7.529C9.099 6.727 9.582 5.909 10.384 5.703C11.187 5.497 12.004 5.981 12.21 6.783ZM7.59 9.207C8.388 9.43 8.853 10.258 8.63 11.055C8.407 11.853 7.579 12.319 6.782 12.096C5.984 11.873 5.518 11.045 5.741 10.247C5.964 9.449 6.792 8.983 7.59 9.207ZM9.497 14.446C8.918 13.854 7.968 13.844 7.376 14.423C6.784 15.002 6.773 15.952 7.353 16.544C7.932 17.136 8.882 17.147 9.474 16.567C10.066 15.988 10.076 15.039 9.497 14.446ZM16.624 9.575C16.032 10.155 15.082 10.144 14.503 9.552C13.923 8.96 13.934 8.01 14.526 7.431C15.118 6.852 16.068 6.862 16.647 7.454C17.226 8.046 17.216 8.996 16.624 9.575Z">`);const un=e=>{let t=()=>e.size??14;return(()=>{var n=ln();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var dn=F(`<div>`);let fn=0;const pn=()=>Date.now()-fn<800,mn=e=>{let[n,r]=W(!1),[i,a]=W(!0),o;P(t(()=>e.visible,e=>{o!==void 0&&(clearTimeout(o),o=void 0),e?pn()?(a(!1),r(!0)):(a(!0),o=setTimeout(()=>{r(!0)},400)):(n()&&(fn=Date.now()),r(!1))})),U(()=>{o!==void 0&&clearTimeout(o),n()&&(fn=Date.now())});let s=()=>e.position===`top`||e.position===`bottom`?{left:`50%`,translate:`-50%`,"z-index":`${ue}`}:{top:`50%`,translate:`0 -50%`,"z-index":`${ue}`};return E(M,{get when(){return n()},get children(){var t=dn();return _(t,()=>e.children),O(n=>{var r=Z(`absolute whitespace-nowrap px-2 py-0.5 rounded-full text-[10px] font-sans font-medium leading-4 pointer-events-none`,`bg-[var(--rg-panel-bg)] text-[var(--rg-text-primary)] [box-shadow:var(--rg-shadow)]`,e.position===`top`&&`bottom-full mb-2.5`,e.position===`bottom`&&`top-full mt-2.5`,e.position===`left`&&`right-full mr-2.5`,e.position===`right`&&`left-full ml-2.5`,i()&&`animate-tooltip-fade-in`),a=s();return r!==n.e&&I(t,n.e=r),n.t=B(t,a,n.t),n},{e:void 0,t:void 0}),t}})};var hn=F(`<div><button data-react-grab-ignore-events type=button>`);const gn=e=>(()=>{var t=hn(),n=t.firstChild;i(n,`mouseleave`,e.onMouseLeave),i(n,`mouseenter`,e.onMouseEnter),i(n,`contextmenu`,t=>e.onContextMenu?.(t)),i(n,`click`,e.onClick,!0);var r=e.ref;return typeof r==`function`?R(r,n):e.ref=n,_(n,()=>e.icon),_(t,E(M,{get when(){return e.tooltip},get children(){return E(mn,{get visible(){return!!e.tooltipVisible},get position(){return e.tooltipPosition??`top`},get children(){return e.tooltip}})}}),null),O(r=>{var i=e.wrapperClass,a=e.isToggle?``:void 0,o=e.actionId,s=e.label,c=!!e.isActive,l=e.class;return i!==r.e&&I(t,r.e=i),a!==r.t&&u(n,`data-react-grab-toolbar-toggle`,r.t=a),o!==r.a&&u(n,`data-react-grab-toolbar-action`,r.a=o),s!==r.o&&u(n,`aria-label`,r.o=s),c!==r.i&&u(n,`aria-pressed`,r.i=c),l!==r.n&&I(n,r.n=l),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})();o([`click`]);var _n=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L12.5858 12L9.29289 8.70711C8.90237 8.31658 8.90237 7.68342 9.29289 7.29289C9.68342 6.90237 10.3166 6.90237 10.7071 7.29289L14.7071 11.2929C14.8946 11.4804 15 11.7348 15 12C15 12.2652 14.8946 12.5196 14.7071 12.7071L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071Z">`);const vn=e=>{let t=()=>e.size??14;return(()=>{var n=_n();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var yn=F(`<button data-react-grab-ignore-events data-react-grab-toolbar-collapse type=button class="group contain-layout shrink-0 flex items-center justify-center cursor-pointer interactive-scale a11y-hitbox">`),bn=F(`<div data-react-grab-toolbar-panel><div><div><div>`);const xn=t=>{let n=()=>t.snapEdge??`bottom`,r=()=>n()===`left`||n()===`right`,a=()=>t.isCollapsed?`duration-140`:`duration-220`,o=()=>r()?`transition-[grid-template-rows] ${a()} ease-drawer`:`transition-[grid-template-columns] ${a()} ease-drawer`,s=()=>r()?`min-h-0`:`min-w-0`,c=()=>t.isCollapsed?`${{top:`rounded-t-none rounded-b-[10px]`,bottom:`rounded-b-none rounded-t-[10px]`,left:`rounded-l-none rounded-r-[10px]`,right:`rounded-r-none rounded-l-[10px]`}[n()]} ${r()?`px-0.25 py-2`:`px-2 py-0.25`}`:``,l=()=>{let e=t.isCollapsed;switch(n()){case`top`:return e?`rotate-90`:`-rotate-90`;case`bottom`:return e?`-rotate-90`:`rotate-90`;case`left`:return e?`rotate-0`:`rotate-180`;case`right`:return e?`rotate-180`:`rotate-0`;default:return`-rotate-90`}},d=()=>{if(t.isChevronPressed)return r()?`scale(0.97, 1)`:`scale(1, 0.97)`},f=()=>(()=>{var e=yn();return i(e,`pointercancel`,t.onCollapsePointerLeave),i(e,`pointerleave`,t.onCollapsePointerLeave),i(e,`pointerup`,t.onCollapsePointerUp,!0),i(e,`pointerdown`,t.onCollapsePointerDown),i(e,`click`,t.onCollapseClick,!0),_(e,E(vn,{size:18,get class(){return Z(`text-[var(--rg-text-secondary)] group-hover:text-[var(--rg-text-primary)] transition-[transform,color] duration-150 ease-drawer -m-0.5`,l())}})),O(n=>{var r=t.isCollapsed?`Expand toolbar`:`Collapse toolbar`,i=!t.isCollapsed;return r!==n.e&&u(e,`aria-label`,n.e=r),i!==n.t&&u(e,`aria-expanded`,n.t=i),n},{e:void 0,t:void 0}),e})(),p=()=>t.isChevronPressed?`transition-[padding,border-radius,transform] duration-60 ease-[cubic-bezier(0,0,0.2,1)]`:`transition-[padding,border-radius,transform] ${a()} ease-drawer`;return(()=>{var n=bn(),a=n.firstChild,l=a.firstChild,u=l.firstChild;return i(n,`click`,t.onPanelClick,!0),i(n,`animationend`,t.onAnimationEnd),_(u,()=>t.actionButtons),_(n,f,null),O(i=>{var f=Z(`flex items-center justify-center rounded-[13px] antialiased relative overflow-visible [font-synthesis:none]`,p(),r()&&`flex-col`,`bg-[var(--rg-panel-bg)] [box-shadow:var(--rg-shadow)]`,!t.isCollapsed&&(r()?`px-1.5 gap-0 py-2`:`py-1.5 gap-0 px-2`),c(),t.isShaking&&(r()?`animate-shake-vertical`:`animate-shake`)),m=t.transformOrigin,h=d(),g=Z(`grid relative overflow-visible`,o(),t.isCollapsed?r()?`grid-rows-[0fr] pointer-events-none`:`grid-cols-[0fr] pointer-events-none`:r()?`grid-rows-[1fr]`:`grid-cols-[1fr]`),_=Z(`flex`,r()?`flex-col items-center min-h-0`:`items-center min-w-0`,t.isCollapsed?`opacity-0`:`opacity-100`,t.isCollapsed?`transition-opacity duration-100 ease-drawer`:`transition-opacity duration-180 ease-drawer delay-[80ms]`),v=Z(`relative overflow-visible flex`,r()?`flex-col items-center`:`items-center`,s());return f!==i.e&&I(n,i.e=f),m!==i.t&&e(n,`transform-origin`,i.t=m),h!==i.a&&e(n,`transform`,i.a=h),g!==i.o&&I(a,i.o=g),_!==i.i&&I(l,i.i=_),v!==i.n&&I(u,i.n=v),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),n})()};o([`click`,`pointerup`]);const Sn=e=>e===`top`||e===`bottom`,Cn=e=>{let t=Sn(e);return{width:t?30:16,height:t?16:30}},wn=(e,t,n,r)=>{let i=Qe(),a=i.width,o=i.height,s=i.offsetLeft+16,c=Math.max(s,i.offsetLeft+a-n-16),l=i.offsetTop+16,u=Math.max(l,i.offsetTop+o-r-16);if(e===`top`||e===`bottom`){let r=Math.max(0,a-n-32);return{x:Math.min(c,Math.max(s,i.offsetLeft+16+r*t)),y:e===`top`?l:u}}let d=Math.max(0,o-r-32),f=Math.min(u,Math.max(l,i.offsetTop+16+d*t));return{x:e===`left`?s:c,y:f}},Tn=(e,t,n,r,i)=>{let a=Qe(),o=a.width,s=a.height;if(e===`top`||e===`bottom`){let e=o-r-32;return e<=0?Be:Math.max(0,Math.min(1,(t-a.offsetLeft-16)/e))}let c=s-i-32;return c<=0?Be:Math.max(0,Math.min(1,(n-a.offsetTop-16)/c))},En=(e,t,n,r,i)=>{let a=Qe(),o=a.width,s=a.height,{width:l,height:u}=n,d;if(t===`top`||t===`bottom`){let n=(l-r)/2;d={x:c(e.x-n,a.offsetLeft+16,a.offsetLeft+o-l-16),y:t===`top`?a.offsetTop+16:a.offsetTop+s-u-16}}else{let n=(u-i)/2,r=c(e.y-n,a.offsetTop+16,a.offsetTop+s-u-16);d={x:t===`left`?a.offsetLeft+16:a.offsetLeft+o-l-16,y:r}}let f=Tn(t,d.x,d.y,l,u);return{position:d,ratio:f}},Dn=(e,t,n,r)=>{let i=Qe(),{width:a,height:o}=n,{width:s,height:l}=r;switch(e){case`top`:case`bottom`:{let n=(a-s)/2;return{x:c(t.x+n,i.offsetLeft,i.offsetLeft+i.width-s),y:e===`top`?i.offsetTop:i.offsetTop+i.height-l}}case`left`:case`right`:{let n=(o-l)/2,r=c(t.y+n,i.offsetTop,i.offsetTop+i.height-l);return{x:e===`left`?i.offsetLeft:i.offsetLeft+i.width-s,y:r}}}},On=(e,t,n,r,i,a)=>{let o=Qe(),s=o.width,l=o.height,u=e+i*150,d=t+a*150,f=d-o.offsetTop+r/2,p=o.offsetTop+l-d-r/2,m=u-o.offsetLeft+n/2,h=o.offsetLeft+s-u-n/2,g=Math.min(f,p,m,h),_=e=>c(e,o.offsetLeft+16,o.offsetLeft+s-n-16),v=e=>c(e,o.offsetTop+16,o.offsetTop+l-r-16);return g===f?{edge:`top`,x:_(u),y:o.offsetTop+16}:g===m?{edge:`left`,x:o.offsetLeft+16,y:v(d)}:g===h?{edge:`right`,x:o.offsetLeft+s-n-16,y:v(d)}:{edge:`bottom`,x:_(u),y:o.offsetTop+l-r-16}},kn=e=>{let[t,n]=W(!1),[r,i]=W(!1),[a,o]=W(!1),[s,c]=W({x:0,y:0}),l={x:0,y:0},u={x:0,y:0,time:0},d={x:0,y:0},f=!1,p,m=null,h=()=>{m?.abort(),m=null},g=t=>{if(!a()){if(Math.hypot(t.clientX-d.x,t.clientY-d.y)<=5)return;o(!0),e.onDragStart()}let n=performance.now(),r=n-u.time;r>0&&c({x:(t.clientX-u.x)/r,y:(t.clientY-u.y)/r}),u={x:t.clientX,y:t.clientY,time:n};let i=t.clientX-l.x,s=t.clientY-l.y;e.onPositionUpdate({x:i,y:s})},_=()=>{h();let t=a();if(n(!1),!t)return;f=!0;let r=e.getContainerRef(),o=r?.getBoundingClientRect();if(!o)return;let c=s(),l=On(o.left,o.top,o.width,o.height,c.x,c.y),u=Tn(l.edge,l.x,l.y,o.width,o.height);e.onSnapEdgeChange(l.edge,u),i(!0),we(()=>{let t=r?.getBoundingClientRect(),n=t?{width:t.width,height:t.height}:e.getExpandedDimensions();we(()=>{let t=wn(l.edge,u,n.width,n.height);e.onSnapComplete({edge:l.edge,ratio:u,position:t,expandedDimensions:n}),p=setTimeout(()=>{i(!1),e.onSnapAnimationEnd?.()},300)})})},v=fe(t=>{if(t.button!==0||e.isCollapsed())return;let r=e.getContainerRef()?.getBoundingClientRect();if(!r)return;d={x:t.clientX,y:t.clientY},l={x:t.clientX-r.left,y:t.clientY-r.top},n(!0),o(!1),c({x:0,y:0}),u={x:t.clientX,y:t.clientY,time:performance.now()},h(),m=new AbortController;let{signal:i}=m;window.addEventListener(`pointermove`,g,{signal:i}),window.addEventListener(`pointerup`,_,{signal:i}),window.addEventListener(`pointercancel`,_,{signal:i})});return U(()=>{h(),clearTimeout(p)}),{isDragging:t,isSnapping:r,handlePointerDown:v,createDragAwareHandler:e=>t=>{if(t.stopImmediatePropagation(),f){f=!1;return}e()}}},An=(e,t)=>{let n=t-e;return e+(n-Math.round(n/360)*360)};var jn=F(`<div data-react-grab-ignore-events data-react-grab-toolbar>`);const Mn=n=>{let r,a,o=null,s=ee(),[c,l]=W(!1),[u,d]=W(!1),[m,h]=W(!1),[g,v]=W(s?.edge??`bottom`),[b,x]=W(s?.ratio??.5),[S,C]=W({x:0,y:0}),[w,T]=W(!1),[D,k]=W(!1),[A,j]=W(!1),[M,N]=W(!1),[te,F]=W(0),[ne,re]=W(null),ie=()=>{o?.(),o=null,n.isActive||ke()},L=kn({getContainerRef:()=>r,isCollapsed:u,getExpandedDimensions:()=>K,onDragStart:()=>{re(null),o&&ie()},onPositionUpdate:e=>C(e),onSnapEdgeChange:(e,t)=>{pe(g(),e),v(e),x(t)},onSnapComplete:e=>{K=e.expandedDimensions,C(e.position),Fe({edge:e.edge,ratio:e.ratio,collapsed:u(),enabled:!u()})}}),z=()=>g()===`left`||g()===`right`,ae=()=>z()?`mb-1.5`:`mr-1.5`,B=e=>n.activeActionId===e,V=()=>!!n.isActive&&(n.activeActionId??`copy`)===`copy`,oe=e=>ne()===e&&!n.isActive&&!u()&&!L.isDragging()&&!L.isSnapping()&&!n.isContextMenuOpen,H=()=>{switch(g()){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`;default:return`top`}},se=e=>{e.stopImmediatePropagation()},G=(e,t)=>({onMouseEnter:n=>{L.isDragging()||(re(e),t?.shouldFreezeInteractions!==!1&&!o&&(o=Ie(),Me(n.clientX,n.clientY)),t?.onHoverChange?.(!0))},onMouseLeave:()=>{re(t=>t===e?null:t),t?.shouldFreezeInteractions!==!1&&!n.isActive&&!n.isContextMenuOpen&&ie(),t?.onHoverChange?.(!1)}});P(t(()=>n.shakeCount,e=>{e&&!n.enabled&&T(!0)})),P(t(()=>[n.isActive,n.isContextMenuOpen],([e,t])=>{!e&&!t&&o&&(o(),o=null)})),P(t(()=>V(),e=>{if(!e){F(e=>An(e,0));return}let t=fe(e=>{if(!a)return;let t=a.getBoundingClientRect(),n=t.left+t.width/2,r=t.top+t.height/2,i=e.clientX-n,o=e.clientY-r;if(Math.hypot(i,o)<4)return;let s=Math.atan2(o,i)*180/Math.PI- -45;F(e=>An(e,s))});window.addEventListener(`pointermove`,t,{passive:!0}),U(()=>{window.removeEventListener(`pointermove`,t)})}));let K={width:78,height:28},[ce,q]=W(Cn(g())),pe=(e,t)=>{Sn(e)!==Sn(t)&&q(Cn(t))},me=(e,t)=>{let n=r?.getBoundingClientRect(),i=Cn(t);return En(e,t,K,n?.width??i.width,n?.height??i.height)},he=()=>{C(wn(g(),b(),K.width,K.height))},ge=L.createDragAwareHandler(()=>n.onToggle?.()),_e=L.createDragAwareHandler(()=>n.onActivateAction?.(ye)),ve=L.createDragAwareHandler(()=>n.onActivateAction?.(Ce)),be=`group contain-layout flex items-center justify-center cursor-pointer interactive-scale a11y-hitbox`,xe=()=>Z(`relative contain-layout flex items-center justify-center`,ae()),Se=e=>e?`text-[var(--rg-text-primary)]`:`text-[var(--rg-text-secondary)] group-hover:text-[var(--rg-text-primary)]`,Te=L.createDragAwareHandler(()=>{let e=r?.getBoundingClientRect(),t=u(),n=b();if(t){let{position:e,ratio:t}=me(Le(),g());n=t,C(e),x(n)}else e&&(K={width:e.width,height:e.height});k(!0),d(e=>!e),Fe({edge:g(),ratio:n,collapsed:!t,enabled:t}),J&&clearTimeout(J),J=setTimeout(()=>{k(!1),Ae()},260)}),Ee=()=>Dn(g(),S(),K,ce()),De,J,Y=null,Ae=()=>{let e=r?.getBoundingClientRect();!e||e.width===0||e.height===0||(u()?q({width:e.width,height:e.height}):(K={width:e.width,height:e.height},Y={width:e.width,height:e.height}))},X=(e,t)=>{if(!(e===0||t===0)&&!(L.isDragging()||L.isSnapping())&&!D()){if(u()){let n=ce();if(n.width===e&&n.height===t)return;q({width:e,height:t});return}Y&&Y.width===e&&Y.height===t||(Y={width:e,height:t},K={width:e,height:t},C(wn(g(),b(),e,t)))}},je=null,Ne=()=>{L.isDragging()||L.isSnapping()||je===null&&(je=we(()=>{je=null,he()}))},Pe=()=>{L.isDragging()||(h(!0),he(),De&&clearTimeout(De),De=setTimeout(()=>{h(!1);let e=Tn(g(),S().x,S().y,K.width,K.height);x(e),Fe({edge:g(),ratio:e,collapsed:u(),enabled:!u()})},500))},Fe=e=>{y(e),n.onStateChange?.(e)};p(()=>{r&&n.onContainerRef?.(r);let e=r?.getBoundingClientRect(),t=Qe(),i=!!(e&&e.width>0&&e.height>0);s?(i&&e&&(K={width:e.width,height:e.height}),d(s.collapsed),C(wn(s.edge,s.ratio,K.width,K.height))):i&&e?(K={width:e.width,height:e.height},C({x:t.offsetLeft+(t.width-e.width)/2,y:t.offsetTop+t.height-e.height-16}),x(Be)):(C(wn(`bottom`,Be,K.width,K.height)),x(Be)),n.onSubscribeToStateChanges&&U(n.onSubscribeToStateChanges(e=>{if(D()||!r?.getBoundingClientRect())return;let t=u()!==e.collapsed;if(pe(g(),e.edge),v(e.edge),t&&!e.collapsed){let t=Le();k(!0),d(e.collapsed);let{position:n,ratio:r}=me(t,e.edge);C(n),x(r),clearTimeout(J),J=setTimeout(()=>{k(!1),Ae()},260)}else t&&(k(!0),clearTimeout(J),J=setTimeout(()=>{k(!1),Ae()},260)),d(e.collapsed),C(wn(e.edge,e.ratio,K.width,K.height)),x(e.ratio)})),window.addEventListener(`resize`,Pe),window.visualViewport?.addEventListener(`resize`,Pe),window.visualViewport?.addEventListener(`scroll`,Pe);let a=le();if(a&&(window.addEventListener(`scroll`,Ne,{passive:!0,capture:!0}),typeof ResizeObserver<`u`)){let e=new ResizeObserver(Ne);e.observe(a),U(()=>e.disconnect())}if(typeof ResizeObserver<`u`&&r){let e=new ResizeObserver(e=>{let t=e[0];if(!t)return;let n=t.borderBoxSize?.[0],i,a;if(n)i=n.inlineSize,a=n.blockSize;else{let e=r?.getBoundingClientRect();if(!e)return;i=e.width,a=e.height}X(i,a)});e.observe(r),U(()=>e.disconnect())}let o=setTimeout(()=>{l(!0)},500);U(()=>{clearTimeout(o)})}),U(()=>{window.removeEventListener(`resize`,Pe),window.visualViewport?.removeEventListener(`resize`,Pe),window.visualViewport?.removeEventListener(`scroll`,Pe),window.removeEventListener(`scroll`,Ne,{capture:!0}),je!==null&&Oe(je),clearTimeout(De),clearTimeout(J),o&&ie()});let Le=()=>u()?Ee():S(),Re=()=>u()?`cursor-pointer`:L.isDragging()?`cursor-grabbing`:`cursor-grab`,ze=()=>M()||!!n.isContextMenuOpen||L.isDragging()||L.isSnapping()||D()||A(),Ve=()=>!!n.isActive&&!ze(),He=()=>m()||L.isDragging()?``:L.isSnapping()?`transition-[transform,opacity] duration-300 ease-out`:D()?`transition-[transform,opacity] ${u()?`duration-140`:`duration-220`} ease-drawer`:`transition-[transform,opacity] duration-400 ease-drawer`,Ue=()=>{switch(g()){case`top`:return`center top`;case`bottom`:return`center bottom`;case`left`:return`left center`;case`right`:return`right center`;default:return`center center`}};return(()=>{var t=jn();t.addEventListener(`mouseleave`,()=>{N(!1),n.onSelectHoverChange?.(!1)}),t.addEventListener(`mouseenter`,()=>{N(!0),u()||n.onSelectHoverChange?.(!0)}),i(t,`mousedown`,se),i(t,`pointerdown`,e=>{se(e),L.handlePointerDown(e)});var o=r;return typeof o==`function`?R(o,t):r=t,_(t,E(xn,{get isCollapsed(){return u()},get snapEdge(){return g()},get isShaking(){return w()},get isChevronPressed(){return A()},get transformOrigin(){return Ue()},onAnimationEnd:()=>T(!1),onCollapseClick:Te,onCollapsePointerDown:()=>j(!0),onCollapsePointerUp:()=>j(!1),onCollapsePointerLeave:()=>j(!1),onPanelClick:e=>{if(u()){e.stopPropagation();let{position:t,ratio:n}=me(Le(),g());C(t),x(n),k(!0),d(!1),Fe({edge:g(),ratio:n,collapsed:!1,enabled:!0}),J&&clearTimeout(J),J=setTimeout(()=>{k(!1),Ae()},260)}},get actionButtons(){return[E(gn,f({actionId:de,isToggle:!0,ref:e=>a=e,get label(){return V()?`Stop selecting element`:`Copy element`},get isActive(){return V()},class:be,get wrapperClass(){return xe()},onClick:ge,onContextMenu:e=>{e.preventDefault(),e.stopPropagation(),re(null),n.onToggleToolbarMenu?.()}},()=>G(de),{get icon(){return E(on,{size:14,get rotationDeg(){return te()},get class(){return Se(V())}})},get tooltipVisible(){return oe(de)},get tooltipPosition(){return H()},tooltip:`Copy`})),E(gn,f({actionId:ye,label:`Comment on element`,get isActive(){return B(ye)},class:be,get wrapperClass(){return xe()},onClick:_e},()=>G(ye),{get icon(){return E(cn,{size:14,get class(){return Se(B(ye))}})},get tooltipVisible(){return oe(ye)},get tooltipPosition(){return H()},tooltip:`Comment`})),E(gn,f({actionId:Ce,label:`Style element`,get isActive(){return B(Ce)},class:be,get wrapperClass(){return xe()},onClick:ve},()=>G(Ce),{get icon(){return E(un,{size:14,get class(){return Se(B(Ce))}})},get tooltipVisible(){return oe(Ce)},get tooltipPosition(){return H()},tooltip:`Style`}))]}})),O(n=>{var r=Z(`fixed left-0 top-0 font-sans text-[13px] antialiased select-none`,Re(),He(),c()?`pointer-events-auto`:`pointer-events-none`),i=String(ue),a=`translate(${Le().x}px, ${Le().y}px) scale(${Ve()?.97:1})`,o=Ue(),s=c()?Ve()?.55:1:0;return r!==n.e&&I(t,n.e=r),i!==n.t&&e(t,`z-index`,n.t=i),a!==n.a&&e(t,`transform`,n.a=a),o!==n.o&&e(t,`transform-origin`,n.o=o),s!==n.i&&e(t,`opacity`,n.i=s),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),t})()},Nn=ie(),Pn=()=>{let e=l(Nn);if(!e)throw Error(`Menu subcomponents must be rendered inside <Menu.Provider>`);return e},Fn=e=>E(Nn.Provider,{get value(){return e.store},get children(){return e.children}}),In=e=>E(vt,{get class(){return Z(`flex flex-col w-fit h-fit`,e.class)},get style(){return e.style},get children(){return e.children}});var Ln=F(`<div role=menu aria-orientation=vertical><div aria-hidden=true class="pointer-events-none absolute opacity-0 transition-[top,left,width,height,opacity,border-radius] duration-75 ease-out bg-[var(--rg-surface-hover)]">`);const Rn=e=>{let t=Pn();return(()=>{var n=Ln(),r=n.firstChild;n.$$pointermove=()=>t.notePointerMove(),R(n=>{t.setHighlightContainer(n),e.ref?.(n)},n);var i=t.setHighlightRail;return typeof i==`function`?R(i,r):t.setHighlightRail=r,_(n,()=>e.children,null),O(r=>{var i=e.label,a=t.keyboardNavigation?t.activeDescendantId():void 0,o=t.keyboardNavigation?-1:void 0,s=Z(`relative flex flex-col`,e.class);return i!==r.e&&u(n,`aria-label`,r.e=i),a!==r.t&&u(n,`aria-activedescendant`,r.t=a),o!==r.a&&u(n,`tabindex`,r.a=o),s!==r.o&&I(n,r.o=s),r},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()};o([`pointermove`]);var zn=F(`<button data-react-grab-ignore-events type=button>`);const Bn=e=>{let t=Pn(),n=t.createItemId(),r=e.value,i=()=>e.role??`menuitem`,a=()=>!e.disabled,o=()=>t.activeValue()===r,s;return p(()=>{s&&(t.registerItem({value:r,domId:n,element:s,isEnabled:a,onSelect:()=>e.onSelect?.()}),U(()=>t.unregisterItem(r)))}),(()=>{var c=zn();c.$$click=t=>{t.stopPropagation(),a()&&e.onSelect?.()},c.addEventListener(`pointerleave`,()=>{t.clearActiveOnPointerLeave&&t.setActiveItem(null)}),c.addEventListener(`pointerenter`,()=>{a()&&t.canActivateOnHover()&&t.setActiveItem(r)}),c.$$pointerdown=e=>e.stopPropagation();var l=s;return typeof l==`function`?R(l,c):s=c,u(c,`id`,n),_(c,()=>e.children),O(n=>{var a=e.dataId??r,s=i(),l=i()===`menuitemradio`?!!e.checked:void 0,d=!!e.disabled,f=t.keyboardNavigation?o()?0:-1:void 0,p=e.disabled,m=Z(`relative z-1 contain-layout flex items-center justify-between w-full px-2 py-1 cursor-pointer text-left border-none bg-transparent disabled:opacity-40 disabled:cursor-default`,e.class);return a!==n.e&&u(c,`data-react-grab-menu-item`,n.e=a),s!==n.t&&u(c,`role`,n.t=s),l!==n.a&&u(c,`aria-checked`,n.a=l),d!==n.o&&u(c,`aria-disabled`,n.o=d),f!==n.i&&u(c,`tabindex`,n.i=f),p!==n.n&&(c.disabled=n.n=p),m!==n.s&&I(c,n.s=m),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),c})()};o([`pointerdown`,`click`]);var Vn=F(`<span>`);const Hn=e=>(()=>{var t=Vn();return _(t,()=>e.children),O(()=>I(t,Z(`text-[13px] leading-4 font-sans font-medium`,e.class))),t})();var Un=F(`<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=currentColor><path fill-rule=evenodd clip-rule=evenodd d="M6.5 5C5.67157 5 5 5.67157 5 6.5C5 7.32843 5.67157 8 6.5 8H8V6.5C8 5.67157 7.32843 5 6.5 5ZM10 8V6.5C10 4.567 8.433 3 6.5 3C4.567 3 3 4.567 3 6.5C3 8.433 4.567 10 6.5 10H8V14H6.5C4.567 14 3 15.567 3 17.5C3 19.433 4.567 21 6.5 21C8.433 21 10 19.433 10 17.5V16H14V17.5C14 19.433 15.567 21 17.5 21C19.433 21 21 19.433 21 17.5C21 15.567 19.433 14 17.5 14H16V10H17.5C19.433 10 21 8.433 21 6.5C21 4.567 19.433 3 17.5 3C15.567 3 14 4.567 14 6.5V8H10ZM10 10V14H14V10H10ZM16 8H17.5C18.3284 8 19 7.32843 19 6.5C19 5.67157 18.3284 5 17.5 5C16.6716 5 16 5.67157 16 6.5V8ZM16 16V17.5C16 18.3284 16.6716 19 17.5 19C18.3284 19 19 18.3284 19 17.5C19 16.6716 18.3284 16 17.5 16H16ZM8 16H6.5C5.67157 16 5 16.6716 5 17.5C5 18.3284 5.67157 19 6.5 19C7.32843 19 8 18.3284 8 17.5V16Z">`);const Wn=e=>{let t=()=>e.size??11;return(()=>{var n=Un();return O(r=>{var i=t(),a=t(),o=e.class;return i!==r.e&&u(n,`width`,r.e=i),a!==r.t&&u(n,`height`,r.t=a),o!==r.a&&u(n,`class`,r.a=o),r},{e:void 0,t:void 0,a:void 0}),n})()};var Gn=F(`<span>`),Kn=F(`<span style=display:inline-flex;align-items:center;gap:2px>`),qn=F(`<span>Ctrl+`);const Jn=e=>{let t=()=>e.shortcut===`Enter`,n=()=>e.modifier!==!1,r=a();return(()=>{var i=Kn();return _(i,E(M,{get when(){return t()},get children(){return E(Ct,{size:8})}}),null),_(i,E(M,{get when(){return!t()},get children(){return E(M,{get when(){return n()},get fallback(){return(()=>{var t=Gn();return _(t,()=>e.shortcut),t})()},get children(){return E(M,{when:r,get fallback(){return(()=>{var t=qn();return t.firstChild,_(t,()=>e.shortcut,null),t})()},get children(){return[E(Wn,{size:9}),(()=>{var t=Gn();return _(t,()=>e.shortcut),t})()]}})}})}}),null),O(()=>I(i,e.class)),i})()},Yn=e=>E(Jn,{get shortcut(){return e.shortcut},get modifier(){return e.modifier},get class(){return Z(`text-[11px] font-sans text-[var(--rg-text-secondary)] ml-4`,e.class)}}),Xn=({hiddenOpacity:e=`0`,visibleOpacity:t=`1`}={})=>{let n,r,i,a=e=>{r&&(r.style.opacity=t,r.style.top=`${e.offsetTop}px`,r.style.left=`${e.offsetLeft}px`,r.style.width=`${e.offsetWidth}px`,r.style.height=`${e.offsetHeight}px`)},o=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>{i&&a(i)});U(()=>o?.disconnect());let s=()=>{i=void 0,o?.disconnect(),r&&(r.style.opacity=e)};return{containerRef:e=>{n=e},followerRef:e=>{r=e},followElement:e=>{if(!(!r||!n)){if(!e){s();return}i=e,a(e),o?.disconnect(),o?.observe(e),o?.observe(n)}},hideFollower:s}},Zn=(e,t)=>e!==t&&e instanceof HTMLElement,Qn=(e,t)=>{let n=[];for(let r of Array.from(e.children))Zn(r,t)&&n.push(r);return n},$n=(e={})=>{let{topCornerRadiusPx:t,bottomCornerRadiusPx:n,cornerShape:r}=e,i=t!==void 0||n!==void 0,a,o=!1,s=e=>{if(!a||!i)return;let s=e.parentElement;if(!s)return;let c=Qn(s,a),l=c[0]===e,u=c[c.length-1]===e,d=l&&t!==void 0?`${t}px`:`0px`,f=u&&n!==void 0?`${n}px`:`0px`;a.style.borderTopLeftRadius=d,a.style.borderTopRightRadius=d,a.style.borderBottomLeftRadius=f,a.style.borderBottomRightRadius=f,r&&!o&&(a.style.setProperty(`corner-shape`,r),o=!0)},{containerRef:c,followerRef:l,followElement:u,hideFollower:d}=Xn();return{containerRef:c,highlightRef:e=>{a=e,o=!1,l(e)},updateHighlight:e=>{u(e),e&&s(e)},clearHighlight:d}},er=(e={})=>{let n=new Map,r=[],i=`react-grab-menu-${Math.random().toString(36).slice(2,8)}`,a=0,o=!1,s=e.value!==void 0,[c,l]=W(null),[u,d]=W(0),f=A(()=>s?e.value?.()??null:c()),p=t=>{if(s){e.onValueChange?.(t);return}l(t)},m=$n(e.highlight??{});P(t([f,u],([e])=>{if(e===null){m.clearHighlight();return}let t=n.get(e);t?m.updateHighlight(t.element):m.clearHighlight()}));let h=()=>r.filter(e=>n.get(e)?.isEnabled()),g=()=>{let e=h();e.length>0&&p(e[0])},_=()=>{let e=h();e.length>0&&p(e[e.length-1])},v=()=>{let e=h();if(e.length===0)return;let t=e.indexOf(f()??``);p(e[t===-1?0:(t+1)%e.length])},y=()=>{let e=h();if(e.length===0)return;let t=e.indexOf(f()??``);p(e[t===-1?e.length-1:(t-1+e.length)%e.length])},b=A(()=>{u();let e=f();if(e!==null)return n.get(e)?.domId});return{keyboardNavigation:e.keyboardNavigation??!1,clearActiveOnPointerLeave:e.clearActiveOnPointerLeave??!1,activeValue:f,activeDescendantId:b,setActiveItem:p,createItemId:()=>`${i}-item-${a++}`,canActivateOnHover:()=>!(e.requirePointerMove??!1)||o,notePointerMove:()=>{o=!0},resetPointerMove:()=>{o=!1},registerItem:e=>{n.set(e.value,e),r.includes(e.value)||r.push(e.value),d(e=>e+1)},unregisterItem:e=>{n.delete(e);let t=r.indexOf(e);t!==-1&&r.splice(t,1),s||l(t=>t===e?null:t),d(e=>e+1)},getActiveItem:()=>{let e=f();return e===null?void 0:n.get(e)},selectFirst:g,selectLast:_,selectNext:v,selectPrevious:y,setHighlightContainer:m.containerRef,setHighlightRail:m.highlightRef}},Q={Provider:Fn,Panel:In,List:Rn,Item:Bn,Label:Hn,Shortcut:Yn},tr=e=>e??!0,nr=(e,t)=>typeof e.enabled==`function`?t?e.enabled(t):!1:tr(e.enabled),$=e=>{e.type===`contextmenu`&&e.preventDefault(),e.stopImmediatePropagation()},rr=e=>{let t=fe(t=>{e.isOpen()&&(e.shouldIgnoreKeyboardEvent?.(t)||e.shouldIgnoreInputEvents&&m(t)||t.code===`Escape`&&(t.preventDefault(),t.stopImmediatePropagation(),e.onDismiss(`keyboard`)))}),n=fe(t=>{e.isOpen()&&(r(t,`data-react-grab-ignore-events`)||e.shouldIgnoreRightClick&&t instanceof MouseEvent&&t.button===2||e.onDismiss(`pointer`))}),i=we(()=>{window.addEventListener(`mousedown`,n,{capture:!0}),window.addEventListener(`touchstart`,n,{capture:!0})});return window.addEventListener(`keydown`,t,{capture:!0}),()=>{Oe(i),window.removeEventListener(`keydown`,t,{capture:!0}),window.removeEventListener(`mousedown`,n,{capture:!0}),window.removeEventListener(`touchstart`,n,{capture:!0})}};var ir=F(`<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 w-fit h-fit px-2">`),ar=F(`<div data-react-grab-ignore-events data-react-grab-context-menu class="fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none"style=pointer-events:auto>`);const or=n=>{let r,a,o=null,s=er({keyboardNavigation:!0,highlight:{bottomCornerRadiusPx:14,cornerShape:Y}}),[c,l]=W(0),[u,d]=W(0),f=A(()=>n.position!==null),m=A(()=>et({tagName:n.tagName,componentName:n.componentName})),h=()=>{if(r){let e=r.getBoundingClientRect();l(e.width),d(e.height)}};P(()=>{f()&&we(h)});let g=A(()=>{let e=n.selectionBounds,t=n.position,r=c(),i=u();if(r===0||i===0||!e||!t)return{left:be.left,top:be.top,arrowLeft:0,arrowPosition:`bottom`};let a=t.x??e.x+e.width/2,o=Math.max(4,Math.min(a-r/2,window.innerWidth-r-4)),s=Math.max(8,Math.min(a-o,r-8)),l=e.y+e.height+8+4,d=e.y-i-8-4,f=l+i>window.innerHeight,p=d>=0,m=f&&p,h=m?d:l,g=m?`top`:`bottom`;if(f&&!p){let n=t.y??e.y+e.height/2;h=Math.max(4,Math.min(n+4,window.innerHeight-i-4)),g=`top`}return{left:o,top:h,arrowLeft:s,arrowPosition:g}}),v=A(()=>{let e=n.actions??[],t=n.actionContext;return e.map(e=>({id:e.id,label:e.label,action:()=>{t&&e.onAction(t)},enabled:nr(e,t),shortcut:e.shortcut,shortcutModifier:e.shortcutModifier}))});P(t(f,e=>{if(e){let e=r?.getRootNode(),t=e instanceof ShadowRoot?e.activeElement:null,n=document.activeElement;o=n instanceof HTMLElement&&t===null&&!(r instanceof Element&&r.contains(n))?n:null,a?.focus({preventScroll:!0});return}s.setActiveItem(null);let t=o;o=null,!(!(t instanceof HTMLElement)||!document.contains(t))&&we(()=>{let e=document.activeElement;(e===null||e===document.body)&&t.focus({preventScroll:!0})})})),p(()=>{h();let e=e=>{if(!f())return;let t=e.key===`ArrowDown`,r=e.key===`ArrowUp`,i=e.key===`Home`,a=e.key===`End`,o=e.key===`Tab`;if(t||r||i||a||o){e.preventDefault(),e.stopPropagation();let n=t||o&&!e.shiftKey;i?s.selectFirst():a?s.selectLast():n?s.selectNext():s.selectPrevious();return}let c=n.actions??[],l=n.actionContext,u=t=>{l&&nr(t,l)&&(e.preventDefault(),e.stopPropagation(),t.onAction(l),n.onHide())};if(e.key===`Enter`){let t=s.getActiveItem();if(t){e.preventDefault(),e.stopPropagation(),t.isEnabled()&&t.onSelect();return}}let d=te(c,e,{includeModifierShortcuts:!0});d&&u(d)},t=rr({isOpen:f,onDismiss:n.onDismiss,shouldIgnoreRightClick:!0}),r=fe(e);window.addEventListener(`keydown`,r,{capture:!0}),U(()=>{t(),window.removeEventListener(`keydown`,r,{capture:!0})})});let y=A(()=>{let{tagName:e,componentName:t}=m();return`Actions for ${t?`${t}.${e}`:e}`});return E(M,{get when(){return f()},get children(){var t=ar();i(t,`contextmenu`,$,!0),i(t,`click`,$,!0),i(t,`mousedown`,$,!0),i(t,`pointerdown`,$,!0);var o=r;return typeof o==`function`?R(o,t):r=t,e(t,`z-index`,`${ue}`),_(t,E(ot,{get position(){return g().arrowPosition},leftPercent:0,get leftOffsetPx(){return g().arrowLeft}}),null),_(t,E(Q.Panel,{class:`justify-center items-start min-w-[100px]`,get children(){return[(()=>{var e=ir();return _(e,E(ft,{get tagName(){return m().tagName},get componentName(){return m().componentName},get isClickable(){return n.hasFilePath},onClick:e=>{e.stopPropagation(),n.hasFilePath&&n.actionContext&&(n.actions?.find(e=>e.id===`open`))?.onAction(n.actionContext)},shrink:!0})),e})(),E(mt,{get children(){return E(Q.Provider,{store:s,get children(){return E(Q.List,{ref:e=>a=e,get label(){return y()},class:`w-[calc(100%+16px)] -mx-2 -my-1.5 outline-none`,get children(){return E(ne,{get each(){return v()},children:e=>E(Q.Item,{get value(){return e.id},get dataId(){return e.label.toLowerCase()},get disabled(){return!e.enabled},onSelect:()=>{e.action(),n.onHide()},get children(){return[E(Q.Label,{class:`text-[var(--rg-text-primary)]`,get children(){return e.label}}),E(M,{get when(){return e.shortcut},children:t=>E(Q.Shortcut,{get shortcut(){return t()},get modifier(){return e.shortcutModifier}})})]}})})}})}})}})]}}),null),O(n=>{var r=`${g().top}px`,i=`${g().left}px`;return r!==n.e&&e(t,`top`,n.e=r),i!==n.t&&e(t,`left`,n.t=i),n},{e:void 0,t:void 0}),t}})};o([`pointerdown`,`mousedown`,`click`,`contextmenu`]);const sr=(e,t,n,r)=>Math.max(r,Math.min(e,n-t-r)),cr=({anchor:e,measuredWidth:t,measuredHeight:n,viewportLeft:r=0,viewportTop:i=0,viewportWidth:a,viewportHeight:o,anchorGapPx:s,viewportPaddingPx:c,offscreenPosition:l})=>{if(!e||t===0||n===0)return l;let u,d;return e.edge===`left`||e.edge===`right`?(u=e.edge===`left`?e.x+s:e.x-t-s,d=e.y-n/2):(u=e.x-t/2,d=e.edge===`top`?e.y+s:e.y-n-s),{left:r+sr(u-r,t,a,c),top:i+sr(d-i,n,o,c)}},lr=(e,t)=>{let[n,r]=W(0),[i,a]=W(0),[o,s]=W(!1),[c,l]=W(!1),[u,d]=W(0),[f,p]=W(`bottom`),m,h,g=()=>{clearTimeout(m),h!==void 0&&(Oe(h),h=void 0)},_=()=>{let t=e();t&&(r(t.offsetWidth),a(t.offsetHeight))},v=()=>{C(()=>{d(e=>e+1),_()})},y=A(()=>t()!==null);return P(()=>{let n=t();n?(p(n.edge),clearTimeout(m),s(!0),h!==void 0&&Oe(h),h=we(()=>{_(),e()?.offsetHeight,l(!0)})):(h!==void 0&&Oe(h),l(!1),m=setTimeout(()=>{s(!1)},120)),U(g)}),P(()=>{if(!y())return;window.addEventListener(`resize`,v),window.visualViewport?.addEventListener(`resize`,v),window.visualViewport?.addEventListener(`scroll`,v);let e=le(),t;e&&typeof ResizeObserver<`u`&&(t=new ResizeObserver(v),t.observe(e)),U(()=>{window.removeEventListener(`resize`,v),window.visualViewport?.removeEventListener(`resize`,v),window.visualViewport?.removeEventListener(`scroll`,v),t?.disconnect()})}),{shouldMount:o,isAnimatedIn:c,lastAnchorEdge:f,displayPosition:A(e=>{u();let r=Qe(),a=cr({anchor:t(),measuredWidth:n(),measuredHeight:i(),viewportLeft:r.offsetLeft,viewportTop:r.offsetTop,viewportWidth:r.width,viewportHeight:r.height,anchorGapPx:8,viewportPaddingPx:8,offscreenPosition:be});return a.left===be.left?e:a},be),measure:_,clearAnimationHandles:g}},ur={padding:{prefix:`p`,scale:`spacing`},"padding-top,padding-bottom":{prefix:`py`,scale:`spacing`},"padding-left,padding-right":{prefix:`px`,scale:`spacing`},"padding-top":{prefix:`pt`,scale:`spacing`},"padding-right":{prefix:`pr`,scale:`spacing`},"padding-bottom":{prefix:`pb`,scale:`spacing`},"padding-left":{prefix:`pl`,scale:`spacing`},margin:{prefix:`m`,scale:`spacing`},"margin-top,margin-bottom":{prefix:`my`,scale:`spacing`},"margin-left,margin-right":{prefix:`mx`,scale:`spacing`},"margin-top":{prefix:`mt`,scale:`spacing`},"margin-right":{prefix:`mr`,scale:`spacing`},"margin-bottom":{prefix:`mb`,scale:`spacing`},"margin-left":{prefix:`ml`,scale:`spacing`},gap:{prefix:`gap`,scale:`spacing`},"column-gap":{prefix:`gap-x`,scale:`spacing`},"row-gap":{prefix:`gap-y`,scale:`spacing`},"width,height":{prefix:`size`,scale:`spacing`},width:{prefix:`w`,scale:`spacing`},height:{prefix:`h`,scale:`spacing`},"min-width":{prefix:`min-w`,scale:`spacing`},"max-width":{prefix:`max-w`,scale:`spacing`},"min-height":{prefix:`min-h`,scale:`spacing`},"max-height":{prefix:`max-h`,scale:`spacing`},"top,right,bottom,left":{prefix:`inset`,scale:`spacing`},"top,bottom":{prefix:`inset-y`,scale:`spacing`},"left,right":{prefix:`inset-x`,scale:`spacing`},top:{prefix:`top`,scale:`spacing`},right:{prefix:`right`,scale:`spacing`},bottom:{prefix:`bottom`,scale:`spacing`},left:{prefix:`left`,scale:`spacing`},"border-width":{prefix:`border`,scale:`border-width`},"border-top-width":{prefix:`border-t`,scale:`border-width`},"border-right-width":{prefix:`border-r`,scale:`border-width`},"border-bottom-width":{prefix:`border-b`,scale:`border-width`},"border-left-width":{prefix:`border-l`,scale:`border-width`},"z-index":{prefix:`z`,scale:`z-index`},opacity:{prefix:`opacity`,scale:`opacity`}},dr=(e,t)=>{let n=ur[e];if(!n)return null;let{prefix:r,scale:i}=n;if(i===`spacing`){if(t<0)return null;let e=t/4;return!Number.isInteger(e)||e>96?null:`${r}-${e}`}return i===`border-width`?!Number.isInteger(t)||t<0||t>8?null:t===1?r:`${r}-${t}`:i===`z-index`?!Number.isInteger(t)||t<0||t>50?null:`${r}-${t}`:!Number.isFinite(t)||t<0||t>100||t%5!=0?null:`${r}-${t}`},fr=e=>{let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement:e.ownerDocument?.activeElement??document.activeElement},pr=e=>e.toLowerCase()===`#00000000`?Fe:e.toUpperCase();var mr=F(`<input data-react-grab-ignore-events data-react-grab-input type=text autocapitalize=none autocorrect=off autocomplete=off>`);const hr=e=>{let[t,r]=n(e,[`class`,`ref`,`autoFocusSelect`]);return(()=>{var e=mr();return R(e=>{t.autoFocusSelect&&queueMicrotask(()=>{e.focus(),e.select()}),t.ref?.(e)},e),u(e,`spellcheck`,!1),w(e,f({get class(){return Z(`bg-transparent border-none outline-none text-[var(--rg-text-primary)] p-0 m-0`,t.class)}},r),!1,!1),e})()},gr=`text-[13px] leading-4 font-medium`,_r={position:`absolute`,opacity:0,"pointer-events":`none`,width:`0`,height:`0`,margin:`0`,padding:`0`,overflow:`hidden`};var vr=F(`<div class="flex items-center gap-2 w-full px-2 h-[20px]"><div class="flex items-center gap-1 ml-auto shrink-0"><button type=button data-react-grab-ignore-events aria-label="Pick color"class="size-[16px] rounded-[4px] border-[var(--rg-border-button)] [border-width:0.5px] border-solid p-0 m-0 cursor-pointer shrink-0"></button><input data-react-grab-ignore-events type=color aria-hidden=true tabindex=-1 class="absolute opacity-0 pointer-events-none size-0">`),yr=F(`<span>`),br=F(`<span class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)] cursor-text">`);const xr=e=>e.length===9?e.slice(0,7):e,Sr=t=>{let[n,r]=W(null),i=()=>n()!==null,a=()=>pr(t.value),o,s=!0;U(()=>{s=!1}),p(()=>{let e=t.onRegisterTrigger?.(()=>o?.click());U(()=>e?.())});let c=()=>{let e=n();if(e===null)return;r(null);let i=d(e);i?i.toLowerCase()!==t.value.toLowerCase()&&t.onCommit(i,`keyboard`):t.onInvalidCommit?.(),t.onEditComplete?.()},l=()=>{i()&&(r(null),t.onEditComplete?.())},f=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.stopImmediatePropagation(),e.key===`Enter`){e.preventDefault(),c();return}e.key===`Escape`&&(e.preventDefault(),l())}},m=e=>{e.preventDefault(),e.stopPropagation(),t.onInteract?.(),o?.click()};return(()=>{var l=vr(),d=l.firstChild,p=d.firstChild,h=p.nextSibling;_(l,E(M,{get when(){return t.label},children:e=>(()=>{var t=yr();return I(t,`${gr} text-[var(--rg-text-primary)] truncate min-w-0`),_(t,e),t})()}),d),_(d,E(M,{get when(){return i()},get fallback(){return(()=>{var e=br();return e.$$click=e=>{e.preventDefault(),e.stopPropagation(),r(a())},e.$$pointerdown=e=>e.stopPropagation(),_(e,a),O(()=>u(e,`data-react-grab-value`,a())),e})()},get children(){return E(hr,{autoFocusSelect:!0,inputmode:`text`,"aria-label":`Style color hex`,class:`text-[12px] leading-4 font-medium tabular-nums text-right`,get style(){return{"field-sizing":`content`,"min-width":`32px`,"max-width":t.emphasized?`100px`:`72px`}},get value(){return n()??``},onInput:e=>r(e.currentTarget.value),onKeyDown:f,onBlur:c,onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})}}),p),p.$$click=m,p.$$mousedown=e=>e.preventDefault(),p.$$pointerdown=e=>e.stopPropagation(),h.$$input=e=>{if(!s)return;let n=e.currentTarget.value,r=t.value.length===9?t.value.slice(7):``,i=n+(r.toLowerCase()===`00`?``:r);t.onInteract?.(),i&&i.toLowerCase()!==t.value.toLowerCase()&&t.onCommit(i,`pointer`)};var g=o;return typeof g==`function`?R(g,h):o=h,O(n=>e(p,`background-color`,t.value)),O(()=>h.value=xr(t.value)),l})()};o([`pointerdown`,`mousedown`,`click`,`input`]);var Cr=F(`<svg width=1em height=1em viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg aria-hidden=true style=width:16px;height:16px;flex-shrink:0;cursor:pointer><path fill-rule=evenodd clip-rule=evenodd>`);const wr=t=>{let n=()=>t.active?`var(--rg-text-primary)`:`var(--rg-text-secondary)`,r=()=>t.active?t.direction===`left`?-2:2:0,a=()=>t.active?1.12:1,o=()=>t.direction===`left`?`M2.54282 10.5427C1.76177 11.3238 1.76177 12.5901 2.54282 13.3712L9.70183 20.5302C11.1193 21.9476 13.5428 20.9437 13.5428 18.9392V16.9573H21.0428C22.1474 16.9573 23.0428 16.0619 23.0428 14.9573V8.95733C23.0428 7.85276 22.1474 6.95733 21.0428 6.95733L13.5428 6.95733V4.97473C13.5428 2.9702 11.1193 1.96631 9.70183 3.38373L2.54282 10.5427Z`:`M14.2983 20.5302L21.4573 13.3712C22.2383 12.5901 22.2383 11.3238 21.4573 10.5427L14.2983 3.38374C12.8808 1.96631 10.4573 2.97019 10.4573 4.97473V6.95659L3.95728 6.95659C2.85271 6.95659 1.95728 7.85202 1.95728 8.95659V14.9566C1.95728 16.0612 2.85271 16.9566 3.95727 16.9566H10.4573V18.9392C10.4573 20.9437 12.8808 21.9476 14.2983 20.5302Z`;return(()=>{var s=Cr(),c=s.firstChild;return i(s,`pointerdown`,t.onPointerDown,!0),O(i=>{var l=`translateX(${r()}px) scale(${a()})`,d=t.active?`transform 30ms cubic-bezier(0, 0, 0.2, 1)`:`transform 450ms cubic-bezier(0.34, 1.8, 0.64, 1)`,f=o(),p=n(),m=t.active?`fill 50ms ease`:`fill 300ms ease`;return l!==i.e&&e(s,`transform`,i.e=l),d!==i.t&&e(s,`transition`,i.t=d),f!==i.a&&u(c,`d`,i.a=f),p!==i.o&&u(c,`fill`,i.o=p),m!==i.i&&e(c,`transition`,i.i=m),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),s})()};o([`pointerdown`]);var Tr=F(`<span>`),Er=F(`<div class="flex items-center gap-2 w-full px-2 h-[20px]"><div class="ml-auto shrink-0 flex items-center gap-1"><span data-react-grab-ignore-events role=button tabindex=-1 class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)] cursor-pointer select-none min-w-[36px] text-center">`);const Dr=e=>{let t=()=>e.options.find(t=>t.value===e.value)?.label??e.value;return(()=>{var n=Er(),r=n.firstChild,i=r.firstChild;return _(n,E(M,{get when(){return e.label},get children(){var t=Tr();return I(t,`${gr} text-[var(--rg-text-primary)] truncate min-w-0`),_(t,()=>e.label),t}}),r),_(r,E(wr,{direction:`left`,get active(){return e.activeKey===`left`},onPointerDown:()=>e.onStep(-1)}),i),i.$$contextmenu=t=>{t.preventDefault(),t.stopPropagation(),e.onStep(-1)},i.$$click=t=>{t.preventDefault(),t.stopPropagation(),e.onStep(1)},i.$$mousedown=e=>e.preventDefault(),i.$$pointerdown=e=>e.stopPropagation(),_(i,t),_(r,E(wr,{direction:`right`,get active(){return e.activeKey===`right`},onPointerDown:()=>e.onStep(1)}),null),O(t=>{var n=`Cycle ${e.label??`value`}`,r=`Click to cycle (${e.options.length} options)`;return n!==t.e&&u(i,`aria-label`,t.e=n),r!==t.t&&u(i,`title`,t.t=r),t},{e:void 0,t:void 0}),n})()};o([`pointerdown`,`mousedown`,`click`,`contextmenu`]);const Or=e=>e.kind===`numeric`?e:null,kr=e=>e.kind===`color`?e:null,Ar=e=>e.kind===`enum`?e:null,jr=/^[0-9]$/,Mr=e=>{let t=Array.from(e),n=t.findIndex(e=>jr.test(e));if(n<0)return{prefixLiterals:t,rightAlignedSegments:[]};let r=t.slice(0,n),i=[],a=0;for(let e=t.length-1;e>=n;e--){let n=t[e],r=jr.test(n)?`digit`:`literal`;i.push({kind:r,value:n,digitDistanceFromRight:a}),r===`digit`&&(a+=1)}return{prefixLiterals:r,rightAlignedSegments:i}};var Nr=F(`<span class=rg-slot-column aria-hidden=true><span class=rg-slot-sizer>0</span><span class=rg-slot-cell>`),Pr=F(`<span class="rg-slot-cell rg-slot-exit">`),Fr=F(`<span><span class=inline-flex style=flex-direction:row-reverse>`),Ir=F(`<span class="inline-block whitespace-pre"aria-hidden=true>`);const Lr=e=>typeof e==`number`?e:Number.parseFloat(String(e).replace(/[^0-9.-]/g,``))||0,Rr=e=>{let n,[r,i]=W(null),a=null;P(t(()=>e.digit,(t,r)=>{r===void 0||t===r||(n&&(n.classList.remove(`rg-slot-enter`),n.offsetWidth,n.classList.add(`rg-slot-enter`)),i({digit:r,direction:e.direction}),a!==null&&clearTimeout(a),a=setTimeout(()=>i(null),350))},{defer:!0})),U(()=>{a!==null&&clearTimeout(a)});let o=()=>({"animation-delay":`${e.delayMs}ms`});return(()=>{var t=Nr(),i=t.firstChild.nextSibling,a=n;return typeof a==`function`?R(a,i):n=i,_(i,()=>e.digit),_(t,E(M,{get when(){return r()},keyed:!0,children:e=>(()=>{var t=Pr();return _(t,()=>e.digit),O(n=>{var r=String(e.direction),i=o();return r!==n.e&&u(t,`data-dir`,n.e=r),n.t=B(t,i,n.t),n},{e:void 0,t:void 0}),t})()}),null),O(t=>{var n=String(e.direction),r=o();return n!==t.e&&u(i,`data-dir`,t.e=n),t.t=B(i,r,t.t),t},{e:void 0,t:void 0}),t})()},zr=e=>{let n=A(()=>String(e.children??``)),r=A(()=>Mr(n())),i=A(t(()=>Lr(e.children),(e,t)=>t===void 0||e===t?0:e>t?1:-1)),a=A(()=>e.direction??i());return(()=>{var t=Fr(),i=t.firstChild;return _(t,E(z,{get each(){return r().prefixLiterals},children:e=>(()=>{var t=Ir();return _(t,e),t})()}),i),_(i,E(z,{get each(){return r().rightAlignedSegments},children:e=>E(M,{get when(){return e().kind===`digit`},get fallback(){return(()=>{var t=Ir();return _(t,()=>e().value),t})()},get children(){return E(Rr,{get digit(){return Number(e().value)},get direction(){return a()},get delayMs(){return e().digitDistanceFromRight*18}})}})})),O(r=>{var i=n(),a=`inline-flex ${e.class??``}`,o={...e.style,"--rg-slot-dur":`350ms`};return i!==r.e&&u(t,`aria-label`,r.e=i),a!==r.t&&I(t,r.t=a),r.a=B(t,o,r.a),r},{e:void 0,t:void 0,a:void 0}),t})()};var Br=F(`<div data-react-grab-slider-base aria-hidden=true class="absolute inset-y-0 left-0 right-0 rounded-[6px] bg-[var(--rg-surface-active)] pointer-events-none">`),Vr=F(`<div class="flex items-center gap-1 w-full px-1"><div role=slider aria-keyshortcuts="ArrowLeft ArrowRight"tabindex=-1 class="relative flex-1 h-[20px] flex items-center overflow-hidden rounded-[6px]"><div data-react-grab-slider-fill aria-hidden=true class="absolute inset-y-0 left-0 bg-[var(--rg-surface-active)] pointer-events-none"></div><div aria-hidden=true class="absolute inset-0 pointer-events-none"></div><div data-react-grab-slider-handle aria-hidden=true class="absolute top-[2px] bottom-[2px] w-[2px] rounded-[1px] bg-[var(--rg-text-primary)] pointer-events-none"style="transition:opacity 120ms ease"></div><div class="relative z-10 flex items-center justify-between w-full px-2 pointer-events-none">`),Hr=F(`<div data-react-grab-slider-hash-mark class="absolute top-1/2 w-px h-[8px] rounded-[1px] bg-[var(--rg-text-secondary)]"style="transform:translate(-50%, -50%);transition:opacity 200ms ease">`),Ur=F(`<span>`),Wr=F(`<span class="ml-auto flex items-center gap-1 pointer-events-auto"><span data-react-grab-value-text class="text-[12px] leading-4 font-medium tabular-nums text-[var(--rg-text-primary)]"><span class="text-[9px] text-[var(--rg-text-secondary)] ml-px">`),Gr=F(`<span data-react-grab-tailwind-label aria-hidden=true class="text-[10px] leading-4 text-[var(--rg-text-secondary)] tabular-nums">`);const Kr=Array.from({length:9},(e,t)=>(t+1)*100/10),qr=/^(-?(?:\d+\.?\d*|\.\d+))\s*([a-zA-Z%]*)$/,Jr=t=>{let[n,r]=W(null),[i,a]=W(0),[o,s]=W(!1),[c,l]=W(!1),d=()=>n()!==null,f,m=null,h=()=>{let e=t.max-t.min;return e<=0?0:(Math.max(t.min,Math.min(t.max,t.value))-t.min)/e*100},g=()=>{t.onCommitValue&&r(k(t.value))},v=()=>!!t.onCommitValue,y=(e,n)=>{if(n.width<=0)return t.value;let r=Math.max(0,Math.min(1,(e-n.left)/n.width));return t.min+r*(t.max-t.min)},b=(e,n)=>{t.onCommitValue?.(y(e,n),`pointer`)},x=(e,t)=>{let n=Math.max(0,e-t.right)-Math.max(0,t.left-e),r=Math.max(0,Math.abs(n)-32),i=Math.sqrt(Math.min(r/200,1));return Math.sign(n)*8*i},S=e=>{if(!v()||d())return;e.preventDefault(),e.stopPropagation(),e.currentTarget.setPointerCapture(e.pointerId);let n=f,r=n!==void 0&&e.target instanceof Node&&n.contains(e.target);m={startX:e.clientX,isDragging:!1,startedOnValueText:r,trackRect:e.currentTarget.getBoundingClientRect()},s(!0),t.onInteract?.()},C=e=>{if(!m)return;let n=e.clientX-m.startX;!m.isDragging&&Math.abs(n)<3||(m.isDragging=!0,t.onInteract?.(),b(e.clientX,m.trackRect),a(x(e.clientX,m.trackRect)))},w=e=>{let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),m&&(m.isDragging||(m.startedOnValueText?g():b(m.startX,m.trackRect)),m=null,s(!1),a(0))},T=e=>{let t=e.currentTarget;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),m&&(m=null,s(!1),a(0))};p(()=>{let e=()=>{m=null,s(!1),l(!1),a(0)};window.addEventListener(`blur`,e),U(()=>window.removeEventListener(`blur`,e))});let D=()=>!!t.activeKey||o()||c(),A=()=>{let e=n();if(e===null)return;r(null);let i=e.trim().replace(/(\d),(\d)/g,`$1.$2`).match(qr);if(!i){t.onInvalidCommit?.(),t.onEditComplete?.();return}let a=i[2].toLowerCase();if(a&&a!==t.unit){t.onInvalidCommit?.(),t.onEditComplete?.();return}let o=Number.parseFloat(i[1]);Number.isFinite(o)?t.onCommitValue?.(o,`keyboard`):t.onInvalidCommit?.(),t.onEditComplete?.()},ee=()=>{d()&&(r(null),t.onEditComplete?.())},j=e=>{if(!(e.isComposing||e.keyCode===229)){if(e.stopImmediatePropagation(),e.key===`Enter`){e.preventDefault(),A();return}e.key===`Escape`&&(e.preventDefault(),ee())}},N=()=>{let e=i();return{cursor:v()&&!d()?`ew-resize`:`default`,"touch-action":v()?`none`:`auto`,"user-select":`none`,"-webkit-user-select":`none`,"min-width":t.emphasized?`96px`:void 0,transform:e===0?`translateX(0)`:`translateX(${e}px)`,transition:o()?`none`:`transform 350ms ${Te}`}};return(()=>{var i=Vr(),a=i.firstChild,s=a.firstChild,p=s.nextSibling,m=p.nextSibling,g=m.nextSibling;return a.addEventListener(`lostpointercapture`,T),a.addEventListener(`pointercancel`,T),a.$$pointerup=w,a.addEventListener(`pointerleave`,()=>l(!1)),a.addEventListener(`pointerenter`,()=>l(!0)),a.$$pointermove=C,a.$$pointerdown=S,_(a,E(M,{get when(){return t.emphasized},get children(){var t=Br();return O(n=>e(t,`opacity`,d()?0:.55)),t}}),s),_(p,E(z,{each:Kr,children:t=>(()=>{var n=Hr();return O(r=>{var i=`${t()}%`,a=D()?.4:0;return i!==r.e&&e(n,`left`,r.e=i),a!==r.t&&e(n,`opacity`,r.t=a),r},{e:void 0,t:void 0}),n})()})),_(g,E(M,{get when(){return t.label},children:e=>(()=>{var t=Ur();return I(t,`${gr} text-[var(--rg-text-primary)] truncate min-w-0`),_(t,e),t})()}),null),_(g,E(M,{get when(){return d()},get fallback(){return(()=>{var n=Wr(),r=n.firstChild,i=r.firstChild,a=f;return typeof a==`function`?R(a,n):f=n,_(n,E(M,{get when(){return t.tailwindLabel},children:e=>(()=>{var t=Gr();return _(t,e),t})()}),r),_(r,E(zr,{get children(){return k(t.value)}}),i),_(i,()=>t.unit),O(r=>{var i=`${k(t.value)}${t.unit}`,a=t.onCommitValue?`text`:`default`;return i!==r.e&&u(n,`data-react-grab-value`,r.e=i),a!==r.t&&e(n,`cursor`,r.t=a),r},{e:void 0,t:void 0}),n})()},get children(){return E(hr,{autoFocusSelect:!0,inputmode:`decimal`,"aria-label":`Style value`,class:`text-[12px] leading-4 font-medium tabular-nums text-right pointer-events-auto ml-auto`,get style(){return{"field-sizing":`content`,"min-width":`16px`,"max-width":t.emphasized?`120px`:`60px`}},get value(){return n()??``},onInput:e=>r(e.currentTarget.value),onKeyDown:j,onBlur:A,onPointerDown:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()})}}),null),_(i,E(M,{get when(){return t.emphasized},get children(){return[E(wr,{direction:`left`,get active(){return t.activeKey===`left`},onPointerDown:()=>t.onStep(-1)}),E(wr,{direction:`right`,get active(){return t.activeKey===`right`},onPointerDown:()=>t.onStep(1)})]}}),null),O(n=>{var r=t.label??`Value`,i=t.min,l=t.max,f=t.value,p=`${k(t.value)}${t.unit}`,g=N(),_=`${h()}%`,v=+!d(),y=`calc(${h()}% - 1px)`,b=t.activeKey?.9:o()||c()?.35:0;return r!==n.e&&u(a,`aria-label`,n.e=r),i!==n.t&&u(a,`aria-valuemin`,n.t=i),l!==n.a&&u(a,`aria-valuemax`,n.a=l),f!==n.o&&u(a,`aria-valuenow`,n.o=f),p!==n.i&&u(a,`aria-valuetext`,n.i=p),n.n=B(a,g,n.n),_!==n.s&&e(s,`width`,n.s=_),v!==n.h&&e(s,`opacity`,n.h=v),y!==n.r&&e(m,`left`,n.r=y),b!==n.d&&e(m,`opacity`,n.d=b),n},{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,d:void 0}),i})()};o([`pointerdown`,`pointermove`,`pointerup`]);const Yr=e=>E(oe,{get children(){return[E(x,{get when(){return Or(e.property)},children:t=>E(Jr,{get label(){return g(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get min(){return t().min},get max(){return t().max},get unit(){return t().unit},get activeKey(){return e.activeKey},get onStep(){return e.onStep},get onCommitValue(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onInteract(){return e.onInteract},get tailwindLabel(){return e.tailwindLabel},get emphasized(){return e.emphasized}})}),E(x,{get when(){return kr(e.property)},children:t=>E(Sr,{get label(){return g(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get onCommit(){return e.onCommit},get onEditComplete(){return e.onEditComplete},get onInvalidCommit(){return e.onInvalidCommit},get onRegisterTrigger(){return e.onColorPickerRegister},get onInteract(){return e.onInteract},get emphasized(){return e.emphasized}})}),E(x,{get when(){return Ar(e.property)},children:t=>E(Dr,{get label(){return g(()=>!!e.showLabel)()?t().label:void 0},get value(){return t().value},get options(){return t().options},get activeKey(){return e.activeKey},get onStep(){return e.onStep}})})]}});var Xr=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">Copy`);const Zr=e=>E(Et,{"data-react-grab-ignore-events":!0,"data-react-grab-copy-button":!0,onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onCopy()},get children(){return Xr()}}),Qr=()=>{let[e,t]=W(!1),n,r=()=>{clearTimeout(n),t(!1)},i=()=>{t(!0),clearTimeout(n),n=setTimeout(()=>{t(!1)},me)},a=()=>{clearTimeout(n)};return U(a),{isPending:e,show:i,hide:r,cleanup:a}};var $r=F(`<div role=menu aria-orientation=vertical aria-label="Editable properties"class="relative flex flex-col w-full max-h-[var(--rg-edit-list-max-h)] overflow-y-auto outline-none no-scrollbar"><div aria-hidden=true class="pointer-events-none absolute opacity-0 transition-[top,left,width,height,opacity,border-radius] duration-75 ease-out bg-[var(--rg-surface-hover)]">`),ei=F(`<div class="flex items-center w-full h-[24px]">`),ti=F(`<button data-react-grab-ignore-events type=button role=menuitem tabindex=-1 class="relative z-1 contain-layout block w-full h-[24px] px-0 py-0 cursor-pointer text-left border-none bg-transparent">`),ni=F(`<div class="flex items-center justify-between w-full h-[24px] px-2 gap-2"><span class="text-[13px] leading-4 font-sans font-medium text-[var(--rg-text-primary)] truncate min-w-0">`),ri=F(`<span class="font-sans text-[var(--rg-text-secondary)] tabular-nums shrink-0"><span class=text-[11px]></span><span class="text-[9px] ml-px">`),ii=F(`<span aria-hidden=true class="size-[12px] rounded-[3px] border-[var(--rg-border-button)] [border-width:0.5px] border-solid shrink-0">`),ai=F(`<span class="text-[11px] font-sans text-[var(--rg-text-secondary)] shrink-0">`);const oi=e=>{let t=Ar(e);return t?t.options.find(e=>e.value===t.value)?.label??t.value:``},si=t=>{let n=[],r,i=!1,a=null,o=()=>{if(!r)return!1;let e=fr(r);return e instanceof HTMLElement&&e.matches(`input[data-react-grab-input]`)},s=(e,n)=>{n===`move`&&(i=!0);let r=o();if(i&&!r){if(t.isAdjusting()){a=e;return}a=null,e!==t.activeIndex&&t.onHoverIndex(e)}};P(()=>{if(t.isAdjusting())return;let e=a;if(e===null)return;a=null;let r=n[e],s=o();i&&(s||r?.matches(`:hover`)&&e!==t.activeIndex&&t.onHoverIndex(e))});let{containerRef:c,highlightRef:l,updateHighlight:d,clearHighlight:f}=$n({});P(()=>{n.length=t.properties.length});let p;return P(()=>{let e=t.activeIndex,i=n[e];if(!i||e<0){f();return}if(d(i),p!==void 0&&cancelAnimationFrame(p),p=requestAnimationFrame(()=>{p=void 0;let t=n[e];t&&d(t)}),!r)return;let a=r.getBoundingClientRect(),o=i.getBoundingClientRect();(o.top<a.top||o.bottom>a.bottom)&&i.scrollIntoView({block:`nearest`})}),U(()=>{p!==void 0&&cancelAnimationFrame(p)}),(()=>{var o=$r(),d=o.firstChild;return o.$$pointermove=()=>{i=!0},R(e=>{r=e,c(e)},o),R(l,d),_(o,E(z,{get each(){return t.properties},children:(i,o)=>{let c=()=>o===t.activeIndex;return(()=>{var l=ti();return l.$$click=e=>{e.stopPropagation(),t.onSelect(o)},l.$$mousedown=e=>{let t=r?fr(r):null;t instanceof HTMLElement&&t.matches(`input[data-react-grab-input]`)&&t.blur(),e.preventDefault()},l.addEventListener(`pointerleave`,()=>{a===o&&(a=null)}),l.$$pointermove=()=>{s(o,`move`)},l.addEventListener(`pointerenter`,()=>{s(o,`enter`)}),R(e=>{n[o]=e,U(()=>{n[o]===e&&(n[o]=void 0)})},l),_(l,E(M,{get when(){return c()},get fallback(){return(()=>{var t=ni(),n=t.firstChild;return _(n,()=>i().label),_(t,E(oe,{get children(){return[E(x,{get when(){return Or(i())},children:e=>(()=>{var t=ri(),n=t.firstChild,r=n.nextSibling;return _(n,()=>k(e().value)),_(r,()=>e().unit),t})()}),E(x,{get when(){return kr(i())},children:t=>(()=>{var n=ii();return O(r=>e(n,`background-color`,t().value)),n})()}),E(x,{get when(){return Ar(i())},children:e=>(()=>{var t=ai();return _(t,()=>oi(e())),t})()})]}}),null),t})()},get children(){var e=ei();return _(e,E(Yr,{get property(){return i()},get activeKey(){return t.activeKey},get onStep(){return t.onStep},get onCommit(){return t.onCommit},get onEditComplete(){return t.onEditComplete},get onInvalidCommit(){return t.onInvalidCommit},get onInteract(){return t.onInteract},get onColorPickerRegister(){return t.onColorPickerRegister},showLabel:!0,get tailwindLabel(){return t.activeTailwindLabel}})),e}})),O(e=>{var t=i().key,n=c()?`true`:void 0;return t!==e.e&&u(l,`data-react-grab-edit-property`,e.e=t),n!==e.t&&u(l,`aria-current`,e.t=n),e},{e:void 0,t:void 0}),l})()}}),null),o})()};o([`pointermove`,`mousedown`,`click`]);const ci=(e,t,n)=>e.kind===`color`&&typeof t==`string`&&typeof n==`string`?t.toLowerCase()===n.toLowerCase():t===n,li=e=>e===`ArrowLeft`?-1:1,ui=e=>{let[t,n]=W(0),r=null,i=null,a=null,o=()=>{i!==null&&clearTimeout(i),a!==null&&clearInterval(a),i=null,a=null,r=null},s=()=>{o(),n(0)},c=t=>{o(),r=t;let n=li(t);i=setTimeout(()=>{a=setInterval(()=>{e.step(n,e.isShiftHeld(),e.isAltHeld(),!0)},60)},280)};return p(()=>{window.addEventListener(`blur`,s),U(()=>window.removeEventListener(`blur`,s))}),U(s),{heldDirection:t,pressArrow:(t,r,i,a)=>{if(r)return;let o=li(t);c(t),n(o),e.step(o,i,a,!1)},releaseKey:e=>{e===r&&s()},cancelRepeat:s}},di=(e,t,n)=>{if(e.length===0)return null;let r=e.findIndex(e=>e.value===t),i=e[((r===-1?0:r)+n+e.length)%e.length];return!i||i.value===t?null:i},fi=(e,t,n,r,i)=>{if(e.kind===`enum`)return di(e.options,e.value,t)?.value??null;if(e.kind!==`numeric`)return null;let a=Math.min(e.min,e.value),o=Math.max(e.max,e.value);if(!n&&!r&&e.unit===`px`&&i?.hasTokens){let n=i.stepLength(e.value,t,e.cssProperties[0]);if(n!==null){let t=v(c(n,a,o));if(t!==e.value)return t}}let s=n?10:1,l=v(c(e.value+t*s,a,o));return l===e.value?null:l},pi=/^-?\d*\.?\d+$/,mi=e=>pi.test(e),hi=e=>e.toLowerCase().replace(/[^a-z0-9]+/g,``),gi=e=>{if(e.kind!==`enum`)return[];let t=[];for(let n of e.options){let e=hi(n.value),r=hi(n.label);e&&t.push(e),r&&r!==e&&t.push(r)}return t},_i=e=>{let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(let e of r.tailwindAliases){let i=hi(e);i&&t.push({property:r,originalIndex:n,kind:`alias`,term:i})}for(let e of gi(r))t.push({property:r,originalIndex:n,kind:`enum-option`,term:e});let i=hi(r.label);i&&t.push({property:r,originalIndex:n,kind:`name`,term:i});let a=hi(r.key);a&&a!==i&&t.push({property:r,originalIndex:n,kind:`name`,term:a});let o=hi(`${r.label} ${r.key}`);o&&t.push({property:r,originalIndex:n,kind:`label`,term:o})}return t},vi=(e,t)=>{if(t.kind===`alias`||t.kind===`enum-option`||t.kind===`name`)return e===t.term?se+t.term.length:t.term.startsWith(e)||e.startsWith(t.term)?J+Math.min(e.length,t.term.length):null;let n=t.term.indexOf(e);return n===-1?null:n===0?Le-t.term.length*1:X-n*100-t.term.length*1},yi=(e,t,n,r)=>{let i=e.get(t.key);i&&i.score>=r||e.set(t.key,{property:t,score:r,originalIndex:n})},bi=e=>{let t=_i(e),n=new Map;for(let t=0;t<e.length;t++)n.set(e[t].key,t);let r=(t,r,i)=>{for(let a=0;a<r.length;a++){let o=r[a],s=n.get(o);if(s===void 0)continue;let c=e[s];yi(t,c,s,i-a)}};return{search:n=>{let i=hi(n);if(!i||mi(i))return e;let a=new Map;r(a,S(n),Ne),r(a,V(n),Ae);for(let e of t){let t=vi(i,e);t!==null&&yi(a,e.property,e.originalIndex,t)}return Array.from(a.values()).sort((e,t)=>t.score===e.score?e.originalIndex-t.originalIndex:t.score-e.score).map(e=>e.property)}}},xi=(e,t)=>e.kind===t.kind&&!ci(e,t.value,e.original),Si=e=>{let{initialProperties:t,searchQuery:n}=e,[r,i]=W({}),a=bi(t),o=A(()=>{let e=n(),i=r(),o=e?t:t.filter(e=>e.isPrioritized||e.isCanonical&&!e.isDefault||i[e.key]!==void 0);return e?a.search(e):o.slice(0,40)}),s=new Map(t.map(e=>[e.key,e])),c=A(()=>{let e=r(),t=Object.keys(e);if(t.length===0)return o();let n=new Map;for(let r of t){let t=e[r];if(t.kind!==`numeric`)continue;let i=s.get(r);if(i)for(let e of i.cssProperties)n.set(e,t.value)}return o().map(t=>{let r=e[t.key];if(r!==void 0)return l(t,r);if(t.kind!==`numeric`)return t;let i=n.get(t.cssProperties[0]);return i===void 0?t:t.cssProperties.every(e=>n.get(e)===i)?{...t,value:i}:t})}),l=(e,t)=>e.kind===`numeric`&&t.kind===`numeric`||e.kind===`color`&&t.kind===`color`||e.kind===`enum`&&t.kind===`enum`?{...e,value:t.value}:e;return{filteredProperties:c,applyStyle:(e,t)=>{let n;if(e.kind===`numeric`&&typeof t==`number`)n={kind:`numeric`,value:t};else if(e.kind===`color`&&typeof t==`string`)n={kind:`color`,value:t};else if(e.kind===`enum`&&typeof t==`string`)n={kind:`enum`,value:t};else return;i(t=>{let r=Object.keys(t);if(r[r.length-1]===e.key)return{...t,[e.key]:n};let i={};for(let n of r){if(n===e.key)continue;let r=s.get(n);r!==void 0&&r.cssProperties.every(t=>e.cssProperties.includes(t))||(i[n]=t[n])}return i[e.key]=n,i})},buildPendingEdits:()=>{let e=r(),t=[],n=new Set;for(let r of Object.keys(e)){let i=e[r],a=s.get(r);if(!a||a.kind!==i.kind)continue;let o=xi(a,i),c=!o&&a.cssProperties.some(e=>n.has(e));if(!(!o&&!c)){if(o)for(let e of a.cssProperties)n.add(e);a.kind===`numeric`&&i.kind===`numeric`?t.push({kind:`numeric`,key:a.key,cssProperties:a.cssProperties,value:i.value,unit:a.unit}):a.kind===`color`&&i.kind===`color`?t.push({kind:`color`,key:a.key,cssProperties:a.cssProperties,value:i.value}):a.kind===`enum`&&i.kind===`enum`&&t.push({kind:`enum`,key:a.key,cssProperties:a.cssProperties,value:i.value})}}return t},hasPendingStyles:()=>{let e=r();for(let n of t){let t=e[n.key];if(t&&xi(n,t))return!0}return!1},hasChangedStyleFor:e=>{let t=r()[e],n=s.get(e);return!!(t&&n&&xi(n,t))}}},Ci=new Map;for(let e of H)for(let t of e)Ci.set(t.key,t.longhands);const wi=e=>{if(e.includes(`,`))return e.split(`,`);let t=Ci.get(e);return t?[...t]:[e]},Ti=/^-?(?:\d+\.?|\d*\.\d*)?$/,Ei=e=>Ti.test(e),Di=e=>{let t=e.startsWith(`-`);return{isNegative:t,base:t?e.slice(1):e}},Oi=/^([a-z-]+)-(-?\d+(?:\.\d+)?)$/,ki=/^(.+?)-\[(.+)]$/,Ai=/^(-?\d*\.?\d+)\s*([a-zA-Z%]*)$/,ji=/^(-?\d*\.?\d+)(px|rem)?$/i,Mi=/^(?:length|size):/i,Ni=new Set([`opacity`,`border-width`,`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`,`z-index`,`font-weight`]),Pi=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`numeric`)return n;return null},Fi=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`enum`)return n;return null},Ii=(e,t)=>{for(let n of e)if(n.key===t&&n.kind===`color`)return n;return null},Li=e=>{let t=e.replace(/^(?:color|length|size):/i,``).trim();return/(?:var|url)\(/i.test(t)?t:t.replace(/_/g,` `)},Ri=e=>{let t=e.lastIndexOf(`:`),n=t>=0?e.slice(t+1):e;return(n.startsWith(`!`)?n.slice(1):n).toLowerCase()},zi=(e,t)=>{let n=e.match(ji);if(!n)return null;let r=n[2]?.toLowerCase();if(!r&&!t)return null;let i=Number.parseFloat(n[1]);return Number.isFinite(i)?r===`rem`?i*16:i:null},Bi=(e,t)=>{let n=wi(t),r=new Map;for(let t of n)for(let n of e)n.kind===`numeric`&&n.cssProperties.includes(t)&&r.set(n.key,n);return Array.from(r.values())},Vi=(e,t)=>v(c(t,e.min,e.max)),Hi=e=>{let{initialProperties:t,searchQuery:n,isCompact:r,activeProperty:i,commit:a,setIsCompact:o}=e,s=e=>{for(let n of t)if(n.key===e&&(n.kind===`numeric`||n.kind===`enum`))return!0;return Bi(t,e).length>0},c=e=>{let t=e.trim().replace(/(\d),(\d)/g,`$1.$2`).match(Ai);if(!t)return null;let n=Number.parseFloat(t[1]);return Number.isFinite(n)?{value:n,unit:t[2].toLowerCase()}:null},l=(e,t)=>e?t.toLowerCase().startsWith(e):!0,u=e=>{if(!r())return!1;let t=i();if(t?.kind!==`numeric`)return!1;let n=c(e);return n?l(n.unit,t.unit):Ei(e)},f=A(()=>u(n())),p=e=>{if(!r())return!1;let t=i();if(t?.kind!==`numeric`)return!1;let n=c(e);if(!n)return!1;let o=t.unit.toLowerCase();if(n.unit!==``&&n.unit!==o)return l(n.unit,t.unit);let s=Vi(t,n.value);return s!==t.value&&a(t,s),!0},m=(e,n)=>{let r=Pi(t,e);if(r)return r.unit===`px`?(o(!0),a(r,Vi(r,n),{shouldCompact:!0}),!0):!1;let i=Bi(t,e);return i.length===0?!1:(o(!0),C(()=>{for(let e of i)a(e,Vi(e,n),{shouldCompact:!0})}),!0)},h=(e,n)=>{let r=b(e);if(!r)return!1;let i=Ii(t,r);if(!i)return!1;let s=n===null?j(e):d(n);return s?(o(!0),a(i,s,{shouldCompact:!0}),!0):!1},g=e=>{let t=e.trim(),n=t.match(ki);if(!n)return!1;let r=n[2],i=Li(r);if(h(t,i))return!0;let a=zi(i,Mi.test(r.trim()));if(a===null)return!1;let{isNegative:o,base:s}=Di(n[1]),c=N(Ri(s));return c?m(c,o?-a:a):!1},_=e=>{if(g(e))return;let n=T(e),{isNegative:r,base:i}=Di(n),c=i.replace(/-\d*$/,``).replace(/-$/,``),l=c?N(c):null;if(l&&s(l)&&o(!0),!r){if(h(n,null))return;let e=re(n);if(e){let n=Fi(t,e.property);if(!n)return;let r=n.options.find(t=>t.value===e.value);r&&(o(!0),a(n,r.value,{shouldCompact:!0}));return}}let u=i.match(Oi);if(!u)return;let d=N(u[1]);if(!d)return;let f=Number.parseFloat(u[2]);if(!Number.isFinite(f))return;let p=r?-f:f,m=Ni.has(d)?p:p*4,_=Pi(t,d);if(_){a(_,Vi(_,m),{shouldCompact:!0});return}if(!r){let e=Fi(t,d);if(e){let t=String(f),n=e.options.find(e=>e.value===t);if(n){a(e,n.value,{shouldCompact:!0});return}}}let v=Bi(t,d);v.length!==0&&C(()=>{for(let e of v)a(e,Vi(e,m),{shouldCompact:!0})})},v=e=>{if(re(e))return!0;let{base:n}=Di(e),r=n.match(Oi);if(!r)return!1;let i=N(r[1]);return i?s(i)?!0:Fi(t,i)!==null:!1};return{isInlineNumericEdit:f,isInlineNumericDraft:u,tryApplyNumericValue:p,applyTailwindClass:e=>{let t=e.trim().replace(/^class\s*=\s*["']/,``).replace(/["']\s*$/,``).replace(/\s+\[/g,`-[`),n=T(t),r=t.split(/\s+/).filter(Boolean);if(r.length>1&&!v(n)){for(let e of r)_(e);return}_(t)}}};var Ui=F(`<span class="text-[var(--rg-text-primary)] text-[13px] leading-3.5 font-sans font-medium">No`),Wi=F(`<span class="text-[var(--rg-error-text)] text-[13px] leading-3.5 font-sans font-medium">Yes`),Gi=F(`<div role=alertdialog aria-modal=true aria-labelledby=rg-discard-prompt-title class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-2 w-full self-stretch"><span id=rg-discard-prompt-title class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-sans font-medium">Discard edits?</span><div class="flex items-center gap-[5px]">`),Ki=F(`<div><textarea data-react-grab-ignore-events data-react-grab-input aria-label="Search properties"aria-keyshortcuts="Enter Escape ArrowUp ArrowDown ArrowLeft ArrowRight Tab"autocapitalize=none autocorrect=off autocomplete=off class="text-[var(--rg-text-primary)] text-[13px] leading-4 font-medium bg-transparent border-none resize-none w-full p-0 m-0 outline-none"rows=1 style=caret-color:var(--rg-text-primary);field-sizing:content;min-height:16px;max-height:16px;scrollbar-width:none>`),qi=F(`<div>`),Ji=F(`<div role=dialog aria-modal=true aria-label="Style element"data-react-grab-ignore-events data-react-grab-edit-panel>`),Yi=F(`<div class="flex items-center justify-center w-full px-3 py-1.5 min-h-[28px]">`);const Xi=e=>E(M,{get when(){return e.state},children:t=>E(M,{keyed:!0,get when(){return t().element},children:n=>E(Zi,{get state(){return t()},position:()=>e.position,get onDismiss(){return e.onDismiss},get onSubmit(){return e.onSubmit},get onPendingEditsChange(){return e.onPendingEditsChange},get onInteractingChange(){return e.onInteractingChange}})})}),Zi=t=>{let n=t.state.properties,a,o=t.state.preview,[s,l]=W(t.state.initialSearchQuery??``),[d,f]=W(null),[m,h]=W(null),y=Si({initialProperties:n,searchQuery:()=>d()??s()}),b=()=>{let e=y.filteredProperties().findIndex(e=>e.kind===`numeric`);return e>0?e:0},[x,S]=W(b()),C=A(()=>y.hasPendingStyles()),w=A(()=>C()||!!t.state.hasSessionEdits),[T,k]=W(!1),ee,j,N,te=!1,[F,ne]=W(!1),re=A(()=>F()||C()),[ie,z]=W(!1),V=ae(),oe=A(()=>et({tagName:t.state.tagName,componentName:t.state.componentName})),H=A(()=>{let e=y.filteredProperties();return e.length===0?null:e[Math.min(Math.max(0,x()),e.length-1)]}),se,G=lr(()=>se,t.position),K=e=>{h(e),clearTimeout(ee),ee=setTimeout(()=>{h(t=>t===e?null:t)},100)},ce=A(()=>re()&&!ie());P(()=>{let e=ce();t.onInteractingChange?.(e)});let le=()=>{ne(!0),clearTimeout(j),j=setTimeout(()=>{ne(!1)},150)},q=()=>{queueMicrotask(()=>{a&&fr(a)!==a&&Xe(a,{preventScroll:!0})})},de=()=>{d()===null&&f(s())},pe=()=>{te=!1,clearTimeout(N)},me=()=>{te=!1,clearTimeout(N),N=setTimeout(()=>{te=!0},500)},he=e=>{let t=e.trim(),n=t.replace(/^-/,``).replace(`.`,``);/[a-z%]+$/i.test(t)||n.length>1?me():pe()},ge=e=>{if(!te)return e;let t=s();if(!t||!e.startsWith(t))return pe(),e;let n=e.slice(t.length);return/^[-.\d]/.test(n)?(pe(),n):e},_e=e=>{if(!te||e.metaKey||e.ctrlKey||e.altKey||!/^[-.\d]$/.test(e.key))return!1;e.preventDefault(),e.stopImmediatePropagation(),pe();let t=e.key;return a&&(a.value=t),Y.tryApplyNumericValue(t)?(de(),l(t),he(t),q(),!0):(l(t),q(),!0)},ve=()=>{pe(),f(null),k(!1)},ye=(e,n,r={})=>{y.applyStyle(e,n),o.apply(e.cssProperties,D(e,n)),t.onPendingEditsChange?.(y.buildPendingEdits()),le(),r.isFromKeyRepeat||X.hide(),r.flashDirection&&K(r.flashDirection===1?`right`:`left`),r.shouldFocus&&q(),r.shouldCompact&&k(!0),r.source===`keyboard`&&V.arm()},be=L(e=>e.shiftKey),Se=L(e=>e.altKey),Ce=(e,n,r,i,a)=>{let o=H();if(!o)return null;let s=fi(o,e,n,r,t.state.designTokens);return s===null?(K(e===1?`right`:`left`),null):(ye(o,s,{flashDirection:e,shouldFocus:!0,isFromKeyRepeat:i,source:a}),o)},we=(e,t,n,r)=>{Ce(e,t,n,r,`keyboard`)&&k(!0)},Ee=e=>{Ce(e,!1,!1,!1,`pointer`)},De=ui({step:we,isShiftHeld:be,isAltHeld:Se}),J=(e,t)=>{let n=H();if(n){if(n.kind===`numeric`&&typeof e==`number`){let r=v(c(e,n.min,n.max));r!==n.value&&ye(n,r,{source:t});return}typeof e==`string`&&(ci(n,e,n.value)||ye(n,e,{source:t}))}},Oe=A(()=>{if(!be())return null;let e=H();return!e||e.kind!==`numeric`?null:dr(e.key,e.value)}),Y=Hi({initialProperties:n,searchQuery:s,isCompact:T,activeProperty:H,commit:(e,t,n)=>{ye(e,t,{...n,source:`keyboard`})},setIsCompact:k}),ke=A(()=>T()&&s()!==``&&Y.isInlineNumericEdit()),Ae=()=>{X.hide(),V.clear(),t.onSubmit(y.buildPendingEdits())},X=Qr(),je,Me=()=>{je&&(je.classList.remove(`animate-shake`),je.offsetWidth,je.classList.add(`animate-shake`))},Ne=e=>{X.hide(),e===`discard`&&o.restore(),t.onDismiss()},Pe=e=>{if(De.cancelRepeat(),e===`pointer`&&V.clear(),X.isPending()){Ne(`discard`);return}if(!w()){Ne(o.hasAppliedStyles()?`discard`:`preserve`);return}let t=T();ve(),!(e===`keyboard`&&t)&&(X.show(),Me())},Fe=e=>{let t=y.filteredProperties();t.length!==0&&(S(n=>(n+e+t.length)%t.length),ve())},Ie=()=>{V.clear(),X.hide()},Le=[],Re=e=>(Le.push(e),()=>{Le=Le.filter(t=>t!==e)}),ze=()=>Le[Le.length-1]??null,Be=(e,t)=>{if(H()?.kind===`color`){t.repeat||ze()?.();return}De.pressArrow(e,t.repeat,t.shiftKey,t.altKey)},Ve={ArrowUp:()=>Fe(-1),ArrowDown:()=>Fe(1),ArrowLeft:e=>Be(`ArrowLeft`,e),ArrowRight:e=>Be(`ArrowRight`,e),Tab:e=>Fe(e.shiftKey?-1:1),Enter:()=>{if(X.isPending())return;let e=H(),t=ze();if(e?.kind===`color`&&!y.hasChangedStyleFor(e.key)&&t&&!w()){t();return}Ae()},Escape:()=>Pe(`keyboard`)},He=e=>{if(e.isComposing||e.keyCode===229)return;if(X.isPending()){let t=e.composedPath()[0];if(t instanceof HTMLElement&&t.closest(`[data-react-grab-discard-button]`)!==null&&(e.key===`Tab`||e.key===`Enter`))return;if(e.key===`Tab`||e.key===`ArrowUp`||e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),e.stopImmediatePropagation();return}}let t=Ve[e.key];t&&(e.preventDefault(),e.stopImmediatePropagation(),t(e))};p(()=>{queueMicrotask(()=>{if(Xe(a,{preventScroll:!0}),a){let e=a.value.length;a.setSelectionRange(e,e)}}),G.measure();let e=s();e&&Y.applyTailwindClass(e);let t=rr({isOpen:()=>!0,onDismiss:Pe,shouldIgnoreKeyboardEvent:e=>{let t=e.composedPath()[0];return X.isPending()&&t instanceof HTMLElement&&t.closest(`[data-react-grab-discard-button]`)!==null},shouldIgnoreRightClick:!0,shouldIgnoreInputEvents:!0}),n=fe(e=>{r(e,`data-react-grab-input`)||_e(e)||He(e)}),i=fe(e=>{De.releaseKey(e.key)}),o=fe(e=>{e.pointerType===`mouse`&&(X.isPending()||V.consume()&&w()&&Pe(`pointer`))});window.addEventListener(`keydown`,n,{capture:!0}),window.addEventListener(`keyup`,i,{capture:!0}),window.addEventListener(`pointermove`,o,{capture:!0}),U(()=>{t(),window.removeEventListener(`keydown`,n,{capture:!0}),window.removeEventListener(`keyup`,i,{capture:!0}),window.removeEventListener(`pointermove`,o,{capture:!0}),clearTimeout(ee),clearTimeout(j),clearTimeout(N),X.cleanup(),G.clearAnimationHandles(),ne(!1)})});let Ue=e=>{S(e),q()};return E(M,{get when(){return G.shouldMount()},get children(){var t=Ji();i(t,`contextmenu`,$,!0),i(t,`click`,$,!0),i(t,`mousedown`,$,!0),i(t,`pointerdown`,$,!0);var n=se;return typeof n==`function`?R(n,t):se=t,e(t,`z-index`,`${ue}`),e(t,`--rg-edit-list-max-h`,`280px`),_(t,E(vt,{ref:e=>je=e,class:`flex flex-col justify-center items-start overflow-hidden w-fit h-fit`,get style(){return{"min-width":T()?void 0:`200px`,"max-width":`320px`,transform:`translateX(${De.heldDirection()*2}px)`,transition:`transform 280ms ${Te}`}},get children(){return[E(M,{get when(){return X.isPending()},get fallback(){return E(M,{get when(){return!T()},get children(){var e=qi();return e.addEventListener(`mouseleave`,()=>z(!1)),e.addEventListener(`mouseenter`,()=>z(!0)),_(e,E(ft,{get tagName(){return oe().tagName},get componentName(){return oe().componentName},isClickable:!1,onClick:()=>{},shrink:!0}),null),_(e,E(M,{get when(){return w()},get children(){return E(Zr,{onCopy:Ae})}}),null),O(()=>I(e,Z(`contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 h-fit px-2`,w()?`w-full self-stretch justify-between`:`w-fit`))),e}})},get children(){var e=Gi(),t=e.firstChild.nextSibling;return _(t,E(Et,{"data-react-grab-ignore-events":!0,"data-react-grab-discard-button":`cancel`,onClick:e=>{e.preventDefault(),e.stopPropagation(),Ie()},get children(){return Ui()}}),null),_(t,E(Et,{variant:`destructive`,"data-react-grab-ignore-events":!0,"data-react-grab-discard-button":`confirm`,onClick:e=>{e.preventDefault(),e.stopPropagation(),Ne(`discard`)},get children(){return Wi()}}),null),e}}),(()=>{var e=Ki(),t=e.firstChild;return t.$$keydown=He,t.$$input=e=>{let t=ge(e.currentTarget.value);if(t!==e.currentTarget.value&&(e.currentTarget.value=t),Y.tryApplyNumericValue(t)){de(),l(t),he(t),q();return}if(pe(),Y.isInlineNumericDraft(t)){de(),l(t),q();return}l(t),f(null),S(t.trim()===``?b():0),ve(),Y.applyTailwindClass(t)},R(e=>{a=e},t),u(t,`spellcheck`,!1),O(n=>{var r=ke()?``:`[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-1.5 w-full self-stretch [border-top-width:0.5px] border-t-solid border-t-[var(--rg-border-subtle)] antialiased`,i=ke()?_r:void 0,a=ke()?-1:0,o=T()?H()?.label??`Search property`:`Search property`;return r!==n.e&&I(e,n.e=r),n.t=B(e,i,n.t),a!==n.a&&u(t,`tabindex`,n.a=a),o!==n.o&&u(t,`placeholder`,n.o=o),n},{e:void 0,t:void 0,a:void 0,o:void 0}),O(()=>t.value=s()),e})(),E(M,{get when(){return y.filteredProperties().length>0},get children(){var e=qi();return _(e,E(si,{get properties(){return y.filteredProperties()},get activeIndex(){return x()},get activeKey(){return m()},onHoverIndex:S,onSelect:Ue,onStep:Ee,onCommit:J,onColorPickerRegister:Re,onEditComplete:q,onInvalidCommit:Me,onInteract:le,isAdjusting:F,get activeTailwindLabel(){return Oe()}})),O(t=>{var n=T()?``:`[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start w-full self-stretch antialiased`,r=T()?_r:void 0;return n!==t.e&&I(e,t.e=n),t.t=B(e,r,t.t),t},{e:void 0,t:void 0}),e}}),E(M,{get when(){return g(()=>!!T())()&&H()},children:e=>(()=>{var t=Yi();return t.$$mousedown=e=>e.preventDefault(),_(t,E(Yr,{get property(){return e()},get activeKey(){return m()},onStep:Ee,onCommit:J,onEditComplete:q,onInvalidCommit:Me,onInteract:le,onColorPickerRegister:Re,showLabel:!1,get tailwindLabel(){return Oe()},emphasized:!0})),t})()})]}})),O(n=>{var r=T()?`true`:`false`,i=Z(`fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none`,G.isAnimatedIn()?`transition-[opacity,transform] duration-220 ease-spring`:`transition-[opacity,transform] duration-120 ease-drawer`),a=`${G.displayPosition().top}px`,o=`${G.displayPosition().left}px`,s=G.isAnimatedIn()?`auto`:`none`,c=xe[G.lastAnchorEdge()],l=G.isAnimatedIn()?`1`:`0`,d=G.isAnimatedIn()?`scale(1)`:`scale(0.92)`;return r!==n.e&&u(t,`data-rg-compact`,n.e=r),i!==n.t&&I(t,n.t=i),a!==n.a&&e(t,`top`,n.a=a),o!==n.o&&e(t,`left`,n.o=o),s!==n.i&&e(t,`pointer-events`,n.i=s),c!==n.n&&e(t,`transform-origin`,n.n=c),l!==n.s&&e(t,`opacity`,n.s=l),d!==n.h&&e(t,`transform`,n.h=d),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),t}})};o([`pointerdown`,`mousedown`,`click`,`contextmenu`,`input`,`keydown`]);var Qi=F(`<div data-react-grab-ignore-events>`);const $i=e=>{let t,n=()=>e.interactive!==!1,r=lr(()=>t,()=>e.position);return p(()=>{r.measure();let t=e.onDismiss?rr({isOpen:()=>!!e.position,onDismiss:e.onDismiss}):void 0;U(()=>{r.clearAnimationHandles(),t?.()})}),E(M,{get when(){return r.shouldMount()},get children(){var i=Qi(),a=t;return typeof a==`function`?R(a,i):t=i,w(i,f(()=>({[e.dataAttribute]:``}),{get class(){return Z(`fixed font-sans text-[13px] antialiased [filter:var(--rg-drop-shadow)] select-none will-change-[opacity,transform]`,r.isAnimatedIn()?`transition-[opacity,transform] duration-220 ease-spring`:`transition-[opacity,transform] duration-120 ease-drawer`)},get style(){return{top:`${r.displayPosition().top}px`,left:`${r.displayPosition().left}px`,"z-index":`${ue}`,"pointer-events":n()&&r.isAnimatedIn()?`auto`:`none`,"transform-origin":xe[r.lastAnchorEdge()],opacity:r.isAnimatedIn()?`1`:`0`,transform:r.isAnimatedIn()?`scale(1)`:`scale(0.92)`}},onPointerDown:$,onMouseDown:$,onClick:$,onContextMenu:$}),!1,!0),_(i,()=>e.children),i}})},ea=e=>{let t=er({clearActiveOnPointerLeave:!0,highlight:{topCornerRadiusPx:14,bottomCornerRadiusPx:14,cornerShape:Y}});return E($i,{get position(){return e.position},dataAttribute:`data-react-grab-toolbar-menu`,get onDismiss(){return e.onDismiss},get children(){return E(Q.Panel,{class:`overflow-hidden`,style:{"min-width":`100px`},get children(){return E(Q.Provider,{store:t,get children(){return E(Q.List,{label:`Default action`,get children(){return E(ne,{get each(){return e.actions},children:t=>{let n=()=>t.id===e.defaultActionId;return E(Q.Item,{get value(){return t.id},role:`menuitemradio`,get checked(){return n()},onSelect:()=>{e.onSetDefaultAction(t.id),e.onDismiss()},get children(){return[E(Q.Label,{get class(){return n()?`text-[var(--rg-text-primary)]`:`text-[var(--rg-text-secondary)]`},get children(){return t.label}}),E(M,{get when(){return t.shortcut},children:e=>E(Q.Shortcut,{get shortcut(){return e()},get modifier(){return t.shortcutModifier}})})]}})}})}})}})}})}})};var ta=F(`<span aria-hidden=true class="shrink-0 font-mono text-[11px] leading-4 text-[var(--rg-text-secondary)] opacity-60 mr-1">`),na=F(`<span class=text-[var(--rg-text-secondary)]>.`),ra=F(`<span class="flex items-center min-w-0 w-full"><span class="text-[13px] leading-4 h-fit font-medium overflow-hidden text-ellipsis whitespace-nowrap min-w-0 transition-colors">`);const ia=t=>{let n=()=>t.state?.activeIndex??0,r=er({value:()=>String(n()),highlight:{topCornerRadiusPx:14,bottomCornerRadiusPx:14,cornerShape:Y}});return E($i,{get position(){return t.position},dataAttribute:`data-react-grab-hierarchy-menu`,interactive:!1,get children(){return E(Q.Panel,{class:`overflow-hidden`,style:{"min-width":`160px`},get children(){return E(Q.Provider,{store:r,get children(){return E(Q.List,{label:`Navigate element hierarchy`,get children(){return E(ne,{get each(){return t.state?.items??[]},children:(t,r)=>E(Q.Item,{get value(){return String(r())},role:`menuitemradio`,get checked(){return r()===n()},get children(){var i=ra(),a=i.firstChild;return _(i,E(M,{get when(){return t.depth>0},get children(){var n=ta();return _(n,()=>t.isLast?`└─`:`├─`),O(r=>e(n,`padding-left`,`${(t.depth-1)*12}px`)),n}}),a),_(a,E(M,{get when(){return t.componentName},get children(){return[g(()=>t.componentName),na()]}}),null),_(a,()=>t.tagName,null),O(e=>{var t=r()===n(),i=r()!==n();return t!==e.e&&a.classList.toggle(`text-[var(--rg-text-primary)]`,e.e=t),i!==e.t&&a.classList.toggle(`text-[var(--rg-text-secondary)]`,e.t=i),e},{e:void 0,t:void 0}),i}})})}})}})}})}})},aa=e=>[E(Ke,{get selectionVisible(){return e.selectionVisible},get selectionBounds(){return e.selectionBounds},get selectionBoundsMultiple(){return e.selectionBoundsMultiple},get selectionShouldSnap(){return e.selectionShouldSnap},get dragVisible(){return e.dragVisible},get dragBounds(){return e.dragBounds},get grabbedBoxes(){return e.grabbedBoxes},get labelInstances(){return e.labelInstances}}),E(Je,{get visible(){return e.isFrozen??!1}}),E(M,{get when(){return g(()=>!!e.selectionLabelVisible)()&&(e.frozenLabelEntries?.length??0)>0},get children(){return E(z,{get each(){return e.frozenLabelEntries??[]},children:(t,n)=>E(rn,{get tagName(){return t().tagName},get componentName(){return t().componentName},get selectionBounds(){return t().bounds},get mouseX(){return t().mouseX},visible:!0,shouldToggleExpandOnClick:n===0,get onToggleExpand(){return n===0?e.onToggleExpand:void 0}})})}}),E(M,{get when(){return g(()=>!!e.selectionLabelVisible)()&&e.pendingShiftPreviewEntry},children:e=>E(rn,{get tagName(){return e().tagName},get componentName(){return e().componentName},get selectionBounds(){return e().bounds},get mouseX(){return e().mouseX},visible:!0})}),E(M,{get when(){return g(()=>!!(e.selectionLabelVisible&&e.selectionBounds))()&&(e.frozenLabelEntries?.length??0)===0},get children(){return E(rn,{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 isPromptMode(){return e.isPromptMode},get inputValue(){return e.inputValue},get status(){return e.selectionLabelStatus},get filePath(){return e.selectionFilePath},get onInputChange(){return e.onInputChange},get onSubmit(){return e.onInputSubmit},get onToggleExpand(){return e.onToggleExpand},get selectionLabelShakeCount(){return e.selectionLabelShakeCount},get onConfirmDismiss(){return e.onConfirmDismiss},get discardPrompt(){return e.discardPrompt},onOpen:()=>{e.selectionFilePath&&Pe(e.selectionFilePath,e.selectionLineNumber)},get isContextMenuOpen(){return e.contextMenuPosition!==null}})}}),E(z,{get each(){return e.labelInstances??[]},children:t=>E(rn,{get tagName(){return t().tagName},get componentName(){return t().componentName},get elementsCount(){return t().elementsCount},get selectionBounds(){return t().bounds},get mouseX(){return t().mouseX},visible:!0,get status(){return t().status},get statusText(){return t().statusText},get isPromptMode(){return t().isPromptMode},get inputValue(){return t().inputValue},get error(){return t().errorMessage},get hideArrow(){return t().hideArrow},get onShowContextMenu(){let n=t();if(!(!(n.status===`copied`||n.status===`fading`)||!h(n.element)))return()=>e.onShowContextMenuInstance?.(n.id)},onRetry:()=>e.onRetryInstance?.(t().id),onAcknowledgeError:()=>e.onAcknowledgeErrorInstance?.(t().id),onHoverChange:n=>e.onLabelInstanceHoverChange?.(t().id,n)})}),E(M,{get when(){return e.toolbarVisible!==!1},get children(){return E(Mn,{get isActive(){return e.isActive},get isContextMenuOpen(){return e.contextMenuPosition!==null},get onToggle(){return e.onToggleActive},get onActivateAction(){return e.onActivateAction},get activeActionId(){return e.activeActionId},get enabled(){return e.enabled},get shakeCount(){return e.shakeCount},get onStateChange(){return e.onToolbarStateChange},get onSubscribeToStateChanges(){return e.onSubscribeToToolbarStateChanges},get onSelectHoverChange(){return e.onToolbarSelectHoverChange},get onContainerRef(){return e.onToolbarRef},get onToggleToolbarMenu(){return e.onToggleToolbarMenu}})}}),E(or,{get position(){return e.contextMenuPosition??null},get selectionBounds(){return e.contextMenuBounds??null},get tagName(){return e.contextMenuTagName},get componentName(){return e.contextMenuComponentName},get hasFilePath(){return e.contextMenuHasFilePath??!1},get actions(){return e.actions},get actionContext(){return e.actionContext},get onDismiss(){return e.onContextMenuDismiss??(()=>{})},get onHide(){return e.onContextMenuHide??(()=>{})}}),E(ea,{get position(){return e.toolbarMenuPosition??null},get actions(){return e.toolbarMenuActions??[]},get defaultActionId(){return e.defaultActionId??`copy`},get onSetDefaultAction(){return e.onSetDefaultAction??(()=>{})},get onDismiss(){return e.onToolbarMenuDismiss??(()=>{})}}),E(ia,{get position(){return e.hierarchyMenuPosition??null},get state(){return e.hierarchyState}}),E(Xi,{get state(){return e.editPanelState??null},get position(){return e.editPanelPosition??null},get onDismiss(){return e.onEditPanelDismiss??(()=>{})},get onSubmit(){return e.onEditPanelSubmit??(()=>{})},get onPendingEditsChange(){return e.onEditPanelPendingEditsChange},get onInteractingChange(){return e.onEditPanelInteractingChange}})];export{aa as ReactGrabRenderer};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-grab",
|
|
3
|
-
"version": "0.1.48-dev.
|
|
3
|
+
"version": "0.1.48-dev.c7c0198",
|
|
4
4
|
"description": "Select context for coding agents directly from your website",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"access": "public"
|
|
81
81
|
},
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"bippy": "^0.
|
|
84
|
-
"@react-grab/cli": "0.1.48-dev.
|
|
83
|
+
"bippy": "^0.6.0",
|
|
84
|
+
"@react-grab/cli": "0.1.48-dev.c7c0198"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@babel/core": "^7.29.0",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2025 Aiden Bai
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
import{At as e,C as t,D as n,Dt as r,E as i,Ft as a,I as o,It as s,Lt as c,M as l,N as u,O as d,Ot as f,P as p,R as m,S as h,T as ee,b as g,j as _,kt as te,pt as ne,w as re,x as v,y as ie,zt as ae}from"./freeze-updates-2TTw39qB.js";var y=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},oe=class extends y{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},se=class extends y{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},ce=class extends y{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},le=class extends y{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const ue=e=>e===void 0||!Number.isFinite(e)?3:Math.max(0,Math.floor(e)),b=e=>{try{return decodeURIComponent(e)}catch{return e}},de=/(?:^|[/\\])node_modules[/\\]/,fe=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,pe=/\.[mc]?[jt]sx?$/i,me=/^chunk-[A-Za-z0-9_-]+$/,he=/[/\\]/,ge=/^(.+?)@v?\d/,x=e=>e.split(he).filter(Boolean),_e=e=>{let[t,n]=x(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},ve=e=>{let t=x(e)[0];if(!t)return null;let n=t.replace(pe,``);if(me.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},S=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},C=e=>e?.match(ge)?.[1]??null,ye=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=x(t.pathname).map(b);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=C(n[e+1]);if(r)return`${t}/${r}`;continue}let r=C(t);if(r)return r}return null},be=e=>S(e,fe,ve)??S(e,de,_e),xe=e=>{if(!e)return null;let t=i(e);return t&&(be(b(t))||ye(e))||null},Se=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,Ce=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,we=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),Te=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),Ee=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},De=e=>{let t=Ee(b(i(e)));if(t.startsWith(`/`))return null;let[n,r,...a]=x(t);return!n||!r||a.length===0||!Se.test(n)||Te.has(n.slice(1))||!Ce.test(r)||pe.test(r)||we.has(r)?null:`${n}/${r}`},Oe=e=>e?xe(e)??De(e):null,w=e=>{if(!e)return{origin:`unknown`,packageName:null};let t=Oe(e);return t?{origin:`package`,packageName:t}:re(e)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},ke=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),T=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},Ae=(e,t)=>{let n=ke.has(e)||e.startsWith(`data-`)&&T(e),r=T(t)&&t.length<100||t.startsWith(`#`)&&T(t.slice(1));return n&&r},E=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},D=e=>{let t=0;for(let n of e)t+=n.penalty;return t},O=(e,t)=>D(e)-D(t),k=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},je=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,A=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,Me=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&T(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)T(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=k(e,i);a!==void 0&&n.push({name:A(i,a),penalty:10});let o=k(e);return o!==void 0&&n.push({name:je(i,o),penalty:50}),n},j=(e,t=ne,n=[])=>{if(t<=0)return[];if(e.length===0)return[n];let r=[];for(let i of e[0]){let a=t-r.length;if(a<=0)break;r.push(...j(e.slice(1),a,[...n,i]))}return r},Ne=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},M=(e,t)=>t.querySelectorAll(E(e)).length===1,Pe=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=k(n,e);if(t===void 0)return;r.push({name:A(e,t),penalty:10}),n=n.parentElement}return M(r,t)?r:void 0},Fe=(e,t,n,r)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new oe;if(e.tagName.toLowerCase()===`html`)return`html`;let i=Ne(t,e),a=Date.now(),o=[],s=e,c=0,l;for(;s&&s!==i&&!l;)if(o.push(Me(s,r)),s=s.parentElement,c++,c>=3){let t=j(o);t.sort(O);for(let r of t){if(Date.now()-a>n){let t=Pe(e,i);if(!t)throw new se(n);return E(t)}if(M(r,i)){l=r;break}}}if(!l&&c<3){let e=j(o);e.sort(O);for(let t of e){if(Date.now()-a>n)break;if(M(t,i)){l=t;break}}}if(!l)throw new ce;return E(l)},N=e=>e.ownerDocument.body??e.ownerDocument.documentElement,P=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),F=e=>e.length>0&&e.length<=120,I=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},Ie=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(I(e,t))return t}for(let t of P){let n=e.getAttribute(t);if(!n||!F(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(I(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(I(e,i))return i}return null},Le=e=>{let t=[],n=N(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},L=e=>{let t=Ie(e);if(t)return t;try{let t=Fe(e,N(e),200,(e,t)=>Ae(e,t)||P.has(e)&&F(t));if(t)return t}catch{}return Le(e)},R=e=>{if(!e)return!1;let t=`/${v(e)}/`.toLowerCase();return a.some(e=>t.includes(e))},z=e=>e.map(e=>`\n in ${e}`).join(``),B=[`about://React/`,`rsc://React/`],Re=e=>B.some(t=>e.startsWith(t)),ze=e=>{for(let t of B){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return b(i>r?e.slice(r,i):e.slice(r))}return e},Be=e=>{if(typeof e!=`object`||!e||!(`status`in e)||e.status!==`fulfilled`||!(`value`in e)||typeof e.value!=`object`||e.value===null||!(`originalStackFrame`in e.value))return null;let t=e.value.originalStackFrame;return typeof t!=`object`||!t||!(`file`in t)||typeof t.file!=`string`||!t.file||`ignored`in t&&t.ignored?null:{file:t.file,line1:`line1`in t&&typeof t.line1==`number`?t.line1:null,column1:`column1`in t&&typeof t.column1==`number`?t.column1:null}},Ve=async(e,t)=>{let n=[],r=[];for(let t=0;t<e.length;t++){let i=e[t];!i.isServer||!i.fileName||(n.push(t),r.push({file:ze(i.fileName),methodName:i.functionName??`<unknown>`,line1:i.lineNumber??null,column1:i.columnNumber??null,arguments:[]}))}if(r.length===0)return e;let i=new AbortController,a=setTimeout(()=>i.abort(),c),o=()=>i.abort();t?.aborted&&i.abort(),t?.addEventListener(`abort`,o);try{let t=await fetch(`${ie()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:r,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),priority:`high`,signal:i.signal});if(!t.ok)return e;let a=await t.json();if(!Array.isArray(a))return e;let o=[...e];for(let t=0;t<n.length;t++){let r=Be(a[t]);if(!r)continue;let i=n[t];o[i]={...e[i],fileName:r.file,lineNumber:r.line1??void 0,columnNumber:r.column1??void 0,isSymbolicated:!0}}return o}catch{return e}finally{clearTimeout(a),t?.removeEventListener(`abort`,o)}},He=e=>{let t=new Map;return l(e,e=>{if(!d(e))return!1;let r=ee(e._debugStack.stack);if(!r)return!1;for(let e of n(r))!e.functionName||!e.fileName||Re(e.fileName)&&(t.has(e.functionName)||t.set(e.functionName,{...e,isServer:!0}));return!1},!0),t},Ue=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=He(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})};let V=0;const H=[],We=()=>V<3?(V+=1,Promise.resolve()):new Promise(e=>{H.push(e)}),Ge=()=>{let e=H.shift();if(e){e();return}--V},U=async(e,t,n=s)=>{await We();let r=new AbortController,i,a=new Promise(e=>{i=setTimeout(()=>{r.abort(),e(t)},n)}),o=e(r.signal);o.catch(()=>{});try{return await Promise.race([o,a])}finally{clearTimeout(i),Ge()}},W=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,Ke=e=>e.startsWith(`data-react-grab-`),qe=e=>e.replace(/\s+/g,` `).trim(),Je=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=qe(n.textContent??``);e&&t.push(e)}return t.join(` `)},Ye=t=>t.getAttribute(`aria-hidden`)===`true`||t.hasAttribute(`hidden`)?!0:e.has(t.tagName.toLowerCase()),Xe=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=qe(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||Ye(e))return n;for(let r of e.childNodes)if(n=Xe(r,t,n),n<=0)break;return n},Ze=(e,t)=>{if(Ye(e))return``;let n=Je(e);if(!r.has(t)||n&&e.children.length===0)return n;let i=[];return Xe(e,i,100),i.join(` `)},Qe=e=>W(e,15),$e=e=>{let t=[];for(let n of te){let r=e.getAttribute(n);r&&t.push(`${n}="${r}"`)}return t.length>0?` ${t.join(` `)}`:``},et=e=>e===`class`||e===`className`||e===`style`,tt=e=>{let t=[],n=[],r=``;for(let{name:i,value:a}of e.attributes)if(!Ke(i)){if(et(i)){i!==`style`&&a&&(r=` class="${Qe(a)}"`);continue}f.has(i)?t.push(a?` ${i}="${a}"`:` ${i}`):a&&n.push(` ${i}="${Qe(a)}"`)}return t.join(``)+n.join(``)+r},nt=e=>e.length===0?``:e.length<=2?e.map(e=>`<${_(e)} ...>`).join(`
|
|
10
|
-
`):`(${e.length} elements)`,rt=e=>{let t=_(e);if(!(e instanceof HTMLElement))return`<${t}${$e(e)} />`;let n=tt(e),r=W(Ze(e,t),100);return r?`<${t}${n}>${r}</${t}>`:`<${t}${n} />`},it=e=>{let t=_(e),n=tt(e),i=Ze(e,t),a=[],o=[],s=!1;for(let t of e.childNodes)t.nodeType!==Node.COMMENT_NODE&&(t.nodeType===Node.TEXT_NODE?t.textContent&&t.textContent.trim().length>0&&(s=!0):t instanceof Element&&(s?o.push(t):a.push(t)));let c=i.length>0&&r.has(t),l=``,u=nt(a);u&&!c&&(l+=`\n ${u}`),i&&(l+=`\n ${W(i,100)}`);let d=nt(o);return d&&!c&&(l+=`\n ${d}`),l.length>0?`<${t}${n}>${l}\n</${t}>`:`<${t}${n} />`},at=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),ot=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),st=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),ct=new Set([`MotionDOMComponent`]),lt=e=>{if(ot.has(e)||st.has(e)||ct.has(e))return!0;for(let t of at)if(e.startsWith(t))return!0;return!1},ut=e=>!(!e||lt(e)||e===`SlotClone`||e===`Slot`),dt=e=>!(e.length<=1||lt(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),G=e=>e&&dt(e)?e:null,K=e=>{if(!u())return e;let t=e;for(;t;){if(o(t))return t;t=t.parentElement}return e},ft=e=>{if(!u())return null;let t=o(K(e)),n=0;for(;t;){if(t.key)return t.key;if(m(t)&&(n+=1,n===2))break;t=t.return}return null},q=new WeakMap,J=new WeakMap,pt=e=>t=>fetch(t,{signal:e,priority:`high`}),mt=e=>U(async n=>{try{let r=o(e);if(!r)return null;let i=await t(r,!0,pt(n));return g()?await Ve(Ue(r,i),n):i}catch{return null}},null),Y=e=>{if(!u())return Promise.resolve([]);let t=K(e),n=q.get(t);if(n)return n;let r=mt(t).then(e=>(e===null&&q.delete(t),e));return q.set(t,r),r},ht=async e=>{if(!u())return null;let t=await Y(e);if(!t)return null;for(let e of t){let t=G(e.functionName);if(t)return t}return null},gt=e=>e.find(e=>!!G(e.functionName))??e[0]??null,_t=e=>!e||!m(e)?null:G(p(e.type)),vt=e=>U(async t=>{let n=o(K(e));if(!n)return null;try{let e=await h(n,!0,pt(t));return e?.fileName?{filePath:v(e.fileName),lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null,componentName:G(e.functionName)??_t(n._debugOwner),origin:w(e.fileName).origin}:null}catch{return null}},null),yt=e=>{let t=K(e),n=J.get(t);if(n)return n;let r=vt(t).then(e=>(e||J.delete(t),e));return J.set(t,r),r},bt=[`app`,`package`],xt=(e,t)=>{for(let n of bt){if(e?.origin===n)return e;let r=gt(t.filter(e=>w(e.fileName).origin===n));if(r?.fileName)return{filePath:v(r.fileName),lineNumber:r.lineNumber??null,columnNumber:r.columnNumber??null,componentName:G(r.functionName),origin:n}}return null},St=async e=>{let t=await yt(e);return t?.origin===`app`?t:xt(t,await Y(e)??[])},Ct=e=>X(K(e),1)[0]??null,X=(e,t,n=()=>!0)=>{if(!u())return[];let r=o(e);if(!r)return[];let i=[];return l(r,e=>{if(i.length>=t)return!0;if(m(e)){let t=p(e.type);t&&ut(t)&&n(t)&&i.push(t)}return!1},!0),i},wt=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],Tt=(e,t)=>{let n=v(e);if(!t||!n.startsWith(`/`))return n;for(let e of wt){let t=n.indexOf(e);if(t!==-1)return`/./${n.slice(t+1)}`}return n},Et=(e,t)=>{let n=Tt(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},Z={isAppSource:!1,consumesBudget:!1},Dt=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,...Z}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,...Z}:i?{text:`\n in ${i}`,...Z}:a?{text:Et({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isAppSource:!0,consumesBudget:!R(a)}:null},Ot=(e,t={},n=null)=>{let r=ue(t.maxLines),i=Math.max(r,20),a=g(),o=[],s=new Set,c=null,l=!1,u=!1,d=!1,f=0,p=e=>{e&&s.add(e)};n&&(u=n.origin===`app`,R(n.filePath)||(f+=1),p(n.componentName),o.push(Et(n,a)));for(let t of e){if(f>=r||o.length>=i)break;let e=w(t.fileName),s=G(t.functionName),m=e.packageName?`${e.packageName}:${s??``}:${t.isServer?`server`:`client`}`:null;if(m&&m===c)continue;if(!l&&s&&s===n?.componentName){l=!0;continue}let h=Dt(t,e,s,a);h!==null&&h.text!==o[o.length-1]&&(h.isAppSource&&(u=!0),h.consumesBudget&&(f+=1,d=!0),p(s),o.push(h.text),c=m)}return{text:o.join(``),shouldAppendSelectorHint:!u,hasBudgetedStackFrame:d,renderedComponentNames:s}},kt=async e=>{let t=await yt(e);return t?.origin===`app`?t:null},At=(e,t,n)=>{let r=X(K(e),n,e=>dt(e)&&!t.renderedComponentNames.has(e));return r.length===0?t:{...t,text:`${t.text}${z(r)}`}},Q=async(e,t={})=>{let n=await kt(e),r=await Y(e),i=ue(t.maxLines),a=Ot(r??[],t,n);if(a.text)return a.hasBudgetedStackFrame?a:At(e,a,i);let o=X(K(e),i);return{text:z(o),shouldAppendSelectorHint:!0,hasBudgetedStackFrame:!1,renderedComponentNames:new Set(o)}},jt=async(e,t={})=>(await Q(e,t)).text,$=(e,t)=>{let n=ft(e),r=n===null?``:`\n key: "${n}"`,i=t.shouldAppendSelectorHint?`\n selector: ${L(e)}`:``;return`${t.text}${r}${i}`},Mt=async(e,t={})=>{let n=await Q(e,t);return`${rt(e)}${$(e,n).replace(/\n\s+/g,` `)}`},Nt=async(e,t={})=>{let n=K(e);return`${it(n)}${$(n,await Q(n,t))}`},Pt=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`),Ft=(e,t)=>{let n=t?.componentName??`div`,r={version:ae,content:e,entries:t?.entries??[{tagName:t?.tagName,componentName:n,content:e,commentText:t?.commentText}],timestamp:Date.now()},i=t=>{t.preventDefault(),t.clipboardData?.setData(`text/plain`,e),t.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${Pt(e)}</code></pre>`),t.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(r))};document.addEventListener(`copy`,i);let a=document.createElement(`textarea`);a.value=e,a.style.position=`fixed`,a.style.left=`-9999px`,a.ariaHidden=`true`,document.body.appendChild(a),a.select();try{return typeof document.execCommand==`function`?document.execCommand(`copy`):!1}finally{document.removeEventListener(`copy`,i),a.remove()}};export{ht as a,St as c,le as d,Mt as i,it as l,Nt as n,Y as o,Ct as r,jt as s,Ft as t,L as u};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2025 Aiden Bai
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
const e=require(`./freeze-updates-m7dy-Od3.cjs`);var t=class extends Error{constructor(e){super(e),this.name=`ReactGrabError`}},n=class extends t{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},r=class extends t{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},i=class extends t{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},a=class extends t{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const o=e=>e===void 0||!Number.isFinite(e)?3:Math.max(0,Math.floor(e)),s=e=>{try{return decodeURIComponent(e)}catch{return e}},c=/(?:^|[/\\])node_modules[/\\]/,l=/[/\\]\.vite[/\\]deps[^/\\]*[/\\]/,u=/\.[mc]?[jt]sx?$/i,d=/^chunk-[A-Za-z0-9_-]+$/,f=/[/\\]/,p=/^(.+?)@v?\d/,m=e=>e.split(f).filter(Boolean),h=e=>{let[t,n]=m(e);return!t||t.startsWith(`.`)?null:t.startsWith(`@`)?n?`${t}/${n}`:null:t},ee=e=>{let t=m(e)[0];if(!t)return null;let n=t.replace(u,``);if(d.test(n))return null;if(!n.startsWith(`@`))return n;let r=n.indexOf(`_`);return r===-1?null:`${n.slice(0,r)}/${n.slice(r+1)}`},g=(e,t,n)=>{let r=e.split(t);return r.length>1?n(r[r.length-1]):null},_=e=>e?.match(p)?.[1]??null,te=e=>{let t;try{t=new URL(e)}catch{return null}if(!t.hostname)return null;let n=m(t.pathname).map(s);for(let[e,t]of n.entries()){if(t.startsWith(`@`)){let r=_(n[e+1]);if(r)return`${t}/${r}`;continue}let r=_(t);if(r)return r}return null},ne=e=>g(e,l,ee)??g(e,c,h),re=t=>{if(!t)return null;let n=e.E(t);return n&&(ne(s(n))||te(t))||null},ie=/^@[A-Za-z0-9][A-Za-z0-9._-]*$/,ae=/^[A-Za-z0-9][A-Za-z0-9._-]*$/,oe=new Set([`app`,`web`,`website`,`frontend`,`client`,`src`]),se=new Set([`app`,`src`,`components`,`pages`,`features`,`modules`,`hooks`,`lib`,`utils`,`ui`,`shared`,`common`,`core`,`styles`,`assets`]),ce=e=>{let t=e;for(;t.startsWith(`../`)||t.startsWith(`./`);)t=t.slice(t.startsWith(`../`)?3:2);return t},le=t=>{let n=ce(s(e.E(t)));if(n.startsWith(`/`))return null;let[r,i,...a]=m(n);return!r||!i||a.length===0||!ie.test(r)||se.has(r.slice(1))||!ae.test(i)||u.test(i)||oe.has(i)?null:`${r}/${i}`},ue=e=>e?re(e)??le(e):null,v=t=>{if(!t)return{origin:`unknown`,packageName:null};let n=ue(t);return n?{origin:`package`,packageName:n}:e.w(t)?{origin:`app`,packageName:null}:{origin:`unknown`,packageName:null}},de=new Set([`role`,`name`,`aria-label`,`rel`,`href`]),y=e=>{if(!/^[a-z-]{3,}$/i.test(e))return!1;let t=e.split(/-|[A-Z]/);for(let e of t)if(e.length<=2||/[^aeiou]{4,}/i.test(e))return!1;return!0},fe=(e,t)=>{let n=de.has(e)||e.startsWith(`data-`)&&y(e),r=y(t)&&t.length<100||t.startsWith(`#`)&&y(t.slice(1));return n&&r},b=e=>{let t=e[0].name;for(let n=1;n<e.length;n++)t=`${e[n].name} > ${t}`;return t},x=e=>{let t=0;for(let n of e)t+=n.penalty;return t},S=(e,t)=>x(e)-x(t),C=(e,t)=>{let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let i=0;for(;r&&(r instanceof Element&&(t===void 0||r.tagName.toLowerCase()===t)&&i++,r!==e);)r=r.nextSibling;return i},pe=(e,t)=>e===`html`?`html`:`${e}:nth-child(${t})`,me=(e,t)=>e===`html`?`html`:`${e}:nth-of-type(${t})`,he=(e,t)=>{let n=[],r=e.getAttribute(`id`),i=e.tagName.toLowerCase();r&&y(r)&&n.push({name:`#${CSS.escape(r)}`,penalty:0});for(let t of e.classList)y(t)&&n.push({name:`.${CSS.escape(t)}`,penalty:1});for(let r of e.attributes)t(r.name,r.value)&&n.push({name:`[${CSS.escape(r.name)}="${CSS.escape(r.value)}"]`,penalty:2});n.push({name:i,penalty:5});let a=C(e,i);a!==void 0&&n.push({name:me(i,a),penalty:10});let o=C(e);return o!==void 0&&n.push({name:pe(i,o),penalty:50}),n},w=(t,n=e.pt,r=[])=>{if(n<=0)return[];if(t.length===0)return[r];let i=[];for(let e of t[0]){let a=n-i.length;if(a<=0)break;i.push(...w(t.slice(1),a,[...r,e]))}return i},ge=(e,t)=>{let n=t.getRootNode?.();return n instanceof ShadowRoot?n:e instanceof Document?e:e.ownerDocument},T=(e,t)=>t.querySelectorAll(b(e)).length===1,_e=(e,t)=>{let n=e,r=[];for(;n&&n!==t;){let e=n.tagName.toLowerCase(),t=C(n,e);if(t===void 0)return;r.push({name:me(e,t),penalty:10}),n=n.parentElement}return T(r,t)?r:void 0},ve=(e,t,a,o)=>{if(e.nodeType!==Node.ELEMENT_NODE)throw new n;if(e.tagName.toLowerCase()===`html`)return`html`;let s=ge(t,e),c=Date.now(),l=[],u=e,d=0,f;for(;u&&u!==s&&!f;)if(l.push(he(u,o)),u=u.parentElement,d++,d>=3){let t=w(l);t.sort(S);for(let n of t){if(Date.now()-c>a){let t=_e(e,s);if(!t)throw new r(a);return b(t)}if(T(n,s)){f=n;break}}}if(!f&&d<3){let e=w(l);e.sort(S);for(let t of e){if(Date.now()-c>a)break;if(T(t,s)){f=t;break}}}if(!f)throw new i;return b(f)},E=e=>e.ownerDocument.body??e.ownerDocument.documentElement,D=new Set([`data-testid`,`data-test-id`,`data-test`,`data-cy`,`data-qa`,`aria-label`,`href`,`src`,`role`,`name`,`title`,`alt`]),O=e=>e.length>0&&e.length<=120,k=(e,t)=>{try{let n=e.ownerDocument.querySelectorAll(t);return n.length===1&&n[0]===e}catch{return!1}},ye=e=>{if(e instanceof HTMLElement&&e.id){let t=`#${CSS.escape(e.id)}`;if(k(e,t))return t}for(let t of D){let n=e.getAttribute(t);if(!n||!O(n))continue;let r=`[${t}=${JSON.stringify(n)}]`;if(k(e,r))return r;let i=`${e.tagName.toLowerCase()}${r}`;if(k(e,i))return i}return null},be=e=>{let t=[],n=E(e),r=e;for(;r;){if(r instanceof HTMLElement&&r.id){t.unshift(`#${CSS.escape(r.id)}`);break}let e=r.parentElement;if(!e){t.unshift(r.tagName.toLowerCase());break}let i=Array.from(e.children).indexOf(r)+1;if(t.unshift(`${r.tagName.toLowerCase()}:nth-child(${i})`),e===n){t.unshift(n.tagName.toLowerCase());break}r=e}return t.join(` > `)},xe=e=>{let t=ye(e);if(t)return t;try{let t=ve(e,E(e),200,(e,t)=>fe(e,t)||D.has(e)&&O(t));if(t)return t}catch{}return be(e)},Se=t=>{if(!t)return!1;let n=`/${e.x(t)}/`.toLowerCase();return e.Ft.some(e=>n.includes(e))},Ce=e=>e.map(e=>`\n in ${e}`).join(``),we=[`about://React/`,`rsc://React/`],Te=e=>we.some(t=>e.startsWith(t)),Ee=e=>{for(let t of we){if(!e.startsWith(t))continue;let n=e.indexOf(`/`,t.length);if(n===-1)continue;let r=n+1,i=e.lastIndexOf(`?`);return s(i>r?e.slice(r,i):e.slice(r))}return e},De=e=>{if(typeof e!=`object`||!e||!(`status`in e)||e.status!==`fulfilled`||!(`value`in e)||typeof e.value!=`object`||e.value===null||!(`originalStackFrame`in e.value))return null;let t=e.value.originalStackFrame;return typeof t!=`object`||!t||!(`file`in t)||typeof t.file!=`string`||!t.file||`ignored`in t&&t.ignored?null:{file:t.file,line1:`line1`in t&&typeof t.line1==`number`?t.line1:null,column1:`column1`in t&&typeof t.column1==`number`?t.column1:null}},Oe=async(t,n)=>{let r=[],i=[];for(let e=0;e<t.length;e++){let n=t[e];!n.isServer||!n.fileName||(r.push(e),i.push({file:Ee(n.fileName),methodName:n.functionName??`<unknown>`,line1:n.lineNumber??null,column1:n.columnNumber??null,arguments:[]}))}if(i.length===0)return t;let a=new AbortController,o=setTimeout(()=>a.abort(),e.Lt),s=()=>a.abort();n?.aborted&&a.abort(),n?.addEventListener(`abort`,s);try{let n=await fetch(`${e.y()}/__nextjs_original-stack-frames`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({frames:i,isServer:!0,isEdgeServer:!1,isAppDirectory:!0}),priority:`high`,signal:a.signal});if(!n.ok)return t;let o=await n.json();if(!Array.isArray(o))return t;let s=[...t];for(let e=0;e<r.length;e++){let n=De(o[e]);if(!n)continue;let i=r[e];s[i]={...t[i],fileName:n.file,lineNumber:n.line1??void 0,columnNumber:n.column1??void 0,isSymbolicated:!0}}return s}catch{return t}finally{clearTimeout(o),n?.removeEventListener(`abort`,s)}},ke=t=>{let n=new Map;return e.M(t,t=>{if(!e.O(t))return!1;let r=e.T(t._debugStack.stack);if(!r)return!1;for(let t of e.D(r))!t.functionName||!t.fileName||Te(t.fileName)&&(n.has(t.functionName)||n.set(t.functionName,{...t,isServer:!0}));return!1},!0),n},Ae=(e,t)=>{if(!t.some(e=>e.isServer&&!e.fileName&&e.functionName))return t;let n=ke(e);return n.size===0?t:t.map(e=>{if(!e.isServer||e.fileName||!e.functionName)return e;let t=n.get(e.functionName);return t?{...e,fileName:t.fileName,lineNumber:t.lineNumber,columnNumber:t.columnNumber}:e})};let A=0;const j=[],je=()=>A<3?(A+=1,Promise.resolve()):new Promise(e=>{j.push(e)}),Me=()=>{let e=j.shift();if(e){e();return}--A},M=async(t,n,r=e.It)=>{await je();let i=new AbortController,a,o=new Promise(e=>{a=setTimeout(()=>{i.abort(),e(n)},r)}),s=t(i.signal);s.catch(()=>{});try{return await Promise.race([s,o])}finally{clearTimeout(a),Me()}},N=(e,t)=>e.length>t?`${e.slice(0,t)}...`:e,Ne=e=>e.startsWith(`data-react-grab-`),P=e=>e.replace(/\s+/g,` `).trim(),Pe=e=>{let t=[];for(let n of e.childNodes){if(n.nodeType!==Node.TEXT_NODE)continue;let e=P(n.textContent??``);e&&t.push(e)}return t.join(` `)},F=t=>t.getAttribute(`aria-hidden`)===`true`||t.hasAttribute(`hidden`)?!0:e.At.has(t.tagName.toLowerCase()),I=(e,t,n)=>{if(e.nodeType===Node.TEXT_NODE){let r=P(e.textContent??``);return r?(t.push(r),n-r.length):n}if(!(e instanceof Element)||F(e))return n;for(let r of e.childNodes)if(n=I(r,t,n),n<=0)break;return n},L=(t,n)=>{if(F(t))return``;let r=Pe(t);if(!e.Dt.has(n)||r&&t.children.length===0)return r;let i=[];return I(t,i,100),i.join(` `)},R=e=>N(e,15),Fe=t=>{let n=[];for(let r of e.kt){let e=t.getAttribute(r);e&&n.push(`${r}="${e}"`)}return n.length>0?` ${n.join(` `)}`:``},Ie=e=>e===`class`||e===`className`||e===`style`,z=t=>{let n=[],r=[],i=``;for(let{name:a,value:o}of t.attributes)if(!Ne(a)){if(Ie(a)){a!==`style`&&o&&(i=` class="${R(o)}"`);continue}e.Ot.has(a)?n.push(o?` ${a}="${o}"`:` ${a}`):o&&r.push(` ${a}="${R(o)}"`)}return n.join(``)+r.join(``)+i},B=t=>t.length===0?``:t.length<=2?t.map(t=>`<${e.j(t)} ...>`).join(`
|
|
10
|
-
`):`(${t.length} elements)`,Le=t=>{let n=e.j(t);if(!(t instanceof HTMLElement))return`<${n}${Fe(t)} />`;let r=z(t),i=N(L(t,n),100);return i?`<${n}${r}>${i}</${n}>`:`<${n}${r} />`},V=t=>{let n=e.j(t),r=z(t),i=L(t,n),a=[],o=[],s=!1;for(let e of t.childNodes)e.nodeType!==Node.COMMENT_NODE&&(e.nodeType===Node.TEXT_NODE?e.textContent&&e.textContent.trim().length>0&&(s=!0):e instanceof Element&&(s?o.push(e):a.push(e)));let c=i.length>0&&e.Dt.has(n),l=``,u=B(a);u&&!c&&(l+=`\n ${u}`),i&&(l+=`\n ${N(i,100)}`);let d=B(o);return d&&!c&&(l+=`\n ${d}`),l.length>0?`<${n}${r}>${l}\n</${n}>`:`<${n}${r} />`},Re=new Set([`_`,`$`,`motion.`,`styled.`,`chakra.`,`ark.`,`Primitive.`,`Slot.`]),ze=new Set(`AppRouter.AppRouterAnnouncer.AppDevOverlay.AppDevOverlayErrorBoundary.ClientPageRoot.ClientSegmentRoot.DevRootHTTPAccessFallbackBoundary.ErrorBoundary.ErrorBoundaryHandler.GracefulDegradeBoundary.HTTPAccessErrorFallback.HTTPAccessFallbackBoundary.HTTPAccessFallbackErrorBoundary.HandleRedirect.Head.HistoryUpdater.HotReload.InnerLayoutRouter.InnerScrollAndFocusHandler.InnerScrollAndFocusHandlerOld.InnerScrollAndMaybeFocusHandler.InnerScrollHandlerNew.LoadableComponent.LoadingBoundary.LoadingBoundaryProvider.NotAllowedRootHTTPFallbackError.OfflineProvider.OuterLayoutRouter.RedirectBoundary.RedirectErrorBoundary.RenderFromTemplateContext.RenderValidationBoundaryAtThisLevel.ReplaySsrOnlyErrors.RootErrorBoundary.RootLevelDevOverlayElement.Router.ScrollAndFocusHandler.ScrollAndMaybeFocusHandler.SegmentBoundaryTrigger.SegmentBoundaryTriggerNode.SegmentStateProvider.SegmentTrieNode.SegmentViewNode.SegmentViewStateNode.ServerRoot.body.html`.split(`.`)),Be=new Set([`Suspense`,`Fragment`,`StrictMode`,`Profiler`,`SuspenseList`]),Ve=new Set([`MotionDOMComponent`]),H=e=>{if(ze.has(e)||Be.has(e)||Ve.has(e))return!0;for(let t of Re)if(e.startsWith(t))return!0;return!1},He=e=>!(!e||H(e)||e===`SlotClone`||e===`Slot`),U=e=>!(e.length<=1||H(e)||e[0]!==e[0].toUpperCase()||e.endsWith(`Provider`)||e.endsWith(`Context`)),W=e=>e&&U(e)?e:null,G=t=>{if(!e.N())return t;let n=t;for(;n;){if(e.I(n))return n;n=n.parentElement}return t},Ue=t=>{if(!e.N())return null;let n=e.I(G(t)),r=0;for(;n;){if(n.key)return n.key;if(e.R(n)&&(r+=1,r===2))break;n=n.return}return null},K=new WeakMap,q=new WeakMap,J=e=>t=>fetch(t,{signal:e,priority:`high`}),We=t=>M(async n=>{try{let r=e.I(t);if(!r)return null;let i=await e.C(r,!0,J(n));return e.b()?await Oe(Ae(r,i),n):i}catch{return null}},null),Y=t=>{if(!e.N())return Promise.resolve([]);let n=G(t),r=K.get(n);if(r)return r;let i=We(n).then(e=>(e===null&&K.delete(n),e));return K.set(n,i),i},Ge=async t=>{if(!e.N())return null;let n=await Y(t);if(!n)return null;for(let e of n){let t=W(e.functionName);if(t)return t}return null},Ke=e=>e.find(e=>!!W(e.functionName))??e[0]??null,qe=t=>!t||!e.R(t)?null:W(e.P(t.type)),Je=t=>M(async n=>{let r=e.I(G(t));if(!r)return null;try{let t=await e.S(r,!0,J(n));return t?.fileName?{filePath:e.x(t.fileName),lineNumber:t.lineNumber??null,columnNumber:t.columnNumber??null,componentName:W(t.functionName)??qe(r._debugOwner),origin:v(t.fileName).origin}:null}catch{return null}},null),X=e=>{let t=G(e),n=q.get(t);if(n)return n;let r=Je(t).then(e=>(e||q.delete(t),e));return q.set(t,r),r},Ye=[`app`,`package`],Xe=(t,n)=>{for(let r of Ye){if(t?.origin===r)return t;let i=Ke(n.filter(e=>v(e.fileName).origin===r));if(i?.fileName)return{filePath:e.x(i.fileName),lineNumber:i.lineNumber??null,columnNumber:i.columnNumber??null,componentName:W(i.functionName),origin:r}}return null},Ze=async e=>{let t=await X(e);return t?.origin===`app`?t:Xe(t,await Y(e)??[])},Qe=e=>Z(G(e),1)[0]??null,Z=(t,n,r=()=>!0)=>{if(!e.N())return[];let i=e.I(t);if(!i)return[];let a=[];return e.M(i,t=>{if(a.length>=n)return!0;if(e.R(t)){let n=e.P(t.type);n&&He(n)&&r(n)&&a.push(n)}return!1},!0),a},$e=[`/src/app/`,`/src/pages/`,`/app/`,`/pages/`],et=(t,n)=>{let r=e.x(t);if(!n||!r.startsWith(`/`))return r;for(let e of $e){let t=r.indexOf(e);if(t!==-1)return`/./${r.slice(t+1)}`}return r},tt=(e,t)=>{let n=et(e.filePath,t),r=t&&e.lineNumber?`${n}:${e.lineNumber}${e.columnNumber?`:${e.columnNumber}`:``}`:n;return e.componentName?`\n in ${e.componentName} (at ${r})`:`\n in ${r}`},Q={isAppSource:!1,consumesBudget:!1},nt=(e,t,n,r)=>{let i=t.packageName,a=t.origin===`app`?e.fileName:null;if(e.isServer&&!a&&(n||!e.functionName)){let e=i?`${i} at Server`:`at Server`;return{text:`\n in ${n??`<anonymous>`} (${e})`,...Q}}return!a&&n?{text:i?`\n in ${n} (${i})`:`\n in ${n}`,...Q}:i?{text:`\n in ${i}`,...Q}:a?{text:tt({componentName:n,filePath:a,lineNumber:e.lineNumber??null,columnNumber:e.columnNumber??null},r),isAppSource:!0,consumesBudget:!Se(a)}:null},rt=(t,n={},r=null)=>{let i=o(n.maxLines),a=Math.max(i,20),s=e.b(),c=[],l=new Set,u=null,d=!1,f=!1,p=!1,m=0,h=e=>{e&&l.add(e)};r&&(f=r.origin===`app`,Se(r.filePath)||(m+=1),h(r.componentName),c.push(tt(r,s)));for(let e of t){if(m>=i||c.length>=a)break;let t=v(e.fileName),n=W(e.functionName),o=t.packageName?`${t.packageName}:${n??``}:${e.isServer?`server`:`client`}`:null;if(o&&o===u)continue;if(!d&&n&&n===r?.componentName){d=!0;continue}let l=nt(e,t,n,s);l!==null&&l.text!==c[c.length-1]&&(l.isAppSource&&(f=!0),l.consumesBudget&&(m+=1,p=!0),h(n),c.push(l.text),u=o)}return{text:c.join(``),shouldAppendSelectorHint:!f,hasBudgetedStackFrame:p,renderedComponentNames:l}},it=async e=>{let t=await X(e);return t?.origin===`app`?t:null},at=(e,t,n)=>{let r=Z(G(e),n,e=>U(e)&&!t.renderedComponentNames.has(e));return r.length===0?t:{...t,text:`${t.text}${Ce(r)}`}},$=async(e,t={})=>{let n=await it(e),r=await Y(e),i=o(t.maxLines),a=rt(r??[],t,n);if(a.text)return a.hasBudgetedStackFrame?a:at(e,a,i);let s=Z(G(e),i);return{text:Ce(s),shouldAppendSelectorHint:!0,hasBudgetedStackFrame:!1,renderedComponentNames:new Set(s)}},ot=async(e,t={})=>(await $(e,t)).text,st=(e,t)=>{let n=Ue(e),r=n===null?``:`\n key: "${n}"`,i=t.shouldAppendSelectorHint?`\n selector: ${xe(e)}`:``;return`${t.text}${r}${i}`},ct=async(e,t={})=>{let n=await $(e,t);return`${Le(e)}${st(e,n).replace(/\n\s+/g,` `)}`},lt=async(e,t={})=>{let n=G(e);return`${V(n)}${st(n,await $(n,t))}`},ut=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`),dt=(t,n)=>{let r=n?.componentName??`div`,i={version:e.zt,content:t,entries:n?.entries??[{tagName:n?.tagName,componentName:r,content:t,commentText:n?.commentText}],timestamp:Date.now()},a=e=>{e.preventDefault(),e.clipboardData?.setData(`text/plain`,t),e.clipboardData?.setData(`text/html`,`<meta charset='utf-8'><pre><code>${ut(t)}</code></pre>`),e.clipboardData?.setData(`application/x-react-grab`,JSON.stringify(i))};document.addEventListener(`copy`,a);let o=document.createElement(`textarea`);o.value=t,o.style.position=`fixed`,o.style.left=`-9999px`,o.ariaHidden=`true`,document.body.appendChild(o),o.select();try{return typeof document.execCommand==`function`?document.execCommand(`copy`):!1}finally{document.removeEventListener(`copy`,a),o.remove()}};Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return Ge}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return Ze}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return ct}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Qe}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return ot}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return dt}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return xe}});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license MIT
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2025 Aiden Bai
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*/
|
|
9
|
-
let e=null;const t=()=>{if(e!==null)return e;try{e=window.matchMedia(`(color-gamut: p3)`).matches}catch{e=!1}return e},n=t(),r=e=>n?`color(display-p3 0.84 0.19 0.78 / ${e})`:`rgba(210, 57, 192, ${e})`;let i=null;const a=e=>{i=e},o=()=>i,s=e=>i?e!==null&&i.contains(e):!0,c=e=>e,l=`data-react-grab`,ee=`0.1.48-dev.a036acc`,te=`var(--rg-panel-bg)`,ne=`var(--rg-shadow)`,re=-1e3,ie=.95,ae=1500,oe=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],se=5e3,ce=8e3,le=1e4,ue=2147483647,de=2147483645,fe=.7,pe=1e3/60,me=.5,he=.01,ge=r(.4),_e=r(.05),ve=r(.5),ye=r(.08),be=r(.15),xe=.2,Se=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],Ce=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),we=new Set([`a`,`code`,`pre`]),Te=new Set([`script`,`style`,`template`,`noscript`]),Ee=[`Meta`,`Control`,`Shift`,`Alt`],De=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),u=`data-react-grab-frozen`,Oe=.18,ke=.6,Ae=.5,je=`data-react-grab-input`,Me=.5,Ne=`copy`,Pe=`comment`,Fe=`edit`,Ie=`superellipse(1.25)`,Le=.75,Re=.01,ze=1e3,Be={left:-9999,top:-9999},Ve={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},He=1e3,Ue=`#00000000`,We=`transparent`,Ge=2e3,Ke=`cubic-bezier(0.34, 1.56, 0.64, 1)`,qe=12e3,Je=9e3,Ye=1e4,Xe=8e3,Ze=5e3,Qe=1e3,$e=1e7,et=1.2,tt=-9999,nt=new Set(`display.position.top.right.bottom.left.z-index.overflow.overflow-x.overflow-y.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.flex-direction.flex-wrap.justify-content.align-items.align-self.align-content.flex-grow.flex-shrink.flex-basis.order.gap.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-template-areas.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-align.text-decoration-line.text-decoration-style.text-transform.text-overflow.text-shadow.white-space.word-break.overflow-wrap.vertical-align.color.background-color.background-image.background-position.background-size.background-repeat.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.box-shadow.opacity.transform.filter.backdrop-filter.object-fit.object-position`.split(`.`)),rt=`bippy-0.5.43`,it=Object.defineProperty,at=Object.prototype.hasOwnProperty,d=()=>{},ot=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{}},st=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e);let ct=!1,lt;const f=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>ct?!0:(e&&typeof e.inject==`function`&&(lt=e.inject.toString()),!!lt?.includes(`(injected)`)),p=new Set,m=new Set,ut=e=>{let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:rt,checkDCE:ot,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),m.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,p.forEach(e=>e())),i},on:d,onCommitFiberRoot:d,onCommitFiberUnmount:d,onPostCommitFiberRoot:d,renderers:t,supportsFiber:!0,supportsFlight:!0};try{it(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{m.add(e),t.renderers.set(n,e)}),dt(e))}}});let t=window.hasOwnProperty,n=!1;it(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{dt(e)}return r},dt=e=>{e&&p.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=ot,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=rt,t._instrumentationIsActive=!1;let e=st(t);if(e||(t.on=d),t.renderers.size){t._instrumentationIsActive=!0,p.forEach(e=>e());return}let n=t.inject,r=f(t);r&&!e&&(ct=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return m.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,p.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||f())&&e?.()}catch{}},ft=()=>at.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),h=e=>ft()?(dt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):ut(e),pt=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));
|
|
10
|
-
/**
|
|
11
|
-
* @license bippy
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Aiden Bai
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/
|
|
18
|
-
(()=>{try{pt()&&h()}catch{}})();
|
|
19
|
-
/**
|
|
20
|
-
* @license bippy
|
|
21
|
-
*
|
|
22
|
-
* Copyright (c) Aiden Bai
|
|
23
|
-
*
|
|
24
|
-
* This source code is licensed under the MIT license found in the
|
|
25
|
-
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/
|
|
27
|
-
const mt=e=>{switch(e.tag){case 5:case 26:case 27:return!0;default:return typeof e.type==`string`}},ht=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},gt=e=>{let t=[],n=[];for(mt(e)?t.push(e):e.child&&n.push(e.child);n.length;){let e=n.pop();if(!e)break;mt(e)?t.push(e):e.child&&n.push(e.child),e.sibling&&n.push(e.sibling)}return t};function _t(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await yt(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=vt(i,t,n);if(e)return e;i=n?null:i.sibling}return null}const vt=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=vt(r,t,n);if(e)return e;r=n?null:r.sibling}return null},yt=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await yt(r,t,n);if(e)return e;r=n?null:r.sibling}return null},bt=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?bt(t.type||t.render):null},g=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=bt(t);return r&&(r.displayName||r.name)||null},xt=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||st(e)||f(e)},St=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let t of Et){let n=_t(t.current,t=>{if(t===e)return!0});if(n)return n}return e},Ct=e=>Object.prototype.toString.call(e)===`[object Object]`&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null),wt=(e,t=[])=>{if(!Ct(e))return[{path:t,value:e}];let n=[];for(let r in e){let i=e[r],a=t.concat(r);Ct(i)?n.push(...wt(i,a)):n.push({path:a,value:i})}return n},Tt=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let t in e)if(t.startsWith(`__reactContainer$`)||t.startsWith(`__reactInternalInstance$`)||t.startsWith(`__reactFiber`))return e[t]||null}return null},Et=new Set,Dt=e=>(e.tagName||``).toLowerCase();let Ot;const kt=()=>{if(Ot!==void 0)return Ot;let e=document.querySelector(`script[nonce], style[nonce]`),t=e?.nonce||e?.getAttribute(`nonce`)||null;return t&&(Ot=t),t},At=[[`data-rr-block`,``],[`data-rr-ignore`,``],[`data-rr-mask`,``],[`data-sentry-block`,``],[`data-sentry-ignore`,``],[`data-sentry-mask`,``],[`data-dd-privacy`,`hidden`],[`data-fs-exclude`,``],[`data-lr-exclude`,``],[`data-hj-suppress`,``],[`data-recording-disable`,``],[`data-clarity-mask`,`true`],[`data-heap-redact-text`,``]],jt=e=>{for(let[t,n]of At)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},Mt=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Nt=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],Pt=[`<anonymous>`,`eval`,``],Ft=/\.(jsx|tsx|ts|js)$/,It=/(\.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,Lt=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,Rt=/\(at [^)]+\)$/,zt=/(^|@)\S+:\d+/,Bt=/^\s*at .*(\S+:\d+|\(native\))/m,Vt=/^(eval@)?(\[native code\])?$/,_=(e,t)=>{if(t?.includeInElement!==!1){let n=e.split(`
|
|
28
|
-
`),r=[];for(let e of n)if(/^\s*at\s+/.test(e)){let t=Wt(e,void 0)[0];t&&r.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*\(at .*\)$/,``);r.push({functionName:t,source:e})}else if(e.match(zt)){let t=Gt(e,void 0)[0];t&&r.push(t)}return Ut(r,t)}return e.match(Bt)?Wt(e,t):Gt(e,t)},Ht=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},Ut=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,Wt=(e,t)=>Ut(e.split(`
|
|
29
|
-
`).filter(e=>!!e.match(Bt)),t).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=Ht(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),Gt=(e,t)=>Ut(e.split(`
|
|
30
|
-
`).filter(e=>!e.match(Vt)),t).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=Ht(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}});var Kt=44,qt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Jt=new Uint8Array(64),Yt=new Uint8Array(128);for(let e=0;e<qt.length;e++){let t=qt.charCodeAt(e);Jt[e]=t,Yt[t]=e}function v(e,t){let n=0,r=0,i=0;do i=Yt[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function Xt(e,t){return e.pos>=t?!1:e.peek()!==Kt}var Zt=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function Qt(e){let{length:t}=e,n=new Zt(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,ee=0;for(i=0;n.pos<e;){let r;i=v(n,i),i<ee&&(l=!1),ee=i,Xt(n,e)?(a=v(n,a),o=v(n,o),s=v(n,s),Xt(n,e)?(c=v(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||$t(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function $t(e){e.sort(en)}function en(e,t){return e[0]-t[0]}const tn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,nn=/^data:application\/json[^,]+base64,/,rn=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,an=new Map,on=new Map,sn=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let i=e[n];if(!i||i.length===0)return null;let a=null;for(let e of i)if(e[0]<=r)a=e;else break;if(!a||a.length<4)return null;let[,o,s,c]=a;if(o===void 0||s===void 0||c===void 0)return null;let l=t[o];return l?{columnNumber:c,fileName:l,lineNumber:s+1}:null},cn=(e,t,n)=>{if(e.sections){let r=null;for(let i of e.sections)if(t>i.offset.line||t===i.offset.line&&n>=i.offset.column)r=i;else break;if(!r)return null;let i=t-r.offset.line,a=t===r.offset.line?n-r.offset.column:n;return sn(r.map.mappings,r.map.sources,i,a)}return sn(e.mappings,e.sources,t-1,n)},ln=(e,t)=>{let n=t.split(`
|
|
31
|
-
`),r;for(let e=n.length-1;e>=0&&!r;e--){let t=n[e].match(rn);t&&(r=t[1]||t[2])}if(!r)return null;let i=tn.test(r);if(!(nn.test(r)||i||r.startsWith(`/`))){let t=e.split(`/`);t[t.length-1]=r,r=t.join(`/`)}return r},un=e=>({file:e.file,mappings:Qt(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),dn=e=>{let t=e.sections.map(({map:e,offset:t})=>({map:{...e,mappings:Qt(e.mappings)},offset:t})),n=new Set;for(let e of t)for(let t of e.map.sources)n.add(t);return{file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},fn=e=>{if(!e)return!1;let t=e.trim();if(!t)return!1;let n=t.match(tn);if(!n)return!0;let r=n[0].toLowerCase();return r===`http:`||r===`https:`},pn=async(e,t=fetch)=>{if(!fn(e))return null;let n=await t(e);if(!n.ok)return null;let r=await n.text();if(!r)return null;let i=ln(e,r);if(!i||!fn(i))return null;let a=await t(i);if(!a.ok)return null;try{let e=await a.json();return`sections`in e?dn(e):un(e)}catch{return null}},mn=async(e,t=!0,n)=>{if(t&&an.has(e))return an.get(e)??null;let r=t?on.get(e):void 0;if(r)return(await r).sourceMap;let i=pn(e,n).then(e=>({sourceMap:e,isTransientFailure:!1}),()=>({sourceMap:null,isTransientFailure:!0}));t&&on.set(e,i);let{sourceMap:a,isTransientFailure:o}=await i;return t&&(on.delete(e),o||an.set(e,a)),a},hn=async(e,t=!0,n)=>await Promise.all(e.map(async e=>{if(!e.fileName)return e;let r=await mn(e.fileName,t,n);if(!r||typeof e.lineNumber!=`number`||typeof e.columnNumber!=`number`)return e;let i=cn(r,e.lineNumber,e.columnNumber);return i?{...e,source:i.fileName&&e.source?e.source.replace(e.fileName,i.fileName):e.source,fileName:i.fileName,lineNumber:i.lineNumber,columnNumber:i.columnNumber,isSymbolicated:!0}:e})),gn=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack==`string`,_n=()=>{let e=h();for(let t of[...Array.from(m),...Array.from(e.renderers.values())]){let e=t.currentDispatcherRef;if(e&&typeof e==`object`)return`H`in e?e.H:e.current}return null},vn=e=>{for(let t of m){let n=t.currentDispatcherRef;n&&typeof n==`object`&&(`H`in n?n.H=e:n.current=e)}},y=e=>`\n in ${e}`,yn=(e,t)=>{let n=y(e);return t&&(n+=` (at ${t})`),n};let b=!1;const x=(e,t)=>{if(!e||b)return``;let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,b=!0;let r=_n();vn(null);let i=console.error,a=console.warn;console.error=()=>{},console.warn=()=>{};try{let n={DetermineComponentFrameRoot(){let n;try{if(t){let t=function(){throw Error()};if(Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){n=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){n=e}e.call(t.prototype)}}else{try{throw Error()}catch(e){n=e}let t=e();t&&typeof t.catch==`function`&&t.catch(()=>{})}}catch(e){if(e instanceof Error&&n instanceof Error&&typeof e.stack==`string`)return[e.stack,n.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`,Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,`name`)?.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});let[r,i]=n.DetermineComponentFrameRoot();if(r&&i){let t=r.split(`
|
|
32
|
-
`),n=i.split(`
|
|
33
|
-
`),a=0,o=0;for(;a<t.length&&!t[a].includes(`DetermineComponentFrameRoot`);)a++;for(;o<n.length&&!n[o].includes(`DetermineComponentFrameRoot`);)o++;if(a===t.length||o===n.length)for(a=t.length-1,o=n.length-1;a>=1&&o>=0&&t[a]!==n[o];)o--;for(;a>=1&&o>=0;a--,o--)if(t[a]!==n[o]){if(a!==1||o!==1)do if(a--,o--,o<0||t[a]!==n[o]){let n=`\n${t[a].replace(` at new `,` at `)}`,r=g(e);return r&&n.includes(`<anonymous>`)&&(n=n.replace(`<anonymous>`,r)),n}while(a>=1&&o>=0);break}}}finally{b=!1,Error.prepareStackTrace=n,vn(r),console.error=i,console.warn=a}let o=e?g(e):``;return o?y(o):``},bn=(e,t)=>{let n=e.tag,r=``;switch(n){case 28:r=y(`Activity`);break;case 1:r=x(e.type,!0);break;case 11:r=x(e.type.render,!1);break;case 0:case 15:r=x(e.type,!1);break;case 5:case 26:case 27:r=y(e.type);break;case 16:r=y(`Lazy`);break;case 13:r=e.child!==t&&t!==null?y(`Suspense Fallback`):y(`Suspense`);break;case 19:r=y(`SuspenseList`);break;case 30:r=y(`ViewTransition`);break;default:return``}return r},xn=e=>{try{let t=``,n=e,r=null;do{t+=bn(n,r);let e=n._debugInfo;if(e&&Array.isArray(e))for(let n=e.length-1;n>=0;n--){let r=e[n];typeof r.name==`string`&&(t+=yn(r.name,r.env))}r=n,n=n.return}while(n);return t}catch(e){return e instanceof Error?`\nError generating stack: ${e.message}\n${e.stack}`:``}},Sn=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
|
|
34
|
-
`)&&(n=n.slice(29));let r=n.indexOf(`
|
|
35
|
-
`);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(`
|
|
36
|
-
`,r)),r!==-1)n=n.slice(0,r);else return``;return n},Cn=e=>!!(e.functionName&&e.fileName&&(e.fileName.startsWith(`rsc://`)||e.fileName.startsWith(`about://React/`))),wn=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Tn=e=>{let t=new Map;for(let n of e)for(let e of n.stackFrames){if(!Cn(e))continue;let n=e.functionName,r=t.get(n)??[];r.some(t=>wn(t,e))||(r.push(e),t.set(n,r))}return t},En=(e,t,n)=>{if(!e.functionName)return{...e,isServer:!0};let r=t.get(e.functionName);if(!r||r.length===0)return{...e,isServer:!0};let i=n.get(e.functionName)??0,a=r[i%r.length];return n.set(e.functionName,i+1),{...e,isServer:!0,fileName:a.fileName,lineNumber:a.lineNumber,columnNumber:a.columnNumber,source:e.source?.replace(`(at Server)`,`(${a.fileName}:${a.lineNumber}:${a.columnNumber})`)}},Dn=e=>{let t=[];return _t(e,e=>{if(!gn(e))return;let n=typeof e.type==`string`?e.type:g(e.type)||`<anonymous>`;t.push({componentName:n,stackFrames:_(Sn(e._debugStack?.stack))})},!0),t},On=async(e,t=!0,n)=>{let r=Dn(e),i=_(xn(e)),a=Tn(r),o=new Map;return hn(i.map(e=>(e.source?.includes(`(at Server)`)??!1)||e.source!=null&&Rt.test(e.source)?En(e,a,o):e).filter((e,t,n)=>{if(t===0)return!0;let r=n[t-1];return e.functionName!==r.functionName}),t,n)},kn=e=>{let t=e._debugSource;return t?typeof t==`object`&&!!t&&`fileName`in t&&typeof t.fileName==`string`&&`lineNumber`in t&&typeof t.lineNumber==`number`:!1},An=async(e,t=!0,n)=>{if(kn(e))return e._debugSource||null;let r=await On(e,t,n);for(let e of r)if(e.fileName)return{fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,functionName:e.functionName};return null},jn=e=>e.split(`/`).filter(Boolean).length,Mn=e=>e.split(`/`).filter(Boolean)[0]??null,Nn=e=>{let t=e.indexOf(`/`,1);if(t===-1||jn(e.slice(0,t))!==1)return e;let n=e.slice(t);if(!Ft.test(n)||jn(n)<2)return e;let r=Mn(n);return!r||r.startsWith(`@`)||r.length>4?e:n},Pn=e=>{if(!e||Pt.some(t=>t===e))return``;let t=e,n=t.startsWith(`http://`)||t.startsWith(`https://`);if(n)try{t=new URL(t).pathname}catch{}if(n&&(t=Nn(t)),t.startsWith(`about://React/`)){let e=t.slice(14),n=e.indexOf(`/`),r=e.indexOf(`:`);t=n!==-1&&(r===-1||n<r)?e.slice(n+1):e}let r=!0;for(;r;){r=!1;for(let e of Nt)if(t.startsWith(e)){t=t.slice(e.length),e===`file:///`&&(t=`/${t.replace(/^\/+/,``)}`),r=!0;break}}if(Mt.test(t)){let e=t.match(Mt);e&&(t=t.slice(e[0].length))}if(t.startsWith(`//`)){let e=t.indexOf(`/`,2);t=e===-1?``:t.slice(e)}let i=t.indexOf(`?`);if(i!==-1){let e=t.slice(i);Lt.test(e)&&(t=t.slice(0,i))}return t},Fn=e=>{let t=Pn(e);return!(!t||!Ft.test(t)||It.test(t))},In=Symbol.for(`react.context`);let Ln=[],Rn=null;const zn=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render."),S=()=>{let e=Rn;return e!==null&&(Rn=e.next),e},C=e=>e._currentValue,w=(e,t,n,r=null)=>{Ln.push({displayName:r,primitive:e,stackError:Error(),value:t,dispatcherHookName:n})},Bn=e=>{if(typeof e==`object`&&e){let t=e;if(typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:return w(`Promise`,e.value,`Use`),e.value;case`rejected`:throw e.reason}throw w(`Unresolved`,e,`Use`),zn}if(t.$$typeof===In&&`_currentValue`in t){let e=t,n=C(e);return w(`Context (use)`,n,`Use`,e.displayName||`Context`),n}}throw Error(`An unsupported type was passed to use(): `+String(e))},Vn=e=>{let t=C(e);return w(`Context`,t,`Context`,e.displayName||null),t},Hn=e=>{let t=S(),n=t===null?typeof e==`function`?e():e:t.memoizedState;return w(`State`,n,`State`),[n,()=>{}]},Un=(e,t,n)=>{let r=S(),i=r===null?n===void 0?t:n(t):r.memoizedState;return w(`Reducer`,i,`Reducer`),[i,()=>{}]},Wn=e=>{let t=S(),n=t===null?{current:e}:t.memoizedState;return w(`Ref`,n.current,`Ref`),n},Gn=()=>{let e=S();return w(`CacheRefresh`,e===null?()=>{}:e.memoizedState,`CacheRefresh`),()=>{}},Kn=e=>{S(),w(`LayoutEffect`,e,`LayoutEffect`)},qn=e=>{S(),w(`InsertionEffect`,e,`InsertionEffect`)},Jn=e=>{S(),w(`Effect`,e,`Effect`)},Yn=e=>{S();let t;typeof e==`object`&&e&&`current`in e&&(t=e.current),w(`ImperativeHandle`,t,`ImperativeHandle`)},Xn=(e,t)=>{w(`DebugValue`,typeof t==`function`?t(e):e,`DebugValue`)},Zn=e=>{let t=S();return w(`Callback`,t===null?e:t.memoizedState[0],`Callback`),e},Qn=e=>{let t=S(),n=t===null?e():t.memoizedState[0];return w(`Memo`,n,`Memo`),n},$n=(e,t)=>{let n=S();S();let r=n===null?t():n.memoizedState;return w(`SyncExternalStore`,r,`SyncExternalStore`),r},er=()=>{let e=S();S();let t=e===null?!1:e.memoizedState;return w(`Transition`,t,`Transition`),[t,()=>{}]},tr=e=>{let t=S(),n=t===null?e:t.memoizedState;return w(`DeferredValue`,n,`DeferredValue`),n},nr=()=>{let e=S(),t=e===null?``:e.memoizedState;return w(`Id`,t,`Id`),t},rr=e=>[],ir=e=>{let t=S(),n=t===null?e:t.memoizedState;return w(`Optimistic`,n,`Optimistic`),[n,()=>{}]},ar=(e,t)=>{let n,r=null;if(e!==null){let t=e.memoizedState;if(typeof t==`object`&&t&&`then`in t&&typeof t.then==`function`){let e=t;switch(e.status){case`fulfilled`:n=e.value;break;case`rejected`:r=e.reason;break;default:r=zn,n=e}}else n=t}else n=t;return{value:n,error:r}},or=e=>(t,n)=>{let r=S();S(),S();let i=Error(),{value:a,error:o}=ar(r,n);if(Ln.push({displayName:null,primitive:e,stackError:i,value:a,dispatcherHookName:e}),o!==null)throw o;return[a,()=>{},!1]},sr=or(`ActionState`),cr={readContext:C,use:Bn,useCallback:Zn,useContext:Vn,useEffect:Jn,useImperativeHandle:Yn,useLayoutEffect:Kn,useInsertionEffect:qn,useMemo:Qn,useReducer:Un,useRef:Wn,useState:Hn,useDebugValue:Xn,useDeferredValue:tr,useTransition:er,useSyncExternalStore:$n,useId:nr,useHostTransitionStatus:()=>{let e=C({_currentValue:null});return w(`HostTransitionStatus`,e,`HostTransitionStatus`),e},useFormState:or(`FormState`),useActionState:sr,useOptimistic:ir,useMemoCache:rr,useCacheRefresh:Gn,useEffectEvent:e=>(S(),w(`EffectEvent`,e,`EffectEvent`),e)};typeof Proxy>`u`||new Proxy(cr,{get(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t];let n=Error(`Missing method in Dispatcher: `+t);throw n.name=`ReactDebugToolsUnsupportedHookError`,n}});const lr=/^(?:\.\/)?\/?\([a-z][a-z0-9-]*\)\//,ur=e=>{let t=Pn(e);return t=t.replace(lr,``),t.startsWith(`./`)&&(t=t.slice(2)),t};let dr;const fr=e=>(e&&(dr=void 0),dr??=typeof document<`u`&&!!(document.getElementById(`__NEXT_DATA__`)||document.querySelector(`nextjs-portal`)),dr);let T;const pr=()=>{if(T!==void 0)return T;let e=document.querySelector(`script[src*="/_next/"]`)?.src,t=e?new URL(e).pathname:``,n=t.indexOf(`/_next/`);return T=n>0?t.slice(0,n):``,T},mr=typeof window<`u`,hr=e=>0,gr=e=>{},E=mr?(Object.getOwnPropertyDescriptor(Window.prototype,`requestAnimationFrame`)?.value??window.requestAnimationFrame).bind(window):hr,D=mr?(Object.getOwnPropertyDescriptor(Window.prototype,`cancelAnimationFrame`)?.value??window.cancelAnimationFrame).bind(window):gr,_r=()=>mr?new Promise(e=>E(()=>e())):Promise.resolve(),vr=typeof Element<`u`&&typeof Element.prototype.checkVisibility==`function`,yr={checkOpacity:!0,checkVisibilityCSS:!0,opacityProperty:!0,visibilityProperty:!0},br={checkVisibilityCSS:!0,visibilityProperty:!0},xr=(e,t)=>{if(vr&&!t)return e.checkVisibility(yr)?!0:e.checkVisibility(br)?window.getComputedStyle(e).opacity!==`0`:!1;let n=t??window.getComputedStyle(e);return n.display!==`none`&&n.visibility!==`hidden`&&n.opacity!==`0`},Sr=e=>{let t=Dt(e);return t===`html`||t===`body`},Cr=[`data-react-grab`,`data-react-grab-demo`],wr=e=>Cr.some(t=>e.hasAttribute(t)),Tr=e=>{if(wr(e))return!0;let t=e.getRootNode();return t instanceof ShadowRoot&&wr(t.host)},Er=e=>e.hasAttribute(`data-react-grab-ignore`)||e.closest(`[data-react-grab-ignore]`)!==null,Dr=e=>{let t=parseInt(e.zIndex,10);return e.pointerEvents===`none`&&e.position===`fixed`&&!isNaN(t)&&t>=2147483600},Or=e=>{let t=e.backgroundColor;return t===`transparent`||t===`rgba(0, 0, 0, 0)`},kr=e=>{let t=e.position;if(t!==`fixed`&&t!==`absolute`)return!1;if(Or(e)||parseFloat(e.opacity)<.1)return!0;let n=parseInt(e.zIndex,10);return!isNaN(n)&&n>1e3};let O=new WeakMap;const Ar=()=>{O=new WeakMap},jr=e=>{if(Sr(e)||Tr(e)||Er(e))return!1;let t=performance.now(),n=O.get(e);if(n&&t-n.timestamp<50)return n.isVisible;if(!xr(e))return O.set(e,{isVisible:!1,timestamp:t}),!1;if(e.clientWidth/window.innerWidth>=.9&&e.clientHeight/window.innerHeight>=.9){let t=window.getComputedStyle(e);if(Dr(t)||kr(t))return!1}return O.set(e,{isVisible:!0,timestamp:t}),!0},k=(e,t)=>{let n=document.createElement(`style`);n.setAttribute(e,``);let r=kt();return r&&(n.nonce=r),jt(n),n.textContent=t,document.head.appendChild(n),n};let A=null,j=null;const Mr=()=>A!==null,Nr=()=>{A||(A=k(`data-react-grab-frozen-pseudo`,`html { pointer-events: none !important; }`),j=k(`data-react-grab-hittest-override`,`html, body { pointer-events: auto !important; }`),j.disabled=!0)},Pr=()=>{A?.remove(),A=null,j?.remove(),j=null},M=()=>{A&&(A.disabled||=!0,j?.disabled&&(j.disabled=!1))},N=()=>{A&&(A.disabled&&=!1,j&&!j.disabled&&(j.disabled=!0))};let P=null,F=null,I=null;const Fr=(e,t,n)=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom,Ir=()=>{I!==null&&clearTimeout(I),I=setTimeout(()=>{I=null,N()},100)},Lr=()=>{I!==null&&(clearTimeout(I),I=null)},Rr=(e,t,n,r)=>{let i=Math.abs(e-n),a=Math.abs(t-r);return i<=2&&a<=2},zr=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return[];Lr(),M();let n=document.elementsFromPoint(e,t);return Ir(),o()?n.filter(s):n},Br=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n=performance.now();if(F&&Fr(e,t,F.rect))return F.element;if(P){let r=Rr(e,t,P.clientX,P.clientY),i=n-P.timestamp<16;if(r||i)return P.element}Lr(),M();let r=null,i=document.elementFromPoint(e,t);if(i&&jr(i)&&s(i))r=i;else{let n=document.elementsFromPoint(e,t);for(let e of n)if(e!==i&&jr(e)&&s(e)){r=e;break}}return Ir(),F=r instanceof HTMLIFrameElement?{element:r,rect:r.getBoundingClientRect()}:null,P={clientX:e,clientY:t,element:r,timestamp:n},r},Vr=()=>{Lr(),N(),P=null,F=null},Hr=async(e,t)=>{let n=fr(),r=new URLSearchParams({file:e}),i=n?`line1`:`line`,a=n?`column1`:`column`;t&&r.set(i,String(t)),r.set(a,`1`);let o=n?`${pr()}/__nextjs_launch-editor`:`/__open-in-editor`;return(await fetch(`${o}?${r}`)).ok},Ur=async(e,t,n)=>{let r=ur(e);if(await Hr(r,t).catch(()=>!1))return;let i=t?`&line=${t}`:``,a=`https://react-grab.com/open-file?url=${encodeURIComponent(r)}${i}`,o=n?n(a,r,t):a;window.open(o,`_blank`,`noopener,noreferrer`)};let L=!1;const R=new Map;let Wr=-1;const Gr=new WeakSet,z=new Map,B=new Map,Kr=e=>Gr.has(e)?!0:!L||!(`gsapVersions`in window)||!(Error().stack??``).includes(`_tick`)?!1:(Gr.add(e),!0);typeof window<`u`&&(window.requestAnimationFrame=e=>{if(!Kr(e))return E(e);if(L){let t=Wr--;return R.set(t,e),t}let t=E(n=>{if(L){let n=Wr--;R.set(n,e),z.set(t,n);return}e(n)});return t},window.cancelAnimationFrame=e=>{if(R.has(e)){R.delete(e);return}let t=B.get(e);if(t!==void 0){D(t.nativeId),B.delete(e);return}let n=z.get(e);if(n!==void 0){R.delete(n),z.delete(e);return}D(e)});const qr=()=>{if(!L){L=!0,R.clear(),z.clear();for(let[e,{nativeId:t,callback:n}]of B)D(t),R.set(e,n);B.clear()}},Jr=()=>{if(L){L=!1;for(let[e,t]of R.entries()){let n=E(n=>{B.delete(e),t(n)});B.set(e,{nativeId:n,callback:t})}R.clear(),z.clear()}},Yr=`
|
|
37
|
-
[${u}],
|
|
38
|
-
[${u}] * {
|
|
39
|
-
animation-play-state: paused !important;
|
|
40
|
-
transition: none !important;
|
|
41
|
-
}
|
|
42
|
-
`;let Xr=null,V=[],H=[],Zr=[],U=null,W=[],G=[],K=!1;const q=new Map;let J=[];const Qr=()=>{Xr||=k(`data-react-grab-frozen-styles`,Yr)},$r=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),ei=e=>{let t=new Set;for(let n of e){n instanceof SVGSVGElement?t.add(n):n instanceof SVGElement&&n.ownerSVGElement&&t.add(n.ownerSVGElement);for(let e of n.querySelectorAll(`svg`))e instanceof SVGSVGElement&&t.add(e)}return[...t]},ti=(e,t)=>{let n=Reflect.get(e,t);typeof n==`function`&&n.call(e)},ni=e=>{for(let t of e){let e=q.get(t)??0;e===0&&ti(t,`pauseAnimations`),q.set(t,e+1)}},ri=e=>{for(let t of e){let e=q.get(t);if(e){if(e===1){q.delete(t),ti(t,`unpauseAnimations`);continue}q.set(t,e-1)}}},ii=e=>{let t=[];for(let n of e)for(let e of n.getAnimations({subtree:!0}))e.playState===`running`&&t.push(e);return t},ai=e=>{for(let t of e)try{t.finish()}catch{}},oi=e=>{if(!(e.effect instanceof KeyframeEffect))return!1;let t=e.effect.target;return t instanceof Element&&t.getRootNode()instanceof ShadowRoot},si=e=>{if(e.length!==0&&!$r(e,Zr)){ci(),Zr=[...e],Qr(),V=e,H=ei(V),ni(H);for(let e of V)e.setAttribute(u,``);J=ii(V);for(let e of J)e.pause()}},ci=()=>{if(!(V.length===0&&H.length===0&&J.length===0)){for(let e of V)e.removeAttribute(u);ri(H),ai(J),V=[],H=[],J=[],Zr=[]}},li=e=>e.length===0?(ci(),()=>{}):(si(e),ci),ui=()=>{if(U)return[];let e=[];for(let t of document.getAnimations())oi(t)||t.playState===`running`&&e.push(t);return e},di=e=>{if(!U){if(U=k(`data-react-grab-global-freeze`,``),e.length>200)U.textContent=`
|
|
43
|
-
*, *::before, *::after {
|
|
44
|
-
animation-play-state: paused !important;
|
|
45
|
-
transition: none !important;
|
|
46
|
-
}
|
|
47
|
-
`,K=!0,G=[];else{for(let t of e)t.pause();G=e,K=!1}W=ei(Array.from(document.querySelectorAll(`svg`))),ni(W),qr()}},fi=()=>{if(U){if(K){U.textContent=`
|
|
48
|
-
*, *::before, *::after {
|
|
49
|
-
transition: none !important;
|
|
50
|
-
}
|
|
51
|
-
`;let e=[];for(let t of document.getAnimations())oi(t)||e.push(t);ai(e),K=!1}else{for(let e of G)try{e.finish()}catch{try{e.play()}catch{}}G=[]}U.remove(),U=null,ri(W),W=[],Jr()}},pi=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],mi=[`focus`,`blur`,`focusin`,`focusout`],hi=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`,`display`],gi=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],_i=new Map,vi=new Map,yi=e=>{e.stopImmediatePropagation()},bi=e=>{e.preventDefault(),e.stopImmediatePropagation()},xi=(e,t)=>{let n=new Map;for(let r of t){let t=e.style.getPropertyValue(r);t&&n.set(r,t)}return n},Si=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=e.style.cssText,a=xi(e,t);for(let e of t){let t=r.getPropertyValue(e);t&&(i+=`${e}: ${t} !important; `)}return{element:e,frozenStyles:i,originalPropertyValues:a}},Ci=(e,t)=>{let n=[],r=document.elementFromPoint(e,t);for(;r&&r!==document.documentElement;)r instanceof HTMLElement&&n.push(r),r=r.parentElement;return n},wi=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;)t instanceof HTMLElement&&e.push(t),t=t.shadowRoot?.activeElement??null;return e},Ti=(e,t)=>{for(let{element:n,frozenStyles:r,originalPropertyValues:i}of e)t.set(n,i),n.style.cssText=r},Ei=(e,t)=>{for(let[n,r]of e)for(let e of t){let t=r.get(e);t?n.style.setProperty(e,t):n.style.removeProperty(e)}e.clear()},Di=(e,t)=>{if(Mr())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?Ci(e,t):Array.from(document.querySelectorAll(`:hover`)).filter(e=>e instanceof HTMLElement);for(let e of r){let t=Si(e,hi);t&&n.push(t)}let i=[];for(let e of wi()){let t=Si(e,gi,vi);t&&i.push(t)}return{hoverStates:n,focusStates:i}},Oi=e=>{if(e){for(let e of pi)document.addEventListener(e,yi,!0);for(let e of mi)document.addEventListener(e,bi,!0);Ti(e.hoverStates,_i),Ti(e.focusStates,vi),Nr()}},ki=()=>{Vr();for(let e of pi)document.removeEventListener(e,yi,!0);for(let e of mi)document.removeEventListener(e,bi,!0);Ei(_i,hi),Ei(vi,gi),Pr()},Ai=(e,t)=>{let n=Di(e,t),r=ui();Oi(n),di(r)},ji=()=>{ki(),fi()},Mi=(e,t)=>{};let Y=!1;const X=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},Ni=new WeakMap,Pi=new WeakMap,Fi=new WeakMap,Ii=new Set,Li=[],Z=[],Q=new WeakMap,$=new WeakMap,Ri=new WeakSet,zi=Et,Bi=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},Vi=()=>{if(zi.size>0)return zi;let e=new Set,t=n=>{let r=Tt(n);if(r){let t=Bi(r);t&&e.add(t);return}for(let r of Array.from(n.children))if(t(r),e.size>0)return};return t(document.body),e},Hi=(e,t)=>{if(!e)return t;if(!t)return e;if(!e.next||!t.next)return t;let n=e.next,r=t.next,i=e===n,a=t===r;return i&&a?(e.next=t,t.next=e):i?(e.next=r,t.next=e):a?(t.next=n,e.next=t):(e.next=r,t.next=n),t},Ui=e=>{if(!e||Q.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>Y?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,`pending`,{configurable:!0,enumerable:!0,get:()=>Y?null:n,set:e=>{if(Y){e!==null&&(t.bufferedPending=Hi(t.bufferedPending??null,e));return}n=e}}),Q.set(e,t)},Wi=e=>{if(!e)return[];let t=[],n=e.next;if(!n)return[];let r=n;do r&&=(t.push(r.action),r.next);while(r&&r!==n);return t},Gi=e=>{let t=Q.get(e);if(!t)return;t.originalGetSnapshot&&(e.getSnapshot=t.originalGetSnapshot),t.originalPendingDescriptor?Object.defineProperty(e,`pending`,t.originalPendingDescriptor):delete e.pending,e.pending=null;let n=e.dispatch;if(typeof n==`function`){let e=Wi(t.pendingValueAtPause??null),r=Wi(t.bufferedPending??null);for(let t of[...e,...r])Z.push(()=>n(t))}Q.delete(e)},Ki=e=>{if($.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,`memoizedValue`,{configurable:!0,enumerable:!0,get(){return Y?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(Y){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),$.set(e,t)},qi=e=>{let t=$.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,`memoizedValue`,t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),$.delete(e))},Ji=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Ui(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)Ki(n),n=n.next},Yi=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Gi(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)qi(n),n=n.next},Xi=e=>{let t=e;for(;t;){if(ht(t)&&Ji(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},Zi=e=>{let t=e;for(;t;){if(ht(t)&&Yi(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},Qi=e=>{if(Ni.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};Ni.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,X(Pi,a,()=>(...e)=>{Y?Z.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,X(Pi,a,()=>(...e)=>{Y?Z.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,X(Fi,a,()=>e=>{Y?Li.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>Y?n.useSyncExternalStore(t=>e(()=>{Y?Ii.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},$i=e=>{let t=e.currentDispatcherRef;if(!t||typeof t!=`object`)return;let n=`H`in t?`H`:`current`,r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>(r&&typeof r==`object`&&Qi(r),r),set:e=>{r=e}})},ea=e=>{queueMicrotask(()=>{try{for(let t of h().renderers.values())if(typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch{}}}catch{}})},ta=e=>{for(let t of e)try{t()}catch{}},na=()=>{for(let e of h().renderers.values())Ri.has(e)||($i(e),Ri.add(e))},ra=()=>{if(Y)return()=>{};na(),Y=!0;let e=Vi();for(let t of e)Xi(t.current);return()=>{if(Y)try{let e=Vi();for(let t of e)Zi(t.current);let t=Array.from(Ii),n=Li.slice(),r=Z.slice();Y=!1,ta(t),ta(n),ta(r),ea(e)}finally{Ii.clear(),Li.length=0,Z.length=0}}};export{Xe as $,kt as A,Te as At,De as B,Re as Bt,On as C,ye as Ct,_ as D,we as Dt,Pn as E,ne as Et,St as F,oe as Ft,Ne as G,c as Gt,pe as H,de as Ht,Tt as I,ce as It,Ve as J,t as Jt,fe as K,s as Kt,mt as L,se as Lt,_t as M,nt as Mt,xt as N,tt as Nt,gn as O,Ce as Ot,g as P,ie as Pt,Ye as Q,ht as R,Me as Rt,An as S,ge as St,Sn as T,te as Tt,Pe as U,l as Ut,xe as V,ue as Vt,$e as W,o as Wt,Fe as X,Be as Y,Ge as Z,E as _,He as _t,si as a,Ue as at,fr as b,Ae as bt,Vr as c,et as ct,N as d,ke as dt,Ze as et,M as f,Oe as ft,D as g,ze as gt,Sr as h,Ee as ht,ji as i,Ke as it,Dt as j,je as jt,jt as k,Se as kt,Br as l,be as lt,jr as m,Ie as mt,Mi as n,qe as nt,li as o,We as ot,Ar as p,le as pt,Le as q,a as qt,Ai as r,Je as rt,Ur as s,ae as st,ra as t,Qe as tt,zr as u,me as ut,_r as v,re as vt,Fn as w,_e as wt,ur as x,ve as xt,pr as y,he as yt,gt as z,ee as zt};
|