vendor.js 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764
  1. (global["webpackJsonp"] = global["webpackJsonp"] || []).push([["pageA/common/vendor"],{
  2. /***/ 130:
  3. /*!******************************************************!*\
  4. !*** ./node_modules/@dcloudio/uni-app/dist/index.js ***!
  5. \******************************************************/
  6. /*! no static exports found */
  7. /***/ (function(module, exports, __webpack_require__) {
  8. "use strict";
  9. Object.defineProperty(exports, "__esModule", { value: true });
  10. exports.onNavigationBarSearchInputClicked = exports.onNavigationBarSearchInputConfirmed = exports.onNavigationBarSearchInputChanged = exports.onBackPress = exports.onNavigationBarButtonTap = exports.onTabItemTap = exports.onResize = exports.onPageScroll = exports.onAddToFavorites = exports.onShareTimeline = exports.onShareAppMessage = exports.onReachBottom = exports.onPullDownRefresh = exports.onUnload = exports.onReady = exports.onLoad = exports.onInit = exports.onUniNViewMessage = exports.onThemeChange = exports.onUnhandledRejection = exports.onPageNotFound = exports.onError = exports.onLaunch = exports.onHide = exports.onShow = exports.initUtsPackageName = exports.initUtsClassName = exports.initUtsIndexClassName = exports.initUtsProxyFunction = exports.initUtsProxyClass = void 0;
  11. var composition_api_1 = __webpack_require__(/*! @vue/composition-api */ 131);
  12. var app = __webpack_require__(/*! ./app */ 133);
  13. var mp = __webpack_require__(/*! ./mp */ 134);
  14. var uts_1 = __webpack_require__(/*! ./uts */ 135);
  15. Object.defineProperty(exports, "initUtsProxyClass", { enumerable: true, get: function () { return uts_1.initUtsProxyClass; } });
  16. Object.defineProperty(exports, "initUtsProxyFunction", { enumerable: true, get: function () { return uts_1.initUtsProxyFunction; } });
  17. Object.defineProperty(exports, "initUtsIndexClassName", { enumerable: true, get: function () { return uts_1.initUtsIndexClassName; } });
  18. Object.defineProperty(exports, "initUtsClassName", { enumerable: true, get: function () { return uts_1.initUtsClassName; } });
  19. Object.defineProperty(exports, "initUtsPackageName", { enumerable: true, get: function () { return uts_1.initUtsPackageName; } });
  20. var lifecycles = [];
  21. var createLifeCycle = function (lifecycle) {
  22. lifecycles.push(lifecycle);
  23. var fn = (0, composition_api_1.createLifeCycle)(lifecycle);
  24. return function (callback, target) {
  25. return fn(callback, target);
  26. };
  27. };
  28. if (typeof plus === 'object') {
  29. app.init();
  30. }
  31. else if (typeof window === 'object' && 'document' in window) {
  32. }
  33. else {
  34. mp.init(lifecycles);
  35. }
  36. exports.onShow = createLifeCycle('onShow');
  37. exports.onHide = createLifeCycle('onHide');
  38. exports.onLaunch = createLifeCycle('onLaunch');
  39. exports.onError = createLifeCycle('onError');
  40. exports.onPageNotFound = createLifeCycle('onPageNotFound');
  41. exports.onUnhandledRejection = createLifeCycle('onUnhandledRejection');
  42. exports.onThemeChange = createLifeCycle('onThemeChange');
  43. exports.onUniNViewMessage = createLifeCycle('onUniNViewMessage');
  44. exports.onInit = createLifeCycle('onInit');
  45. exports.onLoad = createLifeCycle('onLoad');
  46. exports.onReady = createLifeCycle('onReady');
  47. exports.onUnload = createLifeCycle('onUnload');
  48. exports.onPullDownRefresh = createLifeCycle('onPullDownRefresh');
  49. exports.onReachBottom = createLifeCycle('onReachBottom');
  50. exports.onShareAppMessage = createLifeCycle('onShareAppMessage');
  51. exports.onShareTimeline = createLifeCycle('onShareTimeline');
  52. exports.onAddToFavorites = createLifeCycle('onAddToFavorites');
  53. exports.onPageScroll = createLifeCycle('onPageScroll');
  54. exports.onResize = createLifeCycle('onResize');
  55. exports.onTabItemTap = createLifeCycle('onTabItemTap');
  56. exports.onNavigationBarButtonTap = createLifeCycle('onNavigationBarButtonTap');
  57. exports.onBackPress = createLifeCycle('onBackPress');
  58. exports.onNavigationBarSearchInputChanged = createLifeCycle('onNavigationBarSearchInputChanged');
  59. exports.onNavigationBarSearchInputConfirmed = createLifeCycle('onNavigationBarSearchInputConfirmed');
  60. exports.onNavigationBarSearchInputClicked = createLifeCycle('onNavigationBarSearchInputClicked');
  61. /***/ }),
  62. /***/ 131:
  63. /*!******************************************************************************************!*\
  64. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@vue/composition-api/index.js ***!
  65. \******************************************************************************************/
  66. /*! no static exports found */
  67. /***/ (function(module, exports, __webpack_require__) {
  68. "use strict";
  69. if (false) {} else {
  70. module.exports = __webpack_require__(/*! ./dist/vue-composition-api.common.js */ 132)
  71. }
  72. /***/ }),
  73. /***/ 132:
  74. /*!********************************************************************************************************************!*\
  75. !*** ./node_modules/@dcloudio/vue-cli-plugin-uni/packages/@vue/composition-api/dist/vue-composition-api.common.js ***!
  76. \********************************************************************************************************************/
  77. /*! no static exports found */
  78. /***/ (function(module, exports, __webpack_require__) {
  79. "use strict";
  80. Object.defineProperty(exports, '__esModule', { value: true });
  81. /******************************************************************************
  82. Copyright (c) Microsoft Corporation.
  83. Permission to use, copy, modify, and/or distribute this software for any
  84. purpose with or without fee is hereby granted.
  85. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  86. REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  87. AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  88. INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  89. LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  90. OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  91. PERFORMANCE OF THIS SOFTWARE.
  92. ***************************************************************************** */
  93. /* global Reflect, Promise */
  94. var extendStatics = function(d, b) {
  95. extendStatics = Object.setPrototypeOf ||
  96. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  97. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  98. return extendStatics(d, b);
  99. };
  100. function __extends(d, b) {
  101. if (typeof b !== "function" && b !== null)
  102. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  103. extendStatics(d, b);
  104. function __() { this.constructor = d; }
  105. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  106. }
  107. var __assign = function() {
  108. __assign = Object.assign || function __assign(t) {
  109. for (var s, i = 1, n = arguments.length; i < n; i++) {
  110. s = arguments[i];
  111. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  112. }
  113. return t;
  114. };
  115. return __assign.apply(this, arguments);
  116. };
  117. function __values(o) {
  118. var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
  119. if (m) return m.call(o);
  120. if (o && typeof o.length === "number") return {
  121. next: function () {
  122. if (o && i >= o.length) o = void 0;
  123. return { value: o && o[i++], done: !o };
  124. }
  125. };
  126. throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
  127. }
  128. function __read(o, n) {
  129. var m = typeof Symbol === "function" && o[Symbol.iterator];
  130. if (!m) return o;
  131. var i = m.call(o), r, ar = [], e;
  132. try {
  133. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  134. }
  135. catch (error) { e = { error: error }; }
  136. finally {
  137. try {
  138. if (r && !r.done && (m = i["return"])) m.call(i);
  139. }
  140. finally { if (e) throw e.error; }
  141. }
  142. return ar;
  143. }
  144. function __spreadArray(to, from, pack) {
  145. if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
  146. if (ar || !(i in from)) {
  147. if (!ar) ar = Array.prototype.slice.call(from, 0, i);
  148. ar[i] = from[i];
  149. }
  150. }
  151. return to.concat(ar || Array.prototype.slice.call(from));
  152. }
  153. /**
  154. * Displays a warning message (using console.error) with a stack trace if the
  155. * function is called inside of active component.
  156. *
  157. * @param message warning message to be displayed
  158. */
  159. function warn$1(message) {
  160. var _a;
  161. warn(message, (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy);
  162. }
  163. var activeEffectScope;
  164. var effectScopeStack = [];
  165. var EffectScopeImpl = /** @class */ (function () {
  166. function EffectScopeImpl(vm) {
  167. this.active = true;
  168. this.effects = [];
  169. this.cleanups = [];
  170. this.vm = vm;
  171. }
  172. EffectScopeImpl.prototype.run = function (fn) {
  173. if (this.active) {
  174. try {
  175. this.on();
  176. return fn();
  177. }
  178. finally {
  179. this.off();
  180. }
  181. }
  182. else {
  183. warn$1("cannot run an inactive effect scope.");
  184. }
  185. return;
  186. };
  187. EffectScopeImpl.prototype.on = function () {
  188. if (this.active) {
  189. effectScopeStack.push(this);
  190. activeEffectScope = this;
  191. }
  192. };
  193. EffectScopeImpl.prototype.off = function () {
  194. if (this.active) {
  195. effectScopeStack.pop();
  196. activeEffectScope = effectScopeStack[effectScopeStack.length - 1];
  197. }
  198. };
  199. EffectScopeImpl.prototype.stop = function () {
  200. if (this.active) {
  201. this.vm.$destroy();
  202. this.effects.forEach(function (e) { return e.stop(); });
  203. this.cleanups.forEach(function (cleanup) { return cleanup(); });
  204. this.active = false;
  205. }
  206. };
  207. return EffectScopeImpl;
  208. }());
  209. var EffectScope = /** @class */ (function (_super) {
  210. __extends(EffectScope, _super);
  211. function EffectScope(detached) {
  212. if (detached === void 0) { detached = false; }
  213. var _this = this;
  214. var vm = undefined;
  215. withCurrentInstanceTrackingDisabled(function () {
  216. vm = defineComponentInstance(getVueConstructor());
  217. });
  218. _this = _super.call(this, vm) || this;
  219. if (!detached) {
  220. recordEffectScope(_this);
  221. }
  222. return _this;
  223. }
  224. return EffectScope;
  225. }(EffectScopeImpl));
  226. function recordEffectScope(effect, scope) {
  227. var _a;
  228. scope = scope || activeEffectScope;
  229. if (scope && scope.active) {
  230. scope.effects.push(effect);
  231. return;
  232. }
  233. // destroy on parent component unmounted
  234. var vm = (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy;
  235. vm && vm.$on('hook:destroyed', function () { return effect.stop(); });
  236. }
  237. function effectScope(detached) {
  238. return new EffectScope(detached);
  239. }
  240. function getCurrentScope() {
  241. return activeEffectScope;
  242. }
  243. function onScopeDispose(fn) {
  244. if (activeEffectScope) {
  245. activeEffectScope.cleanups.push(fn);
  246. }
  247. else {
  248. warn$1("onScopeDispose() is called when there is no active effect scope" +
  249. " to be associated with.");
  250. }
  251. }
  252. /**
  253. * @internal
  254. **/
  255. function getCurrentScopeVM() {
  256. var _a, _b;
  257. return ((_a = getCurrentScope()) === null || _a === void 0 ? void 0 : _a.vm) || ((_b = getCurrentInstance()) === null || _b === void 0 ? void 0 : _b.proxy);
  258. }
  259. /**
  260. * @internal
  261. **/
  262. function bindCurrentScopeToVM(vm) {
  263. if (!vm.scope) {
  264. var scope_1 = new EffectScopeImpl(vm.proxy);
  265. vm.scope = scope_1;
  266. vm.proxy.$on('hook:destroyed', function () { return scope_1.stop(); });
  267. }
  268. return vm.scope;
  269. }
  270. var vueDependency = undefined;
  271. try {
  272. var requiredVue = __webpack_require__(/*! vue */ 25);
  273. if (requiredVue && isVue(requiredVue)) {
  274. vueDependency = requiredVue;
  275. }
  276. else if (requiredVue &&
  277. 'default' in requiredVue &&
  278. isVue(requiredVue.default)) {
  279. vueDependency = requiredVue.default;
  280. }
  281. }
  282. catch (_a) {
  283. // not available
  284. }
  285. var vueConstructor = null;
  286. var currentInstance = null;
  287. var currentInstanceTracking = true;
  288. var PluginInstalledFlag = '__composition_api_installed__';
  289. function isVue(obj) {
  290. return obj && isFunction(obj) && obj.name === 'Vue';
  291. }
  292. function isVueRegistered(Vue) {
  293. // resolve issue: https://github.com/vuejs/composition-api/issues/876#issue-1087619365
  294. return vueConstructor && hasOwn(Vue, PluginInstalledFlag);
  295. }
  296. function getVueConstructor() {
  297. {
  298. assert(vueConstructor, "must call Vue.use(VueCompositionAPI) before using any function.");
  299. }
  300. return vueConstructor;
  301. }
  302. // returns registered vue or `vue` dependency
  303. function getRegisteredVueOrDefault() {
  304. var constructor = vueConstructor || vueDependency;
  305. {
  306. assert(constructor, "No vue dependency found.");
  307. }
  308. return constructor;
  309. }
  310. function setVueConstructor(Vue) {
  311. // @ts-ignore
  312. if (vueConstructor && Vue.__proto__ !== vueConstructor.__proto__) {
  313. warn('[vue-composition-api] another instance of Vue installed');
  314. }
  315. vueConstructor = Vue;
  316. Object.defineProperty(Vue, PluginInstalledFlag, {
  317. configurable: true,
  318. writable: true,
  319. value: true,
  320. });
  321. }
  322. /**
  323. * For `effectScope` to create instance without populate the current instance
  324. * @internal
  325. **/
  326. function withCurrentInstanceTrackingDisabled(fn) {
  327. var prev = currentInstanceTracking;
  328. currentInstanceTracking = false;
  329. try {
  330. fn();
  331. }
  332. finally {
  333. currentInstanceTracking = prev;
  334. }
  335. }
  336. function setCurrentInstance(instance) {
  337. if (!currentInstanceTracking)
  338. return;
  339. var prev = currentInstance;
  340. prev === null || prev === void 0 ? void 0 : prev.scope.off();
  341. currentInstance = instance;
  342. currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.scope.on();
  343. }
  344. function getCurrentInstance() {
  345. return currentInstance;
  346. }
  347. var instanceMapCache = new WeakMap();
  348. function toVue3ComponentInstance(vm) {
  349. if (instanceMapCache.has(vm)) {
  350. return instanceMapCache.get(vm);
  351. }
  352. var instance = {
  353. proxy: vm,
  354. update: vm.$forceUpdate,
  355. type: vm.$options,
  356. uid: vm._uid,
  357. // $emit is defined on prototype and it expected to be bound
  358. emit: vm.$emit.bind(vm),
  359. parent: null,
  360. root: null, // to be immediately set
  361. };
  362. bindCurrentScopeToVM(instance);
  363. // map vm.$props =
  364. var instanceProps = [
  365. 'data',
  366. 'props',
  367. 'attrs',
  368. 'refs',
  369. 'vnode',
  370. 'slots',
  371. ];
  372. instanceProps.forEach(function (prop) {
  373. proxy(instance, prop, {
  374. get: function () {
  375. return vm["$".concat(prop)];
  376. },
  377. });
  378. });
  379. proxy(instance, 'isMounted', {
  380. get: function () {
  381. // @ts-expect-error private api
  382. return vm._isMounted;
  383. },
  384. });
  385. proxy(instance, 'isUnmounted', {
  386. get: function () {
  387. // @ts-expect-error private api
  388. return vm._isDestroyed;
  389. },
  390. });
  391. proxy(instance, 'isDeactivated', {
  392. get: function () {
  393. // @ts-expect-error private api
  394. return vm._inactive;
  395. },
  396. });
  397. proxy(instance, 'emitted', {
  398. get: function () {
  399. // @ts-expect-error private api
  400. return vm._events;
  401. },
  402. });
  403. instanceMapCache.set(vm, instance);
  404. if (vm.$parent) {
  405. instance.parent = toVue3ComponentInstance(vm.$parent);
  406. }
  407. if (vm.$root) {
  408. instance.root = toVue3ComponentInstance(vm.$root);
  409. }
  410. return instance;
  411. }
  412. var toString = function (x) { return Object.prototype.toString.call(x); };
  413. function isNative(Ctor) {
  414. return typeof Ctor === 'function' && /native code/.test(Ctor.toString());
  415. }
  416. var hasSymbol = typeof Symbol !== 'undefined' &&
  417. isNative(Symbol) &&
  418. typeof Reflect !== 'undefined' &&
  419. isNative(Reflect.ownKeys);
  420. var noopFn = function (_) { return _; };
  421. function proxy(target, key, _a) {
  422. var get = _a.get, set = _a.set;
  423. Object.defineProperty(target, key, {
  424. enumerable: true,
  425. configurable: true,
  426. get: get || noopFn,
  427. set: set || noopFn,
  428. });
  429. }
  430. function def(obj, key, val, enumerable) {
  431. Object.defineProperty(obj, key, {
  432. value: val,
  433. enumerable: !!enumerable,
  434. writable: true,
  435. configurable: true,
  436. });
  437. }
  438. function hasOwn(obj, key) {
  439. return Object.hasOwnProperty.call(obj, key);
  440. }
  441. function assert(condition, msg) {
  442. if (!condition) {
  443. throw new Error("[vue-composition-api] ".concat(msg));
  444. }
  445. }
  446. function isPrimitive(value) {
  447. return (typeof value === 'string' ||
  448. typeof value === 'number' ||
  449. // $flow-disable-line
  450. typeof value === 'symbol' ||
  451. typeof value === 'boolean');
  452. }
  453. function isArray(x) {
  454. return Array.isArray(x);
  455. }
  456. var objectToString = Object.prototype.toString;
  457. var toTypeString = function (value) {
  458. return objectToString.call(value);
  459. };
  460. var isMap = function (val) {
  461. return toTypeString(val) === '[object Map]';
  462. };
  463. var isSet = function (val) {
  464. return toTypeString(val) === '[object Set]';
  465. };
  466. var MAX_VALID_ARRAY_LENGTH = 4294967295; // Math.pow(2, 32) - 1
  467. function isValidArrayIndex(val) {
  468. var n = parseFloat(String(val));
  469. return (n >= 0 &&
  470. Math.floor(n) === n &&
  471. isFinite(val) &&
  472. n <= MAX_VALID_ARRAY_LENGTH);
  473. }
  474. function isObject(val) {
  475. return val !== null && typeof val === 'object';
  476. }
  477. function isPlainObject(x) {
  478. return toString(x) === '[object Object]';
  479. }
  480. function isFunction(x) {
  481. return typeof x === 'function';
  482. }
  483. function isUndef(v) {
  484. return v === undefined || v === null;
  485. }
  486. function warn(msg, vm) {
  487. var Vue = getRegisteredVueOrDefault();
  488. if (!Vue || !Vue.util)
  489. console.warn("[vue-composition-api] ".concat(msg));
  490. else
  491. Vue.util.warn(msg, vm);
  492. }
  493. function logError(err, vm, info) {
  494. {
  495. warn("Error in ".concat(info, ": \"").concat(err.toString(), "\""), vm);
  496. }
  497. if (typeof window !== 'undefined' && typeof console !== 'undefined') {
  498. console.error(err);
  499. }
  500. else {
  501. throw err;
  502. }
  503. }
  504. /**
  505. * Object.is polyfill
  506. * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
  507. * */
  508. function isSame(value1, value2) {
  509. if (value1 === value2) {
  510. return value1 !== 0 || 1 / value1 === 1 / value2;
  511. }
  512. else {
  513. return value1 !== value1 && value2 !== value2;
  514. }
  515. }
  516. function getCurrentInstanceForFn(hook, target) {
  517. target = target || getCurrentInstance();
  518. if (!target) {
  519. warn("".concat(hook, " is called when there is no active component instance to be ") +
  520. "associated with. " +
  521. "Lifecycle injection APIs can only be used during execution of setup().");
  522. }
  523. return target;
  524. }
  525. function defineComponentInstance(Ctor, options) {
  526. if (options === void 0) { options = {}; }
  527. var silent = Ctor.config.silent;
  528. Ctor.config.silent = true;
  529. var vm = new Ctor(options);
  530. Ctor.config.silent = silent;
  531. return vm;
  532. }
  533. function isComponentInstance(obj) {
  534. var Vue = getVueConstructor();
  535. return Vue && obj instanceof Vue;
  536. }
  537. function createSlotProxy(vm, slotName) {
  538. return (function () {
  539. var args = [];
  540. for (var _i = 0; _i < arguments.length; _i++) {
  541. args[_i] = arguments[_i];
  542. }
  543. if (!vm.$scopedSlots[slotName]) {
  544. return warn("slots.".concat(slotName, "() got called outside of the \"render()\" scope"), vm);
  545. }
  546. return vm.$scopedSlots[slotName].apply(vm, args);
  547. });
  548. }
  549. function resolveSlots(slots, normalSlots) {
  550. var res;
  551. if (!slots) {
  552. res = {};
  553. }
  554. else if (slots._normalized) {
  555. // fast path 1: child component re-render only, parent did not change
  556. return slots._normalized;
  557. }
  558. else {
  559. res = {};
  560. for (var key in slots) {
  561. if (slots[key] && key[0] !== '$') {
  562. res[key] = true;
  563. }
  564. }
  565. }
  566. // expose normal slots on scopedSlots
  567. for (var key in normalSlots) {
  568. if (!(key in res)) {
  569. res[key] = true;
  570. }
  571. }
  572. return res;
  573. }
  574. var vueInternalClasses;
  575. var getVueInternalClasses = function () {
  576. if (!vueInternalClasses) {
  577. var vm = defineComponentInstance(getVueConstructor(), {
  578. computed: {
  579. value: function () {
  580. return 0;
  581. },
  582. },
  583. });
  584. // to get Watcher class
  585. var Watcher = vm._computedWatchers.value.constructor;
  586. // to get Dep class
  587. var Dep = vm._data.__ob__.dep.constructor;
  588. vueInternalClasses = {
  589. Watcher: Watcher,
  590. Dep: Dep,
  591. };
  592. vm.$destroy();
  593. }
  594. return vueInternalClasses;
  595. };
  596. function createSymbol(name) {
  597. return hasSymbol ? Symbol.for(name) : name;
  598. }
  599. var WatcherPreFlushQueueKey = createSymbol('composition-api.preFlushQueue');
  600. var WatcherPostFlushQueueKey = createSymbol('composition-api.postFlushQueue');
  601. // must be a string, symbol key is ignored in reactive
  602. var RefKey = 'composition-api.refKey';
  603. var accessModifiedSet = new WeakMap();
  604. var rawSet = new WeakMap();
  605. var readonlySet = new WeakMap();
  606. /**
  607. * Set a property on an object. Adds the new property, triggers change
  608. * notification and intercept it's subsequent access if the property doesn't
  609. * already exist.
  610. */
  611. function set$1(target, key, val) {
  612. var Vue = getVueConstructor();
  613. // @ts-expect-error https://github.com/vuejs/vue/pull/12132
  614. var _a = Vue.util, warn = _a.warn, defineReactive = _a.defineReactive;
  615. if ((isUndef(target) || isPrimitive(target))) {
  616. warn("Cannot set reactive property on undefined, null, or primitive value: ".concat(target));
  617. }
  618. var ob = target.__ob__;
  619. function ssrMockReactivity() {
  620. // in SSR, there is no __ob__. Mock for reactivity check
  621. if (ob && isObject(val) && !hasOwn(val, '__ob__')) {
  622. mockReactivityDeep(val);
  623. }
  624. }
  625. if (isArray(target)) {
  626. if (isValidArrayIndex(key)) {
  627. target.length = Math.max(target.length, key);
  628. target.splice(key, 1, val);
  629. ssrMockReactivity();
  630. return val;
  631. }
  632. else if (key === 'length' && val !== target.length) {
  633. target.length = val;
  634. ob === null || ob === void 0 ? void 0 : ob.dep.notify();
  635. return val;
  636. }
  637. }
  638. if (key in target && !(key in Object.prototype)) {
  639. target[key] = val;
  640. ssrMockReactivity();
  641. return val;
  642. }
  643. if (target._isVue || (ob && ob.vmCount)) {
  644. warn('Avoid adding reactive properties to a Vue instance or its root $data ' +
  645. 'at runtime - declare it upfront in the data option.');
  646. return val;
  647. }
  648. if (!ob) {
  649. target[key] = val;
  650. return val;
  651. }
  652. defineReactive(ob.value, key, val);
  653. // IMPORTANT: define access control before trigger watcher
  654. defineAccessControl(target, key, val);
  655. ssrMockReactivity();
  656. ob.dep.notify();
  657. return val;
  658. }
  659. var _isForceTrigger = false;
  660. function isForceTrigger() {
  661. return _isForceTrigger;
  662. }
  663. function setForceTrigger(v) {
  664. _isForceTrigger = v;
  665. }
  666. var RefImpl = /** @class */ (function () {
  667. function RefImpl(_a) {
  668. var get = _a.get, set = _a.set;
  669. proxy(this, 'value', {
  670. get: get,
  671. set: set,
  672. });
  673. }
  674. return RefImpl;
  675. }());
  676. function createRef(options, isReadonly, isComputed) {
  677. if (isReadonly === void 0) { isReadonly = false; }
  678. if (isComputed === void 0) { isComputed = false; }
  679. var r = new RefImpl(options);
  680. // add effect to differentiate refs from computed
  681. if (isComputed)
  682. r.effect = true;
  683. // seal the ref, this could prevent ref from being observed
  684. // It's safe to seal the ref, since we really shouldn't extend it.
  685. // related issues: #79
  686. var sealed = Object.seal(r);
  687. if (isReadonly)
  688. readonlySet.set(sealed, true);
  689. return sealed;
  690. }
  691. function ref(raw) {
  692. var _a;
  693. if (isRef(raw)) {
  694. return raw;
  695. }
  696. var value = reactive((_a = {}, _a[RefKey] = raw, _a));
  697. return createRef({
  698. get: function () { return value[RefKey]; },
  699. set: function (v) { return (value[RefKey] = v); },
  700. });
  701. }
  702. function isRef(value) {
  703. return value instanceof RefImpl;
  704. }
  705. function unref(ref) {
  706. return isRef(ref) ? ref.value : ref;
  707. }
  708. function toRefs(obj) {
  709. if (!isReactive(obj)) {
  710. warn("toRefs() expects a reactive object but received a plain one.");
  711. }
  712. if (!isPlainObject(obj))
  713. return obj;
  714. var ret = {};
  715. for (var key in obj) {
  716. ret[key] = toRef(obj, key);
  717. }
  718. return ret;
  719. }
  720. function customRef(factory) {
  721. var version = ref(0);
  722. return createRef(factory(function () { return void version.value; }, function () {
  723. ++version.value;
  724. }));
  725. }
  726. function toRef(object, key) {
  727. if (!(key in object))
  728. set$1(object, key, undefined);
  729. var v = object[key];
  730. if (isRef(v))
  731. return v;
  732. return createRef({
  733. get: function () { return object[key]; },
  734. set: function (v) { return (object[key] = v); },
  735. });
  736. }
  737. function shallowRef(raw) {
  738. var _a;
  739. if (isRef(raw)) {
  740. return raw;
  741. }
  742. var value = shallowReactive((_a = {}, _a[RefKey] = raw, _a));
  743. return createRef({
  744. get: function () { return value[RefKey]; },
  745. set: function (v) { return (value[RefKey] = v); },
  746. });
  747. }
  748. function triggerRef(value) {
  749. if (!isRef(value))
  750. return;
  751. setForceTrigger(true);
  752. value.value = value.value;
  753. setForceTrigger(false);
  754. }
  755. function proxyRefs(objectWithRefs) {
  756. var _a, e_1, _b;
  757. if (isReactive(objectWithRefs)) {
  758. return objectWithRefs;
  759. }
  760. var value = reactive((_a = {}, _a[RefKey] = objectWithRefs, _a));
  761. def(value, RefKey, value[RefKey], false);
  762. var _loop_1 = function (key) {
  763. proxy(value, key, {
  764. get: function () {
  765. if (isRef(value[RefKey][key])) {
  766. return value[RefKey][key].value;
  767. }
  768. return value[RefKey][key];
  769. },
  770. set: function (v) {
  771. if (isRef(value[RefKey][key])) {
  772. return (value[RefKey][key].value = unref(v));
  773. }
  774. value[RefKey][key] = unref(v);
  775. },
  776. });
  777. };
  778. try {
  779. for (var _c = __values(Object.keys(objectWithRefs)), _d = _c.next(); !_d.done; _d = _c.next()) {
  780. var key = _d.value;
  781. _loop_1(key);
  782. }
  783. }
  784. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  785. finally {
  786. try {
  787. if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
  788. }
  789. finally { if (e_1) throw e_1.error; }
  790. }
  791. return value;
  792. }
  793. var SKIPFLAG = '__v_skip';
  794. function isRaw(obj) {
  795. var _a;
  796. return Boolean(obj &&
  797. hasOwn(obj, '__ob__') &&
  798. typeof obj.__ob__ === 'object' &&
  799. ((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a[SKIPFLAG]));
  800. }
  801. function isReactive(obj) {
  802. var _a;
  803. return Boolean(obj &&
  804. hasOwn(obj, '__ob__') &&
  805. typeof obj.__ob__ === 'object' &&
  806. !((_a = obj.__ob__) === null || _a === void 0 ? void 0 : _a[SKIPFLAG]));
  807. }
  808. /**
  809. * Proxing property access of target.
  810. * We can do unwrapping and other things here.
  811. */
  812. function setupAccessControl(target) {
  813. if (!isPlainObject(target) ||
  814. isRaw(target) ||
  815. isArray(target) ||
  816. isRef(target) ||
  817. isComponentInstance(target) ||
  818. accessModifiedSet.has(target))
  819. return;
  820. accessModifiedSet.set(target, true);
  821. var keys = Object.keys(target);
  822. for (var i = 0; i < keys.length; i++) {
  823. defineAccessControl(target, keys[i]);
  824. }
  825. }
  826. /**
  827. * Auto unwrapping when access property
  828. */
  829. function defineAccessControl(target, key, val) {
  830. if (key === '__ob__')
  831. return;
  832. if (isRaw(target[key]))
  833. return;
  834. var getter;
  835. var setter;
  836. var property = Object.getOwnPropertyDescriptor(target, key);
  837. if (property) {
  838. if (property.configurable === false) {
  839. return;
  840. }
  841. getter = property.get;
  842. setter = property.set;
  843. if ((!getter || setter) /* not only have getter */ &&
  844. arguments.length === 2) {
  845. val = target[key];
  846. }
  847. }
  848. setupAccessControl(val);
  849. proxy(target, key, {
  850. get: function getterHandler() {
  851. var value = getter ? getter.call(target) : val;
  852. // if the key is equal to RefKey, skip the unwrap logic
  853. if (key !== RefKey && isRef(value)) {
  854. return value.value;
  855. }
  856. else {
  857. return value;
  858. }
  859. },
  860. set: function setterHandler(newVal) {
  861. if (getter && !setter)
  862. return;
  863. // If the key is equal to RefKey, skip the unwrap logic
  864. // If and only if "value" is ref and "newVal" is not a ref,
  865. // the assignment should be proxied to "value" ref.
  866. if (key !== RefKey && isRef(val) && !isRef(newVal)) {
  867. val.value = newVal;
  868. }
  869. else if (setter) {
  870. setter.call(target, newVal);
  871. val = newVal;
  872. }
  873. else {
  874. val = newVal;
  875. }
  876. setupAccessControl(newVal);
  877. },
  878. });
  879. }
  880. function observe(obj) {
  881. var Vue = getRegisteredVueOrDefault();
  882. var observed;
  883. if (Vue.observable) {
  884. observed = Vue.observable(obj);
  885. }
  886. else {
  887. var vm = defineComponentInstance(Vue, {
  888. data: {
  889. $$state: obj,
  890. },
  891. });
  892. observed = vm._data.$$state;
  893. }
  894. // in SSR, there is no __ob__. Mock for reactivity check
  895. if (!hasOwn(observed, '__ob__')) {
  896. mockReactivityDeep(observed);
  897. }
  898. return observed;
  899. }
  900. /**
  901. * Mock __ob__ for object recursively
  902. */
  903. function mockReactivityDeep(obj, seen) {
  904. var e_1, _a;
  905. if (seen === void 0) { seen = new Set(); }
  906. if (seen.has(obj) || hasOwn(obj, '__ob__') || !Object.isExtensible(obj))
  907. return;
  908. def(obj, '__ob__', mockObserver(obj));
  909. seen.add(obj);
  910. try {
  911. for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
  912. var key = _c.value;
  913. var value = obj[key];
  914. if (!(isPlainObject(value) || isArray(value)) ||
  915. isRaw(value) ||
  916. !Object.isExtensible(value)) {
  917. continue;
  918. }
  919. mockReactivityDeep(value, seen);
  920. }
  921. }
  922. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  923. finally {
  924. try {
  925. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  926. }
  927. finally { if (e_1) throw e_1.error; }
  928. }
  929. }
  930. function mockObserver(value) {
  931. if (value === void 0) { value = {}; }
  932. return {
  933. value: value,
  934. dep: {
  935. notify: noopFn,
  936. depend: noopFn,
  937. addSub: noopFn,
  938. removeSub: noopFn,
  939. },
  940. };
  941. }
  942. function createObserver() {
  943. return observe({}).__ob__;
  944. }
  945. function shallowReactive(obj) {
  946. var e_2, _a;
  947. if (!isObject(obj)) {
  948. {
  949. warn('"shallowReactive()" must be called on an object.');
  950. }
  951. return obj;
  952. }
  953. if (!(isPlainObject(obj) || isArray(obj)) ||
  954. isRaw(obj) ||
  955. !Object.isExtensible(obj)) {
  956. return obj;
  957. }
  958. var observed = observe(isArray(obj) ? [] : {});
  959. var ob = observed.__ob__;
  960. var _loop_1 = function (key) {
  961. var val = obj[key];
  962. var getter;
  963. var setter;
  964. var property = Object.getOwnPropertyDescriptor(obj, key);
  965. if (property) {
  966. if (property.configurable === false) {
  967. return "continue";
  968. }
  969. getter = property.get;
  970. setter = property.set;
  971. }
  972. proxy(observed, key, {
  973. get: function getterHandler() {
  974. var _a;
  975. (_a = ob.dep) === null || _a === void 0 ? void 0 : _a.depend();
  976. return val;
  977. },
  978. set: function setterHandler(newVal) {
  979. var _a;
  980. if (getter && !setter)
  981. return;
  982. if (!isForceTrigger() && val === newVal)
  983. return;
  984. if (setter) {
  985. setter.call(obj, newVal);
  986. }
  987. else {
  988. val = newVal;
  989. }
  990. (_a = ob.dep) === null || _a === void 0 ? void 0 : _a.notify();
  991. },
  992. });
  993. };
  994. try {
  995. for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
  996. var key = _c.value;
  997. _loop_1(key);
  998. }
  999. }
  1000. catch (e_2_1) { e_2 = { error: e_2_1 }; }
  1001. finally {
  1002. try {
  1003. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  1004. }
  1005. finally { if (e_2) throw e_2.error; }
  1006. }
  1007. return observed;
  1008. }
  1009. /**
  1010. * Make obj reactivity
  1011. */
  1012. function reactive(obj) {
  1013. if (!isObject(obj)) {
  1014. {
  1015. warn('"reactive()" must be called on an object.');
  1016. }
  1017. return obj;
  1018. }
  1019. if (!(isPlainObject(obj) || isArray(obj)) ||
  1020. isRaw(obj) ||
  1021. !Object.isExtensible(obj)) {
  1022. return obj;
  1023. }
  1024. var observed = observe(obj);
  1025. setupAccessControl(observed);
  1026. return observed;
  1027. }
  1028. /**
  1029. * Make sure obj can't be a reactive
  1030. */
  1031. function markRaw(obj) {
  1032. if (!(isPlainObject(obj) || isArray(obj)) || !Object.isExtensible(obj)) {
  1033. return obj;
  1034. }
  1035. // set the vue observable flag at obj
  1036. var ob = createObserver();
  1037. ob[SKIPFLAG] = true;
  1038. def(obj, '__ob__', ob);
  1039. // mark as Raw
  1040. rawSet.set(obj, true);
  1041. return obj;
  1042. }
  1043. function toRaw(observed) {
  1044. var _a;
  1045. if (isRaw(observed) || !Object.isExtensible(observed)) {
  1046. return observed;
  1047. }
  1048. return ((_a = observed === null || observed === void 0 ? void 0 : observed.__ob__) === null || _a === void 0 ? void 0 : _a.value) || observed;
  1049. }
  1050. function isReadonly(obj) {
  1051. return readonlySet.has(obj);
  1052. }
  1053. /**
  1054. * **In @vue/composition-api, `reactive` only provides type-level readonly check**
  1055. *
  1056. * Creates a readonly copy of the original object. Note the returned copy is not
  1057. * made reactive, but `readonly` can be called on an already reactive object.
  1058. */
  1059. function readonly(target) {
  1060. if (!isObject(target)) {
  1061. warn("value cannot be made reactive: ".concat(String(target)));
  1062. }
  1063. else {
  1064. readonlySet.set(target, true);
  1065. }
  1066. return target;
  1067. }
  1068. function shallowReadonly(obj) {
  1069. var e_1, _a;
  1070. if (!isObject(obj)) {
  1071. {
  1072. warn("value cannot be made reactive: ".concat(String(obj)));
  1073. }
  1074. return obj;
  1075. }
  1076. if (!(isPlainObject(obj) || isArray(obj)) ||
  1077. (!Object.isExtensible(obj) && !isRef(obj))) {
  1078. return obj;
  1079. }
  1080. var readonlyObj = isRef(obj)
  1081. ? new RefImpl({})
  1082. : isReactive(obj)
  1083. ? observe({})
  1084. : {};
  1085. var source = reactive({});
  1086. var ob = source.__ob__;
  1087. var _loop_1 = function (key) {
  1088. var val = obj[key];
  1089. var getter;
  1090. var property = Object.getOwnPropertyDescriptor(obj, key);
  1091. if (property) {
  1092. if (property.configurable === false && !isRef(obj)) {
  1093. return "continue";
  1094. }
  1095. getter = property.get;
  1096. }
  1097. proxy(readonlyObj, key, {
  1098. get: function getterHandler() {
  1099. var value = getter ? getter.call(obj) : val;
  1100. ob.dep.depend();
  1101. return value;
  1102. },
  1103. set: function (v) {
  1104. {
  1105. warn("Set operation on key \"".concat(key, "\" failed: target is readonly."));
  1106. }
  1107. },
  1108. });
  1109. };
  1110. try {
  1111. for (var _b = __values(Object.keys(obj)), _c = _b.next(); !_c.done; _c = _b.next()) {
  1112. var key = _c.value;
  1113. _loop_1(key);
  1114. }
  1115. }
  1116. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  1117. finally {
  1118. try {
  1119. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  1120. }
  1121. finally { if (e_1) throw e_1.error; }
  1122. }
  1123. readonlySet.set(readonlyObj, true);
  1124. return readonlyObj;
  1125. }
  1126. /**
  1127. * Delete a property and trigger change if necessary.
  1128. */
  1129. function del(target, key) {
  1130. var Vue = getVueConstructor();
  1131. var warn = Vue.util.warn;
  1132. if ((isUndef(target) || isPrimitive(target))) {
  1133. warn("Cannot delete reactive property on undefined, null, or primitive value: ".concat(target));
  1134. }
  1135. if (isArray(target) && isValidArrayIndex(key)) {
  1136. target.splice(key, 1);
  1137. return;
  1138. }
  1139. var ob = target.__ob__;
  1140. if (target._isVue || (ob && ob.vmCount)) {
  1141. warn('Avoid deleting properties on a Vue instance or its root $data ' +
  1142. '- just set it to null.');
  1143. return;
  1144. }
  1145. if (!hasOwn(target, key)) {
  1146. return;
  1147. }
  1148. delete target[key];
  1149. if (!ob) {
  1150. return;
  1151. }
  1152. ob.dep.notify();
  1153. }
  1154. var genName = function (name) { return "on".concat(name[0].toUpperCase() + name.slice(1)); };
  1155. function createLifeCycle(lifeCyclehook) {
  1156. return function (callback, target) {
  1157. var instance = getCurrentInstanceForFn(genName(lifeCyclehook), target);
  1158. return (instance &&
  1159. injectHookOption(getVueConstructor(), instance, lifeCyclehook, callback));
  1160. };
  1161. }
  1162. function injectHookOption(Vue, instance, hook, val) {
  1163. var options = instance.proxy.$options;
  1164. var mergeFn = Vue.config.optionMergeStrategies[hook];
  1165. var wrappedHook = wrapHookCall(instance, val);
  1166. options[hook] = mergeFn(options[hook], wrappedHook);
  1167. return wrappedHook;
  1168. }
  1169. function wrapHookCall(instance, fn) {
  1170. return function () {
  1171. var args = [];
  1172. for (var _i = 0; _i < arguments.length; _i++) {
  1173. args[_i] = arguments[_i];
  1174. }
  1175. var prev = getCurrentInstance();
  1176. setCurrentInstance(instance);
  1177. try {
  1178. return fn.apply(void 0, __spreadArray([], __read(args), false));
  1179. }
  1180. finally {
  1181. setCurrentInstance(prev);
  1182. }
  1183. };
  1184. }
  1185. var onBeforeMount = createLifeCycle('beforeMount');
  1186. var onMounted = createLifeCycle('mounted');
  1187. var onBeforeUpdate = createLifeCycle('beforeUpdate');
  1188. var onUpdated = createLifeCycle('updated');
  1189. var onBeforeUnmount = createLifeCycle('beforeDestroy');
  1190. var onUnmounted = createLifeCycle('destroyed');
  1191. var onErrorCaptured = createLifeCycle('errorCaptured');
  1192. var onActivated = createLifeCycle('activated');
  1193. var onDeactivated = createLifeCycle('deactivated');
  1194. var onServerPrefetch = createLifeCycle('serverPrefetch');
  1195. var fallbackVM;
  1196. function flushPreQueue() {
  1197. flushQueue(this, WatcherPreFlushQueueKey);
  1198. }
  1199. function flushPostQueue() {
  1200. flushQueue(this, WatcherPostFlushQueueKey);
  1201. }
  1202. function hasWatchEnv(vm) {
  1203. return vm[WatcherPreFlushQueueKey] !== undefined;
  1204. }
  1205. function installWatchEnv(vm) {
  1206. vm[WatcherPreFlushQueueKey] = [];
  1207. vm[WatcherPostFlushQueueKey] = [];
  1208. vm.$on('hook:beforeUpdate', flushPreQueue);
  1209. vm.$on('hook:updated', flushPostQueue);
  1210. }
  1211. function getWatcherOption(options) {
  1212. return __assign({
  1213. immediate: false,
  1214. deep: false,
  1215. flush: 'pre',
  1216. }, options);
  1217. }
  1218. function getWatchEffectOption(options) {
  1219. return __assign({
  1220. flush: 'pre',
  1221. }, options);
  1222. }
  1223. function getWatcherVM() {
  1224. var vm = getCurrentScopeVM();
  1225. if (!vm) {
  1226. if (!fallbackVM) {
  1227. fallbackVM = defineComponentInstance(getVueConstructor());
  1228. }
  1229. vm = fallbackVM;
  1230. }
  1231. else if (!hasWatchEnv(vm)) {
  1232. installWatchEnv(vm);
  1233. }
  1234. return vm;
  1235. }
  1236. function flushQueue(vm, key) {
  1237. var queue = vm[key];
  1238. for (var index = 0; index < queue.length; index++) {
  1239. queue[index]();
  1240. }
  1241. queue.length = 0;
  1242. }
  1243. function queueFlushJob(vm, fn, mode) {
  1244. // flush all when beforeUpdate and updated are not fired
  1245. var fallbackFlush = function () {
  1246. vm.$nextTick(function () {
  1247. if (vm[WatcherPreFlushQueueKey].length) {
  1248. flushQueue(vm, WatcherPreFlushQueueKey);
  1249. }
  1250. if (vm[WatcherPostFlushQueueKey].length) {
  1251. flushQueue(vm, WatcherPostFlushQueueKey);
  1252. }
  1253. });
  1254. };
  1255. switch (mode) {
  1256. case 'pre':
  1257. fallbackFlush();
  1258. vm[WatcherPreFlushQueueKey].push(fn);
  1259. break;
  1260. case 'post':
  1261. fallbackFlush();
  1262. vm[WatcherPostFlushQueueKey].push(fn);
  1263. break;
  1264. default:
  1265. assert(false, "flush must be one of [\"post\", \"pre\", \"sync\"], but got ".concat(mode));
  1266. break;
  1267. }
  1268. }
  1269. function createVueWatcher(vm, getter, callback, options) {
  1270. var index = vm._watchers.length;
  1271. // @ts-ignore: use undocumented options
  1272. vm.$watch(getter, callback, {
  1273. immediate: options.immediateInvokeCallback,
  1274. deep: options.deep,
  1275. lazy: options.noRun,
  1276. sync: options.sync,
  1277. before: options.before,
  1278. });
  1279. return vm._watchers[index];
  1280. }
  1281. // We have to monkeypatch the teardown function so Vue will run
  1282. // runCleanup() when it tears down the watcher on unmounted.
  1283. function patchWatcherTeardown(watcher, runCleanup) {
  1284. var _teardown = watcher.teardown;
  1285. watcher.teardown = function () {
  1286. var args = [];
  1287. for (var _i = 0; _i < arguments.length; _i++) {
  1288. args[_i] = arguments[_i];
  1289. }
  1290. _teardown.apply(watcher, args);
  1291. runCleanup();
  1292. };
  1293. }
  1294. function createWatcher(vm, source, cb, options) {
  1295. var _a;
  1296. if (!cb) {
  1297. if (options.immediate !== undefined) {
  1298. warn("watch() \"immediate\" option is only respected when using the " +
  1299. "watch(source, callback, options?) signature.");
  1300. }
  1301. if (options.deep !== undefined) {
  1302. warn("watch() \"deep\" option is only respected when using the " +
  1303. "watch(source, callback, options?) signature.");
  1304. }
  1305. }
  1306. var flushMode = options.flush;
  1307. var isSync = flushMode === 'sync';
  1308. var cleanup;
  1309. var registerCleanup = function (fn) {
  1310. cleanup = function () {
  1311. try {
  1312. fn();
  1313. }
  1314. catch (
  1315. // FIXME: remove any
  1316. error) {
  1317. logError(error, vm, 'onCleanup()');
  1318. }
  1319. };
  1320. };
  1321. // cleanup before running getter again
  1322. var runCleanup = function () {
  1323. if (cleanup) {
  1324. cleanup();
  1325. cleanup = null;
  1326. }
  1327. };
  1328. var createScheduler = function (fn) {
  1329. if (isSync ||
  1330. /* without a current active instance, ignore pre|post mode */ vm ===
  1331. fallbackVM) {
  1332. return fn;
  1333. }
  1334. return (function () {
  1335. var args = [];
  1336. for (var _i = 0; _i < arguments.length; _i++) {
  1337. args[_i] = arguments[_i];
  1338. }
  1339. return queueFlushJob(vm, function () {
  1340. fn.apply(void 0, __spreadArray([], __read(args), false));
  1341. }, flushMode);
  1342. });
  1343. };
  1344. // effect watch
  1345. if (cb === null) {
  1346. var running_1 = false;
  1347. var getter_1 = function () {
  1348. // preventing the watch callback being call in the same execution
  1349. if (running_1) {
  1350. return;
  1351. }
  1352. try {
  1353. running_1 = true;
  1354. source(registerCleanup);
  1355. }
  1356. finally {
  1357. running_1 = false;
  1358. }
  1359. };
  1360. var watcher_1 = createVueWatcher(vm, getter_1, noopFn, {
  1361. deep: options.deep || false,
  1362. sync: isSync,
  1363. before: runCleanup,
  1364. });
  1365. patchWatcherTeardown(watcher_1, runCleanup);
  1366. // enable the watcher update
  1367. watcher_1.lazy = false;
  1368. var originGet = watcher_1.get.bind(watcher_1);
  1369. // always run watchEffect
  1370. watcher_1.get = createScheduler(originGet);
  1371. return function () {
  1372. watcher_1.teardown();
  1373. };
  1374. }
  1375. var deep = options.deep;
  1376. var isMultiSource = false;
  1377. var getter;
  1378. if (isRef(source)) {
  1379. getter = function () { return source.value; };
  1380. }
  1381. else if (isReactive(source)) {
  1382. getter = function () { return source; };
  1383. deep = true;
  1384. }
  1385. else if (isArray(source)) {
  1386. isMultiSource = true;
  1387. getter = function () {
  1388. return source.map(function (s) {
  1389. if (isRef(s)) {
  1390. return s.value;
  1391. }
  1392. else if (isReactive(s)) {
  1393. return traverse(s);
  1394. }
  1395. else if (isFunction(s)) {
  1396. return s();
  1397. }
  1398. else {
  1399. warn("Invalid watch source: ".concat(JSON.stringify(s), ".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."), vm);
  1400. return noopFn;
  1401. }
  1402. });
  1403. };
  1404. }
  1405. else if (isFunction(source)) {
  1406. getter = source;
  1407. }
  1408. else {
  1409. getter = noopFn;
  1410. warn("Invalid watch source: ".concat(JSON.stringify(source), ".\n A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."), vm);
  1411. }
  1412. if (deep) {
  1413. var baseGetter_1 = getter;
  1414. getter = function () { return traverse(baseGetter_1()); };
  1415. }
  1416. var applyCb = function (n, o) {
  1417. if (!deep &&
  1418. isMultiSource &&
  1419. n.every(function (v, i) { return isSame(v, o[i]); }))
  1420. return;
  1421. // cleanup before running cb again
  1422. runCleanup();
  1423. return cb(n, o, registerCleanup);
  1424. };
  1425. var callback = createScheduler(applyCb);
  1426. if (options.immediate) {
  1427. var originalCallback_1 = callback;
  1428. // `shiftCallback` is used to handle the first sync effect run.
  1429. // The subsequent callbacks will redirect to `callback`.
  1430. var shiftCallback_1 = function (n, o) {
  1431. shiftCallback_1 = originalCallback_1;
  1432. // o is undefined on the first call
  1433. return applyCb(n, isArray(n) ? [] : o);
  1434. };
  1435. callback = function (n, o) {
  1436. return shiftCallback_1(n, o);
  1437. };
  1438. }
  1439. // @ts-ignore: use undocumented option "sync"
  1440. var stop = vm.$watch(getter, callback, {
  1441. immediate: options.immediate,
  1442. deep: deep,
  1443. sync: isSync,
  1444. });
  1445. // Once again, we have to hack the watcher for proper teardown
  1446. var watcher = vm._watchers[vm._watchers.length - 1];
  1447. // if the return value is reactive and deep:true
  1448. // watch for changes, this might happen when new key is added
  1449. if (isReactive(watcher.value) && ((_a = watcher.value.__ob__) === null || _a === void 0 ? void 0 : _a.dep) && deep) {
  1450. watcher.value.__ob__.dep.addSub({
  1451. update: function () {
  1452. // this will force the source to be revaluated and the callback
  1453. // executed if needed
  1454. watcher.run();
  1455. },
  1456. });
  1457. }
  1458. patchWatcherTeardown(watcher, runCleanup);
  1459. return function () {
  1460. stop();
  1461. };
  1462. }
  1463. function watchEffect(effect, options) {
  1464. var opts = getWatchEffectOption(options);
  1465. var vm = getWatcherVM();
  1466. return createWatcher(vm, effect, null, opts);
  1467. }
  1468. function watchPostEffect(effect) {
  1469. return watchEffect(effect, { flush: 'post' });
  1470. }
  1471. function watchSyncEffect(effect) {
  1472. return watchEffect(effect, { flush: 'sync' });
  1473. }
  1474. // implementation
  1475. function watch(source, cb, options) {
  1476. var callback = null;
  1477. if (isFunction(cb)) {
  1478. // source watch
  1479. callback = cb;
  1480. }
  1481. else {
  1482. // effect watch
  1483. {
  1484. warn("`watch(fn, options?)` signature has been moved to a separate API. " +
  1485. "Use `watchEffect(fn, options?)` instead. `watch` now only " +
  1486. "supports `watch(source, cb, options?) signature.");
  1487. }
  1488. options = cb;
  1489. callback = null;
  1490. }
  1491. var opts = getWatcherOption(options);
  1492. var vm = getWatcherVM();
  1493. return createWatcher(vm, source, callback, opts);
  1494. }
  1495. function traverse(value, seen) {
  1496. if (seen === void 0) { seen = new Set(); }
  1497. if (!isObject(value) || seen.has(value) || rawSet.has(value)) {
  1498. return value;
  1499. }
  1500. seen.add(value);
  1501. if (isRef(value)) {
  1502. traverse(value.value, seen);
  1503. }
  1504. else if (isArray(value)) {
  1505. for (var i = 0; i < value.length; i++) {
  1506. traverse(value[i], seen);
  1507. }
  1508. }
  1509. else if (isSet(value) || isMap(value)) {
  1510. value.forEach(function (v) {
  1511. traverse(v, seen);
  1512. });
  1513. }
  1514. else if (isPlainObject(value)) {
  1515. for (var key in value) {
  1516. traverse(value[key], seen);
  1517. }
  1518. }
  1519. return value;
  1520. }
  1521. // implement
  1522. function computed(getterOrOptions) {
  1523. var vm = getCurrentScopeVM();
  1524. var getter;
  1525. var setter;
  1526. if (isFunction(getterOrOptions)) {
  1527. getter = getterOrOptions;
  1528. }
  1529. else {
  1530. getter = getterOrOptions.get;
  1531. setter = getterOrOptions.set;
  1532. }
  1533. var computedSetter;
  1534. var computedGetter;
  1535. if (vm && !vm.$isServer) {
  1536. var _a = getVueInternalClasses(), Watcher_1 = _a.Watcher, Dep_1 = _a.Dep;
  1537. var watcher_1;
  1538. computedGetter = function () {
  1539. if (!watcher_1) {
  1540. watcher_1 = new Watcher_1(vm, getter, noopFn, { lazy: true });
  1541. }
  1542. if (watcher_1.dirty) {
  1543. watcher_1.evaluate();
  1544. }
  1545. if (Dep_1.target) {
  1546. watcher_1.depend();
  1547. }
  1548. return watcher_1.value;
  1549. };
  1550. computedSetter = function (v) {
  1551. if (!setter) {
  1552. warn('Write operation failed: computed value is readonly.', vm);
  1553. return;
  1554. }
  1555. if (setter) {
  1556. setter(v);
  1557. }
  1558. };
  1559. }
  1560. else {
  1561. // fallback
  1562. var computedHost_1 = defineComponentInstance(getVueConstructor(), {
  1563. computed: {
  1564. $$state: {
  1565. get: getter,
  1566. set: setter,
  1567. },
  1568. },
  1569. });
  1570. vm && vm.$on('hook:destroyed', function () { return computedHost_1.$destroy(); });
  1571. computedGetter = function () { return computedHost_1.$$state; };
  1572. computedSetter = function (v) {
  1573. if (!setter) {
  1574. warn('Write operation failed: computed value is readonly.', vm);
  1575. return;
  1576. }
  1577. computedHost_1.$$state = v;
  1578. };
  1579. }
  1580. return createRef({
  1581. get: computedGetter,
  1582. set: computedSetter,
  1583. }, !setter, true);
  1584. }
  1585. var NOT_FOUND = {};
  1586. function resolveInject(provideKey, vm) {
  1587. var source = vm;
  1588. while (source) {
  1589. // @ts-ignore
  1590. if (source._provided && hasOwn(source._provided, provideKey)) {
  1591. //@ts-ignore
  1592. return source._provided[provideKey];
  1593. }
  1594. source = source.$parent;
  1595. }
  1596. return NOT_FOUND;
  1597. }
  1598. function provide(key, value) {
  1599. var _a;
  1600. var vm = (_a = getCurrentInstanceForFn('provide')) === null || _a === void 0 ? void 0 : _a.proxy;
  1601. if (!vm)
  1602. return;
  1603. if (!vm._provided) {
  1604. var provideCache_1 = {};
  1605. proxy(vm, '_provided', {
  1606. get: function () { return provideCache_1; },
  1607. set: function (v) { return Object.assign(provideCache_1, v); },
  1608. });
  1609. }
  1610. vm._provided[key] = value;
  1611. }
  1612. function inject(key, defaultValue, treatDefaultAsFactory) {
  1613. var _a;
  1614. if (treatDefaultAsFactory === void 0) { treatDefaultAsFactory = false; }
  1615. var vm = (_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy;
  1616. if (!vm) {
  1617. warn("inject() can only be used inside setup() or functional components.");
  1618. return;
  1619. }
  1620. if (!key) {
  1621. warn("injection \"".concat(String(key), "\" not found."), vm);
  1622. return defaultValue;
  1623. }
  1624. var val = resolveInject(key, vm);
  1625. if (val !== NOT_FOUND) {
  1626. return val;
  1627. }
  1628. else if (arguments.length > 1) {
  1629. return treatDefaultAsFactory && isFunction(defaultValue)
  1630. ? defaultValue()
  1631. : defaultValue;
  1632. }
  1633. else {
  1634. warn("Injection \"".concat(String(key), "\" not found."), vm);
  1635. }
  1636. }
  1637. var EMPTY_OBJ = Object.freeze({})
  1638. ;
  1639. var useCssModule = function (name) {
  1640. var _a;
  1641. if (name === void 0) { name = '$style'; }
  1642. var instance = getCurrentInstance();
  1643. if (!instance) {
  1644. warn("useCssModule must be called inside setup()");
  1645. return EMPTY_OBJ;
  1646. }
  1647. var mod = (_a = instance.proxy) === null || _a === void 0 ? void 0 : _a[name];
  1648. if (!mod) {
  1649. warn("Current instance does not have CSS module named \"".concat(name, "\"."));
  1650. return EMPTY_OBJ;
  1651. }
  1652. return mod;
  1653. };
  1654. /**
  1655. * @deprecated use `useCssModule` instead.
  1656. */
  1657. var useCSSModule = useCssModule;
  1658. function createApp(rootComponent, rootProps) {
  1659. if (rootProps === void 0) { rootProps = undefined; }
  1660. var V = getVueConstructor();
  1661. var mountedVM = undefined;
  1662. var provide = {};
  1663. var app = {
  1664. config: V.config,
  1665. use: V.use.bind(V),
  1666. mixin: V.mixin.bind(V),
  1667. component: V.component.bind(V),
  1668. provide: function (key, value) {
  1669. provide[key] = value;
  1670. return this;
  1671. },
  1672. directive: function (name, dir) {
  1673. if (dir) {
  1674. V.directive(name, dir);
  1675. return app;
  1676. }
  1677. else {
  1678. return V.directive(name);
  1679. }
  1680. },
  1681. mount: function (el, hydrating) {
  1682. if (!mountedVM) {
  1683. mountedVM = new V(__assign(__assign({ propsData: rootProps }, rootComponent), { provide: __assign(__assign({}, provide), rootComponent.provide) }));
  1684. mountedVM.$mount(el, hydrating);
  1685. return mountedVM;
  1686. }
  1687. else {
  1688. {
  1689. warn("App has already been mounted.\n" +
  1690. "If you want to remount the same app, move your app creation logic " +
  1691. "into a factory function and create fresh app instances for each " +
  1692. "mount - e.g. `const createMyApp = () => createApp(App)`");
  1693. }
  1694. return mountedVM;
  1695. }
  1696. },
  1697. unmount: function () {
  1698. if (mountedVM) {
  1699. mountedVM.$destroy();
  1700. mountedVM = undefined;
  1701. }
  1702. else {
  1703. warn("Cannot unmount an app that is not mounted.");
  1704. }
  1705. },
  1706. };
  1707. return app;
  1708. }
  1709. var nextTick = function nextTick() {
  1710. var _a;
  1711. var args = [];
  1712. for (var _i = 0; _i < arguments.length; _i++) {
  1713. args[_i] = arguments[_i];
  1714. }
  1715. return (_a = getVueConstructor()) === null || _a === void 0 ? void 0 : _a.nextTick.apply(this, args);
  1716. };
  1717. var fallbackCreateElement;
  1718. var createElement = function createElement() {
  1719. var _a;
  1720. var args = [];
  1721. for (var _i = 0; _i < arguments.length; _i++) {
  1722. args[_i] = arguments[_i];
  1723. }
  1724. var instance = (this === null || this === void 0 ? void 0 : this.proxy) || ((_a = getCurrentInstance()) === null || _a === void 0 ? void 0 : _a.proxy);
  1725. if (!instance) {
  1726. warn('`createElement()` has been called outside of render function.');
  1727. if (!fallbackCreateElement) {
  1728. fallbackCreateElement = defineComponentInstance(getVueConstructor()).$createElement;
  1729. }
  1730. return fallbackCreateElement.apply(fallbackCreateElement, args);
  1731. }
  1732. return instance.$createElement.apply(instance, args);
  1733. };
  1734. function useSlots() {
  1735. return getContext().slots;
  1736. }
  1737. function useAttrs() {
  1738. return getContext().attrs;
  1739. }
  1740. function getContext() {
  1741. var i = getCurrentInstance();
  1742. if (!i) {
  1743. warn("useContext() called without active instance.");
  1744. }
  1745. return i.setupContext;
  1746. }
  1747. function set(vm, key, value) {
  1748. var state = (vm.__composition_api_state__ =
  1749. vm.__composition_api_state__ || {});
  1750. state[key] = value;
  1751. }
  1752. function get(vm, key) {
  1753. return (vm.__composition_api_state__ || {})[key];
  1754. }
  1755. var vmStateManager = {
  1756. set: set,
  1757. get: get,
  1758. };
  1759. function asVmProperty(vm, propName, propValue) {
  1760. var props = vm.$options.props;
  1761. if (!(propName in vm) && !(props && hasOwn(props, propName))) {
  1762. if (isRef(propValue)) {
  1763. proxy(vm, propName, {
  1764. get: function () { return propValue.value; },
  1765. set: function (val) {
  1766. propValue.value = val;
  1767. },
  1768. });
  1769. }
  1770. else {
  1771. proxy(vm, propName, {
  1772. get: function () {
  1773. if (isReactive(propValue)) {
  1774. propValue.__ob__.dep.depend();
  1775. }
  1776. return propValue;
  1777. },
  1778. set: function (val) {
  1779. propValue = val;
  1780. },
  1781. });
  1782. }
  1783. {
  1784. // expose binding to Vue Devtool as a data property
  1785. // delay this until state has been resolved to prevent repeated works
  1786. vm.$nextTick(function () {
  1787. if (Object.keys(vm._data).indexOf(propName) !== -1) {
  1788. return;
  1789. }
  1790. if (isRef(propValue)) {
  1791. proxy(vm._data, propName, {
  1792. get: function () { return propValue.value; },
  1793. set: function (val) {
  1794. propValue.value = val;
  1795. },
  1796. });
  1797. }
  1798. else {
  1799. proxy(vm._data, propName, {
  1800. get: function () { return propValue; },
  1801. set: function (val) {
  1802. propValue = val;
  1803. },
  1804. });
  1805. }
  1806. });
  1807. }
  1808. }
  1809. else {
  1810. if (props && hasOwn(props, propName)) {
  1811. warn("The setup binding property \"".concat(propName, "\" is already declared as a prop."), vm);
  1812. }
  1813. else {
  1814. warn("The setup binding property \"".concat(propName, "\" is already declared."), vm);
  1815. }
  1816. }
  1817. }
  1818. function updateTemplateRef(vm) {
  1819. var rawBindings = vmStateManager.get(vm, 'rawBindings') || {};
  1820. if (!rawBindings || !Object.keys(rawBindings).length)
  1821. return;
  1822. var refs = vm.$refs;
  1823. var oldRefKeys = vmStateManager.get(vm, 'refs') || [];
  1824. for (var index = 0; index < oldRefKeys.length; index++) {
  1825. var key = oldRefKeys[index];
  1826. var setupValue = rawBindings[key];
  1827. if (!refs[key] && setupValue && isRef(setupValue)) {
  1828. setupValue.value = null;
  1829. }
  1830. }
  1831. var newKeys = Object.keys(refs);
  1832. var validNewKeys = [];
  1833. for (var index = 0; index < newKeys.length; index++) {
  1834. var key = newKeys[index];
  1835. var setupValue = rawBindings[key];
  1836. if (refs[key] && setupValue && isRef(setupValue)) {
  1837. setupValue.value = refs[key];
  1838. validNewKeys.push(key);
  1839. }
  1840. }
  1841. vmStateManager.set(vm, 'refs', validNewKeys);
  1842. }
  1843. function afterRender(vm) {
  1844. var stack = [vm._vnode];
  1845. var updated;
  1846. while (stack.length) {
  1847. var vnode = stack.pop();
  1848. if (vnode) {
  1849. if (vnode.context) {
  1850. updateTemplateRef(vnode.context);
  1851. updated = true;
  1852. }
  1853. if (vnode.children) {
  1854. for (var i = 0; i < vnode.children.length; ++i) {
  1855. stack.push(vnode.children[i]);
  1856. }
  1857. }
  1858. }
  1859. }
  1860. if (!updated) {
  1861. updateTemplateRef(vm);
  1862. }
  1863. }
  1864. function updateVmAttrs(vm, ctx) {
  1865. var e_1, _a;
  1866. if (!vm) {
  1867. return;
  1868. }
  1869. var attrBindings = vmStateManager.get(vm, 'attrBindings');
  1870. if (!attrBindings && !ctx) {
  1871. // fix 840
  1872. return;
  1873. }
  1874. if (!attrBindings) {
  1875. var observedData = reactive({});
  1876. attrBindings = { ctx: ctx, data: observedData };
  1877. vmStateManager.set(vm, 'attrBindings', attrBindings);
  1878. proxy(ctx, 'attrs', {
  1879. get: function () {
  1880. return attrBindings === null || attrBindings === void 0 ? void 0 : attrBindings.data;
  1881. },
  1882. set: function () {
  1883. warn("Cannot assign to '$attrs' because it is a read-only property", vm);
  1884. },
  1885. });
  1886. }
  1887. var source = vm.$attrs;
  1888. var _loop_1 = function (attr) {
  1889. if (!hasOwn(attrBindings.data, attr)) {
  1890. proxy(attrBindings.data, attr, {
  1891. get: function () {
  1892. // to ensure it always return the latest value
  1893. return vm.$attrs[attr];
  1894. },
  1895. });
  1896. }
  1897. };
  1898. try {
  1899. for (var _b = __values(Object.keys(source)), _c = _b.next(); !_c.done; _c = _b.next()) {
  1900. var attr = _c.value;
  1901. _loop_1(attr);
  1902. }
  1903. }
  1904. catch (e_1_1) { e_1 = { error: e_1_1 }; }
  1905. finally {
  1906. try {
  1907. if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
  1908. }
  1909. finally { if (e_1) throw e_1.error; }
  1910. }
  1911. }
  1912. function resolveScopedSlots(vm, slotsProxy) {
  1913. var parentVNode = vm.$options._parentVnode;
  1914. if (!parentVNode)
  1915. return;
  1916. var prevSlots = vmStateManager.get(vm, 'slots') || [];
  1917. var curSlots = resolveSlots(parentVNode.data.scopedSlots, vm.$slots);
  1918. // remove staled slots
  1919. for (var index = 0; index < prevSlots.length; index++) {
  1920. var key = prevSlots[index];
  1921. if (!curSlots[key]) {
  1922. delete slotsProxy[key];
  1923. }
  1924. }
  1925. // proxy fresh slots
  1926. var slotNames = Object.keys(curSlots);
  1927. for (var index = 0; index < slotNames.length; index++) {
  1928. var key = slotNames[index];
  1929. if (!slotsProxy[key]) {
  1930. slotsProxy[key] = createSlotProxy(vm, key);
  1931. }
  1932. }
  1933. vmStateManager.set(vm, 'slots', slotNames);
  1934. }
  1935. function activateCurrentInstance(instance, fn, onError) {
  1936. var preVm = getCurrentInstance();
  1937. setCurrentInstance(instance);
  1938. try {
  1939. return fn(instance);
  1940. }
  1941. catch (
  1942. // FIXME: remove any
  1943. err) {
  1944. if (onError) {
  1945. onError(err);
  1946. }
  1947. else {
  1948. throw err;
  1949. }
  1950. }
  1951. finally {
  1952. setCurrentInstance(preVm);
  1953. }
  1954. }
  1955. function mixin(Vue) {
  1956. Vue.mixin({
  1957. beforeCreate: functionApiInit,
  1958. mounted: function () {
  1959. afterRender(this);
  1960. },
  1961. beforeUpdate: function () {
  1962. updateVmAttrs(this);
  1963. },
  1964. updated: function () {
  1965. afterRender(this);
  1966. },
  1967. });
  1968. /**
  1969. * Vuex init hook, injected into each instances init hooks list.
  1970. */
  1971. function functionApiInit() {
  1972. var vm = this;
  1973. var $options = vm.$options;
  1974. var setup = $options.setup, render = $options.render;
  1975. if (render) {
  1976. // keep currentInstance accessible for createElement
  1977. $options.render = function () {
  1978. var _this = this;
  1979. var args = [];
  1980. for (var _i = 0; _i < arguments.length; _i++) {
  1981. args[_i] = arguments[_i];
  1982. }
  1983. return activateCurrentInstance(toVue3ComponentInstance(vm), function () {
  1984. return render.apply(_this, args);
  1985. });
  1986. };
  1987. }
  1988. if (!setup) {
  1989. return;
  1990. }
  1991. if (!isFunction(setup)) {
  1992. {
  1993. warn('The "setup" option should be a function that returns a object in component definitions.', vm);
  1994. }
  1995. return;
  1996. }
  1997. var data = $options.data;
  1998. // wrapper the data option, so we can invoke setup before data get resolved
  1999. $options.data = function wrappedData() {
  2000. initSetup(vm, vm.$props);
  2001. return isFunction(data)
  2002. ? data.call(vm, vm)
  2003. : data || {};
  2004. };
  2005. }
  2006. function initSetup(vm, props) {
  2007. if (props === void 0) { props = {}; }
  2008. var setup = vm.$options.setup;
  2009. var ctx = createSetupContext(vm);
  2010. var instance = toVue3ComponentInstance(vm);
  2011. instance.setupContext = ctx;
  2012. // fake reactive for `toRefs(props)`
  2013. def(props, '__ob__', createObserver());
  2014. // resolve scopedSlots and slots to functions
  2015. resolveScopedSlots(vm, ctx.slots);
  2016. var binding;
  2017. activateCurrentInstance(instance, function () {
  2018. // make props to be fake reactive, this is for `toRefs(props)`
  2019. binding = setup(props, ctx);
  2020. });
  2021. if (!binding)
  2022. return;
  2023. if (isFunction(binding)) {
  2024. // keep typescript happy with the binding type.
  2025. var bindingFunc_1 = binding;
  2026. // keep currentInstance accessible for createElement
  2027. vm.$options.render = function () {
  2028. resolveScopedSlots(vm, ctx.slots);
  2029. return activateCurrentInstance(instance, function () { return bindingFunc_1(); });
  2030. };
  2031. return;
  2032. }
  2033. else if (isObject(binding)) {
  2034. if (isReactive(binding)) {
  2035. binding = toRefs(binding);
  2036. }
  2037. vmStateManager.set(vm, 'rawBindings', binding);
  2038. var bindingObj_1 = binding;
  2039. Object.keys(bindingObj_1).forEach(function (name) {
  2040. var bindingValue = bindingObj_1[name];
  2041. if (!isRef(bindingValue)) {
  2042. if (!isReactive(bindingValue)) {
  2043. if (isFunction(bindingValue)) {
  2044. var copy_1 = bindingValue;
  2045. bindingValue = bindingValue.bind(vm);
  2046. Object.keys(copy_1).forEach(function (ele) {
  2047. bindingValue[ele] = copy_1[ele];
  2048. });
  2049. }
  2050. else if (!isObject(bindingValue)) {
  2051. bindingValue = ref(bindingValue);
  2052. }
  2053. else if (hasReactiveArrayChild(bindingValue)) {
  2054. // creates a custom reactive properties without make the object explicitly reactive
  2055. // NOTE we should try to avoid this, better implementation needed
  2056. customReactive(bindingValue);
  2057. }
  2058. }
  2059. else if (isArray(bindingValue)) {
  2060. bindingValue = ref(bindingValue);
  2061. }
  2062. }
  2063. asVmProperty(vm, name, bindingValue);
  2064. });
  2065. return;
  2066. }
  2067. {
  2068. assert(false, "\"setup\" must return a \"Object\" or a \"Function\", got \"".concat(Object.prototype.toString
  2069. .call(binding)
  2070. .slice(8, -1), "\""));
  2071. }
  2072. }
  2073. function customReactive(target, seen) {
  2074. if (seen === void 0) { seen = new Set(); }
  2075. if (seen.has(target))
  2076. return;
  2077. if (!isPlainObject(target) ||
  2078. isRef(target) ||
  2079. isReactive(target) ||
  2080. isRaw(target))
  2081. return;
  2082. var Vue = getVueConstructor();
  2083. // @ts-expect-error https://github.com/vuejs/vue/pull/12132
  2084. var defineReactive = Vue.util.defineReactive;
  2085. Object.keys(target).forEach(function (k) {
  2086. var val = target[k];
  2087. defineReactive(target, k, val);
  2088. if (val) {
  2089. seen.add(val);
  2090. customReactive(val, seen);
  2091. }
  2092. return;
  2093. });
  2094. }
  2095. function hasReactiveArrayChild(target, visited) {
  2096. if (visited === void 0) { visited = new Map(); }
  2097. if (visited.has(target)) {
  2098. return visited.get(target);
  2099. }
  2100. visited.set(target, false);
  2101. if (isArray(target) && isReactive(target)) {
  2102. visited.set(target, true);
  2103. return true;
  2104. }
  2105. if (!isPlainObject(target) || isRaw(target) || isRef(target)) {
  2106. return false;
  2107. }
  2108. return Object.keys(target).some(function (x) {
  2109. return hasReactiveArrayChild(target[x], visited);
  2110. });
  2111. }
  2112. function createSetupContext(vm) {
  2113. var ctx = { slots: {} };
  2114. var propsPlain = [
  2115. 'root',
  2116. 'parent',
  2117. 'refs',
  2118. 'listeners',
  2119. 'isServer',
  2120. 'ssrContext',
  2121. ];
  2122. var methodReturnVoid = ['emit'];
  2123. propsPlain.forEach(function (key) {
  2124. var srcKey = "$".concat(key);
  2125. proxy(ctx, key, {
  2126. get: function () { return vm[srcKey]; },
  2127. set: function () {
  2128. warn("Cannot assign to '".concat(key, "' because it is a read-only property"), vm);
  2129. },
  2130. });
  2131. });
  2132. updateVmAttrs(vm, ctx);
  2133. methodReturnVoid.forEach(function (key) {
  2134. var srcKey = "$".concat(key);
  2135. proxy(ctx, key, {
  2136. get: function () {
  2137. return function () {
  2138. var args = [];
  2139. for (var _i = 0; _i < arguments.length; _i++) {
  2140. args[_i] = arguments[_i];
  2141. }
  2142. var fn = vm[srcKey];
  2143. fn.apply(vm, args);
  2144. };
  2145. },
  2146. });
  2147. });
  2148. return ctx;
  2149. }
  2150. }
  2151. /**
  2152. * Helper that recursively merges two data objects together.
  2153. */
  2154. function mergeData(from, to) {
  2155. if (!from)
  2156. return to;
  2157. if (!to)
  2158. return from;
  2159. var key;
  2160. var toVal;
  2161. var fromVal;
  2162. var keys = hasSymbol ? Reflect.ownKeys(from) : Object.keys(from);
  2163. for (var i = 0; i < keys.length; i++) {
  2164. key = keys[i];
  2165. // in case the object is already observed...
  2166. if (key === '__ob__')
  2167. continue;
  2168. toVal = to[key];
  2169. fromVal = from[key];
  2170. if (!hasOwn(to, key)) {
  2171. to[key] = fromVal;
  2172. }
  2173. else if (toVal !== fromVal &&
  2174. isPlainObject(toVal) &&
  2175. !isRef(toVal) &&
  2176. isPlainObject(fromVal) &&
  2177. !isRef(fromVal)) {
  2178. mergeData(fromVal, toVal);
  2179. }
  2180. }
  2181. return to;
  2182. }
  2183. function install(Vue) {
  2184. if (isVueRegistered(Vue)) {
  2185. {
  2186. warn('[vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once.');
  2187. }
  2188. return;
  2189. }
  2190. {
  2191. if (Vue.version) {
  2192. if (Vue.version[0] !== '2' || Vue.version[1] !== '.') {
  2193. warn("[vue-composition-api] only works with Vue 2, v".concat(Vue.version, " found."));
  2194. }
  2195. }
  2196. else {
  2197. warn('[vue-composition-api] no Vue version found');
  2198. }
  2199. }
  2200. Vue.config.optionMergeStrategies.setup = function (parent, child) {
  2201. return function mergedSetupFn(props, context) {
  2202. return mergeData(isFunction(parent) ? parent(props, context) || {} : undefined, isFunction(child) ? child(props, context) || {} : undefined);
  2203. };
  2204. };
  2205. setVueConstructor(Vue);
  2206. mixin(Vue);
  2207. }
  2208. var Plugin = {
  2209. install: function (Vue) { return install(Vue); },
  2210. };
  2211. // implementation, close to no-op
  2212. function defineComponent(options) {
  2213. return options;
  2214. }
  2215. function defineAsyncComponent(source) {
  2216. if (isFunction(source)) {
  2217. source = { loader: source };
  2218. }
  2219. var loader = source.loader, loadingComponent = source.loadingComponent, errorComponent = source.errorComponent, _a = source.delay, delay = _a === void 0 ? 200 : _a, timeout = source.timeout, // undefined = never times out
  2220. _b = source.suspensible, // undefined = never times out
  2221. suspensible = _b === void 0 ? false : _b, // in Vue 3 default is true
  2222. userOnError = source.onError;
  2223. if (suspensible) {
  2224. warn("The suspensiblbe option for async components is not supported in Vue2. It is ignored.");
  2225. }
  2226. var pendingRequest = null;
  2227. var retries = 0;
  2228. var retry = function () {
  2229. retries++;
  2230. pendingRequest = null;
  2231. return load();
  2232. };
  2233. var load = function () {
  2234. var thisRequest;
  2235. return (pendingRequest ||
  2236. (thisRequest = pendingRequest =
  2237. loader()
  2238. .catch(function (err) {
  2239. err = err instanceof Error ? err : new Error(String(err));
  2240. if (userOnError) {
  2241. return new Promise(function (resolve, reject) {
  2242. var userRetry = function () { return resolve(retry()); };
  2243. var userFail = function () { return reject(err); };
  2244. userOnError(err, userRetry, userFail, retries + 1);
  2245. });
  2246. }
  2247. else {
  2248. throw err;
  2249. }
  2250. })
  2251. .then(function (comp) {
  2252. if (thisRequest !== pendingRequest && pendingRequest) {
  2253. return pendingRequest;
  2254. }
  2255. if (!comp) {
  2256. warn("Async component loader resolved to undefined. " +
  2257. "If you are using retry(), make sure to return its return value.");
  2258. }
  2259. // interop module default
  2260. if (comp &&
  2261. (comp.__esModule || comp[Symbol.toStringTag] === 'Module')) {
  2262. comp = comp.default;
  2263. }
  2264. if (comp && !isObject(comp) && !isFunction(comp)) {
  2265. throw new Error("Invalid async component load result: ".concat(comp));
  2266. }
  2267. return comp;
  2268. })));
  2269. };
  2270. return function () {
  2271. var component = load();
  2272. return {
  2273. component: component,
  2274. delay: delay,
  2275. timeout: timeout,
  2276. error: errorComponent,
  2277. loading: loadingComponent,
  2278. };
  2279. };
  2280. }
  2281. var version = "1.7.0";
  2282. // auto install when using CDN
  2283. if (typeof window !== 'undefined' && window.Vue) {
  2284. window.Vue.use(Plugin);
  2285. }
  2286. exports.EffectScope = EffectScope;
  2287. exports.computed = computed;
  2288. exports.createApp = createApp;
  2289. exports.createLifeCycle = createLifeCycle;
  2290. exports.createRef = createRef;
  2291. exports.customRef = customRef;
  2292. exports["default"] = Plugin;
  2293. exports.defineAsyncComponent = defineAsyncComponent;
  2294. exports.defineComponent = defineComponent;
  2295. exports.del = del;
  2296. exports.effectScope = effectScope;
  2297. exports.getCurrentInstance = getCurrentInstance;
  2298. exports.getCurrentScope = getCurrentScope;
  2299. exports.h = createElement;
  2300. exports.inject = inject;
  2301. exports.isRaw = isRaw;
  2302. exports.isReactive = isReactive;
  2303. exports.isReadonly = isReadonly;
  2304. exports.isRef = isRef;
  2305. exports.markRaw = markRaw;
  2306. exports.nextTick = nextTick;
  2307. exports.onActivated = onActivated;
  2308. exports.onBeforeMount = onBeforeMount;
  2309. exports.onBeforeUnmount = onBeforeUnmount;
  2310. exports.onBeforeUpdate = onBeforeUpdate;
  2311. exports.onDeactivated = onDeactivated;
  2312. exports.onErrorCaptured = onErrorCaptured;
  2313. exports.onMounted = onMounted;
  2314. exports.onScopeDispose = onScopeDispose;
  2315. exports.onServerPrefetch = onServerPrefetch;
  2316. exports.onUnmounted = onUnmounted;
  2317. exports.onUpdated = onUpdated;
  2318. exports.provide = provide;
  2319. exports.proxyRefs = proxyRefs;
  2320. exports.reactive = reactive;
  2321. exports.readonly = readonly;
  2322. exports.ref = ref;
  2323. exports.set = set$1;
  2324. exports.shallowReactive = shallowReactive;
  2325. exports.shallowReadonly = shallowReadonly;
  2326. exports.shallowRef = shallowRef;
  2327. exports.toRaw = toRaw;
  2328. exports.toRef = toRef;
  2329. exports.toRefs = toRefs;
  2330. exports.triggerRef = triggerRef;
  2331. exports.unref = unref;
  2332. exports.useAttrs = useAttrs;
  2333. exports.useCSSModule = useCSSModule;
  2334. exports.useCssModule = useCssModule;
  2335. exports.useSlots = useSlots;
  2336. exports.version = version;
  2337. exports.warn = warn$1;
  2338. exports.watch = watch;
  2339. exports.watchEffect = watchEffect;
  2340. exports.watchPostEffect = watchPostEffect;
  2341. exports.watchSyncEffect = watchSyncEffect;
  2342. /***/ }),
  2343. /***/ 133:
  2344. /*!****************************************************!*\
  2345. !*** ./node_modules/@dcloudio/uni-app/dist/app.js ***!
  2346. \****************************************************/
  2347. /*! no static exports found */
  2348. /***/ (function(module, exports, __webpack_require__) {
  2349. "use strict";
  2350. Object.defineProperty(exports, "__esModule", { value: true });
  2351. exports.init = void 0;
  2352. var Vue = __webpack_require__(/*! vue */ 25);
  2353. function init() {
  2354. var vueConstructor = (Vue.default ? Vue.default : Vue);
  2355. var defaultMergeHook = vueConstructor.config.optionMergeStrategies.mounted;
  2356. var onReadyFn;
  2357. vueConstructor.config.optionMergeStrategies.mounted = function Le(parentVal, childVal) {
  2358. var res = defaultMergeHook.call(this, parentVal, childVal);
  2359. if (Array.isArray(res)) {
  2360. var index = void 0;
  2361. if (onReadyFn) {
  2362. index = res.indexOf(onReadyFn);
  2363. }
  2364. else {
  2365. index = res.findIndex(function (fn) { return fn.toString().includes('onReady'); });
  2366. onReadyFn = res[index];
  2367. }
  2368. if (index !== -1) {
  2369. res.splice(index, 1);
  2370. res.push(onReadyFn);
  2371. }
  2372. }
  2373. return res;
  2374. };
  2375. }
  2376. exports.init = init;
  2377. /***/ }),
  2378. /***/ 134:
  2379. /*!***************************************************!*\
  2380. !*** ./node_modules/@dcloudio/uni-app/dist/mp.js ***!
  2381. \***************************************************/
  2382. /*! no static exports found */
  2383. /***/ (function(module, exports, __webpack_require__) {
  2384. "use strict";
  2385. Object.defineProperty(exports, "__esModule", { value: true });
  2386. exports.init = void 0;
  2387. var vue_1 = __webpack_require__(/*! vue */ 25);
  2388. function updateLifeCycle(lifecycles, setupLifecycles, fn) {
  2389. if (fn) {
  2390. if (fn.lifecycles) {
  2391. fn.lifecycles.forEach(function (item) {
  2392. if (!setupLifecycles.includes(item)) {
  2393. setupLifecycles.push(item);
  2394. }
  2395. });
  2396. }
  2397. else {
  2398. var fnString_1 = fn.toString();
  2399. lifecycles.forEach(function (item) {
  2400. if (!setupLifecycles.includes(item) && (new RegExp("\\b(".concat(item, ")\\b"))).test(fnString_1)) {
  2401. setupLifecycles.push(item);
  2402. }
  2403. });
  2404. }
  2405. }
  2406. }
  2407. function init(lifecycles) {
  2408. var setup = vue_1.default.config.optionMergeStrategies.setup;
  2409. var extend = vue_1.default.extend;
  2410. vue_1.default.extend = function () {
  2411. var extendedVue = extend.apply(this, arguments);
  2412. var newOptions = extendedVue.options;
  2413. var setup = newOptions.setup;
  2414. if (setup && setup.lifecycles) {
  2415. setup.lifecycles.forEach(function (item) {
  2416. newOptions[item] = newOptions[item] || [function noop() { }];
  2417. });
  2418. }
  2419. return extendedVue;
  2420. };
  2421. Object.defineProperty(vue_1.default.config.optionMergeStrategies, 'setup', {
  2422. set: function (fn) {
  2423. setup = fn;
  2424. },
  2425. get: function () {
  2426. return function (to, from) {
  2427. if (typeof setup === 'function') {
  2428. var newSetup = setup.apply(this, arguments);
  2429. newSetup.lifecycles = newSetup.lifecycles || [];
  2430. updateLifeCycle(lifecycles, newSetup.lifecycles, from);
  2431. updateLifeCycle(lifecycles, newSetup.lifecycles, to);
  2432. return newSetup;
  2433. }
  2434. };
  2435. }
  2436. });
  2437. }
  2438. exports.init = init;
  2439. /***/ }),
  2440. /***/ 135:
  2441. /*!****************************************************!*\
  2442. !*** ./node_modules/@dcloudio/uni-app/dist/uts.js ***!
  2443. \****************************************************/
  2444. /*! no static exports found */
  2445. /***/ (function(module, exports, __webpack_require__) {
  2446. "use strict";
  2447. /* WEBPACK VAR INJECTION */(function(uni) {
  2448. exports.__esModule = true;
  2449. exports.initUtsClassName = exports.initUtsIndexClassName = exports.initUtsPackageName = exports.initUtsProxyClass = exports.initUtsProxyFunction = exports.normalizeArg = void 0;
  2450. var utils_1 = __webpack_require__(/*! ./utils */ 136);
  2451. var callbackId = 1;
  2452. var proxy;
  2453. var callbacks = {};
  2454. function normalizeArg(arg) {
  2455. if (typeof arg === 'function') {
  2456. // 查找该函数是否已缓存
  2457. var oldId = Object.keys(callbacks).find(function (id) { return callbacks[id] === arg; });
  2458. var id = oldId ? parseInt(oldId) : callbackId++;
  2459. callbacks[id] = arg;
  2460. return id;
  2461. }
  2462. else if ((0, utils_1.isPlainObject)(arg)) {
  2463. Object.keys(arg).forEach(function (name) {
  2464. ;
  2465. arg[name] = normalizeArg(arg[name]);
  2466. });
  2467. }
  2468. return arg;
  2469. }
  2470. exports.normalizeArg = normalizeArg;
  2471. function initUtsInstanceMethod(async, opts, instanceId) {
  2472. return initProxyFunction(async, opts, instanceId);
  2473. }
  2474. function getProxy() {
  2475. if (!proxy) {
  2476. proxy = uni.requireNativePlugin('UTS-Proxy');
  2477. }
  2478. return proxy;
  2479. }
  2480. function resolveSyncResult(res) {
  2481. if (res.errMsg) {
  2482. throw new Error(res.errMsg);
  2483. }
  2484. return res.params;
  2485. }
  2486. function invokePropGetter(args) {
  2487. if (args.errMsg) {
  2488. throw new Error(args.errMsg);
  2489. }
  2490. delete args.errMsg;
  2491. return resolveSyncResult(getProxy().invokeSync(args, function () { }));
  2492. }
  2493. function initProxyFunction(async, _a, instanceId) {
  2494. var pkg = _a.package, cls = _a["class"], propOrMethod = _a.name, method = _a.method, companion = _a.companion, methodParams = _a.params, errMsg = _a.errMsg;
  2495. var invokeCallback = function (_a) {
  2496. var id = _a.id, name = _a.name, params = _a.params, keepAlive = _a.keepAlive;
  2497. var callback = callbacks[id];
  2498. if (callback) {
  2499. callback.apply(void 0, params);
  2500. if (!keepAlive) {
  2501. delete callbacks[id];
  2502. }
  2503. }
  2504. else {
  2505. console.error("".concat(pkg).concat(cls, ".").concat(propOrMethod, " ").concat(name, " is not found"));
  2506. }
  2507. };
  2508. var baseArgs = instanceId
  2509. ? { id: instanceId, name: propOrMethod, method: methodParams }
  2510. : {
  2511. package: pkg,
  2512. "class": cls,
  2513. name: method || propOrMethod,
  2514. companion: companion,
  2515. method: methodParams
  2516. };
  2517. return function () {
  2518. var args = [];
  2519. for (var _i = 0; _i < arguments.length; _i++) {
  2520. args[_i] = arguments[_i];
  2521. }
  2522. if (errMsg) {
  2523. throw new Error(errMsg);
  2524. }
  2525. var invokeArgs = (0, utils_1.extend)({}, baseArgs, {
  2526. params: args.map(function (arg) { return normalizeArg(arg); })
  2527. });
  2528. if (async) {
  2529. return new Promise(function (resolve, reject) {
  2530. getProxy().invokeAsync(invokeArgs, function (res) {
  2531. if (res.type !== 'return') {
  2532. invokeCallback(res);
  2533. }
  2534. else {
  2535. if (res.errMsg) {
  2536. reject(res.errMsg);
  2537. }
  2538. else {
  2539. resolve(res.params);
  2540. }
  2541. }
  2542. });
  2543. });
  2544. }
  2545. return resolveSyncResult(getProxy().invokeSync(invokeArgs, invokeCallback));
  2546. };
  2547. }
  2548. function initUtsStaticMethod(async, opts) {
  2549. if (opts.main && !opts.method) {
  2550. if (typeof plus !== 'undefined' && plus.os.name === 'iOS') {
  2551. opts.method = 's_' + opts.name;
  2552. }
  2553. }
  2554. return initProxyFunction(async, opts, 0);
  2555. }
  2556. exports.initUtsProxyFunction = initUtsStaticMethod;
  2557. function initUtsProxyClass(_a) {
  2558. var pkg = _a.package, cls = _a["class"], constructorParams = _a.constructor.params, methods = _a.methods, props = _a.props, staticProps = _a.staticProps, staticMethods = _a.staticMethods, errMsg = _a.errMsg;
  2559. var baseOptions = {
  2560. package: pkg,
  2561. "class": cls,
  2562. errMsg: errMsg
  2563. };
  2564. var ProxyClass = /** @class */ (function () {
  2565. function UtsClass() {
  2566. var params = [];
  2567. for (var _i = 0; _i < arguments.length; _i++) {
  2568. params[_i] = arguments[_i];
  2569. }
  2570. if (errMsg) {
  2571. throw new Error(errMsg);
  2572. }
  2573. var target = {};
  2574. // 初始化实例 ID
  2575. var instanceId = initProxyFunction(false, (0, utils_1.extend)({ name: 'constructor', params: constructorParams }, baseOptions), 0).apply(null, params);
  2576. if (!instanceId) {
  2577. throw new Error("new ".concat(cls, " is failed"));
  2578. }
  2579. return new Proxy(this, {
  2580. get: function (_, name) {
  2581. if (!target[name]) {
  2582. //实例方法
  2583. if ((0, utils_1.hasOwn)(methods, name)) {
  2584. var _a = methods[name], async = _a.async, params_1 = _a.params;
  2585. target[name] = initUtsInstanceMethod(!!async, (0, utils_1.extend)({
  2586. name: name,
  2587. params: params_1
  2588. }, baseOptions), instanceId);
  2589. }
  2590. else if (props.includes(name)) {
  2591. // 实例属性
  2592. return invokePropGetter({
  2593. id: instanceId,
  2594. name: name,
  2595. errMsg: errMsg
  2596. });
  2597. }
  2598. }
  2599. return target[name];
  2600. }
  2601. });
  2602. }
  2603. return UtsClass;
  2604. }());
  2605. var staticMethodCache = {};
  2606. return new Proxy(ProxyClass, {
  2607. get: function (target, name, receiver) {
  2608. if ((0, utils_1.hasOwn)(staticMethods, name)) {
  2609. if (!staticMethodCache[name]) {
  2610. var _a = staticMethods[name], async = _a.async, params = _a.params;
  2611. // 静态方法
  2612. staticMethodCache[name] = initUtsStaticMethod(!!async, (0, utils_1.extend)({ name: name, companion: true, params: params }, baseOptions));
  2613. }
  2614. return staticMethodCache[name];
  2615. }
  2616. if (staticProps.includes(name)) {
  2617. // 静态属性
  2618. return invokePropGetter((0, utils_1.extend)({ name: name, companion: true }, baseOptions));
  2619. }
  2620. return Reflect.get(target, name, receiver);
  2621. }
  2622. });
  2623. }
  2624. exports.initUtsProxyClass = initUtsProxyClass;
  2625. function initUtsPackageName(name, is_uni_modules) {
  2626. if (typeof plus !== 'undefined' && plus.os.name === 'Android') {
  2627. return 'uts.sdk.' + (is_uni_modules ? 'modules.' : '') + name;
  2628. }
  2629. return '';
  2630. }
  2631. exports.initUtsPackageName = initUtsPackageName;
  2632. function initUtsIndexClassName(moduleName, is_uni_modules) {
  2633. if (typeof plus === 'undefined') {
  2634. return '';
  2635. }
  2636. return initUtsClassName(moduleName, plus.os.name === 'iOS' ? 'IndexSwift' : 'IndexKt', is_uni_modules);
  2637. }
  2638. exports.initUtsIndexClassName = initUtsIndexClassName;
  2639. function initUtsClassName(moduleName, className, is_uni_modules) {
  2640. if (typeof plus === 'undefined') {
  2641. return '';
  2642. }
  2643. if (plus.os.name === 'Android') {
  2644. return className;
  2645. }
  2646. if (plus.os.name === 'iOS') {
  2647. return ('UTSSDK' +
  2648. (is_uni_modules ? 'Modules' : '') +
  2649. (0, utils_1.capitalize)(moduleName) +
  2650. (0, utils_1.capitalize)(className));
  2651. }
  2652. return '';
  2653. }
  2654. exports.initUtsClassName = initUtsClassName;
  2655. /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./node_modules/@dcloudio/uni-mp-weixin/dist/index.js */ 2)["default"]))
  2656. /***/ }),
  2657. /***/ 136:
  2658. /*!******************************************************!*\
  2659. !*** ./node_modules/@dcloudio/uni-app/dist/utils.js ***!
  2660. \******************************************************/
  2661. /*! no static exports found */
  2662. /***/ (function(module, exports, __webpack_require__) {
  2663. "use strict";
  2664. Object.defineProperty(exports, "__esModule", { value: true });
  2665. exports.capitalize = exports.isPlainObject = exports.hasOwn = exports.extend = void 0;
  2666. exports.extend = Object.assign;
  2667. var hasOwnProperty = Object.prototype.hasOwnProperty;
  2668. var hasOwn = function (val, key) { return hasOwnProperty.call(val, key); };
  2669. exports.hasOwn = hasOwn;
  2670. var objectToString = Object.prototype.toString;
  2671. var toTypeString = function (value) {
  2672. return objectToString.call(value);
  2673. };
  2674. var isPlainObject = function (val) {
  2675. return toTypeString(val) === '[object Object]';
  2676. };
  2677. exports.isPlainObject = isPlainObject;
  2678. var cacheStringFunction = function (fn) {
  2679. var cache = Object.create(null);
  2680. return (function (str) {
  2681. var hit = cache[str];
  2682. return hit || (cache[str] = fn(str));
  2683. });
  2684. };
  2685. exports.capitalize = cacheStringFunction(function (str) { return str.charAt(0).toUpperCase() + str.slice(1); });
  2686. /***/ })
  2687. }]);
  2688. //# sourceMappingURL=../../../.sourcemap/mp-weixin/pageA/common/vendor.js.map