@ngxs/store 3.7.3-dev.master-5175b98 → 3.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/README.md +16 -16
  2. package/bundles/ngxs-store-internals-testing.umd.js +215 -235
  3. package/bundles/ngxs-store-internals-testing.umd.js.map +1 -1
  4. package/bundles/ngxs-store-internals-testing.umd.min.js +2 -2
  5. package/bundles/ngxs-store-internals-testing.umd.min.js.map +1 -1
  6. package/bundles/ngxs-store-internals.umd.js +211 -422
  7. package/bundles/ngxs-store-internals.umd.js.map +1 -1
  8. package/bundles/ngxs-store-internals.umd.min.js +1 -1
  9. package/bundles/ngxs-store-internals.umd.min.js.map +1 -1
  10. package/bundles/ngxs-store-operators.umd.js +310 -311
  11. package/bundles/ngxs-store-operators.umd.js.map +1 -1
  12. package/bundles/ngxs-store-operators.umd.min.js +1 -1
  13. package/bundles/ngxs-store-operators.umd.min.js.map +1 -1
  14. package/bundles/ngxs-store.umd.js +4518 -4423
  15. package/bundles/ngxs-store.umd.js.map +1 -1
  16. package/bundles/ngxs-store.umd.min.js +1 -1
  17. package/bundles/ngxs-store.umd.min.js.map +1 -1
  18. package/esm2015/index.js +13 -13
  19. package/esm2015/internals/angular.js +40 -46
  20. package/esm2015/internals/index.js +10 -11
  21. package/esm2015/internals/initial-state.js +34 -34
  22. package/esm2015/internals/internal-tokens.js +16 -16
  23. package/esm2015/internals/memoize.js +70 -70
  24. package/esm2015/internals/ngxs-bootstrapper.js +41 -41
  25. package/esm2015/internals/ngxs-store-internals.js +9 -9
  26. package/esm2015/internals/src/symbols.js +14 -14
  27. package/esm2015/internals/symbols.js +14 -14
  28. package/esm2015/internals/testing/fresh-platform.js +71 -90
  29. package/esm2015/internals/testing/helpers/ngxs-test.component.js +22 -22
  30. package/esm2015/internals/testing/helpers/ngxs-test.module.js +24 -24
  31. package/esm2015/internals/testing/index.js +7 -7
  32. package/esm2015/internals/testing/ngxs-store-internals-testing.js +8 -8
  33. package/esm2015/internals/testing/ngxs.setup.js +76 -76
  34. package/esm2015/internals/testing/symbol.js +29 -29
  35. package/esm2015/ngxs-store.js +27 -24
  36. package/esm2015/operators/append.js +31 -31
  37. package/esm2015/operators/compose.js +24 -24
  38. package/esm2015/operators/iif.js +56 -56
  39. package/esm2015/operators/index.js +18 -18
  40. package/esm2015/operators/insert-item.js +41 -41
  41. package/esm2015/operators/internals.js +5 -5
  42. package/esm2015/operators/ngxs-store-operators.js +8 -8
  43. package/esm2015/operators/patch.js +39 -38
  44. package/esm2015/operators/remove-item.js +34 -34
  45. package/esm2015/operators/update-item.js +52 -54
  46. package/esm2015/operators/utils.js +50 -50
  47. package/esm2015/src/actions/actions.js +39 -39
  48. package/esm2015/src/actions/symbols.js +39 -39
  49. package/esm2015/src/actions-stream.js +140 -138
  50. package/esm2015/src/configs/messages.config.js +87 -79
  51. package/esm2015/src/decorators/action.js +44 -48
  52. package/esm2015/src/decorators/select/select-factory.js +46 -49
  53. package/esm2015/src/decorators/select/select.js +45 -81
  54. package/esm2015/src/decorators/select/symbols.js +50 -94
  55. package/esm2015/src/decorators/selector/selector.js +55 -59
  56. package/esm2015/src/decorators/selector/symbols.js +5 -5
  57. package/esm2015/src/decorators/selector-options.js +34 -34
  58. package/esm2015/src/decorators/state.js +75 -83
  59. package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +96 -101
  60. package/esm2015/src/execution/internal-ngxs-execution-strategy.js +45 -45
  61. package/esm2015/src/execution/noop-ngxs-execution-strategy.js +27 -27
  62. package/esm2015/src/execution/symbols.js +29 -29
  63. package/esm2015/src/host-environment/host-environment.js +31 -0
  64. package/esm2015/src/internal/config-validator.js +67 -0
  65. package/esm2015/src/internal/dispatcher.js +217 -217
  66. package/esm2015/src/internal/internals.js +489 -493
  67. package/esm2015/src/internal/lifecycle-state-manager.js +129 -129
  68. package/esm2015/src/internal/state-context-factory.js +138 -138
  69. package/esm2015/src/internal/state-factory.js +429 -449
  70. package/esm2015/src/internal/state-operations.js +125 -120
  71. package/esm2015/src/internal/state-operators.js +33 -33
  72. package/esm2015/src/internal/state-stream.js +21 -21
  73. package/esm2015/src/ivy/ensure-state-class-is-injectable.js +34 -0
  74. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +40 -28
  75. package/esm2015/src/module.js +172 -158
  76. package/esm2015/src/modules/ngxs-feature.module.js +63 -63
  77. package/esm2015/src/modules/ngxs-root.module.js +52 -52
  78. package/esm2015/src/operators/leave-ngxs.js +58 -58
  79. package/esm2015/src/operators/of-action.js +191 -191
  80. package/esm2015/src/plugin-manager.js +70 -70
  81. package/esm2015/src/plugin_api.js +10 -10
  82. package/esm2015/src/public_api.js +29 -29
  83. package/esm2015/src/public_to_deprecate.js +64 -64
  84. package/esm2015/src/state-token/state-token.js +45 -45
  85. package/esm2015/src/state-token/symbols.js +5 -5
  86. package/esm2015/src/store.js +174 -174
  87. package/esm2015/src/symbols.js +221 -217
  88. package/esm2015/src/utils/compose.js +44 -44
  89. package/esm2015/src/utils/freeze.js +35 -35
  90. package/esm2015/src/utils/selector-utils.js +221 -221
  91. package/esm2015/src/utils/store-validators.js +65 -60
  92. package/esm2015/src/utils/utils.js +143 -143
  93. package/esm5/index.js +13 -13
  94. package/esm5/internals/angular.js +40 -46
  95. package/esm5/internals/index.js +10 -11
  96. package/esm5/internals/initial-state.js +45 -45
  97. package/esm5/internals/internal-tokens.js +16 -16
  98. package/esm5/internals/memoize.js +71 -71
  99. package/esm5/internals/ngxs-bootstrapper.js +56 -56
  100. package/esm5/internals/ngxs-store-internals.js +9 -9
  101. package/esm5/internals/src/symbols.js +14 -14
  102. package/esm5/internals/symbols.js +14 -14
  103. package/esm5/internals/testing/fresh-platform.js +81 -101
  104. package/esm5/internals/testing/helpers/ngxs-test.component.js +32 -32
  105. package/esm5/internals/testing/helpers/ngxs-test.module.js +32 -32
  106. package/esm5/internals/testing/index.js +7 -7
  107. package/esm5/internals/testing/ngxs-store-internals-testing.js +8 -8
  108. package/esm5/internals/testing/ngxs.setup.js +98 -98
  109. package/esm5/internals/testing/symbol.js +29 -29
  110. package/esm5/ngxs-store.js +27 -24
  111. package/esm5/operators/append.js +31 -31
  112. package/esm5/operators/compose.js +28 -28
  113. package/esm5/operators/iif.js +56 -56
  114. package/esm5/operators/index.js +18 -18
  115. package/esm5/operators/insert-item.js +41 -41
  116. package/esm5/operators/internals.js +5 -5
  117. package/esm5/operators/ngxs-store-operators.js +8 -8
  118. package/esm5/operators/patch.js +40 -39
  119. package/esm5/operators/remove-item.js +34 -34
  120. package/esm5/operators/update-item.js +52 -54
  121. package/esm5/operators/utils.js +50 -50
  122. package/esm5/src/actions/actions.js +62 -62
  123. package/esm5/src/actions/symbols.js +39 -39
  124. package/esm5/src/actions-stream.js +186 -184
  125. package/esm5/src/configs/messages.config.js +104 -79
  126. package/esm5/src/decorators/action.js +56 -60
  127. package/esm5/src/decorators/select/select-factory.js +47 -50
  128. package/esm5/src/decorators/select/select.js +50 -87
  129. package/esm5/src/decorators/select/symbols.js +51 -95
  130. package/esm5/src/decorators/selector/selector.js +55 -59
  131. package/esm5/src/decorators/selector/symbols.js +5 -5
  132. package/esm5/src/decorators/selector-options.js +34 -34
  133. package/esm5/src/decorators/state.js +76 -84
  134. package/esm5/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +121 -121
  135. package/esm5/src/execution/internal-ngxs-execution-strategy.js +54 -54
  136. package/esm5/src/execution/noop-ngxs-execution-strategy.js +41 -41
  137. package/esm5/src/execution/symbols.js +29 -29
  138. package/esm5/src/host-environment/host-environment.js +29 -0
  139. package/esm5/src/internal/config-validator.js +76 -0
  140. package/esm5/src/internal/dispatcher.js +253 -253
  141. package/esm5/src/internal/internals.js +491 -495
  142. package/esm5/src/internal/lifecycle-state-manager.js +177 -177
  143. package/esm5/src/internal/state-context-factory.js +146 -146
  144. package/esm5/src/internal/state-factory.js +563 -575
  145. package/esm5/src/internal/state-operations.js +139 -130
  146. package/esm5/src/internal/state-operators.js +34 -34
  147. package/esm5/src/internal/state-stream.js +25 -25
  148. package/esm5/src/ivy/ensure-state-class-is-injectable.js +34 -0
  149. package/esm5/src/ivy/ivy-enabled-in-dev-mode.js +40 -28
  150. package/esm5/src/module.js +215 -201
  151. package/esm5/src/modules/ngxs-feature.module.js +65 -65
  152. package/esm5/src/modules/ngxs-root.module.js +47 -47
  153. package/esm5/src/operators/leave-ngxs.js +58 -58
  154. package/esm5/src/operators/of-action.js +217 -217
  155. package/esm5/src/plugin-manager.js +82 -82
  156. package/esm5/src/plugin_api.js +10 -10
  157. package/esm5/src/public_api.js +29 -29
  158. package/esm5/src/public_to_deprecate.js +64 -64
  159. package/esm5/src/state-token/state-token.js +57 -57
  160. package/esm5/src/state-token/symbols.js +5 -5
  161. package/esm5/src/store.js +225 -225
  162. package/esm5/src/symbols.js +230 -226
  163. package/esm5/src/utils/compose.js +55 -55
  164. package/esm5/src/utils/freeze.js +35 -35
  165. package/esm5/src/utils/selector-utils.js +230 -230
  166. package/esm5/src/utils/store-validators.js +86 -78
  167. package/esm5/src/utils/utils.js +151 -151
  168. package/fesm2015/ngxs-store-internals-testing.js +175 -194
  169. package/fesm2015/ngxs-store-internals-testing.js.map +1 -1
  170. package/fesm2015/ngxs-store-internals.js +194 -402
  171. package/fesm2015/ngxs-store-internals.js.map +1 -1
  172. package/fesm2015/ngxs-store-operators.js +312 -313
  173. package/fesm2015/ngxs-store-operators.js.map +1 -1
  174. package/fesm2015/ngxs-store.js +3976 -3927
  175. package/fesm2015/ngxs-store.js.map +1 -1
  176. package/fesm5/ngxs-store-internals-testing.js +221 -241
  177. package/fesm5/ngxs-store-internals-testing.js.map +1 -1
  178. package/fesm5/ngxs-store-internals.js +219 -427
  179. package/fesm5/ngxs-store-internals.js.map +1 -1
  180. package/fesm5/ngxs-store-operators.js +316 -317
  181. package/fesm5/ngxs-store-operators.js.map +1 -1
  182. package/fesm5/ngxs-store.js +4510 -4420
  183. package/fesm5/ngxs-store.js.map +1 -1
  184. package/index.d.ts +8 -8
  185. package/internals/angular.d.ts +3 -3
  186. package/internals/index.d.ts +6 -7
  187. package/internals/initial-state.d.ts +8 -8
  188. package/internals/internal-tokens.d.ts +9 -9
  189. package/internals/memoize.d.ts +9 -9
  190. package/internals/ngxs-bootstrapper.d.ts +13 -13
  191. package/internals/ngxs-store-internals.d.ts +4 -4
  192. package/internals/ngxs-store-internals.metadata.json +1 -1
  193. package/internals/src/symbols.d.ts +7 -7
  194. package/internals/symbols.d.ts +7 -7
  195. package/internals/testing/fresh-platform.d.ts +1 -1
  196. package/internals/testing/helpers/ngxs-test.component.d.ts +5 -5
  197. package/internals/testing/helpers/ngxs-test.module.d.ts +4 -4
  198. package/internals/testing/index.d.ts +3 -3
  199. package/internals/testing/ngxs-store-internals-testing.d.ts +4 -4
  200. package/internals/testing/ngxs-store-internals-testing.metadata.json +1 -1
  201. package/internals/testing/ngxs.setup.d.ts +7 -7
  202. package/internals/testing/symbol.d.ts +14 -14
  203. package/ngxs-store.d.ts +23 -20
  204. package/ngxs-store.metadata.json +1 -1
  205. package/operators/append.d.ts +6 -6
  206. package/operators/compose.d.ts +2 -3
  207. package/operators/iif.d.ts +11 -11
  208. package/operators/index.d.ts +13 -13
  209. package/operators/insert-item.d.ts +7 -7
  210. package/operators/internals.d.ts +2 -2
  211. package/operators/ngxs-store-operators.d.ts +4 -4
  212. package/operators/ngxs-store-operators.metadata.json +1 -1
  213. package/operators/patch.d.ts +10 -6
  214. package/operators/remove-item.d.ts +7 -7
  215. package/operators/update-item.d.ts +10 -10
  216. package/operators/utils.d.ts +9 -10
  217. package/package.json +2 -2
  218. package/src/actions/actions.d.ts +15 -15
  219. package/src/actions/symbols.d.ts +21 -21
  220. package/src/actions-stream.d.ts +49 -49
  221. package/src/configs/messages.config.d.ts +30 -11
  222. package/src/decorators/action.d.ts +5 -5
  223. package/src/decorators/select/select-factory.d.ts +14 -13
  224. package/src/decorators/select/select.d.ts +4 -4
  225. package/src/decorators/select/symbols.d.ts +10 -14
  226. package/src/decorators/selector/selector.d.ts +5 -5
  227. package/src/decorators/selector/symbols.d.ts +4 -4
  228. package/src/decorators/selector-options.d.ts +5 -5
  229. package/src/decorators/state.d.ts +6 -6
  230. package/src/execution/dispatch-outside-zone-ngxs-execution-strategy.d.ts +12 -11
  231. package/src/execution/internal-ngxs-execution-strategy.d.ts +7 -7
  232. package/src/execution/noop-ngxs-execution-strategy.d.ts +5 -5
  233. package/src/execution/symbols.d.ts +6 -6
  234. package/src/host-environment/host-environment.d.ts +6 -0
  235. package/src/internal/config-validator.d.ts +10 -0
  236. package/src/internal/dispatcher.d.ts +32 -32
  237. package/src/internal/internals.d.ts +167 -166
  238. package/src/internal/lifecycle-state-manager.d.ts +20 -20
  239. package/src/internal/state-context-factory.d.ts +15 -15
  240. package/src/internal/state-factory.d.ts +58 -57
  241. package/src/internal/state-operations.d.ts +21 -19
  242. package/src/internal/state-operators.d.ts +2 -2
  243. package/src/internal/state-stream.d.ts +9 -9
  244. package/src/ivy/ensure-state-class-is-injectable.d.ts +6 -0
  245. package/src/ivy/ivy-enabled-in-dev-mode.d.ts +14 -6
  246. package/src/module.d.ts +23 -23
  247. package/src/modules/ngxs-feature.module.d.ts +13 -13
  248. package/src/modules/ngxs-root.module.d.ts +13 -13
  249. package/src/operators/leave-ngxs.d.ts +7 -7
  250. package/src/operators/of-action.d.ts +43 -43
  251. package/src/plugin-manager.d.ts +10 -10
  252. package/src/plugin_api.d.ts +5 -5
  253. package/src/public_api.d.ts +17 -17
  254. package/src/public_to_deprecate.d.ts +21 -21
  255. package/src/state-token/state-token.d.ts +7 -7
  256. package/src/state-token/symbols.d.ts +5 -5
  257. package/src/store.d.ts +53 -53
  258. package/src/symbols.d.ts +137 -135
  259. package/src/utils/compose.d.ts +23 -23
  260. package/src/utils/freeze.d.ts +5 -5
  261. package/src/utils/selector-utils.d.ts +23 -23
  262. package/src/utils/store-validators.d.ts +8 -7
  263. package/src/utils/utils.d.ts +46 -46
  264. package/types/index.d.ts +2 -2
  265. package/esm2015/internals/decorator-injector-adapter.js +0 -204
  266. package/esm5/internals/decorator-injector-adapter.js +0 -204
  267. package/internals/decorator-injector-adapter.d.ts +0 -15
