grab 0.1.47-dev.26647d1 → 0.1.47-dev.2be1b9a
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/{action-shortcuts-DGAbqoMS.cjs → action-shortcuts-BmiLCnu5.cjs} +1 -1
- package/dist/{action-shortcuts-BhYokJly.js → action-shortcuts-XUIWZ3jl.js} +1 -1
- package/dist/{copy-content-DyQ55Lr9.cjs → copy-content-B1_QAMt0.cjs} +1 -1
- package/dist/{copy-content-B1dIIWHE.js → copy-content-BlvgGWmj.js} +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.js +1 -1
- package/dist/{core-CX8-wQgd.cjs → core-B8Mv580_.cjs} +2 -2
- package/dist/{core-CzP697X8.js → core-BOca7d3l.js} +2 -2
- package/dist/{freeze-updates-DJkl1rRj.cjs → freeze-updates-BrD6urbz.cjs} +1 -1
- package/dist/{freeze-updates-C0j6jfj-.js → freeze-updates-_YfmiA9D.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.global.js +2 -2
- package/dist/index.js +1 -1
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.js +1 -1
- package/dist/{renderer-DorUP9xI.cjs → renderer-DGH_eFvg.cjs} +1 -1
- package/dist/{renderer-i3kQaP-2.js → renderer-Pwx56AQA.js} +1 -1
- package/package.json +2 -2
|
@@ -6,10 +6,10 @@
|
|
|
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 e,B as t,C as n,D as r,E as i,F as a,H as o,I as s,J as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,St as g,T as _,V as v,Y as ee,_t as te,b as ne,bt as y,ct as b,dt as x,g as re,gt as ie,h as ae,ht as S,i as C,j as oe,k as se,lt as ce,mt as w,n as le,nt as ue,o as de,p as fe,pt as pe,r as me,t as he,tt as T,ut as E,v as ge,w as _e,x as ve,y as ye,yt as D,z as be}from"./action-shortcuts-
|
|
9
|
+
import{A as e,B as t,C as n,D as r,E as i,F as a,H as o,I as s,J as c,L as l,M as u,N as d,O as f,P as p,R as m,S as h,St as g,T as _,V as v,Y as ee,_t as te,b as ne,bt as y,ct as b,dt as x,g as re,gt as ie,h as ae,ht as S,i as C,j as oe,k as se,lt as ce,mt as w,n as le,nt as ue,o as de,p as fe,pt as pe,r as me,t as he,tt as T,ut as E,v as ge,w as _e,x as ve,y as ye,yt as D,z as be}from"./action-shortcuts-XUIWZ3jl.js";import{$ as xe,B as Se,Bt as Ce,C as we,E as Te,H as O,Ht as k,J as Ee,K as De,S as Oe,U as ke,V as Ae,_ as je,_t as Me,b as Ne,c as Pe,ct as Fe,dt as Ie,f as Le,g as Re,gt as ze,h as Be,i as Ve,l as He,m as Ue,o as We,p as Ge,r as Ke,s as qe,t as Je,u as Ye,ut as Xe,v as Ze,vt as Qe,w as $e,x as et,y as tt,yt as A,zt as nt}from"./freeze-updates-_YfmiA9D.js";import{a as rt,c as it,d as at,i as j,n as ot,o as st,r as ct,s as lt,t as ut}from"./copy-content-BlvgGWmj.js";var dt=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
10
10
|
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-contain-size:initial;--tw-contain-layout:initial;--tw-contain-paint:initial;--tw-contain-style:initial}}}@layer theme{:root,:host{--font-sans:"Geist", ui-sans-serif, system-ui, sans-serif;--font-serif:ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-500:oklch(63.7% .237 25.331);--spacing:4px;--font-weight-thin:100;--font-weight-extralight:200;--font-weight-light:300;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--font-weight-black:900;--radius-sm:4px;--ease-out:cubic-bezier(0, 0, .2, 1);--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--ease-drawer:cubic-bezier(.32, .72, 0, 1);--ease-spring:cubic-bezier(.34, 1.56, .64, 1)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.a11y-hitbox{position:relative}.a11y-hitbox:before{content:"";pointer-events:auto;width:100%;min-width:24px;height:100%;min-height:24px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\\/2{top:50%}.top-\\[2px\\]{top:2px}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-full{right:100%}.bottom-\\[2px\\]{bottom:2px}.bottom-full{bottom:100%}.left-0{left:calc(var(--spacing) * 0)}.left-full{left:100%}.z-1{z-index:1}.z-10{z-index:10}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.-m-0\\.5{margin:calc(var(--spacing) * -.5)}.-m-4{margin:calc(var(--spacing) * -4)}.m-0{margin:calc(var(--spacing) * 0)}.-mx-2{margin-inline:calc(var(--spacing) * -2)}.-my-1\\.5{margin-block:calc(var(--spacing) * -1.5)}.-mt-\\[8px\\]{margin-top:-8px}.mt-2\\.5{margin-top:calc(var(--spacing) * 2.5)}.mr-1\\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2\\.5{margin-right:calc(var(--spacing) * 2.5)}.mb-1\\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2\\.5{margin-bottom:calc(var(--spacing) * 2.5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2\\.5{margin-left:calc(var(--spacing) * 2.5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-auto{margin-left:auto}.ml-px{margin-left:1px}.no-scrollbar{scrollbar-width:none;-ms-overflow-style:none}.no-scrollbar::-webkit-scrollbar{width:0;height:0;display:none}.line-clamp-5{-webkit-line-clamp:5;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.list-item{display:list-item}.size-0{width:calc(var(--spacing) * 0);height:calc(var(--spacing) * 0)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.size-\\[12px\\]{width:12px;height:12px}.size-\\[16px\\]{width:16px;height:16px}.h-\\[8px\\]{height:8px}.h-\\[17px\\]{height:17px}.h-\\[20px\\]{height:20px}.h-\\[24px\\]{height:24px}.h-fit{height:fit-content}.max-h-\\[var\\(--rg-edit-list-max-h\\)\\]{max-height:var(--rg-edit-list-max-h)}.min-h-0{min-height:calc(var(--spacing) * 0)}.min-h-4{min-height:calc(var(--spacing) * 4)}.min-h-\\[28px\\]{min-height:28px}.w-\\[2px\\]{width:2px}.w-\\[calc\\(100\\%\\+16px\\)\\]{width:calc(100% + 16px)}.w-auto{width:auto}.w-fit{width:fit-content}.w-full{width:100%}.w-px{width:1px}.max-w-\\[280px\\]{max-width:280px}.max-w-full{max-width:100%}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[36px\\]{min-width:36px}.min-w-\\[100px\\]{min-width:100px}.min-w-\\[150px\\]{min-width:150px}.flex-1{flex:1}.flex-shrink,.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.-rotate-90{rotate:-90deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.interactive-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}@media (hover:hover) and (pointer:fine){.interactive-scale:hover{transform:scale(1.05)}}.interactive-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.96)}.press-scale{transition:transform .4s cubic-bezier(.34,1.56,.64,1)}.press-scale:active{transition:transform 60ms cubic-bezier(0,0,.2,1);transform:scale(.97)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-grab{cursor:grab}.cursor-grabbing{cursor:grabbing}.cursor-pointer{cursor:pointer}.cursor-text{cursor:text}.resize{resize:both}.resize-none{resize:none}.grid-cols-\\[0fr\\]{grid-template-columns:0fr}.grid-cols-\\[1fr\\]{grid-template-columns:1fr}.grid-rows-\\[0fr\\]{grid-template-rows:0fr}.grid-rows-\\[1fr\\]{grid-template-rows:1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-\\[5px\\]{gap:5px}.self-stretch{align-self:stretch}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:4px}.rounded-\\[1px\\]{border-radius:1px}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-\\[6px\\]{border-radius:6px}.rounded-\\[14px\\]{border-radius:14px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.rounded-t{border-top-left-radius:4px;border-top-right-radius:4px}.rounded-t-\\[10px\\]{border-top-left-radius:10px;border-top-right-radius:10px}.rounded-t-none{border-top-left-radius:0;border-top-right-radius:0}.rounded-l{border-top-left-radius:4px;border-bottom-left-radius:4px}.rounded-l-\\[10px\\]{border-top-left-radius:10px;border-bottom-left-radius:10px}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-tl{border-top-left-radius:4px}.rounded-r{border-top-right-radius:4px;border-bottom-right-radius:4px}.rounded-r-\\[10px\\]{border-top-right-radius:10px;border-bottom-right-radius:10px}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tr{border-top-right-radius:4px}.rounded-b{border-bottom-right-radius:4px;border-bottom-left-radius:4px}.rounded-b-\\[6px\\]{border-bottom-right-radius:6px;border-bottom-left-radius:6px}.rounded-b-\\[10px\\]{border-bottom-right-radius:10px;border-bottom-left-radius:10px}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-br{border-bottom-right-radius:4px}.rounded-bl{border-bottom-left-radius:4px}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.\\[border-width\\:0\\.5px\\]{border-width:.5px}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-t-4{border-top-style:var(--tw-border-style);border-top-width:4px}.\\[border-top-width\\:0\\.5px\\]{border-top-width:.5px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-dotted{--tw-border-style:dotted;border-style:dotted}.border-none{--tw-border-style:none;border-style:none}.border-solid{--tw-border-style:solid;border-style:solid}.border-\\[var\\(--rg-border-button\\)\\]{border-color:var(--rg-border-button)}.border-t-\\[var\\(--rg-border-subtle\\)\\]{border-top-color:var(--rg-border-subtle)}.bg-\\[\\#f00\\]{background-color:red}.bg-\\[var\\(--rg-error-bg\\)\\]{background-color:var(--rg-error-bg)}.bg-\\[var\\(--rg-panel-bg\\)\\]{background-color:var(--rg-panel-bg)}.bg-\\[var\\(--rg-submit-bg\\)\\]{background-color:var(--rg-submit-bg)}.bg-\\[var\\(--rg-surface-active\\)\\]{background-color:var(--rg-surface-active)}.bg-\\[var\\(--rg-surface-hover\\)\\]{background-color:var(--rg-surface-hover)}.bg-\\[var\\(--rg-text-primary\\)\\]{background-color:var(--rg-text-primary)}.bg-\\[var\\(--rg-text-secondary\\)\\]{background-color:var(--rg-text-secondary)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.25{padding-inline:calc(var(--spacing) * .25)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-\\[3px\\]{padding-inline:3px}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-0\\.25{padding-block:calc(var(--spacing) * .25)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-px{padding-block:1px}.pt-1\\.5{padding-top:calc(var(--spacing) * 1.5)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.text-center{text-align:center}.text-justify{text-align:justify}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.font-serif{font-family:var(--font-serif)}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.leading-3\\.5{--tw-leading:calc(var(--spacing) * 3.5);line-height:calc(var(--spacing) * 3.5)}.leading-4{--tw-leading:calc(var(--spacing) * 4);line-height:calc(var(--spacing) * 4)}.font-black{--tw-font-weight:var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-extralight{--tw-font-weight:var(--font-weight-extralight);font-weight:var(--font-weight-extralight)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.font-thin{--tw-font-weight:var(--font-weight-thin);font-weight:var(--font-weight-thin)}.break-normal{overflow-wrap:normal;word-break:normal}.break-words,.wrap-break-word{overflow-wrap:break-word}.break-all{word-break:break-all}.break-keep{word-break:keep-all}.text-ellipsis{text-overflow:ellipsis}.whitespace-break-spaces{white-space:break-spaces}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-line{white-space:pre-line}.whitespace-pre-wrap{white-space:pre-wrap}.text-\\[var\\(--rg-error-text\\)\\]{color:var(--rg-error-text)}.text-\\[var\\(--rg-submit-fg\\)\\]{color:var(--rg-submit-fg)}.text-\\[var\\(--rg-text-primary\\)\\]{color:var(--rg-text-primary)}.text-\\[var\\(--rg-text-primary-85\\)\\]{color:var(--rg-text-primary-85)}.text-\\[var\\(--rg-text-secondary\\)\\]{color:var(--rg-text-secondary)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.\\[box-shadow\\:var\\(--rg-shadow\\)\\]{box-shadow:var(--rg-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\\[filter\\:var\\(--rg-drop-shadow\\)\\]{filter:var(--rg-drop-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-columns\\]{transition-property:grid-template-columns;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[grid-template-rows\\]{transition-property:grid-template-rows;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[opacity\\,transform\\]{transition-property:opacity,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[padding\\,border-radius\\,transform\\]{transition-property:padding,border-radius,transform;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[top\\,left\\,width\\,height\\,opacity\\,border-radius\\]{transition-property:top,left,width,height,opacity,border-radius;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,color\\]{transition-property:transform,color;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-\\[transform\\,opacity\\]{transition-property:transform,opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.delay-\\[80ms\\]{transition-delay:80ms}.duration-60{--tw-duration:60ms;transition-duration:60ms}.duration-75{--tw-duration:75ms;transition-duration:75ms}.duration-100{--tw-duration:.1s;transition-duration:.1s}.duration-120{--tw-duration:.12s;transition-duration:.12s}.duration-140{--tw-duration:.14s;transition-duration:.14s}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-180{--tw-duration:.18s;transition-duration:.18s}.duration-220{--tw-duration:.22s;transition-duration:.22s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-400{--tw-duration:.4s;transition-duration:.4s}.ease-\\[cubic-bezier\\(0\\,0\\,0\\.2\\,1\\)\\]{--tw-ease:cubic-bezier(0,0,.2,1);transition-timing-function:cubic-bezier(0,0,.2,1)}.ease-drawer{--tw-ease:var(--ease-drawer);transition-timing-function:var(--ease-drawer)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.ease-spring{--tw-ease:var(--ease-spring);transition-timing-function:var(--ease-spring)}.will-change-\\[opacity\\,transform\\]{will-change:opacity,transform}.will-change-transform{will-change:transform}.contain-layout{--tw-contain-layout:layout;contain:var(--tw-contain-size,) var(--tw-contain-layout,) var(--tw-contain-paint,) var(--tw-contain-style,)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.\\[corner-shape\\:superellipse\\(1\\.25\\)\\]{corner-shape:superellipse(1.25)}.\\[font-synthesis\\:none\\]{font-synthesis:none}@media (hover:hover){.group-hover\\:text-\\[var\\(--rg-text-primary\\)\\]:is(:where(.group):hover *){color:var(--rg-text-primary)}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}.hover\\:bg-\\[var\\(--rg-error-bg-hover\\)\\]:hover{background-color:var(--rg-error-bg-hover)}.hover\\:bg-\\[var\\(--rg-surface-active\\)\\]:hover{background-color:var(--rg-surface-active)}.hover\\:bg-\\[var\\(--rg-surface-hover\\)\\]:hover{background-color:var(--rg-surface-hover)}.hover\\:text-\\[var\\(--rg-text-primary\\)\\]:hover{color:var(--rg-text-primary)}}.disabled\\:cursor-default:disabled{cursor:default}.disabled\\:opacity-40:disabled{opacity:.4}}:host{all:initial;direction:ltr}:host,[data-rg-theme=dark]{--rg-panel-bg:#161616;--rg-text-primary:#fff;--rg-text-secondary:#a7a7a7;--rg-surface-hover:#ffffff1a;--rg-surface-active:#ffffff26;--rg-border-subtle:#ffffff1a;--rg-border-button:#fff3;--rg-submit-bg:#fff;--rg-submit-fg:#161616;--rg-error-text:#f87171;--rg-error-bg:#3d1515;--rg-error-bg-hover:#4d1f1f;--rg-shadow:0 2px 8px #00000014;--rg-drop-shadow:drop-shadow(0px 2px 8px #00000014);--rg-shimmer-from:#a1a1aa;--rg-shimmer-to:#d4d4d8;--rg-text-primary-85:#ffffffd9}@media (prefers-color-scheme:dark){:host:not([data-rg-theme]){--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}}:host([data-rg-theme=light]),[data-rg-theme=light]{--rg-panel-bg:#fff;--rg-text-primary:#171717;--rg-text-secondary:#737373;--rg-surface-hover:#0000000d;--rg-surface-active:#00000014;--rg-border-subtle:#00000014;--rg-border-button:#00000026;--rg-submit-bg:#171717;--rg-submit-fg:#fff;--rg-error-text:#dc2626;--rg-error-bg:#fee2e2;--rg-error-bg-hover:#fecaca;--rg-shadow:0 2px 12px #0000001a;--rg-drop-shadow:drop-shadow(0px 2px 12px #0000001a);--rg-shimmer-from:#71717a;--rg-shimmer-to:#a1a1aa;--rg-text-primary-85:#171717d9}@keyframes rg-slot-enter-up{0%{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-up{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}}@keyframes rg-slot-enter-down{0%{filter:blur(2px);opacity:0;transform:translateY(-.5em)scale(.5)}to{filter:blur();opacity:1;transform:translateY(0)scale(1)}}@keyframes rg-slot-exit-down{0%{filter:blur();opacity:1;transform:translateY(0)scale(1)}to{filter:blur(2px);opacity:0;transform:translateY(.5em)scale(.5)}}@keyframes rg-slot-enter-fade{0%{filter:blur(2px);opacity:0;transform:scale(.5)}to{filter:blur();opacity:1;transform:scale(1)}}@keyframes rg-slot-exit-fade{0%{filter:blur();opacity:1;transform:scale(1)}to{filter:blur(2px);opacity:0;transform:scale(.5)}}.rg-slot-column{vertical-align:top;display:inline-block;position:relative}.rg-slot-sizer{visibility:hidden;white-space:pre;display:inline-block}.rg-slot-cell{white-space:pre;will-change:transform, filter, opacity;animation-duration:var(--rg-slot-dur,.35s);animation-timing-function:var(--rg-slot-ease,cubic-bezier(.34, 1.56, .64, 1));animation-fill-mode:both;display:inline-block;position:absolute;top:0;left:0}.rg-slot-cell.rg-slot-enter[data-dir="1"]{animation-name:rg-slot-enter-up}.rg-slot-cell.rg-slot-enter[data-dir="-1"]{animation-name:rg-slot-enter-down}.rg-slot-cell.rg-slot-enter[data-dir="0"]{animation-name:rg-slot-enter-fade}.rg-slot-cell.rg-slot-exit[data-dir="1"]{animation-name:rg-slot-exit-up}.rg-slot-cell.rg-slot-exit[data-dir="-1"]{animation-name:rg-slot-exit-down}.rg-slot-cell.rg-slot-exit[data-dir="0"]{animation-name:rg-slot-exit-fade}@media (prefers-reduced-motion:reduce){:host,:host *,:host :before,:host :after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}:host :focus,:host :focus-visible{box-shadow:none!important;outline:none!important}@keyframes shake{0%,to{translate:0}15%,45%{translate:calc(-3px * var(--rg-shake-x,1)) calc(-3px * var(--rg-shake-y,0))}30%,60%{translate:calc(3px * var(--rg-shake-x,1)) calc(3px * var(--rg-shake-y,0))}75%{translate:calc(-2px * var(--rg-shake-x,1)) calc(-2px * var(--rg-shake-y,0))}90%{translate:calc(2px * var(--rg-shake-x,1)) calc(2px * var(--rg-shake-y,0))}}@keyframes icon-loader-spin{0%{opacity:1}50%{opacity:.5}to{opacity:.2}}.icon-loader-bar{animation:.5s linear infinite icon-loader-spin}@keyframes shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}.shimmer-text{background:linear-gradient(90deg, var(--rg-shimmer-from) 0%, var(--rg-shimmer-to) 25%, var(--rg-shimmer-from) 50%, var(--rg-shimmer-to) 75%, var(--rg-shimmer-from) 100%);color:#0000;background-size:200% 100%;-webkit-background-clip:text;background-clip:text;animation:2.5s linear infinite shimmer}.animate-shake,.animate-shake-vertical{will-change:translate;animation:.3s ease-out shake}@keyframes tooltip-fade-in{0%{opacity:0;transform:scale(.97)}to{opacity:1;transform:scale(1)}}.animate-tooltip-fade-in{will-change:transform, opacity;animation:.1s ease-out tooltip-fade-in}.animate-shake-vertical{--rg-shake-x:0;--rg-shake-y:1}@supports (-webkit-touch-callout:none){textarea[data-react-grab-input]{font-size:16px}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-contain-size{syntax:"*";inherits:false}@property --tw-contain-layout{syntax:"*";inherits:false}@property --tw-contain-paint{syntax:"*";inherits:false}@property --tw-contain-style{syntax:"*";inherits:false}`;const M=Symbol(`store-raw`),N=Symbol(`store-node`),P=Symbol(`store-has`),ft=Symbol(`store-self`);function F(e){let t=e[T];if(!t&&(Object.defineProperty(e,T,{value:t=new Proxy(e,vt)}),!Array.isArray(e))){let n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){let a=n[i];r[a].get&&Object.defineProperty(e,a,{enumerable:r[a].enumerable,get:r[a].get.bind(t)})}}return t}function I(e){let t;return typeof e==`object`&&!!e&&(e[T]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function pt(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[M])return n;if(!I(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let n=0,a=e.length;n<a;n++)i=e[n],(r=pt(i,t))!==i&&(e[n]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);let n=Object.keys(e),o=Object.getOwnPropertyDescriptors(e);for(let s=0,c=n.length;s<c;s++)a=n[s],!o[a].get&&(i=e[a],(r=pt(i,t))!==i&&(e[a]=r))}return e}function L(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function mt(e,t,n){if(e[t])return e[t];let[r,i]=S(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function ht(e,t){let n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===T||t===N?n:(delete n.value,delete n.writable,n.get=()=>e[T][t],n)}function gt(e){ie()&&mt(L(e,N),ft)()}function _t(e){return gt(e),Reflect.ownKeys(e)}const vt={get(e,t,n){if(t===M)return e;if(t===T)return n;if(t===ue)return gt(e),n;let r=L(e,N),i=r[t],a=i?i():e[t];if(t===N||t===P||t===`__proto__`)return a;if(!i){let n=Object.getOwnPropertyDescriptor(e,t);ie()&&(typeof a!=`function`||e.hasOwnProperty(t))&&!(n&&n.get)&&(a=mt(r,t,a)())}return I(a)?F(a):a},has(e,t){return t===M||t===T||t===ue||t===N||t===P||t===`__proto__`?!0:(ie()&&mt(L(e,P),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:_t,getOwnPropertyDescriptor:ht};function yt(e,t,n,r=!1){if(!r&&e[t]===n)return;let i=e[t],a=e.length;n===void 0?(delete e[t],e[P]&&e[P][t]&&i!==void 0&&e[P][t].$()):(e[t]=n,e[P]&&e[P][t]&&i===void 0&&e[P][t].$());let o=L(e,N),s;if((s=mt(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let t=e.length;t<a;t++)(s=o[t])&&s.$();(s=mt(o,`length`,a))&&s.$(e.length)}(s=o[ft])&&s.$()}function R(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r+=1){let i=n[r];yt(e,i,t[i])}}function z(e,t){if(typeof t==`function`&&(t=t(e)),t=pt(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){let r=t[n];e[n]!==r&&yt(e,n,r)}yt(e,`length`,r)}else R(e,t)}function bt(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();let a=typeof r,o=Array.isArray(e);if(Array.isArray(r)){for(let i=0;i<r.length;i++)bt(e,[r[i]].concat(t),n);return}else if(o&&a===`function`){for(let i=0;i<e.length;i++)r(e[i],i)&&bt(e,[i].concat(t),n);return}else if(o&&a===`object`){let{from:i=0,to:a=e.length-1,by:o=1}=r;for(let r=i;r<=a;r+=o)bt(e,[r].concat(t),n);return}else if(t.length>1){bt(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a==`function`&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=pt(a),r===void 0||I(i)&&I(a)&&!Array.isArray(a)?R(i,a):yt(e,r,a))}function xt(...[e,t]){let n=pt(e||{}),r=Array.isArray(n),i=F(n);function a(...e){b(()=>{r&&e.length===1?z(n,e[0]):bt(n,e)})}return[i,a]}const St=new WeakMap,B={get(e,t){if(t===M)return e;let n=e[t],r;return I(n)?St.get(n)||(St.set(n,r=new Proxy(n,B)),r):n},set(e,t,n){return yt(e,t,pt(n)),!0},deleteProperty(e,t){return yt(e,t,void 0,!0),!0}};function V(e){return t=>{if(I(t)){let n;(n=St.get(t))||St.set(t,n=new Proxy(t,B)),e(n)}return t}}let H=new WeakMap,U=new WeakMap;const Ct=()=>{H=new WeakMap,U=new WeakMap},wt=(e,t,n)=>{let r=U.get(e);if(r&&n-r.timestamp<200)return r.borderRadius;let i=(t??window.getComputedStyle(e)).borderRadius||`0px`;return U.set(e,{borderRadius:i,timestamp:n}),i},W=e=>{let t=performance.now(),n=H.get(e);if(n&&t-n.timestamp<16)return n.bounds;let r=e.getBoundingClientRect(),i={borderRadius:wt(e,null,t),height:r.height,width:r.width,x:r.left,y:r.top};return H.set(e,{bounds:i,timestamp:t}),i},G=e=>({x:e.x+e.width/2,y:e.y+e.height/2}),Tt=e=>({selectionInteractionLockDepth:0,wasActivatedByToggle:!1,pendingCommentMode:!1,keyHoldDuration:e.keyHoldDuration,dragStart:{x:A,y:A},copyStart:{x:A,y:A},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],frozenDragRect:null,lastGrabbedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:``,grabbedBoxes:[],labelInstances:[],isTouchMode:!1,activationTimestamp:null,previouslyFocusedElement:null,contextMenuPosition:null,contextMenuElement:null,contextMenuClickOffset:null}),Et=e=>{let[t,n]=xt(Tt(e)),[r,i]=S({x:A,y:A}),[a,s]=S(0),[c,l]=S({state:`idle`}),u=e=>{n(V(t=>{e(t),t.frozenElement=t.frozenElements.length>0?t.frozenElements[0]:null,t.frozenDragRect=null}))},d=()=>{u(e=>{e.frozenElements=[]})},f=e=>{l(t=>t.state===`active`?{...t,phase:e}:t)},p={startHold:e=>{e!==void 0&&n(`keyHoldDuration`,e),l({state:`holding`,startedAt:Date.now()})},releaseHold:()=>{c().state===`holding`&&l({state:`idle`})},activate:()=>{b(()=>{l({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement)})},deactivate:()=>{b(()=>{l({state:`idle`}),n(V(e=>{e.wasActivatedByToggle=!1,e.pendingCommentMode=!1,e.inputText=``,e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null,e.activationTimestamp=null,e.previouslyFocusedElement=null,e.contextMenuPosition=null,e.contextMenuElement=null,e.contextMenuClickOffset=null,e.isTouchMode&&(e.detectedElement=null)}))})},toggle:()=>{t.activationTimestamp===null?(n(`wasActivatedByToggle`,!0),p.activate()):p.deactivate()},freeze:()=>{if(c().state===`active`){let e=t.frozenElement??t.detectedElement;e&&n(`frozenElement`,e),f(`frozen`)}},unfreeze:()=>{c().state===`active`&&b(()=>{n(V(e=>{e.frozenElement=null,e.frozenElements=[],e.frozenDragRect=null})),f(`hovering`)})},startDrag:(e,t)=>{c().state===`active`&&b(()=>{t||d(),n(`dragStart`,{x:e.x+window.scrollX,y:e.y+window.scrollY}),f(`dragging-select`)})},startDragReposition:()=>{let e=c();e.state===`active`&&e.phase===`dragging-select`&&f(`dragging-reposition`)},stopDragReposition:()=>{let e=c();e.state===`active`&&e.phase===`dragging-reposition`&&f(`dragging-select`)},shiftDragStart:e=>{let t=c();t.state===`active`&&t.phase===`dragging-reposition`&&n(`dragStart`,t=>({x:t.x+e.x,y:t.y+e.y}))},endDrag:()=>{let e=c();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&b(()=>{n(`dragStart`,{x:A,y:A}),f(`justDragged`)})},cancelDrag:()=>{let e=c();e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)&&b(()=>{n(`dragStart`,{x:A,y:A}),f(`hovering`)})},finishJustDragged:()=>{let e=c();e.state===`active`&&e.phase===`justDragged`&&f(`hovering`)},startCopy:()=>{let e=c().state===`active`;l({state:`copying`,startedAt:Date.now(),wasActive:e})},completeCopy:()=>{let e=c(),t=e.state===`copying`?e.wasActive:!1;l({state:`justCopied`,copiedAt:Date.now(),wasActive:t})},finishJustCopied:()=>{let e=c();e.state===`justCopied`&&(e.wasActive&&!t.wasActivatedByToggle?b(()=>{d(),l({state:`active`,phase:`hovering`,isPromptMode:!1,isPendingDismiss:!1})}):p.deactivate())},enterPromptMode:(e,t)=>{let{x:r}=G(W(t));b(()=>{n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r),i(e),n(`frozenElement`,t),n(`wasActivatedByToggle`,!0),c().state===`active`?l(e=>e.state===`active`?{...e,isPromptMode:!0,phase:`frozen`}:e):(l({state:`active`,phase:`frozen`,isPromptMode:!0,isPendingDismiss:!1}),n(`activationTimestamp`,Date.now()),n(`previouslyFocusedElement`,document.activeElement))})},exitPromptMode:()=>{l(e=>e.state===`active`?{...e,isPromptMode:!1,isPendingDismiss:!1}:e)},setInputText:e=>{n(`inputText`,e)},clearInputText:()=>{n(`inputText`,``)},setPendingDismiss:e=>{l(t=>t.state===`active`?{...t,isPendingDismiss:e}:t)},setPointer:e=>{i(t=>t.x===e.x&&t.y===e.y?t:e)},setDetectedElement:e=>{n(`detectedElement`,e)},setFrozenElement:e=>{u(t=>{t.frozenElements=[e]})},setFrozenElements:e=>{u(t=>{t.frozenElements=e})},toggleFrozenElement:e=>{u(t=>{let n=t.frozenElements.indexOf(e);n>=0?t.frozenElements.splice(n,1):t.frozenElements.push(e)})},addFrozenElements:e=>{u(t=>{for(let n of e)t.frozenElements.includes(n)||t.frozenElements.push(n)})},setFrozenDragRect:e=>{n(`frozenDragRect`,e)},setCopyStart:(e,t)=>{let{x:r}=G(W(t));n(`copyStart`,e),n(`copyOffsetFromCenterX`,e.x-r)},setLastGrabbed:e=>{n(`lastGrabbedElement`,e)},setWasActivatedByToggle:e=>{n(`wasActivatedByToggle`,e)},setPendingCommentMode:e=>{n(`pendingCommentMode`,e)},setTouchMode:e=>{n(`isTouchMode`,e)},incrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>e+1)},decrementSelectionInteractionLockDepth:()=>{n(`selectionInteractionLockDepth`,e=>Math.max(0,e-1))},setSelectionSource:(e,t)=>{b(()=>{n(`selectionFilePath`,e),n(`selectionLineNumber`,t)})},incrementViewportVersion:()=>{s(e=>e+1)},addGrabbedBox:e=>{n(`grabbedBoxes`,t=>[...t,e])},removeGrabbedBox:e=>{n(`grabbedBoxes`,t=>t.filter(t=>t.id!==e))},clearGrabbedBoxes:()=>{n(`grabbedBoxes`,[])},addLabelInstance:e=>{n(`labelInstances`,t=>[...t,e])},updateLabelInstance:(e,r,i)=>{let a=t.labelInstances.findIndex(t=>t.id===e);a!==-1&&b(()=>{n(`labelInstances`,a,`status`,r),i!==void 0&&n(`labelInstances`,a,`errorMessage`,i)})},removeLabelInstance:e=>{n(`labelInstances`,t=>t.filter(t=>t.id!==e))},clearLabelInstances:()=>{n(`labelInstances`,[])},showContextMenu:(e,t)=>{let{x:r,y:i}=G(W(t));b(()=>{n(`contextMenuPosition`,e),n(`contextMenuElement`,t),n(`contextMenuClickOffset`,{x:e.x-r,y:e.y-i})})},hideContextMenu:()=>{b(()=>{n(`contextMenuPosition`,null),n(`contextMenuElement`,null),n(`contextMenuClickOffset`,null)})},updateContextMenuPosition:()=>{let e=t.contextMenuElement,r=t.contextMenuClickOffset;if(!e||!r||!o(e))return;let{x:i,y:a}=G(W(e));n(`contextMenuPosition`,{x:i+r.x,y:a+r.y})}};return{store:t,actions:p,pointer:r,viewportVersion:a,current:c}},K=e=>{if(!document.body)return;let t=document.querySelectorAll(`[${k}]`);for(let n of t)n!==e&&n.parentNode!==e&&(n.shadowRoot||n.remove());document.body.appendChild(e)},Dt=e=>{if(document.body){K(e);return}let t=()=>{document.removeEventListener(`DOMContentLoaded`,t),K(e)};document.addEventListener(`DOMContentLoaded`,t,{once:!0})},Ot=e=>{let t=document.querySelectorAll(`[${k}]`);for(let e of t){let t=e.shadowRoot?.querySelector(`[${k}]`);if(t instanceof HTMLDivElement)return{root:t,host:e};e.remove()}let n=document.createElement(`div`);n.setAttribute(k,`true`),Se(n),n.style.zIndex=String(Ce),n.style.position=`fixed`,n.style.inset=`0`,n.style.pointerEvents=`none`,n.style.contain=`strict`;let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`),a=Ae();a&&(i.nonce=a),i.textContent=`@import url("https://fonts.googleapis.com/css2?family=Geist:wght@500&display=swap");\n${e??``}`,r.appendChild(i);let o=document.createElement(`div`);return o.setAttribute(k,`true`),r.appendChild(o),Dt(n),setTimeout(()=>{K(n)},Me),{root:o,host:n}},kt=e=>{let[t,n]=S(void 0),r=0;return E(D(e,e=>{let t=++r;if(!e){n(void 0);return}let i=ct(e)??void 0;n(i),rt(e).then(e=>{r===t&&n(e??i)}).catch(()=>{r===t&&n(i)})})),[t,n]},At=[`data-theme`,`data-mode`,`data-color-scheme`,`data-bs-theme`,`data-mui-color-scheme`],jt=[{attribute:`data-dark`,theme:`dark`},{attribute:`data-light`,theme:`light`}],Mt=(e,t,n)=>{let[r,i,a]=[e,t,n].map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*r+.7152*i+.0722*a},Nt=e=>{let t=s(getComputedStyle(e).backgroundColor),n=t?m(t):null;return!n||n.alpha===0?null:Mt(n.red,n.green,n.blue)<.18?`dark`:`light`},Pt=e=>{let t=e.toLowerCase();return t===`dark`?`dark`:t===`light`?`light`:null},Ft=e=>{let t=e.trim().toLowerCase();if(!t||t===`normal`||t===`auto`)return null;let n=t.split(/\s+/),r=n.includes(`dark`),i=n.includes(`light`);return r&&i?null:r?`dark`:i?`light`:null},It=e=>{let t=e.style.colorScheme||getComputedStyle(e).colorScheme;return t?Ft(t):null},Lt=e=>{if(e.classList.contains(`dark`))return`dark`;if(e.classList.contains(`light`))return`light`;for(let t of At){let n=e.getAttribute(t);if(!n)continue;let r=Pt(n);if(r)return r}for(let{attribute:t,theme:n}of jt)if(e.hasAttribute(t))return n;return null},Rt=(e,t)=>{for(let n of e){if(!n)continue;let e=t(n);if(e)return e}return null},zt=()=>{let e=[document.documentElement,document.body],t=[document.body,document.documentElement];return Rt(e,Lt)??Rt(e,It)??Rt(t,Nt)??(window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`)},Bt=e=>e===`dark`?`light`:`dark`,Vt={attributes:!0,attributeFilter:[`class`,`style`,...At,...jt.map(({attribute:e})=>e)]},Ht=(e,t)=>{let n=null,r=null,i=()=>{let r=Bt(zt());return r!==n&&(n=r,e.setAttribute(`data-rg-theme`,r),t?.(r)),r},a=()=>{r===null&&(r=we(()=>{r=null,i()}))},o=i(),s=new MutationObserver(a);s.observe(document.documentElement,Vt);let c=null;document.body?s.observe(document.body,Vt):(c=new MutationObserver(()=>{document.body&&(c.disconnect(),c=null,s.observe(document.body,Vt),i())}),c.observe(document.documentElement,{childList:!0}));let l=window.matchMedia(`(prefers-color-scheme: dark)`);return l.addEventListener(`change`,a),{theme:o,cleanup:()=>{c?.disconnect(),s.disconnect(),l.removeEventListener(`change`,a),r!==null&&Oe(r)}}},q=()=>{},Ut=()=>({activate:q,deactivate:q,toggle:q,comment:q,isActive:()=>!1,isEnabled:()=>!1,setEnabled:q,getToolbarState:()=>null,setToolbarState:q,onToolbarStateChange:()=>q,dispose:q,copyElement:()=>Promise.resolve(!1),getSource:()=>Promise.resolve(null),getStackContext:()=>Promise.resolve(``),getState:()=>({isActive:!1,isDragging:!1,isCopying:!1,isPromptMode:!1,isSelectionBoxVisible:!1,isDragBoxVisible:!1,targetElement:null,dragBounds:null,grabbedBoxes:[],labelInstances:[],selectionFilePath:null,toolbarState:null}),setOptions:q,registerPlugin:q,unregisterPlugin:q,getPlugins:()=>[],getDisplayName:()=>null}),Wt=()=>{let e=new AbortController;return{signal:e.signal,abort:()=>e.abort(),addWindowListener:(t,n,r={})=>{window.addEventListener(t,n,{...r,signal:e.signal})},addDocumentListener:(t,n,r={})=>{document.addEventListener(t,n,{...r,signal:e.signal})}}},Gt=(e,t=`Unknown error`)=>e instanceof Error&&e.message?e.message:t,Kt=e=>e instanceof Error?e:Error(String(e)),qt=e=>({functionName:e.functionName,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,isServer:e.isServer,isSymbolicated:e.isSymbolicated}),Jt=async(e,t)=>{let n={maxLines:t},[r,i,a,o]=await Promise.all([j(e,n),lt(e,n),it(e),st(e)]);return{tagName:O(e),componentName:a?.componentName??void 0,content:`[${r}]`,source:a,stackContext:i,frames:(o??[]).map(qt)}},Yt=async(e,t)=>{let n=await Promise.all(e.map(e=>Jt(e,t))),r=new Map;for(let e of n)r.has(e.content)||r.set(e.content,e);let i=[...r.values()];return i.length>0?{content:i.map(e=>e.content).join(`
|
|
11
11
|
`),entries:i}:null},Xt=(e,t,n)=>{if(e?.entries)return t===e.content?e.entries:e.entries.length===1?[{...e.entries[0],content:t,commentText:n}]:e.entries.map(e=>({...e,commentText:n}))},Zt=async(e,t,n,r)=>{await t.onBeforeCopy(n);let i=!1,a=``;try{let o=e.getContent?{content:await e.getContent(n)}:await Yt(n,e.maxContextLines),s=o?.content;if(s?.trim()){let c=await t.transformCopyContent(s,n);a=r?`${r}\n${c}`:c,i=ut(a,{componentName:e.componentName,entries:Xt(o,a,r)})}}catch(e){t.onCopyError(Kt(e))}return i&&t.onCopySuccess(n,a),t.onAfterCopy(n,i),i},J=(e,t)=>{let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return Math.max(0,i-n)*Math.max(0,a-r)},Qt=(e,t)=>e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top,$t=e=>e.sort((e,t)=>{if(e===t)return 0;let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING?-1:n&Node.DOCUMENT_POSITION_PRECEDING?1:0}),en=e=>{if(e.width<=0||e.height<=0)return[];let t=window.innerWidth,n=window.innerHeight,r=e.x,i=e.y,o=e.x+e.width,s=e.y+e.height,c=r+e.width/2,l=i+e.height/2,u=a(Math.ceil(e.width/32),3,20),d=a(Math.ceil(e.height/32),3,20),f=u*d,p=f>100?Math.sqrt(100/f):1,m=a(Math.floor(u*p),3,20),h=a(Math.floor(d*p),3,20),g=new Set,_=[],v=(e,r)=>{let i=a(Math.round(e),0,t-1),o=a(Math.round(r),0,n-1),s=`${i}:${o}`;g.has(s)||(g.add(s),_.push({x:i,y:o}))};v(r+1,i+1),v(o-1,i+1),v(r+1,s-1),v(o-1,s-1),v(c,i+1),v(c,s-1),v(r+1,l),v(o-1,l),v(c,l);for(let t=0;t<m;t+=1){let n=r+(t+.5)/m*e.width;for(let t=0;t<h;t+=1)v(n,i+(t+.5)/h*e.height)}return _},Y=(e,t,n)=>{let r={left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height},i=new Set,a=en(e);Ze();try{for(let e of a){let t=document.elementsFromPoint(e.x,e.y);for(let e of t)i.add(e)}}finally{je()}let o=[];for(let e of i)!n&&et(e)||t(e)&&o.push(e);let s=new Map;for(let e of o)s.set(e,e.getBoundingClientRect());let c=[];for(let e of o){let t=s.get(e);if(t.width<=0||t.height<=0)continue;let i={left:t.left,top:t.top,right:t.left+t.width,bottom:t.top+t.height};if(n){let n=J(r,i),a=t.width*t.height;a>0&&n/a>=.75&&c.push(e)}else Qt(i,r)&&c.push(e)}return $t(c)},tn=e=>{let t=new Set(e);return e.filter(e=>{for(let n=e.parentElement;n;n=n.parentElement)if(t.has(n))return!1;return!0})},nn=(e,t,n=!0)=>tn(Y(e,t,n)),rn=(e,t)=>e.width<=0?0:a((t.x-e.x)/e.width,0,1),an=e=>{let t=window.innerWidth,n=window.innerHeight,r=Math.max(0,e.x),i=Math.min(t,e.x+e.width),a=Math.max(0,e.y),o=Math.min(n,e.y+e.height);return{x:(r+i)/2,y:(a+o)/2}},on=()=>{Ct(),Ue(),tt()},sn=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.pageX-window.scrollX,y:e.pageY-window.scrollY}),cn=e=>({pageX:e.x+window.scrollX,pageY:e.y+window.scrollY,width:e.width,height:e.height}),ln=e=>({borderRadius:`0px`,height:e.height,width:e.width,x:e.x,y:e.y}),un=new Set([`c`,`C`,`с`,`С`,`ȼ`,`Ȼ`,`ↄ`,`Ↄ`,`ᴄ`,`ᶜ`,`ⱼ`,`ⅽ`,`Ⅽ`,`ç`,`Ç`,`ć`,`Ć`,`č`,`Č`,`ĉ`,`Ĉ`,`ċ`,`Ċ`]),dn=(e,t)=>t===`KeyC`?!0:!e||e.length!==1?!1:un.has(e),fn=(e,t)=>{if(!e||!t)return!1;let n=e.toLowerCase();return t===`Space`?n===`space`||n===` `:t.startsWith(`Key`)?t.slice(3).toLowerCase()===n:t.startsWith(`Digit`)?t.slice(5)===n:!1},pn={meta:`metaKey`,cmd:`metaKey`,command:`metaKey`,win:`metaKey`,windows:`metaKey`,ctrl:`ctrlKey`,control:`ctrlKey`,shift:`shiftKey`,alt:`altKey`,option:`altKey`,opt:`altKey`},mn=e=>{let t=e.split(`+`).map(e=>e.trim().toLowerCase()),n={metaKey:!1,ctrlKey:!1,shiftKey:!1,altKey:!1,key:null};for(let e of t){let t=pn[e];t?n[t]=!0:n.key=e}return n},hn=e=>{if(typeof e==`function`)return e;let t=mn(e),n=t.key;return e=>{if(n===null){let n=t.metaKey?e.metaKey||e.key===`Meta`:!0,r=t.ctrlKey?e.ctrlKey||e.key===`Control`:!0,i=t.shiftKey?e.shiftKey||e.key===`Shift`:!0,a=t.altKey?e.altKey||e.key===`Alt`:!0,o=n&&r&&i&&a,s=[t.metaKey,t.ctrlKey,t.shiftKey,t.altKey].filter(Boolean).length,c=[e.metaKey||e.key===`Meta`,e.ctrlKey||e.key===`Control`,e.shiftKey||e.key===`Shift`,e.altKey||e.key===`Alt`].filter(Boolean).length;return o&&c>=s}let r=e.key?.toLowerCase()===n||fn(n,e.code),i=t.metaKey||t.ctrlKey||t.shiftKey||t.altKey?(t.metaKey?e.metaKey:!0)&&(t.ctrlKey?e.ctrlKey:!0)&&(t.shiftKey?e.shiftKey:!0)&&(t.altKey?e.altKey:!0):!e.metaKey&&!e.ctrlKey&&!e.shiftKey&&!e.altKey;return r&&i}},gn=e=>!e||typeof e==`function`?{metaKey:p(),ctrlKey:!p(),shiftKey:!1,altKey:!1,key:null}:mn(e),_n=(e,t)=>{if(t.activationKey)return hn(t.activationKey)(e);let n=(p()?e.metaKey:e.ctrlKey)&&!e.shiftKey&&!e.altKey;return!!(e.key&&n&&dn(e.key,e.code))},vn=e=>{if(e.length===0)return{x:0,y:0,width:0,height:0};if(e.length===1)return e[0];let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let a of e)t=Math.min(t,a.x),n=Math.min(n,a.y),r=Math.max(r,a.x+a.width),i=Math.max(i,a.y+a.height);return{x:t,y:n,width:r-t,height:i-n}},X=e=>{let t=getComputedStyle(e),n={};for(let e of f)n[e]=t.getPropertyValue(e);return n},yn=e=>{let t={};for(let n of ge)t[n]=e.getPropertyValue(n);return t},bn=e=>{try{let t=e.parentElement;if(!t)return null;let n=e.namespaceURI,r=e.tagName.toLowerCase(),i=n&&n!==`http://www.w3.org/1999/xhtml`?e.ownerDocument.createElementNS(n,r):e.ownerDocument.createElement(r),a=`style`in i?i.style:null;a instanceof CSSStyleDeclaration&&a.setProperty(`display`,`none`,`important`),t.appendChild(i);try{return yn(getComputedStyle(i))}finally{i.remove()}}catch{return null}},xn=new Set([`display`,`width`,`height`]),Sn=(e,t,n)=>e.kind===`color`?!1:e.cssProperties.some(e=>xn.has(e))?Cn(e):e.cssProperties.every(e=>{let r=t[e],i=n[e];return r===void 0||i===void 0?!1:r===i}),Cn=e=>{if(e.kind===`color`)return!1;if(e.kind===`enum`)return e.key===`font-weight`?e.original===`400`:e.options[0]?.value===e.original;let{key:t,original:n}=e;return t.startsWith(`padding`)||t.startsWith(`margin`)||t.includes(`gap`)||t===`border-width`||t.endsWith(`-radius`)||t===`border-radius`?n===0:t===`opacity`?n===100:t===`letter-spacing`||t===`z-index`?n===0:_e.has(t)?!1:!!(t===`width`||t===`height`||t===`width,height`||t.startsWith(`max-`)||t.startsWith(`min-`)||t===`line-height`)},wn=e=>{let t=e.trim();if(!t||t===`auto`||t===`normal`||t===`none`)return null;let n=Number.parseFloat(t);return Number.isFinite(n)?t.endsWith(`%`)?{value:n,unit:`%`}:t.endsWith(`rem`)||t.endsWith(`em`)?{value:n*16,unit:`px`}:t.endsWith(`px`)?{value:n,unit:`px`}:{value:n,unit:``}:null},Tn=(e,t)=>{let n=wn(e[t]);if(n)return n;if(t===`line-height`){let t=wn(e[`font-size`]);return t?{value:ae(t.value*Ie),unit:t.unit||`px`}:null}return ve.has(t)?{value:0,unit:`px`}:null},En=(e,t)=>{let n=Tn(e,t[0]);if(!n)return null;for(let r=1;r<t.length;r++){let i=Tn(e,t[r]);if(!i||i.unit!==n.unit||Math.abs(i.value-n.value)>=.5)return null}return n},Dn=(e,t)=>e===`opacity`?{value:Math.round(t.value*100),unit:`%`}:se.has(e)?{value:ae(t.value),unit:``}:{value:ae(t.value),unit:t.unit||`px`},On=e=>e!==null,kn=(e,t)=>{let n=t.map(t=>{let n=t.longhands.length===1?Tn(e,t.longhands[0]):En(e,t.longhands);return n?{definition:t,value:n}:null}).filter(On),r=new Map;for(let e of n)for(let t of e.definition.longhands){let n=r.get(t);(!n||e.definition.longhands.length>n.definition.longhands.length)&&r.set(t,e)}let i=new Set(r.values());return n.map(e=>({...e,isCanonical:i.has(e)}))},An=(t,i,a)=>t===`opacity`?{min:0,max:100}:t===`z-index`?{min:oe,max:e}:t===`letter-spacing`?{min:-10,max:20}:t===`font-size`?{min:8,max:96}:t===`line-height`?{min:0,max:120}:t.includes(`radius`)?{min:0,max:96}:t===`width`||t===`height`||t===`width,height`||t.startsWith(`min-`)||t.startsWith(`max-`)?{min:0,max:Math.max(512,Math.ceil(i*2))}:_e.has(t)?{min:_,max:512}:a===`%`?{min:0,max:100}:{min:t.startsWith(`margin`)?n:0,max:r},jn=(e,t,n)=>{let r=Dn(e.key,t),i=r.unit===`px`&&Math.abs(r.value)>1e7,a=An(e.key,i?0:r.value,r.unit),o=r.value<0?a.min:a.max,s=i?o:r.value;return{kind:`numeric`,key:e.key,label:e.label,cssProperties:e.longhands,min:a.min,max:a.max,value:s,original:s,unit:r.unit,tailwindAliases:de(e.key),isPrioritized:!1,isDefault:!1,isCanonical:n}},Mn=(e,t,n,r=!1)=>{let i=s(n),a=i?m(i):null,o=a!==null&&a.alpha!==0;if(!o&&!r)return null;let c=o&&i?i:Fe;return{kind:`color`,key:e,label:t,cssProperties:[e],value:c,original:c,tailwindAliases:de(e),isPrioritized:r,isDefault:!1,isCanonical:!0}},Nn=(e,t,n)=>{let r=t.trim(),i=n??e.options;return!i||!i.some(e=>e.value===r)?null:{kind:`enum`,key:e.key,label:e.label,cssProperties:[e.key],value:r,original:r,options:i,tailwindAliases:de(e.key),isPrioritized:!1,isDefault:!1,isCanonical:!0}},Pn=new Map(`background-color.color.padding.padding-left,padding-right.padding-top,padding-bottom.padding-top.padding-right.padding-bottom.padding-left.margin.margin-left,margin-right.margin-top,margin-bottom.margin-top.margin-right.margin-bottom.margin-left.font-family.font-size.font-weight.font-style.line-height.letter-spacing.text-transform.text-align.text-decoration-line.white-space.word-break.overflow-wrap.font-variant-numeric.border-radius.border-top-left-radius,border-top-right-radius.border-bottom-left-radius,border-bottom-right-radius.border-top-left-radius,border-bottom-left-radius.border-top-right-radius,border-bottom-right-radius.border-top-left-radius.border-top-right-radius.border-bottom-left-radius.border-bottom-right-radius.width,height.width.height.max-width.max-height.min-width.min-height.opacity.gap.row-gap.column-gap.border-width.border-top-width.border-right-width.border-bottom-width.border-left-width.border-color.align-items.justify-content.top,right,bottom,left.left,right.top,bottom.top.right.bottom.left.z-index`.split(`.`).map((e,t)=>[e,t])),Fn=e=>Pn.get(e.key)??1/0,In=e=>e.map((e,t)=>({property:e,index:t})).sort((e,t)=>{let n=Fn(e.property)-Fn(t.property);return n===0?e.index-t.index:n}).map(e=>e.property),Ln=e=>{let t=X(e),n=getComputedStyle(e),r=yn(n),a=bn(e),o=[],s=new Set,c=e=>{s.has(e.key)||(o.push(e),s.add(e.key))};for(let e of re)for(let n of kn(t,e))c(jn(n.definition,n.value,n.isCanonical));for(let e of i){let n=Tn(t,e.key);n&&c(jn({key:e.key,label:e.label,longhands:[e.key]},n,!0))}for(let{key:e,label:t,alwaysShow:r}of ye){let i=n.getPropertyValue(e);if(!r&&(!i||l(i)))continue;let a=Mn(e,t,i,r);a&&c(a)}let d=n.getPropertyValue(h.key);if(d){let e=Nn(h,d,u(d));e&&c(e)}for(let e of ne){let t=n.getPropertyValue(e.key);if(!t)continue;let r=Nn(e,t);r&&c(r)}return Rn(o,C(e),r,a)},Rn=(e,t,n,r)=>{let i=[],a=[];for(let o of e)if(o.isPrioritized||t.has(o.key))i.push({...o,isPrioritized:!0,isDefault:!1});else{let e=r?Sn(o,n,r):Cn(o);a.push({...o,isDefault:e})}return[...In(i),...In(a)]},zn=e=>e.kind===`color`||e.kind===`enum`?e.value:e.key===`opacity`&&e.unit===`%`?fe(e.value/100):`${fe(e.value)}${e.unit}`,Bn=e=>{let t=new Map;for(let n of e.edits){let e=zn(n);for(let r of n.cssProperties)t.set(r,e)}return Array.from(t,([e,t])=>`${e}: ${t};`)},Vn=e=>e.filePath?`${e.filePath}:${e.lineNumber}`:``,Hn=e=>{if(e.length===0)return``;let t=[`Apply these style changes canonically (CSS = visual intent; choose the source change that best expresses the underlying layout intent):`];if(e.length===1){let n=Vn(e[0]);return n&&t.push(`\n${n}`),t.push(["```css",...Bn(e[0]),"```"].join(`
|
|
12
12
|
`)),t.join(`
|
|
13
13
|
`)}for(let n of e){let e=Vn(n);t.push(e?`\n${e}`:``),t.push(["```css",...Bn(n),"```"].join(`
|
|
14
14
|
`))}return t.join(`
|
|
15
|
-
`)},Un=e=>`style`in e&&e.style instanceof CSSStyleDeclaration,Wn=e=>{let t=new Map,n=Un(e)?e:null;return{apply:(e,r)=>{if(n)for(let i of e)t.has(i)||t.set(i,{value:n.style.getPropertyValue(i),priority:n.style.getPropertyPriority(i)}),n.style.setProperty(i,r)},restore:()=>{if(!n){t.clear();return}for(let[e,{value:r,priority:i}]of t)r?n.style.setProperty(e,r,i):n.style.removeProperty(e);t.clear()},hasAppliedStyles:()=>t.size>0}},Gn=(e,t)=>{for(let n of t){let t=e.edits.findIndex(e=>e.key===n.key);t>=0?e.edits[t]=n:e.edits.push(n)}},Kn=(e,t)=>({element:e.element,preview:e.preview,filePath:e.filePath??``,lineNumber:e.lineNumber??0,edits:t}),qn=e=>{let[t,n]=S(null),[r,i]=S(!1),a=[],o=[],s=e=>{o=e},c=()=>{let r=t()!==null;n(null),i(!1),a=[],o=[],r&&e.onClose?.()},l=()=>{t()?.preview.restore();for(let e=a.length-1;e>=0;e--)a[e].preview.restore();c()},u=e=>{rt(e).then(t=>{t&&n(n=>!n||n.element!==e||n.componentName?n:{...n,componentName:t})})},d=(r,i,a={})=>{if(t()!==null)return!1;let o=Ln(r);if(o.length===0)return!1;let s=a.filePath??e.store.selectionFilePath??void 0,c=a.lineNumber??e.store.selectionLineNumber??void 0;return n({element:r,position:i,selectionBounds:W(r),properties:o,preview:Wn(r),filePath:s,lineNumber:c,componentName:a.componentName,tagName:a.tagName??O(r),initialSearchQuery:a.initialSearchQuery}),u(r),e.isActivated()||e.activateRenderer(),e.actions.setPointer(i),e.actions.setFrozenElement(r),e.actions.freeze(),e.onOpen?.(),!0},f=(r,i)=>{let s=t();if(!s||s.element===r)return!1;let c=Ln(r);return c.length===0?!1:((o.length>0||s.preview.hasAppliedStyles())&&a.push(Kn(s,o)),o=[],n({element:r,position:i,selectionBounds:W(r),properties:c,preview:Wn(r),tagName:O(r),hasSessionEdits:a.some(e=>e.edits.length>0)}),it(r).then(e=>{if(e){for(let t of a)t.element===r&&!t.filePath&&(t.filePath=e.filePath,t.lineNumber=e.lineNumber??0);n(t=>!t||t.element!==r||t.filePath?t:{...t,filePath:e.filePath,lineNumber:e.lineNumber??void 0})}}).catch(()=>void 0),u(r),e.actions.setPointer(i),e.actions.setFrozenElement(r),!0)},p=(e,t)=>[...a,Kn(e,t)],m=e=>{let t=new Map;for(let n of e){if(n.edits.length===0)continue;let e=t.get(n.element);if(e){!e.filePath&&n.filePath&&(e.filePath=n.filePath,e.lineNumber=n.lineNumber),Gn(e,n.edits);continue}t.set(n.element,{filePath:n.filePath,lineNumber:n.lineNumber,edits:[...n.edits]})}return Array.from(t.values())},h=e=>{let t=new Set;for(let n of e)n.edits.length>0&&t.add(n.element);for(let n=e.length-1;n>=0;n--){let r=e[n];r.edits.length===0&&!t.has(r.element)&&r.preview.restore()}};return{state:t,trigger:d,switchToElement:f,setPendingEdits:s,dismiss:()=>{t()!==null&&(l(),e.store.wasActivatedByToggle?e.deactivateRenderer():e.actions.unfreeze())},closePreservingRenderer:()=>{t()!==null&&(l(),e.actions.unfreeze())},submit:n=>{let r=t();if(!r)return;let i=r.element,a=p(r,n),o=Hn(m(a));h(a),c(),e.store.wasActivatedByToggle||e.actions.unfreeze(),e.performCopyWithLabel({element:i,cursorX:r.position.x,extraPrompt:o||void 0,shouldDeactivateAfter:e.store.wasActivatedByToggle})},resetWithDiscard:l,isOpen:()=>t()!==null,isInteracting:r,setInteracting:i}},Jn={enabled:!0,hue:0,selectionBox:{enabled:!0},dragBox:{enabled:!0},grabbedBoxes:{enabled:!0},elementLabel:{enabled:!0},toolbar:{enabled:!0}},Z=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),Yn={activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,activationKey:void 0,getContent:void 0,maxContextLines:3,freezeReactUpdates:!0},Xn=(e={})=>{let t=new Map,n={},[r,i]=xt({theme:Jn,options:{...Yn,...e},actions:[]}),a=()=>{let r=Jn,a={...Yn,...e},o=[];for(let{config:e}of t.values())if(e.theme&&(r=Z(r,e.theme)),e.options&&(a={...a,...e.options}),e.actions)for(let t of e.actions)o.push(t);a={...a,...n},i(`theme`,r),i(`options`,a),i(`actions`,o)},o=(e,t)=>{n[e]=t,i(`options`,e,t)},s=[`activationMode`,`keyHoldDuration`,`allowActivationInsideInput`,`activationKey`,`getContent`,`maxContextLines`,`freezeReactUpdates`],c=e=>{for(let t of s)e[t]!==void 0&&o(t,e[t])},l=(e,n)=>{t.has(e.name)&&u(e.name);let r=e.setup?.(n,_)??{};e.theme&&(r.theme=r.theme?Z(Z(Jn,e.theme),r.theme):e.theme),e.actions&&(r.actions=[...e.actions,...r.actions??[]]),e.hooks&&(r.hooks=r.hooks?{...e.hooks,...r.hooks}:e.hooks),e.options&&(r.options=r.options?{...e.options,...r.options}:e.options),t.set(e.name,{plugin:e,config:r}),a()},u=e=>{let n=t.get(e);n&&(n.config.cleanup&&n.config.cleanup(),t.delete(e),a())},d=()=>Array.from(t.keys()),f=(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&t(...n)}},p=(e,...n)=>{let r=!1;for(let{config:i}of t.values()){let t=i.hooks?.[e];t&&t(...n)===!0&&(r=!0)}return r},m=async(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&await t(...n)}},h=async(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=await t(i,...r))}return i},g=(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=t(i,...r))}return i},_={onActivate:()=>f(`onActivate`),onDeactivate:()=>f(`onDeactivate`),onElementHover:e=>f(`onElementHover`,e),onElementSelect:e=>{let n=!1,r;for(let{config:i}of t.values()){let t=i.hooks?.onElementSelect;if(t){let i=t(e);i===!0?n=!0:i instanceof Promise&&(n=!0,r=i)}}return{wasIntercepted:n,pendingResult:r}},onDragStart:(e,t)=>f(`onDragStart`,e,t),onDragEnd:(e,t)=>f(`onDragEnd`,e,t),onBeforeCopy:async e=>m(`onBeforeCopy`,e),transformCopyContent:async(e,t)=>h(`transformCopyContent`,e,t),onAfterCopy:(e,t)=>f(`onAfterCopy`,e,t),onCopySuccess:(e,t)=>f(`onCopySuccess`,e,t),onCopyError:e=>f(`onCopyError`,e),onStateChange:e=>f(`onStateChange`,e),onPromptModeChange:(e,t)=>f(`onPromptModeChange`,e,t),onSelectionBox:(e,t,n)=>f(`onSelectionBox`,e,t,n),onDragBox:(e,t)=>f(`onDragBox`,e,t),onGrabbedBox:(e,t)=>f(`onGrabbedBox`,e,t),onElementLabel:(e,t,n)=>f(`onElementLabel`,e,t,n),onContextMenu:(e,t)=>f(`onContextMenu`,e,t),onOpenFile:(e,t)=>p(`onOpenFile`,e,t),transformHtmlContent:async(e,t)=>h(`transformHtmlContent`,e,t),transformAgentContext:async(e,t)=>h(`transformAgentContext`,e,t),transformActionContext:e=>g(`transformActionContext`,e),transformOpenFileUrl:(e,t,n)=>g(`transformOpenFileUrl`,e,t,n)};return{register:l,unregister:u,getPluginNames:d,setOptions:c,store:r,hooks:_}},Zn=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,Qn=e=>{let t=e.bounds.x+e.bounds.width/2,n=e.bounds.width/2,r=e.mouseX===void 0?void 0:e.mouseX-t;return{id:Zn(`label`),bounds:e.bounds,boundsMultiple:e.boundsMultiple,tagName:e.tagName,componentName:e.componentName,status:e.status,createdAt:Date.now(),element:e.element,elements:e.elements,mouseX:e.mouseX,mouseXOffsetFromCenter:r,mouseXOffsetRatio:r!==void 0&&n>0?r/n:void 0,hideArrow:e.hideArrow}},$n=(e,t)=>{let n=new Map,r=e=>{let t=n.get(e);t!==void 0&&(window.clearTimeout(t),n.delete(e))},i=()=>{for(let e of n.values())window.clearTimeout(e);n.clear()},a=()=>{i(),e.clearLabelInstances()},o=t=>{r(t);let i=window.setTimeout(()=>{e.updateLabelInstance(t,`fading`);let r=window.setTimeout(()=>{n.delete(t),e.removeLabelInstance(t)},125);n.set(t,r)},Xe);n.set(t,i)};return{createInstance:(t,n,r,i,o)=>{a();let s=Qn({bounds:t,tagName:n,componentName:r,status:i,element:o?.element,mouseX:o?.mouseX,elements:o?.elements,boundsMultiple:o?.boundsMultiple,hideArrow:o?.hideArrow});return e.addLabelInstance(s),s.id},createPerElementInstances:(t,n)=>{a();let r=[];for(let i of t){let t=Qn({bounds:W(i.element),tagName:i.tagName,componentName:i.componentName,status:n,element:i.element,mouseX:i.mouseX});e.addLabelInstance(t),r.push(t.id)}return r},updateAfterCopy:(t,n,r)=>{n?e.updateLabelInstance(t,`copied`):e.updateLabelInstance(t,`error`,r||`Unknown error`),o(t)},cancelAllFades:i,clearAll:a,handleHoverChange:(e,n)=>{if(n){r(e);return}let i=t().find(t=>t.id===e);i&&(i.status===`copied`||i.status===`error`||i.status===`fading`)&&o(e)}}},er=(e,t)=>{let n=[],r=(n,r)=>{let i=an(t(n)),a=Re(i.x,i.y).filter(e),o=a.indexOf(n);return o===-1?null:a[o+r]??null},i=e=>{let t=r(e,1);return t&&(n.push(e),n.length>50&&(n=n.slice(-50))),t},a=e=>{if(n.length>0){let e=n.pop();if(o(e))return e}return r(e,-1)},s=e=>e instanceof SVGElement&&!(e instanceof SVGSVGElement),c=e=>{let t=e.getBoundingClientRect();return t.width>=16||t.height>=16},l=(e,t)=>Math.abs(e.x-t.x)<=2&&Math.abs(e.y-t.y)<=2&&Math.abs(e.width-t.width)<=2&&Math.abs(e.height-t.height)<=2,u=t=>e(t)&&!s(t)&&c(t),d=(e,t)=>{let n=e.getBoundingClientRect(),r=e=>!l(e.getBoundingClientRect(),n),i=e=>{if(e instanceof SVGSVGElement)return null;let n=Array.from(e.children),a=t?n:n.reverse();for(let e of a)if(t){if(u(e)&&r(e))return e;let t=i(e);if(t)return t}else{let t=i(e);if(t)return t;if(u(e)&&r(e))return e}return null},a=e=>t?e.nextElementSibling:e.previousElementSibling,o=null;if(t&&(o=i(e)),!o){let n=e;for(;n;){let e=a(n);for(;e;){if(u(e)&&r(e)){o=e;break}let t=i(e);if(t){o=t;break}e=a(e)}if(o)break;let s=n.parentElement;if(!t&&s&&u(s)){o=s;break}n=s}}return o};return{findNext:(e,t)=>{switch(e){case`ArrowUp`:return i(t);case`ArrowDown`:return a(t);case`ArrowRight`:return d(t,!0);case`ArrowLeft`:return d(t,!1);default:return null}},clearHistory:()=>{n=[]}}},tr=e=>{let{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}=gn(e.activationKey);return{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}},nr=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,`key`),n=!1;if(t?.get&&!t.get.__reactGrabPatched){n=!0;let r=t.get,i=function(){return e.has(this)?``:r.call(this)};i.__reactGrabPatched=!0,Object.defineProperty(KeyboardEvent.prototype,`key`,{get:i,configurable:!0})}return{claimedEvents:e,originalKeyDescriptor:t,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,`key`,t)}}},rr=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),ir=(e,t,n)=>{let r=null,i=()=>{if(!t()){a();return}let o=e(),s=rr(o.x,o.y),c=0,l=0;if(s.top&&(l-=10),s.bottom&&(l+=10),s.left&&(c-=10),s.right&&(c+=10),c!==0||l!==0){let e=window.scrollX,t=window.scrollY;window.scrollBy(c,l);let r=window.scrollX-e,i=window.scrollY-t;(r!==0||i!==0)&&n?.({x:r,y:i})}r=s.top||s.bottom||s.left||s.right?we(i):null},a=()=>{r!==null&&(Oe(r),r=null)};return{start:i,stop:a,isActive:()=>r!==null}},ar=()=>{let e=globalThis;return!!(e.chrome?.runtime?.id||e.browser?.runtime?.id)},or=e=>{try{let t=`0.1.47-dev.26647d1`,n=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 294 294"><path fill="#ff40e0" d="M145 47c25-20 50-27 67-17 16 9 23 30 20 60 0 2-1 5-1 7l-2 13h-1l-12-4c-8-3-17-5-25-6l-17-3c-10-1-20-1-29-1-10 0-20 0-29 1-6 8-11 16-16 24-5 9-9 17-13 26 4 9 8 18 13 26s10 16 16 24l11 14c5 7 11 13 18 19l10 8s-1 0 0 0l-11 9c-17 14-35 22-49 22-6 0-13-2-18-5-16-9-23-30-20-59 1-3 1-5 1-8-30-12-48-29-48-50 0-18 14-35 41-47 2-1 5-2 7-3 0-2 0-5-1-7-3-30 4-51 20-60 18-10 42-3 68 17M71 201c-1 2-1 4-1 5-2 24 3 41 13 47h1c11 7 30 1 51-15-10-9-18-18-26-29-13-1-26-4-38-8m9-38c-3 9-5 17-7 26 8 2 17 4 25 6-3-5-6-10-9-16-3-5-6-10-9-16m-19-53c-2 1-3 1-5 2-21 10-34 23-34 35 0 13 14 27 39 37 3-12 7-25 12-37-5-12-9-24-12-37m37-10c-8 1-17 3-25 6 2 8 4 16 7 25 3-5 6-11 9-16zm-3-61c-4-1-8 0-12 2-10 7-15 24-13 47 0 2 0 3 1 5 12-4 25-6 38-8 8-10 16-20 26-29-15-11-29-17-40-17m111 2c-4-2-8-3-12-2-11 0-25 5-40 17 10 9 19 19 26 29 13 2 26 4 39 8v-5c3-23-2-40-13-47m-61 23c-7 6-13 13-19 19h37c-6-6-12-13-18-19"/><mask id="a"><path fill="#fff" d="m235 85-133 27 28 133 133-27Z"/></mask><path fill="#ff40e0" d="m137 130 76 11c8 1 9 11 3 15l-28 16-4 32c-1 8-10 10-14 4l-41-66c-3-6 1-13 8-12" mask="url(#a)"/></svg>`)}`;console.log(`%cReact Grab${` v${t}`}%c\nhttps://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${n}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,``),e&&navigator.onLine&&!ar()&&fetch(`https://www.react-grab.com/api/version?source=browser&v=${t}&t=${Date.now()}`,{referrerPolicy:`origin`,keepalive:!0,priority:`low`,cache:`no-store`}).then(e=>e.text()).then(e=>{e&&e!==t&&console.warn(`[React Grab] v${t} is outdated (latest: v${e}). Run \`npx grab@latest upgrade\` to upgrade.`)}).catch(()=>null)}catch{}},sr=e=>typeof e==`object`&&!!e,cr=e=>{if(!sr(e))return null;let t={};return typeof e.enabled==`boolean`&&(t.enabled=e.enabled),(e.activationMode===`toggle`||e.activationMode===`hold`)&&(t.activationMode=e.activationMode),typeof e.keyHoldDuration==`number`&&Number.isFinite(e.keyHoldDuration)&&(t.keyHoldDuration=e.keyHoldDuration),typeof e.allowActivationInsideInput==`boolean`&&(t.allowActivationInsideInput=e.allowActivationInsideInput),typeof e.activationKey==`string`&&(t.activationKey=e.activationKey),typeof e.maxContextLines==`number`&&Number.isFinite(e.maxContextLines)&&(t.maxContextLines=e.maxContextLines),typeof e.freezeReactUpdates==`boolean`&&(t.freezeReactUpdates=e.freezeReactUpdates),typeof e.telemetry==`boolean`&&(t.telemetry=e.telemetry),Object.keys(t).length===0?null:t},lr=()=>{if(typeof window>`u`)return null;try{let e=(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)?.getAttribute(`data-options`);return e?cr(JSON.parse(e)):null}catch{return null}},ur=e=>e===`Enter`||e===`NumpadEnter`,dr=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,fr=(e=>({name:e.name,setup:(t,n)=>({actions:[typeof e.contextMenuAction==`function`?e.contextMenuAction(t,n):e.contextMenuAction],cleanup:e.cleanup})}))({name:`copy`,contextMenuAction:{id:`copy`,label:`Copy`,shortcut:`C`,showInToolbarMenu:!0,onAction:e=>{e.copy?.()}}}),pr={name:`comment`,setup:()=>({actions:[{id:`comment`,label:`Comment`,shortcut:`Enter`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterPromptMode?.()}}]})},mr={name:`edit`,setup:()=>({actions:[{id:`edit`,label:`Style`,shortcut:`S`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterEditMode?.()}}]})},Q={name:`open`,actions:[{id:`open`,label:`Open`,shortcut:`O`,enabled:e=>!!e.filePath,onAction:e=>{e.filePath&&(e.hooks.onOpenFile(e.filePath,e.lineNumber)||Ge(e.filePath,e.lineNumber,e.hooks.transformOpenFileUrl),e.hideContextMenu(),e.cleanup())}}]},hr=e=>{let t=e.left+e.width/2,n=e.top+e.height/2,r=n,i=window.innerHeight-n,a=t,o=window.innerWidth-t,s=Math.min(r,i,a,o);return s===r?`top`:s===a?`left`:s===o?`right`:`bottom`},gr=()=>{let[e,t]=S(!1),n=null,r=!1,i=()=>o(n)?n:null,a=()=>{n=null,r=!1,t(!1)};return{selectedElement:i,isPendingDismiss:e,select:(e,i)=>{n=e,t(!1),r=!!i?.shouldPromptBeforeMouseHandoff},clear:a,consumeMouseHandoff:()=>r?(r=!1,i()!==null):!1,showDismissPrompt:()=>i()?e()?!1:(t(!0),!0):(a(),!1),takeSelection:e=>{let t=i()??(o(e)?e:null);return a(),t}}},_r=async(e,t={})=>(await Promise.allSettled(e.map(e=>ot(e,t)))).map(e=>e.status===`fulfilled`?e.value:``),vr=[fr,mr,pr,Q];let yr=!1;const br=new Set,xr=e=>{if(typeof window>`u`)return Ut();let n={enabled:!0,activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,...lr(),...e};if(n.enabled===!1||yr)return Ut();yr=!0,or(n.telemetry!==!1);let{enabled:r,telemetry:i,...a}=n;return w(e=>{let n=!1,r,i=Xn(a),{store:s,actions:l,pointer:u,viewportVersion:f,current:m}=Et({keyHoldDuration:i.store.options.keyHoldDuration??100}),h=x(()=>m().state===`holding`),_=x(()=>m().state===`active`),ne=x(()=>{let e=m();return e.state===`active`&&e.phase===`frozen`}),b=x(()=>{let e=m();return e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)}),re=x(()=>{if(!b())return!1;let e=Math.abs(u().x+window.scrollX-s.dragStart.x),t=Math.abs(u().y+window.scrollY-s.dragStart.y);return e>2||t>2}),ie=x(()=>{let e=m();return e.state===`active`&&e.phase===`dragging-reposition`}),ae=x(()=>{let e=m();return e.state===`active`&&e.phase===`justDragged`}),C=x(()=>m().state===`copying`),oe=x(()=>s.selectionInteractionLockDepth>0),se=x(()=>m().state===`justCopied`),w=x(()=>{let e=m();return e.state===`active`&&!!e.isPromptMode}),ue=x(()=>s.pendingCommentMode||w()),de=x(()=>{let e=m();return e.state===`active`&&!!e.isPromptMode&&!!e.isPendingDismiss});E(D(_,(e,t)=>{if(e&&!t){let e=Ve(u().x,u().y),t=Pe();Ke(e),qe(t),document.body.style.touchAction=`none`}else !e&&t&&(We(),Le(),document.body.style.touchAction=``)}));let fe=le(),[T,ge]=S(fe?!fe.collapsed:!0),[_e,ve]=S(0),[ye,Ce]=S(0),[k,je]=S(fe),[Me,Fe]=S(!1),[Ie,Ze]=S(null),[tt,A]=S(null),j=qn({store:s,actions:l,isActivated:_,activateRenderer:()=>Jn(),deactivateRenderer:()=>Z(),performCopyWithLabel:e=>mn(e),onOpen:()=>{Wi(),N?.(),N=Ui(Hi,A)},onClose:()=>{N?.(),N=null,A(null)}}),ot=x(()=>s.contextMenuPosition!==null||j.isOpen()),st=x(()=>ot()||Ie()!==null),ut,M=null,N=null,P=!1,ft=new WeakMap,F=gr(),I=()=>!T()||w()||oe()||ot()||F.isPendingDismiss(),pt=()=>{ft=new WeakMap},L=()=>{Ct(!1),pt()},mt=e=>{let t=k()??le(),n={edge:t?.edge??`bottom`,ratio:t?.ratio??.5,collapsed:t?.collapsed??!1,enabled:t?.enabled??!0,defaultAction:t?.defaultAction??`copy`,...e};me(n),je(n);for(let e of br)e(n)},ht=()=>{V.timerId!==null&&(clearTimeout(V.timerId),V.timerId=null)},gt=()=>{V.copyWaiting=!1,V.holdTimerFired=!1,V.startTimestamp=null};E(()=>{if(m().state!==`holding`){ht();return}V.startTimestamp=Date.now(),V.timerId=window.setTimeout(()=>{if(V.timerId=null,V.copyWaiting){V.holdTimerFired=!0;return}l.activate()},s.keyHoldDuration),y(ht)}),E(()=>{let e=m();if(e.state!==`active`||e.phase!==`justDragged`)return;let t=setTimeout(()=>{l.finishJustDragged()},Xe);y(()=>clearTimeout(t))}),E(()=>{if(m().state!==`justCopied`)return;let e=setTimeout(()=>{l.finishJustCopied()},Xe);y(()=>clearTimeout(e))}),E(D(h,(e,t=!1)=>{!t||e||!_()||(i.store.options.activationMode!==`hold`&&l.setWasActivatedByToggle(!0),i.hooks.onActivate())}));let _t=(e,t,n)=>{yt(e,t,n),l.clearInputText()},vt=()=>{let e=s.frozenElement||X();e&&l.enterPromptMode({x:u().x,y:u().y},e)},yt=(e,t,n)=>{l.setCopyStart({x:t,y:n},e)},R={lastDetectionTimestamp:0,pendingDetectionScheduledAt:0,latestPointerX:0,latestPointerY:0},z=null,[bt,xt]=S(null),St=(e,t)=>{z!==null&&clearTimeout(z),xt(null),z=window.setTimeout(()=>{xt({x:e,y:t}),z=null},32)},B=null,V={timerId:null,startTimestamp:null,copyWaiting:!1,holdTimerFired:!1},H=null,[U,Ct]=S(!1),wt=0,Tt=!1,K=null,Dt=()=>{Tt=!0,K!==null&&window.clearTimeout(K),K=window.setTimeout(()=>{Tt=!1,K=null},Xe)},At=()=>{K!==null&&(window.clearTimeout(K),K=null),Tt=!1},jt=0,Mt=null,Nt=null,[Pt,Ft]=S(!1),[It,Lt]=S(null),[Rt,zt]=S(null),[Bt,Vt]=kt(Rt),q=x(()=>j.isOpen()?xe:ue()?De:Pt()?It():_()?Ee:null),[Ut,Kt]=S([]),[qt,Jt]=S(0),Yt=er(Ne,W),Xt=ir(u,()=>b(),e=>{if(ie()){if(l.shiftDragStart(e),H){H={x:H.x+e.x,y:H.y+e.y};return}let{pageX:t,pageY:n}=On(u().x,u().y);H={x:t,y:n}}}),J=x(()=>_()&&!C()),Qt=new Map,$t=(e,t)=>{let n=Zn(`grabbed`),r={id:n,bounds:e,createdAt:Date.now(),element:t};l.addGrabbedBox(r),i.hooks.onGrabbedBox(e,t);let a=window.setTimeout(()=>{Qt.delete(n),l.removeGrabbedBox(n)},Xe);Qt.set(n,a)},en=async e=>{let t=await Promise.all(e.map(async e=>{let t=await it(e),n=t?.componentName??null,r=t?.filePath,i=t?.lineNumber??void 0,a=t?.columnNumber??void 0;n||=ct(e);let o=e instanceof HTMLElement?e.innerText?.slice(0,100):void 0;return{tagName:O(e),id:e.id||void 0,className:e.getAttribute(`class`)||void 0,textContent:o,componentName:n??void 0,filePath:r,lineNumber:i,columnNumber:a}}));window.dispatchEvent(new CustomEvent(`react-grab:element-selected`,{detail:{elements:t}}))},Y=$n(l,()=>s.labelInstances),tn=async(e,t,n)=>{At(),m().state!==`copying`&&l.startCopy();let r=!1,i;try{r=await e(),r||(i=`Failed to copy`)}catch(e){i=Gt(e,`Action failed`)}if(t)for(let e of t)Y.updateAfterCopy(e,r,i);m().state===`copying`&&(r&&l.completeCopy(),n?Z():r?(l.activate(),Dt()):l.unfreeze())},un=(e,t,n)=>{let r=e[0],a=n??(r?ct(r):null),o=r?O(r):null,s=a??o??void 0;return Zt({getContent:i.store.options.getContent,componentName:s,maxContextLines:i.store.options.maxContextLines},i.hooks,e,t)},fn=async(e,t,n)=>{if(e.length===0)return!1;let r=[],a=[];for(let t of e){let{wasIntercepted:e,pendingResult:n}=i.hooks.onElementSelect(t);e||r.push(t),n&&a.push(n),i.store.theme.grabbedBoxes.enabled&&$t(W(t),t)}await $e();let o=!0;if(r.length>0&&(o=await un(r,t,n)),a.length>0&&!(await Promise.all(a)).every(Boolean))throw new at;return en(e),o},pn=e=>{rt(e.primaryElement).then(async t=>{await tn(()=>fn(e.targetElements,e.extraPrompt,t??void 0),e.labelInstanceIds.length>0?e.labelInstanceIds:null,e.shouldDeactivateAfter),e.onComplete?.()}).catch(t=>{let n=Gt(t,`Action failed`);for(let t of e.labelInstanceIds)Y.updateAfterCopy(t,!1,n);m().state===`copying`&&l.unfreeze()})},mn=e=>{let{element:t,cursorX:n,selectedElements:r,extraPrompt:i,shouldDeactivateAfter:a,onComplete:o,dragRect:c}=e,u=r??[t],d=c??s.frozenDragRect,f=u.length>1,p=!f&&t===xn()?Dn():void 0,m=d&&f?sn(d):p??W(t),h=f?m.x+m.width/2:n,g=O(t);At(),l.startCopy();let _=g?Y.createInstance(m,g,void 0,`copying`,{element:t,mouseX:h,elements:r}):null;pn({primaryElement:t,targetElements:u,labelInstanceIds:_?[_]:[],extraPrompt:i,shouldDeactivateAfter:a,onComplete:o})},gn=e=>{let{elements:t,labelEntries:n,shouldDeactivateAfter:r,onComplete:i}=e,a=t[0];At(),l.startCopy(),pn({primaryElement:a,targetElements:t,labelInstanceIds:Y.createPerElementInstances(n,`copying`),shouldDeactivateAfter:r,onComplete:i})},X=x(()=>{if(f(),!J()||re()||oe()||F.isPendingDismiss())return null;let e=s.detectedElement;return o(e)?e:null}),yn=x(()=>s.frozenElement||(ne()?null:X()));E(()=>{let e=s.detectedElement;if(!e)return;let t=setInterval(()=>{o(e)||l.setDetectedElement(null)},100);y(()=>clearInterval(t))}),E(D(yn,e=>{if(Mt!==null&&(clearTimeout(Mt),Mt=null),!e){zt(null);return}Mt=window.setTimeout(()=>{Mt=null,zt(e)},100)})),y(()=>{Mt!==null&&(clearTimeout(Mt),Mt=null)}),E(()=>{let e=s.frozenElements;y(Ye(e))}),E(D(_,e=>{e&&i.store.options.freezeReactUpdates&&y(Je())}));let bn=()=>{if(s.isTouchMode&&b()){let e=s.detectedElement;return!e||et(e)?void 0:e}let e=yn();if(!(!e||et(e)))return e},xn=x(()=>bn()),Sn=()=>xn()?s.isTouchMode&&b()?J():J()&&!re():!1,Cn=te(()=>s.frozenElements,e=>x(()=>(f(),W(e)))),wn=x(()=>{let e=s.frozenElements;if(e.length===0)return[];let t=s.frozenDragRect;return t&&e.length>1?[sn(t)]:Cn().map(e=>e())}),Tn=x(()=>{if(!U()||s.pendingCommentMode||Pt())return null;let e=s.detectedElement;return!o(e)||et(e)||s.frozenElements.includes(e)?null:e}),En=x(()=>{f();let e=Tn();if(e)return W(e)}),Dn=x(()=>{f();let e=s.frozenElements;if(e.length>0){let t=wn();if(e.length===1){let e=t[0];if(e)return e}let n=s.frozenDragRect;return n?t[0]??sn(n):ln(vn(t))}let t=xn();if(t)return W(t)}),On=(e,t)=>({pageX:e+window.scrollX,pageY:t+window.scrollY}),kn=(e,t)=>{let{pageX:n,pageY:r}=On(e,t);return{x:Math.abs(n-s.dragStart.x),y:Math.abs(r-s.dragStart.y)}},An=x(()=>{if(!b())return!1;let e=kn(u().x,u().y);return e.x>2||e.y>2}),jn=(e,t)=>{let{pageX:n,pageY:r}=On(e,t),i=Math.min(s.dragStart.x,n),a=Math.min(s.dragStart.y,r),o=Math.abs(n-s.dragStart.x),c=Math.abs(r-s.dragStart.y);return{x:i-window.scrollX,y:a-window.scrollY,width:o,height:c}},Mn=e=>e.code===`Space`||e.key===` `,Nn=()=>{if(!b())return;l.startDragReposition();let{pageX:e,pageY:t}=On(u().x,u().y);H={x:e,y:t}},Pn=()=>{l.stopDragReposition(),H=null},Fn=x(()=>{if(f(),An())return ln(jn(u().x,u().y))}),In=x(()=>{if(f(),!An())return[];let e=bt();if(!e)return[];let t=jn(e.x,e.y),n=nn(t,Ne);return(n.length>0?n:nn(t,Ne,!1)).map(e=>W(e))}),Ln=x(()=>{let e=In();if(e.length>0)return e;let t=En();return t?[...wn(),t]:wn()}),Rn=te(()=>s.frozenElements,e=>{let t=O(e)||`element`,n=ct(e)??void 0;return x(()=>{if(f(),!o(e))return null;let r=W(e),i=ft.get(e);return{tagName:t,componentName:n,bounds:r,mouseX:i===void 0?void 0:r.x+r.width*i}})}),zn=x(()=>{if(w()||s.frozenElements.length<2)return[];let e=[];for(let t of Rn()){let n=t();n!==null&&e.push(n)}return e}),Bn=x(()=>{if(w())return null;let e=Tn();return e?(f(),{tagName:O(e)||`element`,componentName:ct(e)??void 0,bounds:W(e),mouseX:u().x}):null}),Vn=x(()=>{if(C()||w()){f();let e=s.frozenElement||X();return e?{x:G(W(e)).x+s.copyOffsetFromCenterX,y:s.copyStart.y}:{x:s.copyStart.x,y:s.copyStart.y}}return{x:u().x,y:u().y}}),Hn=x(()=>{if(!U()||s.frozenElements.length!==1)return;f();let e=s.frozenElements[0];if(!o(e))return;let t=ft.get(e);if(t===void 0)return;let n=W(e);return n.x+n.width*t});E(D(()=>[X(),s.lastGrabbedElement],([e,t])=>{t&&e&&t!==e&&l.setLastGrabbed(null),e&&i.hooks.onElementHover(e)})),E(D(()=>X(),e=>{let t=++jt,n=()=>{jt===t&&l.setSelectionSource(null,null)};if(!e){n();return}it(e).then(e=>{if(jt===t){if(!e){n();return}l.setSelectionSource(e.filePath,e.lineNumber)}}).catch(()=>{jt===t&&l.setSelectionSource(null,null)})}));let Un=x(()=>s.grabbedBoxes.map(e=>({id:e.id,bounds:e.bounds,createdAt:e.createdAt}))),Wn=x(()=>s.labelInstances.map(e=>({id:e.id,status:e.status,tagName:e.tagName,componentName:e.componentName,createdAt:e.createdAt})));E(D(x(()=>{let e=_(),t=b(),n=C(),r=w(),a=X(),o=Fn(),c=i.store.theme.enabled,l=i.store.theme.selectionBox.enabled,u=i.store.theme.dragBox.enabled,d=An(),f=yn(),p=se();return{isActive:e,isDragging:t,isCopying:n,isPromptMode:r,isSelectionBoxVisible:!!(c&&l&&e&&!n&&!p&&!t&&f!=null),isDragBoxVisible:!!(c&&u&&e&&!n&&d),targetElement:a,dragBounds:o?{x:o.x,y:o.y,width:o.width,height:o.height}:null,grabbedBoxes:[...Un()],labelInstances:[...Wn()],selectionFilePath:s.selectionFilePath,toolbarState:k()}}),e=>{i.hooks.onStateChange(e)})),E(D(()=>{let e=w();return{inputMode:e,position:e?u():g(u),target:e?X():g(X)}},({inputMode:e,position:t,target:n})=>{i.hooks.onPromptModeChange(e,{x:t.x,y:t.y,targetElement:n})})),E(D(()=>[bi(),Dn(),X()],([e,t,n])=>{i.hooks.onSelectionBox(!!e,t??null,n)})),E(D(()=>[Di(),Fn()],([e,t])=>{i.hooks.onDragBox(!!e,t??null)})),E(D(()=>{let e=ki();return[e,Oi(),e?Vn():g(Vn),e?X():g(X),s.selectionFilePath,s.selectionLineNumber]},([e,t,n,r,a,o])=>{i.hooks.onElementLabel(e,t,{x:n.x,y:n.y,content:``,element:r??void 0,tagName:r&&O(r)||void 0,filePath:a??void 0,lineNumber:o??void 0})}));let Gn=null,Kn=e=>{if(e){if(!Gn){Gn=document.createElement(`style`),Gn.setAttribute(`data-react-grab-cursor`,``);let e=Ae();e&&(Gn.nonce=e),Se(Gn),document.head.appendChild(Gn)}Gn.textContent=`* { cursor: ${e} !important; }`}else Gn&&=(Gn.remove(),null)};E(D(()=>[_(),C(),w()],([e,t,n])=>{Kn(t?`progress`:e&&!n?`crosshair`:null)}));let Jn=()=>{let e=h();l.activate(),e||i.hooks.onActivate()},Z=()=>{let e=b(),t=s.previouslyFocusedElement;Pn(),l.deactivate(),j.resetWithDiscard(),Wi(),L(),Rr(),F.clear(),Ft(!1),Lt(null),e&&(document.body.style.userSelect=``),B&&window.clearTimeout(B),Xt.stop(),t instanceof HTMLElement&&t!==document.body&&t!==document.activeElement&&o(t)&&t.focus({preventScroll:!0}),i.hooks.onDeactivate()},Yn=()=>{h()&&l.releaseHold(),_()&&Z(),At()},Qn=()=>{l.setWasActivatedByToggle(!0),Jn()},ar=()=>{let e=[...s.frozenElements],t=s.frozenElement||X(),n=w()?s.inputText.trim():``;if(!t){Z();return}let r=e.length>0?e:[t],i=r.map(e=>W(e))[0],{x:a,y:o}=G(i),c=a+s.copyOffsetFromCenterX;l.setPointer({x:a,y:o}),l.exitPromptMode(),l.clearInputText(),mn({element:t,cursorX:c,selectedElements:r,extraPrompt:n||void 0,shouldDeactivateAfter:!0})},or=()=>{if(w()){if(de()){l.clearInputText(),Z();return}l.setPendingDismiss(!0),Ce(e=>e+1)}},sr=()=>{if(F.isPendingDismiss()){Ur();return}l.clearInputText(),Z()},cr=()=>{l.setPendingDismiss(!1)},lr=()=>{if(j.isOpen()){j.dismiss();return}let e=s.frozenElement||X();e&&fr(e,{x:u().x,y:u().y})},fr=(e,t,n={})=>j.trigger(e,t,n),pr=(e,t)=>{if(!j.isOpen()||s.contextMenuPosition!==null)return!1;let n=Re(e,t).find(Ne);if(!n)return!1;let r=j.switchToElement(n,{x:e,y:t});return r&&He([n]),r},mr=e=>({filePath:s.selectionFilePath??void 0,lineNumber:s.selectionLineNumber??void 0,componentName:Bt(),tagName:O(e)||void 0}),Q=()=>{Nt=null,Ft(!1),l.setPendingCommentMode(!1),Lt(null)},_r=e=>{let t=s.frozenElement||X();if(!t)return!1;let n={x:u().x,y:u().y},r=i.store.actions.find(t=>t.id===e);return r?e===`edit`?fr(t,n,mr(t))?(l.clearInputText(),l.exitPromptMode(),Q(),!0):!0:(l.clearInputText(),l.exitPromptMode(),Q(),r.onAction(Jr(t,n)),!0):(l.clearInputText(),l.exitPromptMode(),Q(),qi(Ee),wr(t,n),!0)},xr=e=>{if(_()){if(q()!==e&&w()&&_r(e))return;if(q()!==e&&s.pendingCommentMode){l.setPendingCommentMode(!1),Nt=e,Lt(e),Ft(!0);return}if(q()!==e&&Pt()){Nt=e,Lt(e);return}Z();return}T()&&(Nt=e,Lt(e),Ft(!0),Qn())},Sr=()=>{xr(k()?.defaultAction??`copy`)},Cr=(e,t,n)=>{Q(),l.clearInputText(),l.enterPromptMode({x:t,y:n},e)},wr=(e,t)=>{L(),Gi(),l.showContextMenu(t,e),Rr(),i.hooks.onContextMenu(e,t)},Tr=(e,t)=>{let n=Nt;if(Nt=null,Lt(null),!n)return;if(n===`edit`){fr(e,t,mr(e));return}let r=i.store.actions.find(e=>e.id===n);if(!r){qi(Ee),wr(e,t);return}r.onAction(Jr(e,t))},Er=()=>{if(T()){if(_()&&ue()){Z();return}l.setPendingCommentMode(!0),_()||Qn()}},Dr=(e,t,n)=>{let r=n&&U()&&!b()&&!s.pendingCommentMode&&!Pt();if(I()||ne()&&!r)return;if(l.setPointer({x:e,y:t}),R.latestPointerX=e,R.latestPointerY=t,r){let n=Be(e,t);n!==s.detectedElement&&l.setDetectedElement(n);return}let i=performance.now(),a=R.pendingDetectionScheduledAt>0&&i-R.pendingDetectionScheduledAt<200;if(i-R.lastDetectionTimestamp>=32&&!a&&(R.lastDetectionTimestamp=i,R.pendingDetectionScheduledAt=i,setTimeout(()=>{if(I()){R.pendingDetectionScheduledAt=0;return}let e=Be(R.latestPointerX,R.latestPointerY);e!==s.detectedElement&&l.setDetectedElement(e),R.pendingDetectionScheduledAt=0})),b()){if(ie()){let{pageX:n,pageY:r}=On(e,t);H&&l.shiftDragStart({x:n-H.x,y:r-H.y}),H={x:n,y:r}}St(e,t);let n=rr(e,t),r=n.top||n.bottom||n.left||n.right;r&&!Xt.isActive()?Xt.start():!r&&Xt.isActive()&&Xt.stop()}},Or=(e,t,n)=>{if(!J()||oe())return!1;!n&&U()&&L();let r=F.selectedElement()!==null;return l.startDrag({x:e,y:t},n||r),l.setPointer({x:e,y:t}),document.body.style.userSelect=`none`,St(e,t),i.hooks.onDragStart(e+window.scrollX,t+window.scrollY),!0},kr=(e,t)=>{let n=s.frozenElements.includes(e),r=s.frozenElements.length===0;if(!n){let n=rn(W(e),t);ft.set(e,n),r&&Vt(ct(e)??void 0)}l.toggleFrozenElement(e),Ue();let i=s.frozenElements.includes(e);if(i||ft.delete(e),s.frozenElements.length===0){L(),l.unfreeze();return}He(s.frozenElements),Ct(!0),l.setPointer(t),l.setLastGrabbed(i?e:s.frozenElements[s.frozenElements.length-1]),l.freeze(),Rr()},Ar=()=>{let e=s.frozenElements.filter(o),t=e.map(e=>{let t=O(e)||`element`,n=ct(e)??void 0,r=ft.get(e),i=W(e);return{element:e,tagName:t,componentName:n,mouseX:r===void 0?i.x+i.width/2:i.x+i.width*r}});if(L(),e.length===0){l.unfreeze();return}if(e.length===1){mn({element:e[0],cursorX:t[0].mouseX,selectedElements:e,shouldDeactivateAfter:s.wasActivatedByToggle});return}gn({elements:e,labelEntries:t,shouldDeactivateAfter:s.wasActivatedByToggle})},jr=(e,t,n)=>{let r=nn(e,Ne),a=r.length>0?r:nn(e,Ne,!1);if(a.length===0)return;let o=n&&!s.pendingCommentMode&&!Pt();if(o&&l.addFrozenElements(a),He(o?s.frozenElements:a),i.hooks.onDragEnd(a,e),o){let e=a[a.length-1];Ct(!0),Ue(),l.setPointer(G(W(e))),l.setLastGrabbed(e),l.freeze(),Rr();return}let c=a[0],u=G(W(c));l.setPointer(u),l.setFrozenElements(a);let d=cn(e);if(l.setFrozenDragRect(d),l.freeze(),l.setLastGrabbed(c),s.pendingCommentMode){Cr(c,u.x,u.y);return}if(Pt()){Ft(!1),Nt?Tr(c,u):wr(c,u);return}let f=s.wasActivatedByToggle&&!t;mn({element:c,cursorX:u.x,selectedElements:a,shouldDeactivateAfter:f,dragRect:d})},Mr=e=>{for(let t of s.frozenElements)if(o(t)&&dr(e,W(t)))return t;return null},Nr=(e,t,n,r)=>{let a=o(s.frozenElement)?s.frozenElement:null,c=F.selectedElement(),d=()=>Re(e,t).find(Ne)??null;if(r&&!s.pendingCommentMode&&!Pt()){let n=d();n!==null&&kr(n,{x:e,y:t});return}let f=d()??(o(s.detectedElement)?s.detectedElement:null),p=c??f??a;if(!p)return;let m,h,g=f===null&&a===p,_=c===p;if(g)m=u().x,h=u().y;else if(_){let e=G(W(p));m=e.x,h=e.y}else m=e,h=t;if(s.pendingCommentMode){Cr(p,m,h),F.clear();return}if(Pt()){Ft(!1);let{wasIntercepted:e}=i.hooks.onElementSelect(p);if(e)return;F.clear(),He([p]),l.setFrozenElement(p);let t={x:m,y:h};l.setPointer(t),l.freeze(),Nt?Tr(p,t):wr(p,t);return}let v=s.wasActivatedByToggle&&!n;l.setLastGrabbed(p),mn({element:p,cursorX:m,shouldDeactivateAfter:v}),F.clear()},Pr=()=>{b()&&(Pn(),l.cancelDrag(),Xt.stop(),document.body.style.userSelect=``)},Fr=(e,t,n,r)=>{if(!b())return;z!==null&&(clearTimeout(z),z=null),xt(null);let i=kn(e,t),a=i.x>2||i.y>2,o=a?jn(e,t):null;a?l.endDrag():l.cancelDrag(),Pn(),Xt.stop(),document.body.style.userSelect=``,o?jr(o,n,r):Nr(e,t,n,r)},$=Wt(),Ir=nr(),Lr=e=>{let t;try{t=Ir.originalKeyDescriptor?.get?Ir.originalKeyDescriptor.get.call(e):e.key}catch{return!1}let n=t===`Enter`||ur(e.code),r=_()||h();return n&&r&&!w()&&!F.isPendingDismiss()&&!s.wasActivatedByToggle?d(e,`data-react-grab-input`)?!1:(Ir.claimedEvents.add(e),e.preventDefault(),e.stopImmediatePropagation(),!0):!1};$.addDocumentListener(`keydown`,Lr,{capture:!0}),$.addDocumentListener(`keyup`,Lr,{capture:!0}),$.addDocumentListener(`keypress`,Lr,{capture:!0});let Rr=()=>{Kt([]),Jt(0),Yt.clearHistory(),F.clear()},zr=(e,t=!1)=>{l.setFrozenElement(e),l.freeze(),F.select(e,{shouldPromptBeforeMouseHandoff:t});let n=G(W(e));l.setPointer(n),s.contextMenuPosition!==null&&l.showContextMenu(n,e)},Br=e=>{let t=an(W(e)),n=Re(t.x,t.y).filter(Ne).reverse();Kt(n),Jt(Math.max(0,n.indexOf(e)))},Vr=e=>{let t=Ut()[e];t&&(Jt(e),Yt.clearHistory(),zr(t,!0))},Hr=()=>{F.showDismissPrompt()&&Ce(e=>e+1)},Ur=()=>{F.clear(),l.unfreeze(),Rr()},Wr=()=>{let e=F.takeSelection(s.frozenElement);if(!e){Ur();return}let t=G(W(e));Rr(),l.setLastGrabbed(e),mn({element:e,cursorX:t.x,shouldDeactivateAfter:s.wasActivatedByToggle})},Gr=e=>{if(!_()||w()||U()||F.isPendingDismiss()||!ke.has(e.key)||st())return!1;let t=yn(),n=!t;if(t||=Be(window.innerWidth/2,window.innerHeight/2),!t)return!1;if(!(e.key===`ArrowUp`||e.key===`ArrowDown`)){Rr();let r=Yt.findNext(e.key,t);return!r&&!n?!1:(e.preventDefault(),e.stopPropagation(),zr(r??t,!0),!0)}Ut().length===0&&Br(t);let r=Yt.findNext(e.key,t)??t;e.preventDefault(),e.stopPropagation(),zr(r,!0);let i=Ut().indexOf(r);return i===-1?Br(r):Jt(i),!0},Kr=e=>e.metaKey||e.ctrlKey||e.altKey||e.repeat||v(e)||!_()||C()||oe()||st()?null:s.frozenElement||X(),qr=e=>{let t=Kr(e);if(!t)return null;let n=he(i.store.actions,e);return n?{element:t,action:n}:null},Jr=(e,t)=>{let n=W(e);return Ri({element:e,filePath:s.selectionFilePath??void 0,lineNumber:s.selectionLineNumber??void 0,tagName:O(e)||void 0,componentName:Bt(),position:t,shouldDeferHideContextMenu:!1,performWithFeedbackOptions:{fallbackBounds:n,fallbackSelectionBounds:[n],position:t}})},Yr=/^[a-zA-Z0-9-]$/,Xr=e=>{if(!e.key||e.key.length!==1||!Yr.test(e.key))return!1;let t=Kr(e);return!t||!j.trigger(t,{x:u().x,y:u().y},{initialSearchQuery:e.key})?!1:(Q(),e.preventDefault(),e.stopImmediatePropagation(),!0)},Zr=e=>{let t=qr(e);if(!t)return!1;let{element:n,action:r}=t;if(w())return _r(r.id)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1;let i={x:u().x,y:u().y};return r.onAction(Jr(n,i)),e.preventDefault(),e.stopImmediatePropagation(),!0},Qr=e=>{if(e.key?.toLowerCase()!==`o`||!_()||!(e.metaKey||e.ctrlKey))return!1;let t=s.selectionFilePath,n=s.selectionLineNumber;return t?(e.preventDefault(),e.stopPropagation(),i.hooks.onOpenFile(t,n??void 0)||Ge(t,n??void 0,i.hooks.transformOpenFileUrl),!0):!1},$r=e=>{if(!_()||C()||s.contextMenuPosition!==null||j.isOpen())return!1;let t=e.key===`F10`&&e.shiftKey,n=e.key===`ContextMenu`;if(!t&&!n)return!1;let r=s.frozenElements,i=r.length>1,a=(i?r[0]:null)||s.frozenElement||X();if(!a)return!1;e.preventDefault(),e.stopPropagation();let o=G(W(a));return i?He(r):(He([a]),l.setFrozenElement(a)),l.setPointer(o),l.freeze(),wr(a,o),!0},ei=x(()=>Ut().map(e=>({tagName:O(e)||`element`,componentName:ct(e)??void 0}))),ti=x(()=>({items:ei(),activeIndex:qt(),isVisible:Ut().length>0})),ni=e=>{if(!(!i.store.options.allowActivationInsideInput&&v(e))&&!(!_n(e,i.store.options)&&((e.metaKey||e.ctrlKey)&&!ze.includes(e.key)&&!ur(e.code)&&(_()&&!s.wasActivatedByToggle?Z():h()&&(ht(),gt(),l.releaseHold())),!ur(e.code)||!h()))){if((_()||h())&&!w()&&(e.preventDefault(),ur(e.code)&&e.stopImmediatePropagation()),_()){if(s.wasActivatedByToggle&&i.store.options.activationMode!==`hold`||e.repeat)return;B!==null&&window.clearTimeout(B),B=window.setTimeout(()=>{Z()},200);return}if(h()&&e.repeat){if(V.copyWaiting){let e=V.holdTimerFired;gt(),e&&l.activate()}return}if(!(C()||se())&&!h()){let n=i.store.options.keyHoldDuration??100;v(e)?be(e)?n+=600:n+=400:t()&&(n+=600),gt(),l.startHold(n)}}},ri=e=>{if(!ur(e.code))return!1;let t=e.composedPath()[0],n=t instanceof HTMLElement?t:null;return!!(n?.closest(`[data-react-grab-discard-copy]`)||n?.closest(`[data-react-grab-discard-yes]`))};$.addWindowListener(`keydown`,e=>{let t=F.isPendingDismiss(),n=t&&(ke.has(e.key)||qr(e)!==null);if(t&&ri(e))return;if(n&&Rr(),n||Lr(e),!T()){_n(e,i.store.options)&&!e.repeat&&ve(e=>e+1);return}let r=ur(e.code)&&h()&&!w(),a=d(e,`data-react-grab-input`);if(w()&&_n(e,i.store.options)&&!e.repeat&&!a){e.preventDefault(),e.stopPropagation(),or();return}if(e.key===`Escape`&&st()){Ie()!==null&&Wi();return}let o=d(e,`data-react-grab-ignore-events`)&&!r;if(w()||o)return w()&&!a&&Zr(e)||(e.key===`Escape`&&(w()?or():s.wasActivatedByToggle&&Z()),o&&ke.has(e.key)&&Gr(e)),void 0;if(b()&&Mn(e)){e.repeat||Nn(),e.preventDefault(),e.stopPropagation();return}if(e.key===`Escape`&&(h()||s.wasActivatedByToggle)){Z();return}_()&&!ze.includes(e.key)&&e.preventDefault();let c=Date.now()-wt<200;Gr(e)||Qr(e)||$r(e)||Zr(e)||Xr(e)||c||ni(e)},{capture:!0}),$.addWindowListener(`keyup`,e=>{if(Lr(e))return;if(Mn(e)&&ie()&&(Pn(),e.preventDefault(),e.stopPropagation()),e.key===`Shift`&&U()){b()&&Pr(),Ar();return}if(d(e,`data-react-grab-ignore-events`))return;let t=tr(i.store.options),n=t.metaKey||t.ctrlKey?p()?!e.metaKey:!e.ctrlKey:t.shiftKey&&!e.shiftKey||t.altKey&&!e.altKey,r=i.store.options.activationKey?typeof i.store.options.activationKey==`function`?i.store.options.activationKey(e):hn(i.store.options.activationKey)(e):dn(e.key,e.code);if(se()||Tt){(r||n)&&(At(),Z());return}if(!h()&&!_()||w())return;let a=!!i.store.options.activationKey,o=i.store.options.activationMode===`hold`,c=b();if(_()){let e=ot();if(n){if(s.wasActivatedByToggle&&i.store.options.activationMode!==`hold`||e)return;Z()}else if(o&&r){if(B!==null&&(window.clearTimeout(B),B=null),e||c)return;Z()}else !a&&r&&B!==null&&(window.clearTimeout(B),B=null);return}if(r||n){if(s.wasActivatedByToggle&&i.store.options.activationMode!==`hold`)return;if(h()||V.holdTimerFired&&n){ht();let t=(V.startTimestamp?Date.now()-V.startTimestamp:0)>=200,n=V.holdTimerFired&&t&&(i.store.options.allowActivationInsideInput||!v(e));gt(),n?l.activate():l.releaseHold()}else Z()}},{capture:!0}),$.addDocumentListener(`copy`,()=>{h()&&(V.copyWaiting=!0)}),$.addWindowListener(`keypress`,Lr,{capture:!0}),$.addWindowListener(`pointermove`,e=>{if(!e.isPrimary)return;let t=e.pointerType===`touch`;if(l.setTouchMode(t),!d(e,`data-react-grab-ignore-events`)&&!I()&&!(t&&!h()&&!_())){if((t?h():_())&&!w()&&ne()&&!e.shiftKey&&!U()){if(F.consumeMouseHandoff()){Hr();return}l.unfreeze(),Rr()}Dr(e.clientX,e.clientY,e.shiftKey)}},{passive:!0}),$.addWindowListener(`pointerdown`,e=>{if(e.button===0&&e.isPrimary&&(l.setTouchMode(e.pointerType===`touch`),P=!1,!d(e,`data-react-grab-ignore-events`))){if(ot()){pr(e.clientX,e.clientY)&&(P=!0,e.preventDefault(),e.stopImmediatePropagation());return}if(w()){let t=Dn();t&&e.clientX>=t.x&&e.clientX<=t.x+t.width&&e.clientY>=t.y&&e.clientY<=t.y+t.height?ar():or();return}if(F.isPendingDismiss()){e.preventDefault(),e.stopImmediatePropagation();return}if(oe()){e.preventDefault(),e.stopImmediatePropagation();return}Or(e.clientX,e.clientY,e.shiftKey)&&(e.pointerId!==void 0&&document.documentElement.setPointerCapture(e.pointerId),e.preventDefault(),e.stopImmediatePropagation())}},{capture:!0}),$.addWindowListener(`pointerup`,e=>{if(e.button!==0||!e.isPrimary||d(e,`data-react-grab-ignore-events`)||ot())return;let t=J()||oe()||b(),n=e.metaKey||e.ctrlKey;Fr(e.clientX,e.clientY,n,e.shiftKey),t&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0}),$.addWindowListener(`contextmenu`,e=>{if(!J()||C()||w()||j.isOpen())return;if(F.isPendingDismiss()){e.preventDefault(),e.stopPropagation();return}let t=d(e,`data-react-grab-ignore-events`),n={x:e.clientX,y:e.clientY},r=t&&s.frozenElements.length>1?Mr(n):null;if(t&&Ut().length>0)Rr();else if(t&&!r)return;if(ot()){e.preventDefault();return}e.preventDefault(),e.stopPropagation();let i=r??Be(e.clientX,e.clientY);if(!i)return;let a=s.frozenElements;a.length>1&&a.includes(i)?He(a):(He([i]),l.setFrozenElement(i)),l.setPointer(n),l.freeze(),wr(i,n)},{capture:!0}),$.addWindowListener(`pointercancel`,e=>{e.isPrimary&&Pr()}),$.addWindowListener(`click`,e=>{if(!d(e,`data-react-grab-ignore-events`)){if(P){P=!1,e.preventDefault(),e.stopImmediatePropagation();return}ot()||(J()||ae())&&(e.preventDefault(),e.stopImmediatePropagation(),s.wasActivatedByToggle&&!w()&&!e.shiftKey&&(h()?l.setWasActivatedByToggle(!1):Z()))}},{capture:!0}),$.addDocumentListener(`visibilitychange`,()=>{if(document.hidden){l.clearGrabbedBoxes();let e=s.activationTimestamp;_()&&!w()&&e!==null&&Date.now()-e>500&&Z()}}),$.addWindowListener(`blur`,()=>{Pr(),h()&&(ht(),l.releaseHold(),gt()),L()}),$.addWindowListener(`focus`,()=>{wt=Date.now()}),$.addWindowListener(`focusin`,e=>{d(e,`data-react-grab`)&&e.stopPropagation()},{capture:!0});let ii=()=>{if(!(s.isTouchMode&&!h()&&!_())&&!I()&&!ne()&&!b()&&s.frozenElements.length===0){let e=Be(u().x,u().y);l.setDetectedElement(e)}},ai=null,oi=null,si=()=>{on(),ii(),l.incrementViewportVersion(),l.updateContextMenuPosition()};$.addWindowListener(`scroll`,si,{capture:!0});let ci=window.innerWidth,li=window.innerHeight;$.addWindowListener(`resize`,()=>{let e=window.innerWidth,t=window.innerHeight;if(ci>0&&li>0){let n=e/ci,r=t/li,i=Math.abs(n-r)<nt,a=Math.abs(n-1)>nt;i&&a&&l.setPointer({x:u().x*n,y:u().y*r})}ci=e,li=t,si()});let ui=window.visualViewport;if(ui){let{signal:e}=$;ui.addEventListener(`resize`,si,{signal:e}),ui.addEventListener(`scroll`,si,{signal:e})}let di=()=>{oi===null&&(oi=we(()=>{oi=null,l.incrementViewportVersion()}))};E(()=>{if(i.store.theme.enabled&&(_()||C()||s.labelInstances.length>0||s.grabbedBoxes.length>0)){if(ai!==null)return;ai=window.setInterval(()=>{di()},100);return}ai!==null&&(window.clearInterval(ai),ai=null),oi!==null&&(Oe(oi),oi=null)}),y(()=>{ai!==null&&window.clearInterval(ai),oi!==null&&Oe(oi)}),$.addDocumentListener(`copy`,e=>{w()||d(e,`data-react-grab-ignore-events`)||J()&&e.preventDefault()},{capture:!0}),y(()=>{$.abort(),z!==null&&window.clearTimeout(z),B&&window.clearTimeout(B),At(),M?.(),M=null,N?.(),N=null,Qt.forEach(e=>window.clearTimeout(e)),Qt.clear(),Y.cancelAllFades(),Xt.stop(),document.body.style.userSelect=``,document.body.style.touchAction=``,Kn(null),Ir.restore()});let{root:fi,host:pi}=Ot(dt);y(Ht(pi).cleanup);let mi=x(()=>i.store.theme.enabled),hi=x(()=>i.store.theme.selectionBox.enabled),gi=x(()=>i.store.theme.elementLabel.enabled),_i=x(()=>i.store.theme.dragBox.enabled),vi=x(()=>se()||Me()&&!ne()||j.isInteracting()),yi=x(()=>In().length>0),bi=x(()=>!mi()||!hi()||vi()?!1:yi()?!0:Sn()),xi=x(()=>{let e=xn();if(e)return O(e)||void 0}),Si=x(()=>!mi()||ot()||!gi()||vi()?!1:Sn()),Ci=new Map,wi=e=>{let t=e.elements?.filter(o)??[],n=e.element,r=null;t.length>0?r=t.map(W):n&&o(n)&&(r=[W(n)]);let i=e.bounds,a=e.boundsMultiple;r&&(i=r.length>1?ln(vn(r)):r[0],e.boundsMultiple!==void 0&&(a=e.boundsMultiple.length>1&&e.boundsMultiple.length===e.elements?.length?r:[i]));let s=Ci.get(e.id),c=s?.boundsMultiple,l=c===a||c!==void 0&&a!==void 0&&c.length===a.length&&c.every((e,t)=>e.x===a[t].x&&e.y===a[t].y&&e.width===a[t].width&&e.height===a[t].height);if(s&&s.status===e.status&&s.errorMessage===e.errorMessage&&s.bounds.x===i.x&&s.bounds.y===i.y&&s.bounds.width===i.width&&s.bounds.height===i.height&&l)return s;let u=i.x+i.width/2,d=i.width/2,f;f=e.mouseXOffsetRatio!==void 0&&d>0?u+e.mouseXOffsetRatio*d:e.mouseXOffsetFromCenter===void 0?e.mouseX??u:u+e.mouseXOffsetFromCenter;let p={...e,bounds:i,boundsMultiple:a,mouseX:f};return Ci.set(e.id,p),p},Ti=x(()=>{if(!mi()||!i.store.theme.grabbedBoxes.enabled)return[];f();let e=new Set(s.labelInstances.map(e=>e.id));for(let t of Ci.keys())e.has(t)||Ci.delete(t);return s.labelInstances.map(wi)}),Ei=x(()=>!mi()||!i.store.theme.grabbedBoxes.enabled?[]:(f(),s.grabbedBoxes.map(e=>!e.element||!document.body.contains(e.element)?e:{...e,bounds:W(e.element)}))),Di=x(()=>mi()&&_i()&&J()&&An()),Oi=x(()=>C()?`processing`:`hover`),ki=x(()=>{if(!mi())return!1;let e=gi(),t=w(),n=C(),r=J(),i=b(),a=!!yn(),o=Me(),s=ne();return!e||t||o&&!s?!1:n?!0:r&&!i&&a}),Ai=x(()=>{f();let e=s.contextMenuElement;return e?W(e):null}),ji=x(()=>(f(),s.contextMenuPosition)),Mi=x(()=>{let e=s.contextMenuElement;if(!e)return;let t=s.frozenElements.length;return t>1?`${t} elements`:O(e)||void 0}),[Ni]=kt(()=>s.frozenElements.length>1?null:s.contextMenuElement),[Pi]=pe(()=>s.contextMenuElement,async e=>e?it(e):null),Fi=async e=>{l.incrementSelectionInteractionLockDepth();try{return await e()}finally{l.decrementSelectionInteractionLockDepth()}},Ii=(e,t,n,r,i)=>async a=>{await Fi(async()=>{let o=i?.fallbackBounds??null,c=i?.fallbackSelectionBounds??[],d=i?.position??s.contextMenuPosition??u(),f=wn(),p=Ai()??o,m=t.length>1,h=m?ln(vn(f)):p,g=s.wasActivatedByToggle,_;if(_=m?f:p?[p]:c,l.hideContextMenu(),h){let i=m?h.x+h.width/2:d.x,o=Y.createInstance(h,n||`element`,r,`copying`,{element:e,mouseX:i,elements:m?t:void 0,boundsMultiple:_}),s=!1,c;try{s=await a(),s||(c=`Failed to copy`)}catch(e){c=Gt(e,`Action failed`)}Y.updateAfterCopy(o,s,c)}else try{await a()}catch{}g?Z():l.unfreeze()})},Li=()=>{setTimeout(()=>{l.hideContextMenu()},0)},Ri=e=>{let{element:t,filePath:n,lineNumber:r,tagName:a,componentName:o,position:c,performWithFeedbackOptions:u,shouldDeferHideContextMenu:d,onBeforeCopy:f,onBeforePrompt:p,customEnterPromptMode:m}=e,h=s.frozenElements.length>0?s.frozenElements:[t],g=d?Li:l.hideContextMenu,v={element:t,elements:h,filePath:n,lineNumber:r,componentName:o,tagName:a,enterPromptMode:m??(()=>{Y.clearAll(),Q(),p?.(),_t(t,c.x,c.y),l.setPointer({x:c.x,y:c.y}),l.setFrozenElement(t),vt(),_()||Jn(),g()}),enterEditMode:()=>{fr(t,c,{filePath:n,lineNumber:r,componentName:o,tagName:a})&&Q(),g()},copy:()=>{Q(),f?.(),mn({element:t,cursorX:c.x,selectedElements:h.length>1?h:void 0,shouldDeactivateAfter:s.wasActivatedByToggle}),g()},hooks:{transformHtmlContent:i.hooks.transformHtmlContent,onOpenFile:i.hooks.onOpenFile,transformOpenFileUrl:i.hooks.transformOpenFileUrl},performWithFeedback:Ii(t,h,a,o,u),hideContextMenu:g,cleanup:()=>{s.wasActivatedByToggle?Z():l.unfreeze()}},ee=i.hooks.transformActionContext(v);return{...v,...ee}},zi=x(()=>{let e=s.contextMenuElement;if(!e)return;let t=Pi(),n=s.contextMenuPosition??u();return Ri({element:e,filePath:t?.filePath,lineNumber:t?.lineNumber??void 0,tagName:Mi(),componentName:Ni(),position:n,shouldDeferHideContextMenu:!0,onBeforeCopy:()=>{F.clear()},customEnterPromptMode:()=>{Y.clearAll(),Q(),l.clearInputText(),l.enterPromptMode(n,e),Li()}})}),Bi=()=>{setTimeout(()=>{l.hideContextMenu(),Z()},0)},Vi=()=>{if(!ut)return null;let e=ut.getBoundingClientRect(),t=hr(e);return t===`left`||t===`right`?{x:t===`left`?e.right:e.left,y:e.top+e.height/2,edge:t}:{x:e.left+e.width/2,y:t===`top`?e.bottom:e.top,edge:t}},Hi=()=>{let e=Vi();if(e)return e;let t=j.state();return t?{x:t.position.x,y:t.position.y,edge:`bottom`}:null},Ui=(e,t)=>{let n=null,r=()=>{let i=e();i&&t(i),n=we(r)};return r(),()=>{n!==null&&(Oe(n),n=null)}},Wi=()=>{M?.(),M=null,Ze(null)},Gi=()=>{l.hideContextMenu(),Wi(),j.dismiss()},Ki=()=>{Ie()===null?(l.hideContextMenu(),j.isOpen()&&j.closePreservingRenderer(),M?.(),M=Ui(Vi,Ze)):Wi()},qi=e=>{mt({defaultAction:e})},Ji=e=>{let t=s.labelInstances.find(t=>t.id===e);if(!t?.element||!o(t.element))return;let n=t.element,r=G(W(n)),i={x:t.mouseX??r.x,y:r.y},a=t.elements&&t.elements.length>0?t.elements.filter(e=>o(e)):[n];setTimeout(()=>{Wi(),j.isOpen()&&j.closePreservingRenderer(),_()||(l.setWasActivatedByToggle(!0),Jn()),l.setPointer(i),l.setFrozenElements(a),a.length>1&&t.bounds&&l.setFrozenDragRect(cn(t.bounds)),l.freeze(),l.showContextMenu(i,n)},0)};E(()=>{let e=i.store.theme.hue;e===0?fi.style.filter=``:fi.style.filter=`hue-rotate(${e}deg)`}),i.store.theme.enabled&&import(`./renderer-i3kQaP-2.js`).then(({ReactGrabRenderer:e})=>{n||(r=ee(()=>ce(e,{get selectionVisible(){return bi()},get selectionBounds(){return Dn()},get selectionBoundsMultiple(){return Ln()},get selectionShouldSnap(){return s.frozenElements.length>0||In().length>0},get selectionElementsCount(){return s.frozenElements.length},get frozenLabelEntries(){return zn()},get pendingShiftPreviewEntry(){return Bn()??void 0},get selectionFilePath(){return s.selectionFilePath??void 0},get selectionLineNumber(){return s.selectionLineNumber??void 0},get selectionTagName(){return xi()},get selectionComponentName(){return Bt()},get selectionLabelVisible(){return Si()},selectionLabelStatus:`idle`,get selectionArrowNavigationState(){return ti()},onArrowNavigationSelect:Vr,get labelInstances(){return Ti()},get dragVisible(){return Di()},get dragBounds(){return Fn()},get grabbedBoxes(){return Ei()},get mouseX(){return c(()=>s.frozenElements.length>1)()?void 0:Hn()??Vn().x},get isFrozen(){return ne()||_()||Me()},get inputValue(){return s.inputText},get isPromptMode(){return w()},onShowContextMenuInstance:Ji,get onLabelInstanceHoverChange(){return Y.handleHoverChange},get onInputChange(){return l.setInputText},onInputSubmit:()=>void ar(),onToggleExpand:lr,get selectionLabelShakeCount(){return ye()},onConfirmDismiss:sr,get discardPrompt(){return c(()=>!!F.isPendingDismiss())()?{isKeyboardSelection:!0,onConfirm:sr,onCopy:Wr}:de()?{onConfirm:sr,onCancel:cr}:void 0},get toolbarVisible(){return i.store.theme.toolbar.enabled},get isActive(){return _()},onToggleActive:Sr,onActivateAction:xr,get activeActionId(){return q()},get enabled(){return T()},get shakeCount(){return _e()},onToolbarStateChange:e=>{je(e),e.enabled!==T()&&(ge(e.enabled),e.enabled||(Yn(),Gi())),br.forEach(t=>t(e))},onSubscribeToToolbarStateChanges:e=>(br.add(e),()=>{br.delete(e)}),onToolbarSelectHoverChange:Fe,onToolbarRef:e=>{ut=e},get contextMenuPosition(){return ji()},get contextMenuBounds(){return Ai()},get contextMenuTagName(){return Mi()},get contextMenuComponentName(){return Ni()},get contextMenuHasFilePath(){return!!Pi()?.filePath},get actions(){return i.store.actions},get actionContext(){return zi()},onContextMenuDismiss:Bi,onContextMenuHide:Li,get toolbarMenuPosition(){return Ie()},get toolbarMenuActions(){return i.store.actions.filter(e=>e.showInToolbarMenu===!0)},get defaultActionId(){return k()?.defaultAction??`copy`},onSetDefaultAction:qi,onToggleToolbarMenu:Ki,onToolbarMenuDismiss:Wi,get editPanelState(){return j.state()},get editPanelPosition(){return tt()},get onEditPanelDismiss(){return j.dismiss},get onEditPanelSubmit(){return j.submit},get onEditPanelPendingEditsChange(){return j.setPendingEdits},get onEditPanelInteractingChange(){return j.setInteracting}}),fi))}).catch(e=>{console.warn(`[react-grab] Failed to load renderer:`,e)});let Yi={activate:()=>{l.setPendingCommentMode(!1),!_()&&T()&&Qn()},deactivate:()=>{(_()||C())&&Z()},toggle:()=>{_()?Z():T()&&Qn()},comment:Er,isActive:()=>_(),isEnabled:()=>T(),setEnabled:e=>{e!==T()&&(ge(e),mt({enabled:e,collapsed:!e}),e||(Yn(),Gi()))},getToolbarState:()=>le(),setToolbarState:e=>{let t=le(),n=e.collapsed??t?.collapsed??!1,r={edge:e.edge??t?.edge??`bottom`,ratio:e.ratio??t?.ratio??.5,collapsed:n,enabled:e.enabled??!n,defaultAction:e.defaultAction??t?.defaultAction??`copy`};me(r),je(r),r.enabled!==T()&&(ge(r.enabled),r.enabled||(Yn(),Gi())),br.forEach(e=>e(r))},onToolbarStateChange:e=>(br.add(e),()=>{br.delete(e)}),dispose:()=>{n=!0,yr=!1,r?.(),M?.(),M=null,N?.(),N=null,br.clear(),e()},copyElement:async e=>{let t=Array.isArray(e)?e:[e];return t.length===0?!1:await un(t)},getSource:async e=>{let t=await it(e);return t?{filePath:t.filePath,lineNumber:t.lineNumber,componentName:t.componentName}:null},getStackContext:e=>lt(e,{maxLines:i.store.options.maxContextLines}),getState:()=>({isActive:_(),isDragging:b(),isCopying:C(),isPromptMode:w(),isSelectionBoxVisible:!!bi(),isDragBoxVisible:!!Di(),targetElement:X(),dragBounds:Fn()??null,grabbedBoxes:[...Un()],labelInstances:[...Wn()],selectionFilePath:s.selectionFilePath,toolbarState:k()}),setOptions:e=>{i.setOptions(e)},registerPlugin:e=>{i.register(e,Yi)},unregisterPlugin:e=>{i.unregister(e)},getPlugins:()=>i.getPluginNames(),getDisplayName:ct};for(let e of vr)i.register(e,Yi);return setTimeout(()=>{Te(!0)},Qe),Yi})};export{Jn as a,pr as i,_r as n,Q as r,xr as t};
|
|
15
|
+
`)},Un=e=>`style`in e&&e.style instanceof CSSStyleDeclaration,Wn=e=>{let t=new Map,n=Un(e)?e:null;return{apply:(e,r)=>{if(n)for(let i of e)t.has(i)||t.set(i,{value:n.style.getPropertyValue(i),priority:n.style.getPropertyPriority(i)}),n.style.setProperty(i,r)},restore:()=>{if(!n){t.clear();return}for(let[e,{value:r,priority:i}]of t)r?n.style.setProperty(e,r,i):n.style.removeProperty(e);t.clear()},hasAppliedStyles:()=>t.size>0}},Gn=(e,t)=>{for(let n of t){let t=e.edits.findIndex(e=>e.key===n.key);t>=0?e.edits[t]=n:e.edits.push(n)}},Kn=(e,t)=>({element:e.element,preview:e.preview,filePath:e.filePath??``,lineNumber:e.lineNumber??0,edits:t}),qn=e=>{let[t,n]=S(null),[r,i]=S(!1),a=[],o=[],s=e=>{o=e},c=()=>{let r=t()!==null;n(null),i(!1),a=[],o=[],r&&e.onClose?.()},l=()=>{t()?.preview.restore();for(let e=a.length-1;e>=0;e--)a[e].preview.restore();c()},u=e=>{rt(e).then(t=>{t&&n(n=>!n||n.element!==e||n.componentName?n:{...n,componentName:t})})},d=(r,i,a={})=>{if(t()!==null)return!1;let o=Ln(r);if(o.length===0)return!1;let s=a.filePath??e.store.selectionFilePath??void 0,c=a.lineNumber??e.store.selectionLineNumber??void 0;return n({element:r,position:i,selectionBounds:W(r),properties:o,preview:Wn(r),filePath:s,lineNumber:c,componentName:a.componentName,tagName:a.tagName??O(r),initialSearchQuery:a.initialSearchQuery}),u(r),e.isActivated()||e.activateRenderer(),e.actions.setPointer(i),e.actions.setFrozenElement(r),e.actions.freeze(),e.onOpen?.(),!0},f=(r,i)=>{let s=t();if(!s||s.element===r)return!1;let c=Ln(r);return c.length===0?!1:((o.length>0||s.preview.hasAppliedStyles())&&a.push(Kn(s,o)),o=[],n({element:r,position:i,selectionBounds:W(r),properties:c,preview:Wn(r),tagName:O(r),hasSessionEdits:a.some(e=>e.edits.length>0)}),it(r).then(e=>{if(e){for(let t of a)t.element===r&&!t.filePath&&(t.filePath=e.filePath,t.lineNumber=e.lineNumber??0);n(t=>!t||t.element!==r||t.filePath?t:{...t,filePath:e.filePath,lineNumber:e.lineNumber??void 0})}}).catch(()=>void 0),u(r),e.actions.setPointer(i),e.actions.setFrozenElement(r),!0)},p=(e,t)=>[...a,Kn(e,t)],m=e=>{let t=new Map;for(let n of e){if(n.edits.length===0)continue;let e=t.get(n.element);if(e){!e.filePath&&n.filePath&&(e.filePath=n.filePath,e.lineNumber=n.lineNumber),Gn(e,n.edits);continue}t.set(n.element,{filePath:n.filePath,lineNumber:n.lineNumber,edits:[...n.edits]})}return Array.from(t.values())},h=e=>{let t=new Set;for(let n of e)n.edits.length>0&&t.add(n.element);for(let n=e.length-1;n>=0;n--){let r=e[n];r.edits.length===0&&!t.has(r.element)&&r.preview.restore()}};return{state:t,trigger:d,switchToElement:f,setPendingEdits:s,dismiss:()=>{t()!==null&&(l(),e.store.wasActivatedByToggle?e.deactivateRenderer():e.actions.unfreeze())},closePreservingRenderer:()=>{t()!==null&&(l(),e.actions.unfreeze())},submit:n=>{let r=t();if(!r)return;let i=r.element,a=p(r,n),o=Hn(m(a));h(a),c(),e.store.wasActivatedByToggle||e.actions.unfreeze(),e.performCopyWithLabel({element:i,cursorX:r.position.x,extraPrompt:o||void 0,shouldDeactivateAfter:e.store.wasActivatedByToggle})},resetWithDiscard:l,isOpen:()=>t()!==null,isInteracting:r,setInteracting:i}},Jn={enabled:!0,hue:0,selectionBox:{enabled:!0},dragBox:{enabled:!0},grabbedBoxes:{enabled:!0},elementLabel:{enabled:!0},toolbar:{enabled:!0}},Z=(e,t)=>({enabled:t.enabled??e.enabled,hue:t.hue??e.hue,selectionBox:{enabled:t.selectionBox?.enabled??e.selectionBox.enabled},dragBox:{enabled:t.dragBox?.enabled??e.dragBox.enabled},grabbedBoxes:{enabled:t.grabbedBoxes?.enabled??e.grabbedBoxes.enabled},elementLabel:{enabled:t.elementLabel?.enabled??e.elementLabel.enabled},toolbar:{enabled:t.toolbar?.enabled??e.toolbar.enabled}}),Yn={activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,activationKey:void 0,getContent:void 0,maxContextLines:3,freezeReactUpdates:!0},Xn=(e={})=>{let t=new Map,n={},[r,i]=xt({theme:Jn,options:{...Yn,...e},actions:[]}),a=()=>{let r=Jn,a={...Yn,...e},o=[];for(let{config:e}of t.values())if(e.theme&&(r=Z(r,e.theme)),e.options&&(a={...a,...e.options}),e.actions)for(let t of e.actions)o.push(t);a={...a,...n},i(`theme`,r),i(`options`,a),i(`actions`,o)},o=(e,t)=>{n[e]=t,i(`options`,e,t)},s=[`activationMode`,`keyHoldDuration`,`allowActivationInsideInput`,`activationKey`,`getContent`,`maxContextLines`,`freezeReactUpdates`],c=e=>{for(let t of s)e[t]!==void 0&&o(t,e[t])},l=(e,n)=>{t.has(e.name)&&u(e.name);let r=e.setup?.(n,_)??{};e.theme&&(r.theme=r.theme?Z(Z(Jn,e.theme),r.theme):e.theme),e.actions&&(r.actions=[...e.actions,...r.actions??[]]),e.hooks&&(r.hooks=r.hooks?{...e.hooks,...r.hooks}:e.hooks),e.options&&(r.options=r.options?{...e.options,...r.options}:e.options),t.set(e.name,{plugin:e,config:r}),a()},u=e=>{let n=t.get(e);n&&(n.config.cleanup&&n.config.cleanup(),t.delete(e),a())},d=()=>Array.from(t.keys()),f=(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&t(...n)}},p=(e,...n)=>{let r=!1;for(let{config:i}of t.values()){let t=i.hooks?.[e];t&&t(...n)===!0&&(r=!0)}return r},m=async(e,...n)=>{for(let{config:r}of t.values()){let t=r.hooks?.[e];t&&await t(...n)}},h=async(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=await t(i,...r))}return i},g=(e,n,...r)=>{let i=n;for(let{config:n}of t.values()){let t=n.hooks?.[e];t&&(i=t(i,...r))}return i},_={onActivate:()=>f(`onActivate`),onDeactivate:()=>f(`onDeactivate`),onElementHover:e=>f(`onElementHover`,e),onElementSelect:e=>{let n=!1,r;for(let{config:i}of t.values()){let t=i.hooks?.onElementSelect;if(t){let i=t(e);i===!0?n=!0:i instanceof Promise&&(n=!0,r=i)}}return{wasIntercepted:n,pendingResult:r}},onDragStart:(e,t)=>f(`onDragStart`,e,t),onDragEnd:(e,t)=>f(`onDragEnd`,e,t),onBeforeCopy:async e=>m(`onBeforeCopy`,e),transformCopyContent:async(e,t)=>h(`transformCopyContent`,e,t),onAfterCopy:(e,t)=>f(`onAfterCopy`,e,t),onCopySuccess:(e,t)=>f(`onCopySuccess`,e,t),onCopyError:e=>f(`onCopyError`,e),onStateChange:e=>f(`onStateChange`,e),onPromptModeChange:(e,t)=>f(`onPromptModeChange`,e,t),onSelectionBox:(e,t,n)=>f(`onSelectionBox`,e,t,n),onDragBox:(e,t)=>f(`onDragBox`,e,t),onGrabbedBox:(e,t)=>f(`onGrabbedBox`,e,t),onElementLabel:(e,t,n)=>f(`onElementLabel`,e,t,n),onContextMenu:(e,t)=>f(`onContextMenu`,e,t),onOpenFile:(e,t)=>p(`onOpenFile`,e,t),transformHtmlContent:async(e,t)=>h(`transformHtmlContent`,e,t),transformAgentContext:async(e,t)=>h(`transformAgentContext`,e,t),transformActionContext:e=>g(`transformActionContext`,e),transformOpenFileUrl:(e,t,n)=>g(`transformOpenFileUrl`,e,t,n)};return{register:l,unregister:u,getPluginNames:d,setOptions:c,store:r,hooks:_}},Zn=e=>`${e}-${Date.now()}-${Math.random().toString(36).slice(2,9)}`,Qn=e=>{let t=e.bounds.x+e.bounds.width/2,n=e.bounds.width/2,r=e.mouseX===void 0?void 0:e.mouseX-t;return{id:Zn(`label`),bounds:e.bounds,boundsMultiple:e.boundsMultiple,tagName:e.tagName,componentName:e.componentName,status:e.status,createdAt:Date.now(),element:e.element,elements:e.elements,mouseX:e.mouseX,mouseXOffsetFromCenter:r,mouseXOffsetRatio:r!==void 0&&n>0?r/n:void 0,hideArrow:e.hideArrow}},$n=(e,t)=>{let n=new Map,r=e=>{let t=n.get(e);t!==void 0&&(window.clearTimeout(t),n.delete(e))},i=()=>{for(let e of n.values())window.clearTimeout(e);n.clear()},a=()=>{i(),e.clearLabelInstances()},o=t=>{r(t);let i=window.setTimeout(()=>{e.updateLabelInstance(t,`fading`);let r=window.setTimeout(()=>{n.delete(t),e.removeLabelInstance(t)},125);n.set(t,r)},Xe);n.set(t,i)};return{createInstance:(t,n,r,i,o)=>{a();let s=Qn({bounds:t,tagName:n,componentName:r,status:i,element:o?.element,mouseX:o?.mouseX,elements:o?.elements,boundsMultiple:o?.boundsMultiple,hideArrow:o?.hideArrow});return e.addLabelInstance(s),s.id},createPerElementInstances:(t,n)=>{a();let r=[];for(let i of t){let t=Qn({bounds:W(i.element),tagName:i.tagName,componentName:i.componentName,status:n,element:i.element,mouseX:i.mouseX});e.addLabelInstance(t),r.push(t.id)}return r},updateAfterCopy:(t,n,r)=>{n?e.updateLabelInstance(t,`copied`):e.updateLabelInstance(t,`error`,r||`Unknown error`),o(t)},cancelAllFades:i,clearAll:a,handleHoverChange:(e,n)=>{if(n){r(e);return}let i=t().find(t=>t.id===e);i&&(i.status===`copied`||i.status===`error`||i.status===`fading`)&&o(e)}}},er=(e,t)=>{let n=[],r=(n,r)=>{let i=an(t(n)),a=Re(i.x,i.y).filter(e),o=a.indexOf(n);return o===-1?null:a[o+r]??null},i=e=>{let t=r(e,1);return t&&(n.push(e),n.length>50&&(n=n.slice(-50))),t},a=e=>{if(n.length>0){let e=n.pop();if(o(e))return e}return r(e,-1)},s=e=>e instanceof SVGElement&&!(e instanceof SVGSVGElement),c=e=>{let t=e.getBoundingClientRect();return t.width>=16||t.height>=16},l=(e,t)=>Math.abs(e.x-t.x)<=2&&Math.abs(e.y-t.y)<=2&&Math.abs(e.width-t.width)<=2&&Math.abs(e.height-t.height)<=2,u=t=>e(t)&&!s(t)&&c(t),d=(e,t)=>{let n=e.getBoundingClientRect(),r=e=>!l(e.getBoundingClientRect(),n),i=e=>{if(e instanceof SVGSVGElement)return null;let n=Array.from(e.children),a=t?n:n.reverse();for(let e of a)if(t){if(u(e)&&r(e))return e;let t=i(e);if(t)return t}else{let t=i(e);if(t)return t;if(u(e)&&r(e))return e}return null},a=e=>t?e.nextElementSibling:e.previousElementSibling,o=null;if(t&&(o=i(e)),!o){let n=e;for(;n;){let e=a(n);for(;e;){if(u(e)&&r(e)){o=e;break}let t=i(e);if(t){o=t;break}e=a(e)}if(o)break;let s=n.parentElement;if(!t&&s&&u(s)){o=s;break}n=s}}return o};return{findNext:(e,t)=>{switch(e){case`ArrowUp`:return i(t);case`ArrowDown`:return a(t);case`ArrowRight`:return d(t,!0);case`ArrowLeft`:return d(t,!1);default:return null}},clearHistory:()=>{n=[]}}},tr=e=>{let{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}=gn(e.activationKey);return{metaKey:t,ctrlKey:n,shiftKey:r,altKey:i}},nr=()=>{let e=new WeakSet,t=Object.getOwnPropertyDescriptor(KeyboardEvent.prototype,`key`),n=!1;if(t?.get&&!t.get.__reactGrabPatched){n=!0;let r=t.get,i=function(){return e.has(this)?``:r.call(this)};i.__reactGrabPatched=!0,Object.defineProperty(KeyboardEvent.prototype,`key`,{get:i,configurable:!0})}return{claimedEvents:e,originalKeyDescriptor:t,restore:()=>{n&&t&&Object.defineProperty(KeyboardEvent.prototype,`key`,t)}}},rr=(e,t)=>({top:t<25,bottom:t>window.innerHeight-25,left:e<25,right:e>window.innerWidth-25}),ir=(e,t,n)=>{let r=null,i=()=>{if(!t()){a();return}let o=e(),s=rr(o.x,o.y),c=0,l=0;if(s.top&&(l-=10),s.bottom&&(l+=10),s.left&&(c-=10),s.right&&(c+=10),c!==0||l!==0){let e=window.scrollX,t=window.scrollY;window.scrollBy(c,l);let r=window.scrollX-e,i=window.scrollY-t;(r!==0||i!==0)&&n?.({x:r,y:i})}r=s.top||s.bottom||s.left||s.right?we(i):null},a=()=>{r!==null&&(Oe(r),r=null)};return{start:i,stop:a,isActive:()=>r!==null}},ar=()=>{let e=globalThis;return!!(e.chrome?.runtime?.id||e.browser?.runtime?.id)},or=e=>{try{let t=`0.1.47-dev.2be1b9a`,n=`data:image/svg+xml;base64,${btoa(`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 294 294"><path fill="#ff40e0" d="M145 47c25-20 50-27 67-17 16 9 23 30 20 60 0 2-1 5-1 7l-2 13h-1l-12-4c-8-3-17-5-25-6l-17-3c-10-1-20-1-29-1-10 0-20 0-29 1-6 8-11 16-16 24-5 9-9 17-13 26 4 9 8 18 13 26s10 16 16 24l11 14c5 7 11 13 18 19l10 8s-1 0 0 0l-11 9c-17 14-35 22-49 22-6 0-13-2-18-5-16-9-23-30-20-59 1-3 1-5 1-8-30-12-48-29-48-50 0-18 14-35 41-47 2-1 5-2 7-3 0-2 0-5-1-7-3-30 4-51 20-60 18-10 42-3 68 17M71 201c-1 2-1 4-1 5-2 24 3 41 13 47h1c11 7 30 1 51-15-10-9-18-18-26-29-13-1-26-4-38-8m9-38c-3 9-5 17-7 26 8 2 17 4 25 6-3-5-6-10-9-16-3-5-6-10-9-16m-19-53c-2 1-3 1-5 2-21 10-34 23-34 35 0 13 14 27 39 37 3-12 7-25 12-37-5-12-9-24-12-37m37-10c-8 1-17 3-25 6 2 8 4 16 7 25 3-5 6-11 9-16zm-3-61c-4-1-8 0-12 2-10 7-15 24-13 47 0 2 0 3 1 5 12-4 25-6 38-8 8-10 16-20 26-29-15-11-29-17-40-17m111 2c-4-2-8-3-12-2-11 0-25 5-40 17 10 9 19 19 26 29 13 2 26 4 39 8v-5c3-23-2-40-13-47m-61 23c-7 6-13 13-19 19h37c-6-6-12-13-18-19"/><mask id="a"><path fill="#fff" d="m235 85-133 27 28 133 133-27Z"/></mask><path fill="#ff40e0" d="m137 130 76 11c8 1 9 11 3 15l-28 16-4 32c-1 8-10 10-14 4l-41-66c-3-6 1-13 8-12" mask="url(#a)"/></svg>`)}`;console.log(`%cReact Grab${` v${t}`}%c\nhttps://react-grab.com`,`background: #330039; color: #ffffff; border: 1px solid #d75fcb; padding: 4px 4px 4px 24px; border-radius: 4px; background-image: url("${n}"); background-size: 16px 16px; background-repeat: no-repeat; background-position: 4px center; display: inline-block; margin-bottom: 4px;`,``),e&&navigator.onLine&&!ar()&&fetch(`https://www.react-grab.com/api/version?source=browser&v=${t}&t=${Date.now()}`,{referrerPolicy:`origin`,keepalive:!0,priority:`low`,cache:`no-store`}).then(e=>e.text()).then(e=>{e&&e!==t&&console.warn(`[React Grab] v${t} is outdated (latest: v${e}). Run \`npx grab@latest upgrade\` to upgrade.`)}).catch(()=>null)}catch{}},sr=e=>typeof e==`object`&&!!e,cr=e=>{if(!sr(e))return null;let t={};return typeof e.enabled==`boolean`&&(t.enabled=e.enabled),(e.activationMode===`toggle`||e.activationMode===`hold`)&&(t.activationMode=e.activationMode),typeof e.keyHoldDuration==`number`&&Number.isFinite(e.keyHoldDuration)&&(t.keyHoldDuration=e.keyHoldDuration),typeof e.allowActivationInsideInput==`boolean`&&(t.allowActivationInsideInput=e.allowActivationInsideInput),typeof e.activationKey==`string`&&(t.activationKey=e.activationKey),typeof e.maxContextLines==`number`&&Number.isFinite(e.maxContextLines)&&(t.maxContextLines=e.maxContextLines),typeof e.freezeReactUpdates==`boolean`&&(t.freezeReactUpdates=e.freezeReactUpdates),typeof e.telemetry==`boolean`&&(t.telemetry=e.telemetry),Object.keys(t).length===0?null:t},lr=()=>{if(typeof window>`u`)return null;try{let e=(document.currentScript instanceof HTMLScriptElement?document.currentScript:null)?.getAttribute(`data-options`);return e?cr(JSON.parse(e)):null}catch{return null}},ur=e=>e===`Enter`||e===`NumpadEnter`,dr=(e,t)=>e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height,fr=(e=>({name:e.name,setup:(t,n)=>({actions:[typeof e.contextMenuAction==`function`?e.contextMenuAction(t,n):e.contextMenuAction],cleanup:e.cleanup})}))({name:`copy`,contextMenuAction:{id:`copy`,label:`Copy`,shortcut:`C`,showInToolbarMenu:!0,onAction:e=>{e.copy?.()}}}),pr={name:`comment`,setup:()=>({actions:[{id:`comment`,label:`Comment`,shortcut:`Enter`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterPromptMode?.()}}]})},mr={name:`edit`,setup:()=>({actions:[{id:`edit`,label:`Style`,shortcut:`S`,shortcutModifier:!1,showInToolbarMenu:!0,onAction:e=>{e.enterEditMode?.()}}]})},Q={name:`open`,actions:[{id:`open`,label:`Open`,shortcut:`O`,enabled:e=>!!e.filePath,onAction:e=>{e.filePath&&(e.hooks.onOpenFile(e.filePath,e.lineNumber)||Ge(e.filePath,e.lineNumber,e.hooks.transformOpenFileUrl),e.hideContextMenu(),e.cleanup())}}]},hr=e=>{let t=e.left+e.width/2,n=e.top+e.height/2,r=n,i=window.innerHeight-n,a=t,o=window.innerWidth-t,s=Math.min(r,i,a,o);return s===r?`top`:s===a?`left`:s===o?`right`:`bottom`},gr=()=>{let[e,t]=S(!1),n=null,r=!1,i=()=>o(n)?n:null,a=()=>{n=null,r=!1,t(!1)};return{selectedElement:i,isPendingDismiss:e,select:(e,i)=>{n=e,t(!1),r=!!i?.shouldPromptBeforeMouseHandoff},clear:a,consumeMouseHandoff:()=>r?(r=!1,i()!==null):!1,showDismissPrompt:()=>i()?e()?!1:(t(!0),!0):(a(),!1),takeSelection:e=>{let t=i()??(o(e)?e:null);return a(),t}}},_r=async(e,t={})=>(await Promise.allSettled(e.map(e=>ot(e,t)))).map(e=>e.status===`fulfilled`?e.value:``),vr=[fr,mr,pr,Q];let yr=!1;const br=new Set,xr=e=>{if(typeof window>`u`)return Ut();let n={enabled:!0,activationMode:`toggle`,keyHoldDuration:100,allowActivationInsideInput:!0,...lr(),...e};if(n.enabled===!1||yr)return Ut();yr=!0,or(n.telemetry!==!1);let{enabled:r,telemetry:i,...a}=n;return w(e=>{let n=!1,r,i=Xn(a),{store:s,actions:l,pointer:u,viewportVersion:f,current:m}=Et({keyHoldDuration:i.store.options.keyHoldDuration??100}),h=x(()=>m().state===`holding`),_=x(()=>m().state===`active`),ne=x(()=>{let e=m();return e.state===`active`&&e.phase===`frozen`}),b=x(()=>{let e=m();return e.state===`active`&&(e.phase===`dragging-select`||e.phase===`dragging-reposition`)}),re=x(()=>{if(!b())return!1;let e=Math.abs(u().x+window.scrollX-s.dragStart.x),t=Math.abs(u().y+window.scrollY-s.dragStart.y);return e>2||t>2}),ie=x(()=>{let e=m();return e.state===`active`&&e.phase===`dragging-reposition`}),ae=x(()=>{let e=m();return e.state===`active`&&e.phase===`justDragged`}),C=x(()=>m().state===`copying`),oe=x(()=>s.selectionInteractionLockDepth>0),se=x(()=>m().state===`justCopied`),w=x(()=>{let e=m();return e.state===`active`&&!!e.isPromptMode}),ue=x(()=>s.pendingCommentMode||w()),de=x(()=>{let e=m();return e.state===`active`&&!!e.isPromptMode&&!!e.isPendingDismiss});E(D(_,(e,t)=>{if(e&&!t){let e=Ve(u().x,u().y),t=Pe();Ke(e),qe(t),document.body.style.touchAction=`none`}else !e&&t&&(We(),Le(),document.body.style.touchAction=``)}));let fe=le(),[T,ge]=S(fe?!fe.collapsed:!0),[_e,ve]=S(0),[ye,Ce]=S(0),[k,je]=S(fe),[Me,Fe]=S(!1),[Ie,Ze]=S(null),[tt,A]=S(null),j=qn({store:s,actions:l,isActivated:_,activateRenderer:()=>Jn(),deactivateRenderer:()=>Z(),performCopyWithLabel:e=>mn(e),onOpen:()=>{Wi(),N?.(),N=Ui(Hi,A)},onClose:()=>{N?.(),N=null,A(null)}}),ot=x(()=>s.contextMenuPosition!==null||j.isOpen()),st=x(()=>ot()||Ie()!==null),ut,M=null,N=null,P=!1,ft=new WeakMap,F=gr(),I=()=>!T()||w()||oe()||ot()||F.isPendingDismiss(),pt=()=>{ft=new WeakMap},L=()=>{Ct(!1),pt()},mt=e=>{let t=k()??le(),n={edge:t?.edge??`bottom`,ratio:t?.ratio??.5,collapsed:t?.collapsed??!1,enabled:t?.enabled??!0,defaultAction:t?.defaultAction??`copy`,...e};me(n),je(n);for(let e of br)e(n)},ht=()=>{V.timerId!==null&&(clearTimeout(V.timerId),V.timerId=null)},gt=()=>{V.copyWaiting=!1,V.holdTimerFired=!1,V.startTimestamp=null};E(()=>{if(m().state!==`holding`){ht();return}V.startTimestamp=Date.now(),V.timerId=window.setTimeout(()=>{if(V.timerId=null,V.copyWaiting){V.holdTimerFired=!0;return}l.activate()},s.keyHoldDuration),y(ht)}),E(()=>{let e=m();if(e.state!==`active`||e.phase!==`justDragged`)return;let t=setTimeout(()=>{l.finishJustDragged()},Xe);y(()=>clearTimeout(t))}),E(()=>{if(m().state!==`justCopied`)return;let e=setTimeout(()=>{l.finishJustCopied()},Xe);y(()=>clearTimeout(e))}),E(D(h,(e,t=!1)=>{!t||e||!_()||(i.store.options.activationMode!==`hold`&&l.setWasActivatedByToggle(!0),i.hooks.onActivate())}));let _t=(e,t,n)=>{yt(e,t,n),l.clearInputText()},vt=()=>{let e=s.frozenElement||X();e&&l.enterPromptMode({x:u().x,y:u().y},e)},yt=(e,t,n)=>{l.setCopyStart({x:t,y:n},e)},R={lastDetectionTimestamp:0,pendingDetectionScheduledAt:0,latestPointerX:0,latestPointerY:0},z=null,[bt,xt]=S(null),St=(e,t)=>{z!==null&&clearTimeout(z),xt(null),z=window.setTimeout(()=>{xt({x:e,y:t}),z=null},32)},B=null,V={timerId:null,startTimestamp:null,copyWaiting:!1,holdTimerFired:!1},H=null,[U,Ct]=S(!1),wt=0,Tt=!1,K=null,Dt=()=>{Tt=!0,K!==null&&window.clearTimeout(K),K=window.setTimeout(()=>{Tt=!1,K=null},Xe)},At=()=>{K!==null&&(window.clearTimeout(K),K=null),Tt=!1},jt=0,Mt=null,Nt=null,[Pt,Ft]=S(!1),[It,Lt]=S(null),[Rt,zt]=S(null),[Bt,Vt]=kt(Rt),q=x(()=>j.isOpen()?xe:ue()?De:Pt()?It():_()?Ee:null),[Ut,Kt]=S([]),[qt,Jt]=S(0),Yt=er(Ne,W),Xt=ir(u,()=>b(),e=>{if(ie()){if(l.shiftDragStart(e),H){H={x:H.x+e.x,y:H.y+e.y};return}let{pageX:t,pageY:n}=On(u().x,u().y);H={x:t,y:n}}}),J=x(()=>_()&&!C()),Qt=new Map,$t=(e,t)=>{let n=Zn(`grabbed`),r={id:n,bounds:e,createdAt:Date.now(),element:t};l.addGrabbedBox(r),i.hooks.onGrabbedBox(e,t);let a=window.setTimeout(()=>{Qt.delete(n),l.removeGrabbedBox(n)},Xe);Qt.set(n,a)},en=async e=>{let t=await Promise.all(e.map(async e=>{let t=await it(e),n=t?.componentName??null,r=t?.filePath,i=t?.lineNumber??void 0,a=t?.columnNumber??void 0;n||=ct(e);let o=e instanceof HTMLElement?e.innerText?.slice(0,100):void 0;return{tagName:O(e),id:e.id||void 0,className:e.getAttribute(`class`)||void 0,textContent:o,componentName:n??void 0,filePath:r,lineNumber:i,columnNumber:a}}));window.dispatchEvent(new CustomEvent(`react-grab:element-selected`,{detail:{elements:t}}))},Y=$n(l,()=>s.labelInstances),tn=async(e,t,n)=>{At(),m().state!==`copying`&&l.startCopy();let r=!1,i;try{r=await e(),r||(i=`Failed to copy`)}catch(e){i=Gt(e,`Action failed`)}if(t)for(let e of t)Y.updateAfterCopy(e,r,i);m().state===`copying`&&(r&&l.completeCopy(),n?Z():r?(l.activate(),Dt()):l.unfreeze())},un=(e,t,n)=>{let r=e[0],a=n??(r?ct(r):null),o=r?O(r):null,s=a??o??void 0;return Zt({getContent:i.store.options.getContent,componentName:s,maxContextLines:i.store.options.maxContextLines},i.hooks,e,t)},fn=async(e,t,n)=>{if(e.length===0)return!1;let r=[],a=[];for(let t of e){let{wasIntercepted:e,pendingResult:n}=i.hooks.onElementSelect(t);e||r.push(t),n&&a.push(n),i.store.theme.grabbedBoxes.enabled&&$t(W(t),t)}await $e();let o=!0;if(r.length>0&&(o=await un(r,t,n)),a.length>0&&!(await Promise.all(a)).every(Boolean))throw new at;return en(e),o},pn=e=>{rt(e.primaryElement).then(async t=>{await tn(()=>fn(e.targetElements,e.extraPrompt,t??void 0),e.labelInstanceIds.length>0?e.labelInstanceIds:null,e.shouldDeactivateAfter),e.onComplete?.()}).catch(t=>{let n=Gt(t,`Action failed`);for(let t of e.labelInstanceIds)Y.updateAfterCopy(t,!1,n);m().state===`copying`&&l.unfreeze()})},mn=e=>{let{element:t,cursorX:n,selectedElements:r,extraPrompt:i,shouldDeactivateAfter:a,onComplete:o,dragRect:c}=e,u=r??[t],d=c??s.frozenDragRect,f=u.length>1,p=!f&&t===xn()?Dn():void 0,m=d&&f?sn(d):p??W(t),h=f?m.x+m.width/2:n,g=O(t);At(),l.startCopy();let _=g?Y.createInstance(m,g,void 0,`copying`,{element:t,mouseX:h,elements:r}):null;pn({primaryElement:t,targetElements:u,labelInstanceIds:_?[_]:[],extraPrompt:i,shouldDeactivateAfter:a,onComplete:o})},gn=e=>{let{elements:t,labelEntries:n,shouldDeactivateAfter:r,onComplete:i}=e,a=t[0];At(),l.startCopy(),pn({primaryElement:a,targetElements:t,labelInstanceIds:Y.createPerElementInstances(n,`copying`),shouldDeactivateAfter:r,onComplete:i})},X=x(()=>{if(f(),!J()||re()||oe()||F.isPendingDismiss())return null;let e=s.detectedElement;return o(e)?e:null}),yn=x(()=>s.frozenElement||(ne()?null:X()));E(()=>{let e=s.detectedElement;if(!e)return;let t=setInterval(()=>{o(e)||l.setDetectedElement(null)},100);y(()=>clearInterval(t))}),E(D(yn,e=>{if(Mt!==null&&(clearTimeout(Mt),Mt=null),!e){zt(null);return}Mt=window.setTimeout(()=>{Mt=null,zt(e)},100)})),y(()=>{Mt!==null&&(clearTimeout(Mt),Mt=null)}),E(()=>{let e=s.frozenElements;y(Ye(e))}),E(D(_,e=>{e&&i.store.options.freezeReactUpdates&&y(Je())}));let bn=()=>{if(s.isTouchMode&&b()){let e=s.detectedElement;return!e||et(e)?void 0:e}let e=yn();if(!(!e||et(e)))return e},xn=x(()=>bn()),Sn=()=>xn()?s.isTouchMode&&b()?J():J()&&!re():!1,Cn=te(()=>s.frozenElements,e=>x(()=>(f(),W(e)))),wn=x(()=>{let e=s.frozenElements;if(e.length===0)return[];let t=s.frozenDragRect;return t&&e.length>1?[sn(t)]:Cn().map(e=>e())}),Tn=x(()=>{if(!U()||s.pendingCommentMode||Pt())return null;let e=s.detectedElement;return!o(e)||et(e)||s.frozenElements.includes(e)?null:e}),En=x(()=>{f();let e=Tn();if(e)return W(e)}),Dn=x(()=>{f();let e=s.frozenElements;if(e.length>0){let t=wn();if(e.length===1){let e=t[0];if(e)return e}let n=s.frozenDragRect;return n?t[0]??sn(n):ln(vn(t))}let t=xn();if(t)return W(t)}),On=(e,t)=>({pageX:e+window.scrollX,pageY:t+window.scrollY}),kn=(e,t)=>{let{pageX:n,pageY:r}=On(e,t);return{x:Math.abs(n-s.dragStart.x),y:Math.abs(r-s.dragStart.y)}},An=x(()=>{if(!b())return!1;let e=kn(u().x,u().y);return e.x>2||e.y>2}),jn=(e,t)=>{let{pageX:n,pageY:r}=On(e,t),i=Math.min(s.dragStart.x,n),a=Math.min(s.dragStart.y,r),o=Math.abs(n-s.dragStart.x),c=Math.abs(r-s.dragStart.y);return{x:i-window.scrollX,y:a-window.scrollY,width:o,height:c}},Mn=e=>e.code===`Space`||e.key===` `,Nn=()=>{if(!b())return;l.startDragReposition();let{pageX:e,pageY:t}=On(u().x,u().y);H={x:e,y:t}},Pn=()=>{l.stopDragReposition(),H=null},Fn=x(()=>{if(f(),An())return ln(jn(u().x,u().y))}),In=x(()=>{if(f(),!An())return[];let e=bt();if(!e)return[];let t=jn(e.x,e.y),n=nn(t,Ne);return(n.length>0?n:nn(t,Ne,!1)).map(e=>W(e))}),Ln=x(()=>{let e=In();if(e.length>0)return e;let t=En();return t?[...wn(),t]:wn()}),Rn=te(()=>s.frozenElements,e=>{let t=O(e)||`element`,n=ct(e)??void 0;return x(()=>{if(f(),!o(e))return null;let r=W(e),i=ft.get(e);return{tagName:t,componentName:n,bounds:r,mouseX:i===void 0?void 0:r.x+r.width*i}})}),zn=x(()=>{if(w()||s.frozenElements.length<2)return[];let e=[];for(let t of Rn()){let n=t();n!==null&&e.push(n)}return e}),Bn=x(()=>{if(w())return null;let e=Tn();return e?(f(),{tagName:O(e)||`element`,componentName:ct(e)??void 0,bounds:W(e),mouseX:u().x}):null}),Vn=x(()=>{if(C()||w()){f();let e=s.frozenElement||X();return e?{x:G(W(e)).x+s.copyOffsetFromCenterX,y:s.copyStart.y}:{x:s.copyStart.x,y:s.copyStart.y}}return{x:u().x,y:u().y}}),Hn=x(()=>{if(!U()||s.frozenElements.length!==1)return;f();let e=s.frozenElements[0];if(!o(e))return;let t=ft.get(e);if(t===void 0)return;let n=W(e);return n.x+n.width*t});E(D(()=>[X(),s.lastGrabbedElement],([e,t])=>{t&&e&&t!==e&&l.setLastGrabbed(null),e&&i.hooks.onElementHover(e)})),E(D(()=>X(),e=>{let t=++jt,n=()=>{jt===t&&l.setSelectionSource(null,null)};if(!e){n();return}it(e).then(e=>{if(jt===t){if(!e){n();return}l.setSelectionSource(e.filePath,e.lineNumber)}}).catch(()=>{jt===t&&l.setSelectionSource(null,null)})}));let Un=x(()=>s.grabbedBoxes.map(e=>({id:e.id,bounds:e.bounds,createdAt:e.createdAt}))),Wn=x(()=>s.labelInstances.map(e=>({id:e.id,status:e.status,tagName:e.tagName,componentName:e.componentName,createdAt:e.createdAt})));E(D(x(()=>{let e=_(),t=b(),n=C(),r=w(),a=X(),o=Fn(),c=i.store.theme.enabled,l=i.store.theme.selectionBox.enabled,u=i.store.theme.dragBox.enabled,d=An(),f=yn(),p=se();return{isActive:e,isDragging:t,isCopying:n,isPromptMode:r,isSelectionBoxVisible:!!(c&&l&&e&&!n&&!p&&!t&&f!=null),isDragBoxVisible:!!(c&&u&&e&&!n&&d),targetElement:a,dragBounds:o?{x:o.x,y:o.y,width:o.width,height:o.height}:null,grabbedBoxes:[...Un()],labelInstances:[...Wn()],selectionFilePath:s.selectionFilePath,toolbarState:k()}}),e=>{i.hooks.onStateChange(e)})),E(D(()=>{let e=w();return{inputMode:e,position:e?u():g(u),target:e?X():g(X)}},({inputMode:e,position:t,target:n})=>{i.hooks.onPromptModeChange(e,{x:t.x,y:t.y,targetElement:n})})),E(D(()=>[bi(),Dn(),X()],([e,t,n])=>{i.hooks.onSelectionBox(!!e,t??null,n)})),E(D(()=>[Di(),Fn()],([e,t])=>{i.hooks.onDragBox(!!e,t??null)})),E(D(()=>{let e=ki();return[e,Oi(),e?Vn():g(Vn),e?X():g(X),s.selectionFilePath,s.selectionLineNumber]},([e,t,n,r,a,o])=>{i.hooks.onElementLabel(e,t,{x:n.x,y:n.y,content:``,element:r??void 0,tagName:r&&O(r)||void 0,filePath:a??void 0,lineNumber:o??void 0})}));let Gn=null,Kn=e=>{if(e){if(!Gn){Gn=document.createElement(`style`),Gn.setAttribute(`data-react-grab-cursor`,``);let e=Ae();e&&(Gn.nonce=e),Se(Gn),document.head.appendChild(Gn)}Gn.textContent=`* { cursor: ${e} !important; }`}else Gn&&=(Gn.remove(),null)};E(D(()=>[_(),C(),w()],([e,t,n])=>{Kn(t?`progress`:e&&!n?`crosshair`:null)}));let Jn=()=>{let e=h();l.activate(),e||i.hooks.onActivate()},Z=()=>{let e=b(),t=s.previouslyFocusedElement;Pn(),l.deactivate(),j.resetWithDiscard(),Wi(),L(),Rr(),F.clear(),Ft(!1),Lt(null),e&&(document.body.style.userSelect=``),B&&window.clearTimeout(B),Xt.stop(),t instanceof HTMLElement&&t!==document.body&&t!==document.activeElement&&o(t)&&t.focus({preventScroll:!0}),i.hooks.onDeactivate()},Yn=()=>{h()&&l.releaseHold(),_()&&Z(),At()},Qn=()=>{l.setWasActivatedByToggle(!0),Jn()},ar=()=>{let e=[...s.frozenElements],t=s.frozenElement||X(),n=w()?s.inputText.trim():``;if(!t){Z();return}let r=e.length>0?e:[t],i=r.map(e=>W(e))[0],{x:a,y:o}=G(i),c=a+s.copyOffsetFromCenterX;l.setPointer({x:a,y:o}),l.exitPromptMode(),l.clearInputText(),mn({element:t,cursorX:c,selectedElements:r,extraPrompt:n||void 0,shouldDeactivateAfter:!0})},or=()=>{if(w()){if(de()){l.clearInputText(),Z();return}l.setPendingDismiss(!0),Ce(e=>e+1)}},sr=()=>{if(F.isPendingDismiss()){Ur();return}l.clearInputText(),Z()},cr=()=>{l.setPendingDismiss(!1)},lr=()=>{if(j.isOpen()){j.dismiss();return}let e=s.frozenElement||X();e&&fr(e,{x:u().x,y:u().y})},fr=(e,t,n={})=>j.trigger(e,t,n),pr=(e,t)=>{if(!j.isOpen()||s.contextMenuPosition!==null)return!1;let n=Re(e,t).find(Ne);if(!n)return!1;let r=j.switchToElement(n,{x:e,y:t});return r&&He([n]),r},mr=e=>({filePath:s.selectionFilePath??void 0,lineNumber:s.selectionLineNumber??void 0,componentName:Bt(),tagName:O(e)||void 0}),Q=()=>{Nt=null,Ft(!1),l.setPendingCommentMode(!1),Lt(null)},_r=e=>{let t=s.frozenElement||X();if(!t)return!1;let n={x:u().x,y:u().y},r=i.store.actions.find(t=>t.id===e);return r?e===`edit`?fr(t,n,mr(t))?(l.clearInputText(),l.exitPromptMode(),Q(),!0):!0:(l.clearInputText(),l.exitPromptMode(),Q(),r.onAction(Jr(t,n)),!0):(l.clearInputText(),l.exitPromptMode(),Q(),qi(Ee),wr(t,n),!0)},xr=e=>{if(_()){if(q()!==e&&w()&&_r(e))return;if(q()!==e&&s.pendingCommentMode){l.setPendingCommentMode(!1),Nt=e,Lt(e),Ft(!0);return}if(q()!==e&&Pt()){Nt=e,Lt(e);return}Z();return}T()&&(Nt=e,Lt(e),Ft(!0),Qn())},Sr=()=>{xr(k()?.defaultAction??`copy`)},Cr=(e,t,n)=>{Q(),l.clearInputText(),l.enterPromptMode({x:t,y:n},e)},wr=(e,t)=>{L(),Gi(),l.showContextMenu(t,e),Rr(),i.hooks.onContextMenu(e,t)},Tr=(e,t)=>{let n=Nt;if(Nt=null,Lt(null),!n)return;if(n===`edit`){fr(e,t,mr(e));return}let r=i.store.actions.find(e=>e.id===n);if(!r){qi(Ee),wr(e,t);return}r.onAction(Jr(e,t))},Er=()=>{if(T()){if(_()&&ue()){Z();return}l.setPendingCommentMode(!0),_()||Qn()}},Dr=(e,t,n)=>{let r=n&&U()&&!b()&&!s.pendingCommentMode&&!Pt();if(I()||ne()&&!r)return;if(l.setPointer({x:e,y:t}),R.latestPointerX=e,R.latestPointerY=t,r){let n=Be(e,t);n!==s.detectedElement&&l.setDetectedElement(n);return}let i=performance.now(),a=R.pendingDetectionScheduledAt>0&&i-R.pendingDetectionScheduledAt<200;if(i-R.lastDetectionTimestamp>=32&&!a&&(R.lastDetectionTimestamp=i,R.pendingDetectionScheduledAt=i,setTimeout(()=>{if(I()){R.pendingDetectionScheduledAt=0;return}let e=Be(R.latestPointerX,R.latestPointerY);e!==s.detectedElement&&l.setDetectedElement(e),R.pendingDetectionScheduledAt=0})),b()){if(ie()){let{pageX:n,pageY:r}=On(e,t);H&&l.shiftDragStart({x:n-H.x,y:r-H.y}),H={x:n,y:r}}St(e,t);let n=rr(e,t),r=n.top||n.bottom||n.left||n.right;r&&!Xt.isActive()?Xt.start():!r&&Xt.isActive()&&Xt.stop()}},Or=(e,t,n)=>{if(!J()||oe())return!1;!n&&U()&&L();let r=F.selectedElement()!==null;return l.startDrag({x:e,y:t},n||r),l.setPointer({x:e,y:t}),document.body.style.userSelect=`none`,St(e,t),i.hooks.onDragStart(e+window.scrollX,t+window.scrollY),!0},kr=(e,t)=>{let n=s.frozenElements.includes(e),r=s.frozenElements.length===0;if(!n){let n=rn(W(e),t);ft.set(e,n),r&&Vt(ct(e)??void 0)}l.toggleFrozenElement(e),Ue();let i=s.frozenElements.includes(e);if(i||ft.delete(e),s.frozenElements.length===0){L(),l.unfreeze();return}He(s.frozenElements),Ct(!0),l.setPointer(t),l.setLastGrabbed(i?e:s.frozenElements[s.frozenElements.length-1]),l.freeze(),Rr()},Ar=()=>{let e=s.frozenElements.filter(o),t=e.map(e=>{let t=O(e)||`element`,n=ct(e)??void 0,r=ft.get(e),i=W(e);return{element:e,tagName:t,componentName:n,mouseX:r===void 0?i.x+i.width/2:i.x+i.width*r}});if(L(),e.length===0){l.unfreeze();return}if(e.length===1){mn({element:e[0],cursorX:t[0].mouseX,selectedElements:e,shouldDeactivateAfter:s.wasActivatedByToggle});return}gn({elements:e,labelEntries:t,shouldDeactivateAfter:s.wasActivatedByToggle})},jr=(e,t,n)=>{let r=nn(e,Ne),a=r.length>0?r:nn(e,Ne,!1);if(a.length===0)return;let o=n&&!s.pendingCommentMode&&!Pt();if(o&&l.addFrozenElements(a),He(o?s.frozenElements:a),i.hooks.onDragEnd(a,e),o){let e=a[a.length-1];Ct(!0),Ue(),l.setPointer(G(W(e))),l.setLastGrabbed(e),l.freeze(),Rr();return}let c=a[0],u=G(W(c));l.setPointer(u),l.setFrozenElements(a);let d=cn(e);if(l.setFrozenDragRect(d),l.freeze(),l.setLastGrabbed(c),s.pendingCommentMode){Cr(c,u.x,u.y);return}if(Pt()){Ft(!1),Nt?Tr(c,u):wr(c,u);return}let f=s.wasActivatedByToggle&&!t;mn({element:c,cursorX:u.x,selectedElements:a,shouldDeactivateAfter:f,dragRect:d})},Mr=e=>{for(let t of s.frozenElements)if(o(t)&&dr(e,W(t)))return t;return null},Nr=(e,t,n,r)=>{let a=o(s.frozenElement)?s.frozenElement:null,c=F.selectedElement(),d=()=>Re(e,t).find(Ne)??null;if(r&&!s.pendingCommentMode&&!Pt()){let n=d();n!==null&&kr(n,{x:e,y:t});return}let f=d()??(o(s.detectedElement)?s.detectedElement:null),p=c??f??a;if(!p)return;let m,h,g=f===null&&a===p,_=c===p;if(g)m=u().x,h=u().y;else if(_){let e=G(W(p));m=e.x,h=e.y}else m=e,h=t;if(s.pendingCommentMode){Cr(p,m,h),F.clear();return}if(Pt()){Ft(!1);let{wasIntercepted:e}=i.hooks.onElementSelect(p);if(e)return;F.clear(),He([p]),l.setFrozenElement(p);let t={x:m,y:h};l.setPointer(t),l.freeze(),Nt?Tr(p,t):wr(p,t);return}let v=s.wasActivatedByToggle&&!n;l.setLastGrabbed(p),mn({element:p,cursorX:m,shouldDeactivateAfter:v}),F.clear()},Pr=()=>{b()&&(Pn(),l.cancelDrag(),Xt.stop(),document.body.style.userSelect=``)},Fr=(e,t,n,r)=>{if(!b())return;z!==null&&(clearTimeout(z),z=null),xt(null);let i=kn(e,t),a=i.x>2||i.y>2,o=a?jn(e,t):null;a?l.endDrag():l.cancelDrag(),Pn(),Xt.stop(),document.body.style.userSelect=``,o?jr(o,n,r):Nr(e,t,n,r)},$=Wt(),Ir=nr(),Lr=e=>{let t;try{t=Ir.originalKeyDescriptor?.get?Ir.originalKeyDescriptor.get.call(e):e.key}catch{return!1}let n=t===`Enter`||ur(e.code),r=_()||h();return n&&r&&!w()&&!F.isPendingDismiss()&&!s.wasActivatedByToggle?d(e,`data-react-grab-input`)?!1:(Ir.claimedEvents.add(e),e.preventDefault(),e.stopImmediatePropagation(),!0):!1};$.addDocumentListener(`keydown`,Lr,{capture:!0}),$.addDocumentListener(`keyup`,Lr,{capture:!0}),$.addDocumentListener(`keypress`,Lr,{capture:!0});let Rr=()=>{Kt([]),Jt(0),Yt.clearHistory(),F.clear()},zr=(e,t=!1)=>{l.setFrozenElement(e),l.freeze(),F.select(e,{shouldPromptBeforeMouseHandoff:t});let n=G(W(e));l.setPointer(n),s.contextMenuPosition!==null&&l.showContextMenu(n,e)},Br=e=>{let t=an(W(e)),n=Re(t.x,t.y).filter(Ne).reverse();Kt(n),Jt(Math.max(0,n.indexOf(e)))},Vr=e=>{let t=Ut()[e];t&&(Jt(e),Yt.clearHistory(),zr(t,!0))},Hr=()=>{F.showDismissPrompt()&&Ce(e=>e+1)},Ur=()=>{F.clear(),l.unfreeze(),Rr()},Wr=()=>{let e=F.takeSelection(s.frozenElement);if(!e){Ur();return}let t=G(W(e));Rr(),l.setLastGrabbed(e),mn({element:e,cursorX:t.x,shouldDeactivateAfter:s.wasActivatedByToggle})},Gr=e=>{if(!_()||w()||U()||F.isPendingDismiss()||!ke.has(e.key)||st())return!1;let t=yn(),n=!t;if(t||=Be(window.innerWidth/2,window.innerHeight/2),!t)return!1;if(!(e.key===`ArrowUp`||e.key===`ArrowDown`)){Rr();let r=Yt.findNext(e.key,t);return!r&&!n?!1:(e.preventDefault(),e.stopPropagation(),zr(r??t,!0),!0)}Ut().length===0&&Br(t);let r=Yt.findNext(e.key,t)??t;e.preventDefault(),e.stopPropagation(),zr(r,!0);let i=Ut().indexOf(r);return i===-1?Br(r):Jt(i),!0},Kr=e=>e.metaKey||e.ctrlKey||e.altKey||e.repeat||v(e)||!_()||C()||oe()||st()?null:s.frozenElement||X(),qr=e=>{let t=Kr(e);if(!t)return null;let n=he(i.store.actions,e);return n?{element:t,action:n}:null},Jr=(e,t)=>{let n=W(e);return Ri({element:e,filePath:s.selectionFilePath??void 0,lineNumber:s.selectionLineNumber??void 0,tagName:O(e)||void 0,componentName:Bt(),position:t,shouldDeferHideContextMenu:!1,performWithFeedbackOptions:{fallbackBounds:n,fallbackSelectionBounds:[n],position:t}})},Yr=/^[a-zA-Z0-9-]$/,Xr=e=>{if(!e.key||e.key.length!==1||!Yr.test(e.key))return!1;let t=Kr(e);return!t||!j.trigger(t,{x:u().x,y:u().y},{initialSearchQuery:e.key})?!1:(Q(),e.preventDefault(),e.stopImmediatePropagation(),!0)},Zr=e=>{let t=qr(e);if(!t)return!1;let{element:n,action:r}=t;if(w())return _r(r.id)?(e.preventDefault(),e.stopImmediatePropagation(),!0):!1;let i={x:u().x,y:u().y};return r.onAction(Jr(n,i)),e.preventDefault(),e.stopImmediatePropagation(),!0},Qr=e=>{if(e.key?.toLowerCase()!==`o`||!_()||!(e.metaKey||e.ctrlKey))return!1;let t=s.selectionFilePath,n=s.selectionLineNumber;return t?(e.preventDefault(),e.stopPropagation(),i.hooks.onOpenFile(t,n??void 0)||Ge(t,n??void 0,i.hooks.transformOpenFileUrl),!0):!1},$r=e=>{if(!_()||C()||s.contextMenuPosition!==null||j.isOpen())return!1;let t=e.key===`F10`&&e.shiftKey,n=e.key===`ContextMenu`;if(!t&&!n)return!1;let r=s.frozenElements,i=r.length>1,a=(i?r[0]:null)||s.frozenElement||X();if(!a)return!1;e.preventDefault(),e.stopPropagation();let o=G(W(a));return i?He(r):(He([a]),l.setFrozenElement(a)),l.setPointer(o),l.freeze(),wr(a,o),!0},ei=x(()=>Ut().map(e=>({tagName:O(e)||`element`,componentName:ct(e)??void 0}))),ti=x(()=>({items:ei(),activeIndex:qt(),isVisible:Ut().length>0})),ni=e=>{if(!(!i.store.options.allowActivationInsideInput&&v(e))&&!(!_n(e,i.store.options)&&((e.metaKey||e.ctrlKey)&&!ze.includes(e.key)&&!ur(e.code)&&(_()&&!s.wasActivatedByToggle?Z():h()&&(ht(),gt(),l.releaseHold())),!ur(e.code)||!h()))){if((_()||h())&&!w()&&(e.preventDefault(),ur(e.code)&&e.stopImmediatePropagation()),_()){if(s.wasActivatedByToggle&&i.store.options.activationMode!==`hold`||e.repeat)return;B!==null&&window.clearTimeout(B),B=window.setTimeout(()=>{Z()},200);return}if(h()&&e.repeat){if(V.copyWaiting){let e=V.holdTimerFired;gt(),e&&l.activate()}return}if(!(C()||se())&&!h()){let n=i.store.options.keyHoldDuration??100;v(e)?be(e)?n+=600:n+=400:t()&&(n+=600),gt(),l.startHold(n)}}},ri=e=>{if(!ur(e.code))return!1;let t=e.composedPath()[0],n=t instanceof HTMLElement?t:null;return!!(n?.closest(`[data-react-grab-discard-copy]`)||n?.closest(`[data-react-grab-discard-yes]`))};$.addWindowListener(`keydown`,e=>{let t=F.isPendingDismiss(),n=t&&(ke.has(e.key)||qr(e)!==null);if(t&&ri(e))return;if(n&&Rr(),n||Lr(e),!T()){_n(e,i.store.options)&&!e.repeat&&ve(e=>e+1);return}let r=ur(e.code)&&h()&&!w(),a=d(e,`data-react-grab-input`);if(w()&&_n(e,i.store.options)&&!e.repeat&&!a){e.preventDefault(),e.stopPropagation(),or();return}if(e.key===`Escape`&&st()){Ie()!==null&&Wi();return}let o=d(e,`data-react-grab-ignore-events`)&&!r;if(w()||o)return w()&&!a&&Zr(e)||(e.key===`Escape`&&(w()?or():s.wasActivatedByToggle&&Z()),o&&ke.has(e.key)&&Gr(e)),void 0;if(b()&&Mn(e)){e.repeat||Nn(),e.preventDefault(),e.stopPropagation();return}if(e.key===`Escape`&&(h()||s.wasActivatedByToggle)){Z();return}_()&&!ze.includes(e.key)&&e.preventDefault();let c=Date.now()-wt<200;Gr(e)||Qr(e)||$r(e)||Zr(e)||Xr(e)||c||ni(e)},{capture:!0}),$.addWindowListener(`keyup`,e=>{if(Lr(e))return;if(Mn(e)&&ie()&&(Pn(),e.preventDefault(),e.stopPropagation()),e.key===`Shift`&&U()){b()&&Pr(),Ar();return}if(d(e,`data-react-grab-ignore-events`))return;let t=tr(i.store.options),n=t.metaKey||t.ctrlKey?p()?!e.metaKey:!e.ctrlKey:t.shiftKey&&!e.shiftKey||t.altKey&&!e.altKey,r=i.store.options.activationKey?typeof i.store.options.activationKey==`function`?i.store.options.activationKey(e):hn(i.store.options.activationKey)(e):dn(e.key,e.code);if(se()||Tt){(r||n)&&(At(),Z());return}if(!h()&&!_()||w())return;let a=!!i.store.options.activationKey,o=i.store.options.activationMode===`hold`,c=b();if(_()){let e=ot();if(n){if(s.wasActivatedByToggle&&i.store.options.activationMode!==`hold`||e)return;Z()}else if(o&&r){if(B!==null&&(window.clearTimeout(B),B=null),e||c)return;Z()}else !a&&r&&B!==null&&(window.clearTimeout(B),B=null);return}if(r||n){if(s.wasActivatedByToggle&&i.store.options.activationMode!==`hold`)return;if(h()||V.holdTimerFired&&n){ht();let t=(V.startTimestamp?Date.now()-V.startTimestamp:0)>=200,n=V.holdTimerFired&&t&&(i.store.options.allowActivationInsideInput||!v(e));gt(),n?l.activate():l.releaseHold()}else Z()}},{capture:!0}),$.addDocumentListener(`copy`,()=>{h()&&(V.copyWaiting=!0)}),$.addWindowListener(`keypress`,Lr,{capture:!0}),$.addWindowListener(`pointermove`,e=>{if(!e.isPrimary)return;let t=e.pointerType===`touch`;if(l.setTouchMode(t),!d(e,`data-react-grab-ignore-events`)&&!I()&&!(t&&!h()&&!_())){if((t?h():_())&&!w()&&ne()&&!e.shiftKey&&!U()){if(F.consumeMouseHandoff()){Hr();return}l.unfreeze(),Rr()}Dr(e.clientX,e.clientY,e.shiftKey)}},{passive:!0}),$.addWindowListener(`pointerdown`,e=>{if(e.button===0&&e.isPrimary&&(l.setTouchMode(e.pointerType===`touch`),P=!1,!d(e,`data-react-grab-ignore-events`))){if(ot()){pr(e.clientX,e.clientY)&&(P=!0,e.preventDefault(),e.stopImmediatePropagation());return}if(w()){let t=Dn();t&&e.clientX>=t.x&&e.clientX<=t.x+t.width&&e.clientY>=t.y&&e.clientY<=t.y+t.height?ar():or();return}if(F.isPendingDismiss()){e.preventDefault(),e.stopImmediatePropagation();return}if(oe()){e.preventDefault(),e.stopImmediatePropagation();return}Or(e.clientX,e.clientY,e.shiftKey)&&(e.pointerId!==void 0&&document.documentElement.setPointerCapture(e.pointerId),e.preventDefault(),e.stopImmediatePropagation())}},{capture:!0}),$.addWindowListener(`pointerup`,e=>{if(e.button!==0||!e.isPrimary||d(e,`data-react-grab-ignore-events`)||ot())return;let t=J()||oe()||b(),n=e.metaKey||e.ctrlKey;Fr(e.clientX,e.clientY,n,e.shiftKey),t&&(e.preventDefault(),e.stopImmediatePropagation())},{capture:!0}),$.addWindowListener(`contextmenu`,e=>{if(!J()||C()||w()||j.isOpen())return;if(F.isPendingDismiss()){e.preventDefault(),e.stopPropagation();return}let t=d(e,`data-react-grab-ignore-events`),n={x:e.clientX,y:e.clientY},r=t&&s.frozenElements.length>1?Mr(n):null;if(t&&Ut().length>0)Rr();else if(t&&!r)return;if(ot()){e.preventDefault();return}e.preventDefault(),e.stopPropagation();let i=r??Be(e.clientX,e.clientY);if(!i)return;let a=s.frozenElements;a.length>1&&a.includes(i)?He(a):(He([i]),l.setFrozenElement(i)),l.setPointer(n),l.freeze(),wr(i,n)},{capture:!0}),$.addWindowListener(`pointercancel`,e=>{e.isPrimary&&Pr()}),$.addWindowListener(`click`,e=>{if(!d(e,`data-react-grab-ignore-events`)){if(P){P=!1,e.preventDefault(),e.stopImmediatePropagation();return}ot()||(J()||ae())&&(e.preventDefault(),e.stopImmediatePropagation(),s.wasActivatedByToggle&&!w()&&!e.shiftKey&&(h()?l.setWasActivatedByToggle(!1):Z()))}},{capture:!0}),$.addDocumentListener(`visibilitychange`,()=>{if(document.hidden){l.clearGrabbedBoxes();let e=s.activationTimestamp;_()&&!w()&&e!==null&&Date.now()-e>500&&Z()}}),$.addWindowListener(`blur`,()=>{Pr(),h()&&(ht(),l.releaseHold(),gt()),L()}),$.addWindowListener(`focus`,()=>{wt=Date.now()}),$.addWindowListener(`focusin`,e=>{d(e,`data-react-grab`)&&e.stopPropagation()},{capture:!0});let ii=()=>{if(!(s.isTouchMode&&!h()&&!_())&&!I()&&!ne()&&!b()&&s.frozenElements.length===0){let e=Be(u().x,u().y);l.setDetectedElement(e)}},ai=null,oi=null,si=()=>{on(),ii(),l.incrementViewportVersion(),l.updateContextMenuPosition()};$.addWindowListener(`scroll`,si,{capture:!0});let ci=window.innerWidth,li=window.innerHeight;$.addWindowListener(`resize`,()=>{let e=window.innerWidth,t=window.innerHeight;if(ci>0&&li>0){let n=e/ci,r=t/li,i=Math.abs(n-r)<nt,a=Math.abs(n-1)>nt;i&&a&&l.setPointer({x:u().x*n,y:u().y*r})}ci=e,li=t,si()});let ui=window.visualViewport;if(ui){let{signal:e}=$;ui.addEventListener(`resize`,si,{signal:e}),ui.addEventListener(`scroll`,si,{signal:e})}let di=()=>{oi===null&&(oi=we(()=>{oi=null,l.incrementViewportVersion()}))};E(()=>{if(i.store.theme.enabled&&(_()||C()||s.labelInstances.length>0||s.grabbedBoxes.length>0)){if(ai!==null)return;ai=window.setInterval(()=>{di()},100);return}ai!==null&&(window.clearInterval(ai),ai=null),oi!==null&&(Oe(oi),oi=null)}),y(()=>{ai!==null&&window.clearInterval(ai),oi!==null&&Oe(oi)}),$.addDocumentListener(`copy`,e=>{w()||d(e,`data-react-grab-ignore-events`)||J()&&e.preventDefault()},{capture:!0}),y(()=>{$.abort(),z!==null&&window.clearTimeout(z),B&&window.clearTimeout(B),At(),M?.(),M=null,N?.(),N=null,Qt.forEach(e=>window.clearTimeout(e)),Qt.clear(),Y.cancelAllFades(),Xt.stop(),document.body.style.userSelect=``,document.body.style.touchAction=``,Kn(null),Ir.restore()});let{root:fi,host:pi}=Ot(dt);y(Ht(pi).cleanup);let mi=x(()=>i.store.theme.enabled),hi=x(()=>i.store.theme.selectionBox.enabled),gi=x(()=>i.store.theme.elementLabel.enabled),_i=x(()=>i.store.theme.dragBox.enabled),vi=x(()=>se()||Me()&&!ne()||j.isInteracting()),yi=x(()=>In().length>0),bi=x(()=>!mi()||!hi()||vi()?!1:yi()?!0:Sn()),xi=x(()=>{let e=xn();if(e)return O(e)||void 0}),Si=x(()=>!mi()||ot()||!gi()||vi()?!1:Sn()),Ci=new Map,wi=e=>{let t=e.elements?.filter(o)??[],n=e.element,r=null;t.length>0?r=t.map(W):n&&o(n)&&(r=[W(n)]);let i=e.bounds,a=e.boundsMultiple;r&&(i=r.length>1?ln(vn(r)):r[0],e.boundsMultiple!==void 0&&(a=e.boundsMultiple.length>1&&e.boundsMultiple.length===e.elements?.length?r:[i]));let s=Ci.get(e.id),c=s?.boundsMultiple,l=c===a||c!==void 0&&a!==void 0&&c.length===a.length&&c.every((e,t)=>e.x===a[t].x&&e.y===a[t].y&&e.width===a[t].width&&e.height===a[t].height);if(s&&s.status===e.status&&s.errorMessage===e.errorMessage&&s.bounds.x===i.x&&s.bounds.y===i.y&&s.bounds.width===i.width&&s.bounds.height===i.height&&l)return s;let u=i.x+i.width/2,d=i.width/2,f;f=e.mouseXOffsetRatio!==void 0&&d>0?u+e.mouseXOffsetRatio*d:e.mouseXOffsetFromCenter===void 0?e.mouseX??u:u+e.mouseXOffsetFromCenter;let p={...e,bounds:i,boundsMultiple:a,mouseX:f};return Ci.set(e.id,p),p},Ti=x(()=>{if(!mi()||!i.store.theme.grabbedBoxes.enabled)return[];f();let e=new Set(s.labelInstances.map(e=>e.id));for(let t of Ci.keys())e.has(t)||Ci.delete(t);return s.labelInstances.map(wi)}),Ei=x(()=>!mi()||!i.store.theme.grabbedBoxes.enabled?[]:(f(),s.grabbedBoxes.map(e=>!e.element||!document.body.contains(e.element)?e:{...e,bounds:W(e.element)}))),Di=x(()=>mi()&&_i()&&J()&&An()),Oi=x(()=>C()?`processing`:`hover`),ki=x(()=>{if(!mi())return!1;let e=gi(),t=w(),n=C(),r=J(),i=b(),a=!!yn(),o=Me(),s=ne();return!e||t||o&&!s?!1:n?!0:r&&!i&&a}),Ai=x(()=>{f();let e=s.contextMenuElement;return e?W(e):null}),ji=x(()=>(f(),s.contextMenuPosition)),Mi=x(()=>{let e=s.contextMenuElement;if(!e)return;let t=s.frozenElements.length;return t>1?`${t} elements`:O(e)||void 0}),[Ni]=kt(()=>s.frozenElements.length>1?null:s.contextMenuElement),[Pi]=pe(()=>s.contextMenuElement,async e=>e?it(e):null),Fi=async e=>{l.incrementSelectionInteractionLockDepth();try{return await e()}finally{l.decrementSelectionInteractionLockDepth()}},Ii=(e,t,n,r,i)=>async a=>{await Fi(async()=>{let o=i?.fallbackBounds??null,c=i?.fallbackSelectionBounds??[],d=i?.position??s.contextMenuPosition??u(),f=wn(),p=Ai()??o,m=t.length>1,h=m?ln(vn(f)):p,g=s.wasActivatedByToggle,_;if(_=m?f:p?[p]:c,l.hideContextMenu(),h){let i=m?h.x+h.width/2:d.x,o=Y.createInstance(h,n||`element`,r,`copying`,{element:e,mouseX:i,elements:m?t:void 0,boundsMultiple:_}),s=!1,c;try{s=await a(),s||(c=`Failed to copy`)}catch(e){c=Gt(e,`Action failed`)}Y.updateAfterCopy(o,s,c)}else try{await a()}catch{}g?Z():l.unfreeze()})},Li=()=>{setTimeout(()=>{l.hideContextMenu()},0)},Ri=e=>{let{element:t,filePath:n,lineNumber:r,tagName:a,componentName:o,position:c,performWithFeedbackOptions:u,shouldDeferHideContextMenu:d,onBeforeCopy:f,onBeforePrompt:p,customEnterPromptMode:m}=e,h=s.frozenElements.length>0?s.frozenElements:[t],g=d?Li:l.hideContextMenu,v={element:t,elements:h,filePath:n,lineNumber:r,componentName:o,tagName:a,enterPromptMode:m??(()=>{Y.clearAll(),Q(),p?.(),_t(t,c.x,c.y),l.setPointer({x:c.x,y:c.y}),l.setFrozenElement(t),vt(),_()||Jn(),g()}),enterEditMode:()=>{fr(t,c,{filePath:n,lineNumber:r,componentName:o,tagName:a})&&Q(),g()},copy:()=>{Q(),f?.(),mn({element:t,cursorX:c.x,selectedElements:h.length>1?h:void 0,shouldDeactivateAfter:s.wasActivatedByToggle}),g()},hooks:{transformHtmlContent:i.hooks.transformHtmlContent,onOpenFile:i.hooks.onOpenFile,transformOpenFileUrl:i.hooks.transformOpenFileUrl},performWithFeedback:Ii(t,h,a,o,u),hideContextMenu:g,cleanup:()=>{s.wasActivatedByToggle?Z():l.unfreeze()}},ee=i.hooks.transformActionContext(v);return{...v,...ee}},zi=x(()=>{let e=s.contextMenuElement;if(!e)return;let t=Pi(),n=s.contextMenuPosition??u();return Ri({element:e,filePath:t?.filePath,lineNumber:t?.lineNumber??void 0,tagName:Mi(),componentName:Ni(),position:n,shouldDeferHideContextMenu:!0,onBeforeCopy:()=>{F.clear()},customEnterPromptMode:()=>{Y.clearAll(),Q(),l.clearInputText(),l.enterPromptMode(n,e),Li()}})}),Bi=()=>{setTimeout(()=>{l.hideContextMenu(),Z()},0)},Vi=()=>{if(!ut)return null;let e=ut.getBoundingClientRect(),t=hr(e);return t===`left`||t===`right`?{x:t===`left`?e.right:e.left,y:e.top+e.height/2,edge:t}:{x:e.left+e.width/2,y:t===`top`?e.bottom:e.top,edge:t}},Hi=()=>{let e=Vi();if(e)return e;let t=j.state();return t?{x:t.position.x,y:t.position.y,edge:`bottom`}:null},Ui=(e,t)=>{let n=null,r=()=>{let i=e();i&&t(i),n=we(r)};return r(),()=>{n!==null&&(Oe(n),n=null)}},Wi=()=>{M?.(),M=null,Ze(null)},Gi=()=>{l.hideContextMenu(),Wi(),j.dismiss()},Ki=()=>{Ie()===null?(l.hideContextMenu(),j.isOpen()&&j.closePreservingRenderer(),M?.(),M=Ui(Vi,Ze)):Wi()},qi=e=>{mt({defaultAction:e})},Ji=e=>{let t=s.labelInstances.find(t=>t.id===e);if(!t?.element||!o(t.element))return;let n=t.element,r=G(W(n)),i={x:t.mouseX??r.x,y:r.y},a=t.elements&&t.elements.length>0?t.elements.filter(e=>o(e)):[n];setTimeout(()=>{Wi(),j.isOpen()&&j.closePreservingRenderer(),_()||(l.setWasActivatedByToggle(!0),Jn()),l.setPointer(i),l.setFrozenElements(a),a.length>1&&t.bounds&&l.setFrozenDragRect(cn(t.bounds)),l.freeze(),l.showContextMenu(i,n)},0)};E(()=>{let e=i.store.theme.hue;e===0?fi.style.filter=``:fi.style.filter=`hue-rotate(${e}deg)`}),i.store.theme.enabled&&import(`./renderer-Pwx56AQA.js`).then(({ReactGrabRenderer:e})=>{n||(r=ee(()=>ce(e,{get selectionVisible(){return bi()},get selectionBounds(){return Dn()},get selectionBoundsMultiple(){return Ln()},get selectionShouldSnap(){return s.frozenElements.length>0||In().length>0},get selectionElementsCount(){return s.frozenElements.length},get frozenLabelEntries(){return zn()},get pendingShiftPreviewEntry(){return Bn()??void 0},get selectionFilePath(){return s.selectionFilePath??void 0},get selectionLineNumber(){return s.selectionLineNumber??void 0},get selectionTagName(){return xi()},get selectionComponentName(){return Bt()},get selectionLabelVisible(){return Si()},selectionLabelStatus:`idle`,get selectionArrowNavigationState(){return ti()},onArrowNavigationSelect:Vr,get labelInstances(){return Ti()},get dragVisible(){return Di()},get dragBounds(){return Fn()},get grabbedBoxes(){return Ei()},get mouseX(){return c(()=>s.frozenElements.length>1)()?void 0:Hn()??Vn().x},get isFrozen(){return ne()||_()||Me()},get inputValue(){return s.inputText},get isPromptMode(){return w()},onShowContextMenuInstance:Ji,get onLabelInstanceHoverChange(){return Y.handleHoverChange},get onInputChange(){return l.setInputText},onInputSubmit:()=>void ar(),onToggleExpand:lr,get selectionLabelShakeCount(){return ye()},onConfirmDismiss:sr,get discardPrompt(){return c(()=>!!F.isPendingDismiss())()?{isKeyboardSelection:!0,onConfirm:sr,onCopy:Wr}:de()?{onConfirm:sr,onCancel:cr}:void 0},get toolbarVisible(){return i.store.theme.toolbar.enabled},get isActive(){return _()},onToggleActive:Sr,onActivateAction:xr,get activeActionId(){return q()},get enabled(){return T()},get shakeCount(){return _e()},onToolbarStateChange:e=>{je(e),e.enabled!==T()&&(ge(e.enabled),e.enabled||(Yn(),Gi())),br.forEach(t=>t(e))},onSubscribeToToolbarStateChanges:e=>(br.add(e),()=>{br.delete(e)}),onToolbarSelectHoverChange:Fe,onToolbarRef:e=>{ut=e},get contextMenuPosition(){return ji()},get contextMenuBounds(){return Ai()},get contextMenuTagName(){return Mi()},get contextMenuComponentName(){return Ni()},get contextMenuHasFilePath(){return!!Pi()?.filePath},get actions(){return i.store.actions},get actionContext(){return zi()},onContextMenuDismiss:Bi,onContextMenuHide:Li,get toolbarMenuPosition(){return Ie()},get toolbarMenuActions(){return i.store.actions.filter(e=>e.showInToolbarMenu===!0)},get defaultActionId(){return k()?.defaultAction??`copy`},onSetDefaultAction:qi,onToggleToolbarMenu:Ki,onToolbarMenuDismiss:Wi,get editPanelState(){return j.state()},get editPanelPosition(){return tt()},get onEditPanelDismiss(){return j.dismiss},get onEditPanelSubmit(){return j.submit},get onEditPanelPendingEditsChange(){return j.setPendingEdits},get onEditPanelInteractingChange(){return j.setInteracting}}),fi))}).catch(e=>{console.warn(`[react-grab] Failed to load renderer:`,e)});let Yi={activate:()=>{l.setPendingCommentMode(!1),!_()&&T()&&Qn()},deactivate:()=>{(_()||C())&&Z()},toggle:()=>{_()?Z():T()&&Qn()},comment:Er,isActive:()=>_(),isEnabled:()=>T(),setEnabled:e=>{e!==T()&&(ge(e),mt({enabled:e,collapsed:!e}),e||(Yn(),Gi()))},getToolbarState:()=>le(),setToolbarState:e=>{let t=le(),n=e.collapsed??t?.collapsed??!1,r={edge:e.edge??t?.edge??`bottom`,ratio:e.ratio??t?.ratio??.5,collapsed:n,enabled:e.enabled??!n,defaultAction:e.defaultAction??t?.defaultAction??`copy`};me(r),je(r),r.enabled!==T()&&(ge(r.enabled),r.enabled||(Yn(),Gi())),br.forEach(e=>e(r))},onToolbarStateChange:e=>(br.add(e),()=>{br.delete(e)}),dispose:()=>{n=!0,yr=!1,r?.(),M?.(),M=null,N?.(),N=null,br.clear(),e()},copyElement:async e=>{let t=Array.isArray(e)?e:[e];return t.length===0?!1:await un(t)},getSource:async e=>{let t=await it(e);return t?{filePath:t.filePath,lineNumber:t.lineNumber,componentName:t.componentName}:null},getStackContext:e=>lt(e,{maxLines:i.store.options.maxContextLines}),getState:()=>({isActive:_(),isDragging:b(),isCopying:C(),isPromptMode:w(),isSelectionBoxVisible:!!bi(),isDragBoxVisible:!!Di(),targetElement:X(),dragBounds:Fn()??null,grabbedBoxes:[...Un()],labelInstances:[...Wn()],selectionFilePath:s.selectionFilePath,toolbarState:k()}),setOptions:e=>{i.setOptions(e)},registerPlugin:e=>{i.register(e,Yi)},unregisterPlugin:e=>{i.unregister(e)},getPlugins:()=>i.getPluginNames(),getDisplayName:ct};for(let e of vr)i.register(e,Yi);return setTimeout(()=>{Te(!0)},Qe),Yi})};export{Jn as a,pr as i,_r as n,Q as r,xr as t};
|
|
@@ -48,4 +48,4 @@ const hn=/^(?:\.\/)?\/?\([a-z][a-z0-9-]*\)\//,gn=e=>{let t=zt(e);return t=t.repl
|
|
|
48
48
|
*, *::before, *::after {
|
|
49
49
|
transition: none !important;
|
|
50
50
|
}
|
|
51
|
-
`;let e=[];for(let t of document.getAnimations())ar(t)||e.push(t);ir(e),K=!1}else{for(let e of G)try{e.finish()}catch{try{e.play()}catch{}}G=[]}U.remove(),U=null,nr(W),W=[],qn()}},pr=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],mr=[`focus`,`blur`,`focusin`,`focusout`],hr=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`],gr=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],_r=new Map,vr=new Map,yr=e=>{e.stopImmediatePropagation()},br=e=>{e.preventDefault(),e.stopImmediatePropagation()},xr=(e,t)=>{let n=new Map;for(let r of t){let t=e.style.getPropertyValue(r);t&&n.set(r,t)}return n},Sr=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=e.style.cssText,a=xr(e,t);for(let e of t){let t=r.getPropertyValue(e);t&&(i+=`${e}: ${t} !important; `)}return{element:e,frozenStyles:i,originalPropertyValues:a}},Cr=(e,t)=>{let n=[],r=document.elementFromPoint(e,t);for(;r&&r!==document.documentElement;)r instanceof HTMLElement&&n.push(r),r=r.parentElement;return n},wr=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;)t instanceof HTMLElement&&e.push(t),t=t.shadowRoot?.activeElement??null;return e},Tr=(e,t)=>{for(let{element:n,frozenStyles:r,originalPropertyValues:i}of e)t.set(n,i),n.style.cssText=r},Er=(e,t)=>{for(let[n,r]of e)for(let e of t){let t=r.get(e);t?n.style.setProperty(e,t):n.style.removeProperty(e)}e.clear()},Dr=(e,t)=>{if(Mn())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?Cr(e,t):Array.from(document.querySelectorAll(`:hover`)).filter(e=>e instanceof HTMLElement);for(let e of r){let t=Sr(e,hr);t&&n.push(t)}let i=[];for(let e of wr()){let t=Sr(e,gr,vr);t&&i.push(t)}return{hoverStates:n,focusStates:i}},Or=e=>{if(e){for(let e of pr)document.addEventListener(e,yr,!0);for(let e of mr)document.addEventListener(e,br,!0);Tr(e.hoverStates,_r),Tr(e.focusStates,vr),Nn()}},kr=(e,t)=>{Or(Dr(e,t))},Ar=()=>{Bn();for(let e of pr)document.removeEventListener(e,yr,!0);for(let e of mr)document.removeEventListener(e,br,!0);Er(_r,hr),Er(vr,gr),Pn()},jr=(e,t)=>{};let Y=!1;const Mr=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},Nr=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Ir=new Set,Lr=[],X=[],Z=new WeakMap,Q=new WeakMap,Rr=new WeakSet,zr=Fe,Br=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},Vr=()=>{if(zr.size>0)return zr;let e=new Set,t=n=>{let r=Pe(n);if(r){let t=Br(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},Hr=(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},Ur=e=>{if(!e||Z.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>Y?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,`pending`,{configurable:!0,enumerable:!0,get:()=>Y?null:n,set:e=>{if(Y){e!==null&&(t.bufferedPending=Hr(t.bufferedPending??null,e));return}n=e}}),Z.set(e,t)},Wr=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},Gr=e=>{let t=Z.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=Wr(t.pendingValueAtPause??null),r=Wr(t.bufferedPending??null);for(let t of[...e,...r])X.push(()=>n(t))}Z.delete(e)},Kr=e=>{if(Q.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,`memoizedValue`,{configurable:!0,enumerable:!0,get(){return Y?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(Y){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),Q.set(e,t)},qr=e=>{let t=Q.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,`memoizedValue`,t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),Q.delete(e))},Jr=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Ur(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)Kr(n),n=n.next},Yr=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Gr(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)qr(n),n=n.next},Xr=e=>{let t=e;for(;t;){if(Ee(t)&&Jr(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}},Zr=e=>{let t=e;for(;t;){if(Ee(t)&&Yr(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}},Qr=e=>{if(Nr.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};Nr.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Mr(Pr,a,()=>(...e)=>{Y?X.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Mr(Pr,a,()=>(...e)=>{Y?X.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Mr(Fr,a,()=>e=>{Y?Lr.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>Y?n.useSyncExternalStore(t=>e(()=>{Y?Ir.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},$r=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`&&Qr(r),r),set:e=>{r=e}})},ei=e=>{queueMicrotask(()=>{try{for(let t of h().renderers.values())if(typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch{}}}catch{}})},$=e=>{for(let t of e)try{t()}catch{}},ti=()=>{for(let e of h().renderers.values())Rr.has(e)||($r(e),Rr.add(e))},ni=()=>{if(Y)return()=>{};ti(),Y=!0;let e=Vr();for(let t of e)Xr(t.current);return()=>{if(Y)try{let e=Vr();for(let t of e)Zr(t.current);let t=Array.from(Ir),n=Lr.slice(),r=X.slice();Y=!1,$(t),$(n),$(r),ei(e)}finally{Ir.clear(),Lr.length=0,X.length=0}}};Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return`edit`}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,`At`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,`Bt`,{enumerable:!0,get:function(){return 2147483647}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`Ct`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,`Dt`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,`Et`,{enumerable:!0,get:function(){return`var(--rg-shadow)`}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`Ft`,{enumerable:!0,get:function(){return 8e3}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return 16.666666666666668}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`Ht`,{enumerable:!0,get:function(){return`data-react-grab`}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`It`,{enumerable:!0,get:function(){return 5e3}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return`copy`}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return`comment`}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`Lt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,`Mt`,{enumerable:!0,get:function(){return-9999}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`Nt`,{enumerable:!0,get:function(){return .95}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,`Ot`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,`Pt`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`Rt`,{enumerable:!0,get:function(){return`0.1.47-dev.26647d1`}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`St`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,`Tt`,{enumerable:!0,get:function(){return`var(--rg-panel-bg)`}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`Ut`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`Vt`,{enumerable:!0,get:function(){return 2147483645}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return .2}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return .75}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return .7}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`_t`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return 12e3}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`bt`,{enumerable:!0,get:function(){return .01}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return lr}}),Object.defineProperty(exports,`ct`,{enumerable:!0,get:function(){return`#00000000`}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,`dt`,{enumerable:!0,get:function(){return 1.2}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return 2e3}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return fr}}),Object.defineProperty(exports,`ft`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(exports,`gt`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return zn}}),Object.defineProperty(exports,`ht`,{enumerable:!0,get:function(){return`superellipse(1.25)`}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,`jt`,{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,`kt`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,`lt`,{enumerable:!0,get:function(){return`transparent`}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,`mt`,{enumerable:!0,get:function(){return 1e4}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return 8e3}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,`ot`,{enumerable:!0,get:function(){return 9e3}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,`pt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return 1e7}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return 5e3}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,`st`,{enumerable:!0,get:function(){return`cubic-bezier(0.34, 1.56, 0.64, 1)`}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ni}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return 1e4}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,`ut`,{enumerable:!0,get:function(){return 1500}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`vt`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,`wt`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,`xt`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,`yt`,{enumerable:!0,get:function(){return-1e3}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,`zt`,{enumerable:!0,get:function(){return .01}});
|
|
51
|
+
`;let e=[];for(let t of document.getAnimations())ar(t)||e.push(t);ir(e),K=!1}else{for(let e of G)try{e.finish()}catch{try{e.play()}catch{}}G=[]}U.remove(),U=null,nr(W),W=[],qn()}},pr=[`mouseenter`,`mouseleave`,`mouseover`,`mouseout`,`pointerenter`,`pointerleave`,`pointerover`,`pointerout`],mr=[`focus`,`blur`,`focusin`,`focusout`],hr=[`background-color`,`color`,`border-color`,`box-shadow`,`transform`,`opacity`,`outline`,`filter`,`scale`,`visibility`],gr=[`background-color`,`color`,`border-color`,`box-shadow`,`outline`,`outline-offset`,`outline-width`,`outline-color`,`outline-style`,`filter`,`opacity`,`ring-color`,`ring-width`],_r=new Map,vr=new Map,yr=e=>{e.stopImmediatePropagation()},br=e=>{e.preventDefault(),e.stopImmediatePropagation()},xr=(e,t)=>{let n=new Map;for(let r of t){let t=e.style.getPropertyValue(r);t&&n.set(r,t)}return n},Sr=(e,t,n)=>{if(n?.has(e))return null;let r=getComputedStyle(e),i=e.style.cssText,a=xr(e,t);for(let e of t){let t=r.getPropertyValue(e);t&&(i+=`${e}: ${t} !important; `)}return{element:e,frozenStyles:i,originalPropertyValues:a}},Cr=(e,t)=>{let n=[],r=document.elementFromPoint(e,t);for(;r&&r!==document.documentElement;)r instanceof HTMLElement&&n.push(r),r=r.parentElement;return n},wr=()=>{let e=[],t=document.activeElement;for(;t&&t!==document.body;)t instanceof HTMLElement&&e.push(t),t=t.shadowRoot?.activeElement??null;return e},Tr=(e,t)=>{for(let{element:n,frozenStyles:r,originalPropertyValues:i}of e)t.set(n,i),n.style.cssText=r},Er=(e,t)=>{for(let[n,r]of e)for(let e of t){let t=r.get(e);t?n.style.setProperty(e,t):n.style.removeProperty(e)}e.clear()},Dr=(e,t)=>{if(Mn())return null;let n=[],r=e!==void 0&&t!==void 0&&e>=0&&t>=0&&e<window.innerWidth&&t<window.innerHeight?Cr(e,t):Array.from(document.querySelectorAll(`:hover`)).filter(e=>e instanceof HTMLElement);for(let e of r){let t=Sr(e,hr);t&&n.push(t)}let i=[];for(let e of wr()){let t=Sr(e,gr,vr);t&&i.push(t)}return{hoverStates:n,focusStates:i}},Or=e=>{if(e){for(let e of pr)document.addEventListener(e,yr,!0);for(let e of mr)document.addEventListener(e,br,!0);Tr(e.hoverStates,_r),Tr(e.focusStates,vr),Nn()}},kr=(e,t)=>{Or(Dr(e,t))},Ar=()=>{Bn();for(let e of pr)document.removeEventListener(e,yr,!0);for(let e of mr)document.removeEventListener(e,br,!0);Er(_r,hr),Er(vr,gr),Pn()},jr=(e,t)=>{};let Y=!1;const Mr=(e,t,n)=>{let r=e.get(t);if(r)return r;let i=n();return e.set(t,i),i},Nr=new WeakMap,Pr=new WeakMap,Fr=new WeakMap,Ir=new Set,Lr=[],X=[],Z=new WeakMap,Q=new WeakMap,Rr=new WeakSet,zr=Fe,Br=e=>{let t=e;for(;t.return;)t=t.return;return t.stateNode??null},Vr=()=>{if(zr.size>0)return zr;let e=new Set,t=n=>{let r=Pe(n);if(r){let t=Br(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},Hr=(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},Ur=e=>{if(!e||Z.has(e))return;let t={originalPendingDescriptor:Object.getOwnPropertyDescriptor(e,`pending`),pendingValueAtPause:e.pending,bufferedPending:null};typeof e.getSnapshot==`function`&&(t.originalGetSnapshot=e.getSnapshot,t.snapshotValueAtPause=e.getSnapshot(),e.getSnapshot=()=>Y?t.snapshotValueAtPause:t.originalGetSnapshot());let n=t.pendingValueAtPause;Object.defineProperty(e,`pending`,{configurable:!0,enumerable:!0,get:()=>Y?null:n,set:e=>{if(Y){e!==null&&(t.bufferedPending=Hr(t.bufferedPending??null,e));return}n=e}}),Z.set(e,t)},Wr=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},Gr=e=>{let t=Z.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=Wr(t.pendingValueAtPause??null),r=Wr(t.bufferedPending??null);for(let t of[...e,...r])X.push(()=>n(t))}Z.delete(e)},Kr=e=>{if(Q.has(e))return;let t={originalDescriptor:Object.getOwnPropertyDescriptor(e,`memoizedValue`),frozenValue:e.memoizedValue};Object.defineProperty(e,`memoizedValue`,{configurable:!0,enumerable:!0,get(){return Y?t.frozenValue:t.originalDescriptor?.get?t.originalDescriptor.get.call(this):this._memoizedValue},set(e){if(Y){t.pendingValue=e,t.didReceivePendingValue=!0;return}t.originalDescriptor?.set?t.originalDescriptor.set.call(this,e):this._memoizedValue=e}}),t.originalDescriptor?.get||(e._memoizedValue=t.frozenValue),Q.set(e,t)},qr=e=>{let t=Q.get(e);t&&(t.originalDescriptor?Object.defineProperty(e,`memoizedValue`,t.originalDescriptor):delete e.memoizedValue,t.didReceivePendingValue&&(e.memoizedValue=t.pendingValue),Q.delete(e))},Jr=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Ur(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)Kr(n),n=n.next},Yr=e=>{let t=e.memoizedState;for(;t;)t.queue&&typeof t.queue==`object`&&Gr(t.queue),t=t.next;let n=e.dependencies?.firstContext;for(;n&&typeof n==`object`&&`memoizedValue`in n;)qr(n),n=n.next},Xr=e=>{let t=e;for(;t;){if(Ee(t)&&Jr(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}},Zr=e=>{let t=e;for(;t;){if(Ee(t)&&Yr(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}},Qr=e=>{if(Nr.has(e))return;let t=e,n={useState:t.useState,useReducer:t.useReducer,useTransition:t.useTransition,useSyncExternalStore:t.useSyncExternalStore};Nr.set(e,n),t.useState=(...t)=>{let r=n.useState.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Mr(Pr,a,()=>(...e)=>{Y?X.push(()=>a(...e)):a(...e)})]},t.useReducer=(...t)=>{let r=n.useReducer.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Mr(Pr,a,()=>(...e)=>{Y?X.push(()=>a(...e)):a(...e)})]},t.useTransition=(...t)=>{let r=n.useTransition.apply(e,t);if(!Y||!Array.isArray(r)||typeof r[1]!=`function`)return r;let[i,a]=r;return[i,Mr(Fr,a,()=>e=>{Y?Lr.push(()=>a(e)):a(e)})]},t.useSyncExternalStore=((e,t,r)=>Y?n.useSyncExternalStore(t=>e(()=>{Y?Ir.add(t):t()}),t,r):n.useSyncExternalStore(e,t,r))},$r=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`&&Qr(r),r),set:e=>{r=e}})},ei=e=>{queueMicrotask(()=>{try{for(let t of h().renderers.values())if(typeof t.scheduleUpdate==`function`){for(let n of e)if(n.current)try{t.scheduleUpdate(n.current)}catch{}}}catch{}})},$=e=>{for(let t of e)try{t()}catch{}},ti=()=>{for(let e of h().renderers.values())Rr.has(e)||($r(e),Rr.add(e))},ni=()=>{if(Y)return()=>{};ti(),Y=!0;let e=Vr();for(let t of e)Xr(t.current);return()=>{if(Y)try{let e=Vr();for(let t of e)Zr(t.current);let t=Array.from(Ir),n=Lr.slice(),r=X.slice();Y=!1,$(t),$(n),$(r),ei(e)}finally{Ir.clear(),Lr.length=0,X.length=0}}};Object.defineProperty(exports,`$`,{enumerable:!0,get:function(){return`edit`}}),Object.defineProperty(exports,`A`,{enumerable:!0,get:function(){return Bt}}),Object.defineProperty(exports,`At`,{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,`B`,{enumerable:!0,get:function(){return fe}}),Object.defineProperty(exports,`Bt`,{enumerable:!0,get:function(){return 2147483647}}),Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`Ct`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return gn}}),Object.defineProperty(exports,`Dt`,{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return vn}}),Object.defineProperty(exports,`Et`,{enumerable:!0,get:function(){return`var(--rg-shadow)`}}),Object.defineProperty(exports,`F`,{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,`Ft`,{enumerable:!0,get:function(){return 8e3}}),Object.defineProperty(exports,`G`,{enumerable:!0,get:function(){return 16.666666666666668}}),Object.defineProperty(exports,`H`,{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,`Ht`,{enumerable:!0,get:function(){return`data-react-grab`}}),Object.defineProperty(exports,`I`,{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,`It`,{enumerable:!0,get:function(){return 5e3}}),Object.defineProperty(exports,`J`,{enumerable:!0,get:function(){return`copy`}}),Object.defineProperty(exports,`K`,{enumerable:!0,get:function(){return`comment`}}),Object.defineProperty(exports,`L`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`Lt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`M`,{enumerable:!0,get:function(){return zt}}),Object.defineProperty(exports,`Mt`,{enumerable:!0,get:function(){return-9999}}),Object.defineProperty(exports,`N`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`Nt`,{enumerable:!0,get:function(){return .95}}),Object.defineProperty(exports,`O`,{enumerable:!0,get:function(){return Ft}}),Object.defineProperty(exports,`Ot`,{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,`P`,{enumerable:!0,get:function(){return yt}}),Object.defineProperty(exports,`Pt`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`Q`,{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,`R`,{enumerable:!0,get:function(){return Pe}}),Object.defineProperty(exports,`Rt`,{enumerable:!0,get:function(){return`0.1.47-dev.2be1b9a`}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`St`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return yn}}),Object.defineProperty(exports,`Tt`,{enumerable:!0,get:function(){return`var(--rg-panel-bg)`}}),Object.defineProperty(exports,`U`,{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,`Ut`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`V`,{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,`Vt`,{enumerable:!0,get:function(){return 2147483645}}),Object.defineProperty(exports,`W`,{enumerable:!0,get:function(){return .2}}),Object.defineProperty(exports,`X`,{enumerable:!0,get:function(){return .75}}),Object.defineProperty(exports,`Y`,{enumerable:!0,get:function(){return .7}}),Object.defineProperty(exports,`Z`,{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`_t`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return kr}}),Object.defineProperty(exports,`at`,{enumerable:!0,get:function(){return 12e3}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`bt`,{enumerable:!0,get:function(){return .01}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return lr}}),Object.defineProperty(exports,`ct`,{enumerable:!0,get:function(){return`#00000000`}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return dr}}),Object.defineProperty(exports,`dt`,{enumerable:!0,get:function(){return 1.2}}),Object.defineProperty(exports,`et`,{enumerable:!0,get:function(){return 2e3}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return fr}}),Object.defineProperty(exports,`ft`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return Rn}}),Object.defineProperty(exports,`gt`,{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return zn}}),Object.defineProperty(exports,`ht`,{enumerable:!0,get:function(){return`superellipse(1.25)`}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return Dr}}),Object.defineProperty(exports,`it`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`j`,{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,`jt`,{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,`k`,{enumerable:!0,get:function(){return Nt}}),Object.defineProperty(exports,`kt`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return or}}),Object.defineProperty(exports,`lt`,{enumerable:!0,get:function(){return`transparent`}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return Bn}}),Object.defineProperty(exports,`mt`,{enumerable:!0,get:function(){return 1e4}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return jr}}),Object.defineProperty(exports,`nt`,{enumerable:!0,get:function(){return 8e3}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return Ar}}),Object.defineProperty(exports,`ot`,{enumerable:!0,get:function(){return 9e3}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return Hn}}),Object.defineProperty(exports,`pt`,{enumerable:!0,get:function(){return .5}}),Object.defineProperty(exports,`q`,{enumerable:!0,get:function(){return 1e7}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return Or}}),Object.defineProperty(exports,`rt`,{enumerable:!0,get:function(){return 5e3}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return ur}}),Object.defineProperty(exports,`st`,{enumerable:!0,get:function(){return`cubic-bezier(0.34, 1.56, 0.64, 1)`}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return ni}}),Object.defineProperty(exports,`tt`,{enumerable:!0,get:function(){return 1e4}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return cr}}),Object.defineProperty(exports,`ut`,{enumerable:!0,get:function(){return 1500}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`vt`,{enumerable:!0,get:function(){return 1e3}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return Cn}}),Object.defineProperty(exports,`wt`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return Tn}}),Object.defineProperty(exports,`xt`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return jn}}),Object.defineProperty(exports,`yt`,{enumerable:!0,get:function(){return-1e3}}),Object.defineProperty(exports,`z`,{enumerable:!0,get:function(){return Ee}}),Object.defineProperty(exports,`zt`,{enumerable:!0,get:function(){return .01}});
|
|
@@ -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
|
-
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=`data-react-grab`,a=`0.1.47-dev.
|
|
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=`data-react-grab`,a=`0.1.47-dev.2be1b9a`,o=`var(--rg-panel-bg)`,s=`var(--rg-shadow)`,c=-1e3,l=.95,u=1500,ee=[`/components/ui/`,`/packages/ui/`,`/design-system/`,`/design-systems/`,`/primitives/`],te=5e3,ne=8e3,re=1e4,ie=2147483647,ae=2147483645,oe=.7,se=1e3/60,ce=.5,le=.01,ue=r(.4),de=r(.05),fe=r(.5),pe=r(.08),me=r(.15),he=.2,ge=[`id`,`class`,`aria-label`,`data-testid`,`role`,`name`,`title`],_e=new Set([`id`,`data-testid`,`aria-label`,`href`,`src`,`alt`,`type`,`name`,`placeholder`,`role`,`for`,`action`,`method`,`title`,`disabled`,`checked`,`readonly`,`required`,`selected`,`open`]),ve=new Set([`a`,`code`,`pre`]),ye=new Set([`script`,`style`,`template`,`noscript`]),be=[`Meta`,`Control`,`Shift`,`Alt`],xe=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`]),d=`data-react-grab-frozen`,Se=.5,Ce=`copy`,we=`comment`,Te=`edit`,Ee=`superellipse(1.25)`,De=.75,Oe=.01,ke=1e3,Ae={left:-9999,top:-9999},je={left:`left center`,right:`right center`,top:`center top`,bottom:`center bottom`},Me=1e3,Ne=`#00000000`,Pe=`transparent`,Fe=2e3,Ie=`cubic-bezier(0.34, 1.56, 0.64, 1)`,Le=12e3,Re=9e3,ze=1e4,Be=8e3,Ve=5e3,He=1e3,Ue=1e7,We=1.2,Ge=-9999,Ke=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(`.`)),qe=e=>(e.tagName||``).toLowerCase();let Je;const Ye=()=>{if(Je!==void 0)return Je;let e=document.querySelector(`script[nonce], style[nonce]`),t=e?.nonce||e?.getAttribute(`nonce`)||null;return t&&(Je=t),t},Xe=[[`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`,``]],Ze=e=>{for(let[t,n]of Xe)e.setAttribute(t,n);e.setAttribute(`data-testid`,`react-grab-overlay`),e.classList.add(`ph-no-capture`)},Qe=`bippy-0.5.42`,$e=Object.defineProperty,et=Object.prototype.hasOwnProperty,f=()=>{},tt=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{}},nt=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>!!(e&&`getFiberRoots`in e);let rt=!1,it;const at=(e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__)=>rt?!0:(e&&typeof e.inject==`function`&&(it=e.inject.toString()),!!it?.includes(`(injected)`)),p=new Set,m=new Set,ot=e=>{let t=new Map,n=0,r={_instrumentationIsActive:!1,_instrumentationSource:Qe,checkDCE:tt,hasUnsupportedRendererAttached:!1,inject(e){let i=++n;return t.set(i,e),m.add(e),r._instrumentationIsActive||(r._instrumentationIsActive=!0,p.forEach(e=>e())),i},on:f,onCommitFiberRoot:f,onCommitFiberUnmount:f,onPostCommitFiberRoot:f,renderers:t,supportsFiber:!0,supportsFlight:!0};try{$e(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`,{configurable:!0,enumerable:!0,get(){return r},set(t){if(t&&typeof t==`object`){let n=r.renderers;r=t,n.size>0&&(n.forEach((e,n)=>{m.add(e),t.renderers.set(n,e)}),st(e))}}});let t=window.hasOwnProperty,n=!1;$e(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{st(e)}return r},st=e=>{e&&p.add(e);try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=tt,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=Qe,t._instrumentationIsActive=!1;let e=nt(t);if(e||(t.on=f),t.renderers.size){t._instrumentationIsActive=!0,p.forEach(e=>e());return}let n=t.inject,r=at(t);r&&!e&&(rt=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=e=>{let i=n(e);return m.add(e),r&&t.renderers.set(i,e),t._instrumentationIsActive=!0,p.forEach(e=>e()),i}}(t.renderers.size||t._instrumentationIsActive||at())&&e?.()}catch{}},ct=()=>et.call(globalThis,`__REACT_DEVTOOLS_GLOBAL_HOOK__`),h=e=>ct()?(st(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):ot(e),lt=()=>!!(typeof window<`u`&&(window.document?.createElement||window.navigator?.product===`ReactNative`)),ut=()=>{try{lt()&&h()}catch{}},dt=e=>{switch(e.tag){case 1:case 11:case 0:case 14:case 15:return!0;default:return!1}};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},g=e=>{let t=e;if(typeof t==`string`)return t;if(typeof t!=`function`&&!(typeof t==`object`&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=ht(t);return r&&(r.displayName||r.name)||null},gt=()=>{let e=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;return!!e?._instrumentationIsActive||nt(e)||at(e)},_t=e=>Object.prototype.toString.call(e)===`[object Object]`&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null),vt=(e,t=[])=>{if(!_t(e))return[{path:t,value:e}];let n=[];for(let r in e){let i=e[r],a=t.concat(r);_t(i)?n.push(...vt(i,a)):n.push({path:a,value:i})}return n},yt=e=>{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t?.renderers)for(let n of t.renderers.values())try{let t=n.findFiberByHostInstance?.(e);if(t)return t}catch{}if(typeof e==`object`&&e){if(`_reactRootContainer`in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let t in e)if(t.startsWith(`__reactContainer$`)||t.startsWith(`__reactInternalInstance$`)||t.startsWith(`__reactFiber`))return e[t]||null}return null},bt=new Set,xt=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,St=[`rsc://`,`file:///`,`webpack-internal://`,`webpack://`,`node:`,`turbopack://`,`metro://`,`/app-pages-browser/`,`/(app-pages-browser)/`],Ct=[`<anonymous>`,`eval`,``],wt=/\.(jsx|tsx|ts|js)$/,Tt=/(\.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,Et=/^\?[\w~.-]+(?:=[^&#]*)?(?:&[\w~.-]+(?:=[^&#]*)?)*$/,Dt=/\(at [^)]+\)$/,Ot=/(^|@)\S+:\d+/,kt=/^\s*at .*(\S+:\d+|\(native\))/m,At=/^(eval@)?(\[native code\])?$/,jt=(e,t)=>{if(t?.includeInElement!==!1){let n=e.split(`
|
|
10
10
|
`),r=[];for(let e of n)if(/^\s*at\s+/.test(e)){let t=Pt(e,void 0)[0];t&&r.push(t)}else if(/^\s*in\s+/.test(e)){let t=e.replace(/^\s*in\s+/,``).replace(/\s*\(at .*\)$/,``);r.push({functionName:t,source:e})}else if(e.match(Ot)){let t=Ft(e,void 0)[0];t&&r.push(t)}return Nt(r,t)}return e.match(kt)?Pt(e,t):Ft(e,t)},Mt=e=>{if(!e.includes(`:`))return[e,void 0,void 0];let t=e.startsWith(`(`)&&/:\d+\)$/.test(e)?e.slice(1,-1):e,n=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t);return n?[n[1],n[2]||void 0,n[3]||void 0]:[t,void 0,void 0]},Nt=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,Pt=(e,t)=>Nt(e.split(`
|
|
11
11
|
`).filter(e=>!!e.match(kt)),t).map(e=>{let t=e;t.includes(`(eval `)&&(t=t.replace(/eval code/g,`eval`).replace(/(\(eval at [^()]*)|(,.*$)/g,``));let n=t.replace(/^\s+/,``).replace(/\(eval code/g,`(`).replace(/^.*?\s+/,``),r=n.match(/ (\(.+\)$)/);n=r?n.replace(r[0],``):n;let i=Mt(r?r[1]:n);return{functionName:r&&n||void 0,fileName:[`eval`,`<anonymous>`].includes(i[0])?void 0:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}),Ft=(e,t)=>Nt(e.split(`
|
|
12
12
|
`).filter(e=>!e.match(At)),t).map(e=>{let t=e;if(t.includes(` > eval`)&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,`:$1`)),!t.includes(`@`)&&!t.includes(`:`))return{functionName:t};{let e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=t.match(e),r=n&&n[1]?n[1]:void 0,i=Mt(t.replace(e,``));return{functionName:r,fileName:i[0],lineNumber:i[1]?+i[1]:void 0,columnNumber:i[2]?+i[2]:void 0,source:t}}});var It=44,Lt=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Rt=new Uint8Array(64),zt=new Uint8Array(128);for(let e=0;e<Lt.length;e++){let t=Lt.charCodeAt(e);Rt[e]=t,zt[t]=e}function _(e,t){let n=0,r=0,i=0;do i=zt[e.next()],n|=(i&31)<<r,r+=5;while(i&32);let a=n&1;return n>>>=1,a&&(n=-2147483648|-n),t+n}function Bt(e,t){return e.pos>=t?!1:e.peek()!==It}var Vt=class{constructor(e){this.pos=0,this.buffer=e}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(e){let{buffer:t,pos:n}=this,r=t.indexOf(e,n);return r===-1?t.length:r}};function Ht(e){let{length:t}=e,n=new Vt(e),r=[],i=0,a=0,o=0,s=0,c=0;do{let e=n.indexOf(`;`),t=[],l=!0,u=0;for(i=0;n.pos<e;){let r;i=_(n,i),i<u&&(l=!1),u=i,Bt(n,e)?(a=_(n,a),o=_(n,o),s=_(n,s),Bt(n,e)?(c=_(n,c),r=[i,a,o,s,c]):r=[i,a,o,s]):r=[i],t.push(r),n.pos++}l||Ut(t),r.push(t),n.pos=e+1}while(n.pos<=t);return r}function Ut(e){e.sort(Wt)}function Wt(e,t){return e[0]-t[0]}const Gt=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,Kt=/^data:application\/json[^,]+base64,/,qt=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,v=new Map,y=new Map,Jt=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let i=e[n];if(!i||i.length===0)return null;let a=null;for(let e of i)if(e[0]<=r)a=e;else break;if(!a||a.length<4)return null;let[,o,s,c]=a;if(o===void 0||s===void 0||c===void 0)return null;let l=t[o];return l?{columnNumber:c,fileName:l,lineNumber:s+1}:null},Yt=(e,t,n)=>{if(e.sections){let r=null;for(let i of e.sections)if(t>i.offset.line||t===i.offset.line&&n>=i.offset.column)r=i;else break;if(!r)return null;let i=t-r.offset.line,a=t===r.offset.line?n-r.offset.column:n;return Jt(r.map.mappings,r.map.sources,i,a)}return Jt(e.mappings,e.sources,t-1,n)},Xt=(e,t)=>{let n=t.split(`
|
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-
|
|
9
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./core-B8Mv580_.cjs`),t=require(`./freeze-updates-BrD6urbz.cjs`),n=require(`./copy-content-B1_QAMt0.cjs`);let r=null;const i=()=>typeof window>`u`?r:window.__REACT_GRAB__??r??null,a=e=>{r=e,typeof window<`u`&&(e?window.__REACT_GRAB__=e:delete window.__REACT_GRAB__)},o=[],s=e=>{for(;o.length>0;){let t=o.shift();t&&e.registerPlugin(t)}},c=e=>{let t=i();if(t){t.registerPlugin(e);return}o.push(e)},l=e=>{let t=i();if(t){t.unregisterPlugin(e);return}let n=o.findIndex(t=>t.name===e);n!==-1&&o.splice(n,1)};typeof window<`u`&&!window.__REACT_GRAB_DISABLED__&&(window.__REACT_GRAB__?r=window.__REACT_GRAB__:(r=e.t(),window.__REACT_GRAB__=r),s(r),window.dispatchEvent(new CustomEvent(`react-grab:init`,{detail:r}))),exports.DEFAULT_THEME=e.a,exports.commentPlugin=e.i,exports.formatElementInfo=n.n,exports.generateSnippet=e.n,exports.getGlobalApi=i,exports.getStack=n.o,exports.init=e.t,exports.isInstrumentationActive=t.I,exports.openPlugin=e.r,exports.registerPlugin=c,exports.setGlobalApi=a,exports.unregisterPlugin=l;
|