@dimina-kit/devtools 0.4.0-dev.20260718095333 → 0.4.0-dev.20260718143821

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.
@@ -45,5 +45,5 @@ import{C as e,S as t,T as n,_ as r,a as i,c as a,f as o,g as s,h as c,l,m as u,n
45
45
 
46
46
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
47
47
 
48
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return D.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jl=`DialogDescriptionWarning`,Ml=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kl(jl).contentName}}.`;return D.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Nl=il,Pl=ul,Fl=fl,Il=gl,Ll=xl,Rl=Cl,zl=Tl,Bl=Nl,Vl=Pl,Hl=D.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Fl,{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}));Hl.displayName=Fl.displayName;var Ul=D.forwardRef(({className:e,children:t,...n},r)=>(0,O.jsxs)(Vl,{children:[(0,O.jsx)(Hl,{}),(0,O.jsxs)(Il,{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,O.jsxs)(zl,{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,O.jsx)(Ee,{className:`h-4 w-4`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Ul.displayName=Il.displayName;var Wl=({className:e,...t})=>(0,O.jsx)(`div`,{className:v(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Wl.displayName=`DialogHeader`;var Gl=({className:e,...t})=>(0,O.jsx)(`div`,{className:v(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Gl.displayName=`DialogFooter`;var Kl=D.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Ll,{ref:n,className:v(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Kl.displayName=Ll.displayName;var ql=D.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Rl,{ref:n,className:v(`text-sm text-text-muted`,e),...t}));ql.displayName=Rl.displayName;function Jl(){let[e,t]=(0,D.useState)(!1),[n,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(`prompt`),[s,c]=(0,D.useState)(0),[l,u]=(0,D.useState)(``);(0,D.useEffect)(()=>p(r.Available,e=>{i(e),o(`prompt`),c(0),u(``),t(!0)}),[]),(0,D.useEffect)(()=>p(r.DownloadProgress,e=>{c(Math.round(e.percent))}),[]);let f=(0,D.useCallback)(async()=>{o(`downloading`),c(0);try{let e=await d(r.Download);e.success?o(`ready`):(u(e.error||`Download failed`),o(`error`))}catch(e){u(e instanceof Error?e.message:String(e)),o(`error`)}},[]),m=(0,D.useCallback)(()=>{d(r.Install).catch(e=>{console.warn(`[update] install failed:`,e)})},[]),h=(0,D.useCallback)(()=>{n?.mandatory&&a!==`ready`||t(!1)},[n,a]);return n?(0,O.jsx)(Bl,{open:e,onOpenChange:e=>{!e&&n?.mandatory&&a!==`ready`||t(e)},children:(0,O.jsxs)(Ul,{className:`max-w-md`,children:[(0,O.jsxs)(Wl,{children:[(0,O.jsx)(Kl,{children:a===`ready`?`Ready to Install`:`Update Available`}),(0,O.jsxs)(ql,{children:[a===`prompt`&&`New version ${n.version} is available.`,a===`downloading`&&`Downloading... ${s}%`,a===`ready`&&`Download complete. Click install to restart and apply the update.`,a===`error`&&`Download failed: ${l}`]})]}),n.releaseNotes&&a===`prompt`&&(0,O.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}),a===`downloading`&&(0,O.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-surface-3`,children:(0,O.jsx)(`div`,{className:`h-full bg-accent transition-all duration-300`,style:{width:`${s}%`}})}),(0,O.jsxs)(Gl,{children:[a===`prompt`&&(0,O.jsxs)(O.Fragment,{children:[!n.mandatory&&(0,O.jsx)(C,{variant:`outline`,onClick:h,children:`Later`}),(0,O.jsx)(C,{onClick:f,children:`Download`})]}),a===`ready`&&(0,O.jsx)(C,{onClick:m,children:`Install & Restart`}),a===`error`&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{variant:`outline`,onClick:h,children:`Close`}),(0,O.jsx)(C,{onClick:f,children:`Retry`})]})]})]})}):null}var Yl=`Dimina DevTools`;function Xl(){let[e,t]=(0,D.useState)(`list`),[n,r]=(0,D.useState)(null),[i,a]=(0,D.useState)([]),[o,s]=(0,D.useState)({}),[c,l]=(0,D.useState)(Yl),[u,d]=(0,D.useState)(!1),[f,p]=(0,D.useState)([]),[m,h]=(0,D.useState)(``);async function g(){a(await Fe())}(0,D.useEffect)(()=>{g(),Pe().then(e=>{e?.appName&&(l(e.appName),document.title=e.appName)}).catch(()=>{})},[]),(0,D.useEffect)(()=>{i.length!==0&&Promise.all(i.map(e=>qe(e.path).then(t=>[e.path,t]))).then(e=>s(Object.fromEntries(e)))},[i]),(0,D.useEffect)(()=>{S(e===`project`?`project`:`list`)},[e]),(0,D.useEffect)(()=>w(()=>{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 Ye()}catch{e=null}if(e&&`ready`in e){await g(),x(e.ready);return}if(e){let t;try{t=await Xe(e)}catch{return}await g(),x(t);return}let[t,n]=await Promise.allSettled([Je(),Ze()]);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 Xe(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,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Jl,{}),(0,O.jsx)(Ae,{projects:i,onAdd:_,onCreate:v,onOpen:x,onRemove:b,thumbnails:o}),(0,O.jsx)(Ne,{open:u,templates:f,defaultBaseDir:m,onSubmit:y,onCancel:()=>d(!1),onBrowse:Ie})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Jl,{}),(0,O.jsx)(wo,{project:n},n?.path)]})}De.createRoot(document.getElementById(`root`)).render((0,O.jsx)(Xl,{}));
49
- //# sourceMappingURL=index-U9F8MrtV.js.map
48
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return D.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},jl=`DialogDescriptionWarning`,Ml=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kl(jl).contentName}}.`;return D.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Nl=il,Pl=ul,Fl=fl,Il=gl,Ll=xl,Rl=Cl,zl=Tl,Bl=Nl,Vl=Pl,Hl=D.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Fl,{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}));Hl.displayName=Fl.displayName;var Ul=D.forwardRef(({className:e,children:t,...n},r)=>(0,O.jsxs)(Vl,{children:[(0,O.jsx)(Hl,{}),(0,O.jsxs)(Il,{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,O.jsxs)(zl,{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,O.jsx)(Ee,{className:`h-4 w-4`}),(0,O.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Ul.displayName=Il.displayName;var Wl=({className:e,...t})=>(0,O.jsx)(`div`,{className:v(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Wl.displayName=`DialogHeader`;var Gl=({className:e,...t})=>(0,O.jsx)(`div`,{className:v(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Gl.displayName=`DialogFooter`;var Kl=D.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Ll,{ref:n,className:v(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Kl.displayName=Ll.displayName;var ql=D.forwardRef(({className:e,...t},n)=>(0,O.jsx)(Rl,{ref:n,className:v(`text-sm text-text-muted`,e),...t}));ql.displayName=Rl.displayName;function Jl(){let[e,t]=(0,D.useState)(!1),[n,i]=(0,D.useState)(null),[a,o]=(0,D.useState)(`prompt`),[s,c]=(0,D.useState)(0),[l,u]=(0,D.useState)(``),[f,m]=(0,D.useState)(`download`);(0,D.useEffect)(()=>p(r.Available,e=>{i(e),o(`prompt`),c(0),u(``),t(!0)}),[]),(0,D.useEffect)(()=>p(r.DownloadProgress,e=>{c(Math.round(e.percent))}),[]);let h=(0,D.useCallback)(async()=>{o(`downloading`),c(0);try{let e=await d(r.Download);e.success?o(`ready`):(u(e.error||`Download failed`),m(`download`),o(`error`))}catch(e){u(e instanceof Error?e.message:String(e)),m(`download`),o(`error`)}},[]),g=(0,D.useCallback)(async()=>{try{let e=await d(r.Install);e.success||(u(e.error||`Install failed`),m(`install`),o(`error`))}catch(e){u(e instanceof Error?e.message:String(e)),m(`install`),o(`error`)}},[]),_=(0,D.useCallback)(()=>{n?.mandatory&&a!==`ready`||t(!1)},[n,a]);return n?(0,O.jsx)(Bl,{open:e,onOpenChange:e=>{!e&&n?.mandatory&&a!==`ready`||t(e)},children:(0,O.jsxs)(Ul,{className:`max-w-md`,children:[(0,O.jsxs)(Wl,{children:[(0,O.jsx)(Kl,{children:a===`ready`?`Ready to Install`:`Update Available`}),(0,O.jsxs)(ql,{children:[a===`prompt`&&`New version ${n.version} is available.`,a===`downloading`&&`Downloading... ${s}%`,a===`ready`&&`Download complete. Click install to restart and apply the update.`,a===`error`&&`${f===`install`?`Install`:`Download`} failed: ${l}`]})]}),n.releaseNotes&&a===`prompt`&&(0,O.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}),a===`downloading`&&(0,O.jsx)(`div`,{className:`h-2 w-full overflow-hidden rounded-full bg-surface-3`,children:(0,O.jsx)(`div`,{className:`h-full bg-accent transition-all duration-300`,style:{width:`${s}%`}})}),(0,O.jsxs)(Gl,{children:[a===`prompt`&&(0,O.jsxs)(O.Fragment,{children:[!n.mandatory&&(0,O.jsx)(C,{variant:`outline`,onClick:_,children:`Later`}),(0,O.jsx)(C,{onClick:h,children:`Download`})]}),a===`ready`&&(0,O.jsx)(C,{onClick:g,children:`Install & Restart`}),a===`error`&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(C,{variant:`outline`,onClick:_,children:`Close`}),(0,O.jsx)(C,{onClick:f===`install`?g:h,children:`Retry`})]})]})]})}):null}var Yl=`Dimina DevTools`;function Xl(){let[e,t]=(0,D.useState)(`list`),[n,r]=(0,D.useState)(null),[i,a]=(0,D.useState)([]),[o,s]=(0,D.useState)({}),[c,l]=(0,D.useState)(Yl),[u,d]=(0,D.useState)(!1),[f,p]=(0,D.useState)([]),[m,h]=(0,D.useState)(``);async function g(){a(await Fe())}(0,D.useEffect)(()=>{g(),Pe().then(e=>{e?.appName&&(l(e.appName),document.title=e.appName)}).catch(()=>{})},[]),(0,D.useEffect)(()=>{i.length!==0&&Promise.all(i.map(e=>qe(e.path).then(t=>[e.path,t]))).then(e=>s(Object.fromEntries(e)))},[i]),(0,D.useEffect)(()=>{S(e===`project`?`project`:`list`)},[e]),(0,D.useEffect)(()=>w(()=>{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 Ye()}catch{e=null}if(e&&`ready`in e){await g(),x(e.ready);return}if(e){let t;try{t=await Xe(e)}catch{return}await g(),x(t);return}let[t,n]=await Promise.allSettled([Je(),Ze()]);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 Xe(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,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Jl,{}),(0,O.jsx)(Ae,{projects:i,onAdd:_,onCreate:v,onOpen:x,onRemove:b,thumbnails:o}),(0,O.jsx)(Ne,{open:u,templates:f,defaultBaseDir:m,onSubmit:y,onCancel:()=>d(!1),onBrowse:Ie})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Jl,{}),(0,O.jsx)(wo,{project:n},n?.path)]})}De.createRoot(document.getElementById(`root`)).render((0,O.jsx)(Xl,{}));
49
+ //# sourceMappingURL=index-DfDIvgvK.js.map
@@ -26,7 +26,7 @@
26
26
  overflow: hidden;
27
27
  }
28
28
  </style>
29
- <script type="module" crossorigin src="../../assets/index-U9F8MrtV.js"></script>
29
+ <script type="module" crossorigin src="../../assets/index-DfDIvgvK.js"></script>
30
30
  <link rel="modulepreload" crossorigin href="../../assets/ipc-transport-CuDJ07aE.js">
31
31
  <link rel="modulepreload" crossorigin href="../../assets/input-c2OcrrZy.js">
32
32
  <link rel="modulepreload" crossorigin href="../../assets/select-DKqzMtTh.js">
@@ -1,8 +1,18 @@
1
+ export const MENU_CAPSULE_WIDTH = 87;
2
+ export const MENU_CAPSULE_HEIGHT = 32;
3
+ export const MENU_CAPSULE_TRAILING_SPACING = 10;
4
+ const NAV_BAR_CONTENT_HEIGHT = {
5
+ ios: 44,
6
+ android: 64,
7
+ };
8
+ export function getMenuCapsuleTopOffset(platform) {
9
+ return (NAV_BAR_CONTENT_HEIGHT[platform] - MENU_CAPSULE_HEIGHT) / 2;
10
+ }
1
11
  export function getMenuCapsuleRect(platform, statusBarHeight, windowWidth) {
2
- const width = platform === 'ios' ? 87 : 95;
3
- const height = 32;
4
- const top = statusBarHeight + (platform === 'ios' ? 4 : 6);
5
- const right = platform === 'ios' ? 7 : 10;
6
- const left = windowWidth - right - width;
12
+ const width = MENU_CAPSULE_WIDTH;
13
+ const height = MENU_CAPSULE_HEIGHT;
14
+ const top = statusBarHeight + getMenuCapsuleTopOffset(platform);
15
+ const right = Math.max(windowWidth - MENU_CAPSULE_TRAILING_SPACING, width);
16
+ const left = right - width;
7
17
  return { width, height, top, right, bottom: top + height, left };
8
18
  }
@@ -1,8 +1,10 @@
1
1
  import { getMenuCapsuleRect } from './menu-button-geometry.js';
2
2
  /**
3
- * wx.getMenuButtonBoundingClientRect() — synchronous, returns the WeChat
4
- * capsule geometry. iOS: width 87, Android: width 95, height 32, top =
5
- * statusBarHeight + (4|6), right = (7|10). See navigation-bar spec.
3
+ * wx.getMenuButtonBoundingClientRect() — synchronous, returns the capsule
4
+ * geometry mirrored from dimina's native containers: width 87, height 32
5
+ * on both platforms; top = statusBarHeight + 6 (iOS) / + 16 (Android), since
6
+ * the nav bar content height differs (44 vs 64); right/left are absolute
7
+ * pixel positions (right = windowWidth - 10). See menu-button-geometry.ts.
6
8
  *
7
9
  * Pulls platform + dimensions from spawn-time host env snapshot (delivered
8
10
  * via `?hostEnv=` URL query, see service-host/preload.cjs).
@@ -0,0 +1,2 @@
1
+ import{i as e,n as t,t as n}from"./jsx-runtime-BDTY6fEq.js";import{t as r}from"./bridge-channels-zhsumfky.js";var i=e(),a=new Set([`audioListen`]);function o(e){return a.has(e)}function s(e,t,n,r){let i=e.apiRegistry[t];if(!i)return r({ok:!1,errMsg:`${t}:fail no handler`}),Promise.resolve();let a=o(t)||(n&&typeof n==`object`&&!Array.isArray(n)?n.keep===!0:!1);return new Promise(o=>{let s=!1,c=e=>{if(s){a&&e.ok&&r({...e,keep:!0});return}s=!0,r(a&&e.ok?{...e,keep:!0}:e),o()},l=Symbol(`sim-cb-success`),u=Symbol(`sim-cb-fail`),d=Symbol(`sim-cb-complete`),f=!1,p=Object.create(e);p.createCallbackFunction=e=>{if(e!=null)return(e===l||e===u)&&(f=!0),(...n)=>{let r=n[0];e===l?c({ok:!0,result:r}):e===u?c({ok:!1,errMsg:r&&typeof r==`object`&&`errMsg`in r?String(r.errMsg):`${t}:fail`,result:r}):e===d&&!a&&c({ok:!0,result:r})}};let m=n&&typeof n==`object`&&!Array.isArray(n)?{...n}:{};m.success=l,m.fail=u,m.complete=d;try{let e=i.call(p,m);if(e&&typeof e.then==`function`){Promise.resolve(e).then(e=>c({ok:!0,result:e}),e=>{c({ok:!1,errMsg:`${t}:fail ${e instanceof Error?e.message:String(e)}`})});return}if(s)return;if(a){o();return}if(f){o();return}c({ok:!0,result:e})}catch(e){c({ok:!1,errMsg:`${t}:fail ${e instanceof Error?e.message:String(e)}`})}})}var c={ios:44,android:64};function l(e){return(c[e]-32)/2}var u=n();function d({platform:e,statusBarHeight:t,onMoreClick:n}){return(0,u.jsxs)(`div`,{className:`menu-capsule`,style:{width:87,height:32,top:t+l(e),right:10},"aria-hidden":`true`,children:[(0,u.jsxs)(`div`,{className:`menu-capsule__more`,onClick:n,children:[(0,u.jsx)(`span`,{className:`menu-capsule__dot menu-capsule__dot--side`}),(0,u.jsx)(`span`,{className:`menu-capsule__dot menu-capsule__dot--mid`}),(0,u.jsx)(`span`,{className:`menu-capsule__dot menu-capsule__dot--side`})]}),(0,u.jsx)(`div`,{className:`menu-capsule__divider`}),(0,u.jsx)(`div`,{className:`menu-capsule__close`,children:(0,u.jsxs)(`svg`,{viewBox:`0 0 22 22`,width:`22`,height:`22`,"aria-hidden":`true`,children:[(0,u.jsx)(`circle`,{cx:`11`,cy:`11`,r:`7.8`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.4`}),(0,u.jsx)(`circle`,{cx:`11`,cy:`11`,r:`3.1`,fill:`currentColor`})]})})]})}var f={linear:`linear`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`},p={ios:`M17.51 3.87L15.73 2.1 5.84 12l9.9 9.9 1.77-1.77L9.38 12l8.13-8.13z`,android:`M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z`};function m({state:e,stackDepth:t,platform:n,statusBarHeight:r,navBarHeight:a,onBack:o,onHome:s,onMoreClick:c}){let l=(0,i.useMemo)(()=>{if(!e.colorAnimation||e.colorAnimation.durationMs<=0)return;let t=f[e.colorAnimation.timingFunc]??`linear`;return`background-color ${e.colorAnimation.durationMs}ms ${t}, color ${e.colorAnimation.durationMs}ms ${t}`},[e.colorAnimation]),m=e.style===`custom`,h=t>1,g=!h&&e.homeButtonVisible,_=n===`ios`?`center`:`left`,v=n===`android`?30:24,y={backgroundColor:e.backgroundColor,color:e.textStyle===`white`?`#ffffff`:`#000000`,height:r+a,paddingTop:r,transition:l};return(0,u.jsxs)(`header`,{className:`nav-bar nav-bar--${n} nav-bar--${e.textStyle}${m?` nav-bar--custom`:``}`,style:y,"aria-hidden":m,children:[!m&&(0,u.jsxs)(`div`,{className:`nav-bar__row`,style:{height:a,justifyContent:_===`center`?`center`:`flex-start`},children:[(h||g)&&(0,u.jsxs)(`div`,{className:`nav-bar__leading`,children:[h&&(0,u.jsx)(`button`,{type:`button`,className:`nav-bar__back`,"aria-label":`Back`,onClick:o,children:(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:v,height:v,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{d:p[n],fill:`currentColor`})})}),g&&(0,u.jsx)(`button`,{type:`button`,className:`nav-bar__home`,"aria-label":`Home`,onClick:s,children:(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`22`,height:`22`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{d:`M3 12l9-9 9 9M5 10v10h14V10`,stroke:`currentColor`,strokeWidth:`2`,fill:`none`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),(0,u.jsxs)(`div`,{className:`nav-bar__title nav-bar__title--${_}`,style:{color:e.textStyle===`white`?`#ffffff`:`#000000`},children:[e.loading&&(0,u.jsx)(`span`,{className:`nav-bar__spinner`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{className:`nav-bar__title-text`,children:e.title})]})]}),(0,u.jsx)(d,{platform:n,statusBarHeight:r,onMoreClick:c})]})}function h(e){return{title:e?.title??``,backgroundColor:e?.backgroundColor??`#000000`,textStyle:e?.textStyle??`white`,style:e?.style??`default`,loading:e?.loading??!1,homeButtonVisible:e?.homeButtonVisible??!1,colorAnimation:e?.colorAnimation}}function g(e){switch(e){case`notch`:return{width:164,height:30,top:0,bottomOnly:!0};case`dynamic-island`:return{width:124,height:36,top:11,bottomOnly:!1};default:return null}}function _({height:e,notchType:t,textStyle:n}){let r=g(t);return(0,u.jsxs)(`div`,{className:`device-statusbar`,style:{height:e,color:n===`black`?`#000000`:`#ffffff`},"aria-hidden":`true`,children:[(0,u.jsx)(`span`,{className:`device-statusbar__time`,children:`9:41`}),r&&(0,u.jsx)(`div`,{className:`device-statusbar__notch`,style:{width:r.width,height:r.height,top:r.top,borderRadius:r.bottomOnly?`0 0 ${Math.round(r.height*.6)}px ${Math.round(r.height*.6)}px`:`${r.height/2}px`}}),(0,u.jsxs)(`div`,{className:`device-statusbar__icons`,children:[(0,u.jsx)(`span`,{className:`device-statusbar__signal`}),(0,u.jsx)(`span`,{className:`device-statusbar__wifi`}),(0,u.jsx)(`span`,{className:`device-statusbar__battery`})]})]})}function v({state:e,currentPath:t,resourceBaseUrl:n,appId:r,onSwitch:i,bottomInset:a=0}){if(!e.config||!e.visible)return null;let{color:o,selectedColor:s,backgroundColor:c,borderStyle:l,list:d}=e.config,f=o||`#999999`,p=s||`#1890ff`;return(0,u.jsx)(`div`,{className:`dmb-tab-bar`,style:{backgroundColor:c||`#ffffff`,borderTopColor:l===`white`?`#ffffff`:`#e0e0e0`,paddingBottom:a},role:`tablist`,"aria-label":`TabBar`,children:d.map((a,o)=>{let s=y(a.pagePath),c=s===t,l=b(c?a.selectedIconPath??a.iconPath:a.iconPath,n,r),d=e.badges[o]??``,m=e.redDots[o]??!1;return(0,u.jsxs)(`button`,{type:`button`,className:`dmb-tab-bar__item${c?` is-selected`:``}`,role:`tab`,"aria-selected":c,onClick:()=>i(s),children:[l&&(0,u.jsx)(`span`,{className:`dmb-tab-bar__icon-slot`,children:(0,u.jsx)(`img`,{className:`dmb-tab-bar__icon`,src:l,alt:``,onError:e=>{e.currentTarget.style.display=`none`}})}),(0,u.jsx)(`span`,{className:`dmb-tab-bar__text`,style:{color:c?p:f},children:a.text||``}),d&&(0,u.jsx)(`span`,{className:`dmb-tab-bar__badge`,children:d}),!d&&m&&(0,u.jsx)(`span`,{className:`dmb-tab-bar__red-dot`})]},`${s}-${o}`)})})}function y(e){return e?e.replace(/^\/+/,``):``}function b(e,t,n){if(!e)return null;let r=e.trim();if(!r)return null;if(/^(?:data:|blob:|https?:|\/\/)/i.test(r))return r;if(!t)return null;let i=r.replace(/^\/+/,``).replace(/^\.\//,``);return i.startsWith(`${n}/`)?x(t,i):x(t,`${n}/main/${i}`)}function x(e,t){return`${e.endsWith(`/`)?e:`${e}/`}${t.replace(/^\/+/,``)}`}var S=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M23.1221%2013.3855C23.1221%2018.5302%2018.2862%2022.7007%2012.321%2022.7007C10.9486%2022.7007%209.63581%2022.48%208.42807%2022.0774C7.60996%2022.48%204.89408%2023.8264%204.89408%2023.8264C4.89408%2023.8264%205.25692%2022.0774%205.51715%2020.6206C3.07834%2018.9126%201.52002%2016.306%201.52002%2013.3855C1.52002%208.241%206.35572%204.07031%2012.321%204.07031C18.2862%204.07031%2023.1221%208.241%2023.1221%2013.3855Z'%20fill='url(%23paint0_radial_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.2446%2019.4912C12.2446%2023.6844%2016.326%2027.0838%2021.3605%2027.0838C22.5189%2027.0838%2023.6267%2026.9038%2024.646%2026.5756C25.4567%2026.9038%2027.6286%2028.0012%2027.6286%2028.0012C27.6286%2028.0012%2027.3134%2026.3862%2027.103%2025.3882C29.1612%2023.9961%2030.4764%2021.8715%2030.4764%2019.4912C30.4764%2015.2977%2026.3951%2011.8984%2021.3605%2011.8984C16.326%2011.8984%2012.2446%2015.2977%2012.2446%2019.4912Z'%20fill='url(%23paint1_radial_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.45121%208.49023C9.2684%208.49023%209.93086%209.14537%209.93086%209.95365C9.93086%2010.7618%209.2684%2011.4171%208.45121%2011.4171C7.63403%2011.4171%206.97168%2010.7618%206.97168%209.95365C6.97168%209.14537%207.63403%208.49023%208.45121%208.49023Z'%20fill='url(%23paint2_linear_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2077%208.49023C17.0247%208.49023%2017.6872%209.14537%2017.6872%209.95365C17.6872%2010.7618%2017.0247%2011.4171%2016.2077%2011.4171C15.3905%2011.4171%2014.728%2010.7618%2014.728%209.95365C14.728%209.14537%2015.3905%208.49023%2016.2077%208.49023Z'%20fill='url(%23paint3_linear_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M19.402%2016.9363C19.402%2017.6636%2018.8059%2018.2533%2018.0704%2018.2533C17.3349%2018.2533%2016.7388%2017.6636%2016.7388%2016.9363C16.7388%2016.2089%2017.3349%2015.6191%2018.0704%2015.6191C18.8059%2015.6191%2019.402%2016.2089%2019.402%2016.9363Z'%20fill='url(%23paint4_linear_87227_8743)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M24.6296%2015.6191C25.3649%2015.6191%2025.9611%2016.2089%2025.9611%2016.9363C25.9611%2017.6636%2025.3649%2018.2533%2024.6296%2018.2533C23.8942%2018.2533%2023.2979%2017.6636%2023.2979%2016.9363C23.2979%2016.2089%2023.8942%2015.6191%2024.6296%2015.6191Z'%20fill='url(%23paint5_linear_87227_8743)'/%3e%3cdefs%3e%3cradialGradient%20id='paint0_radial_87227_8743'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(12.321%204.07031)%20rotate(90)%20scale(25.1081%2027.4541)'%3e%3cstop%20stop-color='%2395FF00'/%3e%3cstop%20offset='1'%20stop-color='%2369CC15'/%3e%3c/radialGradient%3e%3cradialGradient%20id='paint1_radial_87227_8743'%20cx='0'%20cy='0'%20r='1'%20gradientUnits='userSpaceOnUse'%20gradientTransform='translate(21.3441%2011.8984)%20rotate(90)%20scale(15.2975%2017.2945)'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='1'%20stop-color='%23DFEAEB'/%3e%3c/radialGradient%3e%3clinearGradient%20id='paint2_linear_87227_8743'%20x1='6.97168'%20y1='8.49023'%20x2='6.97168'%20y2='11.4171'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F9E47'/%3e%3cstop%20offset='1'%20stop-color='%230C7B2F'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_87227_8743'%20x1='14.728'%20y1='8.49023'%20x2='14.728'%20y2='11.4171'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F9E47'/%3e%3cstop%20offset='1'%20stop-color='%230C7B2F'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_87227_8743'%20x1='16.7388'%20y1='15.6191'%20x2='16.7388'%20y2='18.2533'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%235C7564'/%3e%3cstop%20offset='1'%20stop-color='%23495E4F'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_87227_8743'%20x1='23.2979'%20y1='15.6191'%20x2='23.2979'%20y2='18.2533'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23607B68'/%3e%3cstop%20offset='1'%20stop-color='%23495E4F'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e`,C=`data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16%203C23.1797%203%2029%208.82027%2029%2016C29%2023.1796%2023.1797%2029%2016%2029C8.82027%2029%203%2023.1796%203%2016C3%208.82027%208.82027%203%2016%203ZM16.1243%2011.9418C18.3423%2011.9418%2020.1402%2013.7398%2020.1402%2015.9578C20.1402%2018.1756%2018.3423%2019.9737%2016.1243%2019.9737C13.9064%2019.9737%2012.1084%2018.1756%2012.1084%2015.9578C12.1084%2013.7398%2013.9064%2011.9418%2016.1243%2011.9418Z'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27.2082%2011.9995L19%2019.9898L27.3144%2019.9995C27.3144%2019.9995%2028.9256%2016.3089%2027.2082%2011.9995Z'%20fill='%235E9FF1'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M27%2020.9995H15L21.0382%2026.9995C21.0382%2026.9995%2025.0194%2025.4292%2027%2020.9995Z'%20fill='%2367E4EE'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M20%2027.1955L12.0097%2018.9995L12%2027.349C12%2027.349%2015.6906%2028.9102%2020%2027.1955Z'%20fill='%236DEE63'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11%2026.9995V14.9995L5%2021.1662C5%2021.1662%206.63005%2025.0188%2011%2026.9995Z'%20fill='%23BEEE65'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.81275%2019.9995L13%2012.0092L4.62657%2011.9995C4.62657%2011.9995%203.09985%2015.6901%204.81275%2019.9995Z'%20fill='%23F0DC63'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M5%2010.9995H17L10.7953%204.99951C10.7953%204.99951%206.98064%206.62957%205%2010.9995Z'%20fill='%23EDB262'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%204.80358L19.9903%2012.9995L20%204.65008C20%204.65008%2016.3094%203.08878%2012%204.80358Z'%20fill='%23F1775B'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M21%204.99951V16.9995L27%2010.9995C27%2010.9995%2025.4298%206.9801%2021%204.99951Z'%20fill='%236961EC'/%3e%3c/svg%3e`,w=`data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M21.3485%202.17401C19.7864%200.611917%2017.2537%200.611917%2015.6916%202.17401L11.2336%206.63201L12.6478%208.04622L17.1058%203.58823C17.8869%202.80718%2019.1532%202.80718%2019.9343%203.58823L20.412%204.06598C21.1931%204.84703%2021.1931%206.11336%2020.412%206.89441L14.4202%2012.8863C13.6391%2013.6673%2012.3728%2013.6673%2011.5917%2012.8863L10.7628%2012.0573L9.3486%2013.4715L10.1775%2014.3005C11.7396%2015.8626%2014.2723%2015.8626%2015.8344%2014.3005L21.8262%208.30862C23.3883%206.74652%2023.3883%204.21386%2021.8262%202.65177L21.3485%202.17401ZM2.77902%2021.8258C4.34112%2023.3879%206.87378%2023.3879%208.43588%2021.8258L12.8913%2017.3704L11.4771%2015.9562L7.02166%2020.4116C6.24062%2021.1926%204.97429%2021.1926%204.19324%2020.4116L3.58798%2019.8063C2.80694%2019.0253%202.80694%2017.759%203.58798%2016.9779L9.57583%2010.9901C10.3569%2010.209%2011.6232%2010.209%2012.4043%2010.9901L13.3129%2011.8987L14.7271%2010.4845L13.8185%209.57586C12.2564%208.01376%209.72372%208.01376%208.16162%209.57586L2.17377%2015.5637C0.611673%2017.1258%200.611673%2019.6585%202.17377%2021.2206L2.77902%2021.8258Z'%20fill='%232B263B'/%3e%3c/svg%3e`,T=`data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12%201H11V2V14.5858L5.70719%209.2929L4.29297%2010.7071L11.2223%2017.6365C11.6518%2018.066%2012.3483%2018.066%2012.7779%2017.6365L19.7072%2010.7071L18.293%209.2929L13%2014.5859V2V1H12ZM3.5%2020.5001V16.7501H1.5V20.5001C1.5%2021.6047%202.39543%2022.5001%203.5%2022.5001H20.5C21.6046%2022.5001%2022.5%2021.6047%2022.5%2020.5001V16.7501H20.5V20.5001H3.5Z'%20fill='%232B263B'/%3e%3c/svg%3e`,E=50,D=3e3;function O({dialog:e}){let[t,n]=(0,i.useState)(``),[r,a]=(0,i.useState)(``),[o,s]=(0,i.useState)(!0),c=r.trim().length>0;return(0,u.jsxs)(`div`,{className:`dmui-publish`,children:[(0,u.jsxs)(`div`,{className:`dmui-publish__nav`,children:[(0,u.jsx)(`button`,{type:`button`,className:`dmui-publish__back`,onClick:()=>e.onResult(!1),children:(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`20`,height:`20`,children:(0,u.jsx)(`path`,{d:`M15 19l-7-7 7-7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})})}),(0,u.jsxs)(`div`,{className:`dmui-publish__island-chip`,children:[e.islandImage?(0,u.jsx)(`img`,{className:`dmui-publish__chip-avatar`,src:e.islandImage,alt:``}):(0,u.jsx)(`div`,{className:`dmui-publish__chip-avatar dmui-publish__chip-avatar--placeholder`}),(0,u.jsx)(`span`,{className:`dmui-publish__chip-name`,children:e.islandName||`未命名岛`}),(0,u.jsx)(`span`,{className:`dmui-publish__chip-tag`,children:`岛`})]}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-publish__submit${c?``:` dmui-publish__submit--disabled`}`,disabled:!c,onClick:()=>e.onResult(!0),children:`发布`})]}),(0,u.jsxs)(`div`,{className:`dmui-publish__body`,children:[(0,u.jsx)(`div`,{className:`dmui-publish__images`,children:(0,u.jsx)(`div`,{className:`dmui-publish__image-add`,children:(0,u.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`24`,height:`24`,children:(0,u.jsx)(`path`,{d:`M12 5v14M5 12h14`,fill:`none`,stroke:`#999`,strokeWidth:`2`,strokeLinecap:`round`})})})}),(0,u.jsx)(`input`,{className:`dmui-publish__title`,placeholder:`标题 (50字以内)`,value:t,maxLength:E,onChange:e=>n(e.target.value)}),(0,u.jsx)(`textarea`,{className:`dmui-publish__content`,placeholder:`写下你的想法...`,value:r,maxLength:D,onChange:e=>a(e.target.value)})]}),(0,u.jsxs)(`div`,{className:`dmui-publish__toolbar`,children:[(0,u.jsxs)(`span`,{className:`dmui-publish__count`,children:[r.length,`/`,D]}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-publish__privacy`,onClick:()=>s(!o),children:o?`公开`:`私密`})]})]})}function ee(){let[{toast:e,dialog:n},r]=(0,i.useState)(()=>t.getState());return(0,i.useEffect)(()=>t.subscribe(r),[]),(0,u.jsxs)(u.Fragment,{children:[e&&(0,u.jsx)(k,{toast:e}),n?.kind===`modal`&&(0,u.jsx)(j,{dialog:n}),n?.kind===`actionSheet`&&(0,u.jsx)(M,{dialog:n}),n?.kind===`halfSheet`&&(0,u.jsx)(te,{dialog:n}),n?.kind===`capsuleMenu`&&(0,u.jsx)(ne,{dialog:n}),n?.kind===`share`&&(0,u.jsx)(P,{dialog:n}),n?.kind===`openPost`&&(0,u.jsx)(O,{dialog:n})]})}function k({toast:e}){(0,i.useEffect)(()=>{if(!Number.isFinite(e.duration))return;let n=window.setTimeout(()=>t.dismissToast(e),e.duration);return()=>window.clearTimeout(n)},[e]);let n=e.icon!==`none`||!!e.image;return(0,u.jsxs)(`div`,{className:`dmui-overlay`,"aria-live":`polite`,children:[e.mask&&(0,u.jsx)(`div`,{className:`dmui-mask dmui-mask--transparent`}),(0,u.jsxs)(`div`,{className:`dmui-toast${n?``:` dmui-toast--text`}`,role:`alert`,children:[e.image?(0,u.jsx)(`img`,{className:`dmui-toast__image`,src:e.image,alt:``}):(0,u.jsx)(A,{icon:e.icon}),e.title&&(0,u.jsx)(`div`,{className:`dmui-toast__title`,children:e.title})]})]})}function A({icon:e}){return e===`success`?(0,u.jsx)(`svg`,{className:`dmui-toast__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{d:`M5 13l4 4L19 7`})}):e===`error`?(0,u.jsx)(`svg`,{className:`dmui-toast__icon`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,u.jsx)(`path`,{d:`M6 6l12 12M18 6L6 18`})}):e===`loading`?(0,u.jsx)(`span`,{className:`dmui-toast__spinner`,"aria-hidden":`true`}):null}function j({dialog:e}){let[t,n]=(0,i.useState)(``),r=(0,i.useRef)(null);return(0,i.useEffect)(()=>{e.editable&&r.current?.focus()},[e.editable]),(0,u.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,u.jsx)(`div`,{className:`dmui-mask`}),(0,u.jsxs)(`div`,{className:`dmui-modal`,role:`dialog`,"aria-modal":`true`,children:[e.title&&(0,u.jsx)(`div`,{className:`dmui-modal__title`,children:e.title}),e.editable?(0,u.jsx)(`input`,{ref:r,className:`dmui-modal__input`,value:t,placeholder:e.placeholderText,onChange:e=>n(e.target.value)}):e.content&&(0,u.jsx)(`div`,{className:`dmui-modal__content`,children:e.content}),(0,u.jsxs)(`div`,{className:`dmui-modal__actions`,children:[e.showCancel&&(0,u.jsx)(`button`,{type:`button`,className:`dmui-modal__button`,style:{color:e.cancelColor},onClick:()=>e.onResult(!1),children:e.cancelText}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-modal__button`,style:{color:e.confirmColor},onClick:()=>e.onResult(!0,t),children:e.confirmText})]})]})]})}function M({dialog:e}){return(0,u.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,u.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onSelect(-1)}),(0,u.jsxs)(`div`,{className:`dmui-action-sheet`,role:`menu`,children:[(0,u.jsx)(`div`,{className:`dmui-action-sheet__items`,children:e.itemList.map((t,n)=>(0,u.jsx)(`button`,{type:`button`,className:`dmui-action-sheet__item`,style:{color:e.itemColor},onClick:()=>e.onSelect(n),children:t},n))}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-action-sheet__cancel`,onClick:()=>e.onSelect(-1),children:`取消`})]})]})}function te({dialog:e}){return(0,u.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,u.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onResult(!1)}),(0,u.jsxs)(`div`,{className:`dmui-half-sheet`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsx)(`div`,{className:`dmui-half-sheet__title`,children:`加入岛即可发布讨论`}),(0,u.jsx)(`div`,{className:`dmui-half-sheet__divider`}),(0,u.jsxs)(`div`,{className:`dmui-half-sheet__row`,children:[e.islandAvatar&&(0,u.jsx)(`img`,{className:`dmui-half-sheet__avatar`,src:e.islandAvatar,alt:``}),(0,u.jsxs)(`div`,{className:`dmui-half-sheet__info`,children:[(0,u.jsx)(`div`,{className:`dmui-half-sheet__name`,children:e.islandName}),(0,u.jsxs)(`div`,{className:`dmui-half-sheet__members`,children:[e.memberCount,`人加入`]})]}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-half-sheet__join`,onClick:()=>e.onResult(!0),children:`加入`})]}),(0,u.jsx)(`div`,{className:`dmui-half-sheet__divider`}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-half-sheet__cancel`,onClick:()=>e.onResult(!1),children:`取消`})]})]})}function ne({dialog:e}){return(0,u.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,u.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onSelect(-1)}),(0,u.jsxs)(`div`,{className:`dmui-bottom-sheet`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsxs)(`div`,{className:`dmui-capsule-menu__header`,children:[e.appAvatar?(0,u.jsx)(`img`,{className:`dmui-capsule-menu__avatar`,src:e.appAvatar,alt:``}):(0,u.jsx)(`div`,{className:`dmui-capsule-menu__avatar dmui-capsule-menu__avatar--placeholder`}),(0,u.jsxs)(`div`,{className:`dmui-capsule-menu__app-info`,children:[(0,u.jsx)(`div`,{className:`dmui-capsule-menu__app-name`,children:e.appName}),(0,u.jsxs)(`div`,{className:`dmui-capsule-menu__app-version`,children:[`V`,e.appVersion]})]})]}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__grid`,children:e.items.map((t,n)=>(0,u.jsxs)(`button`,{type:`button`,className:`dmui-bottom-sheet__grid-item`,onClick:()=>e.onSelect(n),children:[(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__icon-circle`,children:t.icon}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__item-label`,children:t.label})]},n))}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-bottom-sheet__cancel`,onClick:()=>e.onSelect(-1),children:`取消`})]})]})}var N=[{label:`微信`,icon:S},{label:`朋友圈`,icon:C}];function P({dialog:e}){let t=e.type===`image`?{label:`保存图片`,icon:T}:{label:`复制链接`,icon:w};return(0,u.jsxs)(`div`,{className:`dmui-overlay`,children:[(0,u.jsx)(`div`,{className:`dmui-mask`,onClick:()=>e.onSelect(-1)}),(0,u.jsxs)(`div`,{className:`dmui-bottom-sheet`,role:`dialog`,"aria-modal":`true`,children:[(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__title`,children:`分享到`}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,u.jsxs)(`div`,{className:`dmui-bottom-sheet__grid`,children:[N.map((t,n)=>(0,u.jsxs)(`button`,{type:`button`,className:`dmui-bottom-sheet__grid-item`,onClick:()=>e.onSelect(n),children:[(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__icon-circle`,children:(0,u.jsx)(`img`,{className:`dmui-bottom-sheet__icon-img`,src:t.icon,alt:t.label})}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__item-label`,children:t.label})]},n)),(0,u.jsxs)(`button`,{type:`button`,className:`dmui-bottom-sheet__grid-item`,onClick:()=>e.onSelect(N.length),children:[(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__icon-circle`,children:(0,u.jsx)(`img`,{className:`dmui-bottom-sheet__icon-img`,src:t.icon,alt:t.label})}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__item-label`,children:t.label})]})]}),(0,u.jsx)(`div`,{className:`dmui-bottom-sheet__divider`}),(0,u.jsx)(`button`,{type:`button`,className:`dmui-bottom-sheet__cancel`,onClick:()=>e.onSelect(-1),children:`取消`})]})]})}function F(e,n){let r={kind:`capsuleMenu`,appName:n||`小程序`,appAvatar:``,appVersion:`1.0.0`,items:[{label:`复制链接`,icon:`🔗`}],onSelect(n){n===0&&navigator.clipboard.writeText(`https://qiandao.com/miniapp?appId=${e}`),t.hideDialog()}};t.showDialog(r)}function I(e){if(!e)return{config:null,visible:!1,badges:[],redDots:[]};let t=e.list.length;return{config:L(e),visible:!0,badges:Array.from({length:t},()=>``),redDots:Array.from({length:t},()=>!1)}}function L(e){return{...e,list:e.list.map(e=>({...e}))}}function R(e,t){switch(t.kind){case`reset`:return{state:I(t.config),ok:!0,errMsg:`reset:ok`};case`visibility`:return{state:{...e,visible:t.visible},ok:!0,errMsg:t.visible?`showTabBar:ok`:`hideTabBar:ok`};case`apply`:return z(e,t.name,t.params)}}function z(e,t,n){if(!e.config)return{state:e,ok:!1,errMsg:`${t}:fail tabBar not configured`};switch(t){case`setTabBarStyle`:return B(e,n);case`setTabBarItem`:return V(e,n);case`showTabBar`:return{state:{...e,visible:!0},ok:!0,errMsg:`showTabBar:ok`};case`hideTabBar`:return{state:{...e,visible:!1},ok:!0,errMsg:`hideTabBar:ok`};case`setTabBarBadge`:return H(e,n);case`removeTabBarBadge`:return U(e,n);case`showTabBarRedDot`:return W(e,n,!0);case`hideTabBarRedDot`:return W(e,n,!1)}}function B(e,t){if(!e.config)return{state:e,ok:!1,errMsg:`setTabBarStyle:fail tabBar not configured`};let n={...e.config},r=(e,t)=>{let r=K(t);r&&(n[e]=r)};return r(`color`,t.color),r(`selectedColor`,t.selectedColor),r(`backgroundColor`,t.backgroundColor),(t.borderStyle===`black`||t.borderStyle===`white`)&&(n.borderStyle=t.borderStyle),{state:{...e,config:n},ok:!0,errMsg:`setTabBarStyle:ok`}}function V(e,t){let n=G(e,t);if(n.err)return{state:e,ok:!1,errMsg:`setTabBarItem:fail ${n.err}`};if(!e.config)return{state:e,ok:!1,errMsg:`setTabBarItem:fail tabBar not configured`};let r=e.config.list[n.index],i={...r,text:typeof t.text==`string`?t.text:r.text,iconPath:typeof t.iconPath==`string`?t.iconPath:r.iconPath,selectedIconPath:typeof t.selectedIconPath==`string`?t.selectedIconPath:r.selectedIconPath},a=[...e.config.list];return a[n.index]=i,{state:{...e,config:{...e.config,list:a}},ok:!0,errMsg:`setTabBarItem:ok`}}function H(e,t){let n=G(e,t);if(n.err)return{state:e,ok:!1,errMsg:`setTabBarBadge:fail ${n.err}`};let r=[...e.badges];r[n.index]=String(t.text??``);let i=[...e.redDots];return i[n.index]=!1,{state:{...e,badges:r,redDots:i},ok:!0,errMsg:`setTabBarBadge:ok`}}function U(e,t){let n=G(e,t);if(n.err)return{state:e,ok:!1,errMsg:`removeTabBarBadge:fail ${n.err}`};let r=[...e.badges];return r[n.index]=``,{state:{...e,badges:r},ok:!0,errMsg:`removeTabBarBadge:ok`}}function W(e,t,n){let r=G(e,t);if(r.err)return{state:e,ok:!1,errMsg:`${n?`showTabBarRedDot`:`hideTabBarRedDot`}:fail ${r.err}`};let i=[...e.redDots];i[r.index]=n;let a=[...e.badges];return n&&(a[r.index]=``),{state:{...e,redDots:i,badges:a},ok:!0,errMsg:`${n?`showTabBarRedDot`:`hideTabBarRedDot`}:ok`}}function G(e,t){let n=e.config?.list??[],r=t.index,i=Number(r);return n.length?r==null||!Number.isInteger(i)||i<0||i>=n.length?{index:-1,err:`invalid index ${r}`}:{index:i,err:null}:{index:-1,err:`tabBar not configured`}}function K(e){if(typeof e!=`string`)return null;let t=e.trim();return!t||t.length>64?null:/[<>"';{}()\\]/.test(t)?/^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/-]+\)$/i.test(t)?t:null:t}function q(e){return e?e.replace(/^\/+/,``):``}function J(e){if(!e)return null;let t=e.indexOf(`=`),n=t>=0?e.slice(0,t):e,r=t>=0?e.slice(t+1):``;return n?[decodeURIComponent(n),decodeURIComponent(r)]:null}function Y(e){let t={};for(let n of e.split(`&`)){let e=J(n);e&&(t[e[0]]=e[1])}return t}function X(e){let[t,n]=(typeof e==`string`?e:``).split(`?`);return{pagePath:q(t),query:n?Y(n):{}}}function Z(e){let t={};return e.isTab&&(t[e.pagePath]=[e]),{stack:[e],tabStacks:t,currentTabPath:e.isTab?e.pagePath:null}}function re(e){return e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:[...e.stack]}:e.tabStacks}function ie(e,t){let n=e.stack[e.stack.length-1],r=[...e.stack,t];return{next:{...e,stack:r,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:r}:e.tabStacks},effects:n?[{kind:`lifecycle`,bridgeId:n.bridgeId,event:`pageHide`}]:[]}}function ae(e,t){if(e.stack.length<=1)return{error:`no page to back`};let n=Math.min(Math.max(1,Number.isFinite(t)?t:1),e.stack.length-1),r=e.stack.slice(e.stack.length-n),i=e.stack.slice(0,e.stack.length-n),a=i[i.length-1],o={...e,stack:i,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:i}:e.tabStacks,currentTabPath:a.isTab?a.pagePath:e.currentTabPath},s=[];for(let e of r)s.push({kind:`lifecycle`,bridgeId:e.bridgeId,event:`pageUnload`}),s.push({kind:`closePage`,bridgeId:e.bridgeId});return s.push({kind:`lifecycle`,bridgeId:a.bridgeId,event:`pageShow`}),{next:o,effects:s}}function oe(e,t){let n=e.stack[e.stack.length-1],r=[...e.stack.slice(0,e.stack.length-1),t],i={...e,stack:r,tabStacks:e.currentTabPath?{...e.tabStacks,[e.currentTabPath]:r}:e.tabStacks},a=[];return n&&(a.push({kind:`lifecycle`,bridgeId:n.bridgeId,event:`pageUnload`}),a.push({kind:`closePage`,bridgeId:n.bridgeId})),{next:i,effects:a}}function se(e,t){let n=new Set;for(let t of e.stack)n.add(t.bridgeId);for(let t of Object.values(e.tabStacks))for(let e of t)n.add(e.bridgeId);n.delete(t.bridgeId);let r=t.isTab?{[t.pagePath]:[t]}:{},i={stack:[t],tabStacks:r,currentTabPath:t.isTab?t.pagePath:null},a=[];for(let e of n)a.push({kind:`lifecycle`,bridgeId:e,event:`pageUnload`}),a.push({kind:`closePage`,bridgeId:e});return{next:i,effects:a}}function ce(e,t,n){let r=e.stack[e.stack.length-1],i=re(e),a,o=i[t];if(o&&o.length>0)a=o;else if(n)a=[n];else throw Error(`[page-stack] switchTab to ${t} requires either a cached substack or a freshly-opened entry`);let s={...e,stack:a,tabStacks:{...i,[t]:a},currentTabPath:t},c=a[a.length-1],l=[];return r&&r.bridgeId!==c.bridgeId&&l.push({kind:`lifecycle`,bridgeId:r.bridgeId,event:`pageHide`}),n||l.push({kind:`lifecycle`,bridgeId:c.bridgeId,event:`pageShow`}),{next:s,effects:l}}function le(e){let t=new Map,n=e.stack[e.stack.length-1]?.bridgeId,r=e=>{t.has(e.bridgeId)||t.set(e.bridgeId,{entry:e,visible:e.bridgeId===n})};for(let t of Object.values(e.tabStacks))for(let e of t)r(e);for(let t of e.stack)r(t);return Array.from(t.values())}function Q(e,t){let n=e.navigationBarBackgroundColor??`#ffffff`,r=e.navigationBarTextStyle??`black`,i=e.navigationStyle??`default`;return h({title:e.navigationBarTitleText??t,backgroundColor:n,textStyle:r,style:i,homeButtonVisible:e.homeButton===!0})}function ue(e,t,n){switch(t){case`setNavigationBarTitle`:return{...e,title:typeof n.title==`string`?n.title:e.title};case`setNavigationBarColor`:return fe(e,n);case`showNavigationBarLoading`:return{...e,loading:!0};case`hideNavigationBarLoading`:return{...e,loading:!1};case`hideHomeButton`:return{...e,homeButtonVisible:!1};default:return e}}var de=[`linear`,`easeIn`,`easeOut`,`easeInOut`];function fe(e,t){let n=typeof t.frontColor==`string`?t.frontColor.toLowerCase():void 0,r=n===`#ffffff`?`white`:n===`#000000`?`black`:e.textStyle,i=typeof t.backgroundColor==`string`?t.backgroundColor:e.backgroundColor,a=(()=>{let e=t.animation;if(!e||typeof e!=`object`)return;let n=e,r=typeof n.duration==`number`&&Number.isFinite(n.duration)?Math.max(0,n.duration):0,i=typeof n.timingFunc==`string`?n.timingFunc:`linear`;return{durationMs:r,timingFunc:de.includes(i)?i:`linear`}})();return{...e,textStyle:r,backgroundColor:i,colorAnimation:a}}function pe(e,t,n){let r=e=>e.bridgeId===t?{...e,navBar:n(e.navBar)}:e,i=e.stack.map(r),a={};for(let[t,n]of Object.entries(e.tabStacks))a[t]=n.map(r);return{...e,stack:i,tabStacks:a}}var $=44,me=24,he=44;function ge({miniApp:e,bridgeId:t,platform:n=`ios`}){let[a,o]=(0,i.useState)(()=>e.getInitialDevice());(0,i.useEffect)(()=>e.onSimulatorEvent(r.DEVICE_CHANGE,o),[e]);let c=a?.safeAreaInsets.top??(n===`ios`?$:me),l=a?.safeAreaInsets.bottom??0,d=a?.notchType??`none`,f=(0,i.useMemo)(()=>e.getRenderPreloadUrl(),[e]),p=(0,i.useMemo)(()=>e.getTabBarConfig(),[e]),h=(0,i.useMemo)(()=>({bridgeId:t,pagePath:q(e.pagePath),query:{...e.query},isTab:!!e.getTabBarConfig()?.list.some(t=>q(t.pagePath)===q(e.pagePath)),windowConfig:e.rootWindowConfig??{},navBar:Q(e.rootWindowConfig??{},e.appId)}),[e,t]),[{shell:g,tabBar:y},b]=(0,i.useState)(()=>({shell:Z(h),tabBar:I(p)})),x=(0,i.useRef)({shell:g,tabBar:y});(0,i.useEffect)(()=>{x.current={shell:g,tabBar:y}},[g,y]);let S=(0,i.useCallback)(t=>{for(let n of t)n.kind===`lifecycle`?e.notifyLifecycle(n.bridgeId,n.event):n.kind===`closePage`&&e.closePage(n.bridgeId)},[e]);(0,i.useEffect)(()=>e.onSimulatorEvent(r.NAV_BAR,e=>{b(t=>({...t,shell:pe(t.shell,e.bridgeId,t=>ue(t,e.name,e.params))}))}),[e]),(0,i.useEffect)(()=>e.onSessionEvent(r.TAB_ACTION,t=>{let n=R(x.current.tabBar,{kind:`apply`,name:t.name,params:t.params});b(e=>({...e,tabBar:n.state})),e.notifyNavCallback({ok:n.ok,errMsg:n.errMsg,callbacks:t.callbacks})}),[e]);let C=(0,i.useCallback)(async t=>{let n=(n,r)=>e.notifyNavCallback({ok:n,errMsg:r,callbacks:t.callbacks});try{switch(t.name){case`navigateTo`:await _e(e,x,b,S,t,n);break;case`navigateBack`:ve(x,b,S,t,n);break;case`redirectTo`:await ye(e,x,b,S,t,n);break;case`reLaunch`:await be(e,x,b,S,t,n);break;case`switchTab`:await xe(e,x,b,S,t,n);break}}catch(e){n(!1,`${t.name}:fail ${e instanceof Error?e.message:String(e)}`)}},[e,S]);(0,i.useEffect)(()=>e.onSessionEvent(r.NAV_ACTION,e=>{C(e)}),[C,e]),(0,i.useEffect)(()=>e.onSessionEvent(r.API_CALL,t=>{s(e,t.name,t.params,n=>{e.notifyApiResponse({requestId:t.requestId,ok:n.ok,result:n.result,errMsg:n.errMsg,keep:n.keep})})}),[e]);let w=(0,i.useCallback)(()=>{if(x.current.shell.stack.length<=1)return;let t=x.current.shell.stack;C({appSessionId:e.appSessionId??``,bridgeId:t[t.length-1].bridgeId,name:`navigateBack`,params:{delta:1},callbacks:{}})},[e,C]),T=(0,i.useCallback)(t=>{let n=x.current.shell;t===n.currentTabPath&&n.stack.length===1||C({appSessionId:e.appSessionId??``,bridgeId:n.stack[n.stack.length-1].bridgeId,name:`switchTab`,params:{url:`/${t}`},callbacks:{}})},[e,C]),E=(0,i.useCallback)(()=>{let t=x.current.shell.stack;F(e.appId,t[t.length-1].navBar.title)},[e]),D=g.stack[g.stack.length-1],O=le(g);return(0,i.useEffect)(()=>{e.notifyActivePage(D.bridgeId)},[e,D.bridgeId]),(0,i.useEffect)(()=>{e.notifyPageStack(g.stack.map(e=>({pagePath:e.pagePath,query:e.query})))},[e,g.stack]),(0,u.jsx)(`main`,{className:`device-shell-root`,children:(0,u.jsxs)(`section`,{className:`device-shell`,"aria-label":`Dimina simulator`,style:a?{width:a.screenWidth,height:a.screenHeight}:void 0,children:[(0,u.jsx)(_,{height:c,notchType:d,textStyle:D.navBar.textStyle}),(0,u.jsx)(m,{state:D.navBar,stackDepth:g.stack.length,platform:n,statusBarHeight:c,navBarHeight:he,onBack:w,onMoreClick:E}),(0,u.jsx)(`div`,{className:`device-shell__viewport`,children:O.map(({entry:t,visible:n})=>(0,u.jsx)(`webview`,{className:`device-shell__webview`,src:e.createRenderHostUrl(t.bridgeId,t.pagePath,t.isTab),preload:f,allowpopups:`true`,style:{display:n?`flex`:`none`,zIndex:n?100:1}},t.bridgeId))}),D.isTab&&(0,u.jsx)(v,{state:y,currentPath:g.currentTabPath,resourceBaseUrl:e.resourceBaseUrl,appId:e.appId,onSwitch:T,bottomInset:l}),(0,u.jsx)(ee,{}),l>0&&(0,u.jsx)(`div`,{className:`device-shell__home-indicator`,style:{height:l},"aria-hidden":`true`})]})})}async function _e(e,t,n,r,i,a){let{pagePath:o,query:s}=X(i.params.url);if(!o){a(!1,`navigateTo:fail invalid url`);return}if(e.getTabBarConfig()?.list.some(e=>q(e.pagePath)===o)){a(!1,`navigateTo:fail can not navigateTo a tabbar page`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:Q(c.windowConfig,e.appId)},{next:u,effects:d}=ie(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`navigateTo:ok`)}function ve(e,t,n,r,i){let a=r.params.delta,o=Number.isFinite(Number(a))?Number(a):1,s=ae(e.current.shell,o);if(`error`in s){i(!1,`navigateBack:fail ${s.error}`);return}t(e=>({...e,shell:s.next})),n(s.effects),i(!0,`navigateBack:ok`)}async function ye(e,t,n,r,i,a){let{pagePath:o,query:s}=X(i.params.url);if(!o){a(!1,`redirectTo:fail invalid url`);return}if(e.getTabBarConfig()?.list.some(e=>q(e.pagePath)===o)){a(!1,`redirectTo:fail can not redirectTo a tabbar page`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:Q(c.windowConfig,e.appId)},{next:u,effects:d}=oe(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`redirectTo:ok`)}async function be(e,t,n,r,i,a){let{pagePath:o,query:s}=X(i.params.url);if(!o){a(!1,`reLaunch:fail invalid url`);return}let c=await e.openPage(o,s),l={bridgeId:c.bridgeId,pagePath:c.pagePath,query:s,isTab:c.isTab,windowConfig:c.windowConfig,navBar:Q(c.windowConfig,e.appId)},{next:u,effects:d}=se(t.current.shell,l);n(e=>({...e,shell:u})),r(d),a(!0,`reLaunch:ok`)}async function xe(e,t,n,r,i,a){let{pagePath:o}=X(i.params.url);if(!o){a(!1,`switchTab:fail invalid url`);return}if(!e.getTabBarConfig()?.list.some(e=>q(e.pagePath)===o)){a(!1,`switchTab:fail not a tabBar page: ${o}`);return}let s=t.current.shell.tabStacks[o],c=null;if(!s||s.length===0){let t=await e.openPage(o,{});c={bridgeId:t.bridgeId,pagePath:t.pagePath,query:{},isTab:!0,windowConfig:t.windowConfig,navBar:Q(t.windowConfig,e.appId)}}let{next:l,effects:u}=ce(t.current.shell,o,c);n(e=>({...e,shell:l})),r(u),a(!0,`switchTab:ok`)}export{ge as DeviceShell};
2
+ //# sourceMappingURL=device-shell-Cs-rmP1f.js.map
@@ -0,0 +1 @@
1
+ .menu-capsule{box-sizing:border-box;color:#1f1f1f;pointer-events:none;background:#fff;border:.5px solid #e5e5e5;border-radius:16px;align-items:center;display:flex;position:absolute;overflow:hidden;box-shadow:0 1px 2px #00000014}.menu-capsule__more,.menu-capsule__close{flex:1;justify-content:center;align-items:center;display:flex}.menu-capsule__more{pointer-events:auto;cursor:pointer;gap:1px}.menu-capsule__dot{background:currentColor;border-radius:50%}.menu-capsule__dot--side{width:4px;height:4px}.menu-capsule__dot--mid{width:6.4px;height:6.4px}.menu-capsule__divider{background:#e9e9e9;width:.5px;height:16px}.menu-capsule__close svg{color:currentColor}.nav-bar{box-sizing:border-box;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,sans-serif;display:flex;position:relative}.nav-bar--custom{z-index:200;pointer-events:none;position:absolute;top:0;left:0;right:0;background-color:#0000!important}.nav-bar--custom .menu-capsule{pointer-events:auto}.nav-bar__row{align-items:center;padding:0 12px;display:flex;position:relative}.nav-bar__leading{z-index:1;align-items:center;gap:6px;display:flex;position:absolute;top:0;bottom:0;left:8px}.nav-bar__back,.nav-bar__home{cursor:pointer;width:32px;height:32px;color:inherit;background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:flex}.nav-bar__title{flex:1;align-items:center;gap:6px;min-width:0;font-size:17px;font-weight:500;display:flex}.nav-bar__title--center{justify-content:center}.nav-bar__title--left{justify-content:flex-start;padding-left:48px}.nav-bar__title-text{text-overflow:ellipsis;white-space:nowrap;max-width:60%;overflow:hidden}.nav-bar__spinner{border:2px solid;border-right-color:#0000;border-radius:50%;width:14px;height:14px;animation:.8s linear infinite nav-bar-spin}@keyframes nav-bar-spin{to{transform:rotate(360deg)}}.device-statusbar{z-index:300;box-sizing:border-box;pointer-events:none;letter-spacing:.2px;justify-content:space-between;align-items:center;padding:0 28px;font:600 14px/1 -apple-system,BlinkMacSystemFont,SF Pro Text,Segoe UI,sans-serif;display:flex;position:absolute;top:0;left:0;right:0}.device-statusbar__time{font-variant-numeric:tabular-nums}.device-statusbar__notch{background:#000;position:absolute;left:50%;transform:translate(-50%)}.device-statusbar__icons{align-items:center;gap:6px;display:inline-flex}.device-statusbar__signal,.device-statusbar__wifi,.device-statusbar__battery{background:currentColor;display:block}.device-statusbar__signal{width:17px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'><rect x='0' y='8' width='3' height='3' rx='1'/><rect x='4.5' y='6' width='3' height='5' rx='1'/><rect x='9' y='3' width='3' height='8' rx='1'/><rect x='13.5' y='0' width='3' height='11' rx='1'/></svg>") 50%/contain no-repeat}.device-statusbar__wifi{border-radius:1px;width:16px;height:11px;-webkit-mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat;mask:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 11'><path d='M8 2.2c2.3 0 4.4.9 6 2.4l-1.4 1.5C11.4 4.9 9.8 4.2 8 4.2S4.6 4.9 3.4 6.1L2 4.6C3.6 3.1 5.7 2.2 8 2.2zm0 3.5c1.3 0 2.5.5 3.4 1.4L10 8.6c-.5-.5-1.2-.8-2-.8s-1.5.3-2 .8L4.6 7.1C5.5 6.2 6.7 5.7 8 5.7zm0 3.3l1.4 1.4c-.4.4-.9.6-1.4.6s-1-.2-1.4-.6L8 9z'/></svg>") 50%/contain no-repeat}.device-statusbar__battery{background:0 0;border:1px solid;border-radius:3px;width:25px;height:12px;position:relative}.device-statusbar__battery:before{content:"";background:currentColor;border-radius:1px;position:absolute;inset:2px 8px 2px 2px}.device-statusbar__battery:after{content:"";background:currentColor;border-radius:0 1px 1px 0;width:2px;position:absolute;top:3px;bottom:3px;right:-3px}.dmb-tab-bar{box-sizing:content-box;z-index:9;border-top:1px solid #e0e0e0;flex-shrink:0;justify-content:space-around;align-items:stretch;width:100%;height:50px;display:flex}.dmb-tab-bar__item{cursor:pointer;font:inherit;color:inherit;background:0 0;border:0;outline:none;flex-direction:column;flex:1;justify-content:center;align-items:center;padding:4px 0 2px;display:flex;position:relative}.dmb-tab-bar__item:focus-visible{outline-offset:-2px;outline:2px solid #1890ff}.dmb-tab-bar__icon-slot{justify-content:center;align-items:center;width:24px;height:24px;margin-bottom:2px;display:flex}.dmb-tab-bar__icon{-o-object-fit:contain;object-fit:contain;max-width:100%;max-height:100%}.dmb-tab-bar__text{-webkit-user-select:none;user-select:none;font-size:11px;line-height:1}.dmb-tab-bar__badge{color:#fff;text-align:center;background:#f43f5e;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;position:absolute;top:0;right:calc(50% - 22px)}.dmb-tab-bar__red-dot{background:#f43f5e;border-radius:50%;width:8px;height:8px;position:absolute;top:4px;right:calc(50% - 16px)}.dmui-publish{z-index:300;pointer-events:auto;background:#fff;flex-direction:column;display:flex;position:absolute;inset:0}.dmui-publish__nav{border-bottom:.5px solid #f2f2f2;flex-shrink:0;align-items:center;height:44px;padding:0 12px;display:flex}.dmui-publish__back{cursor:pointer;color:#333;background:0 0;border:0;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;padding:0;display:flex}.dmui-publish__island-chip{flex:1;justify-content:center;align-items:center;gap:4px;min-width:0;display:flex}.dmui-publish__chip-avatar{-o-object-fit:cover;object-fit:cover;border-radius:4px;flex-shrink:0;width:16px;height:16px}.dmui-publish__chip-avatar--placeholder{background:#e5e7eb}.dmui-publish__chip-name{color:#333;text-overflow:ellipsis;white-space:nowrap;max-width:100px;font:500 14px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.dmui-publish__chip-tag{color:#999;border:.5px solid #ddd;border-radius:2px;flex-shrink:0;padding:1px 4px;font:400 10px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-publish__submit{color:#fff;cursor:pointer;background:#222;border:0;border-radius:14px;flex-shrink:0;height:28px;padding:0 16px;font:500 13px/28px system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-publish__submit--disabled{cursor:default;background:#ccc}.dmui-publish__body{flex:1;padding:16px;overflow-y:auto}.dmui-publish__images{gap:8px;margin-bottom:16px;display:flex;overflow-x:auto}.dmui-publish__image-add{cursor:pointer;background:#fafafa;border:1px dashed #ddd;border-radius:8px;flex-shrink:0;justify-content:center;align-items:center;width:72px;height:72px;display:flex}.dmui-publish__title{color:#333;box-sizing:border-box;border:0;border-bottom:.5px solid #f2f2f2;outline:none;width:100%;padding:12px 0;font:500 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-publish__title::placeholder{color:#ccc;font-weight:400}.dmui-publish__content{color:#333;resize:none;box-sizing:border-box;border:0;outline:none;width:100%;min-height:180px;padding:12px 0;font:400 15px/1.6 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-publish__content::placeholder{color:#ccc}.dmui-publish__toolbar{border-top:.5px solid #f2f2f2;flex-shrink:0;justify-content:space-between;align-items:center;padding:8px 16px;display:flex}.dmui-publish__count{color:#999;font:400 12px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-publish__privacy{color:#666;cursor:pointer;background:0 0;border:0;padding:4px 8px;font:400 12px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-overlay{z-index:300;pointer-events:none;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.dmui-mask{pointer-events:auto;background:#00000080;position:absolute;inset:0}.dmui-mask--transparent{background:0 0}.dmui-toast{color:#fff;pointer-events:none;box-sizing:border-box;background:#000000bf;border-radius:10px;flex-direction:column;justify-content:center;align-items:center;gap:12px;min-width:120px;max-width:70%;padding:20px;display:flex;position:relative}.dmui-toast--text{border-radius:8px;min-width:0;padding:12px 18px}.dmui-toast__title{text-align:center;word-break:break-word;font:400 14px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-toast__icon{fill:none;stroke:#fff;stroke-width:2.4px;stroke-linecap:round;stroke-linejoin:round;width:40px;height:40px}.dmui-toast__image{-o-object-fit:contain;object-fit:contain;width:40px;height:40px}.dmui-toast__spinner{border:3px solid #ffffff4d;border-top-color:#fff;border-radius:50%;width:36px;height:36px;animation:.8s linear infinite dmui-spin}@keyframes dmui-spin{to{transform:rotate(360deg)}}.dmui-modal{pointer-events:auto;box-sizing:border-box;background:#fff;border-radius:12px;width:280px;max-width:80%;padding-top:24px;position:relative;overflow:hidden}.dmui-modal__title{color:#111827;text-align:center;padding:0 24px;font:600 17px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-modal__content{color:#6b7280;text-align:center;max-height:200px;padding:8px 24px 20px;font:400 15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow-y:auto}.dmui-modal__input{box-sizing:border-box;border:1px solid #e5e7eb;border-radius:4px;width:calc(100% - 48px);margin:16px 24px 20px;padding:6px 8px;font-size:15px;display:block}.dmui-modal__actions{border-top:1px solid #e5e7eb;display:flex}.dmui-modal__button{cursor:pointer;background:0 0;border:0;flex:1;padding:14px 0;font:400 17px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-modal__button+.dmui-modal__button{border-left:1px solid #e5e7eb}.dmui-overlay:has(.dmui-action-sheet){align-items:flex-end}.dmui-action-sheet{pointer-events:auto;box-sizing:border-box;width:100%;padding:8px;position:relative}.dmui-action-sheet__items{background:#fff;border-radius:12px;overflow:hidden}.dmui-action-sheet__item{text-align:center;cursor:pointer;background:0 0;border:0;width:100%;padding:16px 0;font:400 17px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-action-sheet__item+.dmui-action-sheet__item{border-top:1px solid #ececec}.dmui-action-sheet__cancel{color:#111827;cursor:pointer;background:#fff;border:0;border-radius:12px;width:100%;margin-top:8px;padding:16px 0;font:600 17px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:block}.dmui-overlay:has(.dmui-half-sheet){align-items:flex-end}.dmui-half-sheet{pointer-events:auto;background:#fff;border-radius:12px 12px 0 0;flex-direction:column;width:100%;animation:.3s ease-out dmui-slide-up;display:flex;position:relative}@keyframes dmui-slide-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}.dmui-half-sheet__title{color:#202020;text-align:center;padding:20px 20px 16px;font:400 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-half-sheet__divider{background:#f2f2f2;height:.5px}.dmui-half-sheet__row{align-items:center;padding:16px 20px;display:flex}.dmui-half-sheet__avatar{-o-object-fit:cover;object-fit:cover;border-radius:8px;flex-shrink:0;width:44px;height:44px}.dmui-half-sheet__info{flex:1;min-width:0;margin-left:12px}.dmui-half-sheet__name{color:#202020;text-overflow:ellipsis;white-space:nowrap;font:500 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.dmui-half-sheet__members{color:#999;margin-top:4px;font:400 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-half-sheet__join{color:#fff;cursor:pointer;background:#222;border:0;border-radius:18px;flex-shrink:0;height:36px;padding:0 20px;font:400 14px/36px system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-half-sheet__cancel{color:#999;text-align:center;cursor:pointer;background:0 0;border:0;padding:16px 0;font:400 16px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-overlay:has(.dmui-bottom-sheet){align-items:flex-end}.dmui-bottom-sheet{pointer-events:auto;background:#fff;border-radius:16px 16px 0 0;flex-direction:column;width:100%;animation:.3s ease-out dmui-slide-up;display:flex;position:relative}.dmui-bottom-sheet__title{color:#202020;text-align:center;padding:20px 20px 16px;font:400 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-bottom-sheet__divider{background:#f2f2f2;height:.5px}.dmui-bottom-sheet__grid{flex-wrap:wrap;gap:16px;padding:16px 20px;display:flex}.dmui-bottom-sheet__grid-item{cursor:pointer;background:0 0;border:0;flex-direction:column;align-items:center;gap:8px;min-width:56px;padding:0;display:flex}.dmui-bottom-sheet__icon-circle{background:#f5f5f5;border-radius:50%;justify-content:center;align-items:center;width:50px;height:50px;font-size:22px;display:flex}.dmui-bottom-sheet__icon-img{width:32px;height:32px}.dmui-bottom-sheet__item-label{color:#333;font:400 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-bottom-sheet__cancel{color:#999;text-align:center;cursor:pointer;background:0 0;border:0;padding:16px 0;font:400 16px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.dmui-capsule-menu__header{align-items:center;padding:20px 20px 16px;display:flex}.dmui-capsule-menu__avatar{-o-object-fit:cover;object-fit:cover;border-radius:10px;flex-shrink:0;width:48px;height:48px}.dmui-capsule-menu__avatar--placeholder{background:#e5e7eb}.dmui-capsule-menu__app-info{flex:1;min-width:0;margin-left:12px}.dmui-capsule-menu__app-name{color:#202020;text-overflow:ellipsis;white-space:nowrap;font:500 16px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;overflow:hidden}.dmui-capsule-menu__app-version{color:#999;margin-top:4px;font:400 12px/1.4 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}.device-shell-root{color:#101418;box-sizing:border-box;background:#121212;width:100%;height:100vh;padding:24px;display:flex;overflow:auto}@media (prefers-color-scheme:light){.device-shell-root{background:#e8e8e8}}.device-shell{background:#f8fafc;border:1px solid #1014182e;border-radius:38px;flex-direction:column;flex:none;min-height:0;margin:auto;display:flex;position:relative;overflow:hidden;box-shadow:0 18px 50px #10141838}.device-shell__status-bar{letter-spacing:0;color:#111827;background:#f8fafc;flex:0 0 42px;justify-content:space-between;align-items:center;padding:0 28px;font:600 13px/1 system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;display:flex}.device-shell__status-icons{align-items:center;gap:5px;display:inline-flex}.device-shell__status-icons span{background:#111827;display:block}.device-shell__status-icons span:first-child{border-radius:2px;width:16px;height:10px}.device-shell__status-icons span:nth-child(2){border-radius:50%;width:12px;height:12px}.device-shell__status-icons span:nth-child(3){border-radius:3px;width:20px;height:10px}.device-shell__viewport{background:#fff;flex:auto;min-height:0;position:relative}.device-shell__webview{background:#fff;border:0;width:100%;height:100%;display:block;position:absolute;inset:0}.device-shell__home-indicator{pointer-events:none;z-index:200;position:absolute;bottom:0;left:0;right:0}.device-shell__home-indicator:before{content:"";background:#111827;border-radius:999px;width:118px;height:4px;position:absolute;bottom:8px;left:50%;transform:translate(-50%)}