UNPKG

vae-of

Version:

Vue2和React快捷集成的工具包,并且适合复杂的集成场景

2 lines (1 loc) 43.8 kB
import React,{version,lazy}from"react";import Vue from"vue";import ReactDOM,{createPortal}from"react-dom";function _arrayLikeToArray(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,o=Array(e);r<e;r++)o[r]=t[r];return o}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _callSuper(t,e,r){return e=_getPrototypeOf(e),_possibleConstructorReturn(t,_isNativeReflectConstruct()?Reflect.construct(e,r||[],_getPrototypeOf(t).constructor):e.apply(t,r))}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,_toPropertyKey(o.key),o)}}function _createClass(t,e,r){return e&&_defineProperties(t.prototype,e),r&&_defineProperties(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function _defineProperty(t,e,r){return(e=_toPropertyKey(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _extends(){return(_extends=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r,o=arguments[e];for(r in o)!{}.hasOwnProperty.call(o,r)||(t[r]=o[r])}return t}).apply(null,arguments)}function _getPrototypeOf(t){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function _inherits(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_setPrototypeOf(t,e)}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function(){return!!t})()}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ownKeys(e,t){var r,o=Object.keys(e);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(e),t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,r)),o}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach(function(t){_defineProperty(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function _objectWithoutProperties(t,e){if(null==t)return{};var r,o=_objectWithoutPropertiesLoose(t,e);if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),a=0;a<n.length;a++)r=n[a],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r]);return o}function _objectWithoutPropertiesLoose(t,e){if(null==t)return{};var r,o={};for(r in t)if({}.hasOwnProperty.call(t,r)){if(e.includes(r))continue;o[r]=t[r]}return o}function _possibleConstructorReturn(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(t)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _toPrimitive(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0===r)return("string"===e?String:Number)(t);r=r.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _toPropertyKey(t){t=_toPrimitive(t,"string");return"symbol"==typeof t?t:t+""}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _unsupportedIterableToArray(t,e){var r;if(t)return"string"==typeof t?_arrayLikeToArray(t,e):"Map"===(r="Object"===(r={}.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(t,e):void 0}var originOptions={react:{componentWrap:"div",slotWrap:"div",componentWrapAttrs:{__use_react_component_wrap:"",style:{all:"unset"}},slotWrapAttrs:{__use_react_slot_wrap:"",style:{all:"unset"}}},vue:{componentWrapHOC:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return function(){var t=(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}).portals,t=void 0===t?[]:t;return React.createElement("div",r,e,t.map(function(t){var e=t.Portal;return React.createElement(e,{key:t.key})}))}},componentWrapAttrs:{"data-use-vue-component-wrap":"",style:{all:"unset"}},slotWrapAttrs:{"data-use-vue-slot-wrap":"",style:{all:"unset"}}}};function setOptions(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{react:{},vue:{}},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:originOptions,r=2<arguments.length?arguments[2]:void 0,e=(t.vue||(t.vue={}),t.react||(t.react={}),[e,_objectSpread2(_objectSpread2({},t),{},{react:_objectSpread2(_objectSpread2(_objectSpread2({},e.react),t.react),{},{componentWrapAttrs:_objectSpread2(_objectSpread2({},e.react.componentWrapAttrs),t.react.componentWrapAttrs),slotWrapAttrs:_objectSpread2(_objectSpread2({},e.react.slotWrapAttrs),t.react.slotWrapAttrs)}),vue:_objectSpread2(_objectSpread2(_objectSpread2({},e.vue),t.vue),{},{componentWrapAttrs:_objectSpread2(_objectSpread2({},e.vue.componentWrapAttrs),t.vue.componentWrapAttrs),slotWrapAttrs:_objectSpread2(_objectSpread2({},e.vue.slotWrapAttrs),t.vue.slotWrapAttrs)})})]);return r&&e.unshift({}),Object.assign.apply(this,e)}var vueRootInfo={},_excluded=["ref"],_excluded2=["style"],_excluded3=["key","data-passed-props"],_excluded4=["data-passed-props","hashList"],_excluded5=["style"],_excluded6=["on","$slots","$scopedSlots","children"],ReactMajorVersion=parseInt(version),domMethods=["getElementById","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS","querySelector","querySelectorAll"],domTopObject={Document:{},Element:{}};function overwriteDomMethods(s){Object.keys(domTopObject).forEach(function(t){domMethods.forEach(function(n){var a=window[t].prototype[n];domTopObject[t][n]=a,window[t].prototype[n]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=a.apply(this,e);return o&&o.constructor!==NodeList||o&&o.constructor===NodeList&&0<o.length?o:Element.prototype[n].apply(s,e)}})})}function recoverDomMethods(){Object.keys(domTopObject).forEach(function(e){domMethods.forEach(function(t){window[e].prototype[t]=domTopObject[e][t]})})}var FunctionComponentWrap=function(){function e(t){return _classCallCheck(this,e),_callSuper(this,e,[t])}return _inherits(e,React.Component),_createClass(e,[{key:"render",value:function(){var t=this.props.component,e=this.props.passedProps,e=(e.ref,_objectWithoutProperties(e,_excluded));return React.createElement(t,e,this.props.children)}}])}(),createReactContainer=function(f,h,_){var t=function(){function d(t){var e;return _classCallCheck(this,d),(e=_callSuper(this,d,[t])).state=_objectSpread2(_objectSpread2({},t),h.isSlots?{children:f}:{}),e.setRef=e.setRef.bind(e),e.vueInReactCall=e.vueInReactCall.bind(e),e.vueWrapperRef=_,e}return _inherits(d,React.Component),_createClass(d,[{key:"setRef",value:function(e){e&&(_.reactRef=e,Object.keys(e).forEach(function(t){_[t]||(_[t]=e[t])}),Promise.resolve().then(function(){Object.keys(e).forEach(function(t){_[t]||(_[t]=e[t])})}),(this.setRef.current=e).vueWrapperRef=_)}},{key:"createSlot",value:function(r){var t=h.react.slotWrapAttrs,o=t.style,n=_objectWithoutProperties(t,_excluded2);return{inheritAttrs:!1,__fromReactSlot:!0,render:function(t){var e;return 1===(null==(e=r=r instanceof Function?r(this):r)?void 0:e.length)&&null!=(e=r[0])&&e.data&&((e=this.$attrs).key,e=_objectWithoutProperties(e,_excluded3),r[0].data.attrs=_objectSpread2(_objectSpread2({},e),r[0].data.attrs)),t(h.react.slotWrap,{attrs:n,style:o},r)}}}},{key:"componentWillUnmount",value:function(){_.reactRef&&(_.reactRef.vueWrapperRef=null,_.reactRef=null)}},{key:"vueInReactCall",value:function(t){var r=this,o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return(2<arguments.length?arguments[2]:void 0)&&t&&t[0]?t.map(function(t,e){return applyVueInReact(r.createSlot(t instanceof Function?t:[t]),_objectSpread2(_objectSpread2(_objectSpread2({},h),o),{},{isSlots:!0,wrapInstance:_})).render({key:(null==t||null==(t=t.data)?void 0:t.key)||e})}):applyVueInReact(this.createSlot(t),_objectSpread2(_objectSpread2(_objectSpread2({},h),o),{},{isSlots:!0,wrapInstance:_})).render()}},{key:"render",value:function(){var t,e,r,o,n=this,a=this.state,s=a["data-passed-props"],i=a.hashList,c=_objectWithoutProperties(a,_excluded4),u={},p={};for(e in c)r=e,o=void 0,c.hasOwnProperty(r)&&null!=c[r]&&(c[r].__slot?(c[r].reactSlot?c[r]=c[r].reactSlot:(o=c[r],h.defaultSlotsFormatter?(c[r].__top__=n.vueWrapperRef,c[r]=h.defaultSlotsFormatter(c[r],n.vueInReactCall,i),c[r]instanceof Array?c[r]=_toConsumableArray(c[r]):-1<["string","number"].indexOf(_typeof(c[r]))?c[r]=[c[r]]:"object"===_typeof(c[r])&&(c[r]=_objectSpread2({},c[r]))):c[r]=_objectSpread2({},applyVueInReact(n.createSlot(c[r]),_objectSpread2(_objectSpread2({},h),{},{isSlots:!0,wrapInstance:_})).render()),c[r].vueSlot=o),u[r]=c[r]):c[r].__scopedSlot&&(c[r]=c[r](n.createSlot),p[r]=c[r]));null!=(a=c.children)&&a.vueFunction||(t=c.children),u.default=t;var l,s=_objectSpread2(_objectSpread2(_objectSpread2({},s),{$slots:u,$scopedSlots:p}),{},{children:t}),a={};return a.ref=this.setRef,h.isSlots?this.state.children||this.props.children:(l=c,l=_objectSpread2(_objectSpread2({},l=h.defaultPropsFormatter?h.defaultPropsFormatter(c,this.vueInReactCall,i):l),{"data-passed-props":s}),Object.getPrototypeOf(f)!==Function.prototype&&("object"!==_typeof(f)||f.render)||d.catchVueRefs()?React.createElement(f,_extends({},l,{"data-passed-props":s},a),t||l.children):React.createElement(FunctionComponentWrap,_extends({passedProps:l,component:f},a),t||l.children))}}],[{key:"catchVueRefs",value:function(){if(_.$parent)for(var t in _.$parent.$refs)if(_.$parent.$refs[t]===_)return!0;return!1}}])}();return _defineProperty(t,"displayName","useReact_".concat(f.displayName||f.name||"Component")),t};function applyReactInVue(O){var x=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return O.__esModule&&O.default&&(O=O.default),x.isSlots&&(O=O()),x=setOptions(x,void 0,!0),{originReactComponent:O,data:function(){return{portals:[],portalKeyPool:[],maxPortalCount:0}},created:function(){this.cleanVnodeStyleClass(),this.$root.$options.router&&(vueRootInfo.router=this.$root.$options.router),this.$root.$options.router&&(vueRootInfo.store=this.$root.$options.store)},props:["dataPassedProps"],render:function(e){this.slotsInit();var t=x.react.componentWrapAttrs,r=t.style,t=_objectWithoutProperties(t,_excluded5);return e(x.react.componentWrap,{ref:"react",attrs:t,style:r},this.portals.map(function(t){return(0,t.Portal)(e,t.key)}))},methods:{pushVuePortal:function(t){var e=this.portalKeyPool.shift()||this.maxPortalCount++;this.portals.push({Portal:t,key:e})},removeVuePortal:function(r){var o,t=this.portals.find(function(t,e){if(t.Portal===r)return o=e,!0});this.portalKeyPool.push(t.key),this.portals.splice(o,1)},slotsInit:function(e){var t,r=this;if(e)return null==(t=e.componentOptions)||null==(t=t.Ctor)||!t.options||null!=(t=e.componentOptions)&&null!=(t=t.Ctor)&&t.options.originReactComponent?(null!=(t=e.data)&&t.scopedSlots&&Object.keys(null==(t=e.data)?void 0:t.scopedSlots).forEach(function(t){if("function"==typeof e.data.scopedSlots[t])try{e.data.scopedSlots[t]()}catch(t){}}),void(e.children||(null==(t=e.componentOptions)?void 0:t.children)||[]).forEach(function(t){r.slotsInit(t)})):void 0;Object.keys(this.$slots).forEach(function(t){(r.$slots[t]||[]).forEach(function(t){r.slotsInit(t)})}),Object.keys(this.$scopedSlots).forEach(function(t){try{r.$scopedSlots[t]()}catch(t){}})},updateLastVnodeData:function(t){return this.lastVnodeData={style:_objectSpread2(_objectSpread2({},this.formatStyle(t.data.style)),this.formatStyle(t.data.staticStyle)),class:Array.from(new Set([].concat(_toConsumableArray(this.formatClass(t.data.class)),_toConsumableArray(this.formatClass(t.data.staticClass))))).join(" ")},Object.assign(t.data,{staticStyle:null,style:null,staticClass:null,class:null}),t},cleanVnodeStyleClass:function(){var e=this,r=this.$vnode;this.updateLastVnodeData(r),Object.defineProperty(this,"$vnode",{get:function(){return r},set:function(t){return r=t!==r?e.updateLastVnodeData(t):r}})},toCamelCase:function(t){return t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()})},formatStyle:function(e){var r,o=this;return e?"string"==typeof e?(e=e.trim()).split(/\s*;\s*/).reduce(function(t,e){return e&&2===(e=e.split(/\s*:\s*/)).length&&Object.assign(t,_defineProperty({},o.toCamelCase(e[0]),e[1])),t},{}):"object"===_typeof(e)?(r={},Object.keys(e).forEach(function(t){r[o.toCamelCase(t)]=e[t]}),r):{}:{}},formatClass:function(e){return e?e instanceof Array?e:"string"==typeof e?(e=e.trim()).split(/\s+/):"object"===_typeof(e)?Object.keys(e).map(function(t){return e[t]||""}):[]:[]},getScopeSlot:function(a,s,e){var i=this;function t(n){function t(){for(var t,e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return a.reactFunction?a.reactFunction.apply(this,r):x.defaultSlotsFormatter?((t=a.apply(this,r)).__top__=i,(t=x.defaultSlotsFormatter(t,i.vueInReactCall,s))instanceof Array||-1<_typeof(t).indexOf("string","number")?t=_toConsumableArray(t):"object"===_typeof(t)&&(t=_objectSpread2({},t)),t):applyVueInReact(n(a.apply(this,r)),_objectSpread2(_objectSpread2({},x),{},{isSlots:!0,wrapInstance:i})).render()}return x.pureTransformer&&e?t.vueFunction=e:t.vueFunction=a,t}return t.__scopedSlot=!0,t},__syncUpdateProps:function(t){this.reactInstance&&this.reactInstance.setState(t)},mountReactComponent:function(t,e){var r=this,o=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},n=null!=this.$props.dataPassedProps?this.$props.dataPassedProps:{},a=n.on,s=n.$slots,i=n.$scopedSlots,c=n.children,n=_objectWithoutProperties(n,_excluded6),u={},p=[],l=null==(l=this.$vnode.context)||null==(l=l.$vnode)||null==(l=l.componentOptions)||null==(l=l.Ctor)||null==(l=l.extendOptions)?void 0:l._scopeId,d=(l&&(u[l]="",p.push(l)),{}),f={};if(!t||null!=e&&e.slot){var h,_=_objectSpread2(_objectSpread2({},s),this.$slots);for(h in _)d[h]=_[h],d[h].__slot=!0;var m,y,v=_objectSpread2(_objectSpread2({},i),this.$scopedSlots);for(m in v)d[m]?this.$scopedSlots[m]&&(this.$scopedSlots[m].__slot=!0):v[m].__slot?(d[m]=v[m](),d[m].__slot=!0):f[m]=this.getScopeSlot(v[m],p,null==(y=this.$vnode)||null==(y=y.data)||null==(y=y.scopedSlots)?void 0:y[m])}var S,b=_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},n),_objectSpread2({},this.$attrs)),!t||null!=e&&e.slot?{$slots:d,$scopedSlots:f,children:c}:{}),{},{on:_objectSpread2(_objectSpread2({},a),this.$listeners)}),R=((!t||null!=e&&e.slot)&&(S=_objectSpread2({},d),c=S.default,delete S.default),this.last=this.last||{},this.last.slot=this.last.slot||{},this.last.listeners=this.last.listeners||{},this.last.attrs=this.last.attrs||{},{slot:function(){r.last.slot=_objectSpread2(_objectSpread2(_objectSpread2({},c?{children:c}:{children:null}),S),f)},listeners:function(){r.last.listeners=b.on},attrs:function(){r.last.attrs=r.$attrs}});if(e&&Object.keys(e).forEach(function(t){return R[t]()}),t){var g=function(){r.reactInstance&&r.reactInstance.setState(function(e){return Object.keys(e).forEach(function(t){x.isSlots&&"children"===t||delete e[t]}),_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},r.cache),!x.isSlots&&r.last.slot),r.last.attrs),j)}),r.cache=null},j=(!this.microTaskUpdate||this.cache||this.$nextTick(function(){g(),r.microTaskUpdate=!1}),this.macroTaskUpdate&&(clearTimeout(this.updateTimer),this.updateTimer=setTimeout(function(){clearTimeout(r.updateTimer),g(),r.macroTaskUpdate=!1})),{});Object.keys(this.last.listeners).forEach(function(t){j["on".concat(t.replace(/^(\w)/,function(t,e){return e.toUpperCase()}))]=r.$listeners[t]}),this.cache=_objectSpread2(_objectSpread2({},this.cache||{}),_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({},n),o),{"data-passed-props":b}),this.lastVnodeData.class?{className:this.lastVnodeData.class}:{}),_objectSpread2({},u)),{},{hashList:p,style:this.lastVnodeData.style})),this.macroTaskUpdate||this.microTaskUpdate||g()}else{R.slot(),R.listeners(),R.attrs();var l=createReactContainer(O,x,this),P={},C=(Object.keys(b.on).forEach(function(t){P["on".concat(t.replace(/^(\w)/,function(t,e){return e.toUpperCase()}))]=b.on[t]}),React.createElement(l,_extends({},n,this.$attrs,P,{children:c},S,f,{"data-passed-props":b},this.lastVnodeData.class?{className:this.lastVnodeData.class}:{},u,{hashList:p,style:this.lastVnodeData.style,ref:function(t){return r.reactInstance=t}}))),$=(this.$redux&&this.$redux.store&&this.$redux.ReactReduxContext&&(s=this.$redux.ReactReduxContext,C=React.createElement(s.Provider,{value:{store:this.$redux.store}},C)),this.$refs.react),I=x.wrapInstance;if(I)(I=x.wrapInstance).vueWrapperRef=this;else for(var w=this.$parent;w;){if(w.parentReactWrapperRef){I=w.parentReactWrapperRef;break}if(w.reactWrapperRef){I=w.reactWrapperRef;break}w=w.$parent}I?(this.parentReactWrapperRef=I,this.reactPortal=function(){return createPortal(C,$)},I.pushReactPortal(this.reactPortal)):17<ReactMajorVersion?(void 0!==ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED&&(ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint=!0),this.__veauryReactApp__=ReactDOM.createRoot($),this.__veauryReactApp__.render(C)):ReactDOM.render(C,$)}}},mounted:function(){clearTimeout(this.updateTimer),this.mountReactComponent()},beforeDestroy:function(){clearTimeout(this.updateTimer),this.reactPortal?(overwriteDomMethods(this.$refs.react),this.parentReactWrapperRef&&this.parentReactWrapperRef.removeReactPortal(this.reactPortal)):(overwriteDomMethods(this.$refs.react),17<ReactMajorVersion?this.__veauryReactApp__.unmount():ReactDOM.unmountComponentAtNode(this.$refs.react)),recoverDomMethods()},updated:function(){this.mountReactComponent(!0,{slot:!0})},inheritAttrs:!1,watch:{$attrs:{handler:function(){this.mountReactComponent(!0,{attrs:!0})},deep:!0},$listeners:{handler:function(){this.mountReactComponent(!0,{listeners:!0})},deep:!0},"$props.dataPassedProps":{handler:function(){this.mountReactComponent(!0,{passedProps:!0})},deep:!0}}}}var reactRouterInfo={};function applyReactRouterInVue(t){return reactRouterInfo.withRouter||(reactRouterInfo.withRouter=t),reactRouterInfo.withRouter}function setReactRouterInVue(t){reactRouterInfo.vueInstance?updateReactRouterInVue(t):(reactRouterInfo.vueInstance=new Vue({data:_objectSpread2({},t)}),Vue.prototype.$reactRouter=reactRouterInfo.vueInstance.$data)}function updateReactRouterInVue(t){Object.assign(reactRouterInfo.vueInstance.$data,_objectSpread2({},t))}function _typeof$1(t){return(_typeof$1="function"==typeof Symbol&&"symbol"===_typeof(Symbol.iterator)?function(t){return _typeof(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":_typeof(t)})(t)}function _toConsumableArray$1(t){return _arrayWithoutHoles$1(t)||_iterableToArray$1(t)||_nonIterableSpread$1()}function _arrayWithoutHoles$1(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}function _iterableToArray$1(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}function _nonIterableSpread$1(){throw new TypeError("Invalid attempt to spread non-iterable instance")}var inBrowser="undefined"!=typeof window;function freeze(t){return Array.isArray(t)||"object"===_typeof$1(t)?Object.freeze(t):t}function combinePassengers(t){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return t.reduce(function(t,e){var r=e.passengers[0],r="function"==typeof r?r(o):e.passengers;return t.concat(r)},[])}function stableSort(t,r){return t.map(function(t,e){return[e,t]}).sort(function(t,e){return r(t[1],e[1])||t[0]-e[0]}).map(function(t){return t[1]})}function pick(r,t){return t.reduce(function(t,e){return r.hasOwnProperty(e)&&(t[e]=r[e]),t},{})}var transports={},targets={},sources={},Wormhole=Vue.extend({data:function(){return{transports:transports,targets:targets,sources:sources,trackInstances:inBrowser}},methods:{open:function(t){var e,r,o;inBrowser&&(e=t.to,r=t.from,o=t.passengers,t=void 0===(t=t.order)?1/0:t,e)&&r&&o&&(r={to:e,from:r,passengers:freeze(o),order:t},-1===Object.keys(this.transports).indexOf(e)&&Vue.set(this.transports,e,[]),o=this.$_getTransportIndex(r),t=this.transports[e].slice(0),-1===o?t.push(r):t[o]=r,this.transports[e]=stableSort(t,function(t,e){return t.order-e.order}))},close:function(t){var e=1<arguments.length&&void 0!==arguments[1]&&arguments[1],r=t.to;r&&(t.from||!1!==e)&&this.transports[r]&&(e?this.transports[r]=[]:0<=(e=this.$_getTransportIndex(t))&&((t=this.transports[r].slice(0)).splice(e,1),this.transports[r]=t))},registerTarget:function(t,e,r){inBrowser&&(this.trackInstances&&!r&&this.targets[t]&&console.warn("[portal-vue]: Target ".concat(t," already exists")),this.$set(this.targets,t,Object.freeze([e])))},unregisterTarget:function(t){this.$delete(this.targets,t)},registerSource:function(t,e,r){inBrowser&&(this.trackInstances&&!r&&this.sources[t]&&console.warn("[portal-vue]: source ".concat(t," already exists")),this.$set(this.sources,t,Object.freeze([e])))},unregisterSource:function(t){this.$delete(this.sources,t)},hasTarget:function(t){return!(!this.targets[t]||!this.targets[t][0])},hasSource:function(t){return!(!this.sources[t]||!this.sources[t][0])},hasContentFor:function(t){return!!this.transports[t]&&!!this.transports[t].length},$_getTransportIndex:function(t){var e,r=t.to,o=t.from;for(e in this.transports[r])if(this.transports[r][e].from===o)return+e;return-1}}}),wormhole=new Wormhole(transports),_id=1,Portal=Vue.extend({name:"portal",props:{disabled:{type:Boolean},name:{type:String,default:function(){return String(_id++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}}},created:function(){var t=this;this.$nextTick(function(){wormhole.registerSource(t.name,t)})},mounted:function(){this.disabled||this.sendUpdate()},updated:function(){this.disabled?this.clear():this.sendUpdate()},beforeDestroy:function(){wormhole.unregisterSource(this.name),this.clear()},watch:{to:function(t,e){e&&e!==t&&this.clear(e),this.sendUpdate()}},methods:{clear:function(t){t={from:this.name,to:t||this.to};wormhole.close(t)},normalizeSlots:function(){return this.$scopedSlots.default?[this.$scopedSlots.default]:this.$slots.default},normalizeOwnChildren:function(t){return"function"==typeof t?t(this.slotProps):t},sendUpdate:function(){var t=this.normalizeSlots();t?(t={from:this.name,to:this.to,passengers:_toConsumableArray$1(t),order:this.order},wormhole.open(t)):this.clear()}},render:function(t){var e=this.$slots.default||this.$scopedSlots.default||[],r=this.tag;return e&&this.disabled?e.length<=1&&this.slim?this.normalizeOwnChildren(e)[0]:t(r,[this.normalizeOwnChildren(e)]):this.slim?t():t(r,{class:{"v-portal":!0},style:{display:"none"},key:"v-portal-placeholder"})}}),PortalTarget=Vue.extend({name:"portalTarget",props:{multiple:{type:Boolean,default:!1},name:{type:String,required:!0},slim:{type:Boolean,default:!1},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},data:function(){return{transports:wormhole.transports,firstRender:!0}},created:function(){var t=this;this.$nextTick(function(){wormhole.registerTarget(t.name,t)})},watch:{ownTransports:function(){this.$emit("change",0<this.children().length)},name:function(t,e){wormhole.unregisterTarget(e),wormhole.registerTarget(t,this)}},mounted:function(){var t=this;this.transition&&this.$nextTick(function(){t.firstRender=!1})},beforeDestroy:function(){wormhole.unregisterTarget(this.name)},computed:{ownTransports:function(){var t=this.transports[this.name]||[];return this.multiple?t:0===t.length?[]:[t[t.length-1]]},passengers:function(){return combinePassengers(this.ownTransports,this.slotProps)}},methods:{children:function(){return 0!==this.passengers.length?this.passengers:this.$scopedSlots.default?this.$scopedSlots.default(this.slotProps):this.$slots.default||[]},noWrapper:function(){var t;return(t=this.slim&&!this.transition)&&1<this.children().length&&console.warn("[portal-vue]: PortalTarget with `slim` option received more than one child element."),t}},render:function(t){var e=this.noWrapper(),r=this.children(),o=this.transition||this.tag;return e?r[0]:this.slim&&!o?t():t(o,{props:{tag:this.transition&&this.tag?this.tag:void 0},class:{"vue-portal-target":!0}},r)}}),_id$1=0,portalProps=["disabled","name","order","slim","slotProps","tag","to"],targetProps=["multiple","transition"],MountingPortal=Vue.extend({name:"MountingPortal",inheritAttrs:!1,props:{append:{type:[Boolean,String]},bail:{type:Boolean},mountTo:{type:String,required:!0},disabled:{type:Boolean},name:{type:String,default:function(){return"mounted_"+String(_id$1++)}},order:{type:Number,default:0},slim:{type:Boolean},slotProps:{type:Object,default:function(){return{}}},tag:{type:String,default:"DIV"},to:{type:String,default:function(){return String(Math.round(1e7*Math.random()))}},multiple:{type:Boolean,default:!1},targetSlim:{type:Boolean},targetSlotProps:{type:Object,default:function(){return{}}},targetTag:{type:String,default:"div"},transition:{type:[String,Object,Function]}},created:function(){var t,e;"undefined"!=typeof document&&((t=document.querySelector(this.mountTo))?(e=this.$props,wormhole.targets[e.name]?e.bail?console.warn("[portal-vue]: Target ".concat(e.name," is already mounted.\n Aborting because 'bail: true' is set")):this.portalTarget=wormhole.targets[e.name]:((e=e.append)&&(e=document.createElement("string"==typeof e?e:"DIV"),t.appendChild(e),t=e),(e=pick(this.$props,targetProps)).slim=this.targetSlim,e.tag=this.targetTag,e.slotProps=this.targetSlotProps,e.name=this.to,this.portalTarget=new PortalTarget({el:t,parent:this.$parent||this,propsData:e}))):console.error("[portal-vue]: Mount Point '".concat(this.mountTo,"' not found in document")))},beforeDestroy:function(){var t,e=this.portalTarget;this.append&&(t=e.$el).parentNode.removeChild(t),e.$destroy()},render:function(t){var e;return this.portalTarget?this.$scopedSlots.manual?(e=this.$scopedSlots.manual({to:this.to}),(e=Array.isArray(e)?e[0]:e)||t()):(e=pick(this.$props,portalProps),t(Portal,{props:e,attrs:this.$attrs,on:this.$listeners,scopedSlots:this.$scopedSlots},this.$slots.default)):(console.warn("[portal-vue] Target wasn't mounted"),t())}}),REACT_ALL_HANDLERS=new Set(["onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onChange","onInput","onInvalid","onReset","onSubmit","onError","onLoad","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onGotPointerCapture","onLostPointerCapture","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onScroll","onWheel","onAbort","onCanPlay","onCanPlayThrough","onDurationChange","onEmptied","onEncrypted","onEnded","onError","onLoadedData","onLoadedMetadata","onLoadStart","onPause","onPlay","onPlaying","onProgress","onRateChange","onSeeked","onSeeking","onStalled","onSuspend","onTimeUpdate","onVolumeChange","onWaiting","onLoad","onError","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd","onToggle"]),_excluded$1=["history","match","location"],_excluded2$1=["$model"],_excluded3$1=["$sync"],_excluded4$1=["$slots","$scopedSlots","children","on"],_excluded5$1=["component","on","$slots","$scopedSlots","children","class","style","data-passed-props"],_excluded6$1=["className","classname"],unsafePrefix=17<=parseFloat(version)?"UNSAFE_":"",optionsName="vae-of-options";function filterVueComponent(t){return"string"==typeof t?Vue.component(t):t}function getOptions(t){return"function"==typeof t?t.options:t}var GetReactRouterPropsCom=function(){function r(t){var e;return _classCallCheck(this,r),e=_callSuper(this,r,[t]),setReactRouterInVue({history:t.history,match:t.match,location:t.location}),e}return _inherits(r,React.Component),_createClass(r,[{key:"".concat(unsafePrefix,"componentWillReceiveProps"),value:function(t){updateReactRouterInVue({history:t.history,match:t.match,location:t.location})}},{key:"render",value:function(){var t=this.props,t=(t.history,_objectWithoutProperties(t,_excluded$1));return React.createElement(VueComponentLoader,_extends({},t,{ref:this.props.forwardRef}))}}])}(),VueContainer=React.forwardRef(function(t,e){var r=setOptions(t[optionsName]||{},void 0,!0);return reactRouterInfo.withRouter?(VueContainer.RouterTargetComponent||(VueContainer.RouterTargetComponent=reactRouterInfo.withRouter(GetReactRouterPropsCom)),React.createElement(VueContainer.RouterTargetComponent,_extends({},_objectSpread2(_objectSpread2({},t),{},_defineProperty({},optionsName,r)),{forwardRef:e}))):React.createElement(VueComponentLoader,_extends({},_objectSpread2(_objectSpread2({},t),{},_defineProperty({},optionsName,r)),{ref:e}))}),VueComponentLoader=function(){function r(t){var e;return _classCallCheck(this,r),(e=_callSuper(this,r,[t])).state={portals:[]},e.portalKeyPool=[],e.maxPortalCount=0,e.currentVueComponent=filterVueComponent(t.component),e.createVueInstance=e.createVueInstance.bind(e),e.vueComponentContainer=e.createVueComponentContainer(),e}return _inherits(r,React.Component),_createClass(r,[{key:"pushReactPortal",value:function(t){var e=this.state.portals,r=this.portalKeyPool.shift()||this.maxPortalCount++;e.push({Portal:t,key:r}),this.setState({portals:e})}},{key:"removeReactPortal",value:function(r){var o,t=this.state.portals,e=t.find(function(t,e){if(t.Portal===r)return o=e,!0});this.portalKeyPool.push(e.key),t.splice(o,1),this.vueRef&&this.setState({portals:t})}},{key:"createVueComponentContainer",value:function(){var e=this,r={},t=this.props[optionsName];return t.isSlots?(Object.keys(this.props).forEach(function(t){REACT_ALL_HANDLERS.has(t)&&"function"==typeof e.props[t]&&(r[t]=e.props[t])}),t.vue.slotWrapAttrs&&(r=_objectSpread2(_objectSpread2({},r),t.vue.slotWrapAttrs))):t.vue.componentWrapAttrs&&(r=_objectSpread2(_objectSpread2({},r),t.vue.componentWrapAttrs)),t.vue.componentWrapHOC(React.createElement("div",{ref:this.createVueInstance,key:null}),r)}},{key:"".concat(unsafePrefix,"componentWillReceiveProps"),value:function(t){var e,r=this,o=t.component,n=t.children,a=t.$slots,t=_objectWithoutProperties(t,["component",optionsName,"children","$slots"].map(_toPropertyKey)),o=filterVueComponent(o);this.currentVueComponent!==o&&this.updateVueComponent(o),this.vueInstance&&(n=this.transferChildren(n),a=this.transferSlots(a),n&&(t.children=n),a&&(t.$slots=a),e=this.doSync(this.doVModel(t)),Object.keys(this.vueInstance.$data.reactProps).forEach(function(t){t in e||"data-passed-props"===t||r.vueInstance.$set(r.vueInstance.$data.reactProps,t,void 0)}),Object.keys(e).forEach(function(t){r.vueInstance.$set(r.vueInstance.$data.reactProps,t,e[t])}))}},{key:"componentWillUnmount",value:function(){this.vuePortal?this.parentVueWrapperRef.removeVuePortal(this.vuePortal):this.vueInstance&&this.vueInstance.$destroy()}},{key:"doVModel",value:function(t){var e,o,n=t.$model,r=_objectWithoutProperties(t,_excluded2$1);return void 0===n?t:(e=_defineProperty({},(t=_objectSpread2(_objectSpread2({},{prop:"value",event:"input"}),getOptions(this.currentVueComponent).model)).prop,n.value),r.on||(r.on={}),r.on[t.event]?(o=r.on[t.event],r.on[t.event]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];o.apply(this,e),n.setter&&n.setter.apply(this,e)}):r.on=_objectSpread2(_objectSpread2({},r.on),_defineProperty({},t.event,n.setter||function(){})),_objectSpread2(_objectSpread2({},r),e))}},{key:"doSync",value:function(t){var a=t.$sync,e=_objectWithoutProperties(t,_excluded3$1);if(void 0===a)return t;var r,s={};for(r in a)!function(o){if(!a.hasOwnProperty(o)||!a[o]||null==a[o].value||null==a[o].setter)return;s[o]=a[o].value;var n,t="update:"+o;e.on||(e.on={}),e.on[t]?(n=e.on[t],e.on[t]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];n.apply(this,e),a[o].setter&&a[o].setter.apply(this,e)}):e.on=_objectSpread2(_objectSpread2({},e.on),_defineProperty({},t,a[o].setter||function(){}))}(r);return _objectSpread2(_objectSpread2({},e),s)}},{key:"transferSlots",value:function(r){if(r)return Object.keys(r).forEach(function(t){var e=r[t];r[t]=function(){return e}}),r}},{key:"transferChildren",value:function(t){var e;if(t)return e=t,function(){return e}}},{key:"createVueInstance",value:function(t){var _=this,u=this,e=this.props,r=e.component,o=e["data-passed-props"],o=void 0===o?{}:o,p=e[optionsName],n=e.children,a=e.$slots,e=_objectWithoutProperties(e,["component","data-passed-props",optionsName,"children","$slots"].map(_toPropertyKey)),n=this.transferChildren(n),a=this.transferSlots(a),r=(n&&(e.children=n),a&&(e.$slots=a),filterVueComponent(r));function s(t){this.vueInstance||(this.vueInstance=t)}s=s.bind(this);var i=_objectSpread2(_objectSpread2({},this.doSync(this.doVModel(e))),{},{"data-passed-props":o}),c=_objectSpread2(_objectSpread2({},vueRootInfo),{},{data:function(){return{reactProps:i}},created:function(){this.reactWrapperRef=u,s(this)},methods:{getNamespaceSlots:function(a,t){var e,s=this,i=(this.getNamespaceSlots.__namespaceSlots||(this.getNamespaceSlots.__namespaceSlots={}),Object.assign({},t));for(e in i)!function(t){if(!i.hasOwnProperty(t)||!i[t])return;var e,r,o,n;"function"==typeof i[t]&&(i[t]=i[t]()),i[t]=(e=i[t],r=t,e.vueSlot||(null!=(o=s.getNamespaceSlots.__namespaceSlots[t])&&null!=(o=o[0])&&null!=(o=o.child)&&o.reactInstance?(n=s.getNamespaceSlots.__namespaceSlots[t],s.$nextTick(function(){n[0].child.reactInstance.setState({children:e})})):(n=[a(applyReactInVue(function(){return e},_objectSpread2(_objectSpread2({},p),{},{isSlots:!0,wrapInstance:u})),{slot:r})],s.getNamespaceSlots.__namespaceSlots[t]=n),n.reactSlot=e,n))}(e);return i},getScopedSlots:function(i,t){var e,c=this,r=(this.getScopedSlots.__scopeSlots||(this.getScopedSlots.__scopeSlots={}),_objectSpread2({},t));for(e in r)!function(a){if(!r.hasOwnProperty(a))return;var s,t=r[a];r[a]=(s=t,function(){for(var t,e,r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return s.vueFunction?s.vueFunction.apply(c,o):(null!=(t=c.getScopedSlots.__scopeSlots[a])&&null!=(t=t.child)&&t.reactInstance?(e=c.getScopedSlots.__scopeSlots[a],c.$nextTick(function(){e.child.reactInstance.setState({children:s.apply(c,o)})})):(e=i(applyReactInVue(function(){return s.apply(c,o)},_objectSpread2(_objectSpread2({},p),{},{isSlots:!0,wrapInstance:u}))),c.getScopedSlots.__scopeSlots[a]=e),e)}),r[a].reactFunction=t}(e);return r},getChildren:function(t,e){var r,o;if(null!=e)return(e="function"==typeof e?e():e).vueSlot?e.vueSlot:(null!=(r=this.getChildren.__vnode)&&null!=(r=r[0])&&null!=(r=r.child)&&r.reactInstance?(o=this.getChildren.__vnode,this.$nextTick(function(){o[0].child.reactInstance.setState({children:e})})):(o=[t(applyReactInVue(function(){return e},_objectSpread2(_objectSpread2({},p),{},{isSlots:!0,wrapInstance:u})))],this.getChildren.__vnode=o),o.reactSlot=e,o)}},mounted:function(){u.vueRef=this.$children[0],this.$children[0].reactWrapperRef=u},beforeDestroy:function(){u.vueRef=null,this.$children[0].reactWrapperRef=null},render:function(t){var e=this.$data.reactProps,r=(e.component,e.on),o=e.$slots,n=e.$scopedSlots,a=e.class,a=void 0===a?"":a,s=e.style,s=void 0===s?"":s,i=e["data-passed-props"],c=i.$slots,u=i.$scopedSlots,p=i.children,l=i.on,i=_objectWithoutProperties(i,_excluded4$1),d=_objectWithoutProperties(e,_excluded5$1),e=(!function(t,e){if(!t)return;if(e)for(var r in t)t.hasOwnProperty(r)&&e[r]&&delete t[r]}(u,c),this.getScopedSlots(t,_objectSpread2(_objectSpread2({},u),n))),u=this.getChildren(t,this.reactProps.children||p),f=this.getNamespaceSlots(t,_objectSpread2(_objectSpread2({},c),o)),n=(u&&(f.default=u),[u||[]].concat(_toConsumableArray(Object.keys(f).map(function(t){if("default"!==t)return f[t]})))),p=_objectSpread2(_objectSpread2({},l),r),h={},c=(Object.keys(d).forEach(function(t){REACT_ALL_HANDLERS.has(t)&&"function"==typeof d[t]&&(h[t.replace(/^on/,"").toLowerCase()]=d[t],delete d[t])}),_objectSpread2(_objectSpread2(_objectSpread2({},i),d),{},{"data-passed-props":_objectSpread2(_objectSpread2(_objectSpread2({},i),d),{},{on:p,children:u,$slots:f,$scopedSlots:e})})),o=function(t){var e=[],r={},o=getOptions(_.currentVueComponent),n=(o.mixins&&o.mixins.forEach(function(t){t.props&&(t.props instanceof Array?e=_toConsumableArray(t.props):r=_objectSpread2({},t.props))}),Object.assign({},t)),t=o.props;if(t)if(t instanceof Array)[].concat(_toConsumableArray(t),_toConsumableArray(e)).forEach(function(t){delete n[t]});else{var a,s=_objectSpread2(_objectSpread2({},t),r);for(a in s)s.hasOwnProperty(a)&&delete n[a]}return n}(_objectSpread2({},c)),l=o.className,r=o.classname,i=_objectWithoutProperties(o,_excluded6$1);return t("use_vue_wrapper",{props:c,on:p,nativeOn:h,attrs:i,class:a||l||r||"",style:s,scopedSlots:_objectSpread2({},e)},n)},components:{use_vue_wrapper:r}});if(t){var l="__vue_wrapper_container_"+(Math.random()+"").substr(2),d=(t.id=l,p.wrapInstance);if(d)(d=p.wrapInstance).reactWrapperRef=u;else for(var f,h=(this._reactInternals||this._reactInternalFiber).return;h;){if(null!=(f=h.stateNode)&&f.parentVueWrapperRef){d=h.stateNode.parentVueWrapperRef;break}if(null!=(f=h.stateNode)&&f.vueWrapperRef){d=h.stateNode.vueWrapperRef;break}h=h.return}d&&document.getElementById(l)?(this.parentVueWrapperRef=d,this.vuePortal=function(t,e){return t(MountingPortal,{props:{mountTo:"#"+l,slim:!0,targetSlim:!0},key:l},[t(Object.assign(c,{router:_._router}))])},d.pushVuePortal(this.vuePortal)):this.vueInstance=new Vue(_objectSpread2(_objectSpread2({},c),{},{el:t}))}}},{key:"updateVueComponent",value:function(t){this.currentVueComponent=t,this.vueInstance&&(t.__fromReactSlot?Object.assign(this.vueInstance.$options.components.use_vue_wrapper._Ctor[0].options,t):this.vueInstance.$options.components.use_vue_wrapper=t,this.vueInstance.$forceUpdate())}},{key:"render",value:function(){return React.createElement(this.vueComponentContainer,{portals:this.state.portals})}}])}();function applyVueInReact(r){var o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return r||console.warn("Component must be passed in applyVueInReact!"),r.__esModule&&r.default&&(r=r.default),React.forwardRef(function(t,e){return React.createElement(VueContainer,_extends({},t,{component:r,ref:e},_defineProperty({},optionsName,o)))})}function lazyVueInReact(t,e){return lazy(function(){return t().then(function(t){return{default:applyVueInReact(t.default,e)}})})}function lazyReactInVue(t,e){return function(){return t().then(function(t){return applyReactInVue(t.default,e)})}}var reduxInstance,vuexStore,ReduxLinkVue=function(){return _createClass(function t(e){var r=this;if(_classCallCheck(this,t),!e||!e.subscribe||!e.getState)throw Error("incorrect store passed in, please check the function applyRedux's parameter must contains redux store");(this.store=e).subscribe(function(){r._vm.state=e.getState()}),this._vm=new Vue({data:function(){return{state:e.getState()}}})},[{key:"state",get:function(){return this._vm.state}},{key:"dispatch",get:function(){return this.store.dispatch}}])}();function applyRedux(t){var e=t.store,t=t.ReactReduxContext;return reduxInstance||(reduxInstance=new ReduxLinkVue(e),t&&(reduxInstance.ReactReduxContext=t),Vue.prototype.$redux=reduxInstance),reduxInstance}function connectVuex(t){var e=t.mapStateToProps,o=void 0===e?function(t){}:e,e=t.mapGettersToProps,n=void 0===e?function(t){}:e,e=t.mapCommitToProps,a=void 0===e?function(t){}:e,e=t.mapDispatchToProps,s=void 0===e?function(t){}:e;return function(t){var r=function(){function e(t){if(_classCallCheck(this,e),t=_callSuper(this,e,[t]),(vuexStore=vueRootInfo.store?vueRootInfo.store:vuexStore)&&vuexStore.state&&vuexStore.subscribe&&vuexStore.dispatch&&vuexStore.commit)return t.state=_objectSpread2(_objectSpread2({},o(vuexStore.state)),n(vuexStore.getters)),t;throw Error("[vae-of warn]Error: incorrect store passed in, please check the function applyVuex's parameter must be vuex store")}return _inherits(e,React.Component),_createClass(e,[{key:"componentDidMount",value:function(){var e=this;this.watch=vuexStore.watch(function(){return _objectSpread2(_objectSpread2({},o(vuexStore.state)),n(vuexStore.getters))},function(t){e.setState(t)},{deep:!0})}},{key:"componentWillUnmount",value:function(){this.watch()}},{key:"render",value:function(){return React.createElement(t,_extends({},this.props,_objectSpread2(_objectSpread2(_objectSpread2({},this.state),a(vuexStore.commit)),s(vuexStore.dispatch)),{ref:this.props.forwardedRef}))}}])}();return React.forwardRef(function(t,e){return React.createElement(r,_extends({forwardedRef:e},t))})}}function applyVuex(t){vuexStore=t}var vueRouterInfo={};function widthVueRouter(t){var r=function(){function e(t){if(_classCallCheck(this,e),t=_callSuper(this,e,[t]),!vueRouterInfo.instance){if(!vueRootInfo.router)throw Error("Vue router does not exist! You must setting the Vue router in the Vue Instance options first.");vueRouterInfo.instance=new Vue({router:vueRootInfo.router})}return t.state={$vueRouter:vueRouterInfo.instance.$router,$vueRoute:vueRouterInfo.instance.$route},t}return _inherits(e,React.Component),_createClass(e,[{key:"componentDidMount",value:function(){var t=this;this.subscribe=vueRouterInfo.instance.$watch("$route",function(){t.setState({$vueRouter:vueRouterInfo.instance.$router,$vueRoute:vueRouterInfo.instance.$route})})}},{key:"componentWillUnmount",value:function(){this.subscribe()}},{key:"render",value:function(){return React.createElement(t,_extends({},this.props,this.state,{ref:this.props.forwardedRef}))}}])}();return React.forwardRef(function(t,e){return React.createElement(r,_extends({forwardedRef:e},t))})}var useReactInVue=applyReactInVue,useVueInReact=applyVueInReact,useRedux=applyRedux,useVuex=applyVuex;export{REACT_ALL_HANDLERS,VueContainer,applyReactInVue,applyReactRouterInVue,applyRedux,applyVueInReact,applyVuex,connectVuex,lazyReactInVue,lazyVueInReact,useReactInVue,useRedux,useVueInReact,useVuex,vueRootInfo,widthVueRouter as withVueRouter};