react-grab 0.1.50-dev.65db899 → 0.1.50-dev.f350003

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.
Files changed (38) hide show
  1. package/dist/{copy-content-CcSwO8vJ.d.ts → copy-content-BwBAqbRh.d.cts} +1 -88
  2. package/dist/{copy-content-Dxdqj7pl.d.cts → copy-content-lkRiqdFh.d.ts} +1 -88
  3. package/dist/core/index.cjs +1 -1
  4. package/dist/core/index.d.cts +2 -2
  5. package/dist/core/index.d.ts +2 -2
  6. package/dist/core/index.js +1 -1
  7. package/dist/core-Cc1el00a.js +11 -0
  8. package/dist/core-Ds3sjKE1.cjs +11 -0
  9. package/dist/execute-context-menu-action-Dzjyult6.cjs +9 -0
  10. package/dist/execute-context-menu-action-Ez2AKvZb.js +9 -0
  11. package/dist/{freeze-updates-giOP_Nph.cjs → freeze-updates-BOaH41eE.cjs} +1 -1
  12. package/dist/freeze-updates-K6zUt3iB.js +43 -0
  13. package/dist/{index-Cd-ADR9Q.d.ts → index-BX45N3Oq.d.ts} +1 -1
  14. package/dist/{index-DdYffA2X.d.cts → index-CvAuGVjl.d.cts} +1 -1
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.global.js +17 -20
  19. package/dist/index.js +1 -1
  20. package/dist/open-file-BA-IcI4n.js +29 -0
  21. package/dist/open-file-DR73qcD1.cjs +20 -0
  22. package/dist/primitives.cjs +2 -2
  23. package/dist/primitives.d.cts +1 -1
  24. package/dist/primitives.d.ts +1 -1
  25. package/dist/primitives.js +2 -2
  26. package/dist/renderer-2q73qKK6.js +9 -0
  27. package/dist/renderer-BdvHhkYY.cjs +9 -0
  28. package/dist/styles.css +1 -1
  29. package/package.json +2 -2
  30. package/dist/core-CLv44ij4.js +0 -14
  31. package/dist/core-DMQiEALv.cjs +0 -14
  32. package/dist/freeze-updates-0VsHStYd.js +0 -43
  33. package/dist/is-type-to-edit-key-bBZ6E0Hm.js +0 -9
  34. package/dist/is-type-to-edit-key-jm_sNrrD.cjs +0 -9
  35. package/dist/open-file-63p5-ajX.js +0 -29
  36. package/dist/open-file-BavF8qWS.cjs +0 -20
  37. package/dist/renderer-DVnVdlCe.js +0 -9
  38. package/dist/renderer-DvalxS2H.cjs +0 -9
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @license MIT
3
+ *
4
+ * Copyright (c) 2025 Aiden Bai
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ let e=null;const t=()=>{if(e!==null)return e;try{e=window.matchMedia(`(color-gamut: p3)`).matches}catch{e=!1}return e},n=t(),r=e=>n?`color(display-p3 0.84 0.19 0.78 / ${e})`:`rgba(210, 57, 192, ${e})`,i=`0.1.50-dev.f350003`,a=`var(--rg-panel-bg)`,o=`var(--rg-shadow)`,s=-1e3,c=.95,l=1500,u=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],d=5e3,f=8e3,p=1e4,ee=.5,m=2147483647,te=2147483645,ne=.7,re=1e3/60,ie=.5,ae=.01,oe=r(.4),se=r(.05),ce=r(.5),le=r(.08),ue=r(.15),de=.2,fe=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],pe=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),me=new Set([`a`,`button`,`code`,`label`,`option`,`pre`,`summary`,`text`]),he=new Set([`script`,`style`,`template`,`noscript`]),ge=[`Meta`,`Control`,`Shift`,`Alt`],_e=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),ve=`data-react-grab-frozen`,ye=`data-react-grab-same-origin-frame`,be=.18,xe=.6,Se=.5,Ce=`data-react-grab-input`,we=.5,Te=`copy`,Ee=`comment`,De=`edit`,Oe=`superellipse(1.25)`,ke=.75,Ae=.01,je=1e3,Me={left:-9999,top:-9999},Ne={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},Pe=1e3,Fe=-9999,Ie=new Set(`display.position.top.right.bottom.left.z-index.overflow.overflow-x.overflow-y.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.flex-direction.flex-wrap.justify-content.align-items.align-self.align-content.flex-grow.flex-shrink.flex-basis.order.gap.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-template-areas.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-align.text-decoration-line.text-decoration-style.text-transform.text-overflow.text-shadow.white-space.word-break.overflow-wrap.vertical-align.color.background-color.background-image.background-position.background-size.background-repeat.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.box-shadow.opacity.transform.filter.backdrop-filter.object-fit.object-position`.split(`.`)),Le=e=>typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE,h=e=>Le(e)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`,g=e=>h(e)&&e.tagName===`IFRAME`,Re=new WeakMap,_=e=>{let t=Number.parseFloat(e);return Number.isFinite(t)?t:0},ze=e=>{let t=performance.now(),n=Re.get(e);if(n&&t-n.timestamp<16)return n.metrics;let r=e.ownerDocument.defaultView?.getComputedStyle(e),i;if(!r)i={contentOffsetX:e.clientLeft,contentOffsetY:e.clientTop,height:e.offsetHeight,width:e.offsetWidth};else{let t=_(r.borderLeftWidth),n=_(r.borderRightWidth),a=_(r.borderTopWidth),o=_(r.borderBottomWidth),s=_(r.paddingLeft),c=_(r.paddingRight),l=_(r.paddingTop),u=_(r.paddingBottom),d=_(r.width),f=_(r.height),p=t+n+s+c,ee=a+o+l+u,m=r.boxSizing===`border-box`?d:d+p,te=r.boxSizing===`border-box`?f:f+ee;i={contentOffsetX:t+s,contentOffsetY:a+l,height:te>0?te:e.offsetHeight,width:m>0?m:e.offsetWidth}}return Re.set(e,{metrics:i,timestamp:t}),i},Be=(e,t)=>t>0?e/t:1,Ve=e=>{if(!e)return null;try{return e.frameElement}catch{return null}},He=(e,t,n)=>{let r=t,i=n,a=1,o=1,s=e;for(;s&&s!==window;){let e=Ve(s);if(!e||!g(e))break;let t=e.getBoundingClientRect(),n=ze(e),c=Be(t.width,n.width),l=Be(t.height,n.height);r=t.left+(n.contentOffsetX+r)*c,i=t.top+(n.contentOffsetY+i)*l,a*=c,o*=l,s=e.ownerDocument.defaultView}return{x:r,y:i,scaleX:a,scaleY:o}},Ue=e=>{let t=e.ownerDocument.defaultView;return t?t.getComputedStyle(e):window.getComputedStyle(e)},We=(e,t)=>e.replace(/([\d.]+)px/g,(e,n)=>{let r=Number(n)*Math.abs(t);return`${Number(r.toFixed(3))}px`}),Ge=(e,t,n)=>{let[r,i]=e.split(`/`).map(e=>e.trim()),a=We(r,t),o=We(i??r,n);return i===void 0&&a===o?a:`${a} / ${o}`},Ke=e=>Object.assign(e,{[Symbol.dispose]:e}),qe=`bippy-0.6.1`,Je=Object.defineProperty,Ye=Object.prototype.hasOwnProperty,v=()=>{},Xe=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{}},Ze=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e);let Qe=!1,$e;const et=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>Qe?!0:(e&&typeof e.inject==`function`&&($e=e.inject.toString()),!!$e?.includes(`(injected)`)),y=new Set,tt=new Set,nt=e=>{e&&y.add(e);let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:qe,checkDCE:Xe,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),tt.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,y.forEach(e=>e())),i},on:v,onCommitFiberRoot:v,onCommitFiberUnmount:v,onPostCommitFiberRoot:v,renderers:t,supportsFiber:!0,supportsFlight:!0};try{Je(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{tt.add(e),t.renderers.set(n,e)}),rt(e))}}});let t=window.hasOwnProperty,n=!1;Je(window,`hasOwnProperty`,{configurable:!0,value:function(...e){try{if(!n&&e[0]===`__REACT_DEVTOOLS_GLOBAL_HOOK__`)return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,n=!0,-0}catch{}return t.apply(this,e)},writable:!0})}catch{rt(e)}return r},rt=e=>{e&&y.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=Xe,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=qe,t._instrumentationIsActive=!1;let e=Ze(t);if(e||(t.on=v),t.renderers.size){t._instrumentationIsActive=!0,y.forEach(e=>e());return}let n=t.inject,r=et(t);r&&!e&&(Qe=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return tt.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,y.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||et())&&e?.()}catch{}},it=()=>Ye.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),b=e=>it()?(rt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):nt(e),at=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`));
10
+ /**
11
+ * @license bippy
12
+ *
13
+ * Copyright (c) Aiden Bai
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ (()=>{try{at()&&b()}catch{}})();
19
+ /**
20
+ * @license bippy
21
+ *
22
+ * Copyright (c) Aiden Bai
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */
27
+ const ot=e=>{switch(e.tag){case 5:case 26:case 27:return!0;default:return typeof e.type==`string`}},st=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}},ct=e=>!e||typeof e!=`object`?!1:`pendingProps`in e&&!(`containerInfo`in e),lt=e=>{let t=e.memoizedProps,n=e.alternate?.memoizedProps||{},r=e.flags??e.effectTag??0;switch(e.tag){case 1:case 9:case 11:case 0:case 14:case 15:return(r&1)==1;default:return e.alternate?n!==t||e.alternate.memoizedState!==e.memoizedState||e.alternate.ref!==e.ref:!0}},ut=e=>{switch(e.tag){case 18:return!0;case 7:case 6:case 23:case 22:return!0;case 3:return!1;default:{let t=typeof e.type==`object`&&e.type!==null?e.type.$$typeof:e.type;if(typeof t==`symbol`)return t.description===`react.concurrent_mode`||t.description===`react.async_mode`;switch(t){case 60111:case`Symbol(react.concurrent_mode)`:case`Symbol(react.async_mode)`:return!0;default:return!1}}}},dt=e=>{let t=[],n=[];for(ot(e)?t.push(e):e.child&&n.push(e.child);n.length;){let e=n.pop();if(!e)break;ot(e)?t.push(e):e.child&&n.push(e.child),e.sibling&&n.push(e.sibling)}return t};function ft(e,t,n=!1){if(!e)return null;let r=t(e);if(r instanceof Promise)return(async()=>{if(await r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=await mt(i,t,n);if(e)return e;i=n?null:i.sibling}return null})();if(r===!0)return e;let i=n?e.return:e.child;for(;i;){let e=pt(i,t,n);if(e)return e;i=n?null:i.sibling}return null}const pt=(e,t,n=!1)=>{if(!e)return null;if(t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=pt(r,t,n);if(e)return e;r=n?null:r.sibling}return null},mt=async(e,t,n=!1)=>{if(!e)return null;if(await t(e)===!0)return e;let r=n?e.return:e.child;for(;r;){let e=await mt(r,t,n);if(e)return e;r=n?null:r.sibling}return null},ht=e=>{let t=e;return typeof t==`function`?t:typeof t==`object`&&t?ht(t.type||t.render):null},gt=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=ht(t);return r&&(r.displayName||r.name)||null},_t=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||Ze(e)||et(e)},vt=new Set,yt=e=>{let t=e.alternate;if(!t)return e;if(t.actualStartTime&&e.actualStartTime)return t.actualStartTime>e.actualStartTime?t:e;for(let t of vt){let n=ft(t.current,t=>{if(t===e)return!0});if(n)return n}return e};let bt=0;const x=new WeakMap,xt=(e,t=bt++)=>{x.set(e,t)},St=e=>{let t=x.get(e);return t===void 0&&e.alternate&&(t=x.get(e.alternate)),t===void 0&&(t=bt++,xt(e,t)),t},S=(e,t,n)=>{let r=t;for(;r!=null;){if(x.has(r)||St(r),!ut(r)&&lt(r)&&e(r,`mount`),r.tag===13)if(r.memoizedState!==null){let t=r.child,n=t?t.sibling:null;if(n){let t=n.child;t!==null&&S(e,t,!1)}}else{let t=null;r.child!==null&&(t=r.child.child),t!==null&&S(e,t,!1)}else r.child!=null&&S(e,r.child,!0);r=n?r.sibling:null}},Ct=(e,t,n,r)=>{if(x.has(t)||St(t),!n)return;x.has(n)||St(n);let i=t.tag===13,a=!ut(t);a&&lt(t)&&e(t,`update`);let o=i&&n.memoizedState!==null,s=i&&t.memoizedState!==null;if(o&&s){let r=t.child?.sibling??null,i=n.child?.sibling??null;r!==null&&i!==null&&Ct(e,r,i,t)}else if(o&&!s){let n=t.child;n!==null&&S(e,n,!0)}else if(!o&&s){Tt(e,n);let r=t.child?.sibling??null;r!==null&&S(e,r,!0)}else if(t.child!==n.child){let n=t.child;for(;n;){if(n.alternate){let i=n.alternate;Ct(e,n,i,a?t:r)}else S(e,n,!1);n=n.sibling}}},wt=(e,t)=>{(t.tag===3||!ut(t))&&e(t,`unmount`)},Tt=(e,t)=>{let n=t.tag===13&&t.memoizedState!==null,r=t.child;for(n&&(r=(t.child?.sibling??null)?.child??null);r!==null;)r.return!==null&&(wt(e,r),Tt(e,r)),r=r.sibling},Et=e=>{if(!it())return null;let t=e;for(;t.return;)t=t.return;let n=Nt.get(t.stateNode);return n===void 0?null:b().renderers?.get(n)??null},Dt=e=>Object.prototype.toString.call(e)===`[object Object]`&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null),Ot=(e,t=[])=>{if(!Dt(e))return[{path:t,value:e}];let n=[];for(let r in e){let i=e[r],a=t.concat(r);Dt(i)?n.push(...Ot(i,a)):n.push({path:a,value:i})}return n},kt=new Set,At=new Set,jt=new Set,Mt=new Set,C=new WeakMap,Nt=new WeakMap,Pt=e=>{let t=C.get(e)??{};if(C.set(e,t),!t.onCommitFiberRoot||e.onCommitFiberRoot!==t.onCommitFiberRoot){let n=e.onCommitFiberRoot,r=(t,i,a)=>{if(n?.(t,i,a),C.get(e)?.onCommitFiberRoot===r){vt.add(i),Nt.set(i,t);for(let e of kt)e(t,i,a)}};t.onCommitFiberRoot=r,e.onCommitFiberRoot=r}if(!t.onCommitFiberUnmount||e.onCommitFiberUnmount!==t.onCommitFiberUnmount){let n=e.onCommitFiberUnmount,r=(t,i)=>{if(n?.(t,i),C.get(e)?.onCommitFiberUnmount===r)for(let e of At)e(t,i)};t.onCommitFiberUnmount=r,e.onCommitFiberUnmount=r}if(!t.onPostCommitFiberRoot||e.onPostCommitFiberRoot!==t.onPostCommitFiberRoot){let n=e.onPostCommitFiberRoot,r=(t,i)=>{if(n?.(t,i),C.get(e)?.onPostCommitFiberRoot===r)for(let e of jt)e(t,i)};t.onPostCommitFiberRoot=r,e.onPostCommitFiberRoot=r}if(!t.onScheduleFiberRoot||e.onScheduleFiberRoot!==t.onScheduleFiberRoot){let n=e.onScheduleFiberRoot,r=(t,i,a)=>{if(n?.(t,i,a),C.get(e)?.onScheduleFiberRoot===r)for(let e of Mt)e(t,i,a)};t.onScheduleFiberRoot=r,e.onScheduleFiberRoot=r}},Ft=e=>{let t=b(e.onActive);t._instrumentationSource=e.name??qe,Pt(t);let{onActive:n,onCommitFiberRoot:r,onCommitFiberUnmount:i,onPostCommitFiberRoot:a,onScheduleFiberRoot:o}=e;return r&&kt.add(r),i&&At.add(i),a&&jt.add(a),o&&Mt.add(o),Ke(()=>{n&&y.delete(n),r&&kt.delete(r),i&&At.delete(i),a&&jt.delete(a),o&&Mt.delete(o)})},It=new Set,Lt=e=>e.startsWith(`__reactContainer$`)||e.startsWith(`__reactInternalInstance$`)||e.startsWith(`__reactFiber`),Rt=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;let t=e.__internalInstanceHandle??e._internalInstanceHandle;if(ct(t))return t;let n=e;for(let e of It){let t=n[e];if(t)return t}for(let e of Object.keys(n))if(Lt(e))return It.add(e),n[e]||null;for(let t of vt){if(Et(t.current)?.findFiberByHostInstance)continue;let n=ft(t.current,t=>t.stateNode===e);if(n)return n}}return null},zt=new WeakMap,Bt=(e,t)=>{zt.set(e,t)},w=e=>zt.get(e)??null,Vt=e=>w(e)?.getFiber()??Rt(e);let Ht=new WeakMap,Ut=new WeakMap;const Wt=()=>{Ht=new WeakMap,Ut=new WeakMap},Gt=(e,t,n)=>{let r=Ut.get(e);if(r&&n-r.timestamp<200)return r.borderRadius;let i=(t??Ue(e)).borderRadius||`0px`;return Ut.set(e,{borderRadius:i,timestamp:n}),i},Kt=e=>{let t=performance.now(),n=Ht.get(e);if(n&&t-n.timestamp<16)return n.bounds;let r=w(e);if(r){let n=r.getBounds();return Ht.set(e,{bounds:n,timestamp:t}),n}let i=e.getBoundingClientRect(),a=He(e.ownerDocument.defaultView,i.left,i.top),o={borderRadius:Ge(Gt(e,null,t),a.scaleX,a.scaleY),height:i.height*a.scaleY,width:i.width*a.scaleX,x:a.x,y:a.y};return Ht.set(e,{bounds:o,timestamp:t}),o},qt=e=>{let t=e.ownerDocument?.defaultView;return!!(t&&e instanceof t.ShadowRoot)};var T=class extends Error{constructor(e,t){super(e,t),this.name=`ReactGrabError`}},E=class extends T{constructor(e,t){super(e,{cause:t}),this.name=`RecoverableError`}},Jt=class extends T{constructor(e){super(`Failed to freeze page`,{cause:e}),this.name=`FreezeError`}},Yt=class extends E{constructor(e,t,n){super(`Failed to open source file "${e}"`,n),this.name=`OpenFileError`,this.filePath=e,this.lineNumber=t}},Xt=class extends E{constructor(e,t,n){super(`Plugin hook "${t}" failed for "${e}"`,n),this.name=`PluginHookError`,this.pluginName=e,this.hookName=t}},Zt=class extends E{constructor(e,t){super(`Plugin cleanup failed for "${e}"`,t),this.name=`PluginCleanupError`,this.pluginName=e}},Qt=class extends E{constructor(e,t){super(`Plugin setup failed for "${e}"`,t),this.name=`PluginSetupError`,this.pluginName=e}},$t=class extends E{constructor(e,t){super(`Action "${e}" failed`,t),this.name=`ContextMenuActionError`,this.actionId=e}},en=class extends E{constructor(e,t){super(`Action "${e}" enabled check failed`,t),this.name=`ContextMenuActionEnabledError`,this.actionId=e}},tn=class extends T{constructor(){super(`Can't generate CSS selector for non-element node type.`),this.name=`NonElementNodeError`}},nn=class extends T{constructor(e){super(`Timeout: Can't find a unique selector after ${e}ms`),this.name=`SelectorTimeoutError`,this.timeoutMs=e}},rn=class extends T{constructor(){super(`Selector was not found.`),this.name=`SelectorNotFoundError`}},an=class extends T{constructor(){super(`Failed to copy`),this.name=`CopyFailedError`}};const on=e=>w(e)?.getTagName()??(e.tagName||``).toLowerCase(),sn=new WeakMap,cn=(e=document)=>{let t=sn.get(e);if(t!==void 0)return t;let n=e.querySelector(`script[nonce], style[nonce]`),r=n?.nonce||n?.getAttribute(`nonce`)||null;return r&&sn.set(e,r),r},ln=[[`data-rr-block`,``],[`data-rr-ignore`,``],[`data-rr-mask`,``],[`data-sentry-block`,``],[`data-sentry-ignore`,``],[`data-sentry-mask`,``],[`data-dd-privacy`,`hidden`],[`data-fs-exclude`,``],[`data-lr-exclude`,``],[`data-hj-suppress`,``],[`data-recording-disable`,``],[`data-clarity-mask`,`true`],[`data-heap-redact-text`,``]],un=e=>{for(let[t,n]of ln)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},dn=e=>typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===9,fn=e=>{if(e.assignedSlot)return e.assignedSlot;if(e.parentElement)return e.parentElement;let t=e.getRootNode();return qt(t)?t.host:dn(t)?Ve(t.defaultView):null};let pn=null;const mn=e=>{pn=e},hn=()=>pn,gn=e=>{if(!pn)return!0;let t=e;for(;t;){if(t===pn)return!0;t=fn(t)}return!1},_n=e=>e,vn=typeof window<`u`,yn=e=>0,bn=e=>{},xn=vn?(Object.getOwnPropertyDescriptor(Window.prototype,`requestAnimationFrame`)?.value??window.requestAnimationFrame).bind(window):yn,Sn=vn?(Object.getOwnPropertyDescriptor(Window.prototype,`cancelAnimationFrame`)?.value??window.cancelAnimationFrame).bind(window):bn,Cn=()=>vn?new Promise(e=>xn(()=>e())):Promise.resolve(),D=e=>{try{return e.contentDocument}catch{return null}},wn=(e,t,n)=>{let r=e.getBoundingClientRect(),i=ze(e),a=Be(r.width,i.width),o=Be(r.height,i.height);return{x:(t-r.left)/a-i.contentOffsetX,y:(n-r.top)/o-i.contentOffsetY}},Tn=(e,t,n)=>{let r=e.elementFromPoint(t,n);for(;r;){let e=r.shadowRoot?.elementFromPoint(t,n);if(e&&e!==r){r=e;continue}if(g(r)){let e=D(r);if(!e)return r;let i=wn(r,t,n);return Tn(e,i.x,i.y)??r}return r}return null},En=(e,t)=>Tn(document,e,t),Dn=e=>{let t=e;for(;t;){if(t.hasAttribute(`data-react-grab-ignore`))return!0;t=fn(t)}return!1},On=typeof Element<`u`&&typeof Element.prototype.checkVisibility==`function`,kn={checkOpacity:!0,checkVisibilityCSS:!0,opacityProperty:!0,visibilityProperty:!0},An={checkVisibilityCSS:!0,visibilityProperty:!0},jn=(e,t)=>{if(On&&!t)return e.checkVisibility(kn)?!0:e.checkVisibility(An)?Ue(e).opacity!==`0`:!1;let n=t??Ue(e);return n.display!==`none`&&n.visibility!==`hidden`&&n.opacity!==`0`},Mn=e=>{let t=on(e);return t===`html`||t===`body`},Nn=[`data-react-grab`,`data-react-grab-demo`],Pn=e=>Nn.some(t=>e.hasAttribute(t)),Fn=e=>{if(Pn(e))return!0;let t=e.getRootNode();return qt(t)&&Pn(t.host)},In=e=>{let t=parseInt(e.zIndex,10);return e.pointerEvents===`none`&&e.position===`fixed`&&!isNaN(t)&&t>=2147483600},Ln=e=>{let t=e.backgroundColor;return t===`transparent`||t===`rgba(0, 0, 0, 0)`},Rn=e=>{let t=e.position;if(t!==`fixed`&&t!==`absolute`)return!1;if(Ln(e)||parseFloat(e.opacity)<.1)return!0;let n=parseInt(e.zIndex,10);return!isNaN(n)&&n>1e3};let zn=new WeakMap;const Bn=()=>{zn=new WeakMap},Vn=e=>{let t=w(e);if(t)return t.isConnected();if(Mn(e)||Fn(e)||Dn(e))return!1;let n=performance.now(),r=zn.get(e);if(r&&n-r.timestamp<50)return r.isVisible;if(!jn(e))return zn.set(e,{isVisible:!1,timestamp:n}),!1;if(e.clientWidth/(e.ownerDocument.defaultView?.innerWidth??window.innerWidth)>=.9&&e.clientHeight/(e.ownerDocument.defaultView?.innerHeight??window.innerHeight)>=.9){let t=Ue(e);if(In(t)||Rn(t))return!1}return zn.set(e,{isVisible:!0,timestamp:n}),!0},Hn=(e,t,n)=>{let r=!0;for(let i of e.elementsFromPoint(t,n)){if(Dn(i)&&(r=!1),!gn(i))continue;let a=i.shadowRoot;if(r&&a&&a!==e){let e=Hn(a,t,n);if(e)return e}if(r&&g(i)){let e=D(i);if(e){let r=wn(i,t,n),a=Hn(e,r.x,r.y);if(a)return a}}if(Vn(i))return i}return null},Un=(e,t)=>Hn(document,e,t),Wn=(e,t,n,r)=>{let i=e.elementsFromPoint(t,n),a=!0;for(let o of i){if(Dn(o)&&(a=!1),a&&o.shadowRoot&&o.shadowRoot!==e&&Wn(o.shadowRoot,t,n,r),a&&g(o)){let e=D(o);if(e){let i=wn(o,t,n);Wn(e,i.x,i.y,r)}}r.add(o)}},Gn=(e,t)=>{let n=new Set;return Wn(document,e,t,n),[...n]},Kn=(e,t,n)=>e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom,qn=(e,t,n=document)=>{let r=n.createElement(`style`);r.setAttribute(e,``);let i=cn(n);return i&&(r.nonce=i),un(r),r.textContent=t,n.head.appendChild(r),r},Jn=`html { pointer-events: none !important; }
28
+ iframe[${ye}] { pointer-events: auto !important; }`,Yn=new Set,O=new Map;let k=!1;const Xn=e=>{if(O.has(e))return;let t=qn(`data-react-grab-frozen-pseudo`,Jn,e),n=qn(`data-react-grab-hittest-override`,`html, body { pointer-events: auto !important; }`,e);n.disabled=!0,O.set(e,{pointerEventsStyle:t,hitTestOverrideStyle:n})},Zn=e=>{let t=O.get(e);t&&(t.pointerEventsStyle.remove(),t.hitTestOverrideStyle.remove(),O.delete(e))},Qn=()=>k,$n=e=>(Yn.add(e),k&&Xn(e),()=>{Yn.delete(e),Zn(e)}),er=()=>{if(!k){k=!0,Yn.add(document);for(let e of Yn)Xn(e)}},tr=()=>{if(k){k=!1;for(let e of[...O.keys()])Zn(e)}},nr=()=>{if(k)for(let e of O.values())e.pointerEventsStyle.disabled||(e.pointerEventsStyle.disabled=!0),e.hitTestOverrideStyle.disabled&&(e.hitTestOverrideStyle.disabled=!1)},rr=()=>{if(k)for(let e of O.values())e.pointerEventsStyle.disabled&&(e.pointerEventsStyle.disabled=!1),e.hitTestOverrideStyle.disabled||(e.hitTestOverrideStyle.disabled=!0)},A=(e,t)=>{if(e.length!==0)throw e.length===1?e[0]:AggregateError(e,t)},ir=new Set,j=new Set;let M=!1;const ar=(e,t)=>{if(j.has(e))try{e.unfreeze()}catch(e){t.push(e)}finally{j.delete(e)}},or=e=>{ir.add(e);try{M&&e.isConnected()&&(e.freeze(),j.add(e))}catch(t){throw ir.delete(e),t}return()=>{let t=[];ar(e,t),ir.delete(e),A(t,`Unregistering renderer freeze failed`)}},sr=()=>{if(!M){M=!0;try{for(let e of ir)e.isConnected()&&(e.freeze(),j.add(e))}catch(e){M=!1;let t=[];for(let e of[...j].reverse())ar(e,t);throw t.length===0?e:AggregateError([e,...t],`Rolling back renderer freeze failed`)}}},cr=()=>{if(!M)return;M=!1;let e=[];for(let t of[...j].reverse())ar(t,e);A(e,`Unfreezing renderers failed`)},lr=new WeakMap,N=new WeakMap,ur=new WeakMap,dr=new WeakMap,fr=[`name`,`position`,`rotation`,`scale`,`color`,`visible`,`args`],P=e=>typeof e==`object`&&!!e,pr=e=>typeof e==`object`&&!!e||typeof e==`function`,F=(e,t)=>typeof e[t]==`function`,mr=e=>P(e)&&typeof e.x==`number`&&typeof e.y==`number`&&typeof e.z==`number`&&F(e,`set`)&&F(e,`clone`)&&F(e,`applyMatrix4`)&&F(e,`project`),hr=e=>P(e)&&F(e,`clone`)&&F(e,`premultiply`),gr=e=>P(e)&&`boundingBox`in e&&F(e,`computeBoundingBox`),_r=e=>P(e)&&typeof e.type==`string`&&P(e.props)&&vr(e.object),vr=e=>P(e)&&e.isObject3D===!0&&typeof e.uuid==`string`&&typeof e.name==`string`&&typeof e.type==`string`&&typeof e.visible==`boolean`&&hr(e.matrixWorld)&&F(e,`updateWorldMatrix`),yr=e=>P(e)&&e.isCamera===!0,br=e=>vr(e)&&e.isScene===!0&&Array.isArray(e.children),xr=e=>P(e)&&typeof e.tagName==`string`&&e.tagName.toLowerCase()===`canvas`&&F(e,`getContext`),Sr=e=>P(e)&&xr(e.domElement),Cr=e=>P(e)&&F(e,`set`),wr=e=>P(e)&&F(e,`setFromCamera`)&&F(e,`intersectObjects`),Tr=e=>P(e)&&Sr(e.gl)&&br(e.scene)&&yr(e.camera)&&wr(e.raycaster)&&Cr(e.pointer),Er=e=>e===`always`||e===`demand`||e===`never`,Dr=e=>P(e)&&typeof e.elapsedTime==`number`,Or=(e,t)=>{let n=e.getState();if(typeof n.setFrameloop!=`function`)return;let r=Dr(n.clock)?n.clock.elapsedTime:null;n.setFrameloop(t);let i=e.getState().clock;r!==null&&Dr(i)&&(i.elapsedTime=r)},kr=e=>{if(ur.has(e))return;let t=null,n=or({freeze:()=>{let n=N.get(e);if(!n)return;let r=n.getState();if(Er(r.frameloop)&&typeof r.setFrameloop==`function`){let e=r.frameloop;Or(n,`never`),t=()=>Or(n,e)}},isConnected:()=>e.isConnected,unfreeze:()=>{t?.(),t=null}});ur.set(e,n)},Ar=e=>{let t=ur.get(e);t&&(ur.delete(e),t())},jr=e=>_r(e.__r3f)?e.__r3f:null,Mr=e=>{let t=e.current.stateNode;if(!P(t)||!pr(t.containerInfo))return null;let n=t.containerInfo,r=Reflect.get(n,`getState`);if(typeof r!=`function`)return null;let i=Reflect.apply(r,n,[]);return Tr(i)?()=>{let e=Reflect.apply(r,n,[]);return Tr(e)?e:i}:null},Nr=e=>{let t=dr.get(e);t&&(dr.delete(e),N.get(t.canvas)===t.root&&(N.delete(t.canvas),Ar(t.canvas)))},Pr=e=>{let t=Mr(e);if(!t){Nr(e);return}let n=t().gl.domElement;if(!n.isConnected||!e.current.child){Nr(e);return}let r=dr.get(e);r&&r.canvas!==n&&(Nr(e),r=void 0),r?r.root.getState=t:(r={canvas:n,root:{getState:t}},dr.set(e,r)),N.set(n,r.root),kr(n)};Ft({name:`react-grab-three-selection`,onCommitFiberRoot:(e,t)=>Pr(t)});const Fr=e=>{let t=e;for(;t;){if(jr(t))return t;t=t.parent}return null},Ir=e=>{let t=e;for(;t;){let e=jr(t);if(e&&typeof e.eventCount==`number`&&e.eventCount>0)return!0;t=t.parent}return!1},Lr=(e,t)=>{let n=e;for(;n;){if(n===t)return!0;n=n.parent}return!1},Rr=(e,t,n)=>{let r=typeof n.instanceId==`number`&&Number.isInteger(n.instanceId)?n.instanceId:null,i=lr.get(t);i||(i=new Map,lr.set(t,i));let a=i.get(r);if(a)return a.canvas=e.gl.domElement,a.intersectionPoint=mr(n.point)?n.point:null,a.object=t,a.rootState=e,a.element;let o=jr(t),s=o?Rt(o):null;if(o&&!s)return null;let c=(o?.type||t.type||`object-3d`).toLowerCase(),l=e.gl.domElement.ownerDocument.createElement(c),u={canvas:e.gl.domElement,element:l,fiber:s,instance:o,instanceId:r,intersectionPoint:mr(n.point)?n.point:null,object:t,rootState:e,tagName:c},d=l.getBoundingClientRect.bind(l);return l.getBoundingClientRect=()=>{let e=Kr(u),t=l.ownerDocument.defaultView?.DOMRect;return t?new t(e.x,e.y,e.width,e.height):d()},Bt(l,{hostElement:u.canvas,supportsDomEditing:!1,getBounds:()=>Kr(u),getFiber:()=>u.fiber?yt(u.fiber):null,getPreview:()=>Vr(u),getSelector:()=>Hr(u),getTagName:()=>u.tagName,isConnected:()=>u.canvas.isConnected&&Lr(u.object,u.rootState.scene)}),i.set(r,u),l},zr=(e,t,n)=>{if(!xr(e))return e;let r=N.get(e);if(!r)return e;let i=r.getState(),a=Kt(e);if(a.width<=0||a.height<=0)return e;let o=(t-a.x)/a.width*2-1,s=-((n-a.y)/a.height)*2+1;if(o<-1||o>1||s<-1||s>1)return e;try{i.pointer.set(o,s),i.raycaster.setFromCamera(i.pointer,i.camera);let e=i.raycaster.intersectObjects(i.scene.children,!0);for(let t of e){if(!Ir(t.object))continue;let e=Fr(t.object);if(!e||e.visible===!1)continue;let n=Rr(i,e,t);if(n)return n}for(let t of e){let e=Fr(t.object);if(!e||e.visible===!1)continue;let n=Rr(i,e,t);if(n)return n}}catch{}return e},Br=e=>typeof e==`string`?JSON.stringify(e):typeof e==`number`||typeof e==`boolean`?`{${String(e)}}`:Array.isArray(e)&&e.length<=4&&e.every(e=>typeof e==`number`||typeof e==`string`)?`{${JSON.stringify(e)}}`:null,Vr=e=>{let t=e.instance?.props??{},n=[];for(let r of fr){let i=t[r];r===`name`&&i===void 0&&e.object.name&&(i=e.object.name);let a=Br(i);a&&n.push(`${r}=${a}`)}return e.instanceId!==null&&n.push(`instanceId={${e.instanceId}}`),`<${e.tagName}${n.length>0?` ${n.join(` `)}`:``} />`},Hr=e=>{if(e.object.name)return`${e.tagName}[name=${JSON.stringify(e.object.name)}]`;let t=e.instanceId===null?``:`:${e.instanceId}`;return`${e.tagName}[uuid=${JSON.stringify(`${e.object.uuid}${t}`)}]`},Ur=e=>{e.object.updateWorldMatrix(!0,!1);let t=e.object.matrixWorld.clone();if(e.instanceId===null||!e.object.getMatrixAt)return t;let n=e.object.matrixWorld.clone();return e.object.getMatrixAt(e.instanceId,n),n.premultiply(t)},Wr=e=>{if(!gr(e.geometry))return null;e.geometry.boundingBox||e.geometry.computeBoundingBox();let t=e.geometry.boundingBox;return!t||!mr(t.min)||!mr(t.max)?null:t},Gr=(e,t)=>{let n=t.x+t.width/2,r=t.y+t.height/2;if(e.intersectionPoint){let i=e.intersectionPoint.clone().project(e.rootState.camera);Number.isFinite(i.x)&&Number.isFinite(i.y)&&(n=t.x+(i.x+1)/2*t.width,r=t.y+(1-i.y)/2*t.height)}return{x:n-16/2,y:r-16/2,width:16,height:16,borderRadius:`0px`}},Kr=e=>{let t=Kt(e.canvas),n=Wr(e.object);if(!n)return Gr(e,t);let r=Ur(e),i=[n.min.x,n.max.x],a=[n.min.y,n.max.y],o=[n.min.z,n.max.z],s=1/0,c=1/0,l=-1/0,u=-1/0,d=n.min.clone();for(let n of i)for(let i of a)for(let a of o){if(d.set(n,i,a).applyMatrix4(r).project(e.rootState.camera),!Number.isFinite(d.x)||!Number.isFinite(d.y))continue;let o=t.x+(d.x+1)/2*t.width,f=t.y+(1-d.y)/2*t.height;s=Math.min(s,o),c=Math.min(c,f),l=Math.max(l,o),u=Math.max(u,f)}if(!Number.isFinite(s)||!Number.isFinite(c)||!Number.isFinite(l)||!Number.isFinite(u))return Gr(e,t);let f=Math.max(t.x,s),p=Math.max(t.y,c),ee=Math.min(t.x+t.width,l),m=Math.min(t.y+t.height,u);return ee<=f||m<=p?Gr(e,t):{x:f,y:p,width:ee-f,height:m-p,borderRadius:`0px`}};let I=null,L=null,R=null;const qr=()=>{R!==null&&clearTimeout(R),R=setTimeout(()=>{R=null,rr()},100)},Jr=()=>{R!==null&&(clearTimeout(R),R=null)},Yr=(e,t,n,r)=>{let i=Math.abs(e-n),a=Math.abs(t-r);return i<=2&&a<=2},Xr=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return[];Jr(),nr();try{let n=Gn(e,t),r=hn()?n.filter(gn):n,i=[];for(let n of r)i.push(zr(n,e,t));return i}finally{qr()}},Zr=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n=performance.now();if(L){let r=L.element,i=n-L.timestamp<16;if(r.isConnected&&i&&Kn(e,t,L.bounds)&&!D(r))return r;L=null,I?.element===r&&(I=null)}if(I){let r=Yr(e,t,I.clientX,I.clientY),i=n-I.timestamp<16;if(r||i)return I.element}Jr(),nr();try{let r=null,i=En(e,t),a=i?zr(i,e,t):null;if(r=i&&a&&Vn(a)&&gn(i)?a:Un(e,t),r&&g(r)&&!D(r)){let e=Kt(r);L={element:r,timestamp:n,bounds:{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height}}}else L=null;return I={clientX:e,clientY:t,element:r,timestamp:n},r}finally{qr()}},Qr=()=>{Jr(),rr(),I=null,L=null},z=e=>{console.warn(`[react-grab]`,e)},$r=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);let B=!1,V=null,H=!1;const U=new Map;let ei=-1;const W=new WeakSet,ti=new WeakSet,ni=new WeakMap,G=new Map,K=new Map,ri=e=>{if(V===e&&(H=!0),W.has(e))return!0;if(!B&&V===e){let t=(ni.get(e)??0)+1;return ni.set(e,t),t<4?!1:(W.add(e),!0)}return!B||!(`gsapVersions`in window)||!(Error().stack??``).includes(`_tick`)?!1:(W.add(e),ti.add(e),!0)};typeof window<`u`&&(window.requestAnimationFrame=e=>{let t=ri(e);if(B&&t){let t=ei--;return U.set(t,e),t}let n=xn(t=>{if(B&&ri(e)){let t=ei--;U.set(t,e),G.set(n,t);return}let r=V,i=H;V=e,H=!1;try{e(t)}finally{let t=H;V=r,H=i,!t&&!ti.has(e)&&(W.delete(e),ni.delete(e))}});return n},window.cancelAnimationFrame=e=>{if(U.has(e)){U.delete(e);return}let t=K.get(e);if(t!==void 0){Sn(t.nativeId),K.delete(e);return}let n=G.get(e);if(n!==void 0){U.delete(n),G.delete(e);return}Sn(e)});const ii=()=>{if(!B){B=!0,U.clear(),G.clear();for(let[e,{nativeId:t,callback:n}]of K)Sn(t),U.set(e,n);K.clear()}},ai=()=>{if(B){B=!1;for(let[e,t]of U.entries()){let n=xn(n=>{K.delete(e);let r=V,i=H;V=t,H=!1;try{t(n)}finally{let e=H;V=r,H=i,!e&&!ti.has(t)&&(W.delete(t),ni.delete(t))}});K.set(e,{nativeId:n,callback:t})}U.clear(),G.clear()}},oi=`
29
+ [${ve}],
30
+ [${ve}] * {
31
+ animation-play-state: paused !important;
32
+ transition: none !important;
33
+ }
34
+ `,si=e=>e?.namespaceURI===`http://www.w3.org/2000/svg`&&e.tagName===`svg`;let ci=null,q=[],J=[],li=[];const Y=new Set,X=new Map,Z=new Map;let Q=[];const ui=()=>X.size>0,di=()=>{ci||=qn(`data-react-grab-frozen-styles`,oi)},fi=e=>{let t=new Set;for(let n of e){let e=si(n)?n:n.closest(`svg`);si(e)&&t.add(e);for(let e of n.querySelectorAll(`svg`))si(e)&&t.add(e)}return[...t]},pi=(e,t)=>{let n=Reflect.get(e,t);typeof n==`function`&&n.call(e)},mi=(e,t)=>{for(let n of e){let e=Z.get(n)??0;if(e===0){Z.set(n,1),t.push(n),pi(n,`pauseAnimations`);continue}Z.set(n,e+1),t.push(n)}},hi=(e,t)=>{let n=[];for(let r of e){let e=Z.get(r);if(e){if(e===1){try{pi(r,`unpauseAnimations`),Z.delete(r)}catch(e){n.push(r),t.push(e)}continue}Z.set(r,e-1)}}return n},gi=e=>{let t=[];for(let n of e)for(let e of n.getAnimations({subtree:!0}))e.playState===`running`&&t.push(e);return t},_i=e=>{for(let t of e)try{t.finish()}catch{}},vi=e=>{for(let t of e)try{t.finish()}catch{try{t.play()}catch{}}},yi=e=>{if(!(e.effect instanceof KeyframeEffect))return!1;let t=e.effect.target;if(!Le(t))return!1;let n=t.getRootNode();return qt(n)&&Pn(n.host)},bi=e=>{if(e.length===0||$r(e,li))return;xi();let t=[...e];di(),q=t,J=[];try{mi(fi(q),J);for(let e of q)e.setAttribute(ve,``);let e=gi(q);Q=[];for(let t of e)t.pause(),Q.push(t);li=t}catch(e){try{xi()}catch(t){throw AggregateError([e,t],`Rolling back animation freeze failed`)}throw e}},xi=()=>{if(q.length===0&&J.length===0&&Q.length===0)return;let e=q,t=J,n=Q,r=[],i=[];li=[];for(let t of e)try{t.removeAttribute(ve)}catch(e){i.push(t),r.push(e)}q=i,J=hi(t,r),vi(n),Q=[],A(r,`Unfreezing element animations failed`)},Si=e=>e.length===0?(xi(),()=>{}):(bi(e),xi),Ci=e=>{let t=[];for(let n of e.getAnimations())yi(n)||n.playState===`running`&&t.push(n);return{targetDocument:e,runningAnimations:t}},wi=e=>{let t=X.get(e);if(!t)return[];let n=[],r=t.styleElement;if(r){try{if(t.didUseCssFreeze){r.textContent=`
35
+ *, *::before, *::after {
36
+ transition: none !important;
37
+ }
38
+ `;let t=[];for(let n of e.getAnimations())yi(n)||t.push(n);_i(t)}else vi(t.frozenWaapiAnimations);t.didUseCssFreeze=!1,t.frozenWaapiAnimations=[]}catch(e){n.push(e)}try{r.remove(),t.styleElement=null}catch(e){n.push(e)}}return t.frozenSvgElements=hi(t.frozenSvgElements,n),t.styleElement===null&&t.frozenSvgElements.length===0&&t.frozenWaapiAnimations.length===0&&X.delete(e),n},Ti=e=>{if(X.has(e.targetDocument))return;let t=qn(`data-react-grab-global-freeze`,``,e.targetDocument),n={styleElement:t,frozenSvgElements:[],frozenWaapiAnimations:[],didUseCssFreeze:!1};if(X.set(e.targetDocument,n),e.runningAnimations.length>200)t.textContent=`
39
+ *, *::before, *::after {
40
+ animation-play-state: paused !important;
41
+ transition: none !important;
42
+ }
43
+ `,n.didUseCssFreeze=!0;else for(let t of e.runningAnimations)t.pause(),n.frozenWaapiAnimations.push(t);mi(fi(Array.from(e.targetDocument.querySelectorAll(`svg`))),n.frozenSvgElements)},Ei=e=>{Y.add(e);try{ui()&&Ti(Ci(e))}catch(t){Y.delete(e);let n=wi(e);throw n.length===0?t:AggregateError([t,...n],`Freezing frame animations failed`)}return()=>{Y.delete(e),A(wi(e),`Unfreezing frame animations failed`)}},Di=()=>ui()?[]:(Y.add(document),[...Y].map(Ci)),Oi=e=>{if(!ui()){for(let t of e)Ti(t);ii()}},ki=()=>{if(!ui())return;let e=[];for(let t of[...X.keys()])e.push(...wi(t));try{ai()}catch(t){e.push(t)}A(e,`Unfreezing global animations failed`)},Ai=(e,t)=>{for(let n of e.querySelectorAll(`:hover`))if(!Fn(n)&&(h(n)&&t.add(n),n.shadowRoot&&Ai(n.shadowRoot,t),g(n))){let e=D(n);e&&Ai(e,t)}},ji=()=>{let e=new Set;return Ai(document,e),[...e]},Mi=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],Ni=[`focus`,`blur`,`focusin`,`focusout`],Pi=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`,`display`],Fi=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],Ii=new Map,Li=new Map,Ri=new Set;let zi=!1;const Bi=e=>{e.stopImmediatePropagation()},Vi=e=>{e.preventDefault(),e.stopImmediatePropagation()},Hi=e=>{for(let t of Mi)e.addEventListener(t,Bi,!0);for(let t of Ni)e.addEventListener(t,Vi,!0)},Ui=e=>{for(let t of Mi)e.removeEventListener(t,Bi,!0);for(let t of Ni)e.removeEventListener(t,Vi,!0)},Wi=e=>{Ri.add(e);let t=$n(e);return zi&&Hi(e),()=>{zi&&Ui(e),Ri.delete(e),t()}},Gi=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=new Map,a=new Map;for(let n of t){let t=r.getPropertyValue(n);t&&(i.set(n,t),a.set(n,{value:e.style.getPropertyValue(n),priority:e.style.getPropertyPriority(n)}))}return{element:e,frozenPropertyValues:i,originalPropertyValues:a}},Ki=(e,t)=>{let n=[],r=En(e,t);for(;r&&r!==document.documentElement&&!Fn(r);)h(r)&&n.push(r),r=fn(r);return n},qi=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;){if(h(t)&&e.push(t),t.shadowRoot?.activeElement){t=t.shadowRoot.activeElement;continue}if(g(t)){t=D(t)?.activeElement??null;continue}t=null}return e},Ji=(e,t)=>{for(let{element:n,frozenPropertyValues:r,originalPropertyValues:i}of e){t.set(n,i);for(let[e,t]of r)n.style.setProperty(e,t,`important`)}},Yi=e=>{let t=[];for(let[n,r]of e){for(let[e,i]of r)try{i.value?n.style.setProperty(e,i.value,i.priority):n.style.removeProperty(e),r.delete(e)}catch(e){t.push(e)}r.size===0&&e.delete(n)}return t},Xi=(e,t)=>{if(Qn())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?Ki(e,t):ji();for(let e of r){let t=Gi(e,Pi);t&&n.push(t)}let i=[];for(let e of qi()){let t=Gi(e,Fi,Li);t&&i.push(t)}return{hoverStates:n,focusStates:i}},Zi=e=>{if(e){zi=!0,Ri.add(document);for(let e of Ri)Hi(e);Ji(e.hoverStates,Ii),Ji(e.focusStates,Li),er()}},Qi=()=>{Qr(),zi=!1;for(let e of Ri)Ui(e);let e=[...Yi(Ii),...Yi(Li)];try{tr()}catch(t){e.push(t)}A(e,`Unfreezing pseudo states failed`)},$i=()=>{let e=[];try{cr()}catch(t){e.push(t)}try{Qi()}catch(t){e.push(t)}try{ki()}catch(t){e.push(t)}return e},ea=(e,t)=>{let n=Xi(e,t),r=Di();try{Zi(n),Oi(r),sr()}catch(e){let t=$i();throw t.length===0?e:AggregateError([e,...t],`Freezing global interactions failed`)}},ta=()=>{A($i(),`Unfreezing global interactions failed`)};let $=!1,na=0;const ra=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},ia=new WeakMap,aa=new WeakMap,oa=new WeakMap,sa=new Set,ca=[],la=[],ua=new WeakMap,da=new WeakMap,fa=new WeakSet,pa=vt,ma=new Set,ha=e=>e.rendererPackageName.startsWith(`react-dom`),ga=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},_a=e=>{let t=e.current?.stateNode;if(!t||typeof t!=`object`)return!1;let n=Reflect.get(t,`containerInfo`);return!!(n&&typeof n==`object`&&typeof Reflect.get(n,`nodeType`)==`number`)},va=()=>{if(pa.size>0){let e=new Set;for(let t of pa)_a(t)&&e.add(t);return e}let e=new Set,t=n=>{let r=Rt(n);if(r){let t=ga(r);t&&e.add(t);return}for(let r of Array.from(n.children))if(t(r),e.size>0)return};return t(document.body),e},ya=(e,t)=>{if(!e)return t;if(!t)return e;if(!e.next||!t.next)return t;let n=e.next,r=t.next,i=e===n,a=t===r;return i&&a?(e.next=t,t.next=e):i?(e.next=r,t.next=e):a?(t.next=n,e.next=t):(e.next=r,t.next=n),t},ba=e=>{if(!e||ua.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>$?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,`pending`,{configurable:!0,enumerable:!0,get:()=>$?null:n,set:e=>{if($){e!==null&&(t.bufferedPending=ya(t.bufferedPending??null,e));return}n=e}}),ua.set(e,t)},xa=e=>{if(!e)return[];let t=[],n=e.next;if(!n)return[];let r=n;do r&&=(t.push(r.action),r.next);while(r&&r!==n);return t},Sa=e=>{let t=ua.get(e);if(!t)return;t.originalGetSnapshot&&(e.getSnapshot=t.originalGetSnapshot),t.originalPendingDescriptor?Object.defineProperty(e,`pending`,t.originalPendingDescriptor):delete e.pending,e.pending=null;let n=e.dispatch;if(typeof n==`function`){let e=xa(t.pendingValueAtPause??null),r=xa(t.bufferedPending??null);for(let t of[...e,...r])la.push(()=>n(t))}ua.delete(e)},Ca=e=>{if(da.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,`memoizedValue`,{configurable:!0,enumerable:!0,get(){return $?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if($){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),da.set(e,t)},wa=e=>{let t=da.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,`memoizedValue`,t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),da.delete(e))},Ta=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&ba(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)Ca(n),n=n.next},Ea=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Sa(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)wa(n),n=n.next},Da=e=>{let t=e;for(;t;){if(st(t)&&Ta(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},Oa=e=>{let t=e;for(;t;){if(st(t)&&Ea(t),t.child){t=t.child;continue}for(;t!==e&&!t.sibling;)if(t=t.return,!t)return;if(t===e)return;t=t.sibling}},ka=e=>{if(ia.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};ia.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!$||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,ra(aa,a,()=>(...e)=>{$?la.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!$||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,ra(aa,a,()=>(...e)=>{$?la.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!$||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,ra(oa,a,()=>e=>{$?ca.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>$?n.useSyncExternalStore(t=>e(()=>{$?sa.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},Aa=e=>{let t=e.currentDispatcherRef;if(!t||typeof t!=`object`)return;let n=`H`in t?`H`:`current`,r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:()=>(r&&typeof r==`object`&&ka(r),r),set:e=>{r=e}})},ja=e=>{queueMicrotask(()=>{try{for(let t of b().renderers.values())if(ha(t)&&typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch(e){z(new E(`scheduleUpdate failed during unfreeze`,e))}}}catch(e){z(new E(`scheduleReactUpdate failed`,e))}})},Ma=e=>{for(let t of e)try{t()}catch(e){z(new E(`Callback failed during state replay`,e))}},Na=()=>{for(let e of b().renderers.values())ha(e)&&(fa.has(e)||(Aa(e),fa.add(e)))},Pa=()=>{sa.clear(),ca.length=0,la.length=0},Fa=()=>{let e=new Set(ma);try{for(let t of va())e.add(t)}catch(e){z(new E(`Collecting fiber roots failed during unfreeze`,e))}ma.clear(),$=!1;for(let t of e)try{Oa(t.current)}catch(e){z(new E(`Resuming a fiber root failed during unfreeze`,e))}let t=Array.from(sa),n=ca.slice(),r=la.slice();Pa(),Ma(t),Ma(n),Ma(r),$||ja(e)},Ia=()=>{let e=na===0;if(na+=1,e)try{Na(),$=!0;let e=va();for(let t of e)ma.add(t),Da(t.current)}catch(e){throw--na,$&&Fa(),e}let t=!1;return()=>{t||(t=!0,--na,na===0&&Fa())}},La=()=>{try{return Ia()}catch(e){return z(new E(`Pausing React updates failed`,e)),()=>{}}};export{gt as $,u as $t,fn as A,p as At,Yt as B,le as Bt,Sn as C,Me as Ct,_n as D,ie as Dt,hn as E,De as Et,en as F,s as Ft,E as G,pe as Gt,Xt as H,a as Ht,$t as I,ae as It,qt as J,Ce as Jt,rn as K,fe as Kt,an as L,Se as Lt,un as M,ge as Mt,cn as N,je as Nt,gn as O,xe as Ot,on as P,Pe as Pt,Vt as Q,c as Qt,Jt as R,ce as Rt,D as S,Ne as St,Cn as T,ue as Tt,Qt as U,o as Ut,Zt as V,se as Vt,T as W,me as Wt,Wt as X,ye as Xt,Kt as Y,Ie as Yt,w as Z,Fe as Zt,Gn as _,ee as _t,Wi as a,m as an,ft as at,Fn as b,ne as bt,Ei as c,b as ct,Zr as d,g as dt,f as en,dt as et,Xr as f,h as ft,nr as g,re as gt,rr as h,de as ht,ta as i,Ae as in,ot as it,dn as j,Oe as jt,mn as k,be as kt,z as l,He as lt,A as m,_e as mt,Ia as n,we as nn,_t as nt,bi as o,te as on,yt as ot,zr as p,Le as pt,nn as q,he as qt,ea as r,i as rn,Rt as rt,Si as s,t as sn,tt as st,La as t,d as tn,st as tt,Qr as u,Ve as ut,Bn as v,Ee as vt,xn as w,l as wt,Mn as x,ke as xt,Vn as y,Te as yt,tn as z,oe as zt};
@@ -6,7 +6,7 @@
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
- import { D as ReactGrabAPI, P as Theme, b as Options, r as StackFrame } from "./copy-content-CcSwO8vJ.js";
9
+ import { D as ReactGrabAPI, P as Theme, b as Options, r as StackFrame } from "./copy-content-lkRiqdFh.js";
10
10
 
11
11
  //#region src/core/context.d.ts
12
12
  declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
@@ -6,7 +6,7 @@
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
- import { D as ReactGrabAPI, P as Theme, b as Options, r as StackFrame } from "./copy-content-Dxdqj7pl.cjs";
9
+ import { D as ReactGrabAPI, P as Theme, b as Options, r as StackFrame } from "./copy-content-BwBAqbRh.cjs";
10
10
 
11
11
  //#region src/core/context.d.ts
12
12
  declare const getStack: (element: Element) => Promise<StackFrame[] | null>;
package/dist/index.cjs CHANGED
@@ -6,4 +6,4 @@
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
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./core-DMQiEALv.cjs`),t=require(`./freeze-updates-giOP_Nph.cjs`),n=require(`./open-file-BavF8qWS.cjs`),r=()=>{if(typeof window>`u`||window.parent===window)return null;try{return window.parent.__REACT_GRAB__??null}catch{return null}};if(typeof window<`u`&&!window.__REACT_GRAB_DISABLED__){let t=window.__REACT_GRAB__??r();t?e.a(t):e.a(e.t()),window.dispatchEvent(new CustomEvent(`react-grab:init`,{detail:e.r()}))}exports.DEFAULT_THEME=e.l,exports.FreezeError=t.z,exports.OpenFileError=t.V,exports.PluginSetupError=t.W,exports.ReactGrabError=t.G,exports.commentPlugin=e.c,exports.formatElementInfo=n.r,exports.generateSnippet=e.n,exports.getGlobalApi=e.r,exports.getStack=n.o,exports.init=e.t,exports.isInstrumentationActive=t.rt,exports.openPlugin=e.s,exports.registerPlugin=e.i,exports.setGlobalApi=e.a,exports.unregisterPlugin=e.o;
9
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./core-Ds3sjKE1.cjs`),t=require(`./freeze-updates-BOaH41eE.cjs`),n=require(`./open-file-DR73qcD1.cjs`),r=()=>{if(typeof window>`u`||window.parent===window)return null;try{return window.parent.__REACT_GRAB__??null}catch{return null}};if(typeof window<`u`&&!window.__REACT_GRAB_DISABLED__){let t=window.__REACT_GRAB__??r();t?e.a(t):e.a(e.t()),window.dispatchEvent(new CustomEvent(`react-grab:init`,{detail:e.r()}))}exports.DEFAULT_THEME=e.l,exports.FreezeError=t.R,exports.OpenFileError=t.B,exports.PluginSetupError=t.U,exports.ReactGrabError=t.W,exports.commentPlugin=e.c,exports.formatElementInfo=n.r,exports.generateSnippet=e.n,exports.getGlobalApi=e.r,exports.getStack=n.o,exports.init=e.t,exports.isInstrumentationActive=t.nt,exports.openPlugin=e.s,exports.registerPlugin=e.i,exports.setGlobalApi=e.a,exports.unregisterPlugin=e.o;
package/dist/index.d.cts CHANGED
@@ -6,8 +6,8 @@
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
- import { A as Rect, C as PluginConfig, D as ReactGrabAPI, E as PromptModeContext, F as ToolbarState, M as SettableOptions, N as SourceInfo, P as Theme, S as Plugin, T as Position, _ as ElementSelectedEventDetail, a as ActionContext, b as Options, c as AgentContext, d as DeepPartial, f as DragRect, g as ElementLabelVariant, h as ElementLabelContext, j as SelectedElementPayload, k as ReactGrabState, l as ContextMenuAction, n as isInstrumentationActive, o as ActionContextHooks, s as ActivationMode, u as ContextMenuActionContext, v as GrabbedBox, w as PluginHooks, x as OverlayBounds, y as OpenFileActionHooks } from "./copy-content-Dxdqj7pl.cjs";
10
- import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-DdYffA2X.cjs";
9
+ import { A as Rect, C as PluginConfig, D as ReactGrabAPI, E as PromptModeContext, F as ToolbarState, M as SettableOptions, N as SourceInfo, P as Theme, S as Plugin, T as Position, _ as ElementSelectedEventDetail, a as ActionContext, b as Options, c as AgentContext, d as DeepPartial, f as DragRect, g as ElementLabelVariant, h as ElementLabelContext, j as SelectedElementPayload, k as ReactGrabState, l as ContextMenuAction, n as isInstrumentationActive, o as ActionContextHooks, s as ActivationMode, u as ContextMenuActionContext, v as GrabbedBox, w as PluginHooks, x as OverlayBounds, y as OpenFileActionHooks } from "./copy-content-BwBAqbRh.cjs";
10
+ import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-CvAuGVjl.cjs";
11
11
  import { i as ReactGrabError, n as OpenFileError, r as PluginSetupError, t as FreezeError } from "./errors-CTlIFDQs.cjs";
12
12
 
13
13
  //#region src/core/plugins/comment.d.ts
package/dist/index.d.ts CHANGED
@@ -6,8 +6,8 @@
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
- import { A as Rect, C as PluginConfig, D as ReactGrabAPI, E as PromptModeContext, F as ToolbarState, M as SettableOptions, N as SourceInfo, P as Theme, S as Plugin, T as Position, _ as ElementSelectedEventDetail, a as ActionContext, b as Options, c as AgentContext, d as DeepPartial, f as DragRect, g as ElementLabelVariant, h as ElementLabelContext, j as SelectedElementPayload, k as ReactGrabState, l as ContextMenuAction, n as isInstrumentationActive, o as ActionContextHooks, s as ActivationMode, u as ContextMenuActionContext, v as GrabbedBox, w as PluginHooks, x as OverlayBounds, y as OpenFileActionHooks } from "./copy-content-CcSwO8vJ.js";
10
- import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-Cd-ADR9Q.js";
9
+ import { A as Rect, C as PluginConfig, D as ReactGrabAPI, E as PromptModeContext, F as ToolbarState, M as SettableOptions, N as SourceInfo, P as Theme, S as Plugin, T as Position, _ as ElementSelectedEventDetail, a as ActionContext, b as Options, c as AgentContext, d as DeepPartial, f as DragRect, g as ElementLabelVariant, h as ElementLabelContext, j as SelectedElementPayload, k as ReactGrabState, l as ContextMenuAction, n as isInstrumentationActive, o as ActionContextHooks, s as ActivationMode, u as ContextMenuActionContext, v as GrabbedBox, w as PluginHooks, x as OverlayBounds, y as OpenFileActionHooks } from "./copy-content-lkRiqdFh.js";
10
+ import { a as getStack, i as formatElementInfo, n as generateSnippet, r as DEFAULT_THEME, t as init } from "./index-BX45N3Oq.js";
11
11
  import { i as ReactGrabError, n as OpenFileError, r as PluginSetupError, t as FreezeError } from "./errors-BEgowzRA.js";
12
12
 
13
13
  //#region src/core/plugins/comment.d.ts