text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ydj=t(require("react")):e.ydj=t(e.react)}(this,(function(e){return(()=>{"use strict";var t={964:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.dispatch=t.removeStore=t.getStore=t.addStore=void 0;const o=new Map;t.addStore=(e,t,r)=>{let i=o.get(e);if(i)s(i,t);else if(i="function"!=typeof e?e:new e,o.set(e,i),s(i,t),!i.initialized){const e=i.init?.();return e?e.then((()=>(i&&(void 0!==r&&void 0===i.state&&(i.state=r),i.initialized=!0),i?.state))):(void 0!==r&&void 0===i.state&&(i.state=r),i.initialized=!0,i.state)}return i.state},t.getStore=e=>o.get(e);const r={},s=(e,t)=>{for(let o in e.actions){r[o]||(r[o]={store:e,setStates:[]});const{store:s,setStates:i}=r[o];if(e!==s)throw new Error("store actions conflict");i.includes(t)||i.push(t)}};t.removeStore=(e,t)=>{Object.keys(e.actions).forEach((o=>{const{store:s,setStates:i}=r[o];if(e===s){const e=i.filter((e=>e!==t));r[o].setStates=e}}))};const i=(e,t)=>{e.forEach((e=>{e(t)}))},n=async e=>{e&&await t.dispatch(e.action,e.data)};t.dispatch=async(e,t)=>{if(r[e]){const{store:o,setStates:s}=r[e],a=o.actions[e].call(o,t);if(a)if(a instanceof Promise){const e=await a;i(s,o.state),await n(e)}else i(s,o.state),await n(a);else i(s,o.state)}}},339:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Store=void 0,t.Store=class{constructor(){this.initialized=!1}setState(e){this.state!==e&&(this.state=e)}}},137:(e,t,o)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStore=void 0;const r=o(297),s=o(964);t.useStore=(e,t)=>{const[o,i]=r.useState(t);return r.useEffect((()=>{const o=s.addStore(e,i,t);return o instanceof Promise?o.then((e=>{i(e)})):i(o),()=>{const t=s.getStore(e);t&&s.removeStore(t,i)}}),[]),o}},297:t=>{t.exports=e}},o={};function r(e){var s=o[e];if(void 0!==s)return s.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,r),i.exports}var s={};return(()=>{var e=s;Object.defineProperty(e,"__esModule",{value:!0}),e.dispatch=e.Store=e.useStore=void 0;var t=r(137);Object.defineProperty(e,"useStore",{enumerable:!0,get:function(){return t.useStore}});var o=r(339);Object.defineProperty(e,"Store",{enumerable:!0,get:function(){return o.Store}});var i=r(964);Object.defineProperty(e,"dispatch",{enumerable:!0,get:function(){return i.dispatch}})})(),s})()}));