react-grab 0.0.32 → 0.0.33
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/dist/index.cjs +43 -1
- package/dist/index.global.js +14 -14
- package/dist/index.js +43 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1161,10 +1161,14 @@ var init = (rawOptions) => {
|
|
|
1161
1161
|
const [didJustDrag, setDidJustDrag] = solidJs.createSignal(false);
|
|
1162
1162
|
const [copyStartX, setCopyStartX] = solidJs.createSignal(OFFSCREEN_POSITION);
|
|
1163
1163
|
const [copyStartY, setCopyStartY] = solidJs.createSignal(OFFSCREEN_POSITION);
|
|
1164
|
+
const [mouseHasSettled, setMouseHasSettled] = solidJs.createSignal(false);
|
|
1164
1165
|
let holdTimerId = null;
|
|
1165
1166
|
let progressAnimationId = null;
|
|
1166
1167
|
let progressDelayTimerId = null;
|
|
1167
1168
|
let keydownSpamTimerId = null;
|
|
1169
|
+
let mouseSettleTimerId = null;
|
|
1170
|
+
let referenceMouseX = OFFSCREEN_POSITION;
|
|
1171
|
+
let referenceMouseY = OFFSCREEN_POSITION;
|
|
1168
1172
|
const isRendererActive = solidJs.createMemo(() => isActivated() && !isCopying());
|
|
1169
1173
|
const hasValidMousePosition = solidJs.createMemo(() => mouseX() > OFFSCREEN_POSITION && mouseY() > OFFSCREEN_POSITION);
|
|
1170
1174
|
const isTargetKeyCombination = (event) => (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "c";
|
|
@@ -1250,6 +1254,7 @@ ${context}
|
|
|
1250
1254
|
const copySingleElementToClipboard = async (targetElement2) => {
|
|
1251
1255
|
const tagName = extractElementTagName(targetElement2);
|
|
1252
1256
|
showTemporaryGrabbedBox(createElementBounds(targetElement2));
|
|
1257
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1253
1258
|
try {
|
|
1254
1259
|
const content = await getHTMLSnippet(targetElement2);
|
|
1255
1260
|
const plainTextContent = wrapInSelectedElementTags(content);
|
|
@@ -1269,6 +1274,7 @@ ${context}
|
|
|
1269
1274
|
for (const element of targetElements) {
|
|
1270
1275
|
showTemporaryGrabbedBox(createElementBounds(element));
|
|
1271
1276
|
}
|
|
1277
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1272
1278
|
try {
|
|
1273
1279
|
const elementSnippets = await Promise.all(targetElements.map((element) => getHTMLSnippet(element)));
|
|
1274
1280
|
const plainTextContent = elementSnippets.filter((snippet) => snippet.trim()).map((snippet) => wrapInSelectedElementTags(snippet)).join("\n\n");
|
|
@@ -1404,6 +1410,13 @@ ${context}
|
|
|
1404
1410
|
}
|
|
1405
1411
|
if (holdTimerId) window.clearTimeout(holdTimerId);
|
|
1406
1412
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1413
|
+
if (mouseSettleTimerId) {
|
|
1414
|
+
window.clearTimeout(mouseSettleTimerId);
|
|
1415
|
+
mouseSettleTimerId = null;
|
|
1416
|
+
}
|
|
1417
|
+
setMouseHasSettled(false);
|
|
1418
|
+
referenceMouseX = OFFSCREEN_POSITION;
|
|
1419
|
+
referenceMouseY = OFFSCREEN_POSITION;
|
|
1407
1420
|
stopProgressAnimation();
|
|
1408
1421
|
};
|
|
1409
1422
|
const abortController = new AbortController();
|
|
@@ -1453,6 +1466,34 @@ ${context}
|
|
|
1453
1466
|
window.addEventListener("mousemove", (event) => {
|
|
1454
1467
|
setMouseX(event.clientX);
|
|
1455
1468
|
setMouseY(event.clientY);
|
|
1469
|
+
if (referenceMouseX === OFFSCREEN_POSITION) {
|
|
1470
|
+
referenceMouseX = event.clientX;
|
|
1471
|
+
referenceMouseY = event.clientY;
|
|
1472
|
+
}
|
|
1473
|
+
const deltaX = event.clientX - referenceMouseX;
|
|
1474
|
+
const deltaY = event.clientY - referenceMouseY;
|
|
1475
|
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
1476
|
+
if (distance >= 200) {
|
|
1477
|
+
if (mouseSettleTimerId !== null) {
|
|
1478
|
+
window.clearTimeout(mouseSettleTimerId);
|
|
1479
|
+
}
|
|
1480
|
+
setMouseHasSettled(false);
|
|
1481
|
+
referenceMouseX = event.clientX;
|
|
1482
|
+
referenceMouseY = event.clientY;
|
|
1483
|
+
mouseSettleTimerId = window.setTimeout(() => {
|
|
1484
|
+
setMouseHasSettled(true);
|
|
1485
|
+
referenceMouseX = mouseX();
|
|
1486
|
+
referenceMouseY = mouseY();
|
|
1487
|
+
mouseSettleTimerId = null;
|
|
1488
|
+
}, 100);
|
|
1489
|
+
} else if (mouseSettleTimerId === null && !mouseHasSettled()) {
|
|
1490
|
+
mouseSettleTimerId = window.setTimeout(() => {
|
|
1491
|
+
setMouseHasSettled(true);
|
|
1492
|
+
referenceMouseX = mouseX();
|
|
1493
|
+
referenceMouseY = mouseY();
|
|
1494
|
+
mouseSettleTimerId = null;
|
|
1495
|
+
}, 100);
|
|
1496
|
+
}
|
|
1456
1497
|
}, {
|
|
1457
1498
|
signal: eventListenerSignal
|
|
1458
1499
|
});
|
|
@@ -1514,6 +1555,7 @@ ${context}
|
|
|
1514
1555
|
abortController.abort();
|
|
1515
1556
|
if (holdTimerId) window.clearTimeout(holdTimerId);
|
|
1516
1557
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1558
|
+
if (mouseSettleTimerId) window.clearTimeout(mouseSettleTimerId);
|
|
1517
1559
|
stopProgressAnimation();
|
|
1518
1560
|
document.body.style.userSelect = "";
|
|
1519
1561
|
document.body.style.cursor = "";
|
|
@@ -1522,7 +1564,7 @@ ${context}
|
|
|
1522
1564
|
const selectionVisible = solidJs.createMemo(() => false);
|
|
1523
1565
|
const dragVisible = solidJs.createMemo(() => isRendererActive() && isDraggingBeyondThreshold());
|
|
1524
1566
|
const labelVariant = solidJs.createMemo(() => isCopying() ? "processing" : "hover");
|
|
1525
|
-
const labelVisible = solidJs.createMemo(() => isRendererActive() && !isDragging() && (Boolean(targetElement()) && !isSameAsLast() || !targetElement()) || isCopying());
|
|
1567
|
+
const labelVisible = solidJs.createMemo(() => isRendererActive() && !isDragging() && mouseHasSettled() && (Boolean(targetElement()) && !isSameAsLast() || !targetElement()) || isCopying());
|
|
1526
1568
|
const progressVisible = solidJs.createMemo(() => isHoldingKeys() && showProgressIndicator() && hasValidMousePosition());
|
|
1527
1569
|
const crosshairVisible = solidJs.createMemo(() => isRendererActive() && !isDragging());
|
|
1528
1570
|
web.render(() => web.createComponent(ReactGrabRenderer, {
|
package/dist/index.global.js
CHANGED
|
@@ -6,25 +6,25 @@ var ReactGrab=(function(exports){'use strict';/**
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
var Mr=(e,t)=>e===t;var Pr=Symbol("solid-track"),ot={equals:Mr},wn=vn,ce=1,Ge=2,Sn={owned:null,cleanups:null,context:null,owner:null};var P=null,p=null,Ie=null,G=null,K=null,ee=null,st=0;function Ae(e,t){let n=G,r=P,o=e.length===0,i=t===void 0?r:t,s=o?Sn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>se(()=>ve(s)));P=s,G=null;try{return be(a,!0)}finally{G=n,P=r;}}function $(e,t){t=t?Object.assign({},ot,t):ot;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),xn(n,o));return [Cn.bind(n),r]}function ae(e,t,n){let r=At(e,t,false,ce);qe(r);}function ne(e,t,n){wn=jr;let r=At(e,t,false,ce);(r.user=true),ee?ee.push(r):qe(r);}function z(e,t,n){n=n?Object.assign({},ot,n):ot;let r=At(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,qe(r),Cn.bind(r)}function se(e){if(G===null)return e();let t=G;G=null;try{return Ie?Ie.untrack(e):e()}finally{G=t;}}function Ee(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let f=0;f<e.length;f++)a[f]=e[f]();}else a=e();let l=se(()=>t(a,o,s));return o=a,l}}function Tn(e){ne(()=>se(e));}function ue(e){return P===null||(P.cleanups===null?P.cleanups=[e]:P.cleanups.push(e)),e}$(false);function Cn(){let e=p;if(this.sources&&(this.state))if((this.state)===ce)qe(this);else {let t=K;K=null,be(()=>it(this),false),K=t;}if(G){let t=this.observers?this.observers.length:0;G.sources?(G.sources.push(this),G.sourceSlots.push(t)):(G.sources=[this],G.sourceSlots=[t]),this.observers?(this.observers.push(G),this.observerSlots.push(G.sources.length-1)):(this.observers=[G],this.observerSlots=[G.sources.length-1]);}return e&&p.sources.has(this)?this.tValue:this.value}function xn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&be(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=p&&p.running;s&&p.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?K.push(i):ee.push(i),i.observers&&En(i)),s?i.tState=ce:i.state=ce);}if(K.length>1e6)throw K=[],new Error},false);}return t}function qe(e){if(!e.fn)return;ve(e);let t=st;pn(e,e.value,t);}function pn(e,t,n){let r,o=P,i=G;G=P=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=ce,e.owned&&e.owned.forEach(ve),e.owned=null)),e.updatedAt=n+1,Ft(s)}finally{G=i,P=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?xn(e,r):e.value=r,e.updatedAt=n);}function At(e,t,n,r=ce,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:P,context:P?P.context:null,pure:n};if(P===null||P!==Sn&&(P.owned?P.owned.push(i):P.owned=[i]),Ie);return i}function Ue(e){let t=p;if((e.state)===0)return;if((e.state)===Ge)return it(e);if(e.suspense&&se(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<st);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===ce)qe(e);else if((e.state)===Ge){let o=K;K=null,be(()=>it(e,n[0]),false),K=o;}}}function be(e,t){if(K)return e();let n=false;t||(K=[]),ee?n=true:ee=[],st++;try{let r=e();return Hr(n),r}catch(r){n||(ee=null),K=null,Ft(r);}}function Hr(e){if(K&&(vn(K),K=null),e)return;let n=ee;ee=null,n.length&&be(()=>wn(n),false);}function vn(e){for(let t=0;t<e.length;t++)Ue(e[t]);}function jr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Ue(r);}for(t=0;t<n;t++)Ue(e[t]);}function it(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=o.state;i===ce?o!==t&&(!o.updatedAt||o.updatedAt<st)&&Ue(o):i===Ge&&it(o,t);}}}function En(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Ge,r.pure?K.push(r):ee.push(r),r.observers&&En(r));}}function ve(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)ve(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ve(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Vr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Ft(e,t=P){let r=Vr(e);throw r;}var Yr=Symbol("fallback");function yn(e){for(let t=0;t<e.length;t++)e[t]();}function Gr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return ue(()=>yn(i)),()=>{let l=e()||[],f=l.length,m,g;return l[Pr],se(()=>{let x,S,C,N,T,A,R,_,O;if(f===0)s!==0&&(yn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Yr],o[0]=Ae(L=>(i[0]=L,n.fallback())),s=1);else if(s===0){for(o=new Array(f),g=0;g<f;g++)r[g]=l[g],o[g]=Ae(b);s=f;}else {for(C=new Array(f),N=new Array(f),a&&(T=new Array(f)),A=0,R=Math.min(s,f);A<R&&r[A]===l[A];A++);for(R=s-1,_=f-1;R>=A&&_>=A&&r[R]===l[_];R--,_--)C[_]=o[R],N[_]=i[R],a&&(T[_]=a[R]);for(x=new Map,S=new Array(_+1),g=_;g>=A;g--)O=l[g],m=x.get(O),S[g]=m===void 0?-1:m,x.set(O,g);for(m=A;m<=R;m++)O=r[m],g=x.get(O),g!==void 0&&g!==-1?(C[g]=o[m],N[g]=i[m],a&&(T[g]=a[m]),g=S[g],x.set(O,g)):i[m]();for(g=A;g<f;g++)g in C?(o[g]=C[g],i[g]=N[g],a&&(a[g]=T[g],a[g](g))):o[g]=Ae(b);o=o.slice(0,s=f),r=l.slice(0);}return o});function b(x){if(i[g]=x,a){let[S,C]=$(g);return a[g]=C,t(l[g],S)}return t(l[g])}}}function k(e,t){return se(()=>e(t||{}))}var zr=e=>`Stale read from <${e}>.`;function at(e){let t="fallback"in e&&{fallback:()=>e.fallback};return z(Gr(()=>e.each,e.children,t||void 0))}function q(e){let t=e.keyed,n=z(()=>e.when,void 0,void 0),r=t?n:z(n,void 0,{equals:(o,i)=>!o==!i});return z(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?se(()=>i(t?o:()=>{if(!se(r))throw zr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Pe=e=>z(()=>e());function Wr(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,f=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){let m=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],m);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let m=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],m),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let m=f.get(t[s]);if(m!=null)if(a<m&&m<i){let g=s,b=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==m+b);)b++;if(b>m-a){let S=t[s];for(;a<m;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function Nn(e,t,n,r={}){let o;return Ae(i=>{o=i,t===document?e():ye(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function oe(e,t,n,r){let o,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(true);return s.cloneNode=s,s}function Kr(e,t,n){(e.removeAttribute(t));}function ct(e,t,n){if(!t)return n?Kr(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function pe(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Re(e,t,n){return se(()=>e(t,n))}function ye(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return lt(e,t,r,n);ae(o=>lt(e,t(),o,n),r);}function lt(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Me(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||s==="boolean"){n=Me(e,n,r);}else {if(s==="function")return ae(()=>{let l=t();for(;typeof l=="function";)l=l();n=lt(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if($t(l,t,n,o))return ae(()=>n=lt(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Me(e,n,r),a)return n}else f?n.length===0?On(e,l,r):Wr(e,n,l):(n&&Me(e),On(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Me(e,n,r,t);Me(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function $t(e,t,n,r){let o=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=$t(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=$t(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let m=String(a);l&&l.nodeType===3&&l.data===m?e.push(l):e.push(document.createTextNode(m));}}return o}function On(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Me(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=false;for(let s=t.length-1;s>=0;s--){let a=t[s];if(o!==a){let l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove();}else i=true;}}else e.insertBefore(o,n);return [o]}var Zr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Jr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Qr=e=>Array.isArray(e),eo=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&Jr(r)&&n){let a=e.composedPath()[0];a instanceof HTMLElement&&(o=a.tagName,i=a.role);}else r instanceof HTMLElement&&(o=r.tagName,i=r.role);return Qr(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},An=e=>eo(e,Zr);var Le="data-react-grab",Fn=()=>{let e=document.querySelector(`[${Le}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Le}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Le,"true"),t.style.zIndex="2147483646",t.style.position="fixed",t.style.top="0",t.style.left="0";let n=t.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute(Le,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var me=(e,t,n)=>e+(t-e)*n;var no=oe("<div>"),ut=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,m]=$(1),g=false,b=null,x=null,S=e.bounds,C=false,N=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,T=()=>{if(C)return;C=true;let _=()=>{let O=me(t(),S.x,N()),L=me(r(),S.y,N()),re=me(i(),S.width,N()),ie=me(a(),S.height,N());n(O),o(L),s(re),l(ie),Math.abs(O-S.x)<.5&&Math.abs(L-S.y)<.5&&Math.abs(re-S.width)<.5&&Math.abs(ie-S.height)<.5?(b=null,C=false):b=requestAnimationFrame(_);};b=requestAnimationFrame(_);};ne(Ee(()=>e.bounds,_=>{if(S=_,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}T();})),ne(()=>{e.variant==="grabbed"&&e.createdAt&&(x=window.setTimeout(()=>{m(0);},1500));}),ue(()=>{b!==null&&(cancelAnimationFrame(b),b=null),x!==null&&(window.clearTimeout(x),x=null),C=false;});let A={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},R=()=>e.variant==="drag"?{border:"1px dashed rgba(210, 57, 192, 0.4)","background-color":"rgba(210, 57, 192, 0.05)","will-change":"transform, width, height",contain:"layout paint size",cursor:"crosshair"}:{border:"1px solid rgb(210, 57, 192)","background-color":"rgba(210, 57, 192, 0.2)",transition:e.variant==="grabbed"?"opacity 0.3s ease-out":void 0};return k(q,{get when(){return e.visible!==false},get children(){var _=no();return ae(O=>ct(_,{...A,...R(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},O)),_}})};var ro=oe('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),$n=e=>{let t;return Tn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=ro(),r=t;return typeof r=="function"?Re(r,n):t=n,ae(o=>ct(n,{...e.style},o)),n})()};var ft=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,m=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:m,top:g}};var oo=oe("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),io=oe("<div style=margin-right:4px>Copied"),so=oe(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),ao=oe("<div style=margin-left:4px>to clipboard"),lo=oe(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),kt=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,m=null,g=false,b=()=>{s=me(s,l,.3),a=me(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?m=null:m=requestAnimationFrame(b);},x=()=>{m===null&&(m=requestAnimationFrame(b));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};ne(Ee(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);ue(()=>clearTimeout(A));}})),ne(()=>{S();}),ue(()=>{m!==null&&(cancelAnimationFrame(m),m=null);});let C=()=>i?.getBoundingClientRect(),N=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,R=window.innerHeight,_=[{left:Math.round(s)+14,top:Math.round(a)+14},{left:Math.round(s)-T.width-14,top:Math.round(a)+14},{left:Math.round(s)+14,top:Math.round(a)-T.height-14},{left:Math.round(s)-T.width-14,top:Math.round(a)-T.height-14}];for(let L of _){let re=L.left>=8&&L.left+T.width<=A-8,ie=L.top>=8&&L.top+T.height<=R-8;if(re&&ie)return L}let O=ft(_[0].left,_[0].top,T.width,T.height);return O.left+=4,O.top+=4,O};return k(q,{get when(){return e.visible!==false},get children(){var T=lo(),A=i;return typeof A=="function"?Re(A,T):i=T,ye(T,k(q,{get when(){return e.variant==="processing"},get children(){return k($n,{})}}),null),ye(T,k(q,{get when(){return e.variant==="success"},get children(){return oo()}}),null),ye(T,k(q,{get when(){return e.variant==="success"},get children(){return io()}}),null),ye(T,k(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),ye(T,k(q,{get when(){return e.variant!=="processing"},get children(){var R=so();return ye(R,()=>e.text),R}}),null),ye(T,k(q,{get when(){return e.variant==="success"},get children(){return ao()}}),null),ae(R=>{var _=`${N().top}px`,O=`${N().left}px`,L=e.zIndex?.toString()??"2147483647",re=t();return _!==R.e&&pe(T,"top",R.e=_),O!==R.t&&pe(T,"left",R.t=O),L!==R.a&&pe(T,"z-index",R.a=L),re!==R.o&&pe(T,"opacity",R.o=re),R},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var co=oe('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),uo=e=>{let[t,n]=$(0);return ne(Ee(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},In=e=>{let t=uo(e.visible),n,r=()=>{let o=n?.getBoundingClientRect();if(!o)return {left:e.mouseX,top:e.mouseY};let i=window.innerHeight,s=e.mouseX-o.width/2,a=e.mouseY+14+o.height+8>i?e.mouseY-o.height-14:e.mouseY+14;return ft(s,a,o.width,o.height)};return k(q,{get when(){return e.visible!==false},get children(){var o=co(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Re(a,o):n=o,ae(l=>{var f=`${r().top}px`,m=`${r().left}px`,g=t(),b=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&pe(o,"top",l.e=f),m!==l.t&&pe(o,"left",l.t=m),g!==l.a&&pe(o,"opacity",l.a=g),b!==l.o&&pe(s,"width",l.o=b),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var fo=oe("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),Mn=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,m=null,g=false,b=()=>{t&&(i=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,o=window.innerHeight,t.width=r*i,t.height=o*i,t.style.width=`${r}px`,t.style.height=`${o}px`,n=t.getContext("2d"),n&&n.scale(i,i));},x=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(s,0),n.lineTo(s,o),n.moveTo(0,a),n.lineTo(r,a),n.stroke());},S=()=>{s=me(s,l,.3),a=me(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?m=null:m=requestAnimationFrame(S);},C=()=>{m===null&&(m=requestAnimationFrame(S));},N=()=>{if(l=e.mouseX,f=e.mouseY,!g){s=l,a=f,g=true,x();return}C();};return ne(()=>{b(),x();let T=()=>{b(),x();};window.addEventListener("resize",T),ue(()=>{window.removeEventListener("resize",T),m!==null&&(cancelAnimationFrame(m),m=null);});}),ne(()=>{N();}),k(q,{get when(){return e.visible!==false},get children(){var T=fo(),A=t;return typeof A=="function"?Re(A,T):t=T,T}})};var Pn=e=>[k(q,{get when(){return Pe(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return k(ut,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),k(q,{get when(){return Pe(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return k(Mn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),k(q,{get when(){return Pe(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return k(ut,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),k(at,{get each(){return e.grabbedBoxes??[]},children:t=>k(ut,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),k(at,{get each(){return e.successLabels??[]},children:t=>k(kt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),k(q,{get when(){return Pe(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return k(kt,{get variant(){return e.labelVariant},get text(){return e.labelText},get x(){return e.labelX},get y(){return e.labelY},get visible(){return e.labelVisible},get zIndex(){return e.labelZIndex}})}}),k(q,{get when(){return Pe(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return k(In,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Hn="0.5.14",We=`bippy-${Hn}`,Ln=Object.defineProperty,mo=Object.prototype.hasOwnProperty,Xe=()=>{},Bn=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{}},It=(e=we())=>"getFiberRoots"in e,jn=false,Dn,ht=(e=we())=>jn?true:(typeof e.inject=="function"&&(Dn=e.inject.toString()),!!Dn?.includes("(injected)")),mt=new Set,Fe=new Set,Vn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:We,checkDCE:Bn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Fe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,mt.forEach(s=>s())),i},on:Xe,onCommitFiberRoot:Xe,onCommitFiberUnmount:Xe,onPostCommitFiberRoot:Xe,renderers:t,supportsFiber:true,supportsFlight:true};try{Ln(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(s){if(s&&typeof s=="object"){let a=r.renderers;r=s,a.size>0&&(a.forEach((l,f)=>{Fe.add(l),s.renderers.set(f,l);}),gt(e));}}});let o=window.hasOwnProperty,i=!1;Ln(window,"hasOwnProperty",{configurable:!0,value:function(...s){try{if(!i&&s[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,i=!0,-0}catch{}return o.apply(this,s)},writable:!0});}catch{gt(e);}return r},gt=e=>{e&&mt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Bn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=We,t._instrumentationIsActive=!1;let n=It(t);if(n||(t.on=Xe),t.renderers.size){t._instrumentationIsActive=!0,mt.forEach(i=>i());return}let r=t.inject,o=ht(t);o&&!n&&(jn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Fe.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,mt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||ht())&&e?.();}catch{}},Mt=()=>mo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),we=e=>Mt()?(gt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Vn(e),Yn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Pt=()=>{try{Yn()&&we();}catch{}};Pt();var pt=0,bt=1;var yt=5;var wt=11,Lt=13,Gn=14,St=15,Dt=16;var Ht=19;var Tt=26,Ct=27,Bt=28,jt=30;var Vt=e=>{switch(e.tag){case yt:case Tt:case Ct:return true;default:return typeof e.type=="string"}},Ke=e=>{switch(e.tag){case bt:case wt:case pt:case Gn:case St:return true;default:return false}};function De(e,t,n=false){return e&&t(e)instanceof Promise?Gt(e,t,n):Yt(e,t,n)}var Yt=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=Yt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Gt=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await Gt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Ut=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Ut(t.type||t.render):null},He=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=Ut(t);return r&&(r.displayName||r.name)||null};var zt=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let n of xt){let r=De(n.current,o=>{if(o===e)return true});if(r)return r}return e};var qt=e=>{let t=we(e.onActive);t._instrumentationSource=e.name??We;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let i=(s,a,l)=>{n!==i&&(n?.(s,a,l),e.onCommitFiberRoot?.(s,a,l));};t.onCommitFiberRoot=i;}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let i=(s,a)=>{t.onCommitFiberUnmount===i&&(r?.(s,a),e.onCommitFiberUnmount?.(s,a));};t.onCommitFiberUnmount=i;}let o=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let i=(s,a)=>{t.onPostCommitFiberRoot===i&&(o?.(s,a),e.onPostCommitFiberRoot?.(s,a));};t.onPostCommitFiberRoot=i;}return t},Ze=e=>{let t=we();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},xt=new Set;var Co=Object.create,Jn=Object.defineProperty,xo=Object.getOwnPropertyDescriptor,vo=Object.getOwnPropertyNames,Eo=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty,Oo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),No=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=vo(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Ro.call(e,a)&&a!==n&&Jn(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=xo(t,a))||r.enumerable});return e},_o=(e,t,n)=>(n=e==null?{}:Co(Eo(e)),No(Jn(n,"default",{value:e,enumerable:true}),e)),Ao=()=>{let e=we();for(let t of [...Array.from(Fe),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Un=e=>{for(let t of Fe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Se=e=>`
|
|
10
|
-
in ${e}`,
|
|
9
|
+
var Br=(e,t)=>e===t;var jr=Symbol("solid-track"),st={equals:Br},xn=Nn,de=1,Ye=2,vn={owned:null,cleanups:null,context:null,owner:null};var L=null,p=null,Me=null,V=null,K=null,te=null,lt=0;function ke(e,t){let n=V,r=L,o=e.length===0,i=t===void 0?r:t,s=o?vn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>le(()=>Ne(s)));L=s,V=null;try{return Ce(a,!0)}finally{V=n,L=r;}}function $(e,t){t=t?Object.assign({},st,t):st;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),On(n,o));return [Rn.bind(n),r]}function ce(e,t,n){let r=$t(e,t,false,de);ze(r);}function ne(e,t,n){xn=zr;let r=$t(e,t,false,de);(r.user=true),te?te.push(r):ze(r);}function U(e,t,n){n=n?Object.assign({},st,n):st;let r=$t(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ze(r),Rn.bind(r)}function le(e){if(V===null)return e();let t=V;V=null;try{return Me?Me.untrack(e):e()}finally{V=t;}}function _e(e,t,n){let r=Array.isArray(e),o;return s=>{let a;if(r){a=Array(e.length);for(let f=0;f<e.length;f++)a[f]=e[f]();}else a=e();let l=le(()=>t(a,o,s));return o=a,l}}function En(e){ne(()=>le(e));}function me(e){return L===null||(L.cleanups===null?L.cleanups=[e]:L.cleanups.push(e)),e}$(false);function Rn(){let e=p;if(this.sources&&(this.state))if((this.state)===de)ze(this);else {let t=K;K=null,Ce(()=>at(this),false),K=t;}if(V){let t=this.observers?this.observers.length:0;V.sources?(V.sources.push(this),V.sourceSlots.push(t)):(V.sources=[this],V.sourceSlots=[t]),this.observers?(this.observers.push(V),this.observerSlots.push(V.sources.length-1)):(this.observers=[V],this.observerSlots=[V.sources.length-1]);}return e&&p.sources.has(this)?this.tValue:this.value}function On(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&Ce(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=p&&p.running;s&&p.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?K.push(i):te.push(i),i.observers&&_n(i)),s?i.tState=de:i.state=de);}if(K.length>1e6)throw K=[],new Error},false);}return t}function ze(e){if(!e.fn)return;Ne(e);let t=lt;Sn(e,e.value,t);}function Sn(e,t,n){let r,o=L,i=V;V=L=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=de,e.owned&&e.owned.forEach(Ne),e.owned=null)),e.updatedAt=n+1,kt(s)}finally{V=i,L=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?On(e,r):e.value=r,e.updatedAt=n);}function $t(e,t,n,r=de,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:L,context:L?L.context:null,pure:n};if(L===null||L!==vn&&(L.owned?L.owned.push(i):L.owned=[i]),Me);return i}function Ge(e){let t=p;if((e.state)===0)return;if((e.state)===Ye)return at(e);if(e.suspense&&le(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<lt);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===de)ze(e);else if((e.state)===Ye){let o=K;K=null,Ce(()=>at(e,n[0]),false),K=o;}}}function Ce(e,t){if(K)return e();let n=false;t||(K=[]),te?n=true:te=[],lt++;try{let r=e();return Gr(n),r}catch(r){n||(te=null),K=null,kt(r);}}function Gr(e){if(K&&(Nn(K),K=null),e)return;let n=te;te=null,n.length&&Ce(()=>xn(n),false);}function Nn(e){for(let t=0;t<e.length;t++)Ge(e[t]);}function zr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:Ge(r);}for(t=0;t<n;t++)Ge(e[t]);}function at(e,t){e.state=0;for(let r=0;r<e.sources.length;r+=1){let o=e.sources[r];if(o.sources){let i=o.state;i===de?o!==t&&(!o.updatedAt||o.updatedAt<lt)&&Ge(o):i===Ye&&at(o,t);}}}function _n(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=Ye,r.pure?K.push(r):te.push(r),r.observers&&_n(r));}}function Ne(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let i=o.pop(),s=n.observerSlots.pop();r<o.length&&(i.sourceSlots[s]=r,o[r]=i,n.observerSlots[r]=s);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ne(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ne(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function qr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function kt(e,t=L){let r=qr(e);throw r;}var Xr=Symbol("fallback");function Cn(e){for(let t=0;t<e.length;t++)e[t]();}function Wr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return me(()=>Cn(i)),()=>{let l=e()||[],f=l.length,h,g;return l[jr],le(()=>{let x,S,C,N,T,A,R,_,O;if(f===0)s!==0&&(Cn(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Xr],o[0]=ke(D=>(i[0]=D,n.fallback())),s=1);else if(s===0){for(o=new Array(f),g=0;g<f;g++)r[g]=l[g],o[g]=ke(b);s=f;}else {for(C=new Array(f),N=new Array(f),a&&(T=new Array(f)),A=0,R=Math.min(s,f);A<R&&r[A]===l[A];A++);for(R=s-1,_=f-1;R>=A&&_>=A&&r[R]===l[_];R--,_--)C[_]=o[R],N[_]=i[R],a&&(T[_]=a[R]);for(x=new Map,S=new Array(_+1),g=_;g>=A;g--)O=l[g],h=x.get(O),S[g]=h===void 0?-1:h,x.set(O,g);for(h=A;h<=R;h++)O=r[h],g=x.get(O),g!==void 0&&g!==-1?(C[g]=o[h],N[g]=i[h],a&&(T[g]=a[h]),g=S[g],x.set(O,g)):i[h]();for(g=A;g<f;g++)g in C?(o[g]=C[g],i[g]=N[g],a&&(a[g]=T[g],a[g](g))):o[g]=ke(b);o=o.slice(0,s=f),r=l.slice(0);}return o});function b(x){if(i[g]=x,a){let[S,C]=$(g);return a[g]=C,t(l[g],S)}return t(l[g])}}}function k(e,t){return le(()=>e(t||{}))}var Zr=e=>`Stale read from <${e}>.`;function ct(e){let t="fallback"in e&&{fallback:()=>e.fallback};return U(Wr(()=>e.each,e.children,t||void 0))}function q(e){let t=e.keyed,n=U(()=>e.when,void 0,void 0),r=t?n:U(n,void 0,{equals:(o,i)=>!o==!i});return U(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?le(()=>i(t?o:()=>{if(!le(r))throw Zr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Le=e=>U(()=>e());function eo(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,f=null;for(;s<o||a<i;){if(t[s]===n[a]){s++,a++;continue}for(;t[o-1]===n[i-1];)o--,i--;if(o===s){let h=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],h);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let h=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],h),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let h=f.get(t[s]);if(h!=null)if(a<h&&h<i){let g=s,b=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==h+b);)b++;if(b>h-a){let S=t[s];for(;a<h;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function $n(e,t,n,r={}){let o;return ke(i=>{o=i,t===document?e():xe(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function ie(e,t,n,r){let o,i=()=>{let a=document.createElement("template");return a.innerHTML=e,a.content.firstChild},s=()=>(o||(o=i())).cloneNode(true);return s.cloneNode=s,s}function to(e,t,n){(e.removeAttribute(t));}function ft(e,t,n){if(!t)return n?to(e,"style"):t;let r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let o,i;for(i in n)t[i]==null&&r.removeProperty(i),delete n[i];for(i in t)o=t[i],o!==n[i]&&(r.setProperty(i,o),n[i]=o);return n}function be(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t);}function Ae(e,t,n){return le(()=>e(t,n))}function xe(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return ut(e,t,r,n);ce(o=>ut(e,t(),o,n),r);}function ut(e,t,n,r,o){for(;typeof n=="function";)n=n();if(t===n)return n;let s=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,s==="string"||s==="number"){if(s==="number"&&(t=t.toString(),t===n))return n;if(a){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=Pe(e,n,r,l);}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t;}else if(t==null||s==="boolean"){n=Pe(e,n,r);}else {if(s==="function")return ce(()=>{let l=t();for(;typeof l=="function";)l=l();n=ut(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(It(l,t,n,o))return ce(()=>n=ut(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Pe(e,n,r),a)return n}else f?n.length===0?Fn(e,l,r):eo(e,n,l):(n&&Pe(e),Fn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=Pe(e,n,r,t);Pe(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function It(e,t,n,r){let o=false;for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n&&n[e.length],f;if(!(a==null||a===true||a===false))if((f=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=It(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=It(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let h=String(a);l&&l.nodeType===3&&l.data===h?e.push(l):e.push(document.createTextNode(h));}}return o}function Fn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function Pe(e,t,n,r){if(n===void 0)return e.textContent="";let o=r||document.createTextNode("");if(t.length){let i=false;for(let s=t.length-1;s>=0;s--){let a=t[s];if(o!==a){let l=a.parentNode===e;!i&&!s?l?e.replaceChild(o,a):e.insertBefore(o,n):l&&a.remove();}else i=true;}}else e.insertBefore(o,n);return [o]}var no=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],ro=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),oo=e=>Array.isArray(e),io=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&ro(r)&&n){let a=e.composedPath()[0];a instanceof HTMLElement&&(o=a.tagName,i=a.role);}else r instanceof HTMLElement&&(o=r.tagName,i=r.role);return oo(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},In=e=>io(e,no);var De="data-react-grab",Mn=()=>{let e=document.querySelector(`[${De}]`);if(e){let i=e.shadowRoot?.querySelector(`[${De}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(De,"true"),t.style.zIndex="2147483646",t.style.position="fixed",t.style.top="0",t.style.left="0";let n=t.attachShadow({mode:"open"}),r=document.createElement("div");return r.setAttribute(De,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var ge=(e,t,n)=>e+(t-e)*n;var ao=ie("<div>"),dt=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,h]=$(1),g=false,b=null,x=null,S=e.bounds,C=false,N=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,T=()=>{if(C)return;C=true;let _=()=>{let O=ge(t(),S.x,N()),D=ge(r(),S.y,N()),re=ge(i(),S.width,N()),se=ge(a(),S.height,N());n(O),o(D),s(re),l(se),Math.abs(O-S.x)<.5&&Math.abs(D-S.y)<.5&&Math.abs(re-S.width)<.5&&Math.abs(se-S.height)<.5?(b=null,C=false):b=requestAnimationFrame(_);};b=requestAnimationFrame(_);};ne(_e(()=>e.bounds,_=>{if(S=_,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}T();})),ne(()=>{e.variant==="grabbed"&&e.createdAt&&(x=window.setTimeout(()=>{h(0);},1500));}),me(()=>{b!==null&&(cancelAnimationFrame(b),b=null),x!==null&&(window.clearTimeout(x),x=null),C=false;});let A={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},R=()=>e.variant==="drag"?{border:"1px dashed rgba(210, 57, 192, 0.4)","background-color":"rgba(210, 57, 192, 0.05)","will-change":"transform, width, height",contain:"layout paint size",cursor:"crosshair"}:{border:"1px solid rgb(210, 57, 192)","background-color":"rgba(210, 57, 192, 0.2)",transition:e.variant==="grabbed"?"opacity 0.3s ease-out":void 0};return k(q,{get when(){return e.visible!==false},get children(){var _=ao();return ce(O=>ft(_,{...A,...R(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},O)),_}})};var lo=ie('<span style="display:inline-block;width:8px;height:8px;border:1.5px solid rgb(210, 57, 192);border-top-color:transparent;border-radius:50%;margin-right:4px;vertical-align:middle">'),Pn=e=>{let t;return En(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=lo(),r=t;return typeof r=="function"?Ae(r,n):t=n,ce(o=>ft(n,{...e.style},o)),n})()};var mt=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,h=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:h,top:g}};var co=ie("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),uo=ie("<div style=margin-right:4px>Copied"),fo=ie(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),mo=ie("<div style=margin-left:4px>to clipboard"),ho=ie(`<div style="position:fixed;padding:2px 6px;background-color:#fde7f7;color:#b21c8e;border:1px solid #f7c5ec;border-radius:4px;font-size:11px;font-weight:500;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;pointer-events:none;transition:opacity 0.2s ease-in-out;display:flex;align-items:center;max-width:calc(100vw - (16px + env(safe-area-inset-left) + env(safe-area-inset-right)));overflow:hidden;text-overflow:ellipsis;white-space:nowrap">`),Mt=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,h=null,g=false,b=()=>{s=ge(s,l,.3),a=ge(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?h=null:h=requestAnimationFrame(b);},x=()=>{h===null&&(h=requestAnimationFrame(b));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};ne(_e(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);me(()=>clearTimeout(A));}})),ne(()=>{S();}),me(()=>{h!==null&&(cancelAnimationFrame(h),h=null);});let C=()=>i?.getBoundingClientRect(),N=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,R=window.innerHeight,_=[{left:Math.round(s)+14,top:Math.round(a)+14},{left:Math.round(s)-T.width-14,top:Math.round(a)+14},{left:Math.round(s)+14,top:Math.round(a)-T.height-14},{left:Math.round(s)-T.width-14,top:Math.round(a)-T.height-14}];for(let D of _){let re=D.left>=8&&D.left+T.width<=A-8,se=D.top>=8&&D.top+T.height<=R-8;if(re&&se)return D}let O=mt(_[0].left,_[0].top,T.width,T.height);return O.left+=4,O.top+=4,O};return k(q,{get when(){return e.visible!==false},get children(){var T=ho(),A=i;return typeof A=="function"?Ae(A,T):i=T,xe(T,k(q,{get when(){return e.variant==="processing"},get children(){return k(Pn,{})}}),null),xe(T,k(q,{get when(){return e.variant==="success"},get children(){return co()}}),null),xe(T,k(q,{get when(){return e.variant==="success"},get children(){return uo()}}),null),xe(T,k(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),xe(T,k(q,{get when(){return e.variant!=="processing"},get children(){var R=fo();return xe(R,()=>e.text),R}}),null),xe(T,k(q,{get when(){return e.variant==="success"},get children(){return mo()}}),null),ce(R=>{var _=`${N().top}px`,O=`${N().left}px`,D=e.zIndex?.toString()??"2147483647",re=t();return _!==R.e&&be(T,"top",R.e=_),O!==R.t&&be(T,"left",R.t=O),D!==R.a&&be(T,"z-index",R.a=D),re!==R.o&&be(T,"opacity",R.o=re),R},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var go=ie('<div style="position:fixed;z-index:2147483647;pointer-events:none;transition:opacity 0.1s ease-in-out"><div style="width:32px;height:2px;background-color:rgba(178, 28, 142, 0.2);border-radius:1px;overflow:hidden;position:relative"><div style="height:100%;background-color:#b21c8e;border-radius:1px;transition:width 0.05s cubic-bezier(0.165, 0.84, 0.44, 1)">'),po=e=>{let[t,n]=$(0);return ne(_e(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},Dn=e=>{let t=po(e.visible),n,r=()=>{let o=n?.getBoundingClientRect();if(!o)return {left:e.mouseX,top:e.mouseY};let i=window.innerHeight,s=e.mouseX-o.width/2,a=e.mouseY+14+o.height+8>i?e.mouseY-o.height-14:e.mouseY+14;return mt(s,a,o.width,o.height)};return k(q,{get when(){return e.visible!==false},get children(){var o=go(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Ae(a,o):n=o,ce(l=>{var f=`${r().top}px`,h=`${r().left}px`,g=t(),b=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&be(o,"top",l.e=f),h!==l.t&&be(o,"left",l.t=h),g!==l.a&&be(o,"opacity",l.a=g),b!==l.o&&be(s,"width",l.o=b),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var bo=ie("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),Hn=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,h=null,g=false,b=()=>{t&&(i=Math.max(window.devicePixelRatio||1,2),r=window.innerWidth,o=window.innerHeight,t.width=r*i,t.height=o*i,t.style.width=`${r}px`,t.style.height=`${o}px`,n=t.getContext("2d"),n&&n.scale(i,i));},x=()=>{n&&(n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath(),n.moveTo(s,0),n.lineTo(s,o),n.moveTo(0,a),n.lineTo(r,a),n.stroke());},S=()=>{s=ge(s,l,.3),a=ge(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?h=null:h=requestAnimationFrame(S);},C=()=>{h===null&&(h=requestAnimationFrame(S));},N=()=>{if(l=e.mouseX,f=e.mouseY,!g){s=l,a=f,g=true,x();return}C();};return ne(()=>{b(),x();let T=()=>{b(),x();};window.addEventListener("resize",T),me(()=>{window.removeEventListener("resize",T),h!==null&&(cancelAnimationFrame(h),h=null);});}),ne(()=>{N();}),k(q,{get when(){return e.visible!==false},get children(){var T=bo(),A=t;return typeof A=="function"?Ae(A,T):t=T,T}})};var Bn=e=>[k(q,{get when(){return Le(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return k(dt,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),k(q,{get when(){return Le(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return k(Hn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),k(q,{get when(){return Le(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return k(dt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),k(ct,{get each(){return e.grabbedBoxes??[]},children:t=>k(dt,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),k(ct,{get each(){return e.successLabels??[]},children:t=>k(Mt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),k(q,{get when(){return Le(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return k(Mt,{get variant(){return e.labelVariant},get text(){return e.labelText},get x(){return e.labelX},get y(){return e.labelY},get visible(){return e.labelVisible},get zIndex(){return e.labelZIndex}})}}),k(q,{get when(){return Le(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return k(Dn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Yn="0.5.14",Xe=`bippy-${Yn}`,jn=Object.defineProperty,yo=Object.prototype.hasOwnProperty,qe=()=>{},Gn=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{}},Pt=(e=ve())=>"getFiberRoots"in e,Un=false,Vn,pt=(e=ve())=>Un?true:(typeof e.inject=="function"&&(Vn=e.inject.toString()),!!Vn?.includes("(injected)")),gt=new Set,Ie=new Set,zn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Xe,checkDCE:Gn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Ie.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,gt.forEach(s=>s())),i},on:qe,onCommitFiberRoot:qe,onCommitFiberUnmount:qe,onPostCommitFiberRoot:qe,renderers:t,supportsFiber:true,supportsFlight:true};try{jn(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(s){if(s&&typeof s=="object"){let a=r.renderers;r=s,a.size>0&&(a.forEach((l,f)=>{Ie.add(l),s.renderers.set(f,l);}),bt(e));}}});let o=window.hasOwnProperty,i=!1;jn(window,"hasOwnProperty",{configurable:!0,value:function(...s){try{if(!i&&s[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,i=!0,-0}catch{}return o.apply(this,s)},writable:!0});}catch{bt(e);}return r},bt=e=>{e&>.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Gn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Xe,t._instrumentationIsActive=!1;let n=Pt(t);if(n||(t.on=qe),t.renderers.size){t._instrumentationIsActive=!0,gt.forEach(i=>i());return}let r=t.inject,o=pt(t);o&&!n&&(Un=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return Ie.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,gt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||pt())&&e?.();}catch{}},Lt=()=>yo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),ve=e=>Lt()?(bt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):zn(e),qn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Dt=()=>{try{qn()&&ve();}catch{}};Dt();var yt=0,wt=1;var St=5;var Tt=11,Ht=13,Xn=14,Ct=15,Bt=16;var jt=19;var xt=26,vt=27,Vt=28,Yt=30;var Gt=e=>{switch(e.tag){case St:case xt:case vt:return true;default:return typeof e.type=="string"}},We=e=>{switch(e.tag){case wt:case Tt:case yt:case Xn:case Ct:return true;default:return false}};function He(e,t,n=false){return e&&t(e)instanceof Promise?zt(e,t,n):Ut(e,t,n)}var Ut=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=Ut(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},zt=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await zt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var qt=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?qt(t.type||t.render):null},Be=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=qt(t);return r&&(r.displayName||r.name)||null};var Xt=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let n of Et){let r=He(n.current,o=>{if(o===e)return true});if(r)return r}return e};var Wt=e=>{let t=ve(e.onActive);t._instrumentationSource=e.name??Xe;let n=t.onCommitFiberRoot;if(e.onCommitFiberRoot){let i=(s,a,l)=>{n!==i&&(n?.(s,a,l),e.onCommitFiberRoot?.(s,a,l));};t.onCommitFiberRoot=i;}let r=t.onCommitFiberUnmount;if(e.onCommitFiberUnmount){let i=(s,a)=>{t.onCommitFiberUnmount===i&&(r?.(s,a),e.onCommitFiberUnmount?.(s,a));};t.onCommitFiberUnmount=i;}let o=t.onPostCommitFiberRoot;if(e.onPostCommitFiberRoot){let i=(s,a)=>{t.onPostCommitFiberRoot===i&&(o?.(s,a),e.onPostCommitFiberRoot?.(s,a));};t.onPostCommitFiberRoot=i;}return t},Ke=e=>{let t=ve();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},Et=new Set;var Oo=Object.create,nr=Object.defineProperty,No=Object.getOwnPropertyDescriptor,_o=Object.getOwnPropertyNames,Ao=Object.getPrototypeOf,Fo=Object.prototype.hasOwnProperty,$o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ko=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=_o(t),i=0,s=o.length,a;i<s;i++)a=o[i],!Fo.call(e,a)&&a!==n&&nr(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=No(t,a))||r.enumerable});return e},Io=(e,t,n)=>(n=e==null?{}:Oo(Ao(e)),ko(nr(n,"default",{value:e,enumerable:true}),e)),Mo=()=>{let e=ve();for(let t of [...Array.from(Ie),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},Wn=e=>{for(let t of Ie){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Ee=e=>`
|
|
10
|
+
in ${e}`,Po=(e,t)=>{let n=Ee(e);return t&&(n+=` (at ${t})`),n},Kt=false,Zt=(e,t)=>{if(!e||Kt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Kt=true;let r=Mo();Wn(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let b;try{if(t){let x=function(){throw Error()};if(Object.defineProperty(x.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(x,[]);}catch(S){b=S;}Reflect.construct(e,[],x);}else {try{x.call();}catch(S){b=S;}e.call(x.prototype);}}else {try{throw Error()}catch(S){b=S;}let x=e();x&&typeof x.catch=="function"&&x.catch(()=>{});}}catch(x){if(x instanceof Error&&b instanceof Error&&typeof x.stack=="string")return [x.stack,b.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[h,g]=l.DetermineComponentFrameRoot();if(h&&g){let b=h.split(`
|
|
11
11
|
`),x=g.split(`
|
|
12
12
|
`),S=0,C=0;for(;S<b.length&&!b[S].includes("DetermineComponentFrameRoot");)S++;for(;C<x.length&&!x[C].includes("DetermineComponentFrameRoot");)C++;if(S===b.length||C===x.length)for(S=b.length-1,C=x.length-1;S>=1&&C>=0&&b[S]!==x[C];)C--;for(;S>=1&&C>=0;S--,C--)if(b[S]!==x[C]){if(S!==1||C!==1)do if(S--,C--,C<0||b[S]!==x[C]){let N=`
|
|
13
|
-
${b[S].replace(" at new "," at ")}`,T=
|
|
13
|
+
${b[S].replace(" at new "," at ")}`,T=Be(e);return T&&N.includes("<anonymous>")&&(N=N.replace("<anonymous>",T)),N}while(S>=1&&C>=0);break}}}finally{Kt=false,Error.prepareStackTrace=n,Wn(r),console.error=o,console.warn=i;}let s=e?Be(e):"";return s?Ee(s):""},Lo=(e,t)=>{let n=e.tag,r="";switch(n){case Vt:r=Ee("Activity");break;case wt:r=Zt(e.type,true);break;case Tt:r=Zt(e.type.render,false);break;case yt:case Ct:r=Zt(e.type,false);break;case St:case xt:case vt:r=Ee(e.type);break;case Bt:r=Ee("Lazy");break;case Ht:r=e.child!==t&&t!==null?Ee("Suspense Fallback"):Ee("Suspense");break;case jt:r=Ee("SuspenseList");break;case Yt:r=Ee("ViewTransition");break;default:return ""}return r},Do=e=>{try{let t="",n=e,r=null;do{t+=Lo(n,r);let o=n._debugInfo;if(o&&Array.isArray(o))for(let i=o.length-1;i>=0;i--){let s=o[i];typeof s.name=="string"&&(t+=Po(s.name,s.env));}r=n,n=n.return;}while(n);return t}catch(t){return t instanceof Error?`
|
|
14
14
|
Error generating stack: ${t.message}
|
|
15
|
-
${t.stack}`:""}},
|
|
15
|
+
${t.stack}`:""}},Ho=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
|
|
16
16
|
`)&&(n=n.slice(29));let r=n.indexOf(`
|
|
17
17
|
`);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(`
|
|
18
|
-
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},
|
|
19
|
-
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=
|
|
20
|
-
`).filter(r=>!!r.match(
|
|
21
|
-
`).filter(r=>!r.match(
|
|
22
|
-
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Ho);s&&(r=s[1]||s[2]);}if(!r)return null;let o=rr.test(r);if(!(Do.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Yo=e=>({file:e.file,mappings:(0, nr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Go=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, nr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Wn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(rr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Uo=async(e,t=fetch)=>{if(!Wn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Vo(e,n);if(!r||!Wn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Go(i):Yo(i)}catch{return null}},zo=async(e,t=true,n)=>{if(t&&Je.has(e)){let i=Je.get(e);if(i==null)return null;if(Bo(i)){let s=i.deref();if(s)return s;Je.delete(e);}else return i}if(t&&vt.has(e))return vt.get(e);let r=Uo(e,n);t&&vt.set(e,r);let o=await r;return t&&vt.delete(e),t&&(o===null?Je.set(e,null):Je.set(e,or?new WeakRef(o):o)),o},Kn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,qo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Zn="about://React/",Xo=["<anonymous>","eval",""],Wo=/\.(jsx|tsx|ts|js)$/,Ko=/(\.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,Zo=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,Jo=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",Qo=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":false},ei=async(e,t=true,n)=>{if(Qo(e))return e._debugSource||null;let r=ir(e);return sr(r,void 0,t,n)},ir=e=>Jo(e)?Io(e._debugStack.stack):ko(e),ti=async(e,t=true,n)=>{let r=await sr(e,1,t,n);return !r||r.length===0?null:r[0]},sr=async(e,t=1,n=true,r)=>{let o=er(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await zo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=jo(a,s.line,s.col);if(l){i.push(l);continue}}i.push({fileName:s.file,lineNumber:s.line,columnNumber:s.col,functionName:s.function});}return i},Be=e=>{if(!e||Xo.includes(e))return "";let t=e;if(t.startsWith(Zn)){let r=t.slice(Zn.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of qo)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(Kn.test(t)){let r=t.match(Kn);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);Zo.test(r)&&(t=t.slice(0,n));}return t},Zt=e=>{let t=Be(e);return !(!t||!Wo.test(t)||Ko.test(t))},ni=async(e,t=true,n)=>{let r=De(e,s=>{if(Ke(s))return true},true);if(r){let s=await ei(r,t,n);if(s?.fileName){let a=Be(s.fileName);if(Zt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=er(ir(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await ti(s.raw,t,n);if(a)return {fileName:Be(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:Be(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},ar=async(e,t=true,n)=>{let r=Ze(e);if(!r||!Vt(r))return null;let o=zt(r);return o?ni(o,t,n):null};var ri=new Set(["role","name","aria-label","rel","href"]);function oi(e,t){let n=ri.has(e);n||=e.startsWith("data-")&&Qe(e);let r=Qe(t)&&t.length<100;return r||=t.startsWith("#")&&Qe(t.slice(1)),n&&r}function ii(e){return Qe(e)}function si(e){return Qe(e)}function ai(e){return true}function cr(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ii,className:si,tagName:ai,attr:oi,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=di(o.root,n),s,a=0;for(let f of li(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=ui(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return et(g)}if(a++,en(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...dr(s,e,o,i,r)];return l.sort(Jt),l.length>0?et(l[0]):et(s)}function*li(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=ci(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...fr(r)),s>=t.seedMinLength){o.sort(Jt);for(let l of o)yield l;o=[];}}o.sort(Jt);for(let a of o)yield a;}function Qe(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function ci(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let s=0;s<e.classList.length;s++){let a=e.classList[s];t.className(a)&&n.push({name:"."+CSS.escape(a),penalty:1});}for(let s=0;s<e.attributes.length;s++){let a=e.attributes[s];t.attr(a.name,a.value)&&n.push({name:`[${CSS.escape(a.name)}="${CSS.escape(a.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let s=Qt(e,o);s!==void 0&&n.push({name:ur(o,s),penalty:10});}let i=Qt(e);return i!==void 0&&n.push({name:fi(o,i),penalty:50}),n}function et(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function lr(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function Jt(e,t){return lr(e)-lr(t)}function Qt(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function ui(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=Qt(r,i);if(s===void 0)return;o.push({name:ur(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(en(o,t))return o}function fi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function ur(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*fr(e,t=[]){if(e.length>0)for(let n of e[0])yield*fr(e.slice(1,e.length),t.concat(n));else yield t;}function di(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function en(e,t){let n=et(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*dr(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let i=1;i<e.length-1;i++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let a=[...e];a.splice(i,1),en(a,r)&&r.querySelector(et(a))===t&&(yield a,yield*dr(a,t,n,r,o));}}qt({onCommitFiberRoot(e,t){xt.add(t);}});var mi=e=>cr(e),tn=async e=>{let t=(u,c)=>u.length>c?`${u.substring(0,c)}...`:u,n=u=>!!(u.startsWith("_")||u.includes("Provider")&&u.includes("Context")),r=u=>{let c=Ze(u);if(!c)return null;let d=null;return De(c,y=>{if(Ke(y)){let E=He(y);if(E&&!n(E))return d=E,true}return false},true),d},o=async u=>{let c=await ar(u);if(!c)return null;let d=Be(c.fileName);return Zt(d)?`${d}:${c.lineNumber}:${c.columnNumber}`:null},i=new Set(["article","aside","footer","form","header","main","nav","section"]),s=u=>{let c=u.tagName.toLowerCase();if(i.has(c)||u.id)return true;if(u.className&&typeof u.className=="string"){let d=u.className.trim();if(d&&d.length>0)return true}return Array.from(u.attributes).some(d=>d.name.startsWith("data-"))},a=(u,c=10)=>{let d=[],y=u.parentElement,E=0;for(;y&&E<c&&y.tagName!=="BODY"&&!(s(y)&&(d.push(y),d.length>=3));)y=y.parentElement,E++;return d.reverse()},l=(u,c=false)=>{let d=u.tagName.toLowerCase(),y=[];if(u.id&&y.push(`id="${u.id}"`),u.className&&typeof u.className=="string"){let M=u.className.trim().split(/\s+/);if(M.length>0&&M[0]){let B=c?M.slice(0,3):M,H=t(B.join(" "),30);y.push(`class="${H}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),D=c?E.slice(0,1):E;for(let M of D)y.push(`${M.name}="${t(M.value,20)}"`);let I=u.getAttribute("aria-label");return I&&!c&&y.push(`aria-label="${t(I,20)}"`),y.length>0?`<${d} ${y.join(" ")}>`:`<${d}>`},f=u=>`</${u.tagName.toLowerCase()}>`,m=u=>{let c=(u.textContent||"").trim().replace(/\s+/g," ");return t(c,60)},g=u=>{if(u.id)return `#${u.id}`;if(u.className&&typeof u.className=="string"){let c=u.className.trim().split(/\s+/);if(c.length>0&&c[0])return `.${c[0]}`}return null},b=[],x=mi(e);b.push(`- selector: ${x}`);let S=e.getBoundingClientRect();b.push(`- width: ${Math.round(S.width)}`),b.push(`- height: ${Math.round(S.height)}`),b.push("HTML snippet:"),b.push("```html");let C=a(e),N=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),R=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),d=N[u],y=A[u];d&&y&&(u===0||N[u-1]!==d)&&b.push(`${c}<${d} source="${y}">`),b.push(`${c}${l(C[u],true)}`);}let _=e.parentElement,O=-1;if(_){let u=Array.from(_.children);if(O=u.indexOf(e),O>0){let c=u[O-1];if(g(c)&&O<=2){let y=" ".repeat(C.length);b.push(`${y} ${l(c,true)}`),b.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(O>0){let y=" ".repeat(C.length);b.push(`${y} ... (${O} element${O===1?"":"s"})`);}}}let L=" ".repeat(C.length),re=C.length>0?N[N.length-1]:null,ie=T&&R&&T!==re;ie&&b.push(`${L} <${T} used-at="${R}">`),b.push(`${L} <!-- IMPORTANT: selected element -->`);let le=m(e),Te=e.children.length,w=`${L}${ie?" ":" "}`;if(le&&Te===0&&le.length<40?b.push(`${w}${l(e)}${le}${f(e)}`):(b.push(`${w}${l(e)}`),le&&b.push(`${w} ${le}`),Te>0&&b.push(`${w} ... (${Te} element${Te===1?"":"s"})`),b.push(`${w}${f(e)}`)),ie&&b.push(`${L} </${T}>`),_&&O>=0){let u=Array.from(_.children),c=u.length-O-1;if(c>0){let d=u[O+1];g(d)&&c<=2?(b.push(`${L} ${l(d,true)}`),b.push(`${L} </${d.tagName.toLowerCase()}>`)):b.push(`${L} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);b.push(`${c}${f(C[u])}`);let d=N[u],y=A[u];d&&y&&(u===C.length-1||N[u+1]!==d)&&b.push(`${c}</${d}>`);}return b.push("```"),b.join(`
|
|
23
|
-
`)};var
|
|
24
|
-
${
|
|
25
|
-
</selected_element>`,
|
|
18
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},Bo=/(^|@)\S+:\d+/,rr=/^\s*at .*(\S+:\d+|\(native\))/m,jo=/^(eval@)?(\[native code\])?$/;var or=(e,t)=>{if(t?.includeInElement!==false){let n=e.split(`
|
|
19
|
+
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let i=Kn(o,void 0)[0];i&&r.push(i);}else if(/^\s*in\s+/.test(o)){let i=o.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");r.push({function:i,raw:o});}else if(o.match(Bo)){let i=Zn(o,void 0)[0];i&&r.push(i);}return Jt(r,t)}return e.match(rr)?Kn(e,t):Zn(e,t)},ir=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t=/(.+?)(?::(\d+))?(?::(\d+))?$/,n=t.exec(e.replace(/[()]/g,""));return [n[1],n[2]||void 0,n[3]||void 0]},Jt=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e;var Kn=(e,t)=>Jt(e.split(`
|
|
20
|
+
`).filter(r=>!!r.match(rr)),t).map(r=>{let o=r;o.includes("(eval ")&&(o=o.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let i=o.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=i.match(/ (\(.+\)$)/);i=s?i.replace(s[0],""):i;let a=ir(s?s[1]:i),l=s&&i||void 0,f=["eval","<anonymous>"].includes(a[0])?void 0:a[0];return {function:l,file:f,line:a[1]?+a[1]:void 0,col:a[2]?+a[2]:void 0,raw:o}});var Zn=(e,t)=>Jt(e.split(`
|
|
21
|
+
`).filter(r=>!r.match(jo)),t).map(r=>{let o=r;if(o.includes(" > eval")&&(o=o.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!o.includes("@")&&!o.includes(":"))return {function:o};{let i=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=o.match(i),a=s&&s[1]?s[1]:void 0,l=ir(o.replace(i,""));return {function:a,file:l[0],line:l[1]?+l[1]:void 0,col:l[2]?+l[2]:void 0,raw:o}}});var Vo=$o((e,t)=>{(function(n,r){typeof e=="object"&&t!==void 0?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.sourcemapCodec={}));})(void 0,function(n){let r=44,o=59,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=new Uint8Array(64),a=new Uint8Array(128);for(let w=0;w<i.length;w++){let u=i.charCodeAt(w);s[w]=u,a[u]=w;}function l(w,u){let c=0,m=0,y=0;do{let H=w.next();y=a[H],c|=(y&31)<<m,m+=5;}while(y&32);let E=c&1;return c>>>=1,E&&(c=-2147483648|-c),u+c}function f(w,u,c){let m=u-c;m=m<0?-m<<1|1:m<<1;do{let y=m&31;m>>>=5,m>0&&(y|=32),w.write(s[y]);}while(m>0);return u}function h(w,u){return w.pos>=u?false:w.peek()!==r}let g=1024*16,b=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(w){return Buffer.from(w.buffer,w.byteOffset,w.byteLength).toString()}}:{decode(w){let u="";for(let c=0;c<w.length;c++)u+=String.fromCharCode(w[c]);return u}};class x{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(g);}write(u){let{buffer:c}=this;c[this.pos++]=u,this.pos===g&&(this.out+=b.decode(c),this.pos=0);}flush(){let{buffer:u,out:c,pos:m}=this;return m>0?c+b.decode(u.subarray(0,m)):c}}class S{constructor(u){this.pos=0,this.buffer=u;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(u){let{buffer:c,pos:m}=this,y=c.indexOf(u,m);return y===-1?c.length:y}}let C=[];function N(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0;for(;c.pos<u;c.pos++){E=l(c,E);let H=l(c,0);if(!h(c,u)){let Y=y.pop();Y[2]=E,Y[3]=H;continue}let I=l(c,0),M=l(c,0),j=M&1,B=j?[E,H,0,0,I,l(c,0)]:[E,H,0,0,I],z=C;if(h(c,u)){z=[];do{let Y=l(c,0);z.push(Y);}while(h(c,u))}B.vars=z,m.push(B),y.push(B);}return m}function T(w){let u=new x;for(let c=0;c<w.length;)c=A(w,c,u,[0]);return u.flush()}function A(w,u,c,m){let y=w[u],{0:E,1:H,2:I,3:M,4:j,vars:B}=y;u>0&&c.write(r),m[0]=f(c,E,m[0]),f(c,H,0),f(c,j,0);let z=y.length===6?1:0;f(c,z,0),y.length===6&&f(c,y[5],0);for(let Y of B)f(c,Y,0);for(u++;u<w.length;){let Y=w[u],{0:F,1:G}=Y;if(F>I||F===I&&G>=M)break;u=A(w,u,c,m);}return c.write(r),m[0]=f(c,I,m[0]),f(c,M,0),u}function R(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0,H=0,I=0,M=0,j=0,B=0,z=0,Y=0;do{let F=c.indexOf(";"),G=0;for(;c.pos<F;c.pos++){if(G=l(c,G),!h(c,F)){let oe=y.pop();oe[2]=E,oe[3]=G;continue}let Q=l(c,0),fe=Q&1,Z=Q&2,ae=Q&4,ye=null,we=C,Se;if(fe){let oe=l(c,H);I=l(c,H===oe?I:0),H=oe,Se=[E,G,0,0,oe,I];}else Se=[E,G,0,0];if(Se.isScope=!!ae,Z){let oe=M,Te=j;M=l(c,M);let Oe=oe===M;j=l(c,Oe?j:0),B=l(c,Oe&&Te===j?B:0),ye=[M,j,B];}if(Se.callsite=ye,h(c,F)){we=[];do{z=E,Y=G;let oe=l(c,0),Te;if(oe<-1){Te=[[l(c,0)]];for(let Oe=-1;Oe>oe;Oe--){let tt=z;z=l(c,z),Y=l(c,z===tt?Y:0);let nt=l(c,0);Te.push([nt,z,Y]);}}else Te=[[oe]];we.push(Te);}while(h(c,F))}Se.bindings=we,m.push(Se),y.push(Se);}E++,c.pos=F+1;}while(c.pos<u);return m}function _(w){if(w.length===0)return "";let u=new x;for(let c=0;c<w.length;)c=O(w,c,u,[0,0,0,0,0,0,0]);return u.flush()}function O(w,u,c,m){let y=w[u],{0:E,1:H,2:I,3:M,isScope:j,callsite:B,bindings:z}=y;m[0]<E?(D(c,m[0],E),m[0]=E,m[1]=0):u>0&&c.write(r),m[1]=f(c,y[1],m[1]);let Y=(y.length===6?1:0)|(B?2:0)|(j?4:0);if(f(c,Y,0),y.length===6){let{4:F,5:G}=y;F!==m[2]&&(m[3]=0),m[2]=f(c,F,m[2]),m[3]=f(c,G,m[3]);}if(B){let{0:F,1:G,2:Q}=y.callsite;F===m[4]?G!==m[5]&&(m[6]=0):(m[5]=0,m[6]=0),m[4]=f(c,F,m[4]),m[5]=f(c,G,m[5]),m[6]=f(c,Q,m[6]);}if(z)for(let F of z){F.length>1&&f(c,-F.length,0);let G=F[0][0];f(c,G,0);let Q=E,fe=H;for(let Z=1;Z<F.length;Z++){let ae=F[Z];Q=f(c,ae[1],Q),fe=f(c,ae[2],fe),f(c,ae[0],0);}}for(u++;u<w.length;){let F=w[u],{0:G,1:Q}=F;if(G>I||G===I&&Q>=M)break;u=O(w,u,c,m);}return m[0]<I?(D(c,m[0],I),m[0]=I,m[1]=0):c.write(r),m[1]=f(c,M,m[1]),u}function D(w,u,c){do w.write(o);while(++u<c)}function re(w){let{length:u}=w,c=new S(w),m=[],y=0,E=0,H=0,I=0,M=0;do{let j=c.indexOf(";"),B=[],z=true,Y=0;for(y=0;c.pos<j;){let F;y=l(c,y),y<Y&&(z=false),Y=y,h(c,j)?(E=l(c,E),H=l(c,H),I=l(c,I),h(c,j)?(M=l(c,M),F=[y,E,H,I,M]):F=[y,E,H,I]):F=[y],B.push(F),c.pos++;}z||se(B),m.push(B),c.pos=j+1;}while(c.pos<=u);return m}function se(w){w.sort(ue);}function ue(w,u){return w[0]-u[0]}function Re(w){let u=new x,c=0,m=0,y=0,E=0;for(let H=0;H<w.length;H++){let I=w[H];if(H>0&&u.write(o),I.length===0)continue;let M=0;for(let j=0;j<I.length;j++){let B=I[j];j>0&&u.write(r),M=f(u,B[0],M),B.length!==1&&(c=f(u,B[1],c),m=f(u,B[2],m),y=f(u,B[3],y),B.length!==4&&(E=f(u,B[4],E)));}}return u.flush()}n.decode=re,n.decodeGeneratedRanges=R,n.decodeOriginalScopes=N,n.encode=Re,n.encodeGeneratedRanges=_,n.encodeOriginalScopes=T,Object.defineProperty(n,"__esModule",{value:true});});}),sr=Io(Vo()),ar=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Yo=/^data:application\/json[^,]+base64,/,Go=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,lr=typeof WeakRef<"u",Ze=new Map,Rt=new Map,Uo=e=>lr&&e instanceof WeakRef,Jn=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let i=null;for(let h of o)if(h[0]<=r)i=h;else break;if(!i||i.length<4)return null;let[,s,a,l]=i;if(s===void 0||a===void 0||l===void 0)return null;let f=t[s];return f?{columnNumber:l,fileName:f,lineNumber:a+1}:null},zo=(e,t,n)=>{if(e.sections){let r=null;for(let s of e.sections)if(t>s.offset.line||t===s.offset.line&&n>=s.offset.column)r=s;else break;if(!r)return null;let o=t-r.offset.line,i=t===r.offset.line?n-r.offset.column:n;return Jn(r.map.mappings,r.map.sources,o,i)}return Jn(e.mappings,e.sources,t-1,n)},qo=(e,t)=>{let n=t.split(`
|
|
22
|
+
`),r;for(let i=n.length-1;i>=0&&!r;i--){let s=n[i].match(Go);s&&(r=s[1]||s[2]);}if(!r)return null;let o=ar.test(r);if(!(Yo.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Xo=e=>({file:e.file,mappings:(0, sr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),Wo=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, sr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Qn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(ar);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Ko=async(e,t=fetch)=>{if(!Qn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=qo(e,n);if(!r||!Qn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?Wo(i):Xo(i)}catch{return null}},Zo=async(e,t=true,n)=>{if(t&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(Uo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&Rt.has(e))return Rt.get(e);let r=Ko(e,n);t&&Rt.set(e,r);let o=await r;return t&&Rt.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,lr?new WeakRef(o):o)),o},er=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Jo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],tr="about://React/",Qo=["<anonymous>","eval",""],ei=/\.(jsx|tsx|ts|js)$/,ti=/(\.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,ni=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,ri=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",oi=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":false},ii=async(e,t=true,n)=>{if(oi(e))return e._debugSource||null;let r=cr(e);return ur(r,void 0,t,n)},cr=e=>ri(e)?Ho(e._debugStack.stack):Do(e),si=async(e,t=true,n)=>{let r=await ur(e,1,t,n);return !r||r.length===0?null:r[0]},ur=async(e,t=1,n=true,r)=>{let o=or(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await Zo(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=zo(a,s.line,s.col);if(l){i.push(l);continue}}i.push({fileName:s.file,lineNumber:s.line,columnNumber:s.col,functionName:s.function});}return i},je=e=>{if(!e||Qo.includes(e))return "";let t=e;if(t.startsWith(tr)){let r=t.slice(tr.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of Jo)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(er.test(t)){let r=t.match(er);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);ni.test(r)&&(t=t.slice(0,n));}return t},Qt=e=>{let t=je(e);return !(!t||!ei.test(t)||ti.test(t))},ai=async(e,t=true,n)=>{let r=He(e,s=>{if(We(s))return true},true);if(r){let s=await ii(r,t,n);if(s?.fileName){let a=je(s.fileName);if(Qt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=or(cr(e),{includeInElement:false}),i=null;for(;o.length;){let s=o.pop();if(!s||!s.raw||!s.file)continue;let a=await si(s.raw,t,n);if(a)return {fileName:je(a.fileName),lineNumber:a.lineNumber,columnNumber:a.columnNumber,functionName:a.functionName};i={fileName:je(s.file),lineNumber:s.line,columnNumber:s.col,functionName:s.function};}return i},fr=async(e,t=true,n)=>{let r=Ke(e);if(!r||!Gt(r))return null;let o=Xt(r);return o?ai(o,t,n):null};var li=new Set(["role","name","aria-label","rel","href"]);function ci(e,t){let n=li.has(e);n||=e.startsWith("data-")&&Je(e);let r=Je(t)&&t.length<100;return r||=t.startsWith("#")&&Je(t.slice(1)),n&&r}function ui(e){return Je(e)}function fi(e){return Je(e)}function di(e){return true}function mr(e,t){if(e.nodeType!==Node.ELEMENT_NODE)throw new Error("Can't generate CSS selector for non-element node type.");if(e.tagName.toLowerCase()==="html")return "html";let n={root:document.body,idName:ui,className:fi,tagName:di,attr:ci,timeoutMs:1e3,seedMinLength:3,optimizedMinLength:2,maxNumberOfPathChecks:1/0},r=new Date,o={...n,...t},i=bi(o.root,n),s,a=0;for(let f of mi(e,o,i)){if(new Date().getTime()-r.getTime()>o.timeoutMs||a>=o.maxNumberOfPathChecks){let g=gi(e,i);if(!g)throw new Error(`Timeout: Can't find a unique selector after ${o.timeoutMs}ms`);return Qe(g)}if(a++,nn(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...pr(s,e,o,i,r)];return l.sort(en),l.length>0?Qe(l[0]):Qe(s)}function*mi(e,t,n){let r=[],o=[],i=e,s=0;for(;i&&i!==n;){let a=hi(i,t);for(let l of a)l.level=s;if(r.push(a),i=i.parentElement,s++,o.push(...gr(r)),s>=t.seedMinLength){o.sort(en);for(let l of o)yield l;o=[];}}o.sort(en);for(let a of o)yield a;}function Je(e){if(/^[a-z\-]{3,}$/i.test(e)){let t=e.split(/-|[A-Z]/);for(let n of t)if(n.length<=2||/[^aeiou]{4,}/i.test(n))return false;return true}return false}function hi(e,t){let n=[],r=e.getAttribute("id");r&&t.idName(r)&&n.push({name:"#"+CSS.escape(r),penalty:0});for(let s=0;s<e.classList.length;s++){let a=e.classList[s];t.className(a)&&n.push({name:"."+CSS.escape(a),penalty:1});}for(let s=0;s<e.attributes.length;s++){let a=e.attributes[s];t.attr(a.name,a.value)&&n.push({name:`[${CSS.escape(a.name)}="${CSS.escape(a.value)}"]`,penalty:2});}let o=e.tagName.toLowerCase();if(t.tagName(o)){n.push({name:o,penalty:5});let s=tn(e,o);s!==void 0&&n.push({name:hr(o,s),penalty:10});}let i=tn(e);return i!==void 0&&n.push({name:pi(o,i),penalty:50}),n}function Qe(e){let t=e[0],n=t.name;for(let r=1;r<e.length;r++){let o=e[r].level||0;t.level===o-1?n=`${e[r].name} > ${n}`:n=`${e[r].name} ${n}`,t=e[r];}return n}function dr(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function en(e,t){return dr(e)-dr(t)}function tn(e,t){let n=e.parentNode;if(!n)return;let r=n.firstChild;if(!r)return;let o=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&(t===void 0||r.tagName.toLowerCase()===t)&&o++,r!==e);)r=r.nextSibling;return o}function gi(e,t){let n=0,r=e,o=[];for(;r&&r!==t;){let i=r.tagName.toLowerCase(),s=tn(r,i);if(s===void 0)return;o.push({name:hr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(nn(o,t))return o}function pi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function hr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*gr(e,t=[]){if(e.length>0)for(let n of e[0])yield*gr(e.slice(1,e.length),t.concat(n));else yield t;}function bi(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function nn(e,t){let n=Qe(e);switch(t.querySelectorAll(n).length){case 0:throw new Error(`Can't select any node with this selector: ${n}`);case 1:return true;default:return false}}function*pr(e,t,n,r,o){if(e.length>2&&e.length>n.optimizedMinLength)for(let i=1;i<e.length-1;i++){if(new Date().getTime()-o.getTime()>n.timeoutMs)return;let a=[...e];a.splice(i,1),nn(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*pr(a,t,n,r,o));}}Wt({onCommitFiberRoot(e,t){Et.add(t);}});var yi=e=>mr(e),rn=async e=>{let t=(u,c)=>u.length>c?`${u.substring(0,c)}...`:u,n=u=>!!(u.startsWith("_")||u.includes("Provider")&&u.includes("Context")),r=u=>{let c=Ke(u);if(!c)return null;let m=null;return He(c,y=>{if(We(y)){let E=Be(y);if(E&&!n(E))return m=E,true}return false},true),m},o=async u=>{let c=await fr(u);if(!c)return null;let m=je(c.fileName);return Qt(m)?`${m}:${c.lineNumber}:${c.columnNumber}`:null},i=new Set(["article","aside","footer","form","header","main","nav","section"]),s=u=>{let c=u.tagName.toLowerCase();if(i.has(c)||u.id)return true;if(u.className&&typeof u.className=="string"){let m=u.className.trim();if(m&&m.length>0)return true}return Array.from(u.attributes).some(m=>m.name.startsWith("data-"))},a=(u,c=10)=>{let m=[],y=u.parentElement,E=0;for(;y&&E<c&&y.tagName!=="BODY"&&!(s(y)&&(m.push(y),m.length>=3));)y=y.parentElement,E++;return m.reverse()},l=(u,c=false)=>{let m=u.tagName.toLowerCase(),y=[];if(u.id&&y.push(`id="${u.id}"`),u.className&&typeof u.className=="string"){let M=u.className.trim().split(/\s+/);if(M.length>0&&M[0]){let j=c?M.slice(0,3):M,B=t(j.join(" "),30);y.push(`class="${B}"`);}}let E=Array.from(u.attributes).filter(M=>M.name.startsWith("data-")),H=c?E.slice(0,1):E;for(let M of H)y.push(`${M.name}="${t(M.value,20)}"`);let I=u.getAttribute("aria-label");return I&&!c&&y.push(`aria-label="${t(I,20)}"`),y.length>0?`<${m} ${y.join(" ")}>`:`<${m}>`},f=u=>`</${u.tagName.toLowerCase()}>`,h=u=>{let c=(u.textContent||"").trim().replace(/\s+/g," ");return t(c,60)},g=u=>{if(u.id)return `#${u.id}`;if(u.className&&typeof u.className=="string"){let c=u.className.trim().split(/\s+/);if(c.length>0&&c[0])return `.${c[0]}`}return null},b=[],x=yi(e);b.push(`- selector: ${x}`);let S=e.getBoundingClientRect();b.push(`- width: ${Math.round(S.width)}`),b.push(`- height: ${Math.round(S.height)}`),b.push("HTML snippet:"),b.push("```html");let C=a(e),N=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),R=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),m=N[u],y=A[u];m&&y&&(u===0||N[u-1]!==m)&&b.push(`${c}<${m} source="${y}">`),b.push(`${c}${l(C[u],true)}`);}let _=e.parentElement,O=-1;if(_){let u=Array.from(_.children);if(O=u.indexOf(e),O>0){let c=u[O-1];if(g(c)&&O<=2){let y=" ".repeat(C.length);b.push(`${y} ${l(c,true)}`),b.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(O>0){let y=" ".repeat(C.length);b.push(`${y} ... (${O} element${O===1?"":"s"})`);}}}let D=" ".repeat(C.length),re=C.length>0?N[N.length-1]:null,se=T&&R&&T!==re;se&&b.push(`${D} <${T} used-at="${R}">`),b.push(`${D} <!-- IMPORTANT: selected element -->`);let ue=h(e),Re=e.children.length,w=`${D}${se?" ":" "}`;if(ue&&Re===0&&ue.length<40?b.push(`${w}${l(e)}${ue}${f(e)}`):(b.push(`${w}${l(e)}`),ue&&b.push(`${w} ${ue}`),Re>0&&b.push(`${w} ... (${Re} element${Re===1?"":"s"})`),b.push(`${w}${f(e)}`)),se&&b.push(`${D} </${T}>`),_&&O>=0){let u=Array.from(_.children),c=u.length-O-1;if(c>0){let m=u[O+1];g(m)&&c<=2?(b.push(`${D} ${l(m,true)}`),b.push(`${D} </${m.tagName.toLowerCase()}>`)):b.push(`${D} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);b.push(`${c}${f(C[u])}`);let m=N[u],y=A[u];m&&y&&(u===C.length-1||N[u+1]!==m)&&b.push(`${c}</${m}>`);}return b.push("```"),b.join(`
|
|
23
|
+
`)};var wi=()=>document.hasFocus()?new Promise(e=>setTimeout(e,50)):new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),setTimeout(e,50);};window.addEventListener("focus",t),window.focus();}),on=async e=>{await wi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let n of e)if(typeof n=="string"){let r=br(n);if(!r)return r}return !0}let t=new Map;for(let n of e)if(n instanceof Blob){let r=n.type||"text/plain";t.has(r)||t.set(r,n);}else t.has("text/plain")||t.set("text/plain",new Blob([n],{type:"text/plain"}));return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(t))]),!0}else {if(e instanceof Blob)return await navigator.clipboard.write([new ClipboardItem({[e.type]:e})]),!0;try{return await navigator.clipboard.writeText(String(e)),!0}catch{return br(e)}}}catch{return false}},br=e=>{if(!document.execCommand)return false;let t=document.createElement("textarea");t.value=String(e),t.style.clipPath="inset(50%)",t.ariaHidden="true",(document.body||document.documentElement).append(t);try{return t.select(),document.execCommand("copy")}finally{t.remove();}};var yr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var et=e=>{if(e.closest(`[${De}]`))return false;let t=window.getComputedStyle(e);return !(!yr(e,t)||t.pointerEvents==="none")};var sn=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(et(r))return r;return null};var wr=(e,t,n)=>{let r=[],o=Array.from(document.querySelectorAll("*")),i=e.x,s=e.y,a=e.x+e.width,l=e.y+e.height;for(let f of o){if(!n){let C=(f.tagName||"").toUpperCase();if(C==="HTML"||C==="BODY")continue}if(!t(f))continue;let h=f.getBoundingClientRect(),g=h.left,b=h.top,x=h.left+h.width,S=h.top+h.height;if(n){let C=Math.max(i,g),N=Math.max(s,b),T=Math.min(a,x),A=Math.min(l,S),R=Math.max(0,T-C),_=Math.max(0,A-N),O=R*_,D=Math.max(0,h.width*h.height);D>0&&O/D>=.75&&r.push(f);}else g<a&&x>i&&b<l&&S>s&&r.push(f);}return r},Sr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t)));var Tr=(e,t)=>{let n=wr(e,t,true);return Sr(n)},Cr=(e,t)=>{let n=wr(e,t,false);return Sr(n)};var an=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e);return {borderRadius:n.borderRadius||"0px",height:t.height,transform:n.transform||"none",width:t.width,x:t.left,y:t.top}};var Si=150,xr=e=>{let t={enabled:true,keyHoldDuration:300,...e};return t.enabled===false?{activate:()=>{},deactivate:()=>{},toggle:()=>{},isActive:()=>false,dispose:()=>{}}:ke(n=>{let[o,i]=$(false),[s,a]=$(-1e3),[l,f]=$(-1e3),[h,g]=$(false),[b,x]=$(-1e3),[S,C]=$(-1e3),[N,T]=$(false),[A,R]=$(null),[_,O]=$(null),[D,re]=$(0),[se,ue]=$([]),[Re,w]=$([]),[u,c]=$(false),[m,y]=$(false),[E,H]=$(false),[I,M]=$(-1e3),[j,B]=$(-1e3),[z,Y]=$(false),F=null,G=null,Q=null,fe=null,Z=null,ae=-1e3,ye=-1e3,we=U(()=>u()&&!N()),Se=U(()=>s()>-1e3&&l()>-1e3),oe=d=>(d.metaKey||d.ctrlKey)&&d.key.toLowerCase()==="c",Te=d=>{let v=`grabbed-${Date.now()}-${Math.random()}`,P=Date.now(),X={id:v,bounds:d,createdAt:P},J=se();ue([...J,X]),setTimeout(()=>{ue(ee=>ee.filter(it=>it.id!==v));},1700);},Oe=(d,v,P)=>{let X=`success-${Date.now()}-${Math.random()}`;w(J=>[...J,{id:X,text:d,x:v,y:P}]),setTimeout(()=>{w(J=>J.filter(ee=>ee.id!==X));},1700);},tt=d=>`<selected_element>
|
|
24
|
+
${d}
|
|
25
|
+
</selected_element>`,nt=d=>{let v=window.getComputedStyle(d),P=d.getBoundingClientRect();return {width:`${Math.round(P.width)}px`,height:`${Math.round(P.height)}px`,paddingTop:v.paddingTop,paddingRight:v.paddingRight,paddingBottom:v.paddingBottom,paddingLeft:v.paddingLeft,background:v.background,opacity:v.opacity}},ln=d=>{let v={elements:d.map(J=>({tagName:J.tagName,content:J.content,computedStyles:J.computedStyles}))},X=`<div data-react-grab="${btoa(JSON.stringify(v))}"></div>`;return new Blob([X],{type:"text/html"})},rt=d=>(d.tagName||"").toLowerCase(),cn=d=>{try{let v=d.map(P=>({tagName:rt(P)}));window.dispatchEvent(new CustomEvent("react-grab:element-selected",{detail:{elements:v}}));}catch{}},Ot=async(d,v,P)=>{M(d),B(v),T(true),await P().finally(()=>{T(false);});},Er=async d=>{let v=rt(d);Te(an(d)),await new Promise(P=>requestAnimationFrame(P));try{let P=await rn(d),X=tt(P),J=ln([{tagName:v,content:P,computedStyles:nt(d)}]);await on([X,J]);}catch{}Oe(v?`<${v}>`:"<element>",I(),j()),cn([d]);},un=async d=>{if(d.length!==0){for(let v of d)Te(an(v));await new Promise(v=>requestAnimationFrame(v));try{let v=await Promise.all(d.map(ee=>rn(ee))),P=v.filter(ee=>ee.trim()).map(ee=>tt(ee)).join(`
|
|
26
26
|
|
|
27
|
-
`),
|
|
27
|
+
`),X=v.map((ee,it)=>({tagName:rt(d[it]),content:ee,computedStyles:nt(d[it])})),J=ln(X);await on([P,J]);}catch{}Oe(`${d.length} elements`,I(),j()),cn(d);}},Fe=U(()=>!we()||h()?null:sn(s(),l())),Rr=U(()=>{let d=Fe();if(!d)return;let v=d.getBoundingClientRect(),P=window.getComputedStyle(d);return {borderRadius:P.borderRadius||"0px",height:v.height,transform:P.transform||"none",width:v.width,x:v.left,y:v.top}}),ot=2,fn=(d,v)=>({x:Math.abs(d-b()),y:Math.abs(v-S())}),dn=U(()=>{if(!h())return false;let d=fn(s(),l());return d.x>ot||d.y>ot}),mn=(d,v)=>{let P=Math.min(b(),d),X=Math.min(S(),v),J=Math.abs(d-b()),ee=Math.abs(v-S());return {x:P,y:X,width:J,height:ee}},Or=U(()=>{if(!dn())return;let d=mn(s(),l());return {borderRadius:"0px",height:d.height,transform:"none",width:d.width,x:d.x,y:d.y}}),Nr=U(()=>{let d=Fe();return d?`<${rt(d)}>`:"<element>"}),hn=U(()=>N()?{x:I(),y:j()}:{x:s(),y:l()}),_r=U(()=>!!(Fe()&&Fe()===A()));ne(_e(()=>[Fe(),A()],([d,v])=>{v&&d&&v!==d&&R(null);}));let gn=U(()=>{let d=_();if(D(),d===null)return 0;let v=Date.now()-d;return Math.min(v/t.keyHoldDuration,1)}),Ar=()=>{O(Date.now()),y(false),Q=window.setTimeout(()=>{y(true),Q=null;},Si);let d=()=>{if(_()===null)return;re(P=>P+1),gn()<1&&(G=requestAnimationFrame(d));};d();},Nt=()=>{G!==null&&(cancelAnimationFrame(G),G=null),Q!==null&&(window.clearTimeout(Q),Q=null),O(null),y(false);},_t=()=>{Nt(),c(true),document.body.style.cursor="crosshair";},Ve=()=>{i(false),c(false),document.body.style.cursor="",h()&&(g(false),document.body.style.userSelect=""),F&&window.clearTimeout(F),fe&&window.clearTimeout(fe),Z&&(window.clearTimeout(Z),Z=null),Y(false),ae=-1e3,ye=-1e3,Nt();},pn=new AbortController,$e=pn.signal;window.addEventListener("keydown",d=>{if(d.key==="Escape"&&o()){Ve();return}if(!In(d)&&oe(d)){if(u()){fe!==null&&window.clearTimeout(fe),fe=window.setTimeout(()=>{Ve();},200);return}d.repeat||(F!==null&&window.clearTimeout(F),o()||i(true),Ar(),F=window.setTimeout(()=>{_t(),t.onActivate?.();},t.keyHoldDuration));}},{signal:$e}),window.addEventListener("keyup",d=>{if(!o()&&!u())return;let v=!d.metaKey&&!d.ctrlKey;(d.key.toLowerCase()==="c"||v)&&Ve();},{signal:$e,capture:true}),window.addEventListener("mousemove",d=>{a(d.clientX),f(d.clientY),ae===-1e3&&(ae=d.clientX,ye=d.clientY);let v=d.clientX-ae,P=d.clientY-ye;Math.sqrt(v*v+P*P)>=200?(Z!==null&&window.clearTimeout(Z),Y(false),ae=d.clientX,ye=d.clientY,Z=window.setTimeout(()=>{Y(true),ae=s(),ye=l(),Z=null;},100)):Z===null&&!z()&&(Z=window.setTimeout(()=>{Y(true),ae=s(),ye=l(),Z=null;},100));},{signal:$e}),window.addEventListener("mousedown",d=>{!we()||N()||(d.preventDefault(),g(true),x(d.clientX),C(d.clientY),document.body.style.userSelect="none");},{signal:$e}),window.addEventListener("mouseup",d=>{if(!h())return;let v=fn(d.clientX,d.clientY),P=v.x>ot||v.y>ot;if(g(false),document.body.style.userSelect="",P){H(true);let X=mn(d.clientX,d.clientY),J=Tr(X,et);if(J.length>0)Ot(d.clientX,d.clientY,()=>un(J));else {let ee=Cr(X,et);ee.length>0&&Ot(d.clientX,d.clientY,()=>un(ee));}}else {let X=sn(d.clientX,d.clientY);if(!X)return;R(X),Ot(d.clientX,d.clientY,()=>Er(X));}},{signal:$e}),window.addEventListener("click",d=>{E()&&(d.preventDefault(),d.stopPropagation(),H(false));},{signal:$e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&ue([]);},{signal:$e}),me(()=>{pn.abort(),F&&window.clearTimeout(F),fe&&window.clearTimeout(fe),Z&&window.clearTimeout(Z),Nt(),document.body.style.userSelect="",document.body.style.cursor="";});let Fr=Mn(),$r=U(()=>false),kr=U(()=>we()&&dn()),Ir=U(()=>N()?"processing":"hover"),Mr=U(()=>we()&&!h()&&z()&&(!!Fe()&&!_r()||!Fe())||N()),Pr=U(()=>o()&&m()&&Se()),Lr=U(()=>we()&&!h());return $n(()=>k(Bn,{get selectionVisible(){return $r()},get selectionBounds(){return Rr()},get dragVisible(){return kr()},get dragBounds(){return Or()},get grabbedBoxes(){return se()},get successLabels(){return Re()},get labelVariant(){return Ir()},get labelText(){return Nr()},get labelX(){return hn().x},get labelY(){return hn().y},get labelVisible(){return Mr()},get progressVisible(){return Pr()},get progress(){return gn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return Lr()}}),Fr),{activate:()=>{u()||(_t(),t.onActivate?.());},deactivate:()=>{u()&&Ve();},toggle:()=>{u()?Ve():(_t(),t.onActivate?.());},isActive:()=>u(),dispose:n}})};var vr=null,Sl=()=>vr;vr=xr();/*! Bundled license information:
|
|
28
28
|
|
|
29
29
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
30
30
|
(**
|
|
@@ -85,4 +85,4 @@ bippy/dist/source.js:
|
|
|
85
85
|
* This source code is licensed under the MIT license found in the
|
|
86
86
|
* LICENSE file in the root directory of this source tree.
|
|
87
87
|
*)
|
|
88
|
-
*/exports.getGlobalApi=
|
|
88
|
+
*/exports.getGlobalApi=Sl;exports.init=xr;return exports;})({});
|
package/dist/index.js
CHANGED
|
@@ -1159,10 +1159,14 @@ var init = (rawOptions) => {
|
|
|
1159
1159
|
const [didJustDrag, setDidJustDrag] = createSignal(false);
|
|
1160
1160
|
const [copyStartX, setCopyStartX] = createSignal(OFFSCREEN_POSITION);
|
|
1161
1161
|
const [copyStartY, setCopyStartY] = createSignal(OFFSCREEN_POSITION);
|
|
1162
|
+
const [mouseHasSettled, setMouseHasSettled] = createSignal(false);
|
|
1162
1163
|
let holdTimerId = null;
|
|
1163
1164
|
let progressAnimationId = null;
|
|
1164
1165
|
let progressDelayTimerId = null;
|
|
1165
1166
|
let keydownSpamTimerId = null;
|
|
1167
|
+
let mouseSettleTimerId = null;
|
|
1168
|
+
let referenceMouseX = OFFSCREEN_POSITION;
|
|
1169
|
+
let referenceMouseY = OFFSCREEN_POSITION;
|
|
1166
1170
|
const isRendererActive = createMemo(() => isActivated() && !isCopying());
|
|
1167
1171
|
const hasValidMousePosition = createMemo(() => mouseX() > OFFSCREEN_POSITION && mouseY() > OFFSCREEN_POSITION);
|
|
1168
1172
|
const isTargetKeyCombination = (event) => (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === "c";
|
|
@@ -1248,6 +1252,7 @@ ${context}
|
|
|
1248
1252
|
const copySingleElementToClipboard = async (targetElement2) => {
|
|
1249
1253
|
const tagName = extractElementTagName(targetElement2);
|
|
1250
1254
|
showTemporaryGrabbedBox(createElementBounds(targetElement2));
|
|
1255
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1251
1256
|
try {
|
|
1252
1257
|
const content = await getHTMLSnippet(targetElement2);
|
|
1253
1258
|
const plainTextContent = wrapInSelectedElementTags(content);
|
|
@@ -1267,6 +1272,7 @@ ${context}
|
|
|
1267
1272
|
for (const element of targetElements) {
|
|
1268
1273
|
showTemporaryGrabbedBox(createElementBounds(element));
|
|
1269
1274
|
}
|
|
1275
|
+
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
1270
1276
|
try {
|
|
1271
1277
|
const elementSnippets = await Promise.all(targetElements.map((element) => getHTMLSnippet(element)));
|
|
1272
1278
|
const plainTextContent = elementSnippets.filter((snippet) => snippet.trim()).map((snippet) => wrapInSelectedElementTags(snippet)).join("\n\n");
|
|
@@ -1402,6 +1408,13 @@ ${context}
|
|
|
1402
1408
|
}
|
|
1403
1409
|
if (holdTimerId) window.clearTimeout(holdTimerId);
|
|
1404
1410
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1411
|
+
if (mouseSettleTimerId) {
|
|
1412
|
+
window.clearTimeout(mouseSettleTimerId);
|
|
1413
|
+
mouseSettleTimerId = null;
|
|
1414
|
+
}
|
|
1415
|
+
setMouseHasSettled(false);
|
|
1416
|
+
referenceMouseX = OFFSCREEN_POSITION;
|
|
1417
|
+
referenceMouseY = OFFSCREEN_POSITION;
|
|
1405
1418
|
stopProgressAnimation();
|
|
1406
1419
|
};
|
|
1407
1420
|
const abortController = new AbortController();
|
|
@@ -1451,6 +1464,34 @@ ${context}
|
|
|
1451
1464
|
window.addEventListener("mousemove", (event) => {
|
|
1452
1465
|
setMouseX(event.clientX);
|
|
1453
1466
|
setMouseY(event.clientY);
|
|
1467
|
+
if (referenceMouseX === OFFSCREEN_POSITION) {
|
|
1468
|
+
referenceMouseX = event.clientX;
|
|
1469
|
+
referenceMouseY = event.clientY;
|
|
1470
|
+
}
|
|
1471
|
+
const deltaX = event.clientX - referenceMouseX;
|
|
1472
|
+
const deltaY = event.clientY - referenceMouseY;
|
|
1473
|
+
const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
1474
|
+
if (distance >= 200) {
|
|
1475
|
+
if (mouseSettleTimerId !== null) {
|
|
1476
|
+
window.clearTimeout(mouseSettleTimerId);
|
|
1477
|
+
}
|
|
1478
|
+
setMouseHasSettled(false);
|
|
1479
|
+
referenceMouseX = event.clientX;
|
|
1480
|
+
referenceMouseY = event.clientY;
|
|
1481
|
+
mouseSettleTimerId = window.setTimeout(() => {
|
|
1482
|
+
setMouseHasSettled(true);
|
|
1483
|
+
referenceMouseX = mouseX();
|
|
1484
|
+
referenceMouseY = mouseY();
|
|
1485
|
+
mouseSettleTimerId = null;
|
|
1486
|
+
}, 100);
|
|
1487
|
+
} else if (mouseSettleTimerId === null && !mouseHasSettled()) {
|
|
1488
|
+
mouseSettleTimerId = window.setTimeout(() => {
|
|
1489
|
+
setMouseHasSettled(true);
|
|
1490
|
+
referenceMouseX = mouseX();
|
|
1491
|
+
referenceMouseY = mouseY();
|
|
1492
|
+
mouseSettleTimerId = null;
|
|
1493
|
+
}, 100);
|
|
1494
|
+
}
|
|
1454
1495
|
}, {
|
|
1455
1496
|
signal: eventListenerSignal
|
|
1456
1497
|
});
|
|
@@ -1512,6 +1553,7 @@ ${context}
|
|
|
1512
1553
|
abortController.abort();
|
|
1513
1554
|
if (holdTimerId) window.clearTimeout(holdTimerId);
|
|
1514
1555
|
if (keydownSpamTimerId) window.clearTimeout(keydownSpamTimerId);
|
|
1556
|
+
if (mouseSettleTimerId) window.clearTimeout(mouseSettleTimerId);
|
|
1515
1557
|
stopProgressAnimation();
|
|
1516
1558
|
document.body.style.userSelect = "";
|
|
1517
1559
|
document.body.style.cursor = "";
|
|
@@ -1520,7 +1562,7 @@ ${context}
|
|
|
1520
1562
|
const selectionVisible = createMemo(() => false);
|
|
1521
1563
|
const dragVisible = createMemo(() => isRendererActive() && isDraggingBeyondThreshold());
|
|
1522
1564
|
const labelVariant = createMemo(() => isCopying() ? "processing" : "hover");
|
|
1523
|
-
const labelVisible = createMemo(() => isRendererActive() && !isDragging() && (Boolean(targetElement()) && !isSameAsLast() || !targetElement()) || isCopying());
|
|
1565
|
+
const labelVisible = createMemo(() => isRendererActive() && !isDragging() && mouseHasSettled() && (Boolean(targetElement()) && !isSameAsLast() || !targetElement()) || isCopying());
|
|
1524
1566
|
const progressVisible = createMemo(() => isHoldingKeys() && showProgressIndicator() && hasValidMousePosition());
|
|
1525
1567
|
const crosshairVisible = createMemo(() => isRendererActive() && !isDragging());
|
|
1526
1568
|
render(() => createComponent(ReactGrabRenderer, {
|