@dimina-kit/devtools 0.3.2-dev.20260522110734 → 0.3.2-dev.20260522142649
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/README.md +90 -155
- package/dist/main/api.d.ts +3 -11
- package/dist/main/api.js +2 -13
- package/dist/main/app/app.d.ts +14 -1
- package/dist/main/app/app.js +93 -2
- package/dist/main/index.bundle.js +140 -52
- package/dist/main/ipc/app.d.ts +1 -1
- package/dist/main/ipc/app.js +3 -0
- package/dist/main/ipc/simulator.d.ts +1 -1
- package/dist/main/ipc/simulator.js +2 -3
- package/dist/main/ipc/toolbar.d.ts +1 -1
- package/dist/main/ipc/toolbar.js +14 -4
- package/dist/main/services/layout/index.d.ts +4 -10
- package/dist/main/services/layout/index.js +11 -19
- package/dist/main/services/module.d.ts +1 -2
- package/dist/main/services/simulator/custom-apis.d.ts +0 -1
- package/dist/main/services/simulator/custom-apis.js +0 -1
- package/dist/main/services/toolbar/toolbar-store.d.ts +23 -0
- package/dist/main/services/toolbar/toolbar-store.js +23 -0
- package/dist/main/services/views/view-manager.d.ts +6 -0
- package/dist/main/services/views/view-manager.js +6 -3
- package/dist/main/services/workbench-context.d.ts +40 -14
- package/dist/main/services/workbench-context.js +6 -1
- package/dist/main/utils/disposable.d.ts +5 -0
- package/dist/main/utils/disposable.js +7 -0
- package/dist/main/utils/ipc-registry.js +5 -1
- package/dist/main/utils/sender-policy.d.ts +4 -1
- package/dist/main/utils/sender-policy.js +6 -0
- package/dist/preload/runtime/custom-apis.js +72 -1
- package/dist/preload/windows/simulator.js +41 -1
- package/dist/renderer/assets/index-4lkyF644.js +46 -0
- package/dist/renderer/assets/{input-CoWcfa8u.js → input-D4byFOLS.js} +2 -2
- package/dist/renderer/assets/{ipc-transport-Cd2xPrsa.js → ipc-transport-BzPzxPwf.js} +2 -2
- package/dist/renderer/assets/{popover-Nq5gT9DO.js → popover-cxKrg_os.js} +2 -2
- package/dist/renderer/assets/{select-By5KH-UG.js → select-BgSkkdHW.js} +2 -2
- package/dist/renderer/assets/{settings-api-Do0_Smq1.js → settings-api-BXCw9vOZ.js} +2 -2
- package/dist/renderer/assets/{settings-Dj_N70qR.js → settings-oD2K1jdT.js} +2 -2
- package/dist/renderer/assets/{workbenchSettings-CazSLGYt.js → workbenchSettings-CTNBpTft.js} +2 -2
- package/dist/renderer/entries/main/index.html +4 -4
- package/dist/renderer/entries/popover/index.html +4 -4
- package/dist/renderer/entries/settings/index.html +4 -4
- package/dist/renderer/entries/workbench-settings/index.html +3 -3
- package/dist/shared/ipc-channels.d.ts +3 -2
- package/dist/shared/ipc-channels.js +4 -3
- package/dist/shared/ipc-schemas.d.ts +2 -0
- package/dist/shared/ipc-schemas.js +2 -0
- package/dist/shared/types.d.ts +55 -3
- package/dist/simulator/assets/simulator-CILbo0Ji.js +9 -0
- package/dist/simulator/simulator.html +1 -1
- package/package.json +3 -35
- package/dist/main/simulator-apis.d.ts +0 -23
- package/dist/main/simulator-apis.js +0 -24
- package/dist/renderer/assets/index-D8VFYBh-.js +0 -46
- package/dist/simulator/assets/simulator-CZc88Jeh.js +0 -9
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import{C as e,E as t,S as n,T as r,_ as i,a,d as o,g as s,h as c,m as l,n as u,o as d,r as f,s as p,t as m,u as h,w as g,y as _}from"./ipc-transport-Cd2xPrsa.js";import{n as v,r as y,t as b}from"./input-CoWcfa8u.js";import{_ as x,a as S,d as C,f as ee,g as w,h as te,i as ne,l as re,m as ie,n as ae,o as oe,p as se,r as ce,s as le,t as ue,u as de,v as fe,y as T}from"./select-By5KH-UG.js";import{n as pe}from"./constants-DI382mTP.js";var me=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),he=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),ge=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),_e=e=>{let t=ge(e);return t.charAt(0).toUpperCase()+t.slice(1)},ve={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},ye=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},E=t(r()),be=(0,E.createContext)({}),xe=()=>(0,E.useContext)(be),Se=(0,E.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=xe()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,E.createElement)(`svg`,{ref:c,...ve,width:t??l??ve.width,height:t??l??ve.height,stroke:e??f,strokeWidth:m,className:me(`lucide`,p,i),...!a&&!ye(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,E.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),Ce=(e,t)=>{let n=(0,E.forwardRef)(({className:n,...r},i)=>(0,E.createElement)(Se,{ref:i,iconNode:t,className:me(`lucide-${he(_e(e))}`,`lucide-${e}`,n),...r}));return n.displayName=_e(e),n},we=Ce(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Te=Ce(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ee=t(e(),1),D=n();function De({project:e,onOpen:t,onRemove:n,thumbnail:r}){let[i,a]=(0,E.useState)(!1);return(0,D.jsxs)(`div`,{className:`relative bg-surface border border-border rounded-lg overflow-hidden cursor-pointer transition-all duration-150 hover:border-accent hover:-translate-y-0.5`,onClick:()=>t(e),onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),children:[r?(0,D.jsx)(`img`,{src:r,className:`h-28 w-full object-cover`,alt:``}):(0,D.jsx)(`div`,{className:`h-28 bg-surface-thumb`}),(0,D.jsxs)(`div`,{className:`p-3`,children:[(0,D.jsx)(`div`,{className:`text-sm font-medium text-text-white mb-1 truncate`,title:e.name,children:e.name}),(0,D.jsx)(`div`,{className:`text-[11px] text-text-secondary truncate`,title:e.path,children:e.path}),(0,D.jsx)(`div`,{className:`text-[11px] text-text-dim mt-1.5`,children:y(e.lastOpened)})]}),i&&(0,D.jsx)(T,{variant:`danger`,size:`icon-sm`,className:`absolute top-1.5 right-1.5 w-5 h-5 rounded-full bg-overlay text-text-secondary leading-none hover:text-status-error hover:bg-danger-bg`,onClick:t=>{t.stopPropagation(),n(e)},title:`移除`,children:`×`})]})}function Oe(e){return(0,D.jsxs)(`button`,{type:`button`,onClick:e.onClick,"aria-label":`新建项目`,className:`relative bg-transparent border-2 border-dashed border-border rounded-lg overflow-hidden cursor-pointer transition-all duration-150 hover:border-accent hover:-translate-y-0.5 h-full min-h-[188px] flex flex-col items-center justify-center gap-2 text-text-secondary hover:text-accent focus:outline-none focus-visible:ring-2 focus-visible:ring-accent`,children:[(0,D.jsx)(`span`,{className:`text-3xl leading-none`,"aria-hidden":`true`,children:`+`}),(0,D.jsx)(`span`,{className:`text-sm font-medium`,children:`新建项目`})]})}function ke({projects:e,onAdd:t,onCreate:n,onOpen:r,onRemove:i,thumbnails:a}){let[o,s]=(0,E.useState)(``),c=(0,E.useMemo)(()=>{if(!o.trim())return e;let t=o.trim().toLowerCase();return e.filter(e=>(e.name||``).toLowerCase().includes(t)||(e.path||``).toLowerCase().includes(t))},[e,o]),l=n??(()=>{}),u=e.length>0&&c.length===0;return(0,D.jsx)(`div`,{className:`flex flex-col h-screen bg-bg`,children:(0,D.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between mb-6 gap-4`,children:[(0,D.jsx)(`div`,{className:`flex items-center flex-1 max-w-xs min-w-0`,children:(0,D.jsxs)(`div`,{className:`relative w-full`,children:[(0,D.jsx)(we,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-text-secondary pointer-events-none`}),(0,D.jsx)(b,{placeholder:`搜索`,value:o,onChange:e=>s(e.target.value),className:`w-full h-8 pl-8 pr-3 rounded-md text-sm`})]})}),(0,D.jsx)(T,{variant:`ghost`,size:`sm`,onClick:t,className:`shrink-0 text-accent hover:text-accent-hover hover:bg-transparent`,children:`导入`})]}),u?(0,D.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-72 text-text-dim gap-3`,children:[(0,D.jsx)(`span`,{className:`text-5xl opacity-40`,children:`🔍`}),(0,D.jsx)(`span`,{className:`text-sm`,children:`未找到匹配的项目`})]}):(0,D.jsxs)(`div`,{className:`grid gap-4`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(220px, 1fr))`},children:[(0,D.jsx)(Oe,{onClick:l}),c.map(e=>(0,D.jsx)(De,{project:e,onOpen:r,onRemove:i,thumbnail:a?.[e.path]},e.path))]})]})})}function Ae(e){return e.trim().replace(/[\\/:*?"<>|]+/g,`-`).replace(/\s+/g,`-`).replace(/-{2,}/g,`-`).replace(/^[-.]+|[-.]+$/g,``)}function je(e,t){return t?e?e.endsWith(`/`)?`${e}${t}`:`${e}/${t}`:t:``}function Me(e){let{open:t,templates:n,defaultBaseDir:r,onSubmit:i,onCancel:a,onBrowse:o}=e,[s,c]=(0,E.useState)(``),[l,u]=(0,E.useState)(``),[d,f]=(0,E.useState)(n[0]?.id??`blank`),p=(0,E.useRef)(!1);if((0,E.useEffect)(()=>{n.find(e=>e.id===d)||f(n[0]?.id??`blank`)},[n,d]),(0,E.useEffect)(()=>{t&&(c(``),u(``),p.current=!1)},[t]),!t)return null;let m=s.trim().length>0&&l.trim().length>0;function h(e){if(c(e),!p.current){let t=Ae(e);u(t?je(r??``,t):``)}}function g(e){p.current=!0,u(e)}async function _(){let e=await o();e&&(p.current=!0,u(e))}function v(){m&&i({name:s.trim(),path:l.trim(),templateId:d})}return(0,D.jsx)(`div`,{role:`dialog`,"aria-label":`新建项目`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,children:(0,D.jsxs)(`div`,{className:`bg-surface rounded-lg shadow-lg w-[560px] max-w-[90vw] p-6`,children:[(0,D.jsx)(`h2`,{className:`text-base font-semibold text-text-white mb-4`,children:`新建项目`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,D.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,D.jsx)(`span`,{className:`text-text-secondary`,children:`项目名`}),(0,D.jsx)(`input`,{"aria-label":`项目名`,type:`text`,value:s,onChange:e=>h(e.target.value),placeholder:`My App`,className:`h-8 px-2 rounded-md border border-border bg-bg text-sm text-text-white`})]}),(0,D.jsxs)(`label`,{className:`flex flex-col gap-1 text-sm`,children:[(0,D.jsx)(`span`,{className:`text-text-secondary`,children:`目录`}),(0,D.jsxs)(`div`,{className:`flex gap-2`,children:[(0,D.jsx)(`input`,{"aria-label":`目录`,type:`text`,value:l,onChange:e=>g(e.target.value),placeholder:`/absolute/path/to/dir`,className:`flex-1 h-8 px-2 rounded-md border border-border bg-bg text-sm text-text-white`}),(0,D.jsx)(`button`,{type:`button`,onClick:_,className:`px-3 h-8 rounded-md border border-border text-sm text-text-secondary hover:text-text-white`,children:`浏览`})]})]}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-1 text-sm`,children:[(0,D.jsx)(`span`,{className:`text-text-secondary`,children:`模板`}),(0,D.jsx)(`div`,{className:`grid gap-2`,style:{gridTemplateColumns:`repeat(auto-fill, minmax(160px, 1fr))`},children:n.map(e=>{let t=e.id===d;return(0,D.jsxs)(`button`,{type:`button`,onClick:()=>f(e.id),className:[`text-left p-3 rounded-md border`,t?`border-accent text-text-white bg-accent/10`:`border-border text-text-secondary hover:border-accent`].join(` `),"aria-pressed":t,children:[(0,D.jsx)(`div`,{className:`text-sm font-medium`,children:e.name}),e.description?(0,D.jsx)(`div`,{className:`text-[11px] mt-1 text-text-dim`,children:e.description}):null]},e.id)})})]})]}),(0,D.jsxs)(`div`,{className:`flex justify-end gap-2 mt-6`,children:[(0,D.jsx)(`button`,{type:`button`,onClick:a,className:`px-3 h-8 rounded-md border border-border text-sm text-text-secondary hover:text-text-white`,children:`取消`}),(0,D.jsx)(`button`,{type:`button`,onClick:v,disabled:!m,className:`px-3 h-8 rounded-md text-sm bg-accent text-white disabled:opacity-40 disabled:cursor-not-allowed`,children:`创建`})]})]})})}function Ne(){return m(a.GetBranding)}function Pe(){return u(a.GetPreloadPath)}function Fe(){return u(o.List)}function Ie(){return m(d.OpenDirectory)}function Le(e){return u(o.Add,e)}function Re(e){return m(o.Remove,e)}function ze(e){return u(h.Open,e)}function Be(e){return u(h.GetPages,e)}function Ve(e){return u(h.GetCompileConfig,e)}function He(e,t){return u(h.SaveCompileConfig,e,t)}function Ue(e){return f(h.Status,t=>e(t))}function We(e){return m(h.CaptureThumbnail,e)}function Ge(e){return m(h.GetThumbnail,e)}function Ke(){return u(o.ListTemplates)}function qe(){return m(o.OpenCreateDialog)}function Je(e){return u(o.Create,e)}function Ye(){return u(o.GetCreateDefaults)}var Xe={selected:`simulator`,simulatorVisible:!0};function Ze(e){return e+48}function Qe(e,t){return Math.max(200,Math.min(t-200,e))}function O(e){return e.current}function $e(e,t){(e.getURL?.()??``)===t?e.reload?.():(e.loadURL?.(t),setTimeout(()=>e.reload?.(),100))}function et(e){let{initialDevice:t,simulatorRef:n}=e,[r,i]=(0,E.useState)(t),[a,o]=(0,E.useState)(100),[s,c]=(0,E.useState)(()=>Ze(t.width)),l=(0,E.useRef)(null),u=(0,E.useRef)(s),d=(0,E.useRef)(s),f=(0,E.useRef)(r);(0,E.useEffect)(()=>{u.current=s,d.current=s},[s]),(0,E.useEffect)(()=>{f.current=r},[r]),(0,E.useEffect)(()=>()=>{l.current!==null&&window.cancelAnimationFrame(l.current)},[]);let p=(0,E.useCallback)(e=>{u.current=e,l.current===null&&(l.current=window.requestAnimationFrame(()=>{l.current=null,ee(u.current)}))},[]),m=(0,E.useCallback)(e=>{let t=O(n);try{t?.send?.(`device:change`,{brand:`Apple`,model:e.name,pixelRatio:e.pixelRatio,screenWidth:e.width,screenHeight:e.height,statusBarHeight:e.statusBarHeight,system:e.system,platform:`ios`,safeAreaBottom:e.safeAreaBottom})}catch{}},[n]);return{device:r,zoom:a,simPanelWidth:s,setSimPanelWidth:c,handleDeviceChange:(0,E.useCallback)(e=>{let t=x.find(t=>t.name===e.target.value)??x[1];i(t),m(t);let n=Ze(t.width);c(n),p(n)},[p,m]),handleZoomChange:(0,E.useCallback)(e=>{o(Number(e.target.value))},[]),handleSplitterDrag:(0,E.useCallback)(e=>{e.preventDefault();let t=e.clientX,n=d.current,r=e=>{let r=Qe(n+e.clientX-t,window.innerWidth);c(r),p(r)},i=()=>{window.removeEventListener(`mousemove`,r),window.removeEventListener(`mouseup`,i)};window.addEventListener(`mousemove`,r),window.addEventListener(`mouseup`,i)},[p]),sendDeviceInfo:m,simPanelWidthRef:d,deviceRef:f,scheduleResize:p}}var tt=[`appId`,`entry`,`page`];function nt(e){return encodeURIComponent(e).replace(/%2F/g,`/`).replace(/%2C/g,`,`)}function rt(e){let t=Object.keys(e.query);if(t.length===0)return e.pagePath;let n=t.map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e.query[t]??``)}`).join(`&`);return`${e.pagePath}?${n}`}function it(e){let t=e.indexOf(`?`);if(t<0)return{pagePath:e,query:{}};let n=e.slice(0,t),r={};for(let n of e.slice(t+1).split(`&`)){if(!n)continue;let e=n.indexOf(`=`),t=e>=0?n.slice(0,e):n,i=e>=0?n.slice(e+1):``;t&&(r[decodeURIComponent(t)]=decodeURIComponent(i))}return{pagePath:n,query:r}}function at(e,t,n={}){let r=rt(t),i=[`appId=${nt(e)}`,`entry=${nt(r)}`,`page=${nt(r)}`];for(let[e,t]of Object.entries(n))tt.includes(e)||i.push(`${encodeURIComponent(e)}=${nt(t)}`);return i.join(`&`)}function ot(e){let t=e.host??`localhost`,n=e.pathname??`/simulator.html`,r=at(e.appId,e.page,e.extras??{});return`http://${t}:${e.port}${n}?${r}`}function st(e,t,n,r){let i=t.startPage||`pages/index/index`,a={};for(let e of t.queryParams??[])e.key&&(a[e.key]=e.value);a.scene=String(t.scene??1001);let o={};return r?.length&&(o.apiNamespaces=r.join(`,`)),ot({appId:e,page:{pagePath:i,query:a},port:n,extras:o})}function ct(e){let t=new URLSearchParams(e.startsWith(`?`)?e.slice(1):e),n=t.get(`appId`),r=t.get(`entry`);if(!n||!r)return null;let i=it(r),a=t.get(`page`);return{appId:n,entry:i,current:a&&a!==r?it(a):i}}function lt(e){if(!e)return null;try{return ct(new URL(e).search)}catch{return null}}function ut(e){return lt(e)?.current.pagePath??``}function dt(e){if(!e)return e;let t;try{t=new URL(e)}catch{return e}let n=ct(t.search);if(!n||n.entry.pagePath===n.current.pagePath&&rt(n.entry)===rt(n.current))return e;let r=new URLSearchParams(t.search.startsWith(`?`)?t.search.slice(1):t.search),i={};for(let[e,t]of r)tt.includes(e)||(i[e]=t);let a=at(n.appId,n.current,i);return`${t.origin}${t.pathname}?${a}${t.hash}`}function ft(e){let{projectPath:t,simulatorRef:n}=e,[r,i]=(0,E.useState)({status:`compiling`,message:`正在编译...`}),[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)([]),[l,u]=(0,E.useState)(0),[d,f]=(0,E.useState)({startPage:``,scene:pe,queryParams:[]}),[p,m]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=!1;async function n(){try{let n=await ze(t);if(e)return;if(!n.success){i({status:`error`,message:n.error});return}let[r,a]=await Promise.all([Be(t),Ve(t)]);if(e)return;o(n.appInfo),u(n.port),c(r.pages),f({startPage:a.startPage||r.entryPagePath||r.pages[0]||``,scene:a.scene??1001,queryParams:a.queryParams||[]}),i({status:`ready`,message:`编译完成`})}catch(t){if(e)return;i({status:`error`,message:t instanceof Error?t.message:String(t)})}}return n(),()=>{e=!0}},[t]),(0,E.useEffect)(()=>{Pe().then(m)},[]),(0,E.useEffect)(()=>Ue(e=>{if(i(e),e.hotReload){let e=O(n);if(!e)return;$e(e,dt(e.getURL?.()??``))}}),[n]);let h=(0,E.useRef)(!1),g=(0,E.useRef)(null);return(0,E.useEffect)(()=>()=>{g.current?.()},[]),{compileStatus:r,appInfo:a,port:l,pages:s,compileConfig:d,preloadPath:p,relaunch:(0,E.useCallback)(async(e=d)=>{try{if(!a?.appId||h.current)return;let r=O(n);if(!r)return;g.current?.(),g.current=null,h.current=!0,await He(t,e),i({status:`ready`,message:`正在刷新...`});let o=st(a.appId,e,l),s=!1,c=null,u=(t,n)=>{s||(s=!0,h.current=!1,g.current=null,c&&clearTimeout(c),r.removeEventListener?.(`did-finish-load`,d),r.removeEventListener?.(`did-stop-loading`,d),r.removeEventListener?.(`did-fail-load`,p),f(e),i({status:t,message:n}))},d=()=>{let e=r.getURL?.()??``,t=o.split(`#`)[1]??``,n=e.split(`#`)[1]??``;t&&n!==t||u(`ready`,`刷新完成`)},p=e=>{e.errorCode!==-3&&u(`error`,`刷新失败`)};r.addEventListener?.(`did-finish-load`,d),r.addEventListener?.(`did-stop-loading`,d),r.addEventListener?.(`did-fail-load`,p),g.current=()=>u(`error`,`已取消`),c=setTimeout(()=>{u(`error`,`刷新超时`)},3e4),$e(r,o)}catch(e){h.current=!1,i({status:`error`,message:e instanceof Error?e.message:`刷新失败`})}},[a,d,l,t,n])}}function pt(e){let{compileStatus:t,sendDeviceInfo:n,simulatorRef:r,simPanelWidthRef:i,deviceRef:a,appInfo:o,compileConfig:s,port:c,projectPath:l}=e,u=(0,E.useMemo)(()=>!o||!c?``:st(o.appId,s,c),[o,s,c]),[d,f]=(0,E.useState)(()=>ut(u));return(0,E.useEffect)(()=>{f(ut(u))},[u]),(0,E.useEffect)(()=>{if(t.status!==`ready`)return;let e=O(r);if(!e){n(a.current);return}let o=!1,s=!1,c=null,d=0,p=t=>{let n=t;if(!n)try{n=e.getURL?.()}catch{}f(ut(n??u))},m=()=>{if(o||s)return;if(d++,d>50){console.warn(`[simulator] Max attach retries exceeded, giving up`),c!==null&&(window.clearInterval(c),c=null);return}let t;try{t=e.getWebContentsId?.()}catch{return}t&&(s=!0,c!==null&&(window.clearInterval(c),c=null),ae(t,i.current),n(a.current),p())},h=e=>{p(e.url)},g=()=>{o||(p(),n(a.current),m())},_=null,v=()=>{o||(_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{o||We(l).catch(()=>{})},3e3))};return e.addEventListener?.(`did-navigate`,h),e.addEventListener?.(`did-navigate-in-page`,h),e.addEventListener?.(`dom-ready`,g),e.addEventListener?.(`did-finish-load`,g),e.addEventListener?.(`did-finish-load`,v),c=window.setInterval(m,200),m(),()=>{o=!0,c!==null&&window.clearInterval(c),_!==null&&window.clearTimeout(_),e.removeEventListener?.(`did-navigate`,h),e.removeEventListener?.(`did-navigate-in-page`,h),e.removeEventListener?.(`dom-ready`,g),e.removeEventListener?.(`did-finish-load`,g),e.removeEventListener?.(`did-finish-load`,v)}},[t.status,n,u,r,i,a,l]),{simulatorUrl:u,currentPage:d}}function mt(e){let t=e.map(e=>e.id),n=t.join(`\0`),[r,i]=(0,E.useState)(null),[a,o]=(0,E.useState)(``);if(n!==a){let e=a?a.split(`\0`):[];t.some(t=>!e.includes(t))&&i(null),o(n)}return{activeBridgeId:r&&t.includes(r)?r:t.at(-1)??null,setActiveBridge:e=>{t.includes(e)&&i(e)}}}function ht(e){let{id:t,initial:n,simulatorRef:r,enabled:i}=e,[a,o]=(0,E.useState)(n),[s,c]=(0,E.useState)(0),l=(0,E.useRef)(0);return(0,E.useEffect)(()=>{if(!i)return;let e=e=>{let{channel:n,args:r}=e;if(n!==p.Push)return;let i=r[0];!i||i.id!==t||i.seq<=l.current||(l.current=i.seq,o(i.data),c(i.seq))},n=null,a=null,s=0,u=()=>{if(n)return;let t=O(r);if(!t){s+=1,s>=50&&a!==null&&(window.clearInterval(a),a=null);return}n=t,a!==null&&(window.clearInterval(a),a=null),t.addEventListener(`ipc-message`,e)};return u(),n||(a=window.setInterval(u,200)),()=>{a!==null&&(window.clearInterval(a),a=null),n&&n.removeEventListener(`ipc-message`,e)}},[i,t,r]),{data:a,seq:s,refresh:(0,E.useCallback)(()=>{O(r)?.send?.(p.Pull,{id:t})},[t,r])}}var gt={bridges:[],entries:{}};function _t(e){let{compileStatus:t,simulatorRef:n}=e,[r,a]=(0,E.useState)([]),o=ht({id:`wxml`,initial:null,simulatorRef:n,enabled:t.status===`ready`}),c=ht({id:`appdata`,initial:gt,simulatorRef:n,enabled:t.status===`ready`}),{activeBridgeId:l,setActiveBridge:u}=mt(c.data.bridges),d={bridges:c.data.bridges,activeBridgeId:l,entries:c.data.entries},p=u,h=c.refresh,g=(0,E.useCallback)(async()=>{let e=await m(i.GetSnapshot);e&&a(e)},[]),_=(0,E.useCallback)(async(e,t)=>await m(i.Set,{key:e,value:t})??{ok:!1,error:`ipc transport failed`},[]),v=(0,E.useCallback)(async e=>await m(i.Remove,{key:e})??{ok:!1,error:`ipc transport failed`},[]),y=(0,E.useCallback)(async()=>await m(i.Clear)??{ok:!1,error:`ipc transport failed`},[]),b=(0,E.useCallback)(async()=>await m(i.ClearAll)??{ok:!1,error:`ipc transport failed`},[]),x=(0,E.useCallback)(async()=>await m(i.GetActivePrefix)??``,[]),S=(0,E.useCallback)(async e=>await m(s.Inspect,e),[]),C=(0,E.useCallback)(async()=>{await m(s.Clear)},[]);return(0,E.useEffect)(()=>f(i.Event,e=>{e.type===`cleared`?a([]):e.type===`added`||e.type===`updated`?a(t=>{let n=t.findIndex(t=>t.key===e.key),r=n>=0?[...t]:[...t,{key:e.key,value:e.newValue}];return n>=0&&(r[n]={key:e.key,value:e.newValue}),r}):e.type===`removed`&&a(t=>t.filter(t=>t.key!==e.key))}),[]),{wxmlTree:o.data,appData:d,storageItems:r,refreshWxml:o.refresh,refreshAppData:h,setActiveAppDataBridge:p,refreshStorage:g,setStorageItem:_,removeStorageItem:v,clearStorage:y,clearAllStorage:b,getStoragePrefix:x,inspectWxmlElement:S,clearWxmlElementInspection:C}}function vt({compileStatus:e,simulatorRef:t}){(0,E.useEffect)(()=>{if(e.status!==`ready`)return;let n=async(e,t)=>{let n;try{let e=t.op===`list`?await u(c.List):await u(c.Invoke,t.name,t.params);n={id:t.id,result:e}}catch(e){n={id:t.id,error:e instanceof Error?e.message:String(e)}}try{e.send?.(l.Response,n)}catch{}},r=e=>{let{channel:r,args:i}=e;if(r!==l.Request)return;let a=i[0];if(!a||typeof a.id!=`number`)return;let o=O(t);o&&n(o,a)},i=null,a=null,o=0,s=()=>{if(i)return;let e=O(t);if(!e){o+=1,o>=50&&a!==null&&(window.clearInterval(a),a=null);return}i=e,a!==null&&(window.clearInterval(a),a=null),e.addEventListener(`ipc-message`,r)};return s(),i||(a=window.setInterval(s,200)),()=>{a!==null&&(window.clearInterval(a),a=null),i&&i.removeEventListener(`ipc-message`,r)}},[e.status,t])}function yt(e){let{initialRightPane:t,simPanelWidthRef:n}=e,[r,i]=(0,E.useState)(t),a=(0,E.useCallback)((e,t)=>{if(e.selected===`simulator`){if(e.simulatorVisible){se();return}ie(!1,t);return}ie(!1,t)},[]);return{rightPane:r,selectRightPane:(0,E.useCallback)(e=>{let t={selected:e,simulatorVisible:!0};i(t),a(t,n.current)},[a,n]),toggleRightPaneVisible:(0,E.useCallback)(()=>{i(e=>{let t={...e,simulatorVisible:!e.simulatorVisible};return a(t,n.current),t})},[a,n])}}function bt(e){let{relaunch:t,compileConfig:n,pages:r,compileDropdownRef:i}=e,[a,o]=(0,E.useState)(!1),s=(0,E.useRef)(t);(0,E.useEffect)(()=>{s.current=t},[t]),(0,E.useEffect)(()=>{let e=le(()=>o(!1)),t=re(e=>{o(!1),s.current(e)});return()=>{e(),t()}},[]);let c=(0,E.useRef)(n),l=(0,E.useRef)(r);return(0,E.useEffect)(()=>{c.current=n},[n]),(0,E.useEffect)(()=>{l.current=r},[r]),{showCompilePanel:a,toggleCompilePanel:(0,E.useCallback)(()=>{o(e=>{if(e)return ne(),!1;let t=i.current;if(!t)return e;let n=t.getBoundingClientRect();return te({top:Math.round(n.bottom-40+6),left:Math.round(n.left),config:c.current,pages:l.current}),!0})},[i])}}function xt(e){let{projectPath:t,initialDevice:n=x[1],initialRightPane:r=Xe}=e,i=(0,E.useRef)(null),a=(0,E.useRef)(null),o=et({initialDevice:n,simulatorRef:i}),s=ft({projectPath:t,simulatorRef:i});(0,E.useEffect)(()=>{s.compileStatus.status===`ready`&&o.setSimPanelWidth(o.device.width+48)},[o.device.width,s.compileStatus.status,o.setSimPanelWidth]);let c=pt({compileStatus:s.compileStatus,sendDeviceInfo:o.sendDeviceInfo,simulatorRef:i,simPanelWidthRef:o.simPanelWidthRef,deviceRef:o.deviceRef,appInfo:s.appInfo,compileConfig:s.compileConfig,port:s.port,projectPath:t}),l=_t({compileStatus:s.compileStatus,simulatorRef:i});vt({compileStatus:s.compileStatus,simulatorRef:i});let u=yt({initialRightPane:r,simPanelWidthRef:o.simPanelWidthRef}),d=bt({relaunch:s.relaunch,compileConfig:s.compileConfig,pages:s.pages,compileDropdownRef:a});return{session:{compileStatus:s.compileStatus,appInfo:s.appInfo,port:s.port,pages:s.pages,compileConfig:s.compileConfig,preloadPath:s.preloadPath,relaunch:s.relaunch},device:{device:o.device,zoom:o.zoom,simPanelWidth:o.simPanelWidth,setSimPanelWidth:o.setSimPanelWidth,handleDeviceChange:o.handleDeviceChange,handleZoomChange:o.handleZoomChange,handleSplitterDrag:o.handleSplitterDrag,sendDeviceInfo:o.sendDeviceInfo},simulator:{simulatorRef:i,simulatorUrl:c.simulatorUrl,currentPage:c.currentPage},panelData:{wxmlTree:l.wxmlTree,appData:l.appData,storageItems:l.storageItems,refreshWxml:l.refreshWxml,refreshAppData:l.refreshAppData,setActiveAppDataBridge:l.setActiveAppDataBridge,refreshStorage:l.refreshStorage,setStorageItem:l.setStorageItem,removeStorageItem:l.removeStorageItem,clearStorage:l.clearStorage,clearAllStorage:l.clearAllStorage,getStoragePrefix:l.getStoragePrefix,inspectWxmlElement:l.inspectWxmlElement,clearWxmlElementInspection:l.clearWxmlElementInspection},rightPane:{rightPane:u.rightPane,selectRightPane:u.selectRightPane,toggleRightPaneVisible:u.toggleRightPaneVisible},popover:{compileDropdownRef:a,showCompilePanel:d.showCompilePanel,toggleCompilePanel:d.toggleCompilePanel}}}typeof window<`u`&&window.document&&window.document.createElement;function k(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function St(e,t){let n=E.createContext(t),r=e=>{let{children:t,...r}=e,i=E.useMemo(()=>r,Object.values(r));return(0,D.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=E.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Ct(e,t=[]){let n=[];function r(t,r){let i=E.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=E.useMemo(()=>o,Object.values(o));return(0,D.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=E.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>E.createContext(e));return function(n){let r=n?.[e]||t;return E.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,wt(i,...t)]}function wt(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function Tt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Et(...e){return t=>{let n=!1,r=e.map(e=>{let r=Tt(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Tt(e[t],null)}}}}function A(...e){return E.useCallback(Et(...e),e)}function Dt(e){let t=Ot(e),n=E.forwardRef((e,n)=>{let{children:r,...i}=e,a=E.Children.toArray(r),o=a.find(At);if(o){let e=o.props.children,r=a.map(t=>t===o?E.Children.count(e)>1?E.Children.only(null):E.isValidElement(e)?e.props.children:null:t);return(0,D.jsx)(t,{...i,ref:n,children:E.isValidElement(e)?E.cloneElement(e,void 0,r):null})}return(0,D.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Ot(e){let t=E.forwardRef((e,t)=>{let{children:n,...r}=e;if(E.isValidElement(n)){let e=Mt(n),i=jt(r,n.props);return n.type!==E.Fragment&&(i.ref=t?Et(t,e):e),E.cloneElement(n,i)}return E.Children.count(n)>1?E.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var kt=Symbol(`radix.slottable`);function At(e){return E.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===kt}function jt(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Mt(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Nt(e){let t=e+`CollectionProvider`,[n,r]=Ct(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=E.useRef(null),a=E.useRef(new Map).current;return(0,D.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Dt(s),l=E.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,D.jsx)(c,{ref:A(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Dt(u),p=E.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=E.useRef(null),s=A(t,o),c=a(u,n);return E.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,D.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return E.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var j=globalThis?.document?E.useLayoutEffect:()=>{},Pt=E.useId||(()=>void 0),Ft=0;function It(e){let[t,n]=E.useState(Pt());return j(()=>{e||n(e=>e??String(Ft++))},[e]),e||(t?`radix-${t}`:``)}var Lt=t(g(),1),M=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Dt(`Primitive.${t}`),r=E.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,D.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Rt(e,t){e&&Lt.flushSync(()=>e.dispatchEvent(t))}function N(e){let t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...e)=>t.current?.(...e),[])}var zt=E.useInsertionEffect||j;function Bt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Vt({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=E.useRef(e!==void 0);E.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,E.useCallback(t=>{if(s){let n=Ht(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Vt({defaultProp:e,onChange:t}){let[n,r]=E.useState(e),i=E.useRef(n),a=E.useRef(t);return zt(()=>{a.current=t},[t]),E.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Ht(e){return typeof e==`function`}var Ut=E.createContext(void 0);function Wt(e){let t=E.useContext(Ut);return e||t||`ltr`}var Gt=`rovingFocusGroup.onEntryFocus`,Kt={bubbles:!1,cancelable:!0},qt=`RovingFocusGroup`,[Jt,Yt,Xt]=Nt(qt),[Zt,Qt]=Ct(qt,[Xt]),[$t,en]=Zt(qt),tn=E.forwardRef((e,t)=>(0,D.jsx)(Jt.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(Jt.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,D.jsx)(nn,{...e,ref:t})})}));tn.displayName=qt;var nn=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=E.useRef(null),p=A(t,f),m=Wt(a),[h,g]=Bt({prop:o,defaultProp:s??null,onChange:c,caller:qt}),[_,v]=E.useState(!1),y=N(l),b=Yt(n),x=E.useRef(!1),[S,C]=E.useState(0);return E.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Gt,y),()=>e.removeEventListener(Gt,y)},[y]),(0,D.jsx)($t,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:E.useCallback(e=>g(e),[g]),onItemShiftTab:E.useCallback(()=>v(!0),[]),onFocusableItemAdd:E.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:E.useCallback(()=>C(e=>e-1),[]),children:(0,D.jsx)(M.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:k(e.onMouseDown,()=>{x.current=!0}),onFocus:k(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Gt,Kt);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);ln([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:k(e.onBlur,()=>v(!1))})})}),rn=`RovingFocusGroupItem`,an=E.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=It(),l=a||c,u=en(rn,n),d=u.currentTabStopId===l,f=Yt(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return E.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,D.jsx)(Jt.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,D.jsx)(M.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:k(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:k(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:k(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=cn(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?un(n,r+1):n.slice(r+1)}setTimeout(()=>ln(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});an.displayName=rn;var on={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function sn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function cn(e,t,n){let r=sn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return on[r]}function ln(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function un(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var dn=tn,fn=an;function pn(e,t){return E.useReducer((e,n)=>t[e][n]??e,e)}var mn=e=>{let{present:t,children:n}=e,r=hn(t),i=typeof n==`function`?n({present:r.isPresent}):E.Children.only(n),a=A(r.ref,_n(i));return typeof n==`function`||r.isPresent?E.cloneElement(i,{ref:a}):null};mn.displayName=`Presence`;function hn(e){let[t,n]=E.useState(),r=E.useRef(null),i=E.useRef(e),a=E.useRef(`none`),[o,s]=pn(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return E.useEffect(()=>{let e=gn(r.current);a.current=o===`mounted`?e:`none`},[o]),j(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=gn(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),j(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=gn(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=gn(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:E.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function gn(e){return e?.animationName||`none`}function _n(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var vn=`Tabs`,[yn,bn]=Ct(vn,[Qt]),xn=Qt(),[Sn,Cn]=yn(vn),wn=E.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=Wt(s),[d,f]=Bt({prop:r,onChange:i,defaultProp:a??``,caller:vn});return(0,D.jsx)(Sn,{scope:n,baseId:It(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,D.jsx)(M.div,{dir:u,"data-orientation":o,...l,ref:t})})});wn.displayName=vn;var Tn=`TabsList`,En=E.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Cn(Tn,n),o=xn(n);return(0,D.jsx)(dn,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,D.jsx)(M.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});En.displayName=Tn;var Dn=`TabsTrigger`,On=E.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Cn(Dn,n),s=xn(n),c=jn(o.baseId,r),l=Mn(o.baseId,r),u=r===o.value;return(0,D.jsx)(fn,{asChild:!0,...s,focusable:!i,active:u,children:(0,D.jsx)(M.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:k(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:k(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:k(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});On.displayName=Dn;var kn=`TabsContent`,An=E.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Cn(kn,n),c=jn(s.baseId,r),l=Mn(s.baseId,r),u=r===s.value,d=E.useRef(u);return E.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,D.jsx)(mn,{present:i||u,children:({present:n})=>(0,D.jsx)(M.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})});An.displayName=kn;function jn(e,t){return`${e}-trigger-${t}`}function Mn(e,t){return`${e}-content-${t}`}var Nn=wn,Pn=En,Fn=On,In=An,Ln=Nn,Rn=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(Pn,{ref:n,className:v(`inline-flex h-7 items-center justify-center rounded-md bg-surface-2 p-1 text-text-muted`,e),...t}));Rn.displayName=Pn.displayName;var zn=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(Fn,{ref:n,className:v(`inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-bg transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-surface-selected data-[state=active]:text-text data-[state=active]:shadow-sm`,e),...t}));zn.displayName=Fn.displayName;var Bn=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(In,{ref:n,className:v(`mt-2 ring-offset-bg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2`,e),...t}));Bn.displayName=In.displayName;var Vn={compiling:`bg-status-warn animate-[pulse_1s_infinite]`,ready:`bg-accent`,error:`bg-status-error`};function Hn({status:e}){return(0,D.jsx)(`span`,{className:v(`w-1.5 h-1.5 rounded-full shrink-0`,Vn[e]??`bg-border`)})}function Un({compileDropdownRef:e,showCompilePanel:t,onToggleCompilePanel:n,onRelaunch:r,compileStatus:i,rightPane:a,onToggleRightPaneVisible:o,onSelectRightPane:s}){let[c,l]=(0,E.useState)([]),[u,d]=(0,E.useState)([]),f=()=>{ce().then(e=>{l(Array.isArray(e)?e:[])}).catch(e=>{console.debug(`[toolbar] getActions not available`,e)})};return(0,E.useEffect)(()=>(f(),oe().then(e=>{e?.length&&d(e)}).catch(e=>{console.warn(`[toolbar] panel:list failed`,e)}),de(()=>f())),[]),(0,D.jsxs)(`div`,{className:`flex flex-col shrink-0`,children:[c.length>0&&(0,D.jsx)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 bg-surface-2 border-b border-border`,children:c.map(e=>(0,D.jsx)(T,{variant:`outline`,size:`sm`,onClick:()=>S(e.id),disabled:i.status===`compiling`,children:e.label},e.id))}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 bg-surface-2 border-b border-border shrink-0`,style:{height:40},children:[(0,D.jsx)(`div`,{ref:e,children:(0,D.jsxs)(T,{variant:`outline`,size:`sm`,onClick:n,className:v(t&&`border-accent`),children:[`普通编译 `,(0,D.jsx)(`span`,{className:`text-[10px] text-text-secondary`,children:`▾`})]})}),(0,D.jsx)(T,{variant:`icon`,size:`icon`,onClick:()=>{r()},disabled:i.status===`compiling`,title:`重新编译`,children:`↺`}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-1.5 shrink-0`,children:[(0,D.jsx)(Hn,{status:i.status}),(0,D.jsx)(`span`,{className:`text-[11px] text-text-muted max-w-28 truncate`,children:i.message})]}),(0,D.jsx)(`div`,{className:`flex-1 min-w-2`}),u.length>0&&(0,D.jsx)(Ln,{value:a.selected,onValueChange:e=>s(e),children:(0,D.jsxs)(Rn,{className:`h-auto gap-px bg-bg border border-border p-0`,children:[(0,D.jsx)(zn,{value:`simulator`,className:`px-2 py-0.5 text-[11px] rounded-none data-[state=active]:shadow-none`,children:`DevTools`}),u.map(e=>(0,D.jsx)(zn,{value:e.id,className:`px-2 py-0.5 text-[11px] rounded-none data-[state=active]:shadow-none`,children:e.label},e.id))]})}),(0,D.jsx)(T,{variant:`icon`,size:`icon`,onClick:o,title:a.simulatorVisible?`隐藏面板`:`显示面板`,className:`text-base`,children:a.simulatorVisible?`⊟`:`⊞`})]})]})}function Wn({simPanelWidth:e,device:t,zoom:n,onDeviceChange:r,onZoomChange:i,compileStatus:a,preloadPath:o,simulatorUrl:s,simulatorRef:c,currentPage:l,copied:u,onCopyPagePath:d}){let f=n/100;return(0,D.jsxs)(`div`,{className:`bg-sim-bg flex flex-col overflow-hidden shrink-0`,style:{width:e,minWidth:e},children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2 px-5 py-2 shrink-0 border-b border-border-subtle`,children:[(0,D.jsx)(ue,{value:t.name,onChange:r,children:x.map(e=>(0,D.jsx)(`option`,{value:e.name,children:e.name},e.name))}),(0,D.jsx)(ue,{value:n,onChange:i,className:`max-w-16`,children:fe.map(e=>(0,D.jsxs)(`option`,{value:e,children:[e,`%`]},e))})]}),(0,D.jsx)(`div`,{className:`flex-1 overflow-auto flex items-start justify-center p-5`,children:(0,D.jsx)(`div`,{className:`flex flex-col items-center`,children:(0,D.jsx)(`div`,{className:`shrink-0 overflow-visible relative`,style:{borderRadius:44,boxShadow:`0 0 0 8px var(--color-phone-shell), 0 0 0 10px var(--color-phone-border), 0 24px 60px var(--color-overlay-heavy)`,background:`var(--color-phone-shell)`,width:Math.round(t.width*f),height:Math.round(t.height*f)},children:(0,D.jsxs)(`div`,{className:`bg-black relative overflow-hidden shrink-0`,style:{borderRadius:36,width:t.width,height:t.height,transform:`scale(${f})`,transformOrigin:`top left`},children:[o&&s&&(0,D.jsx)(`webview`,{ref:c,src:s,partition:`persist:simulator`,allowpopups:``,style:{display:`flex`,flexDirection:`column`,width:t.width,height:t.height}}),a.status===`compiling`&&(0,D.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/50 rounded-[36px] z-10`,children:(0,D.jsx)(`div`,{className:`text-text-dim text-[13px]`,children:`正在编译中...`})}),a.status===`error`&&(0,D.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center bg-black/70 rounded-[36px] z-10`,children:(0,D.jsxs)(`div`,{className:`text-center p-4`,children:[(0,D.jsx)(`div`,{className:`text-status-error text-[14px] font-medium mb-2`,children:`编译失败`}),(0,D.jsx)(`div`,{className:`text-status-error text-[11px] max-w-[280px] break-words`,children:a.message})]})})]})})})}),(0,D.jsx)(`div`,{className:`flex items-center px-2.5 bg-sim-bottom border-t border-border-subtle shrink-0 h-[30px] min-w-0`,children:(0,D.jsxs)(`div`,{className:`flex items-center gap-1 min-w-0`,children:[(0,D.jsx)(`span`,{className:`text-[11px] text-text-dim truncate min-w-0`,children:l||`—`}),l&&(0,D.jsx)(`button`,{className:v(`shrink-0 flex items-center justify-center w-4 h-4 rounded transition-colors`,u?`text-accent`:`text-text-dim hover:text-text`),onClick:d,title:`复制路径`,children:u?(0,D.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,children:(0,D.jsx)(`polyline`,{points:`1.5,5 4,7.5 8.5,2.5`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}):(0,D.jsxs)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 10 10`,fill:`none`,children:[(0,D.jsx)(`rect`,{x:`1`,y:`3`,width:`6`,height:`6.5`,rx:`1`,stroke:`currentColor`,strokeWidth:`1`}),(0,D.jsx)(`path`,{d:`M3 3V2a1 1 0 011-1h4a1 1 0 011 1v5a1 1 0 01-1 1H7`,stroke:`currentColor`,strokeWidth:`1`})]})})]})})]})}function Gn(e){return!!(e.tagName===`#shadow-root`||e.tagName.includes(`/`))}function Kn({node:e,depth:t,inspectedSid:n,onInspect:r}){let[i,a]=(0,E.useState)(()=>Gn(e)),o=t*16,s=!!(e.sid&&e.sid===n),c=`py-px leading-[18px] hover:bg-surface-2${s?` bg-surface-2`:``}`,l=()=>{e.sid&&r?.(e)};if(e.tagName===`#text`)return(0,D.jsxs)(`div`,{className:`py-px leading-[18px] hover:bg-surface-2`,style:{paddingLeft:o},children:[(0,D.jsx)(`span`,{className:`w-3 inline-block`}),(0,D.jsx)(`span`,{className:`text-text`,children:e.text})]});if(e.tagName===`#fragment`)return(0,D.jsx)(D.Fragment,{children:(e.children??[]).map((e,i)=>(0,D.jsx)(Kn,{node:e,depth:t,inspectedSid:n,onInspect:r},i))});if(e.tagName===`#shadow-root`){let s=(e.children??[]).length>0;return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`py-px leading-[18px] hover:bg-surface-2 cursor-pointer`,style:{paddingLeft:o},onClick:()=>s&&a(!i),children:[(0,D.jsx)(`span`,{className:`text-text-dim w-3 shrink-0 inline-block text-center select-none`,children:s?i?`▾`:`▸`:` `}),(0,D.jsx)(`span`,{className:`text-text-dim italic`,children:`#shadow-root`})]}),i&&e.children.map((e,i)=>(0,D.jsx)(Kn,{node:e,depth:t+1,inspectedSid:n,onInspect:r},i))]})}let u=(e.children??[]).length>0,d=Object.entries(e.attrs),f=u&&e.children.length===1&&e.children[0].tagName===`#text`?e.children[0].text:null;return f?(0,D.jsxs)(`div`,{className:c,style:{paddingLeft:o},onMouseEnter:l,"data-wxml-sid":e.sid,children:[(0,D.jsx)(`span`,{className:`w-3 inline-block`}),(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`<`,e.tagName]}),d.map(([e,t])=>(0,D.jsxs)(`span`,{children:[` `,(0,D.jsx)(`span`,{className:`text-code-blue`,children:e}),(0,D.jsx)(`span`,{className:`text-text-dim`,children:`=`}),(0,D.jsxs)(`span`,{className:`text-code-orange`,children:[`"`,t,`"`]})]},e)),(0,D.jsx)(`span`,{className:`text-code-keyword`,children:`>`}),(0,D.jsx)(`span`,{className:`text-text`,children:f}),(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`</`,e.tagName,`>`]})]}):(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`flex items-start hover:bg-surface-2 py-px leading-[18px]${u?` cursor-pointer`:``}${s?` bg-surface-2`:``}`,style:{paddingLeft:o},onMouseEnter:l,onClick:()=>{u&&a(!i)},"data-wxml-sid":e.sid,children:[(0,D.jsx)(`span`,{className:`text-text-dim w-3 shrink-0 text-center select-none`,children:u?i?`▾`:`▸`:` `}),(0,D.jsxs)(`span`,{children:[(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`<`,e.tagName]}),d.map(([e,t])=>(0,D.jsxs)(`span`,{children:[` `,(0,D.jsx)(`span`,{className:`text-code-blue`,children:e}),(0,D.jsx)(`span`,{className:`text-text-dim`,children:`=`}),(0,D.jsxs)(`span`,{className:`text-code-orange`,children:[`"`,t,`"`]})]},e)),(0,D.jsx)(`span`,{className:`text-code-keyword`,children:u?`>`:` />`})]})]}),i&&u&&(0,D.jsxs)(D.Fragment,{children:[e.children.map((e,i)=>(0,D.jsx)(Kn,{node:e,depth:t+1,inspectedSid:n,onInspect:r},i)),(0,D.jsxs)(`div`,{style:{paddingLeft:o},className:`py-px leading-[18px]`,children:[(0,D.jsx)(`span`,{className:`w-3 inline-block`}),(0,D.jsxs)(`span`,{className:`text-code-keyword`,children:[`</`,e.tagName,`>`]})]})]})]})}function qn({inspection:e}){if(!e)return null;let{rect:t,style:n}=e,r=[n.display,n.position===`static`?null:n.position,n.boxSizing].filter(Boolean);return(0,D.jsxs)(`div`,{className:`border-t border-border-subtle bg-bg-panel px-2.5 py-1.5 font-mono text-[11px] text-text-dim shrink-0`,children:[(0,D.jsx)(`span`,{className:`text-text`,children:`box`}),` `,Math.round(t.width),` x `,Math.round(t.height),` @ `,Math.round(t.x),`, `,Math.round(t.y),(0,D.jsx)(`span`,{className:`mx-2 text-border-subtle`,children:`|`}),r.join(` / `),(0,D.jsx)(`span`,{className:`mx-2 text-border-subtle`,children:`|`}),`font `,n.fontSize]})}function Jn({tree:e,onRefresh:t,onInspectElement:n,onClearInspection:r}){let[i,a]=(0,E.useState)(null),o=(0,E.useRef)(0),s=(0,E.useRef)(null);(0,E.useEffect)(()=>()=>{s.current!==null&&cancelAnimationFrame(s.current)},[]);let c=(0,E.useCallback)(e=>{if(!e.sid||!n)return;let t=e.sid;s.current!==null&&cancelAnimationFrame(s.current),s.current=requestAnimationFrame(()=>{s.current=null;let e=++o.current;n(t).then(t=>{e===o.current&&a(t)}).catch(()=>{e===o.current&&a(null)})})},[n]),l=(0,E.useCallback)(()=>{s.current!==null&&(cancelAnimationFrame(s.current),s.current=null),o.current++,a(null),r?.()},[r]);return e?(0,D.jsxs)(`div`,{className:`flex flex-col flex-1 overflow-hidden`,onMouseLeave:l,"data-testid":`wxml-panel`,children:[(0,D.jsx)(`div`,{className:`flex items-center px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`})}),(0,D.jsx)(`div`,{className:`flex-1 overflow-y-auto p-2 font-mono text-[12px]`,children:(0,D.jsx)(Kn,{node:e,depth:0,inspectedSid:i?.sid??null,onInspect:c})}),(0,D.jsx)(qn,{inspection:i})]}):(0,D.jsxs)(`div`,{className:`flex flex-col flex-1 overflow-hidden`,"data-testid":`wxml-panel`,children:[(0,D.jsx)(`div`,{className:`flex items-center px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`})}),(0,D.jsx)(`div`,{className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`等待小程序加载...`})]})}function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(null,arguments)}function F(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Yn={},Xn=(0,E.createContext)(Yn),Zn=(e,t)=>P({},e,t),Qn=()=>(0,E.useContext)(Xn),$n=(0,E.createContext)(()=>{});$n.displayName=`JVR.DispatchShowTools`;function er(){return(0,E.useReducer)(Zn,Yn)}function tr(){return(0,E.useContext)($n)}var nr=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(Xn.Provider,{value:t,children:(0,D.jsx)($n.Provider,{value:n,children:r})})};nr.displayName=`JVR.ShowTools`;var rr={},ir=(0,E.createContext)(rr),ar=(e,t)=>P({},e,t),or=()=>(0,E.useContext)(ir),sr=(0,E.createContext)(()=>{});sr.displayName=`JVR.DispatchExpands`;function cr(){return(0,E.useReducer)(ar,rr)}function lr(){return(0,E.useContext)(sr)}var ur=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(ir.Provider,{value:t,children:(0,D.jsx)(sr.Provider,{value:n,children:r})})};ur.displayName=`JVR.Expands`;var dr={Str:{as:`span`,"data-type":`string`,style:{color:`var(--w-rjv-type-string-color, #cb4b16)`},className:`w-rjv-type`,children:`string`},Url:{as:`a`,style:{color:`var(--w-rjv-type-url-color, #0969da)`},"data-type":`url`,className:`w-rjv-type`,children:`url`},Undefined:{style:{color:`var(--w-rjv-type-undefined-color, #586e75)`},as:`span`,"data-type":`undefined`,className:`w-rjv-type`,children:`undefined`},Null:{style:{color:`var(--w-rjv-type-null-color, #d33682)`},as:`span`,"data-type":`null`,className:`w-rjv-type`,children:`null`},Map:{style:{color:`var(--w-rjv-type-map-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`map`,className:`w-rjv-type`,children:`Map`},Nan:{style:{color:`var(--w-rjv-type-nan-color, #859900)`},as:`span`,"data-type":`nan`,className:`w-rjv-type`,children:`NaN`},Bigint:{style:{color:`var(--w-rjv-type-bigint-color, #268bd2)`},as:`span`,"data-type":`bigint`,className:`w-rjv-type`,children:`bigint`},Int:{style:{color:`var(--w-rjv-type-int-color, #268bd2)`},as:`span`,"data-type":`int`,className:`w-rjv-type`,children:`int`},Set:{style:{color:`var(--w-rjv-type-set-color, #268bd2)`,marginRight:3},as:`span`,"data-type":`set`,className:`w-rjv-type`,children:`Set`},Float:{style:{color:`var(--w-rjv-type-float-color, #859900)`},as:`span`,"data-type":`float`,className:`w-rjv-type`,children:`float`},True:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},False:{style:{color:`var(--w-rjv-type-boolean-color, #2aa198)`},as:`span`,"data-type":`bool`,className:`w-rjv-type`,children:`bool`},Date:{style:{color:`var(--w-rjv-type-date-color, #268bd2)`},as:`span`,"data-type":`date`,className:`w-rjv-type`,children:`date`}},fr=(0,E.createContext)(dr),pr=(e,t)=>P({},e,t),I=()=>(0,E.useContext)(fr),mr=(0,E.createContext)(()=>{});mr.displayName=`JVR.DispatchTypes`;function hr(){return(0,E.useReducer)(pr,dr)}function gr(){return(0,E.useContext)(mr)}function _r(e){var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(fr.Provider,{value:t,children:(0,D.jsx)(mr.Provider,{value:n,children:r})})}_r.displayName=`JVR.Types`;var vr=[`style`];function yr(e){var{style:t}=e,n=F(e,vr);return(0,D.jsx)(`svg`,P({viewBox:`0 0 24 24`,fill:`var(--w-rjv-arrow-color, currentColor)`,style:P({cursor:`pointer`,height:`1em`,width:`1em`,userSelect:`none`,display:`inline-flex`},t)},n,{children:(0,D.jsx)(`path`,{d:`M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z`})}))}yr.displayName=`JVR.TriangleArrow`;var br={Arrow:{as:`span`,className:`w-rjv-arrow`,style:{transform:`rotate(0deg)`,transition:`all 0.3s`},children:(0,D.jsx)(yr,{})},Colon:{as:`span`,style:{color:`var(--w-rjv-colon-color, var(--w-rjv-color))`,marginLeft:0,marginRight:2},className:`w-rjv-colon`,children:`:`},Quote:{as:`span`,style:{color:`var(--w-rjv-quotes-color, #236a7c)`},className:`w-rjv-quotes`,children:`"`},ValueQuote:{as:`span`,style:{color:`var(--w-rjv-quotes-string-color, #cb4b16)`},className:`w-rjv-quotes`,children:`"`},BracketsLeft:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-start`,children:`[`},BracketsRight:{as:`span`,style:{color:`var(--w-rjv-brackets-color, #236a7c)`},className:`w-rjv-brackets-end`,children:`]`},BraceLeft:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-start`,children:`{`},BraceRight:{as:`span`,style:{color:`var(--w-rjv-curlybraces-color, #236a7c)`},className:`w-rjv-curlybraces-end`,children:`}`}},xr=(0,E.createContext)(br),Sr=(e,t)=>P({},e,t),L=()=>(0,E.useContext)(xr),Cr=(0,E.createContext)(()=>{});Cr.displayName=`JVR.DispatchSymbols`;function wr(){return(0,E.useReducer)(Sr,br)}function Tr(){return(0,E.useContext)(Cr)}var Er=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(xr.Provider,{value:t,children:(0,D.jsx)(Cr.Provider,{value:n,children:r})})};Er.displayName=`JVR.Symbols`;var Dr={Copied:{className:`w-rjv-copied`,style:{height:`1em`,width:`1em`,cursor:`pointer`,verticalAlign:`middle`,marginLeft:5}},CountInfo:{as:`span`,className:`w-rjv-object-size`,style:{color:`var(--w-rjv-info-color, #0000004d)`,paddingLeft:8,fontStyle:`italic`}},CountInfoExtra:{as:`span`,className:`w-rjv-object-extra`,style:{paddingLeft:8}},Ellipsis:{as:`span`,style:{cursor:`pointer`,color:`var(--w-rjv-ellipsis-color, #cb4b16)`,userSelect:`none`},className:`w-rjv-ellipsis`,children:`...`},Row:{as:`div`,className:`w-rjv-line`},KeyName:{as:`span`,className:`w-rjv-object-key`}},Or=(0,E.createContext)(Dr),kr=(e,t)=>P({},e,t),R=()=>(0,E.useContext)(Or),Ar=(0,E.createContext)(()=>{});Ar.displayName=`JVR.DispatchSection`;function jr(){return(0,E.useReducer)(kr,Dr)}function Mr(){return(0,E.useContext)(Ar)}var Nr=e=>{var{initial:t,dispatch:n,children:r}=e;return(0,D.jsx)(Or.Provider,{value:t,children:(0,D.jsx)(Ar.Provider,{value:n,children:r})})};Nr.displayName=`JVR.Section`;var Pr={objectSortKeys:!1,indentWidth:15},Fr=(0,E.createContext)(Pr);Fr.displayName=`JVR.Context`;var Ir=(0,E.createContext)(()=>{});Ir.displayName=`JVR.DispatchContext`;function Lr(e,t){return P({},e,t)}var z=()=>(0,E.useContext)(Fr),Rr=e=>{var{children:t,initialState:n,initialTypes:r}=e,[i,a]=(0,E.useReducer)(Lr,Object.assign({},Pr,n)),[o,s]=er(),[c,l]=cr(),[u,d]=hr(),[f,p]=wr(),[m,h]=jr();return(0,E.useEffect)(()=>a(P({},n)),[n]),(0,D.jsx)(Fr.Provider,{value:i,children:(0,D.jsx)(Ir.Provider,{value:a,children:(0,D.jsx)(nr,{initial:o,dispatch:s,children:(0,D.jsx)(ur,{initial:c,dispatch:l,children:(0,D.jsx)(_r,{initial:P({},u,r),dispatch:d,children:(0,D.jsx)(Er,{initial:f,dispatch:p,children:(0,D.jsx)(Nr,{initial:m,dispatch:h,children:t})})})})})})})};Rr.displayName=`JVR.Provider`;function zr(e){if(e==null)throw TypeError(`Cannot destructure `+e)}var Br=[`isNumber`,`value`,`parentValue`,`keyName`,`keys`],Vr=[`as`,`render`],Hr=[`as`,`render`],Ur=[`as`,`render`],Wr=[`as`,`style`,`render`],Gr=[`as`,`render`],Kr=[`as`,`render`],qr=[`as`,`render`],Jr=[`as`,`render`],Yr=e=>{var{Quote:t={}}=L(),{isNumber:n,value:r,parentValue:i,keyName:a,keys:o}=e,s=F(e,Br);if(n)return null;var{as:c,render:l}=t,u=F(t,Vr),d=c||`span`,f=P({},s,u);return typeof f.children==`string`&&(f.children=f.children.trim()||void 0),l&&typeof l==`function`&&l(f,{value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])})||(0,D.jsx)(d,P({},f))};Yr.displayName=`JVR.Quote`;var B=e=>{var{ValueQuote:t={}}=L(),n=P({},(zr(e),e)),{as:r,render:i}=t,a=F(t,Hr),o=r||`span`,s=P({},n,a);return i&&typeof i==`function`&&i(s,{})||(0,D.jsx)(o,P({},s))};B.displayName=`JVR.ValueQuote`;var Xr=e=>{var{value:t,parentValue:n,keyName:r,keys:i}=e,{Colon:a={}}=L(),{as:o,render:s}=a,c=F(a,Ur),l=o||`span`;return s&&typeof s==`function`&&s(c,{value:t,parentValue:n,keyName:r,keys:i||(r?[r]:[])})||(0,D.jsx)(l,P({},c))};Xr.displayName=`JVR.Colon`;var Zr=e=>{var{Arrow:t={}}=L(),n=or(),{expandKey:r,style:i,value:a,parentValue:o,keyName:s,keys:c}=e,l=!!n[r],{as:u,style:d,render:f}=t,p=F(t,Wr),m=u||`span`,h=f&&typeof f==`function`,g=P({},p,{"data-expanded":l,style:P({},d,i)});return h&&f(g,{value:a,parentValue:o,keyName:s,keys:c||(s?[s]:[])})||(0,D.jsx)(m,P({},p,{style:P({},d,i)}))};Zr.displayName=`JVR.Arrow`;var Qr=e=>{var{isBrackets:t,value:n,parentValue:r,keyName:i,keys:a}=e,{BracketsLeft:o={},BraceLeft:s={}}=L(),c={value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])};if(t){var{as:l,render:u}=o,d=F(o,Gr),f=l||`span`;return u&&typeof u==`function`&&u(d,c)||(0,D.jsx)(f,P({},d))}var{as:p,render:m}=s,h=F(s,Kr),g=p||`span`;return m&&typeof m==`function`&&m(h,c)||(0,D.jsx)(g,P({},h))};Qr.displayName=`JVR.BracketsOpen`;var $r=e=>{var{isBrackets:t,isVisiable:n,value:r,parentValue:i,keyName:a,keys:o}=e,s={value:r,parentValue:i,keyName:a,keys:o||(a?[a]:[])};if(!n)return null;var{BracketsRight:c={},BraceRight:l={}}=L();if(t){var{as:u,render:d}=c,f=F(c,qr),p=u||`span`;return d&&typeof d==`function`&&d(f,s)||(0,D.jsx)(p,P({},f))}var{as:m,render:h}=l,g=F(l,Jr),_=m||`span`;return h&&typeof h==`function`&&h(g,s)||(0,D.jsx)(_,P({},g))};$r.displayName=`JVR.BracketsClose`;var ei=e=>{var{keyName:t,value:n,expandKey:r,parentValue:i,level:a,keys:o=[]}=e,s=or(),{collapsed:c,shouldExpandNodeInitially:l}=z(),u=typeof c==`boolean`?c:typeof c==`number`?a>c:!1,d=s[r]??(l?!1:u),f=l&&l(!d,{value:n,keys:o,level:a,keyName:t,parentValue:i});if(l&&c===!1){if(s[r]===void 0&&!f)return null}else if(s[r]===void 0&&f)return null;var p=Object.keys(n).length;if(d||p===0)return null;var m={paddingLeft:4},h={keyName:t,value:n,keys:o,parentValue:i},g=Array.isArray(n),_=n instanceof Set;return(0,D.jsx)(`div`,{style:m,children:(0,D.jsx)($r,P({isBrackets:g||_},h,{isVisiable:!0}))})};ei.displayName=`JVR.NestedClose`;var ti=[`as`,`render`],ni=[`as`,`render`],ri=[`as`,`render`],ii=[`as`,`render`],ai=[`as`,`render`],oi=[`as`,`render`],si=[`as`,`render`],ci=[`as`,`render`],li=[`as`,`render`],ui=[`as`,`render`],di=[`as`,`render`],fi=[`as`,`render`],pi=[`as`,`render`],mi=e=>{if(e===void 0)return`0n`;if(typeof e==`string`)try{e=BigInt(e)}catch{return`0n`}return e?e.toString()+`n`:`0n`},hi=e=>{var{value:t,keyName:n}=e,{Set:r={},displayDataTypes:i}=I();if(!(t instanceof Set)||!i)return null;var{as:a,render:o}=r,s=F(r,ti);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,D.jsx)(a||`span`,P({},s))};hi.displayName=`JVR.SetComp`;var gi=e=>{var{value:t,keyName:n}=e,{Map:r={},displayDataTypes:i}=I();if(!(t instanceof Map)||!i)return null;var{as:a,render:o}=r,s=F(r,ni);return o&&typeof o==`function`&&o(s,{type:`type`,value:t,keyName:n})||(0,D.jsx)(a||`span`,P({},s))};gi.displayName=`JVR.MapComp`;var V={opacity:.75,paddingRight:4},_i=e=>{var{children:t=``,keyName:n,keys:r}=e,{Str:i={},displayDataTypes:a}=I(),{shortenTextAfterLength:o=30,stringEllipsis:s=`...`}=z(),{as:c,render:l}=i,u=F(i,ri),d=t,[f,p]=(0,E.useState)(o&&d.length>o);(0,E.useEffect)(()=>p(o&&d.length>o),[o]);var m=c||`span`,h=P({},V,i.style||{});o>0&&(u.style=P({},u.style,{cursor:d.length<=o?`initial`:`pointer`}),d.length>o&&(u.onClick=()=>{p(!f)}));var g=f?``+d.slice(0,o)+s:d,_=l&&typeof l==`function`,v=_&&l(P({},u,{style:h}),{type:`type`,value:t,keyName:n,keys:r}),y=f?`w-rjv-value w-rjv-value-short`:`w-rjv-value`,b=_&&l(P({},u,{children:g,className:y}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(v||(0,D.jsx)(m,P({},u,{style:h}))),b||(0,D.jsxs)(E.Fragment,{children:[(0,D.jsx)(B,{}),(0,D.jsx)(m,P({},u,{className:y,children:g})),(0,D.jsx)(B,{})]})]})};_i.displayName=`JVR.TypeString`;var vi=e=>{var{children:t,keyName:n,keys:r}=e,{True:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,ii),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p||(0,D.jsx)(l,P({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};vi.displayName=`JVR.TypeTrue`;var yi=e=>{var{children:t,keyName:n,keys:r}=e,{False:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,ai),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p||(0,D.jsx)(l,P({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};yi.displayName=`JVR.TypeFalse`;var bi=e=>{var{children:t,keyName:n,keys:r}=e,{Float:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,oi),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p||(0,D.jsx)(l,P({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};bi.displayName=`JVR.TypeFloat`;var xi=e=>{var{children:t,keyName:n,keys:r}=e,{Int:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,si),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p||(0,D.jsx)(l,P({},c,{className:`w-rjv-value`,children:t?.toString()}))]})};xi.displayName=`JVR.TypeInt`;var Si=e=>{var{children:t,keyName:n,keys:r}=e,{Bigint:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,ci),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p||(0,D.jsx)(l,P({},c,{className:`w-rjv-value`,children:mi(t?.toString())}))]})};Si.displayName=`JVR.TypeFloat`;var Ci=e=>{var{children:t,keyName:n,keys:r}=e,{Url:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,li),l=o||`span`,u=P({},V,i.style),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t?.href,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p||(0,D.jsxs)(`a`,P({href:t?.href,target:`_blank`},c,{className:`w-rjv-value`,children:[(0,D.jsx)(B,{}),t?.href,(0,D.jsx)(B,{})]}))]})};Ci.displayName=`JVR.TypeUrl`;var wi=e=>{var{children:t,keyName:n,keys:r}=e,{Date:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,ui),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=t instanceof Date?t.toLocaleString():t,m=d&&s(P({},c,{children:p,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),m||(0,D.jsx)(l,P({},c,{className:`w-rjv-value`,children:p}))]})};wi.displayName=`JVR.TypeDate`;var Ti=e=>{var{children:t,keyName:n,keys:r}=e,{Undefined:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,di),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p]})};Ti.displayName=`JVR.TypeUndefined`;var Ei=e=>{var{children:t,keyName:n,keys:r}=e,{Null:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,fi),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t,className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p]})};Ei.displayName=`JVR.TypeNull`;var Di=e=>{var{children:t,keyName:n,keys:r}=e,{Nan:i={},displayDataTypes:a}=I(),{as:o,render:s}=i,c=F(i,pi),l=o||`span`,u=P({},V,i.style||{}),d=s&&typeof s==`function`,f=d&&s(P({},c,{style:u}),{type:`type`,value:t,keyName:n,keys:r}),p=d&&s(P({},c,{children:t?.toString(),className:`w-rjv-value`}),{type:`value`,value:t,keyName:n,keys:r});return(0,D.jsxs)(E.Fragment,{children:[a&&(f||(0,D.jsx)(l,P({},c,{style:u}))),p]})};Di.displayName=`JVR.TypeNan`;var Oi=e=>Number(e)===e&&e%1!=0||isNaN(e),ki=e=>{var{value:t,keyName:n,keys:r}=e,i={keyName:n,keys:r};return t instanceof URL?(0,D.jsx)(Ci,P({},i,{children:t})):typeof t==`string`?(0,D.jsx)(_i,P({},i,{children:t})):t===!0?(0,D.jsx)(vi,P({},i,{children:t})):t===!1?(0,D.jsx)(yi,P({},i,{children:t})):t===null?(0,D.jsx)(Ei,P({},i,{children:t})):t===void 0?(0,D.jsx)(Ti,P({},i,{children:t})):t instanceof Date?(0,D.jsx)(wi,P({},i,{children:t})):typeof t==`number`&&isNaN(t)?(0,D.jsx)(Di,P({},i,{children:t})):typeof t==`number`&&Oi(t)?(0,D.jsx)(bi,P({},i,{children:t})):typeof t==`bigint`?(0,D.jsx)(Si,P({},i,{children:t})):typeof t==`number`?(0,D.jsx)(xi,P({},i,{children:t})):null};ki.displayName=`JVR.Value`;function H(e,t,n){var r=Tr(),i=P({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:P({},e.style,t.style),children:t.children||e.children});(0,E.useEffect)(()=>r({[n]:i}),[t])}function U(e,t,n){var r=gr(),i=P({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:P({},e.style,t.style),children:t.children||e.children});(0,E.useEffect)(()=>r({[n]:i}),[t])}function W(e,t,n){var r=Mr(),i=P({},e,t,{className:[e.className,t.className].filter(Boolean).join(` `),style:P({},e.style,t.style),children:t.children||e.children});(0,E.useEffect)(()=>r({[n]:i}),[t])}var Ai=[`as`,`render`],ji=e=>{var{KeyName:t={}}=R();return W(t,e,`KeyName`),null};ji.displayName=`JVR.KeyName`;var Mi=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o={color:typeof t==`number`?`var(--w-rjv-key-number, #268bd2)`:`var(--w-rjv-key-string, #002b36)`},{KeyName:s={}}=R(),{as:c,render:l}=s,u=F(s,Ai);u.style=P({},u.style,o);var d=c||`span`;return l&&typeof l==`function`&&l(P({},u,{children:t}),{value:n,parentValue:r,keyName:i,keys:a||(i?[i]:[])})||(0,D.jsx)(d,P({},u,{children:t}))};Mi.displayName=`JVR.KeyNameComp`;var Ni=[`children`,`value`,`parentValue`,`keyName`,`keys`],Pi=[`as`,`render`,`children`],Fi=e=>{var{Row:t={}}=R();return W(t,e,`Row`),null};Fi.displayName=`JVR.Row`;var Ii=e=>{var{children:t,value:n,parentValue:r,keyName:i,keys:a}=e,o=F(e,Ni),{Row:s={}}=R(),{as:c,render:l}=s,u=F(s,Pi),d=c||`div`;return l&&typeof l==`function`&&l(P({},o,u,{children:t}),{value:n,keyName:i,parentValue:r,keys:a})||(0,D.jsx)(d,P({},o,u,{children:t}))};Ii.displayName=`JVR.RowComp`;function Li(e){var t=(0,E.useRef)();return(0,E.useEffect)(()=>{t.current=e}),t.current}function Ri(e){var{value:t,highlightUpdates:n,highlightContainer:r}=e,i=Li(t),a=(0,E.useMemo)(()=>{if(!n||i===void 0)return!1;if(typeof t!=typeof i)return!0;if(typeof t==`number`)return isNaN(t)&&isNaN(i)?!1:t!==i;if(Array.isArray(t)!==Array.isArray(i))return!0;if(typeof t==`object`||typeof t==`function`)return!1;if(t!==i)return!0},[n,t]);(0,E.useEffect)(()=>{r&&r.current&&a&&`animate`in r.current&&r.current.animate([{backgroundColor:`var(--w-rjv-update-color, #ebcb8b)`},{backgroundColor:``}],{duration:1e3,easing:`ease-in`})},[a,t,r])}var zi=[`keyName`,`value`,`parentValue`,`expandKey`,`keys`,`beforeCopy`],Bi=[`as`,`render`],Vi=e=>{var{keyName:t,value:n,parentValue:r,expandKey:i,keys:a,beforeCopy:o}=e,s=F(e,zi),{onCopied:c,enableClipboard:l,beforeCopy:u}=z(),d=Qn()[i],[f,p]=(0,E.useState)(!1),{Copied:m={}}=R(),h=m?.beforeCopy;if(l===!1||!d)return null;var g={style:{display:`inline-flex`},fill:f?`var(--w-rjv-copied-success-color, #28a745)`:`var(--w-rjv-copied-color, currentColor)`,onClick:e=>{e.stopPropagation();var s=``;s=typeof n==`number`&&n===1/0?`Infinity`:typeof n==`number`&&isNaN(n)?`NaN`:typeof n==`bigint`?mi(n):n instanceof Date?n.toLocaleString():JSON.stringify(n,(e,t)=>typeof t==`bigint`?mi(t):t,2);var l=o||h||u;l&&typeof l==`function`&&(s=l(s,t,n,r,i,a)),c&&c(s,n),p(!0),(navigator.clipboard||{writeText(e){return new Promise((t,n)=>{var r=document.createElement(`textarea`);r.style.position=`absolute`,r.style.opacity=`0`,r.style.left=`-99999999px`,r.value=e,document.body.appendChild(r),r.select(),document.execCommand(`copy`)?t():n(),r.remove()})}}).writeText(s).then(()=>{var e=setTimeout(()=>{p(!1),clearTimeout(e)},3e3)}).catch(e=>{})}},{render:_}=m,v=F(m,Bi),y=P({},v,s,g,{style:P({},v.style,s.style,g.style)});return _&&typeof _==`function`&&_(P({},y,{"data-copied":f}),{value:n,keyName:t,keys:a,parentValue:r})||(f?(0,D.jsx)(`svg`,P({viewBox:`0 0 32 36`},y,{children:(0,D.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,15.2249049 C29.1403264,13.8627542 29.9736597,13.1778155 30,13.1700887 C30,11.9705278 30,10.0804982 30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,26.1114493 L27.5,28.4926435 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M28.5589286,16 L32,19.6 L21.0160714,30.5382252 L13.5303571,24.2571429 L17.1303571,20.6571429 L21.0160714,24.5428571 L28.5589286,16 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})):(0,D.jsx)(`svg`,P({viewBox:`0 0 32 36`},y,{children:(0,D.jsx)(`path`,{d:`M27.5,33 L2.5,33 L2.5,12.5 L27.5,12.5 L27.5,20 L30,20 L30,7.5 C30,6.1 28.9,5 27.5,5 L20,5 C20,2.2 17.8,0 15,0 C12.2,0 10,2.2 10,5 L2.5,5 C1.1,5 0,6.1 0,7.5 L0,33 C0,34.4 1.1,36 2.5,36 L27.5,36 C28.9,36 30,34.4 30,33 L30,29 L27.5,29 L27.5,33 Z M7.5,7.5 L10,7.5 C10,7.5 12.5,6.4 12.5,5 C12.5,3.6 13.6,2.5 15,2.5 C16.4,2.5 17.5,3.6 17.5,5 C17.5,6.4 18.8,7.5 20,7.5 L22.5,7.5 C22.5,7.5 25,8.6 25,10 L5,10 C5,8.5 6.1,7.5 7.5,7.5 Z M5,27.5 L10,27.5 L10,25 L5,25 L5,27.5 Z M22.5,21.5 L22.5,16.5 L12.5,24 L22.5,31.5 L22.5,26.5 L32,26.5 L32,21.5 L22.5,21.5 Z M17.5,15 L5,15 L5,17.5 L17.5,17.5 L17.5,15 Z M10,20 L5,20 L5,22.5 L10,22.5 L10,20 Z`})})))};Vi.displayName=`JVR.Copied`;function Hi(){var e=(0,E.useRef)(null);return e.current===null&&(e.current=`custom-id-`+Math.random().toString(36).substr(2,9)),e.current}var Ui=e=>{var{keyName:t,value:n,expandKey:r=``,level:i,keys:a=[],parentValue:o}=e,s=or(),{objectSortKeys:c,indentWidth:l,collapsed:u,shouldExpandNodeInitially:d}=z(),f=typeof u==`boolean`?u:typeof u==`number`?i>u:!1,p=s[r]??(d?!1:f),m=d&&d(!p,{value:n,keys:a,level:i,keyName:t,parentValue:o});if(d&&u===!1){if(s[r]===void 0&&!m)return null}else if(s[r]===void 0&&m)return null;if(p)return null;var h=Array.isArray(n)?Object.entries(n).map(e=>[Number(e[0]),e[1]]):Object.entries(n);return c&&(h=c===!0?h.sort((e,t)=>{var[n]=e,[r]=t;return typeof n==`string`&&typeof r==`string`?n.localeCompare(r):0}):h.sort((e,t)=>{var[n,r]=e,[i,a]=t;return typeof n==`string`&&typeof i==`string`?c(n,i,r,a):0})),(0,D.jsx)(`div`,{className:`w-rjv-wrap`,style:{borderLeft:`var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)`,paddingLeft:l,marginLeft:6},children:h.map((e,t)=>{var[r,o]=e;return(0,D.jsx)(Gi,{parentValue:n,keyName:r,keys:[...a,r],value:o,level:i},t)})})};Ui.displayName=`JVR.KeyValues`;var Wi=e=>{var{keyName:t,parentValue:n,keys:r,value:i}=e,{highlightUpdates:a}=z(),o=typeof t==`number`,s=(0,E.useRef)(null);Ri({value:i,highlightUpdates:a,highlightContainer:s});var c={keyName:t,value:i,keys:r,parentValue:n};return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`span`,{ref:s,children:[(0,D.jsx)(Yr,P({isNumber:o,"data-placement":`left`},c)),(0,D.jsx)(Mi,P({},c,{children:t})),(0,D.jsx)(Yr,P({isNumber:o,"data-placement":`right`},c))]}),(0,D.jsx)(Xr,P({},c))]})};Wi.displayName=`JVR.KayName`;var Gi=e=>{var{keyName:t,value:n,parentValue:r,level:i=0,keys:a=[]}=e,o=tr(),s=Hi(),c=Array.isArray(n),l=n instanceof Set,u=n instanceof Map,d=n instanceof Date,f=n instanceof URL;return n&&typeof n==`object`&&!c&&!l&&!u&&!d&&!f||c||l||u?(0,D.jsx)(aa,{keyName:t,value:l?Array.from(n):u?Object.fromEntries(n):n,parentValue:r,initialValue:n,keys:a,level:i+1}):(0,D.jsxs)(Ii,P({className:`w-rjv-line`,value:n,keyName:t,keys:a,parentValue:r},{onMouseEnter:()=>o({[s]:!0}),onMouseLeave:()=>o({[s]:!1})},{children:[(0,D.jsx)(Wi,{keyName:t,value:n,keys:a,parentValue:r}),(0,D.jsx)(ki,{keyName:t,value:n,keys:a}),(0,D.jsx)(Vi,{keyName:t,value:n,keys:a,parentValue:r,expandKey:s})]}))};Gi.displayName=`JVR.KeyValuesItem`;var Ki=[`value`,`keyName`],qi=[`as`,`render`],Ji=e=>{var{CountInfoExtra:t={}}=R();return W(t,e,`CountInfoExtra`),null};Ji.displayName=`JVR.CountInfoExtra`;var Yi=e=>{var{value:t={},keyName:n}=e,r=F(e,Ki),{CountInfoExtra:i={}}=R(),{as:a,render:o}=i,s=F(i,qi);if(!o&&!s.children)return null;var c=a||`span`,l=o&&typeof o==`function`,u=P({},s,r);return l&&o(u,{value:t,keyName:n})||(0,D.jsx)(c,P({},u))};Yi.displayName=`JVR.CountInfoExtraComps`;var Xi=[`value`,`keyName`],Zi=[`as`,`render`],Qi=e=>{var{CountInfo:t={}}=R();return W(t,e,`CountInfo`),null};Qi.displayName=`JVR.CountInfo`;var $i=e=>{var{value:t={},keyName:n}=e,r=F(e,Xi),{displayObjectSize:i}=z(),{CountInfo:a={}}=R();if(!i)return null;var{as:o,render:s}=a,c=F(a,Zi),l=o||`span`;c.style=P({},c.style,e.style);var u=Object.keys(t).length;c.children||=u+` item`+(u===1?``:`s`);var d=P({},c,r);return s&&typeof s==`function`&&s(P({},d,{"data-length":u}),{value:t,keyName:n})||(0,D.jsx)(l,P({},d))};$i.displayName=`JVR.CountInfoComp`;var ea=[`as`,`render`],ta=e=>{var{Ellipsis:t={}}=R();return W(t,e,`Ellipsis`),null};ta.displayName=`JVR.Ellipsis`;var na=e=>{var{isExpanded:t,value:n,keyName:r}=e,{Ellipsis:i={}}=R(),{as:a,render:o}=i,s=F(i,ea),c=a||`span`;return o&&typeof o==`function`&&o(P({},s,{"data-expanded":t}),{value:n,keyName:r})||(!t||typeof n==`object`&&Object.keys(n).length==0?null:(0,D.jsx)(c,P({},s)))};na.displayName=`JVR.EllipsisComp`;var ra=e=>{var{keyName:t,expandKey:n,keys:r=[],initialValue:i,value:a,parentValue:o,level:s}=e,c=or(),l=lr(),{onExpand:u,collapsed:d,shouldExpandNodeInitially:f}=z(),p=typeof d==`boolean`?d:typeof d==`number`?s>d:!1,m=c[n]??(f?!1:p),h=f&&f(!m,{value:a,keys:r,level:s,keyName:t,parentValue:o});c[n]===void 0&&f&&(m=!h);var g=()=>{var e={expand:!m,value:a,keyid:n,keyName:t};u&&u(e),l({[n]:e.expand})},_={display:`inline-flex`,alignItems:`center`},v={transform:`rotate(`+(m?`-90`:`0`)+`deg)`,transition:`all 0.3s`},y=Object.keys(a).length,b=typeof a==`object`,x=Array.isArray(a),S=a instanceof Set,C=y!==0&&(x||S||b),ee={style:_};C&&(ee.onClick=g);var w={keyName:t,value:a,keys:r,parentValue:o};return(0,D.jsxs)(`span`,P({},ee,{children:[C&&(0,D.jsx)(Zr,P({style:v,expandKey:n},w)),(t||typeof t==`number`)&&(0,D.jsx)(Wi,P({},w)),(0,D.jsx)(hi,{value:i,keyName:t}),(0,D.jsx)(gi,{value:i,keyName:t}),(0,D.jsx)(Qr,P({isBrackets:x||S},w)),(0,D.jsx)(na,{keyName:t,value:a,isExpanded:m}),(0,D.jsx)($r,P({isVisiable:m||!C,isBrackets:x||S},w)),(0,D.jsx)($i,{value:a,keyName:t}),(0,D.jsx)(Yi,{value:a,keyName:t}),(0,D.jsx)(Vi,{keyName:t,value:a,expandKey:n,parentValue:o,keys:r})]}))};ra.displayName=`JVR.NestedOpen`;var ia=[`className`,`children`,`parentValue`,`keyid`,`level`,`value`,`initialValue`,`keys`,`keyName`],aa=(0,E.forwardRef)((e,t)=>{var{className:n=``,parentValue:r,level:i=1,value:a,initialValue:o,keys:s,keyName:c}=e,l=F(e,ia),u=tr(),d=Hi();return(0,D.jsxs)(`div`,P({className:[n,`w-rjv-inner`].filter(Boolean).join(` `),ref:t},l,{onMouseEnter:()=>u({[d]:!0}),onMouseLeave:()=>u({[d]:!1})},{children:[(0,D.jsx)(ra,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c,initialValue:o}),(0,D.jsx)(Ui,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c}),(0,D.jsx)(ei,{expandKey:d,value:a,level:i,keys:s,parentValue:r,keyName:c})]}))});aa.displayName=`JVR.Container`;var oa=e=>{var{BraceLeft:t={}}=L();return H(t,e,`BraceLeft`),null};oa.displayName=`JVR.BraceLeft`;var sa=e=>{var{BraceRight:t={}}=L();return H(t,e,`BraceRight`),null};sa.displayName=`JVR.BraceRight`;var ca=e=>{var{BracketsLeft:t={}}=L();return H(t,e,`BracketsLeft`),null};ca.displayName=`JVR.BracketsLeft`;var la=e=>{var{BracketsRight:t={}}=L();return H(t,e,`BracketsRight`),null};la.displayName=`JVR.BracketsRight`;var ua=e=>{var{Arrow:t={}}=L();return H(t,e,`Arrow`),null};ua.displayName=`JVR.Arrow`;var da=e=>{var{Colon:t={}}=L();return H(t,e,`Colon`),null};da.displayName=`JVR.Colon`;var fa=e=>{var{Quote:t={}}=L();return H(t,e,`Quote`),null};fa.displayName=`JVR.Quote`;var pa=e=>{var{ValueQuote:t={}}=L();return H(t,e,`ValueQuote`),null};pa.displayName=`JVR.ValueQuote`;var ma=e=>{var{Bigint:t={}}=I();return U(t,e,`Bigint`),null};ma.displayName=`JVR.Bigint`;var ha=e=>{var{Date:t={}}=I();return U(t,e,`Date`),null};ha.displayName=`JVR.Date`;var ga=e=>{var{False:t={}}=I();return U(t,e,`False`),null};ga.displayName=`JVR.False`;var _a=e=>{var{Float:t={}}=I();return U(t,e,`Float`),null};_a.displayName=`JVR.Float`;var va=e=>{var{Int:t={}}=I();return U(t,e,`Int`),null};va.displayName=`JVR.Int`;var ya=e=>{var{Map:t={}}=I();return U(t,e,`Map`),null};ya.displayName=`JVR.Map`;var ba=e=>{var{Nan:t={}}=I();return U(t,e,`Nan`),null};ba.displayName=`JVR.Nan`;var xa=e=>{var{Null:t={}}=I();return U(t,e,`Null`),null};xa.displayName=`JVR.Null`;var Sa=e=>{var{Set:t={}}=I();return U(t,e,`Set`),null};Sa.displayName=`JVR.Set`;var Ca=e=>{var{Str:t={}}=I();return U(t,e,`Str`),null};Ca.displayName=`JVR.StringText`;var wa=e=>{var{True:t={}}=I();return U(t,e,`True`),null};wa.displayName=`JVR.True`;var Ta=e=>{var{Undefined:t={}}=I();return U(t,e,`Undefined`),null};Ta.displayName=`JVR.Undefined`;var Ea=e=>{var{Url:t={}}=I();return U(t,e,`Url`),null};Ea.displayName=`JVR.Url`;var Da=e=>{var{Copied:t={}}=R();return W(t,e,`Copied`),null};Da.displayName=`JVR.Copied`;var Oa=[`className`,`style`,`value`,`children`,`collapsed`,`shouldExpandNodeInitially`,`indentWidth`,`displayObjectSize`,`shortenTextAfterLength`,`stringEllipsis`,`highlightUpdates`,`enableClipboard`,`displayDataTypes`,`objectSortKeys`,`onExpand`,`onCopied`,`beforeCopy`],G=(0,E.forwardRef)((e,t)=>{var{className:n=``,style:r,value:i,children:a,collapsed:o=!1,shouldExpandNodeInitially:s,indentWidth:c=15,displayObjectSize:l=!0,shortenTextAfterLength:u=30,stringEllipsis:d,highlightUpdates:f=!0,enableClipboard:p=!0,displayDataTypes:m=!0,objectSortKeys:h=!1,onExpand:g,onCopied:_,beforeCopy:v}=e,y=F(e,Oa),b=P({lineHeight:1.4,fontFamily:`var(--w-rjv-font-family, Menlo, monospace)`,color:`var(--w-rjv-color, #002b36)`,backgroundColor:`var(--w-rjv-background-color, #00000000)`,fontSize:13},r),x=[`w-json-view-container`,`w-rjv`,n].filter(Boolean).join(` `);return(0,D.jsxs)(Rr,{initialState:{value:i,objectSortKeys:h,indentWidth:c,shouldExpandNodeInitially:o===!1?s:void 0,displayObjectSize:l,collapsed:o,enableClipboard:p,shortenTextAfterLength:u,stringEllipsis:d,highlightUpdates:f,onCopied:_,onExpand:g,beforeCopy:v},initialTypes:{displayDataTypes:m},children:[(0,D.jsx)(aa,P({value:i},y,{ref:t,className:x,style:b})),a]})});G.Bigint=ma,G.Date=ha,G.False=ga,G.Float=_a,G.Int=va,G.Map=ya,G.Nan=ba,G.Null=xa,G.Set=Sa,G.String=Ca,G.True=wa,G.Undefined=Ta,G.Url=Ea,G.ValueQuote=pa,G.Arrow=ua,G.Colon=da,G.Quote=fa,G.Ellipsis=ta,G.BraceLeft=oa,G.BraceRight=sa,G.BracketsLeft=ca,G.BracketsRight=la,G.Copied=Da,G.CountInfo=Qi,G.CountInfoExtra=Ji,G.KeyName=ji,G.Row=Fi,G.displayName=`JVR.JsonView`;function ka(e){return e.pagePath??e.id}var Aa={"--w-rjv-font-family":`var(--font-family-mono)`,"--w-rjv-background-color":`transparent`,"--w-rjv-color":`var(--color-code-blue)`,"--w-rjv-key-string":`var(--color-code-blue)`,"--w-rjv-line-color":`var(--color-border-subtle)`,"--w-rjv-arrow-color":`var(--color-text-secondary)`,"--w-rjv-info-color":`var(--color-code-label)`,"--w-rjv-curlybraces-color":`var(--color-text-secondary)`,"--w-rjv-brackets-color":`var(--color-text-secondary)`,"--w-rjv-quotes-color":`var(--color-code-orange)`,"--w-rjv-quotes-string-color":`var(--color-code-orange)`,"--w-rjv-type-string-color":`var(--color-code-orange)`,"--w-rjv-type-int-color":`var(--color-code-number)`,"--w-rjv-type-float-color":`var(--color-code-number)`,"--w-rjv-type-bigint-color":`var(--color-code-number)`,"--w-rjv-type-boolean-color":`var(--color-code-keyword)`,"--w-rjv-type-null-color":`var(--color-code-keyword)`,"--w-rjv-type-nan-color":`var(--color-code-keyword)`,"--w-rjv-type-undefined-color":`var(--color-code-keyword)`,"--w-rjv-type-date-color":`var(--color-code-label)`,"--w-rjv-type-url-color":`var(--color-code-blue)`,fontSize:12,padding:`6px 8px`,wordBreak:`break-all`,whiteSpace:`pre-wrap`};function ja({state:e,onRefresh:t,onSelectBridge:n}){let{bridges:r,activeBridgeId:i,entries:a}=e,o=r.some(e=>Object.keys(a[e.id]??{}).length>0);return(0,D.jsxs)(`div`,{className:`flex flex-col overflow-hidden flex-1`,children:[(0,D.jsx)(`div`,{className:`flex items-center px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`})}),r.length>1&&(0,D.jsx)(`div`,{className:`flex gap-1 px-2 py-1 border-b border-border-subtle shrink-0 overflow-x-auto bg-bg-panel`,children:r.map(e=>{let t=e.id===i;return(0,D.jsx)(`button`,{onClick:()=>n(e.id),title:e.id,className:`shrink-0 px-2 py-0.5 text-[11px] rounded border transition-colors `+(t?`border-accent text-accent bg-surface-3`:`border-border-subtle text-text-dim hover:border-accent hover:text-accent`),children:ka(e)},e.id)})}),r.length===0||!o?(0,D.jsx)(`div`,{className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`暂无页面数据(仅显示 Page 级 data)`}):(0,D.jsx)(`div`,{className:`flex-1 overflow-hidden relative`,children:r.map(e=>{let t=e.id===i,n=a[e.id]??{},r=Object.keys(n);return(0,D.jsx)(`div`,{"data-bridge-id":e.id,className:`absolute inset-0 flex flex-col gap-2 p-2 overflow-y-auto`,style:{display:t?`flex`:`none`},children:r.length===0?(0,D.jsx)(`div`,{className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`暂无页面数据(仅显示 Page 级 data)`}):r.map(t=>(0,D.jsxs)(`div`,{className:`border border-border-subtle rounded overflow-hidden shrink-0`,children:[(0,D.jsx)(`div`,{className:`bg-surface-3 px-2 py-0.5 text-[11px] text-code-label truncate`,children:t}),(0,D.jsx)(G,{value:n[t]??{},collapsed:1,displayDataTypes:!1,displayObjectSize:!1,enableClipboard:!1,indentWidth:12,style:Aa})]},`${e.id}::${t}`))},e.id)})})]})}function Ma(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}function Na({items:e,onRefresh:t,onSet:n,onRemove:r,onClear:i,onClearAll:a,getPrefix:o}){let[s,c]=(0,E.useState)(null),[l,u]=(0,E.useState)(null),[d,f]=(0,E.useState)(!1),[p,m]=(0,E.useState)(``),[h,g]=(0,E.useState)(``),[_,v]=(0,E.useState)(``);(0,E.useEffect)(()=>{let e=!1;return o().then(t=>{e||m(t)}),()=>{e=!0}},[o]);async function y(e){f(!0),u(null);try{let t=await e();return t.ok?t:(u(t.error),null)}finally{f(!1)}}function b(e){c({key:e.key,draft:Ma(e.value)})}async function x(){if(!s)return;let{key:e,draft:t}=s;c(null),await y(()=>n(e,t))}async function S(e){await y(()=>r(e))}async function C(){e.length!==0&&await y(()=>i())}async function ee(){typeof window<`u`&&!window.confirm(`清空 simulator 中所有 appId 的 Storage 数据?该操作不可撤销。`)||await y(()=>a())}async function w(){let e=h.trim();if(!e){u(`key 不能为空`);return}let t=p+e;await y(()=>n(t,_))&&(g(``),v(``))}return(0,D.jsxs)(`div`,{className:`flex flex-col overflow-hidden flex-1`,"data-testid":`storage-panel`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 border-b border-border-subtle shrink-0 bg-bg-panel`,children:[(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:t,disabled:d,className:`hover:border-accent hover:text-accent`,children:`↻ 刷新`}),(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:C,disabled:d||e.length===0,className:`hover:border-destructive hover:text-destructive`,title:`仅清空当前 appId 的 Storage`,children:`清空`}),(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:ee,disabled:d,className:`hover:border-destructive hover:text-destructive`,title:`清空 simulator 中所有 appId 的 Storage`,children:`清空所有`}),l&&(0,D.jsx)(`span`,{className:`ml-2 text-[11px] text-destructive truncate`,title:l,children:l})]}),(0,D.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:(0,D.jsxs)(`table`,{className:`w-full border-collapse text-[12px]`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{children:[(0,D.jsx)(`th`,{className:`text-left text-code-label font-normal px-2.5 py-1 border-b border-border-subtle text-[11px] sticky top-0 bg-bg z-10`,children:`Key`}),(0,D.jsx)(`th`,{className:`text-left text-code-label font-normal px-2.5 py-1 border-b border-border-subtle text-[11px] sticky top-0 bg-bg z-10`,children:`Value`}),(0,D.jsx)(`th`,{className:`w-px sticky top-0 bg-bg z-10 border-b border-border-subtle`})]})}),(0,D.jsx)(`tbody`,{children:e.length===0?(0,D.jsx)(`tr`,{children:(0,D.jsx)(`td`,{colSpan:3,className:`text-[12px] text-text-dim text-center px-4 py-6`,children:`暂无 Storage 数据`})}):e.map(e=>{let t=s?.key===e.key;return(0,D.jsxs)(`tr`,{className:`hover:[&>td]:bg-surface`,children:[(0,D.jsx)(`td`,{className:`px-2.5 py-0.5 border-b border-border-subtle font-mono text-code-blue whitespace-nowrap w-px pr-5 align-top`,children:e.key}),(0,D.jsx)(`td`,{className:`px-2.5 py-0.5 border-b border-border-subtle font-mono text-code-orange break-all align-top cursor-text`,onClick:()=>{t||b(e)},children:t?(0,D.jsx)(`input`,{autoFocus:!0,type:`text`,value:s.draft,onChange:t=>c({key:e.key,draft:t.target.value}),onBlur:x,onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),x()):e.key===`Escape`&&(e.preventDefault(),c(null))},className:`w-full bg-transparent outline-none border border-accent/60 rounded px-1 py-0 font-mono text-code-orange`}):Ma(e.value)}),(0,D.jsx)(`td`,{className:`px-1 py-0.5 border-b border-border-subtle align-top`,children:(0,D.jsx)(`button`,{type:`button`,onClick:()=>S(e.key),disabled:d,title:`删除`,className:`text-text-dim hover:text-destructive px-1 leading-none`,children:`×`})})]},e.key)})})]})}),(0,D.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1.5 border-t border-border-subtle shrink-0 bg-bg-panel`,children:[p&&(0,D.jsx)(`span`,{className:`font-mono text-[11px] text-text-dim shrink-0`,title:`active appId prefix`,children:p}),(0,D.jsx)(`input`,{type:`text`,placeholder:`key`,value:h,onChange:e=>g(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),w())},className:`w-32 bg-transparent border border-border-subtle rounded px-1.5 py-0.5 text-[12px] font-mono outline-none focus:border-accent`}),(0,D.jsx)(`input`,{type:`text`,placeholder:`value`,value:_,onChange:e=>v(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),w())},className:`flex-1 bg-transparent border border-border-subtle rounded px-1.5 py-0.5 text-[12px] font-mono outline-none focus:border-accent`}),(0,D.jsx)(T,{variant:`outline`,size:`xs`,onClick:()=>void w(),disabled:d||!h.trim(),className:`hover:border-accent hover:text-accent`,children:`+ 新增`})]})]})}function Pa({project:e}){let t=(0,E.useRef)(null),[n,r]=(0,E.useState)(!1),{session:i,device:a,simulator:o,panelData:s,rightPane:c,popover:l}=xt({projectPath:e.path});(0,E.useEffect)(()=>{let t=`Dimina DevTools`;return document.title=`${e.name} - ${t}`,Ne().then(n=>{n?.appName&&(t=n.appName,document.title=`${e.name} - ${t}`)}).catch(()=>{}),()=>{document.title=t}},[e.name]),(0,E.useEffect)(()=>()=>{t.current!==null&&window.clearTimeout(t.current)},[]);async function u(){if(o.currentPage)try{await navigator.clipboard.writeText(o.currentPage),r(!0),t.current!==null&&window.clearTimeout(t.current),t.current=window.setTimeout(()=>r(!1),w)}catch{r(!1)}}return(0,D.jsxs)(`div`,{className:`flex flex-col h-screen`,children:[(0,D.jsx)(Un,{compileDropdownRef:l.compileDropdownRef,showCompilePanel:l.showCompilePanel,onToggleCompilePanel:l.toggleCompilePanel,onRelaunch:()=>i.relaunch(),compileStatus:i.compileStatus,rightPane:c.rightPane,onToggleRightPaneVisible:c.toggleRightPaneVisible,onSelectRightPane:c.selectRightPane}),(0,D.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[(0,D.jsx)(Wn,{simPanelWidth:a.simPanelWidth,device:a.device,zoom:a.zoom,onDeviceChange:a.handleDeviceChange,onZoomChange:a.handleZoomChange,compileStatus:i.compileStatus,preloadPath:i.preloadPath,simulatorUrl:o.simulatorUrl,simulatorRef:o.simulatorRef,currentPage:o.currentPage,copied:n,onCopyPagePath:u}),(0,D.jsx)(`div`,{className:`w-1 bg-surface-splitter border-l border-r border-border-subtle cursor-col-resize shrink-0 transition-colors hover:bg-accent active:bg-accent`,onMouseDown:a.handleSplitterDrag}),(0,D.jsxs)(`div`,{className:`flex flex-1 overflow-hidden`,children:[c.rightPane.selected===`wxml`&&(0,D.jsx)(Jn,{tree:s.wxmlTree,onRefresh:s.refreshWxml,onInspectElement:s.inspectWxmlElement,onClearInspection:s.clearWxmlElementInspection}),(0,D.jsx)(`div`,{className:`flex flex-1 overflow-hidden`,style:{display:c.rightPane.selected===`appdata`?`flex`:`none`},children:(0,D.jsx)(ja,{state:s.appData,onRefresh:s.refreshAppData,onSelectBridge:s.setActiveAppDataBridge})}),c.rightPane.selected===`storage`&&(0,D.jsx)(Na,{items:s.storageItems,onRefresh:s.refreshStorage,onSet:s.setStorageItem,onRemove:s.removeStorageItem,onClear:s.clearStorage,onClearAll:s.clearAllStorage,getPrefix:s.getStoragePrefix}),c.rightPane.selected===`simulator`&&(0,D.jsx)(`div`,{className:`flex-1`})]})]})]})}function Fa(e,t=globalThis?.document){let n=N(e);E.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Ia=`DismissableLayer`,La=`dismissableLayer.update`,Ra=`dismissableLayer.pointerDownOutside`,za=`dismissableLayer.focusOutside`,Ba,Va=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ha=E.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=E.useContext(Va),[u,d]=E.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=E.useState({}),m=A(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=Ga(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=Ka(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Fa(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),E.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ba=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),qa(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Ba)}},[u,f,n,l]),E.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),qa())},[u,l]),E.useEffect(()=>{let e=()=>p({});return document.addEventListener(La,e),()=>document.removeEventListener(La,e)},[]),(0,D.jsx)(M.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:k(e.onFocusCapture,S.onFocusCapture),onBlurCapture:k(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:k(e.onPointerDownCapture,x.onPointerDownCapture)})});Ha.displayName=Ia;var Ua=`DismissableLayerBranch`,Wa=E.forwardRef((e,t)=>{let n=E.useContext(Va),r=E.useRef(null),i=A(t,r);return E.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,D.jsx)(M.div,{...e,ref:i})});Wa.displayName=Ua;function Ga(e,t=globalThis?.document){let n=N(e),r=E.useRef(!1),i=E.useRef(()=>{});return E.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Ja(Ra,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Ka(e,t=globalThis?.document){let n=N(e),r=E.useRef(!1);return E.useEffect(()=>{let e=e=>{e.target&&!r.current&&Ja(za,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qa(){let e=new CustomEvent(La);document.dispatchEvent(e)}function Ja(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Rt(i,a):i.dispatchEvent(a)}var Ya=`focusScope.autoFocusOnMount`,Xa=`focusScope.autoFocusOnUnmount`,Za={bubbles:!1,cancelable:!0},Qa=`FocusScope`,$a=E.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=E.useState(null),l=N(i),u=N(a),d=E.useRef(null),f=A(t,e=>c(e)),p=E.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;E.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:K(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||K(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&K(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),E.useEffect(()=>{if(s){oo.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Ya,Za);s.addEventListener(Ya,l),s.dispatchEvent(t),t.defaultPrevented||(eo(lo(no(s)),{select:!0}),document.activeElement===e&&K(s))}return()=>{s.removeEventListener(Ya,l),setTimeout(()=>{let t=new CustomEvent(Xa,Za);s.addEventListener(Xa,u),s.dispatchEvent(t),t.defaultPrevented||K(e??document.body,{select:!0}),s.removeEventListener(Xa,u),oo.remove(p)},0)}}},[s,l,u,p]);let m=E.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=to(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&K(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&K(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,D.jsx)(M.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});$a.displayName=Qa;function eo(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(K(r,{select:t}),document.activeElement!==n)return}function to(e){let t=no(e);return[ro(t,e),ro(t.reverse(),e)]}function no(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ro(e,t){for(let n of e)if(!io(n,{upTo:t}))return n}function io(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function ao(e){return e instanceof HTMLInputElement&&`select`in e}function K(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ao(e)&&t&&e.select()}}var oo=so();function so(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=co(e,t),e.unshift(t)},remove(t){e=co(e,t),e[0]?.resume()}}}function co(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function lo(e){return e.filter(e=>e.tagName!==`A`)}var uo=`Portal`,fo=E.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=E.useState(!1);j(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Lt.createPortal((0,D.jsx)(M.div,{...r,ref:t}),o):null});fo.displayName=uo;var po=0;function mo(){E.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??ho()),document.body.insertAdjacentElement(`beforeend`,e[1]??ho()),po++,()=>{po===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),po--}},[])}function ho(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var q=function(){return q=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},q.apply(this,arguments)};function go(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function _o(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var vo=`right-scroll-bar-position`,yo=`width-before-scroll-bar`,bo=`with-scroll-bars-hidden`,xo=`--removed-body-scroll-bar-size`;function So(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Co(e,t){var n=(0,E.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var wo=typeof window<`u`?E.useLayoutEffect:E.useEffect,To=new WeakMap;function Eo(e,t){var n=Co(t||null,function(t){return e.forEach(function(e){return So(e,t)})});return wo(function(){var t=To.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||So(e,null)}),i.forEach(function(e){r.has(e)||So(e,a)})}To.set(n,e)},[e]),n}function Do(e){return e}function Oo(e,t){t===void 0&&(t=Do);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function ko(e){e===void 0&&(e={});var t=Oo(null);return t.options=q({async:!0,ssr:!1},e),t}var Ao=function(e){var t=e.sideCar,n=go(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return E.createElement(r,q({},n))};Ao.isSideCarExport=!0;function jo(e,t){return e.useMedium(t),Ao}var Mo=ko(),No=function(){},Po=E.forwardRef(function(e,t){var n=E.useRef(null),r=E.useState({onScrollCapture:No,onWheelCapture:No,onTouchMoveCapture:No}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=go(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Eo([n,t]),C=q(q({},b),i);return E.createElement(E.Fragment,null,u&&E.createElement(x,{sideCar:Mo,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?E.cloneElement(E.Children.only(s),q(q({},C),{ref:S})):E.createElement(v,q({},C,{className:c,ref:S}),s))});Po.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Po.classNames={fullWidth:yo,zeroRight:vo};var Fo,Io=function(){if(Fo)return Fo;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Lo(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Io();return t&&e.setAttribute(`nonce`,t),e}function Ro(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function zo(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Bo=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Lo())&&(Ro(t,n),zo(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Vo=function(){var e=Bo();return function(t,n){E.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ho=function(){var e=Vo();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Uo={left:0,top:0,right:0,gap:0},Wo=function(e){return parseInt(e||``,10)||0},Go=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Wo(n),Wo(r),Wo(i)]},Ko=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Uo;var t=Go(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},qo=Ho(),J=`data-scroll-locked`,Jo=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
2
|
-
.${bo} {
|
|
3
|
-
overflow: hidden ${r};
|
|
4
|
-
padding-right: ${s}px ${r};
|
|
5
|
-
}
|
|
6
|
-
body[${J}] {
|
|
7
|
-
overflow: hidden ${r};
|
|
8
|
-
overscroll-behavior: contain;
|
|
9
|
-
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
10
|
-
padding-left: ${i}px;
|
|
11
|
-
padding-top: ${a}px;
|
|
12
|
-
padding-right: ${o}px;
|
|
13
|
-
margin-left:0;
|
|
14
|
-
margin-top:0;
|
|
15
|
-
margin-right: ${s}px ${r};
|
|
16
|
-
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.${vo} {
|
|
20
|
-
right: ${s}px ${r};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.${yo} {
|
|
24
|
-
margin-right: ${s}px ${r};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.${vo} .${vo} {
|
|
28
|
-
right: 0 ${r};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.${yo} .${yo} {
|
|
32
|
-
margin-right: 0 ${r};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
body[${J}] {
|
|
36
|
-
${xo}: ${s}px;
|
|
37
|
-
}
|
|
38
|
-
`},Yo=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Xo=function(){E.useEffect(function(){return document.body.setAttribute(J,(Yo()+1).toString()),function(){var e=Yo()-1;e<=0?document.body.removeAttribute(J):document.body.setAttribute(J,e.toString())}},[])},Zo=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Xo();var a=E.useMemo(function(){return Ko(i)},[i]);return E.createElement(qo,{styles:Jo(a,!t,i,n?``:`!important`)})},Qo=!1;if(typeof window<`u`)try{var $o=Object.defineProperty({},`passive`,{get:function(){return Qo=!0,!0}});window.addEventListener(`test`,$o,$o),window.removeEventListener(`test`,$o,$o)}catch{Qo=!1}var Y=Qo?{passive:!1}:!1,es=function(e){return e.tagName===`TEXTAREA`},ts=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!es(e)&&n[t]===`visible`)},ns=function(e){return ts(e,`overflowY`)},rs=function(e){return ts(e,`overflowX`)},is=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ss(e,r)){var i=cs(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},as=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},os=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ss=function(e,t){return e===`v`?ns(t):rs(t)},cs=function(e,t){return e===`v`?as(t):os(t)},ls=function(e,t){return e===`h`&&t===`rtl`?-1:1},us=function(e,t,n,r,i){var a=ls(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=cs(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ss(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ds=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fs=function(e){return[e.deltaX,e.deltaY]},ps=function(e){return e&&`current`in e?e.current:e},ms=function(e,t){return e[0]===t[0]&&e[1]===t[1]},hs=function(e){return`
|
|
39
|
-
.block-interactivity-${e} {pointer-events: none;}
|
|
40
|
-
.allow-interactivity-${e} {pointer-events: all;}
|
|
41
|
-
`},gs=0,X=[];function _s(e){var t=E.useRef([]),n=E.useRef([0,0]),r=E.useRef(),i=E.useState(gs++)[0],a=E.useState(Ho)[0],o=E.useRef(e);E.useEffect(function(){o.current=e},[e]),E.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=_o([e.lockRef.current],(e.shards||[]).map(ps),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=E.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ds(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=is(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=is(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return us(h,t,e,h===`h`?s:c,!0)},[]),c=E.useCallback(function(e){var n=e;if(!(!X.length||X[X.length-1]!==a)){var r=`deltaY`in n?fs(n):ds(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ms(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ps).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=E.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:vs(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=E.useCallback(function(e){n.current=ds(e),r.current=void 0},[]),d=E.useCallback(function(t){l(t.type,fs(t),t.target,s(t,e.lockRef.current))},[]),f=E.useCallback(function(t){l(t.type,ds(t),t.target,s(t,e.lockRef.current))},[]);E.useEffect(function(){return X.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Y),document.addEventListener(`touchmove`,c,Y),document.addEventListener(`touchstart`,u,Y),function(){X=X.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Y),document.removeEventListener(`touchmove`,c,Y),document.removeEventListener(`touchstart`,u,Y)}},[]);var p=e.removeScrollBar,m=e.inert;return E.createElement(E.Fragment,null,m?E.createElement(a,{styles:hs(i)}):null,p?E.createElement(Zo,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function vs(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ys=jo(Mo,_s),bs=E.forwardRef(function(e,t){return E.createElement(Po,q({},e,{ref:t,sideCar:ys}))});bs.classNames=Po.classNames;var xs=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Z=new WeakMap,Ss=new WeakMap,Cs={},ws=0,Ts=function(e){return e&&(e.host||Ts(e.parentNode))},Es=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Ts(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ds=function(e,t,n,r){var i=Es(t,Array.isArray(e)?e:[e]);Cs[n]||(Cs[n]=new WeakMap);var a=Cs[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Z.get(e)||0)+1,l=(a.get(e)||0)+1;Z.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Ss.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),ws++,function(){o.forEach(function(e){var t=Z.get(e)-1,i=a.get(e)-1;Z.set(e,t),a.set(e,i),t||(Ss.has(e)||e.removeAttribute(r),Ss.delete(e)),i||e.removeAttribute(n)}),ws--,ws||(Z=new WeakMap,Z=new WeakMap,Ss=new WeakMap,Cs={})}},Os=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||xs(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ds(r,i,n,`aria-hidden`)):function(){return null}},ks=`Dialog`,[As,js]=Ct(ks),[Ms,Q]=As(ks),Ns=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=E.useRef(null),c=E.useRef(null),[l,u]=Bt({prop:r,defaultProp:i??!1,onChange:a,caller:ks});return(0,D.jsx)(Ms,{scope:t,triggerRef:s,contentRef:c,contentId:It(),titleId:It(),descriptionId:It(),open:l,onOpenChange:u,onOpenToggle:E.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Ns.displayName=ks;var Ps=`DialogTrigger`,Fs=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Ps,n),a=A(t,i.triggerRef);return(0,D.jsx)(M.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ec(i.open),...r,ref:a,onClick:k(e.onClick,i.onOpenToggle)})});Fs.displayName=Ps;var Is=`DialogPortal`,[Ls,Rs]=As(Is,{forceMount:void 0}),zs=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Q(Is,t);return(0,D.jsx)(Ls,{scope:t,forceMount:n,children:E.Children.map(r,e=>(0,D.jsx)(mn,{present:n||a.open,children:(0,D.jsx)(fo,{asChild:!0,container:i,children:e})}))})};zs.displayName=Is;var Bs=`DialogOverlay`,Vs=E.forwardRef((e,t)=>{let n=Rs(Bs,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q(Bs,e.__scopeDialog);return a.modal?(0,D.jsx)(mn,{present:r||a.open,children:(0,D.jsx)(Us,{...i,ref:t})}):null});Vs.displayName=Bs;var Hs=Dt(`DialogOverlay.RemoveScroll`),Us=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Bs,n);return(0,D.jsx)(bs,{as:Hs,allowPinchZoom:!0,shards:[i.contentRef],children:(0,D.jsx)(M.div,{"data-state":ec(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),$=`DialogContent`,Ws=E.forwardRef((e,t)=>{let n=Rs($,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Q($,e.__scopeDialog);return(0,D.jsx)(mn,{present:r||a.open,children:a.modal?(0,D.jsx)(Gs,{...i,ref:t}):(0,D.jsx)(Ks,{...i,ref:t})})});Ws.displayName=$;var Gs=E.forwardRef((e,t)=>{let n=Q($,e.__scopeDialog),r=E.useRef(null),i=A(t,n.contentRef,r);return E.useEffect(()=>{let e=r.current;if(e)return Os(e)},[]),(0,D.jsx)(qs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:k(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:k(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:k(e.onFocusOutside,e=>e.preventDefault())})}),Ks=E.forwardRef((e,t)=>{let n=Q($,e.__scopeDialog),r=E.useRef(!1),i=E.useRef(!1);return(0,D.jsx)(qs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),qs=E.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Q($,n),c=E.useRef(null),l=A(t,c);return mo(),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)($a,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,D.jsx)(Ha,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ec(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(ic,{titleId:s.titleId}),(0,D.jsx)(oc,{contentRef:c,descriptionId:s.descriptionId})]})]})}),Js=`DialogTitle`,Ys=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Js,n);return(0,D.jsx)(M.h2,{id:i.titleId,...r,ref:t})});Ys.displayName=Js;var Xs=`DialogDescription`,Zs=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Xs,n);return(0,D.jsx)(M.p,{id:i.descriptionId,...r,ref:t})});Zs.displayName=Xs;var Qs=`DialogClose`,$s=E.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Q(Qs,n);return(0,D.jsx)(M.button,{type:`button`,...r,ref:t,onClick:k(e.onClick,()=>i.onOpenChange(!1))})});$s.displayName=Qs;function ec(e){return e?`open`:`closed`}var tc=`DialogTitleWarning`,[nc,rc]=St(tc,{contentName:$,titleName:Js,docsSlug:`dialog`}),ic=({titleId:e})=>{let t=rc(tc),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
|
-
|
|
43
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
|
-
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return E.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ac=`DialogDescriptionWarning`,oc=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${rc(ac).contentName}}.`;return E.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},sc=Ns,cc=zs,lc=Vs,uc=Ws,dc=Ys,fc=Zs,pc=$s,mc=sc,hc=cc,gc=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(lc,{ref:n,className:v(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));gc.displayName=lc.displayName;var _c=E.forwardRef(({className:e,children:t,...n},r)=>(0,D.jsxs)(hc,{children:[(0,D.jsx)(gc,{}),(0,D.jsxs)(uc,{ref:r,className:v(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border bg-surface text-text p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg`,e),...n,children:[t,(0,D.jsxs)(pc,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-bg transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-accent focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-surface-active data-[state=open]:text-text-muted`,children:[(0,D.jsx)(Te,{className:`h-4 w-4`}),(0,D.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));_c.displayName=uc.displayName;var vc=({className:e,...t})=>(0,D.jsx)(`div`,{className:v(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});vc.displayName=`DialogHeader`;var yc=({className:e,...t})=>(0,D.jsx)(`div`,{className:v(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});yc.displayName=`DialogFooter`;var bc=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(dc,{ref:n,className:v(`text-lg font-semibold leading-none tracking-tight`,e),...t}));bc.displayName=dc.displayName;var xc=E.forwardRef(({className:e,...t},n)=>(0,D.jsx)(fc,{ref:n,className:v(`text-sm text-text-muted`,e),...t}));xc.displayName=fc.displayName;function Sc(){let[e,t]=(0,E.useState)(!1),[n,r]=(0,E.useState)(null),[i,a]=(0,E.useState)(`prompt`),[o,s]=(0,E.useState)(0),[c,l]=(0,E.useState)(``);(0,E.useEffect)(()=>f(_.Available,e=>{r(e),a(`prompt`),s(0),l(``),t(!0)}),[]),(0,E.useEffect)(()=>f(_.DownloadProgress,e=>{s(Math.round(e.percent))}),[]);let d=(0,E.useCallback)(async()=>{a(`downloading`),s(0);try{let e=await u(_.Download);e.success?a(`ready`):(l(e.error||`Download failed`),a(`error`))}catch(e){l(e instanceof Error?e.message:String(e)),a(`error`)}},[]),p=(0,E.useCallback)(()=>{u(_.Install).catch(e=>{console.warn(`[update] install failed:`,e)})},[]),m=(0,E.useCallback)(()=>{n?.mandatory&&i!==`ready`||t(!1)},[n,i]);return n?(0,D.jsx)(mc,{open:e,onOpenChange:e=>{!e&&n?.mandatory&&i!==`ready`||t(e)},children:(0,D.jsxs)(_c,{className:`max-w-md`,children:[(0,D.jsxs)(vc,{children:[(0,D.jsx)(bc,{children:i===`ready`?`Ready to Install`:`Update Available`}),(0,D.jsxs)(xc,{children:[i===`prompt`&&`New version ${n.version} is available.`,i===`downloading`&&`Downloading... ${o}%`,i===`ready`&&`Download complete. Click install to restart and apply the update.`,i===`error`&&`Download failed: ${c}`]})]}),n.releaseNotes&&i===`prompt`&&(0,D.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded border border-border bg-surface-2 p-3 text-xs text-text-secondary whitespace-pre-wrap`,children:n.releaseNotes}),i===`downloading`&&(0,D.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-surface-3`,children:(0,D.jsx)(`div`,{className:`h-full bg-accent transition-all duration-300`,style:{width:`${o}%`}})}),(0,D.jsxs)(yc,{children:[i===`prompt`&&(0,D.jsxs)(D.Fragment,{children:[!n.mandatory&&(0,D.jsx)(T,{variant:`outline`,onClick:m,children:`Later`}),(0,D.jsx)(T,{onClick:d,children:`Download`})]}),i===`ready`&&(0,D.jsx)(T,{onClick:p,children:`Install & Restart`}),i===`error`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(T,{variant:`outline`,onClick:m,children:`Close`}),(0,D.jsx)(T,{onClick:d,children:`Retry`})]})]})]})}):null}var Cc=`Dimina DevTools`;function wc(){let[e,t]=(0,E.useState)(`list`),[n,r]=(0,E.useState)(null),[i,a]=(0,E.useState)([]),[o,s]=(0,E.useState)({}),[c,l]=(0,E.useState)(Cc),[u,d]=(0,E.useState)(!1),[f,p]=(0,E.useState)([]),[m,h]=(0,E.useState)(``);async function g(){a(await Fe())}(0,E.useEffect)(()=>{g(),Ne().then(e=>{e?.appName&&(l(e.appName),document.title=e.appName)}).catch(()=>{})},[]),(0,E.useEffect)(()=>{i.length!==0&&Promise.all(i.map(e=>Ge(e.path).then(t=>[e.path,t]))).then(e=>s(Object.fromEntries(e)))},[i]),(0,E.useEffect)(()=>C(()=>{document.title=c,t(`list`),r(null),Fe().then(a)}),[c]);async function _(){let e=await Ie();if(!e)return;let t;try{t=await Le(e)}catch{return}await g(),x(t)}async function v(){let e;try{e=await qe()}catch{e=null}if(e&&`ready`in e){await g(),x(e.ready);return}if(e){let t;try{t=await Je(e)}catch{return}await g(),x(t);return}let[t,n]=await Promise.allSettled([Ke(),Ye()]);p(t.status===`fulfilled`?t.value:[]),h(n.status===`fulfilled`?n.value.baseDir:``),d(!0)}async function y(e){d(!1);let t;try{t=await Je(e)}catch{return}await g(),x(t)}async function b(e){await Re(e.path),await g()}function x(e){r(e),t(`project`)}return e===`list`?(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Sc,{}),(0,D.jsx)(ke,{projects:i,onAdd:_,onCreate:v,onOpen:x,onRemove:b,thumbnails:o}),(0,D.jsx)(Me,{open:u,templates:f,defaultBaseDir:m,onSubmit:y,onCancel:()=>d(!1),onBrowse:Ie})]}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(Sc,{}),(0,D.jsx)(Pa,{project:n},n?.path)]})}Ee.createRoot(document.getElementById(`root`)).render((0,D.jsx)(wc,{}));
|
|
46
|
-
//# sourceMappingURL=index-D8VFYBh-.js.map
|