react-grab 0.0.29 → 0.0.31
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 +189 -256
- package/dist/index.global.js +16 -18
- package/dist/index.js +191 -258
- package/package.json +3 -1
package/dist/index.global.js
CHANGED
|
@@ -6,29 +6,27 @@ 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 gr=Symbol("solid-track"),We={equals:mr},en=sn,fe=1,De=2,tn={owned:null,cleanups:null,context:null,owner:null};var M=null,y=null,Ae=null,G=null,ee=null,ne=null,Ze=0;function Oe(e,t){let n=G,r=M,o=e.length===0,i=t===void 0?r:t,s=o?tn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ae(()=>ve(s)));M=s,G=null;try{return ye(a,!0)}finally{G=n,M=r;}}function D(e,t){t=t?Object.assign({},We,t):We;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 le(e,t,n){let r=gt(e,t,false,fe);je(r);}function re(e,t,n){en=wr;let r=gt(e,t,false,fe);(r.user=true),ne?ne.push(r):je(r);}function X(e,t,n){n=n?Object.assign({},We,n):We;let r=gt(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,je(r),rn.bind(r)}function ae(e){if(G===null)return e();let t=G;G=null;try{return Ae?Ae.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 c=0;c<e.length;c++)a[c]=e[c]();}else a=e();let l=ae(()=>t(a,o,s));return o=a,l}}function nn(e){re(()=>ae(e));}function de(e){return M===null||(M.cleanups===null?M.cleanups=[e]:M.cleanups.push(e)),e}D(false);function rn(){let e=y;if(this.sources&&(this.state))if((this.state)===fe)je(this);else {let t=ee;ee=null,ye(()=>Ke(this),false),ee=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&&y.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&&ye(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=y&&y.running;s&&y.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?ee.push(i):ne.push(i),i.observers&&an(i)),s?i.tState=fe:i.state=fe);}if(ee.length>1e6)throw ee=[],new Error},false);}return t}function je(e){if(!e.fn)return;ve(e);let t=Ze;Zt(e,e.value,t);}function Zt(e,t,n){let r,o=M,i=G;G=M=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=fe,e.owned&&e.owned.forEach(ve),e.owned=null)),e.updatedAt=n+1,ht(s)}finally{G=i,M=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?on(e,r):e.value=r,e.updatedAt=n);}function gt(e,t,n,r=fe,o){let i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:M,context:M?M.context:null,pure:n};if(M===null||M!==tn&&(M.owned?M.owned.push(i):M.owned=[i]),Ae);return i}function He(e){let t=y;if((e.state)===0)return;if((e.state)===De)return Ke(e);if(e.suspense&&ae(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<Ze);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===fe)je(e);else if((e.state)===De){let o=ee;ee=null,ye(()=>Ke(e,n[0]),false),ee=o;}}}function ye(e,t){if(ee)return e();let n=false;t||(ee=[]),ne?n=true:ne=[],Ze++;try{let r=e();return br(n),r}catch(r){n||(ne=null),ee=null,ht(r);}}function br(e){if(ee&&(sn(ee),ee=null),e)return;let n=ne;ne=null,n.length&&ye(()=>en(n),false);}function sn(e){for(let t=0;t<e.length;t++)He(e[t]);}function wr(e){let t,n=0;for(t=0;t<e.length;t++){let r=e[t];r.user?e[n++]=r:He(r);}for(t=0;t<n;t++)He(e[t]);}function Ke(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===fe?o!==t&&(!o.updatedAt||o.updatedAt<Ze)&&He(o):i===De&&Ke(o,t);}}}function an(e){for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(!r.state)&&(r.state=De,r.pure?ee.push(r):ne.push(r),r.observers&&an(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 Sr(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function ht(e,t=M){let r=Sr(e);throw r;}var Tr=Symbol("fallback");function Jt(e){for(let t=0;t<e.length;t++)e[t]();}function xr(e,t,n={}){let r=[],o=[],i=[],s=0,a=t.length>1?[]:null;return de(()=>Jt(i)),()=>{let l=e()||[],c=l.length,f,g;return l[gr],ae(()=>{let C,S,E,p,d,b,w,_,O;if(c===0)s!==0&&(Jt(i),i=[],r=[],o=[],s=0,a&&(a=[])),n.fallback&&(r=[Tr],o[0]=Oe(F=>(i[0]=F,n.fallback())),s=1);else if(s===0){for(o=new Array(c),g=0;g<c;g++)r[g]=l[g],o[g]=Oe(v);s=c;}else {for(E=new Array(c),p=new Array(c),a&&(d=new Array(c)),b=0,w=Math.min(s,c);b<w&&r[b]===l[b];b++);for(w=s-1,_=c-1;w>=b&&_>=b&&r[w]===l[_];w--,_--)E[_]=o[w],p[_]=i[w],a&&(d[_]=a[w]);for(C=new Map,S=new Array(_+1),g=_;g>=b;g--)O=l[g],f=C.get(O),S[g]=f===void 0?-1:f,C.set(O,g);for(f=b;f<=w;f++)O=r[f],g=C.get(O),g!==void 0&&g!==-1?(E[g]=o[f],p[g]=i[f],a&&(d[g]=a[f]),g=S[g],C.set(O,g)):i[f]();for(g=b;g<c;g++)g in E?(o[g]=E[g],i[g]=p[g],a&&(a[g]=d[g],a[g](g))):o[g]=Oe(v);o=o.slice(0,s=c),r=l.slice(0);}return o});function v(C){if(i[g]=C,a){let[S,E]=D(g);return a[g]=E,t(l[g],S)}return t(l[g])}}}function $(e,t){return ae(()=>e(t||{}))}var vr=e=>`Stale read from <${e}>.`;function Qe(e){let t="fallback"in e&&{fallback:()=>e.fallback};return X(xr(()=>e.each,e.children,t||void 0))}function W(e){let t=e.keyed,n=X(()=>e.when,void 0,void 0),r=t?n:X(n,void 0,{equals:(o,i)=>!o==!i});return X(()=>{let o=r();if(o){let i=e.children;return typeof i=="function"&&i.length>0?ae(()=>i(t?o:()=>{if(!ae(r))throw vr("Show");return n()})):i}return e.fallback},void 0,void 0)}var Ie=e=>X(()=>e());function _r(e,t,n){let r=n.length,o=t.length,i=r,s=0,a=0,l=t[o-1].nextSibling,c=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 f=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],f);}else if(i===a)for(;s<o;)(!c||!c.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let f=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],f),t[o]=n[i];}else {if(!c){c=new Map;let g=a;for(;g<i;)c.set(n[g],g++);}let f=c.get(t[s]);if(f!=null)if(a<f&&f<i){let g=s,v=1,C;for(;++g<o&&g<i&&!((C=c.get(t[g]))==null||C!==f+v);)v++;if(v>f-a){let S=t[s];for(;a<f;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function un(e,t,n,r={}){let o;return Oe(i=>{o=i,t===document?e():we(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 Or(e,t,n){(e.removeAttribute(t));}function et(e,t,n){if(!t)return n?Or(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 Re(e,t,n){return ae(()=>e(t,n))}function we(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Je(e,t,r,n);le(o=>Je(e,t(),o,n),r);}function Je(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=$e(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=$e(e,n,r);}else {if(s==="function")return le(()=>{let l=t();for(;typeof l=="function";)l=l();n=Je(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],c=n&&Array.isArray(n);if(pt(l,t,n,o))return le(()=>n=Je(e,l,n,r,true)),()=>n;if(l.length===0){if(n=$e(e,n,r),a)return n}else c?n.length===0?cn(e,l,r):_r(e,n,l):(n&&$e(e),cn(e,l));n=l;}else if(t.nodeType){if(Array.isArray(n)){if(a)return n=$e(e,n,r,t);$e(e,n,null,t);}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t;}}return n}function pt(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],c;if(!(a==null||a===true||a===false))if((c=typeof a)=="object"&&a.nodeType)e.push(a);else if(Array.isArray(a))o=pt(e,a,l)||o;else if(c==="function")if(r){for(;typeof a=="function";)a=a();o=pt(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let f=String(a);l&&l.nodeType===3&&l.data===f?e.push(l):e.push(document.createTextNode(f));}}return o}function cn(e,t,n=null){for(let r=0,o=t.length;r<o;r++)e.insertBefore(t[r],n);}function $e(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 kr=["input","textarea","select","searchbox","slider","spinbutton","menuitem","menuitemcheckbox","menuitemradio","option","radio","textbox"],Nr=e=>!!e.tagName&&!e.tagName.startsWith("-")&&e.tagName.includes("-"),Fr=e=>Array.isArray(e),Ar=(e,t=false)=>{let{composed:n,target:r}=e,o,i;if(r instanceof HTMLElement&&Nr(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 Fr(t)?!!(o&&t&&t.some(s=>typeof o=="string"&&s.toLowerCase()===o.toLowerCase()||s===i)):!!(o&&t&&t)},dn=e=>Ar(e,kr);var Pe="data-react-grab",mn=()=>{let e=document.querySelector(`[${Pe}]`);if(e){let i=e.shadowRoot?.querySelector(`[${Pe}]`);if(i instanceof HTMLDivElement&&e.shadowRoot)return i}let t=document.createElement("div");t.setAttribute(Pe,"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(Pe,"true"),n.appendChild(r),(document.body??document.documentElement).appendChild(t),r};var me=(e,t,n)=>e+(t-e)*n;var Ir=ie("<div>"),tt=e=>{let[t,n]=D(e.bounds.x),[r,o]=D(e.bounds.y),[i,s]=D(e.bounds.width),[a,l]=D(e.bounds.height),[c,f]=D(1),g=false,v=null,C=null,S=e.bounds,E=false,p=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,d=()=>{if(E)return;E=true;let _=()=>{let O=me(t(),S.x,p()),F=me(r(),S.y,p()),N=me(i(),S.width,p()),U=me(a(),S.height,p());n(O),o(F),s(N),l(U),Math.abs(O-S.x)<.5&&Math.abs(F-S.y)<.5&&Math.abs(N-S.width)<.5&&Math.abs(U-S.height)<.5?(v=null,E=false):v=requestAnimationFrame(_);};v=requestAnimationFrame(_);};re(Ee(()=>e.bounds,_=>{if(S=_,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}d();})),re(()=>{e.variant==="grabbed"&&e.createdAt&&(C=window.setTimeout(()=>{f(0);},1500));}),de(()=>{v!==null&&(cancelAnimationFrame(v),v=null),C!==null&&(window.clearTimeout(C),C=null),E=false;});let b={position:"fixed","box-sizing":"border-box","pointer-events":e.variant==="drag"?"none":"auto","z-index":"2147483646"},w=()=>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 $(W,{get when(){return e.visible!==false},get children(){var _=Ir();return le(O=>et(_,{...b,...w(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:c()},O)),_}})};var Pr=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">'),gn=e=>{let t;return nn(()=>{t&&t.animate([{transform:"rotate(0deg)"},{transform:"rotate(360deg)"}],{duration:600,easing:"linear",iterations:1/0});}),(()=>{var n=Pr(),r=t;return typeof r=="function"?Re(r,n):t=n,le(o=>et(n,{...e.style},o)),n})()};var Ve=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,c=i-r-8,f=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,c));return {left:f,top:g}};var Mr=ie("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),Lr=ie("<div style=margin-right:4px>Copied"),Dr=ie("<div style=margin-left:4px>to clipboard"),Hr=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">`),Br=ie(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),bt=e=>{let[t,n]=D(0),[r,o]=D(0),i,s=e.x,a=e.y,l=e.x,c=e.y,f=null,g=false,v=()=>{s=me(s,l,.3),a=me(a,c,.3),o(b=>b+1),Math.abs(s-l)<.5&&Math.abs(a-c)<.5?f=null:f=requestAnimationFrame(v);},C=()=>{f===null&&(f=requestAnimationFrame(v));},S=()=>{if(l=e.x,c=e.y,!g){s=l,a=c,g=true,o(d=>d+1);return}C();};re(Ee(()=>e.visible,d=>{if(d!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let b=setTimeout(()=>{n(0);},1500);de(()=>clearTimeout(b));}})),re(()=>{S();}),de(()=>{f!==null&&(cancelAnimationFrame(f),f=null);});let E=()=>i?.getBoundingClientRect(),p=()=>{r();let d=E();if(!d)return {left:s,top:a};if(e.variant==="success"){let N=Math.round(s),U=Math.round(a)-d.height-6,te=N<8,ue=U<8,x=te||ue,h=Ve(N,U,d.width,d.height);return x&&(h.left+=4,h.top+=4),h}let b=12,w=window.innerWidth,_=window.innerHeight,O=[{left:Math.round(s)+b,top:Math.round(a)+b},{left:Math.round(s)-d.width-b,top:Math.round(a)+b},{left:Math.round(s)+b,top:Math.round(a)-d.height-b},{left:Math.round(s)-d.width-b,top:Math.round(a)-d.height-b}];for(let N of O){let U=N.left>=8&&N.left+d.width<=w-8,te=N.top>=8&&N.top+d.height<=_-8;if(U&&te)return N}let F=Ve(O[0].left,O[0].top,d.width,d.height);return F.left+=4,F.top+=4,F};return $(W,{get when(){return e.visible!==false},get children(){var d=Hr(),b=i;return typeof b=="function"?Re(b,d):i=d,we(d,$(W,{get when(){return e.variant==="processing"},get children(){return $(gn,{})}}),null),we(d,$(W,{get when(){return e.variant==="success"},get children(){return Mr()}}),null),we(d,$(W,{get when(){return e.variant==="success"},get children(){return Lr()}}),null),we(d,$(W,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),we(d,$(W,{get when(){return e.text.startsWith("(")},get fallback(){return (()=>{var w=Br();return we(w,()=>e.text),w})()},get children(){return e.text}}),null),we(d,$(W,{get when(){return e.variant==="success"},get children(){return Dr()}}),null),le(w=>{var _=`${p().top}px`,O=`${p().left}px`,F=e.zIndex?.toString()??"2147483647",N=t();return _!==w.e&&be(d,"top",w.e=_),O!==w.t&&be(d,"left",w.t=O),F!==w.a&&be(d,"z-index",w.a=F),N!==w.o&&be(d,"opacity",w.o=N),w},{e:void 0,t:void 0,a:void 0,o:void 0}),d}})};var jr=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)">'),Vr=e=>{let[t,n]=D(0);return re(Ee(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},hn=e=>{let t=Vr(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 Ve(s,a,o.width,o.height)};return $(W,{get when(){return e.visible!==false},get children(){var o=jr(),i=o.firstChild,s=i.firstChild,a=n;return typeof a=="function"?Re(a,o):n=o,le(l=>{var c=`${r().top}px`,f=`${r().left}px`,g=t(),v=`${Math.min(100,Math.max(0,e.progress*100))}%`;return c!==l.e&&be(o,"top",l.e=c),f!==l.t&&be(o,"left",l.t=f),g!==l.a&&be(o,"opacity",l.a=g),v!==l.o&&be(s,"width",l.o=v),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var Yr=ie("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),pn=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,c=e.mouseY,f=null,g=false,v=()=>{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));},C=(w,_)=>{let O=document.elementFromPoint(w,_);if(!O||O===t||O===document.body||O===document.documentElement)return null;let F=O.getBoundingClientRect();return F.width===0||F.height===0?null:{top:F.top,bottom:F.bottom,left:F.left,right:F.right}},S=(w,_,O,F,N)=>{let U=C(w,_);if(!U)return N;let te=5;for(let ue=te;ue<N;ue+=te){let x=w+O*ue,h=_+F*ue;if(x<0||x>=r||h<0||h>=o)return ue;let u=C(x,h);if(!u||u.top!==U.top||u.bottom!==U.bottom||u.left!==U.left||u.right!==U.right)return ue}return N},E=()=>{if(!n)return;n.clearRect(0,0,r,o),n.strokeStyle="rgba(210, 57, 192)",n.lineWidth=1,n.beginPath();let w=S(s,a,0,-1,a),_=S(s,a,0,1,o-a),O=S(s,a,-1,0,s),F=S(s,a,1,0,r-s);n.moveTo(s,a-w),n.lineTo(s,a+_),n.moveTo(s-O,a),n.lineTo(s+F,a),n.stroke();},p=()=>{s=me(s,l,.3),a=me(a,c,.3),E(),Math.abs(s-l)<.5&&Math.abs(a-c)<.5?f=null:f=requestAnimationFrame(p);},d=()=>{f===null&&(f=requestAnimationFrame(p));},b=()=>{if(l=e.mouseX,c=e.mouseY,!g){s=l,a=c,g=true,E();return}d();};return re(()=>{v(),E();let w=()=>{v(),E();};window.addEventListener("resize",w),de(()=>{window.removeEventListener("resize",w),f!==null&&(cancelAnimationFrame(f),f=null);});}),re(()=>{b();}),$(W,{get when(){return e.visible!==false},get children(){var w=Yr(),_=t;return typeof _=="function"?Re(_,w):t=w,w}})};var bn=e=>[$(W,{get when(){return Ie(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return $(tt,{variant:"selection",get bounds(){return e.selectionBounds},get visible(){return e.selectionVisible}})}}),$(W,{get when(){return Ie(()=>e.crosshairVisible===true&&e.mouseX!==void 0)()&&e.mouseY!==void 0},get children(){return $(pn,{get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},visible:true})}}),$(W,{get when(){return Ie(()=>!!e.dragVisible)()&&e.dragBounds},get children(){return $(tt,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),$(Qe,{get each(){return e.grabbedBoxes??[]},children:t=>$(tt,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),$(Qe,{get each(){return e.successLabels??[]},children:t=>$(bt,{variant:"success",get text(){return t.text},get x(){return t.x},get y(){return t.y}})}),$(W,{get when(){return Ie(()=>!!(e.labelVisible&&e.labelVariant&&e.labelText&&e.labelX!==void 0))()&&e.labelY!==void 0},get children(){return $(bt,{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}})}}),$(W,{get when(){return Ie(()=>!!(e.progressVisible&&e.progress!==void 0&&e.mouseX!==void 0))()&&e.mouseY!==void 0},get children(){return $(hn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Sn="0.5.14",Ge=`bippy-${Sn}`,yn=Object.defineProperty,Gr=Object.prototype.hasOwnProperty,Ye=()=>{},Tn=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{}},wt=(e=Se())=>"getFiberRoots"in e,xn=false,wn,ot=(e=Se())=>xn?true:(typeof e.inject=="function"&&(wn=e.inject.toString()),!!wn?.includes("(injected)")),rt=new Set,ke=new Set,Cn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Ge,checkDCE:Tn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),ke.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,rt.forEach(s=>s())),i},on:Ye,onCommitFiberRoot:Ye,onCommitFiberUnmount:Ye,onPostCommitFiberRoot:Ye,renderers:t,supportsFiber:true,supportsFlight:true};try{yn(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,c)=>{ke.add(l),s.renderers.set(c,l);}),it(e));}}});let o=window.hasOwnProperty,i=!1;yn(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{it(e);}return r},it=e=>{e&&rt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Tn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Ge,t._instrumentationIsActive=!1;let n=wt(t);if(n||(t.on=Ye),t.renderers.size){t._instrumentationIsActive=!0,rt.forEach(i=>i());return}let r=t.inject,o=ot(t);o&&!n&&(xn=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=i=>{let s=r(i);return ke.add(i),o&&t.renderers.set(s,i),t._instrumentationIsActive=!0,rt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||ot())&&e?.();}catch{}},St=()=>Gr.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Se=e=>St()?(it(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Cn(e),vn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Tt=()=>{try{vn()&&Se();}catch{}};Tt();var xt=0,Ct=1;var vt=5;var Et=11,Rt=13;var _t=15,Ot=16;var kt=19;var Nt=26,Ft=27,At=28,$t=30;var It=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?It(t.type||t.render):null},st=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=It(t);return r&&(r.displayName||r.name)||null};var Pt=e=>{let t=Se(e.onActive);t._instrumentationSource=e.name??Ge;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},at=e=>{let t=Se();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},Mt=new Set;var ro=Object.create,An=Object.defineProperty,oo=Object.getOwnPropertyDescriptor,io=Object.getOwnPropertyNames,so=Object.getPrototypeOf,ao=Object.prototype.hasOwnProperty,lo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),co=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=io(t),i=0,s=o.length,a;i<s;i++)a=o[i],!ao.call(e,a)&&a!==n&&An(e,a,{get:(l=>t[l]).bind(null,a),enumerable:!(r=oo(t,a))||r.enumerable});return e},uo=(e,t,n)=>(n=e==null?{}:ro(so(e)),co(An(n,"default",{value:e,enumerable:true}),e)),fo=()=>{let e=Se();for(let t of [...Array.from(ke),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},En=e=>{for(let t of ke){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Te=e=>`
|
|
10
|
-
in ${e}`,
|
|
11
|
-
`),
|
|
12
|
-
`),S=0,
|
|
13
|
-
${
|
|
9
|
+
var Mr=(e,t)=>e===t;var Pr=Symbol("solid-track"),rt={equals:Mr},yn=xn,le=1,Ye=2,wn={owned:null,cleanups:null,context:null,owner:null};var P=null,b=null,Ie=null,V=null,K=null,Q=null,it=0;function Ae(e,t){let n=V,r=P,o=e.length===0,i=t===void 0?r:t,s=o?wn:{owned:null,cleanups:null,context:i?i.context:null,owner:i},a=o?e:()=>e(()=>ie(()=>ve(s)));P=s,V=null;try{return ye(a,!0)}finally{V=n,P=r;}}function $(e,t){t=t?Object.assign({},rt,t):rt;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Cn(n,o));return [Tn.bind(n),r]}function se(e,t,n){let r=_t(e,t,false,le);ze(r);}function te(e,t,n){yn=jr;let r=_t(e,t,false,le);(r.user=true),Q?Q.push(r):ze(r);}function z(e,t,n){n=n?Object.assign({},rt,n):rt;let r=_t(e,t,true,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,ze(r),Tn.bind(r)}function ie(e){if(V===null)return e();let t=V;V=null;try{return Ie?Ie.untrack(e):e()}finally{V=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=ie(()=>t(a,o,s));return o=a,l}}function Sn(e){te(()=>ie(e));}function ce(e){return P===null||(P.cleanups===null?P.cleanups=[e]:P.cleanups.push(e)),e}$(false);function Tn(){let e=b;if(this.sources&&(this.state))if((this.state)===le)ze(this);else {let t=K;K=null,ye(()=>ot(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&&b.sources.has(this)?this.tValue:this.value}function Cn(e,t,n){let r=e.value;if(!e.comparator||!e.comparator(r,t)){e.value=t;e.observers&&e.observers.length&&ye(()=>{for(let o=0;o<e.observers.length;o+=1){let i=e.observers[o],s=b&&b.running;s&&b.disposed.has(i)||((s?!i.tState:!i.state)&&(i.pure?K.push(i):Q.push(i),i.observers&&vn(i)),s?i.tState=le:i.state=le);}if(K.length>1e6)throw K=[],new Error},false);}return t}function ze(e){if(!e.fn)return;ve(e);let t=it;gn(e,e.value,t);}function gn(e,t,n){let r,o=P,i=V;V=P=e;try{r=e.fn(t);}catch(s){return e.pure&&((e.state=le,e.owned&&e.owned.forEach(ve),e.owned=null)),e.updatedAt=n+1,At(s)}finally{V=i,P=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Cn(e,r):e.value=r,e.updatedAt=n);}function _t(e,t,n,r=le,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!==wn&&(P.owned?P.owned.push(i):P.owned=[i]),Ie);return i}function Ge(e){let t=b;if((e.state)===0)return;if((e.state)===Ye)return ot(e);if(e.suspense&&ie(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<it);){(e.state)&&n.push(e);}for(let r=n.length-1;r>=0;r--){if(e=n[r],t);if((e.state)===le)ze(e);else if((e.state)===Ye){let o=K;K=null,ye(()=>ot(e,n[0]),false),K=o;}}}function ye(e,t){if(K)return e();let n=false;t||(K=[]),Q?n=true:Q=[],it++;try{let r=e();return Hr(n),r}catch(r){n||(Q=null),K=null,At(r);}}function Hr(e){if(K&&(xn(K),K=null),e)return;let n=Q;Q=null,n.length&&ye(()=>yn(n),false);}function xn(e){for(let t=0;t<e.length;t++)Ge(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:Ge(r);}for(t=0;t<n;t++)Ge(e[t]);}function ot(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===le?o!==t&&(!o.updatedAt||o.updatedAt<it)&&Ge(o):i===Ye&&ot(o,t);}}}function vn(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):Q.push(r),r.observers&&vn(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 At(e,t=P){let r=Vr(e);throw r;}var Yr=Symbol("fallback");function bn(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 ce(()=>bn(i)),()=>{let l=e()||[],f=l.length,d,g;return l[Pr],ie(()=>{let x,S,C,R,T,A,O,N,_;if(f===0)s!==0&&(bn(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(p);s=f;}else {for(C=new Array(f),R=new Array(f),a&&(T=new Array(f)),A=0,O=Math.min(s,f);A<O&&r[A]===l[A];A++);for(O=s-1,N=f-1;O>=A&&N>=A&&r[O]===l[N];O--,N--)C[N]=o[O],R[N]=i[O],a&&(T[N]=a[O]);for(x=new Map,S=new Array(N+1),g=N;g>=A;g--)_=l[g],d=x.get(_),S[g]=d===void 0?-1:d,x.set(_,g);for(d=A;d<=O;d++)_=r[d],g=x.get(_),g!==void 0&&g!==-1?(C[g]=o[d],R[g]=i[d],a&&(T[g]=a[d]),g=S[g],x.set(_,g)):i[d]();for(g=A;g<f;g++)g in C?(o[g]=C[g],i[g]=R[g],a&&(a[g]=T[g],a[g](g))):o[g]=Ae(p);o=o.slice(0,s=f),r=l.slice(0);}return o});function p(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 ie(()=>e(t||{}))}var zr=e=>`Stale read from <${e}>.`;function st(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?ie(()=>i(t?o:()=>{if(!ie(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 d=i<r?a?n[a-1].nextSibling:n[i-a]:l;for(;a<i;)e.insertBefore(n[a++],d);}else if(i===a)for(;s<o;)(!f||!f.has(t[s]))&&t[s].remove(),s++;else if(t[s]===n[i-1]&&n[a]===t[o-1]){let d=t[--o].nextSibling;e.insertBefore(n[a++],t[s++].nextSibling),e.insertBefore(n[--i],d),t[o]=n[i];}else {if(!f){f=new Map;let g=a;for(;g<i;)f.set(n[g],g++);}let d=f.get(t[s]);if(d!=null)if(a<d&&d<i){let g=s,p=1,x;for(;++g<o&&g<i&&!((x=f.get(t[g]))==null||x!==d+p);)p++;if(p>d-a){let S=t[s];for(;a<d;)e.insertBefore(n[a++],S);}else e.replaceChild(n[a++],t[s++]);}else s++;else t[s++].remove();}}}function On(e,t,n,r={}){let o;return Ae(i=>{o=i,t===document?e():we(t,e(),t.firstChild?null:void 0,n);},r.owner),()=>{o(),t.textContent="";}}function re(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 lt(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 ie(()=>e(t,n))}function we(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return at(e,t,r,n);se(o=>at(e,t(),o,n),r);}function at(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 se(()=>{let l=t();for(;typeof l=="function";)l=l();n=at(e,l,n,r);}),()=>n;if(Array.isArray(t)){let l=[],f=n&&Array.isArray(n);if(Ft(l,t,n,o))return se(()=>n=at(e,l,n,r,true)),()=>n;if(l.length===0){if(n=Me(e,n,r),a)return n}else f?n.length===0?Rn(e,l,r):Wr(e,n,l):(n&&Me(e),Rn(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 Ft(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=Ft(e,a,l)||o;else if(f==="function")if(r){for(;typeof a=="function";)a=a();o=Ft(e,Array.isArray(a)?a:[a],Array.isArray(l)?l:[l])||o;}else e.push(a),o=true;else {let d=String(a);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d));}}return o}function Rn(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)},_n=e=>eo(e,Zr);var Le="data-react-grab",An=()=>{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 fe=(e,t,n)=>e+(t-e)*n;var no=re("<div>"),ct=e=>{let[t,n]=$(e.bounds.x),[r,o]=$(e.bounds.y),[i,s]=$(e.bounds.width),[a,l]=$(e.bounds.height),[f,d]=$(1),g=false,p=null,x=null,S=e.bounds,C=false,R=()=>e.lerpFactor!==void 0?e.lerpFactor:e.variant==="drag"?.7:.95,T=()=>{if(C)return;C=true;let N=()=>{let _=fe(t(),S.x,R()),L=fe(r(),S.y,R()),ne=fe(i(),S.width,R()),oe=fe(a(),S.height,R());n(_),o(L),s(ne),l(oe),Math.abs(_-S.x)<.5&&Math.abs(L-S.y)<.5&&Math.abs(ne-S.width)<.5&&Math.abs(oe-S.height)<.5?(p=null,C=false):p=requestAnimationFrame(N);};p=requestAnimationFrame(N);};te(Ee(()=>e.bounds,N=>{if(S=N,!g){n(S.x),o(S.y),s(S.width),l(S.height),g=true;return}T();})),te(()=>{e.variant==="grabbed"&&e.createdAt&&(x=window.setTimeout(()=>{d(0);},1500));}),ce(()=>{p!==null&&(cancelAnimationFrame(p),p=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"},O=()=>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 N=no();return se(_=>lt(N,{...A,...O(),top:`${r()}px`,left:`${t()}px`,width:`${i()}px`,height:`${a()}px`,"border-radius":e.bounds.borderRadius,transform:e.bounds.transform,opacity:f()},_)),N}})};var ro=re('<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">'),Fn=e=>{let t;return Sn(()=>{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,se(o=>lt(n,{...e.style},o)),n})()};var ut=(e,t,n,r)=>{let o=window.innerWidth,i=window.innerHeight,s=8,a=8,l=o-n-8,f=i-r-8,d=Math.max(s,Math.min(e,l)),g=Math.max(a,Math.min(t,f));return {left:d,top:g}};var oo=re("<span style=display:inline-block;margin-right:4px;font-weight:600>\u2713"),io=re("<div style=margin-right:4px>Copied"),so=re(`<span style="font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;font-variant-numeric:tabular-nums">`),ao=re("<div style=margin-left:4px>to clipboard"),lo=re(`<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">`),$t=e=>{let[t,n]=$(0),[r,o]=$(0),i,s=e.x,a=e.y,l=e.x,f=e.y,d=null,g=false,p=()=>{s=fe(s,l,.3),a=fe(a,f,.3),o(A=>A+1),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(p);},x=()=>{d===null&&(d=requestAnimationFrame(p));},S=()=>{if(l=e.x,f=e.y,!g){s=l,a=f,g=true,o(T=>T+1);return}x();};te(Ee(()=>e.visible,T=>{if(T!==false)requestAnimationFrame(()=>{n(1);});else {n(0);return}if(e.variant==="success"){let A=setTimeout(()=>{n(0);},1700);ce(()=>clearTimeout(A));}})),te(()=>{S();}),ce(()=>{d!==null&&(cancelAnimationFrame(d),d=null);});let C=()=>i?.getBoundingClientRect(),R=()=>{r();let T=C();if(!T)return {left:s,top:a};let A=window.innerWidth,O=window.innerHeight,N=[{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 N){let ne=L.left>=8&&L.left+T.width<=A-8,oe=L.top>=8&&L.top+T.height<=O-8;if(ne&&oe)return L}let _=ut(N[0].left,N[0].top,T.width,T.height);return _.left+=4,_.top+=4,_};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,we(T,k(q,{get when(){return e.variant==="processing"},get children(){return k(Fn,{})}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return oo()}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return io()}}),null),we(T,k(q,{get when(){return e.variant==="processing"},children:"Grabbing\u2026"}),null),we(T,k(q,{get when(){return e.variant!=="processing"},get children(){var O=so();return we(O,()=>e.text),O}}),null),we(T,k(q,{get when(){return e.variant==="success"},get children(){return ao()}}),null),se(O=>{var N=`${R().top}px`,_=`${R().left}px`,L=e.zIndex?.toString()??"2147483647",ne=t();return N!==O.e&&pe(T,"top",O.e=N),_!==O.t&&pe(T,"left",O.t=_),L!==O.a&&pe(T,"z-index",O.a=L),ne!==O.o&&pe(T,"opacity",O.o=ne),O},{e:void 0,t:void 0,a:void 0,o:void 0}),T}})};var co=re('<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 te(Ee(()=>e,r=>{r!==false?requestAnimationFrame(()=>{n(1);}):n(0);})),t},kn=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 ut(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,se(l=>{var f=`${r().top}px`,d=`${r().left}px`,g=t(),p=`${Math.min(100,Math.max(0,e.progress*100))}%`;return f!==l.e&&pe(o,"top",l.e=f),d!==l.t&&pe(o,"left",l.t=d),g!==l.a&&pe(o,"opacity",l.a=g),p!==l.o&&pe(s,"width",l.o=p),l},{e:void 0,t:void 0,a:void 0,o:void 0}),o}})};var fo=re("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>"),In=e=>{let t,n=null,r=0,o=0,i=1,s=e.mouseX,a=e.mouseY,l=e.mouseX,f=e.mouseY,d=null,g=false,p=()=>{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=fe(s,l,.3),a=fe(a,f,.3),x(),Math.abs(s-l)<.5&&Math.abs(a-f)<.5?d=null:d=requestAnimationFrame(S);},C=()=>{d===null&&(d=requestAnimationFrame(S));},R=()=>{if(l=e.mouseX,f=e.mouseY,!g){s=l,a=f,g=true,x();return}C();};return te(()=>{p(),x();let T=()=>{p(),x();};window.addEventListener("resize",T),ce(()=>{window.removeEventListener("resize",T),d!==null&&(cancelAnimationFrame(d),d=null);});}),te(()=>{R();}),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 Mn=e=>[k(q,{get when(){return Pe(()=>!!e.selectionVisible)()&&e.selectionBounds},get children(){return k(ct,{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(In,{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(ct,{variant:"drag",get bounds(){return e.dragBounds},get visible(){return e.dragVisible}})}}),k(st,{get each(){return e.grabbedBoxes??[]},children:t=>k(ct,{variant:"grabbed",get bounds(){return t.bounds},get createdAt(){return t.createdAt}})}),k(st,{get each(){return e.successLabels??[]},children:t=>k($t,{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($t,{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(kn,{get progress(){return e.progress},get mouseX(){return e.mouseX},get mouseY(){return e.mouseY},get visible(){return e.progressVisible}})}})];var Dn="0.5.14",Xe=`bippy-${Dn}`,Pn=Object.defineProperty,mo=Object.prototype.hasOwnProperty,qe=()=>{},Hn=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{}},kt=(e=Se())=>"getFiberRoots"in e,Bn=false,Ln,mt=(e=Se())=>Bn?true:(typeof e.inject=="function"&&(Ln=e.inject.toString()),!!Ln?.includes("(injected)")),dt=new Set,Fe=new Set,jn=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:Xe,checkDCE:Hn,hasUnsupportedRendererAttached:false,inject(o){let i=++n;return t.set(i,o),Fe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,dt.forEach(s=>s())),i},on:qe,onCommitFiberRoot:qe,onCommitFiberUnmount:qe,onPostCommitFiberRoot:qe,renderers:t,supportsFiber:true,supportsFlight:true};try{Pn(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);}),ht(e));}}});let o=window.hasOwnProperty,i=!1;Pn(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{ht(e);}return r},ht=e=>{e&&dt.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Hn,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Xe,t._instrumentationIsActive=!1;let n=kt(t);if(n||(t.on=qe),t.renderers.size){t._instrumentationIsActive=!0,dt.forEach(i=>i());return}let r=t.inject,o=mt(t);o&&!n&&(Bn=!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,dt.forEach(a=>a()),s};}(t.renderers.size||t._instrumentationIsActive||mt())&&e?.();}catch{}},It=()=>mo.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Se=e=>It()?(ht(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):jn(e),Vn=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Mt=()=>{try{Vn()&&Se();}catch{}};Mt();var gt=0,pt=1;var bt=5;var yt=11,Pt=13,Yn=14,wt=15,Lt=16;var Dt=19;var St=26,Tt=27,Ht=28,Bt=30;var jt=e=>{switch(e.tag){case bt:case St:case Tt:return true;default:return typeof e.type=="string"}},We=e=>{switch(e.tag){case pt:case yt:case gt:case Yn:case wt:return true;default:return false}};function De(e,t,n=false){return e&&t(e)instanceof Promise?Yt(e,t,n):Vt(e,t,n)}var Vt=(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=Vt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},Yt=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 Yt(r,t,n);if(o)return o;r=n?null:r.sibling;}return null};var Gt=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?Gt(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=Gt(t);return r&&(r.displayName||r.name)||null};var Ut=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 Ct){let r=De(n.current,o=>{if(o===e)return true});if(r)return r}return e};var zt=e=>{let t=Se(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=Se();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},Ct=new Set;var Co=Object.create,Zn=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&&Zn(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(Zn(n,"default",{value:e,enumerable:true}),e)),Ao=()=>{let e=Se();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},Gn=e=>{for(let t of Fe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},Te=e=>`
|
|
10
|
+
in ${e}`,Fo=(e,t)=>{let n=Te(e);return t&&(n+=` (at ${t})`),n},qt=false,Xt=(e,t)=>{if(!e||qt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,qt=true;let r=Ao();Gn(null);let o=console.error,i=console.warn;console.error=()=>{},console.warn=()=>{};try{let l={DetermineComponentFrameRoot(){let p;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){p=S;}Reflect.construct(e,[],x);}else {try{x.call();}catch(S){p=S;}e.call(x.prototype);}}else {try{throw Error()}catch(S){p=S;}let x=e();x&&typeof x.catch=="function"&&x.catch(()=>{});}}catch(x){if(x instanceof Error&&p instanceof Error&&typeof x.stack=="string")return [x.stack,p.stack]}return [null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[d,g]=l.DetermineComponentFrameRoot();if(d&&g){let p=d.split(`
|
|
11
|
+
`),x=g.split(`
|
|
12
|
+
`),S=0,C=0;for(;S<p.length&&!p[S].includes("DetermineComponentFrameRoot");)S++;for(;C<x.length&&!x[C].includes("DetermineComponentFrameRoot");)C++;if(S===p.length||C===x.length)for(S=p.length-1,C=x.length-1;S>=1&&C>=0&&p[S]!==x[C];)C--;for(;S>=1&&C>=0;S--,C--)if(p[S]!==x[C]){if(S!==1||C!==1)do if(S--,C--,C<0||p[S]!==x[C]){let R=`
|
|
13
|
+
${p[S].replace(" at new "," at ")}`,T=He(e);return T&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",T)),R}while(S>=1&&C>=0);break}}}finally{qt=false,Error.prepareStackTrace=n,Gn(r),console.error=o,console.warn=i;}let s=e?He(e):"";return s?Te(s):""},$o=(e,t)=>{let n=e.tag,r="";switch(n){case Ht:r=Te("Activity");break;case pt:r=Xt(e.type,true);break;case yt:r=Xt(e.type.render,false);break;case gt:case wt:r=Xt(e.type,false);break;case bt:case St:case Tt:r=Te(e.type);break;case Lt:r=Te("Lazy");break;case Pt:r=e.child!==t&&t!==null?Te("Suspense Fallback"):Te("Suspense");break;case Dt:r=Te("SuspenseList");break;case Bt:r=Te("ViewTransition");break;default:return ""}return r},ko=e=>{try{let t="",n=e,r=null;do{t+=$o(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+=Fo(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}`:""}},Io=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(xo);s&&(r=s[1]||s[2]);}if(!r)return null;let o=Mn.test(r);if(!(To.test(r)||o||r.startsWith("/"))){let i=e.split("/");i[i.length-1]=r,r=i.join("/");}return r},Ro=e=>({file:e.file,mappings:(0, Pn.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),_o=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, Pn.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}},kn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(Mn);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Oo=async(e,t=fetch)=>{if(!kn(e))return null;let n;try{n=await(await t(e)).text();}catch{return null}if(!n)return null;let r=Eo(e,n);if(!r||!kn(r))return null;try{let o=await t(r),i=await o.json();return "sections"in i?_o(i):Ro(i)}catch{return null}},ko=async(e,t=true,n)=>{if(t&&Ue.has(e)){let i=Ue.get(e);if(i==null)return null;if(Co(i)){let s=i.deref();if(s)return s;Ue.delete(e);}else return i}if(t&<.has(e))return lt.get(e);let r=Oo(e,n);t&<.set(e,r);let o=await r;return t&<.delete(e),t&&(o===null?Ue.set(e,null):Ue.set(e,Ln?new WeakRef(o):o)),o},Nn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,No=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Fn="about://React/",Fo=["<anonymous>","eval",""],Ao=/\.(jsx|tsx|ts|js)$/,$o=/(\.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,Io=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,Po=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string";var Dn=e=>Po(e)?po(e._debugStack.stack):ho(e);var Hn=async(e,t=1,n=true,r)=>{let o=wo(e,{slice:t??1}),i=[];for(let s of o){if(!s?.file)continue;let a=await ko(s.file,n,r);if(a&&typeof s.line=="number"&&typeof s.col=="number"){let l=vo(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},Bt=e=>{if(!e||Fo.includes(e))return "";let t=e;if(t.startsWith(Fn)){let r=t.slice(Fn.length),o=r.indexOf("/"),i=r.indexOf(":");t=o!==-1&&(i===-1||o<i)?r.slice(o+1):r;}for(let r of No)if(t.startsWith(r)){t=t.slice(r.length),r==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`);break}if(Nn.test(t)){let r=t.match(Nn);r&&(t=t.slice(r[0].length));}let n=t.indexOf("?");if(n!==-1){let r=t.slice(n);Io.test(r)&&(t=t.slice(0,n));}return t},Bn=e=>{let t=Bt(e);return !(!t||!Ao.test(t)||$o.test(t))};Pt({onCommitFiberRoot(e,t){Mt.add(t);}});var jn=async e=>{let t=at(e);if(!t)return null;let n=Dn(t),r=await Hn(n,Number.MAX_SAFE_INTEGER);return r?(console.log(r),r.map(o=>({...o,fileName:Bt(o.fileName)})).filter(o=>Bn(o.fileName))):null};var Vn=e=>{let t=new Set(["article","aside","footer","form","header","main","nav","section"]),n=p=>{let d=p.tagName.toLowerCase();if(t.has(d)||p.id)return true;if(p.className&&typeof p.className=="string"){let b=p.className.trim();if(b&&b.length>0)return true}return Array.from(p.attributes).some(b=>b.name.startsWith("data-"))},r=(p,d=10)=>{let b=[],w=p.parentElement,_=0;for(;w&&_<d&&w.tagName!=="BODY"&&!(n(w)&&(b.push(w),b.length>=3));)w=w.parentElement,_++;return b.reverse()},o=p=>{let d=[],b=p,w=0,_=5;for(;b&&w<_&&b.tagName!=="BODY";){let O=b.tagName.toLowerCase();if(b.id){O+=`#${b.id}`,d.unshift(O);break}else if(b.className&&typeof b.className=="string"&&b.className.trim()){let F=b.className.trim().split(/\s+/).slice(0,2);O+=`.${F.join(".")}`;}if(!b.id&&(!b.className||!b.className.trim())&&b.parentElement){let F=Array.from(b.parentElement.children),N=F.indexOf(b);N>=0&&F.length>1&&(O+=`:nth-child(${N+1})`);}d.unshift(O),b=b.parentElement,w++;}return d.join(" > ")},i=(p,d=false)=>{let b=p.tagName.toLowerCase(),w=[];if(p.id&&w.push(`id="${p.id}"`),p.className&&typeof p.className=="string"){let N=p.className.trim().split(/\s+/);if(N.length>0&&N[0]){let te=(d?N.slice(0,3):N).join(" ");te.length>30&&(te=te.substring(0,30)+"..."),w.push(`class="${te}"`);}}let _=Array.from(p.attributes).filter(N=>N.name.startsWith("data-")),O=d?_.slice(0,1):_;for(let N of O){let U=N.value;U.length>20&&(U=U.substring(0,20)+"..."),w.push(`${N.name}="${U}"`);}let F=p.getAttribute("aria-label");if(F&&!d){let N=F;N.length>20&&(N=N.substring(0,20)+"..."),w.push(`aria-label="${N}"`);}return w.length>0?`<${b} ${w.join(" ")}>`:`<${b}>`},s=p=>`</${p.tagName.toLowerCase()}>`,a=p=>{let d=p.textContent||"";d=d.trim().replace(/\s+/g," ");let b=60;return d.length>b&&(d=d.substring(0,b)+"..."),d},l=p=>{if(p.id)return `#${p.id}`;if(p.className&&typeof p.className=="string"){let d=p.className.trim().split(/\s+/);if(d.length>0&&d[0])return `.${d[0]}`}return null},c=[];c.push(`Path: ${o(e)}`),c.push("");let f=r(e);for(let p=0;p<f.length;p++){let d=" ".repeat(p);c.push(d+i(f[p],true));}let g=e.parentElement,v=-1;if(g){let p=Array.from(g.children);if(v=p.indexOf(e),v>0){let d=p[v-1];if(l(d)&&v<=2){let w=" ".repeat(f.length);c.push(`${w} ${i(d,true)}`),c.push(`${w} </${d.tagName.toLowerCase()}>`);}else if(v>0){let w=" ".repeat(f.length);c.push(`${w} ... (${v} element${v===1?"":"s"})`);}}}let C=" ".repeat(f.length);c.push(C+" <!-- SELECTED -->");let S=a(e),E=e.children.length;if(S&&E===0&&S.length<40?c.push(`${C} ${i(e)}${S}${s(e)}`):(c.push(C+" "+i(e)),S&&c.push(`${C} ${S}`),E>0&&c.push(`${C} ... (${E} element${E===1?"":"s"})`),c.push(C+" "+s(e))),g&&v>=0){let p=Array.from(g.children),d=p.length-v-1;if(d>0){let b=p[v+1];l(b)&&d<=2?(c.push(`${C} ${i(b,true)}`),c.push(`${C} </${b.tagName.toLowerCase()}>`)):c.push(`${C} ... (${d} element${d===1?"":"s"})`);}}for(let p=f.length-1;p>=0;p--){let d=" ".repeat(p);c.push(d+s(f[p]));}return c.join(`
|
|
23
|
-
`)};var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
Component owner stack:
|
|
27
|
-
${Y}`}return R},Ne=m=>(m.tagName||"").toLowerCase(),Me=async m=>{let R=m.getBoundingClientRect(),P=Ne(m);q(Yt(m));try{let Y=await ge(m),z=se(Y),oe=xe([{tagName:P,content:await ge(m),computedStyles:_e(m)}]);await jt([z,oe]);}catch{}L(P?`<${P}>`:"<element>",R.left,R.top);},he=async m=>{if(m.length===0)return;let R=1/0,P=1/0;for(let Y of m){let z=Y.getBoundingClientRect();R=Math.min(R,z.left),P=Math.min(P,z.top),q(Yt(Y));}try{let z=(await Promise.all(m.map(Le=>ge(Le)))).join(`
|
|
18
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},Mo=/(^|@)\S+:\d+/,Jn=/^\s*at .*(\S+:\d+|\(native\))/m,Po=/^(eval@)?(\[native code\])?$/;var Qn=(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=Un(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(Mo)){let i=zn(o,void 0)[0];i&&r.push(i);}return Wt(r,t)}return e.match(Jn)?Un(e,t):zn(e,t)},er=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]},Wt=(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 Un=(e,t)=>Wt(e.split(`
|
|
20
|
+
`).filter(r=>!!r.match(Jn)),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=er(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)=>Wt(e.split(`
|
|
21
|
+
`).filter(r=>!r.match(Po)),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=er(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 Lo=Oo((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 D=w.next();y=a[D],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 d(w,u){return w.pos>=u?false:w.peek()!==r}let g=1024*16,p=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+=p.decode(c),this.pos=0);}flush(){let{buffer:u,out:c,pos:m}=this;return m>0?c+p.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 R(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0;for(;c.pos<u;c.pos++){E=l(c,E);let D=l(c,0);if(!d(c,u)){let U=y.pop();U[2]=E,U[3]=D;continue}let I=l(c,0),M=l(c,0),B=M&1,H=B?[E,D,0,0,I,l(c,0)]:[E,D,0,0,I],Y=C;if(d(c,u)){Y=[];do{let U=l(c,0);Y.push(U);}while(d(c,u))}H.vars=Y,m.push(H),y.push(H);}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:D,2:I,3:M,4:B,vars:H}=y;u>0&&c.write(r),m[0]=f(c,E,m[0]),f(c,D,0),f(c,B,0);let Y=y.length===6?1:0;f(c,Y,0),y.length===6&&f(c,y[5],0);for(let U of H)f(c,U,0);for(u++;u<w.length;){let U=w[u],{0:F,1:j}=U;if(F>I||F===I&&j>=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 O(w){let{length:u}=w,c=new S(w),m=[],y=[],E=0,D=0,I=0,M=0,B=0,H=0,Y=0,U=0;do{let F=c.indexOf(";"),j=0;for(;c.pos<F;c.pos++){if(j=l(c,j),!d(c,F)){let ee=y.pop();ee[2]=E,ee[3]=j;continue}let J=l(c,0),$e=J&1,Oe=J&2,xe=J&4,je=null,ke=C,me;if($e){let ee=l(c,D);I=l(c,D===ee?I:0),D=ee,me=[E,j,0,0,ee,I];}else me=[E,j,0,0];if(me.isScope=!!xe,Oe){let ee=M,he=B;M=l(c,M);let be=ee===M;B=l(c,be?B:0),H=l(c,be&&he===B?H:0),je=[M,B,H];}if(me.callsite=je,d(c,F)){ke=[];do{Y=E,U=j;let ee=l(c,0),he;if(ee<-1){he=[[l(c,0)]];for(let be=-1;be>ee;be--){let vt=Y;Y=l(c,Y),U=l(c,Y===vt?U:0);let tt=l(c,0);he.push([tt,Y,U]);}}else he=[[ee]];ke.push(he);}while(d(c,F))}me.bindings=ke,m.push(me),y.push(me);}E++,c.pos=F+1;}while(c.pos<u);return m}function N(w){if(w.length===0)return "";let u=new x;for(let c=0;c<w.length;)c=_(w,c,u,[0,0,0,0,0,0,0]);return u.flush()}function _(w,u,c,m){let y=w[u],{0:E,1:D,2:I,3:M,isScope:B,callsite:H,bindings:Y}=y;m[0]<E?(L(c,m[0],E),m[0]=E,m[1]=0):u>0&&c.write(r),m[1]=f(c,y[1],m[1]);let U=(y.length===6?1:0)|(H?2:0)|(B?4:0);if(f(c,U,0),y.length===6){let{4:F,5:j}=y;F!==m[2]&&(m[3]=0),m[2]=f(c,F,m[2]),m[3]=f(c,j,m[3]);}if(H){let{0:F,1:j,2:J}=y.callsite;F===m[4]?j!==m[5]&&(m[6]=0):(m[5]=0,m[6]=0),m[4]=f(c,F,m[4]),m[5]=f(c,j,m[5]),m[6]=f(c,J,m[6]);}if(Y)for(let F of Y){F.length>1&&f(c,-F.length,0);let j=F[0][0];f(c,j,0);let J=E,$e=D;for(let Oe=1;Oe<F.length;Oe++){let xe=F[Oe];J=f(c,xe[1],J),$e=f(c,xe[2],$e),f(c,xe[0],0);}}for(u++;u<w.length;){let F=w[u],{0:j,1:J}=F;if(j>I||j===I&&J>=M)break;u=_(w,u,c,m);}return m[0]<I?(L(c,m[0],I),m[0]=I,m[1]=0):c.write(r),m[1]=f(c,M,m[1]),u}function L(w,u,c){do w.write(o);while(++u<c)}function ne(w){let{length:u}=w,c=new S(w),m=[],y=0,E=0,D=0,I=0,M=0;do{let B=c.indexOf(";"),H=[],Y=true,U=0;for(y=0;c.pos<B;){let F;y=l(c,y),y<U&&(Y=false),U=y,d(c,B)?(E=l(c,E),D=l(c,D),I=l(c,I),d(c,B)?(M=l(c,M),F=[y,E,D,I,M]):F=[y,E,D,I]):F=[y],H.push(F),c.pos++;}Y||oe(H),m.push(H),c.pos=B+1;}while(c.pos<=u);return m}function oe(w){w.sort(ae);}function ae(w,u){return w[0]-u[0]}function Ce(w){let u=new x,c=0,m=0,y=0,E=0;for(let D=0;D<w.length;D++){let I=w[D];if(D>0&&u.write(o),I.length===0)continue;let M=0;for(let B=0;B<I.length;B++){let H=I[B];B>0&&u.write(r),M=f(u,H[0],M),H.length!==1&&(c=f(u,H[1],c),m=f(u,H[2],m),y=f(u,H[3],y),H.length!==4&&(E=f(u,H[4],E)));}}return u.flush()}n.decode=ne,n.decodeGeneratedRanges=O,n.decodeOriginalScopes=R,n.encode=Ce,n.encodeGeneratedRanges=N,n.encodeOriginalScopes=T,Object.defineProperty(n,"__esModule",{value:true});});}),tr=_o(Lo()),nr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Do=/^data:application\/json[^,]+base64,/,Ho=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,rr=typeof WeakRef<"u",Ze=new Map,xt=new Map,Bo=e=>rr&&e instanceof WeakRef,qn=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let i=null;for(let d of o)if(d[0]<=r)i=d;else break;if(!i||i.length<4)return null;let[,s,a,l]=i;if(s===void 0||a===void 0||l===void 0)return null;let f=t[s];return f?{columnNumber:l,fileName:f,lineNumber:a+1}:null},jo=(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 qn(r.map.mappings,r.map.sources,o,i)}return qn(e.mappings,e.sources,t-1,n)},Vo=(e,t)=>{let n=t.split(`
|
|
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=nr.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, tr.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, tr.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}},Xn=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(nr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},Uo=async(e,t=fetch)=>{if(!Xn(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||!Xn(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&&Ze.has(e)){let i=Ze.get(e);if(i==null)return null;if(Bo(i)){let s=i.deref();if(s)return s;Ze.delete(e);}else return i}if(t&&xt.has(e))return xt.get(e);let r=Uo(e,n);t&&xt.set(e,r);let o=await r;return t&&xt.delete(e),t&&(o===null?Ze.set(e,null):Ze.set(e,rr?new WeakRef(o):o)),o},Wn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,qo=["rsc://","file:///","webpack://","node:","turbopack://","metro://"],Kn="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=or(e);return ir(r,void 0,t,n)},or=e=>Jo(e)?Io(e._debugStack.stack):ko(e),ti=async(e,t=true,n)=>{let r=await ir(e,1,t,n);return !r||r.length===0?null:r[0]},ir=async(e,t=1,n=true,r)=>{let o=Qn(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(Kn)){let r=t.slice(Kn.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(Wn.test(t)){let r=t.match(Wn);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},Kt=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(We(s))return true},true);if(r){let s=await ei(r,t,n);if(s?.fileName){let a=Be(s.fileName);if(Kt(a))return {fileName:a,lineNumber:s.lineNumber,columnNumber:s.columnNumber,functionName:s.functionName}}}let o=Qn(or(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},sr=async(e,t=true,n)=>{let r=Ke(e);if(!r||!jt(r))return null;let o=Ut(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-")&&Je(e);let r=Je(t)&&t.length<100;return r||=t.startsWith("#")&&Je(t.slice(1)),n&&r}function ii(e){return Je(e)}function si(e){return Je(e)}function ai(e){return true}function lr(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 Qe(g)}if(a++,Qt(f,i)){s=f;break}}if(!s)throw new Error("Selector was not found.");let l=[...fr(s,e,o,i,r)];return l.sort(Zt),l.length>0?Qe(l[0]):Qe(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(...ur(r)),s>=t.seedMinLength){o.sort(Zt);for(let l of o)yield l;o=[];}}o.sort(Zt);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 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=Jt(e,o);s!==void 0&&n.push({name:cr(o,s),penalty:10});}let i=Jt(e);return i!==void 0&&n.push({name:fi(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 ar(e){return e.map(t=>t.penalty).reduce((t,n)=>t+n,0)}function Zt(e,t){return ar(e)-ar(t)}function Jt(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=Jt(r,i);if(s===void 0)return;o.push({name:cr(i,s),penalty:NaN,level:n}),r=r.parentElement,n++;}if(Qt(o,t))return o}function fi(e,t){return e==="html"?"html":`${e}:nth-child(${t})`}function cr(e,t){return e==="html"?"html":`${e}:nth-of-type(${t})`}function*ur(e,t=[]){if(e.length>0)for(let n of e[0])yield*ur(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 Qt(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*fr(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),Qt(a,r)&&r.querySelector(Qe(a))===t&&(yield a,yield*fr(a,t,n,r,o));}}zt({onCommitFiberRoot(e,t){Ct.add(t);}});var mi=e=>lr(e),en=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 De(c,y=>{if(We(y)){let E=He(y);if(E&&!n(E))return m=E,true}return false},true),m},o=async u=>{let c=await sr(u);if(!c)return null;let m=Be(c.fileName);return Kt(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 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?`<${m} ${y.join(" ")}>`:`<${m}>`},f=u=>`</${u.tagName.toLowerCase()}>`,d=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},p=[],x=mi(e);p.push("Locate this element in the codebase:"),p.push(`- selector: ${x}`);let S=e.getBoundingClientRect();p.push(`- width: ${Math.round(S.width)}`),p.push(`- height: ${Math.round(S.height)}`),p.push("HTML snippet:"),p.push("```html");let C=a(e),R=C.map(u=>r(u)),T=r(e),A=await Promise.all(C.map(u=>o(u))),O=await o(e);for(let u=0;u<C.length;u++){let c=" ".repeat(u),m=R[u],y=A[u];m&&y&&(u===0||R[u-1]!==m)&&p.push(`${c}<${m} source="${y}">`),p.push(`${c}${l(C[u],true)}`);}let N=e.parentElement,_=-1;if(N){let u=Array.from(N.children);if(_=u.indexOf(e),_>0){let c=u[_-1];if(g(c)&&_<=2){let y=" ".repeat(C.length);p.push(`${y} ${l(c,true)}`),p.push(`${y} </${c.tagName.toLowerCase()}>`);}else if(_>0){let y=" ".repeat(C.length);p.push(`${y} ... (${_} element${_===1?"":"s"})`);}}}let L=" ".repeat(C.length),ne=C.length>0?R[R.length-1]:null,oe=T&&O&&T!==ne;oe&&p.push(`${L} <${T} used-at="${O}">`),p.push(`${L} <!-- IMPORTANT: selected element -->`);let ae=d(e),Ce=e.children.length,w=`${L}${oe?" ":" "}`;if(ae&&Ce===0&&ae.length<40?p.push(`${w}${l(e)}${ae}${f(e)}`):(p.push(`${w}${l(e)}`),ae&&p.push(`${w} ${ae}`),Ce>0&&p.push(`${w} ... (${Ce} element${Ce===1?"":"s"})`),p.push(`${w}${f(e)}`)),oe&&p.push(`${L} </${T}>`),N&&_>=0){let u=Array.from(N.children),c=u.length-_-1;if(c>0){let m=u[_+1];g(m)&&c<=2?(p.push(`${L} ${l(m,true)}`),p.push(`${L} </${m.tagName.toLowerCase()}>`)):p.push(`${L} ... (${c} element${c===1?"":"s"})`);}}for(let u=C.length-1;u>=0;u--){let c=" ".repeat(u);p.push(`${c}${f(C[u])}`);let m=R[u],y=A[u];m&&y&&(u===C.length-1||R[u+1]!==m)&&p.push(`${c}</${m}>`);}return p.push("```"),p.join(`
|
|
23
|
+
`)};var hi=()=>document.hasFocus()?Promise.resolve():new Promise(e=>{let t=()=>{window.removeEventListener("focus",t),e();};window.addEventListener("focus",t),window.focus();}),tn=async e=>{await hi();try{if(Array.isArray(e)){if(!navigator?.clipboard?.write){for(let t of e)if(typeof t=="string"){let n=dr(t);if(!n)return n}return !0}return await navigator.clipboard.write([new ClipboardItem(Object.fromEntries(e.map(t=>t instanceof Blob?[t.type??"text/plain",t]:["text/plain",new Blob([t],{type:"text/plain"})])))]),!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 dr(e)}}}catch{return false}},dr=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 mr=(e,t=window.getComputedStyle(e))=>t.display!=="none"&&t.visibility!=="hidden"&&t.opacity!=="0";var et=e=>{if(e.closest(`[${Le}]`))return false;let t=window.getComputedStyle(e);return !(!mr(e,t)||t.pointerEvents==="none")};var nn=(e,t)=>{let n=document.elementsFromPoint(e,t);for(let r of n)if(et(r))return r;return null};var hr=(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 d=f.getBoundingClientRect(),g=d.left,p=d.top,x=d.left+d.width,S=d.top+d.height;if(n){let C=Math.max(i,g),R=Math.max(s,p),T=Math.min(a,x),A=Math.min(l,S),O=Math.max(0,T-C),N=Math.max(0,A-R),_=O*N,L=Math.max(0,d.width*d.height);L>0&&_/L>=.75&&r.push(f);}else g<a&&x>i&&p<l&&S>s&&r.push(f);}return r},gr=e=>e.filter(t=>!e.some(n=>n!==t&&n.contains(t))),pr=(e,t,n)=>{if(e.length<=1)return null;let r=t.x,o=t.y,i=t.x+t.width,s=t.y+t.height,a=e[0];for(;a;){let l=a.parentElement;if(!l)break;let f=l.getBoundingClientRect(),d=Math.max(r,f.left),g=Math.max(o,f.top),p=Math.min(i,f.left+f.width),x=Math.min(s,f.top+f.height),S=Math.max(0,p-d),C=Math.max(0,x-g),R=S*C,T=Math.max(0,f.width*f.height);if(!(T>0&&R/T>=.75))break;if(!n(l)){a=l;continue}if(e.every(N=>l.contains(N)))return l;a=l;}return null},br=(e,t)=>{let n=hr(e,t,true),r=gr(n),o=pr(r,e,t);return o?[o]:r},yr=(e,t)=>{let n=hr(e,t,false),r=gr(n),o=pr(r,e,t);return o?[o]:r};var rn=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 gi=150,wr=e=>{let t={enabled:true,keyHoldDuration:300,...e};if(t.enabled!==false)return Ae(n=>{let[o,i]=$(false),[s,a]=$(-1e3),[l,f]=$(-1e3),[d,g]=$(false),[p,x]=$(-1e3),[S,C]=$(-1e3),[R,T]=$(false),[A,O]=$(null),[N,_]=$(null),[L,ne]=$(0),[oe,ae]=$([]),[Ce,w]=$([]),[u,c]=$(false),[m,y]=$(false),[E,D]=$(false),[I,M]=$(-1e3),[B,H]=$(-1e3),Y=null,U=null,F=null,j=null,J=z(()=>u()&&!R()),$e=z(()=>s()>-1e3&&l()>-1e3),Oe=h=>(h.metaKey||h.ctrlKey)&&h.key.toLowerCase()==="c",xe=h=>{let v=`grabbed-${Date.now()}-${Math.random()}`,G=Date.now(),W={id:v,bounds:h,createdAt:G},Z=oe();ae([...Z,W]),setTimeout(()=>{ae(ge=>ge.filter(Ve=>Ve.id!==v));},1700);},je=(h,v,G)=>{let W=`success-${Date.now()}-${Math.random()}`;w(Z=>[...Z,{id:W,text:h,x:v,y:G}]),setTimeout(()=>{w(Z=>Z.filter(ge=>ge.id!==W));},1700);},ke=h=>`<selected_element>
|
|
24
|
+
${h}
|
|
25
|
+
</selected_element>`,me=h=>{let v=window.getComputedStyle(h),G=h.getBoundingClientRect();return {width:`${Math.round(G.width)}px`,height:`${Math.round(G.height)}px`,paddingTop:v.paddingTop,paddingRight:v.paddingRight,paddingBottom:v.paddingBottom,paddingLeft:v.paddingLeft,background:v.background,opacity:v.opacity}},ee=h=>{let v={elements:h.map(Z=>({tagName:Z.tagName,content:Z.content,computedStyles:Z.computedStyles}))},W=`<div data-react-grab="${btoa(JSON.stringify(v))}"></div>`;return new Blob([W],{type:"text/html"})},he=h=>(h.tagName||"").toLowerCase(),be=async(h,v,G)=>{M(h),H(v),T(true),await G().finally(()=>{T(false);});},vt=async h=>{let v=he(h);xe(rn(h));try{let G=await en(h),W=ke(G),Z=ee([{tagName:v,content:G,computedStyles:me(h)}]);await tn([W,Z]);}catch{}je(v?`<${v}>`:"<element>",I(),B());},tt=async h=>{if(h.length!==0){for(let v of h)xe(rn(v));try{let v=await Promise.all(h.map(Ve=>en(Ve))),G=v.join(`
|
|
28
26
|
|
|
29
27
|
---
|
|
30
28
|
|
|
31
|
-
`),
|
|
29
|
+
`),W=ke(G),Z=v.map((Ve,fn)=>({tagName:he(h[fn]),content:Ve,computedStyles:me(h[fn])})),ge=ee(Z);await tn([W,ge]);}catch{}je(`${h.length} elements`,I(),B());}},Ne=z(()=>!J()||d()?null:nn(s(),l())),Sr=z(()=>{let h=Ne();if(!h)return;let v=h.getBoundingClientRect(),G=window.getComputedStyle(h);return {borderRadius:G.borderRadius||"0px",height:v.height,transform:G.transform||"none",width:v.width,x:v.left,y:v.top}}),nt=2,on=(h,v)=>({x:Math.abs(h-p()),y:Math.abs(v-S())}),sn=z(()=>{if(!d())return false;let h=on(s(),l());return h.x>nt||h.y>nt}),an=(h,v)=>{let G=Math.min(p(),h),W=Math.min(S(),v),Z=Math.abs(h-p()),ge=Math.abs(v-S());return {x:G,y:W,width:Z,height:ge}},Tr=z(()=>{if(!sn())return;let h=an(s(),l());return {borderRadius:"0px",height:h.height,transform:"none",width:h.width,x:h.x,y:h.y}}),Cr=z(()=>{let h=Ne();return h?`<${he(h)}>`:"<element>"}),ln=z(()=>R()?{x:I(),y:B()}:{x:s(),y:l()}),xr=z(()=>!!(Ne()&&Ne()===A()));te(Ee(()=>[Ne(),A()],([h,v])=>{v&&h&&v!==h&&O(null);}));let cn=z(()=>{let h=N();if(L(),h===null)return 0;let v=Date.now()-h;return Math.min(v/t.keyHoldDuration,1)}),vr=()=>{_(Date.now()),y(false),F=window.setTimeout(()=>{y(true),F=null;},gi);let h=()=>{if(N()===null)return;ne(G=>G+1),cn()<1&&(U=requestAnimationFrame(h));};h();},Et=()=>{U!==null&&(cancelAnimationFrame(U),U=null),F!==null&&(window.clearTimeout(F),F=null),_(null),y(false);},Er=()=>{Et(),c(true),document.body.style.cursor="crosshair";},Rt=()=>{i(false),c(false),document.body.style.cursor="",d()&&(g(false),document.body.style.userSelect=""),Y&&window.clearTimeout(Y),j&&window.clearTimeout(j),Et();},un=new AbortController,_e=un.signal;window.addEventListener("keydown",h=>{if(h.key==="Escape"&&o()){Rt();return}_n(h)||Oe(h)&&(o()||(i(true),vr(),Y=window.setTimeout(()=>{Er(),t.onActivate?.();},t.keyHoldDuration)),u()&&(j&&window.clearTimeout(j),j=window.setTimeout(()=>{Rt();},200)));},{signal:_e}),window.addEventListener("keyup",h=>{if(!o()&&!u())return;let v=!h.metaKey&&!h.ctrlKey;(h.key.toLowerCase()==="c"||v)&&Rt();},{signal:_e,capture:true}),window.addEventListener("mousemove",h=>{a(h.clientX),f(h.clientY);},{signal:_e}),window.addEventListener("mousedown",h=>{!J()||R()||(h.preventDefault(),g(true),x(h.clientX),C(h.clientY),document.body.style.userSelect="none");},{signal:_e}),window.addEventListener("mouseup",h=>{if(!d())return;let v=on(h.clientX,h.clientY),G=v.x>nt||v.y>nt;if(g(false),document.body.style.userSelect="",G){D(true);let W=an(h.clientX,h.clientY),Z=br(W,et);if(Z.length>0)be(h.clientX,h.clientY,()=>tt(Z));else {let ge=yr(W,et);ge.length>0&&be(h.clientX,h.clientY,()=>tt(ge));}}else {let W=nn(h.clientX,h.clientY);if(!W)return;O(W),be(h.clientX,h.clientY,()=>vt(W));}},{signal:_e}),window.addEventListener("click",h=>{E()&&(h.preventDefault(),h.stopPropagation(),D(false));},{signal:_e,capture:true}),document.addEventListener("visibilitychange",()=>{document.hidden&&ae([]);},{signal:_e}),ce(()=>{un.abort(),Y&&window.clearTimeout(Y),j&&window.clearTimeout(j),Et(),document.body.style.userSelect="",document.body.style.cursor="";});let Rr=An(),Or=z(()=>false),Nr=z(()=>J()&&sn()),_r=z(()=>R()?"processing":"hover"),Ar=z(()=>J()&&!d()&&(!!Ne()&&!xr()||!Ne())||R()),Fr=z(()=>o()&&m()&&$e()),$r=z(()=>J()&&!d());return On(()=>k(Mn,{get selectionVisible(){return Or()},get selectionBounds(){return Sr()},get dragVisible(){return Nr()},get dragBounds(){return Tr()},get grabbedBoxes(){return oe()},get successLabels(){return Ce()},get labelVariant(){return _r()},get labelText(){return Cr()},get labelX(){return ln().x},get labelY(){return ln().y},get labelVisible(){return Ar()},get progressVisible(){return Fr()},get progress(){return cn()},get mouseX(){return s()},get mouseY(){return l()},get crosshairVisible(){return $r()}}),Rr),n})};wr();/*! Bundled license information:
|
|
32
30
|
|
|
33
31
|
bippy/dist/rdt-hook-DAGphl8S.js:
|
|
34
32
|
(**
|
|
@@ -89,4 +87,4 @@ bippy/dist/source.js:
|
|
|
89
87
|
* This source code is licensed under the MIT license found in the
|
|
90
88
|
* LICENSE file in the root directory of this source tree.
|
|
91
89
|
*)
|
|
92
|
-
*/exports.init=
|
|
90
|
+
*/exports.init=wr;return exports;})({});
|