index.cjs 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904
  1. 'use strict';
  2. var vueDemi = require('vue-demi');
  3. var __defProp$b = Object.defineProperty;
  4. var __defProps$8 = Object.defineProperties;
  5. var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
  6. var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
  7. var __hasOwnProp$d = Object.prototype.hasOwnProperty;
  8. var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
  9. var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  10. var __spreadValues$b = (a, b) => {
  11. for (var prop in b || (b = {}))
  12. if (__hasOwnProp$d.call(b, prop))
  13. __defNormalProp$b(a, prop, b[prop]);
  14. if (__getOwnPropSymbols$d)
  15. for (var prop of __getOwnPropSymbols$d(b)) {
  16. if (__propIsEnum$d.call(b, prop))
  17. __defNormalProp$b(a, prop, b[prop]);
  18. }
  19. return a;
  20. };
  21. var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
  22. function computedEager(fn, options) {
  23. var _a;
  24. const result = vueDemi.shallowRef();
  25. vueDemi.watchEffect(() => {
  26. result.value = fn();
  27. }, __spreadProps$8(__spreadValues$b({}, options), {
  28. flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
  29. }));
  30. return vueDemi.readonly(result);
  31. }
  32. function computedWithControl(source, fn) {
  33. let v = void 0;
  34. let track;
  35. let trigger;
  36. const dirty = vueDemi.ref(true);
  37. const update = () => {
  38. dirty.value = true;
  39. trigger();
  40. };
  41. vueDemi.watch(source, update, { flush: "sync" });
  42. const get = typeof fn === "function" ? fn : fn.get;
  43. const set = typeof fn === "function" ? void 0 : fn.set;
  44. const result = vueDemi.customRef((_track, _trigger) => {
  45. track = _track;
  46. trigger = _trigger;
  47. return {
  48. get() {
  49. if (dirty.value) {
  50. v = get();
  51. dirty.value = false;
  52. }
  53. track();
  54. return v;
  55. },
  56. set(v2) {
  57. set == null ? void 0 : set(v2);
  58. }
  59. };
  60. });
  61. if (Object.isExtensible(result))
  62. result.trigger = update;
  63. return result;
  64. }
  65. function tryOnScopeDispose(fn) {
  66. if (vueDemi.getCurrentScope()) {
  67. vueDemi.onScopeDispose(fn);
  68. return true;
  69. }
  70. return false;
  71. }
  72. function createEventHook() {
  73. const fns = /* @__PURE__ */ new Set();
  74. const off = (fn) => {
  75. fns.delete(fn);
  76. };
  77. const on = (fn) => {
  78. fns.add(fn);
  79. const offFn = () => off(fn);
  80. tryOnScopeDispose(offFn);
  81. return {
  82. off: offFn
  83. };
  84. };
  85. const trigger = (param) => {
  86. return Promise.all(Array.from(fns).map((fn) => fn(param)));
  87. };
  88. return {
  89. on,
  90. off,
  91. trigger
  92. };
  93. }
  94. function createGlobalState(stateFactory) {
  95. let initialized = false;
  96. let state;
  97. const scope = vueDemi.effectScope(true);
  98. return (...args) => {
  99. if (!initialized) {
  100. state = scope.run(() => stateFactory(...args));
  101. initialized = true;
  102. }
  103. return state;
  104. };
  105. }
  106. function createInjectionState(composable) {
  107. const key = Symbol("InjectionState");
  108. const useProvidingState = (...args) => {
  109. const state = composable(...args);
  110. vueDemi.provide(key, state);
  111. return state;
  112. };
  113. const useInjectedState = () => vueDemi.inject(key);
  114. return [useProvidingState, useInjectedState];
  115. }
  116. function createSharedComposable(composable) {
  117. let subscribers = 0;
  118. let state;
  119. let scope;
  120. const dispose = () => {
  121. subscribers -= 1;
  122. if (scope && subscribers <= 0) {
  123. scope.stop();
  124. state = void 0;
  125. scope = void 0;
  126. }
  127. };
  128. return (...args) => {
  129. subscribers += 1;
  130. if (!state) {
  131. scope = vueDemi.effectScope(true);
  132. state = scope.run(() => composable(...args));
  133. }
  134. tryOnScopeDispose(dispose);
  135. return state;
  136. };
  137. }
  138. function extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {
  139. if (!vueDemi.isVue3 && !vueDemi.version.startsWith("2.7.")) {
  140. if (process.env.NODE_ENV !== "production")
  141. throw new Error("[VueUse] extendRef only works in Vue 2.7 or above.");
  142. return;
  143. }
  144. for (const [key, value] of Object.entries(extend)) {
  145. if (key === "value")
  146. continue;
  147. if (vueDemi.isRef(value) && unwrap) {
  148. Object.defineProperty(ref, key, {
  149. get() {
  150. return value.value;
  151. },
  152. set(v) {
  153. value.value = v;
  154. },
  155. enumerable
  156. });
  157. } else {
  158. Object.defineProperty(ref, key, { value, enumerable });
  159. }
  160. }
  161. return ref;
  162. }
  163. function get(obj, key) {
  164. if (key == null)
  165. return vueDemi.unref(obj);
  166. return vueDemi.unref(obj)[key];
  167. }
  168. function isDefined(v) {
  169. return vueDemi.unref(v) != null;
  170. }
  171. var __defProp$a = Object.defineProperty;
  172. var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
  173. var __hasOwnProp$c = Object.prototype.hasOwnProperty;
  174. var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
  175. var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  176. var __spreadValues$a = (a, b) => {
  177. for (var prop in b || (b = {}))
  178. if (__hasOwnProp$c.call(b, prop))
  179. __defNormalProp$a(a, prop, b[prop]);
  180. if (__getOwnPropSymbols$c)
  181. for (var prop of __getOwnPropSymbols$c(b)) {
  182. if (__propIsEnum$c.call(b, prop))
  183. __defNormalProp$a(a, prop, b[prop]);
  184. }
  185. return a;
  186. };
  187. function makeDestructurable(obj, arr) {
  188. if (typeof Symbol !== "undefined") {
  189. const clone = __spreadValues$a({}, obj);
  190. Object.defineProperty(clone, Symbol.iterator, {
  191. enumerable: false,
  192. value() {
  193. let index = 0;
  194. return {
  195. next: () => ({
  196. value: arr[index++],
  197. done: index > arr.length
  198. })
  199. };
  200. }
  201. });
  202. return clone;
  203. } else {
  204. return Object.assign([...arr], obj);
  205. }
  206. }
  207. function toValue(r) {
  208. return typeof r === "function" ? r() : vueDemi.unref(r);
  209. }
  210. const resolveUnref = toValue;
  211. function reactify(fn, options) {
  212. const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? vueDemi.unref : toValue;
  213. return function(...args) {
  214. return vueDemi.computed(() => fn.apply(this, args.map((i) => unrefFn(i))));
  215. };
  216. }
  217. function reactifyObject(obj, optionsOrKeys = {}) {
  218. let keys = [];
  219. let options;
  220. if (Array.isArray(optionsOrKeys)) {
  221. keys = optionsOrKeys;
  222. } else {
  223. options = optionsOrKeys;
  224. const { includeOwnProperties = true } = optionsOrKeys;
  225. keys.push(...Object.keys(obj));
  226. if (includeOwnProperties)
  227. keys.push(...Object.getOwnPropertyNames(obj));
  228. }
  229. return Object.fromEntries(
  230. keys.map((key) => {
  231. const value = obj[key];
  232. return [
  233. key,
  234. typeof value === "function" ? reactify(value.bind(obj), options) : value
  235. ];
  236. })
  237. );
  238. }
  239. function toReactive(objectRef) {
  240. if (!vueDemi.isRef(objectRef))
  241. return vueDemi.reactive(objectRef);
  242. const proxy = new Proxy({}, {
  243. get(_, p, receiver) {
  244. return vueDemi.unref(Reflect.get(objectRef.value, p, receiver));
  245. },
  246. set(_, p, value) {
  247. if (vueDemi.isRef(objectRef.value[p]) && !vueDemi.isRef(value))
  248. objectRef.value[p].value = value;
  249. else
  250. objectRef.value[p] = value;
  251. return true;
  252. },
  253. deleteProperty(_, p) {
  254. return Reflect.deleteProperty(objectRef.value, p);
  255. },
  256. has(_, p) {
  257. return Reflect.has(objectRef.value, p);
  258. },
  259. ownKeys() {
  260. return Object.keys(objectRef.value);
  261. },
  262. getOwnPropertyDescriptor() {
  263. return {
  264. enumerable: true,
  265. configurable: true
  266. };
  267. }
  268. });
  269. return vueDemi.reactive(proxy);
  270. }
  271. function reactiveComputed(fn) {
  272. return toReactive(vueDemi.computed(fn));
  273. }
  274. function reactiveOmit(obj, ...keys) {
  275. const flatKeys = keys.flat();
  276. const predicate = flatKeys[0];
  277. return reactiveComputed(
  278. () => typeof predicate === "function" ? Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter((e) => !flatKeys.includes(e[0])))
  279. );
  280. }
  281. const isClient = typeof window !== "undefined";
  282. const isDef = (val) => typeof val !== "undefined";
  283. const notNullish = (val) => val != null;
  284. const assert = (condition, ...infos) => {
  285. if (!condition)
  286. console.warn(...infos);
  287. };
  288. const toString = Object.prototype.toString;
  289. const isObject = (val) => toString.call(val) === "[object Object]";
  290. const now = () => Date.now();
  291. const timestamp = () => +Date.now();
  292. const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
  293. const noop = () => {
  294. };
  295. const rand = (min, max) => {
  296. min = Math.ceil(min);
  297. max = Math.floor(max);
  298. return Math.floor(Math.random() * (max - min + 1)) + min;
  299. };
  300. const hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
  301. const isIOS = /* @__PURE__ */ getIsIOS();
  302. function getIsIOS() {
  303. var _a;
  304. return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /* @__PURE__ */ /iP(ad|hone|od)/.test(window.navigator.userAgent);
  305. }
  306. function createFilterWrapper(filter, fn) {
  307. function wrapper(...args) {
  308. return new Promise((resolve, reject) => {
  309. Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve).catch(reject);
  310. });
  311. }
  312. return wrapper;
  313. }
  314. const bypassFilter = (invoke) => {
  315. return invoke();
  316. };
  317. function debounceFilter(ms, options = {}) {
  318. let timer;
  319. let maxTimer;
  320. let lastRejector = noop;
  321. const _clearTimeout = (timer2) => {
  322. clearTimeout(timer2);
  323. lastRejector();
  324. lastRejector = noop;
  325. };
  326. const filter = (invoke) => {
  327. const duration = toValue(ms);
  328. const maxDuration = toValue(options.maxWait);
  329. if (timer)
  330. _clearTimeout(timer);
  331. if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
  332. if (maxTimer) {
  333. _clearTimeout(maxTimer);
  334. maxTimer = null;
  335. }
  336. return Promise.resolve(invoke());
  337. }
  338. return new Promise((resolve, reject) => {
  339. lastRejector = options.rejectOnCancel ? reject : resolve;
  340. if (maxDuration && !maxTimer) {
  341. maxTimer = setTimeout(() => {
  342. if (timer)
  343. _clearTimeout(timer);
  344. maxTimer = null;
  345. resolve(invoke());
  346. }, maxDuration);
  347. }
  348. timer = setTimeout(() => {
  349. if (maxTimer)
  350. _clearTimeout(maxTimer);
  351. maxTimer = null;
  352. resolve(invoke());
  353. }, duration);
  354. });
  355. };
  356. return filter;
  357. }
  358. function throttleFilter(ms, trailing = true, leading = true, rejectOnCancel = false) {
  359. let lastExec = 0;
  360. let timer;
  361. let isLeading = true;
  362. let lastRejector = noop;
  363. let lastValue;
  364. const clear = () => {
  365. if (timer) {
  366. clearTimeout(timer);
  367. timer = void 0;
  368. lastRejector();
  369. lastRejector = noop;
  370. }
  371. };
  372. const filter = (_invoke) => {
  373. const duration = toValue(ms);
  374. const elapsed = Date.now() - lastExec;
  375. const invoke = () => {
  376. return lastValue = _invoke();
  377. };
  378. clear();
  379. if (duration <= 0) {
  380. lastExec = Date.now();
  381. return invoke();
  382. }
  383. if (elapsed > duration && (leading || !isLeading)) {
  384. lastExec = Date.now();
  385. invoke();
  386. } else if (trailing) {
  387. lastValue = new Promise((resolve, reject) => {
  388. lastRejector = rejectOnCancel ? reject : resolve;
  389. timer = setTimeout(() => {
  390. lastExec = Date.now();
  391. isLeading = true;
  392. resolve(invoke());
  393. clear();
  394. }, Math.max(0, duration - elapsed));
  395. });
  396. }
  397. if (!leading && !timer)
  398. timer = setTimeout(() => isLeading = true, duration);
  399. isLeading = false;
  400. return lastValue;
  401. };
  402. return filter;
  403. }
  404. function pausableFilter(extendFilter = bypassFilter) {
  405. const isActive = vueDemi.ref(true);
  406. function pause() {
  407. isActive.value = false;
  408. }
  409. function resume() {
  410. isActive.value = true;
  411. }
  412. const eventFilter = (...args) => {
  413. if (isActive.value)
  414. extendFilter(...args);
  415. };
  416. return { isActive: vueDemi.readonly(isActive), pause, resume, eventFilter };
  417. }
  418. const directiveHooks = {
  419. mounted: vueDemi.isVue3 ? "mounted" : "inserted",
  420. updated: vueDemi.isVue3 ? "updated" : "componentUpdated",
  421. unmounted: vueDemi.isVue3 ? "unmounted" : "unbind"
  422. };
  423. function promiseTimeout(ms, throwOnTimeout = false, reason = "Timeout") {
  424. return new Promise((resolve, reject) => {
  425. if (throwOnTimeout)
  426. setTimeout(() => reject(reason), ms);
  427. else
  428. setTimeout(resolve, ms);
  429. });
  430. }
  431. function identity(arg) {
  432. return arg;
  433. }
  434. function createSingletonPromise(fn) {
  435. let _promise;
  436. function wrapper() {
  437. if (!_promise)
  438. _promise = fn();
  439. return _promise;
  440. }
  441. wrapper.reset = async () => {
  442. const _prev = _promise;
  443. _promise = void 0;
  444. if (_prev)
  445. await _prev;
  446. };
  447. return wrapper;
  448. }
  449. function invoke(fn) {
  450. return fn();
  451. }
  452. function containsProp(obj, ...props) {
  453. return props.some((k) => k in obj);
  454. }
  455. function increaseWithUnit(target, delta) {
  456. var _a;
  457. if (typeof target === "number")
  458. return target + delta;
  459. const value = ((_a = target.match(/^-?[0-9]+\.?[0-9]*/)) == null ? void 0 : _a[0]) || "";
  460. const unit = target.slice(value.length);
  461. const result = parseFloat(value) + delta;
  462. if (Number.isNaN(result))
  463. return target;
  464. return result + unit;
  465. }
  466. function objectPick(obj, keys, omitUndefined = false) {
  467. return keys.reduce((n, k) => {
  468. if (k in obj) {
  469. if (!omitUndefined || obj[k] !== void 0)
  470. n[k] = obj[k];
  471. }
  472. return n;
  473. }, {});
  474. }
  475. function objectOmit(obj, keys, omitUndefined = false) {
  476. return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {
  477. return (!omitUndefined || value !== void 0) && !keys.includes(key);
  478. }));
  479. }
  480. function objectEntries(obj) {
  481. return Object.entries(obj);
  482. }
  483. function toRef(...args) {
  484. if (args.length !== 1)
  485. return vueDemi.toRef(...args);
  486. const r = args[0];
  487. return typeof r === "function" ? vueDemi.readonly(vueDemi.customRef(() => ({ get: r, set: noop }))) : vueDemi.ref(r);
  488. }
  489. const resolveRef = toRef;
  490. function reactivePick(obj, ...keys) {
  491. const flatKeys = keys.flat();
  492. const predicate = flatKeys[0];
  493. return reactiveComputed(() => typeof predicate === "function" ? Object.fromEntries(Object.entries(vueDemi.toRefs(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));
  494. }
  495. function refAutoReset(defaultValue, afterMs = 1e4) {
  496. return vueDemi.customRef((track, trigger) => {
  497. let value = defaultValue;
  498. let timer;
  499. const resetAfter = () => setTimeout(() => {
  500. value = defaultValue;
  501. trigger();
  502. }, toValue(afterMs));
  503. tryOnScopeDispose(() => {
  504. clearTimeout(timer);
  505. });
  506. return {
  507. get() {
  508. track();
  509. return value;
  510. },
  511. set(newValue) {
  512. value = newValue;
  513. trigger();
  514. clearTimeout(timer);
  515. timer = resetAfter();
  516. }
  517. };
  518. });
  519. }
  520. function useDebounceFn(fn, ms = 200, options = {}) {
  521. return createFilterWrapper(
  522. debounceFilter(ms, options),
  523. fn
  524. );
  525. }
  526. function refDebounced(value, ms = 200, options = {}) {
  527. const debounced = vueDemi.ref(value.value);
  528. const updater = useDebounceFn(() => {
  529. debounced.value = value.value;
  530. }, ms, options);
  531. vueDemi.watch(value, () => updater());
  532. return debounced;
  533. }
  534. function refDefault(source, defaultValue) {
  535. return vueDemi.computed({
  536. get() {
  537. var _a;
  538. return (_a = source.value) != null ? _a : defaultValue;
  539. },
  540. set(value) {
  541. source.value = value;
  542. }
  543. });
  544. }
  545. function useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {
  546. return createFilterWrapper(
  547. throttleFilter(ms, trailing, leading, rejectOnCancel),
  548. fn
  549. );
  550. }
  551. function refThrottled(value, delay = 200, trailing = true, leading = true) {
  552. if (delay <= 0)
  553. return value;
  554. const throttled = vueDemi.ref(value.value);
  555. const updater = useThrottleFn(() => {
  556. throttled.value = value.value;
  557. }, delay, trailing, leading);
  558. vueDemi.watch(value, () => updater());
  559. return throttled;
  560. }
  561. function refWithControl(initial, options = {}) {
  562. let source = initial;
  563. let track;
  564. let trigger;
  565. const ref = vueDemi.customRef((_track, _trigger) => {
  566. track = _track;
  567. trigger = _trigger;
  568. return {
  569. get() {
  570. return get();
  571. },
  572. set(v) {
  573. set(v);
  574. }
  575. };
  576. });
  577. function get(tracking = true) {
  578. if (tracking)
  579. track();
  580. return source;
  581. }
  582. function set(value, triggering = true) {
  583. var _a, _b;
  584. if (value === source)
  585. return;
  586. const old = source;
  587. if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
  588. return;
  589. source = value;
  590. (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
  591. if (triggering)
  592. trigger();
  593. }
  594. const untrackedGet = () => get(false);
  595. const silentSet = (v) => set(v, false);
  596. const peek = () => get(false);
  597. const lay = (v) => set(v, false);
  598. return extendRef(
  599. ref,
  600. {
  601. get,
  602. set,
  603. untrackedGet,
  604. silentSet,
  605. peek,
  606. lay
  607. },
  608. { enumerable: true }
  609. );
  610. }
  611. const controlledRef = refWithControl;
  612. function set(...args) {
  613. if (args.length === 2) {
  614. const [ref, value] = args;
  615. ref.value = value;
  616. }
  617. if (args.length === 3) {
  618. if (vueDemi.isVue2) {
  619. vueDemi.set(...args);
  620. } else {
  621. const [target, key, value] = args;
  622. target[key] = value;
  623. }
  624. }
  625. }
  626. function syncRef(left, right, options = {}) {
  627. var _a, _b;
  628. const {
  629. flush = "sync",
  630. deep = false,
  631. immediate = true,
  632. direction = "both",
  633. transform = {}
  634. } = options;
  635. let watchLeft;
  636. let watchRight;
  637. const transformLTR = (_a = transform.ltr) != null ? _a : (v) => v;
  638. const transformRTL = (_b = transform.rtl) != null ? _b : (v) => v;
  639. if (direction === "both" || direction === "ltr") {
  640. watchLeft = vueDemi.watch(
  641. left,
  642. (newValue) => right.value = transformLTR(newValue),
  643. { flush, deep, immediate }
  644. );
  645. }
  646. if (direction === "both" || direction === "rtl") {
  647. watchRight = vueDemi.watch(
  648. right,
  649. (newValue) => left.value = transformRTL(newValue),
  650. { flush, deep, immediate }
  651. );
  652. }
  653. return () => {
  654. watchLeft == null ? void 0 : watchLeft();
  655. watchRight == null ? void 0 : watchRight();
  656. };
  657. }
  658. function syncRefs(source, targets, options = {}) {
  659. const {
  660. flush = "sync",
  661. deep = false,
  662. immediate = true
  663. } = options;
  664. if (!Array.isArray(targets))
  665. targets = [targets];
  666. return vueDemi.watch(
  667. source,
  668. (newValue) => targets.forEach((target) => target.value = newValue),
  669. { flush, deep, immediate }
  670. );
  671. }
  672. var __defProp$9 = Object.defineProperty;
  673. var __defProps$7 = Object.defineProperties;
  674. var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
  675. var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
  676. var __hasOwnProp$b = Object.prototype.hasOwnProperty;
  677. var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
  678. var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  679. var __spreadValues$9 = (a, b) => {
  680. for (var prop in b || (b = {}))
  681. if (__hasOwnProp$b.call(b, prop))
  682. __defNormalProp$9(a, prop, b[prop]);
  683. if (__getOwnPropSymbols$b)
  684. for (var prop of __getOwnPropSymbols$b(b)) {
  685. if (__propIsEnum$b.call(b, prop))
  686. __defNormalProp$9(a, prop, b[prop]);
  687. }
  688. return a;
  689. };
  690. var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
  691. function toRefs(objectRef) {
  692. if (!vueDemi.isRef(objectRef))
  693. return vueDemi.toRefs(objectRef);
  694. const result = Array.isArray(objectRef.value) ? new Array(objectRef.value.length) : {};
  695. for (const key in objectRef.value) {
  696. result[key] = vueDemi.customRef(() => ({
  697. get() {
  698. return objectRef.value[key];
  699. },
  700. set(v) {
  701. if (Array.isArray(objectRef.value)) {
  702. const copy = [...objectRef.value];
  703. copy[key] = v;
  704. objectRef.value = copy;
  705. } else {
  706. const newObject = __spreadProps$7(__spreadValues$9({}, objectRef.value), { [key]: v });
  707. Object.setPrototypeOf(newObject, objectRef.value);
  708. objectRef.value = newObject;
  709. }
  710. }
  711. }));
  712. }
  713. return result;
  714. }
  715. function tryOnBeforeMount(fn, sync = true) {
  716. if (vueDemi.getCurrentInstance())
  717. vueDemi.onBeforeMount(fn);
  718. else if (sync)
  719. fn();
  720. else
  721. vueDemi.nextTick(fn);
  722. }
  723. function tryOnBeforeUnmount(fn) {
  724. if (vueDemi.getCurrentInstance())
  725. vueDemi.onBeforeUnmount(fn);
  726. }
  727. function tryOnMounted(fn, sync = true) {
  728. if (vueDemi.getCurrentInstance())
  729. vueDemi.onMounted(fn);
  730. else if (sync)
  731. fn();
  732. else
  733. vueDemi.nextTick(fn);
  734. }
  735. function tryOnUnmounted(fn) {
  736. if (vueDemi.getCurrentInstance())
  737. vueDemi.onUnmounted(fn);
  738. }
  739. function createUntil(r, isNot = false) {
  740. function toMatch(condition, { flush = "sync", deep = false, timeout, throwOnTimeout } = {}) {
  741. let stop = null;
  742. const watcher = new Promise((resolve) => {
  743. stop = vueDemi.watch(
  744. r,
  745. (v) => {
  746. if (condition(v) !== isNot) {
  747. stop == null ? void 0 : stop();
  748. resolve(v);
  749. }
  750. },
  751. {
  752. flush,
  753. deep,
  754. immediate: true
  755. }
  756. );
  757. });
  758. const promises = [watcher];
  759. if (timeout != null) {
  760. promises.push(
  761. promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop == null ? void 0 : stop())
  762. );
  763. }
  764. return Promise.race(promises);
  765. }
  766. function toBe(value, options) {
  767. if (!vueDemi.isRef(value))
  768. return toMatch((v) => v === value, options);
  769. const { flush = "sync", deep = false, timeout, throwOnTimeout } = options != null ? options : {};
  770. let stop = null;
  771. const watcher = new Promise((resolve) => {
  772. stop = vueDemi.watch(
  773. [r, value],
  774. ([v1, v2]) => {
  775. if (isNot !== (v1 === v2)) {
  776. stop == null ? void 0 : stop();
  777. resolve(v1);
  778. }
  779. },
  780. {
  781. flush,
  782. deep,
  783. immediate: true
  784. }
  785. );
  786. });
  787. const promises = [watcher];
  788. if (timeout != null) {
  789. promises.push(
  790. promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {
  791. stop == null ? void 0 : stop();
  792. return toValue(r);
  793. })
  794. );
  795. }
  796. return Promise.race(promises);
  797. }
  798. function toBeTruthy(options) {
  799. return toMatch((v) => Boolean(v), options);
  800. }
  801. function toBeNull(options) {
  802. return toBe(null, options);
  803. }
  804. function toBeUndefined(options) {
  805. return toBe(void 0, options);
  806. }
  807. function toBeNaN(options) {
  808. return toMatch(Number.isNaN, options);
  809. }
  810. function toContains(value, options) {
  811. return toMatch((v) => {
  812. const array = Array.from(v);
  813. return array.includes(value) || array.includes(toValue(value));
  814. }, options);
  815. }
  816. function changed(options) {
  817. return changedTimes(1, options);
  818. }
  819. function changedTimes(n = 1, options) {
  820. let count = -1;
  821. return toMatch(() => {
  822. count += 1;
  823. return count >= n;
  824. }, options);
  825. }
  826. if (Array.isArray(toValue(r))) {
  827. const instance = {
  828. toMatch,
  829. toContains,
  830. changed,
  831. changedTimes,
  832. get not() {
  833. return createUntil(r, !isNot);
  834. }
  835. };
  836. return instance;
  837. } else {
  838. const instance = {
  839. toMatch,
  840. toBe,
  841. toBeTruthy,
  842. toBeNull,
  843. toBeNaN,
  844. toBeUndefined,
  845. changed,
  846. changedTimes,
  847. get not() {
  848. return createUntil(r, !isNot);
  849. }
  850. };
  851. return instance;
  852. }
  853. }
  854. function until(r) {
  855. return createUntil(r);
  856. }
  857. function defaultComparator(value, othVal) {
  858. return value === othVal;
  859. }
  860. function useArrayDifference(...args) {
  861. var _a;
  862. const list = args[0];
  863. const values = args[1];
  864. let compareFn = (_a = args[2]) != null ? _a : defaultComparator;
  865. if (typeof compareFn === "string") {
  866. const key = compareFn;
  867. compareFn = (value, othVal) => value[key] === othVal[key];
  868. }
  869. return vueDemi.computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));
  870. }
  871. function useArrayEvery(list, fn) {
  872. return vueDemi.computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));
  873. }
  874. function useArrayFilter(list, fn) {
  875. return vueDemi.computed(() => toValue(list).map((i) => toValue(i)).filter(fn));
  876. }
  877. function useArrayFind(list, fn) {
  878. return vueDemi.computed(
  879. () => toValue(
  880. toValue(list).find((element, index, array) => fn(toValue(element), index, array))
  881. )
  882. );
  883. }
  884. function useArrayFindIndex(list, fn) {
  885. return vueDemi.computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));
  886. }
  887. function findLast(arr, cb) {
  888. let index = arr.length;
  889. while (index-- > 0) {
  890. if (cb(arr[index], index, arr))
  891. return arr[index];
  892. }
  893. return void 0;
  894. }
  895. function useArrayFindLast(list, fn) {
  896. return vueDemi.computed(
  897. () => toValue(
  898. !Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))
  899. )
  900. );
  901. }
  902. function isArrayIncludesOptions(obj) {
  903. return isObject(obj) && containsProp(obj, "formIndex", "comparator");
  904. }
  905. function useArrayIncludes(...args) {
  906. var _a;
  907. const list = args[0];
  908. const value = args[1];
  909. let comparator = args[2];
  910. let formIndex = 0;
  911. if (isArrayIncludesOptions(comparator)) {
  912. formIndex = (_a = comparator.fromIndex) != null ? _a : 0;
  913. comparator = comparator.comparator;
  914. }
  915. if (typeof comparator === "string") {
  916. const key = comparator;
  917. comparator = (element, value2) => element[key] === toValue(value2);
  918. }
  919. comparator = comparator != null ? comparator : (element, value2) => element === toValue(value2);
  920. return vueDemi.computed(
  921. () => toValue(list).slice(formIndex).some(
  922. (element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))
  923. )
  924. );
  925. }
  926. function useArrayJoin(list, separator) {
  927. return vueDemi.computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));
  928. }
  929. function useArrayMap(list, fn) {
  930. return vueDemi.computed(() => toValue(list).map((i) => toValue(i)).map(fn));
  931. }
  932. function useArrayReduce(list, reducer, ...args) {
  933. const reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);
  934. return vueDemi.computed(() => {
  935. const resolved = toValue(list);
  936. return args.length ? resolved.reduce(reduceCallback, toValue(args[0])) : resolved.reduce(reduceCallback);
  937. });
  938. }
  939. function useArraySome(list, fn) {
  940. return vueDemi.computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));
  941. }
  942. function uniq(array) {
  943. return Array.from(new Set(array));
  944. }
  945. function uniqueElementsBy(array, fn) {
  946. return array.reduce((acc, v) => {
  947. if (!acc.some((x) => fn(v, x, array)))
  948. acc.push(v);
  949. return acc;
  950. }, []);
  951. }
  952. function useArrayUnique(list, compareFn) {
  953. return vueDemi.computed(() => {
  954. const resolvedList = toValue(list).map((element) => toValue(element));
  955. return compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);
  956. });
  957. }
  958. function useCounter(initialValue = 0, options = {}) {
  959. const count = vueDemi.ref(initialValue);
  960. const {
  961. max = Infinity,
  962. min = -Infinity
  963. } = options;
  964. const inc = (delta = 1) => count.value = Math.min(max, count.value + delta);
  965. const dec = (delta = 1) => count.value = Math.max(min, count.value - delta);
  966. const get = () => count.value;
  967. const set = (val) => count.value = Math.max(min, Math.min(max, val));
  968. const reset = (val = initialValue) => {
  969. initialValue = val;
  970. return set(val);
  971. };
  972. return { count, inc, dec, get, set, reset };
  973. }
  974. const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/;
  975. const REGEX_FORMAT = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
  976. function defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {
  977. let m = hours < 12 ? "AM" : "PM";
  978. if (hasPeriod)
  979. m = m.split("").reduce((acc, curr) => acc += `${curr}.`, "");
  980. return isLowercase ? m.toLowerCase() : m;
  981. }
  982. function formatDate(date, formatStr, options = {}) {
  983. var _a;
  984. const years = date.getFullYear();
  985. const month = date.getMonth();
  986. const days = date.getDate();
  987. const hours = date.getHours();
  988. const minutes = date.getMinutes();
  989. const seconds = date.getSeconds();
  990. const milliseconds = date.getMilliseconds();
  991. const day = date.getDay();
  992. const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;
  993. const matches = {
  994. YY: () => String(years).slice(-2),
  995. YYYY: () => years,
  996. M: () => month + 1,
  997. MM: () => `${month + 1}`.padStart(2, "0"),
  998. MMM: () => date.toLocaleDateString(options.locales, { month: "short" }),
  999. MMMM: () => date.toLocaleDateString(options.locales, { month: "long" }),
  1000. D: () => String(days),
  1001. DD: () => `${days}`.padStart(2, "0"),
  1002. H: () => String(hours),
  1003. HH: () => `${hours}`.padStart(2, "0"),
  1004. h: () => `${hours % 12 || 12}`.padStart(1, "0"),
  1005. hh: () => `${hours % 12 || 12}`.padStart(2, "0"),
  1006. m: () => String(minutes),
  1007. mm: () => `${minutes}`.padStart(2, "0"),
  1008. s: () => String(seconds),
  1009. ss: () => `${seconds}`.padStart(2, "0"),
  1010. SSS: () => `${milliseconds}`.padStart(3, "0"),
  1011. d: () => day,
  1012. dd: () => date.toLocaleDateString(options.locales, { weekday: "narrow" }),
  1013. ddd: () => date.toLocaleDateString(options.locales, { weekday: "short" }),
  1014. dddd: () => date.toLocaleDateString(options.locales, { weekday: "long" }),
  1015. A: () => meridiem(hours, minutes),
  1016. AA: () => meridiem(hours, minutes, false, true),
  1017. a: () => meridiem(hours, minutes, true),
  1018. aa: () => meridiem(hours, minutes, true, true)
  1019. };
  1020. return formatStr.replace(REGEX_FORMAT, (match, $1) => {
  1021. var _a2;
  1022. return $1 || ((_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) || match;
  1023. });
  1024. }
  1025. function normalizeDate(date) {
  1026. if (date === null)
  1027. return /* @__PURE__ */ new Date(NaN);
  1028. if (date === void 0)
  1029. return /* @__PURE__ */ new Date();
  1030. if (date instanceof Date)
  1031. return new Date(date);
  1032. if (typeof date === "string" && !/Z$/i.test(date)) {
  1033. const d = date.match(REGEX_PARSE);
  1034. if (d) {
  1035. const m = d[2] - 1 || 0;
  1036. const ms = (d[7] || "0").substring(0, 3);
  1037. return new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);
  1038. }
  1039. }
  1040. return new Date(date);
  1041. }
  1042. function useDateFormat(date, formatStr = "HH:mm:ss", options = {}) {
  1043. return vueDemi.computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));
  1044. }
  1045. function useIntervalFn(cb, interval = 1e3, options = {}) {
  1046. const {
  1047. immediate = true,
  1048. immediateCallback = false
  1049. } = options;
  1050. let timer = null;
  1051. const isActive = vueDemi.ref(false);
  1052. function clean() {
  1053. if (timer) {
  1054. clearInterval(timer);
  1055. timer = null;
  1056. }
  1057. }
  1058. function pause() {
  1059. isActive.value = false;
  1060. clean();
  1061. }
  1062. function resume() {
  1063. const intervalValue = toValue(interval);
  1064. if (intervalValue <= 0)
  1065. return;
  1066. isActive.value = true;
  1067. if (immediateCallback)
  1068. cb();
  1069. clean();
  1070. timer = setInterval(cb, intervalValue);
  1071. }
  1072. if (immediate && isClient)
  1073. resume();
  1074. if (vueDemi.isRef(interval) || typeof interval === "function") {
  1075. const stopWatch = vueDemi.watch(interval, () => {
  1076. if (isActive.value && isClient)
  1077. resume();
  1078. });
  1079. tryOnScopeDispose(stopWatch);
  1080. }
  1081. tryOnScopeDispose(pause);
  1082. return {
  1083. isActive,
  1084. pause,
  1085. resume
  1086. };
  1087. }
  1088. var __defProp$8 = Object.defineProperty;
  1089. var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
  1090. var __hasOwnProp$a = Object.prototype.hasOwnProperty;
  1091. var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
  1092. var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1093. var __spreadValues$8 = (a, b) => {
  1094. for (var prop in b || (b = {}))
  1095. if (__hasOwnProp$a.call(b, prop))
  1096. __defNormalProp$8(a, prop, b[prop]);
  1097. if (__getOwnPropSymbols$a)
  1098. for (var prop of __getOwnPropSymbols$a(b)) {
  1099. if (__propIsEnum$a.call(b, prop))
  1100. __defNormalProp$8(a, prop, b[prop]);
  1101. }
  1102. return a;
  1103. };
  1104. function useInterval(interval = 1e3, options = {}) {
  1105. const {
  1106. controls: exposeControls = false,
  1107. immediate = true,
  1108. callback
  1109. } = options;
  1110. const counter = vueDemi.ref(0);
  1111. const update = () => counter.value += 1;
  1112. const reset = () => {
  1113. counter.value = 0;
  1114. };
  1115. const controls = useIntervalFn(
  1116. callback ? () => {
  1117. update();
  1118. callback(counter.value);
  1119. } : update,
  1120. interval,
  1121. { immediate }
  1122. );
  1123. if (exposeControls) {
  1124. return __spreadValues$8({
  1125. counter,
  1126. reset
  1127. }, controls);
  1128. } else {
  1129. return counter;
  1130. }
  1131. }
  1132. function useLastChanged(source, options = {}) {
  1133. var _a;
  1134. const ms = vueDemi.ref((_a = options.initialValue) != null ? _a : null);
  1135. vueDemi.watch(
  1136. source,
  1137. () => ms.value = timestamp(),
  1138. options
  1139. );
  1140. return ms;
  1141. }
  1142. function useTimeoutFn(cb, interval, options = {}) {
  1143. const {
  1144. immediate = true
  1145. } = options;
  1146. const isPending = vueDemi.ref(false);
  1147. let timer = null;
  1148. function clear() {
  1149. if (timer) {
  1150. clearTimeout(timer);
  1151. timer = null;
  1152. }
  1153. }
  1154. function stop() {
  1155. isPending.value = false;
  1156. clear();
  1157. }
  1158. function start(...args) {
  1159. clear();
  1160. isPending.value = true;
  1161. timer = setTimeout(() => {
  1162. isPending.value = false;
  1163. timer = null;
  1164. cb(...args);
  1165. }, toValue(interval));
  1166. }
  1167. if (immediate) {
  1168. isPending.value = true;
  1169. if (isClient)
  1170. start();
  1171. }
  1172. tryOnScopeDispose(stop);
  1173. return {
  1174. isPending: vueDemi.readonly(isPending),
  1175. start,
  1176. stop
  1177. };
  1178. }
  1179. var __defProp$7 = Object.defineProperty;
  1180. var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
  1181. var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
  1182. var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
  1183. var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1184. var __spreadValues$7 = (a, b) => {
  1185. for (var prop in b || (b = {}))
  1186. if (__hasOwnProp$9.call(b, prop))
  1187. __defNormalProp$7(a, prop, b[prop]);
  1188. if (__getOwnPropSymbols$9)
  1189. for (var prop of __getOwnPropSymbols$9(b)) {
  1190. if (__propIsEnum$9.call(b, prop))
  1191. __defNormalProp$7(a, prop, b[prop]);
  1192. }
  1193. return a;
  1194. };
  1195. function useTimeout(interval = 1e3, options = {}) {
  1196. const {
  1197. controls: exposeControls = false,
  1198. callback
  1199. } = options;
  1200. const controls = useTimeoutFn(
  1201. callback != null ? callback : noop,
  1202. interval,
  1203. options
  1204. );
  1205. const ready = vueDemi.computed(() => !controls.isPending.value);
  1206. if (exposeControls) {
  1207. return __spreadValues$7({
  1208. ready
  1209. }, controls);
  1210. } else {
  1211. return ready;
  1212. }
  1213. }
  1214. function useToNumber(value, options = {}) {
  1215. const {
  1216. method = "parseFloat",
  1217. radix,
  1218. nanToZero
  1219. } = options;
  1220. return vueDemi.computed(() => {
  1221. let resolved = toValue(value);
  1222. if (typeof resolved === "string")
  1223. resolved = Number[method](resolved, radix);
  1224. if (nanToZero && isNaN(resolved))
  1225. resolved = 0;
  1226. return resolved;
  1227. });
  1228. }
  1229. function useToString(value) {
  1230. return vueDemi.computed(() => `${toValue(value)}`);
  1231. }
  1232. function useToggle(initialValue = false, options = {}) {
  1233. const {
  1234. truthyValue = true,
  1235. falsyValue = false
  1236. } = options;
  1237. const valueIsRef = vueDemi.isRef(initialValue);
  1238. const _value = vueDemi.ref(initialValue);
  1239. function toggle(value) {
  1240. if (arguments.length) {
  1241. _value.value = value;
  1242. return _value.value;
  1243. } else {
  1244. const truthy = toValue(truthyValue);
  1245. _value.value = _value.value === truthy ? toValue(falsyValue) : truthy;
  1246. return _value.value;
  1247. }
  1248. }
  1249. if (valueIsRef)
  1250. return toggle;
  1251. else
  1252. return [_value, toggle];
  1253. }
  1254. function watchArray(source, cb, options) {
  1255. let oldList = (options == null ? void 0 : options.immediate) ? [] : [
  1256. ...source instanceof Function ? source() : Array.isArray(source) ? source : toValue(source)
  1257. ];
  1258. return vueDemi.watch(source, (newList, _, onCleanup) => {
  1259. const oldListRemains = new Array(oldList.length);
  1260. const added = [];
  1261. for (const obj of newList) {
  1262. let found = false;
  1263. for (let i = 0; i < oldList.length; i++) {
  1264. if (!oldListRemains[i] && obj === oldList[i]) {
  1265. oldListRemains[i] = true;
  1266. found = true;
  1267. break;
  1268. }
  1269. }
  1270. if (!found)
  1271. added.push(obj);
  1272. }
  1273. const removed = oldList.filter((_2, i) => !oldListRemains[i]);
  1274. cb(newList, oldList, added, removed, onCleanup);
  1275. oldList = [...newList];
  1276. }, options);
  1277. }
  1278. var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
  1279. var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
  1280. var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
  1281. var __objRest$5 = (source, exclude) => {
  1282. var target = {};
  1283. for (var prop in source)
  1284. if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
  1285. target[prop] = source[prop];
  1286. if (source != null && __getOwnPropSymbols$8)
  1287. for (var prop of __getOwnPropSymbols$8(source)) {
  1288. if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
  1289. target[prop] = source[prop];
  1290. }
  1291. return target;
  1292. };
  1293. function watchWithFilter(source, cb, options = {}) {
  1294. const _a = options, {
  1295. eventFilter = bypassFilter
  1296. } = _a, watchOptions = __objRest$5(_a, [
  1297. "eventFilter"
  1298. ]);
  1299. return vueDemi.watch(
  1300. source,
  1301. createFilterWrapper(
  1302. eventFilter,
  1303. cb
  1304. ),
  1305. watchOptions
  1306. );
  1307. }
  1308. var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
  1309. var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
  1310. var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
  1311. var __objRest$4 = (source, exclude) => {
  1312. var target = {};
  1313. for (var prop in source)
  1314. if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
  1315. target[prop] = source[prop];
  1316. if (source != null && __getOwnPropSymbols$7)
  1317. for (var prop of __getOwnPropSymbols$7(source)) {
  1318. if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
  1319. target[prop] = source[prop];
  1320. }
  1321. return target;
  1322. };
  1323. function watchAtMost(source, cb, options) {
  1324. const _a = options, {
  1325. count
  1326. } = _a, watchOptions = __objRest$4(_a, [
  1327. "count"
  1328. ]);
  1329. const current = vueDemi.ref(0);
  1330. const stop = watchWithFilter(
  1331. source,
  1332. (...args) => {
  1333. current.value += 1;
  1334. if (current.value >= toValue(count))
  1335. vueDemi.nextTick(() => stop());
  1336. cb(...args);
  1337. },
  1338. watchOptions
  1339. );
  1340. return { count: current, stop };
  1341. }
  1342. var __defProp$6 = Object.defineProperty;
  1343. var __defProps$6 = Object.defineProperties;
  1344. var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
  1345. var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
  1346. var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
  1347. var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
  1348. var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1349. var __spreadValues$6 = (a, b) => {
  1350. for (var prop in b || (b = {}))
  1351. if (__hasOwnProp$6.call(b, prop))
  1352. __defNormalProp$6(a, prop, b[prop]);
  1353. if (__getOwnPropSymbols$6)
  1354. for (var prop of __getOwnPropSymbols$6(b)) {
  1355. if (__propIsEnum$6.call(b, prop))
  1356. __defNormalProp$6(a, prop, b[prop]);
  1357. }
  1358. return a;
  1359. };
  1360. var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
  1361. var __objRest$3 = (source, exclude) => {
  1362. var target = {};
  1363. for (var prop in source)
  1364. if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
  1365. target[prop] = source[prop];
  1366. if (source != null && __getOwnPropSymbols$6)
  1367. for (var prop of __getOwnPropSymbols$6(source)) {
  1368. if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
  1369. target[prop] = source[prop];
  1370. }
  1371. return target;
  1372. };
  1373. function watchDebounced(source, cb, options = {}) {
  1374. const _a = options, {
  1375. debounce = 0,
  1376. maxWait = void 0
  1377. } = _a, watchOptions = __objRest$3(_a, [
  1378. "debounce",
  1379. "maxWait"
  1380. ]);
  1381. return watchWithFilter(
  1382. source,
  1383. cb,
  1384. __spreadProps$6(__spreadValues$6({}, watchOptions), {
  1385. eventFilter: debounceFilter(debounce, { maxWait })
  1386. })
  1387. );
  1388. }
  1389. var __defProp$5 = Object.defineProperty;
  1390. var __defProps$5 = Object.defineProperties;
  1391. var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
  1392. var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
  1393. var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
  1394. var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
  1395. var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1396. var __spreadValues$5 = (a, b) => {
  1397. for (var prop in b || (b = {}))
  1398. if (__hasOwnProp$5.call(b, prop))
  1399. __defNormalProp$5(a, prop, b[prop]);
  1400. if (__getOwnPropSymbols$5)
  1401. for (var prop of __getOwnPropSymbols$5(b)) {
  1402. if (__propIsEnum$5.call(b, prop))
  1403. __defNormalProp$5(a, prop, b[prop]);
  1404. }
  1405. return a;
  1406. };
  1407. var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
  1408. function watchDeep(source, cb, options) {
  1409. return vueDemi.watch(
  1410. source,
  1411. cb,
  1412. __spreadProps$5(__spreadValues$5({}, options), {
  1413. deep: true
  1414. })
  1415. );
  1416. }
  1417. var __defProp$4 = Object.defineProperty;
  1418. var __defProps$4 = Object.defineProperties;
  1419. var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
  1420. var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
  1421. var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
  1422. var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
  1423. var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1424. var __spreadValues$4 = (a, b) => {
  1425. for (var prop in b || (b = {}))
  1426. if (__hasOwnProp$4.call(b, prop))
  1427. __defNormalProp$4(a, prop, b[prop]);
  1428. if (__getOwnPropSymbols$4)
  1429. for (var prop of __getOwnPropSymbols$4(b)) {
  1430. if (__propIsEnum$4.call(b, prop))
  1431. __defNormalProp$4(a, prop, b[prop]);
  1432. }
  1433. return a;
  1434. };
  1435. var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
  1436. var __objRest$2 = (source, exclude) => {
  1437. var target = {};
  1438. for (var prop in source)
  1439. if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
  1440. target[prop] = source[prop];
  1441. if (source != null && __getOwnPropSymbols$4)
  1442. for (var prop of __getOwnPropSymbols$4(source)) {
  1443. if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
  1444. target[prop] = source[prop];
  1445. }
  1446. return target;
  1447. };
  1448. function watchIgnorable(source, cb, options = {}) {
  1449. const _a = options, {
  1450. eventFilter = bypassFilter
  1451. } = _a, watchOptions = __objRest$2(_a, [
  1452. "eventFilter"
  1453. ]);
  1454. const filteredCb = createFilterWrapper(
  1455. eventFilter,
  1456. cb
  1457. );
  1458. let ignoreUpdates;
  1459. let ignorePrevAsyncUpdates;
  1460. let stop;
  1461. if (watchOptions.flush === "sync") {
  1462. const ignore = vueDemi.ref(false);
  1463. ignorePrevAsyncUpdates = () => {
  1464. };
  1465. ignoreUpdates = (updater) => {
  1466. ignore.value = true;
  1467. updater();
  1468. ignore.value = false;
  1469. };
  1470. stop = vueDemi.watch(
  1471. source,
  1472. (...args) => {
  1473. if (!ignore.value)
  1474. filteredCb(...args);
  1475. },
  1476. watchOptions
  1477. );
  1478. } else {
  1479. const disposables = [];
  1480. const ignoreCounter = vueDemi.ref(0);
  1481. const syncCounter = vueDemi.ref(0);
  1482. ignorePrevAsyncUpdates = () => {
  1483. ignoreCounter.value = syncCounter.value;
  1484. };
  1485. disposables.push(
  1486. vueDemi.watch(
  1487. source,
  1488. () => {
  1489. syncCounter.value++;
  1490. },
  1491. __spreadProps$4(__spreadValues$4({}, watchOptions), { flush: "sync" })
  1492. )
  1493. );
  1494. ignoreUpdates = (updater) => {
  1495. const syncCounterPrev = syncCounter.value;
  1496. updater();
  1497. ignoreCounter.value += syncCounter.value - syncCounterPrev;
  1498. };
  1499. disposables.push(
  1500. vueDemi.watch(
  1501. source,
  1502. (...args) => {
  1503. const ignore = ignoreCounter.value > 0 && ignoreCounter.value === syncCounter.value;
  1504. ignoreCounter.value = 0;
  1505. syncCounter.value = 0;
  1506. if (ignore)
  1507. return;
  1508. filteredCb(...args);
  1509. },
  1510. watchOptions
  1511. )
  1512. );
  1513. stop = () => {
  1514. disposables.forEach((fn) => fn());
  1515. };
  1516. }
  1517. return { stop, ignoreUpdates, ignorePrevAsyncUpdates };
  1518. }
  1519. var __defProp$3 = Object.defineProperty;
  1520. var __defProps$3 = Object.defineProperties;
  1521. var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
  1522. var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
  1523. var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
  1524. var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
  1525. var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1526. var __spreadValues$3 = (a, b) => {
  1527. for (var prop in b || (b = {}))
  1528. if (__hasOwnProp$3.call(b, prop))
  1529. __defNormalProp$3(a, prop, b[prop]);
  1530. if (__getOwnPropSymbols$3)
  1531. for (var prop of __getOwnPropSymbols$3(b)) {
  1532. if (__propIsEnum$3.call(b, prop))
  1533. __defNormalProp$3(a, prop, b[prop]);
  1534. }
  1535. return a;
  1536. };
  1537. var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
  1538. function watchImmediate(source, cb, options) {
  1539. return vueDemi.watch(
  1540. source,
  1541. cb,
  1542. __spreadProps$3(__spreadValues$3({}, options), {
  1543. immediate: true
  1544. })
  1545. );
  1546. }
  1547. function watchOnce(source, cb, options) {
  1548. const stop = vueDemi.watch(source, (...args) => {
  1549. vueDemi.nextTick(() => stop());
  1550. return cb(...args);
  1551. }, options);
  1552. }
  1553. var __defProp$2 = Object.defineProperty;
  1554. var __defProps$2 = Object.defineProperties;
  1555. var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
  1556. var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
  1557. var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
  1558. var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
  1559. var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1560. var __spreadValues$2 = (a, b) => {
  1561. for (var prop in b || (b = {}))
  1562. if (__hasOwnProp$2.call(b, prop))
  1563. __defNormalProp$2(a, prop, b[prop]);
  1564. if (__getOwnPropSymbols$2)
  1565. for (var prop of __getOwnPropSymbols$2(b)) {
  1566. if (__propIsEnum$2.call(b, prop))
  1567. __defNormalProp$2(a, prop, b[prop]);
  1568. }
  1569. return a;
  1570. };
  1571. var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
  1572. var __objRest$1 = (source, exclude) => {
  1573. var target = {};
  1574. for (var prop in source)
  1575. if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
  1576. target[prop] = source[prop];
  1577. if (source != null && __getOwnPropSymbols$2)
  1578. for (var prop of __getOwnPropSymbols$2(source)) {
  1579. if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
  1580. target[prop] = source[prop];
  1581. }
  1582. return target;
  1583. };
  1584. function watchPausable(source, cb, options = {}) {
  1585. const _a = options, {
  1586. eventFilter: filter
  1587. } = _a, watchOptions = __objRest$1(_a, [
  1588. "eventFilter"
  1589. ]);
  1590. const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
  1591. const stop = watchWithFilter(
  1592. source,
  1593. cb,
  1594. __spreadProps$2(__spreadValues$2({}, watchOptions), {
  1595. eventFilter
  1596. })
  1597. );
  1598. return { stop, pause, resume, isActive };
  1599. }
  1600. var __defProp$1 = Object.defineProperty;
  1601. var __defProps$1 = Object.defineProperties;
  1602. var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
  1603. var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
  1604. var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
  1605. var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
  1606. var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1607. var __spreadValues$1 = (a, b) => {
  1608. for (var prop in b || (b = {}))
  1609. if (__hasOwnProp$1.call(b, prop))
  1610. __defNormalProp$1(a, prop, b[prop]);
  1611. if (__getOwnPropSymbols$1)
  1612. for (var prop of __getOwnPropSymbols$1(b)) {
  1613. if (__propIsEnum$1.call(b, prop))
  1614. __defNormalProp$1(a, prop, b[prop]);
  1615. }
  1616. return a;
  1617. };
  1618. var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
  1619. var __objRest = (source, exclude) => {
  1620. var target = {};
  1621. for (var prop in source)
  1622. if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
  1623. target[prop] = source[prop];
  1624. if (source != null && __getOwnPropSymbols$1)
  1625. for (var prop of __getOwnPropSymbols$1(source)) {
  1626. if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
  1627. target[prop] = source[prop];
  1628. }
  1629. return target;
  1630. };
  1631. function watchThrottled(source, cb, options = {}) {
  1632. const _a = options, {
  1633. throttle = 0,
  1634. trailing = true,
  1635. leading = true
  1636. } = _a, watchOptions = __objRest(_a, [
  1637. "throttle",
  1638. "trailing",
  1639. "leading"
  1640. ]);
  1641. return watchWithFilter(
  1642. source,
  1643. cb,
  1644. __spreadProps$1(__spreadValues$1({}, watchOptions), {
  1645. eventFilter: throttleFilter(throttle, trailing, leading)
  1646. })
  1647. );
  1648. }
  1649. var __defProp = Object.defineProperty;
  1650. var __defProps = Object.defineProperties;
  1651. var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
  1652. var __getOwnPropSymbols = Object.getOwnPropertySymbols;
  1653. var __hasOwnProp = Object.prototype.hasOwnProperty;
  1654. var __propIsEnum = Object.prototype.propertyIsEnumerable;
  1655. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  1656. var __spreadValues = (a, b) => {
  1657. for (var prop in b || (b = {}))
  1658. if (__hasOwnProp.call(b, prop))
  1659. __defNormalProp(a, prop, b[prop]);
  1660. if (__getOwnPropSymbols)
  1661. for (var prop of __getOwnPropSymbols(b)) {
  1662. if (__propIsEnum.call(b, prop))
  1663. __defNormalProp(a, prop, b[prop]);
  1664. }
  1665. return a;
  1666. };
  1667. var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
  1668. function watchTriggerable(source, cb, options = {}) {
  1669. let cleanupFn;
  1670. function onEffect() {
  1671. if (!cleanupFn)
  1672. return;
  1673. const fn = cleanupFn;
  1674. cleanupFn = void 0;
  1675. fn();
  1676. }
  1677. function onCleanup(callback) {
  1678. cleanupFn = callback;
  1679. }
  1680. const _cb = (value, oldValue) => {
  1681. onEffect();
  1682. return cb(value, oldValue, onCleanup);
  1683. };
  1684. const res = watchIgnorable(source, _cb, options);
  1685. const { ignoreUpdates } = res;
  1686. const trigger = () => {
  1687. let res2;
  1688. ignoreUpdates(() => {
  1689. res2 = _cb(getWatchSources(source), getOldValue(source));
  1690. });
  1691. return res2;
  1692. };
  1693. return __spreadProps(__spreadValues({}, res), {
  1694. trigger
  1695. });
  1696. }
  1697. function getWatchSources(sources) {
  1698. if (vueDemi.isReactive(sources))
  1699. return sources;
  1700. if (Array.isArray(sources))
  1701. return sources.map((item) => toValue(item));
  1702. return toValue(sources);
  1703. }
  1704. function getOldValue(source) {
  1705. return Array.isArray(source) ? source.map(() => void 0) : void 0;
  1706. }
  1707. function whenever(source, cb, options) {
  1708. return vueDemi.watch(
  1709. source,
  1710. (v, ov, onInvalidate) => {
  1711. if (v)
  1712. cb(v, ov, onInvalidate);
  1713. },
  1714. options
  1715. );
  1716. }
  1717. exports.assert = assert;
  1718. exports.autoResetRef = refAutoReset;
  1719. exports.bypassFilter = bypassFilter;
  1720. exports.clamp = clamp;
  1721. exports.computedEager = computedEager;
  1722. exports.computedWithControl = computedWithControl;
  1723. exports.containsProp = containsProp;
  1724. exports.controlledComputed = computedWithControl;
  1725. exports.controlledRef = controlledRef;
  1726. exports.createEventHook = createEventHook;
  1727. exports.createFilterWrapper = createFilterWrapper;
  1728. exports.createGlobalState = createGlobalState;
  1729. exports.createInjectionState = createInjectionState;
  1730. exports.createReactiveFn = reactify;
  1731. exports.createSharedComposable = createSharedComposable;
  1732. exports.createSingletonPromise = createSingletonPromise;
  1733. exports.debounceFilter = debounceFilter;
  1734. exports.debouncedRef = refDebounced;
  1735. exports.debouncedWatch = watchDebounced;
  1736. exports.directiveHooks = directiveHooks;
  1737. exports.eagerComputed = computedEager;
  1738. exports.extendRef = extendRef;
  1739. exports.formatDate = formatDate;
  1740. exports.get = get;
  1741. exports.hasOwn = hasOwn;
  1742. exports.identity = identity;
  1743. exports.ignorableWatch = watchIgnorable;
  1744. exports.increaseWithUnit = increaseWithUnit;
  1745. exports.invoke = invoke;
  1746. exports.isClient = isClient;
  1747. exports.isDef = isDef;
  1748. exports.isDefined = isDefined;
  1749. exports.isIOS = isIOS;
  1750. exports.isObject = isObject;
  1751. exports.makeDestructurable = makeDestructurable;
  1752. exports.noop = noop;
  1753. exports.normalizeDate = normalizeDate;
  1754. exports.notNullish = notNullish;
  1755. exports.now = now;
  1756. exports.objectEntries = objectEntries;
  1757. exports.objectOmit = objectOmit;
  1758. exports.objectPick = objectPick;
  1759. exports.pausableFilter = pausableFilter;
  1760. exports.pausableWatch = watchPausable;
  1761. exports.promiseTimeout = promiseTimeout;
  1762. exports.rand = rand;
  1763. exports.reactify = reactify;
  1764. exports.reactifyObject = reactifyObject;
  1765. exports.reactiveComputed = reactiveComputed;
  1766. exports.reactiveOmit = reactiveOmit;
  1767. exports.reactivePick = reactivePick;
  1768. exports.refAutoReset = refAutoReset;
  1769. exports.refDebounced = refDebounced;
  1770. exports.refDefault = refDefault;
  1771. exports.refThrottled = refThrottled;
  1772. exports.refWithControl = refWithControl;
  1773. exports.resolveRef = resolveRef;
  1774. exports.resolveUnref = resolveUnref;
  1775. exports.set = set;
  1776. exports.syncRef = syncRef;
  1777. exports.syncRefs = syncRefs;
  1778. exports.throttleFilter = throttleFilter;
  1779. exports.throttledRef = refThrottled;
  1780. exports.throttledWatch = watchThrottled;
  1781. exports.timestamp = timestamp;
  1782. exports.toReactive = toReactive;
  1783. exports.toRef = toRef;
  1784. exports.toRefs = toRefs;
  1785. exports.toValue = toValue;
  1786. exports.tryOnBeforeMount = tryOnBeforeMount;
  1787. exports.tryOnBeforeUnmount = tryOnBeforeUnmount;
  1788. exports.tryOnMounted = tryOnMounted;
  1789. exports.tryOnScopeDispose = tryOnScopeDispose;
  1790. exports.tryOnUnmounted = tryOnUnmounted;
  1791. exports.until = until;
  1792. exports.useArrayDifference = useArrayDifference;
  1793. exports.useArrayEvery = useArrayEvery;
  1794. exports.useArrayFilter = useArrayFilter;
  1795. exports.useArrayFind = useArrayFind;
  1796. exports.useArrayFindIndex = useArrayFindIndex;
  1797. exports.useArrayFindLast = useArrayFindLast;
  1798. exports.useArrayIncludes = useArrayIncludes;
  1799. exports.useArrayJoin = useArrayJoin;
  1800. exports.useArrayMap = useArrayMap;
  1801. exports.useArrayReduce = useArrayReduce;
  1802. exports.useArraySome = useArraySome;
  1803. exports.useArrayUnique = useArrayUnique;
  1804. exports.useCounter = useCounter;
  1805. exports.useDateFormat = useDateFormat;
  1806. exports.useDebounce = refDebounced;
  1807. exports.useDebounceFn = useDebounceFn;
  1808. exports.useInterval = useInterval;
  1809. exports.useIntervalFn = useIntervalFn;
  1810. exports.useLastChanged = useLastChanged;
  1811. exports.useThrottle = refThrottled;
  1812. exports.useThrottleFn = useThrottleFn;
  1813. exports.useTimeout = useTimeout;
  1814. exports.useTimeoutFn = useTimeoutFn;
  1815. exports.useToNumber = useToNumber;
  1816. exports.useToString = useToString;
  1817. exports.useToggle = useToggle;
  1818. exports.watchArray = watchArray;
  1819. exports.watchAtMost = watchAtMost;
  1820. exports.watchDebounced = watchDebounced;
  1821. exports.watchDeep = watchDeep;
  1822. exports.watchIgnorable = watchIgnorable;
  1823. exports.watchImmediate = watchImmediate;
  1824. exports.watchOnce = watchOnce;
  1825. exports.watchPausable = watchPausable;
  1826. exports.watchThrottled = watchThrottled;
  1827. exports.watchTriggerable = watchTriggerable;
  1828. exports.watchWithFilter = watchWithFilter;
  1829. exports.whenever = whenever;