wevu 6.18.5 → 6.18.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dev/index.mjs +2 -2
- package/dist/dev/internal-runtime.mjs +2 -2
- package/dist/dev/{router-BD-ovqV2.mjs → router-D0JQfgyN.mjs} +83 -66
- package/dist/dev/router-D0JQfgyN.mjs.map +1 -0
- package/dist/dev/router.mjs +114 -48
- package/dist/dev/router.mjs.map +1 -1
- package/dist/dev/{templateRef-DvxMB5FK.mjs → templateRef-BLnYcEH0.mjs} +7 -3
- package/dist/dev/templateRef-BLnYcEH0.mjs.map +1 -0
- package/dist/dev/vue-demi.mjs +2 -2
- package/dist/index.mjs +1 -1
- package/dist/internal-runtime.mjs +1 -1
- package/dist/router-D4W4lEXM.mjs +1 -0
- package/dist/router.mjs +1 -1
- package/dist/templateRef-DOTHWzZ5.mjs +1 -0
- package/dist/vue-demi.mjs +1 -1
- package/package.json +2 -2
- package/dist/dev/router-BD-ovqV2.mjs.map +0 -1
- package/dist/dev/templateRef-DvxMB5FK.mjs.map +0 -1
- package/dist/router-DLOOLAqv.mjs +0 -1
- package/dist/templateRef-D6aBJONi.mjs +0 -1
package/dist/dev/vue-demi.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import { A as removeMutationRecorder, F as getCurrentScope, I as onScopeDispose,
|
|
|
4
4
|
import { i as touchReactive, r as prelinkReactiveTree, t as computed } from "./computed-BxRsUJgi.mjs";
|
|
5
5
|
import { S as shallowReadonly, b as isReadonly, c as getCurrentSetupContext, d as setCurrentSetupContext, n as callHookList, r as callHookReturn, s as getCurrentInstance, u as setCurrentInstance, x as readonly, y as isProxy } from "./base-CYkvI7w8.mjs";
|
|
6
6
|
import { n as toRefs, t as toRef } from "./toRefs-D06VmFK2.mjs";
|
|
7
|
-
import { $ as
|
|
8
|
-
import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-
|
|
7
|
+
import { $ as onShareTimeline, B as onLaunch, F as onAddToFavorites, G as onPageScroll, H as onMemoryWarning, I as onAttached, J as onReady, K as onPullDownRefresh, L as onDetached, P as setGlobalProvidedValue, Q as onShareAppMessage, R as onError, U as onMoved, V as onLoad, W as onPageNotFound, X as onRouteDone, Y as onResize, Z as onSaveExitState, _ as injectGlobal, et as onShow, g as inject, h as hasInjectionContext, it as onUnload, n as useNativeRouter, nt as onThemeChange, q as onReachBottom, rt as onUnhandledRejection, t as useNativePageRouter, tt as onTabItemTap, v as provide, y as provideGlobal, z as onHide } from "./router-D0JQfgyN.mjs";
|
|
8
|
+
import { $ as version, A as registerPageLayoutBridge, B as mountRuntimeInstance, C as useElementIntersectionObserver, D as defineComponent, E as createWevuScopedSlotComponent, F as unregisterRuntimeLayoutHosts, G as setPageLayout, H as teardownRuntimeInstance, I as useLayoutBridge, J as usePageLayout, K as syncRuntimePageLayoutState, L as useLayoutHosts, M as resolveLayoutBridge, N as resolveLayoutHost, O as createApp, P as unregisterPageLayoutBridge, Q as markNoSetData, R as waitForLayoutHost, S as useIntersectionObserver, T as createWevuComponent, U as runSetupFunction, V as setRuntimeSetDataVisibility, W as resolveRuntimePageLayoutName, X as setWevuDefaults, Y as resetWevuDefaults, Z as isNoSetData, _ as usePageScrollThrottle, a as useModel, at as onDeactivated, b as useNavigationBarMetrics, c as useSlots, ct as onServerPrefetch, d as useUpdatePerformanceListener, et as callUpdateHooks, f as useBoundingClientRect, g as useAsyncPullDownRefresh, h as useSelectorQuery, i as useChangeModel, it as onBeforeUpdate, j as registerRuntimeLayoutHosts, k as registerComponent, l as defineAppSetup, lt as onUnmounted, m as useSelectorFields, n as mergeModels, nt as onBeforeMount, o as useAttrs, ot as onErrorCaptured, p as useScrollOffset, q as syncRuntimePageLayoutStateFromRuntime, r as useBindModel, rt as onBeforeUnmount, s as useNativeInstance, st as onMounted, t as useTemplateRef, tt as onActivated, u as use, ut as onUpdated, v as getCurrentPageStackSnapshot, w as useDisposables, x as usePageStack, y as getNavigationBarMetrics, z as registerApp } from "./templateRef-BLnYcEH0.mjs";
|
|
9
9
|
import { n as normalizeStyle, r as resolvePropValue, t as normalizeClass } from "./template-n_iVr0ey.mjs";
|
|
10
10
|
import { n as defineStore, r as createStore, t as storeToRefs } from "./store-HNsiQJ4d.mjs";
|
|
11
11
|
import "./index.mjs";
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-CenpyGzJ.mjs";import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./watch-Bbd-gmEg.mjs";import{A as p,F as m,I as h,L as g,M as _,N as v,P as y,R as b,a as x,c as S,d as C,i as w,j as T,k as E,l as D,n as O,o as k,s as A,t as j,u as M,v as N}from"./ref-D37CknuD.mjs";import{i as P,r as F,t as I}from"./computed-Xoi9XEUx.mjs";import{S as L,b as R,c as z,d as B,n as V,r as H,s as U,u as W,x as G,y as K}from"./base-BxKbbKVO.mjs";import{n as q,t as J}from"./toRefs-CoytPyo0.mjs";import{$ as Y,B as X,F as Z,G as Q,H as $,I as ee,J as te,K as ne,L as re,
|
|
1
|
+
import"./rolldown-runtime-CenpyGzJ.mjs";import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./watch-Bbd-gmEg.mjs";import{A as p,F as m,I as h,L as g,M as _,N as v,P as y,R as b,a as x,c as S,d as C,i as w,j as T,k as E,l as D,n as O,o as k,s as A,t as j,u as M,v as N}from"./ref-D37CknuD.mjs";import{i as P,r as F,t as I}from"./computed-Xoi9XEUx.mjs";import{S as L,b as R,c as z,d as B,n as V,r as H,s as U,u as W,x as G,y as K}from"./base-BxKbbKVO.mjs";import{n as q,t as J}from"./toRefs-CoytPyo0.mjs";import{$ as Y,B as X,F as Z,G as Q,H as $,I as ee,J as te,K as ne,L as re,P as ie,Q as ae,R as oe,U as se,V as ce,W as le,X as ue,Y as de,Z as fe,_ as pe,et as me,g as he,h as ge,it as _e,n as ve,nt as ye,q as be,rt as xe,t as Se,tt as Ce,v as we,y as Te,z as Ee}from"./router-D4W4lEXM.mjs";import{$ as De,A as Oe,B as ke,C as Ae,D as je,E as Me,F as Ne,G as Pe,H as Fe,I as Ie,J as Le,K as Re,L as ze,M as Be,N as Ve,O as He,P as Ue,Q as We,R as Ge,S as Ke,T as qe,U as Je,V as Ye,W as Xe,X as Ze,Y as Qe,Z as $e,_ as et,a as tt,at as nt,b as rt,c as it,ct as at,d as ot,et as st,f as ct,g as lt,h as ut,i as dt,it as ft,j as pt,k as mt,l as ht,lt as gt,m as _t,n as vt,nt as yt,o as bt,ot as xt,p as St,q as Ct,r as wt,rt as Tt,s as Et,st as Dt,t as Ot,tt as kt,u as At,ut as jt,v as Mt,w as Nt,x as Pt,y as Ft,z as It}from"./templateRef-DOTHWzZ5.mjs";import{n as Lt,r as Rt,t as zt}from"./template-CNzlwH-E.mjs";import{n as Bt,r as Vt,t as Ht}from"./store-eHrHBQiv.mjs";export*from"@wevu/web-apis";export{E as addMutationRecorder,T as batch,V as callHookList,H as callHookReturn,st as callUpdateHooks,I as computed,He as createApp,Vt as createStore,qe as createWevuComponent,Me as createWevuScopedSlotComponent,j as customRef,ht as defineAppSetup,je as defineComponent,Bt as defineStore,_ as effect,v as effectScope,y as endBatch,U as getCurrentInstance,Mt as getCurrentPageStackSnapshot,m as getCurrentScope,z as getCurrentSetupContext,e as getDeepWatchStrategy,Ft as getNavigationBarMetrics,A as getReactiveVersion,ge as hasInjectionContext,he as inject,pe as injectGlobal,$e as isNoSetData,K as isProxy,S as isRaw,D as isReactive,R as isReadonly,O as isRef,n as isShallowReactive,t as isShallowRef,We as markNoSetData,M as markRaw,vt as mergeModels,ke as mountRuntimeInstance,c as nextTick,zt as normalizeClass,Lt as normalizeStyle,kt as onActivated,Z as onAddToFavorites,ee as onAttached,yt as onBeforeMount,Tt as onBeforeUnmount,ft as onBeforeUpdate,nt as onDeactivated,re as onDetached,oe as onError,xt as onErrorCaptured,Ee as onHide,X as onLaunch,ce as onLoad,$ as onMemoryWarning,Dt as onMounted,se as onMoved,le as onPageNotFound,Q as onPageScroll,ne as onPullDownRefresh,be as onReachBottom,te as onReady,de as onResize,ue as onRouteDone,fe as onSaveExitState,h as onScopeDispose,at as onServerPrefetch,ae as onShareAppMessage,Y as onShareTimeline,me as onShow,Ce as onTabItemTap,ye as onThemeChange,xe as onUnhandledRejection,_e as onUnload,gt as onUnmounted,jt as onUpdated,F as prelinkReactiveTree,we as provide,Te as provideGlobal,C as reactive,G as readonly,w as ref,It as registerApp,mt as registerComponent,Oe as registerPageLayoutBridge,pt as registerRuntimeLayoutHosts,p as removeMutationRecorder,Qe as resetWevuDefaults,Be as resolveLayoutBridge,Ve as resolveLayoutHost,Rt as resolvePropValue,Xe as resolveRuntimePageLayoutName,Je as runSetupFunction,W as setCurrentInstance,B as setCurrentSetupContext,s as setDeepWatchStrategy,ie as setGlobalProvidedValue,Pe as setPageLayout,Ye as setRuntimeSetDataVisibility,Ze as setWevuDefaults,r as shallowReactive,L as shallowReadonly,a as shallowRef,g as startBatch,b as stop,Ht as storeToRefs,Re as syncRuntimePageLayoutState,Ct as syncRuntimePageLayoutStateFromRuntime,Fe as teardownRuntimeInstance,N as toRaw,J as toRef,q as toRefs,x as toValue,P as touchReactive,u as traverse,f as triggerRef,k as unref,Ue as unregisterPageLayoutBridge,Ne as unregisterRuntimeLayoutHosts,At as use,lt as useAsyncPullDownRefresh,bt as useAttrs,wt as useBindModel,ct as useBoundingClientRect,dt as useChangeModel,Nt as useDisposables,Ae as useElementIntersectionObserver,Ke as useIntersectionObserver,Ie as useLayoutBridge,ze as useLayoutHosts,tt as useModel,Et as useNativeInstance,Se as useNativePageRouter,ve as useNativeRouter,rt as useNavigationBarMetrics,Le as usePageLayout,et as usePageScrollThrottle,Pt as usePageStack,St as useScrollOffset,_t as useSelectorFields,ut as useSelectorQuery,it as useSlots,Ot as useTemplateRef,ot as useUpdatePerformanceListener,De as version,Ge as waitForLayoutHost,d as watch,o as watchEffect,l as watchPostEffect,i as watchSyncEffect};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,d as t,n,r,s as i,u as a}from"./base-BxKbbKVO.mjs";import{$ as o,B as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,
|
|
1
|
+
import{c as e,d as t,n,r,s as i,u as a}from"./base-BxKbbKVO.mjs";import{$ as o,B as s,F as c,G as l,H as u,I as d,J as f,K as p,L as m,P as h,Q as g,R as _,U as v,V as y,W as b,X as x,Y as S,Z as C,_ as w,et as T,g as E,h as D,it as O,n as k,nt as A,q as j,rt as M,t as N,tt as P,v as F,y as I,z as L}from"./router-D4W4lEXM.mjs";import{$ as R,B as z,C as B,D as V,E as H,G as U,H as W,I as G,J as K,K as q,L as J,M as Y,N as X,O as Z,Q,R as $,S as ee,T as te,U as ne,V as re,W as ie,X as ae,Y as oe,Z as se,_ as ce,a as le,at as ue,b as de,c as fe,ct as pe,d as me,f as he,g as ge,h as _e,i as ve,it as ye,k as be,l as xe,lt as Se,m as Ce,n as we,nt as Te,o as Ee,ot as De,p as Oe,q as ke,r as Ae,rt as je,s as Me,st as Ne,t as Pe,tt as Fe,u as Ie,ut as Le,v as Re,w as ze,x as Be,y as Ve,z as He}from"./templateRef-DOTHWzZ5.mjs";export{n as callHookList,r as callHookReturn,Z as createApp,te as createWevuComponent,H as createWevuScopedSlotComponent,xe as defineAppSetup,V as defineComponent,i as getCurrentInstance,Re as getCurrentPageStackSnapshot,e as getCurrentSetupContext,Ve as getNavigationBarMetrics,D as hasInjectionContext,E as inject,w as injectGlobal,se as isNoSetData,Q as markNoSetData,we as mergeModels,z as mountRuntimeInstance,Fe as onActivated,c as onAddToFavorites,d as onAttached,Te as onBeforeMount,je as onBeforeUnmount,ye as onBeforeUpdate,ue as onDeactivated,m as onDetached,_ as onError,De as onErrorCaptured,L as onHide,s as onLaunch,y as onLoad,u as onMemoryWarning,Ne as onMounted,v as onMoved,b as onPageNotFound,l as onPageScroll,p as onPullDownRefresh,j as onReachBottom,f as onReady,S as onResize,x as onRouteDone,C as onSaveExitState,pe as onServerPrefetch,g as onShareAppMessage,o as onShareTimeline,T as onShow,P as onTabItemTap,A as onThemeChange,M as onUnhandledRejection,O as onUnload,Se as onUnmounted,Le as onUpdated,F as provide,I as provideGlobal,He as registerApp,be as registerComponent,oe as resetWevuDefaults,Y as resolveLayoutBridge,X as resolveLayoutHost,ie as resolveRuntimePageLayoutName,ne as runSetupFunction,a as setCurrentInstance,t as setCurrentSetupContext,h as setGlobalProvidedValue,U as setPageLayout,re as setRuntimeSetDataVisibility,ae as setWevuDefaults,q as syncRuntimePageLayoutState,ke as syncRuntimePageLayoutStateFromRuntime,W as teardownRuntimeInstance,Ie as use,ge as useAsyncPullDownRefresh,Ee as useAttrs,Ae as useBindModel,he as useBoundingClientRect,ve as useChangeModel,ze as useDisposables,B as useElementIntersectionObserver,ee as useIntersectionObserver,G as useLayoutBridge,J as useLayoutHosts,le as useModel,Me as useNativeInstance,N as useNativePageRouter,k as useNativeRouter,de as useNavigationBarMetrics,K as usePageLayout,ce as usePageScrollThrottle,Be as usePageStack,Oe as useScrollOffset,Ce as useSelectorFields,_e as useSelectorQuery,fe as useSlots,Pe as useTemplateRef,me as useUpdatePerformanceListener,R as version,$ as waitForLayoutHost};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as e,c as t,f as n,g as r,h as i,i as a,l as o,m as s,n as c,o as l,s as u,t as d,v as f}from"./base-BxKbbKVO.mjs";import{WEVU_APP_PROVIDES_KEY as p,WEVU_IS_APP_INSTANCE_KEY as ee,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as m,WEVU_PARENT_INSTANCE_KEY as h,WEVU_PROVIDES_KEY as g,WEVU_RUNTIME_APP_KEY as te}from"@weapp-core/constants";function _(e,t,n){o(d(e),e,t,n)}function ne(e){_(`onLaunch`,e)}function re(e){_(`onPageNotFound`,e)}function ie(e){_(`onUnhandledRejection`,e)}function ae(e){_(`onThemeChange`,e)}function oe(e){_(`onMemoryWarning`,e)}function se(e){_(`onShow`,e)}function ce(e){_(`onLoad`,e)}function le(e){_(`onHide`,e)}function ue(e){_(`onUnload`,e)}function de(e){_(`onReady`,e)}function fe(e){_(`onPullDownRefresh`,e)}function pe(e){_(`onReachBottom`,e)}function me(e){let t=d(`onPageScroll`);o(t,`onPageScroll`,e),a(t,`onPageScroll`)}function he(e){_(`onRouteDone`,e)}function ge(e){_(`onTabItemTap`,e)}function _e(e){_(`onResize`,e)}function ve(e){_(`onMoved`,e)}function ye(e){_(`onAttached`,e)}function be(e){_(`onDetached`,e)}function xe(e){_(`onError`,e)}function Se(e){_(`onSaveExitState`,e,{single:!0})}function Ce(t){let n=d(`onShareAppMessage`);o(n,`onShareAppMessage`,t,{single:!0}),l(n,`onShareAppMessage`),e(n)}function we(t){let n=d(`onShareTimeline`);o(n,`onShareTimeline`,t,{single:!0}),l(n,`onShareTimeline`),e(n)}function Te(e){let t=d(`onAddToFavorites`);o(t,`onAddToFavorites`,e,{single:!0}),l(t,`onAddToFavorites`)}const v=new Map;function y(e,t){v.set(e,t)}function b(e){return v.has(e)}function x(e){return v.get(e)}function S(e){return!!(e&&typeof e==`object`&&e[ee]===!0)}function C(e){return Object.create(e==null?null:e)}function w(e){if(!e)return C();let t=e[p];if(t&&typeof t==`object`)return t;let n=C();try{Object.defineProperty(e,p,{value:n,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[p]=n}return n}function T(e,t){try{Object.defineProperty(e,g,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[g]=t}}function E(e){var t,n;let r=e[g];if(r&&typeof r==`object`)return r;let i=e[te],a=(t=(n=e[h])==null?void 0:n[g])==null?w(i):t,o=S(e)?w(i):C(a);return T(e,o),o}function Ee(e){return w(e)}function De(e,t,n){w(e)[t]=n,y(t,n)}function Oe(e,t,n){var r;let i=w(t),a=(r=n==null?void 0:n[g])==null?i:r,o=S(e)?i:C(a);if(n)try{Object.defineProperty(e,h,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(t){e[h]=n}T(e,o)}function D(e,t){let n=Object.getPrototypeOf(e);for(;n;){if(n===t)return!0;n=Object.getPrototypeOf(n)}return!1}function ke(e,t){let n=E(e),r=E(t);if(!(n===r||D(n,r)||D(r,n))){Object.setPrototypeOf(r,n);try{Object.defineProperty(t,h,{value:e,configurable:!0,enumerable:!1,writable:!0})}catch(n){t[h]=e}}}let O=!1,k;function A(){return k}function Ae(e){k=e}function je(e){k===e&&(k=void 0)}function j(e,t){var n;e[m]=Number((n=e[m])==null?0:n)+1;try{return t()}finally{var r;let t=Number((r=e[m])==null?1:r)-1;t<=0?delete e[m]:e[m]=t}}function Me(e){let t=e.options;if(t&&typeof t==`object`)return t;let n=s(),r=n[n.length-1],i=r&&typeof r==`object`?r.options:void 0;return i&&typeof i==`object`?i:{}}function Ne(){if(O)return;O=!0;let e=r();if(!(!e||typeof e!=`object`)){if(f(`pullDownRefreshApi`)){let t=e.startPullDownRefresh;typeof t==`function`&&(e.startPullDownRefresh=function(...e){let n=t.apply(this,e);return k&&c(k,`onPullDownRefresh`,[]),n})}if(f(`pageScrollApi`)){let t=e.pageScrollTo;typeof t==`function`&&(e.pageScrollTo=function(e,...n){let r=t.apply(this,[e,...n]);if(k){let t=k;j(t,()=>{c(t,`onPageScroll`,[e==null?{}:e])})}return r})}}}function Pe(e){let{enableOnShareAppMessage:t,enableOnShareTimeline:n}=e;if(!t&&!n||!f(`pageShareMenu`))return;let a=r();if(!a||typeof a.showShareMenu!=`function`)return;let o=i().shareTimelineRequiresShareAppMessage?t||n:t;if(!o&&!n)return;let s=[];o&&s.push(`shareAppMessage`),n&&s.push(`shareTimeline`);let c=[{withShareTicket:!0,menus:s},{menus:s},n?{withShareTicket:!0}:void 0,n?{}:void 0,void 0];for(let e of c)try{e===void 0?a.showShareMenu():a.showShareMenu(e);break}catch(e){}}const Fe=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],M=new Set,N=new WeakSet;function Ie(e){return M.add(e),()=>{M.delete(e)}}function P(e){for(let t of M)try{t(e)}catch(e){}}function Le(e,t){if(e===`navigateBack`)return{method:e,source:`native`};if(t&&typeof t==`object`){let n=t.url;if(typeof n==`string`)return{method:e,source:`native`,url:n}}return{method:e,source:`native`}}function Re(e){if(!e||typeof e!=`object`)return;let t=e;if(!N.has(t)){N.add(t);for(let e of Fe){let n=t[e];typeof n==`function`&&(t[e]=function(t,...r){let i=!1,a=()=>{i||(i=!0,P(Le(e,t)))},o=t&&typeof t==`object`?{...t,success:(...e)=>{a();let n=t.success;return typeof n==`function`?n(...e):void 0}}:t,s=n.call(this,o,...r);return s&&typeof s.then==`function`&&s.then(a,()=>{}),s})}}}function ze(){return!!u()}function Be(e,t){let n=u();n?(E(n)[e]=t,S(n)&&y(e,t)):y(e,t)}function Ve(e,t){var n;let r=u();if(r){let t=E(r);if(e in t)return t[e]}if(b(e))return x(e);if(arguments.length>=2)return t;let i=(n=globalThis.console)==null?void 0:n.warn;typeof i==`function`&&i(`wevu.inject:未找到对应 key 的值:${String(e)}`)}function He(e,t){y(e,t)}function Ue(e,t){if(b(e))return x(e);if(arguments.length>=2)return t;throw Error(`injectGlobal():未找到对应 key 的 provider:${String(e)}`)}function F(e){let t=[];for(let n of e.split(`/`))if(!(!n||n===`.`)){if(n===`..`){t.length>0&&t.pop();continue}t.push(n)}return t}function I(e,t){if(!e)return F(t).join(`/`);if(e.startsWith(`/`))return F(e).join(`/`);if(e.startsWith(`./`)||e.startsWith(`../`)){let n=F(t);n.length>0&&n.pop();for(let t of e.split(`/`))if(!(!t||t===`.`)){if(t===`..`){n.length>0&&n.pop();continue}n.push(t)}return n.join(`/`)}return F(e).join(`/`)}function L(e){return e?`/${e}`:`/`}const We=/(?:^|\/):/;function Ge(e){return We.test(e)}const Ke=/\+/g;function R(e){return decodeURIComponent(e.replace(Ke,` `))}function z(e){return encodeURIComponent(e)}function B(e,t,n){let r=e[t];if(r===void 0){e[t]=n;return}if(Array.isArray(r)){r.push(n);return}e[t]=[r,n]}function V(e,t,n){let r=e[t];if(r===void 0){e[t]=n;return}if(Array.isArray(r)){r.push(n);return}e[t]=[r,n]}function H(e){if(e!==void 0)return e===null?null:String(e)}function U(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r)){for(let e of r){let r=H(e);r!==void 0&&B(t,n,r)}continue}let i=H(r);i!==void 0&&B(t,n,i)}return t}function W(e){if(e!=null)return String(e)}function qe(e){let t={};for(let n of Object.keys(e)){let r=e[n];if(Array.isArray(r)){for(let e of r){let r=W(e);r!==void 0&&V(t,n,r)}continue}let i=W(r);i!==void 0&&V(t,n,i)}return t}function G(e){return e?e.startsWith(`#`)?e:`#${e}`:``}function K(e){let t=e.startsWith(`?`)?e.slice(1):e,n={};if(!t)return n;for(let e of t.split(`&`)){if(!e)continue;let t=e.indexOf(`=`),r=t>=0?e.slice(0,t):e;r&&B(n,R(r),t>=0?R(e.slice(t+1)):null)}return n}function q(e={}){let t=U(e),n=[];for(let e of Object.keys(t)){let r=z(e),i=t[e];if(Array.isArray(i)){for(let e of i)e===null?n.push(r):n.push(`${r}=${z(e)}`);continue}if(i===null){n.push(r);continue}n.push(`${r}=${z(i)}`)}return n.join(`&`)}const Je={parseQuery:K,stringifyQuery:q};function J(e,t=Je){let n=e.indexOf(`#`),r=n>=0?e.slice(0,n):e,i=n>=0?G(e.slice(n+1)):``,a=r.indexOf(`?`);return a<0?{path:r,query:{},hash:i}:{path:r.slice(0,a),query:U(t.parseQuery(r.slice(a+1))),hash:i}}function Y(e,t,n=``,r,i={},a=q){let o=I(e,``),s=a(t),c=L(o),l=G(n),u=s?`${c}?${s}`:c,d={path:o,fullPath:l?`${u}${l}`:u,query:t,hash:l,params:i};return r!==void 0&&(d.name=r),d}function X(e){return typeof(e==null?void 0:e.route)==`string`&&e.route.length>0||typeof(e==null?void 0:e.__route__)==`string`&&e.__route__.length>0}function Ye(e){let t=s();if(Array.isArray(t)&&t.length>0){let e=t[t.length-1];if(X(e))return e}let n=A();return X(n)?n:e}function Xe(e,t){var n;return e?Y(typeof e.route==`string`?e.route:typeof e.__route__==`string`?e.__route__:``,U(t==null?(n=e.options)==null?{}:n:t),``,void 0,{}):Y(``,{})}function Ze(e,t){return Xe(Ye(t),e)}const Qe=[`switchTab`,`reLaunch`,`redirectTo`,`navigateTo`,`navigateBack`],$e=new WeakMap;function Z(e){return!e||typeof e!=`object`?!1:Qe.every(t=>typeof e[t]==`function`)}function et(){return n()}function tt(e){if(!(typeof e!=`string`||!e))return I(e,``)||void 0}function nt(e,t){let n=t===`pageRouter`?[e.route,e.__route__,e.is]:[e.is,e.route,e.__route__];for(let e of n){let t=tt(e);if(t)return t}}function rt(e,t){if(!t||!e.startsWith(`./`)&&!e.startsWith(`../`))return e;let{path:n,query:r,hash:i}=J(e),a=L(I(n,t)),o=q(r);return`${a}${o?`?${o}`:``}${i}`}function Q(e,t){let n=t==null?``:t,r=$e.get(e),i=r==null?void 0:r.get(n);if(i)return i;let a=Object.create(null);for(let n of Qe)a[n]=r=>{let i=e[n];if(n===`navigateBack`||!r||typeof r!=`object`)return i.call(e,r);let a=typeof r.url==`string`?rt(r.url,t):r.url,o=r.success,s={...r,url:a,success:(...e)=>(typeof a==`string`&&P({method:n,source:`native`,url:a}),typeof o==`function`?o(...e):void 0)};return i.call(e,s)};let o=r==null?new Map:r;return o.set(n,a),$e.set(e,o),a}function $(e,n,r){let i=t();if(!(i!=null&&i.instance))throw Error(`${r}() 必须在 setup() 的同步阶段调用`);let a=i.instance,o=nt(a,e),s=a[e];if(Z(s))return Q(s,o);let c=a[n];if(Z(c))return Q(c,o);let l=et();if(l)return Q(l,o);throw Error(`当前运行环境不支持 Router,请升级宿主基础库或检查平台路由能力`)}function it(){return $(`router`,`pageRouter`,`useNativeRouter`)}function at(){return $(`pageRouter`,`router`,`useNativePageRouter`)}export{we as $,ke as A,ne as B,Ae as C,je as D,A as E,Te as F,me as G,oe as H,ye as I,de as J,fe as K,be as L,Ee as M,De as N,Me as O,y as P,Ce as Q,xe as R,Ie as S,Pe as T,ve as U,ce as V,re as W,he as X,_e as Y,Se as Z,Ue as _,Ze as a,Re as b,U as c,q as d,se as et,L as f,Ve as g,ze as h,J as i,ue as it,Oe as j,j as k,qe as l,I as m,it as n,ae as nt,Xe as o,Ge as p,pe as q,Y as r,ie as rt,G as s,at as t,ge as tt,K as u,Be as v,Ne as w,P as x,He as y,le as z};
|
package/dist/router.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e}from"./ref-D37CknuD.mjs";import{c as t,g as n,x as r}from"./base-BxKbbKVO.mjs";import{$ as i,B as a,Y as o,a as s,c,d as l,f as u,g as d,h as f,i as p,l as m,m as h,n as g,o as _,p as v,q as y,r as b,rt as x,s as S,t as C,u as w,x as ee,y as T}from"./router-DLOOLAqv.mjs";const te=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function E(e){var t;let n=te.exec(e);if(n)return{key:n[1],modifier:(t=n[2])==null?``:t}}function D(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function O(e){return encodeURIComponent(e)}function k(e){try{return decodeURIComponent(e)}catch(t){return e}}function A(e,t,n){let r=[],i=new Set;for(let a of e.split(`/`)){if(!a)continue;let e=E(a);if(!e){r.push(a);continue}let o=D(t[e.key]);if(e.modifier===``){if(o.length!==1)throw Error(`Missing required param "${e.key}" for named route "${n}"`);i.add(e.key),r.push(O(o[0]));continue}if(e.modifier===`?`){if(o.length===0)continue;if(o.length>1)throw Error(`Param "${e.key}" for named route "${n}" must be a single value`);i.add(e.key),r.push(O(o[0]));continue}if(e.modifier===`+`){if(o.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${n}"`);i.add(e.key);for(let e of o)r.push(O(e));continue}o.length>0&&i.add(e.key);for(let e of o)r.push(O(e))}return{path:r.join(`/`),consumedKeys:i}}function ne(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function re(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>ne(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function ie(e,t,n){let r=e.name;if(typeof r!=`string`||!r||e.path!==void 0||e.fullPath!==void 0)return e;let i=t.recordByName.get(r);if(!i)throw Error(`Named route "${r}" is not defined in createRouter({ routes | namedRoutes })`);let a=e.params?c(e.params):{},o=A(i.path,a,r);return n===`strict`&&re(a,o.consumedKeys,r),{...e,path:o.path?`/${o.path}`:`/`,params:a}}function j(e){return e.split(`/`).filter(Boolean)}function ae(e){return[e.path,...e.aliasPaths]}function M(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function oe(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function se(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())!i.parentName||n.has(e)||n.has(i.parentName)&&(n.add(e),r=!0)}return n}function ce(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function le(e,t){let n=j(e),r=j(t),i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.push(t);return}i.set(e,[t])},o=e=>{let t=i.get(e);!t||t.length===0||(t.pop(),t.length===0&&i.delete(e))},s=(e,t,n)=>{for(let i=0;i<n;i+=1)a(e,k(r[t+i]));return()=>{for(let t=0;t<n;t+=1)o(e)}},c=(e,t)=>{if(e>=n.length)return t>=r.length;let i=n[e],l=E(i);if(!l)return t>=r.length||i!==r[t]?!1:c(e+1,t+1);if(l.modifier===``){if(t>=r.length)return!1;a(l.key,k(r[t]));let n=c(e+1,t+1);return n||o(l.key),n}if(l.modifier===`?`){if(t<r.length){if(a(l.key,k(r[t])),c(e+1,t+1))return!0;o(l.key)}return c(e+1,t)}let u=+(l.modifier===`+`),d=r.length-t;for(let n=d;n>=u;--n){let r=s(l.key,t,n);if(c(e+1,t+n))return!0;r()}return!1};if(c(0,0))return ce(i)}function ue(e,t){if(e.name){let n=t.recordByName.get(e.name);if(n)return{record:n,matchedRecords:M(n,t)}}let n=t.nameByStaticPath.get(e.path);if(n){let r=t.recordByName.get(n);if(r)return{record:r,matchedRecords:M(r,t),matchedPath:e.path}}for(let n of t.recordByName.values())for(let r of ae(n)){if(!u(r))continue;let i=le(r,e.path);if(i)return{record:n,matchedRecords:M(n,t),matchedPath:r,params:i}}}function N(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`[wevu/router] ${e}`)}function de(e){let t=v(e,``);return t?l(t):`/`}function fe(e,t=new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(fe(t,n))return!0;return!1}function pe(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(fe(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function me(e){let t=new Map,n=[];for(let i of e){var r;let e=typeof i.route.name==`string`?i.route.name.trim():``;if(!e)continue;let a=(r=i.source)==null?`namedRoutes`:r,o=de(i.route.path),s=t.get(e);s&&n.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}n.length!==0&&N(`duplicate route names detected, later entries override earlier ones: ${n.join(`, `)}`)}function he(e){return e?Array.isArray(e)?e:[e]:[]}function ge(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function _e(e,t){if(!e)return[];let n=Array.isArray(e)?e:[e],r=[];for(let e of n){if(typeof e!=`string`)continue;let n=v(e,``);!n||n===t||r.includes(n)||r.push(n)}return r}function ve(e,t,n=`namedRoutes`){let r=v(e.path,``);if(!r&&e.path!==`/`)return;let i=ge(e,r,n);if(i)return{name:i,path:r,aliasPaths:_e(e.alias,r),parentName:t,meta:e.meta,beforeEnterGuards:he(e.beforeEnter),redirect:e.redirect}}function P(e,t){return!t||e.startsWith(`/`)?v(e,``):v(`${l(t)}/${e}`,``)}function ye(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function be(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function xe(e){if(e.length!==0)return e.length===1?l(e[0]):e.map(e=>l(e))}function F(e,t,n,r=[],i,a=`namedRoutes`,o=new Set){let s=[];for(let[c,u]of e.entries()){let e=`${a}[${c}]`;if(o.has(u)){N(`ignored route record at ${e}: detected circular children reference`);continue}if(typeof u.path!=`string`||!u.path){N(`ignored route record "${typeof(u==null?void 0:u.name)==`string`?u.name.trim():``}" at ${e}: route path is required`);continue}let d=P(u.path,t),f=ge(u,d,i);if(!f){N(`ignored route record at ${e}: route name is required`);continue}let p=[],m=new Map;for(let n of ye(u.alias)){let r=P(n,t);if(!r)continue;if(r===d){N(`ignored alias "${l(r)}" for route "${f}" at ${e}: alias is same as route path`);continue}let i=m.get(r);if(i){N(`ignored duplicate alias "${l(r)}" for route "${f}" at ${e}: already declared by "${i}"`);continue}m.set(r,n),p.push(r)}let h=u.path.startsWith(`/`)?[]:r.map(e=>P(u.path,e)).filter(Boolean).filter(e=>e!==d),g=be([...p,...h]),_={name:f,path:d?l(d):`/`,alias:xe(g),meta:u.meta,beforeEnter:u.beforeEnter,redirect:u.redirect};if(s.push({route:_,parentName:n,source:i}),Array.isArray(u.children)&&u.children.length>0){let t=new Set(o);t.add(u),s.push(...F(u.children,d,f,g,i,`${e}.children`,t))}}return s}function Se(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return F(e,void 0,void 0,[],t,t);let n=[];for(let[r,i]of Object.entries(e)){let e=typeof r==`string`?r.trim():``;if(!e){N(`ignored route record at ${t}: route name is required`);continue}if(typeof i!=`string`||!i){N(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:i},source:t})}return n}function Ce(e){return[...Se(e.routes,`routes`),...Se(e.namedRoutes,`namedRoutes`)]}function I(e){let t=new Map;for(let[n,r]of e.entries()){!u(r.path)&&!t.has(r.path)&&t.set(r.path,n);for(let e of r.aliasPaths)!u(e)&&!t.has(e)&&t.set(e,n)}return t}function we(e){let t=new Map;for(let n of e){let e=ve(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:I(t)}}function L(e){if(e)return{...e}}function Te(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=L(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function Ee(e,t,n,r,i,a){let o=Object.freeze(e.map(e=>l(e))),s=Object.freeze(t.map(Te));return Object.freeze({tabBarEntries:o,routes:s,namedRoutes:s,paramsMode:n,maxRedirects:r,parseQuery:i.parseQuery,stringifyQuery:i.stringifyQuery,rejectOnError:a})}function De(e,t){let n={name:e.name,path:l(e.path)},r=typeof t==`string`&&t?l(v(t,``)):void 0;return r&&r!==n.path&&(n.aliasPath=r),e.meta!==void 0&&(n.meta=L(e.meta)),n}function R(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:L(e.meta)}))}function z(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function B(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function V(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:z(e.query),hash:e.hash,params:B(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=L(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=R(e.matched)),t}function Oe(e){let t={path:e.path,fullPath:e.fullPath,query:z(e.query),hash:e.hash,params:B(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=L(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=R(e.matched)),t}function H(e){let t={path:e.path,fullPath:e.fullPath,query:z(e.query),hash:e.hash,params:B(e.params)};return e.meta!==void 0&&(t.meta=L(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=R(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=V(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function U(e,t=w){let n=l(e.path),r=t(e.query);return r?`${n}?${r}`:n}function ke(e){return Object.keys(e).length>0}const Ae=Symbol(`wevu.router.instance`);let je;function Me(e){je=e,ee(Ae,e)}function Ne(){var e;return(e=je)==null?T(Ae,void 0):e}const W={unknown:1,aborted:4,cancelled:8,duplicated:16},Pe=/already|same|duplicat|重复/,Fe=/cancel|取消/,Ie=/abort|interrupt|中断/;function Le(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function G(e){let t=Le(e).toLowerCase();return Pe.test(t)?W.duplicated:Fe.test(t)?W.cancelled:Ie.test(t)?W.aborted:W.unknown}function K(e,t,n,r){let i=Le(r)||`Navigation failed`,a=Error(i);return a.__wevuNavigationFailure=!0,a.type=e,a.to=t,a.from=n,a.cause=r,a}function q(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function Re(e){return!e||typeof e!=`object`?!1:`to`in e}function ze(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function J(e,t,n){for(let r of e)try{let e=await r(t.to,t.from,t);if(q(e))return{status:`failure`,failure:e};if(e===!1)return{status:`failure`,failure:K(W.aborted,t.to,t.from,`Navigation aborted by guard`)};if(Re(e))return t.to?{status:`redirect`,target:n(e.to,t.to.path),replace:e.replace}:{status:`failure`,failure:K(W.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)};if(ze(e))return t.to?{status:`redirect`,target:n(e,t.to.path)}:{status:`failure`,failure:K(W.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)}}catch(e){return{status:`failure`,failure:K(W.aborted,t.to,t.from,e)}}return{status:`continue`}}function Y(e,t,n,r){return new Promise(i=>{let a=!1,o=e=>{a||(a=!0,i(e))};try{let i=e({...t,success:()=>o(),fail:e=>{o(K(G(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>o(),e=>o(K(G(e),n,r,e)))}catch(e){o(K(G(e),n,r,e))}})}async function Be(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function Ve(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function He(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function Ue(e){return e.type===W.unknown||e.cause instanceof Error||e.type===W.aborted&&e.cause!==void 0&&!(typeof e.cause==`string`||He(e.cause))}function X(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function We(e){let{afterEachHooks:t,errorHandlers:n,nativeRouter:r,rejectOnError:i}=e;async function a(e){if(await Be(t,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure}),e.failure&&Ue(e.failure)){var i;await Ve(n,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure})}}function o(e){return i&&Ue(e)}async function s(e){if(!e.failure&&e.to&&f({route:e.to}),await a(e),e.failure&&o(e.failure))throw e.failure;return e.failure}return{settleNavigationResult:s}}function Ge(e,t){return K(W.duplicated,e,t,`Avoided redundant navigation to current location`)}function Ke(e,t){return K(W.aborted,e,t,`switchTab does not support query parameters`)}function Z(e,t,n){return K(W.aborted,e,t,`Navigation redirected more than ${n} times`)}function qe(e,t){return K(W.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function Je(e){return K(W.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function Q(e,t){e.redirectedFrom=t.redirectedFrom?V(t.redirectedFrom):Oe(t)}async function Ye(e,t,n,r){let i=typeof e==`function`?await e(t,n):e;return Re(i)?{target:r(i.to,t.path),replace:i.replace}:{target:r(i,t.path),replace:!0}}async function Xe(e){let{mode:t,target:n,from:r,nativeRouter:i,routeResolveCodec:a,namedRouteLookup:o,beforeEachGuards:s,beforeResolveGuards:c,maxRedirects:u,tabBarPathSet:d,resolveWithCodec:f}=e,p=n,m=t,h=0;for(;;){var g;let e=d.has(p.path);if(U(p,a.stringifyQuery)===U(r,a.stringifyQuery)&&p.hash!==r.hash)return X(m,r,p,qe(p,r));if(e?p.path===r.path:p.fullPath===r.fullPath)return X(m,r,p,Ge(p,r));if(e&&ke(p.query))return X(m,r,p,Ke(p,r));let t=await J(s,{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return X(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if(Q(e,p),p=e,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));continue}}let n=ue(p,o),_=(g=n==null?void 0:n.matchedRecords)==null?[]:g,v=!1;for(let e of _){if(e.redirect===void 0)continue;let t;try{t=await Ye(e.redirect,p,r,f)}catch(e){return X(m,r,p,K(W.aborted,p,r,e))}let n=t.replace===!1?`push`:`replace`,i=t.target;if(i.fullPath!==p.fullPath||n!==m){if(Q(i,p),p=i,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));v=!0;break}}if(v)continue;let y=!1;for(let e of _){if(e.beforeEnterGuards.length===0)continue;let t=await J(new Set(e.beforeEnterGuards),{mode:m,to:p,from:r,nativeRouter:i},f);if(t.status===`failure`)return X(m,r,p,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||n!==m){if(Q(e,p),p=e,m=n,h+=1,h>u)return X(m,r,p,Z(p,r,u));y=!0;break}}}if(y)continue;let b=await J(c,{mode:m,to:p,from:r,nativeRouter:i},f);if(b.status===`failure`)return X(m,r,p,b.failure);if(b.status===`redirect`){let e=b.target,t=b.replace===!0?`replace`:b.replace===!1?`push`:m;if(e.fullPath!==p.fullPath||t!==m){if(Q(e,p),p=e,m=t,h+=1,h>u)return X(m,r,p,Z(p,r,u));continue}}if(e){let e=await Y(i.switchTab,{url:l(p.path)},p,r);return q(e)?X(m,r,p,e):X(m,r,p)}let x=await Y(m===`push`?i.navigateTo:i.redirectTo,{url:U(p,a.stringifyQuery)},p,r);return q(x)?X(m,r,p,x):X(m,r,p)}}function Ze(e){let{nativeRouter:t,route:n,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l,settleNavigationResult:u}=e;async function d(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(X(`push`,d,void 0,K(W.unknown,void 0,d,e)))}let p=await Xe({mode:`push`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l});return u(p)}async function f(e){let d=H(n),f;try{f=l(e,d.path)}catch(e){return u(X(`replace`,d,void 0,K(W.unknown,void 0,d,e)))}let p=await Xe({mode:`replace`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l});return u(p)}async function p(e=1){let r=H(n),i=await J(a,{mode:`back`,from:r,nativeRouter:t},l);if(i.status===`failure`)return u(X(`back`,r,void 0,i.failure));if(i.status===`redirect`)return u(X(`back`,r,void 0,K(W.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let s=await J(o,{mode:`back`,from:r,nativeRouter:t},l);if(s.status===`failure`)return u(X(`back`,r,void 0,s.failure));if(s.status===`redirect`)return u(X(`back`,r,void 0,K(W.aborted,void 0,r,`Redirect is not supported in back navigation guards`)));let c=await Y(t.navigateBack,{delta:e},void 0,r),d=q(c)?X(`back`,r,void 0,c):X(`back`,r);return u(d)}async function m(e){if(e<0)return p(Math.abs(e));if(e===0)return;let t=H(n);return u(X(`back`,t,void 0,Je(t)))}async function h(){return m(1)}return{push:d,replace:f,back:p,go:m,forward:h}}const Qe={parseQuery:m,stringifyQuery:w};function $(e,t=``,n=Qe){var r,i,a,o;if(typeof e==`string`){let r=p(e,n);return b(v(r.path,t),r.query,r.hash,void 0,{},n.stringifyQuery)}let s=typeof e.fullPath==`string`?p(e.fullPath,n):void 0;return b(v((r=(i=e.path)==null?s==null?void 0:s.path:i)==null?t:r,t),e.query?S(e.query):(a=s==null?void 0:s.query)==null?{}:a,_((o=e.hash)==null?s==null?void 0:s.hash:o),typeof e.name==`string`?e.name:void 0,e.params?c(e.params):{},n.stringifyQuery)}function $e(e){let t={name:e.name,path:e.path?`/${e.path}`:`/`};return e.meta!==void 0&&(t.meta=L(e.meta)),e.aliasPaths.length===1?t.alias=l(e.aliasPaths[0]):e.aliasPaths.length>1&&(t.alias=e.aliasPaths.map(e=>l(e))),e.beforeEnterGuards.length===1?t.beforeEnter=e.beforeEnterGuards[0]:e.beforeEnterGuards.length>1&&(t.beforeEnter=e.beforeEnterGuards.slice()),e.redirect!==void 0&&(t.redirect=e.redirect),t}function et(e){let t=t=>e.recordByName.has(t),n=()=>Array.from(e.recordByName.values(),$e),r=((t,n)=>{let r=typeof t==`string`?n:t;if(!r)throw Error(`Route record is required when adding a child route`);pe(r);let i=typeof t==`string`?t:void 0,a=i?e.recordByName.get(i):void 0;if(i&&!a)throw Error(`Parent route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let o=F([r],a==null?void 0:a.path,i,a==null?void 0:a.aliasPaths,void 0,`addRoute`);if(o.length===0)throw Error(`Route name and path are required when adding a named route`);let s=[];for(let t of o){let n=ve(t.route,t.parentName);if(!n)continue;let r=e.recordByName.get(n.name);if(r){let t=se(r.name,e.recordByName);for(let n of t)e.recordByName.delete(n);N(`addRoute() replaced existing route "${n.name}" (${l(r.path)} -> ${l(n.path)}) and removed ${t.size-1} nested route(s)`)}e.recordByName.set(n.name,n),s.push(n)}return e.nameByStaticPath=I(e.recordByName),()=>{let t=!1;for(let n of s)e.recordByName.get(n.name)===n&&(e.recordByName.delete(n.name),t=!0);t&&(e.nameByStaticPath=I(e.recordByName))}});function i(t){let n=se(t,e.recordByName);if(n.size===0)return;let r=!1;for(let t of n)r=e.recordByName.delete(t)||r;r&&(e.nameByStaticPath=I(e.recordByName))}function a(){e.recordByName.clear(),e.nameByStaticPath.clear()}return{hasRoute:t,getRoutes:n,addRoute:r,removeRoute:i,clearRoutes:a}}function tt(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=z(t.query),e.hash=t.hash,e.params=B(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=L(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=R(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=V(t.redirectedFrom)}function nt(n={}){var c;let l=t();if(!l)throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let u=l.instance,f=(c=n.resolveRoute)==null?(e=>{var t,n;return(t=(n=Ne())==null?void 0:n.resolve(e))==null?e:t}):c,p=f(s(void 0,u)),m=e({path:p.path,fullPath:p.fullPath,query:z(p.query),hash:p.hash,params:B(p.params)});tt(m,p);function h(e,t){let n=f(t||s(e,u));tt(m,n)}a(e=>{h(e)}),y(()=>{h()}),i(()=>{h()}),o(()=>{h()});let g=d(e=>{if(e!=null&&e.route){h(void 0,e.route);return}if(e!=null&&e.url){h(void 0,$(e.url,m.path));return}h()});return x(()=>{g()}),{route:r(m)}}function rt(e={}){return nt(e).route}function it(){return g()}function at(){return C()}function ot(e={}){var t,r,i,a,o,s;let c=it();h(n());let l=new Set,u=new Set,d=new Set,f=new Set,p=(t=e.maxRedirects)==null?10:t,g=(r=e.paramsMode)==null?`loose`:r,_=(i=e.rejectOnError)==null||i,y={parseQuery:(a=e.parseQuery)==null?m:a,stringifyQuery:(o=e.stringifyQuery)==null?w:o},b=Promise.resolve(),x=Ce(e);me(x);let S=we(x),C=((s=e.tabBarEntries)==null?[]:s).map(e=>v(e,``)).filter(Boolean),ee=new Set(C),T=et(S),te=Ee(C,T.getRoutes(),g,p,y,_);function E(e){let t={...e};t.href=t.fullPath;let n=ue(t,S);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=oe(n.matchedRecords);r!==void 0&&(t.meta=L(r)),n.params&&Object.keys(t.params).length===0&&(t.params=B(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>De(e,t===r.length-1?n.matchedPath:void 0))}else t.matched=[];return t}function D(e,t){return E($(typeof e==`string`?e:ie(e,S,g),t,y))}let O=nt({resolveRoute:E}).route;function k(e){return D(e,O.path)}let A=Ze({nativeRouter:c,route:O,routeResolveCodec:y,namedRouteLookup:S,beforeEachGuards:l,beforeResolveGuards:u,maxRedirects:p,tabBarPathSet:ee,resolveWithCodec:D,settleNavigationResult:We({afterEachHooks:d,errorHandlers:f,nativeRouter:c,rejectOnError:_}).settleNavigationResult});function ne(e){return l.add(e),()=>{l.delete(e)}}function re(e){return u.add(e),()=>{u.delete(e)}}function j(e){return d.add(e),()=>{d.delete(e)}}function ae(e){return f.add(e),()=>{f.delete(e)}}let M={nativeRouter:c,options:te,currentRoute:O,install(e){var t;Me(M);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=M)},resolve:k,isReady(){return b},push:A.push,replace:A.replace,back:A.back,go:A.go,forward:A.forward,hasRoute:T.hasRoute,getRoutes:T.getRoutes,addRoute:T.addRoute,removeRoute:T.removeRoute,clearRoutes:T.clearRoutes,beforeEach:ne,beforeResolve:re,afterEach:j,onError:ae};return Me(M),M}function st(){let e=Ne();if(e)return e;throw Error(`useRouter() 未找到已创建的 router 实例。请先在 setup() 中调用 createRouter()。`)}export{W as NavigationFailureType,K as createNavigationFailure,ot as createRouter,q as isNavigationFailure,m as parseQuery,$ as resolveRouteLocation,w as stringifyQuery,at as useNativePageRouter,it as useNativeRouter,rt as useRoute,st as useRouter};
|
|
1
|
+
import{d as e}from"./ref-D37CknuD.mjs";import{c as t,g as n,m as r,x as i}from"./base-BxKbbKVO.mjs";import{J as a,S as o,V as s,X as c,_ as l,a as u,b as d,c as f,d as p,et as m,f as h,i as g,it as _,l as v,m as y,n as b,o as x,p as S,r as C,s as ee,t as w,u as te,x as T,y as ne}from"./router-D4W4lEXM.mjs";const E=/^:(\w+)(?:\([^)]*\))?([+*?])?$/;function D(e){var t;let n=E.exec(e);if(n)return{key:n[1],modifier:(t=n[2])==null?``:t}}function O(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function k(e){return encodeURIComponent(e)}function A(e){try{return decodeURIComponent(e)}catch(t){return e}}function re(e,t,n){let r=[],i=new Set;for(let a of e.split(`/`)){if(!a)continue;let e=D(a);if(!e){r.push(a);continue}let o=O(t[e.key]);if(e.modifier===``){if(o.length!==1)throw Error(`Missing required param "${e.key}" for named route "${n}"`);i.add(e.key),r.push(k(o[0]));continue}if(e.modifier===`?`){if(o.length===0)continue;if(o.length>1)throw Error(`Param "${e.key}" for named route "${n}" must be a single value`);i.add(e.key),r.push(k(o[0]));continue}if(e.modifier===`+`){if(o.length===0)throw Error(`Missing required repeatable param "${e.key}" for named route "${n}"`);i.add(e.key);for(let e of o)r.push(k(e));continue}o.length>0&&i.add(e.key);for(let e of o)r.push(k(e))}return{path:r.join(`/`),consumedKeys:i}}function ie(e){return e===void 0?!1:!Array.isArray(e)||e.length>0}function j(e,t,n){let r=Object.keys(e).filter(e=>!t.has(e)).filter(t=>ie(e[t]));if(r.length!==0)throw Error(`Unexpected params for named route "${n}": ${r.join(`, `)}`)}function ae(e,t,n){let r=e.name;if(typeof r!=`string`||!r||e.path!==void 0||e.fullPath!==void 0)return e;let i=t.recordByName.get(r);if(!i)throw Error(`Named route "${r}" is not defined in createRouter({ routes | namedRoutes })`);let a=e.params?v(e.params):{},o=re(i.path,a,r);return n===`strict`&&j(a,o.consumedKeys,r),{...e,path:o.path?`/${o.path}`:`/`,params:a}}function M(e){return e.split(`/`).filter(Boolean)}function N(e){return[e.path,...e.aliasPaths]}function P(e,t){let n=[],r=new Set,i=e;for(;i&&!(r.has(i.name)||(r.add(i.name),n.unshift(i),!i.parentName));)i=t.recordByName.get(i.parentName);return n}function oe(e){let t;for(let n of e)n.meta&&(t||(t={}),Object.assign(t,n.meta));return t}function F(e,t){let n=new Set;if(!t.has(e))return n;n.add(e);let r=!0;for(;r;){r=!1;for(let[e,i]of t.entries())!i.parentName||n.has(e)||n.has(i.parentName)&&(n.add(e),r=!0)}return n}function se(e){let t={};for(let[n,r]of e.entries())r.length!==0&&(t[n]=r.length===1?r[0]:r);return t}function ce(e,t){let n=M(e),r=M(t),i=new Map,a=(e,t)=>{let n=i.get(e);if(n){n.push(t);return}i.set(e,[t])},o=e=>{let t=i.get(e);!t||t.length===0||(t.pop(),t.length===0&&i.delete(e))},s=(e,t,n)=>{for(let i=0;i<n;i+=1)a(e,A(r[t+i]));return()=>{for(let t=0;t<n;t+=1)o(e)}},c=(e,t)=>{if(e>=n.length)return t>=r.length;let i=n[e],l=D(i);if(!l)return t>=r.length||i!==r[t]?!1:c(e+1,t+1);if(l.modifier===``){if(t>=r.length)return!1;a(l.key,A(r[t]));let n=c(e+1,t+1);return n||o(l.key),n}if(l.modifier===`?`){if(t<r.length){if(a(l.key,A(r[t])),c(e+1,t+1))return!0;o(l.key)}return c(e+1,t)}let u=+(l.modifier===`+`),d=r.length-t;for(let n=d;n>=u;--n){let r=s(l.key,t,n);if(c(e+1,t+n))return!0;r()}return!1};if(c(0,0))return se(i)}function le(e,t){if(e.name){let n=t.recordByName.get(e.name);if(n)return{record:n,matchedRecords:P(n,t)}}let n=t.nameByStaticPath.get(e.path);if(n){let r=t.recordByName.get(n);if(r)return{record:r,matchedRecords:P(r,t),matchedPath:e.path}}for(let n of t.recordByName.values())for(let r of N(n)){if(!S(r))continue;let i=ce(r,e.path);if(i)return{record:n,matchedRecords:P(n,t),matchedPath:r,params:i}}}function I(e){typeof console>`u`||typeof console.warn!=`function`||console.warn(`[wevu/router] ${e}`)}function ue(e){let t=y(e,``);return t?h(t):`/`}function de(e,t=new Set){if(t.has(e))return!0;if(!Array.isArray(e.children)||e.children.length===0)return!1;let n=new Set(t);n.add(e);for(let t of e.children)if(de(t,n))return!0;return!1}function fe(e){let t=typeof e.name==`string`?e.name.trim():``;if(!t)throw Error(`Route name is required when adding a named route`);if(typeof e.path!=`string`||!e.path)throw Error(`Route path is required when adding named route "${t}"`);if(de(e))throw Error(`Circular children reference detected when adding named route "${t}"`)}function pe(e){let t=new Map,n=[];for(let i of e){var r;let e=typeof i.route.name==`string`?i.route.name.trim():``;if(!e)continue;let a=(r=i.source)==null?`namedRoutes`:r,o=ue(i.route.path),s=t.get(e);s&&n.push(`"${e}" (${s.source}:${s.path} -> ${a}:${o})`),t.set(e,{source:a,path:o})}n.length!==0&&I(`duplicate route names detected, later entries override earlier ones: ${n.join(`, `)}`)}function me(e){return e?Array.isArray(e)?e:[e]:[]}function he(e,t,n=`namedRoutes`){return typeof e.name==`string`&&e.name.trim()?e.name.trim():n===`routes`?t||`/`:``}function ge(e,t){if(!e)return[];let n=Array.isArray(e)?e:[e],r=[];for(let e of n){if(typeof e!=`string`)continue;let n=y(e,``);!n||n===t||r.includes(n)||r.push(n)}return r}function _e(e,t,n=`namedRoutes`){let r=y(e.path,``);if(!r&&e.path!==`/`)return;let i=he(e,r,n);if(i)return{name:i,path:r,aliasPaths:ge(e.alias,r),parentName:t,meta:e.meta,beforeEnterGuards:me(e.beforeEnter),redirect:e.redirect}}function L(e,t){return!t||e.startsWith(`/`)?y(e,``):y(`${h(t)}/${e}`,``)}function ve(e){return e?Array.isArray(e)?e.filter(e=>typeof e==`string`&&e.length>0):typeof e==`string`&&e.length>0?[e]:[]:[]}function ye(e){let t=[];for(let n of e)!n||t.includes(n)||t.push(n);return t}function be(e){if(e.length!==0)return e.length===1?h(e[0]):e.map(e=>h(e))}function R(e,t,n,r=[],i,a=`namedRoutes`,o=new Set){let s=[];for(let[c,l]of e.entries()){let e=`${a}[${c}]`;if(o.has(l)){I(`ignored route record at ${e}: detected circular children reference`);continue}if(typeof l.path!=`string`||!l.path){I(`ignored route record "${typeof(l==null?void 0:l.name)==`string`?l.name.trim():``}" at ${e}: route path is required`);continue}let u=L(l.path,t),d=he(l,u,i);if(!d){I(`ignored route record at ${e}: route name is required`);continue}let f=[],p=new Map;for(let n of ve(l.alias)){let r=L(n,t);if(!r)continue;if(r===u){I(`ignored alias "${h(r)}" for route "${d}" at ${e}: alias is same as route path`);continue}let i=p.get(r);if(i){I(`ignored duplicate alias "${h(r)}" for route "${d}" at ${e}: already declared by "${i}"`);continue}p.set(r,n),f.push(r)}let m=l.path.startsWith(`/`)?[]:r.map(e=>L(l.path,e)).filter(Boolean).filter(e=>e!==u),g=ye([...f,...m]),_={name:d,path:u?h(u):`/`,alias:be(g),meta:l.meta,beforeEnter:l.beforeEnter,redirect:l.redirect};if(s.push({route:_,parentName:n,source:i}),Array.isArray(l.children)&&l.children.length>0){let t=new Set(o);t.add(l),s.push(...R(l.children,u,d,g,i,`${e}.children`,t))}}return s}function xe(e,t=`namedRoutes`){if(!e)return[];if(Array.isArray(e))return R(e,void 0,void 0,[],t,t);let n=[];for(let[r,i]of Object.entries(e)){let e=typeof r==`string`?r.trim():``;if(!e){I(`ignored route record at ${t}: route name is required`);continue}if(typeof i!=`string`||!i){I(`ignored route record "${e}" at ${t}: route path is required`);continue}n.push({route:{name:e,path:i},source:t})}return n}function Se(e){return[...xe(e.routes,`routes`),...xe(e.namedRoutes,`namedRoutes`)]}function z(e){let t=new Map;for(let[n,r]of e.entries()){!S(r.path)&&!t.has(r.path)&&t.set(r.path,n);for(let e of r.aliasPaths)!S(e)&&!t.has(e)&&t.set(e,n)}return t}function Ce(e){let t=new Map;for(let n of e){let e=_e(n.route,n.parentName,n.source);e&&t.set(e.name,e)}return{recordByName:t,nameByStaticPath:z(t)}}function B(e){if(e)return{...e}}function we(e){let t={name:e.name,path:e.path};return e.meta!==void 0&&(t.meta=B(e.meta)),Array.isArray(e.alias)?t.alias=Object.freeze(e.alias.slice()):e.alias!==void 0&&(t.alias=e.alias),Array.isArray(e.beforeEnter)?t.beforeEnter=Object.freeze(e.beforeEnter.slice()):e.beforeEnter!==void 0&&(t.beforeEnter=e.beforeEnter),e.redirect!==void 0&&(t.redirect=e.redirect),Object.freeze(t)}function Te(e,t,n,r,i,a){let o=Object.freeze(e.map(e=>h(e))),s=Object.freeze(t.map(we));return Object.freeze({tabBarEntries:o,routes:s,namedRoutes:s,paramsMode:n,maxRedirects:r,parseQuery:i.parseQuery,stringifyQuery:i.stringifyQuery,rejectOnError:a})}function Ee(e,t){let n={name:e.name,path:h(e.path)},r=typeof t==`string`&&t?h(y(t,``)):void 0;return r&&r!==n.path&&(n.aliasPath=r),e.meta!==void 0&&(n.meta=B(e.meta)),n}function V(e){if(e)return e.map(e=>({name:e.name,path:e.path,aliasPath:e.aliasPath,meta:B(e.meta)}))}function H(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function U(e){let t={};for(let n of Object.keys(e)){let r=e[n];t[n]=Array.isArray(r)?r.slice():r}return t}function W(e){if(!e)return;let t={path:e.path,fullPath:e.fullPath,query:H(e.query),hash:e.hash,params:U(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=B(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=V(e.matched)),t}function De(e){let t={path:e.path,fullPath:e.fullPath,query:H(e.query),hash:e.hash,params:U(e.params)};return e.name!==void 0&&(t.name=e.name),e.meta!==void 0&&(t.meta=B(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=V(e.matched)),t}function G(e){let t={path:e.path,fullPath:e.fullPath,query:H(e.query),hash:e.hash,params:U(e.params)};return e.meta!==void 0&&(t.meta=B(e.meta)),e.href!==void 0&&(t.href=e.href),e.matched!==void 0&&(t.matched=V(e.matched)),e.redirectedFrom!==void 0&&(t.redirectedFrom=W(e.redirectedFrom)),e.name!==void 0&&(t.name=e.name),t}function K(e,t=p){let n=h(e.path),r=t(e.query);return r?`${n}?${r}`:n}function Oe(e){return Object.keys(e).length>0}const q={unknown:1,aborted:4,cancelled:8,duplicated:16},ke=/already|same|duplicat|重复/,Ae=/cancel|取消/,je=/abort|interrupt|中断/;function Me(e){if(typeof e==`string`)return e;if(e&&typeof e==`object`){let t=e.errMsg;if(typeof t==`string`)return t;if(e instanceof Error)return e.message}return``}function Ne(e){let t=Me(e).toLowerCase();return ke.test(t)?q.duplicated:Ae.test(t)?q.cancelled:je.test(t)?q.aborted:q.unknown}function J(e,t,n,r){let i=Me(r)||`Navigation failed`,a=Error(i);return a.__wevuNavigationFailure=!0,a.type=e,a.to=t,a.from=n,a.cause=r,a}function Y(e,t){if(!e||typeof e!=`object`)return!1;let n=e;return n.__wevuNavigationFailure===!0?t===void 0||n.type===t:!1}function Pe(e){return!e||typeof e!=`object`?!1:`to`in e}function Fe(e){if(typeof e==`string`)return!0;if(!e||typeof e!=`object`)return!1;let t=e;return`path`in t||`fullPath`in t||`query`in t||`hash`in t||`name`in t||`params`in t}async function X(e,t,n){for(let r of e)try{let e=await r(t.to,t.from,t);if(Y(e))return{status:`failure`,failure:e};if(e===!1)return{status:`failure`,failure:J(q.aborted,t.to,t.from,`Navigation aborted by guard`)};if(Pe(e))return t.to?{status:`redirect`,target:n(e.to,t.to.path),replace:e.replace}:{status:`failure`,failure:J(q.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)};if(Fe(e))return t.to?{status:`redirect`,target:n(e,t.to.path)}:{status:`failure`,failure:J(q.aborted,t.to,t.from,`Redirect is not supported in back navigation guards`)}}catch(e){return{status:`failure`,failure:J(q.aborted,t.to,t.from,e)}}return{status:`continue`}}function Ie(e,t,n,r){return new Promise(i=>{let a=!1,o=e=>{a||(a=!0,i(e))};try{let i=e({...t,success:()=>o(),fail:e=>{o(J(Ne(e),n,r,e))}});i&&typeof i.then==`function`&&i.then(()=>o(),e=>o(J(Ne(e),n,r,e)))}catch(e){o(J(Ne(e),n,r,e))}})}async function Le(e,t){for(let n of e)try{await n(t.to,t.from,t.failure,t)}catch(e){}}async function Re(e,t,n){for(let r of e)try{await r(t,n)}catch(e){}}function ze(e){return!e||typeof e!=`object`?!1:typeof e.errMsg==`string`}function Be(e){return e.type===q.unknown||e.cause instanceof Error||e.type===q.aborted&&e.cause!==void 0&&!(typeof e.cause==`string`||ze(e.cause))}function Z(e,t,n,r){return{mode:e,from:t,to:n,failure:r}}function Ve(e){let{afterEachHooks:t,errorHandlers:n,nativeRouter:r,rejectOnError:i}=e;async function a(e){if(await Le(t,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure}),e.failure&&Be(e.failure)){var i;await Re(n,(i=e.failure.cause)==null?e.failure:i,{mode:e.mode,to:e.to,from:e.from,nativeRouter:r,failure:e.failure})}}function o(e){return i&&Be(e)}async function s(e){if(e.failure||T(e.to?{route:e.to,source:`router`}:void 0),await a(e),e.failure&&o(e.failure))throw e.failure;return e.failure}return{emitNavigationAfterEach:a,settleNavigationResult:s}}function He(e,t,n){let i=r(),a=i[i.length-1-e];if(a)return n(x(a).fullPath,t.path)}async function Ue(e){let{target:t,from:n,nativeRouter:r,beforeEachGuards:i,beforeResolveGuards:a,resolveWithCodec:o}=e,s={mode:`back`,to:t,from:n,nativeRouter:r};for(let e of[i,a]){let r=await X(e,s,o);if(r.status===`failure`)return Z(`back`,n,t,r.failure);if(r.status===`redirect`)return Z(`back`,n,t,J(q.aborted,t,n,`Redirect is not supported in back navigation guards`))}return Z(`back`,n,t)}const We=Symbol(`wevu.router.instance`);let Ge;function Ke(e){Ge=e,ne(We,e)}function qe(){var e;return(e=Ge)==null?l(We,void 0):e}function Je(e,t){return J(q.duplicated,e,t,`Avoided redundant navigation to current location`)}function Ye(e,t){return J(q.aborted,e,t,`switchTab does not support query parameters`)}function Q(e,t,n){return J(q.aborted,e,t,`Navigation redirected more than ${n} times`)}function Xe(e,t){return J(q.aborted,e,t,`Hash-only navigation is not supported in mini-program router`)}function Ze(e){return J(q.aborted,void 0,e,`Forward navigation is not supported in mini-program router`)}function $(e,t){e.redirectedFrom=t.redirectedFrom?W(t.redirectedFrom):De(t)}async function Qe(e,t,n,r){let i=typeof e==`function`?await e(t,n):e;return Pe(i)?{target:r(i.to,t.path),replace:i.replace}:{target:r(i,t.path),replace:!0}}async function $e(e){let{mode:t,target:n,from:r,nativeRouter:i,routeResolveCodec:a,namedRouteLookup:o,beforeEachGuards:s,beforeResolveGuards:c,maxRedirects:l,tabBarPathSet:u,resolveWithCodec:d}=e,f=n,p=t,m=0;for(;;){var g;let e=u.has(f.path);if(K(f,a.stringifyQuery)===K(r,a.stringifyQuery)&&f.hash!==r.hash)return Z(p,r,f,Xe(f,r));if(e?f.path===r.path:f.fullPath===r.fullPath)return Z(p,r,f,Je(f,r));if(e&&Oe(f.query))return Z(p,r,f,Ye(f,r));let t=await X(s,{mode:p,to:f,from:r,nativeRouter:i},d);if(t.status===`failure`)return Z(p,r,f,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:p;if(e.fullPath!==f.fullPath||n!==p){if($(e,f),f=e,p=n,m+=1,m>l)return Z(p,r,f,Q(f,r,l));continue}}let n=le(f,o),_=(g=n==null?void 0:n.matchedRecords)==null?[]:g,v=!1;for(let e of _){if(e.redirect===void 0)continue;let t;try{t=await Qe(e.redirect,f,r,d)}catch(e){return Z(p,r,f,J(q.aborted,f,r,e))}let n=t.replace===!1?`push`:`replace`,i=t.target;if(i.fullPath!==f.fullPath||n!==p){if($(i,f),f=i,p=n,m+=1,m>l)return Z(p,r,f,Q(f,r,l));v=!0;break}}if(v)continue;let y=!1;for(let e of _){if(e.beforeEnterGuards.length===0)continue;let t=await X(new Set(e.beforeEnterGuards),{mode:p,to:f,from:r,nativeRouter:i},d);if(t.status===`failure`)return Z(p,r,f,t.failure);if(t.status===`redirect`){let e=t.target,n=t.replace===!0?`replace`:t.replace===!1?`push`:p;if(e.fullPath!==f.fullPath||n!==p){if($(e,f),f=e,p=n,m+=1,m>l)return Z(p,r,f,Q(f,r,l));y=!0;break}}}if(y)continue;let b=await X(c,{mode:p,to:f,from:r,nativeRouter:i},d);if(b.status===`failure`)return Z(p,r,f,b.failure);if(b.status===`redirect`){let e=b.target,t=b.replace===!0?`replace`:b.replace===!1?`push`:p;if(e.fullPath!==f.fullPath||t!==p){if($(e,f),f=e,p=t,m+=1,m>l)return Z(p,r,f,Q(f,r,l));continue}}if(e){let e=await Ie(i.switchTab,{url:h(f.path)},f,r);return Y(e)?Z(p,r,f,e):Z(p,r,f)}let x=await Ie(p===`push`?i.navigateTo:i.redirectTo,{url:K(f,a.stringifyQuery)},f,r);return Y(x)?Z(p,r,f,x):Z(p,r,f)}}function et(e){let{nativeRouter:t,route:n,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l,settleNavigationResult:u}=e;async function d(e){let d=G(n),f;try{f=l(e,d.path)}catch(e){return u(Z(`push`,d,void 0,J(q.unknown,void 0,d,e)))}let p=await $e({mode:`push`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l});return u(p)}async function f(e){let d=G(n),f;try{f=l(e,d.path)}catch(e){return u(Z(`replace`,d,void 0,J(q.unknown,void 0,d,e)))}let p=await $e({mode:`replace`,target:f,from:d,nativeRouter:t,routeResolveCodec:r,namedRouteLookup:i,beforeEachGuards:a,beforeResolveGuards:o,maxRedirects:s,tabBarPathSet:c,resolveWithCodec:l});return u(p)}async function p(e=1){let r=G(n),i=He(e,r,l),s=await Ue({target:i,from:r,nativeRouter:t,beforeEachGuards:a,beforeResolveGuards:o,resolveWithCodec:l});if(s.failure)return u(s);let c=await Ie(t.navigateBack,{delta:e},i,r),d=Y(c)?Z(`back`,r,i,c):s;return u(d)}async function m(e){if(e<0)return p(Math.abs(e));if(e===0)return;let t=G(n);return u(Z(`back`,t,void 0,Ze(t)))}async function h(){return m(1)}return{push:d,replace:f,back:p,go:m,forward:h}}const tt={parseQuery:te,stringifyQuery:p};function nt(e,t=``,n=tt){var r,i,a,o;if(typeof e==`string`){let r=g(e,n);return C(y(r.path,t),r.query,r.hash,void 0,{},n.stringifyQuery)}let s=typeof e.fullPath==`string`?g(e.fullPath,n):void 0;return C(y((r=(i=e.path)==null?s==null?void 0:s.path:i)==null?t:r,t),e.query?f(e.query):(a=s==null?void 0:s.query)==null?{}:a,ee((o=e.hash)==null?s==null?void 0:s.hash:o),typeof e.name==`string`?e.name:void 0,e.params?v(e.params):{},n.stringifyQuery)}function rt(e){let t={name:e.name,path:e.path?`/${e.path}`:`/`};return e.meta!==void 0&&(t.meta=B(e.meta)),e.aliasPaths.length===1?t.alias=h(e.aliasPaths[0]):e.aliasPaths.length>1&&(t.alias=e.aliasPaths.map(e=>h(e))),e.beforeEnterGuards.length===1?t.beforeEnter=e.beforeEnterGuards[0]:e.beforeEnterGuards.length>1&&(t.beforeEnter=e.beforeEnterGuards.slice()),e.redirect!==void 0&&(t.redirect=e.redirect),t}function it(e){let t=t=>e.recordByName.has(t),n=()=>Array.from(e.recordByName.values(),rt),r=((t,n)=>{let r=typeof t==`string`?n:t;if(!r)throw Error(`Route record is required when adding a child route`);fe(r);let i=typeof t==`string`?t:void 0,a=i?e.recordByName.get(i):void 0;if(i&&!a)throw Error(`Parent route "${i}" is not defined in createRouter({ routes | namedRoutes })`);let o=R([r],a==null?void 0:a.path,i,a==null?void 0:a.aliasPaths,void 0,`addRoute`);if(o.length===0)throw Error(`Route name and path are required when adding a named route`);let s=[];for(let t of o){let n=_e(t.route,t.parentName);if(!n)continue;let r=e.recordByName.get(n.name);if(r){let t=F(r.name,e.recordByName);for(let n of t)e.recordByName.delete(n);I(`addRoute() replaced existing route "${n.name}" (${h(r.path)} -> ${h(n.path)}) and removed ${t.size-1} nested route(s)`)}e.recordByName.set(n.name,n),s.push(n)}return e.nameByStaticPath=z(e.recordByName),()=>{let t=!1;for(let n of s)e.recordByName.get(n.name)===n&&(e.recordByName.delete(n.name),t=!0);t&&(e.nameByStaticPath=z(e.recordByName))}});function i(t){let n=F(t,e.recordByName);if(n.size===0)return;let r=!1;for(let t of n)r=e.recordByName.delete(t)||r;r&&(e.nameByStaticPath=z(e.recordByName))}function a(){e.recordByName.clear(),e.nameByStaticPath.clear()}return{hasRoute:t,getRoutes:n,addRoute:r,removeRoute:i,clearRoutes:a}}function at(e,t){e.path=t.path,e.fullPath=t.fullPath,e.query=H(t.query),e.hash=t.hash,e.params=U(t.params),t.name===void 0?delete e.name:e.name=t.name,t.meta===void 0?delete e.meta:e.meta=B(t.meta),t.href===void 0?delete e.href:e.href=t.href,t.matched===void 0?delete e.matched:e.matched=V(t.matched),t.redirectedFrom===void 0?delete e.redirectedFrom:e.redirectedFrom=W(t.redirectedFrom)}function ot(n={}){var r;let l=t();if(!l)throw Error(`useRoute() 必须在 setup() 的同步阶段调用`);let d=l.instance,f=(r=n.resolveRoute)==null?(e=>{var t,n;return(t=(n=qe())==null?void 0:n.resolve(e))==null?e:t}):r,p=f(u(void 0,d)),h=e({path:p.path,fullPath:p.fullPath,query:H(p.query),hash:p.hash,params:U(p.params)});at(h,p);function g(e,t,r){let i=f(t||u(e,d));if(r){var a;(a=n.beforeRouteStateSync)==null||a.call(n,i,r)}at(h,i)}s(e=>{g(e)}),a(()=>{g()}),m(()=>{g()}),c(()=>{g()});let v=o(e=>{if(e!=null&&e.route){g(void 0,e.route,e);return}if(e!=null&&e.page){g(void 0,x(e.page),e);return}if(e!=null&&e.url){g(void 0,nt(e.url,h.path),e);return}g(void 0,void 0,e)});return _(()=>{v()}),{route:i(h)}}function st(e={}){return ot(e).route}function ct(){return b()}function lt(){return w()}function ut(e={}){var t,r,i,a,o,s;let c=ct();d(n());let l=new Set,u=new Set,f=new Set,m=new Set,h=(t=e.maxRedirects)==null?10:t,g=(r=e.paramsMode)==null?`loose`:r,_=(i=e.rejectOnError)==null||i,v={parseQuery:(a=e.parseQuery)==null?te:a,stringifyQuery:(o=e.stringifyQuery)==null?p:o},b=Promise.resolve(),x=Se(e);pe(x);let S=Ce(x),C=((s=e.tabBarEntries)==null?[]:s).map(e=>y(e,``)).filter(Boolean),ee=new Set(C),w=it(S),T=0,ne=Te(C,w.getRoutes(),g,h,v,_);function E(e){let t={...e};t.href=t.fullPath;let n=le(t,S);if(n){let e=n.record;t.name===void 0&&(t.name=e.name);let r=oe(n.matchedRecords);r!==void 0&&(t.meta=B(r)),n.params&&Object.keys(t.params).length===0&&(t.params=U(n.params)),t.matched=n.matchedRecords.map((e,t,r)=>Ee(e,t===r.length-1?n.matchedPath:void 0))}else t.matched=[];return t}function D(e,t){return E(nt(typeof e==`string`?e:ae(e,S,g),t,v))}let O,k;function A(e){return e.source===`page`||e.source===`native`&&e.method===`navigateBack`}function re(e,t){T>0||!A(t)||e.fullPath===O.fullPath||Ue({target:e,from:G(O),nativeRouter:c,beforeEachGuards:l,beforeResolveGuards:u,resolveWithCodec:D}).then(e=>k==null?void 0:k(e))}O=ot({beforeRouteStateSync:re,resolveRoute:E}).route;function ie(e){return D(e,O.path)}let j=Ve({afterEachHooks:f,errorHandlers:m,nativeRouter:c,rejectOnError:_});k=j.emitNavigationAfterEach;let M=et({nativeRouter:c,route:O,routeResolveCodec:v,namedRouteLookup:S,beforeEachGuards:l,beforeResolveGuards:u,maxRedirects:h,tabBarPathSet:ee,resolveWithCodec:D,settleNavigationResult:j.settleNavigationResult});async function N(e){T+=1;try{return await e()}finally{--T}}function P(e){return l.add(e),()=>{l.delete(e)}}function F(e){return u.add(e),()=>{u.delete(e)}}function se(e){return f.add(e),()=>{f.delete(e)}}function ce(e){return m.add(e),()=>{m.delete(e)}}let I={nativeRouter:c,options:ne,currentRoute:O,install(e){var t;Ke(I);let n=e==null||(t=e.config)==null?void 0:t.globalProperties;n&&(n.$router=I)},resolve:ie,isReady(){return b},push:e=>N(()=>M.push(e)),replace:e=>N(()=>M.replace(e)),back:e=>N(()=>M.back(e)),go:e=>N(()=>M.go(e)),forward:()=>N(()=>M.forward()),hasRoute:w.hasRoute,getRoutes:w.getRoutes,addRoute:w.addRoute,removeRoute:w.removeRoute,clearRoutes:w.clearRoutes,beforeEach:P,beforeResolve:F,afterEach:se,onError:ce};return Ke(I),I}function dt(){let e=qe();if(e)return e;throw Error(`useRouter() 未找到已创建的 router 实例。请先在 setup() 中调用 createRouter()。`)}export{q as NavigationFailureType,J as createNavigationFailure,ut as createRouter,Y as isNavigationFailure,te as parseQuery,nt as resolveRouteLocation,p as stringifyQuery,lt as useNativePageRouter,ct as useNativeRouter,st as useRoute,dt as useRouter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as e,l as t,m as n,p as r,t as i}from"./watch-Bbd-gmEg.mjs";import{A as a,B as o,M as s,N as c,R as l,a as u,d,i as f,k as p,l as m,n as h,o as g,r as _,s as v,t as y,v as b,z as x}from"./ref-D37CknuD.mjs";import{i as S,n as C,r as w,t as T}from"./computed-Xoi9XEUx.mjs";import{_ as E,c as D,d as O,g as k,h as A,l as j,m as M,n as N,p as P,r as F,s as I,t as L,u as R,v as z,x as B}from"./base-BxKbbKVO.mjs";import{A as V,C as H,D as U,E as ee,G as W,I as te,K as ne,L as G,M as re,N as ie,O as ae,T as K,et as oe,it as se,j as ce,k as le,w as ue,x as de}from"./router-D4W4lEXM.mjs";import{WEAPP_VITE_STATEFUL_HMR_BRIDGE_KEY as fe,WEVU_ATTRS_KEY as pe,WEVU_EFFECT_SCOPE_KEY as me,WEVU_EXPOSED_KEY as he,WEVU_FUNCTION_PROP_PATHS_KEY as ge,WEVU_HOOKS_KEY as _e,WEVU_INLINE_HANDLER as ve,WEVU_INLINE_MAP_KEY as ye,WEVU_IS_APP_INSTANCE_KEY as be,WEVU_LAYOUT_BRIDGE_PAGE_KEYS as xe,WEVU_LAYOUT_HOST_BRIDGE_KEY as Se,WEVU_MODEL_HANDLER as Ce,WEVU_NATIVE_INSTANCE_KEY as q,WEVU_ON_BEFORE_UPDATE_HOOK as we,WEVU_ON_LOAD_CALLED_KEY as Te,WEVU_ON_UPDATED_HOOK as Ee,WEVU_OWNER_HANDLER as J,WEVU_PAGE_LAYOUT_NAME_KEY as De,WEVU_PAGE_LAYOUT_NONE as Oe,WEVU_PAGE_LAYOUT_PROPS_KEY as ke,WEVU_PAGE_LAYOUT_SETTER_KEY as Ae,WEVU_PAGE_SCROLL_HOOK_DEPTH_KEY as je,WEVU_PARENT_INSTANCE_KEY as Me,WEVU_PENDING_PROP_VALUES_KEY as Ne,WEVU_PROPS_ALIASES_KEY as Pe,WEVU_PROPS_DERIVED_KEYS_KEY as Fe,WEVU_PROPS_KEY as Y,WEVU_PROP_KEYS_KEY as Ie,WEVU_PUBLIC_RUNTIME_KEY as X,WEVU_READY_CALLED_KEY as Le,WEVU_RESERVED_METHOD_PREFIX as Re,WEVU_ROUTE_DONE_CALLED_KEY as ze,WEVU_ROUTE_DONE_IN_TICK_KEY as Be,WEVU_RUNTIME_APP_KEY as Ve,WEVU_RUNTIME_KEY as He,WEVU_SCOPED_SLOT_CREATOR_KEY as Ue,WEVU_SCOPED_SLOT_OWNER_SEED_KEY as We,WEVU_SCOPED_SLOT_OWNER_STORE_KEY as Ge,WEVU_SETUP_CONTEXT_INSTANCE_KEY as Ke,WEVU_SETUP_STATE_KEY as qe,WEVU_SLOT_NAMES_PROP as Je,WEVU_SLOT_OWNER_ID_KEY as Z,WEVU_SLOT_OWNER_ID_PROP as Ye,WEVU_SLOT_OWNER_KEY as Xe,WEVU_SLOT_OWNER_PROXY_KEY as Ze,WEVU_SLOT_PROPS_DATA_KEY as Qe,WEVU_SLOT_PROPS_KEY as $e,WEVU_SLOT_SCOPE_KEY as et,WEVU_TEMPLATE_REFS_CALLBACKS_KEY as tt,WEVU_TEMPLATE_REFS_KEY as nt,WEVU_TEMPLATE_REFS_PENDING_KEY as rt,WEVU_TEMPLATE_REF_MAP_KEY as it,WEVU_WATCH_STOPS_KEY as at}from"@weapp-core/constants";import{wpi as ot}from"@wevu/api";function st(e){j(L(`onMounted`),`onReady`,e)}function ct(e){j(L(`onUpdated`),Ee,e)}function lt(e){L(`onBeforeUnmount`),e()}function ut(e){j(L(`onUnmounted`),`onUnload`,e)}function dt(e){L(`onBeforeMount`),e()}function ft(e){j(L(`onBeforeUpdate`),we,e)}function pt(e){let t=L(`onErrorCaptured`);j(t,`onError`,n=>e(n,t,``))}function mt(e){j(L(`onActivated`),`onShow`,e)}function ht(e){j(L(`onDeactivated`),`onHide`,e)}function gt(e){L(`onServerPrefetch`)}function _t(e,t){N(e,t===`before`?we:Ee)}const vt=`6.18.7`;function yt(e){return e?e.charAt(0).toUpperCase()+e.slice(1):``}function bt(e){return e?e.split(`.`).map(e=>e.trim()).filter(Boolean):[]}function Q(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xt(e,t,n){let r=e[t];if(!r)throw Error(`计算属性 "${t}" 是只读的`);r(n)}function St(e){if(e==null)return e;if(typeof e==`object`){if(`detail`in e&&e.detail&&`value`in e.detail)return e.detail.value;if(`target`in e&&e.target&&`value`in e.target)return e.target.value}return e}function Ct(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];(r[n]==null||typeof r[n]!=`object`)&&(r[n]={}),r=r[n]}r[t[t.length-1]]=n}function wt(e,t,n,r,i,a){if(!i.length)return;let[o,...s]=i;if(!s.length){if(n[o])xt(r,o,a);else{let n=t&&Object.prototype.hasOwnProperty.call(t,o)?t:e,r=n[o];h(r)?r.value=a:n[o]=a}return}if(n[o]){xt(r,o,a);return}let c=t&&Object.prototype.hasOwnProperty.call(t,o)?t:e;(c[o]==null||typeof c[o]!=`object`)&&(c[o]={}),Ct(c[o],s,a)}function Tt(e,t){return t.reduce((e,t)=>e==null?e:e[t],e)}function Et(e){return St(e)}function Dt(e,t,n,r,i){return(a,o)=>{let s=bt(a);if(!s.length)throw Error(`bindModel 需要非空路径`);let c=()=>Tt(e,s),l=e=>{wt(t,i,n,r,s,e)},u={event:`input`,valueProp:`value`,parser:Et,formatter:e=>e,...o};return{get value(){return c()},set value(e){l(e)},update(e){l(e)},model(e){let t={...u,...e},n=`on${yt(t.event)}`,r=e=>{let n=t.parser(e);l(n)};return{[t.valueProp]:t.formatter(c()),[n]:r}}}}}function Ot(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function kt(e){return Array.isArray(e)||Ot(e)}function At(e){if(Array.isArray(e))return e;let t=[];for(let n of Object.keys(e)){let r=Object.getOwnPropertyDescriptor(e,n);!r||typeof r.get==`function`||t.push(r.value)}return t}function jt(e,t=new WeakSet){return h(e)||m(e)?!0:!e||typeof e!=`object`||t.has(e)||(t.add(e),!kt(e))?!1:At(e).some(e=>jt(e,t))}function Mt(e,t=new WeakSet){if(h(e)){let n=e.value;m(n)&&S(n),Mt(n,t);return}if(m(e)){S(e),Mt(b(e),t);return}!e||typeof e!=`object`||t.has(e)||!kt(e)||(t.add(e),At(e).forEach(e=>Mt(e,t)))}const Nt=`__wevu_native_bridge__`;function Pt(e){try{Object.defineProperty(e,Nt,{value:!0,configurable:!1,enumerable:!1,writable:!1})}catch(t){e[Nt]=!0}}function Ft(e){return typeof e==`function`&&!!e[Nt]}function It(e){let t=Object.create(null),n=Object.create(null),r=new Set;return{computedRefs:t,computedSetters:n,dirtyComputedKeys:r,createTrackedComputed:(t,n,i)=>{let a,c=!0,l,u={get value(){return c&&(a=l(),c=!1),x(u,`value`),a},set value(e){if(!i)throw Error(`计算属性是只读的`);i(e)}};return _(u),l=s(n,{lazy:!0,scheduler:()=>{c||(c=!0,e.setDataStrategy===`patch`&&e.includeComputed&&r.add(t),o(u,`value`))}}),u},computedProxy:new Proxy({},{get(e,n){if(typeof n==`string`&&t[n])return t[n].value},has(e,n){return typeof n==`string`&&!!t[n]},ownKeys(){return Object.keys(t)},getOwnPropertyDescriptor(e,n){if(typeof n==`string`&&t[n])return{configurable:!0,enumerable:!0,value:t[n].value}}})}}function Lt(e){let{state:t,setupState:n,computedDefs:r,methodDefs:i,appConfig:a,includeComputed:o,setDataStrategy:s}=e,c={},{computedRefs:l,computedSetters:u,dirtyComputedKeys:d,createTrackedComputed:p,computedProxy:m}=It({includeComputed:o,setDataStrategy:s}),g=f(0),_=(e,t)=>{let n=b(e),r=n[He],i=r==null?void 0:r.proxy,a=(e,t)=>{let n=e[t];return Ft(n)},o=n=>!(!n||typeof n!=`object`||n===e||n===t||n===i||a(n,`triggerEvent`)||a(n,`createSelectorQuery`)||a(n,`createIntersectionObserver`)||a(n,`setData`)),s=n[q];if(o(s))return s;let c=r==null?void 0:r.instance;if(o(c))return c},v=e=>{if(Q(c,e))return;let n=(...n)=>{let r=_(t,t);if(!r)return;let i=Reflect.get(r,e);if(typeof i==`function`)return i.apply(r,n)};Pt(n),c[e]=n},y=new Proxy(t,{get(e,r,i){if(typeof r==`string`){if(g.value,Q(n,r))return Reflect.get(n,r,i);if(r===`props`){let t=e[Y];if(t&&typeof t==`object`)return t}if(r===`data`||r===`$state`)return t;if(r===`$computed`)return m;if(Q(c,r))return c[r];if(l[r])return l[r].value;if(Q(a.globalProperties,r))return a.globalProperties[r]}if(!Reflect.has(e,r)){let t=_(e,i);if(t&&Reflect.has(t,r)){let e=Reflect.get(t,r);return typeof e==`function`?e.bind(t):e}}let o=Reflect.get(e,r,i);return typeof r==`string`&&Q(n,r)?Reflect.get(n,r,i):o},set(e,t,r,i){if(typeof t==`string`&&l[t])return xt(u,t,r),!0;if(Q(n,t)){let e=Reflect.get(n,t,i);return h(e)&&!h(r)?(e.value=r,!0):Reflect.set(n,t,r,i)}if(Reflect.has(e,t)){var a;let o=Reflect.get(e,t,i);return h(o)&&!h(r)?(o.value=r,!0):Q((a=e[Y])==null?{}:a,t)?Reflect.set(n,t,r,i):Reflect.set(e,t,r,i)}let o=_(e,i);return o&&Reflect.has(o,t)?Reflect.set(o,t,r):Reflect.set(e,t,r,i)},has(e,t){if(t===`data`||typeof t==`string`&&(Q(n,t)||l[t]||Q(c,t)))return!0;let r=_(e,e);return r&&Reflect.has(r,t)?!0:Reflect.has(e,t)},ownKeys(e){let t=new Set;return Reflect.ownKeys(e).forEach(e=>{t.add(e)}),Reflect.ownKeys(n).forEach(e=>{t.add(e)}),Object.keys(c).forEach(e=>t.add(e)),Object.keys(l).forEach(e=>t.add(e)),[...t]},getOwnPropertyDescriptor(e,r){if(typeof r==`string`&&Q(n,r))return Object.getOwnPropertyDescriptor(n,r);if(Reflect.has(e,r))return Object.getOwnPropertyDescriptor(e,r);if(typeof r==`string`){if(r===`data`)return{configurable:!0,enumerable:!1,get(){return t}};if(l[r])return{configurable:!0,enumerable:!0,get(){return l[r].value},set(e){xt(u,r,e)}};if(Q(c,r))return{configurable:!0,enumerable:!1,value:c[r]}}}});return Object.keys(i).forEach(e=>{let t=i[e];if(typeof t==`function`){c[e]=(...e)=>t.apply(y,e);return}e===ye&&t&&typeof t==`object`&&(c[e]=t)}),v(`triggerEvent`),v(`createSelectorQuery`),v(`createIntersectionObserver`),v(`setData`),Object.keys(r).forEach(e=>{let t=r[e];if(typeof t==`function`)l[e]=p(e,()=>t.call(y));else{var n,i;let r=(n=t.get)==null?void 0:n.bind(y);if(!r)throw Error(`计算属性 "${e}" 需要提供 getter`);let a=(i=t.set)==null?void 0:i.bind(y);a?(u[e]=a,l[e]=p(e,r,a)):l[e]=p(e,r)}}),{boundMethods:c,computedRefs:l,computedSetters:u,dirtyComputedKeys:d,computedProxy:m,publicInstance:y,touchSetupMethodsVersion(){g.value+=1}}}function Rt(e){return e!==`patch`&&e!==`diff`}function zt(e){if(e!==`off`)return t=>{if(e===`fallback`&&!Rt(t.reason))return;let n=typeof t.bytes==`number`?t.bytes:t.estimatedBytes,r=typeof n==`number`?`${n}B`:`unknown`,i=[`mode=${t.mode}`,`reason=${t.reason}`,`pending=${t.pendingPatchKeys}`,`keys=${t.payloadKeys}`,`bytes=${r}`];typeof t.mergedSiblingParents==`number`&&i.push(`mergedParents=${t.mergedSiblingParents}`),typeof t.computedDirtyKeys==`number`&&i.push(`computedDirty=${t.computedDirtyKeys}`),typeof t.flushCount==`number`&&i.push(`flushes=${t.flushCount}`),typeof t.windowMs==`number`&&i.push(`window=${t.windowMs}ms`);let a=`[wevu:setData] ${i.join(` `)}`;if(Rt(t.reason)){console.warn(a);return}console.info(a)}}const Bt=Symbol(`wevu.noSetData`);function $(e){return Object.defineProperty(e,Bt,{value:!0,configurable:!0,enumerable:!1,writable:!1}),e}function Vt(e){return typeof e==`object`&&!!e&&e[Bt]===!0}function Ht(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function Ut(e,t,n,r,i,a,o,s,c,l){let u=g(e);if(typeof u==`bigint`){let e=Number(u);return Number.isSafeInteger(e)?e:u.toString()}if(typeof u==`symbol`)return u.toString();if(typeof u==`function`)return s||c!=null&&c.has(l)?u:void 0;if(typeof u!=`object`||!u)return u;if(Vt(u))return;let d=m(u),f=d?b(u):u,p=!!r&&d;if(r&&!p){let e=i==null?void 0:i.get(f);p=e==null?!jt(f):e,i==null||i.set(f,p)}let h=p?r:void 0;if(a<=0||o.keys<=0)return f;if(h){let e=v(f),t=h.get(f);if(t&&t.version===e)return t.value}if(n.has(f))return;if(t.has(f))return t.get(f);if(f instanceof Date)return f.getTime();if(f instanceof RegExp)return f.toString();if(f instanceof Map){let e=[];return t.set(f,e),n.add(f),f.forEach((r,i)=>{e.push([Ut(i,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``),Ut(r,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``)])}),n.delete(f),e}if(f instanceof Set){let e=[];return t.set(f,e),n.add(f),f.forEach(r=>{e.push(Ut(r,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``))}),n.delete(f),e}if(typeof ArrayBuffer<`u`){if(f instanceof ArrayBuffer)return f.byteLength;if(ArrayBuffer.isView(f)){let e=f;if(typeof e[Symbol.iterator]==`function`){let r=[...e];return t.set(f,r),r.map(e=>Ut(e,t,n,void 0,void 0,1/0,{keys:1/0},s,void 0,``))}let r=[...new Uint8Array(e.buffer,e.byteOffset,e.byteLength)];return t.set(f,r),r}}if(f instanceof Error)return{name:f.name,message:f.message};if(Array.isArray(f)){let e=[];t.set(f,e),n.add(f);let u=a-1;for(let a=0;a<f.length;a+=1){let d=l?`${l}.${a}`:String(a),p=Ut(f[a],t,n,r,i,u,o,s,c,d);e[a]=p===void 0?null:p}return n.delete(f),h&&h.set(f,{version:v(f),value:e}),e}let _={};t.set(f,_),n.add(f);let y=a-1;for(let e of Object.keys(f)){if(--o.keys,o.keys<=0)break;let a=l?`${l}.${e}`:e,u=Ut(f[e],t,n,r,i,y,o,s,c,a);u!==void 0&&(_[e]=u)}return n.delete(f),h&&h.set(f,{version:v(f),value:_}),_}function Wt(e,t=new WeakMap,n){var r,i,a;let o=(r=n==null?void 0:n._depth)==null?typeof(n==null?void 0:n.maxDepth)==`number`?Math.max(0,Math.floor(n.maxDepth)):1/0:r,s=(i=n==null?void 0:n._budget)==null?typeof(n==null?void 0:n.maxKeys)==`number`?{keys:Math.max(0,Math.floor(n.maxKeys))}:{keys:1/0}:i,c=Array.isArray(n==null?void 0:n.functionPaths)&&n.functionPaths.length?new Set(n.functionPaths):void 0;return Ut(e,t,new WeakSet,n==null?void 0:n.cache,n==null?void 0:n.cacheEligibility,o,s,!!(n!=null&&n.includeFunctions),c,(a=n==null?void 0:n._path)==null?``:a)}function Gt(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function Kt(e,t,n){let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let i of r)if(!Q(t,i)||!n(e[i],t[i]))return!1;return!0}function qt(e,t){return Object.is(e,t)?!0:Array.isArray(e)&&Array.isArray(t)?Gt(e,t,qt):Ht(e)&&Ht(t)?Kt(e,t,qt):!1}function Jt(e){return e===void 0?null:e}function Yt(e,t,n,r){if(!qt(e,t)){if(Ht(e)&&Ht(t)){for(let i of Object.keys(t)){if(!Q(e,i)){r[`${n}.${i}`]=Jt(t[i]);continue}Yt(e[i],t[i],`${n}.${i}`,r)}for(let i of Object.keys(e))Q(t,i)||(r[`${n}.${i}`]=null);return}if(Array.isArray(e)&&Array.isArray(t)){Gt(e,t,qt)||(r[n]=Jt(t));return}r[n]=Jt(t)}}function Xt(e,t,n){let r={},i=n==null?void 0:n.skipKeys;for(let n of Object.keys(t))i!=null&&i.has(n)||Yt(e[n],t[n],n,r);for(let n of Object.keys(e))i!=null&&i.has(n)||Q(t,n)||(r[n]=null);return r}function Zt(e){let t=Object.keys(e).sort();if(t.length<=1)return e;let n={},r=[];for(let i of t){for(;r.length;){let e=r[r.length-1];if(i.startsWith(e))break;r.pop()}r.length||(n[i]=e[i],r.push(`${i}.`))}return n}function Qt(e,t,n){if(t<=0)return t+1;if(e===null)return 4;let r=typeof e;if(r===`string`)return 2+e.length;if(r===`number`)return Number.isFinite(e)?String(e).length:4;if(r===`boolean`)return e?4:5;if(r===`undefined`||r===`function`||r===`symbol`||r!==`object`||n.has(e))return 4;if(n.add(e),Array.isArray(e)){let r=2;for(let i=0;i<e.length;i++)if(i&&(r+=1),r+=Qt(e[i],t-r,n),r>t)return r;return r}let i=2;for(let[r,a]of Object.entries(e))if(i>2&&(i+=1),i+=2+r.length+1,i+=Qt(a,t-i,n),i>t)return i;return i}function $t(e,t){if(t===1/0)return{fallback:!1,estimatedBytes:void 0,bytes:void 0};let n=t,r=Object.keys(e).length,i=Qt(e,n+1,new WeakSet);if(i>n)return{fallback:!0,estimatedBytes:i,bytes:void 0};if(i>=n*.85&&r>2)try{let t=JSON.stringify(e).length;return{fallback:t>n,estimatedBytes:i,bytes:t}}catch(e){return{fallback:!1,estimatedBytes:i,bytes:void 0}}return{fallback:!1,estimatedBytes:i,bytes:void 0}}function en(e){let{input:t,entryMap:n,getPlainByPath:r,mergeSiblingThreshold:i,mergeSiblingSkipArray:a,mergeSiblingMaxParentBytes:o,mergeSiblingMaxInflationRatio:s}=e;if(!i)return{out:t,merged:0};let c=Object.keys(t);if(c.length<i)return{out:t,merged:0};let l=new Map,u=new Set;for(let e of c){var d;let r=n.get(e);if(!r)continue;if(t[e]===null||r.op===`delete`){let t=e.lastIndexOf(`.`);t>0&&u.add(e.slice(0,t));continue}let i=e.lastIndexOf(`.`);if(i<=0)continue;let a=e.slice(0,i),o=(d=l.get(a))==null?[]:d;o.push(e),l.set(a,o)}let f=[...l.entries()].filter(([e,t])=>t.length>=i&&!u.has(e)).sort((e,t)=>t[0].split(`.`).length-e[0].split(`.`).length);if(!f.length)return{out:t,merged:0};let p={};Object.assign(p,t);let m=0,h=new WeakMap,g=e=>{if(e&&typeof e==`object`){let t=h.get(e);if(t!==void 0)return t;let n=Qt(e,1/0,new WeakSet);return h.set(e,n),n}return Qt(e,1/0,new WeakSet)},_=(e,t)=>2+e.length+1+g(t);for(let[e,t]of f){if(Q(p,e))continue;let n=t.filter(e=>Q(p,e));if(n.length<i)continue;let c=r(e);if(!(a&&Array.isArray(c))&&!(o!==1/0&&_(e,c)>o)){if(s!==1/0){let t=0;for(let e of n)t+=_(e,p[e]);if(_(e,c)>t*s)continue}p[e]=c;for(let e of n)delete p[e];m+=1}}return{out:p,merged:m}}function tn(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function nn(e){return e===void 0?null:e}function rn(e){if(Array.isArray(e))return e.map(e=>rn(e));if(!tn(e))return e;let t={};for(let n of Object.keys(e))t[n]=rn(e[n]);return t}function an(e,t){if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}if(!tn(e)||!tn(t))return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Q(t,r)||!Object.is(e[r],t[r]))return!1;return!0}function on(e,t,n,r){if(Object.is(e,t))return!0;if(n<=0)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!on(e[i],t[i],n-1,r))return!1;return!0}if(!tn(e)||!tn(t))return!1;let i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(let a of i)if(--r.keys,r.keys<=0||!Q(t,a)||!on(e[a],t[a],n-1,r))return!1;return!0}function sn(e,t,n,r,i){var a;let o=(a=i==null?void 0:i.cloneValue)==null||a,s=t.split(`.`).filter(Boolean);if(!s.length)return;let c=e;for(let e=0;e<s.length-1;e++){let t=s[e];(!Q(c,t)||c[t]==null||typeof c[t]!=`object`)&&(c[t]={}),c=c[t]}let l=s[s.length-1];if(r===`delete`)try{delete c[l]}catch(e){c[l]=null}else c[l]=o?rn(n):n}function cn(e){let{state:t,setupState:n,computedRefs:r,includeComputed:i,shouldIncludeKey:a,plainCache:o,plainCacheEligibility:s,toPlainMaxDepth:c,toPlainMaxKeys:l,includeFunctions:u=!1,functionPaths:d=[]}=e,f=new WeakMap,p={},h=Number.isFinite(l)?{keys:l}:void 0,g=m(t)?b(t):t,_=n&&typeof n==`object`?m(n)?b(n):n:void 0,v=Object.keys(g),y=_?Object.keys(_):[],x=i?Object.keys(r):[];for(let e of v)a(e)&&(p[e]=Wt(g[e],f,{cache:o,cacheEligibility:s,maxDepth:c,includeFunctions:u,functionPaths:d,_budget:h,_path:e}));for(let e of y)a(e)&&(p[e]=Wt(_[e],f,{cache:o,cacheEligibility:s,maxDepth:c,includeFunctions:u,functionPaths:d,_budget:h,_path:e}));for(let e of x)a(e)&&(p[e]=Wt(r[e].value,f,{cache:o,cacheEligibility:s,maxDepth:c,includeFunctions:u,functionPaths:d,_budget:h,_path:e}));return p}function ln(e){let{state:t,computedRefs:n,dirtyComputedKeys:r,includeComputed:i,computedCompare:a,computedCompareMaxDepth:o,computedCompareMaxKeys:s,currentAdapter:c,shouldIncludeKey:l,maxPatchKeys:u,maxPayloadBytes:d,mergeSiblingThreshold:f,mergeSiblingMaxInflationRatio:p,mergeSiblingMaxParentBytes:m,mergeSiblingSkipArray:h,elevateTopKeyThreshold:g,toPlainMaxDepth:_,toPlainMaxKeys:v,includeFunctions:y=!1,functionPaths:b,plainCache:x,plainCacheEligibility:S,pendingPatches:C,fallbackTopKeys:w,latestSnapshot:T,latestComputedSnapshot:E,needsFullSnapshot:D,emitDebug:O,runDiffUpdate:k}=e;if(C.size>u){D.value=!0;let e=C.size;C.clear(),r.clear(),O({mode:`diff`,reason:`maxPatchKeys`,pendingPatchKeys:e,payloadKeys:0}),k(`maxPatchKeys`);return}let A=new WeakMap,j=new Map,M=Object.create(null),N=[...C.entries()];if(Number.isFinite(g)&&g>0){let e=new Map;for(let[t]of N){var P;let n=t.split(`.`,1)[0];e.set(n,((P=e.get(n))==null?0:P)+1)}for(let[t,n]of e)n>=g&&w.add(t)}let F=N.filter(([e])=>{for(let t of w)if(e===t||e.startsWith(`${t}.`))return!1;return!0}),I=new Map(F);C.clear();let L=e=>{let n=e.split(`.`).filter(Boolean),r=t;for(let e of n){if(r==null)return r;r=r[e]}return r},R=e=>{if(j.has(e))return j.get(e);let t=nn(Wt(L(e),A,{cache:x,cacheEligibility:S,maxDepth:_,maxKeys:v,includeFunctions:y,functionPaths:b,_path:e}));return j.set(e,t),t};if(w.size){for(let e of w)l(e)&&(M[e]=R(e),I.set(e,{kind:`property`,op:`set`}));w.clear()}for(let[e,t]of F){if((t.kind===`array`?`set`:t.op)===`delete`){M[e]=null;continue}M[e]=R(e)}let z=0;if(i&&r.size){let e=Object.create(null),t=[...r];r.clear(),z=t.length;for(let r of t){if(!l(r))continue;let t=Wt(n[r].value,A,{cache:x,cacheEligibility:S,maxDepth:_,maxKeys:v,includeFunctions:y,functionPaths:b,_path:r}),i=E[r];(a===`deep`?on(i,t,o,{keys:s}):a===`shallow`?an(i,t):Object.is(i,t))||(e[r]=nn(t),E[r]=rn(t))}Object.assign(M,e)}let B=Zt(M),V=0;if(f){let e=en({input:B,entryMap:I,getPlainByPath:R,mergeSiblingThreshold:f,mergeSiblingSkipArray:h,mergeSiblingMaxParentBytes:m,mergeSiblingMaxInflationRatio:p});V=e.merged,B=Zt(e.out)}let H=$t(B,d),U=H.fallback;if(O({mode:U?`diff`:`patch`,reason:U?`maxPayloadBytes`:`patch`,pendingPatchKeys:F.length,payloadKeys:Object.keys(B).length,mergedSiblingParents:V||void 0,computedDirtyKeys:z||void 0,estimatedBytes:H.estimatedBytes,bytes:H.bytes}),U){D.value=!0,C.clear(),r.clear(),k(`maxPayloadBytes`);return}if(Object.keys(B).length){for(let[e,t]of Object.entries(B)){let n=I.get(e);n?sn(T,e,t,n.kind===`array`?`set`:n.op,{cloneValue:!1}):sn(T,e,t,`set`,{cloneValue:!1})}if(typeof c.setData==`function`){let e=c.setData(B);e&&typeof e.then==`function`&&e.catch(()=>{})}O({mode:`patch`,reason:`patch`,pendingPatchKeys:F.length,payloadKeys:Object.keys(B).length})}}function un(e){let{state:t,setupState:n,snapshotOmitKeys:r,computedRefs:i,dirtyComputedKeys:a,includeComputed:o,setDataStrategy:s,computedCompare:c,computedCompareMaxDepth:l,computedCompareMaxKeys:u,currentAdapter:d,shouldIncludeKey:f,maxPatchKeys:p,maxPayloadBytes:g,mergeSiblingThreshold:_,mergeSiblingMaxInflationRatio:y,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E=!1,functionPaths:D,debug:O,debugWhen:k,debugSampleRate:A,loopWarning:j,runTracker:M,isMounted:N,initialSnapshot:P,initialState:F}=e,I=new WeakMap,L=new WeakMap,R={},z=Object.create(null),B=Object.create(null),V=Object.create(null),H={value:s===`patch`},U=new Map,ee=new Set,W=[],te=-1/0,ne=new Set(F&&typeof F==`object`?Object.keys(F):[]),G=e=>{if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype},re=(e,t)=>{if(Object.is(e,t))return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>re(e,t[n]));if(G(e)&&G(t)){let n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(n=>Q(t,n)&&re(e[n],t[n]))}return!1},ie=e=>{let t=h(e)?e.value:e;if(typeof t!=`object`||!t)return t;if(!m(t)&&jt(t))return{snapshot:Wt(t,new WeakMap,{cacheEligibility:L,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D})};let n=m(t)?b(t):t;return{raw:n,version:v(n)}},ae=(e,t)=>Object.is(e,t)?!0:!e||!t||typeof e!=`object`||typeof t!=`object`||!Q(e,`raw`)||!Q(t,`raw`)?e&&t&&typeof e==`object`&&typeof t==`object`&&Q(e,`snapshot`)&&Q(t,`snapshot`)?re(e.snapshot,t.snapshot):!1:e.raw===t.raw&&e.version===t.version,K=e=>f(e)&&!(r!=null&&r.has(e));if(P)for(let[e,t]of Object.entries(P))K(e)&&(R[e]=t);let oe=()=>{if(!P)return;let e=m(t)?b(t):t,r=n&&typeof n==`object`?m(n)?b(n):n:void 0;for(let t of Object.keys(P))if(K(t)){if(r&&Q(r,t)){B[t]=ie(r[t]);continue}if(Q(e,t)){if(ne.has(t))continue;e[t]=P[t],B[t]=ie(e[t])}}},se=e=>{let r=[],i=n&&typeof n==`object`?m(n)?b(n):n:void 0;for(let n of new Set([...Object.keys(t),...i?Object.keys(i):[]])){if(!K(n))continue;let a=i&&Q(i,n)?i[n]:t[n],o=h(a)?a.value:a;!o||typeof o!=`object`||b(o)===e&&r.push(n)}return r},ce=e=>{if(!O)return;let t=e.reason!==`patch`&&e.reason!==`diff`;if(!(k===`fallback`&&!t)&&!(A<1&&Math.random()>A))try{O(e)}catch(e){}},le=()=>{if(!j)return;let e=Date.now();W.push(e);let t=e-j.sampleWindowMs;for(;W.length&&W[0]<t;)W.shift();W.length<=j.maxFlushes||j.coolDownMs>0&&e-te<j.coolDownMs||(te=e,ce({mode:s,reason:`loopWarning`,pendingPatchKeys:U.size+ee.size,payloadKeys:0,computedDirtyKeys:o?a.size:0,flushCount:W.length,windowMs:j.sampleWindowMs,message:`疑似运行时更新循环:${W.length} 次 setData flush/${j.sampleWindowMs}ms`}))},ue=()=>cn({state:t,setupState:n,computedRefs:i,includeComputed:o,shouldIncludeKey:K,plainCache:I,plainCacheEligibility:L,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D});oe();let de=()=>{let e=m(t)?b(t):t,r=n&&typeof n==`object`?m(n)?b(n):n:void 0,a={...R},s=new WeakMap,c=new Set,l=new Set,u=new Set;for(let t of new Set([...Object.keys(e),...r?Object.keys(r):[]])){if(!K(t))continue;c.add(t);let n=r&&Q(r,t)?r:e,i=ie(n[t]),o=B[t];o&&i&&typeof o==`object`&&typeof i==`object`&&Q(o,`raw`)&&Q(i,`raw`)&&Array.isArray(o.raw)&&Array.isArray(i.raw)&&o.raw!==i.raw&&u.add(t),(!ae(o,i)||!Q(R,t))&&(a[t]=Wt(n[t],s,{cache:I,cacheEligibility:L,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:t})),B[t]=i}for(let e of Object.keys(B))c.has(e)||(delete B[e],(!o||!Q(i,e))&&delete a[e]);if(!o){for(let e of Object.keys(V))delete V[e];return{snapshot:a,replacedTopLevelKeys:u}}for(let e of Object.keys(i)){if(!K(e))continue;l.add(e);let t=i[e].value,n=ie(t);(!ae(V[e],n)||!Q(R,e))&&(a[e]=Wt(t,s,{cache:I,cacheEligibility:L,maxDepth:w,maxKeys:T,includeFunctions:E,functionPaths:D,_path:e})),V[e]=n}for(let t of Object.keys(V))l.has(t)||(delete V[t],(!Q(e,t)||!K(t))&&delete a[t]);return{snapshot:a,replacedTopLevelKeys:u}},fe=(e=`diff`)=>{var t;let n=s===`diff`?de():void 0,r=(t=n==null?void 0:n.snapshot)==null?ue():t,c=n?(()=>{let e={};for(let t of n.replacedTopLevelKeys)e[t]=r[t];return{...Xt(R,r,{skipKeys:n.replacedTopLevelKeys}),...e}})():Xt(R,r);if(R=r,H.value=!1,U.clear(),s===`patch`&&o){z=Object.create(null);for(let e of Object.keys(i))K(e)&&(z[e]=r[e]);a.clear()}if(Object.keys(c).length){if(typeof d.setData==`function`){let e=d.setData(c);e&&typeof e.then==`function`&&e.catch(()=>{})}ce({mode:`diff`,reason:e,pendingPatchKeys:0,payloadKeys:Object.keys(c).length})}};return{job:e=>{if(N())if(le(),M(),s===`patch`&&!H.value){if(!(U.size>0||ee.size>0||o&&a.size>0)){fe(`diff`);return}ln({state:t,computedRefs:i,dirtyComputedKeys:a,includeComputed:o,computedCompare:c,computedCompareMaxDepth:l,computedCompareMaxKeys:u,currentAdapter:d,shouldIncludeKey:K,maxPatchKeys:p,maxPayloadBytes:g,mergeSiblingThreshold:_,mergeSiblingMaxInflationRatio:y,mergeSiblingMaxParentBytes:x,mergeSiblingSkipArray:S,elevateTopKeyThreshold:C,toPlainMaxDepth:w,toPlainMaxKeys:T,includeFunctions:E,functionPaths:D,plainCache:I,plainCacheEligibility:L,pendingPatches:U,fallbackTopKeys:ee,latestSnapshot:R,latestComputedSnapshot:z,needsFullSnapshot:H,emitDebug:ce,runDiffUpdate:fe})}else fe(H.value?`needsFullSnapshot`:`diff`)},mutationRecorder:(e,t)=>{if(!N())return;if(e.root!==t){let t=se(e.root);if(t.length)for(let e of t)ee.add(e);return}if(!e.path){if(Array.isArray(e.fallbackTopKeys)&&e.fallbackTopKeys.length)for(let t of e.fallbackTopKeys)ee.add(t);else H.value=!0;return}let n=e.path.split(`.`,1)[0];K(n)&&U.set(e.path,{kind:e.kind,op:e.op})},snapshot:()=>s===`patch`?ue():{...R},cloneLatestSnapshot:()=>({...R}),getLatestSnapshot:()=>R}}function dn(e){var t,n,r,i,a,o,s;let c=(t=e==null?void 0:e.includeComputed)==null||t,l=(n=e==null?void 0:e.suspendWhenHidden)!=null&&n,u=(r=e==null?void 0:e.strategy)==null?`diff`:r,d=typeof(e==null?void 0:e.maxPatchKeys)==`number`?Math.max(0,e.maxPatchKeys):1/0,f=typeof(e==null?void 0:e.maxPayloadBytes)==`number`?Math.max(0,e.maxPayloadBytes):1/0,p=typeof(e==null?void 0:e.mergeSiblingThreshold)==`number`?Math.max(2,Math.floor(e.mergeSiblingThreshold)):0,m=typeof(e==null?void 0:e.mergeSiblingMaxInflationRatio)==`number`?Math.max(0,e.mergeSiblingMaxInflationRatio):1.25,h=typeof(e==null?void 0:e.mergeSiblingMaxParentBytes)==`number`?Math.max(0,e.mergeSiblingMaxParentBytes):1/0,g=(i=e==null?void 0:e.mergeSiblingSkipArray)==null||i,_=(a=e==null?void 0:e.computedCompare)==null?u===`patch`?`deep`:`reference`:a,v=typeof(e==null?void 0:e.computedCompareMaxDepth)==`number`?Math.max(0,Math.floor(e.computedCompareMaxDepth)):4,y=typeof(e==null?void 0:e.computedCompareMaxKeys)==`number`?Math.max(0,Math.floor(e.computedCompareMaxKeys)):200,b=e==null?void 0:e.prelinkMaxDepth,x=e==null?void 0:e.prelinkMaxKeys,S=e==null?void 0:e.debug,C=(o=e==null?void 0:e.diagnostics)==null?`off`:o,w=e==null?void 0:e.loopWarning,T=w===!1||w&&typeof w==`object`&&w.enabled===!1?!1:{sampleWindowMs:typeof w==`object`&&typeof w.sampleWindowMs==`number`?Math.max(100,Math.floor(w.sampleWindowMs)):1e3,maxFlushes:typeof w==`object`&&typeof w.maxFlushes==`number`?Math.max(1,Math.floor(w.maxFlushes)):50,coolDownMs:typeof w==`object`&&typeof w.coolDownMs==`number`?Math.max(0,Math.floor(w.coolDownMs)):5e3},E=(s=e==null?void 0:e.debugWhen)==null?`fallback`:s,D=typeof(e==null?void 0:e.debugSampleRate)==`number`?Math.min(1,Math.max(0,e.debugSampleRate)):1,O=typeof(e==null?void 0:e.elevateTopKeyThreshold)==`number`?Math.max(0,Math.floor(e.elevateTopKeyThreshold)):1/0,k=typeof(e==null?void 0:e.toPlainMaxDepth)==`number`?Math.max(0,Math.floor(e.toPlainMaxDepth)):1/0,A=typeof(e==null?void 0:e.toPlainMaxKeys)==`number`?Math.max(0,Math.floor(e.toPlainMaxKeys)):1/0,j=!!(e!=null&&e.includeFunctions),M=Array.isArray(e==null?void 0:e.functionPaths)?[...new Set(e.functionPaths.filter(e=>typeof e==`string`&&e.length>0))]:[],N=Array.isArray(e==null?void 0:e.pick)&&e.pick.length>0?new Set(e.pick):void 0,P=Array.isArray(e==null?void 0:e.omit)&&e.omit.length>0?new Set(e.omit):void 0;return{includeComputed:c,suspendWhenHidden:l,setDataStrategy:u,maxPatchKeys:d,maxPayloadBytes:f,mergeSiblingThreshold:p,mergeSiblingMaxInflationRatio:m,mergeSiblingMaxParentBytes:h,mergeSiblingSkipArray:g,computedCompare:_,computedCompareMaxDepth:v,computedCompareMaxKeys:y,prelinkMaxDepth:b,prelinkMaxKeys:x,debug:S,diagnostics:C,loopWarning:T,debugWhen:E,debugSampleRate:D,elevateTopKeyThreshold:O,toPlainMaxDepth:k,toPlainMaxKeys:A,includeFunctions:j,functionPaths:M,pickSet:N,omitSet:P,shouldIncludeKey:e=>!(N&&!N.has(e)||P&&P.has(e))}}function fn(e,t){let n=(()=>{e()});return n.stop=()=>n(),n.pause=()=>{var e;t==null||(e=t.pause)==null||e.call(t)},n.resume=()=>{var e;t==null||(e=t.resume)==null||e.call(t)},n}function pn(e){return typeof e==`function`?e():e==null?{}:e}function mn(t){let{data:r,resolvedComputed:o,resolvedMethods:c,appConfig:u,setDataOptions:f}=t;return t=>{let h=pn(r);if(h&&typeof h==`object`&&!Q(h,Y))try{Object.defineProperty(h,Y,{value:e(Object.create(null)),configurable:!0,enumerable:!1,writable:!1})}catch(e){}let g=d(h),_=d(Object.create(null)),v=t==null?void 0:t.__wevu_snapshotOmitKeys,y=!!(t!=null&&t.__wevu_deferInitialSnapshot),x=t==null?void 0:t.__wevu_initialSnapshot,T=t==null?void 0:t.__wevu_initialState,E=new Set(v instanceof Set||Array.isArray(v)?v:[]);if(h&&typeof h==`object`&&!Q(h,qe))try{Object.defineProperty(h,qe,{value:_,configurable:!0,enumerable:!1,writable:!1})}catch(e){}if(h&&typeof h==`object`&&T&&typeof T==`object`)for(let[e,t]of Object.entries(T))E.has(e)||(h[e]=t);let D=o,O=c,k=!0,A=[],j=new Set;Object.keys(g).forEach(e=>{let t=g[e];jt(t)&&j.add(e)});let{includeComputed:M,setDataStrategy:N,maxPatchKeys:P,maxPayloadBytes:F,mergeSiblingThreshold:I,mergeSiblingMaxInflationRatio:L,mergeSiblingMaxParentBytes:R,mergeSiblingSkipArray:z,computedCompare:B,computedCompareMaxDepth:V,computedCompareMaxKeys:H,prelinkMaxDepth:U,prelinkMaxKeys:ee,debug:W,diagnostics:te,loopWarning:ne,debugWhen:G,debugSampleRate:re,elevateTopKeyThreshold:ie,toPlainMaxDepth:ae,toPlainMaxKeys:K,includeFunctions:oe,functionPaths:se,shouldIncludeKey:ce}=dn(f),le=zt(te),ue=te===`off`&&ne?zt(`fallback`):void 0,de=W||le||ue?e=>{typeof W==`function`&&W(e),le==null||le(e),e.reason===`loopWarning`&&(ue==null||ue(e))}:void 0,fe=te===`always`?`always`:G,{boundMethods:me,computedRefs:he,computedSetters:ge,dirtyComputedKeys:_e,computedProxy:ve,publicInstance:ye,touchSetupMethodsVersion:be}=Lt({state:g,setupState:_,computedDefs:D,methodDefs:O,appConfig:u,includeComputed:M,setDataStrategy:N}),xe=t==null?{setData:()=>{}}:t,Se=b(g),Ce,q=un({state:g,setupState:_,snapshotOmitKeys:E,computedRefs:he,dirtyComputedKeys:_e,includeComputed:M,setDataStrategy:N,computedCompare:B,computedCompareMaxDepth:V,computedCompareMaxKeys:H,currentAdapter:xe,shouldIncludeKey:ce,maxPatchKeys:P,maxPayloadBytes:F,mergeSiblingThreshold:I,mergeSiblingMaxInflationRatio:L,mergeSiblingMaxParentBytes:R,mergeSiblingSkipArray:z,elevateTopKeyThreshold:ie,toPlainMaxDepth:ae,toPlainMaxKeys:K,includeFunctions:oe,functionPaths:se,debug:de,debugWhen:fe,debugSampleRate:re,loopWarning:ne,runTracker:()=>Ce==null?void 0:Ce(),isMounted:()=>k,initialSnapshot:x&&typeof x==`object`?x:void 0,initialState:T&&typeof T==`object`?T:void 0}),we=()=>q.job(Se),Te=e=>q.mutationRecorder(e,Se);Ce=s(()=>{S(g);let e=g[Y];m(e)&&S(e);let t=g[pe];m(t)&&S(t),j.forEach(e=>{var t;Mt((t=_[e])==null?g[e]:t)})},{lazy:!0,scheduler:()=>n(we)}),y||we(),A.push(fn(()=>l(Ce))),N===`patch`&&(w(g,{shouldIncludeTopKey:ce,maxDepth:U,maxKeys:ee}),p(Te),A.push(fn(()=>a(Te))),A.push(fn(()=>C(g))));function Ee(e,t,n){let r=i(e,(e,n)=>t(e,n),n);return A.push(r),fn(()=>{r();let e=A.indexOf(r);e>=0&&A.splice(e,1)},r)}let J={get state(){return g},get setupState(){return _},get proxy(){return ye},get methods(){return me},get computed(){return ve},get adapter(){return xe},bindModel:Dt(ye,g,he,ge,_),watch:Ee,snapshot:()=>q.snapshot(),unmount:()=>{k&&(k=!1,A.forEach(e=>{try{e()}catch(e){}}),A.length=0)}};try{Object.defineProperty(J,"__wevu_touchSetupMethodsVersion",{value:be,configurable:!0,enumerable:!1,writable:!1})}catch(e){J.__wevu_touchSetupMethodsVersion=be}try{Object.defineProperty(J,"__wevu_flushSetupSnapshotSync",{value:we,configurable:!0,enumerable:!1,writable:!1})}catch(e){J.__wevu_flushSetupSnapshotSync=we}try{Object.defineProperty(J,"__wevu_cloneLatestSnapshot",{value:q.cloneLatestSnapshot,configurable:!0,enumerable:!1,writable:!1})}catch(e){J.__wevu_cloneLatestSnapshot=q.cloneLatestSnapshot}try{Object.defineProperty(J,"__wevu_trackSetupReactiveKey",{value:e=>{j.add(e)},configurable:!0,enumerable:!1,writable:!1})}catch(e){J.__wevu_trackSetupReactiveKey=e=>{j.add(e)}}try{Object.defineProperty(J,Fe,{value:E,configurable:!0,enumerable:!1,writable:!1})}catch(e){J[Fe]=E}return J}}const hn=`__wevuDefaultsScope`;let gn={};function _n(e){if(!(!e||typeof e!=`object`||Array.isArray(e)))return e}function vn(e,t){if(!e)return t;if(!t)return e;let n={...e,...t},r=_n(e.setData),i=_n(t.setData);(r||i)&&(n.setData={...r==null?{}:r,...i==null?{}:i});let a=_n(e.options),o=_n(t.options);return(a||o)&&(n.options={...a==null?{}:a,...o==null?{}:o}),n}function yn(e,t){return vn(e,t)}function bn(e,t){return{app:vn(e.app,t.app),component:vn(e.component,t.component)}}function xn(e){gn=bn(gn,e)}function Sn(){gn={}}function Cn(e){return yn(gn.app,e)}function wn(e){return yn(gn.component,e)}const Tn=/&/g,En=/"/g,Dn=/"/g,On=/'/g,kn=/'/g,An=/</g,jn=/>/g;function Mn(e){return e.replace(Tn,`&`).replace(En,`"`).replace(Dn,`"`).replace(On,`'`).replace(kn,`'`).replace(An,`<`).replace(jn,`>`)}function Nn(e){if(typeof e==`number`&&Number.isFinite(e))return e;if(typeof e==`string`&&e.trim()){let t=Number(e);if(Number.isFinite(t))return t}}const Pn=/[^a-z0-9]+/gi,Fn=/^-+|-+$/g;function In(e){return e.trim().replace(Pn,`-`).replace(Fn,``).toLowerCase()}const Ln=/-([a-z0-9])/g;function Rn(e,t){let n=In(typeof(t==null?void 0:t.type)==`string`?t.type:``);if(!n)return;let r=n.replace(Ln,(e,t)=>t.toUpperCase());if(r)return`${e}${r[0].toUpperCase()}${r.slice(1)}`}const zn={wvEventDetail:[`wd`,`wvEventDetail`],wvHandler:[`wh`,`wvHandler`],wvInlineId:[`wi`,`wvInlineId`]};function Bn(e,t,n){var r;let i=(r=zn[t])==null?[t]:r;for(let t of i){let r=Rn(t,n);if(r&&(e==null?void 0:e[r])!==void 0)return e[r]}for(let t of i)if((e==null?void 0:e[t])!==void 0)return e[t]}function Vn(e,t,n){return Bn(e,t,n)}function Hn(e,t){let n=Vn(e,`wvEventDetail`,t);return n===!0||n===1||n===`1`||n===`true`}function Un(e,t){if(!Hn(t,e))return e;if(!(!e||typeof e!=`object`||!(`detail`in e)))return e.detail}function Wn(e,t){if(!t)return;let n=t.split(`.`).filter(Boolean),r=h(e)?e.value:e;for(let e of n){if(h(r)&&(r=r.value),r==null)return;r=r[e]}return h(r)?r.value:r}function Gn(e){if(typeof e!=`object`||!e||h(e)||m(e))return e;try{return d(e)}catch(t){return e}}function Kn(e,t,n,r){var i,a,o,s;let c=(i=(a=n==null||(o=n.currentTarget)==null?void 0:o.dataset)==null?n==null||(s=n.target)==null?void 0:s.dataset:a)==null?{}:i,l=Un(n,c),u=Vn(c,`wvInlineId`,n);if(u&&r){let t=r[u];if(t&&typeof t.fn==`function`){let n={},r=Array.isArray(t.keys)?t.keys:[];for(let e=0;e<r.length;e+=1){let t=r[e];n[t]=c==null?void 0:c[`wvS${e}`]}let i=Array.isArray(t.indexKeys)?t.indexKeys:[];for(let e=0;e<i.length;e+=1){let t=i[e],r=Nn(c==null?void 0:c[`wvI${e}`]);r!==void 0&&(n[t]=r)}let a=Array.isArray(t.scopeResolvers)?t.scopeResolvers:[];for(let t=0;t<r.length;t+=1){let i=r[t],o=a[t];try{let t;if(typeof o==`function`)t=o(e,n,l);else if(o&&typeof o==`object`&&o.type===`for-item`){let r=n[o.indexKey],i=Wn(e,o.path);t=i==null?void 0:i[r]}else continue;t!==void 0&&(n[i]=Gn(t))}catch(e){}}let o=t.fn(e,n,l);return typeof o==`function`?o.call(e,l):o}}let d=Vn(c,`wvHandler`,n),f=typeof t==`string`&&t?t:typeof d==`string`?d:void 0;if(!f)return;let p=Vn(c,`wvArgs`,n),m=[];if(Array.isArray(p))m=p;else if(typeof p==`string`)try{m=JSON.parse(p)}catch(e){try{m=JSON.parse(Mn(p))}catch(e){m=[]}}Array.isArray(m)||(m=[]);let h=m.map(e=>e===`$event`?l:e),g=e==null?void 0:e[f];if(typeof g==`function`)return g.apply(e,h)}function qn(){let e=ee();if(e)return e;let t=M();return t[t.length-1]}function Jn(e){return e!==Oe&&e}function Yn(){var e,t;if(!D())throw Error(`usePageLayout() 必须在 setup() 的同步阶段调用`);let n=I(),r=n==null||(e=n.__wevu)==null?void 0:e.state,i=d({name:Jn(r==null?void 0:r[De]),props:{...(t=r==null?void 0:r[ke])==null?{}:t}});return n&&(n.__wevuPageLayoutState=i),B(i)}function Xn(e,t,n){let r=e.__wevuPageLayoutState;r&&(r.name=t,r.props={...n})}function Zn(e){var t,n;let r=e.__wevuPageLayoutState,i=(t=e.__wevu)==null?void 0:t.state;!r||!i||(r.name=Jn(i[De]),r.props={...(n=i[ke])==null?{}:n})}function Qn(e,t){let n=I(),r=n==null?void 0:n[Ae];if(typeof r==`function`){r(e,t);return}let i=qn(),a=i==null?void 0:i[Ae];if(typeof a==`function`){a(e,t);return}throw Error(`setPageLayout() 未找到当前页面实例。请在页面 setup()、事件回调或当前页面上下文中调用。`)}function $n(e){return e===!1?Oe:e}function er(){let e=globalThis;return e[Ge]instanceof Map||(e[Ge]=new Map),typeof e[We]!=`number`&&(e[We]=0),{globalObject:e,ownerStore:e[Ge]}}function tr(){let{globalObject:e}=er();return e[We]+=1,`wv${e[We]}`}function nr(e,t,n){var r;let{ownerStore:i}=er(),a=(r=i.get(e))==null?{snapshot:{},proxy:n,subscribers:new Set}:r;if(a.snapshot=t,a.proxy=n,i.set(e,a),a.subscribers.size)for(let e of a.subscribers)try{e(t,n)}catch(e){}}function rr(e){let{ownerStore:t}=er();t.delete(e)}function ir(e,t){var n;let{ownerStore:r}=er(),i=(n=r.get(e))==null?{snapshot:{},proxy:void 0,subscribers:new Set}:n;return i.subscribers.add(t),r.set(e,i),()=>{let n=r.get(e);n&&n.subscribers.delete(t)}}function ar(e){var t;let{ownerStore:n}=er();return(t=n.get(e))==null?void 0:t.proxy}function or(e){var t;let{ownerStore:n}=er();return(t=n.get(e))==null?void 0:t.snapshot}function sr(e){let t=e.__wevu_cloneLatestSnapshot;return typeof t==`function`?t():typeof e.snapshot==`function`?e.snapshot():{}}function cr(e,t){let n=e[Fe];return!(n instanceof Set&&n.has(t))}function lr(e,t,n){if(!(!t||typeof t!=`object`))for(let[r,i]of Object.entries(t))cr(n,r)&&(e[r]=i)}function ur(e,t,n){var r;try{t.state[Z]=n}catch(e){}try{e[Z]=n}catch(e){}try{let t=e.data;t&&typeof t==`object`&&(t[Z]=n)}catch(e){}let i=sr(t);lr(i,(r=e[Y])==null?e.properties:r,t),nr(n,i,t.proxy)}function dr(e){return e.kind===`component`}function fr(e){return new Proxy(e,{get(e,t,n){let r=Reflect.get(e,t,n);return h(r)?r.value:r},set(e,t,n,r){let i=e[t];return h(i)&&!h(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}})}function pr(e,t){let n=e.__wevuExposeProxy;if(n&&e.__wevuExposeRaw===t)return n;let r=fr(t);try{Object.defineProperty(e,"__wevuExposeProxy",{value:r,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(e,"__wevuExposeRaw",{value:t,configurable:!0,enumerable:!1,writable:!1})}catch(n){e.__wevuExposeProxy=r,e.__wevuExposeRaw=t}return r}function mr(e,t){if(!t||typeof t!=`object`)return e;let n=t;return $(new Proxy(e,{get(e,t,r){if(Reflect.has(e,t))return Reflect.get(e,t,r);let i=n[t];return typeof i==`function`?i.bind(n):i},set(e,t,r,i){return Reflect.has(e,t)?Reflect.set(e,t,r,i):(t in n,n[t]=r,!0)},has(e,t){return Reflect.has(e,t)||t in n},ownKeys(e){return[...new Set([...Reflect.ownKeys(e),...Reflect.ownKeys(n)])]},getOwnPropertyDescriptor(e,t){if(Reflect.has(e,t))return Object.getOwnPropertyDescriptor(e,t);let r=Object.getOwnPropertyDescriptor(n,t);return r&&{...r,configurable:!0}}}))}function hr(e){var t;if(!e||typeof e!=`object`)return e==null?null:e;let n=e,r=n[he];return r&&typeof r==`object`?pr(n,r):(t=n[X])!=null&&t.proxy?n[X].proxy:e}function gr(e){return e[it]}function _r(e,t,n){if(!e)return;let r=e.get(t);r&&(r.value=n)}function vr(e,t){var n,r;let i=(n=(r=e.__wevu)==null?void 0:r.proxy)==null?e:n,a;if(t.get)try{a=t.get.call(i)}catch(e){a=void 0}return a==null&&t.name&&(a=t.name),typeof a==`function`?{type:`function`,fn:a}:h(a)?{type:`ref`,ref:a}:typeof a==`string`&&a?{type:`name`,name:a}:t.name?{type:`name`,name:t.name}:{type:`skip`}}function yr(e){var t,n;let r=(t=(n=e.__wevu)==null?void 0:n.state)==null?e:t,i=r.$refs;if(i&&typeof i==`object`)return i;let a=$(Object.create(null));return Object.defineProperty(r,"$refs",{value:a,configurable:!0,enumerable:!1,writable:!1}),a}function br(e){let t=e;if(t&&typeof t.createSelectorQuery==`function`)return t.createSelectorQuery();if(!z(`globalCreateSelectorQuery`))return null;let n=k();if(n&&typeof n.createSelectorQuery==`function`){let e=n.createSelectorQuery();return e?A().selectorQueryScopeByIn&&typeof e.in==`function`?e.in(t):e:null}return null}function xr(e,t,n,r,i){let a=br(e);return a?(r(n.multiple?a.selectAll(t):a.select(t)),new Promise(e=>{a.exec(t=>{var r;let a=Array.isArray(t)?t[0]:null;if(n.index!=null&&Array.isArray(a)){var o;a=(o=a[n.index])==null?null:o}if(i){var s;i((s=a)==null?null:s)}e((r=a)==null?null:r)})})):(i&&i(null),Promise.resolve(null))}function Sr(e,t,n){return $({selector:t,boundingClientRect:r=>xr(e,t,n,e=>e.boundingClientRect(),r),scrollOffset:r=>xr(e,t,n,e=>e.scrollOffset(),r),fields:(r,i)=>xr(e,t,n,e=>e.fields(r),i),node:r=>xr(e,t,n,e=>e.node(),r)})}function Cr(e,t){let n=e;if(!n)return t.inFor?$([]):null;if(t.inFor){if(typeof n.selectAllComponents==`function`){let r=n.selectAllComponents(t.selector);return $((Array.isArray(r)?r:[]).map((n,r)=>mr(Sr(e,t.selector,{multiple:!0,index:r}),hr(n))))}return $([])}let r=Sr(e,t.selector,{multiple:!1});return typeof n.selectComponent==`function`?mr(r,hr(n.selectComponent(t.selector))):r}function wr(e,t,n){return t.inFor?$((Array.isArray(n)?n:[]).map((n,r)=>Sr(e,t.selector,{multiple:!0,index:r}))):n?Sr(e,t.selector,{multiple:!1}):null}function Tr(e,t){let n=e[nt];if(!n||!n.length){t==null||t();return}if(!e[Le]){t==null||t();return}if(!e.__wevu){t==null||t();return}let r=gr(e),i=n.filter(e=>!dr(e)),a=n.filter(e=>dr(e)).map(t=>({binding:t,value:Cr(e,t)})),o=n=>{var i,a;let o=yr(e),s=new Map,c=new Set,l=(i=(a=e.__wevu)==null?void 0:a.proxy)==null?e:i;n.forEach(t=>{let n=t.binding,r=t.value,i=vr(e,n);if(i.type===`function`){n.inFor&&Array.isArray(r)?r.length?r.forEach(e=>i.fn.call(l,e)):i.fn.call(l,null):i.fn.call(l,r==null?null:r);return}if(i.type===`ref`){i.ref.value=r;return}if(i.type===`name`){var a;c.add(i.name);let e=(a=s.get(i.name))==null?{values:[],count:0,hasFor:!1}:a;e.count+=1,e.hasFor=e.hasFor||n.inFor,n.inFor?Array.isArray(r)&&e.values.push(...r):r!=null&&e.values.push(r),s.set(i.name,e)}});for(let[e,t]of s){let n;n=t.values.length?t.hasFor||t.values.length>1||t.count>1?$(t.values):t.values[0]:t.hasFor?$([]):null,o[e]=n,_r(r,e,n)}for(let e of Object.keys(o))c.has(e)||delete o[e];t==null||t()};if(!i.length){o(a);return}let s=br(e);if(!s){o(a);return}let c=[];for(let e of i)(e.inFor?s.selectAll(e.selector):s.select(e.selector)).boundingClientRect(),c.push({binding:e});s.exec(t=>{let n=c.map((n,r)=>{let i=Array.isArray(t)?t[r]:null;return{binding:n.binding,value:wr(e,n.binding,i)}});o([...a,...n])})}function Er(e,t){let n=e[nt];if(!n||!n.length){t==null||t();return}if(t){var i;let n=(i=e[tt])==null?[]:i;n.push(t),e[tt]||Object.defineProperty(e,tt,{value:n,configurable:!0,enumerable:!1,writable:!0})}e[rt]||(e[rt]=!0,r(()=>{e[rt]=!1,Tr(e,()=>{let t=e[tt];!t||!t.length||t.splice(0).forEach(e=>{try{e()}catch(e){}})})}))}function Dr(e){var t,n;let r=e[nt];if(!r||!r.length)return;let i=yr(e),a=(t=(n=e.__wevu)==null?void 0:n.proxy)==null?e:t,o=new Set,s=gr(e);for(let t of r){let n=vr(e,t),r=t.inFor?$([]):null;if(n.type===`function`){n.fn.call(a,null);continue}if(n.type===`ref`){n.ref.value=r;continue}n.type===`name`&&(o.add(n.name),i[n.name]=r,_r(s,n.name,r))}for(let e of Object.keys(i))o.has(e)||delete i[e]}const Or=[`triggerEvent`,`createSelectorQuery`,`createIntersectionObserver`,`setData`,`setUpdatePerformanceListener`];function kr(){return Object.freeze(Object.create(null))}const Ar=()=>[];function jr(e){return Array.isArray(e)?[...new Set(e.filter(e=>typeof e==`string`&&e.length>0))]:!e||typeof e!=`object`?[]:Object.entries(e).filter(([,e])=>!!e).map(([e])=>e)}function Mr(e){if(!Q(e,Je))return kr();let t=()=>jr(e[Je]),n=e=>typeof e==`string`&&t().includes(e);return new Proxy(Object.create(null),{get(e,t){if(n(t))return Ar},has(e,t){return n(t)},ownKeys(){return t()},getOwnPropertyDescriptor(e,t){if(n(t))return{configurable:!0,enumerable:!0,value:Ar}},set(){return!1},deleteProperty(){return!1}})}function Nr(){let e=(()=>{});return e.stop=()=>{},e.pause=()=>{},e.resume=()=>{},e}function Pr(e){try{return $(e)}catch(t){return e}}function Fr(e){return!e||typeof e!=`object`||Array.isArray(e)?!1:Q(e,`bubbles`)||Q(e,`composed`)||Q(e,`capturePhase`)}function Ir(e){if(e.length===0)return{detail:void 0,options:void 0};if(e.length===1)return{detail:e[0],options:void 0};let t=e[e.length-1];if(Fr(t)){let n=e.slice(0,-1);return{detail:n.length<=1?n[0]:n,options:t}}return{detail:e,options:void 0}}function Lr(e,t,n){let r=e==null?void 0:e.state,i=r&&typeof r==`object`?b(r):void 0,a=e==null?void 0:e.proxy,o=e=>{let r=e[n];if(typeof r!=`function`)return!1;if(Ft(r))return!0;let i=t[n];return typeof i==`function`&&r===i},s=e=>!e||typeof e!=`object`||e===t||e===a||o(e)?!1:typeof e[n]==`function`,c=i?i[q]:void 0;if(s(c))return c;let l=e==null?void 0:e.instance;if(s(l))return l}function Rr(e,t,n){Pt(n);try{Object.defineProperty(e,t,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(r){e[t]=n}}function zr(e,t){let n=e[Ke];if(n&&typeof n==`object`)return n;let r=Object.create(null),i=n=>{let r=Lr(t,e,n);if(r)return r;let i=e[n];if(typeof i==`function`&&!Ft(i))return e};Rr(r,`triggerEvent`,(...e)=>{let[t,n,r]=e,a=i(`triggerEvent`);a&&typeof a.triggerEvent==`function`&&(e.length>=3?a.triggerEvent(t,n,r):a.triggerEvent(t,n))}),Rr(r,`createSelectorQuery`,()=>{var n;let r=i(`createSelectorQuery`);if(r&&typeof r.createSelectorQuery==`function`)return r.createSelectorQuery();let a=k();if(!z(`globalCreateSelectorQuery`)||!a||typeof a.createSelectorQuery!=`function`)return;let o=a.createSelectorQuery();if(!o||!A().selectorQueryScopeByIn||typeof o.in!=`function`)return o;let s=(n=Lr(t,e,`setData`))==null?e:n;return o.in(s)}),Rr(r,`createIntersectionObserver`,n=>{var r;let a=i(`createIntersectionObserver`);if(a&&typeof a.createIntersectionObserver==`function`)return a.createIntersectionObserver(n==null?{}:n);let o=k();if(!z(`globalCreateIntersectionObserver`)||!o||typeof o.createIntersectionObserver!=`function`)return;let s=(r=Lr(t,e,`setData`))==null?e:r;return A().intersectionObserverScopeByParameter?o.createIntersectionObserver(s,n==null?{}:n):o.createIntersectionObserver(n==null?{}:n)}),Rr(r,`setData`,(e,n)=>{let r=i(`setData`);if(r&&typeof r.setData==`function`)return r.setData(e,n);let a=t==null?void 0:t.adapter,o=typeof(a==null?void 0:a.setData)==`function`?a.setData(e):void 0;return typeof n==`function`&&n(),o}),Rr(r,`setUpdatePerformanceListener`,e=>{let t=i(`setUpdatePerformanceListener`);if(t&&typeof t.setUpdatePerformanceListener==`function`)return t.setUpdatePerformanceListener(e)});let a=Pr(new Proxy(r,{get(t,n,r){if(Reflect.has(t,n))return Reflect.get(t,n,r);let i=e[n];return typeof i==`function`?i.bind(e):i},has(t,n){return Reflect.has(t,n)||n in e},set(t,n,r){return Reflect.has(t,n)?(t[n]=r,!0):(e[n]=r,!0)}}));try{Object.defineProperty(e,Ke,{value:a,configurable:!0,enumerable:!1,writable:!0})}catch(t){e[Ke]=a}return a}function Br(e){return!e||typeof e!=`object`?!1:typeof e.triggerEvent==`function`||typeof e.createSelectorQuery==`function`||typeof e.createIntersectionObserver==`function`||typeof e.setData==`function`}function Vr(e,t,n){let r=t==null?void 0:t[n];if(typeof r!=`function`)return!1;if(Ft(r))return!0;let i=e==null?void 0:e.proxy;return typeof(i==null?void 0:i[n])==`function`&&r===i[n]}function Hr(e,t){if(!e||!Br(t)||t===e.proxy)return;let n=t;if(Vr(e,n,`triggerEvent`)||Vr(e,n,`createSelectorQuery`)||Vr(e,n,`createIntersectionObserver`)||Vr(e,n,`setData`))return;let r=e.state;if(!(!r||typeof r!=`object`))try{Object.defineProperty(r,q,{value:n,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[q]=n}}function Ur(e,t){try{let n=t.methods;for(let t of Object.keys(n))Or.includes(t)||typeof e[t]!=`function`&&(e[t]=function(...n){var r,i;let a=(r=this[X])==null?e[X]:r;Hr(a,this);let o=a==null||(i=a.methods)==null?void 0:i[t];if(typeof o==`function`)return o.apply(a.proxy,n)})}catch(e){}}let Wr=e=>e.startsWith(`layouts/`);function Gr(e){let t=e.is;return typeof t==`string`&&Wr(t,e)}function Kr(e){if(Gr(e))return;let t=e[Me];if(t&&typeof t==`object`)return t;let n=e.selectOwnerComponent;if(typeof n==`function`)try{let t=n.call(e);if(t&&t!==e&&typeof t==`object`&&t.__wevu)return t}catch(e){}let r=M(),i=r[r.length-1];if(i&&i!==e&&typeof i==`object`&&i.__wevu)return i}function qr(e){if(!Gr(e))return;let t=M(),n=t[t.length-1];n&&n!==e&&typeof n==`object`&&n.__wevu&&V(e,n)}function Jr(e,t){e[Ve]=t,ce(e,t,Kr(e)),qr(e)}function Yr(e,t,n){var r;if(typeof e!=`function`)return;let i=(r=n==null?void 0:n.runtime)==null?{methods:Object.create(null),state:{},setupState:{},proxy:{},watch:()=>()=>{},bindModel:()=>{}}:r;return n&&(n.runtime=i),e(t,{...n==null?{}:n,runtime:i})}function Xr(e,t){try{Object.defineProperty(e,Y,{value:t,configurable:!0,enumerable:!1,writable:!1})}catch(n){e[Y]=t}}function Zr(e,t){try{Object.defineProperty(e,qe,{value:t,configurable:!0,enumerable:!1,writable:!1})}catch(n){e[qe]=t}}function Qr(e,t){try{Object.defineProperty(e,q,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[q]=t}}function $r(e,t){try{Object.defineProperty(e,He,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){e[He]=t}}function ei(e,t){try{Object.defineProperty(e,"instance",{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(n){try{e.instance=t}catch(e){}}}function ti(e){let t=e[Ke],n=t&&typeof t.setData==`function`?t.setData:void 0;if(typeof n==`function`&&!Ft(n))return n;let r=e.setData;if(typeof r==`function`&&!Ft(r))return r}function ni(e){let t=e.route;if(typeof t==`string`&&t)return t;let n=e.is;return typeof n==`string`&&n?n:`unknown`}function ri(e,t,n){try{return t.call(e,n)}catch(t){let n=ni(e);throw Error(`[wevu] setData failed (${n}): ${t instanceof Error?t.message:String(t)}`)}}function ii(e,t){let n=Object.keys(e);for(let r of n)if(!Q(t,r))try{delete e[r]}catch(e){}for(let[n,r]of Object.entries(t))e[n]=r}function ai(t,n,r=t.properties||{}){let i=n&&typeof n==`object`?n[Y]:void 0,a=i&&typeof i==`object`?i:e({});ii(a,r),n&&typeof n==`object`&&Xr(n,a);try{Object.defineProperty(t,Y,{value:a,configurable:!0,enumerable:!1,writable:!0})}catch(e){t[Y]=a}return a}function oi(e){return e.includes(`:`)?e.replaceAll(`:`,`-`).toLowerCase():e}function si(e){return e.startsWith(`__wv_`)}function ci(t){var n;let{target:r,runtime:i,runtimeWithDefaults:a,runtimeState:o,runtimeProxy:s,setup:l}=t,u=ai(r,o,r.properties||{}),d=e(Object.create(null)),f=new Set(Array.isArray(r[Ie])?r[Ie]:[]),p=e=>typeof o==`object`&&!!o&&Q(o,e);(()=>{let e=r.properties&&typeof r.properties==`object`?r.properties:void 0;for(let t of Object.keys(d))(!e||!Q(e,t)||si(t)||f.has(t)||p(t))&&delete d[t];if(e)for(let[t,n]of Object.entries(e))si(t)||f.has(t)||p(t)||(d[t]=n)})();try{Object.defineProperty(r,pe,{value:d,configurable:!0,enumerable:!1,writable:!1})}catch(e){r[pe]=d}let h=zr(r,a),g=Mr(u);Zr(o,(n=a.setupState)==null?Object.create(null):n);try{Object.defineProperty(o,"$slots",{value:g,configurable:!0,enumerable:!1,writable:!1})}catch(e){o.$slots=g}let _=Pr({props:u,runtime:a,state:o,proxy:s,bindModel:i.bindModel.bind(a),watch:i.watch.bind(a),instance:h,emit:(e,...t)=>{let{detail:n,options:r}=Ir(t),i=oi(e);h.triggerEvent(i,n,r)},expose:e=>{r[he]=e},attrs:d,slots:g}),v=c(!0);r[me]=v,R(r),O(_);try{let e=v.run(()=>Yr(l,u,_)),t=!1;if(e&&typeof e==`object`){let n=i.setupState&&typeof i.setupState==`object`?m(i.setupState)?b(i.setupState):i.setupState:Object.create(null);Object.keys(e).forEach(r=>{let a=e[r];if(typeof a==`function`)i.methods[r]=(...e)=>a.apply(i.proxy,e),i.state[r]=(...e)=>a.apply(i.proxy,e),t=!0;else{if(jt(a)){var o;(o=i.__wevu_trackSetupReactiveKey)==null||o.call(i,r)}i.state[r]=a,n[r]=a}})}if(t){var y;(y=i.__wevu_touchSetupMethodsVersion)==null||y.call(i)}}catch(e){throw v.stop(),r[me]=void 0,e}finally{O(void 0),R(void 0)}}function li(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function ui(e){var t,n,r;let i={devOnly:!0,sampleWindowMs:1e3,maxCalls:30,coolDownMs:5e3,warnOnPageScroll:!0,pageScrollCoolDownMs:2e3};return e===void 0||e===!1?{...i,enabled:!1}:e===!0?{...i,enabled:!0}:li(e)?{enabled:(t=e.enabled)==null||t,devOnly:(n=e.devOnly)==null?i.devOnly:n,sampleWindowMs:typeof e.sampleWindowMs==`number`?Math.max(100,Math.floor(e.sampleWindowMs)):i.sampleWindowMs,maxCalls:typeof e.maxCalls==`number`?Math.max(1,Math.floor(e.maxCalls)):i.maxCalls,coolDownMs:typeof e.coolDownMs==`number`?Math.max(0,Math.floor(e.coolDownMs)):i.coolDownMs,warnOnPageScroll:(r=e.warnOnPageScroll)==null?i.warnOnPageScroll:r,pageScrollCoolDownMs:typeof e.pageScrollCoolDownMs==`number`?Math.max(0,Math.floor(e.pageScrollCoolDownMs)):i.pageScrollCoolDownMs}:{...i,enabled:!1}}function di(){let e=P();if((e==null?void 0:e.debug)===!0||(e==null?void 0:e.envVersion)===`develop`)return!0;let t=k();try{var n;if((t==null||(n=t.getAccountInfoSync)==null||(n=n.call(t))==null||(n=n.miniProgram)==null?void 0:n.envVersion)===`develop`)return!0}catch(e){}return!1}function fi(e){var t,n;let r=ui(e.option);if(!r.enabled)return;let i=di();if(r.devOnly&&!i)return;let a=(t=e.now)==null?(()=>Date.now()):t,o=(n=e.logger)==null?(e=>{var t;let n=(t=globalThis)==null||(t=t.console)==null?void 0:t.warn;typeof n==`function`&&n(e)}):n,s=[],c=-1/0,l=-1/0;return()=>{var t,n;let i=a();s.push(i);let u=i-r.sampleWindowMs;for(;s.length>0&&s[0]<u;)s.shift();let d=(t=(n=e.isInPageScrollHook)==null?void 0:n.call(e))!=null&&t;r.warnOnPageScroll&&d&&(r.pageScrollCoolDownMs<=0||i-l>=r.pageScrollCoolDownMs)&&(l=i,o(`[wevu:setData] 检测到 onPageScroll 回调内调用 setData(${e.targetLabel})。建议改用 IntersectionObserver 监听可见性,或对滚动更新做节流。`)),!(s.length<=r.maxCalls)&&(r.coolDownMs>0&&i-c<r.coolDownMs||(c=i,o(`[wevu:setData] 检测到高频 setData 调用:${s.length} 次/${r.sampleWindowMs}ms(${e.targetLabel})。建议合并更新或降低调用频率。`)))}}function pi(e,t,n){if(typeof e==`function`)return{handler:e.bind(t.proxy),options:{}};if(typeof e==`string`){var r,i;let a=(r=(i=t.methods)==null?void 0:i[e])==null?n[e]:r;return typeof a==`function`?{handler:a.bind(t.proxy),options:{}}:void 0}if(!e||typeof e!=`object`)return;let a=pi(e.handler,t,n);if(!a)return;let o={...a.options};return e.immediate!==void 0&&(o.immediate=e.immediate),e.deep!==void 0&&(o.deep=e.deep),{handler:a.handler,options:o}}function mi(e,t){let n=t.split(`.`).map(e=>e.trim()).filter(Boolean);return n.length?()=>{let t=e;for(let e of n){if(t==null)return t;t=t[e]}return t}:()=>e}function hi(e,t,n){let r=[],i=e.proxy;for(let[a,o]of Object.entries(t)){let t=pi(o,e,n);if(!t)continue;let s=mi(i,a),c=e.watch(s,t.handler,t.options);r.push(c)}return r}function gi(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(gi(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=gi(i,t);return n}function _i(e,t,n){let r=e.data;if((!r||typeof r!=`object`)&&(!n||!Object.keys(n).length))return;let i=Array.isArray(t)&&t.length?new Set(t):void 0,a={};if(r&&typeof r==`object`)for(let[e,t]of Object.entries(r))i!=null&&i.has(e)||(a[e]=gi(t));if(n)for(let[e,t]of Object.entries(n))i!=null&&i.has(e)||(a[e]=gi(t));return a}function vi(e){return!!(e!=null&&e.__wevuHasTemplateRuntimeBindings)}function yi(e){typeof e.route!=`string`||!e.route||(e[Ae]=(t,n)=>{var r;let i=(r=e.__wevu)==null?void 0:r.state;if(!i||typeof i!=`object`)return;i[De]=$n(t);let a=t===!1||n==null?{}:n;i[ke]=a,Xn(e,t,a)})}function bi(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,m,h,g;if(e.__wevu)return e.__wevu;Jr(e,t),Pr(e);let _=(a=e.data)==null?void 0:a[Z],v=typeof _==`string`&&_?_:tr(),y=typeof _==`string`&&_!==v,b=!!(!(t==null||(o=t.__wevuSetDataOptions)==null)&&o.suspendWhenHidden),x=typeof e.route==`string`&&e.route?`page:${e.route}`:typeof e.is==`string`&&e.is?`component:${e.is}`:`unknown-target`,S=fi({option:t==null||(s=t.__wevuSetDataOptions)==null?void 0:s.highFrequencyWarning,targetLabel:x,isInPageScrollHook:()=>{var t;return Number((t=e[je])==null?0:t)>0}}),C=i!=null&&i.deferSetData?(e=>{let t,n=!1,r={setData(r){if(!n){var i;t={...(i=t)==null?{}:i,...r};return}let a=ti(e);if(a)return ri(e,a,r)}};return r.__wevu_enableSetData=(r=!1)=>{n=!0,r&&(t=void 0);let i=ti(e);if(t&&Object.keys(t).length&&i){let n=t;t=void 0,ri(e,i,n)}},r})(e):{setData(t){let n=ti(e);if(n)return ri(e,n,t)}},w,T=!0,E,D=(e,t)=>({...e==null?{}:e,...t}),O=()=>{var t;if(!w)return;let n=sr(w);lr(n,(t=e[Y])==null?e.properties:t,w),nr(v,n,w.proxy)},k=()=>{if(!y)return;let t=e.data;try{t&&typeof t==`object`&&(t[Z]=v)}catch(e){}let n=ti(e);n&&ri(e,n,{[Z]:v})},A={...C,setData(t){if(S==null||S(),b&&!T){E=D(E,t),O(),Er(e);return}let n=C.setData(t);return O(),Er(e),n},__wevu_setVisibility(t){if(T=t,!T||!E)return;let n=E;E=void 0;let r=C.setData(n);return O(),Er(e),r}};Array.isArray(i==null?void 0:i.snapshotOmitKeys)&&i.snapshotOmitKeys.length&&Object.defineProperty(A,"__wevu_snapshotOmitKeys",{configurable:!0,enumerable:!1,value:i.snapshotOmitKeys,writable:!1});let j=_i(e,i==null?void 0:i.snapshotOmitKeys,vi(t)?void 0:{[Z]:v});j&&Object.keys(j).length&&Object.defineProperty(A,"__wevu_initialSnapshot",{configurable:!0,enumerable:!1,value:j,writable:!1}),Object.defineProperty(A,"__wevu_initialState",{configurable:!0,enumerable:!1,value:{[Z]:v},writable:!1});let M=e.properties;(r||M&&typeof M==`object`&&Object.keys(M).length>0)&&Object.defineProperty(A,"__wevu_deferInitialSnapshot",{configurable:!0,enumerable:!1,value:!0,writable:!1});let N=t.mount(A);w=N,ei(N,e);let P=(c=N==null?void 0:N.proxy)==null?{}:c,F=(l=N==null?void 0:N.state)==null?{}:l,I=(u=N==null?void 0:N.setupState)==null?Object.create(null):u;F&&typeof F==`object`&&($r(F,N),Qr(F,e));let L=(d=N==null?void 0:N.computed)==null?Object.create(null):d;if(!(N!=null&&N.methods))try{N.methods=Object.create(null)}catch(e){}let R=(f=N==null?void 0:N.methods)==null?Object.create(null):f,z=(p=N==null?void 0:N.watch)==null?(()=>Nr()):p,B=(m=N==null?void 0:N.bindModel)==null?(()=>{}):m,V={...N==null?{}:N,state:F,setupState:I,proxy:P,methods:R,computed:L,watch:z,bindModel:B,snapshot:(h=N==null?void 0:N.snapshot)==null?(()=>Object.create(null)):h,unmount:(g=N==null?void 0:N.unmount)==null?(()=>{}):g},H=V,U={__wevu_flushSetupSnapshotSync:N.__wevu_flushSetupSnapshotSync,__wevu_touchSetupMethodsVersion:N.__wevu_touchSetupMethodsVersion,__wevu_trackSetupReactiveKey:N.__wevu_trackSetupReactiveKey,[Fe]:N[Fe]};for(let[e,t]of Object.entries(U))t&&Object.defineProperty(V,e,{configurable:!0,enumerable:!1,value:t,writable:!0});if(Object.defineProperty(e,X,{value:V,configurable:!0,enumerable:!1,writable:!1}),e.__wevu=V,yi(e),ai(e,F),ur(e,V,v),k(),n){let t=hi(V,n,e);t.length&&(e[at]=t)}if(r){if(ci({target:e,runtime:N,runtimeWithDefaults:V,runtimeState:F,runtimeProxy:P,setup:r}),!(i!=null&&i.deferSetData)){var ee;(ee=H.__wevu_flushSetupSnapshotSync)==null||ee.call(H)}O()}else if(e.properties&&typeof e.properties==`object`&&Object.keys(e.properties).length>0){var W;(W=H.__wevu_flushSetupSnapshotSync)==null||W.call(H),O()}return Ur(e,N),N}function xi(e,t,n){for(let e of Reflect.ownKeys(t))if(!Reflect.has(n,e)){let n=Reflect.getOwnPropertyDescriptor(t,e);n!=null&&n.configurable&&Reflect.deleteProperty(t,e)}for(let e of Reflect.ownKeys(n)){let r=Reflect.getOwnPropertyDescriptor(n,e);if(r)try{Reflect.defineProperty(t,e,r)}catch(r){try{t[e]=n[e]}catch(e){}}}return $r(t.state,t),e.__wevu=t,Object.defineProperty(e,X,{value:t,configurable:!0,enumerable:!1,writable:!1}),t}function Si(e,t,n,r,i){let a=e.__wevu;Ei(e,{skipHooks:!0});let o=bi(e,t,n,r,{deferSetData:!0,snapshotOmitKeys:i==null?void 0:i.snapshotOmitKeys});return!a||a===o?o:xi(e,a,o)}function Ci(e,t){let n=e.__wevu,r=n==null?void 0:n.state,i=n==null?void 0:n.setupState,a=e.data;if(!(!r||typeof r!=`object`||!a||typeof a!=`object`)){for(let[e,n]of Object.entries(a))if(!(!e||e===`undefined`)&&Object.prototype.hasOwnProperty.call(r,e))try{let a=i==null?void 0:i[e];if(!(t!=null&&t.includeSetupState)&&i&&Object.prototype.hasOwnProperty.call(i,e))continue;if(h(a)){a.value=n;continue}r[e]=n}catch(e){}}}function wi(e,t){var n,r,i;let a=(n=e.__wevu)==null?void 0:n.adapter;Ci(e,{includeSetupState:t==null?void 0:t.rehydrateSetupState}),a&&typeof a.__wevu_enableSetData==`function`&&a.__wevu_enableSetData(!0),(r=e.__wevu)==null||(i=r.__wevu_flushSetupSnapshotSync)==null||i.call(r)}function Ti(e,t){var n;let r=(n=e.__wevu)==null?void 0:n.adapter;r&&typeof r.__wevu_setVisibility==`function`&&r.__wevu_setVisibility(t)}function Ei(e,t){var n;let r=e.__wevu,i=e[Z];i&&rr(i),Dr(e),!(t!=null&&t.skipHooks)&&r&&e[_e]&&N(e,`onUnload`,[]),e[_e]&&(e[_e]=void 0);let a=e[at];if(Array.isArray(a))for(let e of a)try{e()}catch(e){}e[at]=void 0,(n=e[me])==null||n.stop(),e[me]=void 0,r&&r.unmount(),delete e.__wevu,X in e&&delete e[X]}const Di=`__wevuAppGlobalListeners`,Oi=`__wevuOnMemoryWarningListener`;function ki(e){let t=e[_e],n=!!(t!=null&&t.onMemoryWarning);if(!z(`appMemoryWarningListener`)){delete e[Oi];return}let r=k(),i=r==null?void 0:r.onMemoryWarning,a=r==null?void 0:r.offMemoryWarning;if(typeof i!=`function`)return;let o=e[Oi];if(typeof o==`function`&&typeof a==`function`)try{a(o)}catch(e){}if(!n){delete e[Oi];return}let s=t=>{N(e,`onMemoryWarning`,[t])};e[Oi]=s,i(s)}function Ai(e,t){var n,r;let{hookName:i,onApiName:a,offApiName:o,capabilityName:s,userHandler:c}=t,l=e[_e],u=!!(l!=null&&l[i]),d=(r=(n=e)[Di])==null?n[Di]=Object.create(null):r,f=d[i];if(!z(s)){delete d[i],delete e[i];return}let p=k(),m=p==null?void 0:p[a],h=p==null?void 0:p[o];if(typeof f==`function`&&typeof h==`function`)try{h(f)}catch(e){}if(!u&&typeof c!=`function`){delete d[i];return}let g=(...t)=>{N(e,i,t),typeof c==`function`&&c.apply(e,t)};e[i]=g,d[i]=g,typeof m==`function`&&m(g)}function ji(e,t){Ai(e,{hookName:`onError`,onApiName:`onError`,offApiName:`offError`,capabilityName:`appErrorListener`,userHandler:t.onError}),Ai(e,{hookName:`onPageNotFound`,onApiName:`onPageNotFound`,offApiName:`offPageNotFound`,capabilityName:`appPageNotFoundListener`,userHandler:t.onPageNotFound}),Ai(e,{hookName:`onUnhandledRejection`,onApiName:`onUnhandledRejection`,offApiName:`offUnhandledRejection`,capabilityName:`appUnhandledRejectionListener`,userHandler:t.onUnhandledRejection}),Ai(e,{hookName:`onThemeChange`,onApiName:`onThemeChange`,offApiName:`offThemeChange`,capabilityName:`appThemeChangeListener`,userHandler:t.onThemeChange})}function Mi(e,t,n,r,i){var a;if(typeof App!=`function`)throw TypeError(`createApp 需要全局 App 构造器可用`);let o=Object.keys(t==null?{}:t),s={...i};s.globalData=(a=s.globalData)==null?{}:a,s[ve]||(s[ve]=function(e){var t,n;let r=this.__wevu;return Kn((t=r==null?void 0:r.proxy)==null?this:t,void 0,e,r==null||(n=r.methods)==null?void 0:n[ye])});let c=s.onLaunch,l=s.onError,u=s.onPageNotFound,d=s.onUnhandledRejection,f=s.onThemeChange;s.onLaunch=function(...t){this[be]=!0,bi(this,e,n,r),ki(this),ji(this,{onError:l,onPageNotFound:u,onUnhandledRejection:d,onThemeChange:f}),N(this,`onLaunch`,t),typeof c==`function`&&c.apply(this,t)};let p=s.onShow;s.onShow=function(...e){N(this,`onShow`,e),typeof p==`function`&&p.apply(this,e)};let m=s.onHide;s.onHide=function(...e){N(this,`onHide`,e),typeof m==`function`&&m.apply(this,e)},delete s.onError,delete s.onPageNotFound,delete s.onUnhandledRejection,delete s.onThemeChange;for(let e of o){let t=s[e];s[e]=function(...n){var r;let i=this.__wevu,a,o=i==null||(r=i.methods)==null?void 0:r[e];return o&&(a=o.apply(i.proxy,n)),typeof t==`function`?t.apply(this,n):a}}App(s)}function Ni(e){let{features:t,userOnSaveExitState:n,userOnPullDownRefresh:r,userOnReachBottom:i,userOnPageScroll:a,userOnRouteDone:o,userOnTabItemTap:s,userOnResize:c,userOnShareAppMessage:l,userOnShareTimeline:u,userOnAddToFavorites:d}=e,f=typeof r==`function`||!!t.enableOnPullDownRefresh,p=typeof i==`function`||!!t.enableOnReachBottom,m=typeof a==`function`||!!t.enableOnPageScroll,h=typeof o==`function`||!!t.enableOnRouteDone,g=!!t.enableOnRouteDoneFallback,_=typeof s==`function`||!!t.enableOnTabItemTap,v=typeof c==`function`||!!t.enableOnResize,y=typeof u==`function`||!!t.enableOnShareTimeline,b=typeof l==`function`||!!t.enableOnShareAppMessage,x=typeof d==`function`||!!t.enableOnAddToFavorites,S=typeof n==`function`||!!t.enableOnSaveExitState,C=()=>{};return{enableOnPullDownRefresh:f,enableOnReachBottom:p,enableOnPageScroll:m,enableOnRouteDone:h,enableOnRouteDoneFallback:g,enableOnTabItemTap:_,enableOnResize:v,enableOnShareAppMessage:b,enableOnShareTimeline:y,enableOnAddToFavorites:x,enableOnSaveExitState:S,effectiveOnSaveExitState:typeof n==`function`?n:(()=>({data:void 0})),effectiveOnPullDownRefresh:typeof r==`function`?r:C,effectiveOnReachBottom:typeof i==`function`?i:C,effectiveOnPageScroll:typeof a==`function`?a:C,effectiveOnRouteDone:typeof o==`function`?o:C,effectiveOnTabItemTap:typeof s==`function`?s:C,effectiveOnResize:typeof c==`function`?c:C,effectiveOnShareAppMessage:typeof l==`function`?l:C,effectiveOnShareTimeline:typeof u==`function`?u:C,effectiveOnAddToFavorites:typeof d==`function`?d:(()=>({}))}}function Pi(e,t){let{enableOnSaveExitState:n,enableOnPullDownRefresh:r,enableOnReachBottom:i,enableOnPageScroll:a,enableOnRouteDone:o,enableOnTabItemTap:s,enableOnResize:c,enableOnShareAppMessage:l,enableOnShareTimeline:u,enableOnAddToFavorites:d,effectiveOnSaveExitState:f,effectiveOnPullDownRefresh:p,effectiveOnReachBottom:m,effectiveOnPageScroll:h,effectiveOnRouteDone:g,effectiveOnTabItemTap:_,effectiveOnResize:v,effectiveOnShareAppMessage:y,effectiveOnShareTimeline:b,effectiveOnAddToFavorites:x,hasHook:S}=t;n&&(e.onSaveExitState=function(...e){let t=F(this,`onSaveExitState`,e);return t===void 0?f.apply(this,e):t}),r&&(e.onPullDownRefresh=function(...e){if(N(this,`onPullDownRefresh`,e),!S(this,`onPullDownRefresh`))return p.apply(this,e)}),i&&(e.onReachBottom=function(...e){if(N(this,`onReachBottom`,e),!S(this,`onReachBottom`))return m.apply(this,e)}),a&&(e.onPageScroll=function(...e){return le(this,()=>{if(N(this,`onPageScroll`,e),!S(this,`onPageScroll`))return h.apply(this,e)})}),o&&(e.onRouteDone=function(...e){if(!this[Be]&&(this[Be]=!0,Promise.resolve().then(()=>{this[Be]=!1}),this[ze]=!0,N(this,`onRouteDone`,e),!S(this,`onRouteDone`)))return g.apply(this,e)}),s&&(e.onTabItemTap=function(...e){if(N(this,`onTabItemTap`,e),!S(this,`onTabItemTap`))return _.apply(this,e)}),c&&(e.onResize=function(...e){if(N(this,`onResize`,e),!S(this,`onResize`))return v.apply(this,e)}),l&&(e.onShareAppMessage=function(...e){let t=F(this,`onShareAppMessage`,e);return t===void 0?y.apply(this,e):t}),u&&(e.onShareTimeline=function(...e){let t=F(this,`onShareTimeline`,e);return t===void 0?b.apply(this,e):t}),d&&(e.onAddToFavorites=function(...e){let t=F(this,`onAddToFavorites`,e);return t===void 0?x.apply(this,e):t})}function Fi(e){let{runtimeApp:t,watch:n,setup:r,userOnLoad:i,userOnUnload:a,userOnShow:o,userOnHide:s,userOnReady:c,isPage:l,enableOnSaveExitState:u,enableOnPullDownRefresh:d,enableOnReachBottom:f,enableOnPageScroll:p,enableOnRouteDone:m,enableOnRouteDoneFallback:h,enableOnTabItemTap:g,enableOnResize:_,enableOnShareAppMessage:v,enableOnShareTimeline:y,enableOnAddToFavorites:b,syncWevuPropsFromValues:x,effectiveOnSaveExitState:S,effectiveOnPullDownRefresh:C,effectiveOnReachBottom:w,effectiveOnPageScroll:T,effectiveOnRouteDone:E,effectiveOnTabItemTap:D,effectiveOnResize:O,effectiveOnShareAppMessage:k,effectiveOnShareTimeline:A,effectiveOnAddToFavorites:j,hasHook:M}=e,P=e=>{var t,n;(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)},F={onLoad(...e){if(this[Te])return;this[Te]=!0,bi(this,t,n,r);let a=e[0]&&typeof e[0]==`object`?e[0]:ae(this);if(x==null||x(this,a),P(this),wi(this),l&&K({enableOnShareAppMessage:v,enableOnShareTimeline:y}),N(this,`onLoad`,e),typeof i==`function`)return i.apply(this,e.length?e:[a])},onUnload(...e){if(l&&U(this),Ei(this),typeof a==`function`)return a.apply(this,e)},onShow(...e){if(l&&(ue(),H(this),this[Te]||F.onLoad.call(this,ae(this)),x==null||x(this,ae(this)),P(this),K({enableOnShareAppMessage:v,enableOnShareTimeline:y}),this[ze]=!1),Ti(this,!0),l&&de({page:this,source:`page`}),N(this,`onShow`,e),typeof o==`function`)return o.apply(this,e)},onHide(...e){if(l&&U(this),Ti(this,!1),N(this,`onHide`,e),typeof s==`function`)return s.apply(this,e)},onReady(...e){if(l&&(this[Te]||F.onLoad.call(this,ae(this)),x==null||x(this,ae(this)),P(this),K({enableOnShareAppMessage:v,enableOnShareTimeline:y})),!this[Le]){if(this[Le]=!0,l&&m&&h){let e=this;setTimeout(()=>{if(!e[ze]){var t;(t=F.onRouteDone)==null||t.call(e)}},0)}Er(this,()=>{N(this,`onReady`,e),typeof c==`function`&&c.apply(this,e)});return}if(typeof c==`function`)return c.apply(this,e)}};return Pi(F,{enableOnSaveExitState:u,enableOnPullDownRefresh:d,enableOnReachBottom:f,enableOnPageScroll:p,enableOnRouteDone:m,enableOnTabItemTap:g,enableOnResize:_,enableOnShareAppMessage:v,enableOnShareTimeline:y,enableOnAddToFavorites:b,effectiveOnSaveExitState:S,effectiveOnPullDownRefresh:C,effectiveOnReachBottom:w,effectiveOnPageScroll:T,effectiveOnRouteDone:E,effectiveOnTabItemTap:D,effectiveOnResize:O,effectiveOnShareAppMessage:k,effectiveOnShareTimeline:A,effectiveOnAddToFavorites:j,hasHook:M}),F}function Ii(e){let{userMethods:t,runtimeMethods:n}=e,r={...t};r[ve]||(r[ve]=function(e){var t,n;let r=this.__wevu;return Kn((t=r==null?void 0:r.proxy)==null?this:t,void 0,e,r==null||(n=r.methods)==null?void 0:n[ye])}),r[Ce]||(r[Ce]=function(e){var t,n,r;let i=(t=e==null||(n=e.currentTarget)==null||(n=n.dataset)==null?void 0:n.wvModel)==null?e==null||(r=e.target)==null||(r=r.dataset)==null?void 0:r.wvModel:t;if(typeof i!=`string`||!i)return;let a=this.__wevu;if(!a||typeof a.bindModel!=`function`)return;let o=St(e);try{a.bindModel(i).update(o)}catch(e){}}),!r[J]&&typeof(n==null?void 0:n[J])==`function`&&(r[J]=n[J]);let i=Object.keys(n==null?{}:n);function a(e){let t=e.__wevu;if(t)return t;let n=e.$state;if(n&&typeof n==`object`)return n[He]}function o(e,t){if((e==null?void 0:e.proxy)===t)return;let n=e==null?void 0:e.proxy,r=e=>{let r=t[e];if(typeof r!=`function`)return!1;let i=n==null?void 0:n[e];return typeof i==`function`&&r===i};if(r(`triggerEvent`)||r(`createSelectorQuery`)||r(`createIntersectionObserver`)||r(`setData`)||!(typeof t.triggerEvent==`function`||typeof t.createSelectorQuery==`function`||typeof t.createIntersectionObserver==`function`||typeof t.setData==`function`))return;let i=e==null?void 0:e.state;if(!(!i||typeof i!=`object`)&&t.$state!==i)try{Object.defineProperty(i,q,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){i[q]=t}}for(let e of i){if(e===ye||e.startsWith(Re))continue;let t=r[e];r[e]=function(...n){var r;let i=a(this);o(i,this);let s,c=i==null||(r=i.methods)==null?void 0:r[e];if(c&&(s=c.apply(i.proxy,n)),typeof t==`function`){let e=t.apply(this,n);return e===void 0?s:e}return s}}return{finalMethods:r}}function Li(e,t=new WeakMap){if(!e||typeof e!=`object`)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r of e)n.push(Li(r,t));return n}let n={};t.set(e,n);for(let[r,i]of Object.entries(e))n[r]=Li(i,t);return n}function Ri(e){let t=e.route;if(typeof t==`string`&&t)return t;let n=e.is;return typeof n==`string`&&n?n:`unknown`}function zi(e){var t;let{methods:n={},lifetimes:r={},pageLifetimes:i={},options:a={},...o}=e,s=o.onLoad,c=o.onUnload,l=o.onShow,u=o.onHide,d=o.onReady,f=o.onSaveExitState,p=o.onPullDownRefresh,m=o.onReachBottom,h=o.onPageScroll,g=o.onRouteDone,_=o.onTabItemTap,v=o.onResize,y=o.onShareAppMessage,b=o.onShareTimeline,x=o.onAddToFavorites,S=(t=o.features)==null?{}:t,C=[s,c,l,u,d,f,p,m,h,g,_,v,y,b,x].some(e=>typeof e==`function`),w=!!o.__wevu_isPage||Object.keys(S==null?{}:S).length>0||C,T={...o},E=new Set([`data`,`behaviors`,`relations`,`externalClasses`,`options`,`properties`,`observers`,`pureDataPattern`,`virtualHost`,`definitionFilter`,`export`,`__wevuTemplateRefs`,`__wevuLayoutHosts`,Pe,Fe,`setupLifecycle`,`features`,`__wevu_isPage`]),D=[];for(let[e,t]of Object.entries(T))E.has(e)||typeof t!=`function`&&(D.push([e,t]),delete T[e]);let O=e=>{if(D.length){for(let[t,n]of D)if(!Q(e,t))try{e[t]=Li(n)}catch(e){}}},k=new Set([`data`,`export`,`definitionFilter`,`onLoad`,`onUnload`,`onShow`,`onHide`,`onReady`,`onSaveExitState`,`onPullDownRefresh`,`onReachBottom`,`onPageScroll`,`onRouteDone`,`onTabItemTap`,`onResize`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]),A={};for(let[e,t]of Object.entries(T))typeof t!=`function`||k.has(e)||(A[e]=t,delete T[e]);let j=T.__wevuTemplateRefs;delete T.__wevuTemplateRefs;let M=T.__wevuLayoutHosts;delete T.__wevuLayoutHosts;let N=T[Pe];delete T[Pe];let P=T[Fe];delete T[Fe];let F=T.observers,I=T.setupLifecycle===`created`?`created`:`attached`;delete T.setupLifecycle;let L=T.created;return delete T.features,delete T.created,delete T.onLoad,delete T.onUnload,delete T.onShow,delete T.onHide,delete T.onReady,{userMethods:n,userLifetimes:r,userPageLifetimes:i,userOptions:a,restOptions:T,topLevelMethods:A,templateRefs:j,layoutHosts:M,propsAliases:N,propsDerivedKeys:P,userObservers:F,setupLifecycle:I,legacyCreated:L,isPage:w,features:S,userOnLoad:s,userOnUnload:c,userOnShow:l,userOnHide:u,userOnReady:d,userOnSaveExitState:f,userOnPullDownRefresh:p,userOnReachBottom:m,userOnPageScroll:h,userOnRouteDone:g,userOnTabItemTap:_,userOnResize:v,userOnShareAppMessage:y,userOnShareTimeline:b,userOnAddToFavorites:x,applyExtraInstanceFields:O}}function Bi(e){var t;let n=e.__wevu,r=e[Z];if(!n||!r||typeof n.snapshot!=`function`)return;let i=n.snapshot();lr(i,(t=e[Y])==null?e.properties:t,n),nr(r,i,n.proxy)}function Vi(e){let{restOptions:t,propsAliases:n,propsDerivedKeys:r,userObservers:i}=e,a=t.properties&&typeof t.properties==`object`?Object.keys(t.properties):[],o=new Set(a),s=new Set(r==null?[]:r),c=Object.entries(n==null?{}:n).filter(([e,t])=>e&&t),l=new Set(c.map(([e])=>e)),u=[...s].filter(e=>o.has(e)&&!l.has(e)),d=new Set([Je,Ye,et]),f=new WeakMap,p=e=>e.startsWith(`__wv_`),m=e=>{let t=e.__wevu,n=t==null?void 0:t[Fe];if(n instanceof Set)for(let e of u)n.add(e)},h=(e,t,n)=>Q(e,t)&&Object.is(e[t],n)?!1:(e[t]=n,!0),g=(e,t,n)=>{var r;if(!d.has(t))return;let i=!1,a=(r=e.__wevu)==null?void 0:r.state;try{a&&typeof a==`object`&&h(a,t,n);let r=e.data;r&&typeof r==`object`&&(i=h(r,t,n))}catch(e){}if(!(!i||typeof e.setData!=`function`))try{e.setData({[t]:n})}catch(e){}},_=(e,t)=>{var n;if(!c.length)return;let r=e.__wevu,i=r==null?void 0:r.setupState,a=r==null?void 0:r.state;if(!i||typeof i!=`object`)return;m(e);let o=(n=f.get(e))==null?new Set:n;f.set(e,o);for(let[e,n]of c){if(Q(i,e)&&!o.has(e))continue;let r=t[n];try{h(i,e,r),o.add(e)}catch(e){}if(a&&typeof a==`object`&&(!Q(a,e)||o.has(e)))try{h(a,e,r)}catch(e){}}},v=(e,t)=>{if(!s.size)return;let n=e.__wevu,r=n==null?void 0:n.setupState;if(!r||typeof r!=`object`)return;m(e);let i=new Map(c);for(let e of s){var a;let n=(a=i.get(e))==null?e:a;if(Q(t,n))try{h(r,e,t[n])}catch(e){}}},y=e=>{try{Object.defineProperty(e,Ie,{value:a,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[Ie]=a}},b=e=>{let t=e[pe];if(!t||typeof t!=`object`)return;let n=t=>{var n;let r=(n=e.__wevu)==null?void 0:n.state;return typeof r==`object`&&!!r&&Q(r,t)},r=e.properties,i=r&&typeof r==`object`?r:void 0,a=Object.keys(t);for(let e of a)if(!i||!Q(i,e)||p(e)||o.has(e)||n(e))try{delete t[e]}catch(e){}if(!i){Bi(e);return}for(let[e,r]of Object.entries(i))if(!(p(e)||o.has(e)||n(e)))try{t[e]=r}catch(e){}Bi(e)},x=e=>{let t=e[Y],n=e.properties,r=e[Ne];if(t&&typeof t==`object`&&n&&typeof n==`object`){let i=n,a=Object.keys(t);for(let e of a)if(!Q(i,e))try{delete t[e]}catch(e){}for(let[n,a]of Object.entries(i)){let i=r&&Q(r,n)?r[n]:a;try{t[n]=i}catch(e){}g(e,n,i)}if(r){for(let[n,a]of Object.entries(r))if(!Q(i,n)){try{t[n]=a}catch(e){}g(e,n,a)}}v(e,t),_(e,t),Bi(e)}r&&delete e[Ne],b(e)},S=(e,t)=>{if(!t||typeof t!=`object`)return;let n=e[Y];if(!n||typeof n!=`object`)return;let r=!1;for(let i of a)if(Q(t,i)){try{n[i]=t[i],r=!0}catch(e){}g(e,i,t[i])}r&&(v(e,n),_(e,n),Bi(e),b(e))},C=(e,t,n)=>{var r,i;let a=e[Y];if(!a||typeof a!=`object`)return;try{a[t]=n}catch(e){}g(e,t,n);let o=(i=(r=e)[Ne])==null?r[Ne]=Object.create(null):i;o[t]=n,v(e,a),_(e,a),Bi(e),b(e)},w={};if(a.length)for(let e of a)w[e]=function(t){C(this,e,t)};let T={...i==null?{}:i};for(let[e,t]of Object.entries(w)){let n=T[e];typeof n==`function`?T[e]=function(...e){n.apply(this,e),t.apply(this,e)}:T[e]=t}let E=T[`**`];return T[`**`]=function(...e){typeof E==`function`&&E.apply(this,e),x(this)},{attachWevuPropKeys:y,directPropsDerivedKeys:u,syncWevuPropsFromInstance:x,syncWevuPropsFromValues:S,finalObservers:T}}function Hi(e){return Array.from(new Set(Array.isArray(e)?e:[e])).filter(e=>typeof e==`string`&&e.length>0)}function Ui(e){if(!e||typeof e!=`object`)return[];let t=[],n=typeof e.route==`string`?e.route.replace(/^\/+/,``):``;n&&t.push(`route:${n}`);for(let[n,r]of[[`webview`,`__wxWebviewId__`],[`exparser`,`__wxExparserNodeId__`]]){let i=e[r];(typeof i==`number`||typeof i==`string`)&&t.push(`${n}:${String(i)}`)}return Array.from(new Set(t))}function Wi(){let e=new Map;function t(t,n,r){let i=Hi(t);if(i.length===0||r.length===0)return null;for(let t of r){var a;let r=(a=e.get(t))==null?new Map:a;for(let e of i)r.set(e,n);e.set(t,r)}return i}function n(t,n,r){let i=Hi(t);if(i.length===0||r.length===0)return!1;let a=!1;for(let t of r){let r=e.get(t);if(r){for(let e of i)r.get(e)===n&&(r.delete(e),a=!0);r.size===0&&e.delete(t)}}return a}function r(t,n){return n.map(n=>{var r;return(r=e.get(n))==null?void 0:r.get(t)}).find(Boolean)}function i(e,t,n){var i;let a=r(e,t);return a?(i=n(a,e))==null?null:i:null}function a(e,t,n,r={}){var o,s;let c=(o=r.retries)==null?20:o,l=(s=r.interval)==null?16:s,u=i(e,t(),n);return u||c<=0?Promise.resolve(u):new Promise(i=>{setTimeout(()=>{i(a(e,t,n,{...r,retries:c-1}))},l)})}return{register:t,resolveBridge:r,resolveHost:i,unregister:n,waitForHost:a}}const Gi=Wi();function Ki(){let e=M();return e[e.length-1]}function qi(e){return Ui(e)}function Ji(e){return e&&typeof e.__wevuSetPageLayout==`function`?e:Ki()}function Yi(e){var t,n;if(!e||typeof e!=`object`)return;let r=(t=e[X])==null||(t=t.state)==null?void 0:t[q];if(r&&typeof r==`object`)return r;let i=(n=e.$state)==null?void 0:n[q];return i&&typeof i==`object`?i:e[q]&&typeof e[q]==`object`?e[q]:e}function Xi(e){return typeof e==`function`?e():h(e)?e.value:e}function Zi(e,t){return e.find(e=>e.key===t)}function Qi(e,t){let n=e==null?void 0:e.selectComponent;if(typeof n!=`function`)return null;try{var r;return(r=n.call(e,t))==null?null:r}catch(e){return null}}function $i(e,t){var n,r,i,a,o,s,c,l;if(!e.refName)return null;let u=gr(t),d=(n=(r=(i=(a=t[X])==null||(a=a.state)==null?void 0:a.$refs)==null?(o=t.__wevu)==null||(o=o.state)==null?void 0:o.$refs:i)==null?(s=t.$state)==null?void 0:s.$refs:r)==null?t.$refs:n,f=(c=u==null||(l=u.get(e.refName))==null?void 0:l.value)==null?d==null?void 0:d[e.refName]:c;if(Array.isArray(f)){var p;return(p=f[0])==null?null:p}return f==null?null:f}function ea(e,t){let n=Yi(t),r=n&&typeof n==`object`?Object.create(n):{};return Object.assign(r,{selectComponent(r){let i=Zi(e,r);if(!i)return null;if(i.kind===`component`||!i.kind){var a,o;return $i(i,t)||((a=(o=Qi(n,i.selector))==null?Qi(Ki(),i.selector):o)==null?null:a)}return null}})}function ta(e,t){let n=t==null?I():t,r=Ji(n),i=qi(r);return!n||!r||i.length===0||!Gi.register(e,n,i)?!1:(n[xe]=i,!0)}function na(e,t){var n;let r=t==null?I():t,i=Ji(r),a=(n=r==null?void 0:r[xe])==null?qi(i):n;if(!r||!Array.isArray(a)||a.length===0)return!1;let o=Gi.unregister(e,r,a);return delete r[xe],o}function ra(e,t){var n,r;let i=(n=Ki())==null?Ji(t):n,a=Gi.resolveBridge(e,qi(i));return(r=a==null?t:a)==null?I():r}function ia(e,t={}){var n,r;let i=(n=t.context)==null?t.fallbackContext:n,a=(r=Ki())==null?Ji(i):r;return Gi.resolveHost(e,qi(a),(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)})}function aa(e,t={}){var n;let r=(n=t.context)==null?t.fallbackContext:n;return Gi.waitForHost(e,()=>{var e;return qi((e=Ki())==null?Ji(r):e)},(e,t)=>{var n;return(n=e.selectComponent)==null?void 0:n.call(e,t)},t)}function oa(e,t={}){if(!D())throw Error(`useLayoutBridge() 必须在 setup() 的同步阶段调用`);let n=I(),r=Hi(e),i=t.resolveComponent,a=Yi(n),o=a&&typeof a==`object`?Object.create(a):{},s=Object.assign(o,{selectComponent(e){var t,a,o;if(!r.includes(e))return null;let s=i==null?void 0:i(e);if(s!==void 0)return s;let c=Yi(n),l=c==null||(t=c.selectComponent)==null?void 0:t.call(c,e);if(l)return l;let u=Ki();return(a=u==null||(o=u.selectComponent)==null?void 0:o.call(u,e))==null?null:a}});ta(r,s),te(()=>{ta(r,s)}),G(()=>{na(r,s)})}function sa(e,t){if(!e.length)return null;let n=t==null?I():t;if(!n)return null;let r=ea(e,n);return ta(e.map(e=>e.key),r),r}function ca(e,t){if(!e.length)return!1;let n=t==null?I():t;return n?na(e.map(e=>e.key),n):!1}function la(e){oa(Object.keys(e),{resolveComponent(t){return Xi(e[t])}})}function ua(e){let{runtimeApp:t,watch:n,setup:r,restOptions:i,pageLifecycleHooks:a,finalObservers:o,userLifetimes:s,userPageLifetimes:c,finalMethods:l,finalOptions:u,applyExtraInstanceFields:d,templateRefs:f,layoutHosts:p,attachWevuPropKeys:m,setupLifecycle:h,syncWevuPropsFromInstance:g,directPropsDerivedKeys:_,isPage:v,legacyCreated:y,getRuntimeOwnerLabel:b}=e,x={},S=e=>{if(!Array.isArray(p)||!p.length||e[Se])return;let t=sa(p,e);t&&(e[Se]=t)},C=e=>{v&&(e[Ae]=(t,n)=>{var r;let i=(r=e.__wevu)==null?void 0:r.state;if(!i||typeof i!=`object`)return;i[De]=$n(t);let a=t===!1||n==null?{}:n;i[ke]=a,Xn(e,t,a)})};if(v)for(let e of[`onPullDownRefresh`,`onReachBottom`,`onShareAppMessage`,`onShareTimeline`,`onAddToFavorites`]){let t=a[e];typeof t==`function`&&typeof l[e]!=`function`&&(x[e]=function(...e){return t.apply(this,e)})}let w={...i,...a,observers:o,lifetimes:{...s,created:function(...e){if(d(this),Array.isArray(f)&&f.length&&Object.defineProperty(this,nt,{value:f,configurable:!0,enumerable:!1,writable:!1}),m(this),h===`created`){try{bi(this,t,n,r,{deferSetData:!0,snapshotOmitKeys:_})}catch(e){let t=b(this);throw Error(`[wevu] mount runtime failed in created (${t}): ${e instanceof Error?e.message:String(e)}`)}g(this),C(this)}typeof y==`function`&&y.apply(this,e),typeof s.created==`function`&&s.created.apply(this,e)},moved:function(...e){N(this,`onMoved`,e),typeof s.moved==`function`&&s.moved.apply(this,e)},attached:function(...e){if(d(this),Array.isArray(f)&&f.length&&!this[nt]&&Object.defineProperty(this,nt,{value:f,configurable:!0,enumerable:!1,writable:!1}),m(this),h!==`created`||!this.__wevu)try{bi(this,t,n,r,{snapshotOmitKeys:_})}catch(e){let t=b(this);throw Error(`[wevu] mount runtime failed in attached (${t}): ${e instanceof Error?e.message:String(e)}`)}g(this),C(this),S(this),h===`created`&&wi(this),N(this,`onAttached`,e),typeof s.attached==`function`&&s.attached.apply(this,e)},ready:function(...e){if(v&&typeof a.onReady==`function`){a.onReady.call(this,...e),typeof s.ready==`function`&&s.ready.apply(this,e);return}if(!this[Le]){this[Le]=!0,g(this),Er(this,()=>{N(this,`onReady`,e),typeof s.ready==`function`&&s.ready.apply(this,e)});return}typeof s.ready==`function`&&s.ready.apply(this,e)},detached:function(...e){if(N(this,`onDetached`,e),v&&typeof a.onUnload==`function`){a.onUnload.call(this,...e),typeof s.detached==`function`&&s.detached.apply(this,e);return}Dr(this),Array.isArray(p)&&p.length&&this[Se]&&(ca(p,this[Se]),delete this[Se]),Ei(this),typeof s.detached==`function`&&s.detached.apply(this,e)},error:function(...e){N(this,`onError`,e),typeof s.error==`function`&&s.error.apply(this,e)}},pageLifetimes:{...c,show:function(...e){if(v&&typeof a.onShow==`function`){a.onShow.call(this,...e),typeof c.show==`function`&&c.show.apply(this,e);return}Ti(this,!0),N(this,`onShow`,e),typeof c.show==`function`&&c.show.apply(this,e)},hide:function(...e){if(v&&typeof a.onHide==`function`){a.onHide.call(this,...e),typeof c.hide==`function`&&c.hide.apply(this,e);return}Ti(this,!1),N(this,`onHide`,e),typeof c.hide==`function`&&c.hide.apply(this,e)},resize:function(...e){if(v&&typeof a.onResize==`function`){a.onResize.call(this,...e),typeof c.resize==`function`&&c.resize.apply(this,e);return}N(this,`onResize`,e),typeof c.resize==`function`&&c.resize.apply(this,e)},routeDone:function(...e){if(v&&typeof a.onRouteDone==`function`){a.onRouteDone.call(this,...e),typeof c.routeDone==`function`&&c.routeDone.apply(this,e);return}N(this,`onRouteDone`,e),typeof c.routeDone==`function`&&c.routeDone.apply(this,e)}},methods:{...x,...l},options:u},T=globalThis[fe];if(typeof(T==null?void 0:T.trackWevuComponent)==`function`){let e=T.trackWevuComponent(w,e=>{Si(e,t,n,r,{snapshotOmitKeys:_}),g(e),C(e),S(e),wi(e,{rehydrateSetupState:!0})});T.isApplying()||Component(e)}else Component(w)}function da(e,t,n,r,i){var a;let{userMethods:o,userLifetimes:s,userPageLifetimes:c,userOptions:l,restOptions:u,topLevelMethods:d,templateRefs:f,layoutHosts:p,propsAliases:m,propsDerivedKeys:h,userObservers:g,setupLifecycle:_,legacyCreated:v,isPage:y,features:b,userOnLoad:x,userOnUnload:S,userOnShow:C,userOnHide:w,userOnReady:T,userOnSaveExitState:E,userOnPullDownRefresh:D,userOnReachBottom:O,userOnPageScroll:k,userOnRouteDone:A,userOnTabItemTap:j,userOnResize:M,userOnShareAppMessage:N,userOnShareTimeline:P,userOnAddToFavorites:F,applyExtraInstanceFields:I}=zi(i),{enableOnPullDownRefresh:L,enableOnReachBottom:R,enableOnPageScroll:z,enableOnRouteDone:B,enableOnRouteDoneFallback:V,enableOnTabItemTap:H,enableOnResize:U,enableOnShareAppMessage:ee,enableOnShareTimeline:W,enableOnAddToFavorites:te,enableOnSaveExitState:ne,effectiveOnSaveExitState:G,effectiveOnPullDownRefresh:re,effectiveOnReachBottom:ie,effectiveOnPageScroll:ae,effectiveOnRouteDone:K,effectiveOnTabItemTap:oe,effectiveOnResize:se,effectiveOnShareAppMessage:ce,effectiveOnShareTimeline:le,effectiveOnAddToFavorites:ue}=Ni({features:b,userOnSaveExitState:E,userOnPullDownRefresh:D,userOnReachBottom:O,userOnPageScroll:k,userOnRouteDone:A,userOnTabItemTap:j,userOnResize:M,userOnShareAppMessage:N,userOnShareTimeline:P,userOnAddToFavorites:F}),de=(e,t)=>{let n=e[_e];if(!n)return!1;let r=n[t];return r?Array.isArray(r)?r.length>0:typeof r==`function`:!1};{let e=u.export;u.export=function(){var t;let n=(t=this[he])==null?{}:t,r=typeof e==`function`?e.call(this):{};return r&&typeof r==`object`&&!Array.isArray(r)?{...n,...r}:r==null?n:r}}let fe={multipleSlots:(a=l.multipleSlots)==null||a,...l},{attachWevuPropKeys:pe,directPropsDerivedKeys:me,syncWevuPropsFromInstance:ge,syncWevuPropsFromValues:ve,finalObservers:ye}=Vi({restOptions:u,propsAliases:m,propsDerivedKeys:h,userObservers:g}),{finalMethods:be}=Ii({userMethods:{...d,...o},runtimeMethods:t});ua({runtimeApp:e,watch:n,setup:r,restOptions:u,pageLifecycleHooks:Fi({runtimeApp:e,watch:n,setup:r,userOnLoad:x,userOnUnload:S,userOnShow:C,userOnHide:w,userOnReady:T,isPage:y,enableOnSaveExitState:ne,enableOnPullDownRefresh:L,enableOnReachBottom:R,enableOnPageScroll:z,enableOnRouteDone:B,enableOnRouteDoneFallback:V,enableOnTabItemTap:H,enableOnResize:U,enableOnShareAppMessage:ee,enableOnShareTimeline:W,enableOnAddToFavorites:te,syncWevuPropsFromValues:ve,effectiveOnSaveExitState:G,effectiveOnPullDownRefresh:re,effectiveOnReachBottom:ie,effectiveOnPageScroll:ae,effectiveOnRouteDone:K,effectiveOnTabItemTap:oe,effectiveOnResize:se,effectiveOnShareAppMessage:ce,effectiveOnShareTimeline:le,effectiveOnAddToFavorites:ue,hasHook:de}),finalObservers:ye,userLifetimes:s,userPageLifetimes:c,finalMethods:be,finalOptions:fe,applyExtraInstanceFields:I,templateRefs:f,layoutHosts:p,attachWevuPropKeys:pe,setupLifecycle:_,syncWevuPropsFromInstance:ge,syncWevuPropsFromValues:ve,directPropsDerivedKeys:me,isPage:y,legacyCreated:v,getRuntimeOwnerLabel:Ri})}function fa(e){let{[hn]:t,data:n,computed:r,methods:i,setData:a,watch:o,setup:s,...c}=e.__wevuDefaultsScope===`component`?e:Cn(e),l=i==null?{}:i,u=r==null?{}:r,d=new Set,f=new Set,p=!1,m={globalProperties:{}},h={mount:mn({data:n,resolvedComputed:u,resolvedMethods:l,appConfig:m,setDataOptions:a}),use(e,...t){if(!e||d.has(e))return h;if(d.add(e),typeof e==`function`)e(h,...t);else if(typeof e.install==`function`)e.install(h,...t);else throw TypeError(`插件必须是函数,或包含 install 方法的对象`);return h},provide(e,t){return ie(h,e,t),h},onUnmount(e){if(typeof e!=`function`)throw TypeError(`onUnmount 只接受函数`);return p?(e(),h):(f.add(e),h)},unmount(){if(!p){p=!0;for(let e of f)e();f.clear()}},config:m,version:vt},g=typeof App==`function`;try{re(h),Object.defineProperty(h,"__wevuSetDataOptions",{value:a,configurable:!0,enumerable:!1,writable:!1}),Object.defineProperty(h,"__wevuHasTemplateRuntimeBindings",{value:Object.keys(u).some(e=>e.startsWith(`__wv_bind_`)),configurable:!0,enumerable:!1,writable:!1})}catch(e){h.__wevuSetDataOptions=a,h.__wevuHasTemplateRuntimeBindings=Object.keys(u).some(e=>e.startsWith(`__wv_bind_`))}if(g){let e=k(),t=`__wevuAppRegistered`;e&&e[t]||(e&&(e[t]=!0),Mi(h,i==null?{}:i,o,s,c))}return h}var pa=class extends Error{};function ma(e){if(typeof e==`function`)return e;let t=e==null?void 0:e.get;return typeof t==`function`?t:void 0}function ha(e){return e.startsWith(`__wv_bind_`)||e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`)}function ga(e,t){if(!e.startsWith(`__wv_bind_`))return!1;try{return!/\bthis\b/.test(Function.prototype.toString.call(t))}catch(e){return!1}}function _a(e){if(e===Z)return``;if(e.startsWith(`__wv_bind_`))return null;if(e.startsWith(`__wv_cls_`)||e.startsWith(`__wv_style_`))return``}function va(e,t){let n=Array.isArray(t==null?void 0:t.pick)?t.pick:[];if(!n.length)return;let r=new Set(Array.isArray(t==null?void 0:t.omit)?t.omit:[]),i={};for(let t of n){if(r.has(t)||Q(e,t))continue;let n=_a(t);n!==void 0&&(i[t]=n)}return Object.keys(i).length?i:void 0}function ya(e){let{data:t,computed:n,setData:r}=e,i=n?Object.keys(n):[];if(!i.length)return;let{includeComputed:a,shouldIncludeKey:o,toPlainMaxDepth:s,toPlainMaxKeys:c,includeFunctions:l,functionPaths:u}=dn(r);if(!a)return;let d={},f=new Set,p,m=e=>{if(Q(t,e)||!o(e))return{ok:!1};if(Q(d,e))return{ok:!0,value:d[e]};if(f.has(e))return{ok:!1};let r=ma(n[e]);if(!r)return{ok:!1};f.add(e);try{let t=r.call(p);if(t===void 0)return{ok:!1};let n=Wt(t,new WeakMap,{maxDepth:s,maxKeys:c,includeFunctions:l,functionPaths:u,_path:e});return n===void 0?{ok:!1}:(d[e]=n,{ok:!0,value:n})}catch(e){return{ok:!1}}finally{f.delete(e)}};p=new Proxy(t,{get(e,r,i){if(typeof r==`string`){if(r===`data`||r===`$state`)return t;if(r===`props`||r===`$props`||r===`$attrs`)throw new pa;if(Q(t,r))return Reflect.get(e,r,i);if(n&&Q(n,r)){let e=m(r);if(e.ok)return e.value;throw new pa}throw new pa}return Reflect.get(e,r,i)},has(e,t){return Reflect.has(e,t)||typeof t==`string`&&!!(n&&Q(n,t))}});for(let e of i){let t=ma(n[e]);ha(e)&&(!t||!ga(e,t))||m(e)}return Object.keys(d).length?d:void 0}function ba(e,t,n){if(!e||typeof e!=`object`)return e;let r=ya({data:e,computed:t,setData:n}),i=va(e,n);return r||i?{...e,...i,...r}:e}const xa=`__wevu_allowNullPropInput`,Sa=`allowNullPropInput`,Ca=new Map([[String,String],[Number,Number],[Boolean,Boolean],[Object,Object],[Array,Array],[Function,Function],[`String`,String],[`Number`,Number],[`Boolean`,Boolean],[`Object`,Object],[`Array`,Array],[`Function`,Function],[null,null],[`null`,null],[`Null`,null]]);function wa(e){return Ca.get(e)}function Ta(e){if(e===void 0)return[];let t=Array.isArray(e)?e:[e],n=[];t.forEach(e=>{let t=wa(e);t!==void 0&&(n.includes(t)||n.push(t))});let r=n.filter(e=>e!==null);return r.length>0?r:(n.includes(null),[null])}function Ea(e,t){let n=Ta(t);if(n.length!==0&&(e.type=n[0],n.length>1)){let t=[];for(let e of n.slice(1))t.includes(e)||t.push(e);t.length>0&&(e.optionalTypes=t)}}function Da(e,t){if(t===void 0||e.type===t)return;let n=Array.isArray(e.optionalTypes)?[...e.optionalTypes]:[];n.includes(t)||(n.push(t),e.optionalTypes=n)}function Oa(e){if(!Array.isArray(e))return[];let t=[];return e.forEach(e=>{let n=wa(e);n==null||t.includes(n)||t.push(n)}),t}function ka(e,t){if(e===void 0)return;if(e===null)return{type:null};if(Array.isArray(e)||typeof e==`function`){let n={};return Ea(n,e),t&&n.type!==null&&Da(n,null),Q(n,`type`)||(n.type=null),n}if(typeof e!=`object`)return e;let n={...e};if(`type`in n){var r;let e=Ta(n.type);n.type=(r=e[0])==null?null:r;let t=Oa(n.optionalTypes);for(let n of e.slice(1))n!==null&&!t.includes(n)&&t.push(n);t.length>0?n.optionalTypes=t:delete n.optionalTypes}return Q(n,`type`)||(n.type=null),t&&n.type!==null&&Da(n,null),n}function Aa(e,t){let n={};return Object.entries(e).forEach(([e,r])=>{let i=ka(r,t);i!==void 0&&(n[e]=i)}),n}function ja(e,t){let n={};return e&&Object.entries(e).forEach(([e,r])=>{if(r!==void 0){if(r===null){n[e]={type:null};return}if(Array.isArray(r)||typeof r==`function`){let i={};Ea(i,r),t&&i.type!==null&&Da(i,null),Q(i,`type`)||(i.type=null),n[e]=i;return}if(typeof r==`object`){if(e.endsWith(`Modifiers`)&&Object.keys(r).length===0){n[e]={type:Object,value:{}};return}let i={};if(`type`in r&&r.type!==void 0&&Ea(i,r.type),Array.isArray(r.optionalTypes)){let e=r.optionalTypes.map(e=>wa(e)).filter(e=>e!=null);if(e.length>0){let t=Array.isArray(i.optionalTypes)?i.optionalTypes:[];for(let n of e)n!==i.type&&(t.includes(n)||t.push(n));t.length>0&&(i.optionalTypes=t)}}`observer`in r&&(typeof r.observer==`function`||typeof r.observer==`string`)&&(i.observer=r.observer);let a=`default`in r?r.default:r.value;a!==void 0&&(i.value=typeof a==`function`?a():a),t&&i.type!==null&&Da(i,null),Q(i,`type`)||(i.type=null),n[e]=i}}}),n}function Ma(e,t,n){var r;let i=!!((r=e[xa])==null?e[Sa]:r),{[xa]:a,[Sa]:o,...s}=e,c=e.properties,l=c&&typeof c==`object`&&Object.keys(c).length>0?c:void 0,u=n==null?l:n,d=!!(t||u),f=e=>{let t={...e==null?{}:e};return d?(Q(t,Ye)||(t[Ye]={type:String,value:``}),Q(t,et)||(t[et]={type:null,value:null}),Q(t,Je)||(t[Je]={type:null,value:null}),t):t};if(u){let{properties:e,...n}=s,r=u?i?Aa(u,i):u:void 0,a=ja(t,i);return{...n,properties:f({...a,...r})}}return{...s,properties:f(ja(t,i))}}const Na=[Z,Ye,Ze,Xe,Qe,$e,et],Pa=/&/g,Fa=/"/g,Ia=/"/g,La=/'/g,Ra=/'/g,za=/</g,Ba=/>/g;function Va(e){return e.replace(Pa,`&`).replace(Fa,`"`).replace(Ia,`"`).replace(La,`'`).replace(Ra,`'`).replace(za,`<`).replace(Ba,`>`)}function Ha(e){var t,n,r,i;let a=Vn((t=(n=e==null||(r=e.currentTarget)==null?void 0:r.dataset)==null?e==null||(i=e.target)==null?void 0:i.dataset:n)==null?{}:t,`wvArgs`,e),o=[];if(Array.isArray(a))o=a;else if(typeof a==`string`)try{o=JSON.parse(a)}catch(e){try{o=JSON.parse(Va(a))}catch(e){o=[]}}return Array.isArray(o)||(o=[]),o.map(t=>t===`$event`?e:t)}function Ua(e){if(!e||typeof e!=`object`)return{};if(Array.isArray(e)){let t={};for(let n=0;n<e.length;n+=2){let r=e[n];typeof r==`string`&&r&&(t[r]=e[n+1])}return t}return e}function Wa(e){var t,n,r,i;return(t=(n=e==null||(r=e.__wevu)==null?void 0:r.proxy)==null?e==null||(i=e[X])==null?void 0:i.proxy:n)==null?e:t}function Ga(e,t){if(!t||Object.keys(t).length===0)return;let n=Wa(e),r={};for(let[e,i]of Object.entries(t))try{let t;typeof i==`function`?t=i.call(n):typeof(i==null?void 0:i.get)==`function`&&(t=i.get.call(n)),t!==void 0&&(r[e]=t)}catch(e){}return r}function Ka(e){var t,n;e==null||(t=e.__wevu)==null||(n=t.__wevu_flushSetupSnapshotSync)==null||n.call(t)}function qa(e,t){Ka(e);let n=Ga(e,t);n&&Object.keys(n).length>0&&typeof(e==null?void 0:e.setData)==`function`&&e.setData(n)}function Ja(e,t){var n,r,i;let a=Q(t==null?{}:t,et)?t[et]:e==null||(n=e.properties)==null?void 0:n[et],o=Q(t==null?{}:t,$e)?t[$e]:e==null||(r=e.properties)==null?void 0:r[$e],s=Ua(a),c=Ua(o),l={...s,...c};e[Qe]=l;let u=e==null||(i=e.__wevu)==null?void 0:i.state;return u&&typeof u==`object`&&(u[Qe]=l),l}function Ya(e,t,n){let r=Ja(e,n);typeof(e==null?void 0:e.setData)==`function`&&e.setData({[Qe]:r}),qa(e,t)}function Xa(e,t){var n;e[Ze]=t;let r=e==null?void 0:e.data;if(r&&typeof r==`object`)try{Object.defineProperty(r,Ze,{value:t,configurable:!0,enumerable:!1,writable:!0})}catch(e){r[Ze]=t}let i=e==null||(n=e.__wevu)==null?void 0:n.state;i&&typeof i==`object`&&(i[Ze]=t)}function Za(e,t,n,r){var i;Xa(e,n),Ja(e),e[Xe]=t||{};let a=e==null||(i=e.__wevu)==null?void 0:i.state;a&&typeof a==`object`&&(a[Xe]=t||{}),typeof(e==null?void 0:e.setData)==`function`&&e.setData({[Xe]:t||{}}),qa(e,r)}function Qa(e,t,n){if(!t){typeof(e==null?void 0:e.__wvOwnerUnsub)==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerUnsub=void 0,e.__wvOwnerBoundId=``,Xa(e,void 0);return}let r=(t,r)=>{Za(e,t,r,n)};e.__wvOwnerBoundId!==t&&(typeof e.__wvOwnerUnsub==`function`&&e.__wvOwnerUnsub(),e.__wvOwnerBoundId=t,e.__wvOwnerUnsub=ir(t,r));let i=or(t);i&&r(i,ar(t))}function $a(e){var t,n,r,i;return(t=(n=e==null||(r=e.properties)==null?void 0:r[Ye])==null?e==null||(i=e.properties)==null?void 0:i[Z]:n)==null?``:t}function eo(e,t){Ya(e,t);let n=$a(e);n&&Qa(e,n,t)}function to(){let e={[Xe]:{},[Qe]:{}};return Object.defineProperty(e,Ze,{value:void 0,configurable:!0,enumerable:!1,writable:!0}),e}function no(e){let t=e==null?void 0:e.computed,n={options:{virtualHost:!0},setData:{omit:Na},[Fe]:Na,properties:{[Ye]:{type:String,value:``,observer(e){Qa(this,e||``,t)}},[Z]:{type:String,value:``,observer(e){Qa(this,e||``,t)}},[$e]:{type:null,value:null,observer(e){Ya(this,t,{[$e]:e})}},[et]:{type:null,value:null,observer(e){Ya(this,t,{[et]:e})}}},data:to,lifetimes:{attached(){eo(this,t)},ready(){eo(this,t)},detached(){typeof this.__wvOwnerUnsub==`function`&&this.__wvOwnerUnsub(),this.__wvOwnerUnsub=void 0,this.__wvOwnerBoundId=``,Xa(this,void 0)}},methods:{[J](e){var t,n,r,i,a;let o=this[Ze],s=Kn(o,void 0,e,(t=this.__wevu)==null||(t=t.methods)==null?void 0:t[ye]);if(s!==void 0)return s;if(!o)return;let c=Vn((n=(r=e==null||(i=e.currentTarget)==null?void 0:i.dataset)==null?e==null||(a=e.target)==null?void 0:a.dataset:r)==null?{}:n,`wvHandler`,e);if(typeof c!=`string`||!c)return;let l=o==null?void 0:o[c];if(typeof l!=`function`)return;let u=Ha(e);return l.apply(o,u)}}};return e!=null&&e.computed&&Object.keys(e.computed).length>0&&(n.computed=e.computed),e!=null&&e.inlineMap&&Object.keys(e.inlineMap).length>0&&(n.methods={...n.methods,[ye]:e.inlineMap}),n}function ro(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function io(e){return typeof e!=`object`||!e||h(e)||m(e)||Array.isArray(e)?!0:ro(e)}function ao(e,t,n,r){var i,a,o;let s=!!(r!=null&&r.includeFunctionsInState),c=r==null?void 0:r.functionPropPaths,l=(i=e==null?void 0:e.methods)==null?Object.create(null):i,u=(a=e==null?void 0:e.state)==null?Object.create(null):a,d=(o=e==null?void 0:e.setupState)==null?Object.create(null):o,f=m(u)?b(u):u,p=!1;if(e&&!e.methods)try{e.methods=l}catch(e){}if(e&&!e.state)try{e.state=u}catch(e){}if(e&&!e.setupState)try{e.setupState=d}catch(e){}if(Object.keys(n).forEach(r=>{let i=n[r];if(typeof i==`function`){let t=(...t)=>{var n;return i.apply((n=e==null?void 0:e.proxy)==null?e:n,t)};l[r]=t,u[r]=t,(s||c!=null&&c.has(r))&&(d[r]=t),p=!0}else{if(jt(i)){var a;e==null||(a=e.__wevu_trackSetupReactiveKey)==null||a.call(e,r)}if(u[r]=i,i===t||!io(i))try{Object.defineProperty(f,r,{value:i,configurable:!0,enumerable:!1,writable:!0})}catch(e){}d[r]=i}}),e){var h,g;if(e.methods=(h=e.methods)==null?l:h,e.state=(g=e.state)==null?u:g,p){var _;(_=e.__wevu_touchSetupMethodsVersion)==null||_.call(e)}}}let oo;function so(){let e=E();if(!e)return;let t=e;oo&&t[Ue]!==oo&&(t[Ue]=oo)}function co(e,t){return!!e.__wevu_isPage&&Array.isArray(t==null?void 0:t.pick)&&t.pick.includes(Z)}function lo(e){return Array.isArray(e==null?void 0:e.pick)&&e.pick.includes(Z)}function uo(e){let t=e.properties;return!!(t&&typeof t==`object`&&(Ye in t||et in t))}function fo(e,t){return(t==null?void 0:t.strategy)!==`patch`||!uo(e)?t:{...t,strategy:`diff`}}function po(e){so();let{__typeProps:t,data:n,computed:r,methods:i,setData:a,watch:o,setup:s,props:c,allowFunctionProps:l,...u}=wn(e),d=u[ge],f=Array.isArray(d)?[...new Set(d.filter(e=>typeof e==`string`&&e.length>0))]:[];delete u[ge];let p=fo(u,l===!0?{...a==null?{}:a,includeFunctions:!0,functionPaths:f}:l===!1?a:f.length?{...a==null?{}:a,functionPaths:f}:a),m=new Set(f.filter(e=>!e.includes(`.`))),h=fa({data:n,computed:r,methods:i,setData:p,[hn]:`component`}),g=typeof s==`function`?((e,t)=>{let n=Yr(s,e,t);return n&&t&&ao(t.runtime,t.instance,n,{includeFunctionsInState:l===!0,functionPropPaths:l===!1?void 0:m}),n}):void 0,_=typeof n==`function`?n():n,v=ba(lo(p)?{..._&&typeof _==`object`?_:{},[Z]:co(u,p)?(_==null?void 0:_[Z])||tr():(_==null?void 0:_[Z])||``}:_,r,p),y=Ma(v===void 0?u:{...u,data:v},c),b={data:n,computed:r,methods:i,setData:p,watch:o,setup:g,mpOptions:y};return da(h,i==null?{}:i,o,g,y),{__wevu_runtime:h,__wevu_options:b}}function mo(e){var t;so();let{properties:n,props:r,...i}=e;po(Ma({...i,allowNullPropInput:(t=i.allowNullPropInput)==null||t,__wevu_allowNullPropInput:!0},r,n))}function ho(e){mo(no(e))}oo=ho,so();const go=[`dispose`,`abort`,`cancel`,`stop`,`disconnect`,`destroy`,`close`];function _o(e){if(e){if(typeof e==`function`)return e;for(let t of go){let n=e[t];if(typeof n==`function`)return()=>n.call(e)}}}function vo(){if(!I())throw Error(`useDisposables() 必须在 setup() 的同步阶段调用`);let e=new Set,t=!1,n=n=>{let r=_o(n);if(!r)return()=>{};if(t){try{r()}catch(e){}return()=>{}}return e.add(r),()=>{e.delete(r)}},r=()=>{if(t)return;t=!0;let n=[...e];e.clear();for(let e of n)try{e()}catch(e){}};return se(r),G(r),{add:n,dispose:r,setTimeout:(e,t,...r)=>{let i=setTimeout(e,t,...r);return n(()=>{clearTimeout(i)}),i},setInterval:(e,t,...r)=>{let i=setInterval(e,t,...r);return n(()=>{clearInterval(i)}),i}}}function yo(e,t){let n=e,r=n.createIntersectionObserver;if(typeof r==`function`)return r.call(n,t);if(!z(`globalCreateIntersectionObserver`))return;let i=k(),a=i==null?void 0:i.createIntersectionObserver;if(typeof a==`function`)return A().intersectionObserverScopeByParameter?a.call(i,e,t):a.call(i,t)}function bo(e,t){var n;if(t===!1||typeof e.relativeToViewport!=`function`)return e;let r=t&&typeof t==`object`?t:void 0;return(n=e.relativeToViewport(r))==null?e:n}function xo(e){var t;let n=(t=e.context)==null?I():t;if(!n||!D())throw Error(`useElementIntersectionObserver() 必须在 setup() 的同步阶段调用`);let r=null,a=()=>{if(r){try{r.disconnect()}catch(e){}r=null}},o=()=>{var t,i;a();let o=u(e.selector);if(!(e.enabled==null||u(e.enabled))||!o)return null;let s=yo(n,u((t=e.observerOptions)==null?{}:t));return!s||typeof s.observe!=`function`?null:(r=bo(s,(i=e.relativeToViewport)==null||i),r.observe(o,t=>{var n;return(n=e.onObserve)==null?void 0:n.call(e,t)}),r)};return i(()=>{var t;return[u(e.selector),e.enabled==null||u(e.enabled),u((t=e.observerOptions)==null?{}:t),e.relativeToViewport]},()=>{o()},{deep:!0}),st(o),ut(a),se(a),G(a),{disconnect:a,observe:o,get observer(){return r}}}function So(e,t){let n=e,r=n.createIntersectionObserver;if(typeof r==`function`)return r.call(n,t)}function Co(e,t){if(!z(`globalCreateIntersectionObserver`))return;let n=k(),r=n==null?void 0:n.createIntersectionObserver;if(typeof r==`function`)return A().intersectionObserverScopeByParameter?r.call(n,e,t):r.call(n,t)}function wo(e={}){var t;let n=I();if(!n)throw Error(`useIntersectionObserver() 必须在 setup() 的同步阶段调用`);let r=(t=So(n,e))==null?Co(n,e):t;if(!r||typeof r.disconnect!=`function`)throw Error(`当前运行环境不支持 IntersectionObserver,请检查基础库版本或平台能力`);let i=!1,a=()=>{if(!i){i=!0;try{r.disconnect()}catch(e){}}};return se(a),G(a),r}function To(e){var t,n;return e?(t=(n=e.split(`?`)[0])==null?void 0:n.replace(/^\/+/,``))==null?``:t:``}function Eo(){let e=M(),t=e[e.length-1],n=e.length||1;return{canGoBack:n>1,currentRoute:To(t==null?void 0:t.route),stackLength:n}}function Do(e={}){var t;if(!D())throw Error(`usePageStack() 必须在 setup() 的同步阶段调用`);let n=Eo(),r=f(n.currentRoute),i=f(n.stackLength),a=T(()=>i.value>1),o=()=>{let e=Eo();r.value=e.currentRoute,i.value=e.stackLength};return((t=e.autoRefresh)==null||t)&&(te(o),oe(o)),{canGoBack:a,currentRoute:r,refresh:o,stackLength:i}}function Oo(e={}){var t,n;let r=(t=e.defaultStatusBarHeight)==null?20:t,i=(n=e.defaultNavigationBarHeight)==null?44:n,a=k(),o=typeof(a==null?void 0:a.getSystemInfoSync)==`function`?a.getSystemInfoSync():{},s=Number((o==null?void 0:o.statusBarHeight)||r),c;try{c=typeof(a==null?void 0:a.getMenuButtonBoundingClientRect)==`function`?a.getMenuButtonBoundingClientRect():void 0}catch(e){}let l=Number((c==null?void 0:c.top)||0),u=Number((c==null?void 0:c.height)||0),d=l>s&&u>0?(l-s)*2+u:i;return{navigationBarHeight:d,navigationHeight:s+d,statusBarHeight:s}}function ko(e={}){var t;if(!D())throw Error(`useNavigationBarMetrics() 必须在 setup() 的同步阶段调用`);let n=Oo(e),r=f(n.statusBarHeight),i=f(n.navigationBarHeight),a=T(()=>r.value+i.value),o=()=>{let t=Oo(e);r.value=t.statusBarHeight,i.value=t.navigationBarHeight};return((t=e.autoRefresh)==null||t)&&te(o),{navigationBarHeight:i,navigationHeight:a,refresh:o,statusBarHeight:r}}function Ao(e){return typeof e!=`number`||!Number.isFinite(e)?80:Math.max(0,e)}function jo(e){if(!(typeof e!=`number`||!Number.isFinite(e)))return Math.max(0,e)}function Mo(e,t={}){var n,r;if(!I())throw Error(`usePageScrollThrottle() 必须在 setup() 的同步阶段调用`);if(typeof e!=`function`)throw TypeError(`usePageScrollThrottle() 需要传入回调函数`);let i=Ao(t.interval),a=(n=t.leading)==null||n,o=(r=t.trailing)==null||r,s=jo(t.maxWait),c,l,u=!1,d=0,f,p=()=>{c&&(clearTimeout(c),c=void 0)},m=()=>{l&&(clearTimeout(l),l=void 0)},h=t=>{p(),m(),f=void 0,d=Date.now(),e(t)},g=()=>{let e=f;f=void 0,c=void 0,!(!e||u)&&h(e)},_=()=>{let e=f;l=void 0,!(!e||u)&&h(e)},v=e=>{if(!o||c)return;let t=Math.max(0,i-(e-(d===0?e:d)));c=setTimeout(g,t)},y=e=>{if(typeof s!=`number`||l)return;let t=s-(e-(d===0?e:d));if(t<=0){_();return}l=setTimeout(_,t)};W(e=>{if(u)return;if(i===0){h(e);return}let t=Date.now();if(f=e,a&&(d===0||t-d>=i)){h(e);return}if(typeof s==`number`&&t-(d===0?t:d)>=s){h(e);return}!o&&typeof s!=`number`||(v(t),y(t))});let b=()=>{u||(u=!0,f=void 0,p(),m())};return se(b),G(b),b}function No(e,t={}){ne(async()=>{try{await e()}catch(e){var n;await((n=t.onError)==null?void 0:n.call(t,e))}finally{var r;await((r=t.stopPullDownRefresh)==null?(()=>ot.stopPullDownRefresh()):r)()}})}function Po(e,t){let n=t==null?I():t;if(!n||!D())throw Error(`${e}() 必须在 setup() 的同步阶段调用`);return n}function Fo(e,t,n,r){let i=br(e);return!i||!t?Promise.resolve(null):(r(n?i.selectAll(t):i.select(t)),new Promise(e=>{i.exec(t=>{let n=Array.isArray(t)?t[0]:null;e(n==null?null:n)})}))}function Io(e={}){let t=Po(`useSelectorQuery`,e.context);return()=>br(t)}function Lo(e={}){var t;let n=Po(`useBoundingClientRect`,e.context),r=(t=e.all)!=null&&t;return e=>Fo(n,e,r,e=>e.boundingClientRect())}function Ro(e){var t;let n=Po(`useSelectorFields`,e.context),r=(t=e.all)!=null&&t;return t=>Fo(n,t,r,t=>t.fields(e.fields))}function zo(e={}){var t;let n=Po(`useScrollOffset`,e.context),r=(t=e.all)!=null&&t;return e=>Fo(n,e,r,e=>e.scrollOffset())}function Bo(e){let t=e,n=t.setUpdatePerformanceListener;if(typeof n==`function`)return e=>{n.call(t,e)}}function Vo(e){let t=I();if(!t)throw Error(`useUpdatePerformanceListener() 必须在 setup() 的同步阶段调用`);if(typeof e!=`function`)throw TypeError(`useUpdatePerformanceListener() 需要传入监听函数`);let n=Bo(t);if(!n)throw Error(`当前实例不支持 setUpdatePerformanceListener,请检查基础库版本或组件上下文`);n(e);let r=!1,i=()=>{if(!r){r=!0;try{n(void 0)}catch(e){}}};return se(i),G(i),i}function Ho(){let e=I();if(e!=null&&e[be]&&e[Ve])return e[Ve];throw Error(`defineAppSetup() / use() 只能在 app setup 上下文中调用`)}function Uo(e){return e(Ho())}function Wo(e,...t){return Ho().use(e,...t)}const Go=Object.freeze(Object.create(null));function Ko(){var e;let t=D();if(!t)throw Error(`useAttrs() 必须在 setup() 的同步阶段调用`);return(e=t.attrs)==null?{}:e}function qo(){var e;let t=D();if(!t)throw Error(`useSlots() 必须在 setup() 的同步阶段调用`);return(e=t.slots)==null?Go:e}function Jo(){let e=D();if(!(e!=null&&e.instance))throw Error(`useNativeInstance() 必须在 setup() 的同步阶段调用`);return e.instance}const Yo=Object.freeze(Object.create(null));function Xo(e,t){let n=t===`modelValue`?`modelModifiers`:`${t}Modifiers`,r=e==null?void 0:e[n];return!r||typeof r!=`object`?Yo:r}function Zo(e,t){let n=e;try{Object.defineProperty(n,Symbol.iterator,{configurable:!0,value:()=>{let e=0;return{next:()=>e===0?(e+=1,{value:n,done:!1}):e===1?(e+=1,{value:t(),done:!1}):{value:void 0,done:!0}}}})}catch(e){}return n}function Qo(e,t,n={}){let r=D();if(!r)throw Error(`useModel() 必须在 setup() 的同步阶段调用`);let i=r.emit,a=`update:${t}`,o=()=>Xo(e,t);return Zo(y({get:()=>{let r=e==null?void 0:e[t];return n.get?n.get(r,o()):r},set:e=>{let t=n.set?n.set(e,o()):e;i==null||i(a,t)}}),o)}function $o(e){let t=I();if(!(t!=null&&t.__wevu)||typeof t.__wevu.bindModel!=`function`)throw Error(`useBindModel() 必须在 setup() 的同步阶段调用`);let n=t.__wevu.bindModel.bind(t.__wevu),r=((t,r)=>{if(!e)return n(t,r);let i={...e,...r};return n(t,i)});return r.model=(e,t)=>r(e).model(t),r.value=(t,n)=>{var i;let a={...e,...n},o=(i=a==null?void 0:a.valueProp)==null?`value`:i;return r.model(t,n)[o]},r.on=(t,n)=>{var i;let a={...e,...n},o=`on${yt((i=a==null?void 0:a.event)==null?`input`:i)}`;return r.model(t,n)[o]},r}function es(){let e=$o({event:`change`});return function(t,n){return e.model(t,n)}}function ts(e,t){return e==null?t:t==null?e:Array.isArray(e)&&Array.isArray(t)?[...new Set([...e,...t])]:typeof e==`object`&&typeof t==`object`?{...e,...t}:t}function ns(e){let t=e[it];if(t)return t;let n=new Map;try{Object.defineProperty(e,it,{value:n,configurable:!0,enumerable:!1,writable:!1})}catch(t){e[it]=n}return n}function rs(e){let n=I();if(!n)throw Error(`useTemplateRef() 必须在 setup() 的同步阶段调用`);let r=typeof e==`string`?e.trim():``;if(!r)throw Error(`useTemplateRef() 需要传入有效的模板 ref 名称`);let i=ns(n),a=i.get(r);if(a)return a;let o=t(null);return i.set(r,o),o}export{vt as $,ta as A,bi as B,xo as C,po as D,ho as E,ca as F,Qn as G,Ei as H,oa as I,Yn as J,Xn as K,la as L,ra as M,ia as N,fa as O,na as P,$ as Q,aa as R,wo as S,mo as T,Yr as U,Ti as V,$n as W,xn as X,Sn as Y,Vt as Z,Mo as _,Qo as a,ht as at,ko as b,qo as c,gt as ct,Vo as d,_t as et,Lo as f,No as g,Io as h,es as i,ft as it,sa as j,da as k,Uo as l,ut as lt,Ro as m,ts as n,dt as nt,Ko as o,pt as ot,zo as p,Zn as q,$o as r,lt as rt,Jo as s,st,rs as t,mt as tt,Wo as u,ct as ut,Eo as v,vo as w,Do as x,Oo as y,Mi as z};
|
package/dist/vue-demi.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-CenpyGzJ.mjs";import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./watch-Bbd-gmEg.mjs";import{A as p,F as m,I as h,L as g,M as _,N as v,P as y,R as b,a as x,c as S,d as C,i as w,j as T,k as E,l as D,n as O,o as k,s as A,t as j,u as M,v as N}from"./ref-D37CknuD.mjs";import{i as P,r as F,t as I}from"./computed-Xoi9XEUx.mjs";import{S as L,b as R,c as z,d as B,n as V,r as H,s as U,u as W,x as G,y as K}from"./base-BxKbbKVO.mjs";import{n as q,t as J}from"./toRefs-CoytPyo0.mjs";import{$ as Y,B as X,F as Z,G as Q,H as $,I as ee,J as te,K as ne,L as re,
|
|
1
|
+
import"./rolldown-runtime-CenpyGzJ.mjs";import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./watch-Bbd-gmEg.mjs";import{A as p,F as m,I as h,L as g,M as _,N as v,P as y,R as b,a as x,c as S,d as C,i as w,j as T,k as E,l as D,n as O,o as k,s as A,t as j,u as M,v as N}from"./ref-D37CknuD.mjs";import{i as P,r as F,t as I}from"./computed-Xoi9XEUx.mjs";import{S as L,b as R,c as z,d as B,n as V,r as H,s as U,u as W,x as G,y as K}from"./base-BxKbbKVO.mjs";import{n as q,t as J}from"./toRefs-CoytPyo0.mjs";import{$ as Y,B as X,F as Z,G as Q,H as $,I as ee,J as te,K as ne,L as re,P as ie,Q as ae,R as oe,U as se,V as ce,W as le,X as ue,Y as de,Z as fe,_ as pe,et as me,g as he,h as ge,it as _e,n as ve,nt as ye,q as be,rt as xe,t as Se,tt as Ce,v as we,y as Te,z as Ee}from"./router-D4W4lEXM.mjs";import{$ as De,A as Oe,B as ke,C as Ae,D as je,E as Me,F as Ne,G as Pe,H as Fe,I as Ie,J as Le,K as Re,L as ze,M as Be,N as Ve,O as He,P as Ue,Q as We,R as Ge,S as Ke,T as qe,U as Je,V as Ye,W as Xe,X as Ze,Y as Qe,Z as $e,_ as et,a as tt,at as nt,b as rt,c as it,ct as at,d as ot,et as st,f as ct,g as lt,h as ut,i as dt,it as ft,j as pt,k as mt,l as ht,lt as gt,m as _t,n as vt,nt as yt,o as bt,ot as xt,p as St,q as Ct,r as wt,rt as Tt,s as Et,st as Dt,t as Ot,tt as kt,u as At,ut as jt,v as Mt,w as Nt,x as Pt,y as Ft,z as It}from"./templateRef-DOTHWzZ5.mjs";import{n as Lt,r as Rt,t as zt}from"./template-CNzlwH-E.mjs";import{n as Bt,r as Vt,t as Ht}from"./store-eHrHBQiv.mjs";import"./index.mjs";export*from"@wevu/web-apis";const Ut=!1,Wt=!0,Gt=void 0;function Kt(){}export{Gt as Vue2,E as addMutationRecorder,T as batch,V as callHookList,H as callHookReturn,st as callUpdateHooks,I as computed,He as createApp,Vt as createStore,qe as createWevuComponent,Me as createWevuScopedSlotComponent,j as customRef,ht as defineAppSetup,je as defineComponent,Bt as defineStore,_ as effect,v as effectScope,y as endBatch,U as getCurrentInstance,Mt as getCurrentPageStackSnapshot,m as getCurrentScope,z as getCurrentSetupContext,e as getDeepWatchStrategy,Ft as getNavigationBarMetrics,A as getReactiveVersion,ge as hasInjectionContext,he as inject,pe as injectGlobal,Kt as install,$e as isNoSetData,K as isProxy,S as isRaw,D as isReactive,R as isReadonly,O as isRef,n as isShallowReactive,t as isShallowRef,Ut as isVue2,Wt as isVue3,We as markNoSetData,M as markRaw,vt as mergeModels,ke as mountRuntimeInstance,c as nextTick,zt as normalizeClass,Lt as normalizeStyle,kt as onActivated,Z as onAddToFavorites,ee as onAttached,yt as onBeforeMount,Tt as onBeforeUnmount,ft as onBeforeUpdate,nt as onDeactivated,re as onDetached,oe as onError,xt as onErrorCaptured,Ee as onHide,X as onLaunch,ce as onLoad,$ as onMemoryWarning,Dt as onMounted,se as onMoved,le as onPageNotFound,Q as onPageScroll,ne as onPullDownRefresh,be as onReachBottom,te as onReady,de as onResize,ue as onRouteDone,fe as onSaveExitState,h as onScopeDispose,at as onServerPrefetch,ae as onShareAppMessage,Y as onShareTimeline,me as onShow,Ce as onTabItemTap,ye as onThemeChange,xe as onUnhandledRejection,_e as onUnload,gt as onUnmounted,jt as onUpdated,F as prelinkReactiveTree,we as provide,Te as provideGlobal,C as reactive,G as readonly,w as ref,It as registerApp,mt as registerComponent,Oe as registerPageLayoutBridge,pt as registerRuntimeLayoutHosts,p as removeMutationRecorder,Qe as resetWevuDefaults,Be as resolveLayoutBridge,Ve as resolveLayoutHost,Rt as resolvePropValue,Xe as resolveRuntimePageLayoutName,Je as runSetupFunction,W as setCurrentInstance,B as setCurrentSetupContext,s as setDeepWatchStrategy,ie as setGlobalProvidedValue,Pe as setPageLayout,Ye as setRuntimeSetDataVisibility,Ze as setWevuDefaults,r as shallowReactive,L as shallowReadonly,a as shallowRef,g as startBatch,b as stop,Ht as storeToRefs,Re as syncRuntimePageLayoutState,Ct as syncRuntimePageLayoutStateFromRuntime,Fe as teardownRuntimeInstance,N as toRaw,J as toRef,q as toRefs,x as toValue,P as touchReactive,u as traverse,f as triggerRef,k as unref,Ue as unregisterPageLayoutBridge,Ne as unregisterRuntimeLayoutHosts,At as use,lt as useAsyncPullDownRefresh,bt as useAttrs,wt as useBindModel,ct as useBoundingClientRect,dt as useChangeModel,Nt as useDisposables,Ae as useElementIntersectionObserver,Ke as useIntersectionObserver,Ie as useLayoutBridge,ze as useLayoutHosts,tt as useModel,Et as useNativeInstance,Se as useNativePageRouter,ve as useNativeRouter,rt as useNavigationBarMetrics,Le as usePageLayout,et as usePageScrollThrottle,Pt as usePageStack,St as useScrollOffset,_t as useSelectorFields,ut as useSelectorQuery,it as useSlots,Ot as useTemplateRef,ot as useUpdatePerformanceListener,De as version,Ge as waitForLayoutHost,d as watch,o as watchEffect,l as watchPostEffect,i as watchSyncEffect};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wevu",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.18.
|
|
4
|
+
"version": "6.18.7",
|
|
5
5
|
"description": "Vue 3 风格的小程序运行时,包含响应式、diff+setData 与轻量状态管理",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"@weapp-core/constants": "0.1.14",
|
|
230
230
|
"@weapp-core/shared": "3.0.6",
|
|
231
231
|
"@wevu/api": "0.2.12",
|
|
232
|
-
"@wevu/compiler": "6.18.
|
|
232
|
+
"@wevu/compiler": "6.18.7",
|
|
233
233
|
"@wevu/web-apis": "1.2.28"
|
|
234
234
|
},
|
|
235
235
|
"scripts": {
|