SafetyScreen-ui/node_modules/vuex/dist/vuex.global.prod.js

7 lines
10 KiB
JavaScript
Raw Normal View History

2025-03-29 19:33:58 +08:00
/*!
* vuex v4.0.0-beta.2
* (c) 2020 Evan You
* @license MIT
*/
var Vuex=function(t){"use strict";var e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).__VUE_DEVTOOLS_GLOBAL_HOOK__;function n(t,e){Object.keys(t).forEach((function(n){return e(t[n],n)}))}function r(t){return null!==t&&"object"==typeof t}function o(t,e){if(!t)throw new Error("[vuex] "+e)}var i=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"==typeof n?n():n)||{}},s={namespaced:{configurable:!0}};s.namespaced.get=function(){return!!this._rawModule.namespaced},i.prototype.addChild=function(t,e){this._children[t]=e},i.prototype.removeChild=function(t){delete this._children[t]},i.prototype.getChild=function(t){return this._children[t]},i.prototype.hasChild=function(t){return t in this._children},i.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},i.prototype.forEachChild=function(t){n(this._children,t)},i.prototype.forEachGetter=function(t){this._rawModule.getters&&n(this._rawModule.getters,t)},i.prototype.forEachAction=function(t){this._rawModule.actions&&n(this._rawModule.actions,t)},i.prototype.forEachMutation=function(t){this._rawModule.mutations&&n(this._rawModule.mutations,t)},Object.defineProperties(i.prototype,s);var a=function(t){this.register([],t,!1)};a.prototype.get=function(t){return t.reduce((function(t,e){return t.getChild(e)}),this.root)},a.prototype.getNamespace=function(t){var e=this.root;return t.reduce((function(t,n){return t+((e=e.getChild(n)).namespaced?n+"/":"")}),"")},a.prototype.update=function(t){!function t(e,n,r){if(n.update(r),r.modules)for(var o in r.modules){if(!n.getChild(o))return;t(e.concat(o),n.getChild(o),r.modules[o])}}([],this.root,t)},a.prototype.register=function(t,e,r){var o=this;void 0===r&&(r=!0);var s=new i(e,r);0===t.length?this.root=s:this.get(t.slice(0,-1)).addChild(t[t.length-1],s);e.modules&&n(e.modules,(function(e,n){o.register(t.concat(n),e,r)}))},a.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];e.getChild(n).runtime&&e.removeChild(n)},a.prototype.isRegistered=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];return e.hasChild(n)};var c=function t(n){var r=this;void 0===n&&(n={}),"production"!==process.env.NODE_ENV&&(o("undefined"!=typeof Promise,"vuex requires a Promise polyfill in this browser."),o(this instanceof t,"store must be called with the new operator."));var i=n.plugins;void 0===i&&(i=[]);var s=n.strict;void 0===s&&(s=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new a(n),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null);var c=this,u=this.dispatch,f=this.commit;this.dispatch=function(t,e){return u.call(c,t,e)},this.commit=function(t,e,n){return f.call(c,t,e,n)},this.strict=s;var h=this._modules.root.state;l(this,h,[],this._modules.root),p(this,h),i.forEach((function(t){return t(r)})),(void 0===n.devtools||n.devtools)&&function(t){e&&(t._devtoolHook=e,e.emit("vuex:init",t),e.on("vuex:travel-to-state",(function(e){t.replaceState(e)})),t.subscribe((function(t,n){e.emit("vuex:mutation",t,n)}),{prepend:!0}),t.subscribeAction((function(t,n){e.emit("vuex:action",t,n)}),{prepend:!0}))}(this)},u={state:{configurable:!0}};function f(t,e,n){return e.indexOf(t)<0&&(n&&n.prepend?e.unshift(t):e.push(t)),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function h(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;l(t,n,[],t._modules.root,!0),p(t,n,e)}function p(e,r,o){var i=e._state;e.getters={},e._makeLocalGettersCache=Object.create(null);var s=e._wrappedGetters,a={};n(s,(function(n,r){a[r]=function(t,e){return function(){return t(e)}}(n,e),Object.defineProperty(e.getters,r,{