/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/vue-flow@0.3.0/vue-flow.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
!function(){var t={install:function(t){var e,o={},n={},i={},a={},r=[],s=[],f=[];function c(t){return d(t?o[t]:o[this.name])}function l(t,e,n,i){var a=0;return function e(o){if("object"!=typeof o||isNaN(o.length))throw"please make sure the param of next is type of array or argument";return a<r.length?m(r[a++](i,e,f,n),o,t):f(o[0])}(e);function f(t){if(t){if(t.constructor!==Object)throw console.log(arguments),"the argument of end should be a plain data object";return a=r.length,u(t=function(t,e){for(var o,n=0,i=s.length;n<i;n++)"object"==typeof(o=s[n](t,e))&&(t=o);return t}(t,o[n.modelName]),n.modelName,n.actionName)}}}function u(t,e,n){var a,r,s=o[e],f=i[e],c=Object.keys(t),l=d(t),u={};if(Object.assign(s,l),f&&f.length)for(var m=0,w=f.length;m<w;m++)if(f[m]){if(f[m].statePath[1]&&-1===c.indexOf(f[m].statePath[1]))continue;a=u[f[m].statePath]||(u[f[m].statePath]=p(f[m].statePath)),r={name:f[m].dataName,value:a,action:e+"."+n},h(f[m].comp,r),f[m].comp.$options.beforeFlowIn&&f[m].comp.$options.beforeFlowIn.call(f[m].comp,r),f[m].comp.$set(f[m].dataName,a)}return l}function h(t,e){for(var o=0,n=s.length;o<n;o++)f[o].call(t,e)}function p(t){var e=o[t[0]];return t[1]?(e=isNaN(t[1])?e[t[1]]:e[t[1]]||e[parseInt(t[1])],t[2]&&"object"==typeof e?(e=isNaN(t[2])?e[t[2]]:e[t[2]]||e[parseInt(t[2])],t[3]&&"object"==typeof e?(e=isNaN(t[3])?e[t[3]]:e[t[3]]||e[parseInt(t[3])],t[4]&&"object"==typeof e?d(isNaN(t[4])?e[t[4]]:e[t[4]]||e[parseInt(t[4])]):d(e)):d(e)):d(e)):d(e)}function d(t){return"object"==typeof t?JSON.parse(JSON.stringify(t)):t}function m(t,e,o){switch(e.length){case 0:return o?t.call(o):t();case 1:return o?t.call(o,e[0]):t(e[0]);case 2:return o?t.call(o,e[0],e[1]):t(e[0],e[1]);case 3:return o?t.call(o,e[0],e[1],e[2]):t(e[0],e[1],e[2]);case 4:return o?t.call(o,e[0],e[1],e[2],e[3]):t(e[0],e[1],e[2],e[3]);case 5:return o?t.call(o,e[0],e[1],e[2],e[3],e[4]):t(e[0],e[1],e[2],e[3],e[4]);default:return t.apply(o||this,e)}}t.flow={},t.flow.model=function(t,i){if(!t||!i)throw"two arguments are required";if(!i.default||i.default.constructor!==Object)throw"please set an default object-type property to be the default data of the model";function r(){this.name=t}for(var s in o[t]=d(i.default),e=r.prototype=Object.assign({constructor:r,getState:c},a),i)i.hasOwnProperty(s)&&"default"!=s&&(e[s]=function(t,a){return e.dispatch=r,function(){var e=m(i[a],arguments,n[t]);if(void 0!==e)return r.call(n[t],e)};function r(){return l(this,arguments,{modelName:t,actionName:a,models:n,store:o},r)}}(t,s));n[t]=new r},t.flow.dispatch=function(t,e){if(!t||t.constructor!==String)throw"the first argument should be a model name the second shuould be a plain object";u(e,t,"Vue.flow")},t.flow.bind=function(t,e){if("function"!=typeof e)throw"a callback as the second argument is needed";switch(t){case"beforeStore":s.push(e);break;case"beforeFlowIn":f.push(e)}},t.flow.addMiddleware=function(t){"object"==typeof t&&t.constructor===Array?r=r.concat(t):"function"==typeof t&&r.push(t)},t.flow.mixin=function(t){Object.assign(a,t)},t.mixin({init:function(){if(this.$options.flow)for(var e in this.$options.flow)if(this.$options.flow.hasOwnProperty(e)){var o=this.$options.flow[e].split(".");i[o[0]]=i[o[0]]||[],i[o[0]].push({comp:this,dataName:e,statePath:o}),t.util.defineReactive(this,e,p(o))}var a;if(this.$options.actions)for(var e in this.$options.actions)if(this.$options.actions.hasOwnProperty(e)){if(a=this.$options.actions[e].split("."),!n[a[0]])throw"the model "+a[0]+" is not exist";if(!n[a[0]][a[1]])throw"the action "+a[1]+" of model "+a[0]+" is not exist";this[e]=function(t,e){return function(){arguments[0]&&void 0!==arguments[0].cancelBubble&&arguments[0].srcElement?n[t][e].call(n[t]):m(n[t][e],arguments,n[t])}}(a[0],a[1])}},beforeDestroy:function(){var t,e;if(this.$options.flow)for(var o in this.$options.flow)if(this.$options.flow.hasOwnProperty(o)){t=this.$options.flow[o].split("."),e=[];for(var n=0,a=i[t[0]].length;n<a;n++)i[t[0]][n].comp!==this&&e.push(i[t[0]][n]);i[t[0]]=e}},methods:{$action:function(t,e){if(-1===t.indexOf("."))throw"please check the argument of $action";if(t=t.split("."),!n[t[0]])throw"the model "+t[0]+" is not exist";if(!n[t[0]][t[1]])throw"the action "+t[1]+" of model "+t[0]+" is not exist";m(n[t[0]][t[1]],Array.prototype.slice.call(arguments,1),n[t[0]])}}}),t.flow.mixin({each:function(t,e){if("object"==typeof t){if(void 0!==t.length)for(var o=0,n=t.length;o<n&&!1!==e(t[o],o);o++);else for(var i in t)if(t.hasOwnProperty(i)&&!1===e(t[i],i))break}else console.error("argument is wrong")},map:function(t,e){var o,n=[];return this.each(t,(function(t,i){void 0!==(o=e(t,i))&&n.push(o)})),n},find:function(t,e){var o;return this.each(t,(function(t,n){if(e(t,n))return o=t,!1})),o},clone:d})}};if("object"==typeof module&&module.exports)module.exports=t;else if("function"==typeof define&&define.amd)define((function(){return t}));else if(void 0!==typeof window)window.vueState=t}();
//# sourceMappingURL=/sm/41d3c98dc6b804987fe5241a59974f06760e752372226d19691c2ac926b6af17.map