(function(u,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@vue/reactivity"),require("react")):typeof define=="function"&&define.amd?define(["exports","@vue/reactivity","react"],c):(u=typeof globalThis<"u"?globalThis:u||self,c(u.veact={},u.VueReactivity,u.React))})(this,function(u,c,o){"use strict";/*! * veact v1.0.0 * https://github.com/veactjs/veact * * Includes @vue/reactivity * https://github.com/vuejs/core/tree/main/packages/reactivity * * (c) 2021-present Surmon and Veact contributors. * Released under the MIT License. * * Date: 2024-09-05T14:34:40.987Z */function R(e){o.useEffect(()=>{e()},[])}function r(e){o.useEffect(()=>()=>{e()},[])}function w(e){const n=o.useRef(!1);o.useEffect(()=>{n.current?e():n.current=!0})}const S=e=>e+1,f=()=>o.useReducer(S,0)[1],l="veact",d={...console,log(...e){console.log(`[${l}]`,...e)},warn(...e){console.warn(`[${l}]`,...e)},error(...e){console.error(`[${l}]`,...e)}};function h(e,n,t={}){return c.watch(e,n,{...t,onWarn:d.warn,scheduler:a=>a()})}const s=(e,n,t={})=>{const[a]=o.useState(()=>h(e,n,t));return r(()=>a.stop()),a};function p(e){const[n]=o.useState(()=>c.ref(e)),t=f();return s(n,t,{deep:!0}),n}function m(e){const[n]=o.useState(()=>c.shallowRef(e)),t=f();return s(n,t),n}function U(e){const[n]=o.useState(()=>c.customRef(e)),t=f();return s(n,t),n}function b(e){const[n]=o.useState(()=>c.reactive(e)),t=f();return s(n,t),n}function E(e){const[n]=o.useState(()=>c.shallowReactive(e)),t=f();return s(n,t),n}function j(e){const[n]=o.useState(()=>c.readonly(e)),t=f();return s(n,t),n}function v(e){const[n]=o.useState(()=>c.shallowReadonly(e)),t=f();return s(n,t),n}function O(e,n){const[t]=o.useState(()=>c.computed(e,n)),a=f();return s(t,a),t}function i(e,n={}){return c.watch(e,null,{...n,onWarn:d.warn,scheduler:t=>t()})}const y=(e,n)=>{const[t]=o.useState(()=>i(e,n));return r(()=>t.stop()),t};function W(...e){const n=o.useRef(!1),[t]=o.useState(()=>c.effectScope(...e)),a=o.useRef(t.run),C=o.useCallback(M=>{if(!n.current)return n.current=!0,a.current.bind(t)(M)},[]);return t.run=C,t}function g(e){const n=f();return s(()=>e(),n,{deep:!0}),e()}Object.defineProperty(u,"baseWatch",{enumerable:!0,get:()=>c.watch}),u.onBeforeUnmount=r,u.onMounted=R,u.onUpdated=w,u.useComputed=O,u.useCustomRef=U,u.useEffectScope=W,u.useReactive=b,u.useReactivity=g,u.useReadonly=j,u.useRef=p,u.useShallowReactive=E,u.useShallowReadonly=v,u.useShallowRef=m,u.useWatch=s,u.useWatchEffect=y,u.watch=h,u.watchEffect=i,Object.keys(c).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(u,e)&&Object.defineProperty(u,e,{enumerable:!0,get:()=>c[e]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});