react-reinspect 0.1.8 → 0.1.9

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.
@@ -1 +0,0 @@
1
- let e=require(`react`),t=require(`react/jsx-runtime`),n=require(`react-dom`);var r=(0,e.createContext)(null),i=[`backgroundColor`,`color`,`fontSize`,`padding`,`margin`,`borderRadius`,`borderWidth`,`borderColor`,`opacity`,`width`,`height`,`gap`],a=[`#f97316`,`#2563eb`,`#16a34a`,`#db2777`,`#ca8a04`,`#0f766e`],o=new Set([`backgroundColor`,`color`,`borderColor`]),s=new Set([`fontSize`,`padding`,`margin`,`borderRadius`,`borderWidth`,`width`,`height`,`gap`]),c=2147483e3,l=`reinspect.inspectMode`,u=[`wrapped`,`first-party`,`all`],d=[`off`,`attempts`,`commits`,`both`],f=!1;function p(){f||typeof console>`u`||(f=!0,console.warn("[react-reinspect] `shouldCountRenders` and `renderCaptureMode` are deprecated. Use `renderCounters` instead."))}function m(e){return typeof e==`string`&&u.includes(e)}function h(e){return typeof e==`string`&&d.includes(e)}function g(){if(!(typeof window>`u`))try{let e=window.sessionStorage.getItem(l);return m(e)?e:void 0}catch{return}}function _(e){return g()||(m(e)?e:`wrapped`)}function v(e){if(!(typeof window>`u`))try{window.sessionStorage.setItem(l,e)}catch{}}function y(){if(!(typeof window>`u`))try{window.location.reload()}catch{}}function b(e){return h(e.renderCounters)?e.renderCounters:((e.shouldCountRenders!==void 0||e.renderCaptureMode!==void 0)&&p(),e.shouldCountRenders===!1?`off`:e.shouldCountRenders===!0?e.renderCaptureMode??`attempts`:e.renderCaptureMode?e.renderCaptureMode:`off`)}function x(e={}){let t=e.enabled??!1,n=e.editableProps&&e.editableProps.length>0?e.editableProps:i,r=e.palette&&e.palette.length>0?e.palette:a;return{enabled:t,startActive:e.startActive??!0,showFloatingToggle:e.showFloatingToggle??t,inspectMode:_(e.inspectMode),editableProps:n,palette:r,zIndexBase:e.zIndexBase??c,renderCounters:b(e),countRendersForComponents:e.countRendersForComponents??[]}}function ee(e){let t=0;for(let n=0;n<e.length;n+=1)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t)}function S(e,t){return t.length===0?a[0]??`#f97316`:t[ee(e)%t.length]??`#f97316`}function te(e,t){if(!e)return{};let n={};for(let r of t){let t=e[r];t==null||t===``||(n[r]=t)}return n}function ne(e){if(!e)return`#1f2937`;if(/^#[0-9a-fA-F]{6}$/.test(e))return e;if(/^#[0-9a-fA-F]{3}$/.test(e)){let[,t=`0`,n=`0`,r=`0`]=e;return`#${t}${t}${n}${n}${r}${r}`}return`#1f2937`}function re(e){let t=Number(e);if(Number.isFinite(t))return t}var C=4,w=40,T=40,E=`__reinspect_placeholder__`;function D(e,t){return{[E]:e,display:t}}function O(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ie(e){if(!O(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function k(e){return O(e)&&typeof e.__reinspect_placeholder__==`string`&&typeof e.display==`string`}function A(e){try{return JSON.stringify(e,null,2)}catch{return null}}function j(e){try{let t=Function.prototype.toString.call(e);return typeof t!=`string`||t.trim().length===0?`[Function source unavailable]`:t}catch{return`[Function source unavailable]`}}function M(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=120?t:`${t.slice(0,117)}...`}function N(e,t,n){if(n>C)return D(`truncated`,`[Max depth reached]`);if(e===null)return null;let r=typeof e;if(r===`string`||r===`boolean`)return e;if(r===`number`)return Number.isFinite(e)?e:D(`non-finite-number`,String(e));if(r===`undefined`)return D(`undefined`,`undefined`);if(r===`bigint`)return D(`bigint`,`${String(e)}n`);if(r===`symbol`)return D(`symbol`,String(e));if(r===`function`)return D(`function`,`[Function ${e.name||`anonymous`}]`);if(e instanceof Date)return D(`date`,Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString());if(e instanceof RegExp)return D(`regexp`,e.toString());if(r===`object`){let r=e;if(t.has(r))return D(`circular`,`[Circular]`);if(t.add(r),Array.isArray(e)){let i=[],a=Math.min(e.length,T);for(let r=0;r<a;r+=1)i.push(N(e[r],t,n+1));return e.length>T&&i.push(D(`truncated`,`${e.length-T} more items`)),t.delete(r),i}let i={},a=Object.entries(e),o=Math.min(a.length,w);for(let e=0;e<o;e+=1){let r=a[e];if(!r)continue;let[o,s]=r;i[o]=N(s,t,n+1)}return a.length>w&&(i.__reinspect_truncated__=D(`truncated`,`${a.length-w} more keys`)),t.delete(r),i}return D(`unsupported`,`[Unsupported value]`)}function P(e){if(e===null)return{kind:`null`,summary:`null`,copyText:`null`};let t=typeof e;if(t===`undefined`)return{kind:`undefined`,summary:`undefined`,copyText:`undefined`};if(t===`boolean`)return{kind:`boolean`,summary:String(e),copyText:String(e)};if(t===`number`)return{kind:`number`,summary:String(e),copyText:String(e)};if(t===`string`)return{kind:`string`,summary:JSON.stringify(e),copyText:String(e)};if(t===`bigint`)return{kind:`bigint`,summary:`${String(e)}n`,copyText:`${String(e)}n`};if(t===`symbol`){let t=String(e);return{kind:`symbol`,summary:t,copyText:t}}if(t===`function`){let t=e,n=j(t),r=t.name||`anonymous`;return{kind:`function`,summary:`Function ${r}(${t.length})`,copyText:n,functionMeta:{name:r,arity:t.length,preview:M(n),source:n}}}if(e instanceof Date){let t=Number.isNaN(e.getTime())?`Invalid Date`:e.toISOString();return{kind:`date`,summary:`Date ${t}`,copyText:t}}if(e instanceof RegExp){let t=e.toString();return{kind:`regexp`,summary:t,copyText:t}}return Array.isArray(e)?{kind:`array`,summary:`Array(${e.length})`}:O(e)?{kind:`object`,summary:`Object(${Object.keys(e).length})`}:{kind:`unknown`,summary:String(e)}}function F(e){if(!k(e)){if(Array.isArray(e)){let t=[];for(let n of e){let e=F(n);if(e===void 0)return;t.push(e)}return t}if(O(e)){let t={};for(let[n,r]of Object.entries(e)){let e=F(r);e!==void 0&&(t[n]=e)}return t}return e}}function ae(e){return Object.keys(e).map(t=>({key:t,value:P(e[t])}))}function oe(e){return A(N(e,new WeakSet,0))??`{}`}function se(e){return A(N(e,new WeakSet,0))}function I(e){if(e===null)return!0;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||Array.isArray(e)?!0:ie(e)}function ce(e){let t=e.trim();if(t.length===0)return{parsed:null,error:`Value JSON cannot be empty.`};try{let e=F(JSON.parse(t));return e===void 0||!I(e)?{parsed:null,error:`Only objects, arrays, and primitive JSON values are editable.`}:{parsed:e,error:null}}catch{return{parsed:null,error:`Invalid JSON. Fix syntax and try Apply again.`}}}function le(e){let t=e.trim();if(t.length===0)return{parsed:{},error:null};try{let e=JSON.parse(t);if(typeof e!=`object`||!e||Array.isArray(e))return{parsed:null,error:`Props JSON must be an object (example: {"title":"Demo"}).`};let n={};for(let[t,r]of Object.entries(e)){let e=F(r);e!==void 0&&(n[t]=e)}return{parsed:n,error:null}}catch{return{parsed:null,error:`Invalid JSON. Fix syntax and try Apply again.`}}}var L=Symbol.for(`reinspect.wrapped`);function R(e){return e[L]}function z(e,t){e[L]=t}var B={attempts:0,commits:0},V=new Map,H=new Map;function U(e){let t=V.get(e);if(t)return t;let n={attempts:0,commits:0};return V.set(e,n),n}function W(e){let t=H.get(e);if(t)for(let e of t)e()}function ue(e){let t=U(e);V.set(e,{attempts:t.attempts+1,commits:t.commits+1}),W(e)}function de(e){return V.get(e)||B}function fe(e){V.delete(e),W(e)}function pe(e,t){let n=H.get(e);return n?n.add(t):H.set(e,new Set([t])),()=>{let n=H.get(e);n&&(n.delete(t),n.size===0&&H.delete(e))}}function G(t){return(0,e.useSyncExternalStore)((0,e.useCallback)(e=>pe(t,e),[t]),(0,e.useCallback)(()=>de(t),[t]),()=>B)}function me(e,t){return t===`commits`?`${e.commits} commits`:t===`both`?`${e.attempts} attempts | ${e.commits} commits`:`${e.attempts} attempts`}function he({value:e,onCopy:n}){if(e.kind===`function`&&e.functionMeta){let r=e.functionMeta;return(0,t.jsxs)(`div`,{className:`reinspect-prop-function`,children:[(0,t.jsx)(`code`,{children:e.summary}),(0,t.jsx)(`pre`,{children:r.preview}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>n(r.source,`Function source`),disabled:!r.source,children:`Copy function source`})]})}return(0,t.jsxs)(`div`,{className:`reinspect-prop-scalar`,children:[(0,t.jsx)(`code`,{children:e.summary}),e.copyText?(0,t.jsx)(`button`,{type:`button`,onClick:()=>n(e.copyText??``,`Value`),children:`Copy`}):null]})}function ge({instanceId:e,counterMode:n}){return(0,t.jsx)(t.Fragment,{children:me(G(e),n)})}var _e={enabled:!1,startActive:!1,showFloatingToggle:!1,inspectMode:`wrapped`,editableProps:[],palette:[],zIndexBase:0,renderCounters:`off`,countRendersForComponents:[]},K=0;function ve(e){return K+=1,`${e}-${K.toString(36)}`}function q(e){let t=e.replace(/([A-Z])/g,` $1`).trim(),n=t.slice(0,1);return t.length>0?n.toUpperCase()+t.slice(1):e}function ye(e){return e.trim().toLowerCase().replace(/[\s_-]+/g,``)}function J(e){return e!=null&&e!==``}function be(e){return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}async function xe(e){if(typeof navigator>`u`||!navigator.clipboard?.writeText)return!1;try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}function Se(e,t){return t?.componentName?.trim()||e.displayName?.trim()||e.name?.trim()||t?.fallbackName?.trim()||`Component`}function Ce(e,t,n){return e===`manual`||n===`all`||n===`first-party`&&t===`first-party`}function we(i,a){let c=a?.source??`manual`,l=a?.scope??`first-party`,u=R(i);if(u&&c===`auto`)return i;let d=u&&c===`manual`?u.original:i,f=Se(d,a);function p(i){let a=(0,e.useRef)(null),u=(0,e.useRef)(null),p=(0,e.useRef)(null),[m,h]=(0,e.useState)(null),[g,_]=(0,e.useState)(`css`),[v,y]=(0,e.useState)(`detected`),[b,x]=(0,e.useState)(``),[ee,S]=(0,e.useState)({}),[C,w]=(0,e.useState)(`{}`),[T,E]=(0,e.useState)(null),[D,O]=(0,e.useState)(null),[ie,k]=(0,e.useState)({}),[A,j]=(0,e.useState)({}),[M,N]=(0,e.useState)({}),[P,F]=(0,e.useState)(null),[L,R]=(0,e.useState)(``),[z,B]=(0,e.useState)(null),V=(0,e.useContext)(r),H=!!V,U=V?.config??_e,W=V?.getBorderColor??(()=>`#f97316`),de=V?.isActive??!1,pe=V?.inspectMode??`wrapped`,G=V?.renderCounterMode??_e.renderCounters,me=V?.overrides??{},K=V?.updateOverride??(()=>void 0),Se=V?.renderCountComponents??{},we=V?.setRenderCountingForComponent??(()=>void 0),Te=V?.isRenderCountingEnabledFor??(()=>!1);a.current||=ve(f);let Y=a.current,Ee=W(f),De=Ce(c,l,pe),X=U.enabled&&de&&De,Oe=X&&Te(f),ke=!!Se[f],Ae=G!==`off`,je=G===`off`?`attempts`:G,Z=Oe,Me=me[Y],Ne=X?te(Me,U.editableProps):{},Q={...i,...ee},Pe=Q,$=X&&m!==null,Fe=ye(b),Ie=Fe.length===0?U.editableProps:U.editableProps.filter(e=>ye(e).includes(Fe)),Le=$&&g===`props`&&v===`detected`?ae(Pe):[],Re=(0,e.useRef)(Z);(0,e.useEffect)(()=>{Re.current=Z},[Z]);let ze=(0,e.useMemo)(()=>(e,t)=>{t===`mount`||!Re.current||ue(Y)},[Y]);(0,e.useEffect)(()=>()=>{fe(Y)},[Y]),(0,e.useEffect)(()=>{if(!$)return;let e=e=>{let t=e.target;u.current?.contains(t)||p.current?.contains(t)||(h(null),F(null),R(``),B(null))},t=e=>{if(e.key===`Escape`){if(P){F(null),R(``),B(null);return}h(null)}};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[P,$]),(0,e.useEffect)(()=>{if(!D)return;let e=globalThis.setTimeout(()=>{O(null)},1400);return()=>{globalThis.clearTimeout(e)}},[D]);let Be={"--reinspect-color":Ee,"--reinspect-z-base":U.zIndexBase},Ve=e=>{X&&(e.preventDefault(),_(`css`),y(`detected`),x(``),E(null),O(null),k({}),j({}),N({}),F(null),R(``),B(null),w(`{}`),h({x:e.clientX,y:e.clientY}))},He=()=>{let{parsed:e,error:t}=le(C);if(t||!e){E(t);return}S(e),E(null)},Ue=()=>{S({}),v===`raw`&&w(oe(i)),E(null)},We=(e,t)=>{xe(e).then(e=>{O(e?`${t} copied.`:`Clipboard access is unavailable.`)})},Ge=(e,t)=>{if(M[e]){N(t=>({...t,[e]:!1}));return}if(!(e in ie)&&!(e in A)){let n=se(t);n===null?j(t=>({...t,[e]:`JSON preview is unavailable for this value.`})):k(t=>({...t,[e]:n}))}N(t=>({...t,[e]:!0}))},Ke=(e,t)=>{if(!I(t))return;let n=se(t);if(n===null){O(`Unable to open editor for this value.`);return}F(e),R(n),B(null)},qe=()=>{if(!P)return;let{parsed:e,error:t}=ce(L);if(t||e===null){B(t);return}S(t=>({...t,[P]:e})),F(null),R(``),B(null)},Je=$?(0,t.jsxs)(`div`,{ref:u,className:`reinspect-menu`,role:`dialog`,"aria-label":`${f} inspector controls`,style:{top:`${m.y}px`,left:`${m.x}px`},children:[(0,t.jsxs)(`p`,{className:`reinspect-menu-title`,children:[f,` inspector`]}),(0,t.jsxs)(`label`,{className:`reinspect-menu-component-setting`,children:[(0,t.jsx)(`span`,{children:`Capture renders for this component`}),(0,t.jsx)(`input`,{type:`checkbox`,checked:Ae?!0:ke,onChange:e=>we(f,e.currentTarget.checked),disabled:Ae,"aria-label":`Capture renders for ${f}`,"data-testid":`reinspect-component-render-toggle-${f}`})]}),Ae?(0,t.jsx)(`p`,{className:`reinspect-setting-note`,children:`Global capture is enabled from Reinspect settings.`}):null,(0,t.jsxs)(`div`,{className:`reinspect-submenu`,children:[(0,t.jsx)(`button`,{type:`button`,"data-state":g===`css`?`active`:`idle`,onClick:()=>_(`css`),children:`CSS`}),(0,t.jsx)(`button`,{type:`button`,"data-state":g===`props`?`active`:`idle`,onClick:()=>_(`props`),children:`Props`})]}),g===`css`?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(`div`,{className:`reinspect-menu-filter`,children:[(0,t.jsx)(`span`,{className:`reinspect-menu-filter-icon`,"aria-hidden":`true`,children:(0,t.jsx)(`svg`,{viewBox:`0 0 24 24`,focusable:`false`,children:(0,t.jsx)(`path`,{d:`M10.5 3a7.5 7.5 0 015.92 12.1l4.24 4.23a1 1 0 01-1.42 1.42l-4.23-4.24A7.5 7.5 0 1110.5 3zm0 2a5.5 5.5 0 100 11 5.5 5.5 0 000-11z`,fill:`currentColor`})})}),(0,t.jsx)(`input`,{id:`${Y}-css-filter`,"data-testid":`reinspect-css-filter-input`,type:`search`,value:b,placeholder:`Filter`,"aria-label":`Filter CSS properties`,onChange:e=>x(e.currentTarget.value)})]}),(0,t.jsx)(`div`,{className:`reinspect-menu-grid`,children:Ie.map(e=>{let n=Me?.[e],r=`${Y}-${e}`;if(o.has(e)){let i=typeof n==`string`?ne(n):`#1f2937`;return(0,t.jsxs)(`div`,{className:`reinspect-field`,children:[(0,t.jsx)(`label`,{htmlFor:r,children:q(e)}),(0,t.jsxs)(`div`,{className:`reinspect-inline-controls`,children:[(0,t.jsx)(`input`,{id:r,type:`color`,value:i,onChange:t=>K(Y,e,t.currentTarget.value)}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>K(Y,e,void 0),disabled:!J(n),children:`reset`})]})]},e)}if(e===`opacity`){let i=typeof n==`number`?n:1;return(0,t.jsxs)(`div`,{className:`reinspect-field`,children:[(0,t.jsx)(`label`,{htmlFor:r,children:`Opacity`}),(0,t.jsxs)(`div`,{className:`reinspect-inline-controls reinspect-opacity-controls`,children:[(0,t.jsx)(`input`,{id:r,type:`range`,min:`0`,max:`1`,step:`0.05`,value:i,onChange:t=>{let n=re(t.currentTarget.value);n!==void 0&&K(Y,e,n)}}),(0,t.jsx)(`output`,{children:i.toFixed(2)}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>K(Y,e,void 0),disabled:!J(n),children:`reset`})]})]},e)}if(s.has(e)){let i=typeof n==`number`?n:``;return(0,t.jsxs)(`div`,{className:`reinspect-field`,children:[(0,t.jsxs)(`label`,{htmlFor:r,children:[q(e),` (px)`]}),(0,t.jsxs)(`div`,{className:`reinspect-inline-controls`,children:[(0,t.jsx)(`input`,{id:r,type:`number`,step:`1`,value:i,onChange:t=>{if(t.currentTarget.value===``){K(Y,e,void 0);return}let n=re(t.currentTarget.value);n!==void 0&&K(Y,e,n)}}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>K(Y,e,void 0),disabled:!J(n),children:`reset`})]})]},e)}return(0,t.jsxs)(`div`,{className:`reinspect-field`,children:[(0,t.jsx)(`label`,{htmlFor:r,children:q(e)}),(0,t.jsxs)(`div`,{className:`reinspect-inline-controls`,children:[(0,t.jsx)(`input`,{id:r,type:`text`,value:typeof n==`string`?n:``,onChange:t=>K(Y,e,t.currentTarget.value||void 0)}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>K(Y,e,void 0),disabled:!J(n),children:`reset`})]})]},e)})}),Ie.length===0?(0,t.jsxs)(`p`,{className:`reinspect-menu-empty-state`,children:[`No CSS properties match "`,b.trim(),`".`]}):null]}):(0,t.jsxs)(`div`,{className:`reinspect-props-panel`,children:[(0,t.jsxs)(`div`,{className:`reinspect-props-submenu`,children:[(0,t.jsx)(`button`,{type:`button`,"data-state":v===`detected`?`active`:`idle`,onClick:()=>y(`detected`),children:`Detected`}),(0,t.jsx)(`button`,{type:`button`,"data-state":v===`raw`?`active`:`idle`,onClick:()=>{y(`raw`),E(null),w(oe(Pe))},children:`Raw`})]}),v===`detected`?Le.length>0?(0,t.jsxs)(`div`,{className:`reinspect-props-table`,children:[(0,t.jsxs)(`div`,{className:`reinspect-props-header`,children:[(0,t.jsx)(`span`,{children:`Key`}),(0,t.jsx)(`span`,{children:`Value`})]}),Le.map(e=>{let n=be(e.key),r=Pe[e.key],i=e.value.kind===`object`||e.value.kind===`array`,a=!!M[e.key],o=ie[e.key],s=A[e.key],c=I(r);return(0,t.jsxs)(`div`,{className:`reinspect-props-row`,"data-testid":`reinspect-prop-row-${n}`,children:[(0,t.jsx)(`code`,{className:`reinspect-prop-key`,children:e.key}),(0,t.jsxs)(`div`,{className:`reinspect-prop-cell`,"data-testid":`reinspect-prop-value-${n}`,children:[he({value:e.value,onCopy:We}),i||c?(0,t.jsxs)(`div`,{className:`reinspect-prop-actions`,children:[i?(0,t.jsx)(`button`,{type:`button`,"data-testid":`reinspect-prop-show-json-${n}`,onClick:()=>Ge(e.key,r),children:a?`Hide JSON`:`Show JSON`}):null,c?(0,t.jsx)(`button`,{type:`button`,"data-testid":`reinspect-prop-edit-${n}`,onClick:()=>Ke(e.key,r),children:`Edit`}):null]}):null,a?(0,t.jsx)(`div`,{className:`reinspect-prop-json-preview`,"data-testid":`reinspect-prop-json-preview-${n}`,children:s?(0,t.jsx)(`p`,{className:`reinspect-error`,children:s}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`pre`,{children:o}),o?(0,t.jsx)(`button`,{type:`button`,"data-testid":`reinspect-prop-copy-json-${n}`,onClick:()=>We(o,`JSON value`),children:`Copy JSON`}):null]})}):null]})]},e.key)})]}):(0,t.jsx)(`p`,{className:`reinspect-menu-empty-state`,children:`No props detected.`}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(`label`,{htmlFor:`${Y}-props-json`,children:`Props JSON`}),(0,t.jsx)(`textarea`,{id:`${Y}-props-json`,value:C,onChange:e=>{w(e.currentTarget.value),E(null)},rows:9}),T?(0,t.jsx)(`p`,{className:`reinspect-error`,children:T}):null,(0,t.jsxs)(`div`,{className:`reinspect-inline-controls`,children:[(0,t.jsx)(`button`,{type:`button`,onClick:He,children:`apply`}),(0,t.jsx)(`button`,{type:`button`,onClick:Ue,children:`reset`})]})]}),D?(0,t.jsx)(`p`,{className:`reinspect-setting-note`,"data-testid":`reinspect-props-copy-status`,children:D}):null]})]}):null,Ye=P?(0,n.createPortal)((0,t.jsx)(`div`,{className:`reinspect-modal-backdrop`,role:`dialog`,"aria-modal":`true`,"aria-label":`Edit ${P} prop`,"data-testid":`reinspect-prop-edit-modal`,children:(0,t.jsxs)(`div`,{className:`reinspect-modal`,ref:p,children:[(0,t.jsxs)(`p`,{className:`reinspect-menu-title`,children:[`Edit prop: `,P]}),(0,t.jsx)(`label`,{htmlFor:`${Y}-prop-edit-json`,children:`JSON value`}),(0,t.jsx)(`textarea`,{id:`${Y}-prop-edit-json`,"data-testid":`reinspect-prop-edit-textarea`,value:L,onChange:e=>{R(e.currentTarget.value),B(null)},rows:10}),z?(0,t.jsx)(`p`,{className:`reinspect-error`,"data-testid":`reinspect-prop-edit-error`,children:z}):null,(0,t.jsxs)(`div`,{className:`reinspect-inline-controls`,children:[(0,t.jsx)(`button`,{type:`button`,onClick:qe,children:`apply`}),(0,t.jsx)(`button`,{type:`button`,onClick:()=>{F(null),R(``),B(null)},children:`cancel`})]})]})}),document.body):null;if(!H){if(c===`manual`)throw Error(`useReinspect must be used within ReinspectProvider`);return(0,t.jsx)(d,{...Q})}if(!X)return(0,t.jsx)(d,{...Q});let Xe=Z?(0,t.jsx)(e.Profiler,{id:Y,onRender:ze,children:(0,t.jsx)(d,{...Q})}):(0,t.jsx)(d,{...Q});return(0,t.jsxs)(`div`,{className:`reinspect-shell`,"data-reinspect-component":f,"data-reinspect-active":X,"data-testid":`reinspect-shell-${f}`,style:Be,onContextMenu:Ve,children:[X?(0,t.jsxs)(`span`,{className:`reinspect-name-badge`,children:[f,Oe?` | `:``,Oe?(0,t.jsx)(ge,{instanceId:Y,counterMode:je}):null]}):null,Je?(0,n.createPortal)(Je,document.body):null,Ye,(0,t.jsx)(`div`,{className:`reinspect-content`,"data-reinspect-content":`true`,style:Ne,children:Xe})]})}return p.displayName=`withReinspect(${f})`,z(p,{source:c,scope:l,original:d}),p}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return we}});