@@ -12,5 +12,5 @@
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}function l(){throw new Error("You have forgotten to import the NGXS module!")}var h=function(){function t(t,n){this._ngZone=t,this._platformId=n,("undefined"==typeof ngDevMode||ngDevMode)&&function(t){if(t instanceof e.NgZone)return;console.warn("Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })")}(t)}return t.prototype.enter=function(t){return r.isPlatformServer(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)},t.prototype.leave=function(t){return this.runInsideAngular(t)},t.prototype.runInsideAngular=function(t){return e.NgZone.isInAngularZone()?t():this._ngZone.run(t)},t.prototype.runOutsideAngular=function(t){return e.NgZone.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t}();var y=new e.InjectionToken("ROOT_STATE_TOKEN"),d=new e.InjectionToken("FEATURE_STATE_TOKEN"),g=new e.InjectionToken("NGXS_PLUGINS"),v="NGXS_META",S="NGXS_OPTIONS_META",m="NGXS_SELECTOR_META",_=function(){function t(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=h}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}();var O=function(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n};var b=new e.InjectionToken("NGXS_EXECUTION_STRATEGY");function x(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}var E=function(t,e,n){t=c({},t);var r=e.split("."),o=r.length-1;return r.reduce((function(t,e,r){return t[e]=r===o?n:Array.isArray(t[e])?t[e].slice():c({},t[e]),t&&t[e]}),t),t},I=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)},T=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},j=function(t){for(var e,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return t;var i=r.shift();if(T(t)&&T(i))for(var a in i)T(i[a])?(t[a]||Object.assign(t,((e={})[a]={},e)),j(t[a],i[a])):Object.assign(t,((n={})[a]=i[a],n));return j.apply(void 0,f([t],r))};function A(t){if(!t.hasOwnProperty(v)){var e={name:null,actions:{},defaults:{},path:null,makeRootSelector:function(t){return t.getStateGetter(e.name)},children:[]};Object.defineProperty(t,v,{value:e})}return N(t)}function N(t){return t[v]}function w(t){if(!t.hasOwnProperty(m)){Object.defineProperty(t,m,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:function(){return{}}}})}return P(t)}function P(t){return t[m]}function C(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){var e=t.slice();return(function(t){return e.reduce((function(t,e){return t&&t[e]}),t)})}(t):function(t){for(var e=t,n="store."+e[0],r=0,o=e.length,i=n;++r<o;)i=i+" && "+(n=n+"."+e[r]);return new Function("store","return "+i+";")}(t)}function R(t,e){var n=I(e.currentAppState,t.path),r=I(e.newAppState,t.path);return new O(n,r,!t.isInitialised)}function M(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D(t,["DISPATCHED"])}function D(t,e,n){void 0===n&&(n=k);var r=t.reduce((function(t,e){return t[x(e)]=!0,t}),{}),o=e&&function(t){return t.reduce((function(t,e){return t[e]=!0,t}),{})}(e);return function(t){return t.pipe(function(t,e){return i.filter((function(n){var r=x(n.action),o=t[r],i=!e||e[n.status];return o&&i}))}(r,o),n())}}function F(){return i.map((function(t){var e=t.action,n=t.status;return({action:e,result:{successful:"SUCCESSFUL"===n,canceled:"CANCELED"===n,error:t.error}})}))}function k(){return i.map((function(t){return t.action}))}function B(t){return function(e){return new o.Observable((function(n){return e.subscribe({next:function(e){t.leave((function(){return n.next(e)}))},error:function(e){t.leave((function(){return n.error(e)}))},complete:function(){t.leave((function(){return n.complete()}))}})}))}}var L=function(){function t(t){this._executionStrategy=t}return t.prototype.enter=function(t){return this._executionStrategy.enter(t)},t.prototype.leave=function(t){return this._executionStrategy.leave(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[b]}]}]},t}();var U=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._itemQueue=[],e._busyPushingNext=!1,e}return u(e,t),e.prototype.next=function(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,t.prototype.next.call(this,e);this._itemQueue.length>0;){var n=this._itemQueue.pop();t.prototype.next.call(this,n)}this._busyPushingNext=!1}},e}(o.Subject);var H=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(U),G=function(t){function n(e,n){return t.call(this,(function(t){var r=e.pipe(B(n)).subscribe({next:function(e){return t.next(e)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});t.add(r)}))||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[{type:H},{type:L}]},n}(o.Observable),X=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.shift();return r.apply(void 0,f(e,[function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return X(t).apply(void 0,f(e))}]))}},V=function(t){function n(){return t.call(this,{})||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]},n}(o.BehaviorSubject),Z=function(){function t(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}return Object.defineProperty(t.prototype,"rootPlugins",{get:function(){return this._parentManager&&this._parentManager.plugins||this.plugins},enumerable:!0,configurable:!0}),t.prototype.registerHandlers=function(){var t,e=this.getPluginHandlers();(t=this.rootPlugins).push.apply(t,f(e))},t.prototype.getPluginHandlers=function(){return(this._pluginHandlers||[]).map((function(t){return t.handle?t.handle.bind(t):t}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:Array,decorators:[{type:e.Inject,args:[g]},{type:e.Optional}]}]},t}();var q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(o.Subject),z=function(){function t(t,e,n,r,o,i){this._injector=t,this._actions=e,this._actionResults=n,this._pluginManager=r,this._stateStream=o,this._ngxsExecutionStrategy=i}return t.prototype.dispatch=function(t){var n=this,r=this._ngxsExecutionStrategy.enter((function(){return n.dispatchByEvents(t)}));return r.subscribe({error:function(t){return n._ngxsExecutionStrategy.leave((function(){try{n._errorHandler=n._errorHandler||n._injector.get(e.ErrorHandler),n._errorHandler.handleError(t)}catch(t){}}))}}),r.pipe(B(this._ngxsExecutionStrategy))},t.prototype.dispatchByEvents=function(t){var e=this;return Array.isArray(t)?0===t.length?o.of(this._stateStream.getValue()):o.forkJoin(t.map((function(t){return e.dispatchSingle(t)}))):this.dispatchSingle(t)},t.prototype.dispatchSingle=function(t){var e=this;if(!x(t)){var n=new Error("This action doesn't have a type property: "+t.constructor.name);return o.throwError(n)}var r=this._stateStream.getValue(),a=this._pluginManager.plugins;return X(f(a,[function(t,n){t!==r&&e._stateStream.next(t);var o=e.getActionResultStream(n);return o.subscribe((function(t){return e._actions.next(t)})),e._actions.next({action:n,status:"DISPATCHED"}),e.createDispatchObservable(o)}]))(r,t).pipe(i.shareReplay())},t.prototype.getActionResultStream=function(t){return this._actionResults.pipe(i.filter((function(e){return e.action===t&&"DISPATCHED"!==e.status})),i.take(1),i.shareReplay())},t.prototype.createDispatchObservable=function(t){var e=this;return t.pipe(i.exhaustMap((function(t){switch(t.status){case"SUCCESSFUL":return o.of(e._stateStream.getValue());case"ERRORED":return o.throwError(t.error);default:return o.EMPTY}}))).pipe(i.shareReplay())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.Injector},{type:H},{type:q},{type:Z},{type:V},{type:L}]},t}();var Y=function(t){Object.freeze(t);var e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(r){!n.call(t,r)||e&&("caller"===r||"callee"===r||"arguments"===r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||Object.isFrozen(t[r])||Y(t[r])})),t},K=function(){function t(t,e,n){this._stateStream=t,this._dispatcher=e,this._config=n}return t.prototype.getRootStateOperations=function(){var t,e=this,n={getState:function(){return e._stateStream.getValue()},setState:function(t){return e._stateStream.next(t)},dispatch:function(t){return e._dispatcher.dispatch(t)}};return this._config.developmentMode?(t=n,{getState:function(){return t.getState()},setState:function(e){var n=Y(e);return t.setState(n)},dispatch:function(e){return t.dispatch(e)}}):n},t.prototype.setStateToTheCurrentWithNew=function(t){var e=this.getRootStateOperations(),n=e.getState();e.setState(c({},n,t.defaults))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:V},{type:z},{type:_}]},t}();function W(t){return function(e){Array.isArray(t)?function(){throw new Error("Patching arrays is not supported.")}():"object"!=typeof t&&function(){throw new Error("Patching primitives is not supported.")}();var n=c({},e);for(var r in t)n[r]=t[r];return(n)}}var Q=function(){function t(t){this._internalStateOperations=t}return t.prototype.createStateContext=function(t){var e=this._internalStateOperations.getRootStateOperations();function n(e){return I(e,t.path)}function r(n,r){var o=E(n,t.path,r),i=t.instance;if(i.ngxsOnChanges){var a=R(t,{currentAppState:n,newAppState:o});i.ngxsOnChanges(a)}return e.setState(o),o}function o(t,e){return r(t,e(n(t)))}return{getState:function(){return n(e.getState())},patchState:function(t){return o(e.getState(),W(t))},setState:function(t){var n=e.getState();return"function"==typeof t?o(n,t):r(n,t)},dispatch:function(t){return e.dispatch(t)}}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:K}]},t}();var J=function(){function t(){}return t.checkThatStateIsNamedCorrectly=function(t){t?this.stateNameRegex.test(t)||function(t){throw new Error(t+" is not a valid state name. It needs to be a valid object property name.")}(t):function(){throw new Error("States must register a 'name' property.")}()},t.checkThatStateNameIsUnique=function(t,e,n){var r=n[t];r&&r!==e&&function(t,e,n){throw new Error("State name '"+t+"' from "+e+" already exists in "+n+".")}(t,e.name,r.name)},t.checkThatStateClassesHaveBeenDecorated=function(t){t.forEach((function(t){N(t)||function(t){throw new Error('States must be decorated with @State() decorator, but "'+t+"\" isn't.")}(t.name)}))},t.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$"),t}();var $=function(){function t(t,e,r,o,i,a,u){var s=this;this._injector=t,this._config=e,this._parentFactory=r,this._actions=o,this._actionResults=i,this._stateContextFactory=a,this._initialState=u,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=n.memoize((function(){var t=s;function e(e){var n=t.statePaths[e];return n?C(n.split("."),t._config):null}return s._parentFactory?s._parentFactory.getRuntimeSelectorContext():{getStateGetter:function(t){var n=e(t);return n||function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=e(t)),n?n.apply(void 0,f(r)):void 0}},getSelectorOptions:function(e){var n=t._config.selectorOptions;return c({},n,e||{})}}}))}return Object.defineProperty(t.prototype,"states",{get:function(){return this._parentFactory?this._parentFactory.states:this._states},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statesByName",{get:function(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statePaths",{get:function(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths},enumerable:!0,configurable:!0}),t.cloneDefaults=function(t){var e,n={};return Array.isArray(t)?n=t.slice():n="object"==typeof(e=t)&&null!==e||"function"==typeof e?c({},t):void 0===t?{}:t,n},t.prototype.ngOnDestroy=function(){this._actionsSubscription.unsubscribe()},t.prototype.add=function(e){var n,r;("undefined"==typeof ngDevMode||ngDevMode)&&J.checkThatStateClassesHaveBeenDecorated(e);var o=this.addToStatesMap(e).newStates;if(!o.length)return[];var i,a,u,c,p=function(t){var e=function(e){var n=t.find((function(t){return t===e}));if(("undefined"==typeof ngDevMode||ngDevMode)&&!n)throw new Error("Child state not found: "+e+". \r\nYou may have forgotten to add states to module");return(n[v].name)};return t.reduce((function(t,n){var r=n[v],o=r.name,i=r.children;return t[o]=(i||[]).map(e),t}),{})}(o),f=(i=p,a=[],u={},c=function(t,e){void 0===e&&(e=[]),Array.isArray(e)||(e=[]),e.push(t),u[t]=!0,i[t].forEach((function(n){if(("undefined"==typeof ngDevMode||ngDevMode)&&e.indexOf(n)>=0)throw new Error("Circular dependency '"+n+"' is required by '"+t+"': "+e.join(" -> "));u[n]||c(n,e.slice(0))})),a.indexOf(t)<0&&a.push(t)},Object.keys(i).forEach((function(t){return c(t)})),a.reverse()),l=function(t,e){void 0===e&&(e={});var n=function(t,e){for(var r in t)if(t.hasOwnProperty(r)&&t[r].indexOf(e)>=0){var o=n(t,r);return null!==o?o+"."+r:r}return null};for(var r in t)if(t.hasOwnProperty(r)){var o=n(t,r);e[r]=o?o+"."+r:r}return e}(p),h=o.reduce((function(t,e){return t[e[v].name]=e,t}),{}),y=[];try{for(var d=s(f),g=d.next();!g.done;g=d.next()){var S=g.value,m=h[S],_=l[S],O=m[v];this.addRuntimeInfoToMeta(O,_);var b={name:S,path:_,isInitialised:!1,actions:O.actions,instance:this._injector.get(m),defaults:t.cloneDefaults(O.defaults)};this.hasBeenMountedAndBootstrapped(S,_)||y.push(b),this.states.push(b)}}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return y},t.prototype.addAndReturnDefaults=function(t){var e=t||[],n=this.add(e);return{defaults:n.reduce((function(t,e){return E(t,e.path,e.defaults)}),{}),states:n}},t.prototype.connectActionHandlers=function(){var t=this;if(null===this._actionsSubscription){var e=new o.Subject;this._actionsSubscription=this._actions.pipe(i.filter((function(t){return"DISPATCHED"===t.status})),i.mergeMap((function(n){e.next(n);var r=n.action;return t.invokeActions(e,r).pipe(i.map((function(){return{action:r,status:"SUCCESSFUL"}})),i.defaultIfEmpty({action:r,status:"CANCELED"}),i.catchError((function(t){return o.of({action:r,status:"ERRORED",error:t})})))}))).subscribe((function(e){return t._actionResults.next(e)}))}},t.prototype.invokeActions=function(t,e){var n,r,a,u,c=x(e),p=[];try{for(var f=s(this.states),l=f.next();!l.done;l=f.next()){var h=l.value,y=h.actions[c];if(y)try{for(var d=s(y),g=d.next();!g.done;g=d.next()){var v=g.value,S=this._stateContextFactory.createStateContext(h);try{var m=h.instance[v.fn](S,e);m instanceof Promise&&(m=o.from(m)),m instanceof o.Observable?(m=m.pipe(i.mergeMap((function(t){return t instanceof Promise?o.from(t):t instanceof o.Observable?t:o.of(t)})),i.defaultIfEmpty({})),v.options.cancelUncompleted&&(m=m.pipe(i.takeUntil(t.pipe(M(e)))))):m=o.of({}).pipe(i.shareReplay()),p.push(m)}catch(t){p.push(o.throwError(t))}}}catch(t){a={error:t}}finally{try{g&&!g.done&&(u=d.return)&&u.call(d)}finally{if(a)throw a.error}}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return p.length||p.push(o.of({})),o.forkJoin(p)},t.prototype.addToStatesMap=function(t){var e,n,r=[],o=this.statesByName;try{for(var i=s(t),a=i.next();!a.done;a=i.next()){var u=a.value,c=N(u).name;("undefined"==typeof ngDevMode||ngDevMode)&&J.checkThatStateNameIsUnique(c,u,o),!o[c]&&(r.push(u),o[c]=u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{newStates:r}},t.prototype.addRuntimeInfoToMeta=function(t,e){this.statePaths[t.name]=e,t.path=e},t.prototype.hasBeenMountedAndBootstrapped=function(t,e){var n=void 0!==I(this._initialState,e);return this.statesByName[t]&&n},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.Injector},{type:_},{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:H},{type:q},{type:Q},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var tt=function(){function t(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}return t.prototype.ngxsBootstrap=function(t,e){var n=this;this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(i.filter((function(){return!!e})),i.tap((function(){return n.invokeInit(e.states)})),i.mergeMap((function(){return n.bootstrapper.appBootstrapped$})),i.filter((function(t){return!!t}))).subscribe((function(){return n.invokeBootstrap(e.states)}))},t.prototype.invokeInit=function(t){var e,n;try{for(var r=s(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;if(a.ngxsOnChanges){var u=R(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});a.ngxsOnChanges(u)}a.ngxsOnInit&&a.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.invokeBootstrap=function(t){var e,n;try{for(var r=s(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;a.ngxsAfterBootstrap&&a.ngxsAfterBootstrap(this.getStateContext(i))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.getStateContext=function(t){return this.stateContextFactory.createStateContext(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:K},{type:Q},{type:n.NgxsBootstrapper}]},t}();var et={getOptions:function(t){return t&&t.NGXS_SELECTOR_OPTIONS_META||{}},defineOptions:function(t,e){t&&(t.NGXS_SELECTOR_OPTIONS_META=e)}};function nt(t,e,r){var o=r&&r.containerClass,i=n.memoize((function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(o,t);if(i instanceof Function){var a=n.memoize.apply(null,[i]);return a}return i}));Object.setPrototypeOf(i,e);var a=function(t,e){var n=w(t);n.originalFn=t;var r=function(){return{}};e&&(n.containerClass=e.containerClass,n.selectorName=e.selectorName,r=e.getSelectorOptions||r);var o=c({},n);return n.getSelectorOptions=function(){return function(t,e){return c({},et.getOptions(t.containerClass)||{},et.getOptions(t.originalFn)||{},t.getSelectorOptions()||{},e)}(o,r())},n}(e,r);return a.makeRootSelector=function(e){var n=function(t,e,n){void 0===n&&(n=[]);var r=e.getSelectorOptions(),o=t.getSelectorOptions(r),i=function(t,e,n){void 0===t&&(t=[]);var r=[],o=0===t.length||e.injectContainerState;if(n&&o){N(n)&&r.push(n)}t&&r.push.apply(r,f(t));return r}(n,o,e.containerClass).map((function(e){return rt(e)(t)}));return{selectorOptions:o,argumentSelectorFunctions:i}}(e,a,t),r=n.argumentSelectorFunctions,o=n.selectorOptions;return(function(t){var e=r.map((function(e){return e(t)}));try{return i.apply(void 0,f(e))}catch(t){if(t instanceof TypeError&&o.suppressErrors)return;throw t}})},i}function rt(t){var e=P(t)||N(t);return e&&e.makeRootSelector||function(){return t}}var ot=function(){function t(t,e,n,r,o,i){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=r,this._stateFactory=o,this.initStateStream(i)}return t.prototype.dispatch=function(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)},t.prototype.select=function(t){var e=this,n=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(i.map(n),i.catchError((function(t){var n=e._config.selectorOptions.suppressErrors;return t instanceof TypeError&&n?o.of(void 0):o.throwError(t)})),i.distinctUntilChanged(),B(this._internalExecutionStrategy))},t.prototype.selectOnce=function(t){return this.select(t).pipe(i.take(1))},t.prototype.selectSnapshot=function(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())},t.prototype.subscribe=function(t){return this._stateStream.pipe(B(this._internalExecutionStrategy)).subscribe(t)},t.prototype.snapshot=function(){return this._internalStateOperations.getRootStateOperations().getState()},t.prototype.reset=function(t){return this._internalStateOperations.getRootStateOperations().setState(t)},t.prototype.getStoreBoundSelectorFn=function(t){return rt(t)(this._stateFactory.getRuntimeSelectorContext())},t.prototype.initStateStream=function(t){var e=this._stateStream.value;if(!e||0===Object.keys(e).length){var n=Object.keys(this._config.defaultsState).length>0?c({},this._config.defaultsState,t):t;this._stateStream.next(n)}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:V},{type:K},{type:_},{type:L},{type:$},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var it=function(){function t(e,n){t.store=e,t.config=n}return t.prototype.ngOnDestroy=function(){t.store=null,t.config=null},t.store=null,t.config=null,t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:ot},{type:_}]},t.ngInjectableDef=e.defineInjectable({factory:function(){return new t(e.inject(ot),e.inject(_))},token:t,providedIn:"root"}),t}();var at=function(){function t(){}return Object.defineProperty(t,"type",{get:function(){return"@@INIT"},enumerable:!0,configurable:!0}),t}(),ut=function(){function t(t){this.addedStates=t}return Object.defineProperty(t,"type",{get:function(){return"@@UPDATE_STATE"},enumerable:!0,configurable:!0}),t}();var ct=function(){function t(t,n,r,o,i,a){void 0===i&&(i=[]),!e.ɵivyEnabled&&o.get(it);var u=t.addAndReturnDefaults(i);n.setStateToTheCurrentWithNew(u),t.connectActionHandlers(),a.ngxsBootstrap(new at,u)}return t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:$},{type:K},{type:ot},{type:e.Injector},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[y]}]},{type:tt}]},t}(),st=function(){function t(e,n,r,o,i){void 0===o&&(o=[]);var a=t.flattenStates(o),u=r.addAndReturnDefaults(a);u.states.length&&(n.setStateToTheCurrentWithNew(u),i.ngxsBootstrap(new ut(u.defaults),u))}return t.flattenStates=function(t){return void 0===t&&(t=[]),t.reduce((function(t,e){return t.concat(e)}),[])},t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:ot},{type:K},{type:$},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[d]}]},{type:tt}]},t}(),pt=function(){function t(){}return t.forRoot=function(e,r){return void 0===e&&(e=[]),void 0===r&&(r={}),{ngModule:ct,providers:f([$,Q,G,H,n.NgxsBootstrapper,tt,z,q,K,L,ot,V,Z],e,t.ngxsTokenProviders(e,r))}},t.forFeature=function(t){return void 0===t&&(t=[]),{ngModule:st,providers:f([$,Z],t,[{provide:d,multi:!0,useValue:t}])}},t.ngxsTokenProviders=function(r,o){return[{provide:b,useClass:o.executionStrategy||h},{provide:y,useValue:r},{provide:t.ROOT_OPTIONS,useValue:o},{provide:_,useFactory:t.ngxsConfigFactory,deps:[t.ROOT_OPTIONS]},{provide:e.APP_BOOTSTRAP_LISTENER,useFactory:t.appBootstrapListenerFactory,multi:!0,deps:[n.NgxsBootstrapper]},{provide:n.INITIAL_STATE_TOKEN,useFactory:t.getInitialState},{provide:n.NGXS_STATE_CONTEXT_FACTORY,useExisting:Q},{provide:n.NGXS_STATE_FACTORY,useExisting:$}]},t.ngxsConfigFactory=function(t){return j(new _,t)},t.appBootstrapListenerFactory=function(t){return function(){return t.bootstrap()}},t.getInitialState=function(){return n.InitialState.pop()},t.ROOT_OPTIONS=new e.InjectionToken("ROOT_OPTIONS"),t.decorators=[{type:e.NgModule}],t}();var ft=36;function lt(t,n){return e.ɵivyEnabled?function(t,e){return ngDevMode&&!e?l():e.select(t)}(t,n):function(t){return it.store?it.store.select(t):l()}(t)}function ht(t,n,r,o){if(void 0===o&&(o=[]),"string"!=typeof(r=r||function(t){var e=t.length-1;return t.charCodeAt(e)===ft?t.slice(0,e):t}(n)))return r;var i=o.length?f([r],o):r.split(".");return e.ɵivyEnabled?function(t,e){return ngDevMode&&!e?l():C(t,e)}(i,t):function(t){return C(t,it.config)}(i)}var yt=function(){function t(){}return t.prototype.enter=function(t){return t()},t.prototype.leave=function(t){return t()},t.decorators=[{type:e.Injectable}],t}(),dt=function(){function t(t){var e=this;this.name=t,w(this).makeRootSelector=function(t){return t.getStateGetter(e.name)}}return t.prototype.getName=function(){return this.name},t.prototype.toString=function(){return"StateToken["+this.name+"]"},t}();t.Action=function(t,e){return function(n,r){var o,i;("undefined"==typeof ngDevMode||ngDevMode)&&(n.hasOwnProperty("prototype")&&function(){throw new Error("@Action() decorator cannot be used with static methods.")}());var a=A(n.constructor);Array.isArray(t)||(t=[t]);try{for(var u=s(t),c=u.next();!c.done;c=u.next()){var p=c.value.type;a.actions[p]||(a.actions[p]=[]),a.actions[p].push({fn:r,options:e||{},type:p})}}catch(t){o={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}},t.Actions=G,t.InitState=at,t.NGXS_PLUGINS=g,t.NgxsModule=pt,t.NgxsSimpleChange=O,t.NoopNgxsExecutionStrategy=yt,t.Select=function(t){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];return(function(o,a){var u,c=a.toString(),s="__"+c+"__selector",p=null,f=null;e.ɵivyEnabled&&(f=n.ensureInjectorNotifierIsCaptured(o)),Object.defineProperties(o,((u={})[s]={writable:!0,enumerable:!1,configurable:!0},u[c]={enumerable:!0,configurable:!0,get:function(){var o=this;return this[s]?this[s]:(e.ɵivyEnabled?this[s]=f.pipe(i.mergeMap((function(){var e=n.localInject(o,ot),i=n.localInject(o,_);return lt(p=p||ht(i,c,t,r),e)}))):(p=p||ht(null,c,t,r),this[s]=lt(p,null)),this[s])}},u)),e.ɵivyEnabled&&n.ensureLocalInjectorCaptured(o)})},t.Selector=function(t){return function(e,n,r){("undefined"==typeof ngDevMode||ngDevMode)&&(!(r&&null!==r.value)&&function(){throw new Error("Selectors only work on methods.")}());var o=r.value,i=nt(t,o,{containerClass:e,selectorName:n.toString(),getSelectorOptions:function(){return{}}}),a={configurable:!0,get:function(){return i}};return a.originalFn=o,a}},t.SelectorOptions=function(t){return function(e,n,r){if(n){var o=r.value||r.originalFn;o&&et.defineOptions(o,t)}else et.defineOptions(e,t)}},t.State=function(t){return function(n){("undefined"==typeof ngDevMode||ngDevMode)&&function(t){e.ɵivyEnabled&&(t.ɵprov||console.warn("'"+t.name+"' class should be decorated with @Injectable() right after the @State() decorator"))}(n);var r=n,o=A(r),i=Object.getPrototypeOf(r),a=function(e){var n=e[S]||{};return(c({},n,t))}(i);!function(t){var e=t.meta,n=t.inheritedStateClass,r=t.optionsWithInheritance,o=r.children,i=r.defaults,a=r.name,u="string"==typeof a?a:a&&a.getName()||null;if(("undefined"==typeof ngDevMode||ngDevMode)&&J.checkThatStateIsNamedCorrectly(u),n.hasOwnProperty(v)){var s=n[v]||{};e.actions=c({},e.actions,s.actions)}e.children=o,e.defaults=i,e.name=u}({meta:o,inheritedStateClass:i,optionsWithInheritance:a}),r[S]=a}},t.StateStream=V,t.StateToken=dt,t.Store=ot,t.UpdateState=ut,t.actionMatcher=function(t){var e=x(t);return(function(t){return e===x(t)})},t.createSelector=nt,t.ensureSelectorMetadata=function(t){return w(t)},t.ensureStoreMetadata=function(t){return A(t)},t.getActionTypeFromInstance=x,t.getSelectorMetadata=function(t){return P(t)},t.getStoreMetadata=function(t){return N(t)},t.getValue=I,t.ofAction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D(t)},t.ofActionCanceled=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D(t,["CANCELED"])},t.ofActionCompleted=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D(t,["SUCCESSFUL","CANCELED","ERRORED"],F)},t.ofActionDispatched=M,t.ofActionErrored=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D(t,["ERRORED"])},t.ofActionSuccessful=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return D(t,["SUCCESSFUL"])},t.setValue=E,t.ɵa=U,t.ɵb=H,t.ɵc=y,t.ɵd=d,t.ɵe=m,t.ɵf=_,t.ɵg=j,t.ɵh=b,t.ɵi=ct,t.ɵj=$,t.ɵk=q,t.ɵl=z,t.ɵm=Q,t.ɵn=K,t.ɵo=Z,t.ɵp=L,t.ɵr=A,t.ɵs=N,t.ɵt=w,t.ɵu=P,t.ɵv=tt,t.ɵw=st,t.ɵx=h,Object.defineProperty(t,"__esModule",{value:!0})}));
15
+ ***************************************************************************** */var a=function(t,e){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function u(t,e){function n(){this.constructor=t}a(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var s,c=function(){return(c=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function p(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function f(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(f(arguments[e]));return t}var h={STATE_NAME:"STATE_NAME",STATE_UNIQUE:"STATE_UNIQUE",STATE_NAME_PROPERTY:"STATE_NAME_PROPERTY",STATE_DECORATOR:"STATE_DECORATOR",INCORRECT_PRODUCTION:"INCORRECT_PRODUCTION",INCORRECT_DEVELOPMENT:"INCORRECT_DEVELOPMENT",SELECT_FACTORY_NOT_CONNECTED:"SELECT_FACTORY_NOT_CONNECTED",ACTION_DECORATOR:"ACTION_DECORATOR",SELECTOR_DECORATOR:"SELECTOR_DECORATOR",ZONE_WARNING:"ZONE_WARNING",PATCHING_ARRAY:"PATCHING_ARRAY",PATCHING_PRIMITIVE:"PATCHING_PRIMITIVE",UNDECORATED_STATE_IN_IVY:"UNDECORATED_STATE_IN_IVY"},y=((s={})[h.STATE_NAME]=function(t){return t+" is not a valid state name. It needs to be a valid object property name."},s[h.STATE_NAME_PROPERTY]=function(){return"States must register a 'name' property"},s[h.STATE_UNIQUE]=function(t,e,n){return"State name '"+t+"' from "+e+" already exists in "+n},s[h.STATE_DECORATOR]=function(){return"States must be decorated with @State() decorator"},s[h.INCORRECT_PRODUCTION]=function(){return"Angular is running in production mode but NGXS is still running in the development mode!\nPlease set developmentMode to false on the NgxsModule options when in production mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},s[h.INCORRECT_DEVELOPMENT]=function(){return"RECOMMENDATION: Set developmentMode to true on the NgxsModule when Angular is running in development mode.\nNgxsModule.forRoot(states, { developmentMode: !environment.production })"},s[h.SELECT_FACTORY_NOT_CONNECTED]=function(){return"You have forgotten to import the NGXS module!"},s[h.ACTION_DECORATOR]=function(){return"@Action() decorator cannot be used with static methods"},s[h.SELECTOR_DECORATOR]=function(){return"Selectors only work on methods"},s[h.ZONE_WARNING]=function(){return"Your application was bootstrapped with nooped zone and your execution strategy requires an actual NgZone!\nPlease set the value of the executionStrategy property to NoopNgxsExecutionStrategy.\nNgxsModule.forRoot(states, { executionStrategy: NoopNgxsExecutionStrategy })"},s[h.PATCHING_ARRAY]=function(){return"Patching arrays is not supported."},s[h.PATCHING_PRIMITIVE]=function(){return"Patching primitives is not supported."},s[h.UNDECORATED_STATE_IN_IVY]=function(t){return"'"+t+"' class should be decorated with @Injectable() right after the @State() decorator"},s),d=function(){function t(t,e){this._ngZone=t,this._platformId=e,this.verifyZoneIsNotNooped(this._ngZone)}return t.prototype.enter=function(t){return r.isPlatformServer(this._platformId)?this.runInsideAngular(t):this.runOutsideAngular(t)},t.prototype.leave=function(t){return this.runInsideAngular(t)},t.prototype.runInsideAngular=function(t){return e.NgZone.isInAngularZone()?t():this._ngZone.run(t)},t.prototype.runOutsideAngular=function(t){return e.NgZone.isInAngularZone()?this._ngZone.runOutsideAngular(t):t()},t.prototype.verifyZoneIsNotNooped=function(t){t instanceof e.NgZone||console.warn(y[h.ZONE_WARNING]())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.NgZone},{type:String,decorators:[{type:e.Inject,args:[e.PLATFORM_ID]}]}]},t}();var g=new e.InjectionToken("ROOT_STATE_TOKEN"),S=new e.InjectionToken("FEATURE_STATE_TOKEN"),v=new e.InjectionToken("NGXS_PLUGINS"),_=new e.InjectionToken("NG_TEST_MODE"),O=new e.InjectionToken("NG_DEV_MODE"),E="NGXS_META",T="NGXS_OPTIONS_META",m="NGXS_SELECTOR_META",A=function(){function t(){this.defaultsState={},this.selectorOptions={injectContainerState:!0,suppressErrors:!0},this.compatibility={strictContentSecurityPolicy:!1},this.executionStrategy=d}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}();var N=function(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n};var I=new e.InjectionToken("NGXS_EXECUTION_STRATEGY");function b(t){return t.constructor&&t.constructor.type?t.constructor.type:t.type}var R=function(t,e,n){t=c({},t);var r=e.split("."),o=r.length-1;return r.reduce((function(t,e,r){return t[e]=r===o?n:Array.isArray(t[e])?t[e].slice():c({},t[e]),t&&t[e]}),t),t},C=function(t,e){return e.split(".").reduce((function(t,e){return t&&t[e]}),t)},x=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},P=function(t){for(var e,n,r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(!r.length)return t;var i=r.shift();if(x(t)&&x(i))for(var a in i)x(i[a])?(t[a]||Object.assign(t,((e={})[a]={},e)),P(t[a],i[a])):Object.assign(t,((n={})[a]=i[a],n));return P.apply(void 0,l([t],r))};function j(t){if(!t.hasOwnProperty(E)){var e={name:null,actions:{},defaults:{},path:null,makeRootSelector:function(t){return t.getStateGetter(e.name)},children:[]};Object.defineProperty(t,E,{value:e})}return w(t)}function w(t){return t[E]}function M(t){if(!t.hasOwnProperty(m)){Object.defineProperty(t,m,{value:{makeRootSelector:null,originalFn:null,containerClass:null,selectorName:null,getSelectorOptions:function(){return{}}}})}return D(t)}function D(t){return t[m]}function F(t,e){return e&&e.compatibility&&e.compatibility.strictContentSecurityPolicy?function(t){var e=t.slice();return(function(t){return e.reduce((function(t,e){return t&&t[e]}),t)})}(t):function(t){for(var e=t,n="store."+e[0],r=0,o=e.length,i=n;++r<o;)i=i+" && "+(n=n+"."+e[r]);return new Function("store","return "+i+";")}(t)}function k(t,e){var n=C(e.currentAppState,t.path),r=C(e.newAppState,t.path);return new N(n,r,!t.isInitialised)}function U(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return L(t,["DISPATCHED"])}function L(t,e,n){void 0===n&&(n=V);var r=t.reduce((function(t,e){return t[b(e)]=!0,t}),{}),o=e&&function(t){return t.reduce((function(t,e){return t[e]=!0,t}),{})}(e);return function(t){return t.pipe(function(t,e){return i.filter((function(n){var r=b(n.action),o=t[r],i=!e||e[n.status];return o&&i}))}(r,o),n())}}function G(){return i.map((function(t){var e=t.action,n=t.status;return({action:e,result:{successful:"SUCCESSFUL"===n,canceled:"CANCELED"===n,error:t.error}})}))}function V(){return i.map((function(t){return t.action}))}function B(t){return function(e){return new o.Observable((function(n){return e.subscribe({next:function(e){t.leave((function(){return n.next(e)}))},error:function(e){t.leave((function(){return n.error(e)}))},complete:function(){t.leave((function(){return n.complete()}))}})}))}}var H=function(){function t(t){this._executionStrategy=t}return t.prototype.enter=function(t){return this._executionStrategy.enter(t)},t.prototype.leave=function(t){return this._executionStrategy.leave(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[I]}]}]},t}();var Y=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._itemQueue=[],e._busyPushingNext=!1,e}return u(e,t),e.prototype.next=function(e){if(this._busyPushingNext)this._itemQueue.unshift(e);else{for(this._busyPushingNext=!0,t.prototype.next.call(this,e);this._itemQueue.length>0;){var n=this._itemQueue.pop();t.prototype.next.call(this,n)}this._busyPushingNext=!1}},e}(o.Subject);var Z=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(Y),X=function(t){function n(e,n){return t.call(this,(function(t){var r=e.pipe(B(n)).subscribe({next:function(e){return t.next(e)},error:function(e){return t.error(e)},complete:function(){return t.complete()}});t.add(r)}))||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[{type:Z},{type:H}]},n}(o.Observable),q=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=t.shift();return r.apply(void 0,l(e,[function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return q(t).apply(void 0,l(e))}]))}},W=function(t){function n(){return t.call(this,{})||this}return u(n,t),n.decorators=[{type:e.Injectable}],n.ctorParameters=function(){return[]},n}(o.BehaviorSubject),z=function(){function t(t,e){this._parentManager=t,this._pluginHandlers=e,this.plugins=[],this.registerHandlers()}return Object.defineProperty(t.prototype,"rootPlugins",{get:function(){return this._parentManager&&this._parentManager.plugins||this.plugins},enumerable:!0,configurable:!0}),t.prototype.registerHandlers=function(){var t,e=this.getPluginHandlers();(t=this.rootPlugins).push.apply(t,l(e))},t.prototype.getPluginHandlers=function(){return(this._pluginHandlers||[]).map((function(t){return t.handle?t.handle.bind(t):t}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:Array,decorators:[{type:e.Inject,args:[v]},{type:e.Optional}]}]},t}();var Q=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return u(n,t),n.decorators=[{type:e.Injectable}],n}(o.Subject),K=function(){function t(t,e,n,r,o,i){this._injector=t,this._actions=e,this._actionResults=n,this._pluginManager=r,this._stateStream=o,this._ngxsExecutionStrategy=i}return t.prototype.dispatch=function(t){var n=this,r=this._ngxsExecutionStrategy.enter((function(){return n.dispatchByEvents(t)}));return r.subscribe({error:function(t){return n._ngxsExecutionStrategy.leave((function(){try{n._errorHandler=n._errorHandler||n._injector.get(e.ErrorHandler),n._errorHandler.handleError(t)}catch(t){}}))}}),r.pipe(B(this._ngxsExecutionStrategy))},t.prototype.dispatchByEvents=function(t){var e=this;return Array.isArray(t)?0===t.length?o.of(this._stateStream.getValue()):o.forkJoin(t.map((function(t){return e.dispatchSingle(t)}))):this.dispatchSingle(t)},t.prototype.dispatchSingle=function(t){var e=this;if(!b(t)){var n=new Error("This action doesn't have a type property: "+t.constructor.name);return o.throwError(n)}var r=this._stateStream.getValue(),a=this._pluginManager.plugins;return q(l(a,[function(t,n){t!==r&&e._stateStream.next(t);var o=e.getActionResultStream(n);return o.subscribe((function(t){return e._actions.next(t)})),e._actions.next({action:n,status:"DISPATCHED"}),e.createDispatchObservable(o)}]))(r,t).pipe(i.shareReplay())},t.prototype.getActionResultStream=function(t){return this._actionResults.pipe(i.filter((function(e){return e.action===t&&"DISPATCHED"!==e.status})),i.take(1),i.shareReplay())},t.prototype.createDispatchObservable=function(t){var e=this;return t.pipe(i.exhaustMap((function(t){switch(t.status){case"SUCCESSFUL":return o.of(e._stateStream.getValue());case"ERRORED":return o.throwError(t.error);default:return o.EMPTY}}))).pipe(i.shareReplay())},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.Injector},{type:Z},{type:Q},{type:z},{type:W},{type:H}]},t}();var J=function(t){Object.freeze(t);var e="function"==typeof t,n=Object.prototype.hasOwnProperty;return Object.getOwnPropertyNames(t).forEach((function(r){!n.call(t,r)||e&&("caller"===r||"callee"===r||"arguments"===r)||null===t[r]||"object"!=typeof t[r]&&"function"!=typeof t[r]||Object.isFrozen(t[r])||J(t[r])})),t},$=function(){function t(t,e){this.isDevMode=t,this.isTestMode=e}return t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[O]}]},{type:void 0,decorators:[{type:e.Inject,args:[_]}]}]},t}();var tt=function(){function t(t,e){this._host=t,this._config=e}return Object.defineProperty(t.prototype,"isIncorrectProduction",{get:function(){return!this._host.isDevMode()&&this._config.developmentMode},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isIncorrectDevelopment",{get:function(){return this._host.isDevMode()&&!this._config.developmentMode},enumerable:!0,configurable:!0}),t.prototype.verifyDevMode=function(){this._host.isTestMode()||(this.isIncorrectProduction?console.warn(y[h.INCORRECT_PRODUCTION]()):this.isIncorrectDevelopment&&console.warn(y[h.INCORRECT_DEVELOPMENT]()))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:$},{type:A}]},t}();var et=function(){function t(t,e,n,r){this._stateStream=t,this._dispatcher=e,this._config=n,r.verifyDevMode()}return t.prototype.getRootStateOperations=function(){var t=this,e={getState:function(){return t._stateStream.getValue()},setState:function(e){return t._stateStream.next(e)},dispatch:function(e){return t._dispatcher.dispatch(e)}};return this._config.developmentMode?this.ensureStateAndActionsAreImmutable(e):e},t.prototype.ensureStateAndActionsAreImmutable=function(t){return{getState:function(){return t.getState()},setState:function(e){var n=J(e);return t.setState(n)},dispatch:function(e){return t.dispatch(e)}}},t.prototype.setStateToTheCurrentWithNew=function(t){var e=this.getRootStateOperations(),n=e.getState();e.setState(c({},n,t.defaults))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:W},{type:K},{type:A},{type:tt}]},t}();var nt=function(){function t(t){this._internalStateOperations=t}return t.prototype.createStateContext=function(t){var e=this._internalStateOperations.getRootStateOperations();function n(e){return C(e,t.path)}function r(n,r){var o=R(n,t.path,r),i=t.instance;if(i.ngxsOnChanges){var a=k(t,{currentAppState:n,newAppState:o});i.ngxsOnChanges(a)}return e.setState(o),o}function o(t,e){return r(t,e(n(t)))}return{getState:function(){return n(e.getState())},patchState:function(t){return o(e.getState(),function(t){return function(e){if(Array.isArray(t))throw new Error(y[h.PATCHING_ARRAY]());if("object"!=typeof t)throw new Error(y[h.PATCHING_PRIMITIVE]());var n=c({},e);for(var r in t)n[r]=t[r];return(n)}}(t))},setState:function(t){var n=e.getState();return"function"==typeof t?o(n,t):r(n,t)},dispatch:function(t){return e.dispatch(t)}}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:et}]},t}();var rt=function(){function t(){}return t.stateNameErrorMessage=function(t){return y[h.STATE_NAME](t)},t.checkCorrectStateName=function(t){if(!t)throw new Error(y[h.STATE_NAME_PROPERTY]());if(!this.stateNameRegex.test(t))throw new Error(this.stateNameErrorMessage(t))},t.checkStateNameIsUnique=function(t,e){var n=this.getValidStateMeta(t).name,r=e[n];if(r&&r!==t)throw new Error(y[h.STATE_UNIQUE](n,t.name,r.name));return n},t.getValidStateMeta=function(t){var e=w(t);if(!e)throw new Error(y[h.STATE_DECORATOR]());return e},t.stateNameRegex=new RegExp("^[a-zA-Z0-9_]+$"),t}();var ot=function(){function t(t,e,r,o,i,a,u){var s=this;this._injector=t,this._config=e,this._parentFactory=r,this._actions=o,this._actionResults=i,this._stateContextFactory=a,this._initialState=u,this._actionsSubscription=null,this._states=[],this._statesByName={},this._statePaths={},this.getRuntimeSelectorContext=n.memoize((function(){var t=s;function e(e){var n=t.statePaths[e];return n?F(n.split("."),t._config):null}return s._parentFactory?s._parentFactory.getRuntimeSelectorContext():{getStateGetter:function(t){var n=e(t);return n||function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return n||(n=e(t)),n?n.apply(void 0,l(r)):void 0}},getSelectorOptions:function(e){var n=t._config.selectorOptions;return c({},n,e||{})}}}))}return Object.defineProperty(t.prototype,"states",{get:function(){return this._parentFactory?this._parentFactory.states:this._states},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statesByName",{get:function(){return this._parentFactory?this._parentFactory.statesByName:this._statesByName},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statePaths",{get:function(){return this._parentFactory?this._parentFactory.statePaths:this._statePaths},enumerable:!0,configurable:!0}),t.cloneDefaults=function(t){var e,n={};return Array.isArray(t)?n=t.slice():n="object"==typeof(e=t)&&null!==e||"function"==typeof e?c({},t):void 0===t?{}:t,n},t.checkStatesAreValid=function(t){t.forEach(rt.getValidStateMeta)},t.prototype.ngOnDestroy=function(){this._actionsSubscription.unsubscribe()},t.prototype.add=function(e){var n,r;t.checkStatesAreValid(e);var o=this.addToStatesMap(e).newStates;if(!o.length)return[];var i,a,u,s,c=function(t){var e=function(e){var n=t.find((function(t){return t===e}));if(!n)throw new Error("Child state not found: "+e+". \r\nYou may have forgotten to add states to module");return(n[E].name)};return t.reduce((function(t,n){var r=n[E],o=r.name,i=r.children;return t[o]=(i||[]).map(e),t}),{})}(o),f=(i=c,a=[],u={},s=function(t,e){void 0===e&&(e=[]),Array.isArray(e)||(e=[]),e.push(t),u[t]=!0,i[t].forEach((function(n){if(e.indexOf(n)>=0)throw new Error("Circular dependency '"+n+"' is required by '"+t+"': "+e.join(" -> "));u[n]||s(n,e.slice(0))})),a.indexOf(t)<0&&a.push(t)},Object.keys(i).forEach((function(t){return s(t)})),a.reverse()),l=function(t,e){void 0===e&&(e={});var n=function(t,e){for(var r in t)if(t.hasOwnProperty(r)&&t[r].indexOf(e)>=0){var o=n(t,r);return null!==o?o+"."+r:r}return null};for(var r in t)if(t.hasOwnProperty(r)){var o=n(t,r);e[r]=o?o+"."+r:r}return e}(c),h=o.reduce((function(t,e){return t[e[E].name]=e,t}),{}),y=[];try{for(var d=p(f),g=d.next();!g.done;g=d.next()){var S=g.value,v=h[S],_=l[S],O=v[E];this.addRuntimeInfoToMeta(O,_);var T={name:S,path:_,isInitialised:!1,actions:O.actions,instance:this._injector.get(v),defaults:t.cloneDefaults(O.defaults)};this.hasBeenMountedAndBootstrapped(S,_)||y.push(T),this.states.push(T)}}catch(t){n={error:t}}finally{try{g&&!g.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return y},t.prototype.addAndReturnDefaults=function(t){var e=t||[],n=this.add(e);return{defaults:n.reduce((function(t,e){return R(t,e.path,e.defaults)}),{}),states:n}},t.prototype.connectActionHandlers=function(){var t=this;null===this._actionsSubscription&&(this._actionsSubscription=this._actions.pipe(i.filter((function(t){return"DISPATCHED"===t.status})),i.mergeMap((function(e){var n=e.action;return t.invokeActions(t._actions,n).pipe(i.map((function(){return{action:n,status:"SUCCESSFUL"}})),i.defaultIfEmpty({action:n,status:"CANCELED"}),i.catchError((function(t){return o.of({action:n,status:"ERRORED",error:t})})))}))).subscribe((function(e){return t._actionResults.next(e)})))},t.prototype.invokeActions=function(t,e){var n,r,a,u,s=b(e),c=[];try{for(var f=p(this.states),l=f.next();!l.done;l=f.next()){var h=l.value,y=h.actions[s];if(y)try{for(var d=p(y),g=d.next();!g.done;g=d.next()){var S=g.value,v=this._stateContextFactory.createStateContext(h);try{var _=h.instance[S.fn](v,e);_ instanceof Promise&&(_=o.from(_)),_ instanceof o.Observable?(_=_.pipe(i.defaultIfEmpty({})),S.options.cancelUncompleted&&(_=_.pipe(i.takeUntil(t.pipe(U(e)))))):_=o.of({}).pipe(i.shareReplay()),c.push(_)}catch(t){c.push(o.throwError(t))}}}catch(t){a={error:t}}finally{try{g&&!g.done&&(u=d.return)&&u.call(d)}finally{if(a)throw a.error}}}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}return c.length||c.push(o.of({})),o.forkJoin(c)},t.prototype.addToStatesMap=function(t){var e,n,r=[],o=this.statesByName;try{for(var i=p(t),a=i.next();!a.done;a=i.next()){var u=a.value,s=rt.checkStateNameIsUnique(u,o);!o[s]&&(r.push(u),o[s]=u)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return{newStates:r}},t.prototype.addRuntimeInfoToMeta=function(t,e){this.statePaths[t.name]=e,t.path=e},t.prototype.hasBeenMountedAndBootstrapped=function(t,e){var n=void 0!==C(this._initialState,e);return this.statesByName[t]&&n},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:e.Injector},{type:A},{type:t,decorators:[{type:e.Optional},{type:e.SkipSelf}]},{type:Z},{type:Q},{type:nt},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var it=function(){function t(t,e,n){this.internalStateOperations=t,this.stateContextFactory=e,this.bootstrapper=n}return t.prototype.ngxsBootstrap=function(t,e){var n=this;this.internalStateOperations.getRootStateOperations().dispatch(t).pipe(i.filter((function(){return!!e})),i.tap((function(){return n.invokeInit(e.states)})),i.mergeMap((function(){return n.bootstrapper.appBootstrapped$})),i.filter((function(t){return!!t}))).subscribe((function(){return n.invokeBootstrap(e.states)}))},t.prototype.invokeInit=function(t){var e,n;try{for(var r=p(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;if(a.ngxsOnChanges){var u=k(i,{currentAppState:{},newAppState:this.internalStateOperations.getRootStateOperations().getState()});a.ngxsOnChanges(u)}a.ngxsOnInit&&a.ngxsOnInit(this.getStateContext(i)),i.isInitialised=!0}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.invokeBootstrap=function(t){var e,n;try{for(var r=p(t),o=r.next();!o.done;o=r.next()){var i=o.value,a=i.instance;a.ngxsAfterBootstrap&&a.ngxsAfterBootstrap(this.getStateContext(i))}}catch(t){e={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.getStateContext=function(t){return this.stateContextFactory.createStateContext(t)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:et},{type:nt},{type:n.NgxsBootstrapper}]},t}();var at={getOptions:function(t){return t&&t.NGXS_SELECTOR_OPTIONS_META||{}},defineOptions:function(t,e){t&&(t.NGXS_SELECTOR_OPTIONS_META=e)}};function ut(t,e,r){var o=r&&r.containerClass,i=n.memoize((function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=e.apply(o,t);if(i instanceof Function){var a=n.memoize.apply(null,[i]);return a}return i}));Object.setPrototypeOf(i,e);var a=function(t,e){var n=M(t);n.originalFn=t;var r=function(){return{}};e&&(n.containerClass=e.containerClass,n.selectorName=e.selectorName,r=e.getSelectorOptions||r);var o=c({},n);return n.getSelectorOptions=function(){return function(t,e){return c({},at.getOptions(t.containerClass)||{},at.getOptions(t.originalFn)||{},t.getSelectorOptions()||{},e)}(o,r())},n}(e,r);return a.makeRootSelector=function(e){var n=function(t,e,n){void 0===n&&(n=[]);var r=e.getSelectorOptions(),o=t.getSelectorOptions(r),i=function(t,e,n){void 0===t&&(t=[]);var r=[],o=0===t.length||e.injectContainerState;if(n&&o){w(n)&&r.push(n)}t&&r.push.apply(r,l(t));return r}(n,o,e.containerClass).map((function(e){return st(e)(t)}));return{selectorOptions:o,argumentSelectorFunctions:i}}(e,a,t),r=n.argumentSelectorFunctions,o=n.selectorOptions;return(function(t){var e=r.map((function(e){return e(t)}));try{return i.apply(void 0,l(e))}catch(t){if(t instanceof TypeError&&o.suppressErrors)return;throw t}})},i}function st(t){var e=D(t)||w(t);return e&&e.makeRootSelector||function(){return t}}var ct=function(){function t(t,e,n,r,o,i){this._stateStream=t,this._internalStateOperations=e,this._config=n,this._internalExecutionStrategy=r,this._stateFactory=o,this.initStateStream(i)}return t.prototype.dispatch=function(t){return this._internalStateOperations.getRootStateOperations().dispatch(t)},t.prototype.select=function(t){var e=this,n=this.getStoreBoundSelectorFn(t);return this._stateStream.pipe(i.map(n),i.catchError((function(t){var n=e._config.selectorOptions.suppressErrors;return t instanceof TypeError&&n?o.of(void 0):o.throwError(t)})),i.distinctUntilChanged(),B(this._internalExecutionStrategy))},t.prototype.selectOnce=function(t){return this.select(t).pipe(i.take(1))},t.prototype.selectSnapshot=function(t){return this.getStoreBoundSelectorFn(t)(this._stateStream.getValue())},t.prototype.subscribe=function(t){return this._stateStream.pipe(B(this._internalExecutionStrategy)).subscribe(t)},t.prototype.snapshot=function(){return this._internalStateOperations.getRootStateOperations().getState()},t.prototype.reset=function(t){return this._internalStateOperations.getRootStateOperations().setState(t)},t.prototype.getStoreBoundSelectorFn=function(t){return st(t)(this._stateFactory.getRuntimeSelectorContext())},t.prototype.initStateStream=function(t){var e=this._stateStream.value;if(!e||0===Object.keys(e).length){var n=Object.keys(this._config.defaultsState).length>0?c({},this._config.defaultsState,t):t;this._stateStream.next(n)}},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:W},{type:et},{type:A},{type:H},{type:ot},{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[n.INITIAL_STATE_TOKEN]}]}]},t}();var pt=function(){function t(e,n){t.store=e,t.config=n}return t.prototype.ngOnDestroy=function(){t.store=null,t.config=null},t.store=null,t.config=null,t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:ct},{type:A}]},t}();var ft=function(){function t(){}return Object.defineProperty(t,"type",{get:function(){return"@@INIT"},enumerable:!0,configurable:!0}),t}(),lt=function(){function t(t){this.addedStates=t}return Object.defineProperty(t,"type",{get:function(){return"@@UPDATE_STATE"},enumerable:!0,configurable:!0}),t}();var ht=new o.ReplaySubject(1);var yt=function(){function t(t,n,r,o,i,a){void 0===i&&(i=[]),function(){try{var t=window.ng,n=!(!!t.probe&&!!t.coreTokens)&&e.isDevMode();ht.next(n)}catch(t){ht.next(!1)}finally{ht.complete()}}();var u=t.addAndReturnDefaults(i);n.setStateToTheCurrentWithNew(u),t.connectActionHandlers(),a.ngxsBootstrap(new ft,u)}return t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:ot},{type:et},{type:ct},{type:pt},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[g]}]},{type:it}]},t}(),dt=function(){function t(e,n,r,o,i){void 0===o&&(o=[]);var a=t.flattenStates(o),u=r.addAndReturnDefaults(a);u.states.length&&(n.setStateToTheCurrentWithNew(u),i.ngxsBootstrap(new lt(u.defaults),u))}return t.flattenStates=function(t){return void 0===t&&(t=[]),t.reduce((function(t,e){return t.concat(e)}),[])},t.decorators=[{type:e.NgModule}],t.ctorParameters=function(){return[{type:ct},{type:et},{type:ot},{type:Array,decorators:[{type:e.Optional},{type:e.Inject,args:[S]}]},{type:it}]},t}(),gt=function(){function t(){}return t.forRoot=function(e,r){return void 0===e&&(e=[]),void 0===r&&(r={}),{ngModule:yt,providers:l([ot,nt,X,Z,n.NgxsBootstrapper,tt,$,it,K,Q,et,H,ct,W,pt,z],e,t.ngxsTokenProviders(e,r))}},t.forFeature=function(t){return void 0===t&&(t=[]),{ngModule:dt,providers:l([ot,z],t,[{provide:S,multi:!0,useValue:t}])}},t.ngxsTokenProviders=function(r,o){return[{provide:_,useValue:n.isAngularInTestMode},{provide:O,useValue:e.isDevMode},{provide:I,useClass:o.executionStrategy||d},{provide:g,useValue:r},{provide:t.ROOT_OPTIONS,useValue:o},{provide:A,useFactory:t.ngxsConfigFactory,deps:[t.ROOT_OPTIONS]},{provide:e.APP_BOOTSTRAP_LISTENER,useFactory:t.appBootstrapListenerFactory,multi:!0,deps:[n.NgxsBootstrapper]},{provide:n.INITIAL_STATE_TOKEN,useFactory:t.getInitialState},{provide:n.NGXS_STATE_CONTEXT_FACTORY,useExisting:nt},{provide:n.NGXS_STATE_FACTORY,useExisting:ot}]},t.ngxsConfigFactory=function(t){return P(new A,t)},t.appBootstrapListenerFactory=function(t){return function(){return t.bootstrap()}},t.getInitialState=function(){return n.InitialState.pop()},t.ROOT_OPTIONS=new e.InjectionToken("ROOT_OPTIONS"),t.decorators=[{type:e.NgModule}],t}();var St=36;function vt(t,e,n){return void 0===n&&(n=[]),"string"==typeof(e=e||function(t){var e=t.length-1;return t.charCodeAt(e)===St?t.slice(0,e):t}(t))?F(n.length?l([e],n):e.split("."),pt.config):e}var _t=function(){function t(){}return t.prototype.enter=function(t){return t()},t.prototype.leave=function(t){return t()},t.decorators=[{type:e.Injectable}],t}(),Ot=function(){function t(t){var e=this;this.name=t,M(this).makeRootSelector=function(t){return t.getStateGetter(e.name)}}return t.prototype.getName=function(){return this.name},t.prototype.toString=function(){return"StateToken["+this.name+"]"},t}();t.Action=function(t,e){return function(n,r){var o,i;if(n.hasOwnProperty("prototype"))throw new Error(y[h.ACTION_DECORATOR]());var a=j(n.constructor);Array.isArray(t)||(t=[t]);try{for(var u=p(t),s=u.next();!s.done;s=u.next()){var c=s.value.type;a.actions[c]||(a.actions[c]=[]),a.actions[c].push({fn:r,options:e||{},type:c})}}catch(t){o={error:t}}finally{try{s&&!s.done&&(i=u.return)&&i.call(u)}finally{if(o)throw o.error}}}},t.Actions=X,t.InitState=ft,t.NGXS_PLUGINS=v,t.NgxsModule=gt,t.NgxsSimpleChange=N,t.NoopNgxsExecutionStrategy=_t,t.Select=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return(function(n,r){var o,i=r.toString(),a="__"+i+"__selector",u=vt(i,t,e);Object.defineProperties(n,((o={})[a]={writable:!0,enumerable:!1,configurable:!0},o[i]={enumerable:!0,configurable:!0,get:function(){return this[a]||(this[a]=function(t){if(!pt.store)throw new Error(y[h.SELECT_FACTORY_NOT_CONNECTED]());return pt.store.select(t)}(u))}},o))})},t.Selector=function(t){return function(e,n,r){if(!(r&&null!==r.value))throw new Error(y[h.SELECTOR_DECORATOR]());var o=r.value,i=ut(t,o,{containerClass:e,selectorName:n.toString(),getSelectorOptions:function(){return{}}}),a={configurable:!0,get:function(){return i}};return a.originalFn=o,a}},t.SelectorOptions=function(t){return function(e,n,r){if(n){var o=r.value||r.originalFn;o&&at.defineOptions(o,t)}else at.defineOptions(e,t)}},t.State=function(t){return function(e){!function(t){ht.subscribe((function(e){e&&(t.ɵprov||console.warn(y[h.UNDECORATED_STATE_IN_IVY](t.name)))}))}(e);var n=e,r=j(n),o=Object.getPrototypeOf(n),i=function(e){var n=e[T]||{};return(c({},n,t))}(o);!function(t){var e=t.meta,n=t.inheritedStateClass,r=t.optionsWithInheritance,o=r.children,i=r.defaults,a=r.name,u="string"==typeof a?a:a&&a.getName()||null;if(rt.checkCorrectStateName(u),n.hasOwnProperty(E)){var s=n[E]||{};e.actions=c({},e.actions,s.actions)}e.children=o,e.defaults=i,e.name=u}({meta:r,inheritedStateClass:o,optionsWithInheritance:i}),n[T]=i}},t.StateStream=W,t.StateToken=Ot,t.Store=ct,t.UpdateState=lt,t.actionMatcher=function(t){var e=b(t);return(function(t){return e===b(t)})},t.createSelector=ut,t.ensureSelectorMetadata=function(t){return M(t)},t.ensureStoreMetadata=function(t){return j(t)},t.getActionTypeFromInstance=b,t.getSelectorMetadata=function(t){return D(t)},t.getStoreMetadata=function(t){return w(t)},t.getValue=C,t.ofAction=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return L(t)},t.ofActionCanceled=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return L(t,["CANCELED"])},t.ofActionCompleted=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return L(t,["SUCCESSFUL","CANCELED","ERRORED"],G)},t.ofActionDispatched=U,t.ofActionErrored=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return L(t,["ERRORED"])},t.ofActionSuccessful=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return L(t,["SUCCESSFUL"])},t.setValue=R,t.ɵa=Y,t.ɵb=Z,t.ɵba=pt,t.ɵbb=it,t.ɵbc=dt,t.ɵbd=d,t.ɵc=g,t.ɵd=S,t.ɵe=_,t.ɵf=O,t.ɵg=m,t.ɵh=A,t.ɵi=P,t.ɵj=I,t.ɵk=yt,t.ɵl=ot,t.ɵm=Q,t.ɵn=K,t.ɵo=nt,t.ɵp=et,t.ɵq=z,t.ɵr=H,t.ɵs=tt,t.ɵt=$,t.ɵw=j,t.ɵx=w,t.ɵy=M,t.ɵz=D,Object.defineProperty(t,"__esModule",{value:!0})}));
16
16
  //# sourceMappingURL=ngxs-store.umd.min.js.map