diff --git a/.gitignore b/.gitignore
index c23999f9..dcce5108 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,37 +1 @@
-*.gem
-*.rbc
-/.config
-/coverage/
-/InstalledFiles
-/pkg/
-/spec/reports/
-/test/tmp/
-/test/version_tmp/
-/tmp/
-
-## Specific to RubyMotion:
-.dat*
-.repl_history
-#build/
-
-## Documentation cache and generated files:
-/.yardoc/
-/_yardoc/
-/doc/
-/rdoc/
-
-## Environment normalisation:
-/.bundle/
-/lib/bundler/man/
-
-# for a library or gem, you might want to ignore these files since the code is
-# intended to run in multiple environments; otherwise, check them in:
-# Gemfile.lock
-# .ruby-version
-# .ruby-gemset
-
-# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
-.rvmrc
-/thin.*
-/bundle/
-vendor/
+.bundle/
diff --git a/public/app/vendor/node_modules/.bin/google-closure-compiler-js b/public/app/vendor/node_modules/.bin/google-closure-compiler-js
new file mode 120000
index 00000000..947d2117
--- /dev/null
+++ b/public/app/vendor/node_modules/.bin/google-closure-compiler-js
@@ -0,0 +1 @@
+../google-closure-compiler-js/cmd.js
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/.bin/tsc b/public/app/vendor/node_modules/.bin/tsc
new file mode 120000
index 00000000..0863208a
--- /dev/null
+++ b/public/app/vendor/node_modules/.bin/tsc
@@ -0,0 +1 @@
+../typescript/bin/tsc
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/.bin/tsserver b/public/app/vendor/node_modules/.bin/tsserver
new file mode 120000
index 00000000..f8f8f1a0
--- /dev/null
+++ b/public/app/vendor/node_modules/.bin/tsserver
@@ -0,0 +1 @@
+../typescript/bin/tsserver
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/CHANGELOG.md b/public/app/vendor/node_modules/@uirouter/angularjs/CHANGELOG.md
new file mode 100644
index 00000000..b529fd0a
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/CHANGELOG.md
@@ -0,0 +1,1600 @@
+## 1.0.10 (2017-10-18)
+[Compare `@uirouter/angularjs` versions 1.0.9 and 1.0.10](https://github.com/angular-ui/ui-router/compare/1.0.9...1.0.10)
+
+### Bug Fixes
+
+* **artifactory:** Add trailing newline to package.json to work around artifactory issue ([#3551](https://github.com/angular-ui/ui-router/issues/3551)) ([d09a345](https://github.com/angular-ui/ui-router/commit/d09a345)), closes [#3550](https://github.com/angular-ui/ui-router/issues/3550)
+
+## 1.0.9 (2017-10-17)
+[Compare `@uirouter/angularjs` versions 1.0.8 and 1.0.9](https://github.com/angular-ui/ui-router/compare/1.0.8...1.0.9)
+
+
+### Updated `@uirouter/core` from 5.0.10 to 5.0.11
+[Compare `@uirouter/core` versions 5.0.10 and 5.0.11](https://github.com/ui-router/core/compare/5.0.10...5.0.11)
+
+### Bug Fixes
+
+* **ie9:** make console.bind work in ie9 ([#85](https://github.com/ui-router/core/issues/85)) ([318214b](https://github.com/ui-router/core/commit/318214b))
+
+## 1.0.8 (2017-10-07)
+[Compare `@uirouter/angularjs` versions 1.0.7 and 1.0.8](https://github.com/angular-ui/ui-router/compare/1.0.7...1.0.8)
+
+
+## 5.0.10 (2017-10-07)
+[Compare `@uirouter/core` versions 5.0.8 and 5.0.10](https://github.com/ui-router/core/compare/5.0.8...5.0.10)
+
+### Bug Fixes
+
+* **angular/cli:** Use package.json fields: 'typings', 'main', 'jsnext:main' ([74143d9](https://github.com/ui-router/core/commit/74143d9))
+* **isomorphic:** Remove use of CustomEvent. Detect root scope (global/window/self) for nodejs, browser, or web-worker. ([2d206ba](https://github.com/ui-router/core/commit/2d206ba))
+* **typings:** Use StateObject for parameter to hook criteria functions ([5b58566](https://github.com/ui-router/core/commit/5b58566))
+
+
+### Features
+
+* **TransitionHook:** Add hook registration option `invokeLimit` to limit the number of times a hook is invoked before being auto-deregistered. ([2cb17ef](https://github.com/ui-router/core/commit/2cb17ef))
+
+
+
+## 1.0.7 (2017-09-30)
+[Compare `@uirouter/angularjs` versions 1.0.6 and 1.0.7](https://github.com/angular-ui/ui-router/compare/1.0.6...1.0.7)
+
+### Bug Fixes
+
+* **typings:** Allow views: { foo: 'string' } in Ng1StateDeclaration ([2f7a3f2](https://github.com/angular-ui/ui-router/commit/2f7a3f2))
+
+### Updated `@uirouter/core` from 5.0.6 to 5.0.8 (2017-09-30)
+[Compare `@uirouter/core` versions 5.0.6 and 5.0.8](https://github.com/ui-router/core/compare/5.0.6...5.0.8)
+
+### Bug Fixes
+
+* **bundle:** Rollup: Do not warn on THIS_IS_UNDEFINED ([a4581b1](https://github.com/ui-router/core/commit/a4581b1))
+* **globals:** Use shallow copy to update the globals.params / $state.params object ([e883afc](https://github.com/ui-router/core/commit/e883afc))
+* **Injector:** When getting tokens from native injector, only throw on undefined (not on falsey values) ([ada9ca2](https://github.com/ui-router/core/commit/ada9ca2))
+* **redirectTo:** Fix typings for redirectTo. Allow a function that returns a target state or a promise for one. ([3904487](https://github.com/ui-router/core/commit/3904487))
+* **trace:** Fall back to console.log if .table is unavailable (IE) ([c8110fc](https://github.com/ui-router/core/commit/c8110fc))
+* **trace:** Support tracing of object-parameters with circular references ([2f1ae9a](https://github.com/ui-router/core/commit/2f1ae9a))
+* **url:** Add CustomEvent polyfill for IE ([a50db21](https://github.com/ui-router/core/commit/a50db21))
+* **vanilla:** fix base path handling for vanilla push state ([ad61d74](https://github.com/ui-router/core/commit/ad61d74))
+* **vanilla:** Use `self` instead of `window` for webworker compat ([a4629ee](https://github.com/ui-router/core/commit/a4629ee))
+
+
+### Features
+
+* **TargetState:** Add builder methods .withState, .withParams, and .withOptions ([6b93142](https://github.com/ui-router/core/commit/6b93142))
+
+
+
+## `@uirouter/angularjs` 1.0.6 (2017-08-12)
+[Compare `@uirouter/angularjs` versions 1.0.5 and 1.0.6](https://github.com/angular-ui/ui-router/compare/1.0.5...1.0.6)
+
+### Bug Fixes
+
+* **sourcemaps:** Embed sources inline into sourcemaps ([4baa430](https://github.com/angular-ui/ui-router/commit/4baa430))
+
+
+
+## Changes in `@uirouter/core` between versions [5.0.5 and 5.0.6](https://github.com/ui-router/core/compare/5.0.5...5.0.6) (2017-08-12)
+
+
+### Bug Fixes
+
+* **sourceMaps:** Embed typescript sources in sourcemaps ([10558a3](https://github.com/ui-router/core/commit/10558a3))
+* **typescript:** Fix strictNullCheck type error ([0ae585e](https://github.com/ui-router/core/commit/0ae585e))
+* **urlRouter:** Fix absolute 'href' generation by using location.hostname (not location.host) ([a28b68a](https://github.com/ui-router/core/commit/a28b68a))
+* **urlService:** Fix priority sorting of URL rules ([73a1fe0](https://github.com/ui-router/core/commit/73a1fe0))
+
+
+
+
+## [1.0.5](https://github.com/angular-ui/ui-router/compare/1.0.4...1.0.5) (2017-06-29)
+
+Updated to @uirouter/core 5.0.5 and addressed typescript 2.4 breaking changes
+
+## Changes in `@uirouter/core` between versions [5.0.3 and 5.0.5](https://github.com/ui-router/core/compare/5.0.3...5.0.5) (2017-06-29)
+
+
+### Bug Fixes
+
+* **future:** Allow future states to specify a `parent:` ([828fe1b](https://github.com/ui-router/core/commit/828fe1b))
+* **typescript:** Update to typescript 2.4 ([ce1669b](https://github.com/ui-router/core/commit/ce1669b))
+* **view:** only sync views which are of the same name *and type* ([c48da4a](https://github.com/ui-router/core/commit/c48da4a))
+
+
+### Features
+
+* **invalidTransition:** Better error messaging when param values are invalid ([2a15d1a](https://github.com/ui-router/core/commit/2a15d1a))
+* **trace:** Trace view synchronization. Allow trace.enable(...string) ([284392d](https://github.com/ui-router/core/commit/284392d))
+* **urlMatcher:** add support for multiline urls ([5b11ce0](https://github.com/ui-router/core/commit/5b11ce0))
+
+
+
+
+## [1.0.4](https://github.com/angular-ui/ui-router/compare/1.0.3...1.0.4) (2017-06-09)
+
+
+### Bug Fixes
+
+* **bundle:** work around rollup bug https://github.com/rollup/rollup/issues/1322 ([befb50a](https://github.com/angular-ui/ui-router/commit/befb50a))
+* **uiSrefActive:** Avoid "Possibly unhandled rejection" in console ([5c09e28](https://github.com/angular-ui/ui-router/commit/5c09e28))
+
+
+
+### @uirouter/core changes
+## [5.0.4](https://github.com/ui-router/core/compare/5.0.3...5.0.4) (2017-06-09)
+
+
+### Bug Fixes
+
+* **future:** Allow future states to specify a `parent:` ([828fe1b](https://github.com/ui-router/core/commit/828fe1b))
+* **view:** only sync views which are of the same name *and type* ([c48da4a](https://github.com/ui-router/core/commit/c48da4a))
+
+
+### Features
+
+* **invalidTransition:** Better error messaging when param values are invalid ([2a15d1a](https://github.com/ui-router/core/commit/2a15d1a))
+* **trace:** Trace view synchronization. Allow trace.enable(...string) ([284392d](https://github.com/ui-router/core/commit/284392d))
+
+
+
+
+## [1.0.3](https://github.com/angular-ui/ui-router/compare/1.0.1...1.0.3) (2017-05-07)
+
+
+### Bug Fixes
+
+* **templateFactory:** Do not prepend x- to attribute names unless necessary. ([e573f06](https://github.com/angular-ui/ui-router/commit/e573f06))
+
+
+### Features
+
+* **build:** Publish non-monolithic @uirouter/angularjs UMD bundle `ui-router-angularjs.js` ([8db3696](https://github.com/angular-ui/ui-router/commit/8db3696))
+ ** Note: this change is necessary to properly support plugins which depend on @uirouter/core
+
+
+
+### @uirouter/core changes
+## [5.0.3](https://github.com/ui-router/core/compare/5.0.1...5.0.3) (2017-05-07)
+
+
+### Bug Fixes
+
+* **common:** Fix implementation of 'pick' -- use hasOwnProperty ([09848a4](https://github.com/ui-router/core/commit/09848a4))
+* **common:** Re-fix implementation of 'pick' using for .. in ([f2da7f4](https://github.com/ui-router/core/commit/f2da7f4))
+
+
+### Features
+
+* **build:** Build and distribute @uirouter/core UMD bundles ([0a8da85](https://github.com/ui-router/core/commit/0a8da85))
+
+
+
+
+## [1.0.1](https://github.com/angular-ui/ui-router/compare/1.0.0...1.0.1) (2017-05-04)
+
+
+### Bug Fixes
+
+* **routeToComponent:** Do not prefix component element with `x-` unless necessary. ([60b9ef9](https://github.com/angular-ui/ui-router/commit/60b9ef9))
+
+
+
+# [1.0.0](https://github.com/angular-ui/ui-router/compare/1.0.0-rc.1...1.0.0) (2017-04-30)
+
+
+# NOTICE: The npm package is renamed from `angular-ui-router` to `@uirouter/angularjs`
+
+
+### Bug Fixes
+
+* **noImplicitAny:** move noimplicitany compliance test file to correct location ([ec6e5e4](https://github.com/angular-ui/ui-router/commit/ec6e5e4))
+* **onEnter:** Fix typescript typing for onEnter/onRetain/onExit ([df6ee24](https://github.com/angular-ui/ui-router/commit/df6ee24))
+* **routeToComponent:** Bind resolves that start with data- or x- ([4559c32](https://github.com/angular-ui/ui-router/commit/4559c32))
+* **StateRegistry:** Allow stateRegistry.register() to take a Ng1StateDeclaration ([cc88525](https://github.com/angular-ui/ui-router/commit/cc88525)), closes [#3345](https://github.com/angular-ui/ui-router/issues/3345)
+* **uiCanExit:** Only process uiCanExit hook once during redirects ([7a086ee](https://github.com/angular-ui/ui-router/commit/7a086ee))
+* **uiSref:** replace angular.copy with extend (PR [#3330](https://github.com/angular-ui/ui-router/issues/3330)) ([20d1fcd](https://github.com/angular-ui/ui-router/commit/20d1fcd)), closes [#3189](https://github.com/angular-ui/ui-router/issues/3189)
+* **UrlRouterProvider:** export `UrlRouterProvider` symbol for use with .d.ts typings ([d71bad0](https://github.com/angular-ui/ui-router/commit/d71bad0)), closes [#3296](https://github.com/angular-ui/ui-router/issues/3296)
+* **view:** Allow targeting nested named ui-view by simple ui-view name ([8fe5b1f](https://github.com/angular-ui/ui-router/commit/8fe5b1f))
+* **views:** Allow same views object to be reused in multiple states ([66103fc](https://github.com/angular-ui/ui-router/commit/66103fc)), closes [#3353](https://github.com/angular-ui/ui-router/issues/3353)
+* **views:** Better validation of view declarations (throw when there are state-level and view-level conflicts) ([7573156](https://github.com/angular-ui/ui-router/commit/7573156))
+
+
+### Features
+
+* **uiSref:** Bind ui-sref to other DOM events (PR [#3343](https://github.com/angular-ui/ui-router/issues/3343)) ([193ac2e](https://github.com/angular-ui/ui-router/commit/193ac2e)), closes [#3169](https://github.com/angular-ui/ui-router/issues/3169)
+* **uiSref:** switch custom events prop from `event:` to `events:` ([d3942a6](https://github.com/angular-ui/ui-router/commit/d3942a6))
+
+
+UI-Router for AngularJS version 1.0.0 updates `ui-router-core@3.1.0` to `@uirouter/core@5.0.1`.
+Please keep reading to see if the breaking changes from core between 3.1.0 and 5.0.1 affect you.
+
+### `@uirouter/core` changes
+# [diff to 3.1.0](https://github.com/ui-router/core/compare/3.1.0...5.0.1) (2017-04-30)
+
+### Bug Fixes
+
+* **BrowserLocationConfig:** fixed protocol + port value ([#38](https://github.com/ui-router/core/issues/38)) ([5559382](https://github.com/ui-router/core/commit/5559382))
+* **lazyLoad:** Allow `lazyLoad` stateBuilder: Get lazyLoad fn from internal State object, not StateDeclaration ([9313880](https://github.com/ui-router/core/commit/9313880))
+* **lazyLoad:** Wait for future state to be replaced before registering lazy children ([4bdce47](https://github.com/ui-router/core/commit/4bdce47))
+* **noImplicitAny:** Fix noimplicitany compliance ([1a6cdfc](https://github.com/ui-router/core/commit/1a6cdfc))
+* **pushStateLocation:** call listeners in url() ([#24](https://github.com/ui-router/core/issues/24)) ([7c90911](https://github.com/ui-router/core/commit/7c90911)), closes [#23](https://github.com/ui-router/core/issues/23)
+* **redirect:** Do not update URL after redirect with { location: false } ([652a760](https://github.com/ui-router/core/commit/652a760))
+* **resolve:** Allow resolve's state context to be injected as `$state$` ([a06948b](https://github.com/ui-router/core/commit/a06948b))
+* **tfs:** Rename $q.ts and $injector.ts files, removing leading dollar signs ([cb653ee](https://github.com/ui-router/core/commit/cb653ee))
+* **trace:** Re-add transitionStart trace ([b019036](https://github.com/ui-router/core/commit/b019036))
+* **transitionHook:** Do not process transition hooks after router has been disposed. ([666c6d7](https://github.com/ui-router/core/commit/666c6d7))
+* **TransitionHook:** Transition hooks no longer expose the internal StateObject ([2b0e48b](https://github.com/ui-router/core/commit/2b0e48b))
+* **typings:** Allow strictNullChecks for HookMatchCriteria ([d92d4d5](https://github.com/ui-router/core/commit/d92d4d5))
+* **ui-sref:** Improve performance of generating hrefs ([c3967bd](https://github.com/ui-router/core/commit/c3967bd))
+* **view:** Do not throw when uiView doesn't have a state context ([f76ee2a](https://github.com/ui-router/core/commit/f76ee2a))
+* **view:** Update views in order of ui-view depth and also by state depth ([46dea2b](https://github.com/ui-router/core/commit/46dea2b))
+
+
+### Features
+
+* **abort:** Add API to manually abort/cancel a transition ([39f8a53](https://github.com/ui-router/core/commit/39f8a53))
+* **common:** Perf improvements in hot functions: ([4193244](https://github.com/ui-router/core/commit/4193244))
+* **core:** Export all vanilla.* code from `ui-router-core` ([f3392d1](https://github.com/ui-router/core/commit/f3392d1))
+* **core:** Switch to [@uirouter](https://github.com/uirouter)/core npm module ([e3f389f](https://github.com/ui-router/core/commit/e3f389f))
+* **decorators:** Add state, resolve and resolve data decorators ([642df0b](https://github.com/ui-router/core/commit/642df0b))
+* **defaultErrorHandler:** Do not invoke default error handler for ABORTED transitions ([b07a24b](https://github.com/ui-router/core/commit/b07a24b))
+* **globals:** Removed `UIRouterGlobals` interface. Renamed `Globals` class to `UIRouterGlobals` ([8719334](https://github.com/ui-router/core/commit/8719334))
+* **Globals:** implement Disposable and delete global transition data ([a794018](https://github.com/ui-router/core/commit/a794018))
+* **onBefore:** Run onBefore hooks asynchronously. ([30b82aa](https://github.com/ui-router/core/commit/30b82aa))
+* **onEnter/Exit/Retain:** Use onExit/onEnter/onRetain from 56955state(), not state.self ([bc1f554](https://github.com/ui-router/core/commit/bc1f554))
+* **Rejection:** Add $id to ease debugging of transition rejections ([d456d54](https://github.com/ui-router/core/commit/d456d54))
+* **State:** Support registration of ES6 state classes (as opposed to object literals) ([3a5d055](https://github.com/ui-router/core/commit/3a5d055))
+* **State:** Switch Internal State Object to prototypally inherit from the State Declaration ([027c995](https://github.com/ui-router/core/commit/027c995)), closes [#34](https://github.com/ui-router/core/issues/34)
+* **StateObject:** Rename internal `State` object to `StateObject` ([feceaf9](https://github.com/ui-router/core/commit/feceaf9))
+* **StateRegistry:** improve perf for: `.register()` and `StateMatcher.find()` misses ([fdb3ab9](https://github.com/ui-router/core/commit/fdb3ab9))
+* **transition:** Ignore duplicate transitions (double clicks) ([bd1bd0b](https://github.com/ui-router/core/commit/bd1bd0b))
+* **transition:** Improve supersede logic: Do not supersede if the new trans is aborted before onStart ([3141a8f](https://github.com/ui-router/core/commit/3141a8f))
+* **transition:** Run hooks synchronously in current stack, when possible ([953e618](https://github.com/ui-router/core/commit/953e618))
+* **Transition:** deprecate `Transition.is()` which was never implemented ([1edff4b](https://github.com/ui-router/core/commit/1edff4b))
+* **Transition:** Normalize all transition errors to a Rejection. ([a7464bb](https://github.com/ui-router/core/commit/a7464bb))
+* **UIRouter:** Add `trace` global to the `UIRouter` object ([48c5af6](https://github.com/ui-router/core/commit/48c5af6))
+* **UrlService:** (`UrlRouter`) improve perf of registering Url Rules and sorting Url Rules ([64fbfff](https://github.com/ui-router/core/commit/64fbfff))
+* **UrlService:** Add `rules.initial("/home")` to config initial state (like otherwise) ([bbe4209](https://github.com/ui-router/core/commit/bbe4209))
+* **View:** Allow targeting views on own state using `viewname@.` (normalizeUIViewTarget) ([7078216](https://github.com/ui-router/core/commit/7078216)), closes [#25](https://github.com/ui-router/core/issues/25)
+
+
+### BREAKING CHANGES
+
+## **TransitionHook:** Transition hooks no longer expose the internal `State` object (now named `StateObject`)
+
+#### Before:
+
+```js
+import { State } from "ui-router-core";
+const match = { to: (state: State) => state.data.auth };
+transitionsvc.onEnter(match, (trans: Transition, state: State) => {
+ // state is the internal State object
+ if (state.includes["foo"]) { // internal ui-router API
+ return false;
+ }
+}
+```
+
+#### Now:
+
+```js
+import { StateDeclaration } from "ui-router-core";
+const match = { to: (state: StateDeclaration) => state.data.auth };
+transitionsvc.onEnter(match, (trans: Transition, state: StateDeclaration) => {
+ // state === the state object you registered
+ // Access internal ui-router API using $$state()
+ if (state.$$state().includes["foo"]) {
+ return false;
+ }
+}
+```
+
+#### Motivation:
+
+The `State` object (now named `StateObject`) is an internal API and should not be exposed via any public APIs.
+If you depend on the internal APIs, you can still access the internal object by calling `state.$$state()`.
+
+#### BC Likelihood
+
+How likely is this BC to affect me?
+
+Medium: You will likely be affected you 1) have transition hooks, 2) are using typescript and/or 3) use the internal ui-router State API.
+
+#### BC Severity
+
+How severe is this BC?
+
+Low: Access to the internal api is still available using `$$state()`.
+
+
+## **StateObject:** Renamed internal API `State` object to `StateObject`
+
+#### Before:
+
+```
+import {State} from "ui-router-core";
+```
+
+- #### Now:
+
+```
+import {StateObject} from "ui-router-core";
+```
+
+#### Motivation:
+
+We'd like to use the `State` name/symbol as a public API.
+It will likely be an ES7/TS decorator for ES6/TS state definition classes, i.e:
+
+```js
+@State("foo")
+export class FooState implements StateDeclaration {
+ url = "/foo";
+ component = FooComponent;
+
+ @Resolve({ deps: [FooService] })
+ fooData(fooService) {
+ return fooService.getFoos();
+ }
+}
+```
+
+#### BC Likelihood
+
+How likely is this to affect me?
+
+Low: This only affects code that imports the internal API symbol `State`.
+You will likely be affected you 1) import that symbol, 2) are using typescript and 3) explicitly
+typed a variable such as `let internalStateObject = state.$$state();`
+
+#### BC Severity
+
+How severe is this change?
+
+Low: Find all places where `State` is imported and rename to `StateObject`
+
+
+## **Transition:** All Transition errors are now wrapped in a Rejection object.
+
+#### Before:
+
+Previously, if a transition hook returned a rejected promise:
+```js
+.onStart({}, () => Promise.reject('reject transition'));
+```
+
+In `onError` or `transtion.promise.catch()`, the raw rejection was returned:
+```js
+.onError({}, (trans, err) => err === 'reject transition')
+```
+
+#### Now:
+
+Now, the error is wrapped in a Rejection object.
+
+- The detail (thrown error or rejected value) is still available as `.detail`.
+
+```js
+.onError({}, (trans, err) =>
+ err instanceof Rejection && err.detail === 'reject transition')
+```
+
+- The Rejection object indicates the `.type` of transition rejection (ABORTED, ERROR, SUPERSEDED and/or redirection).
+```js
+.onError({}, (trans, err) => {
+ err.type === RejectType.ABORTED === 3
+});
+```
+
+#### Motivation:
+
+Errors *thrown from* a hook and rejection values *returned from* a hook can now be processed in the same way.
+
+#### BC Likelihood
+
+How likely is this to affect me?
+
+Medium: apps which have onError handlers for rejected values
+
+#### BC Severity
+
+How severe is this change?
+
+Low: Find all error handlers (or .catch/.then chains) that do not understand Rejection. Add `err.detail` processing.
+
+
+
+## **onBefore:** `onBefore` hooks are now run asynchronously like all the other hooks.
+
+#### Old behavior
+
+Previously, the `onBefore` hooks were run in the same stackframe as `transitionTo`.
+If they threw an error, it could be caught using try/catch.
+
+```js
+transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
+try {
+ stateService.go('foo');
+} catch (error) {
+ // handle error
+}
+```
+
+#### New behavior
+
+Now, `onBefore` hooks are processed asynchronously.
+To handle errors, use any of the async error handling paradigms:
+
+- Chain off the promise
+ ```js
+ transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
+ stateService.go('foo').catch(error => { //handle error });
+ ```
+- Define an error handler
+ ```js
+ transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
+ transitionService.onError({ to: 'foo' }), () => { // handle error });
+ stateService.go('foo');
+ ```
+- Use the global defaultErrorHandler
+ ```js
+ transitionService.onBefore({ to: 'foo' }), () => { throw new Error('doh'); });
+ stateService.go('foo');
+ stateService.defaultErrorHandler(error => { // global error handler });
+ ```
+
+#### Motivation
+
+Why introduce a BC?
+
+- No subtle behavior differences by hook type
+- Simpler code and mental model
+- Fewer edge cases to account for
+
+#### BC Liklihood
+
+How likely is this to affect my app?
+
+Very Low: Apps that registered onBefore hooks and depend on
+synchronous execution are affected.
+
+#### BC Severity
+
+How severe is this BC?
+
+Low: Switch to asynchronous handling, such as chaining off the
+transition promise
+
+
+## **defaultErrorHandler:** ABORTED transitions do not invoke the `defaultErrorHandler`
+
+Returning `false` from a transition hook will abort the transition.
+
+#### Old behavior
+
+Previously, this case was considered an error and was logged by
+`defaultErrorHandler`.
+After your feedback, we agree that this is not typically an error.
+
+#### New behavior
+
+Now, aborted transitions do not trigger the `defaultErrorHandler`
+
+#### Motivation:
+
+> Why introduce a BC?
+
+Most users do not consider ABORT to be an error. The default error
+handler should match this assumption.
+
+#### BC liklihood
+
+> How likely am I to be affected?
+
+Low: Most users do not consider ABORT to be an error. For most users
+this will not be a BC.
+
+#### BC severity
+
+> How severe is this BC?
+
+Low: Users who want to handle all transition rejections can
+register a `.onError` handler and filter/process accordingly.
+
+
+## **globals:** This change will likely only affect a small subset of typescript users and probably only those using `ui-router-ng2`.
+
+If you're injecting the `Globals` class somewhere, e.g.:
+```
+@Injectable()
+class MyService {
+ _globals: UIRouterGlobals;
+ constructor(globals: Globals) {
+ this._globals = globals;
+ }
+}
+```
+you should now inject `UIRouterGlobals`, e.g.:
+```
+@Injectable()
+class MyService {
+ constructor(public globals: UIRouterGlobals) { }
+}
+```
+
+Likewise, if you were casting the `UIRouter.globals` object as a `UIRouterGlobals`, it is no longer necessary:
+
+```js
+function myHook(trans: Transition) {
+ let globals: UIRouterGlobals = trans.router.globals; // cast is no longer necessary
+}
+```
+
+Closes https://github.com/ui-router/core/issues/31
+
+
+
+
+# [1.0.0-rc.1](https://github.com/angular-ui/ui-router/compare/1.0.0-beta.3...v1.0.0-rc.1) (2017-01-09)
+
+
+### Bug Fixes
+
+* Post-process .d.ts files to make them compatible with TS 1.8 ([c8162ee](https://github.com/angular-ui/ui-router/commit/c8162ee)), closes [#3070](https://github.com/angular-ui/ui-router/issues/3070)
+* **$stateChangeSuccess:** fire polyfill `$stateChangeSuccess` right after global state are updated ([3984f9b](https://github.com/angular-ui/ui-router/commit/3984f9b)), closes [#3144](https://github.com/angular-ui/ui-router/issues/3144)
+* **$viewContentLoading:** Add $viewContentLoading event back ([c346a28](https://github.com/angular-ui/ui-router/commit/c346a28))
+* **build:** Use global `angular` reference if require('angular') is falsey or empty ([2982613](https://github.com/angular-ui/ui-router/commit/2982613)), closes [#3113](https://github.com/angular-ui/ui-router/issues/3113)
+* **component:** Do not throw err when component has `&` binding ([b5c731d](https://github.com/angular-ui/ui-router/commit/b5c731d)), closes [#3099](https://github.com/angular-ui/ui-router/issues/3099)
+* **Ng1ViewDeclaration:** Make controllerProvider IInjectable ([#3056](https://github.com/angular-ui/ui-router/issues/3056)) ([a3136ae](https://github.com/angular-ui/ui-router/commit/a3136ae)), closes [#3044](https://github.com/angular-ui/ui-router/issues/3044)
+* **ng2.uiSrefActive:** Allow ng-if on nested uiSrefs ([e3051f5](https://github.com/angular-ui/ui-router/commit/e3051f5)), closes [#3046](https://github.com/angular-ui/ui-router/issues/3046)
+* **onExit:** inject resolve values using the "from path" ([c91b65a](https://github.com/angular-ui/ui-router/commit/c91b65a))
+* **onExit:** inject the current transition as `$transition$` ([c91b65a](https://github.com/angular-ui/ui-router/commit/c91b65a)), closes [#3081](https://github.com/angular-ui/ui-router/issues/3081)
+* **package:** use engines: node: >=4.0.0 ([6801b0c](https://github.com/angular-ui/ui-router/commit/6801b0c)), closes [#3086](https://github.com/angular-ui/ui-router/issues/3086)
+* **Resolve:** Fix NOWAIT resolve injection into controllers and bindings to components. ([cb57ce9](https://github.com/angular-ui/ui-router/commit/cb57ce9))
+* **typings:** Change Ng1ViewDeclaration.controller type to IInjectable|string ([d2b5d84](https://github.com/angular-ui/ui-router/commit/d2b5d84)), closes [#3089](https://github.com/angular-ui/ui-router/issues/3089)
+* **typings:** Change Ng1ViewDeclaration.controller type to IInjectable|string ([8e91dc9](https://github.com/angular-ui/ui-router/commit/8e91dc9))
+* **ui-sref:** Update `ui-sref/state` href when states are added/removed ([389dfd5](https://github.com/angular-ui/ui-router/commit/389dfd5))
+* **ui-sref:** Update params-only sref when state changes ([3c1bd0e](https://github.com/angular-ui/ui-router/commit/3c1bd0e)), closes [#1031](https://github.com/angular-ui/ui-router/issues/1031) [#2541](https://github.com/angular-ui/ui-router/issues/2541)
+* **ui-sref:** Use either .on or .bind for click handlers ([b00f044](https://github.com/angular-ui/ui-router/commit/b00f044)), closes [#3035](https://github.com/angular-ui/ui-router/issues/3035)
+* **ui-sref-active:** Add CSS class immediately (avoid delay) ([27eb5e9](https://github.com/angular-ui/ui-router/commit/27eb5e9)), closes [#2503](https://github.com/angular-ui/ui-router/issues/2503)
+* **ui-sref-active:** Avoid add/remove class race condition ([126a4ad](https://github.com/angular-ui/ui-router/commit/126a4ad))
+* **ui-sref-active:** Use `$scope.$evalAsync` to apply css class ([6a9d9ae](https://github.com/angular-ui/ui-router/commit/6a9d9ae)), closes [#2503](https://github.com/angular-ui/ui-router/issues/2503) [#1997](https://github.com/angular-ui/ui-router/issues/1997) [#2503](https://github.com/angular-ui/ui-router/issues/2503) [#1997](https://github.com/angular-ui/ui-router/issues/1997)
+* **ui-state:** Process ui-state links relative to where they are created ([cae4dc4](https://github.com/angular-ui/ui-router/commit/cae4dc4))
+* **ui-state:** Support one time bindings in ng 1.3 ([389dfd5](https://github.com/angular-ui/ui-router/commit/389dfd5)), closes [#3131](https://github.com/angular-ui/ui-router/issues/3131) [#3054](https://github.com/angular-ui/ui-router/issues/3054)
+* **uiView:** do not leave initial view scope undestroyed ([#3164](https://github.com/angular-ui/ui-router/issues/3164)) ([37d6f9a](https://github.com/angular-ui/ui-router/commit/37d6f9a)), closes [#1896](https://github.com/angular-ui/ui-router/issues/1896)
+
+
+### Features
+
+* bundle using rollupjs for smaller bundle and faster init times ([a4b5500](https://github.com/angular-ui/ui-router/commit/a4b5500))
+* Deprecate public use of `$urlRouter` and `$urlMatcherFactory` in favor of `$urlService` ([6ee7f21](https://github.com/angular-ui/ui-router/commit/6ee7f21))
+* Move imperative `$resolve` service out of main bundle ([cae6d03](https://github.com/angular-ui/ui-router/commit/cae6d03))
+* remove component.json ([af736c4](https://github.com/angular-ui/ui-router/commit/af736c4))
+* Use angular 1.3+ `$templateRequest` service to fetch templates ([7e1f36e](https://github.com/angular-ui/ui-router/commit/7e1f36e)), closes [#3193](https://github.com/angular-ui/ui-router/issues/3193) [#1882](https://github.com/angular-ui/ui-router/issues/1882)
+* **$uiRouter:** expose router instance at config-time as `$uiRouterProvider.router` ([9d2661c](https://github.com/angular-ui/ui-router/commit/9d2661c))
+* **injectables:** Expose `$uiRouterProvider`, `$uiRouterGlobals`, and `$stateRegistry` injectables ([7fa72a6](https://github.com/angular-ui/ui-router/commit/7fa72a6))
+* **ui-sref-active:** improve performance by reducing $watches ([126a4ad](https://github.com/angular-ui/ui-router/commit/126a4ad))
+* **ui-view:** Route-to-component: Wire component "&" bindings ([af95206](https://github.com/angular-ui/ui-router/commit/af95206)), closes [#3239](https://github.com/angular-ui/ui-router/issues/3239) [#3111](https://github.com/angular-ui/ui-router/issues/3111)
+* **UrlService:** Create UrlService API (facade) for easier access to URL based APIs ([6ee7f21](https://github.com/angular-ui/ui-router/commit/6ee7f21))
+* **view:** A view without anything to render defaults to `` ([7d28fdd](https://github.com/angular-ui/ui-router/commit/7d28fdd)), closes [#3178](https://github.com/angular-ui/ui-router/issues/3178)
+* **view:** Route a view to a directive using `componentProvider` ([#3165](https://github.com/angular-ui/ui-router/issues/3165)) ([090d2e3](https://github.com/angular-ui/ui-router/commit/090d2e3))
+
+
+### BREAKING CHANGES
+
+# BREAKING CHANGE: Deprecate public use of `$urlRouter` and `$urlMatcherFactory` in favor of `$urlService`
+
+The `UrlService` combines the commonly used URL APIs in a single place.
+The service may be injected in a run block as `$urlService`, or in a config block as `$urlServiceProvider`.
+
+The service object has two nested API objects, `rules` and `config`. An example usage is `$urlService.rules.otherwise('/home')`
+
+The existing API for `$urlRouter` and `$urlMatcherFactory` will continue to function as before, but are now considered an "internal API".\
+The new `$urlService` is a facade which delegates to the appropriate internal APIs.
+
+# BREAKING CHANGE: Use angular 1.3+ `$templateRequest` service to fetch templates
+
+We now fetch templates using `$templateRequest` when it is available (angular 1.3+).
+You can revert to previous template fetching behavior using `$http` by configuring the ui-router `$templateFactoryProvider`.
+
+```js
+.config(function($templateFactoryProvider) {
+ $templateFactoryProvider.shouldUnsafelyUseHttp(true);
+});
+```
+
+There are security ramifications to using `$http` to fetch templates.
+Read
+[Impact on loading templates](https://docs.angularjs.org/api/ng/service/$sce#impact-on-loading-templates)
+for more details
+
+# BREAKING CHANGE: Move imperative `$resolve` service out of main bundle
+
+The `$resolve` service's `.resolve()` method can be used to perform async dependency injection imperatively.
+
+The code has been moved out of the main angular-ui-router codebase and is now opt-in.
+For prebuilt bundle users, add `release/legacy/resolveService.js` to your project.
+For self-bundlers (e.g., webpack), add `angular-ui-router/lib/legacy/resolveService` as an `import` or `require()`.
+
+It's unlikely you use this service.
+Its most common usage is with the UI-Bootstrap `$modal` service.
+
+# BREAKING CHANGE: remove component.json
+
+
+
+
+## ui-router-core changes
+
+This release of angular-ui-router (1.0.0-rc.1) updates ui-router-core to 3.1.0
+These are the changes in ui-router-core from 1.0.0-beta.3 to 3.1.0
+
+# [3.1.0](https://github.com/ui-router/core/compare/1.0.0-beta.3...3.1.0) (2017-01-09)
+
+
+### Bug Fixes
+
+* **lazyLoad:** Sync by URL after nested lazy load triggered by URL ([1c6220c](https://github.com/ui-router/core/commit/1c6220c))
+* **lazyLoad:** Use UrlService.match() to retry url sync after successful lazy load triggered by url ([8c2461d](https://github.com/ui-router/core/commit/8c2461d)), closes [#19](https://github.com/ui-router/core/issues/19)
+* **Ng1ViewDeclaration:** Make controllerProvider IInjectable ([#3056](https://github.com/ui-router/core/issues/3056)) ([a3136ae](https://github.com/ui-router/core/commit/a3136ae)), closes [#3044](https://github.com/ui-router/core/issues/3044)
+* **ng2.uiSrefActive:** Allow ng-if on nested uiSrefs ([e3051f5](https://github.com/ui-router/core/commit/e3051f5)), closes [#3046](https://github.com/ui-router/core/issues/3046)
+* **onBefore:** Skip remaining hooks after the ([#2](https://github.com/ui-router/core/issues/2)) ([8a45d04](https://github.com/ui-router/core/commit/8a45d04))
+* **param:** `params: { foo: { raw: true } }` overrides `ParamType.raw` ([aefeabf](https://github.com/ui-router/core/commit/aefeabf))
+* **Param:** Mark all query parameters as optional ([7334d98](https://github.com/ui-router/core/commit/7334d98))
+* **params:** Check for null in `int` param type `is()` check ([aa551e4](https://github.com/ui-router/core/commit/aa551e4)), closes [#3197](https://github.com/ui-router/core/issues/3197)
+* **redirect:** Do not allow `onBefore` hooks to cause infinite redirect loops ([5c5f7eb](https://github.com/ui-router/core/commit/5c5f7eb)), closes [#6](https://github.com/ui-router/core/issues/6)
+* **redirectTo:** Do not puke when redirectTo returns undefined ([bde9c0f](https://github.com/ui-router/core/commit/bde9c0f))
+* **redirectTo:** fix TS type signature of `redirectTo` ([2c059c4](https://github.com/ui-router/core/commit/2c059c4))
+* **StateQueueManager:** Compare parsed url parameters using typed parameters ([beca1f5](https://github.com/ui-router/core/commit/beca1f5))
+* **StateRegistry:** Fix error message: State '' is already defined ([f5bd96b](https://github.com/ui-router/core/commit/f5bd96b))
+* **StateService:** Compare typed parameters in .is() and .includes() ([b1a5155](https://github.com/ui-router/core/commit/b1a5155))
+* **TargetState:** Narrow `name()` return type to `String` ([a02f4a7](https://github.com/ui-router/core/commit/a02f4a7))
+* **Transition:** Use { location: replace } when redirecting a transtition in response to a URL sync ([23e2b78](https://github.com/ui-router/core/commit/23e2b78))
+* **typescript:** Emit TS 1.8 compatible .d.ts files ([65badf4](https://github.com/ui-router/core/commit/65badf4))
+* **typings:** Allow urlRouter.rule to return void ([0b78bdf](https://github.com/ui-router/core/commit/0b78bdf))
+* **ui-sref:** Use either .on or .bind for click handlers ([b00f044](https://github.com/ui-router/core/commit/b00f044)), closes [#3035](https://github.com/ui-router/core/issues/3035)
+* **UrlRouter:** Use { location: 'replace' } whenever a url redirect happens ([6cf9b8f](https://github.com/ui-router/core/commit/6cf9b8f))
+* **UrlService:** Wire urlMatcherFactory and urlRouter functions ([a7b58d6](https://github.com/ui-router/core/commit/a7b58d6))
+* **vanilla:** vanilla locations: do not parse "empty string" query key parameter ([f949480](https://github.com/ui-router/core/commit/f949480))
+* **view:** Load view prerequisites in `onFinish` ([cc85e76](https://github.com/ui-router/core/commit/cc85e76))
+* **view.load:** Allow view.load to return synchronously ([8619cf9](https://github.com/ui-router/core/commit/8619cf9))
+
+
+### Features
+
+* (CoreServices) Move `location` and `locationConfig` from `services` to `UIRouter.locationService` and `UIRouter.locationConfig`. ([029fb00](https://github.com/ui-router/core/commit/029fb00))
+* Built-in `string` parameter type no longer encodes slashes as `~2F` nor tildes as `~~` ([72bb2d8](https://github.com/ui-router/core/commit/72bb2d8))
+* Create router.dispose() to dispose a router instance and resources. ([0690917](https://github.com/ui-router/core/commit/0690917))
+* Hook errors are all normalized to a "Rejection" type. To access the detail of the error thrown (`throw "Error 123"`), use `.detail`, i.e.: ([f486ced](https://github.com/ui-router/core/commit/f486ced))
+* Move `html5Mode` and `hashPrefix` from `LocationServices` to `LocationConfig` interface ([9d316a7](https://github.com/ui-router/core/commit/9d316a7))
+* move `ViewService.viewConfigFactory` and `rootContext` to `_pluginapi.*` ([65badf4](https://github.com/ui-router/core/commit/65badf4))
+* Move html5Mode and hashPrefix to LocationServices from LocationConfig ([f7ac2bb](https://github.com/ui-router/core/commit/f7ac2bb))
+* Order URL Matching Rules by priority, not registration order ([eb2f5d7](https://github.com/ui-router/core/commit/eb2f5d7))
+* Path/Query parameters no longer default to `string` param type ([72bb2d8](https://github.com/ui-router/core/commit/72bb2d8))
+* Previously, a state with a `lazyLoad` function was considered a future state. ([ec50da4](https://github.com/ui-router/core/commit/ec50da4))
+* Remove `getResolveValue` and `getResolvable` methods from `Transition` in favor of `injector().get()` and `injector().getAsync()` ([111d259](https://github.com/ui-router/core/commit/111d259))
+* Replace `LocationServices.setUrl` with `LocationServices.url` ([4c39dcb](https://github.com/ui-router/core/commit/4c39dcb))
+* Replace UrlRouterProvider/UrlRouter with just UrlRouter ([fddd1e2](https://github.com/ui-router/core/commit/fddd1e2))
+* **assertMap:** Add a [].map() helper that asserts that each element is truthy ([f044f53](https://github.com/ui-router/core/commit/f044f53))
+* **futureState:** States with a `.**` name suffix (i.e., `foo.**`) are considered future states ([ec50da4](https://github.com/ui-router/core/commit/ec50da4))
+* **hash:** Change the hash parameter type (`'#'`) to `inherit: false` so it is cleared out when another transition occurs. ([849f84f](https://github.com/ui-router/core/commit/849f84f)), closes [#3245](https://github.com/ui-router/core/issues/3245) [#3218](https://github.com/ui-router/core/issues/3218) [#3017](https://github.com/ui-router/core/issues/3017)
+* **HookBuilder:** Allow custom hook types (to be defined by a plugin) ([3f146e6](https://github.com/ui-router/core/commit/3f146e6))
+* **lazyLoad:** Created `StateService.lazyLoad` method to imperatively lazy load a state ([ec50da4](https://github.com/ui-router/core/commit/ec50da4)), closes [#8](https://github.com/ui-router/core/issues/8)
+* **lazyLoad:** Exported/exposed the `lazyLoadState` function ([ec50da4](https://github.com/ui-router/core/commit/ec50da4))
+* **lazyLoad:** the `lazyLoad` hook can be used to lazy load anything (component code, etc) ([ec50da4](https://github.com/ui-router/core/commit/ec50da4)), closes [#4](https://github.com/ui-router/core/issues/4)
+* **LocationServices:** Add a `parts()` method which returns the URL parts as an object ([32e64f0](https://github.com/ui-router/core/commit/32e64f0))
+* **onCreate:** Add onCreate transition hook ([f486ced](https://github.com/ui-router/core/commit/f486ced))
+* **params:** Add `path` and `query` param types ([72bb2d8](https://github.com/ui-router/core/commit/72bb2d8))
+* **params:** add option to use generic type for Transition.params ([#17](https://github.com/ui-router/core/issues/17)) ([eb12ec8](https://github.com/ui-router/core/commit/eb12ec8)), closes [#16](https://github.com/ui-router/core/issues/16)
+* **Params:** Allow `inherit: false` specified per parameter or type ([849f84f](https://github.com/ui-router/core/commit/849f84f))
+* **plugin:** Allow all plugins to be gotted. ([e324973](https://github.com/ui-router/core/commit/e324973))
+* **plugin:** Allow registration by ES6 class, JS constructor fn, JS factory fn ([b9f4541](https://github.com/ui-router/core/commit/b9f4541))
+* **plugin:** Create plugin API ([36a5215](https://github.com/ui-router/core/commit/36a5215)), closes [#7](https://github.com/ui-router/core/issues/7)
+* **Resolve:** implement NOWAIT policy: Do not wait for resolves before completing a transition. ([05d4c73](https://github.com/ui-router/core/commit/05d4c73)), closes [#3243](https://github.com/ui-router/core/issues/3243) [#2691](https://github.com/ui-router/core/issues/2691)
+* **State:** add .parameters() option for filtering to matching keys ([beca1f5](https://github.com/ui-router/core/commit/beca1f5))
+* **transition:** Allow plugins to define own transition events like `onEnter` ([0dc2c19](https://github.com/ui-router/core/commit/0dc2c19))
+* **transition:** Create ([2673406](https://github.com/ui-router/core/commit/2673406))
+* **Transition:** Add Transition.originalTransition() to return the initial transition in a chain of redirects ([4fe39e3](https://github.com/ui-router/core/commit/4fe39e3))
+* **Transition:** Allow `injector()` to retrieve resolves for the exiting states/path ([df502e8](https://github.com/ui-router/core/commit/df502e8))
+* **Transition:** Allow a plain object `ResolvableLiteral` in `Transition.addResolvable` ([ad9ae81](https://github.com/ui-router/core/commit/ad9ae81))
+* **Transition:** Make Transition.params() immutable to avoid confusion about mutability ([0162212](https://github.com/ui-router/core/commit/0162212))
+* **Transition:** Support treechange paths in API for Resolve+transition ([beedc82](https://github.com/ui-router/core/commit/beedc82))
+* **UrlMatcher:** Add comparison function by UrlMatcher specificity ([eb2f5d7](https://github.com/ui-router/core/commit/eb2f5d7))
+* **UrlRouter:** sort url rules by specificity, not by registration order. ([eb2f5d7](https://github.com/ui-router/core/commit/eb2f5d7))
+* **UrlService:** allow eager or lazy binding of location objects during construction ([7e0a8af](https://github.com/ui-router/core/commit/7e0a8af))
+* **UrlServices:** Add `match()`: given a URL, return the best matching Url Rule ([32e64f0](https://github.com/ui-router/core/commit/32e64f0))
+* **vanilla:** Implement in-memory-only location api ([f64aace](https://github.com/ui-router/core/commit/f64aace))
+
+
+### BREAKING CHANGES
+
+# BREAKING CHANGE: Remove `getResolveValue` and `getResolvable` methods from `Transition` in favor of `injector().get()` and `injector().getAsync()`
+
+In beta.3, the Transition APIs: `injector()`, `getResolvable`, and `getResolveValue` duplicated functionality.
+
+Instead of:
+```js
+trans.getResolveValue('myResolve');
+```
+use:
+```js
+trans.injector().get('myResolve')
+```
+# BREAKING CHANGE: Hook errors are all normalized to a "Rejection" type. To access the detail of the error thrown (`throw "Error 123"`), use `.detail`, i.e.:
+### Before
+```js
+$state.go('foo').catch(err => { if (err === "Error 123") .. });
+```
+### New way
+```js
+$state.go('foo').catch(err => { if (err.detail === "Error 123") .. });
+```
+# BREAKING CHANGE: Replace `LocationServices.setUrl` with `LocationServices.url`
+
+This makes `url()` a getter/setter. It also adds the optional `state` parameter to pass through to the browser history when using pushstate.
+End users should not notice this change, but plugin authors may.
+# BREAKING CHANGE: Replace UrlRouterProvider/UrlRouter with just UrlRouter
+
+The configuration functions from the provider object have been integrated into the normal UrlRouter object.
+The `UIRouter` object no longer has a `uriRouterProvider`, but the equivalent functions can be found on `uiRouter`
+
+One difference between the old functions on `urlRouterProvider` and the new ones on `uriRouter` is that new functions do not accept injectable functions.
+# BREAKING CHANGE: Built-in `string` parameter type no longer encodes slashes as `~2F` nor tildes as `~~`
+
+Previously, the `string` parameter type pre-encoded tilde chars (`~`) as two tilde chars (`~~`) and slashes (`/`) as `~2F`.
+
+Now, the `string` parameter type does not pre-encode slashes nor tildes.
+If you rely on the previous encoding, create a custom parameter type that implements the behavior:
+
+```js
+urlMatcherFactory.type('tildes', {
+ encode: (val: any) =>
+ val != null ? val.toString().replace(/(~|\/)/g, m => ({ '~': '~~', '/': '~2F' }[m])) : val;
+ decode: (val: string) =>
+ val != null ? val.toString().replace(/(~~|~2F)/g, m => ({ '~~': '~', '~2F': '/' }[m])) : val;
+ pattern: /[^/]*/
+});
+```
+# BREAKING CHANGE: Path/Query parameters no longer default to `string` param type
+
+Previously, if a url parameter's type was not specified (in either the path or query), it defaulted to the `string` type.
+
+Now, path parameters default to the new `path` type and query parameters default to the new `query` type.
+
+**In Angular 1 only**, the new `path` parameter type retains the old behavior of pre-encoding `~` to `~~` and `/` to `~2F`
+# BREAKING CHANGE: Order URL Matching Rules by priority, not registration order
+
+URL Rules can come from registered states' `.url`s, calling `.when()`, or calling `.rule()`.
+It's possible that two or more URL Rules could match the URL.
+
+### Previously
+
+Previously, url rules were matched in the order in which they were registered.
+The rule which was registered first would handle the URL change.
+
+### Now
+
+Now, the URL rules are sorted according to a sort function.
+More specific rules are preferred over less specific rules
+
+### Why
+
+It's possible to have multiple url rules that match a given URL.
+Consider the following states:
+
+ - `{ name: 'books', url: '/books/index' }''`
+ - `{ name: 'book', url: '/books/:bookId' }''`
+
+Both states match when the url is `/books/index`.
+Additionally, you might have some custom url rewrite rules such as:
+
+ `.when('/books/list', '/books/index')`.
+
+The `book` state also matches when the rewrite rule is matched.
+
+Previously, we simply used the first rule that matched. However, now that lazy loading is officially supported, it can be difficult for developers to ensure the rules are registered in the right order.
+
+Instead, we now prioritize url rules by how specific they are. More specific rules are matched earlier than less specific rules.
+We split the path on `/`. A static segment (such as `index` in the example) is more specific than a parameter (such as`:bookId`).
+
+### More Details
+
+The built-in rule sorting function (see `UrlRouter.defaultRuleSortFn`) sorts rules in this order:
+
+- Explicit priority: `.when('/foo', '/bar', { priority: 1 })` (default priority is 0)
+- Rule Type:
+ - UrlMatchers first (registered states and `.when(string, ...)`)
+ - then regular Expressions (`.when(regexp, ...)`)
+ - finally, everything else (`.rule()`)
+- UrlMatcher specificity: static path segments are more specific than variables (see `UrlMatcher.compare`)
+- Registration order (except for UrlMatcher based rules)
+
+For complete control, a custom sort function can be registered with `UrlService.rules.sort(sortFn)`
+
+### Query params
+
+Because query parameters are optional, they are not considered during sorting.
+For example, both these rules will match when the url is `'/foo/bar'`:
+
+```
+.when('/foo/bar', doSomething);
+.when('/foo/bar?queryparam', doSomethingElse);
+```
+
+To choose the most specific rule, we match both rules, then choose the rule with the "best ratio" of matched optional parameters (see `UrlRuleFactory.fromUrlMatcher`)
+
+This allows child states to be defined with only query params for a URL.
+The state only activates when the query parameter is present.
+
+```
+.state('parent', { url: '/parent' });
+.state('parent.child', { url: '?queryParam' });
+```
+
+## Restoring the previous behavior
+
+For backwards compatibility, register a sort function which sorts by the registration order:
+
+```js
+myApp.config(function ($urlServiceProvider) {
+
+ function sortByRegistrationOrder(a, b) {
+ return a.$id - b.$id;
+ }
+
+ $urlServiceProvider.rules.sort(sortByRegistrationOrder);
+
+});
+```
+# BREAKING CHANGE: Move `html5Mode` and `hashPrefix` from `LocationServices` to `LocationConfig` interface
+
+### End users should not notice
+
+# BREAKING CHANGE: move `ViewService.viewConfigFactory` and `rootContext` to `_pluginapi.*`
+This BC happened in commit 6c42285
+
+# BREAKING CHANGE: Move html5Mode and hashPrefix to LocationServices from LocationConfig
+
+# BREAKING CHANGE: Previously, a state with a `lazyLoad` function was considered a future state.
+Now, a state whose name ends with `.**` (i.e., a glob pattern which matches all children) is a future state.
+
+### All future states should be given a name that ends in `.**`.
+
+Change your future states from:
+```
+{ name: 'future', url: '/future', lazyLoad: () => ... }
+```
+to:
+```
+{ name: 'future.**', url: '/future', lazyLoad: () => ... }
+```
+# BREAKING CHANGE: (CoreServices) Move `location` and `locationConfig` from `services` to `UIRouter.locationService` and `UIRouter.locationConfig`.
+
+The core `services` object is a mutable object which each framework was monkey patching.
+This change removes the requirement to monkey patch a global mutable object.
+Instead, framework implementors should pass the `LocationServices` and `LocationConfig` implementations into the `UIRouter` constructor.
+
+### End Users
+
+End users who were accessing `services.location` or `services.locationConfig` should access these off the `UIRouter` instance instead.
+
+
+
+
+
+
+# [1.0.0-beta.3 commits](https://github.com/angular-ui/ui-router/compare/1.0.0-beta.2...1.0.0-beta.3) (2016-09-23)
+
+[Read more on the blog](https://ui-router.github.io/blog/uirouter-1.0.0-beta.3/)
+
+This release adds Angular 2.0.0 final support.
+It changes the NgModule mechanism to use `UIRouterModule.forRoot()` and `UIRouterModule.forChild()`.
+See the blog and the breaking changes section.
+
+### Bug Fixes
+
+This release fixes bugs for both ng1 and ng2
+
+* **common:** Remove `url()` from LocationService interface ([#2990](https://github.com/angular-ui/ui-router/issues/2990)) ([d6c2580](https://github.com/angular-ui/ui-router/commit/d6c2580))
+* **lazyLoad:** Always delete the lazy load promise after it settles. ([dd2f101](https://github.com/angular-ui/ui-router/commit/dd2f101))
+* **ng1.StateProvider:** Export StateProvider class so type can be used ([167770d](https://github.com/angular-ui/ui-router/commit/167770d))
+* **ng1.uiView:** Remove deprecated jquery functions bind/unbind in favor of on/off ([60ebd44](https://github.com/angular-ui/ui-router/commit/60ebd44))
+* **ng2:** Angular 2.0.0 final compatibility ([7c54b75](https://github.com/angular-ui/ui-router/commit/7c54b75)), closes [#2991](https://github.com/angular-ui/ui-router/issues/2991)
+* **ng2.NgModule:** Allow apps with no forChild modules ([d3bd332](https://github.com/angular-ui/ui-router/commit/d3bd332)), closes [#3009](https://github.com/angular-ui/ui-router/issues/3009)
+* **ng2.uiView:** Use ReflectorReader to get component inputs
+* **resolve:** Don't re-resolve data when redirected to same state, but only dynamic params changed. ([98cd2d2](https://github.com/angular-ui/ui-router/commit/98cd2d2)), closes [#3033](https://github.com/angular-ui/ui-router/issues/3033)
+* **trace:** Show function definition during logging of trace.enable('HOOK') ([190d122](https://github.com/angular-ui/ui-router/commit/190d122))
+* **transition:** Fail a transition if a new one has started while resolves are loading ([bc87d9e](https://github.com/angular-ui/ui-router/commit/bc87d9e)), closes [#2972](https://github.com/angular-ui/ui-router/issues/2972)
+* **urlMatcherFactory:** fix tilde edge case with "string" encoding ([#3018](https://github.com/angular-ui/ui-router/issues/3018)) ([a201906](https://github.com/angular-ui/ui-router/commit/a201906))
+* **viewService:** Allow root ui-view to be wrapped in ng-if ([32f718a](https://github.com/angular-ui/ui-router/commit/32f718a)), closes [#3004](https://github.com/angular-ui/ui-router/issues/3004)
+
+### Features
+
+* **StateBuilder:** Calculate parent state name when ends in two wildcards `**` ([b4621f3](https://github.com/angular-ui/ui-router/commit/b4621f3))
+
+
+### BREAKING CHANGES
+
+#### BC in Core
+* Remove `UIInjector.native` infavor of `UIInjector.getNative()` ([d11b7dc](https://github.com/angular-ui/ui-router/commit/d11b7dc))
+* Remove `stateProvider` from ui-router-core. Use `stateRegistry` and `stateService` in 88c6494
+* We now enforce states with an explicit `parent:` may NOT ALSO specify a parent state in their name (i.e., `parent.child`)
+
+#### BC in Angular 2
+
+Major breaking changes for Angular 2 bootstrap between beta.2 and beta.3
+
+- Removed `@UIRouterModule` decorator.
+- Added `UIRouterModule.forRoot()` and `UIRouterModule.forChild()` factory methods
+- See https://ui-router.github.io/docs/latest/classes/ng2.uiroutermodule.html
+
+@NgModule({
+ imports: [
+ UIRouterModule.forRoot({
+ states: INITIAL_STATES,
+ useHash: true,
+ configClass: MyUIRouterConfig
+ }),
+ BrowserModule,
+ FeatureModule,
+ ],
+ declarations: INITIAL_COMPONENTS
+})
+class RootAppModule {}
+
+@NgModule({
+ imports: [
+ UIRouterModule.forChild({
+ states: FEATURE_STATES,
+ configClass: FeatureConfig
+ }),
+ CommonModule,
+ ],
+ declarations: FEATURE_COMPONENTS
+})
+
+
+
+# [1.0.0-beta.2 commits](https://github.com/angular-ui/ui-router/compare/1.0.0-beta.1...1.0.0-beta.2) (2016-09-09)
+
+[Read more on the blog](https://ui-router.github.io/blog/uirouter-1.0.0-beta.2/)
+
+### Features
+
+#### Core
+
+* **lazyLoad:** Add state.lazyLoad hook to lazy load a tree of states ([bef5257](https://github.com/angular-ui/ui-router/commit/bef5257)) ([8ecb6c6](https://github.com/angular-ui/ui-router/commit/8ecb6c6)), closes [#146](https://github.com/angular-ui/ui-router/issues/146) [#2739](https://github.com/angular-ui/ui-router/issues/2739)
+* **StateRegistry:** Add `deregister` method. ([44579ec](https://github.com/angular-ui/ui-router/commit/44579ec)), closes [#1095](https://github.com/angular-ui/ui-router/issues/1095) [#2711](https://github.com/angular-ui/ui-router/issues/2711)
+* **redirectTo:** Process `redirectTo` property of a state as a redirect string/object/hook function ([6becb12](https://github.com/angular-ui/ui-router/commit/6becb12)), closes [#27](https://github.com/angular-ui/ui-router/issues/27) [#948](https://github.com/angular-ui/ui-router/issues/948)
+* **redirect:** Error after 20+ redirected transitions ([88052bf](https://github.com/angular-ui/ui-router/commit/88052bf))
+* **rejectFactory:** separate transition aborted and transition errored reject types ([55995fd](https://github.com/angular-ui/ui-router/commit/55995fd))
+* **Resolve:** support ng2-like provide object literals ([a7e5ea6](https://github.com/angular-ui/ui-router/commit/a7e5ea6))
+* **Resolve:** Switch state.resolve to be an array of Resolvables ([6743a60](https://github.com/angular-ui/ui-router/commit/6743a60))
+* **Transition:** Add the transition source (url/sref) to TransitionOptions ([5d42d79](https://github.com/angular-ui/ui-router/commit/5d42d79))
+* **Transition:** Added `getResolvable(token)` method ([3aee2b7](https://github.com/angular-ui/ui-router/commit/3aee2b7))
+* **Transition:** expose the current `UiRouter` object as a public property ([52f1308](https://github.com/angular-ui/ui-router/commit/52f1308))
+* **Transition:** expose the transition rejection reason as `Transition.error()` ([7a9e383](https://github.com/angular-ui/ui-router/commit/7a9e383)), closes [#2866](https://github.com/angular-ui/ui-router/issues/2866)
+* **Transition:** Expose the transition's TargetState as targetState() ([f06f6b6](https://github.com/angular-ui/ui-router/commit/f06f6b6))
+* **urlRouter:** Allow a rule to be deleted. ([55f3d3d](https://github.com/angular-ui/ui-router/commit/55f3d3d))
+
+#### ng2
+* **ng2.rx:** Added RxJS Observables for transitions and states: ([2a2f381](https://github.com/angular-ui/ui-router/commit/2a2f381))
+* **ng2:** Add [@UIRouterModule](https://github.com/UIRouterModule) decorator ([e7bedc2](https://github.com/angular-ui/ui-router/commit/e7bedc2)), closes [#2922](https://github.com/angular-ui/ui-router/issues/2922)
+* **ng2:** Improve ng2 bootstrap flexibility with provideUIRouter() provider factory function ([bc17066](https://github.com/angular-ui/ui-router/commit/bc17066)), closes [#2958](https://github.com/angular-ui/ui-router/issues/2958)
+* **ng2.UrlRouter:** Implement { location: replace } ([b8c6146](https://github.com/angular-ui/ui-router/commit/b8c6146)), closes [#2850](https://github.com/angular-ui/ui-router/issues/2850)
+* **ng2.NgModule:** Add module's states to DI using UIROUTER_STATES_TOKEN ([0cb628e](https://github.com/angular-ui/ui-router/commit/0cb628e))
+* **ng2.stateRegistry:** Automatically register states defined on a UIRouterModule ([58a3c84](https://github.com/angular-ui/ui-router/commit/58a3c84))
+* **ng2.UIView:** Use merged NgModule/ParentComp to inject routed component ([37241e7](https://github.com/angular-ui/ui-router/commit/37241e7))
+* **ng2.upgrade:** Enable ng1-to-ng2 ([0bf4eb4](https://github.com/angular-ui/ui-router/commit/0bf4eb4))
+* **uiView:** Support Components loaded via AppModule ([696148f](https://github.com/angular-ui/ui-router/commit/696148f))
+
+
+### Bug Fixes
+
+#### Core
+
+* **defaultErrorHandler:** Invoke handler when a transition is Canceled. ([4fcccd8](https://github.com/angular-ui/ui-router/commit/4fcccd8)), closes [#2924](https://github.com/angular-ui/ui-router/issues/2924)
+* **defaultErrorHandler:** log Error and Error.stack by default ([e102a85](https://github.com/angular-ui/ui-router/commit/e102a85))
+* **defaultErrorHandler:** Reduce console.error noise when redirected ([8c0344f](https://github.com/angular-ui/ui-router/commit/8c0344f))
+* **common:** Add concrete import to interface.ts to fix unit tests ([2d16740](https://github.com/angular-ui/ui-router/commit/2d16740))
+* **redirect:** fix bug where redirected transitions with reload: true got wrong resolve values copied ([bd0e3a3](https://github.com/angular-ui/ui-router/commit/bd0e3a3))
+* **redirectTo:** fix redirectTo definition (interface) ([eff7195](https://github.com/angular-ui/ui-router/commit/eff7195)), closes [#2871](https://github.com/angular-ui/ui-router/issues/2871)
+* **Rejection:** Silence "Error: Uncaught (in Exception)" ([38432f4](https://github.com/angular-ui/ui-router/commit/38432f4)), closes [#2676](https://github.com/angular-ui/ui-router/issues/2676)
+* **Resolve:** prevent RXWAIT from waiting for the observable to complete ([a02caf3](https://github.com/angular-ui/ui-router/commit/a02caf3))
+* **ResolvePolicy:** Fix resolve policy config loading ([4440811](https://github.com/angular-ui/ui-router/commit/4440811)), closes [#2945](https://github.com/angular-ui/ui-router/issues/2945)
+* **stateService:** change reloadState parameter in reload function is optional ([#2973](https://github.com/angular-ui/ui-router/issues/2973)) ([839dc4a](https://github.com/angular-ui/ui-router/commit/839dc4a))
+* **StateService:** remove jQuery deprecated feature ([fa40acc](https://github.com/angular-ui/ui-router/commit/fa40acc))
+* **trace:** make TRANSITION trace less noisy when a transition is redirected ([a65c58f](https://github.com/angular-ui/ui-router/commit/a65c58f))
+* **Trace:** Fix error in console after $trace.enable() ([013c77a](https://github.com/angular-ui/ui-router/commit/013c77a)), closes [#2752](https://github.com/angular-ui/ui-router/issues/2752)
+* **transitionHook:** Prevent queued hookFn to be called if deregistered ([#2939](https://github.com/angular-ui/ui-router/issues/2939)) ([39e1ba7](https://github.com/angular-ui/ui-router/commit/39e1ba7)), closes [#2928](https://github.com/angular-ui/ui-router/issues/2928)
+* **typescript:** Make UI-Router `noImplicitAny` safe. ([0769bc2](https://github.com/angular-ui/ui-router/commit/0769bc2)), closes [#2693](https://github.com/angular-ui/ui-router/issues/2693)
+* **typescript:** Remove angular1 specific types from ui-router-core methods ([30124bd](https://github.com/angular-ui/ui-router/commit/30124bd)), closes [#2693](https://github.com/angular-ui/ui-router/issues/2693)
+
+
+#### ng1
+
+* **ng1.stateService:** Coerce 'null' `params` value to empty object ([f674151](https://github.com/angular-ui/ui-router/commit/f674151)), closes [#2952](https://github.com/angular-ui/ui-router/issues/2952)
+* **ng1.uiSref:** Allow nested UISrefs by stopping event propagation on-click ([b4a2499](https://github.com/angular-ui/ui-router/commit/b4a2499)), closes [#2962](https://github.com/angular-ui/ui-router/issues/2962)
+* **ng1.uiSrefActive:** update sref-active after existing transition-in-progress completes ([0994c71](https://github.com/angular-ui/ui-router/commit/0994c71)), closes [#2908](https://github.com/angular-ui/ui-router/issues/2908)
+* **uiSref, uiState:** added click unbind to prevent memory leaks ([79d501e](https://github.com/angular-ui/ui-router/commit/79d501e))
+* **uiView:** separate $uiView and $uiViewAnim element.data() ([a94117d](https://github.com/angular-ui/ui-router/commit/a94117d)), closes [#2763](https://github.com/angular-ui/ui-router/issues/2763)
+
+#### ng2
+
+* **ng2.pushState:** Properly match urls when base path set ([b9be2dc](https://github.com/angular-ui/ui-router/commit/b9be2dc)), closes [#2745](https://github.com/angular-ui/ui-router/issues/2745)
+* **ng2.UIRouterConfig:** Allow new UIRouter() to finish before configuring it ([a151f71](https://github.com/angular-ui/ui-router/commit/a151f71))
+* **ng2.uiSrefActive:** Allow uiSrefActive on ancestor element. ([874fc07](https://github.com/angular-ui/ui-router/commit/874fc07)), closes [#2950](https://github.com/angular-ui/ui-router/issues/2950)
+* **ng2.uiSrefActive:** don't puke on sref to invalid target state ([c9b6570](https://github.com/angular-ui/ui-router/commit/c9b6570))
+* **ng2.UISrefActive:** Use [@ContentChildren](https://github.com/ContentChildren) to query for the nested UISref ([999c42a](https://github.com/angular-ui/ui-router/commit/999c42a)), closes [#2950](https://github.com/angular-ui/ui-router/issues/2950)
+* **ng2.UiView:** fix input resolve binding ([4f53f81](https://github.com/angular-ui/ui-router/commit/4f53f81))
+* **ng2.UIView:** Make routed to component appear *inside* UIView, not next to it. ([558fc80](https://github.com/angular-ui/ui-router/commit/558fc80))
+
+### BREAKING CHANGES:
+
+1) State Glob patterns have been changed slightly.
+
+Previously, a single wildcard `foo.*` could match "missing segments" on the end of a state name.
+For example, `foo.*` would match the state `foo`.
+Likewise, `foo.*.*.*` would also match the `foo` state.
+
+Now, a single wildcard matches exactly one segment.
+`foo.*` will match `foo.bar` and `foo.baz`, but neither `foo` nor `foo.bar.baz`.
+
+If you previously relied on the single wildcard to match missing segments, use a double wildcard, `foo.**`.
+
+Double wildcards match 0 or more segments.
+
+[Read more about Glob matching](https://ui-router.github.io/docs/latest/classes/common.glob.html)
+
+2) (obscure) Angular 1 DI token `ng1UIRouter` renamed to `$uiRouter`
+
+3) (obscure) Renamed `Transition.previous()` to `Transition.redirectedFrom()`
+
+
+
+# [1.0.0-beta.1 commits](https://github.com/angular-ui/ui-router/compare/1.0.0-alpha.5...1.0.0-beta.1) (2016-06-30)
+
+# UI-Router 1.0 is in beta
+
+## UI-Router has a new home!
+
+https://ui-router.github.io/new-ui-router-site/
+
+
+# BREAKING CHANGES
+
+These breaking changes are for users upgrading from a previous alpha, not from 0.x legacy series.
+This list is extensive, but typical users won't be affected by most of these changes.
+
+The most common breaks will be #1 and #2
+
+1) BC-BREAK: renamed all Ui* (lowercase 'i') symbols to UI* (uppercase 'I') for more consistent naming.
+ - UiView -> UIView
+ - UiSref -> UISref (and related directives)
+ - UiInjector -> UIInjector
+
+2) BC-BREAK: Transition Hooks are no longer injected (onBefore/onStart/onExit/onRetain/onEnter/onFinish/onSuccess/onError)
+
+ Previously, a hook like `['$state', ($state) => $state.target('foo')]` would get `$state` injected.
+ Now, all hooks receive two parameters:
+ - transition: the current Transition, which has an `injector()` function
+ - state: for onEnter/onRetain/onExit hooks only, the State which the hook is being run for. This value will be null for onBefore/onStart/onFinish/onSuccess/onError hooks.
+
+ Refactor your hooks
+ from: `['$state', 'mySvc', ($state, mySvc) => mySvc.foo() ? $state.target('foo')] : true`
+ to: `(trans) => trans.injector().get('mySvc').foo() ? trans.router.stateService.target('foo') : true`
+
+ Note: for backwards compatiblity, angular 1 onEnter/onExit/onRetain hooks are still injected
+
+3) BC-BREAK: - The (internal API) State object's .resolve property is now an array of Resolvables, built from your state definitions by the StateBuilder
+
+4) BC-BREAK: - Removed the default resolve called `$resolve$`, which was added in a previous alpha
+
+5) BC-BREAK: - `Transition.addResolves()` replaced with `Transition.addResolvable()`
+
+6) BC-BREAK: remove `ResolveContext.getResolvables()` in favor of `.getToken()`` and `.getResolvable()`
+
+7) BC-BREAK: remove `ResolveContext.invokeLater()` and `.invokeNow()`
+
+8) BC-BREAK: remove support for `JIT` resolves. This also eliminated the need for the `loadAllControllerLocals` hook which was also removed
+
+9) BC-BREAK: Replaced `ViewConfig.node` with `ViewConfig.path`. Angular 1's `$(element).data('$uiView')` is affected.
+ Previously the .node was the node for the view. Now the last element in the path is the node for the view.
+
+10) BC-BREAK: Nodes no longer have (stateful) `.resolveContext` properties. Instead, a new ResolveContext is wrapped over a Path of Nodes. Removed `PathFactory.bindResolveContexts()`.
+
+11) BC-BREAK: ResolveContext.resolvePath returns a promise for resolved data as an array of tuples, instead of a promise for an object of resolved data. Removed `ResolveContext.resolvePathElement()`.
+
+12) BC-BREAK: Removed ResolvePolicy enum in favor of the ResolvePolicy interface `{ when: "", async: "" }`
+
+13) BC-BREAK: renamed `ResolveContext.isolateRootTo` to `subContext`
+
+14) BC-BREAK: rename `UIRouterGlobals` class to `Globals`; add `UIRouterGlobals` back as an interface
+
+15) BC-BREAK: Moved `defaultErrorHandler` from `TransitionService` to `StateService`
+
+
+
+
+### Features
+
+* **Resolve:** Switch state.resolve to be an array of Resolvables ([6743a60](https://github.com/angular-ui/ui-router/commit/6743a60))
+* **Resolve:** support ng2-like provide object literals. Support injection of arbitrary tokens, not just strings. ([a7e5ea6](https://github.com/angular-ui/ui-router/commit/a7e5ea6))
+* **Resolve:** support ng2-like provide object literals ([a7e5ea6](https://github.com/angular-ui/ui-router/commit/a7e5ea6))
+* **Transition:** expose the current `UiRouter` object as a public property ([52f1308](https://github.com/angular-ui/ui-router/commit/52f1308))
+* **redirectTo:** Process `redirectTo` property of a state as a redirect string/object/hook function ([6becb12](https://github.com/angular-ui/ui-router/commit/6becb12)), closes [#27](https://github.com/angular-ui/ui-router/issues/27) [#948](https://github.com/angular-ui/ui-router/issues/948)
+* **rejectFactory:** separate transition aborted and transition errored reject types ([55995fd](https://github.com/angular-ui/ui-router/commit/55995fd))
+* **ParamType:** allow a custom parameter Type to specify a default value for a parameter's `dynamic` property
+* **Resolvable:** Added a new Resolve Policy 'RXWAIT'. If an Observable is returned, pass the observable as the value, but also wait for it to emit its first value
+
+### Bug Fixes
+
+* **ng2.pushState:** Properly match urls when base path set ([b9be2dc](https://github.com/angular-ui/ui-router/commit/b9be2dc)), closes [#2745](https://github.com/angular-ui/ui-router/issues/2745)
+* **ng2.UIRouterConfig:** Allow new UIRouter() to finish before configuring it ([a151f71](https://github.com/angular-ui/ui-router/commit/a151f71))
+* **ng2.UiView:** fix input resolve binding ([4f53f81](https://github.com/angular-ui/ui-router/commit/4f53f81))
+* **ng2.UIView:** Make routed to component appear *inside* UIView, not next to it. ([558fc80](https://github.com/angular-ui/ui-router/commit/558fc80))
+* **redirect:** fix bug where redirected transitions with reload: true got wrong resolve values copied ([bd0e3a3](https://github.com/angular-ui/ui-router/commit/bd0e3a3))
+* **Rejection:** Silence "Error: Uncaught (in Exception)" ([38432f4](https://github.com/angular-ui/ui-router/commit/38432f4)), closes [#2676](https://github.com/angular-ui/ui-router/issues/2676)
+* **Trace:** Fix error in console after $trace.enable() ([013c77a](https://github.com/angular-ui/ui-router/commit/013c77a)), closes [#2752](https://github.com/angular-ui/ui-router/issues/2752)
+* **ng2.UIView:** Trigger change detection once for routed components
+
+
+
+
+
+# [1.0.0-alpha.5 commits](https://github.com/angular-ui/ui-router/compare/1.0.0-alpha.4...1.0.0-alpha.5) (2016-05-13)
+
+
+### Bug Fixes
+
+## Core
+* **attachRoute:** Do not update URL after syncing from url([8742511](https://github.com/angular-ui/ui-router/commit/8742511)), closes [#2730](https://github.com/angular-ui/ui-router/issues/2730)
+* **common:** only use window if available([32ff988](https://github.com/angular-ui/ui-router/commit/32ff988))
+* **coreservices:** Use Promise.reject()/resolve()/all()([62b2ebc](https://github.com/angular-ui/ui-router/commit/62b2ebc)), closes [#2683](https://github.com/angular-ui/ui-router/issues/2683)
+* **paramTypes.hash:** Update hash for each transition([79d4fd7](https://github.com/angular-ui/ui-router/commit/79d4fd7)), closes [#2742](https://github.com/angular-ui/ui-router/issues/2742)
+* **Rejection:** Dont log an ignored trans as console.error([7522c26](https://github.com/angular-ui/ui-router/commit/7522c26)), closes [#2676](https://github.com/angular-ui/ui-router/issues/2676)
+* **resolve:** Fix regression; Allow resolve values to be service names([a34fd3b](https://github.com/angular-ui/ui-router/commit/a34fd3b)), closes [#2588](https://github.com/angular-ui/ui-router/issues/2588)
+* **StateQueueManager:** Do not throw on orphan states.([95ae0cf](https://github.com/angular-ui/ui-router/commit/95ae0cf)), closes [#2546](https://github.com/angular-ui/ui-router/issues/2546)
+* **TransitionManager:** Update url even when the Transition is ignored.([f9c3e3c](https://github.com/angular-ui/ui-router/commit/f9c3e3c)), closes [#2723](https://github.com/angular-ui/ui-router/issues/2723)
+
+## ng1
+* **ng1.component:** Allow route-to-component "@" and optional bindings([71b3393](https://github.com/angular-ui/ui-router/commit/71b3393)), closes [#2708](https://github.com/angular-ui/ui-router/issues/2708)
+* **view:** only run ng1 route-to-component code if component: is a string([ec1c534](https://github.com/angular-ui/ui-router/commit/ec1c534))
+
+## ng2
+* **ng2.uiSrefStatus:** Avoid "dehydrated detector" error([9111727](https://github.com/angular-ui/ui-router/commit/9111727)), closes [#2684](https://github.com/angular-ui/ui-router/issues/2684)
+* **ng2.uiView:** Fix "Invalid left-hand in assignment"([3f711a1](https://github.com/angular-ui/ui-router/commit/3f711a1))
+* **build:** declare external dep on `angular/core` in webpack bundle([adfbde3](https://github.com/angular-ui/ui-router/commit/adfbde3)), closes [#2687](https://github.com/angular-ui/ui-router/issues/2687)
+
+
+
+### Features
+
+## ng2
+* **ng2.uiView:** bind resolve data to input[] and [@Input](https://github.com/Input)(), process bindings:([f6dae28](https://github.com/angular-ui/ui-router/commit/f6dae28))
+* **ng2.urlRouter:** HTML5 PushState support([9842fb7](https://github.com/angular-ui/ui-router/commit/9842fb7)), closes [#2688](https://github.com/angular-ui/ui-router/issues/2688)
+* **ng2.UIRouter:** update to ng2 beta.17([45c0758](https://github.com/angular-ui/ui-router/commit/45c0758))
+* **ng2.UIRouter:** Update ui-router for ng2 rc.1([3219406](https://github.com/angular-ui/ui-router/commit/3219406)), closes [#2722](https://github.com/angular-ui/ui-router/issues/2722)
+
+
+
+
+# [1.0.0-alpha.4 commits](https://github.com/angular-ui/ui-router/compare/1.0.0-alpha.3...1.0.0-alpha.4) (2016-04-06)
+
+### Bug Fixes
+
+* **ng2.uiView:** Fix "Invalid left-hand in assignment" ([3f711a1](https://github.com/angular-ui/ui-router/commit/3f711a1))
+* **view:** only run ng1 route-to-component code if component: is a string ([ec1c534](https://github.com/angular-ui/ui-router/commit/ec1c534))
+
+### Features
+
+* **uiView:** add support for hybrid ng1/ng2 ui-router apps via ng-upgrade and http://github.com/ui-router/ng1-to-ng2
+* **ng2.uiView:** bind resolve data to input[] and @Input(), process bindings: ([f6dae28](https://github.com/angular-ui/ui-router/commit/f6dae28))
+
+
+
+
+# [1.0.0-alpha.2](https://github.com/angular-ui/ui-router/compare/1.0.0-alpha.1...v1.0.0-alpha.2) (2016-04-03)
+
+Changes between 1.0.0-alpha.1 and 1.0.0-alpha.2
+
+## Angular 2
+This is the first release with angular 2 support. See http://github.com/ui-router/quickstart-ng2 for a small ui-router-ng2 app
+
+### Bug Fixes
+
+* **ViewHooks:** Avoid calling $onInit if angular 1.5 will call it for us ([d42b617](https://github.com/angular-ui/ui-router/commit/d42b617)), closes [#2660](https://github.com/angular-ui/ui-router/issues/2660)
+* **ViewHooks:** Fix problem with injecting uiCanExit ([76ab22d](https://github.com/angular-ui/ui-router/commit/76ab22d)), closes [#2661](https://github.com/angular-ui/ui-router/issues/2661)
+* **view:** temporary sanity check that a node exists ([1c0edeb](https://github.com/angular-ui/ui-router/commit/1c0edeb)), closes [#2657](https://github.com/angular-ui/ui-router/issues/2657)
+* **justjs.$q:** Fix $q.all([..]) and $q.all({...}) ([b1624c6](https://github.com/angular-ui/ui-router/commit/b1624c6))
+* **ng2.uiSref:** Fix anchor href generation ([98b5b42](https://github.com/angular-ui/ui-router/commit/98b5b42))
+* **ng2.uiSrefStatus:** calculate target state parameters ([46cdf4c](https://github.com/angular-ui/ui-router/commit/46cdf4c))
+* **ng2.uiView:** Dispose prev comp on empty viewconfig ([f28e0c3](https://github.com/angular-ui/ui-router/commit/f28e0c3))
+
+### Features
+
+* **UIRouterConfig:** Define UIRouterConfig class for router bootstrap ([c16b9e6](https://github.com/angular-ui/ui-router/commit/c16b9e6))
+* **UIRouterGlobals:** Create UIRouterGlobals ([0eb7406](https://github.com/angular-ui/ui-router/commit/0eb7406)), closes [#2525](https://github.com/angular-ui/ui-router/issues/2525)
+* **ui-router-ng2:** Update providers and viewsBuilder to match new 1.0 API ([ff54d61](https://github.com/angular-ui/ui-router/commit/ff54d61))
+* **ng2.uiSrefActive:** Implement uiSrefStatus, uiSrefActive, uiSrefActiveEq ([fcb15c5](https://github.com/angular-ui/ui-router/commit/fcb15c5))
+
+
+
+
+# [1.0.0-alpha.1 commits](https://github.com/angular-ui/ui-router/compare/1.0.0alpha0...1.0.0-alpha.1) (2016-03-27)
+
+## We will maintain a list of [Known BC from 0.2.x to 1.0 final](https://github.com/angular-ui/ui-router/issues/2219) to help people upgrade to the 1.0 release.
+
+## Bug fixes and features since 1.0.0alpha0
+
+### Bug Fixes
+
+* **date:** Compare dates only using year, month, date ([7a68ade](https://github.com/angular-ui/ui-router/commit/7a68ade)), closes [#2484](https://github.com/angular-ui/ui-router/issues/2484)
+* **params:** Clone all properties of a Node. Introduce applyRawParams() ([88c624d](https://github.com/angular-ui/ui-router/commit/88c624d))
+* **RejectFactory:** stringify rejections with circular dependency-aware stringify ([199db79](https://github.com/angular-ui/ui-router/commit/199db79)), closes [#2538](https://github.com/angular-ui/ui-router/issues/2538)
+* **src/resolve:** use injector's strictDi value in calls to .annotate ([4c5b5d8](https://github.com/angular-ui/ui-router/commit/4c5b5d8))
+* **stateQueueManager:** Use `location: true` for url-matched transitions ([25e0c04](https://github.com/angular-ui/ui-router/commit/25e0c04)), closes [#2455](https://github.com/angular-ui/ui-router/issues/2455)
+* **stateService:** Process reload: in the StateService.target() ([081da32](https://github.com/angular-ui/ui-router/commit/081da32)), closes [#2537](https://github.com/angular-ui/ui-router/issues/2537)
+* **Transition:** Do not reuse resolves for reloaded state during redirect ([0c123c3](https://github.com/angular-ui/ui-router/commit/0c123c3)), closes [#2539](https://github.com/angular-ui/ui-router/issues/2539)
+* **Transition:** Reject Transition promise when onBefore error ([4b6d56f](https://github.com/angular-ui/ui-router/commit/4b6d56f)), closes [#2561](https://github.com/angular-ui/ui-router/issues/2561)
+* **Transition:** Reset URL to current state after aborted transition ([3a1308b](https://github.com/angular-ui/ui-router/commit/3a1308b)), closes [#2611](https://github.com/angular-ui/ui-router/issues/2611)
+* **transition/transitionService:** uses console.error to log error in default error handler ([43a8fc5](https://github.com/angular-ui/ui-router/commit/43a8fc5))
+* **ui-sref:** update ui-sref-active/eq info when params change ([dcbaebf](https://github.com/angular-ui/ui-router/commit/dcbaebf)), closes [#2554](https://github.com/angular-ui/ui-router/issues/2554)
+* **ui-state:** update ui-sref-active/eq info ([025ebc8](https://github.com/angular-ui/ui-router/commit/025ebc8)), closes [#2488](https://github.com/angular-ui/ui-router/issues/2488)
+* **UrlMatcher:** Format parent/child UrlMatchers properly ([86e07ef](https://github.com/angular-ui/ui-router/commit/86e07ef)), closes [##2504](https://github.com/#/issues/2504)
+* **UrlMatcher:** isOptional always false for empty parameter ([4e85db4](https://github.com/angular-ui/ui-router/commit/4e85db4))
+
+### Features
+
+* **params:** Add uiOnParamsChanged controller callback ([961c96d](https://github.com/angular-ui/ui-router/commit/961c96d)), closes [#2608](https://github.com/angular-ui/ui-router/issues/2608) [#2470](https://github.com/angular-ui/ui-router/issues/2470) [#2391](https://github.com/angular-ui/ui-router/issues/2391) [#1967](https://github.com/angular-ui/ui-router/issues/1967)
+* **resolve:** Allow all resolved data for a node to be injected as `$resolve$` ([e432c27](https://github.com/angular-ui/ui-router/commit/e432c27))
+* **state:** Expose the internal state API via `$$state()` ([92053f1](https://github.com/angular-ui/ui-router/commit/92053f1)), closes [#13](https://github.com/angular-ui/ui-router/issues/13)
+* **ui-router-ng2:** Initial angular2 support ([217de70](https://github.com/angular-ui/ui-router/commit/217de70))
+* **uiCanExit:** Add controller lifecycle hook "uiCanExit" ([afcfe95](https://github.com/angular-ui/ui-router/commit/afcfe95))
+* **uiView:** Expose the resolved data for a state as $scope.$resolve ([0f6aea6](https://github.com/angular-ui/ui-router/commit/0f6aea6)), closes [#2175](https://github.com/angular-ui/ui-router/issues/2175) [#2547](https://github.com/angular-ui/ui-router/issues/2547)
+* **uiView:** Fire the $onInit hook ([c8afc38](https://github.com/angular-ui/ui-router/commit/c8afc38)), closes [#2559](https://github.com/angular-ui/ui-router/issues/2559)
+* **uiView:** Put $animate promises on element.data('$uiView') ([a5578de](https://github.com/angular-ui/ui-router/commit/a5578de)), closes [#2562](https://github.com/angular-ui/ui-router/issues/2562) [#2579](https://github.com/angular-ui/ui-router/issues/2579)
+* **view:** Route a view to a directive using `component:` ([1552032](https://github.com/angular-ui/ui-router/commit/1552032)), closes [#2627](https://github.com/angular-ui/ui-router/issues/2627)
+
+
+
+## Other commits
+
+Many of these commits are merged from 0.2.x `legacy` branch
+
+* **uiSrefActive:** allow multiple classes ([120d7ad](https://github.com/angular-ui/ui-router/commit/120d7ad)), closes [#2481](https://github.com/angular-ui/ui-router/issues/2481) [#2482](https://github.com/angular-ui/ui-router/issues/2482)
+* **justjs:** provide naive implementation of most of the coreservices api ([426f134](https://github.com/angular-ui/ui-router/commit/426f134))
+* **resolve:** add $resolve service back to 1.0 ([70c6659](https://github.com/angular-ui/ui-router/commit/70c6659))
+* **uiSrefActive:** allow active & active-eq on same element ([d9a676b](https://github.com/angular-ui/ui-router/commit/d9a676b)), closes [#1997](https://github.com/angular-ui/ui-router/issues/1997)
+* **uiSrefActive:** provide a ng-{class,style} like interface ([a9ff6fe](https://github.com/angular-ui/ui-router/commit/a9ff6fe)), closes [#1431](https://github.com/angular-ui/ui-router/issues/1431)
+* **uiSrefActive:** Added support for multiple nested uiSref directives ([b184494](https://github.com/angular-ui/ui-router/commit/b184494))
+* **uiState:** add ui-state directive ([3831af1](https://github.com/angular-ui/ui-router/commit/3831af1)), closes [#395](https://github.com/angular-ui/ui-router/issues/395) [#900](https://github.com/angular-ui/ui-router/issues/900) [#1932](https://github.com/angular-ui/ui-router/issues/1932)
+* **urlMatcher:** add support for optional spaces ([4b7f304](https://github.com/angular-ui/ui-router/commit/4b7f304))
+* **urlMatcher:** Add param only type names ([6a371f9](https://github.com/angular-ui/ui-router/commit/6a371f9))
+* **$IncludedByStateFilter:** add parameters to $IncludedByStateFilter ([963f6e7](https://github.com/angular-ui/ui-router/commit/963f6e7)), closes [#1735](https://github.com/angular-ui/ui-router/issues/1735)
+* **$state:** make state data inheritance prototypical ([c4fec8c](https://github.com/angular-ui/ui-router/commit/c4fec8c))
+* **$state:** Inject templateProvider with resolved values ([afa20f2](https://github.com/angular-ui/ui-router/commit/afa20f2))
+* **$state:** added 'state' to state reload method (feat no.1612) ([b8f0457](https://github.com/angular-ui/ui-router/commit/b8f0457))
+* **$state:** broadcast $stateChangeCancel event when event.preventDefault() is called in $sta ([ecefb75](https://github.com/angular-ui/ui-router/commit/ecefb75))
+* **$state:** inject resolve params into controllerProvider ([b380c22](https://github.com/angular-ui/ui-router/commit/b380c22)), closes [#1131](https://github.com/angular-ui/ui-router/issues/1131)
+* **$state:** support URLs with #fragments ([3da0a17](https://github.com/angular-ui/ui-router/commit/3da0a17))
+* **$uiViewScroll:** change function to return promise ([c2a9a31](https://github.com/angular-ui/ui-router/commit/c2a9a31)), closes [#1702](https://github.com/angular-ui/ui-router/issues/1702)
+
+
+
+
+### 0.2.18 (2016-02-07)
+
+This is a maintenance release which fixes a few known bugs introduced in 0.2.16.
+
+#### Bug Fixes
+
+* **$urlRouter:** revert BC: resolve clashing of routes This reverts commit b5c57c8ec2e14e17e75104 ([2f1ebefc](https://github.com/angular-ui/ui-router/commit/2f1ebefc242ff48960e0bf63da359296a38f6852), closes [#2501](https://github.com/angular-ui/ui-router/issues/2501))
+* **uiState:** Corrected typo for 'ref' variable (#2488, #2508) ([b8f3c144](https://github.com/angular-ui/ui-router/commit/b8f3c144b913e620f177b78f3b4f52afa61d41a6))
+* **$urlMatcherFactory:** Fix to make the YUI Javascript compressor work ([ad9c41d2](https://github.com/angular-ui/ui-router/commit/ad9c41d2e723d50e30dd3452fbd274b7057dc3d9))
+* **stateBuilder:** fix non-url params on a state without a url. The parameters are now applied when ([d6d8c332](https://github.com/angular-ui/ui-router/commit/d6d8c3322c4dde8bb5b8dde25f9fcda49e9c4c81), closes [#2025](https://github.com/angular-ui/ui-router/issues/2025))
+* **ui-view:** (ui-view) use static renderer when no animation is present for a ui-view ([2523bbdb](https://github.com/angular-ui/ui-router/commit/2523bbdb5542483a489c22804f1751b8b9f71703), closes [#2485](https://github.com/angular-ui/ui-router/issues/2485)). This allows a ui-view scope to be destroyed when switching states, before the next view is initialized.
+
+
+#### Features
+
+* **ui-view:** Add noanimation attribute to specify static renderer. ([2523bbdb](https://github.com/angular-ui/ui-router/commit/2523bbdb5542483a489c22804f1751b8b9f71703), closes [#2485](https://github.com/angular-ui/ui-router/issues/2485)). This allows a ui-view scope to be destroyed before the next ui-view is initialized, when ui-view animation is not present.
+
+
+
+### 0.2.17 (2016-01-25)
+
+
+#### Bug Fixes
+
+* **uiSrefActive:** allow multiple classes ([a89114a0](https://github.com/angular-ui/ui-router/commit/a89114a083813c1a7280c48fc18e626caa5a31f4), closes [#2481](https://github.com/angular-ui/ui-router/issues/2481), [#2482](https://github.com/angular-ui/ui-router/issues/2482))
+
+
+
+### 0.2.16 (2016-01-24)
+
+
+#### Bug Fixes
+
+* **$state:**
+ * statechangeCancel: Avoid infinite digest in .otherwise/redirect case. Don't clobber url if a new transition has started. Closes #222 ([e00aa695](https://github.com/angular-ui/ui-router/commit/e00aa695e41ddc5ebd5d2b226aa0917a751b11aa), closes [#2238](https://github.com/angular-ui/ui-router/issues/2238))
+ * transitionTo: Allow hash (#) value to be read as toParams['#'] in events. Re-add the saved hash before broadcasting $stateChangeStart event. ([8c1bf30d](https://github.com/angular-ui/ui-router/commit/8c1bf30d2a3b78ba40b330f12d854c885d6cc117))
+* **$stateParams:** Fix for testing: reset service instance between tests ([2aeb0c4b](https://github.com/angular-ui/ui-router/commit/2aeb0c4b205baf6cfa2ef25bb986bb160dc13bf9))
+* **$urlRouter:**
+ * Sort URL rules by specificity. Potential minor BC if apps were relying on rule registration order. ([b5c57c8e](https://github.com/angular-ui/ui-router/commit/b5c57c8ec2e14e17e75104c1424654f126ea4011))
+ * Use $sniffer for pushstate compat check ([c219e801](https://github.com/angular-ui/ui-router/commit/c219e801797f340ef9c5c919ab890ef003a7a042))
+* **UrlMatcher:**
+ * Properly encode/decode slashes in parameters Closes #2172 Closes #2250 Closes #1 ([02e98660](https://github.com/angular-ui/ui-router/commit/02e98660a80dfd1ca4b113dd24ee304af91e9f8c), closes [#2339](https://github.com/angular-ui/ui-router/issues/2339))
+ * Array types: Fix default value for array query parameters. Pass empty arrays through in handler. ([20d6e243](https://github.com/angular-ui/ui-router/commit/20d6e243f1745ddbf257217245a1dc22eabe13da), closes [#2222](https://github.com/angular-ui/ui-router/issues/2222))
+ * Remove trailing slash, if parameter is optional and was squashed from URL ([77fa11bf](https://github.com/angular-ui/ui-router/commit/77fa11bf0787d0f6da97ab0003ab29afb7411391), closes [#1902](https://github.com/angular-ui/ui-router/issues/1902))
+ * Allow a parameter declaration to configure the parameter type by name. closes #2294 ([e4010249](https://github.com/angular-ui/ui-router/commit/e40102492d40fe1cf6ba14d955fcc9f345c16458))
+ * include the slash when recognizing squashed params in url ([b5130bb1](https://github.com/angular-ui/ui-router/commit/b5130bb1215e15f832ea6daa670410b9a950c0d4), closes [#2064](https://github.com/angular-ui/ui-router/issues/2064))
+ * Allow url query param names to contain periods ([d31b3337](https://github.com/angular-ui/ui-router/commit/d31b3337cc2ce71d87c92fdded629e46558d0b49))
+* **reloadOnSearch:** Update `locals.globals.$stateParams` when reloadOnSearch=false ([350d3e87](https://github.com/angular-ui/ui-router/commit/350d3e87783a2263fd7d23913da34f1268c3300b), closes [#2356](https://github.com/angular-ui/ui-router/issues/2356))
+* **ui-view:**
+ * fix $animate usage for ng 1.4+ ([9b6d9a2d](https://github.com/angular-ui/ui-router/commit/9b6d9a2d0ce4ae08384165cb517bddea59b67892))
+ * change $viewContentLoading to pair with $viewContentLoaded ([f9b43d66](https://github.com/angular-ui/ui-router/commit/f9b43d66833f0e17de41fd8d1cc3b491e3ba4a0e), closes [#685](https://github.com/angular-ui/ui-router/issues/685))
+ * $destroy event is triggered before animation ends ([1be13795](https://github.com/angular-ui/ui-router/commit/1be13795686ab78abb2d5094bc8addcacb928975))
+* **uiSref:**
+ * Ensure URL once param checks pass ([9dc31c54](https://github.com/angular-ui/ui-router/commit/9dc31c5465328e5666468b0c2319ce205f4b72f8), closes [#2091](https://github.com/angular-ui/ui-router/issues/2091))
+ * uiSrefActive: update the active classes after linking directive ([7c914030](https://github.com/angular-ui/ui-router/commit/7c914030f13e05e45a941c1b723cb785db729890))
+
+
+#### Features
+
+* **$IncludedByStateFilter:** add parameters to $IncludedByStateFilter ([963f6e71](https://github.com/angular-ui/ui-router/commit/963f6e71633b9c3a266f3991d79089b7d14786b4), closes [#1735](https://github.com/angular-ui/ui-router/issues/1735))
+* **isStateFilter:** Include optional state params. ([71d74699](https://github.com/angular-ui/ui-router/commit/71d7469987ee9ca86a41c8c6393ccd5d8913c3d6))
+* **$state:** make state data inheritance prototypical ([c4fec8c7](https://github.com/angular-ui/ui-router/commit/c4fec8c7998113902af4152d716c42dada6eb465))
+* **$stateChangeStart:** Add options to event ([a1f07559](https://github.com/angular-ui/ui-router/commit/a1f07559ec74e10ff80bc4be81f287e3772b8fcb))
+* **UrlMatcher:** Add param only type names ([6a371f9b](https://github.com/angular-ui/ui-router/commit/6a371f9b70e37a82eb324122879e4473c3f6d526))
+* **uiSrefActive:**
+ * provide a ng-{class,style} like interface ([a9ff6feb](https://github.com/angular-ui/ui-router/commit/a9ff6febb469e0d5cd49054216c4472df7a6259d))
+ * allow active & active-eq on same element ([d9a676ba](https://github.com/angular-ui/ui-router/commit/d9a676ba2c4d9e954be224c60496bcb38f6074e3))
+* **uiState:** add ui-state directive ([3831af1d](https://github.com/angular-ui/ui-router/commit/3831af1dc71b601351e6694af0665a77297f8f7f), closes [#395](https://github.com/angular-ui/ui-router/issues/395), [#900](https://github.com/angular-ui/ui-router/issues/900), [#1932](https://github.com/angular-ui/ui-router/issues/1932))
+* **urlMatcher:** add support for optional spaces in params ([4b7f3046](https://github.com/angular-ui/ui-router/commit/4b7f304617f0b3590b532103b5c2fb526c98a9e4))
+
+
+
+### 0.2.15 (2015-05-19)
+
+
+#### Bug Fixes
+
+* **$state:** reloadOnSearch should not affect non-search param changes. ([6ca0d770](https://github.com/angular-ui/ui-router/commit/6ca0d7704cf7de9c6e6b7bb64df2f9c68fe081cc), closes [#1079](https://github.com/angular-ui/ui-router/issues/1079))
+* **urlMatcherFactory:** Revert to 0.2.13 behavior where all string parameters are considered optional fi ([495a02c3](https://github.com/angular-ui/ui-router/commit/495a02c3cbde501c1c149bce137806669209bc29), closes [#1963](https://github.com/angular-ui/ui-router/issues/1963))
+* **urlRouter:** allow .when() to redirect, even after a successful $state.go() - This partially ([48aeaff6](https://github.com/angular-ui/ui-router/commit/48aeaff645baf3f42f5a8940ebd97563791ad9f8), closes [#1584](https://github.com/angular-ui/ui-router/issues/1584))
+
+
+#### Features
+
+* **$state:** Inject templateProvider with resolved values ([afa20f22](https://github.com/angular-ui/ui-router/commit/afa20f22373b7176b26daa7e1099750c4254a354))
+
+
+
+### 0.2.14 (2015-04-23)
+
+
+#### Bug Fixes
+
+* **$StateRefDirective:** resolve missing support for svg anchor elements #1667 ([0149a7bb](https://github.com/angular-ui/ui-router/commit/0149a7bb38b7af99388a1ad7cc9909a7b7c4439d))
+* **$urlMatcherFactory:**
+ * regex params should respect case-sensitivity ([1e10519f](https://github.com/angular-ui/ui-router/commit/1e10519f3be6bbf0cefdcce623cd2ade06e649e5), closes [#1671](https://github.com/angular-ui/ui-router/issues/1671))
+ * unquote all dashes from array params ([06664d33](https://github.com/angular-ui/ui-router/commit/06664d330f882390655dcfa83e10276110d0d0fa))
+ * add Type.$normalize function ([b0c6aa23](https://github.com/angular-ui/ui-router/commit/b0c6aa2350fdd3ce8483144774adc12f5a72b7e9))
+ * make optional params regex grouping optional ([06f73794](https://github.com/angular-ui/ui-router/commit/06f737945e83e668d09cfc3bcffd04a500ff1963), closes [#1576](https://github.com/angular-ui/ui-router/issues/1576))
+* **$state:** allow about.*.** glob patterns ([e39b27a2](https://github.com/angular-ui/ui-router/commit/e39b27a2cb7d88525c446a041f9fbf1553202010))
+* **uiSref:**
+ * use Object's toString instead of Window's toString ([2aa7f4d1](https://github.com/angular-ui/ui-router/commit/2aa7f4d139dbd5b9fcc4afdcf2ab6642c87f5671))
+ * add absolute to allowed transition options ([ae1b3c4e](https://github.com/angular-ui/ui-router/commit/ae1b3c4eedc37983400d830895afb50457c63af4))
+* **uiSrefActive:** Apply active classes on lazy loaded states ([f0ddbe7b](https://github.com/angular-ui/ui-router/commit/f0ddbe7b4a91daf279c3b7d0cee732bb1f3be5b4))
+* **uiView:** add `$element` to locals for view controller ([db68914c](https://github.com/angular-ui/ui-router/commit/db68914cd6c821e7dec8155bd33142a3a97f5453))
+
+
+#### Features
+
+* **$state:**
+ * support URLs with #fragments ([3da0a170](https://github.com/angular-ui/ui-router/commit/3da0a17069e27598c0f9d9164e104dd5ce05cdc6))
+ * inject resolve params into controllerProvider ([b380c223](https://github.com/angular-ui/ui-router/commit/b380c223fe12e2fde7582c0d6b1ed7b15a23579b), closes [#1131](https://github.com/angular-ui/ui-router/issues/1131))
+ * added 'state' to state reload method (feat no.1612) - modiefied options.reload ([b8f04575](https://github.com/angular-ui/ui-router/commit/b8f04575a8557035c1858c4d5c8dbde3e1855aaa))
+ * broadcast $stateChangeCancel event when event.preventDefault() is called in $sta ([ecefb758](https://github.com/angular-ui/ui-router/commit/ecefb758cb445e41620b62a272aafa3638613d7a))
+* **$uiViewScroll:** change function to return promise ([c2a9a311](https://github.com/angular-ui/ui-router/commit/c2a9a311388bb212e5a2e820536d1d739f829ccd), closes [#1702](https://github.com/angular-ui/ui-router/issues/1702))
+* **uiSrefActive:** Added support for multiple nested uiSref directives ([b1844948](https://github.com/angular-ui/ui-router/commit/b18449481d152b50705abfce2493a444eb059fa5))
+
+
+
+### 0.2.13 (2014-11-20)
+
+This release primarily fixes issues reported against 0.2.12
+
+#### Bug Fixes
+
+* **$state:** fix $state.includes/.is to apply param types before comparisions fix(uiSref): ma ([19715d15](https://github.com/angular-ui/ui-router/commit/19715d15e3cbfff724519e9febedd05b49c75baa), closes [#1513](https://github.com/angular-ui/ui-router/issues/1513))
+ * Avoid re-synchronizing from url after .transitionTo ([b267ecd3](https://github.com/angular-ui/ui-router/commit/b267ecd348e5c415233573ef95ebdbd051875f52), closes [#1573](https://github.com/angular-ui/ui-router/issues/1573))
+* **$urlMatcherFactory:**
+ * Built-in date type uses local time zone ([d726bedc](https://github.com/angular-ui/ui-router/commit/d726bedcbb5f70a5660addf43fd52ec730790293))
+ * make date type fn check .is before running ([aa94ce3b](https://github.com/angular-ui/ui-router/commit/aa94ce3b86632ad05301530a2213099da73a3dc0), closes [#1564](https://github.com/angular-ui/ui-router/issues/1564))
+ * early binding of array handler bypasses type resolution ([ada4bc27](https://github.com/angular-ui/ui-router/commit/ada4bc27df5eff3ba3ab0de94a09bd91b0f7a28c))
+ * add 'any' Type for non-encoding non-url params ([3bfd75ab](https://github.com/angular-ui/ui-router/commit/3bfd75ab445ee2f1dd55275465059ed116b10b27), closes [#1562](https://github.com/angular-ui/ui-router/issues/1562))
+ * fix encoding slashes in params ([0c983a08](https://github.com/angular-ui/ui-router/commit/0c983a08e2947f999683571477debd73038e95cf), closes [#1119](https://github.com/angular-ui/ui-router/issues/1119))
+ * fix mixed path/query params ordering problem ([a479fbd0](https://github.com/angular-ui/ui-router/commit/a479fbd0b8eb393a94320973e5b9a62d83912ee2), closes [#1543](https://github.com/angular-ui/ui-router/issues/1543))
+* **ArrayType:**
+ * specify empty array mapping corner case ([74aa6091](https://github.com/angular-ui/ui-router/commit/74aa60917e996b0b4e27bbb4eb88c3c03832021d), closes [#1511](https://github.com/angular-ui/ui-router/issues/1511))
+ * fix .equals for array types ([5e6783b7](https://github.com/angular-ui/ui-router/commit/5e6783b77af9a90ddff154f990b43dbb17eeda6e), closes [#1538](https://github.com/angular-ui/ui-router/issues/1538))
+* **Param:** fix default value shorthand declaration ([831d812a](https://github.com/angular-ui/ui-router/commit/831d812a524524c71f0ee1c9afaf0487a5a66230), closes [#1554](https://github.com/angular-ui/ui-router/issues/1554))
+* **common:** fixed the _.filter clone to not create sparse arrays ([750f5cf5](https://github.com/angular-ui/ui-router/commit/750f5cf5fd91f9ada96f39e50d39aceb2caf22b6), closes [#1563](https://github.com/angular-ui/ui-router/issues/1563))
+* **ie8:** fix calls to indexOf and filter ([dcb31b84](https://github.com/angular-ui/ui-router/commit/dcb31b843391b3e61dee4de13f368c109541813e), closes [#1556](https://github.com/angular-ui/ui-router/issues/1556))
+
+
+#### Features
+
+* add json parameter Type ([027f1fcf](https://github.com/angular-ui/ui-router/commit/027f1fcf9c0916cea651e88981345da6f9ff214a))
+
+
+
+### 0.2.12 (2014-11-13)
+
+#### Bug Fixes
+
+* **$resolve:** use resolve fn result, not parent resolved value of same name ([67f5e00c](https://github.com/angular-ui/ui-router/commit/67f5e00cc9aa006ce3fe6cde9dff261c28eab70a), closes [#1317], [#1353])
+* **$state:**
+ * populate default params in .transitionTo. ([3f60fbe6](https://github.com/angular-ui/ui-router/commit/3f60fbe6d65ebeca8d97952c05aa1d269f1b7ba1), closes [#1396])
+ * reload() now reinvokes controllers ([73443420](https://github.com/angular-ui/ui-router/commit/7344342018847902594dc1fc62d30a5c30f01763), closes [#582])
+ * do not emit $viewContentLoading if notify: false ([74255feb](https://github.com/angular-ui/ui-router/commit/74255febdf48ae082a02ca1e735165f2c369a463), closes [#1387](https://github.com/angular-ui/ui-router/issues/1387))
+ * register states at config-time ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a))
+ * handle parent.name when parent is obj ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a))
+* **$urlMatcherFactory:**
+ * register types at config ([4533fe36](https://github.com/angular-ui/ui-router/commit/4533fe36e0ab2f0143edd854a4145deaa013915a), closes [#1476])
+ * made path params default value "" for backwards compat ([8f998e71](https://github.com/angular-ui/ui-router/commit/8f998e71e43a0b31293331c981f5db0f0097b8ba))
+ * Pre-replace certain param values for better mapping ([6374a3e2](https://github.com/angular-ui/ui-router/commit/6374a3e29ab932014a7c77d2e1ab884cc841a2e3))
+ * fixed ParamSet.$$keys() ordering ([9136fecb](https://github.com/angular-ui/ui-router/commit/9136fecbc2bfd4fda748a9914f0225a46c933860))
+ * empty string policy now respected in Param.value() ([db12c85c](https://github.com/angular-ui/ui-router/commit/db12c85c16f2d105415f9bbbdeb11863f64728e0))
+ * "string" type now encodes/decodes slashes ([3045e415](https://github.com/angular-ui/ui-router/commit/3045e41577a8b8b8afc6039f42adddf5f3c061ec), closes [#1119])
+ * allow arrays in both path and query params ([fdd2f2c1](https://github.com/angular-ui/ui-router/commit/fdd2f2c191c4a67c874fdb9ec9a34f8dde9ad180), closes [#1073], [#1045], [#1486], [#1394])
+ * typed params in search ([8d4cab69](https://github.com/angular-ui/ui-router/commit/8d4cab69dd67058e1a716892cc37b7d80a57037f), closes [#1488](https://github.com/angular-ui/ui-router/issues/1488))
+ * no longer generate unroutable urls ([cb9fd9d8](https://github.com/angular-ui/ui-router/commit/cb9fd9d8943cb26c7223f6990db29c82ae8740f8), closes [#1487](https://github.com/angular-ui/ui-router/issues/1487))
+ * handle optional parameter followed by required parameter in url format. ([efc72106](https://github.com/angular-ui/ui-router/commit/efc72106ddcc4774b48ea176a505ef9e95193b41))
+ * default to parameter string coersion. ([13a468a7](https://github.com/angular-ui/ui-router/commit/13a468a7d54c2fb0751b94c0c1841d580b71e6dc), closes [#1414](https://github.com/angular-ui/ui-router/issues/1414))
+ * concat respects strictMode/caseInsensitive ([dd72e103](https://github.com/angular-ui/ui-router/commit/dd72e103edb342d9cf802816fe127e1bbd68fd5f), closes [#1395])
+* **ui-sref:**
+ * Allow sref state options to take a scope object ([b5f7b596](https://github.com/angular-ui/ui-router/commit/b5f7b59692ce4933e2d63eb5df3f50a4ba68ccc0))
+ * replace raw href modification with attrs. ([08c96782](https://github.com/angular-ui/ui-router/commit/08c96782faf881b0c7ab00afc233ee6729548fa0))
+ * nagivate to state when url is "" fix($state.href): generate href for state with ([656b5aab](https://github.com/angular-ui/ui-router/commit/656b5aab906e5749db9b5a080c6a83b95f50fd91), closes [#1363](https://github.com/angular-ui/ui-router/issues/1363))
+ * Check that state is defined in isMatch() ([92aebc75](https://github.com/angular-ui/ui-router/commit/92aebc7520f88babdc6e266536086e07263514c3), closes [#1314](https://github.com/angular-ui/ui-router/issues/1314), [#1332](https://github.com/angular-ui/ui-router/issues/1332))
+* **uiView:**
+ * allow inteprolated ui-view names ([81f6a19a](https://github.com/angular-ui/ui-router/commit/81f6a19a432dac9198fd33243855bfd3b4fea8c0), closes [#1324](https://github.com/angular-ui/ui-router/issues/1324))
+ * Made anim work with angular 1.3 ([c3bb7ad9](https://github.com/angular-ui/ui-router/commit/c3bb7ad903da1e1f3c91019cfd255be8489ff4ef), closes [#1367](https://github.com/angular-ui/ui-router/issues/1367), [#1345](https://github.com/angular-ui/ui-router/issues/1345))
+* **urlRouter:** html5Mode accepts an object from angular v1.3.0-rc.3 ([7fea1e9d](https://github.com/angular-ui/ui-router/commit/7fea1e9d0d8c6e09cc6c895ecb93d4221e9adf48))
+* **stateFilters:** mark state filters as stateful. ([a00b353e](https://github.com/angular-ui/ui-router/commit/a00b353e3036f64a81245c4e7898646ba218f833), closes [#1479])
+* **ui-router:** re-add IE8 compatibility for map/filter/keys ([8ce69d9f](https://github.com/angular-ui/ui-router/commit/8ce69d9f7c886888ab53eca7e53536f36b428aae), closes [#1518], [#1383])
+* **package:** point 'main' to a valid filename ([ac903350](https://github.com/angular-ui/ui-router/commit/ac9033501debb63364539d91fbf3a0cba4579f8e))
+* **travis:** make CI build faster ([0531de05](https://github.com/angular-ui/ui-router/commit/0531de052e414a8d839fbb4e7635e923e94865b3))
+
+
+#### Features
+
+##### Default and Typed params
+
+This release includes a lot of bug fixes around default/optional and typed parameters. As such, 0.2.12 is the first release where we recommend those features be used.
+
+* **$state:**
+ * add state params validation ([b1379e6a](https://github.com/angular-ui/ui-router/commit/b1379e6a4d38f7ed7436e05873932d7c279af578), closes [#1433](https://github.com/angular-ui/ui-router/issues/1433))
+ * is/includes/get work on relative stateOrName ([232e94b3](https://github.com/angular-ui/ui-router/commit/232e94b3c2ca2c764bb9510046e4b61690c87852))
+ * .reload() returns state transition promise ([639e0565](https://github.com/angular-ui/ui-router/commit/639e0565dece9d5544cc93b3eee6e11c99bd7373))
+* **$templateFactory:** request templateURL as text/html ([ccd60769](https://github.com/angular-ui/ui-router/commit/ccd6076904a4b801d77b47f6e2de4c06ce9962f8), closes [#1287])
+* **$urlMatcherFactory:** Made a Params and ParamSet class ([0cc1e6cc](https://github.com/angular-ui/ui-router/commit/0cc1e6cc461a4640618e2bb594566551c54834e2))
+
+
+
+
+### 0.2.11 (2014-08-26)
+
+
+#### Bug Fixes
+
+* **$resolve:** Resolves only inherit from immediate parent fixes #702 ([df34e20c](https://github.com/angular-ui/ui-router/commit/df34e20c576299e7a3c8bd4ebc68d42341c0ace9))
+* **$state:**
+ * change $state.href default options.inherit to true ([deea695f](https://github.com/angular-ui/ui-router/commit/deea695f5cacc55de351ab985144fd233c02a769))
+ * sanity-check state lookups ([456fd5ae](https://github.com/angular-ui/ui-router/commit/456fd5aec9ea507518927bfabd62b4afad4cf714), closes [#980](https://github.com/angular-ui/ui-router/issues/980))
+ * didn't comply to inherit parameter ([09836781](https://github.com/angular-ui/ui-router/commit/09836781f126c1c485b06551eb9cfd4fa0f45c35))
+ * allow view content loading broadcast ([7b78edee](https://github.com/angular-ui/ui-router/commit/7b78edeeb52a74abf4d3f00f79534033d5a08d1a))
+* **$urlMatcherFactory:**
+ * detect injected functions ([91f75ae6](https://github.com/angular-ui/ui-router/commit/91f75ae66c4d129f6f69e53bd547594e9661f5d5))
+ * syntax ([1ebed370](https://github.com/angular-ui/ui-router/commit/1ebed37069bae8614d41541d56521f5c45f703f3))
+* **UrlMatcher:**
+ * query param function defaults ([f9c20530](https://github.com/angular-ui/ui-router/commit/f9c205304f10d8a4ebe7efe9025e642016479a51))
+ * don't decode default values ([63607bdb](https://github.com/angular-ui/ui-router/commit/63607bdbbcb432d3fb37856a1cb3da0cd496804e))
+* **travis:** update Node version to fix build ([d6b95ef2](https://github.com/angular-ui/ui-router/commit/d6b95ef23d9dacb4eba08897f5190a0bcddb3a48))
+* **uiSref:**
+ * Generate an href for states with a blank url. closes #1293 ([691745b1](https://github.com/angular-ui/ui-router/commit/691745b12fa05d3700dd28f0c8d25f8a105074ad))
+ * should inherit params by default ([b973dad1](https://github.com/angular-ui/ui-router/commit/b973dad155ad09a7975e1476bd096f7b2c758eeb))
+ * cancel transition if preventDefault() has been called ([2e6d9167](https://github.com/angular-ui/ui-router/commit/2e6d9167d3afbfbca6427e53e012f94fb5fb8022))
+* **uiView:** Fixed infinite loop when is called .go() from a controller. ([e13988b8](https://github.com/angular-ui/ui-router/commit/e13988b8cd6231d75c78876ee9d012cc87f4a8d9), closes [#1194](https://github.com/angular-ui/ui-router/issues/1194))
+* **docs:**
+ * Fixed link to milestones ([6c0ae500](https://github.com/angular-ui/ui-router/commit/6c0ae500cc238ea9fc95adcc15415c55fc9e1f33))
+ * fix bug in decorator example ([4bd00af5](https://github.com/angular-ui/ui-router/commit/4bd00af50b8b88a49d1545a76290731cb8e0feb1))
+ * Removed an incorrect semi-colon ([af97cef8](https://github.com/angular-ui/ui-router/commit/af97cef8b967f2e32177e539ef41450dca131a7d))
+ * Explain return value of rule as function ([5e887890](https://github.com/angular-ui/ui-router/commit/5e8878900a6ffe59a81aed531a3925e34a297377))
+
+
+#### Features
+
+* **$state:**
+ * allow parameters to pass unharmed ([8939d057](https://github.com/angular-ui/ui-router/commit/8939d0572ab1316e458ef016317ecff53131a822))
+ * **BREAKING CHANGE**: state parameters are no longer automatically coerced to strings, and unspecified parameter values are now set to undefined rather than null.
+ * allow prevent syncUrl on failure ([753060b9](https://github.com/angular-ui/ui-router/commit/753060b910d5d2da600a6fa0757976e401c33172))
+* **typescript:** Add typescript definitions for component builds ([521ceb3f](https://github.com/angular-ui/ui-router/commit/521ceb3fd7850646422f411921e21ce5e7d82e0f))
+* **uiSref:** extend syntax for ui-sref ([71cad3d6](https://github.com/angular-ui/ui-router/commit/71cad3d636508b5a9fe004775ad1f1adc0c80c3e))
+* **uiSrefActive:**
+ * Also activate for child states. ([bf163ad6](https://github.com/angular-ui/ui-router/commit/bf163ad6ce176ce28792696c8302d7cdf5c05a01), closes [#818](https://github.com/angular-ui/ui-router/issues/818))
+ * **BREAKING CHANGE** Since ui-sref-active now activates even when child states are active you may need to swap out your ui-sref-active with ui-sref-active-eq, thought typically we think devs want the auto inheritance.
+
+ * uiSrefActiveEq: new directive with old ui-sref-active behavior
+* **$urlRouter:**
+ * defer URL change interception ([c72d8ce1](https://github.com/angular-ui/ui-router/commit/c72d8ce11916d0ac22c81b409c9e61d7048554d7))
+ * force URLs to have valid params ([d48505cd](https://github.com/angular-ui/ui-router/commit/d48505cd328d83e39d5706e085ba319715f999a6))
+ * abstract $location handling ([08b4636b](https://github.com/angular-ui/ui-router/commit/08b4636b294611f08db35f00641eb5211686fb50))
+* **$urlMatcherFactory:**
+ * fail on bad parameters ([d8f124c1](https://github.com/angular-ui/ui-router/commit/d8f124c10d00c7e5dde88c602d966db261aea221))
+ * date type support ([b7f074ff](https://github.com/angular-ui/ui-router/commit/b7f074ff65ca150a3cdbda4d5ad6cb17107300eb))
+ * implement type support ([450b1f0e](https://github.com/angular-ui/ui-router/commit/450b1f0e8e03c738174ff967f688b9a6373290f4))
+* **UrlMatcher:**
+ * handle query string arrays ([9cf764ef](https://github.com/angular-ui/ui-router/commit/9cf764efab45fa9309368688d535ddf6e96d6449), closes [#373](https://github.com/angular-ui/ui-router/issues/373))
+ * injectable functions as defaults ([00966ecd](https://github.com/angular-ui/ui-router/commit/00966ecd91fb745846039160cab707bfca8b3bec))
+ * default values & type decoding for query params ([a472b301](https://github.com/angular-ui/ui-router/commit/a472b301389fbe84d1c1fa9f24852b492a569d11))
+ * allow shorthand definitions ([5b724304](https://github.com/angular-ui/ui-router/commit/5b7243049793505e44b6608ea09878c37c95b1f5))
+ * validates whole interface ([32b27db1](https://github.com/angular-ui/ui-router/commit/32b27db173722e9194ef1d5c0ea7d93f25a98d11))
+ * implement non-strict matching ([a3e21366](https://github.com/angular-ui/ui-router/commit/a3e21366bee0475c9795a1ec76f70eec41c5b4e3))
+ * add per-param config support ([07b3029f](https://github.com/angular-ui/ui-router/commit/07b3029f4d409cf955780113df92e36401b47580))
+ * **BREAKING CHANGE**: the `params` option in state configurations must now be an object keyed by parameter name.
+
+### 0.2.10 (2014-03-12)
+
+
+#### Bug Fixes
+
+* **$state:** use $browser.baseHref() when generating urls with .href() ([cbcc8488](https://github.com/angular-ui/ui-router/commit/cbcc84887d6b6d35258adabb97c714cd9c1e272d))
+* **bower.json:** JS files should not be ignored ([ccdab193](https://github.com/angular-ui/ui-router/commit/ccdab193315f304eb3be5f5b97c47a926c79263e))
+* **dev:** karma:background task is missing, can't run grunt:dev. ([d9f7b898](https://github.com/angular-ui/ui-router/commit/d9f7b898e8e3abb8c846b0faa16a382913d7b22b))
+* **sample:** Contacts menu button not staying active when navigating to detail states. Need t ([2fcb8443](https://github.com/angular-ui/ui-router/commit/2fcb84437cb43ade12682a92b764f13cac77dfe7))
+* **uiSref:** support mock-clicks/events with no data ([717d3ff7](https://github.com/angular-ui/ui-router/commit/717d3ff7d0ba72d239892dee562b401cdf90e418))
+* **uiView:**
+ * Do NOT autoscroll when autoscroll attr is missing ([affe5bd7](https://github.com/angular-ui/ui-router/commit/affe5bd785cdc3f02b7a9f64a52e3900386ec3a0), closes [#807](https://github.com/angular-ui/ui-router/issues/807))
+ * Refactoring uiView directive to copy ngView logic ([548fab6a](https://github.com/angular-ui/ui-router/commit/548fab6ab9debc9904c5865c8bc68b4fc3271dd0), closes [#857](https://github.com/angular-ui/ui-router/issues/857), [#552](https://github.com/angular-ui/ui-router/issues/552))
+
+
+#### Features
+
+* **$state:** includes() allows glob patterns for state matching. ([2d5f6b37](https://github.com/angular-ui/ui-router/commit/2d5f6b37191a3135f4a6d9e8f344c54edcdc065b))
+* **UrlMatcher:** Add support for case insensitive url matching ([642d5247](https://github.com/angular-ui/ui-router/commit/642d524799f604811e680331002feec7199a1fb5))
+* **uiSref:** add support for transition options ([2ed7a728](https://github.com/angular-ui/ui-router/commit/2ed7a728cee6854b38501fbc1df6139d3de5b28a))
+* **uiView:** add controllerAs config with function ([1ee7334a](https://github.com/angular-ui/ui-router/commit/1ee7334a73efeccc9b95340e315cdfd59944762d))
+
+
+### 0.2.9 (2014-01-17)
+
+
+This release is identical to 0.2.8. 0.2.8 was re-tagged in git to fix a problem with bower.
+
+
+### 0.2.8 (2014-01-16)
+
+
+#### Bug Fixes
+
+* **$state:** allow null to be passed as 'params' param ([094dc30e](https://github.com/angular-ui/ui-router/commit/094dc30e883e1bd14e50a475553bafeaade3b178))
+* **$state.go:** param inheritance shouldn't inherit from siblings ([aea872e0](https://github.com/angular-ui/ui-router/commit/aea872e0b983cb433436ce5875df10c838fccedb))
+* **bower.json:** fixes bower.json ([eed3cc4d](https://github.com/angular-ui/ui-router/commit/eed3cc4d4dfef1d3ef84b9fd063127538ebf59d3))
+* **uiSrefActive:** annotate controller injection ([85921422](https://github.com/angular-ui/ui-router/commit/85921422ff7fb0effed358136426d616cce3d583), closes [#671](https://github.com/angular-ui/ui-router/issues/671))
+* **uiView:**
+ * autoscroll tests pass on 1.2.4 & 1.1.5 ([86eacac0](https://github.com/angular-ui/ui-router/commit/86eacac09ca5e9000bd3b9c7ba6e2cc95d883a3a))
+ * don't animate initial load ([83b6634d](https://github.com/angular-ui/ui-router/commit/83b6634d27942ca74766b2b1244a7fc52c5643d9))
+ * test pass against 1.0.8 and 1.2.4 ([a402415a](https://github.com/angular-ui/ui-router/commit/a402415a2a28b360c43b9fe8f4f54c540f6c33de))
+ * it should autoscroll when expr is missing. ([8bb9e27a](https://github.com/angular-ui/ui-router/commit/8bb9e27a2986725f45daf44c4c9f846385095aff))
+
+
+#### Features
+
+* **uiSref:** add target attribute behaviour ([c12bf9a5](https://github.com/angular-ui/ui-router/commit/c12bf9a520d30d70294e3d82de7661900f8e394e))
+* **uiView:**
+ * merge autoscroll expression test. ([b89e0f87](https://github.com/angular-ui/ui-router/commit/b89e0f871d5cc35c10925ede986c10684d5c9252))
+ * cache and test autoscroll expression ([ee262282](https://github.com/angular-ui/ui-router/commit/ee2622828c2ce83807f006a459ac4e11406d9258))
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/CONTRIBUTING.md b/public/app/vendor/node_modules/@uirouter/angularjs/CONTRIBUTING.md
new file mode 100644
index 00000000..f4896914
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/CONTRIBUTING.md
@@ -0,0 +1,113 @@
+
+# Report an Issue
+
+Help us make UI-Router better! If you think you might have found a bug, or some other weirdness, start by making sure
+it hasn't already been reported. You can [search through existing issues](https://github.com/angular-ui/ui-router/search?q=wat%3F&type=Issues)
+to see if someone's reported one similar to yours.
+
+If not, then [create a plunkr](http://bit.ly/UIR-Plunk) that demonstrates the problem (try to use as little code
+as possible: the more minimalist, the faster we can debug it).
+
+Next, [create a new issue](https://github.com/angular-ui/ui-router/issues/new) that briefly explains the problem,
+and provides a bit of background as to the circumstances that triggered it. Don't forget to include the link to
+that plunkr you created!
+
+**Note**: If you're unsure how a feature is used, or are encountering some unexpected behavior that you aren't sure
+is a bug, it's best to talk it out on
+[StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) before reporting it. This
+keeps development streamlined, and helps us focus on building great software.
+
+
+Issues only! |
+-------------|
+Please keep in mind that the issue tracker is for *issues*. Please do *not* post an issue if you need help or support. Instead, see one of the above-mentioned forums or [IRC](irc://irc.freenode.net/#angularjs). |
+
+#### Purple Labels
+A purple label means that **you** need to take some further action.
+ - ![Not Actionable - Need Info](https://angular-ui.github.io/ui-router/ngdoc_assets/incomplete.png): Your issue is not specific enough, or there is no clear action that we can take. Please clarify and refine your issue.
+ - ![Plunkr Please](https://angular-ui.github.io/ui-router/ngdoc_assets/example.png): Please [create a plunkr](http://bit.ly/UIR-Plunk)
+ - ![StackOverflow](https://angular-ui.github.io/ui-router/ngdoc_assets/so.png): We suspect your issue is really a help request, or could be answered by the community. Please ask your question on [StackOverflow](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router). If you determine that is an actual issue, please explain why.
+
+If your issue gets labeled with purple label, no further action will be taken until you respond to the label appropriately.
+
+# Contribute
+
+**(1)** See the **[Developing](#developing)** section below, to get the development version of UI-Router up and running on your local machine.
+
+**(2)** Check out the [roadmap](https://github.com/angular-ui/ui-router/milestones) to see where the project is headed, and if your feature idea fits with where we're headed.
+
+**(3)** If you're not sure, [open an RFC](https://github.com/angular-ui/ui-router/issues/new?title=RFC:%20My%20idea) to get some feedback on your idea.
+
+**(4)** Finally, commit some code and open a pull request. Code & commits should abide by the following rules:
+
+- *Always* have test coverage for new features (or regression tests for bug fixes), and *never* break existing tests
+- Commits should represent one logical change each; if a feature goes through multiple iterations, squash your commits down to one
+- Make sure to follow the [Angular commit message format](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#commit-message-format) so your change will appear in the changelog of the next release.
+- Changes should always respect the coding style of the project
+
+
+
+# Developing
+
+UI-Router uses npm and Rollup.
+
+## Fetch the source code
+
+The code for Angular UI-Router is split into two source repositories:
+
+* [UI-Router Core](https://github.com/ui-router/core) (`@uirouter/core` on npm)
+* [UI-Router for Angular 1](https://github.com/angular-ui/ui-router) (`@ui-router/angularjs` on npm)
+
+Clone both repositories into directories next to each other.
+
+```
+mkdir uirouter
+cd uirouter
+git clone https://github.com/angular-ui/ui-router.git angularjs
+git clone https://github.com/ui-router/core.git core
+```
+
+## Install dependencies
+
+Use `npm` to install the development dependencies for each repository.
+
+```
+cd core
+npm install
+cd ../angularjs
+npm install
+cd ..
+```
+
+## Link the directories
+
+This step is necessary if you need to modify any code in `@uirouter/core`.
+Using `npm`, link `@uirouter/core` into `@uirouter/angularjs`
+
+```
+cd core
+npm link
+cd ../angularjs
+npm link '@uirouter/core'
+```
+
+After executing these steps, `@uirouter/angularjs` will be depend on your local copy of `@uirouter/core` instead of the version listed in `package.json`.
+
+## Develop
+
+These scripts may be run in the `angularjs` directory:
+
+* `npm run build`: Compiles TypeScript source
+* `npm run package`: Compiles TypeScript source and creates the Rollup bundles.
+* `npm test`: Runs the test suite (against Angular 1.2 through 1.5).
+* `npm run watch`: Continuously compiles the source and runs the test suite (when either source or tests change).
+
+Scripts of the same name (in the `core` directory) can be used.
+
+* `npm run build`: Compiles `@uirouter/core` TypeScript source
+* `npm test`: Runs the `@uirouter/core` test suite
+* `npm run watch`: Continuously compiles the source and runs the `@uirouter/core` test suite (when core source or tests change).
+
+If you've followed the [linking instructions](#link-the-directories), it's useful to run both
+`npm run watch` tasks (each task from `@uirouter/core` *and* `@uirouter/angularjs`).
+This ensures that changes to either `@uirouter/core` and `@uirouter/angularjs` compile successfully and are run against their test suites.
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/DOCS.md b/public/app/vendor/node_modules/@uirouter/angularjs/DOCS.md
new file mode 100644
index 00000000..a532665a
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/DOCS.md
@@ -0,0 +1,48 @@
+# [UI Router for Angular 1](https://ui-router.github.io/ng1/docs/latest)
+
+#### The de-facto solution to flexible routing in angular 1
+
+
+
+
+Angular UI-Router is a client-side [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application)
+routing framework for [AngularJS](http://angularjs.org).
+
+**[View on Github](http://github.com/angular-ui/ui-router) |**
+**[Tutorials](https://ui-router.github.io/ng1/tutorials/)** |
+**[Guides](https://ui-router.github.io/guide) |**
+**[Sample App](http://ui-router.github.io/resources/sampleapp/) |**
+**[Wiki](https://github.com/angular-ui/ui-router/wiki) |**
+**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions)**
+
+#### API Documentation Organization
+
+The documentation is arranged according to API concern, such as `url`, `resolve`, and `core`.
+For a list of services and objects that can be injectable, see the [`injectables` section](./injectables.html).
+
+By default, only the public UI-Router API is shown.
+To view both public API and the internal APIs, check the "Internal UI-Router API" checkbox.
+
+#### Typescript
+
+UI-Router is written in Typescript.
+The API documentation is generated using [TypeDoc](https://github.com/TypeStrong/typedoc).
+The documentation reflects the Typescript classes, interfaces, and parameter types information embedded in the source code.
+
+#### Contributing
+
+Angular UI-Router depends on the framework agnostic `@uirouter/core`.
+To contribute to the documentation, please submit a PR to either
+[@uirouter/angularjs](http://github.com/angular-ui/ui-router)
+or
+[@uirouter/core](http://github.com/ui-router/core).
+To find where a specific piece of documentation is written, follow the links that say:
+ > _Defined in ui-router/somedir/somefile.ts_
+
+
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/ISSUE_TEMPLATE.md b/public/app/vendor/node_modules/@uirouter/angularjs/ISSUE_TEMPLATE.md
new file mode 100644
index 00000000..764b85b6
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/ISSUE_TEMPLATE.md
@@ -0,0 +1,53 @@
+This issue tracker is for Bug Reports and Feature Requests only.
+Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.
+
+This is a:
+
+- [ ] Bug Report
+- [ ] Feature Request
+- [ ] General Query
+
+My version of UI-Router is: (version)
+
+
+
+# Bug Report
+
+#### Current Behavior:
+
+(current behavior here)
+
+#### Expected Behavior:
+
+(expected behavior here)
+
+#### Link to Plunker that reproduces the issue:
+
+http://bit.ly/UIR-Plunk
+
+
+
+
+# Feature Request
+
+(feature request here)
+
+
+
+
+# General Query
+
+Please direct general implementation questions to StackOverflow:
+http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router
+
+Please review the Sample Application which highlights common approaches:
+https://github.com/ui-router/sample-app-ng1
+
+- [ ] I have already asked my question on StackOverflow and nobody could answer the question
+
+- [ ] I have already reviewed the sample application for examples of common approaches
+
+- [ ] I believe my question can only be answered by the UI-Router maintainers
+
+
+(general query here)
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/LICENSE b/public/app/vendor/node_modules/@uirouter/angularjs/LICENSE
new file mode 100644
index 00000000..6413b092
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/LICENSE
@@ -0,0 +1,21 @@
+The MIT License
+
+Copyright (c) 2013-2015 The AngularUI Team, Karsten Sperling
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/README.md b/public/app/vendor/node_modules/@uirouter/angularjs/README.md
new file mode 100644
index 00000000..a64087de
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/README.md
@@ -0,0 +1,56 @@
+# AngularUI Router [![Build Status](https://travis-ci.org/angular-ui/ui-router.svg?branch=master)](https://travis-ci.org/angular-ui/ui-router)
+
+**Note: this is the Angular 1.x source for UI-Router version 1.0. If you are looking for the source for UI-Router
+version 0.2.x, it can be found [here](https://github.com/angular-ui/ui-router/tree/legacy)**
+
+---
+
+
+#### The de-facto solution to flexible routing in angular
+---
+**[Tutorials](https://ui-router.github.io/tutorials/)** |
+**[API Docs](https://ui-router.github.io/docs/latest/)** |
+**[Download stable](http://unpkg.com/@uirouter/angularjs@latest/release/angular-ui-router.js)** (or **[Minified](http://unpkg.com/@uirouter/angularjs@latest/release/angular-ui-router.min.js)**) **|**
+**[Guide](https://github.com/angular-ui/ui-router/wiki) |**
+**[Sample App](http://ui-router.github.io/resources/sampleapp/) |**
+**[FAQ](https://github.com/angular-ui/ui-router/wiki/Frequently-Asked-Questions) |**
+**[Report an Issue](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#report-an-issue) |**
+**[Contribute](https://github.com/angular-ui/ui-router/blob/master/CONTRIBUTING.md#contribute) |**
+**[Help!](http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router) |**
+
+---
+
+Angular UI-Router is a client-side [Single Page Application](https://en.wikipedia.org/wiki/Single-page_application)
+routing framework for [AngularJS](http://angularjs.org).
+
+Routing frameworks for SPAs update the browser's URL as the user navigates through the app. Conversely, this allows
+changes to the browser's URL to drive navigation through the app, thus allowing the user to create a bookmark to a
+location deep within the SPA.
+
+UI-Router applications are modeled as a hierarchical tree of states. UI-Router provides a
+[*state machine*](https://en.wikipedia.org/wiki/Finite-state_machine) to manage the transitions between those
+application states in a transaction-like manner.
+
+## Get Started
+
+
+- [UI-Router for Angular 1](https://ui-router.github.io/ng1)
+- [UI-Router for Angular 2](https://ui-router.github.io/ng2)
+- [UI-Router for React](https://ui-router.github.io/react)
+
+## Resources
+
+* [In-Depth Guide](https://github.com/angular-ui/ui-router/wiki)
+* [Slides comparing ngRoute to ui-router](http://slid.es/timkindberg/ui-router#/)
+* [UI-Router Extras / Addons for legacy (0.x)](http://christopherthielen.github.io/ui-router-extras/#/home) (@christopherthielen)
+
+### Videos
+
+* [Introduction Video](https://egghead.io/lessons/angularjs-introduction-ui-router) (egghead.io)
+* [Tim Kindberg on Angular UI-Router](https://www.youtube.com/watch?v=lBqiZSemrqg)
+* [Activating States](https://egghead.io/lessons/angularjs-ui-router-activating-states) (egghead.io)
+* [Learn Angular.js using UI-Router](http://youtu.be/QETUuZ27N0w) (LearnCode.academy)
+
+## Reporting issues and Contributing
+
+Please read our [Contributor guidelines](CONTRIBUTING.md) before reporting an issue or creating a pull request.
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/artifacts.json b/public/app/vendor/node_modules/@uirouter/angularjs/artifacts.json
new file mode 100644
index 00000000..efbce402
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/artifacts.json
@@ -0,0 +1,8 @@
+{
+ "ARTIFACTS": [
+ "lib",
+ "lib-esm",
+ "release",
+ "package.json"
+ ]
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.d.ts
new file mode 100644
index 00000000..a58640ee
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.d.ts
@@ -0,0 +1 @@
+export declare const ng: any;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.js
new file mode 100644
index 00000000..af11d370
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.js
@@ -0,0 +1,4 @@
+import * as ng_from_import from "angular";
+var ng_from_global = angular;
+export var ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;
+//# sourceMappingURL=angular.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.js.map
new file mode 100644
index 00000000..df8e4a43
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/angular.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "angular.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/angular.ts"
+ ],
+ "names": [],
+ "mappings": "AAKA,OAAO,KAAK,cAAc,MAAM,SAAS,CAAC;AAC1C,IAAI,cAAc,GAAG,OAAO,CAAC;AAE7B,MAAM,CAAC,IAAM,EAAE,GAAG,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC",
+ "sourcesContent": [
+ "/**\n * @hidden\n * @module ng1\n */ /** */\ndeclare var angular;\nimport * as ng_from_import from \"angular\";\nlet ng_from_global = angular;\n\nexport const ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.d.ts
new file mode 100644
index 00000000..0e3fe8d5
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.d.ts
@@ -0,0 +1,3 @@
+/** @hidden Used for typedoc */
+export interface ng1_directive {
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js
new file mode 100644
index 00000000..e5f6cf7f
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/directives/stateDirectives.js
@@ -0,0 +1,569 @@
+/**
+ * # Angular 1 Directives
+ *
+ * These are the directives included in UI-Router for Angular 1.
+ * These directives are used in templates to create viewports and link/navigate to states.
+ *
+ * @ng1api
+ * @preferred
+ * @module directives
+ */ /** for typedoc */
+import { ng as angular } from "../angular";
+import { extend, forEach, tail, isString, isObject, isArray, parse, noop, unnestR, identity, uniqR, inArray, removeFrom } from "@uirouter/core";
+/** @hidden */
+function parseStateRef(ref) {
+ var paramsOnly = ref.match(/^\s*({[^}]*})\s*$/), parsed;
+ if (paramsOnly)
+ ref = '(' + paramsOnly[1] + ')';
+ parsed = ref.replace(/\n/g, " ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/);
+ if (!parsed || parsed.length !== 4)
+ throw new Error("Invalid state ref '" + ref + "'");
+ return { state: parsed[1] || null, paramExpr: parsed[3] || null };
+}
+/** @hidden */
+function stateContext(el) {
+ var $uiView = el.parent().inheritedData('$uiView');
+ var path = parse('$cfg.path')($uiView);
+ return path ? tail(path).state.name : undefined;
+}
+/** @hidden */
+function processedDef($state, $element, def) {
+ var uiState = def.uiState || $state.current.name;
+ var uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {});
+ var href = $state.href(uiState, def.uiStateParams, uiStateOpts);
+ return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href };
+}
+/** @hidden */
+function getTypeInfo(el) {
+ // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+ var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';
+ var isForm = el[0].nodeName === "FORM";
+ return {
+ attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'),
+ isAnchor: el.prop("tagName").toUpperCase() === "A",
+ clickable: !isForm
+ };
+}
+/** @hidden */
+function clickHook(el, $state, $timeout, type, getDef) {
+ return function (e) {
+ var button = e.which || e.button, target = getDef();
+ if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {
+ // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
+ var transition = $timeout(function () {
+ $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);
+ });
+ e.preventDefault();
+ // if the state has no URL, ignore one preventDefault from the directive.
+ var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1 : 0;
+ e.preventDefault = function () {
+ if (ignorePreventDefaultCount-- <= 0)
+ $timeout.cancel(transition);
+ };
+ }
+ };
+}
+/** @hidden */
+function defaultOpts(el, $state) {
+ return {
+ relative: stateContext(el) || $state.$current,
+ inherit: true,
+ source: "sref"
+ };
+}
+/** @hidden */
+function bindEvents(element, scope, hookFn, uiStateOpts) {
+ var events;
+ if (uiStateOpts) {
+ events = uiStateOpts.events;
+ }
+ if (!isArray(events)) {
+ events = ['click'];
+ }
+ var on = element.on ? 'on' : 'bind';
+ for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
+ var event_1 = events_1[_i];
+ element[on](event_1, hookFn);
+ }
+ scope.$on('$destroy', function () {
+ var off = element.off ? 'off' : 'unbind';
+ for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {
+ var event_2 = events_2[_i];
+ element[off](event_2, hookFn);
+ }
+ });
+}
+/**
+ * `ui-sref`: A directive for linking to a state
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * ### Linked State
+ * The attribute value of the `ui-sref` is the name of the state to link to.
+ *
+ * #### Example:
+ * This will activate the `home` state when the link is clicked.
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Relative Links
+ * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).
+ * You just need to be aware that the path is relative to the state that *created* the link.
+ * This allows a state to create a relative `ui-sref` which always targets the same destination.
+ *
+ * #### Example:
+ * Both these links are relative to the parent state, even when a child state is currently active.
+ * ```html
+ * child 1 state
+ * child 2 state
+ * ```
+ *
+ * This link activates the parent state.
+ * ```html
+ * Return
+ * ```
+ *
+ * ### hrefs
+ * If the linked state has a URL, the directive will automatically generate and
+ * update the `href` attribute (using the [[StateService.href]] method).
+ *
+ * #### Example:
+ * Assuming the `users` state has a url of `/users/`
+ * ```html
+ * Users
+ * ```
+ *
+ * ### Parameter Values
+ * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.
+ * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.
+ * The content inside the parentheses is an expression, evaluated to the parameter values.
+ *
+ * #### Example:
+ * This example renders a list of links to users.
+ * The state's `userId` parameter value comes from each user's `user.id` property.
+ * ```html
+ *
+ * ```
+ *
+ * Note:
+ * The parameter values expression is `$watch`ed for updates.
+ *
+ * ### Transition Options
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.
+ * Options are restricted to `location`, `inherit`, and `reload`.
+ *
+ * #### Example:
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Other DOM Events
+ *
+ * You can also customize which DOM events to respond to (instead of `click`) by
+ * providing an `events` array in the `ui-sref-opts` attribute.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * ### Highlighting the active link
+ * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
+ *
+ * ### Examples
+ * If you have the following template:
+ *
+ * ```html
+ * Home
+ * About
+ * Next page
+ *
+ *
+ * ```
+ *
+ * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:
+ *
+ * ```html
+ * Home
+ * About
+ * Next page
+ *
+ *
+ *
+ * Home
+ * ```
+ *
+ * ### Notes
+ *
+ * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.
+ * #### Example:
+ * Sets the `lang` parameter to `en` and remains on the same state.
+ *
+ * ```html
+ * English
+ * ```
+ *
+ * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
+ *
+ * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).
+ * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.
+ */
+var uiSref;
+uiSref = ['$uiRouter', '$timeout',
+ function $StateRefDirective($uiRouter, $timeout) {
+ var $state = $uiRouter.stateService;
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function (scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var unlinkInfoFn = null;
+ var hookFn;
+ var rawDef = {};
+ var getDef = function () { return processedDef($state, element, rawDef); };
+ var ref = parseStateRef(attrs.uiSref);
+ rawDef.uiState = ref.state;
+ rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};
+ function update() {
+ var def = getDef();
+ if (unlinkInfoFn)
+ unlinkInfoFn();
+ if (active)
+ unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);
+ if (def.href != null)
+ attrs.$set(type.attr, def.href);
+ }
+ if (ref.paramExpr) {
+ scope.$watch(ref.paramExpr, function (val) {
+ rawDef.uiStateParams = extend({}, val);
+ update();
+ }, true);
+ rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));
+ }
+ update();
+ scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));
+ scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));
+ if (!type.clickable)
+ return;
+ hookFn = clickHook(element, $state, $timeout, type, getDef);
+ bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
+ }
+ };
+ }];
+/**
+ * `ui-state`: A fully dynamic directive for linking to a state
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * ### Linked State
+ * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.
+ * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**
+ *
+ * #### Example:
+ * Create a list of links.
+ * ```html
+ *
+ * ```
+ *
+ * ### Relative Links
+ * If the expression evaluates to a relative path, it is processed like [[uiSref]].
+ * You just need to be aware that the path is relative to the state that *created* the link.
+ * This allows a state to create relative `ui-state` which always targets the same destination.
+ *
+ * ### hrefs
+ * If the linked state has a URL, the directive will automatically generate and
+ * update the `href` attribute (using the [[StateService.href]] method).
+ *
+ * ### Parameter Values
+ * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.
+ * Param values should be provided using the `ui-state-params` attribute.
+ * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.
+ *
+ * #### Example:
+ * This example renders a list of links with param values.
+ * The state's `userId` parameter value comes from each user's `user.id` property.
+ * ```html
+ *
+ * ```
+ *
+ * ### Transition Options
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.
+ * Options are restricted to `location`, `inherit`, and `reload`.
+ * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.
+ *
+ * #### Example:
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Other DOM Events
+ *
+ * You can also customize which DOM events to respond to (instead of `click`) by
+ * providing an `events` array in the `ui-state-opts` attribute.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * ### Highlighting the active link
+ * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
+ *
+ * ### Notes
+ *
+ * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.
+ * However, it might be simpler to use [[uiSref]] parameter-only links.
+ *
+ * #### Example:
+ * Sets the `lang` parameter to `en` and remains on the same state.
+ *
+ * ```html
+ * English
+ * ```
+ *
+ * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
+ * ```
+ */
+var uiState;
+uiState = ['$uiRouter', '$timeout',
+ function $StateRefDynamicDirective($uiRouter, $timeout) {
+ var $state = $uiRouter.stateService;
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function (scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var unlinkInfoFn = null;
+ var hookFn;
+ var rawDef = {};
+ var getDef = function () { return processedDef($state, element, rawDef); };
+ var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];
+ var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return (acc[attr] = noop, acc); }, {});
+ function update() {
+ var def = getDef();
+ if (unlinkInfoFn)
+ unlinkInfoFn();
+ if (active)
+ unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);
+ if (def.href != null)
+ attrs.$set(type.attr, def.href);
+ }
+ inputAttrs.forEach(function (field) {
+ rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;
+ attrs.$observe(field, function (expr) {
+ watchDeregFns[field]();
+ watchDeregFns[field] = scope.$watch(expr, function (newval) {
+ rawDef[field] = newval;
+ update();
+ }, true);
+ });
+ });
+ update();
+ scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));
+ scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));
+ if (!type.clickable)
+ return;
+ hookFn = clickHook(element, $state, $timeout, type, getDef);
+ bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
+ }
+ };
+ }];
+/**
+ * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active
+ *
+ * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the
+ * related directive's state is active (and remove them when it is inactive).
+ *
+ * The primary use-case is to highlight the active link in navigation menus,
+ * distinguishing it from the inactive menu items.
+ *
+ * ### Linking to a `ui-sref` or `ui-state`
+ * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.
+ * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.
+ *
+ * ### Matching
+ *
+ * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.
+ * This is a "fuzzy match" which uses [[StateService.includes]].
+ *
+ * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).
+ * This is an "exact match" which uses [[StateService.is]].
+ *
+ * ### Parameter values
+ * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.
+ * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * When the app state is `app.user` (or any child state),
+ * and contains the state parameter "user" with value "bilbobaggins",
+ * the resulting HTML will appear as (note the 'active' class):
+ *
+ * ```html
+ *
+ * ```
+ *
+ * ### Glob mode
+ *
+ * It is possible to pass `ui-sref-active` an expression that evaluates to an object.
+ * The objects keys represent active class names and values represent the respective state names/globs.
+ * `ui-sref-active` will match if the current active state **includes** any of
+ * the specified state names/globs, even the abstract ones.
+ *
+ * #### Example:
+ * Given the following template, with "admin" being an abstract state:
+ * ```html
+ *
\n * ```\n *\n * Note:\n * The parameter values expression is `$watch`ed for updates.\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-sref-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Examples\n * If you have the following template:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n *
\n * ```\n *\n * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n *
\n *\n * Home\n * ```\n *\n * ### Notes\n *\n * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n *\n * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).\n * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.\n */\nlet uiSref: ng1_directive;\nuiSref = ['$uiRouter', '$timeout',\n function $StateRefDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {\n let $state = $uiRouter.stateService;\n\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope: IScope, element: IAugmentedJQuery, attrs: any, uiSrefActive: any) {\n let type = getTypeInfo(element);\n let active = uiSrefActive[1] || uiSrefActive[0];\n let unlinkInfoFn: Function = null;\n let hookFn;\n\n let rawDef = {} as Def;\n let getDef = () => processedDef($state, element, rawDef);\n\n let ref = parseStateRef(attrs.uiSref);\n rawDef.uiState = ref.state;\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\n\n function update() {\n let def = getDef();\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null) attrs.$set(type.attr, def.href);\n }\n\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function (val) {\n rawDef.uiStateParams = extend({}, val);\n update();\n }, true);\n rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));\n }\n\n update();\n\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n }\n };\n }];\n\n/**\n * `ui-state`: A fully dynamic directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.\n * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**\n *\n * #### Example:\n * Create a list of links.\n * ```html\n *
\n * ```\n *\n * ### Relative Links\n * If the expression evaluates to a relative path, it is processed like [[uiSref]].\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create relative `ui-state` which always targets the same destination.\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * ### Parameter Values\n * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.\n * Param values should be provided using the `ui-state-params` attribute.\n * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * This example renders a list of links with param values.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n *
\n * ```\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-state-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Notes\n *\n * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.\n * However, it might be simpler to use [[uiSref]] parameter-only links.\n *\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n * ```\n */\nlet uiState: ng1_directive;\nuiState = ['$uiRouter', '$timeout',\n function $StateRefDynamicDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {\n let $state = $uiRouter.stateService;\n\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope: IScope, element: IAugmentedJQuery, attrs: any, uiSrefActive: any) {\n let type = getTypeInfo(element);\n let active = uiSrefActive[1] || uiSrefActive[0];\n let unlinkInfoFn: Function = null;\n let hookFn;\n\n let rawDef = {} as Def;\n let getDef = () => processedDef($state, element, rawDef);\n\n let inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\n let watchDeregFns = inputAttrs.reduce((acc, attr) => (acc[attr] = noop, acc), {});\n\n function update() {\n let def = getDef();\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null) attrs.$set(type.attr, def.href);\n }\n\n inputAttrs.forEach((field) => {\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\n\n attrs.$observe(field, (expr) => {\n watchDeregFns[field]();\n watchDeregFns[field] = scope.$watch(expr, (newval) => {\n rawDef[field] = newval;\n update();\n }, true);\n })\n });\n\n update();\n\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n }\n };\n }];\n\n\n/**\n * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active\n *\n * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the\n * related directive's state is active (and remove them when it is inactive).\n *\n * The primary use-case is to highlight the active link in navigation menus,\n * distinguishing it from the inactive menu items.\n *\n * ### Linking to a `ui-sref` or `ui-state`\n * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.\n * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.\n *\n * ### Matching\n *\n * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.\n * This is a \"fuzzy match\" which uses [[StateService.includes]].\n *\n * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).\n * This is an \"exact match\" which uses [[StateService.is]].\n *\n * ### Parameter values\n * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.\n * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.\n *\n * #### Example:\n * ```html\n *
\n * ```\n *\n * When the app state is `app.user` (or any child state),\n * and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n *\n * ```html\n *
\n * ```\n *\n * ### Glob mode\n *\n * It is possible to pass `ui-sref-active` an expression that evaluates to an object.\n * The objects keys represent active class names and values represent the respective state names/globs.\n * `ui-sref-active` will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * #### Example:\n * Given the following template, with \"admin\" being an abstract state:\n * ```html\n *
\",\n * controller: function(allfolders, $scope) {\n * $scope.allfolders = allfolders;\n * }\n * }\n * ```\n *\n * Since this interface extends [[Ng1ViewDeclaration]], any view declaration properties can be set directly\n * on the state declaration and they will be applied to the view with the name `$default`. For example:\n *\n * ```js\n * var state = {\n * name: 'foo',\n * url: '/foo',\n * template: '
',\n * controller: 'FooController\n * }\n * }\n * }\n * ```\n *\n * If a state definition contains a `views:` object, any view properties set directly on the state are ignored.\n * Thus, this is an invalid state defintion:\n *\n * ```js\n * var state = {\n * name: 'foo',\n * url: '/foo',\n * controller: 'FooController, // invalid because views: exists\n * views: {\n * header: {\n * template: '
header
'\n * }\n * }\n * }\n * ```\n */\nexport interface Ng1StateDeclaration extends _Ng1StateDeclaration, Ng1ViewDeclaration {\n /**\n * An optional object which defines multiple named views.\n *\n * Each key is the name of a view, and each value is a [[Ng1ViewDeclaration]].\n * Unnamed views are internally renamed to `$default`.\n *\n * A view's name is used to match an active `` directive in the DOM. When the state\n * is entered, the state's views are activated and matched with active `` directives:\n *\n * - The view's name is processed into a ui-view target:\n * - ui-view address: an address to a ui-view\n * - state anchor: the state to anchor the address to\n *\n * Examples:\n *\n * Targets three named ui-views in the parent state's template\n *\n * #### Example:\n * ```js\n * views: {\n * header: {\n * controller: \"headerCtrl\",\n * templateUrl: \"header.html\"\n * },\n * body: {\n * controller: \"bodyCtrl\",\n * templateUrl: \"body.html\"\n * },\n * footer: \"footerComponent\"\n * }\n * ```\n *\n * #### Example:\n * ```js\n * // Targets named ui-view=\"header\" in the template of the ancestor state 'top'\n * // and the named `ui-view=\"body\" from the parent state's template.\n * views: {\n * 'header@top': {\n * controller: \"msgHeaderCtrl\",\n * templateUrl: \"msgHeader.html\"\n * },\n * 'body': {\n * controller: \"messagesCtrl\",\n * templateUrl: \"messages.html\"\n * }\n * }\n * ```\n *\n * ## View targeting details\n *\n * There are a few styles of view addressing/targeting.\n * The most common is a simple `ui-view` name\n *\n * #### Simple ui-view name\n *\n * Addresses without an `@` are anchored to the parent state.\n *\n * #### Example:\n * ```js\n * // target the `` created in the parent state's view\n * views: {\n * foo: {...}\n * }\n * ```\n *\n * #### View name anchored to a state\n *\n * You can anchor the `ui-view` name to a specific state by including an `@`\n *\n * #### Example:\n * targets the `` which was created in a view owned by the state `bar.baz`\n * ```js\n * views: {\n * 'foo@bar.baz': {...}\n * }\n * ```\n *\n * #### Absolute addressing\n *\n * You can address a `ui-view` absolutely, using dotted notation, by prefixing the address with a `!`.\n * Dotted addresses traverse the hierarchy of `ui-view`s active in the DOM:\n *\n * #### Example:\n * absolutely targets the ``\n * ... which was created in the unnamed/$default root ``\n * ```js\n * views: {\n * '!$default.nested': {...}\n * }\n * ```\n *\n * #### Relative addressing\n *\n * Absolute addressing is actually relative addressing, anchored to the unnamed root state (`\"\"`).\n * You can also use relative addressing anchored to *any state*, in order to target a target deeply nested `ui-views`:\n * The `ui-view` is targeted relative to the anchored state by traversing the nested `ui-view` names.\n *\n * #### Example:\n * targets the ``\n * ... which was created inside the\n * ``\n * ... which was created inside the parent state's template.\n * ```js\n * views: {\n * 'foo.bar': {...}\n * }\n * ```\n *\n * #### Example:\n * targets the ``\n * ... which was created in ``\n * ... which was created in a template from the state `baz.qux`\n * ```js\n * views: {\n * 'foo.bar@baz.qux': {...}\n * }\n * ```\n *\n * #### Example:\n * a view can relatively target a named `ui-view` defined on an ancestor using `^` (meaning \"parent\")\n * ```js\n * views: {\n * 'foo@^': {...}, // foo@(parent state) (same as simply 'foo')\n * 'bar@^.^': {...}, // bar@(grandparent state)\n * 'baz@^.^.^': {...}, // baz@(great-grandparent state)\n * }\n * ```\n *\n * For additional in-depth details about how `ui-view` addressing works, see the internal api [[ViewService.match]].\n *\n * ---\n *\n * ## State template+controller and `views:` incompatiblity\n *\n * If a state has a `views` object, any state-level view properties ([[Ng1ViewDeclaration]]) are ignored. Therefore,\n * if _any view_ for a state is declared in the `views` object, then _all of the state's views_ must be defined in\n * the `views` object. The state declaration must not have any of the following fields:\n * - component\n * - bindings\n * - resolveAs\n * - template\n * - templateUrl\n * - templateProvider\n * - controller\n * - controllerAs\n * - controllerProvider\n */\n views?: { [key: string]: string | Ng1ViewDeclaration; };\n\n /**\n * A state hook invoked when a state is being entered.\n *\n * The hook can inject global services.\n * It can also inject `$transition$` or `$state$` (from the current transition).\n * \n * ### Example:\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onEnter: (MyService, $transition$, $state$) => {\n * return MyService.doSomething($state$.name, $transition$.params());\n * }\n * });\n * ```\n *\n * #### Example:`\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onEnter: [ 'MyService', '$transition$', '$state$', function (MyService, $transition$, $state$) {\n * return MyService.doSomething($state$.name, $transition$.params());\n * } ]\n * });\n * ```\n */\n onEnter?: Ng1StateTransitionHook | IInjectable;\n\n /**\n * A state hook invoked when a state is being exited.\n *\n * The hook can inject global services.\n * It can also inject `$transition$` or `$state$` (from the current transition).\n *\n * ### Example:\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onExit: (MyService, $transition$, $state$) => {\n * return MyService.doSomething($state$.name, $transition$.params());\n * }\n * });\n * ```\n *\n * #### Example:`\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onExit: [ 'MyService', '$transition$', '$state$', function (MyService, $transition$, $state$) {\n * return MyService.doSomething($state$.name, $transition$.params());\n * } ]\n * });\n * ```\n */\n onExit?: Ng1StateTransitionHook | IInjectable;\n\n /**\n * A state hook invoked when a state is being retained.\n *\n * The hook can inject global services.\n * It can also inject `$transition$` or `$state$` (from the current transition).\n *\n * #### Example:\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onRetain: (MyService, $transition$, $state$) => {\n * return MyService.doSomething($state$.name, $transition$.params());\n * }\n * });\n * ```\n *\n * #### Example:`\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onRetain: [ 'MyService', '$transition$', '$state$', function (MyService, $transition$, $state$) {\n * return MyService.doSomething($state$.name, $transition$.params());\n * } ]\n * });\n * ```\n */\n onRetain?: Ng1StateTransitionHook | IInjectable;\n\n /**\n * Makes all search/query parameters `dynamic`\n *\n * ### Deprecation warning: use [[ParamDeclaration.dynamic]] instead\n *\n * @deprecated\n */\n reloadOnSearch?: boolean;\n}\n\nexport interface Ng1ViewDeclaration extends _ViewDeclaration {\n /**\n * The name of the component to use for this view.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * The name of an [angular 1.5+ `.component()`](https://docs.angularjs.org/guide/component) (or directive with \n * bindToController and/or scope declaration) which will be used for this view.\n *\n * Resolve data can be provided to the component via the component's `bindings` object (for 1.3+ directives, the\n * `bindToController` is used; for other directives, the `scope` declaration is used). For each binding declared \n * on the component, any resolve with the same name is set on the component's controller instance. The binding \n * is provided to the component as a one-time-binding. In general, components should likewise declare their\n * input bindings as [one-way (\"<\")](https://docs.angularjs.org/api/ng/service/$compile#-scope-).\n *\n * Note: inside a \"views:\" block, a bare string `\"foo\"` is shorthand for `{ component: \"foo\" }`\n *\n * Note: Mapping from resolve names to component inputs may be specified using [[bindings]].\n *\n * #### Example:\n * ```js\n * .state('profile', {\n * // Use the component for the Unnamed view\n * component: 'MyProfile',\n * }\n *\n * .state('messages', {\n * // use the component for the view named 'header'\n * // use the component for the view named 'content'\n * views: {\n * header: { component: 'NavBar' },\n * content: { component: 'MessageList' }\n * }\n * }\n *\n * .state('contacts', {\n * // Inside a \"views:\" block, a bare string \"NavBar\" is shorthand for { component: \"NavBar\" }\n * // use the component for the view named 'header'\n * // use the component for the view named 'content'\n * views: {\n * header: 'NavBar',\n * content: 'ContactList'\n * }\n * }\n * ```\n *\n *\n * Note: When using `component` to define a view, you may _not_ use any of: `template`, `templateUrl`,\n * `templateProvider`, `controller`, `controllerProvider`, `controllerAs`.\n *\n *\n * See also: Todd Motto's angular 1.3 and 1.4 [backport of .component()](https://github.com/toddmotto/angular-component)\n */\n component?: string;\n\n /**\n * An object which maps `resolve`s to [[component]] `bindings`.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * When using a [[component]] declaration (`component: 'myComponent'`), each input binding for the component is supplied\n * data from a resolve of the same name, by default. You may supply data from a different resolve name by mapping it here.\n *\n * Each key in this object is the name of one of the component's input bindings.\n * Each value is the name of the resolve that should be provided to that binding.\n *\n * Any component bindings that are omitted from this map get the default behavior of mapping to a resolve of the\n * same name.\n *\n * #### Example:\n * ```js\n * $stateProvider.state('foo', {\n * resolve: {\n * foo: function(FooService) { return FooService.get(); },\n * bar: function(BarService) { return BarService.get(); }\n * },\n * component: 'Baz',\n * // The component's `baz` binding gets data from the `bar` resolve\n * // The component's `foo` binding gets data from the `foo` resolve (default behavior)\n * bindings: {\n * baz: 'bar'\n * }\n * });\n *\n * app.component('Baz', {\n * templateUrl: 'baz.html',\n * controller: 'BazController',\n * bindings: {\n * foo: '<', // foo binding\n * baz: '<' // baz binding\n * }\n * });\n * ```\n *\n */\n bindings?: { [key: string]: string };\n\n /**\n * Dynamic component provider function.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * This is an injectable provider function which returns the name of the component to use.\n * The provider will invoked during a Transition in which the view's state is entered.\n * The provider is called after the resolve data is fetched.\n *\n * #### Example:\n * ```js\n * componentProvider: function(MyResolveData, $transition$) {\n * if (MyResolveData.foo) {\n * return \"fooComponent\"\n * } else if ($transition$.to().name === 'bar') {\n * return \"barComponent\";\n * }\n * }\n * ```\n */\n componentProvider?: IInjectable;\n\n /**\n * The view's controller function or name\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * The controller function, or the name of a registered controller. The controller function will be used\n * to control the contents of the [[directives.uiView]] directive.\n *\n * If specified as a string, controllerAs can be declared here, i.e., \"FooController as foo\" instead of in\n * a separate [[controllerAs]] property.\n *\n * See: [[Ng1Controller]] for information about component-level router hooks.\n */\n controller?: (IInjectable|string);\n\n /**\n * A controller alias name.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * If present, the controller will be published to scope under the `controllerAs` name.\n * See: https://docs.angularjs.org/api/ng/directive/ngController\n */\n controllerAs?: string;\n\n /**\n * Dynamic controller provider function.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * This is an injectable provider function which returns the actual controller function, or the name\n * of a registered controller. The provider will invoked during a Transition in which the view's state is\n * entered. The provider is called after the resolve data is fetched.\n *\n * #### Example:\n * ```js\n * controllerProvider: function(MyResolveData, $transition$) {\n * if (MyResolveData.foo) {\n * return \"FooCtrl\"\n * } else if ($transition$.to().name === 'bar') {\n * return \"BarCtrl\";\n * } else {\n * return function($scope) {\n * $scope.baz = \"Qux\";\n * }\n * }\n * }\n * ```\n */\n controllerProvider?: IInjectable;\n\n /**\n * The scope variable name to use for resolve data.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * When a view is activated, the resolved data for the state which the view belongs to is put on the scope.\n * This property sets the name of the scope variable to use for the resolved data.\n *\n * Defaults to `$resolve`.\n */\n resolveAs?: string;\n\n /**\n * The HTML template for the view.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * HTML template as a string, or a function which returns an html template as a string.\n * This template will be used to render the corresponding [[directives.uiView]] directive.\n *\n * This property takes precedence over templateUrl.\n *\n * If `template` is a function, it will be called with the Transition parameters as the first argument.\n *\n * #### Example:\n * ```js\n * template: \"
\";\n * }\n * ```\n */\n template?: (Function|string);\n\n /**\n * The URL for the HTML template for the view.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * A path or a function that returns a path to an html template.\n * The template will be fetched and used to render the corresponding [[directives.uiView]] directive.\n *\n * If `templateUrl` is a function, it will be called with the Transition parameters as the first argument.\n *\n * #### Example:\n * ```js\n * templateUrl: \"/templates/home.html\"\n * ```\n *\n * #### Example:\n * ```js\n * templateUrl: function(params) {\n * return myTemplates[params.pageId];\n * }\n * ```\n */\n templateUrl?: (string|Function);\n\n /**\n * Injected function which returns the HTML template.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * Injected function which returns the HTML template.\n * The template will be used to render the corresponding [[directives.uiView]] directive.\n *\n * #### Example:\n * ```js\n * templateProvider: function(MyTemplateService, $transition$) {\n * return MyTemplateService.getTemplate($transition$.params().pageId);\n * }\n * ```\n */\n templateProvider?: IInjectable;\n\n}\n\n/**\n * The shape of a controller for a view (and/or component), defining the controller callbacks.\n *\n * A view in UI-Router is comprised of either a `component` ([[Ng1ViewDeclaration.component]]) or a combination of a\n * `template` (or `templateProvider`) and a `controller` (or `controllerProvider`).\n *\n * The `controller` object (or the `component`'s controller object) can define component-level controller callbacks,\n * which UI-Router will call at the appropriate times. These callbacks are similar to Transition Hooks\n * ([[IHookRegistry]]), but are only called if the view is currently active.\n *\n * This interface defines the UI-Router component callbacks.\n *\n */\nexport interface Ng1Controller {\n /** @hidden */\n $onInit(): void;\n /**\n * This callback is called when parameter values have changed.\n * \n * This callback can be used to respond to changing parameter values in the current state, or in parent/child states.\n * This callback is especially handy when using dynamic parameters ([[ParamDeclaration.dynamic]])\n * \n * Called when:\n * - The view is still active\n * - A new transition has completed successfully\n * - The state for the view (controller) was not reloaded\n * - At least one parameter value was changed\n *\n * Called with:\n * @param newValues an object containing the changed parameter values\n * @param $transition$ the new Transition which triggered this callback\n *\n * #### Example:\n * ```js\n * angular.module('foo').controller('FancyCtrl', function() {\n * this.uiOnParamsChanged = function(newParams) {\n * console.log(\"new params: \", newParams);\n * }\n * });\n * ```\n */\n uiOnParamsChanged(newValues: any, $transition$: Transition): void;\n\n /**\n * This callback is called when the view's state is about to be exited.\n *\n * This callback is used to inform a view that it is about to be exited, due to a new [[Transition]].\n * The callback can ask for user confirmation, and cancel or alter the new Transition. The callback should\n * return a value, or a promise for a value. If a promise is returned, the new Transition waits until the\n * promise settles.\n *\n *\n * Called when:\n * - The view is still active\n * - A new Transition is about to run\n * - The new Transition will exit the view's state\n *\n * Called with:\n * - The new Transition\n *\n * Relevant return Values:\n * - `false`: The transition is cancelled.\n * - A rejected promise: The transition is cancelled.\n * - [[TargetState]]: The transition is redirected to the new target state.\n * - Anything else: the transition will continue normally (the state and view will be deactivated)\n *\n * #### Example:\n * ```js\n * app.component('myComponent', {\n * template: '',\n * bindings: { 'data': '<' },\n * controller: function() {\n *\n * this.originalData = angular.copy(this.data);\n *\n * this.uiCanExit = function() {\n * if (!angular.equals(this.data, this.originalData)) {\n * // Note: This could also return a Promise and request async\n * // confirmation using something like ui-bootstrap $modal\n * return window.confirm(\"Data has changed. Exit anyway and lose changes?\");\n * }\n * }\n * }\n * }\n * ```\n *\n * @param transition the new Transition that is about to exit the component's state\n * @return a HookResult, or a promise for a HookResult\n */\n uiCanExit(transition: Transition): HookResult;\n}\n\n/**\n * Manages which template-loading mechanism to use.\n *\n * Defaults to `$templateRequest` on Angular versions starting from 1.3, `$http` otherwise.\n */\nexport interface TemplateFactoryProvider {\n /**\n * Forces $templateFactory to use $http instead of $templateRequest.\n *\n * UI-Router uses `$templateRequest` by default on angular 1.3+.\n * Use this method to choose to use `$http` instead.\n *\n * ---\n *\n * ## Security warning\n *\n * This might cause XSS, as $http doesn't enforce the regular security checks for\n * templates that have been introduced in Angular 1.3.\n *\n * See the $sce documentation, section\n * \n * Impact on loading templates for more details about this mechanism.\n *\n * *Note: forcing this to `false` on Angular 1.2.x will crash, because `$templateRequest` is not implemented.*\n *\n * @param useUnsafeHttpService `true` to use `$http` to fetch templates\n */\n useHttpService(useUnsafeHttpService: boolean);\n}\n\ndeclare module \"@uirouter/core/lib/state/stateRegistry\" {\n interface StateRegistry {\n register(state: Ng1StateDeclaration);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.d.ts
new file mode 100644
index 00000000..1684f1ef
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.d.ts
@@ -0,0 +1,6 @@
+/** @hidden */
+export declare const resolveFactory: () => {
+ resolve: (invocables: {
+ [key: string]: Function;
+ }, locals?: {}, parent?: Promise) => Promise<{}>;
+};
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.js
new file mode 100644
index 00000000..ed6244a5
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.js
@@ -0,0 +1,67 @@
+/** @module ng1 */ /** */
+import { StateObject, PathNode, ResolveContext, mapObj, resolvablesBuilder } from "@uirouter/core";
+import * as angular from "angular";
+/**
+ * Implementation of the legacy `$resolve` service for angular 1.
+ */
+var $resolve = {
+ /**
+ * Asynchronously injects a resolve block.
+ *
+ * This emulates most of the behavior of the ui-router 0.2.x $resolve.resolve() service API.
+ *
+ * ### Not bundled by default
+ *
+ * This API is no longer not part of the standard `@uirouter/angularjs` bundle.
+ * For users of the prebuilt bundles, add the `release/resolveService.min.js` UMD bundle.
+ * For bundlers (webpack, browserify, etc), add `@uirouter/angularjs/lib/legacy/resolveService`.
+ *
+ * ---
+ *
+ * Given an object `invocables`, where keys are strings and values are injectable functions,
+ * injects each function, and waits for the resulting promise to resolve.
+ * When all resulting promises are resolved, returns the results as an object.
+ *
+ * #### Example:
+ * ```js
+ * let invocables = {
+ * foo: [ '$http', ($http) =>
+ * $http.get('/api/foo').then(resp => resp.data) ],
+ * bar: [ 'foo', '$http', (foo, $http) =>
+ * $http.get('/api/bar/' + foo.barId).then(resp => resp.data) ]
+ * }
+ * $resolve.resolve(invocables)
+ * .then(results => console.log(results.foo, results.bar))
+ * // Logs foo and bar:
+ * // { id: 123, barId: 456, fooData: 'foo data' }
+ * // { id: 456, barData: 'bar data' }
+ * ```
+ *
+ * @param invocables an object which looks like an [[StateDeclaration.resolve]] object; keys are resolve names and values are injectable functions
+ * @param locals key/value pre-resolved data (locals)
+ * @param parent a promise for a "parent resolve"
+ */
+ resolve: function (invocables, locals, parent) {
+ if (locals === void 0) { locals = {}; }
+ var parentNode = new PathNode(new StateObject({ params: {}, resolvables: [] }));
+ var node = new PathNode(new StateObject({ params: {}, resolvables: [] }));
+ var context = new ResolveContext([parentNode, node]);
+ context.addResolvables(resolvablesBuilder({ resolve: invocables }), node.state);
+ var resolveData = function (parentLocals) {
+ var rewrap = function (_locals) { return resolvablesBuilder({ resolve: mapObj(_locals, function (local) { return function () { return local; }; }) }); };
+ context.addResolvables(rewrap(parentLocals), parentNode.state);
+ context.addResolvables(rewrap(locals), node.state);
+ var tuples2ObjR = function (acc, tuple) {
+ acc[tuple.token] = tuple.value;
+ return acc;
+ };
+ return context.resolvePath().then(function (results) { return results.reduce(tuples2ObjR, {}); });
+ };
+ return parent ? parent.then(resolveData) : resolveData({});
+ }
+};
+/** @hidden */
+export var resolveFactory = function () { return $resolve; };
+// The old $resolve service
+angular.module('ui.router').factory('$resolve', resolveFactory);
+//# sourceMappingURL=resolveService.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.js.map
new file mode 100644
index 00000000..f59e4435
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/resolveService.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "resolveService.js",
+ "sourceRoot": "",
+ "sources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,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAEnD,IAAM,WAAW,GAAG,UAAC,GAAQ,EAAE,KAAiC;gBAC9D,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;gBAC/B,MAAM,CAAC,GAAG,CAAC;YACb,CAAC,CAAC;YACF,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,EAA/B,CAA+B,CAAC,CAAC;QAChF,CAAC,CAAC;QAEF,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC7D,CAAC;CACF,CAAC;AAEF,cAAc;AACd,MAAM,CAAC,IAAM,cAAc,GAAG,cAAM,OAAA,QAAQ,EAAR,CAAQ,CAAC;AAE7C,2BAA2B;AAC3B,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAQ,cAAc,CAAC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport { StateObject, PathNode, ResolveContext, Obj, mapObj, resolvablesBuilder } from \"@uirouter/core\";\nimport * as angular from \"angular\";\n\n/**\n * Implementation of the legacy `$resolve` service for angular 1.\n */\nvar $resolve = {\n /**\n * Asynchronously injects a resolve block.\n *\n * This emulates most of the behavior of the ui-router 0.2.x $resolve.resolve() service API.\n *\n * ### Not bundled by default\n *\n * This API is no longer not part of the standard `@uirouter/angularjs` bundle.\n * For users of the prebuilt bundles, add the `release/resolveService.min.js` UMD bundle.\n * For bundlers (webpack, browserify, etc), add `@uirouter/angularjs/lib/legacy/resolveService`.\n *\n * ---\n *\n * Given an object `invocables`, where keys are strings and values are injectable functions,\n * injects each function, and waits for the resulting promise to resolve.\n * When all resulting promises are resolved, returns the results as an object.\n *\n * #### Example:\n * ```js\n * let invocables = {\n * foo: [ '$http', ($http) =>\n * $http.get('/api/foo').then(resp => resp.data) ],\n * bar: [ 'foo', '$http', (foo, $http) =>\n * $http.get('/api/bar/' + foo.barId).then(resp => resp.data) ]\n * }\n * $resolve.resolve(invocables)\n * .then(results => console.log(results.foo, results.bar))\n * // Logs foo and bar:\n * // { id: 123, barId: 456, fooData: 'foo data' }\n * // { id: 456, barData: 'bar data' }\n * ```\n *\n * @param invocables an object which looks like an [[StateDeclaration.resolve]] object; keys are resolve names and values are injectable functions\n * @param locals key/value pre-resolved data (locals)\n * @param parent a promise for a \"parent resolve\"\n */\n resolve: (invocables: { [key: string]: Function }, locals = {}, parent?: Promise) => {\n let parentNode = new PathNode(new StateObject( { params: {}, resolvables: [] }));\n let node = new PathNode(new StateObject( { params: {}, resolvables: [] }));\n let context = new ResolveContext([parentNode, node]);\n\n context.addResolvables(resolvablesBuilder( { resolve: invocables }), node.state);\n\n const resolveData = (parentLocals: Obj) => {\n const rewrap = (_locals: Obj) => resolvablesBuilder( { resolve: mapObj(_locals, local => () => local) });\n context.addResolvables(rewrap(parentLocals), parentNode.state);\n context.addResolvables(rewrap(locals), node.state);\n\n const tuples2ObjR = (acc: Obj, tuple: { token: any, value: any }) => {\n acc[tuple.token] = tuple.value;\n return acc;\n };\n return context.resolvePath().then(results => results.reduce(tuples2ObjR, {}));\n };\n\n return parent ? parent.then(resolveData) : resolveData({});\n }\n};\n\n/** @hidden */\nexport const resolveFactory = () => $resolve;\n\n// The old $resolve service\nangular.module('ui.router').factory('$resolve', resolveFactory);\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.d.ts
new file mode 100644
index 00000000..db7a7204
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.d.ts
@@ -0,0 +1,124 @@
+
+import { IAngularEvent } from "angular";
+/**
+ * An event broadcast on `$rootScope` when the state transition **begins**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] instead
+ *
+ * You can use `event.preventDefault()`
+ * to prevent the transition from happening and then the transition promise will be
+ * rejected with a `'transition prevented'` value.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]]
+ *
+ * #### Example:
+ * ```js
+ * $rootScope.$on('$stateChangeStart', function(event, transition) {
+ * event.preventDefault();
+ * // transitionTo() promise will be rejected with
+ * // a 'transition prevented' error
+ * })
+ * ```
+ *
+ * @event $stateChangeStart
+ * @deprecated
+ */
+export declare var $stateChangeStart: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` if a transition is **cancelled**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] instead
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that was cancelled
+ *
+ * @event $stateChangeCancel
+ * @deprecated
+ */
+export declare var $stateChangeCancel: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` once the state transition is **complete**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onSuccess]]
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that just succeeded
+ *
+ * @event $stateChangeSuccess
+ * @deprecated
+ */
+export declare var $stateChangeSuccess: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` when an **error occurs** during transition.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onError]]
+ *
+ * It's important to note that if you
+ * have any errors in your resolve functions (javascript errors, non-existent services, etc)
+ * they will not throw traditionally. You must listen for this $stateChangeError event to
+ * catch **ALL** errors.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `error`: The reason the transition errored.
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that errored
+ *
+ * @event $stateChangeError
+ * @deprecated
+ */
+export declare var $stateChangeError: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` when a requested state **cannot be found** using the provided state name.
+ *
+ * ### Deprecation warning: use [[StateService.onInvalid]] instead
+ *
+ * The event is broadcast allowing any handlers a single chance to deal with the error (usually by
+ * lazy-loading the unfound state). A `TargetState` object is passed to the listener handler,
+ * you can see its properties in the example. You can use `event.preventDefault()` to abort the
+ * transition and the promise returned from `transitionTo()` will be rejected with a
+ * `'transition aborted'` error.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `unfoundState` Unfound State information. Contains: `to, toParams, options` properties.
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ *
+ * #### Example:
+ * ```js
+ * // somewhere, assume lazy.state has not been defined
+ * $state.go("lazy.state", { a: 1, b: 2 }, { inherit: false });
+ *
+ * // somewhere else
+ * $scope.$on('$stateNotFound', function(event, transition) {
+ * function(event, unfoundState, fromState, fromParams){
+ * console.log(unfoundState.to); // "lazy.state"
+ * console.log(unfoundState.toParams); // {a:1, b:2}
+ * console.log(unfoundState.options); // {inherit:false} + default options
+ * });
+ * ```
+ *
+ * @event $stateNotFound
+ * @deprecated
+ */
+export declare var $stateNotFound: IAngularEvent;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.js
new file mode 100644
index 00000000..2d5ea23c
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.js
@@ -0,0 +1,270 @@
+/**
+ * # Legacy state events
+ *
+ * Polyfill implementation of the UI-Router 0.2.x state events.
+ *
+ * The 0.2.x state events are deprecated. We recommend moving to Transition Hooks instead, as they
+ * provide much more flexibility, support async, and provide the context (the Transition, etc) necessary
+ * to implement meaningful application behaviors.
+ *
+ * To enable these state events, include the `stateEvents.js` file in your project, e.g.,
+ * ```
+ *
+ * ```
+ * and also make sure you depend on the `ui.router.state.events` angular module, e.g.,
+ * ```
+ * angular.module("myApplication", ['ui.router', 'ui.router.state.events']
+ * ```
+ *
+ * @module ng1_state_events
+ */ /** */
+import { ng as angular } from "../angular";
+/**
+ * An event broadcast on `$rootScope` when the state transition **begins**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] instead
+ *
+ * You can use `event.preventDefault()`
+ * to prevent the transition from happening and then the transition promise will be
+ * rejected with a `'transition prevented'` value.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]]
+ *
+ * #### Example:
+ * ```js
+ * $rootScope.$on('$stateChangeStart', function(event, transition) {
+ * event.preventDefault();
+ * // transitionTo() promise will be rejected with
+ * // a 'transition prevented' error
+ * })
+ * ```
+ *
+ * @event $stateChangeStart
+ * @deprecated
+ */
+export var $stateChangeStart;
+/**
+ * An event broadcast on `$rootScope` if a transition is **cancelled**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] instead
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that was cancelled
+ *
+ * @event $stateChangeCancel
+ * @deprecated
+ */
+export var $stateChangeCancel;
+/**
+ * An event broadcast on `$rootScope` once the state transition is **complete**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onSuccess]]
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that just succeeded
+ *
+ * @event $stateChangeSuccess
+ * @deprecated
+ */
+export var $stateChangeSuccess;
+/**
+ * An event broadcast on `$rootScope` when an **error occurs** during transition.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onError]]
+ *
+ * It's important to note that if you
+ * have any errors in your resolve functions (javascript errors, non-existent services, etc)
+ * they will not throw traditionally. You must listen for this $stateChangeError event to
+ * catch **ALL** errors.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `error`: The reason the transition errored.
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that errored
+ *
+ * @event $stateChangeError
+ * @deprecated
+ */
+export var $stateChangeError;
+/**
+ * An event broadcast on `$rootScope` when a requested state **cannot be found** using the provided state name.
+ *
+ * ### Deprecation warning: use [[StateService.onInvalid]] instead
+ *
+ * The event is broadcast allowing any handlers a single chance to deal with the error (usually by
+ * lazy-loading the unfound state). A `TargetState` object is passed to the listener handler,
+ * you can see its properties in the example. You can use `event.preventDefault()` to abort the
+ * transition and the promise returned from `transitionTo()` will be rejected with a
+ * `'transition aborted'` error.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `unfoundState` Unfound State information. Contains: `to, toParams, options` properties.
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ *
+ * #### Example:
+ * ```js
+ * // somewhere, assume lazy.state has not been defined
+ * $state.go("lazy.state", { a: 1, b: 2 }, { inherit: false });
+ *
+ * // somewhere else
+ * $scope.$on('$stateNotFound', function(event, transition) {
+ * function(event, unfoundState, fromState, fromParams){
+ * console.log(unfoundState.to); // "lazy.state"
+ * console.log(unfoundState.toParams); // {a:1, b:2}
+ * console.log(unfoundState.options); // {inherit:false} + default options
+ * });
+ * ```
+ *
+ * @event $stateNotFound
+ * @deprecated
+ */
+export var $stateNotFound;
+(function () {
+ var isFunction = angular.isFunction, isString = angular.isString;
+ function applyPairs(memo, keyValTuple) {
+ var key, value;
+ if (Array.isArray(keyValTuple))
+ key = keyValTuple[0], value = keyValTuple[1];
+ if (!isString(key))
+ throw new Error("invalid parameters to applyPairs");
+ memo[key] = value;
+ return memo;
+ }
+ function stateChangeStartHandler($transition$) {
+ if (!$transition$.options().notify || !$transition$.valid() || $transition$.ignored())
+ return;
+ var $injector = $transition$.injector();
+ var $stateEvents = $injector.get('$stateEvents');
+ var $rootScope = $injector.get('$rootScope');
+ var $state = $injector.get('$state');
+ var $urlRouter = $injector.get('$urlRouter');
+ var enabledEvents = $stateEvents.provider.enabled();
+ var toParams = $transition$.params("to");
+ var fromParams = $transition$.params("from");
+ if (enabledEvents.$stateChangeSuccess) {
+ var startEvent = $rootScope.$broadcast('$stateChangeStart', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
+ if (startEvent.defaultPrevented) {
+ if (enabledEvents.$stateChangeCancel) {
+ $rootScope.$broadcast('$stateChangeCancel', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
+ }
+ //Don't update and resync url if there's been a new transition started. see issue #2238, #600
+ if ($state.transition == null)
+ $urlRouter.update();
+ return false;
+ }
+ // right after global state is updated
+ var successOpts = { priority: 9999 };
+ $transition$.onSuccess({}, function () {
+ $rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
+ }, successOpts);
+ }
+ if (enabledEvents.$stateChangeError) {
+ $transition$.promise["catch"](function (error) {
+ if (error && (error.type === 2 /* RejectType.SUPERSEDED */ || error.type === 3 /* RejectType.ABORTED */))
+ return;
+ var evt = $rootScope.$broadcast('$stateChangeError', $transition$.to(), toParams, $transition$.from(), fromParams, error, $transition$.options(), $transition$);
+ if (!evt.defaultPrevented) {
+ $urlRouter.update();
+ }
+ });
+ }
+ }
+ stateNotFoundHandler.$inject = ['$to$', '$from$', '$state', '$rootScope', '$urlRouter'];
+ function stateNotFoundHandler($to$, $from$, injector) {
+ var $state = injector.get('$state');
+ var $rootScope = injector.get('$rootScope');
+ var $urlRouter = injector.get('$urlRouter');
+ var redirect = { to: $to$.identifier(), toParams: $to$.params(), options: $to$.options() };
+ var e = $rootScope.$broadcast('$stateNotFound', redirect, $from$.state(), $from$.params());
+ if (e.defaultPrevented || e.retry)
+ $urlRouter.update();
+ function redirectFn() {
+ return $state.target(redirect.to, redirect.toParams, redirect.options);
+ }
+ if (e.defaultPrevented) {
+ return false;
+ }
+ else if (e.retry || !!$state.get(redirect.to)) {
+ return e.retry && isFunction(e.retry.then) ? e.retry.then(redirectFn) : redirectFn();
+ }
+ }
+ $StateEventsProvider.$inject = ['$stateProvider'];
+ function $StateEventsProvider($stateProvider) {
+ $StateEventsProvider.prototype.instance = this;
+ var runtime = false;
+ var allEvents = ['$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError'];
+ var enabledStateEvents = allEvents.map(function (e) { return [e, true]; }).reduce(applyPairs, {});
+ function assertNotRuntime() {
+ if (runtime)
+ throw new Error("Cannot enable events at runtime (use $stateEventsProvider");
+ }
+ /**
+ * Enables the deprecated UI-Router 0.2.x State Events
+ * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]
+ */
+ this.enable = function () {
+ var events = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ events[_i] = arguments[_i];
+ }
+ assertNotRuntime();
+ if (!events || !events.length)
+ events = allEvents;
+ events.forEach(function (event) { return enabledStateEvents[event] = true; });
+ };
+ /**
+ * Disables the deprecated UI-Router 0.2.x State Events
+ * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]
+ */
+ this.disable = function () {
+ var events = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ events[_i] = arguments[_i];
+ }
+ assertNotRuntime();
+ if (!events || !events.length)
+ events = allEvents;
+ events.forEach(function (event) { return delete enabledStateEvents[event]; });
+ };
+ this.enabled = function () { return enabledStateEvents; };
+ this.$get = $get;
+ $get.$inject = ['$transitions'];
+ function $get($transitions) {
+ runtime = true;
+ if (enabledStateEvents["$stateNotFound"])
+ $stateProvider.onInvalid(stateNotFoundHandler);
+ if (enabledStateEvents.$stateChangeStart)
+ $transitions.onBefore({}, stateChangeStartHandler, { priority: 1000 });
+ return {
+ provider: $StateEventsProvider.prototype.instance
+ };
+ }
+ }
+ angular.module('ui.router.state.events', ['ui.router.state'])
+ .provider("$stateEvents", $StateEventsProvider)
+ .run(['$stateEvents', function ($stateEvents) {
+ }]);
+})();
+//# sourceMappingURL=stateEvents.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.js.map
new file mode 100644
index 00000000..b2f2220b
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/legacy/stateEvents.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "stateEvents.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/legacy/stateEvents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,CAAkB,CAAC;QAExC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,cAAc,CAAC,CAAC;QAChC,cAAc,YAA+B;YAC3C,OAAO,GAAG,IAAI,CAAC;YAEf,EAAE,CAAC,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;gBACvC,cAAc,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;YACjD,EAAE,CAAC,CAAC,kBAAkB,CAAC,iBAAiB,CAAC;gBACvC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAEzE,MAAM,CAAC;gBACL,QAAQ,EAAE,oBAAoB,CAAC,SAAS,CAAC,QAAQ;aAClD,CAAC;QACJ,CAAC;IACH,CAAC;IAGD,OAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,iBAAiB,CAAC,CAAC;SACxD,QAAQ,CAAC,cAAc,EAA4B,oBAAoB,CAAC;SACxE,GAAG,CAAC,CAAC,cAAc,EAAE,UAAU,YAAiB;QACjD,CAAC,CAAC,CAAC,CAAC;AACV,CAAC,CAAC,EAAE,CAAC",
+ "sourcesContent": [
+ "/**\n * # Legacy state events\n *\n * Polyfill implementation of the UI-Router 0.2.x state events.\n *\n * The 0.2.x state events are deprecated. We recommend moving to Transition Hooks instead, as they\n * provide much more flexibility, support async, and provide the context (the Transition, etc) necessary\n * to implement meaningful application behaviors.\n *\n * To enable these state events, include the `stateEvents.js` file in your project, e.g.,\n * ```\n * \n * ```\n * and also make sure you depend on the `ui.router.state.events` angular module, e.g.,\n * ```\n * angular.module(\"myApplication\", ['ui.router', 'ui.router.state.events']\n * ```\n *\n * @module ng1_state_events\n */ /** */\nimport { ng as angular } from \"../angular\";\nimport { IScope, IAngularEvent, IServiceProviderFactory } from \"angular\";\nimport {\n Obj, TargetState, StateService, Transition, TransitionService, UrlRouter, HookResult, UIInjector\n} from \"@uirouter/core\";\nimport { StateProvider } from \"../stateProvider\";\n\n/**\n * An event broadcast on `$rootScope` when the state transition **begins**.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] instead\n *\n * You can use `event.preventDefault()`\n * to prevent the transition from happening and then the transition promise will be\n * rejected with a `'transition prevented'` value.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]]\n *\n * #### Example:\n * ```js\n * $rootScope.$on('$stateChangeStart', function(event, transition) {\n * event.preventDefault();\n * // transitionTo() promise will be rejected with\n * // a 'transition prevented' error\n * })\n * ```\n *\n * @event $stateChangeStart\n * @deprecated\n */\nexport var $stateChangeStart: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` if a transition is **cancelled**.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] instead\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that was cancelled\n *\n * @event $stateChangeCancel\n * @deprecated\n */\nexport var $stateChangeCancel: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` once the state transition is **complete**.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onSuccess]]\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that just succeeded\n *\n * @event $stateChangeSuccess\n * @deprecated\n */\nexport var $stateChangeSuccess: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` when an **error occurs** during transition.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onError]]\n *\n * It's important to note that if you\n * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n * they will not throw traditionally. You must listen for this $stateChangeError event to\n * catch **ALL** errors.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `error`: The reason the transition errored.\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that errored\n *\n * @event $stateChangeError\n * @deprecated\n */\nexport var $stateChangeError: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` when a requested state **cannot be found** using the provided state name.\n *\n * ### Deprecation warning: use [[StateService.onInvalid]] instead\n *\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A `TargetState` object is passed to the listener handler,\n * you can see its properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `transitionTo()` will be rejected with a\n * `'transition aborted'` error.\n *\n * Additional arguments to the event handler are provided:\n * - `unfoundState` Unfound State information. Contains: `to, toParams, options` properties.\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n *\n * #### Example:\n * ```js\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", { a: 1, b: 2 }, { inherit: false });\n *\n * // somewhere else\n * $scope.$on('$stateNotFound', function(event, transition) {\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * });\n * ```\n *\n * @event $stateNotFound\n * @deprecated\n */\nexport var $stateNotFound: IAngularEvent;\n\n\n(function () {\n let { isFunction, isString } = angular;\n\n function applyPairs(memo: Obj, keyValTuple: any[]) {\n let key: string, value: any;\n if (Array.isArray(keyValTuple)) [key, value] = keyValTuple;\n if (!isString(key)) throw new Error(\"invalid parameters to applyPairs\");\n memo[key] = value;\n return memo;\n }\n\n function stateChangeStartHandler($transition$: Transition) {\n if (!$transition$.options().notify || !$transition$.valid() || $transition$.ignored())\n return;\n\n let $injector = $transition$.injector();\n let $stateEvents = $injector.get('$stateEvents');\n let $rootScope = $injector.get('$rootScope');\n let $state = $injector.get('$state');\n let $urlRouter = $injector.get('$urlRouter');\n\n let enabledEvents = $stateEvents.provider.enabled();\n\n\n let toParams = $transition$.params(\"to\");\n let fromParams = $transition$.params(\"from\");\n\n if (enabledEvents.$stateChangeSuccess) {\n let startEvent = $rootScope.$broadcast('$stateChangeStart', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n\n if (startEvent.defaultPrevented) {\n if (enabledEvents.$stateChangeCancel) {\n $rootScope.$broadcast('$stateChangeCancel', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n }\n //Don't update and resync url if there's been a new transition started. see issue #2238, #600\n if ($state.transition == null) $urlRouter.update();\n return false;\n }\n\n // right after global state is updated\n let successOpts = { priority: 9999 };\n $transition$.onSuccess({}, function () {\n $rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n }, successOpts);\n }\n\n if (enabledEvents.$stateChangeError) {\n $transition$.promise[\"catch\"](function (error) {\n if (error && (error.type === 2 /* RejectType.SUPERSEDED */ || error.type === 3 /* RejectType.ABORTED */))\n return;\n\n\n let evt = $rootScope.$broadcast('$stateChangeError', $transition$.to(), toParams, $transition$.from(), fromParams, error, $transition$.options(), $transition$);\n\n if (!evt.defaultPrevented) {\n $urlRouter.update();\n }\n });\n }\n }\n\n stateNotFoundHandler.$inject = ['$to$', '$from$', '$state', '$rootScope', '$urlRouter'];\n function stateNotFoundHandler($to$: TargetState, $from$: TargetState, injector: UIInjector): HookResult {\n let $state: StateService = injector.get('$state');\n let $rootScope: IScope = injector.get('$rootScope');\n let $urlRouter: UrlRouter = injector.get('$urlRouter');\n\n interface StateNotFoundEvent extends IAngularEvent {\n retry: Promise;\n }\n\n let redirect = { to: $to$.identifier(), toParams: $to$.params(), options: $to$.options() };\n let e = $rootScope.$broadcast('$stateNotFound', redirect, $from$.state(), $from$.params());\n\n if (e.defaultPrevented || e.retry)\n $urlRouter.update();\n\n function redirectFn(): TargetState {\n return $state.target(redirect.to, redirect.toParams, redirect.options);\n }\n\n if (e.defaultPrevented) {\n return false;\n } else if (e.retry || !!$state.get(redirect.to)) {\n return e.retry && isFunction(e.retry.then) ? e.retry.then(redirectFn) : redirectFn();\n }\n }\n\n $StateEventsProvider.$inject = ['$stateProvider'];\n function $StateEventsProvider($stateProvider: StateProvider) {\n $StateEventsProvider.prototype.instance = this;\n\n interface IEventsToggle {\n [key: string]: boolean;\n $stateChangeStart: boolean;\n $stateNotFound: boolean;\n $stateChangeSuccess: boolean;\n $stateChangeError: boolean;\n }\n\n let runtime = false;\n let allEvents = ['$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError'];\n let enabledStateEvents = allEvents.map(e => [e, true]).reduce(applyPairs, {});\n\n function assertNotRuntime() {\n if (runtime) throw new Error(\"Cannot enable events at runtime (use $stateEventsProvider\");\n }\n\n /**\n * Enables the deprecated UI-Router 0.2.x State Events\n * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]\n */\n this.enable = function (...events: string[]) {\n assertNotRuntime();\n if (!events || !events.length) events = allEvents;\n events.forEach(event => enabledStateEvents[event] = true);\n };\n\n /**\n * Disables the deprecated UI-Router 0.2.x State Events\n * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]\n */\n this.disable = function (...events: string[]) {\n assertNotRuntime();\n if (!events || !events.length) events = allEvents;\n events.forEach(event => delete enabledStateEvents[event]);\n };\n\n this.enabled = () => enabledStateEvents;\n\n this.$get = $get;\n $get.$inject = ['$transitions'];\n function $get($transitions: TransitionService) {\n runtime = true;\n\n if (enabledStateEvents[\"$stateNotFound\"])\n $stateProvider.onInvalid(stateNotFoundHandler);\n if (enabledStateEvents.$stateChangeStart)\n $transitions.onBefore({}, stateChangeStartHandler, { priority: 1000 });\n\n return {\n provider: $StateEventsProvider.prototype.instance\n };\n }\n }\n\n\n angular.module('ui.router.state.events', ['ui.router.state'])\n .provider(\"$stateEvents\", $StateEventsProvider)\n .run(['$stateEvents', function ($stateEvents: any) { /* Invokes $get() */\n }]);\n})();\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.d.ts
new file mode 100644
index 00000000..147d7312
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.d.ts
@@ -0,0 +1,43 @@
+
+/**
+ * @internalapi
+ * @module ng1
+ */ /** */
+import { LocationConfig, LocationServices, UIRouter } from "@uirouter/core";
+import { ILocationService, ILocationProvider } from "angular";
+/**
+ * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service
+ */
+export declare class Ng1LocationServices implements LocationConfig, LocationServices {
+ private $locationProvider;
+ private $location;
+ private $sniffer;
+ path: any;
+ search: any;
+ hash: any;
+ hashPrefix: any;
+ port: any;
+ protocol: any;
+ host: any;
+ baseHref: any;
+ private _urlListeners;
+ dispose(): void;
+ constructor($locationProvider: ILocationProvider);
+ onChange(callback: Function): () => Function[];
+ html5Mode(): any;
+ url(newUrl?: string, replace?: boolean, state?: any): string;
+ _runtimeServices($rootScope: any, $location: ILocationService, $sniffer: any, $browser: any): void;
+ /**
+ * Applys ng1-specific path parameter encoding
+ *
+ * The Angular 1 `$location` service is a bit weird.
+ * It doesn't allow slashes to be encoded/decoded bi-directionally.
+ *
+ * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
+ *
+ * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
+ *
+ * @param router
+ */
+ static monkeyPatchPathParameterType(router: UIRouter): void;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.js
new file mode 100644
index 00000000..23d206cb
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.js
@@ -0,0 +1,73 @@
+import { val, createProxyFunctions, removeFrom, isObject } from "@uirouter/core";
+/**
+ * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service
+ */
+var Ng1LocationServices = /** @class */ (function () {
+ function Ng1LocationServices($locationProvider) {
+ // .onChange() registry
+ this._urlListeners = [];
+ this.$locationProvider = $locationProvider;
+ var _lp = val($locationProvider);
+ createProxyFunctions(_lp, this, _lp, ['hashPrefix']);
+ }
+ Ng1LocationServices.prototype.dispose = function () { };
+ Ng1LocationServices.prototype.onChange = function (callback) {
+ var _this = this;
+ this._urlListeners.push(callback);
+ return function () { return removeFrom(_this._urlListeners)(callback); };
+ };
+ Ng1LocationServices.prototype.html5Mode = function () {
+ var html5Mode = this.$locationProvider.html5Mode();
+ html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;
+ return html5Mode && this.$sniffer.history;
+ };
+ Ng1LocationServices.prototype.url = function (newUrl, replace, state) {
+ if (replace === void 0) { replace = false; }
+ if (newUrl)
+ this.$location.url(newUrl);
+ if (replace)
+ this.$location.replace();
+ if (state)
+ this.$location.state(state);
+ return this.$location.url();
+ };
+ Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser) {
+ var _this = this;
+ this.$location = $location;
+ this.$sniffer = $sniffer;
+ // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange
+ $rootScope.$on("$locationChangeSuccess", function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); });
+ var _loc = val($location);
+ var _browser = val($browser);
+ // Bind these LocationService functions to $location
+ createProxyFunctions(_loc, this, _loc, ["replace", "path", "search", "hash"]);
+ // Bind these LocationConfig functions to $location
+ createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);
+ // Bind these LocationConfig functions to $browser
+ createProxyFunctions(_browser, this, _browser, ['baseHref']);
+ };
+ /**
+ * Applys ng1-specific path parameter encoding
+ *
+ * The Angular 1 `$location` service is a bit weird.
+ * It doesn't allow slashes to be encoded/decoded bi-directionally.
+ *
+ * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
+ *
+ * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
+ *
+ * @param router
+ */
+ Ng1LocationServices.monkeyPatchPathParameterType = function (router) {
+ var pathType = router.urlMatcherFactory.type('path');
+ pathType.encode = function (val) {
+ return val != null ? val.toString().replace(/(~|\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : val;
+ };
+ pathType.decode = function (val) {
+ return val != null ? val.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : val;
+ };
+ };
+ return Ng1LocationServices;
+}());
+export { Ng1LocationServices };
+//# sourceMappingURL=locationServices.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.js.map
new file mode 100644
index 00000000..d32c463e
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/locationServices.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "locationServices.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/locationServices.ts"
+ ],
+ "names": [],
+ "mappings": "AAKA,OAAO,EAAE,GAAG,EAAE,oBAAoB,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAGjF;;GAEG;AACH;IAmBE,6BAAY,iBAAoC;QALhD,uBAAuB;QACf,kBAAa,GAAe,EAAE,CAAC;QAKrC,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;QAC3C,IAAI,GAAG,GAAG,GAAG,CAAC,iBA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,GAAW;YAC1B,OAAA,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAA9B,CAA8B,CAAC,CAAC,CAAC,CAAC,GAAG;QAA5F,CAA4F,CAAC;IAEnG,CAAC;IACH,0BAAC;AAAD,CAAC,AAlFD,IAkFC",
+ "sourcesContent": [
+ "/**\n * @internalapi\n * @module ng1\n */ /** */\nimport { LocationConfig, LocationServices, UIRouter, ParamType } from \"@uirouter/core\";\nimport { val, createProxyFunctions, removeFrom, isObject } from \"@uirouter/core\";\nimport { ILocationService, ILocationProvider } from \"angular\";\n\n/**\n * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service\n */\nexport class Ng1LocationServices implements LocationConfig, LocationServices {\n private $locationProvider: ILocationProvider;\n private $location: ILocationService;\n private $sniffer;\n\n path;\n search;\n hash;\n hashPrefix;\n port;\n protocol;\n host;\n baseHref;\n\n // .onChange() registry\n private _urlListeners: Function[] = [];\n\n dispose() { }\n\n constructor($locationProvider: ILocationProvider) {\n this.$locationProvider = $locationProvider;\n let _lp = val($locationProvider);\n createProxyFunctions(_lp, this, _lp, ['hashPrefix']);\n }\n\n onChange(callback: Function) {\n this._urlListeners.push(callback);\n return () => removeFrom(this._urlListeners)(callback);\n }\n\n html5Mode() {\n let html5Mode: any = this.$locationProvider.html5Mode();\n html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;\n return html5Mode && this.$sniffer.history;\n }\n\n url(newUrl?: string, replace = false, state?) {\n if (newUrl) this.$location.url(newUrl);\n if (replace) this.$location.replace();\n if (state) this.$location.state(state);\n return this.$location.url();\n }\n\n _runtimeServices($rootScope, $location: ILocationService, $sniffer, $browser) {\n this.$location = $location;\n this.$sniffer = $sniffer;\n\n // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange\n $rootScope.$on(\"$locationChangeSuccess\", evt => this._urlListeners.forEach(fn => fn(evt)));\n let _loc = val($location);\n let _browser = val($browser);\n\n // Bind these LocationService functions to $location\n createProxyFunctions(_loc, this, _loc, [\"replace\", \"path\", \"search\", \"hash\"]);\n // Bind these LocationConfig functions to $location\n createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);\n // Bind these LocationConfig functions to $browser\n createProxyFunctions(_browser, this, _browser, ['baseHref']);\n }\n\n /**\n * Applys ng1-specific path parameter encoding\n *\n * The Angular 1 `$location` service is a bit weird.\n * It doesn't allow slashes to be encoded/decoded bi-directionally.\n *\n * See the writeup at https://github.com/angular-ui/ui-router/issues/2598\n *\n * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F\n *\n * @param router\n */\n static monkeyPatchPathParameterType(router: UIRouter) {\n let pathType: ParamType = router.urlMatcherFactory.type('path');\n\n pathType.encode = (val: any) =>\n val != null ? val.toString().replace(/(~|\\/)/g, m => ({ '~': '~~', '/': '~2F' }[m])) : val;\n\n pathType.decode = (val: string) =>\n val != null ? val.toString().replace(/(~~|~2F)/g, m => ({ '~~': '~', '~2F': '/' }[m])) : val;\n\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.d.ts
new file mode 100644
index 00000000..72217adc
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.d.ts
@@ -0,0 +1,16 @@
+
+import { IRootScopeService } from "angular";
+import { ResolveContext, TypedMap } from "@uirouter/core";
+import { StateProvider } from "./stateProvider";
+import { UrlRouterProvider } from "./urlRouterProvider";
+declare module '@uirouter/core/lib/router' {
+ interface UIRouter {
+ /** @hidden */
+ stateProvider: StateProvider;
+ /** @hidden */
+ urlRouterProvider: UrlRouterProvider;
+ }
+}
+export declare function watchDigests($rootScope: IRootScopeService): void;
+/** @hidden TODO: find a place to move this */
+export declare const getLocals: (ctx: ResolveContext) => TypedMap;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.js
new file mode 100644
index 00000000..3db9fa99
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.js
@@ -0,0 +1,113 @@
+/**
+ * # Angular 1 types
+ *
+ * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.
+ * The customizations to the core types for Angular UI-Router are documented here.
+ *
+ * The optional [[$resolve]] service is also documented here.
+ *
+ * @module ng1
+ * @preferred
+ */
+/** for typedoc */
+import { ng as angular } from "./angular";
+import { services, applyPairs, isString, trace, extend, UIRouter, unnestR } from "@uirouter/core";
+import { ng1ViewsBuilder, getNg1ViewConfigFactory } from "./statebuilders/views";
+import { TemplateFactory } from "./templateFactory";
+import { StateProvider } from "./stateProvider";
+import { getStateHookBuilder } from "./statebuilders/onEnterExitRetain";
+import { Ng1LocationServices } from "./locationServices";
+import { UrlRouterProvider } from "./urlRouterProvider";
+angular.module("ui.router.angular1", []);
+var mod_init = angular.module('ui.router.init', []);
+var mod_util = angular.module('ui.router.util', ['ng', 'ui.router.init']);
+var mod_rtr = angular.module('ui.router.router', ['ui.router.util']);
+var mod_state = angular.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);
+var mod_main = angular.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);
+var mod_cmpt = angular.module('ui.router.compat', ['ui.router']); // tslint:disable-line
+var router = null;
+$uiRouter.$inject = ['$locationProvider'];
+/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */
+function $uiRouter($locationProvider) {
+ // Create a new instance of the Router when the $uiRouterProvider is initialized
+ router = this.router = new UIRouter();
+ router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);
+ // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties
+ router.stateRegistry.decorator("views", ng1ViewsBuilder);
+ router.stateRegistry.decorator("onExit", getStateHookBuilder("onExit"));
+ router.stateRegistry.decorator("onRetain", getStateHookBuilder("onRetain"));
+ router.stateRegistry.decorator("onEnter", getStateHookBuilder("onEnter"));
+ router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());
+ var ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider);
+ Ng1LocationServices.monkeyPatchPathParameterType(router);
+ // backwards compat: also expose router instance as $uiRouterProvider.router
+ router['router'] = router;
+ router['$get'] = $get;
+ $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache'];
+ function $get($location, $browser, $sniffer, $rootScope, $http, $templateCache) {
+ ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser);
+ delete router['router'];
+ delete router['$get'];
+ return router;
+ }
+ return router;
+}
+var getProviderFor = function (serviceName) { return ['$uiRouterProvider', function ($urp) {
+ var service = $urp.router[serviceName];
+ service["$get"] = function () { return service; };
+ return service;
+ }]; };
+// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)
+runBlock.$inject = ['$injector', '$q', '$uiRouter'];
+function runBlock($injector, $q, $uiRouter) {
+ services.$injector = $injector;
+ services.$q = $q;
+ // The $injector is now available.
+ // Find any resolvables that had dependency annotation deferred
+ $uiRouter.stateRegistry.get()
+ .map(function (x) { return x.$$state().resolvables; })
+ .reduce(unnestR, [])
+ .filter(function (x) { return x.deps === "deferred"; })
+ .forEach(function (resolvable) { return resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi); });
+}
+// $urlRouter service and $urlRouterProvider
+var getUrlRouterProvider = function (uiRouter) {
+ return uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter);
+};
+// $state service and $stateProvider
+// $urlRouter service and $urlRouterProvider
+var getStateProvider = function () {
+ return extend(router.stateProvider, { $get: function () { return router.stateService; } });
+};
+watchDigests.$inject = ['$rootScope'];
+export function watchDigests($rootScope) {
+ $rootScope.$watch(function () { trace.approximateDigests++; });
+}
+mod_init.provider("$uiRouter", $uiRouter);
+mod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);
+mod_util.provider('$urlService', getProviderFor('urlService'));
+mod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]);
+mod_util.provider('$templateFactory', function () { return new TemplateFactory(); });
+mod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));
+mod_state.provider('$uiRouterGlobals', getProviderFor('globals'));
+mod_state.provider('$transitions', getProviderFor('transitionService'));
+mod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);
+mod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]);
+mod_main.factory('$view', function () { return router.viewService; });
+mod_main.service("$trace", function () { return trace; });
+mod_main.run(watchDigests);
+mod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]);
+mod_state.run(['$state', function ($state) { }]);
+mod_rtr.run(['$urlRouter', function ($urlRouter) { }]);
+mod_init.run(runBlock);
+/** @hidden TODO: find a place to move this */
+export var getLocals = function (ctx) {
+ var tokens = ctx.getTokens().filter(isString);
+ var tuples = tokens.map(function (key) {
+ var resolvable = ctx.getResolvable(key);
+ var waitPolicy = ctx.getPolicy(resolvable).async;
+ return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];
+ });
+ return tuples.reduce(applyPairs, {});
+};
+//# sourceMappingURL=services.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.js.map
new file mode 100644
index 00000000..185f21f8
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/services.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "services.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/services.ts"
+ ],
+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I,UAAU,GAAG,GAAG,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;QACjD,MAAM,CAAC,CAAE,GAAG,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAE,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC",
+ "sourcesContent": [
+ "/**\n * # Angular 1 types\n *\n * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.\n * The customizations to the core types for Angular UI-Router are documented here.\n *\n * The optional [[$resolve]] service is also documented here.\n *\n * @module ng1\n * @preferred\n */\n/** for typedoc */\nimport { ng as angular } from \"./angular\";\nimport {\n IRootScopeService, IQService, ILocationService, ILocationProvider, IHttpService, ITemplateCacheService\n} from \"angular\";\nimport {\n services, applyPairs, isString, trace, extend, UIRouter, StateService, UrlRouter, UrlMatcherFactory, ResolveContext,\n unnestR, TypedMap\n} from \"@uirouter/core\";\nimport { ng1ViewsBuilder, getNg1ViewConfigFactory } from \"./statebuilders/views\";\nimport { TemplateFactory } from \"./templateFactory\";\nimport { StateProvider } from \"./stateProvider\";\nimport { getStateHookBuilder } from \"./statebuilders/onEnterExitRetain\";\nimport { Ng1LocationServices } from \"./locationServices\";\nimport { UrlRouterProvider } from \"./urlRouterProvider\";\nimport IInjectorService = angular.auto.IInjectorService; // tslint:disable-line\n\nangular.module(\"ui.router.angular1\", []);\nlet mod_init = angular.module('ui.router.init', []);\nlet mod_util = angular.module('ui.router.util', ['ng', 'ui.router.init']);\nlet mod_rtr = angular.module('ui.router.router', ['ui.router.util']);\nlet mod_state = angular.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\nlet mod_main = angular.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\nlet mod_cmpt = angular.module('ui.router.compat', ['ui.router']); // tslint:disable-line\n\ndeclare module '@uirouter/core/lib/router' {\n interface UIRouter {\n /** @hidden */\n stateProvider: StateProvider;\n /** @hidden */\n urlRouterProvider: UrlRouterProvider;\n }\n}\n\nlet router: UIRouter = null;\n\n$uiRouter.$inject = ['$locationProvider'];\n/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */\nfunction $uiRouter($locationProvider: ILocationProvider) {\n\n // Create a new instance of the Router when the $uiRouterProvider is initialized\n router = this.router = new UIRouter();\n router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);\n\n // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties\n router.stateRegistry.decorator(\"views\", ng1ViewsBuilder);\n router.stateRegistry.decorator(\"onExit\", getStateHookBuilder(\"onExit\"));\n router.stateRegistry.decorator(\"onRetain\", getStateHookBuilder(\"onRetain\"));\n router.stateRegistry.decorator(\"onEnter\", getStateHookBuilder(\"onEnter\"));\n\n router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());\n\n let ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider);\n\n Ng1LocationServices.monkeyPatchPathParameterType(router);\n\n // backwards compat: also expose router instance as $uiRouterProvider.router\n router['router'] = router;\n router['$get'] = $get;\n $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache'];\n function $get($location: ILocationService, $browser: any, $sniffer: any, $rootScope: ng.IScope, $http: IHttpService, $templateCache: ITemplateCacheService) {\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser);\n delete router['router'];\n delete router['$get'];\n return router;\n }\n return router;\n}\n\nconst getProviderFor = (serviceName) => [ '$uiRouterProvider', ($urp) => {\n let service = $urp.router[serviceName];\n service[\"$get\"] = () => service;\n return service;\n}];\n\n// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\nfunction runBlock($injector: IInjectorService, $q: IQService, $uiRouter: UIRouter) {\n services.$injector = $injector;\n services.$q = $q;\n\n // The $injector is now available.\n // Find any resolvables that had dependency annotation deferred\n $uiRouter.stateRegistry.get()\n .map(x => x.$$state().resolvables)\n .reduce(unnestR, [])\n .filter(x => x.deps === \"deferred\")\n .forEach(resolvable => resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi));\n}\n\n// $urlRouter service and $urlRouterProvider\nconst getUrlRouterProvider = (uiRouter: UIRouter) =>\n uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter);\n\n// $state service and $stateProvider\n// $urlRouter service and $urlRouterProvider\nconst getStateProvider = () =>\n extend(router.stateProvider, { $get: () => router.stateService });\n\nwatchDigests.$inject = ['$rootScope'];\nexport function watchDigests($rootScope: IRootScopeService) {\n $rootScope.$watch(function() { trace.approximateDigests++; });\n}\n\nmod_init .provider(\"$uiRouter\", $uiRouter);\nmod_rtr .provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\nmod_util .provider('$urlService', getProviderFor('urlService'));\nmod_util .provider('$urlMatcherFactory', ['$uiRouterProvider', () => router.urlMatcherFactory]);\nmod_util .provider('$templateFactory', () => new TemplateFactory());\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\nmod_state.provider('$transitions', getProviderFor('transitionService'));\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\n\nmod_state.factory ('$stateParams', ['$uiRouter', ($uiRouter: UIRouter) => $uiRouter.globals.params]);\nmod_main .factory ('$view', () => router.viewService);\nmod_main .service (\"$trace\", () => trace);\n\nmod_main .run (watchDigests);\nmod_util .run (['$urlMatcherFactory', function ($urlMatcherFactory: UrlMatcherFactory) { }]);\nmod_state.run (['$state', function ($state: StateService) { }]);\nmod_rtr .run (['$urlRouter', function ($urlRouter: UrlRouter) { }]);\nmod_init .run (runBlock);\n\n/** @hidden TODO: find a place to move this */\nexport const getLocals = (ctx: ResolveContext): TypedMap => {\n let tokens = ctx.getTokens().filter(isString);\n\n let tuples = tokens .map(key => {\n let resolvable = ctx.getResolvable(key);\n let waitPolicy = ctx.getPolicy(resolvable).async;\n return [ key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data ];\n });\n\n return tuples.reduce(applyPairs, {});\n};\n\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.d.ts
new file mode 100644
index 00000000..1e2d747a
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.d.ts
@@ -0,0 +1,3 @@
+import { StateService } from "@uirouter/core";
+export declare function $IsStateFilter($state: StateService): any;
+export declare function $IncludedByStateFilter($state: StateService): any;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.js
new file mode 100644
index 00000000..f984c518
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.js
@@ -0,0 +1,42 @@
+/** @module ng1 */ /** for typedoc */
+import { ng as angular } from "./angular";
+/**
+ * `isState` Filter: truthy if the current state is the parameter
+ *
+ * Translates to [[StateService.is]] `$state.is("stateName")`.
+ *
+ * #### Example:
+ * ```html
+ *
show if state is 'stateName'
+ * ```
+ */
+$IsStateFilter.$inject = ['$state'];
+export function $IsStateFilter($state) {
+ var isFilter = function (state, params, options) {
+ return $state.is(state, params, options);
+ };
+ isFilter.$stateful = true;
+ return isFilter;
+}
+/**
+ * `includedByState` Filter: truthy if the current state includes the parameter
+ *
+ * Translates to [[StateService.includes]]` $state.is("fullOrPartialStateName")`.
+ *
+ * #### Example:
+ * ```html
+ *
show if state includes 'fullOrPartialStateName'
+ * ```
+ */
+$IncludedByStateFilter.$inject = ['$state'];
+export function $IncludedByStateFilter($state) {
+ var includesFilter = function (state, params, options) {
+ return $state.includes(state, params, options);
+ };
+ includesFilter.$stateful = true;
+ return includesFilter;
+}
+angular.module('ui.router.state')
+ .filter('isState', $IsStateFilter)
+ .filter('includedByState', $IncludedByStateFilter);
+//# sourceMappingURL=stateFilters.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.js.map
new file mode 100644
index 00000000..52370494
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateFilters.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "stateFilters.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/stateFilters.ts"
+ ],
+ "names": [],
+ "mappings": "AAAA,kBAAkB,CAAC,kBAAkB;AAErC,OAAO,EAAE,EAAE,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAG1C;;;;;;;;;GASG;AACH,cAAc,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AACpC,MAAM,yBAAyB,MAAoB;IACjD,IAAI,QAAQ,GAAQ,UAAS,KAAkB,EAAE,MAAW,EAAE,OAAoC;QAChG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC;IACF,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;;;;GASG;AACH,sBAAsB,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC5C,MAAM,iCAAiC,MAAoB;IACzD,IAAI,cAAc,GAAQ,UAAS,KAAkB,EAAE,MAAW,EAAE,OAAmC;QACrG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC,CAAC;IACF,cAAc,CAAC,SAAS,GAAG,IAAI,CAAC;IAChC,MAAM,CAAE,cAAc,CAAC;AACzB,CAAC;AAED,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;KAC9B,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC;KACjC,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** for typedoc */\n\nimport { ng as angular } from \"./angular\";\nimport { Obj, StateService, StateOrName } from \"@uirouter/core\";\n\n/**\n * `isState` Filter: truthy if the current state is the parameter\n *\n * Translates to [[StateService.is]] `$state.is(\"stateName\")`.\n *\n * #### Example:\n * ```html\n *
show if state is 'stateName'
\n * ```\n */\n$IsStateFilter.$inject = ['$state'];\nexport function $IsStateFilter($state: StateService) {\n var isFilter: any = function(state: StateOrName, params: Obj, options?: { relative?: StateOrName }) {\n return $state.is(state, params, options);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n\n/**\n * `includedByState` Filter: truthy if the current state includes the parameter\n *\n * Translates to [[StateService.includes]]` $state.is(\"fullOrPartialStateName\")`.\n *\n * #### Example:\n * ```html\n *
show if state includes 'fullOrPartialStateName'
\n * ```\n */\n$IncludedByStateFilter.$inject = ['$state'];\nexport function $IncludedByStateFilter($state: StateService) {\n var includesFilter: any = function(state: StateOrName, params: Obj, options: { relative?: StateOrName }) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\n\nangular.module('ui.router.state')\n .filter('isState', $IsStateFilter)\n .filter('includedByState', $IncludedByStateFilter);\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.d.ts
new file mode 100644
index 00000000..366b608d
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.d.ts
@@ -0,0 +1,254 @@
+/** @module ng1 */ /** for typedoc */
+import { BuilderFunction, StateRegistry, StateService, OnInvalidCallback } from "@uirouter/core";
+import { Ng1StateDeclaration } from "./interface";
+/**
+ * The Angular 1 `StateProvider`
+ *
+ * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
+ * on state.
+ *
+ * A state corresponds to a "place" in the application in terms of the overall UI and
+ * navigation. A state describes (via the controller / template / view properties) what
+ * the UI looks like and does at that place.
+ *
+ * States often have things in common, and the primary way of factoring out these
+ * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
+ * nested states.
+ *
+ * The `$stateProvider` provides interfaces to declare these states for your app.
+ */
+export declare class StateProvider {
+ private stateRegistry;
+ private stateService;
+ constructor(stateRegistry: StateRegistry, stateService: StateService);
+ /**
+ * Decorates states when they are registered
+ *
+ * Allows you to extend (carefully) or override (at your own peril) the
+ * `stateBuilder` object used internally by [[StateRegistry]].
+ * This can be used to add custom functionality to ui-router,
+ * for example inferring templateUrl based on the state name.
+ *
+ * When passing only a name, it returns the current (original or decorated) builder
+ * function that matches `name`.
+ *
+ * The builder functions that can be decorated are listed below. Though not all
+ * necessarily have a good use case for decoration, that is up to you to decide.
+ *
+ * In addition, users can attach custom decorators, which will generate new
+ * properties within the state's internal definition. There is currently no clear
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
+ * however, expect this to become increasingly relevant as we introduce additional
+ * meta-programming features.
+ *
+ * **Warning**: Decorators should not be interdependent because the order of
+ * execution of the builder functions in non-deterministic. Builder functions
+ * should only be dependent on the state definition object and super function.
+ *
+ *
+ * Existing builder functions and current return values:
+ *
+ * - **parent** `{object}` - returns the parent state object.
+ * - **data** `{object}` - returns state data, including any inherited data that is not
+ * overridden by own values (if any).
+ * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
+ * or `null`.
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
+ * navigable).
+ * - **params** `{object}` - returns an array of state params that are ensured to
+ * be a super-set of parent's params.
+ * - **views** `{object}` - returns a views object where each key is an absolute view
+ * name (i.e. "viewName@stateName") and each value is the config object
+ * (template, controller) for the view. Even when you don't use the views object
+ * explicitly on a state config, one is still created for you internally.
+ * So by decorating this builder function you have access to decorating template
+ * and controller properties.
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
+ * not including any params defined by ancestor states.
+ * - **path** `{string}` - returns the full path from the root down to this state.
+ * Needed for state activation.
+ * - **includes** `{object}` - returns an object that includes every state that
+ * would pass a `$state.includes()` test.
+ *
+ * #### Example:
+ * Override the internal 'views' builder with a function that takes the state
+ * definition, and a reference to the internal function being overridden:
+ * ```js
+ * $stateProvider.decorator('views', function (state, parent) {
+ * let result = {},
+ * views = parent(state);
+ *
+ * angular.forEach(views, function (config, name) {
+ * let autoName = (state.name + '.' + name).replace('.', '/');
+ * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+ * result[name] = config;
+ * });
+ * return result;
+ * });
+ *
+ * $stateProvider.state('home', {
+ * views: {
+ * 'contact.list': { controller: 'ListController' },
+ * 'contact.item': { controller: 'ItemController' }
+ * }
+ * });
+ * ```
+ *
+ *
+ * ```js
+ * // Auto-populates list and item views with /partials/home/contact/list.html,
+ * // and /partials/home/contact/item.html, respectively.
+ * $state.go('home');
+ * ```
+ *
+ * @param {string} name The name of the builder function to decorate.
+ * @param {object} func A function that is responsible for decorating the original
+ * builder function. The function receives two parameters:
+ *
+ * - `{object}` - state - The state config object.
+ * - `{object}` - super - The original builder function.
+ *
+ * @return {object} $stateProvider - $stateProvider instance
+ */
+ decorator(name: string, func: BuilderFunction): Function | this | BuilderFunction[];
+ /**
+ * Registers a state
+ *
+ * ### This is a passthrough to [[StateRegistry.register]].
+ *
+ * Registers a state configuration under a given state name.
+ * The stateConfig object has the following acceptable properties.
+ *
+ *
+ *
+ * - **`template`** - {string|function=} - html template as a string or a function that returns
+ * an html template as a string which should be used by the uiView directives. This property
+ * takes precedence over templateUrl.
+ *
+ * If `template` is a function, it will be called with the following parameters:
+ *
+ * - {array.<object>} - state parameters extracted from the current $location.path() by
+ * applying the current state
+ *
+ *
+ *
+ * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html
+ * template that should be used by uiView.
+ *
+ * If `templateUrl` is a function, it will be called with the following parameters:
+ *
+ * - {array.<object>} - state parameters extracted from the current $location.path() by
+ * applying the current state
+ *
+ *
+ *
+ * - **`templateProvider`** - {function=} - Provider function that returns HTML content
+ * string.
+ *
+ *
+ *
+ * - **`controller`** - {string|function=} - Controller fn that should be associated with newly
+ * related scope or the name of a registered controller if passed as a string.
+ *
+ *
+ *
+ * - **`controllerProvider`** - {function=} - Injectable provider function that returns
+ * the actual controller or string.
+ *
+ *
+ *
+ * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be
+ * published to scope under the controllerAs name.
+ *
+ *
+ *
+ * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which
+ * should be injected into the controller. If any of these dependencies are promises,
+ * the router will wait for them all to be resolved or one to be rejected before the
+ * controller is instantiated. If all the promises are resolved successfully, the values
+ * of the resolved promises are injected and $stateChangeSuccess event is fired. If any
+ * of the promises are rejected the $stateChangeError event is fired. The map object is:
+ *
+ * - key - {string}: name of dependency to be injected into controller
+ * - factory - {string|function}: If string then it is alias for service. Otherwise if function,
+ * it is injected and return value it treated as dependency. If result is a promise, it is
+ * resolved before its value is injected into controller.
+ *
+ *
+ *
+ * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or
+ * transitioned to, the `$stateParams` service will be populated with any
+ * parameters that were passed.
+ *
+ *
+ *
+ * - **`params`** - {object=} - An array of parameter names or regular expressions. Only
+ * use this within a state if you are not using url. Otherwise you can specify your
+ * parameters within the url. When a state is navigated or transitioned to, the
+ * $stateParams service will be populated with any parameters that were passed.
+ *
+ *
+ *
+ * - **`views`** - {object=} - Use the views property to set up multiple views or to target views
+ * manually/explicitly.
+ *
+ *
+ *
+ * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,
+ * but can provide inherited properties to its common children states.
+ *
+ *
+ *
+ * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way
+ * to trigger an action or dispatch an event, such as opening a dialog.
+ * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
+ *
+ *
+ *
+ * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to
+ * trigger an action or dispatch an event, such as opening a dialog.
+ * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
+ *
+ *
+ *
+ * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state
+ * just because a search/query parameter has changed (via $location.search() or $location.hash()).
+ * Useful for when you'd like to modify $location.search() without triggering a reload.
+ *
+ *
+ *
+ * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.
+ *
+ * #### Example:
+ * Some state name examples
+ * ```js
+ * // stateName can be a single top-level name (must be unique).
+ * $stateProvider.state("home", {});
+ *
+ * // Or it can be a nested state name. This state is a child of the
+ * // above "home" state.
+ * $stateProvider.state("home.newest", {});
+ *
+ * // Nest states as deeply as needed.
+ * $stateProvider.state("home.newest.abc.xyz.inception", {});
+ *
+ * // state() returns $stateProvider, so you can chain state declarations.
+ * $stateProvider
+ * .state("home", {})
+ * .state("about", {})
+ * .state("contacts", {});
+ * ```
+ *
+ * @param {string} name A unique state name, e.g. "home", "about", "contacts".
+ * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
+ * @param {object} definition State configuration object.
+ */
+ state(name: string, definition: Ng1StateDeclaration): StateProvider;
+ state(definition: Ng1StateDeclaration): StateProvider;
+ /**
+ * Registers an invalid state handler
+ *
+ * This is a passthrough to [[StateService.onInvalid]] for ng1.
+ */
+ onInvalid(callback: OnInvalidCallback): Function;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.js
new file mode 100644
index 00000000..7d7e9e07
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.js
@@ -0,0 +1,138 @@
+/** @module ng1 */ /** for typedoc */
+import { val, isObject, createProxyFunctions } from "@uirouter/core";
+/**
+ * The Angular 1 `StateProvider`
+ *
+ * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
+ * on state.
+ *
+ * A state corresponds to a "place" in the application in terms of the overall UI and
+ * navigation. A state describes (via the controller / template / view properties) what
+ * the UI looks like and does at that place.
+ *
+ * States often have things in common, and the primary way of factoring out these
+ * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
+ * nested states.
+ *
+ * The `$stateProvider` provides interfaces to declare these states for your app.
+ */
+var StateProvider = /** @class */ (function () {
+ function StateProvider(stateRegistry, stateService) {
+ this.stateRegistry = stateRegistry;
+ this.stateService = stateService;
+ createProxyFunctions(val(StateProvider.prototype), this, val(this));
+ }
+ /**
+ * Decorates states when they are registered
+ *
+ * Allows you to extend (carefully) or override (at your own peril) the
+ * `stateBuilder` object used internally by [[StateRegistry]].
+ * This can be used to add custom functionality to ui-router,
+ * for example inferring templateUrl based on the state name.
+ *
+ * When passing only a name, it returns the current (original or decorated) builder
+ * function that matches `name`.
+ *
+ * The builder functions that can be decorated are listed below. Though not all
+ * necessarily have a good use case for decoration, that is up to you to decide.
+ *
+ * In addition, users can attach custom decorators, which will generate new
+ * properties within the state's internal definition. There is currently no clear
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
+ * however, expect this to become increasingly relevant as we introduce additional
+ * meta-programming features.
+ *
+ * **Warning**: Decorators should not be interdependent because the order of
+ * execution of the builder functions in non-deterministic. Builder functions
+ * should only be dependent on the state definition object and super function.
+ *
+ *
+ * Existing builder functions and current return values:
+ *
+ * - **parent** `{object}` - returns the parent state object.
+ * - **data** `{object}` - returns state data, including any inherited data that is not
+ * overridden by own values (if any).
+ * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
+ * or `null`.
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
+ * navigable).
+ * - **params** `{object}` - returns an array of state params that are ensured to
+ * be a super-set of parent's params.
+ * - **views** `{object}` - returns a views object where each key is an absolute view
+ * name (i.e. "viewName@stateName") and each value is the config object
+ * (template, controller) for the view. Even when you don't use the views object
+ * explicitly on a state config, one is still created for you internally.
+ * So by decorating this builder function you have access to decorating template
+ * and controller properties.
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
+ * not including any params defined by ancestor states.
+ * - **path** `{string}` - returns the full path from the root down to this state.
+ * Needed for state activation.
+ * - **includes** `{object}` - returns an object that includes every state that
+ * would pass a `$state.includes()` test.
+ *
+ * #### Example:
+ * Override the internal 'views' builder with a function that takes the state
+ * definition, and a reference to the internal function being overridden:
+ * ```js
+ * $stateProvider.decorator('views', function (state, parent) {
+ * let result = {},
+ * views = parent(state);
+ *
+ * angular.forEach(views, function (config, name) {
+ * let autoName = (state.name + '.' + name).replace('.', '/');
+ * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+ * result[name] = config;
+ * });
+ * return result;
+ * });
+ *
+ * $stateProvider.state('home', {
+ * views: {
+ * 'contact.list': { controller: 'ListController' },
+ * 'contact.item': { controller: 'ItemController' }
+ * }
+ * });
+ * ```
+ *
+ *
+ * ```js
+ * // Auto-populates list and item views with /partials/home/contact/list.html,
+ * // and /partials/home/contact/item.html, respectively.
+ * $state.go('home');
+ * ```
+ *
+ * @param {string} name The name of the builder function to decorate.
+ * @param {object} func A function that is responsible for decorating the original
+ * builder function. The function receives two parameters:
+ *
+ * - `{object}` - state - The state config object.
+ * - `{object}` - super - The original builder function.
+ *
+ * @return {object} $stateProvider - $stateProvider instance
+ */
+ StateProvider.prototype.decorator = function (name, func) {
+ return this.stateRegistry.decorator(name, func) || this;
+ };
+ StateProvider.prototype.state = function (name, definition) {
+ if (isObject(name)) {
+ definition = name;
+ }
+ else {
+ definition.name = name;
+ }
+ this.stateRegistry.register(definition);
+ return this;
+ };
+ /**
+ * Registers an invalid state handler
+ *
+ * This is a passthrough to [[StateService.onInvalid]] for ng1.
+ */
+ StateProvider.prototype.onInvalid = function (callback) {
+ return this.stateService.onInvalid(callback);
+ };
+ return StateProvider;
+}());
+export { StateProvider };
+//# sourceMappingURL=stateProvider.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.js.map
new file mode 100644
index 00000000..a98bedf2
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/stateProvider.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "stateProvider.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/stateProvider.ts"
+ ],
+ "names": [],
+ "mappings": "AAAA,kBAAkB,CAAC,kBAAkB;AACrC,OAAO,EACH,GAAG,EAAE,QAAQ,EAAE,oBAAoB,EACtC,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;GAeG;AACH;IACE,uBAAoB,aAA4B,EAAU,YAA0B;QAAhE,kBAAa,GAAb,aAAa,CAAe;QAAU,iBAAY,GAAZ,YAAY,CAAc;QAClF,oBAAoB,CAAC,GAAG,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwFG;IACH,iCAAS,GAAT,UAAU,IAAY,EAAE,IAAqB;QAC3C,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;IAC1D,CAAC;IAwID,6BAAK,GAAL,UAAM,IAAS,EAAE,UAAgB;QAC/B,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IAEH,iCAAS,GAAT,UAAU,QAA2B;QACnC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACH,oBAAC;AAAD,CAAC,AA3PD,IA2PC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** for typedoc */\nimport {\n val, isObject, createProxyFunctions, BuilderFunction, StateRegistry, StateService, OnInvalidCallback\n} from \"@uirouter/core\";\nimport { Ng1StateDeclaration } from \"./interface\";\n\n/**\n * The Angular 1 `StateProvider`\n *\n * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\nexport class StateProvider {\n constructor(private stateRegistry: StateRegistry, private stateService: StateService) {\n createProxyFunctions(val(StateProvider.prototype), this, val(this));\n }\n\n /**\n * Decorates states when they are registered\n *\n * Allows you to extend (carefully) or override (at your own peril) the\n * `stateBuilder` object used internally by [[StateRegistry]].\n * This can be used to add custom functionality to ui-router,\n * for example inferring templateUrl based on the state name.\n *\n * When passing only a name, it returns the current (original or decorated) builder\n * function that matches `name`.\n *\n * The builder functions that can be decorated are listed below. Though not all\n * necessarily have a good use case for decoration, that is up to you to decide.\n *\n * In addition, users can attach custom decorators, which will generate new\n * properties within the state's internal definition. There is currently no clear\n * use-case for this beyond accessing internal states (i.e. $state.$current),\n * however, expect this to become increasingly relevant as we introduce additional\n * meta-programming features.\n *\n * **Warning**: Decorators should not be interdependent because the order of\n * execution of the builder functions in non-deterministic. Builder functions\n * should only be dependent on the state definition object and super function.\n *\n *\n * Existing builder functions and current return values:\n *\n * - **parent** `{object}` - returns the parent state object.\n * - **data** `{object}` - returns state data, including any inherited data that is not\n * overridden by own values (if any).\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n * or `null`.\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is\n * navigable).\n * - **params** `{object}` - returns an array of state params that are ensured to\n * be a super-set of parent's params.\n * - **views** `{object}` - returns a views object where each key is an absolute view\n * name (i.e. \"viewName@stateName\") and each value is the config object\n * (template, controller) for the view. Even when you don't use the views object\n * explicitly on a state config, one is still created for you internally.\n * So by decorating this builder function you have access to decorating template\n * and controller properties.\n * - **ownParams** `{object}` - returns an array of params that belong to the state,\n * not including any params defined by ancestor states.\n * - **path** `{string}` - returns the full path from the root down to this state.\n * Needed for state activation.\n * - **includes** `{object}` - returns an object that includes every state that\n * would pass a `$state.includes()` test.\n *\n * #### Example:\n * Override the internal 'views' builder with a function that takes the state\n * definition, and a reference to the internal function being overridden:\n * ```js\n * $stateProvider.decorator('views', function (state, parent) {\n * let result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * let autoName = (state.name + '.' + name).replace('.', '/');\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n * result[name] = config;\n * });\n * return result;\n * });\n *\n * $stateProvider.state('home', {\n * views: {\n * 'contact.list': { controller: 'ListController' },\n * 'contact.item': { controller: 'ItemController' }\n * }\n * });\n * ```\n *\n *\n * ```js\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * $state.go('home');\n * ```\n *\n * @param {string} name The name of the builder function to decorate.\n * @param {object} func A function that is responsible for decorating the original\n * builder function. The function receives two parameters:\n *\n * - `{object}` - state - The state config object.\n * - `{object}` - super - The original builder function.\n *\n * @return {object} $stateProvider - $stateProvider instance\n */\n decorator(name: string, func: BuilderFunction) {\n return this.stateRegistry.decorator(name, func) || this;\n }\n\n /**\n * Registers a state\n *\n * ### This is a passthrough to [[StateRegistry.register]].\n *\n * Registers a state configuration under a given state name.\n * The stateConfig object has the following acceptable properties.\n *\n * \n *\n * - **`template`** - {string|function=} - html template as a string or a function that returns\n * an html template as a string which should be used by the uiView directives. This property\n * takes precedence over templateUrl.\n *\n * If `template` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * \n *\n * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html\n * template that should be used by uiView.\n *\n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * \n *\n * - **`templateProvider`** - {function=} - Provider function that returns HTML content\n * string.\n *\n * \n *\n * - **`controller`** - {string|function=} - Controller fn that should be associated with newly\n * related scope or the name of a registered controller if passed as a string.\n *\n * \n *\n * - **`controllerProvider`** - {function=} - Injectable provider function that returns\n * the actual controller or string.\n *\n * \n *\n * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be\n * published to scope under the controllerAs name.\n *\n * \n *\n * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which\n * should be injected into the controller. If any of these dependencies are promises,\n * the router will wait for them all to be resolved or one to be rejected before the\n * controller is instantiated. If all the promises are resolved successfully, the values\n * of the resolved promises are injected and $stateChangeSuccess event is fired. If any\n * of the promises are rejected the $stateChangeError event is fired. The map object is:\n *\n * - key - {string}: name of dependency to be injected into controller\n * - factory - {string|function}: If string then it is alias for service. Otherwise if function,\n * it is injected and return value it treated as dependency. If result is a promise, it is\n * resolved before its value is injected into controller.\n *\n * \n *\n * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or\n * transitioned to, the `$stateParams` service will be populated with any\n * parameters that were passed.\n *\n * \n *\n * - **`params`** - {object=} - An array of parameter names or regular expressions. Only\n * use this within a state if you are not using url. Otherwise you can specify your\n * parameters within the url. When a state is navigated or transitioned to, the\n * $stateParams service will be populated with any parameters that were passed.\n *\n * \n *\n * - **`views`** - {object=} - Use the views property to set up multiple views or to target views\n * manually/explicitly.\n *\n * \n *\n * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,\n * but can provide inherited properties to its common children states.\n *\n * \n *\n * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way\n * to trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.\n *\n * \n *\n * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to\n * trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.\n *\n * \n *\n * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state\n * just because a search/query parameter has changed (via $location.search() or $location.hash()).\n * Useful for when you'd like to modify $location.search() without triggering a reload.\n *\n * \n *\n * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.\n *\n * #### Example:\n * Some state name examples\n * ```js\n * // stateName can be a single top-level name (must be unique).\n * $stateProvider.state(\"home\", {});\n *\n * // Or it can be a nested state name. This state is a child of the\n * // above \"home\" state.\n * $stateProvider.state(\"home.newest\", {});\n *\n * // Nest states as deeply as needed.\n * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n *\n * // state() returns $stateProvider, so you can chain state declarations.\n * $stateProvider\n * .state(\"home\", {})\n * .state(\"about\", {})\n * .state(\"contacts\", {});\n * ```\n *\n * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n * @param {object} definition State configuration object.\n */\n state(name: string, definition: Ng1StateDeclaration): StateProvider;\n state(definition: Ng1StateDeclaration): StateProvider;\n state(name: any, definition?: any) {\n if (isObject(name)) {\n definition = name;\n } else {\n definition.name = name;\n }\n this.stateRegistry.register(definition);\n return this;\n }\n\n /**\n * Registers an invalid state handler\n *\n * This is a passthrough to [[StateService.onInvalid]] for ng1.\n */\n\n onInvalid(callback: OnInvalidCallback): Function {\n return this.stateService.onInvalid(callback);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.d.ts
new file mode 100644
index 00000000..94bc8bdc
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.d.ts
@@ -0,0 +1,10 @@
+/** @module ng1 */ /** */
+import { StateObject, TransitionStateHookFn, BuilderFunction } from "@uirouter/core";
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
+ * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
+ */
+export declare const getStateHookBuilder: (hookName: "onEnter" | "onExit" | "onRetain") => (state: StateObject, parentFn: BuilderFunction) => TransitionStateHookFn;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js
new file mode 100644
index 00000000..2a999dee
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js
@@ -0,0 +1,23 @@
+/** @module ng1 */ /** */
+import { services, ResolveContext, extend } from "@uirouter/core";
+import { getLocals } from "../services";
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
+ * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
+ */
+export var getStateHookBuilder = function (hookName) {
+ return function stateHookBuilder(state, parentFn) {
+ var hook = state[hookName];
+ var pathname = hookName === 'onExit' ? 'from' : 'to';
+ function decoratedNg1Hook(trans, state) {
+ var resolveContext = new ResolveContext(trans.treeChanges(pathname));
+ var locals = extend(getLocals(resolveContext), { $state$: state, $transition$: trans });
+ return services.$injector.invoke(hook, this, locals);
+ }
+ return hook ? decoratedNg1Hook : undefined;
+ };
+};
+//# sourceMappingURL=onEnterExitRetain.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js.map
new file mode 100644
index 00000000..d3e47cdb
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/onEnterExitRetain.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "onEnterExitRetain.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/statebuilders/onEnterExitRetain.ts"
+ ],
+ "names": [],
+ "mappings": "AAAA,kBAAkB,CAAC,MAAM;AACzB,OAAO,EACuD,QAAQ,EAAE,cAAc,EAAE,MAAM,EAC7F,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;;;;GAMG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG,UAAC,QAAuC;IAC3E,OAAA,0BAA0B,KAAkB,EAAE,QAAyB;QACrE,IAAI,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAErD,0BAA0B,KAAiB,EAAE,KAA0B;YACrE,IAAI,cAAc,GAAG,IAAI,cAAc,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;YACrE,IAAI,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;YACxF,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,CAAC;AAXD,CAWC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport {\n StateObject, TransitionStateHookFn, HookResult, Transition, services, ResolveContext, extend, BuilderFunction\n} from \"@uirouter/core\";\nimport { getLocals } from \"../services\";\nimport { Ng1StateDeclaration } from '../interface';\n\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,\n * `onRetain` callback hooks on a [[Ng1StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * ensures that those hooks are injectable for @uirouter/angularjs (ng1).\n */\nexport const getStateHookBuilder = (hookName: \"onEnter\"|\"onExit\"|\"onRetain\") =>\nfunction stateHookBuilder(state: StateObject, parentFn: BuilderFunction): TransitionStateHookFn {\n let hook = state[hookName];\n let pathname = hookName === 'onExit' ? 'from' : 'to';\n\n function decoratedNg1Hook(trans: Transition, state: Ng1StateDeclaration): HookResult {\n let resolveContext = new ResolveContext(trans.treeChanges(pathname));\n let locals = extend(getLocals(resolveContext), { $state$: state, $transition$: trans });\n return services.$injector.invoke(hook, this, locals);\n }\n\n return hook ? decoratedNg1Hook : undefined;\n};\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.d.ts
new file mode 100644
index 00000000..687ad4a4
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.d.ts
@@ -0,0 +1,34 @@
+import { StateObject, ViewConfig, ViewConfigFactory, PathNode, ResolveContext, IInjectable } from "@uirouter/core";
+import { Ng1ViewDeclaration } from "../interface";
+import { TemplateFactory } from "../templateFactory";
+export declare function getNg1ViewConfigFactory(): ViewConfigFactory;
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `views`.
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
+ *
+ * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
+ * and applies the state-level configuration to a view named `$default`.
+ */
+export declare function ng1ViewsBuilder(state: StateObject): {};
+export declare class Ng1ViewConfig implements ViewConfig {
+ path: PathNode[];
+ viewDecl: Ng1ViewDeclaration;
+ factory: TemplateFactory;
+ $id: number;
+ loaded: boolean;
+ controller: Function;
+ template: string;
+ component: string;
+ locals: any;
+ constructor(path: PathNode[], viewDecl: Ng1ViewDeclaration, factory: TemplateFactory);
+ load(): Promise;
+ getTemplate: (uiView: any, context: ResolveContext) => string;
+ /**
+ * Gets the controller for a view configuration.
+ *
+ * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.
+ */
+ getController(context: ResolveContext): (IInjectable | string | Promise);
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js
new file mode 100644
index 00000000..702ce9e8
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js
@@ -0,0 +1,105 @@
+import { pick, forEach, tail, extend, isArray, isInjectable, isDefined, isString, services, trace, ViewService, ResolveContext, Resolvable } from "@uirouter/core";
+export function getNg1ViewConfigFactory() {
+ var templateFactory = null;
+ return function (path, view) {
+ templateFactory = templateFactory || services.$injector.get("$templateFactory");
+ return [new Ng1ViewConfig(path, view, templateFactory)];
+ };
+}
+var hasAnyKey = function (keys, obj) {
+ return keys.reduce(function (acc, key) { return acc || isDefined(obj[key]); }, false);
+};
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `views`.
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
+ *
+ * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
+ * and applies the state-level configuration to a view named `$default`.
+ */
+export function ng1ViewsBuilder(state) {
+ // Do not process root state
+ if (!state.parent)
+ return {};
+ var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);
+ // Do not allow a state to have both state-level props and also a `views: {}` property.
+ // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.
+ // However, the `$default` approach should not be mixed with a separate `views: ` block.
+ if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {
+ throw new Error("State '" + state.name + "' has a 'views' object. " +
+ "It cannot also have \"view properties\" at the state level. " +
+ "Move the following properties into a view (in the 'views' object): " +
+ (" " + allViewKeys.filter(function (key) { return isDefined(state[key]); }).join(", ")));
+ }
+ var views = {}, viewsObject = state.views || { "$default": pick(state, allViewKeys) };
+ forEach(viewsObject, function (config, name) {
+ // Account for views: { "": { template... } }
+ name = name || "$default";
+ // Account for views: { header: "headerComponent" }
+ if (isString(config))
+ config = { component: config };
+ // Make a shallow copy of the config object
+ config = extend({}, config);
+ // Do not allow a view to mix props for component-style view with props for template/controller-style view
+ if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {
+ throw new Error("Cannot combine: " + compKeys.join("|") + " with: " + nonCompKeys.join("|") + " in stateview: '" + name + "@" + state.name + "'");
+ }
+ config.resolveAs = config.resolveAs || '$resolve';
+ config.$type = "ng1";
+ config.$context = state;
+ config.$name = name;
+ var normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);
+ config.$uiViewName = normalized.uiViewName;
+ config.$uiViewContextAnchor = normalized.uiViewContextAnchor;
+ views[name] = config;
+ });
+ return views;
+}
+var id = 0;
+var Ng1ViewConfig = /** @class */ (function () {
+ function Ng1ViewConfig(path, viewDecl, factory) {
+ var _this = this;
+ this.path = path;
+ this.viewDecl = viewDecl;
+ this.factory = factory;
+ this.$id = id++;
+ this.loaded = false;
+ this.getTemplate = function (uiView, context) {
+ return _this.component ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) : _this.template;
+ };
+ }
+ Ng1ViewConfig.prototype.load = function () {
+ var _this = this;
+ var $q = services.$q;
+ var context = new ResolveContext(this.path);
+ var params = this.path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});
+ var promises = {
+ template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),
+ controller: $q.when(this.getController(context))
+ };
+ return $q.all(promises).then(function (results) {
+ trace.traceViewServiceEvent("Loaded", _this);
+ _this.controller = results.controller;
+ extend(_this, results.template); // Either { template: "tpl" } or { component: "cmpName" }
+ return _this;
+ });
+ };
+ /**
+ * Gets the controller for a view configuration.
+ *
+ * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.
+ */
+ Ng1ViewConfig.prototype.getController = function (context) {
+ var provider = this.viewDecl.controllerProvider;
+ if (!isInjectable(provider))
+ return this.viewDecl.controller;
+ var deps = services.$injector.annotate(provider);
+ var providerFn = isArray(provider) ? tail(provider) : provider;
+ var resolvable = new Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ return Ng1ViewConfig;
+}());
+export { Ng1ViewConfig };
+//# sourceMappingURL=views.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js.map
new file mode 100644
index 00000000..6357dcb6
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/statebuilders/views.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "views.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/statebuilders/views.ts"
+ ],
+ "names": [],
+ "mappings": "AAEA,OAAO,EACU,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EACxC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAC/C,WAAW,EAA+B,cAAc,EAAE,UAAU,EACnF,MAAM,gBAAgB,CAAC;AAKxB,MAAM;IACJ,IAAI,eAAe,GAAoB,IAAI,CAAC;IAC5C,MAAM,CAAC,UAAC,IAAI,EAAE,IAAI;QAChB,eAAe,GAAG,eAAe,IAAI,QAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChF,MAAM,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC;AAED,IAAM,SAAS,GAAG,UAAC,IAAI,EAAE,GAAG;IACxB,OAAA,IAAI,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,GAAG,IAAK,OAAA,GAAG,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAA1B,CAA0B,EAAE,KAAK,CAAC;AAA5D,CAA4D,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,0BAA0B,KAAkB;IAChD,4BAA4B;IAC5B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,CAAC;IAE7B,IAAI,OAAO,GAAG,CAAC,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC5E,Q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AAI,CAAC,QAAQ,CAAC,UAAU,CAAC;QAC7D,IAAI,IAAI,GAAG,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACjD,IAAI,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrE,IAAI,UAAU,GAAG,IAAI,UAAU,CAAC,EAAE,EAAQ,UAAU,EAAE,IAAI,CAAC,CAAC;QAC5D,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IACH,oBAAC;AAAD,CAAC,AA5CD,IA4CC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport { ng as angular } from \"../angular\";\nimport {\n StateObject, pick, forEach, tail, extend,\n isArray, isInjectable, isDefined, isString, services, trace,\n ViewConfig, ViewService, ViewConfigFactory, PathNode, ResolveContext, Resolvable, IInjectable\n} from \"@uirouter/core\";\nimport { Ng1ViewDeclaration } from \"../interface\";\nimport { TemplateFactory } from \"../templateFactory\";\nimport IInjectorService = angular.auto.IInjectorService;\n\nexport function getNg1ViewConfigFactory(): ViewConfigFactory {\n let templateFactory: TemplateFactory = null;\n return (path, view) => {\n templateFactory = templateFactory || services.$injector.get(\"$templateFactory\");\n return [new Ng1ViewConfig(path, view, templateFactory)];\n };\n}\n\nconst hasAnyKey = (keys, obj) =>\n keys.reduce((acc, key) => acc || isDefined(obj[key]), false);\n\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `views`.\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * handles the `views` property with logic specific to @uirouter/angularjs (ng1).\n *\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object\n * and applies the state-level configuration to a view named `$default`.\n */\nexport function ng1ViewsBuilder(state: StateObject) {\n // Do not process root state\n if (!state.parent) return {};\n\n let tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'],\n ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'],\n compKeys = ['component', 'bindings', 'componentProvider'],\n nonCompKeys = tplKeys.concat(ctrlKeys),\n allViewKeys = compKeys.concat(nonCompKeys);\n\n // Do not allow a state to have both state-level props and also a `views: {}` property.\n // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.\n // However, the `$default` approach should not be mixed with a separate `views: ` block.\n if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {\n throw new Error(`State '${state.name}' has a 'views' object. ` +\n `It cannot also have \"view properties\" at the state level. ` +\n `Move the following properties into a view (in the 'views' object): ` +\n ` ${allViewKeys.filter(key => isDefined(state[key])).join(\", \")}`);\n }\n\n let views: { [key: string]: Ng1ViewDeclaration } = {},\n viewsObject = state.views || { \"$default\": pick(state, allViewKeys) };\n\n forEach(viewsObject, function (config: Ng1ViewDeclaration, name: string) {\n // Account for views: { \"\": { template... } }\n name = name || \"$default\";\n // Account for views: { header: \"headerComponent\" }\n if (isString(config)) config = { component: config };\n\n // Make a shallow copy of the config object\n config = extend({}, config);\n\n // Do not allow a view to mix props for component-style view with props for template/controller-style view\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\n throw new Error(`Cannot combine: ${compKeys.join(\"|\")} with: ${nonCompKeys.join(\"|\")} in stateview: '${name}@${state.name}'`);\n }\n\n config.resolveAs = config.resolveAs || '$resolve';\n config.$type = \"ng1\";\n config.$context = state;\n config.$name = name;\n\n let normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\n config.$uiViewName = normalized.uiViewName;\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\n\n views[name] = config;\n });\n return views;\n}\n\nlet id = 0;\nexport class Ng1ViewConfig implements ViewConfig {\n $id = id++;\n loaded: boolean = false;\n controller: Function; // actually IInjectable|string\n template: string;\n component: string;\n locals: any; // TODO: delete me\n\n constructor(public path: PathNode[], public viewDecl: Ng1ViewDeclaration, public factory: TemplateFactory) { }\n\n load() {\n let $q = services.$q;\n let context = new ResolveContext(this.path);\n let params = this.path.reduce((acc, node) => extend(acc, node.paramValues), {});\n\n let promises: any = {\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\n controller: $q.when(this.getController(context))\n };\n\n return $q.all(promises).then((results) => {\n trace.traceViewServiceEvent(\"Loaded\", this);\n this.controller = results.controller;\n extend(this, results.template); // Either { template: \"tpl\" } or { component: \"cmpName\" }\n return this;\n });\n }\n\n getTemplate = (uiView, context: ResolveContext) =>\n this.component ? this.factory.makeComponentTemplate(uiView, context, this.component, this.viewDecl.bindings) : this.template;\n\n /**\n * Gets the controller for a view configuration.\n *\n * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.\n */\n getController(context: ResolveContext): (IInjectable|string|Promise) {\n let provider = this.viewDecl.controllerProvider;\n if (!isInjectable(provider)) return this.viewDecl.controller;\n let deps = services.$injector.annotate(provider);\n let providerFn = isArray(provider) ? tail( provider) : provider;\n let resolvable = new Resolvable(\"\", providerFn, deps);\n return resolvable.get(context);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.d.ts
new file mode 100644
index 00000000..76eae489
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.d.ts
@@ -0,0 +1,85 @@
+
+import { IAugmentedJQuery } from "angular";
+import { IInjectable, ResolveContext, RawParams } from "@uirouter/core";
+import { Ng1ViewDeclaration, TemplateFactoryProvider } from "./interface";
+/**
+ * Service which manages loading of templates from a ViewConfig.
+ */
+export declare class TemplateFactory implements TemplateFactoryProvider {
+ /** @hidden */ private _useHttp;
+ /** @hidden */ private $templateRequest;
+ /** @hidden */ private $templateCache;
+ /** @hidden */ private $http;
+ /** @hidden */ $get: (string | (($http: any, $templateCache: any, $injector: any) => this))[];
+ /** @hidden */
+ useHttpService(value: boolean): void;
+ /**
+ * Creates a template from a configuration object.
+ *
+ * @param config Configuration object for which to load a template.
+ * The following properties are search in the specified order, and the first one
+ * that is defined is used to create the template:
+ *
+ * @param params Parameters to pass to the template function.
+ * @param context The resolve context associated with the template's view
+ *
+ * @return {string|object} The template html as a string, or a promise for
+ * that string,or `null` if no template is configured.
+ */
+ fromConfig(config: Ng1ViewDeclaration, params: any, context: ResolveContext): Promise<{
+ template?: string;
+ component?: string;
+ }>;
+ /**
+ * Creates a template from a string or a function returning a string.
+ *
+ * @param template html template as a string or function that returns an html template as a string.
+ * @param params Parameters to pass to the template function.
+ *
+ * @return {string|object} The template html as a string, or a promise for that
+ * string.
+ */
+ fromString(template: (string | Function), params?: RawParams): any;
+ /**
+ * Loads a template from the a URL via `$http` and `$templateCache`.
+ *
+ * @param {string|Function} url url of the template to load, or a function
+ * that returns a url.
+ * @param {Object} params Parameters to pass to the url function.
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ fromUrl(url: (string | Function), params: any): any;
+ /**
+ * Creates a template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ fromProvider(provider: IInjectable, params: any, context: ResolveContext): Promise;
+ /**
+ * Creates a component's template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string} The template html as a string: "".
+ */
+ fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext): Promise;
+ /**
+ * Creates a template from a component's name
+ *
+ * This implements route-to-component.
+ * It works by retrieving the component (directive) metadata from the injector.
+ * It analyses the component's bindings, then constructs a template that instantiates the component.
+ * The template wires input and output bindings to resolves or from the parent component.
+ *
+ * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
+ * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
+ * @param component {string} Component's name in camel case.
+ * @param bindings An object defining the component's bindings: {foo: '<'}
+ * @return {string} The template as a string: "".
+ */
+ makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any): string;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.js
new file mode 100644
index 00000000..4f947127
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.js
@@ -0,0 +1,192 @@
+/** @module view */
+/** for typedoc */
+import { ng as angular } from "./angular";
+import { isArray, isDefined, isFunction, isObject, services, tail, kebobString, unnestR, Resolvable } from "@uirouter/core";
+/**
+ * Service which manages loading of templates from a ViewConfig.
+ */
+var TemplateFactory = /** @class */ (function () {
+ function TemplateFactory() {
+ var _this = this;
+ /** @hidden */ this._useHttp = angular.version.minor < 3;
+ /** @hidden */ this.$get = ['$http', '$templateCache', '$injector', function ($http, $templateCache, $injector) {
+ _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');
+ _this.$http = $http;
+ _this.$templateCache = $templateCache;
+ return _this;
+ }];
+ }
+ /** @hidden */
+ TemplateFactory.prototype.useHttpService = function (value) {
+ this._useHttp = value;
+ };
+ ;
+ /**
+ * Creates a template from a configuration object.
+ *
+ * @param config Configuration object for which to load a template.
+ * The following properties are search in the specified order, and the first one
+ * that is defined is used to create the template:
+ *
+ * @param params Parameters to pass to the template function.
+ * @param context The resolve context associated with the template's view
+ *
+ * @return {string|object} The template html as a string, or a promise for
+ * that string,or `null` if no template is configured.
+ */
+ TemplateFactory.prototype.fromConfig = function (config, params, context) {
+ var defaultTemplate = "";
+ var asTemplate = function (result) { return services.$q.when(result).then(function (str) { return ({ template: str }); }); };
+ var asComponent = function (result) { return services.$q.when(result).then(function (str) { return ({ component: str }); }); };
+ return (isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) :
+ isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) :
+ isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) :
+ isDefined(config.component) ? asComponent(config.component) :
+ isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) :
+ asTemplate(defaultTemplate));
+ };
+ ;
+ /**
+ * Creates a template from a string or a function returning a string.
+ *
+ * @param template html template as a string or function that returns an html template as a string.
+ * @param params Parameters to pass to the template function.
+ *
+ * @return {string|object} The template html as a string, or a promise for that
+ * string.
+ */
+ TemplateFactory.prototype.fromString = function (template, params) {
+ return isFunction(template) ? template(params) : template;
+ };
+ ;
+ /**
+ * Loads a template from the a URL via `$http` and `$templateCache`.
+ *
+ * @param {string|Function} url url of the template to load, or a function
+ * that returns a url.
+ * @param {Object} params Parameters to pass to the url function.
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ TemplateFactory.prototype.fromUrl = function (url, params) {
+ if (isFunction(url))
+ url = url(params);
+ if (url == null)
+ return null;
+ if (this._useHttp) {
+ return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })
+ .then(function (response) {
+ return response.data;
+ });
+ }
+ return this.$templateRequest(url);
+ };
+ ;
+ /**
+ * Creates a template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ TemplateFactory.prototype.fromProvider = function (provider, params, context) {
+ var deps = services.$injector.annotate(provider);
+ var providerFn = isArray(provider) ? tail(provider) : provider;
+ var resolvable = new Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ ;
+ /**
+ * Creates a component's template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string} The template html as a string: "".
+ */
+ TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {
+ var deps = services.$injector.annotate(provider);
+ var providerFn = isArray(provider) ? tail(provider) : provider;
+ var resolvable = new Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ ;
+ /**
+ * Creates a template from a component's name
+ *
+ * This implements route-to-component.
+ * It works by retrieving the component (directive) metadata from the injector.
+ * It analyses the component's bindings, then constructs a template that instantiates the component.
+ * The template wires input and output bindings to resolves or from the parent component.
+ *
+ * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
+ * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
+ * @param component {string} Component's name in camel case.
+ * @param bindings An object defining the component's bindings: {foo: '<'}
+ * @return {string} The template as a string: "".
+ */
+ TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {
+ bindings = bindings || {};
+ // Bind once prefix
+ var prefix = angular.version.minor >= 3 ? "::" : "";
+ // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`
+ var kebob = function (camelCase) {
+ var kebobed = kebobString(camelCase);
+ return /^(x|data)-/.exec(kebobed) ? "x-" + kebobed : kebobed;
+ };
+ var attributeTpl = function (input) {
+ var name = input.name, type = input.type;
+ var attrName = kebob(name);
+ // If the ui-view has an attribute which matches a binding on the routed component
+ // then pass that attribute through to the routed component template.
+ // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`
+ if (uiView.attr(attrName) && !bindings[name])
+ return attrName + "='" + uiView.attr(attrName) + "'";
+ var resolveName = bindings[name] || name;
+ // Pre-evaluate the expression for "@" bindings by enclosing in {{ }}
+ // some-attr="{{ ::$resolve.someResolveName }}"
+ if (type === '@')
+ return attrName + "='{{" + prefix + "$resolve." + resolveName + "}}'";
+ // Wire "&" callbacks to resolves that return a callback function
+ // Get the result of the resolve (should be a function) and annotate it to get its arguments.
+ // some-attr="$resolve.someResolveResultName(foo, bar)"
+ if (type === '&') {
+ var res = context.getResolvable(resolveName);
+ var fn = res && res.data;
+ var args = fn && services.$injector.annotate(fn) || [];
+ // account for array style injection, i.e., ['foo', function(foo) {}]
+ var arrayIdxStr = isArray(fn) ? "[" + (fn.length - 1) + "]" : '';
+ return attrName + "='$resolve." + resolveName + arrayIdxStr + "(" + args.join(",") + ")'";
+ }
+ // some-attr="::$resolve.someResolveName"
+ return attrName + "='" + prefix + "$resolve." + resolveName + "'";
+ };
+ var attrs = getComponentBindings(component).map(attributeTpl).join(" ");
+ var kebobName = kebob(component);
+ return "<" + kebobName + " " + attrs + ">" + kebobName + ">";
+ };
+ ;
+ return TemplateFactory;
+}());
+export { TemplateFactory };
+// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')
+function getComponentBindings(name) {
+ var cmpDefs = services.$injector.get(name + "Directive"); // could be multiple
+ if (!cmpDefs || !cmpDefs.length)
+ throw new Error("Unable to find component named '" + name + "'");
+ return cmpDefs.map(getBindings).reduce(unnestR, []);
+}
+// Given a directive definition, find its object input attributes
+// Use different properties, depending on the type of directive (component, bindToController, normal)
+var getBindings = function (def) {
+ if (isObject(def.bindToController))
+ return scopeBindings(def.bindToController);
+ return scopeBindings(def.scope);
+};
+// for ng 1.2 style, process the scope: { input: "=foo" }
+// for ng 1.3 through ng 1.5, process the component's bindToController: { input: "=foo" } object
+var scopeBindings = function (bindingsObj) { return Object.keys(bindingsObj || {})
+ .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; })
+ .filter(function (tuple) { return isDefined(tuple) && isArray(tuple[1]); })
+ .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); }); };
+//# sourceMappingURL=templateFactory.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.js.map
new file mode 100644
index 00000000..bbe58e8e
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/templateFactory.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "templateFactory.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uir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C,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAmB,CAAA,EAAtE,CAAsE,CAAC,EAN7C,CAM6C,CAAC",
+ "sourcesContent": [
+ "/** @module view */\n/** for typedoc */\nimport { ng as angular } from \"./angular\";\nimport { IAugmentedJQuery } from \"angular\";\nimport {\n isArray, isDefined, isFunction, isObject, services, Obj, IInjectable, tail, kebobString, unnestR, ResolveContext,\n Resolvable, RawParams\n} from \"@uirouter/core\";\nimport { Ng1ViewDeclaration, TemplateFactoryProvider } from \"./interface\";\n\n/**\n * Service which manages loading of templates from a ViewConfig.\n */\nexport class TemplateFactory implements TemplateFactoryProvider {\n /** @hidden */ private _useHttp = angular.version.minor < 3;\n /** @hidden */ private $templateRequest;\n /** @hidden */ private $templateCache;\n /** @hidden */ private $http;\n\n /** @hidden */ $get = ['$http', '$templateCache', '$injector', ($http, $templateCache, $injector) => {\n this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');\n this.$http = $http;\n this.$templateCache = $templateCache;\n return this;\n }];\n\n /** @hidden */\n useHttpService(value: boolean) {\n this._useHttp = value;\n };\n\n /**\n * Creates a template from a configuration object.\n *\n * @param config Configuration object for which to load a template.\n * The following properties are search in the specified order, and the first one\n * that is defined is used to create the template:\n *\n * @param params Parameters to pass to the template function.\n * @param context The resolve context associated with the template's view\n *\n * @return {string|object} The template html as a string, or a promise for\n * that string,or `null` if no template is configured.\n */\n fromConfig(config: Ng1ViewDeclaration, params: any, context: ResolveContext): Promise<{ template?: string, component?: string }> {\n const defaultTemplate = \"\";\n\n const asTemplate = (result) => services.$q.when(result).then(str => ({ template: str }));\n const asComponent = (result) => services.$q.when(result).then(str => ({ component: str }));\n\n return (\n isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) :\n isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) :\n isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) :\n isDefined(config.component) ? asComponent(config.component) :\n isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) :\n asTemplate(defaultTemplate)\n );\n };\n\n /**\n * Creates a template from a string or a function returning a string.\n *\n * @param template html template as a string or function that returns an html template as a string.\n * @param params Parameters to pass to the template function.\n *\n * @return {string|object} The template html as a string, or a promise for that\n * string.\n */\n fromString(template: (string | Function), params?: RawParams) {\n return isFunction(template) ? ( template)(params) : template;\n };\n\n /**\n * Loads a template from the a URL via `$http` and `$templateCache`.\n *\n * @param {string|Function} url url of the template to load, or a function\n * that returns a url.\n * @param {Object} params Parameters to pass to the url function.\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n fromUrl(url: (string | Function), params: any) {\n if (isFunction(url)) url = ( url)(params);\n if (url == null) return null;\n\n if (this._useHttp) {\n return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })\n .then(function (response) {\n return response.data;\n });\n }\n\n return this.$templateRequest(url);\n };\n\n /**\n * Creates a template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n fromProvider(provider: IInjectable, params: any, context: ResolveContext) {\n let deps = services.$injector.annotate(provider);\n let providerFn = isArray(provider) ? tail( provider) : provider;\n let resolvable = new Resolvable(\"\", providerFn, deps);\n return resolvable.get(context);\n };\n\n /**\n * Creates a component's template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string} The template html as a string: \"\".\n */\n fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext) {\n let deps = services.$injector.annotate(provider);\n let providerFn = isArray(provider) ? tail( provider) : provider;\n let resolvable = new Resolvable(\"\", providerFn, deps);\n return resolvable.get(context);\n };\n\n /**\n * Creates a template from a component's name\n *\n * This implements route-to-component.\n * It works by retrieving the component (directive) metadata from the injector.\n * It analyses the component's bindings, then constructs a template that instantiates the component.\n * The template wires input and output bindings to resolves or from the parent component.\n *\n * @param uiView {object} The parent ui-view (for binding outputs to callbacks)\n * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)\n * @param component {string} Component's name in camel case.\n * @param bindings An object defining the component's bindings: {foo: '<'}\n * @return {string} The template as a string: \"\".\n */\n makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any) {\n bindings = bindings || {};\n\n // Bind once prefix\n const prefix = angular.version.minor >= 3 ? \"::\" : \"\";\n // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`\n const kebob = (camelCase: string) => {\n const kebobed = kebobString(camelCase);\n return /^(x|data)-/.exec(kebobed) ? `x-${kebobed}` : kebobed;\n };\n\n\n const attributeTpl = (input: BindingTuple) => {\n let { name, type } = input;\n let attrName = kebob(name);\n // If the ui-view has an attribute which matches a binding on the routed component\n // then pass that attribute through to the routed component template.\n // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`\n if (uiView.attr(attrName) && !bindings[name])\n return `${attrName}='${uiView.attr(attrName)}'`;\n\n let resolveName = bindings[name] || name;\n // Pre-evaluate the expression for \"@\" bindings by enclosing in {{ }}\n // some-attr=\"{{ ::$resolve.someResolveName }}\"\n if (type === '@')\n return `${attrName}='{{${prefix}$resolve.${resolveName}}}'`;\n\n // Wire \"&\" callbacks to resolves that return a callback function\n // Get the result of the resolve (should be a function) and annotate it to get its arguments.\n // some-attr=\"$resolve.someResolveResultName(foo, bar)\"\n if (type === '&') {\n let res = context.getResolvable(resolveName);\n let fn = res && res.data;\n let args = fn && services.$injector.annotate(fn) || [];\n // account for array style injection, i.e., ['foo', function(foo) {}]\n let arrayIdxStr = isArray(fn) ? `[${fn.length - 1}]` : '';\n return `${attrName}='$resolve.${resolveName}${arrayIdxStr}(${args.join(\",\")})'`;\n }\n\n // some-attr=\"::$resolve.someResolveName\"\n return `${attrName}='${prefix}$resolve.${resolveName}'`;\n };\n\n let attrs = getComponentBindings(component).map(attributeTpl).join(\" \");\n let kebobName = kebob(component);\n return `<${kebobName} ${attrs}>${kebobName}>`;\n };\n}\n\n// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')\nfunction getComponentBindings(name: string) {\n let cmpDefs = services.$injector.get(name + \"Directive\"); // could be multiple\n if (!cmpDefs || !cmpDefs.length) throw new Error(`Unable to find component named '${name}'`);\n return cmpDefs.map(getBindings).reduce(unnestR, []);\n}\n\n// Given a directive definition, find its object input attributes\n// Use different properties, depending on the type of directive (component, bindToController, normal)\nconst getBindings = (def: any) => {\n if (isObject(def.bindToController)) return scopeBindings(def.bindToController);\n return scopeBindings(def.scope);\n};\n\ninterface BindingTuple {\n name: string;\n type: string;\n}\n\n// for ng 1.2 style, process the scope: { input: \"=foo\" }\n// for ng 1.3 through ng 1.5, process the component's bindToController: { input: \"=foo\" } object\nconst scopeBindings = (bindingsObj: Obj) => Object.keys(bindingsObj || {})\n // [ 'input', [ '=foo', '=', 'foo' ] ]\n .map(key => [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])])\n // skip malformed values\n .filter(tuple => isDefined(tuple) && isArray(tuple[1]))\n // { name: ('foo' || 'input'), type: '=' }\n .map(tuple => ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] } as BindingTuple));\n\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.d.ts
new file mode 100644
index 00000000..aa31bd77
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.d.ts
@@ -0,0 +1,157 @@
+/** @module url */ /** */
+import { UIRouter, UrlRouter, LocationServices, $InjectorLike, UrlRuleHandlerFn, UrlMatcher, IInjectable } from "@uirouter/core";
+export interface RawNg1RuleFunction {
+ ($injector: $InjectorLike, $location: LocationServices): string | void;
+}
+/**
+ * Manages rules for client-side URL
+ *
+ * ### Deprecation warning:
+ * This class is now considered to be an internal API
+ * Use the [[UrlService]] instead.
+ * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].
+ *
+ * This class manages the router rules for what to do when the URL changes.
+ *
+ * This provider remains for backwards compatibility.
+ *
+ * @deprecated
+ */
+export declare class UrlRouterProvider {
+ /** @hidden */ _router: UIRouter;
+ /** @hidden */ _urlRouter: UrlRouter;
+ /** @hidden */
+ constructor(router: UIRouter);
+ /** @hidden */
+ $get(): UrlRouter;
+ /**
+ * Registers a url handler function.
+ *
+ * Registers a low level url handler (a `rule`).
+ * A rule detects specific URL patterns and returns a redirect, or performs some action.
+ *
+ * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Here's an example of how you might allow case insensitive urls
+ * $urlRouterProvider.rule(function ($injector, $location) {
+ * var path = $location.path(),
+ * normalized = path.toLowerCase();
+ *
+ * if (path !== normalized) {
+ * return normalized;
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param ruleFn
+ * Handler function that takes `$injector` and `$location` services as arguments.
+ * You can use them to detect a url and return a different url as a string.
+ *
+ * @return [[UrlRouterProvider]] (`this`)
+ */
+ rule(ruleFn: RawNg1RuleFunction): UrlRouterProvider;
+ /**
+ * Defines the path or behavior to use when no url can be matched.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // if the path doesn't match any of the urls you configured
+ * // otherwise will take care of routing the user to the
+ * // specified url
+ * $urlRouterProvider.otherwise('/index');
+ *
+ * // Example of using function rule as param
+ * $urlRouterProvider.otherwise(function ($injector, $location) {
+ * return '/a/valid/url';
+ * });
+ * });
+ * ```
+ *
+ * @param rule
+ * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.
+ * The function version is passed two params: `$injector` and `$location` services, and should return a url string.
+ *
+ * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
+ */
+ otherwise(rule: string | RawNg1RuleFunction): UrlRouterProvider;
+ /**
+ * Registers a handler for a given url matching.
+ *
+ * If the handler is a string, it is
+ * treated as a redirect, and is interpolated according to the syntax of match
+ * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
+ *
+ * If the handler is a function, it is injectable.
+ * It gets invoked if `$location` matches.
+ * You have the option of inject the match object as `$match`.
+ *
+ * The handler can return
+ *
+ * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
+ * will continue trying to find another one that matches.
+ * - **string** which is treated as a redirect and passed to `$location.url()`
+ * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+ * if ($state.$current.navigable !== state ||
+ * !equalForKeys($match, $stateParams) {
+ * $state.transitionTo(state, $match, false);
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param what A pattern string to match, compiled as a [[UrlMatcher]].
+ * @param handler The path (or function that returns a path) that you want to redirect your user to.
+ * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]
+ *
+ * Note: the handler may also invoke arbitrary code, such as `$state.go()`
+ */
+ when(what: (RegExp | UrlMatcher | string), handler: string | IInjectable): this;
+ static injectableHandler(router: UIRouter, handler: any): UrlRuleHandlerFn;
+ /**
+ * Disables monitoring of the URL.
+ *
+ * Call this method before UI-Router has bootstrapped.
+ * It will stop UI-Router from performing the initial url sync.
+ *
+ * This can be useful to perform some asynchronous initialization before the router starts.
+ * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Prevent $urlRouter from automatically intercepting URL changes;
+ * $urlRouterProvider.deferIntercept();
+ * })
+ *
+ * app.run(function (MyService, $urlRouter, $http) {
+ * $http.get("/stuff").then(function(resp) {
+ * MyService.doStuff(resp.data);
+ * $urlRouter.listen();
+ * $urlRouter.sync();
+ * });
+ * });
+ * ```
+ *
+ * @param defer Indicates whether to defer location change interception.
+ * Passing no parameter is equivalent to `true`.
+ */
+ deferIntercept(defer?: boolean): void;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js
new file mode 100644
index 00000000..b1d0bdcf
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js
@@ -0,0 +1,204 @@
+/** @module url */ /** */
+import { BaseUrlRule } from "@uirouter/core";
+import { services, isString, isFunction, isArray, identity } from "@uirouter/core";
+/**
+ * Manages rules for client-side URL
+ *
+ * ### Deprecation warning:
+ * This class is now considered to be an internal API
+ * Use the [[UrlService]] instead.
+ * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].
+ *
+ * This class manages the router rules for what to do when the URL changes.
+ *
+ * This provider remains for backwards compatibility.
+ *
+ * @deprecated
+ */
+var UrlRouterProvider = /** @class */ (function () {
+ /** @hidden */
+ function UrlRouterProvider(router) {
+ this._router = router;
+ this._urlRouter = router.urlRouter;
+ }
+ /** @hidden */
+ UrlRouterProvider.prototype.$get = function () {
+ var urlRouter = this._urlRouter;
+ urlRouter.update(true);
+ if (!urlRouter.interceptDeferred)
+ urlRouter.listen();
+ return urlRouter;
+ };
+ /**
+ * Registers a url handler function.
+ *
+ * Registers a low level url handler (a `rule`).
+ * A rule detects specific URL patterns and returns a redirect, or performs some action.
+ *
+ * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Here's an example of how you might allow case insensitive urls
+ * $urlRouterProvider.rule(function ($injector, $location) {
+ * var path = $location.path(),
+ * normalized = path.toLowerCase();
+ *
+ * if (path !== normalized) {
+ * return normalized;
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param ruleFn
+ * Handler function that takes `$injector` and `$location` services as arguments.
+ * You can use them to detect a url and return a different url as a string.
+ *
+ * @return [[UrlRouterProvider]] (`this`)
+ */
+ UrlRouterProvider.prototype.rule = function (ruleFn) {
+ var _this = this;
+ if (!isFunction(ruleFn))
+ throw new Error("'rule' must be a function");
+ var match = function () {
+ return ruleFn(services.$injector, _this._router.locationService);
+ };
+ var rule = new BaseUrlRule(match, identity);
+ this._urlRouter.rule(rule);
+ return this;
+ };
+ ;
+ /**
+ * Defines the path or behavior to use when no url can be matched.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // if the path doesn't match any of the urls you configured
+ * // otherwise will take care of routing the user to the
+ * // specified url
+ * $urlRouterProvider.otherwise('/index');
+ *
+ * // Example of using function rule as param
+ * $urlRouterProvider.otherwise(function ($injector, $location) {
+ * return '/a/valid/url';
+ * });
+ * });
+ * ```
+ *
+ * @param rule
+ * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.
+ * The function version is passed two params: `$injector` and `$location` services, and should return a url string.
+ *
+ * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
+ */
+ UrlRouterProvider.prototype.otherwise = function (rule) {
+ var _this = this;
+ var urlRouter = this._urlRouter;
+ if (isString(rule)) {
+ urlRouter.otherwise(rule);
+ }
+ else if (isFunction(rule)) {
+ urlRouter.otherwise(function () { return rule(services.$injector, _this._router.locationService); });
+ }
+ else {
+ throw new Error("'rule' must be a string or function");
+ }
+ return this;
+ };
+ ;
+ /**
+ * Registers a handler for a given url matching.
+ *
+ * If the handler is a string, it is
+ * treated as a redirect, and is interpolated according to the syntax of match
+ * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
+ *
+ * If the handler is a function, it is injectable.
+ * It gets invoked if `$location` matches.
+ * You have the option of inject the match object as `$match`.
+ *
+ * The handler can return
+ *
+ * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
+ * will continue trying to find another one that matches.
+ * - **string** which is treated as a redirect and passed to `$location.url()`
+ * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+ * if ($state.$current.navigable !== state ||
+ * !equalForKeys($match, $stateParams) {
+ * $state.transitionTo(state, $match, false);
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param what A pattern string to match, compiled as a [[UrlMatcher]].
+ * @param handler The path (or function that returns a path) that you want to redirect your user to.
+ * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]
+ *
+ * Note: the handler may also invoke arbitrary code, such as `$state.go()`
+ */
+ UrlRouterProvider.prototype.when = function (what, handler) {
+ if (isArray(handler) || isFunction(handler)) {
+ handler = UrlRouterProvider.injectableHandler(this._router, handler);
+ }
+ this._urlRouter.when(what, handler);
+ return this;
+ };
+ ;
+ UrlRouterProvider.injectableHandler = function (router, handler) {
+ return function (match) {
+ return services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });
+ };
+ };
+ /**
+ * Disables monitoring of the URL.
+ *
+ * Call this method before UI-Router has bootstrapped.
+ * It will stop UI-Router from performing the initial url sync.
+ *
+ * This can be useful to perform some asynchronous initialization before the router starts.
+ * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Prevent $urlRouter from automatically intercepting URL changes;
+ * $urlRouterProvider.deferIntercept();
+ * })
+ *
+ * app.run(function (MyService, $urlRouter, $http) {
+ * $http.get("/stuff").then(function(resp) {
+ * MyService.doStuff(resp.data);
+ * $urlRouter.listen();
+ * $urlRouter.sync();
+ * });
+ * });
+ * ```
+ *
+ * @param defer Indicates whether to defer location change interception.
+ * Passing no parameter is equivalent to `true`.
+ */
+ UrlRouterProvider.prototype.deferIntercept = function (defer) {
+ this._urlRouter.deferIntercept(defer);
+ };
+ ;
+ return UrlRouterProvider;
+}());
+export { UrlRouterProvider };
+//# sourceMappingURL=urlRouterProvider.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js.map
new file mode 100644
index 00000000..9b2a5ad6
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/urlRouterProvider.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "urlRouterProvider.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/urlRouterProvider.ts"
+ ],
+ "names": [],
+ "mappings": "AAAA,kBAAkB,CAAC,MAAM;AACzB,OAAO,EACmD,WAAW,EAEpE,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAMnF;;;;;;;;;;;;;GAaG;AACH;IAIE,cAAc;IACd,2BAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC;IACrC,CAAC;IAED,cAAc;IACd,gCAAI,GAAJ;QACE,IAAI,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAChC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,EAAE,CAAC,CAAC,CA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IAAI,CAAC;IACd,CAAC;IAAA,CAAC;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACH,gCAAI,GAAJ,UAAK,IAAgC,EAAE,OAA2B;QAChE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAC5C,OAAO,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAAA,CAAC;IAEK,mCAAiB,GAAxB,UAAyB,MAAgB,EAAE,OAAO;QAChD,MAAM,CAAC,UAAA,KAAK;YACR,OAAA,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAAhG,CAAgG,CAAC;IACvG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,0CAAc,GAAd,UAAe,KAAe;QAC5B,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAAA,CAAC;IACJ,wBAAC;AAAD,CAAC,AAzLD,IAyLC",
+ "sourcesContent": [
+ "/** @module url */ /** */\nimport {\n UIRouter, UrlRouter, LocationServices, $InjectorLike, BaseUrlRule, UrlRuleHandlerFn, UrlMatcher,\n IInjectable\n} from \"@uirouter/core\";\nimport { services, isString, isFunction, isArray, identity } from \"@uirouter/core\";\n\nexport interface RawNg1RuleFunction {\n ($injector: $InjectorLike, $location: LocationServices): string|void;\n}\n\n/**\n * Manages rules for client-side URL\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\n *\n * This class manages the router rules for what to do when the URL changes.\n *\n * This provider remains for backwards compatibility.\n *\n * @deprecated\n */\nexport class UrlRouterProvider {\n /** @hidden */ _router: UIRouter;\n /** @hidden */ _urlRouter: UrlRouter;\n\n /** @hidden */\n constructor(router: UIRouter) {\n this._router = router;\n this._urlRouter = router.urlRouter;\n }\n\n /** @hidden */\n $get() {\n let urlRouter = this._urlRouter;\n urlRouter.update(true);\n if (!urlRouter.interceptDeferred) urlRouter.listen();\n return urlRouter;\n }\n\n /**\n * Registers a url handler function.\n *\n * Registers a low level url handler (a `rule`).\n * A rule detects specific URL patterns and returns a redirect, or performs some action.\n *\n * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Here's an example of how you might allow case insensitive urls\n * $urlRouterProvider.rule(function ($injector, $location) {\n * var path = $location.path(),\n * normalized = path.toLowerCase();\n *\n * if (path !== normalized) {\n * return normalized;\n * }\n * });\n * });\n * ```\n *\n * @param ruleFn\n * Handler function that takes `$injector` and `$location` services as arguments.\n * You can use them to detect a url and return a different url as a string.\n *\n * @return [[UrlRouterProvider]] (`this`)\n */\n rule(ruleFn: RawNg1RuleFunction): UrlRouterProvider {\n if (!isFunction(ruleFn)) throw new Error(\"'rule' must be a function\");\n\n const match = () =>\n ruleFn(services.$injector, this._router.locationService);\n\n let rule = new BaseUrlRule(match, identity);\n this._urlRouter.rule(rule);\n return this;\n };\n\n /**\n * Defines the path or behavior to use when no url can be matched.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // if the path doesn't match any of the urls you configured\n * // otherwise will take care of routing the user to the\n * // specified url\n * $urlRouterProvider.otherwise('/index');\n *\n * // Example of using function rule as param\n * $urlRouterProvider.otherwise(function ($injector, $location) {\n * return '/a/valid/url';\n * });\n * });\n * ```\n *\n * @param rule\n * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.\n * The function version is passed two params: `$injector` and `$location` services, and should return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n otherwise(rule: string | RawNg1RuleFunction): UrlRouterProvider {\n let urlRouter = this._urlRouter;\n\n if (isString(rule)) {\n urlRouter.otherwise(rule);\n } else if (isFunction(rule)) {\n urlRouter.otherwise(() => rule(services.$injector, this._router.locationService));\n } else {\n throw new Error(\"'rule' must be a string or function\");\n }\n\n return this;\n };\n\n /**\n * Registers a handler for a given url matching.\n *\n * If the handler is a string, it is\n * treated as a redirect, and is interpolated according to the syntax of match\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n *\n * If the handler is a function, it is injectable.\n * It gets invoked if `$location` matches.\n * You have the option of inject the match object as `$match`.\n *\n * The handler can return\n *\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n * will continue trying to find another one that matches.\n * - **string** which is treated as a redirect and passed to `$location.url()`\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n * if ($state.$current.navigable !== state ||\n * !equalForKeys($match, $stateParams) {\n * $state.transitionTo(state, $match, false);\n * }\n * });\n * });\n * ```\n *\n * @param what A pattern string to match, compiled as a [[UrlMatcher]].\n * @param handler The path (or function that returns a path) that you want to redirect your user to.\n * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]\n *\n * Note: the handler may also invoke arbitrary code, such as `$state.go()`\n */\n when(what: (RegExp|UrlMatcher|string), handler: string|IInjectable) {\n if (isArray(handler) || isFunction(handler)) {\n handler = UrlRouterProvider.injectableHandler(this._router, handler);\n }\n\n this._urlRouter.when(what, handler as any);\n return this;\n };\n\n static injectableHandler(router: UIRouter, handler): UrlRuleHandlerFn {\n return match =>\n services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });\n }\n\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * $urlRouterProvider.deferIntercept();\n * })\n *\n * app.run(function (MyService, $urlRouter, $http) {\n * $http.get(\"/stuff\").then(function(resp) {\n * MyService.doStuff(resp.data);\n * $urlRouter.listen();\n * $urlRouter.sync();\n * });\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n deferIntercept(defer?: boolean) {\n this._urlRouter.deferIntercept(defer);\n };\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.d.ts
new file mode 100644
index 00000000..e4fc544f
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.d.ts
@@ -0,0 +1,9 @@
+export interface UIViewScrollProvider {
+ /**
+ * Uses standard anchorScroll behavior
+ *
+ * Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
+ * service for scrolling based on the url anchor.
+ */
+ useAnchorScroll(): void;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.js
new file mode 100644
index 00000000..7dab9a7d
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.js
@@ -0,0 +1,21 @@
+/** @module ng1 */ /** */
+import { ng as angular } from "./angular";
+/** @hidden */
+function $ViewScrollProvider() {
+ var useAnchorScroll = false;
+ this.useAnchorScroll = function () {
+ useAnchorScroll = true;
+ };
+ this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
+ if (useAnchorScroll) {
+ return $anchorScroll;
+ }
+ return function ($element) {
+ return $timeout(function () {
+ $element[0].scrollIntoView();
+ }, 0, false);
+ };
+ }];
+}
+angular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
+//# sourceMappingURL=viewScroll.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.js.map
new file mode 100644
index 00000000..9f77ee23
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib-esm/viewScroll.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "viewScroll.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/viewScroll.ts"
+ ],
+ "names": [],
+ "mappings": "AAAA,kBAAkB,CAAC,MAAM;AACzB,OAAO,EAAE,EAAE,IAAI,OAAO,EAAE,MAAM,WAAW,CAAC;AAgB1C,cAAc;AACd;IAEE,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,IAAI,CAAC,eAAe,GAAG;QACrB,eAAe,GAAG,IAAI,CAAC;IACzB,CAAC,CAAC;IAEF,IAAI,CAAC,IAAI,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,UAAU,aAAmC,EAAE,QAAyB;YAChH,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;gBACpB,MAAM,CAAC,aAAa,CAAC;YACvB,CAAC;YAED,MAAM,CAAC,UAAU,QAAgB;gBAC/B,MAAM,CAAC,QAAQ,CAAC;oBACd,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;gBAC/B,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;YACf,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,eAAe,EAA4B,mBAAmB,CAAC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport { ng as angular } from \"./angular\";\nimport { IServiceProviderFactory } from \"angular\";\nimport IAnchorScrollService = angular.IAnchorScrollService;\nimport ITimeoutService = angular.ITimeoutService;\n\nexport interface UIViewScrollProvider {\n /**\n * Uses standard anchorScroll behavior\n *\n * Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * service for scrolling based on the url anchor.\n */\n useAnchorScroll(): void;\n}\n\n\n/** @hidden */\nfunction $ViewScrollProvider() {\n\n var useAnchorScroll = false;\n\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n\n this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll: IAnchorScrollService, $timeout: ITimeoutService): Function {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n\n return function ($element: JQuery) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.d.ts
new file mode 100644
index 00000000..a58640ee
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.d.ts
@@ -0,0 +1 @@
+export declare const ng: any;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.js
new file mode 100644
index 00000000..00a15e6b
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.js
@@ -0,0 +1,6 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var ng_from_import = require("angular");
+var ng_from_global = angular;
+exports.ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;
+//# sourceMappingURL=angular.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.js.map
new file mode 100644
index 00000000..f8029a85
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/angular.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "angular.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/angular.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAKA,wCAA0C;AAC1C,IAAI,cAAc,GAAG,OAAO,CAAC;AAEhB,QAAA,EAAE,GAAG,CAAC,cAAc,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC",
+ "sourcesContent": [
+ "/**\n * @hidden\n * @module ng1\n */ /** */\ndeclare var angular;\nimport * as ng_from_import from \"angular\";\nlet ng_from_global = angular;\n\nexport const ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/directives/stateDirectives.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/directives/stateDirectives.d.ts
new file mode 100644
index 00000000..0e3fe8d5
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/directives/stateDirectives.d.ts
@@ -0,0 +1,3 @@
+/** @hidden Used for typedoc */
+export interface ng1_directive {
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/directives/stateDirectives.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/directives/stateDirectives.js
new file mode 100644
index 00000000..6d748ace
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/directives/stateDirectives.js
@@ -0,0 +1,571 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * # Angular 1 Directives
+ *
+ * These are the directives included in UI-Router for Angular 1.
+ * These directives are used in templates to create viewports and link/navigate to states.
+ *
+ * @ng1api
+ * @preferred
+ * @module directives
+ */ /** for typedoc */
+var angular_1 = require("../angular");
+var core_1 = require("@uirouter/core");
+/** @hidden */
+function parseStateRef(ref) {
+ var paramsOnly = ref.match(/^\s*({[^}]*})\s*$/), parsed;
+ if (paramsOnly)
+ ref = '(' + paramsOnly[1] + ')';
+ parsed = ref.replace(/\n/g, " ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/);
+ if (!parsed || parsed.length !== 4)
+ throw new Error("Invalid state ref '" + ref + "'");
+ return { state: parsed[1] || null, paramExpr: parsed[3] || null };
+}
+/** @hidden */
+function stateContext(el) {
+ var $uiView = el.parent().inheritedData('$uiView');
+ var path = core_1.parse('$cfg.path')($uiView);
+ return path ? core_1.tail(path).state.name : undefined;
+}
+/** @hidden */
+function processedDef($state, $element, def) {
+ var uiState = def.uiState || $state.current.name;
+ var uiStateOpts = core_1.extend(defaultOpts($element, $state), def.uiStateOpts || {});
+ var href = $state.href(uiState, def.uiStateParams, uiStateOpts);
+ return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href };
+}
+/** @hidden */
+function getTypeInfo(el) {
+ // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+ var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';
+ var isForm = el[0].nodeName === "FORM";
+ return {
+ attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'),
+ isAnchor: el.prop("tagName").toUpperCase() === "A",
+ clickable: !isForm
+ };
+}
+/** @hidden */
+function clickHook(el, $state, $timeout, type, getDef) {
+ return function (e) {
+ var button = e.which || e.button, target = getDef();
+ if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {
+ // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
+ var transition = $timeout(function () {
+ $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);
+ });
+ e.preventDefault();
+ // if the state has no URL, ignore one preventDefault from the directive.
+ var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1 : 0;
+ e.preventDefault = function () {
+ if (ignorePreventDefaultCount-- <= 0)
+ $timeout.cancel(transition);
+ };
+ }
+ };
+}
+/** @hidden */
+function defaultOpts(el, $state) {
+ return {
+ relative: stateContext(el) || $state.$current,
+ inherit: true,
+ source: "sref"
+ };
+}
+/** @hidden */
+function bindEvents(element, scope, hookFn, uiStateOpts) {
+ var events;
+ if (uiStateOpts) {
+ events = uiStateOpts.events;
+ }
+ if (!core_1.isArray(events)) {
+ events = ['click'];
+ }
+ var on = element.on ? 'on' : 'bind';
+ for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
+ var event_1 = events_1[_i];
+ element[on](event_1, hookFn);
+ }
+ scope.$on('$destroy', function () {
+ var off = element.off ? 'off' : 'unbind';
+ for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {
+ var event_2 = events_2[_i];
+ element[off](event_2, hookFn);
+ }
+ });
+}
+/**
+ * `ui-sref`: A directive for linking to a state
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * ### Linked State
+ * The attribute value of the `ui-sref` is the name of the state to link to.
+ *
+ * #### Example:
+ * This will activate the `home` state when the link is clicked.
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Relative Links
+ * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).
+ * You just need to be aware that the path is relative to the state that *created* the link.
+ * This allows a state to create a relative `ui-sref` which always targets the same destination.
+ *
+ * #### Example:
+ * Both these links are relative to the parent state, even when a child state is currently active.
+ * ```html
+ * child 1 state
+ * child 2 state
+ * ```
+ *
+ * This link activates the parent state.
+ * ```html
+ * Return
+ * ```
+ *
+ * ### hrefs
+ * If the linked state has a URL, the directive will automatically generate and
+ * update the `href` attribute (using the [[StateService.href]] method).
+ *
+ * #### Example:
+ * Assuming the `users` state has a url of `/users/`
+ * ```html
+ * Users
+ * ```
+ *
+ * ### Parameter Values
+ * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.
+ * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.
+ * The content inside the parentheses is an expression, evaluated to the parameter values.
+ *
+ * #### Example:
+ * This example renders a list of links to users.
+ * The state's `userId` parameter value comes from each user's `user.id` property.
+ * ```html
+ *
+ * ```
+ *
+ * Note:
+ * The parameter values expression is `$watch`ed for updates.
+ *
+ * ### Transition Options
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.
+ * Options are restricted to `location`, `inherit`, and `reload`.
+ *
+ * #### Example:
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Other DOM Events
+ *
+ * You can also customize which DOM events to respond to (instead of `click`) by
+ * providing an `events` array in the `ui-sref-opts` attribute.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * ### Highlighting the active link
+ * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
+ *
+ * ### Examples
+ * If you have the following template:
+ *
+ * ```html
+ * Home
+ * About
+ * Next page
+ *
+ *
+ * ```
+ *
+ * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:
+ *
+ * ```html
+ * Home
+ * About
+ * Next page
+ *
+ *
+ *
+ * Home
+ * ```
+ *
+ * ### Notes
+ *
+ * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.
+ * #### Example:
+ * Sets the `lang` parameter to `en` and remains on the same state.
+ *
+ * ```html
+ * English
+ * ```
+ *
+ * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
+ *
+ * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).
+ * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.
+ */
+var uiSref;
+uiSref = ['$uiRouter', '$timeout',
+ function $StateRefDirective($uiRouter, $timeout) {
+ var $state = $uiRouter.stateService;
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function (scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var unlinkInfoFn = null;
+ var hookFn;
+ var rawDef = {};
+ var getDef = function () { return processedDef($state, element, rawDef); };
+ var ref = parseStateRef(attrs.uiSref);
+ rawDef.uiState = ref.state;
+ rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};
+ function update() {
+ var def = getDef();
+ if (unlinkInfoFn)
+ unlinkInfoFn();
+ if (active)
+ unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);
+ if (def.href != null)
+ attrs.$set(type.attr, def.href);
+ }
+ if (ref.paramExpr) {
+ scope.$watch(ref.paramExpr, function (val) {
+ rawDef.uiStateParams = core_1.extend({}, val);
+ update();
+ }, true);
+ rawDef.uiStateParams = core_1.extend({}, scope.$eval(ref.paramExpr));
+ }
+ update();
+ scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));
+ scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));
+ if (!type.clickable)
+ return;
+ hookFn = clickHook(element, $state, $timeout, type, getDef);
+ bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
+ }
+ };
+ }];
+/**
+ * `ui-state`: A fully dynamic directive for linking to a state
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * ### Linked State
+ * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.
+ * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**
+ *
+ * #### Example:
+ * Create a list of links.
+ * ```html
+ *
+ * ```
+ *
+ * ### Relative Links
+ * If the expression evaluates to a relative path, it is processed like [[uiSref]].
+ * You just need to be aware that the path is relative to the state that *created* the link.
+ * This allows a state to create relative `ui-state` which always targets the same destination.
+ *
+ * ### hrefs
+ * If the linked state has a URL, the directive will automatically generate and
+ * update the `href` attribute (using the [[StateService.href]] method).
+ *
+ * ### Parameter Values
+ * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.
+ * Param values should be provided using the `ui-state-params` attribute.
+ * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.
+ *
+ * #### Example:
+ * This example renders a list of links with param values.
+ * The state's `userId` parameter value comes from each user's `user.id` property.
+ * ```html
+ *
+ * ```
+ *
+ * ### Transition Options
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.
+ * Options are restricted to `location`, `inherit`, and `reload`.
+ * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.
+ *
+ * #### Example:
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Other DOM Events
+ *
+ * You can also customize which DOM events to respond to (instead of `click`) by
+ * providing an `events` array in the `ui-state-opts` attribute.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * ### Highlighting the active link
+ * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
+ *
+ * ### Notes
+ *
+ * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.
+ * However, it might be simpler to use [[uiSref]] parameter-only links.
+ *
+ * #### Example:
+ * Sets the `lang` parameter to `en` and remains on the same state.
+ *
+ * ```html
+ * English
+ * ```
+ *
+ * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
+ * ```
+ */
+var uiState;
+uiState = ['$uiRouter', '$timeout',
+ function $StateRefDynamicDirective($uiRouter, $timeout) {
+ var $state = $uiRouter.stateService;
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function (scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var unlinkInfoFn = null;
+ var hookFn;
+ var rawDef = {};
+ var getDef = function () { return processedDef($state, element, rawDef); };
+ var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];
+ var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return (acc[attr] = core_1.noop, acc); }, {});
+ function update() {
+ var def = getDef();
+ if (unlinkInfoFn)
+ unlinkInfoFn();
+ if (active)
+ unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);
+ if (def.href != null)
+ attrs.$set(type.attr, def.href);
+ }
+ inputAttrs.forEach(function (field) {
+ rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;
+ attrs.$observe(field, function (expr) {
+ watchDeregFns[field]();
+ watchDeregFns[field] = scope.$watch(expr, function (newval) {
+ rawDef[field] = newval;
+ update();
+ }, true);
+ });
+ });
+ update();
+ scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));
+ scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));
+ if (!type.clickable)
+ return;
+ hookFn = clickHook(element, $state, $timeout, type, getDef);
+ bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
+ }
+ };
+ }];
+/**
+ * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active
+ *
+ * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the
+ * related directive's state is active (and remove them when it is inactive).
+ *
+ * The primary use-case is to highlight the active link in navigation menus,
+ * distinguishing it from the inactive menu items.
+ *
+ * ### Linking to a `ui-sref` or `ui-state`
+ * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.
+ * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.
+ *
+ * ### Matching
+ *
+ * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.
+ * This is a "fuzzy match" which uses [[StateService.includes]].
+ *
+ * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).
+ * This is an "exact match" which uses [[StateService.is]].
+ *
+ * ### Parameter values
+ * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.
+ * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * When the app state is `app.user` (or any child state),
+ * and contains the state parameter "user" with value "bilbobaggins",
+ * the resulting HTML will appear as (note the 'active' class):
+ *
+ * ```html
+ *
+ * ```
+ *
+ * ### Glob mode
+ *
+ * It is possible to pass `ui-sref-active` an expression that evaluates to an object.
+ * The objects keys represent active class names and values represent the respective state names/globs.
+ * `ui-sref-active` will match if the current active state **includes** any of
+ * the specified state names/globs, even the abstract ones.
+ *
+ * #### Example:
+ * Given the following template, with "admin" being an abstract state:
+ * ```html
+ *
\n * ```\n *\n * Note:\n * The parameter values expression is `$watch`ed for updates.\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-sref-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Examples\n * If you have the following template:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n *
\n * ```\n *\n * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:\n *\n * ```html\n * Home\n * About\n * Next page\n *\n *
\n *\n * Home\n * ```\n *\n * ### Notes\n *\n * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n *\n * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).\n * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.\n */\nlet uiSref: ng1_directive;\nuiSref = ['$uiRouter', '$timeout',\n function $StateRefDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {\n let $state = $uiRouter.stateService;\n\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope: IScope, element: IAugmentedJQuery, attrs: any, uiSrefActive: any) {\n let type = getTypeInfo(element);\n let active = uiSrefActive[1] || uiSrefActive[0];\n let unlinkInfoFn: Function = null;\n let hookFn;\n\n let rawDef = {} as Def;\n let getDef = () => processedDef($state, element, rawDef);\n\n let ref = parseStateRef(attrs.uiSref);\n rawDef.uiState = ref.state;\n rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};\n\n function update() {\n let def = getDef();\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null) attrs.$set(type.attr, def.href);\n }\n\n if (ref.paramExpr) {\n scope.$watch(ref.paramExpr, function (val) {\n rawDef.uiStateParams = extend({}, val);\n update();\n }, true);\n rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));\n }\n\n update();\n\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n }\n };\n }];\n\n/**\n * `ui-state`: A fully dynamic directive for linking to a state\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**\n *\n * A directive which links to a state (and optionally, parameters).\n * When clicked, this directive activates the linked state with the supplied parameter values.\n *\n * ### Linked State\n * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.\n * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**\n *\n * #### Example:\n * Create a list of links.\n * ```html\n *
\n * ```\n *\n * ### Relative Links\n * If the expression evaluates to a relative path, it is processed like [[uiSref]].\n * You just need to be aware that the path is relative to the state that *created* the link.\n * This allows a state to create relative `ui-state` which always targets the same destination.\n *\n * ### hrefs\n * If the linked state has a URL, the directive will automatically generate and\n * update the `href` attribute (using the [[StateService.href]] method).\n *\n * ### Parameter Values\n * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.\n * Param values should be provided using the `ui-state-params` attribute.\n * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * This example renders a list of links with param values.\n * The state's `userId` parameter value comes from each user's `user.id` property.\n * ```html\n *
\n * ```\n *\n * ### Transition Options\n * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.\n * Options are restricted to `location`, `inherit`, and `reload`.\n * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.\n *\n * #### Example:\n * ```html\n * Home\n * ```\n *\n * ### Other DOM Events\n *\n * You can also customize which DOM events to respond to (instead of `click`) by\n * providing an `events` array in the `ui-state-opts` attribute.\n *\n * #### Example:\n * ```html\n * \n * ```\n *\n * ### Highlighting the active link\n * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.\n *\n * ### Notes\n *\n * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.\n * However, it might be simpler to use [[uiSref]] parameter-only links.\n *\n * #### Example:\n * Sets the `lang` parameter to `en` and remains on the same state.\n *\n * ```html\n * English\n * ```\n *\n * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.\n * ```\n */\nlet uiState: ng1_directive;\nuiState = ['$uiRouter', '$timeout',\n function $StateRefDynamicDirective($uiRouter: UIRouter, $timeout: ITimeoutService) {\n let $state = $uiRouter.stateService;\n\n return {\n restrict: 'A',\n require: ['?^uiSrefActive', '?^uiSrefActiveEq'],\n link: function (scope: IScope, element: IAugmentedJQuery, attrs: any, uiSrefActive: any) {\n let type = getTypeInfo(element);\n let active = uiSrefActive[1] || uiSrefActive[0];\n let unlinkInfoFn: Function = null;\n let hookFn;\n\n let rawDef = {} as Def;\n let getDef = () => processedDef($state, element, rawDef);\n\n let inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];\n let watchDeregFns = inputAttrs.reduce((acc, attr) => (acc[attr] = noop, acc), {});\n\n function update() {\n let def = getDef();\n if (unlinkInfoFn) unlinkInfoFn();\n if (active) unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);\n if (def.href != null) attrs.$set(type.attr, def.href);\n }\n\n inputAttrs.forEach((field) => {\n rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;\n\n attrs.$observe(field, (expr) => {\n watchDeregFns[field]();\n watchDeregFns[field] = scope.$watch(expr, (newval) => {\n rawDef[field] = newval;\n update();\n }, true);\n })\n });\n\n update();\n\n scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));\n scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));\n\n if (!type.clickable) return;\n hookFn = clickHook(element, $state, $timeout, type, getDef);\n bindEvents(element, scope, hookFn, rawDef.uiStateOpts);\n }\n };\n }];\n\n\n/**\n * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active\n *\n * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the\n * related directive's state is active (and remove them when it is inactive).\n *\n * The primary use-case is to highlight the active link in navigation menus,\n * distinguishing it from the inactive menu items.\n *\n * ### Linking to a `ui-sref` or `ui-state`\n * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.\n * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.\n *\n * ### Matching\n *\n * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.\n * This is a \"fuzzy match\" which uses [[StateService.includes]].\n *\n * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).\n * This is an \"exact match\" which uses [[StateService.is]].\n *\n * ### Parameter values\n * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.\n * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.\n *\n * #### Example:\n * ```html\n *
\n * ```\n *\n * When the app state is `app.user` (or any child state),\n * and contains the state parameter \"user\" with value \"bilbobaggins\",\n * the resulting HTML will appear as (note the 'active' class):\n *\n * ```html\n *
\n * ```\n *\n * ### Glob mode\n *\n * It is possible to pass `ui-sref-active` an expression that evaluates to an object.\n * The objects keys represent active class names and values represent the respective state names/globs.\n * `ui-sref-active` will match if the current active state **includes** any of\n * the specified state names/globs, even the abstract ones.\n *\n * #### Example:\n * Given the following template, with \"admin\" being an abstract state:\n * ```html\n *
\",\n * controller: function(allfolders, $scope) {\n * $scope.allfolders = allfolders;\n * }\n * }\n * ```\n *\n * Since this interface extends [[Ng1ViewDeclaration]], any view declaration properties can be set directly\n * on the state declaration and they will be applied to the view with the name `$default`. For example:\n *\n * ```js\n * var state = {\n * name: 'foo',\n * url: '/foo',\n * template: '
',\n * controller: 'FooController\n * }\n * }\n * }\n * ```\n *\n * If a state definition contains a `views:` object, any view properties set directly on the state are ignored.\n * Thus, this is an invalid state defintion:\n *\n * ```js\n * var state = {\n * name: 'foo',\n * url: '/foo',\n * controller: 'FooController, // invalid because views: exists\n * views: {\n * header: {\n * template: '
header
'\n * }\n * }\n * }\n * ```\n */\nexport interface Ng1StateDeclaration extends _Ng1StateDeclaration, Ng1ViewDeclaration {\n /**\n * An optional object which defines multiple named views.\n *\n * Each key is the name of a view, and each value is a [[Ng1ViewDeclaration]].\n * Unnamed views are internally renamed to `$default`.\n *\n * A view's name is used to match an active `` directive in the DOM. When the state\n * is entered, the state's views are activated and matched with active `` directives:\n *\n * - The view's name is processed into a ui-view target:\n * - ui-view address: an address to a ui-view\n * - state anchor: the state to anchor the address to\n *\n * Examples:\n *\n * Targets three named ui-views in the parent state's template\n *\n * #### Example:\n * ```js\n * views: {\n * header: {\n * controller: \"headerCtrl\",\n * templateUrl: \"header.html\"\n * },\n * body: {\n * controller: \"bodyCtrl\",\n * templateUrl: \"body.html\"\n * },\n * footer: \"footerComponent\"\n * }\n * ```\n *\n * #### Example:\n * ```js\n * // Targets named ui-view=\"header\" in the template of the ancestor state 'top'\n * // and the named `ui-view=\"body\" from the parent state's template.\n * views: {\n * 'header@top': {\n * controller: \"msgHeaderCtrl\",\n * templateUrl: \"msgHeader.html\"\n * },\n * 'body': {\n * controller: \"messagesCtrl\",\n * templateUrl: \"messages.html\"\n * }\n * }\n * ```\n *\n * ## View targeting details\n *\n * There are a few styles of view addressing/targeting.\n * The most common is a simple `ui-view` name\n *\n * #### Simple ui-view name\n *\n * Addresses without an `@` are anchored to the parent state.\n *\n * #### Example:\n * ```js\n * // target the `` created in the parent state's view\n * views: {\n * foo: {...}\n * }\n * ```\n *\n * #### View name anchored to a state\n *\n * You can anchor the `ui-view` name to a specific state by including an `@`\n *\n * #### Example:\n * targets the `` which was created in a view owned by the state `bar.baz`\n * ```js\n * views: {\n * 'foo@bar.baz': {...}\n * }\n * ```\n *\n * #### Absolute addressing\n *\n * You can address a `ui-view` absolutely, using dotted notation, by prefixing the address with a `!`.\n * Dotted addresses traverse the hierarchy of `ui-view`s active in the DOM:\n *\n * #### Example:\n * absolutely targets the ``\n * ... which was created in the unnamed/$default root ``\n * ```js\n * views: {\n * '!$default.nested': {...}\n * }\n * ```\n *\n * #### Relative addressing\n *\n * Absolute addressing is actually relative addressing, anchored to the unnamed root state (`\"\"`).\n * You can also use relative addressing anchored to *any state*, in order to target a target deeply nested `ui-views`:\n * The `ui-view` is targeted relative to the anchored state by traversing the nested `ui-view` names.\n *\n * #### Example:\n * targets the ``\n * ... which was created inside the\n * ``\n * ... which was created inside the parent state's template.\n * ```js\n * views: {\n * 'foo.bar': {...}\n * }\n * ```\n *\n * #### Example:\n * targets the ``\n * ... which was created in ``\n * ... which was created in a template from the state `baz.qux`\n * ```js\n * views: {\n * 'foo.bar@baz.qux': {...}\n * }\n * ```\n *\n * #### Example:\n * a view can relatively target a named `ui-view` defined on an ancestor using `^` (meaning \"parent\")\n * ```js\n * views: {\n * 'foo@^': {...}, // foo@(parent state) (same as simply 'foo')\n * 'bar@^.^': {...}, // bar@(grandparent state)\n * 'baz@^.^.^': {...}, // baz@(great-grandparent state)\n * }\n * ```\n *\n * For additional in-depth details about how `ui-view` addressing works, see the internal api [[ViewService.match]].\n *\n * ---\n *\n * ## State template+controller and `views:` incompatiblity\n *\n * If a state has a `views` object, any state-level view properties ([[Ng1ViewDeclaration]]) are ignored. Therefore,\n * if _any view_ for a state is declared in the `views` object, then _all of the state's views_ must be defined in\n * the `views` object. The state declaration must not have any of the following fields:\n * - component\n * - bindings\n * - resolveAs\n * - template\n * - templateUrl\n * - templateProvider\n * - controller\n * - controllerAs\n * - controllerProvider\n */\n views?: { [key: string]: string | Ng1ViewDeclaration; };\n\n /**\n * A state hook invoked when a state is being entered.\n *\n * The hook can inject global services.\n * It can also inject `$transition$` or `$state$` (from the current transition).\n * \n * ### Example:\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onEnter: (MyService, $transition$, $state$) => {\n * return MyService.doSomething($state$.name, $transition$.params());\n * }\n * });\n * ```\n *\n * #### Example:`\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onEnter: [ 'MyService', '$transition$', '$state$', function (MyService, $transition$, $state$) {\n * return MyService.doSomething($state$.name, $transition$.params());\n * } ]\n * });\n * ```\n */\n onEnter?: Ng1StateTransitionHook | IInjectable;\n\n /**\n * A state hook invoked when a state is being exited.\n *\n * The hook can inject global services.\n * It can also inject `$transition$` or `$state$` (from the current transition).\n *\n * ### Example:\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onExit: (MyService, $transition$, $state$) => {\n * return MyService.doSomething($state$.name, $transition$.params());\n * }\n * });\n * ```\n *\n * #### Example:`\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onExit: [ 'MyService', '$transition$', '$state$', function (MyService, $transition$, $state$) {\n * return MyService.doSomething($state$.name, $transition$.params());\n * } ]\n * });\n * ```\n */\n onExit?: Ng1StateTransitionHook | IInjectable;\n\n /**\n * A state hook invoked when a state is being retained.\n *\n * The hook can inject global services.\n * It can also inject `$transition$` or `$state$` (from the current transition).\n *\n * #### Example:\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onRetain: (MyService, $transition$, $state$) => {\n * return MyService.doSomething($state$.name, $transition$.params());\n * }\n * });\n * ```\n *\n * #### Example:`\n * ```js\n * $stateProvider.state({\n * name: 'mystate',\n * onRetain: [ 'MyService', '$transition$', '$state$', function (MyService, $transition$, $state$) {\n * return MyService.doSomething($state$.name, $transition$.params());\n * } ]\n * });\n * ```\n */\n onRetain?: Ng1StateTransitionHook | IInjectable;\n\n /**\n * Makes all search/query parameters `dynamic`\n *\n * ### Deprecation warning: use [[ParamDeclaration.dynamic]] instead\n *\n * @deprecated\n */\n reloadOnSearch?: boolean;\n}\n\nexport interface Ng1ViewDeclaration extends _ViewDeclaration {\n /**\n * The name of the component to use for this view.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * The name of an [angular 1.5+ `.component()`](https://docs.angularjs.org/guide/component) (or directive with \n * bindToController and/or scope declaration) which will be used for this view.\n *\n * Resolve data can be provided to the component via the component's `bindings` object (for 1.3+ directives, the\n * `bindToController` is used; for other directives, the `scope` declaration is used). For each binding declared \n * on the component, any resolve with the same name is set on the component's controller instance. The binding \n * is provided to the component as a one-time-binding. In general, components should likewise declare their\n * input bindings as [one-way (\"<\")](https://docs.angularjs.org/api/ng/service/$compile#-scope-).\n *\n * Note: inside a \"views:\" block, a bare string `\"foo\"` is shorthand for `{ component: \"foo\" }`\n *\n * Note: Mapping from resolve names to component inputs may be specified using [[bindings]].\n *\n * #### Example:\n * ```js\n * .state('profile', {\n * // Use the component for the Unnamed view\n * component: 'MyProfile',\n * }\n *\n * .state('messages', {\n * // use the component for the view named 'header'\n * // use the component for the view named 'content'\n * views: {\n * header: { component: 'NavBar' },\n * content: { component: 'MessageList' }\n * }\n * }\n *\n * .state('contacts', {\n * // Inside a \"views:\" block, a bare string \"NavBar\" is shorthand for { component: \"NavBar\" }\n * // use the component for the view named 'header'\n * // use the component for the view named 'content'\n * views: {\n * header: 'NavBar',\n * content: 'ContactList'\n * }\n * }\n * ```\n *\n *\n * Note: When using `component` to define a view, you may _not_ use any of: `template`, `templateUrl`,\n * `templateProvider`, `controller`, `controllerProvider`, `controllerAs`.\n *\n *\n * See also: Todd Motto's angular 1.3 and 1.4 [backport of .component()](https://github.com/toddmotto/angular-component)\n */\n component?: string;\n\n /**\n * An object which maps `resolve`s to [[component]] `bindings`.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * When using a [[component]] declaration (`component: 'myComponent'`), each input binding for the component is supplied\n * data from a resolve of the same name, by default. You may supply data from a different resolve name by mapping it here.\n *\n * Each key in this object is the name of one of the component's input bindings.\n * Each value is the name of the resolve that should be provided to that binding.\n *\n * Any component bindings that are omitted from this map get the default behavior of mapping to a resolve of the\n * same name.\n *\n * #### Example:\n * ```js\n * $stateProvider.state('foo', {\n * resolve: {\n * foo: function(FooService) { return FooService.get(); },\n * bar: function(BarService) { return BarService.get(); }\n * },\n * component: 'Baz',\n * // The component's `baz` binding gets data from the `bar` resolve\n * // The component's `foo` binding gets data from the `foo` resolve (default behavior)\n * bindings: {\n * baz: 'bar'\n * }\n * });\n *\n * app.component('Baz', {\n * templateUrl: 'baz.html',\n * controller: 'BazController',\n * bindings: {\n * foo: '<', // foo binding\n * baz: '<' // baz binding\n * }\n * });\n * ```\n *\n */\n bindings?: { [key: string]: string };\n\n /**\n * Dynamic component provider function.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * This is an injectable provider function which returns the name of the component to use.\n * The provider will invoked during a Transition in which the view's state is entered.\n * The provider is called after the resolve data is fetched.\n *\n * #### Example:\n * ```js\n * componentProvider: function(MyResolveData, $transition$) {\n * if (MyResolveData.foo) {\n * return \"fooComponent\"\n * } else if ($transition$.to().name === 'bar') {\n * return \"barComponent\";\n * }\n * }\n * ```\n */\n componentProvider?: IInjectable;\n\n /**\n * The view's controller function or name\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * The controller function, or the name of a registered controller. The controller function will be used\n * to control the contents of the [[directives.uiView]] directive.\n *\n * If specified as a string, controllerAs can be declared here, i.e., \"FooController as foo\" instead of in\n * a separate [[controllerAs]] property.\n *\n * See: [[Ng1Controller]] for information about component-level router hooks.\n */\n controller?: (IInjectable|string);\n\n /**\n * A controller alias name.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * If present, the controller will be published to scope under the `controllerAs` name.\n * See: https://docs.angularjs.org/api/ng/directive/ngController\n */\n controllerAs?: string;\n\n /**\n * Dynamic controller provider function.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * This is an injectable provider function which returns the actual controller function, or the name\n * of a registered controller. The provider will invoked during a Transition in which the view's state is\n * entered. The provider is called after the resolve data is fetched.\n *\n * #### Example:\n * ```js\n * controllerProvider: function(MyResolveData, $transition$) {\n * if (MyResolveData.foo) {\n * return \"FooCtrl\"\n * } else if ($transition$.to().name === 'bar') {\n * return \"BarCtrl\";\n * } else {\n * return function($scope) {\n * $scope.baz = \"Qux\";\n * }\n * }\n * }\n * ```\n */\n controllerProvider?: IInjectable;\n\n /**\n * The scope variable name to use for resolve data.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * When a view is activated, the resolved data for the state which the view belongs to is put on the scope.\n * This property sets the name of the scope variable to use for the resolved data.\n *\n * Defaults to `$resolve`.\n */\n resolveAs?: string;\n\n /**\n * The HTML template for the view.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * HTML template as a string, or a function which returns an html template as a string.\n * This template will be used to render the corresponding [[directives.uiView]] directive.\n *\n * This property takes precedence over templateUrl.\n *\n * If `template` is a function, it will be called with the Transition parameters as the first argument.\n *\n * #### Example:\n * ```js\n * template: \"
\";\n * }\n * ```\n */\n template?: (Function|string);\n\n /**\n * The URL for the HTML template for the view.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * A path or a function that returns a path to an html template.\n * The template will be fetched and used to render the corresponding [[directives.uiView]] directive.\n *\n * If `templateUrl` is a function, it will be called with the Transition parameters as the first argument.\n *\n * #### Example:\n * ```js\n * templateUrl: \"/templates/home.html\"\n * ```\n *\n * #### Example:\n * ```js\n * templateUrl: function(params) {\n * return myTemplates[params.pageId];\n * }\n * ```\n */\n templateUrl?: (string|Function);\n\n /**\n * Injected function which returns the HTML template.\n *\n * A property of [[Ng1StateDeclaration]] or [[Ng1ViewDeclaration]]:\n *\n * Injected function which returns the HTML template.\n * The template will be used to render the corresponding [[directives.uiView]] directive.\n *\n * #### Example:\n * ```js\n * templateProvider: function(MyTemplateService, $transition$) {\n * return MyTemplateService.getTemplate($transition$.params().pageId);\n * }\n * ```\n */\n templateProvider?: IInjectable;\n\n}\n\n/**\n * The shape of a controller for a view (and/or component), defining the controller callbacks.\n *\n * A view in UI-Router is comprised of either a `component` ([[Ng1ViewDeclaration.component]]) or a combination of a\n * `template` (or `templateProvider`) and a `controller` (or `controllerProvider`).\n *\n * The `controller` object (or the `component`'s controller object) can define component-level controller callbacks,\n * which UI-Router will call at the appropriate times. These callbacks are similar to Transition Hooks\n * ([[IHookRegistry]]), but are only called if the view is currently active.\n *\n * This interface defines the UI-Router component callbacks.\n *\n */\nexport interface Ng1Controller {\n /** @hidden */\n $onInit(): void;\n /**\n * This callback is called when parameter values have changed.\n * \n * This callback can be used to respond to changing parameter values in the current state, or in parent/child states.\n * This callback is especially handy when using dynamic parameters ([[ParamDeclaration.dynamic]])\n * \n * Called when:\n * - The view is still active\n * - A new transition has completed successfully\n * - The state for the view (controller) was not reloaded\n * - At least one parameter value was changed\n *\n * Called with:\n * @param newValues an object containing the changed parameter values\n * @param $transition$ the new Transition which triggered this callback\n *\n * #### Example:\n * ```js\n * angular.module('foo').controller('FancyCtrl', function() {\n * this.uiOnParamsChanged = function(newParams) {\n * console.log(\"new params: \", newParams);\n * }\n * });\n * ```\n */\n uiOnParamsChanged(newValues: any, $transition$: Transition): void;\n\n /**\n * This callback is called when the view's state is about to be exited.\n *\n * This callback is used to inform a view that it is about to be exited, due to a new [[Transition]].\n * The callback can ask for user confirmation, and cancel or alter the new Transition. The callback should\n * return a value, or a promise for a value. If a promise is returned, the new Transition waits until the\n * promise settles.\n *\n *\n * Called when:\n * - The view is still active\n * - A new Transition is about to run\n * - The new Transition will exit the view's state\n *\n * Called with:\n * - The new Transition\n *\n * Relevant return Values:\n * - `false`: The transition is cancelled.\n * - A rejected promise: The transition is cancelled.\n * - [[TargetState]]: The transition is redirected to the new target state.\n * - Anything else: the transition will continue normally (the state and view will be deactivated)\n *\n * #### Example:\n * ```js\n * app.component('myComponent', {\n * template: '',\n * bindings: { 'data': '<' },\n * controller: function() {\n *\n * this.originalData = angular.copy(this.data);\n *\n * this.uiCanExit = function() {\n * if (!angular.equals(this.data, this.originalData)) {\n * // Note: This could also return a Promise and request async\n * // confirmation using something like ui-bootstrap $modal\n * return window.confirm(\"Data has changed. Exit anyway and lose changes?\");\n * }\n * }\n * }\n * }\n * ```\n *\n * @param transition the new Transition that is about to exit the component's state\n * @return a HookResult, or a promise for a HookResult\n */\n uiCanExit(transition: Transition): HookResult;\n}\n\n/**\n * Manages which template-loading mechanism to use.\n *\n * Defaults to `$templateRequest` on Angular versions starting from 1.3, `$http` otherwise.\n */\nexport interface TemplateFactoryProvider {\n /**\n * Forces $templateFactory to use $http instead of $templateRequest.\n *\n * UI-Router uses `$templateRequest` by default on angular 1.3+.\n * Use this method to choose to use `$http` instead.\n *\n * ---\n *\n * ## Security warning\n *\n * This might cause XSS, as $http doesn't enforce the regular security checks for\n * templates that have been introduced in Angular 1.3.\n *\n * See the $sce documentation, section\n * \n * Impact on loading templates for more details about this mechanism.\n *\n * *Note: forcing this to `false` on Angular 1.2.x will crash, because `$templateRequest` is not implemented.*\n *\n * @param useUnsafeHttpService `true` to use `$http` to fetch templates\n */\n useHttpService(useUnsafeHttpService: boolean);\n}\n\ndeclare module \"@uirouter/core/lib/state/stateRegistry\" {\n interface StateRegistry {\n register(state: Ng1StateDeclaration);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.d.ts
new file mode 100644
index 00000000..1684f1ef
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.d.ts
@@ -0,0 +1,6 @@
+/** @hidden */
+export declare const resolveFactory: () => {
+ resolve: (invocables: {
+ [key: string]: Function;
+ }, locals?: {}, parent?: Promise) => Promise<{}>;
+};
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.js
new file mode 100644
index 00000000..e4b03b34
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.js
@@ -0,0 +1,69 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/** @module ng1 */ /** */
+var core_1 = require("@uirouter/core");
+var angular = require("angular");
+/**
+ * Implementation of the legacy `$resolve` service for angular 1.
+ */
+var $resolve = {
+ /**
+ * Asynchronously injects a resolve block.
+ *
+ * This emulates most of the behavior of the ui-router 0.2.x $resolve.resolve() service API.
+ *
+ * ### Not bundled by default
+ *
+ * This API is no longer not part of the standard `@uirouter/angularjs` bundle.
+ * For users of the prebuilt bundles, add the `release/resolveService.min.js` UMD bundle.
+ * For bundlers (webpack, browserify, etc), add `@uirouter/angularjs/lib/legacy/resolveService`.
+ *
+ * ---
+ *
+ * Given an object `invocables`, where keys are strings and values are injectable functions,
+ * injects each function, and waits for the resulting promise to resolve.
+ * When all resulting promises are resolved, returns the results as an object.
+ *
+ * #### Example:
+ * ```js
+ * let invocables = {
+ * foo: [ '$http', ($http) =>
+ * $http.get('/api/foo').then(resp => resp.data) ],
+ * bar: [ 'foo', '$http', (foo, $http) =>
+ * $http.get('/api/bar/' + foo.barId).then(resp => resp.data) ]
+ * }
+ * $resolve.resolve(invocables)
+ * .then(results => console.log(results.foo, results.bar))
+ * // Logs foo and bar:
+ * // { id: 123, barId: 456, fooData: 'foo data' }
+ * // { id: 456, barData: 'bar data' }
+ * ```
+ *
+ * @param invocables an object which looks like an [[StateDeclaration.resolve]] object; keys are resolve names and values are injectable functions
+ * @param locals key/value pre-resolved data (locals)
+ * @param parent a promise for a "parent resolve"
+ */
+ resolve: function (invocables, locals, parent) {
+ if (locals === void 0) { locals = {}; }
+ var parentNode = new core_1.PathNode(new core_1.StateObject({ params: {}, resolvables: [] }));
+ var node = new core_1.PathNode(new core_1.StateObject({ params: {}, resolvables: [] }));
+ var context = new core_1.ResolveContext([parentNode, node]);
+ context.addResolvables(core_1.resolvablesBuilder({ resolve: invocables }), node.state);
+ var resolveData = function (parentLocals) {
+ var rewrap = function (_locals) { return core_1.resolvablesBuilder({ resolve: core_1.mapObj(_locals, function (local) { return function () { return local; }; }) }); };
+ context.addResolvables(rewrap(parentLocals), parentNode.state);
+ context.addResolvables(rewrap(locals), node.state);
+ var tuples2ObjR = function (acc, tuple) {
+ acc[tuple.token] = tuple.value;
+ return acc;
+ };
+ return context.resolvePath().then(function (results) { return results.reduce(tuples2ObjR, {}); });
+ };
+ return parent ? parent.then(resolveData) : resolveData({});
+ }
+};
+/** @hidden */
+exports.resolveFactory = function () { return $resolve; };
+// The old $resolve service
+angular.module('ui.router').factory('$resolve', exports.resolveFactory);
+//# sourceMappingURL=resolveService.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.js.map
new file mode 100644
index 00000000..624885b8
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/resolveService.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "resolveService.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/legacy/resolveService.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA,kBAAkB,CAAC,MAAM;AACzB,uCAAwG;AACxG,iCAAmC;AAEnC;;GAEG;AACH,IAAI,QAAQ,GAAG;IACb;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,OAAO,EAAE,UAAC,UAAuC,EAAE,MAAW,EAAE,MAAqB;QAAlC,uBAAA,EAAA,WAAW;QAC5D,IAAI,UAAU,GAAG,IAAI,eAAQ,CAAC,IAAI,kBAAW,CAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QACtF,IAAI,IAAI,GAAG,IAAI,eAAQ,CAAC,IAAI,kBAAW,CAAO,EAAE,MAAM,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;QAChF,IAAI,OAAO,GAAG,IAAI,qBAAc,CAAC,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;QAErD,OAA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Content": [
+ "/** @module ng1 */ /** */\nimport { StateObject, PathNode, ResolveContext, Obj, mapObj, resolvablesBuilder } from \"@uirouter/core\";\nimport * as angular from \"angular\";\n\n/**\n * Implementation of the legacy `$resolve` service for angular 1.\n */\nvar $resolve = {\n /**\n * Asynchronously injects a resolve block.\n *\n * This emulates most of the behavior of the ui-router 0.2.x $resolve.resolve() service API.\n *\n * ### Not bundled by default\n *\n * This API is no longer not part of the standard `@uirouter/angularjs` bundle.\n * For users of the prebuilt bundles, add the `release/resolveService.min.js` UMD bundle.\n * For bundlers (webpack, browserify, etc), add `@uirouter/angularjs/lib/legacy/resolveService`.\n *\n * ---\n *\n * Given an object `invocables`, where keys are strings and values are injectable functions,\n * injects each function, and waits for the resulting promise to resolve.\n * When all resulting promises are resolved, returns the results as an object.\n *\n * #### Example:\n * ```js\n * let invocables = {\n * foo: [ '$http', ($http) =>\n * $http.get('/api/foo').then(resp => resp.data) ],\n * bar: [ 'foo', '$http', (foo, $http) =>\n * $http.get('/api/bar/' + foo.barId).then(resp => resp.data) ]\n * }\n * $resolve.resolve(invocables)\n * .then(results => console.log(results.foo, results.bar))\n * // Logs foo and bar:\n * // { id: 123, barId: 456, fooData: 'foo data' }\n * // { id: 456, barData: 'bar data' }\n * ```\n *\n * @param invocables an object which looks like an [[StateDeclaration.resolve]] object; keys are resolve names and values are injectable functions\n * @param locals key/value pre-resolved data (locals)\n * @param parent a promise for a \"parent resolve\"\n */\n resolve: (invocables: { [key: string]: Function }, locals = {}, parent?: Promise) => {\n let parentNode = new PathNode(new StateObject( { params: {}, resolvables: [] }));\n let node = new PathNode(new StateObject( { params: {}, resolvables: [] }));\n let context = new ResolveContext([parentNode, node]);\n\n context.addResolvables(resolvablesBuilder( { resolve: invocables }), node.state);\n\n const resolveData = (parentLocals: Obj) => {\n const rewrap = (_locals: Obj) => resolvablesBuilder( { resolve: mapObj(_locals, local => () => local) });\n context.addResolvables(rewrap(parentLocals), parentNode.state);\n context.addResolvables(rewrap(locals), node.state);\n\n const tuples2ObjR = (acc: Obj, tuple: { token: any, value: any }) => {\n acc[tuple.token] = tuple.value;\n return acc;\n };\n return context.resolvePath().then(results => results.reduce(tuples2ObjR, {}));\n };\n\n return parent ? parent.then(resolveData) : resolveData({});\n }\n};\n\n/** @hidden */\nexport const resolveFactory = () => $resolve;\n\n// The old $resolve service\nangular.module('ui.router').factory('$resolve', resolveFactory);\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.d.ts
new file mode 100644
index 00000000..db7a7204
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.d.ts
@@ -0,0 +1,124 @@
+
+import { IAngularEvent } from "angular";
+/**
+ * An event broadcast on `$rootScope` when the state transition **begins**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] instead
+ *
+ * You can use `event.preventDefault()`
+ * to prevent the transition from happening and then the transition promise will be
+ * rejected with a `'transition prevented'` value.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]]
+ *
+ * #### Example:
+ * ```js
+ * $rootScope.$on('$stateChangeStart', function(event, transition) {
+ * event.preventDefault();
+ * // transitionTo() promise will be rejected with
+ * // a 'transition prevented' error
+ * })
+ * ```
+ *
+ * @event $stateChangeStart
+ * @deprecated
+ */
+export declare var $stateChangeStart: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` if a transition is **cancelled**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] instead
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that was cancelled
+ *
+ * @event $stateChangeCancel
+ * @deprecated
+ */
+export declare var $stateChangeCancel: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` once the state transition is **complete**.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onSuccess]]
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that just succeeded
+ *
+ * @event $stateChangeSuccess
+ * @deprecated
+ */
+export declare var $stateChangeSuccess: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` when an **error occurs** during transition.
+ *
+ * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onError]]
+ *
+ * It's important to note that if you
+ * have any errors in your resolve functions (javascript errors, non-existent services, etc)
+ * they will not throw traditionally. You must listen for this $stateChangeError event to
+ * catch **ALL** errors.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `toState`: the Transition Target state
+ * - `toParams`: the Transition Target Params
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `error`: The reason the transition errored.
+ * - `options`: any Transition Options
+ * - `$transition$`: the [[Transition]] that errored
+ *
+ * @event $stateChangeError
+ * @deprecated
+ */
+export declare var $stateChangeError: IAngularEvent;
+/**
+ * An event broadcast on `$rootScope` when a requested state **cannot be found** using the provided state name.
+ *
+ * ### Deprecation warning: use [[StateService.onInvalid]] instead
+ *
+ * The event is broadcast allowing any handlers a single chance to deal with the error (usually by
+ * lazy-loading the unfound state). A `TargetState` object is passed to the listener handler,
+ * you can see its properties in the example. You can use `event.preventDefault()` to abort the
+ * transition and the promise returned from `transitionTo()` will be rejected with a
+ * `'transition aborted'` error.
+ *
+ * Additional arguments to the event handler are provided:
+ * - `unfoundState` Unfound State information. Contains: `to, toParams, options` properties.
+ * - `fromState`: the state the transition is coming from
+ * - `fromParams`: the parameters from the state the transition is coming from
+ * - `options`: any Transition Options
+ *
+ * #### Example:
+ * ```js
+ * // somewhere, assume lazy.state has not been defined
+ * $state.go("lazy.state", { a: 1, b: 2 }, { inherit: false });
+ *
+ * // somewhere else
+ * $scope.$on('$stateNotFound', function(event, transition) {
+ * function(event, unfoundState, fromState, fromParams){
+ * console.log(unfoundState.to); // "lazy.state"
+ * console.log(unfoundState.toParams); // {a:1, b:2}
+ * console.log(unfoundState.options); // {inherit:false} + default options
+ * });
+ * ```
+ *
+ * @event $stateNotFound
+ * @deprecated
+ */
+export declare var $stateNotFound: IAngularEvent;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.js
new file mode 100644
index 00000000..73d4bdd6
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.js
@@ -0,0 +1,150 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * # Legacy state events
+ *
+ * Polyfill implementation of the UI-Router 0.2.x state events.
+ *
+ * The 0.2.x state events are deprecated. We recommend moving to Transition Hooks instead, as they
+ * provide much more flexibility, support async, and provide the context (the Transition, etc) necessary
+ * to implement meaningful application behaviors.
+ *
+ * To enable these state events, include the `stateEvents.js` file in your project, e.g.,
+ * ```
+ *
+ * ```
+ * and also make sure you depend on the `ui.router.state.events` angular module, e.g.,
+ * ```
+ * angular.module("myApplication", ['ui.router', 'ui.router.state.events']
+ * ```
+ *
+ * @module ng1_state_events
+ */ /** */
+var angular_1 = require("../angular");
+(function () {
+ var isFunction = angular_1.ng.isFunction, isString = angular_1.ng.isString;
+ function applyPairs(memo, keyValTuple) {
+ var key, value;
+ if (Array.isArray(keyValTuple))
+ key = keyValTuple[0], value = keyValTuple[1];
+ if (!isString(key))
+ throw new Error("invalid parameters to applyPairs");
+ memo[key] = value;
+ return memo;
+ }
+ function stateChangeStartHandler($transition$) {
+ if (!$transition$.options().notify || !$transition$.valid() || $transition$.ignored())
+ return;
+ var $injector = $transition$.injector();
+ var $stateEvents = $injector.get('$stateEvents');
+ var $rootScope = $injector.get('$rootScope');
+ var $state = $injector.get('$state');
+ var $urlRouter = $injector.get('$urlRouter');
+ var enabledEvents = $stateEvents.provider.enabled();
+ var toParams = $transition$.params("to");
+ var fromParams = $transition$.params("from");
+ if (enabledEvents.$stateChangeSuccess) {
+ var startEvent = $rootScope.$broadcast('$stateChangeStart', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
+ if (startEvent.defaultPrevented) {
+ if (enabledEvents.$stateChangeCancel) {
+ $rootScope.$broadcast('$stateChangeCancel', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
+ }
+ //Don't update and resync url if there's been a new transition started. see issue #2238, #600
+ if ($state.transition == null)
+ $urlRouter.update();
+ return false;
+ }
+ // right after global state is updated
+ var successOpts = { priority: 9999 };
+ $transition$.onSuccess({}, function () {
+ $rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);
+ }, successOpts);
+ }
+ if (enabledEvents.$stateChangeError) {
+ $transition$.promise["catch"](function (error) {
+ if (error && (error.type === 2 /* RejectType.SUPERSEDED */ || error.type === 3 /* RejectType.ABORTED */))
+ return;
+ var evt = $rootScope.$broadcast('$stateChangeError', $transition$.to(), toParams, $transition$.from(), fromParams, error, $transition$.options(), $transition$);
+ if (!evt.defaultPrevented) {
+ $urlRouter.update();
+ }
+ });
+ }
+ }
+ stateNotFoundHandler.$inject = ['$to$', '$from$', '$state', '$rootScope', '$urlRouter'];
+ function stateNotFoundHandler($to$, $from$, injector) {
+ var $state = injector.get('$state');
+ var $rootScope = injector.get('$rootScope');
+ var $urlRouter = injector.get('$urlRouter');
+ var redirect = { to: $to$.identifier(), toParams: $to$.params(), options: $to$.options() };
+ var e = $rootScope.$broadcast('$stateNotFound', redirect, $from$.state(), $from$.params());
+ if (e.defaultPrevented || e.retry)
+ $urlRouter.update();
+ function redirectFn() {
+ return $state.target(redirect.to, redirect.toParams, redirect.options);
+ }
+ if (e.defaultPrevented) {
+ return false;
+ }
+ else if (e.retry || !!$state.get(redirect.to)) {
+ return e.retry && isFunction(e.retry.then) ? e.retry.then(redirectFn) : redirectFn();
+ }
+ }
+ $StateEventsProvider.$inject = ['$stateProvider'];
+ function $StateEventsProvider($stateProvider) {
+ $StateEventsProvider.prototype.instance = this;
+ var runtime = false;
+ var allEvents = ['$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError'];
+ var enabledStateEvents = allEvents.map(function (e) { return [e, true]; }).reduce(applyPairs, {});
+ function assertNotRuntime() {
+ if (runtime)
+ throw new Error("Cannot enable events at runtime (use $stateEventsProvider");
+ }
+ /**
+ * Enables the deprecated UI-Router 0.2.x State Events
+ * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]
+ */
+ this.enable = function () {
+ var events = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ events[_i] = arguments[_i];
+ }
+ assertNotRuntime();
+ if (!events || !events.length)
+ events = allEvents;
+ events.forEach(function (event) { return enabledStateEvents[event] = true; });
+ };
+ /**
+ * Disables the deprecated UI-Router 0.2.x State Events
+ * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]
+ */
+ this.disable = function () {
+ var events = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ events[_i] = arguments[_i];
+ }
+ assertNotRuntime();
+ if (!events || !events.length)
+ events = allEvents;
+ events.forEach(function (event) { return delete enabledStateEvents[event]; });
+ };
+ this.enabled = function () { return enabledStateEvents; };
+ this.$get = $get;
+ $get.$inject = ['$transitions'];
+ function $get($transitions) {
+ runtime = true;
+ if (enabledStateEvents["$stateNotFound"])
+ $stateProvider.onInvalid(stateNotFoundHandler);
+ if (enabledStateEvents.$stateChangeStart)
+ $transitions.onBefore({}, stateChangeStartHandler, { priority: 1000 });
+ return {
+ provider: $StateEventsProvider.prototype.instance
+ };
+ }
+ }
+ angular_1.ng.module('ui.router.state.events', ['ui.router.state'])
+ .provider("$stateEvents", $StateEventsProvider)
+ .run(['$stateEvents', function ($stateEvents) {
+ }]);
+})();
+//# sourceMappingURL=stateEvents.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.js.map
new file mode 100644
index 00000000..af94c294
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/legacy/stateEvents.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "stateEvents.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/legacy/stateEvents.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA;;;;;;;;;;;;;;;;;;;GAmBG,CAAC,MAAM;AACV,sCAA2C;AAuI3C,CAAC;IACO,IAAA,oCAAU,EAAE,gCAAQ,CAAa;IAEvC,oBAAoB,IAAS,EAAE,WAAkB;QAC/C,IAAI,GAAW,EAAE,KAAU,CAAC;QAC5B,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAAE,oBAAG,EAAE,sBAAK,CAAgB;QAC3D,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACxE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAClB,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAED,iCAAiC,YAAwB;QACvD,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAA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AAA,KAAK,IAAI,OAAA,OAAO,kBAAkB,CAAC,KAAK,CAAC,EAAhC,CAAgC,CAAC,CAAC;QAC5D,CAAC,CAAC;QAEF,IAAI,CAAC,OAAO,GAAG,cAAM,OAAA,kBAAkB,EAAlB,CAAkB,CAAC;QAExC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,CAAC,cAAc,CAAC,CAAC;QAChC,cAAc,YAA+B;YAC3C,OAAO,GAAG,IAAI,CAAC;YAEf,EAAE,CAAC,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC;gBACvC,cAAc,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;YACjD,EAAE,CAAC,CAAC,kBAAkB,CAAC,iBAAiB,CAAC;gBACvC,YAAY,CAAC,QAAQ,CAAC,EAAE,EAAE,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAEzE,MAAM,CAAC;gBACL,QAAQ,EAAE,oBAAoB,CAAC,SAAS,CAAC,QAAQ;aAClD,CAAC;QACJ,CAAC;IACH,CAAC;IAGD,YAAO,CAAC,MAAM,CAAC,wBAAwB,EAAE,CAAC,iBAAiB,CAAC,CAAC;SACxD,QAAQ,CAAC,cAAc,EAA4B,oBAAoB,CAAC;SACxE,GAAG,CAAC,CAAC,cAAc,EAAE,UAAU,YAAiB;QACjD,CAAC,CAAC,CAAC,CAAC;AACV,CAAC,CAAC,EAAE,CAAC",
+ "sourcesContent": [
+ "/**\n * # Legacy state events\n *\n * Polyfill implementation of the UI-Router 0.2.x state events.\n *\n * The 0.2.x state events are deprecated. We recommend moving to Transition Hooks instead, as they\n * provide much more flexibility, support async, and provide the context (the Transition, etc) necessary\n * to implement meaningful application behaviors.\n *\n * To enable these state events, include the `stateEvents.js` file in your project, e.g.,\n * ```\n * \n * ```\n * and also make sure you depend on the `ui.router.state.events` angular module, e.g.,\n * ```\n * angular.module(\"myApplication\", ['ui.router', 'ui.router.state.events']\n * ```\n *\n * @module ng1_state_events\n */ /** */\nimport { ng as angular } from \"../angular\";\nimport { IScope, IAngularEvent, IServiceProviderFactory } from \"angular\";\nimport {\n Obj, TargetState, StateService, Transition, TransitionService, UrlRouter, HookResult, UIInjector\n} from \"@uirouter/core\";\nimport { StateProvider } from \"../stateProvider\";\n\n/**\n * An event broadcast on `$rootScope` when the state transition **begins**.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] instead\n *\n * You can use `event.preventDefault()`\n * to prevent the transition from happening and then the transition promise will be\n * rejected with a `'transition prevented'` value.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]]\n *\n * #### Example:\n * ```js\n * $rootScope.$on('$stateChangeStart', function(event, transition) {\n * event.preventDefault();\n * // transitionTo() promise will be rejected with\n * // a 'transition prevented' error\n * })\n * ```\n *\n * @event $stateChangeStart\n * @deprecated\n */\nexport var $stateChangeStart: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` if a transition is **cancelled**.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] instead\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that was cancelled\n *\n * @event $stateChangeCancel\n * @deprecated\n */\nexport var $stateChangeCancel: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` once the state transition is **complete**.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onSuccess]]\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that just succeeded\n *\n * @event $stateChangeSuccess\n * @deprecated\n */\nexport var $stateChangeSuccess: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` when an **error occurs** during transition.\n *\n * ### Deprecation warning: use [[TransitionService.onStart]] and [[Transition.promise]], or [[Transition.onError]]\n *\n * It's important to note that if you\n * have any errors in your resolve functions (javascript errors, non-existent services, etc)\n * they will not throw traditionally. You must listen for this $stateChangeError event to\n * catch **ALL** errors.\n *\n * Additional arguments to the event handler are provided:\n * - `toState`: the Transition Target state\n * - `toParams`: the Transition Target Params\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `error`: The reason the transition errored.\n * - `options`: any Transition Options\n * - `$transition$`: the [[Transition]] that errored\n *\n * @event $stateChangeError\n * @deprecated\n */\nexport var $stateChangeError: IAngularEvent;\n\n/**\n * An event broadcast on `$rootScope` when a requested state **cannot be found** using the provided state name.\n *\n * ### Deprecation warning: use [[StateService.onInvalid]] instead\n *\n * The event is broadcast allowing any handlers a single chance to deal with the error (usually by\n * lazy-loading the unfound state). A `TargetState` object is passed to the listener handler,\n * you can see its properties in the example. You can use `event.preventDefault()` to abort the\n * transition and the promise returned from `transitionTo()` will be rejected with a\n * `'transition aborted'` error.\n *\n * Additional arguments to the event handler are provided:\n * - `unfoundState` Unfound State information. Contains: `to, toParams, options` properties.\n * - `fromState`: the state the transition is coming from\n * - `fromParams`: the parameters from the state the transition is coming from\n * - `options`: any Transition Options\n *\n * #### Example:\n * ```js\n * // somewhere, assume lazy.state has not been defined\n * $state.go(\"lazy.state\", { a: 1, b: 2 }, { inherit: false });\n *\n * // somewhere else\n * $scope.$on('$stateNotFound', function(event, transition) {\n * function(event, unfoundState, fromState, fromParams){\n * console.log(unfoundState.to); // \"lazy.state\"\n * console.log(unfoundState.toParams); // {a:1, b:2}\n * console.log(unfoundState.options); // {inherit:false} + default options\n * });\n * ```\n *\n * @event $stateNotFound\n * @deprecated\n */\nexport var $stateNotFound: IAngularEvent;\n\n\n(function () {\n let { isFunction, isString } = angular;\n\n function applyPairs(memo: Obj, keyValTuple: any[]) {\n let key: string, value: any;\n if (Array.isArray(keyValTuple)) [key, value] = keyValTuple;\n if (!isString(key)) throw new Error(\"invalid parameters to applyPairs\");\n memo[key] = value;\n return memo;\n }\n\n function stateChangeStartHandler($transition$: Transition) {\n if (!$transition$.options().notify || !$transition$.valid() || $transition$.ignored())\n return;\n\n let $injector = $transition$.injector();\n let $stateEvents = $injector.get('$stateEvents');\n let $rootScope = $injector.get('$rootScope');\n let $state = $injector.get('$state');\n let $urlRouter = $injector.get('$urlRouter');\n\n let enabledEvents = $stateEvents.provider.enabled();\n\n\n let toParams = $transition$.params(\"to\");\n let fromParams = $transition$.params(\"from\");\n\n if (enabledEvents.$stateChangeSuccess) {\n let startEvent = $rootScope.$broadcast('$stateChangeStart', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n\n if (startEvent.defaultPrevented) {\n if (enabledEvents.$stateChangeCancel) {\n $rootScope.$broadcast('$stateChangeCancel', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n }\n //Don't update and resync url if there's been a new transition started. see issue #2238, #600\n if ($state.transition == null) $urlRouter.update();\n return false;\n }\n\n // right after global state is updated\n let successOpts = { priority: 9999 };\n $transition$.onSuccess({}, function () {\n $rootScope.$broadcast('$stateChangeSuccess', $transition$.to(), toParams, $transition$.from(), fromParams, $transition$.options(), $transition$);\n }, successOpts);\n }\n\n if (enabledEvents.$stateChangeError) {\n $transition$.promise[\"catch\"](function (error) {\n if (error && (error.type === 2 /* RejectType.SUPERSEDED */ || error.type === 3 /* RejectType.ABORTED */))\n return;\n\n\n let evt = $rootScope.$broadcast('$stateChangeError', $transition$.to(), toParams, $transition$.from(), fromParams, error, $transition$.options(), $transition$);\n\n if (!evt.defaultPrevented) {\n $urlRouter.update();\n }\n });\n }\n }\n\n stateNotFoundHandler.$inject = ['$to$', '$from$', '$state', '$rootScope', '$urlRouter'];\n function stateNotFoundHandler($to$: TargetState, $from$: TargetState, injector: UIInjector): HookResult {\n let $state: StateService = injector.get('$state');\n let $rootScope: IScope = injector.get('$rootScope');\n let $urlRouter: UrlRouter = injector.get('$urlRouter');\n\n interface StateNotFoundEvent extends IAngularEvent {\n retry: Promise;\n }\n\n let redirect = { to: $to$.identifier(), toParams: $to$.params(), options: $to$.options() };\n let e = $rootScope.$broadcast('$stateNotFound', redirect, $from$.state(), $from$.params());\n\n if (e.defaultPrevented || e.retry)\n $urlRouter.update();\n\n function redirectFn(): TargetState {\n return $state.target(redirect.to, redirect.toParams, redirect.options);\n }\n\n if (e.defaultPrevented) {\n return false;\n } else if (e.retry || !!$state.get(redirect.to)) {\n return e.retry && isFunction(e.retry.then) ? e.retry.then(redirectFn) : redirectFn();\n }\n }\n\n $StateEventsProvider.$inject = ['$stateProvider'];\n function $StateEventsProvider($stateProvider: StateProvider) {\n $StateEventsProvider.prototype.instance = this;\n\n interface IEventsToggle {\n [key: string]: boolean;\n $stateChangeStart: boolean;\n $stateNotFound: boolean;\n $stateChangeSuccess: boolean;\n $stateChangeError: boolean;\n }\n\n let runtime = false;\n let allEvents = ['$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError'];\n let enabledStateEvents = allEvents.map(e => [e, true]).reduce(applyPairs, {});\n\n function assertNotRuntime() {\n if (runtime) throw new Error(\"Cannot enable events at runtime (use $stateEventsProvider\");\n }\n\n /**\n * Enables the deprecated UI-Router 0.2.x State Events\n * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]\n */\n this.enable = function (...events: string[]) {\n assertNotRuntime();\n if (!events || !events.length) events = allEvents;\n events.forEach(event => enabledStateEvents[event] = true);\n };\n\n /**\n * Disables the deprecated UI-Router 0.2.x State Events\n * [ '$stateChangeStart', '$stateNotFound', '$stateChangeSuccess', '$stateChangeError' ]\n */\n this.disable = function (...events: string[]) {\n assertNotRuntime();\n if (!events || !events.length) events = allEvents;\n events.forEach(event => delete enabledStateEvents[event]);\n };\n\n this.enabled = () => enabledStateEvents;\n\n this.$get = $get;\n $get.$inject = ['$transitions'];\n function $get($transitions: TransitionService) {\n runtime = true;\n\n if (enabledStateEvents[\"$stateNotFound\"])\n $stateProvider.onInvalid(stateNotFoundHandler);\n if (enabledStateEvents.$stateChangeStart)\n $transitions.onBefore({}, stateChangeStartHandler, { priority: 1000 });\n\n return {\n provider: $StateEventsProvider.prototype.instance\n };\n }\n }\n\n\n angular.module('ui.router.state.events', ['ui.router.state'])\n .provider(\"$stateEvents\", $StateEventsProvider)\n .run(['$stateEvents', function ($stateEvents: any) { /* Invokes $get() */\n }]);\n})();\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.d.ts
new file mode 100644
index 00000000..147d7312
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.d.ts
@@ -0,0 +1,43 @@
+
+/**
+ * @internalapi
+ * @module ng1
+ */ /** */
+import { LocationConfig, LocationServices, UIRouter } from "@uirouter/core";
+import { ILocationService, ILocationProvider } from "angular";
+/**
+ * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service
+ */
+export declare class Ng1LocationServices implements LocationConfig, LocationServices {
+ private $locationProvider;
+ private $location;
+ private $sniffer;
+ path: any;
+ search: any;
+ hash: any;
+ hashPrefix: any;
+ port: any;
+ protocol: any;
+ host: any;
+ baseHref: any;
+ private _urlListeners;
+ dispose(): void;
+ constructor($locationProvider: ILocationProvider);
+ onChange(callback: Function): () => Function[];
+ html5Mode(): any;
+ url(newUrl?: string, replace?: boolean, state?: any): string;
+ _runtimeServices($rootScope: any, $location: ILocationService, $sniffer: any, $browser: any): void;
+ /**
+ * Applys ng1-specific path parameter encoding
+ *
+ * The Angular 1 `$location` service is a bit weird.
+ * It doesn't allow slashes to be encoded/decoded bi-directionally.
+ *
+ * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
+ *
+ * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
+ *
+ * @param router
+ */
+ static monkeyPatchPathParameterType(router: UIRouter): void;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.js
new file mode 100644
index 00000000..9af2f7dc
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.js
@@ -0,0 +1,75 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var core_1 = require("@uirouter/core");
+/**
+ * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service
+ */
+var Ng1LocationServices = /** @class */ (function () {
+ function Ng1LocationServices($locationProvider) {
+ // .onChange() registry
+ this._urlListeners = [];
+ this.$locationProvider = $locationProvider;
+ var _lp = core_1.val($locationProvider);
+ core_1.createProxyFunctions(_lp, this, _lp, ['hashPrefix']);
+ }
+ Ng1LocationServices.prototype.dispose = function () { };
+ Ng1LocationServices.prototype.onChange = function (callback) {
+ var _this = this;
+ this._urlListeners.push(callback);
+ return function () { return core_1.removeFrom(_this._urlListeners)(callback); };
+ };
+ Ng1LocationServices.prototype.html5Mode = function () {
+ var html5Mode = this.$locationProvider.html5Mode();
+ html5Mode = core_1.isObject(html5Mode) ? html5Mode.enabled : html5Mode;
+ return html5Mode && this.$sniffer.history;
+ };
+ Ng1LocationServices.prototype.url = function (newUrl, replace, state) {
+ if (replace === void 0) { replace = false; }
+ if (newUrl)
+ this.$location.url(newUrl);
+ if (replace)
+ this.$location.replace();
+ if (state)
+ this.$location.state(state);
+ return this.$location.url();
+ };
+ Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser) {
+ var _this = this;
+ this.$location = $location;
+ this.$sniffer = $sniffer;
+ // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange
+ $rootScope.$on("$locationChangeSuccess", function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); });
+ var _loc = core_1.val($location);
+ var _browser = core_1.val($browser);
+ // Bind these LocationService functions to $location
+ core_1.createProxyFunctions(_loc, this, _loc, ["replace", "path", "search", "hash"]);
+ // Bind these LocationConfig functions to $location
+ core_1.createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);
+ // Bind these LocationConfig functions to $browser
+ core_1.createProxyFunctions(_browser, this, _browser, ['baseHref']);
+ };
+ /**
+ * Applys ng1-specific path parameter encoding
+ *
+ * The Angular 1 `$location` service is a bit weird.
+ * It doesn't allow slashes to be encoded/decoded bi-directionally.
+ *
+ * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
+ *
+ * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
+ *
+ * @param router
+ */
+ Ng1LocationServices.monkeyPatchPathParameterType = function (router) {
+ var pathType = router.urlMatcherFactory.type('path');
+ pathType.encode = function (val) {
+ return val != null ? val.toString().replace(/(~|\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : val;
+ };
+ pathType.decode = function (val) {
+ return val != null ? val.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : val;
+ };
+ };
+ return Ng1LocationServices;
+}());
+exports.Ng1LocationServices = Ng1LocationServices;
+//# sourceMappingURL=locationServices.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.js.map
new file mode 100644
index 00000000..337a13af
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/locationServices.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "locationServices.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/locationServices.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAKA,uCAAiF;AAGjF;;GAEG;AACH;IAmBE,6BAAY,iBAAoC;QALhD,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E,CAAC,CAAC,CAAC,CAAC,EAA9B,CAA8B,CAAC,CAAC,CAAC,CAAC,GAAG;QAA1F,CAA0F,CAAC;QAE/F,QAAQ,CAAC,MAAM,GAAG,UAAC,GAAW;YAC1B,OAAA,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,UAAA,CAAC,IAAI,OAAA,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,EAA9B,CAA8B,CAAC,CAAC,CAAC,CAAC,GAAG;QAA5F,CAA4F,CAAC;IAEnG,CAAC;IACH,0BAAC;AAAD,CAAC,AAlFD,IAkFC;AAlFY,kDAAmB",
+ "sourcesContent": [
+ "/**\n * @internalapi\n * @module ng1\n */ /** */\nimport { LocationConfig, LocationServices, UIRouter, ParamType } from \"@uirouter/core\";\nimport { val, createProxyFunctions, removeFrom, isObject } from \"@uirouter/core\";\nimport { ILocationService, ILocationProvider } from \"angular\";\n\n/**\n * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service\n */\nexport class Ng1LocationServices implements LocationConfig, LocationServices {\n private $locationProvider: ILocationProvider;\n private $location: ILocationService;\n private $sniffer;\n\n path;\n search;\n hash;\n hashPrefix;\n port;\n protocol;\n host;\n baseHref;\n\n // .onChange() registry\n private _urlListeners: Function[] = [];\n\n dispose() { }\n\n constructor($locationProvider: ILocationProvider) {\n this.$locationProvider = $locationProvider;\n let _lp = val($locationProvider);\n createProxyFunctions(_lp, this, _lp, ['hashPrefix']);\n }\n\n onChange(callback: Function) {\n this._urlListeners.push(callback);\n return () => removeFrom(this._urlListeners)(callback);\n }\n\n html5Mode() {\n let html5Mode: any = this.$locationProvider.html5Mode();\n html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;\n return html5Mode && this.$sniffer.history;\n }\n\n url(newUrl?: string, replace = false, state?) {\n if (newUrl) this.$location.url(newUrl);\n if (replace) this.$location.replace();\n if (state) this.$location.state(state);\n return this.$location.url();\n }\n\n _runtimeServices($rootScope, $location: ILocationService, $sniffer, $browser) {\n this.$location = $location;\n this.$sniffer = $sniffer;\n\n // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange\n $rootScope.$on(\"$locationChangeSuccess\", evt => this._urlListeners.forEach(fn => fn(evt)));\n let _loc = val($location);\n let _browser = val($browser);\n\n // Bind these LocationService functions to $location\n createProxyFunctions(_loc, this, _loc, [\"replace\", \"path\", \"search\", \"hash\"]);\n // Bind these LocationConfig functions to $location\n createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);\n // Bind these LocationConfig functions to $browser\n createProxyFunctions(_browser, this, _browser, ['baseHref']);\n }\n\n /**\n * Applys ng1-specific path parameter encoding\n *\n * The Angular 1 `$location` service is a bit weird.\n * It doesn't allow slashes to be encoded/decoded bi-directionally.\n *\n * See the writeup at https://github.com/angular-ui/ui-router/issues/2598\n *\n * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F\n *\n * @param router\n */\n static monkeyPatchPathParameterType(router: UIRouter) {\n let pathType: ParamType = router.urlMatcherFactory.type('path');\n\n pathType.encode = (val: any) =>\n val != null ? val.toString().replace(/(~|\\/)/g, m => ({ '~': '~~', '/': '~2F' }[m])) : val;\n\n pathType.decode = (val: string) =>\n val != null ? val.toString().replace(/(~~|~2F)/g, m => ({ '~~': '~', '~2F': '/' }[m])) : val;\n\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.d.ts
new file mode 100644
index 00000000..72217adc
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.d.ts
@@ -0,0 +1,16 @@
+
+import { IRootScopeService } from "angular";
+import { ResolveContext, TypedMap } from "@uirouter/core";
+import { StateProvider } from "./stateProvider";
+import { UrlRouterProvider } from "./urlRouterProvider";
+declare module '@uirouter/core/lib/router' {
+ interface UIRouter {
+ /** @hidden */
+ stateProvider: StateProvider;
+ /** @hidden */
+ urlRouterProvider: UrlRouterProvider;
+ }
+}
+export declare function watchDigests($rootScope: IRootScopeService): void;
+/** @hidden TODO: find a place to move this */
+export declare const getLocals: (ctx: ResolveContext) => TypedMap;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.js
new file mode 100644
index 00000000..05d33387
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.js
@@ -0,0 +1,116 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/**
+ * # Angular 1 types
+ *
+ * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.
+ * The customizations to the core types for Angular UI-Router are documented here.
+ *
+ * The optional [[$resolve]] service is also documented here.
+ *
+ * @module ng1
+ * @preferred
+ */
+/** for typedoc */
+var angular_1 = require("./angular");
+var core_1 = require("@uirouter/core");
+var views_1 = require("./statebuilders/views");
+var templateFactory_1 = require("./templateFactory");
+var stateProvider_1 = require("./stateProvider");
+var onEnterExitRetain_1 = require("./statebuilders/onEnterExitRetain");
+var locationServices_1 = require("./locationServices");
+var urlRouterProvider_1 = require("./urlRouterProvider");
+angular_1.ng.module("ui.router.angular1", []);
+var mod_init = angular_1.ng.module('ui.router.init', []);
+var mod_util = angular_1.ng.module('ui.router.util', ['ng', 'ui.router.init']);
+var mod_rtr = angular_1.ng.module('ui.router.router', ['ui.router.util']);
+var mod_state = angular_1.ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);
+var mod_main = angular_1.ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);
+var mod_cmpt = angular_1.ng.module('ui.router.compat', ['ui.router']); // tslint:disable-line
+var router = null;
+$uiRouter.$inject = ['$locationProvider'];
+/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */
+function $uiRouter($locationProvider) {
+ // Create a new instance of the Router when the $uiRouterProvider is initialized
+ router = this.router = new core_1.UIRouter();
+ router.stateProvider = new stateProvider_1.StateProvider(router.stateRegistry, router.stateService);
+ // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties
+ router.stateRegistry.decorator("views", views_1.ng1ViewsBuilder);
+ router.stateRegistry.decorator("onExit", onEnterExitRetain_1.getStateHookBuilder("onExit"));
+ router.stateRegistry.decorator("onRetain", onEnterExitRetain_1.getStateHookBuilder("onRetain"));
+ router.stateRegistry.decorator("onEnter", onEnterExitRetain_1.getStateHookBuilder("onEnter"));
+ router.viewService._pluginapi._viewConfigFactory('ng1', views_1.getNg1ViewConfigFactory());
+ var ng1LocationService = router.locationService = router.locationConfig = new locationServices_1.Ng1LocationServices($locationProvider);
+ locationServices_1.Ng1LocationServices.monkeyPatchPathParameterType(router);
+ // backwards compat: also expose router instance as $uiRouterProvider.router
+ router['router'] = router;
+ router['$get'] = $get;
+ $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache'];
+ function $get($location, $browser, $sniffer, $rootScope, $http, $templateCache) {
+ ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser);
+ delete router['router'];
+ delete router['$get'];
+ return router;
+ }
+ return router;
+}
+var getProviderFor = function (serviceName) { return ['$uiRouterProvider', function ($urp) {
+ var service = $urp.router[serviceName];
+ service["$get"] = function () { return service; };
+ return service;
+ }]; };
+// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)
+runBlock.$inject = ['$injector', '$q', '$uiRouter'];
+function runBlock($injector, $q, $uiRouter) {
+ core_1.services.$injector = $injector;
+ core_1.services.$q = $q;
+ // The $injector is now available.
+ // Find any resolvables that had dependency annotation deferred
+ $uiRouter.stateRegistry.get()
+ .map(function (x) { return x.$$state().resolvables; })
+ .reduce(core_1.unnestR, [])
+ .filter(function (x) { return x.deps === "deferred"; })
+ .forEach(function (resolvable) { return resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi); });
+}
+// $urlRouter service and $urlRouterProvider
+var getUrlRouterProvider = function (uiRouter) {
+ return uiRouter.urlRouterProvider = new urlRouterProvider_1.UrlRouterProvider(uiRouter);
+};
+// $state service and $stateProvider
+// $urlRouter service and $urlRouterProvider
+var getStateProvider = function () {
+ return core_1.extend(router.stateProvider, { $get: function () { return router.stateService; } });
+};
+watchDigests.$inject = ['$rootScope'];
+function watchDigests($rootScope) {
+ $rootScope.$watch(function () { core_1.trace.approximateDigests++; });
+}
+exports.watchDigests = watchDigests;
+mod_init.provider("$uiRouter", $uiRouter);
+mod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);
+mod_util.provider('$urlService', getProviderFor('urlService'));
+mod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]);
+mod_util.provider('$templateFactory', function () { return new templateFactory_1.TemplateFactory(); });
+mod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));
+mod_state.provider('$uiRouterGlobals', getProviderFor('globals'));
+mod_state.provider('$transitions', getProviderFor('transitionService'));
+mod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);
+mod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]);
+mod_main.factory('$view', function () { return router.viewService; });
+mod_main.service("$trace", function () { return core_1.trace; });
+mod_main.run(watchDigests);
+mod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]);
+mod_state.run(['$state', function ($state) { }]);
+mod_rtr.run(['$urlRouter', function ($urlRouter) { }]);
+mod_init.run(runBlock);
+/** @hidden TODO: find a place to move this */
+exports.getLocals = function (ctx) {
+ var tokens = ctx.getTokens().filter(core_1.isString);
+ var tuples = tokens.map(function (key) {
+ var resolvable = ctx.getResolvable(key);
+ var waitPolicy = ctx.getPolicy(resolvable).async;
+ return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];
+ });
+ return tuples.reduce(core_1.applyPairs, {});
+};
+//# sourceMappingURL=services.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.js.map
new file mode 100644
index 00000000..44caf971
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/services.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "services.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/services.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA;;;;;;;;;;GAUG;AACH,kBAAkB;AAClB,qCAA0C;AAI1C,uCAGwB;AACxB,+CAAiF;AACjF,qDAAoD;AACpD,iDAAgD;AAChD,uEAAwE;AACxE,uDAAyD;AACzD,yDAAwD;AAGxD,YAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;AACzC,IAAI,QAAQ,GAAI,YAAO,CAAC,MAAM,CAAC,gBAAgB,EAAI,EAAE,CAAC,CAAC;AACvD,IAAI,QAAQ,GAAI,YAAO,CAAC,MAAM,CAAC,gBAAgB,EAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAC7E,IAAI,OAAO,GAAK,YAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACvE,IAAI,SAAS,GAAG,YAAO,CAAC,MAAM,CAAC,iBAAiB,EAAG,CAAC,kBAAkB,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,CAAC,CAAC;AACjH,IAAI,QAAQ,GAAI,YAAO,CAAC,MAAM,CAAC,WAAW,EAAS,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAChH,IAAI,QAAQ,GAAI,YAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,sBAAsB;AAWzF,IAAI,MAAM,GAAa,IAAI,CAAC;AAE5B,SAAS,CAA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GAAG,EAAE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAE,CAAC;IACjF,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAU,EAAE,EAAE,CAAC,CAAC;AACvC,CAAC,CAAC",
+ "sourcesContent": [
+ "/**\n * # Angular 1 types\n *\n * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.\n * The customizations to the core types for Angular UI-Router are documented here.\n *\n * The optional [[$resolve]] service is also documented here.\n *\n * @module ng1\n * @preferred\n */\n/** for typedoc */\nimport { ng as angular } from \"./angular\";\nimport {\n IRootScopeService, IQService, ILocationService, ILocationProvider, IHttpService, ITemplateCacheService\n} from \"angular\";\nimport {\n services, applyPairs, isString, trace, extend, UIRouter, StateService, UrlRouter, UrlMatcherFactory, ResolveContext,\n unnestR, TypedMap\n} from \"@uirouter/core\";\nimport { ng1ViewsBuilder, getNg1ViewConfigFactory } from \"./statebuilders/views\";\nimport { TemplateFactory } from \"./templateFactory\";\nimport { StateProvider } from \"./stateProvider\";\nimport { getStateHookBuilder } from \"./statebuilders/onEnterExitRetain\";\nimport { Ng1LocationServices } from \"./locationServices\";\nimport { UrlRouterProvider } from \"./urlRouterProvider\";\nimport IInjectorService = angular.auto.IInjectorService; // tslint:disable-line\n\nangular.module(\"ui.router.angular1\", []);\nlet mod_init = angular.module('ui.router.init', []);\nlet mod_util = angular.module('ui.router.util', ['ng', 'ui.router.init']);\nlet mod_rtr = angular.module('ui.router.router', ['ui.router.util']);\nlet mod_state = angular.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);\nlet mod_main = angular.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);\nlet mod_cmpt = angular.module('ui.router.compat', ['ui.router']); // tslint:disable-line\n\ndeclare module '@uirouter/core/lib/router' {\n interface UIRouter {\n /** @hidden */\n stateProvider: StateProvider;\n /** @hidden */\n urlRouterProvider: UrlRouterProvider;\n }\n}\n\nlet router: UIRouter = null;\n\n$uiRouter.$inject = ['$locationProvider'];\n/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */\nfunction $uiRouter($locationProvider: ILocationProvider) {\n\n // Create a new instance of the Router when the $uiRouterProvider is initialized\n router = this.router = new UIRouter();\n router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);\n\n // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties\n router.stateRegistry.decorator(\"views\", ng1ViewsBuilder);\n router.stateRegistry.decorator(\"onExit\", getStateHookBuilder(\"onExit\"));\n router.stateRegistry.decorator(\"onRetain\", getStateHookBuilder(\"onRetain\"));\n router.stateRegistry.decorator(\"onEnter\", getStateHookBuilder(\"onEnter\"));\n\n router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());\n\n let ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider);\n\n Ng1LocationServices.monkeyPatchPathParameterType(router);\n\n // backwards compat: also expose router instance as $uiRouterProvider.router\n router['router'] = router;\n router['$get'] = $get;\n $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache'];\n function $get($location: ILocationService, $browser: any, $sniffer: any, $rootScope: ng.IScope, $http: IHttpService, $templateCache: ITemplateCacheService) {\n ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser);\n delete router['router'];\n delete router['$get'];\n return router;\n }\n return router;\n}\n\nconst getProviderFor = (serviceName) => [ '$uiRouterProvider', ($urp) => {\n let service = $urp.router[serviceName];\n service[\"$get\"] = () => service;\n return service;\n}];\n\n// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)\nrunBlock.$inject = ['$injector', '$q', '$uiRouter'];\nfunction runBlock($injector: IInjectorService, $q: IQService, $uiRouter: UIRouter) {\n services.$injector = $injector;\n services.$q = $q;\n\n // The $injector is now available.\n // Find any resolvables that had dependency annotation deferred\n $uiRouter.stateRegistry.get()\n .map(x => x.$$state().resolvables)\n .reduce(unnestR, [])\n .filter(x => x.deps === \"deferred\")\n .forEach(resolvable => resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi));\n}\n\n// $urlRouter service and $urlRouterProvider\nconst getUrlRouterProvider = (uiRouter: UIRouter) =>\n uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter);\n\n// $state service and $stateProvider\n// $urlRouter service and $urlRouterProvider\nconst getStateProvider = () =>\n extend(router.stateProvider, { $get: () => router.stateService });\n\nwatchDigests.$inject = ['$rootScope'];\nexport function watchDigests($rootScope: IRootScopeService) {\n $rootScope.$watch(function() { trace.approximateDigests++; });\n}\n\nmod_init .provider(\"$uiRouter\", $uiRouter);\nmod_rtr .provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);\nmod_util .provider('$urlService', getProviderFor('urlService'));\nmod_util .provider('$urlMatcherFactory', ['$uiRouterProvider', () => router.urlMatcherFactory]);\nmod_util .provider('$templateFactory', () => new TemplateFactory());\nmod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));\nmod_state.provider('$uiRouterGlobals', getProviderFor('globals'));\nmod_state.provider('$transitions', getProviderFor('transitionService'));\nmod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);\n\nmod_state.factory ('$stateParams', ['$uiRouter', ($uiRouter: UIRouter) => $uiRouter.globals.params]);\nmod_main .factory ('$view', () => router.viewService);\nmod_main .service (\"$trace\", () => trace);\n\nmod_main .run (watchDigests);\nmod_util .run (['$urlMatcherFactory', function ($urlMatcherFactory: UrlMatcherFactory) { }]);\nmod_state.run (['$state', function ($state: StateService) { }]);\nmod_rtr .run (['$urlRouter', function ($urlRouter: UrlRouter) { }]);\nmod_init .run (runBlock);\n\n/** @hidden TODO: find a place to move this */\nexport const getLocals = (ctx: ResolveContext): TypedMap => {\n let tokens = ctx.getTokens().filter(isString);\n\n let tuples = tokens .map(key => {\n let resolvable = ctx.getResolvable(key);\n let waitPolicy = ctx.getPolicy(resolvable).async;\n return [ key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data ];\n });\n\n return tuples.reduce(applyPairs, {});\n};\n\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.d.ts
new file mode 100644
index 00000000..1e2d747a
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.d.ts
@@ -0,0 +1,3 @@
+import { StateService } from "@uirouter/core";
+export declare function $IsStateFilter($state: StateService): any;
+export declare function $IncludedByStateFilter($state: StateService): any;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.js
new file mode 100644
index 00000000..d0fd2fe4
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.js
@@ -0,0 +1,46 @@
+"use strict";
+/** @module ng1 */ /** for typedoc */
+Object.defineProperty(exports, "__esModule", { value: true });
+var angular_1 = require("./angular");
+/**
+ * `isState` Filter: truthy if the current state is the parameter
+ *
+ * Translates to [[StateService.is]] `$state.is("stateName")`.
+ *
+ * #### Example:
+ * ```html
+ *
show if state is 'stateName'
+ * ```
+ */
+$IsStateFilter.$inject = ['$state'];
+function $IsStateFilter($state) {
+ var isFilter = function (state, params, options) {
+ return $state.is(state, params, options);
+ };
+ isFilter.$stateful = true;
+ return isFilter;
+}
+exports.$IsStateFilter = $IsStateFilter;
+/**
+ * `includedByState` Filter: truthy if the current state includes the parameter
+ *
+ * Translates to [[StateService.includes]]` $state.is("fullOrPartialStateName")`.
+ *
+ * #### Example:
+ * ```html
+ *
show if state includes 'fullOrPartialStateName'
+ * ```
+ */
+$IncludedByStateFilter.$inject = ['$state'];
+function $IncludedByStateFilter($state) {
+ var includesFilter = function (state, params, options) {
+ return $state.includes(state, params, options);
+ };
+ includesFilter.$stateful = true;
+ return includesFilter;
+}
+exports.$IncludedByStateFilter = $IncludedByStateFilter;
+angular_1.ng.module('ui.router.state')
+ .filter('isState', $IsStateFilter)
+ .filter('includedByState', $IncludedByStateFilter);
+//# sourceMappingURL=stateFilters.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.js.map
new file mode 100644
index 00000000..5d3b86f4
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateFilters.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "stateFilters.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/stateFilters.ts"
+ ],
+ "names": [],
+ "mappings": ";AAAA,kBAAkB,CAAC,kBAAkB;;AAErC,qCAA0C;AAG1C;;;;;;;;;GASG;AACH,cAAc,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AACpC,wBAA+B,MAAoB;IACjD,IAAI,QAAQ,GAAQ,UAAS,KAAkB,EAAE,MAAW,EAAE,OAAoC;QAChG,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC;IACF,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,QAAQ,CAAC;AAClB,CAAC;AAND,wCAMC;AAED;;;;;;;;;GASG;AACH,sBAAsB,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC5C,gCAAuC,MAAoB;IACzD,IAAI,cAAc,GAAQ,UAAS,KAAkB,EAAE,MAAW,EAAE,OAAmC;QACrG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC,CAAC;IACF,cAAc,CAAC,SAAS,GAAG,IAAI,CAAC;IAChC,MAAM,CAAE,cAAc,CAAC;AACzB,CAAC;AAND,wDAMC;AAED,YAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;KAC9B,MAAM,CAAC,SAAS,EAAE,cAAc,CAAC;KACjC,MAAM,CAAC,iBAAiB,EAAE,sBAAsB,CAAC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** for typedoc */\n\nimport { ng as angular } from \"./angular\";\nimport { Obj, StateService, StateOrName } from \"@uirouter/core\";\n\n/**\n * `isState` Filter: truthy if the current state is the parameter\n *\n * Translates to [[StateService.is]] `$state.is(\"stateName\")`.\n *\n * #### Example:\n * ```html\n *
show if state is 'stateName'
\n * ```\n */\n$IsStateFilter.$inject = ['$state'];\nexport function $IsStateFilter($state: StateService) {\n var isFilter: any = function(state: StateOrName, params: Obj, options?: { relative?: StateOrName }) {\n return $state.is(state, params, options);\n };\n isFilter.$stateful = true;\n return isFilter;\n}\n\n/**\n * `includedByState` Filter: truthy if the current state includes the parameter\n *\n * Translates to [[StateService.includes]]` $state.is(\"fullOrPartialStateName\")`.\n *\n * #### Example:\n * ```html\n *
show if state includes 'fullOrPartialStateName'
\n * ```\n */\n$IncludedByStateFilter.$inject = ['$state'];\nexport function $IncludedByStateFilter($state: StateService) {\n var includesFilter: any = function(state: StateOrName, params: Obj, options: { relative?: StateOrName }) {\n return $state.includes(state, params, options);\n };\n includesFilter.$stateful = true;\n return includesFilter;\n}\n\nangular.module('ui.router.state')\n .filter('isState', $IsStateFilter)\n .filter('includedByState', $IncludedByStateFilter);\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.d.ts
new file mode 100644
index 00000000..366b608d
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.d.ts
@@ -0,0 +1,254 @@
+/** @module ng1 */ /** for typedoc */
+import { BuilderFunction, StateRegistry, StateService, OnInvalidCallback } from "@uirouter/core";
+import { Ng1StateDeclaration } from "./interface";
+/**
+ * The Angular 1 `StateProvider`
+ *
+ * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
+ * on state.
+ *
+ * A state corresponds to a "place" in the application in terms of the overall UI and
+ * navigation. A state describes (via the controller / template / view properties) what
+ * the UI looks like and does at that place.
+ *
+ * States often have things in common, and the primary way of factoring out these
+ * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
+ * nested states.
+ *
+ * The `$stateProvider` provides interfaces to declare these states for your app.
+ */
+export declare class StateProvider {
+ private stateRegistry;
+ private stateService;
+ constructor(stateRegistry: StateRegistry, stateService: StateService);
+ /**
+ * Decorates states when they are registered
+ *
+ * Allows you to extend (carefully) or override (at your own peril) the
+ * `stateBuilder` object used internally by [[StateRegistry]].
+ * This can be used to add custom functionality to ui-router,
+ * for example inferring templateUrl based on the state name.
+ *
+ * When passing only a name, it returns the current (original or decorated) builder
+ * function that matches `name`.
+ *
+ * The builder functions that can be decorated are listed below. Though not all
+ * necessarily have a good use case for decoration, that is up to you to decide.
+ *
+ * In addition, users can attach custom decorators, which will generate new
+ * properties within the state's internal definition. There is currently no clear
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
+ * however, expect this to become increasingly relevant as we introduce additional
+ * meta-programming features.
+ *
+ * **Warning**: Decorators should not be interdependent because the order of
+ * execution of the builder functions in non-deterministic. Builder functions
+ * should only be dependent on the state definition object and super function.
+ *
+ *
+ * Existing builder functions and current return values:
+ *
+ * - **parent** `{object}` - returns the parent state object.
+ * - **data** `{object}` - returns state data, including any inherited data that is not
+ * overridden by own values (if any).
+ * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
+ * or `null`.
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
+ * navigable).
+ * - **params** `{object}` - returns an array of state params that are ensured to
+ * be a super-set of parent's params.
+ * - **views** `{object}` - returns a views object where each key is an absolute view
+ * name (i.e. "viewName@stateName") and each value is the config object
+ * (template, controller) for the view. Even when you don't use the views object
+ * explicitly on a state config, one is still created for you internally.
+ * So by decorating this builder function you have access to decorating template
+ * and controller properties.
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
+ * not including any params defined by ancestor states.
+ * - **path** `{string}` - returns the full path from the root down to this state.
+ * Needed for state activation.
+ * - **includes** `{object}` - returns an object that includes every state that
+ * would pass a `$state.includes()` test.
+ *
+ * #### Example:
+ * Override the internal 'views' builder with a function that takes the state
+ * definition, and a reference to the internal function being overridden:
+ * ```js
+ * $stateProvider.decorator('views', function (state, parent) {
+ * let result = {},
+ * views = parent(state);
+ *
+ * angular.forEach(views, function (config, name) {
+ * let autoName = (state.name + '.' + name).replace('.', '/');
+ * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+ * result[name] = config;
+ * });
+ * return result;
+ * });
+ *
+ * $stateProvider.state('home', {
+ * views: {
+ * 'contact.list': { controller: 'ListController' },
+ * 'contact.item': { controller: 'ItemController' }
+ * }
+ * });
+ * ```
+ *
+ *
+ * ```js
+ * // Auto-populates list and item views with /partials/home/contact/list.html,
+ * // and /partials/home/contact/item.html, respectively.
+ * $state.go('home');
+ * ```
+ *
+ * @param {string} name The name of the builder function to decorate.
+ * @param {object} func A function that is responsible for decorating the original
+ * builder function. The function receives two parameters:
+ *
+ * - `{object}` - state - The state config object.
+ * - `{object}` - super - The original builder function.
+ *
+ * @return {object} $stateProvider - $stateProvider instance
+ */
+ decorator(name: string, func: BuilderFunction): Function | this | BuilderFunction[];
+ /**
+ * Registers a state
+ *
+ * ### This is a passthrough to [[StateRegistry.register]].
+ *
+ * Registers a state configuration under a given state name.
+ * The stateConfig object has the following acceptable properties.
+ *
+ *
+ *
+ * - **`template`** - {string|function=} - html template as a string or a function that returns
+ * an html template as a string which should be used by the uiView directives. This property
+ * takes precedence over templateUrl.
+ *
+ * If `template` is a function, it will be called with the following parameters:
+ *
+ * - {array.<object>} - state parameters extracted from the current $location.path() by
+ * applying the current state
+ *
+ *
+ *
+ * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html
+ * template that should be used by uiView.
+ *
+ * If `templateUrl` is a function, it will be called with the following parameters:
+ *
+ * - {array.<object>} - state parameters extracted from the current $location.path() by
+ * applying the current state
+ *
+ *
+ *
+ * - **`templateProvider`** - {function=} - Provider function that returns HTML content
+ * string.
+ *
+ *
+ *
+ * - **`controller`** - {string|function=} - Controller fn that should be associated with newly
+ * related scope or the name of a registered controller if passed as a string.
+ *
+ *
+ *
+ * - **`controllerProvider`** - {function=} - Injectable provider function that returns
+ * the actual controller or string.
+ *
+ *
+ *
+ * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be
+ * published to scope under the controllerAs name.
+ *
+ *
+ *
+ * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which
+ * should be injected into the controller. If any of these dependencies are promises,
+ * the router will wait for them all to be resolved or one to be rejected before the
+ * controller is instantiated. If all the promises are resolved successfully, the values
+ * of the resolved promises are injected and $stateChangeSuccess event is fired. If any
+ * of the promises are rejected the $stateChangeError event is fired. The map object is:
+ *
+ * - key - {string}: name of dependency to be injected into controller
+ * - factory - {string|function}: If string then it is alias for service. Otherwise if function,
+ * it is injected and return value it treated as dependency. If result is a promise, it is
+ * resolved before its value is injected into controller.
+ *
+ *
+ *
+ * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or
+ * transitioned to, the `$stateParams` service will be populated with any
+ * parameters that were passed.
+ *
+ *
+ *
+ * - **`params`** - {object=} - An array of parameter names or regular expressions. Only
+ * use this within a state if you are not using url. Otherwise you can specify your
+ * parameters within the url. When a state is navigated or transitioned to, the
+ * $stateParams service will be populated with any parameters that were passed.
+ *
+ *
+ *
+ * - **`views`** - {object=} - Use the views property to set up multiple views or to target views
+ * manually/explicitly.
+ *
+ *
+ *
+ * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,
+ * but can provide inherited properties to its common children states.
+ *
+ *
+ *
+ * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way
+ * to trigger an action or dispatch an event, such as opening a dialog.
+ * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
+ *
+ *
+ *
+ * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to
+ * trigger an action or dispatch an event, such as opening a dialog.
+ * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.
+ *
+ *
+ *
+ * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state
+ * just because a search/query parameter has changed (via $location.search() or $location.hash()).
+ * Useful for when you'd like to modify $location.search() without triggering a reload.
+ *
+ *
+ *
+ * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.
+ *
+ * #### Example:
+ * Some state name examples
+ * ```js
+ * // stateName can be a single top-level name (must be unique).
+ * $stateProvider.state("home", {});
+ *
+ * // Or it can be a nested state name. This state is a child of the
+ * // above "home" state.
+ * $stateProvider.state("home.newest", {});
+ *
+ * // Nest states as deeply as needed.
+ * $stateProvider.state("home.newest.abc.xyz.inception", {});
+ *
+ * // state() returns $stateProvider, so you can chain state declarations.
+ * $stateProvider
+ * .state("home", {})
+ * .state("about", {})
+ * .state("contacts", {});
+ * ```
+ *
+ * @param {string} name A unique state name, e.g. "home", "about", "contacts".
+ * To create a parent/child state use a dot, e.g. "about.sales", "home.newest".
+ * @param {object} definition State configuration object.
+ */
+ state(name: string, definition: Ng1StateDeclaration): StateProvider;
+ state(definition: Ng1StateDeclaration): StateProvider;
+ /**
+ * Registers an invalid state handler
+ *
+ * This is a passthrough to [[StateService.onInvalid]] for ng1.
+ */
+ onInvalid(callback: OnInvalidCallback): Function;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.js
new file mode 100644
index 00000000..b8fa3b7e
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.js
@@ -0,0 +1,140 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/** @module ng1 */ /** for typedoc */
+var core_1 = require("@uirouter/core");
+/**
+ * The Angular 1 `StateProvider`
+ *
+ * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
+ * on state.
+ *
+ * A state corresponds to a "place" in the application in terms of the overall UI and
+ * navigation. A state describes (via the controller / template / view properties) what
+ * the UI looks like and does at that place.
+ *
+ * States often have things in common, and the primary way of factoring out these
+ * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
+ * nested states.
+ *
+ * The `$stateProvider` provides interfaces to declare these states for your app.
+ */
+var StateProvider = /** @class */ (function () {
+ function StateProvider(stateRegistry, stateService) {
+ this.stateRegistry = stateRegistry;
+ this.stateService = stateService;
+ core_1.createProxyFunctions(core_1.val(StateProvider.prototype), this, core_1.val(this));
+ }
+ /**
+ * Decorates states when they are registered
+ *
+ * Allows you to extend (carefully) or override (at your own peril) the
+ * `stateBuilder` object used internally by [[StateRegistry]].
+ * This can be used to add custom functionality to ui-router,
+ * for example inferring templateUrl based on the state name.
+ *
+ * When passing only a name, it returns the current (original or decorated) builder
+ * function that matches `name`.
+ *
+ * The builder functions that can be decorated are listed below. Though not all
+ * necessarily have a good use case for decoration, that is up to you to decide.
+ *
+ * In addition, users can attach custom decorators, which will generate new
+ * properties within the state's internal definition. There is currently no clear
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
+ * however, expect this to become increasingly relevant as we introduce additional
+ * meta-programming features.
+ *
+ * **Warning**: Decorators should not be interdependent because the order of
+ * execution of the builder functions in non-deterministic. Builder functions
+ * should only be dependent on the state definition object and super function.
+ *
+ *
+ * Existing builder functions and current return values:
+ *
+ * - **parent** `{object}` - returns the parent state object.
+ * - **data** `{object}` - returns state data, including any inherited data that is not
+ * overridden by own values (if any).
+ * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
+ * or `null`.
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
+ * navigable).
+ * - **params** `{object}` - returns an array of state params that are ensured to
+ * be a super-set of parent's params.
+ * - **views** `{object}` - returns a views object where each key is an absolute view
+ * name (i.e. "viewName@stateName") and each value is the config object
+ * (template, controller) for the view. Even when you don't use the views object
+ * explicitly on a state config, one is still created for you internally.
+ * So by decorating this builder function you have access to decorating template
+ * and controller properties.
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
+ * not including any params defined by ancestor states.
+ * - **path** `{string}` - returns the full path from the root down to this state.
+ * Needed for state activation.
+ * - **includes** `{object}` - returns an object that includes every state that
+ * would pass a `$state.includes()` test.
+ *
+ * #### Example:
+ * Override the internal 'views' builder with a function that takes the state
+ * definition, and a reference to the internal function being overridden:
+ * ```js
+ * $stateProvider.decorator('views', function (state, parent) {
+ * let result = {},
+ * views = parent(state);
+ *
+ * angular.forEach(views, function (config, name) {
+ * let autoName = (state.name + '.' + name).replace('.', '/');
+ * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+ * result[name] = config;
+ * });
+ * return result;
+ * });
+ *
+ * $stateProvider.state('home', {
+ * views: {
+ * 'contact.list': { controller: 'ListController' },
+ * 'contact.item': { controller: 'ItemController' }
+ * }
+ * });
+ * ```
+ *
+ *
+ * ```js
+ * // Auto-populates list and item views with /partials/home/contact/list.html,
+ * // and /partials/home/contact/item.html, respectively.
+ * $state.go('home');
+ * ```
+ *
+ * @param {string} name The name of the builder function to decorate.
+ * @param {object} func A function that is responsible for decorating the original
+ * builder function. The function receives two parameters:
+ *
+ * - `{object}` - state - The state config object.
+ * - `{object}` - super - The original builder function.
+ *
+ * @return {object} $stateProvider - $stateProvider instance
+ */
+ StateProvider.prototype.decorator = function (name, func) {
+ return this.stateRegistry.decorator(name, func) || this;
+ };
+ StateProvider.prototype.state = function (name, definition) {
+ if (core_1.isObject(name)) {
+ definition = name;
+ }
+ else {
+ definition.name = name;
+ }
+ this.stateRegistry.register(definition);
+ return this;
+ };
+ /**
+ * Registers an invalid state handler
+ *
+ * This is a passthrough to [[StateService.onInvalid]] for ng1.
+ */
+ StateProvider.prototype.onInvalid = function (callback) {
+ return this.stateService.onInvalid(callback);
+ };
+ return StateProvider;
+}());
+exports.StateProvider = StateProvider;
+//# sourceMappingURL=stateProvider.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.js.map
new file mode 100644
index 00000000..4a574faf
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/stateProvider.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "stateProvider.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/stateProvider.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA,kBAAkB,CAAC,kBAAkB;AACrC,uCAEwB;AAGxB;;;;;;;;;;;;;;;GAeG;AACH;IACE,uBAAoB,aAA4B,EAAU,YAA0B;QAAhE,kBAAa,GAAb,aAAa,CAAe;QAAU,iBAAY,GAAZ,YAAY,CAAc;QAClF,2BAAoB,CAAC,UAAG,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,UAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACtE,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwFG;IACH,iCAAS,GAAT,UAAU,IAAY,EAAE,IAAqB;QAC3C,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;IAC1D,CAAC;IAwID,6BAAK,GAAL,UAAM,IAAS,EAAE,UAAgB;QAC/B,EAAE,CAAC,CAAC,eAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnB,UAAU,GAAG,IAAI,CAAC;QACpB,CAAC;QAAC,IAAI,CAAC,CAAC;YACN,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC;QACzB,CAAC;QACD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QACxC,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAED;;;;OAIG;IAEH,iCAAS,GAAT,UAAU,QAA2B;QACnC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC/C,CAAC;IACH,oBAAC;AAAD,CAAC,AA3PD,IA2PC;AA3PY,sCAAa",
+ "sourcesContent": [
+ "/** @module ng1 */ /** for typedoc */\nimport {\n val, isObject, createProxyFunctions, BuilderFunction, StateRegistry, StateService, OnInvalidCallback\n} from \"@uirouter/core\";\nimport { Ng1StateDeclaration } from \"./interface\";\n\n/**\n * The Angular 1 `StateProvider`\n *\n * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely\n * on state.\n *\n * A state corresponds to a \"place\" in the application in terms of the overall UI and\n * navigation. A state describes (via the controller / template / view properties) what\n * the UI looks like and does at that place.\n *\n * States often have things in common, and the primary way of factoring out these\n * commonalities in this model is via the state hierarchy, i.e. parent/child states aka\n * nested states.\n *\n * The `$stateProvider` provides interfaces to declare these states for your app.\n */\nexport class StateProvider {\n constructor(private stateRegistry: StateRegistry, private stateService: StateService) {\n createProxyFunctions(val(StateProvider.prototype), this, val(this));\n }\n\n /**\n * Decorates states when they are registered\n *\n * Allows you to extend (carefully) or override (at your own peril) the\n * `stateBuilder` object used internally by [[StateRegistry]].\n * This can be used to add custom functionality to ui-router,\n * for example inferring templateUrl based on the state name.\n *\n * When passing only a name, it returns the current (original or decorated) builder\n * function that matches `name`.\n *\n * The builder functions that can be decorated are listed below. Though not all\n * necessarily have a good use case for decoration, that is up to you to decide.\n *\n * In addition, users can attach custom decorators, which will generate new\n * properties within the state's internal definition. There is currently no clear\n * use-case for this beyond accessing internal states (i.e. $state.$current),\n * however, expect this to become increasingly relevant as we introduce additional\n * meta-programming features.\n *\n * **Warning**: Decorators should not be interdependent because the order of\n * execution of the builder functions in non-deterministic. Builder functions\n * should only be dependent on the state definition object and super function.\n *\n *\n * Existing builder functions and current return values:\n *\n * - **parent** `{object}` - returns the parent state object.\n * - **data** `{object}` - returns state data, including any inherited data that is not\n * overridden by own values (if any).\n * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}\n * or `null`.\n * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is\n * navigable).\n * - **params** `{object}` - returns an array of state params that are ensured to\n * be a super-set of parent's params.\n * - **views** `{object}` - returns a views object where each key is an absolute view\n * name (i.e. \"viewName@stateName\") and each value is the config object\n * (template, controller) for the view. Even when you don't use the views object\n * explicitly on a state config, one is still created for you internally.\n * So by decorating this builder function you have access to decorating template\n * and controller properties.\n * - **ownParams** `{object}` - returns an array of params that belong to the state,\n * not including any params defined by ancestor states.\n * - **path** `{string}` - returns the full path from the root down to this state.\n * Needed for state activation.\n * - **includes** `{object}` - returns an object that includes every state that\n * would pass a `$state.includes()` test.\n *\n * #### Example:\n * Override the internal 'views' builder with a function that takes the state\n * definition, and a reference to the internal function being overridden:\n * ```js\n * $stateProvider.decorator('views', function (state, parent) {\n * let result = {},\n * views = parent(state);\n *\n * angular.forEach(views, function (config, name) {\n * let autoName = (state.name + '.' + name).replace('.', '/');\n * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';\n * result[name] = config;\n * });\n * return result;\n * });\n *\n * $stateProvider.state('home', {\n * views: {\n * 'contact.list': { controller: 'ListController' },\n * 'contact.item': { controller: 'ItemController' }\n * }\n * });\n * ```\n *\n *\n * ```js\n * // Auto-populates list and item views with /partials/home/contact/list.html,\n * // and /partials/home/contact/item.html, respectively.\n * $state.go('home');\n * ```\n *\n * @param {string} name The name of the builder function to decorate.\n * @param {object} func A function that is responsible for decorating the original\n * builder function. The function receives two parameters:\n *\n * - `{object}` - state - The state config object.\n * - `{object}` - super - The original builder function.\n *\n * @return {object} $stateProvider - $stateProvider instance\n */\n decorator(name: string, func: BuilderFunction) {\n return this.stateRegistry.decorator(name, func) || this;\n }\n\n /**\n * Registers a state\n *\n * ### This is a passthrough to [[StateRegistry.register]].\n *\n * Registers a state configuration under a given state name.\n * The stateConfig object has the following acceptable properties.\n *\n * \n *\n * - **`template`** - {string|function=} - html template as a string or a function that returns\n * an html template as a string which should be used by the uiView directives. This property\n * takes precedence over templateUrl.\n *\n * If `template` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * \n *\n * - **`templateUrl`** - {string|function=} - path or function that returns a path to an html\n * template that should be used by uiView.\n *\n * If `templateUrl` is a function, it will be called with the following parameters:\n *\n * - {array.<object>} - state parameters extracted from the current $location.path() by\n * applying the current state\n *\n * \n *\n * - **`templateProvider`** - {function=} - Provider function that returns HTML content\n * string.\n *\n * \n *\n * - **`controller`** - {string|function=} - Controller fn that should be associated with newly\n * related scope or the name of a registered controller if passed as a string.\n *\n * \n *\n * - **`controllerProvider`** - {function=} - Injectable provider function that returns\n * the actual controller or string.\n *\n * \n *\n * - **`controllerAs`** – {string=} – A controller alias name. If present the controller will be\n * published to scope under the controllerAs name.\n *\n * \n *\n * - **`resolve`** - {object.<string, function>=} - An optional map of dependencies which\n * should be injected into the controller. If any of these dependencies are promises,\n * the router will wait for them all to be resolved or one to be rejected before the\n * controller is instantiated. If all the promises are resolved successfully, the values\n * of the resolved promises are injected and $stateChangeSuccess event is fired. If any\n * of the promises are rejected the $stateChangeError event is fired. The map object is:\n *\n * - key - {string}: name of dependency to be injected into controller\n * - factory - {string|function}: If string then it is alias for service. Otherwise if function,\n * it is injected and return value it treated as dependency. If result is a promise, it is\n * resolved before its value is injected into controller.\n *\n * \n *\n * - **`url`** - {string=} - A url with optional parameters. When a state is navigated or\n * transitioned to, the `$stateParams` service will be populated with any\n * parameters that were passed.\n *\n * \n *\n * - **`params`** - {object=} - An array of parameter names or regular expressions. Only\n * use this within a state if you are not using url. Otherwise you can specify your\n * parameters within the url. When a state is navigated or transitioned to, the\n * $stateParams service will be populated with any parameters that were passed.\n *\n * \n *\n * - **`views`** - {object=} - Use the views property to set up multiple views or to target views\n * manually/explicitly.\n *\n * \n *\n * - **`abstract`** - {boolean=} - An abstract state will never be directly activated,\n * but can provide inherited properties to its common children states.\n *\n * \n *\n * - **`onEnter`** - {object=} - Callback function for when a state is entered. Good way\n * to trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.\n *\n * \n *\n * - **`onExit`** - {object=} - Callback function for when a state is exited. Good way to\n * trigger an action or dispatch an event, such as opening a dialog.\n * If minifying your scripts, make sure to use the `['injection1', 'injection2', function(injection1, injection2){}]` syntax.\n *\n * \n *\n * - **`reloadOnSearch = true`** - {boolean=} - If `false`, will not retrigger the same state\n * just because a search/query parameter has changed (via $location.search() or $location.hash()).\n * Useful for when you'd like to modify $location.search() without triggering a reload.\n *\n * \n *\n * - **`data`** - {object=} - Arbitrary data object, useful for custom configuration.\n *\n * #### Example:\n * Some state name examples\n * ```js\n * // stateName can be a single top-level name (must be unique).\n * $stateProvider.state(\"home\", {});\n *\n * // Or it can be a nested state name. This state is a child of the\n * // above \"home\" state.\n * $stateProvider.state(\"home.newest\", {});\n *\n * // Nest states as deeply as needed.\n * $stateProvider.state(\"home.newest.abc.xyz.inception\", {});\n *\n * // state() returns $stateProvider, so you can chain state declarations.\n * $stateProvider\n * .state(\"home\", {})\n * .state(\"about\", {})\n * .state(\"contacts\", {});\n * ```\n *\n * @param {string} name A unique state name, e.g. \"home\", \"about\", \"contacts\".\n * To create a parent/child state use a dot, e.g. \"about.sales\", \"home.newest\".\n * @param {object} definition State configuration object.\n */\n state(name: string, definition: Ng1StateDeclaration): StateProvider;\n state(definition: Ng1StateDeclaration): StateProvider;\n state(name: any, definition?: any) {\n if (isObject(name)) {\n definition = name;\n } else {\n definition.name = name;\n }\n this.stateRegistry.register(definition);\n return this;\n }\n\n /**\n * Registers an invalid state handler\n *\n * This is a passthrough to [[StateService.onInvalid]] for ng1.\n */\n\n onInvalid(callback: OnInvalidCallback): Function {\n return this.stateService.onInvalid(callback);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.d.ts
new file mode 100644
index 00000000..94bc8bdc
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.d.ts
@@ -0,0 +1,10 @@
+/** @module ng1 */ /** */
+import { StateObject, TransitionStateHookFn, BuilderFunction } from "@uirouter/core";
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
+ * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
+ */
+export declare const getStateHookBuilder: (hookName: "onEnter" | "onExit" | "onRetain") => (state: StateObject, parentFn: BuilderFunction) => TransitionStateHookFn;
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.js
new file mode 100644
index 00000000..5c550815
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.js
@@ -0,0 +1,25 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/** @module ng1 */ /** */
+var core_1 = require("@uirouter/core");
+var services_1 = require("../services");
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
+ * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
+ */
+exports.getStateHookBuilder = function (hookName) {
+ return function stateHookBuilder(state, parentFn) {
+ var hook = state[hookName];
+ var pathname = hookName === 'onExit' ? 'from' : 'to';
+ function decoratedNg1Hook(trans, state) {
+ var resolveContext = new core_1.ResolveContext(trans.treeChanges(pathname));
+ var locals = core_1.extend(services_1.getLocals(resolveContext), { $state$: state, $transition$: trans });
+ return core_1.services.$injector.invoke(hook, this, locals);
+ }
+ return hook ? decoratedNg1Hook : undefined;
+ };
+};
+//# sourceMappingURL=onEnterExitRetain.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.js.map
new file mode 100644
index 00000000..a883718f
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/onEnterExitRetain.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "onEnterExitRetain.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/statebuilders/onEnterExitRetain.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA,kBAAkB,CAAC,MAAM;AACzB,uCAEwB;AACxB,wCAAwC;AAGxC;;;;;;GAMG;AACU,QAAA,mBAAmB,GAAG,UAAC,QAAuC;IAC3E,OAAA,0BAA0B,KAAkB,EAAE,QAAyB;QACrE,IAAI,IAAI,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC3B,IAAI,QAAQ,GAAG,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QAErD,0BAA0B,KAAiB,EAAE,KAA0B;YACrE,IAAI,cAAc,GAAG,IAAI,qBAAc,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC;YACrE,IAAI,MAAM,GAAG,aAAM,CAAC,oBAAS,CAAC,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,CAAC,CAAC;YACxF,MAAM,CAAC,eAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7C,CAAC;AAXD,CAWC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport {\n StateObject, TransitionStateHookFn, HookResult, Transition, services, ResolveContext, extend, BuilderFunction\n} from \"@uirouter/core\";\nimport { getLocals } from \"../services\";\nimport { Ng1StateDeclaration } from '../interface';\n\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,\n * `onRetain` callback hooks on a [[Ng1StateDeclaration]].\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * ensures that those hooks are injectable for @uirouter/angularjs (ng1).\n */\nexport const getStateHookBuilder = (hookName: \"onEnter\"|\"onExit\"|\"onRetain\") =>\nfunction stateHookBuilder(state: StateObject, parentFn: BuilderFunction): TransitionStateHookFn {\n let hook = state[hookName];\n let pathname = hookName === 'onExit' ? 'from' : 'to';\n\n function decoratedNg1Hook(trans: Transition, state: Ng1StateDeclaration): HookResult {\n let resolveContext = new ResolveContext(trans.treeChanges(pathname));\n let locals = extend(getLocals(resolveContext), { $state$: state, $transition$: trans });\n return services.$injector.invoke(hook, this, locals);\n }\n\n return hook ? decoratedNg1Hook : undefined;\n};\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.d.ts
new file mode 100644
index 00000000..687ad4a4
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.d.ts
@@ -0,0 +1,34 @@
+import { StateObject, ViewConfig, ViewConfigFactory, PathNode, ResolveContext, IInjectable } from "@uirouter/core";
+import { Ng1ViewDeclaration } from "../interface";
+import { TemplateFactory } from "../templateFactory";
+export declare function getNg1ViewConfigFactory(): ViewConfigFactory;
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `views`.
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
+ *
+ * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
+ * and applies the state-level configuration to a view named `$default`.
+ */
+export declare function ng1ViewsBuilder(state: StateObject): {};
+export declare class Ng1ViewConfig implements ViewConfig {
+ path: PathNode[];
+ viewDecl: Ng1ViewDeclaration;
+ factory: TemplateFactory;
+ $id: number;
+ loaded: boolean;
+ controller: Function;
+ template: string;
+ component: string;
+ locals: any;
+ constructor(path: PathNode[], viewDecl: Ng1ViewDeclaration, factory: TemplateFactory);
+ load(): Promise;
+ getTemplate: (uiView: any, context: ResolveContext) => string;
+ /**
+ * Gets the controller for a view configuration.
+ *
+ * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.
+ */
+ getController(context: ResolveContext): (IInjectable | string | Promise);
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.js
new file mode 100644
index 00000000..7c4c88af
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.js
@@ -0,0 +1,109 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+var core_1 = require("@uirouter/core");
+function getNg1ViewConfigFactory() {
+ var templateFactory = null;
+ return function (path, view) {
+ templateFactory = templateFactory || core_1.services.$injector.get("$templateFactory");
+ return [new Ng1ViewConfig(path, view, templateFactory)];
+ };
+}
+exports.getNg1ViewConfigFactory = getNg1ViewConfigFactory;
+var hasAnyKey = function (keys, obj) {
+ return keys.reduce(function (acc, key) { return acc || core_1.isDefined(obj[key]); }, false);
+};
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `views`.
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
+ *
+ * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
+ * and applies the state-level configuration to a view named `$default`.
+ */
+function ng1ViewsBuilder(state) {
+ // Do not process root state
+ if (!state.parent)
+ return {};
+ var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);
+ // Do not allow a state to have both state-level props and also a `views: {}` property.
+ // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.
+ // However, the `$default` approach should not be mixed with a separate `views: ` block.
+ if (core_1.isDefined(state.views) && hasAnyKey(allViewKeys, state)) {
+ throw new Error("State '" + state.name + "' has a 'views' object. " +
+ "It cannot also have \"view properties\" at the state level. " +
+ "Move the following properties into a view (in the 'views' object): " +
+ (" " + allViewKeys.filter(function (key) { return core_1.isDefined(state[key]); }).join(", ")));
+ }
+ var views = {}, viewsObject = state.views || { "$default": core_1.pick(state, allViewKeys) };
+ core_1.forEach(viewsObject, function (config, name) {
+ // Account for views: { "": { template... } }
+ name = name || "$default";
+ // Account for views: { header: "headerComponent" }
+ if (core_1.isString(config))
+ config = { component: config };
+ // Make a shallow copy of the config object
+ config = core_1.extend({}, config);
+ // Do not allow a view to mix props for component-style view with props for template/controller-style view
+ if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {
+ throw new Error("Cannot combine: " + compKeys.join("|") + " with: " + nonCompKeys.join("|") + " in stateview: '" + name + "@" + state.name + "'");
+ }
+ config.resolveAs = config.resolveAs || '$resolve';
+ config.$type = "ng1";
+ config.$context = state;
+ config.$name = name;
+ var normalized = core_1.ViewService.normalizeUIViewTarget(config.$context, config.$name);
+ config.$uiViewName = normalized.uiViewName;
+ config.$uiViewContextAnchor = normalized.uiViewContextAnchor;
+ views[name] = config;
+ });
+ return views;
+}
+exports.ng1ViewsBuilder = ng1ViewsBuilder;
+var id = 0;
+var Ng1ViewConfig = /** @class */ (function () {
+ function Ng1ViewConfig(path, viewDecl, factory) {
+ var _this = this;
+ this.path = path;
+ this.viewDecl = viewDecl;
+ this.factory = factory;
+ this.$id = id++;
+ this.loaded = false;
+ this.getTemplate = function (uiView, context) {
+ return _this.component ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) : _this.template;
+ };
+ }
+ Ng1ViewConfig.prototype.load = function () {
+ var _this = this;
+ var $q = core_1.services.$q;
+ var context = new core_1.ResolveContext(this.path);
+ var params = this.path.reduce(function (acc, node) { return core_1.extend(acc, node.paramValues); }, {});
+ var promises = {
+ template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),
+ controller: $q.when(this.getController(context))
+ };
+ return $q.all(promises).then(function (results) {
+ core_1.trace.traceViewServiceEvent("Loaded", _this);
+ _this.controller = results.controller;
+ core_1.extend(_this, results.template); // Either { template: "tpl" } or { component: "cmpName" }
+ return _this;
+ });
+ };
+ /**
+ * Gets the controller for a view configuration.
+ *
+ * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.
+ */
+ Ng1ViewConfig.prototype.getController = function (context) {
+ var provider = this.viewDecl.controllerProvider;
+ if (!core_1.isInjectable(provider))
+ return this.viewDecl.controller;
+ var deps = core_1.services.$injector.annotate(provider);
+ var providerFn = core_1.isArray(provider) ? core_1.tail(provider) : provider;
+ var resolvable = new core_1.Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ return Ng1ViewConfig;
+}());
+exports.Ng1ViewConfig = Ng1ViewConfig;
+//# sourceMappingURL=views.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.js.map
new file mode 100644
index 00000000..29c153ce
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/statebuilders/views.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "views.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/statebuilders/views.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAEA,uCAIwB;AAKxB;IACE,IAAI,eAAe,GAAoB,IAAI,CAAC;IAC5C,MAAM,CAAC,UAAC,IAAI,EAAE,IAAI;QAChB,eAAe,GAAG,eAAe,IAAI,eAAQ,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAChF,MAAM,CAAC,CAAC,IAAI,aAAa,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC;AAND,0DAMC;AAED,IAAM,SAAS,GAAG,UAAC,IAAI,EAAE,GAAG;IACxB,OAAA,IAAI,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,GAAG,IAAK,OAAA,GAAG,IAAI,gBAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAA1B,CAA0B,EAAE,KAAK,CAAC;AAA5D,CAA4D,CAAC;AAEjE;;;;;;;;GAQG;AACH,yBAAgC,KAAkB;IAChD,4BAA4B;IAC5B,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,CAAC;IAE7B,IAAI,OAAO,GAAG,CAAC,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC,EAC5E,QAAQ,GAAG,CAAC,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,WAAW,CAAC,EAC5E,QAAQ,GAAG,CAAC,WAAW,EAAE,UAAU,EAAE,mBAAmB,CAAC,EACzD,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,EACtC,WAAW,GAAG,QAAQ,CAAC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,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACrE,IAAI,UAAU,GAAG,IAAI,iBAAU,CAAC,EAAE,EAAQ,UAAU,EAAE,IAAI,CAAC,CAAC;QAC5D,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACjC,CAAC;IACH,oBAAC;AAAD,CAAC,AA5CD,IA4CC;AA5CY,sCAAa",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport { ng as angular } from \"../angular\";\nimport {\n StateObject, pick, forEach, tail, extend,\n isArray, isInjectable, isDefined, isString, services, trace,\n ViewConfig, ViewService, ViewConfigFactory, PathNode, ResolveContext, Resolvable, IInjectable\n} from \"@uirouter/core\";\nimport { Ng1ViewDeclaration } from \"../interface\";\nimport { TemplateFactory } from \"../templateFactory\";\nimport IInjectorService = angular.auto.IInjectorService;\n\nexport function getNg1ViewConfigFactory(): ViewConfigFactory {\n let templateFactory: TemplateFactory = null;\n return (path, view) => {\n templateFactory = templateFactory || services.$injector.get(\"$templateFactory\");\n return [new Ng1ViewConfig(path, view, templateFactory)];\n };\n}\n\nconst hasAnyKey = (keys, obj) =>\n keys.reduce((acc, key) => acc || isDefined(obj[key]), false);\n\n/**\n * This is a [[StateBuilder.builder]] function for angular1 `views`.\n *\n * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder\n * handles the `views` property with logic specific to @uirouter/angularjs (ng1).\n *\n * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object\n * and applies the state-level configuration to a view named `$default`.\n */\nexport function ng1ViewsBuilder(state: StateObject) {\n // Do not process root state\n if (!state.parent) return {};\n\n let tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'],\n ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'],\n compKeys = ['component', 'bindings', 'componentProvider'],\n nonCompKeys = tplKeys.concat(ctrlKeys),\n allViewKeys = compKeys.concat(nonCompKeys);\n\n // Do not allow a state to have both state-level props and also a `views: {}` property.\n // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.\n // However, the `$default` approach should not be mixed with a separate `views: ` block.\n if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {\n throw new Error(`State '${state.name}' has a 'views' object. ` +\n `It cannot also have \"view properties\" at the state level. ` +\n `Move the following properties into a view (in the 'views' object): ` +\n ` ${allViewKeys.filter(key => isDefined(state[key])).join(\", \")}`);\n }\n\n let views: { [key: string]: Ng1ViewDeclaration } = {},\n viewsObject = state.views || { \"$default\": pick(state, allViewKeys) };\n\n forEach(viewsObject, function (config: Ng1ViewDeclaration, name: string) {\n // Account for views: { \"\": { template... } }\n name = name || \"$default\";\n // Account for views: { header: \"headerComponent\" }\n if (isString(config)) config = { component: config };\n\n // Make a shallow copy of the config object\n config = extend({}, config);\n\n // Do not allow a view to mix props for component-style view with props for template/controller-style view\n if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {\n throw new Error(`Cannot combine: ${compKeys.join(\"|\")} with: ${nonCompKeys.join(\"|\")} in stateview: '${name}@${state.name}'`);\n }\n\n config.resolveAs = config.resolveAs || '$resolve';\n config.$type = \"ng1\";\n config.$context = state;\n config.$name = name;\n\n let normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);\n config.$uiViewName = normalized.uiViewName;\n config.$uiViewContextAnchor = normalized.uiViewContextAnchor;\n\n views[name] = config;\n });\n return views;\n}\n\nlet id = 0;\nexport class Ng1ViewConfig implements ViewConfig {\n $id = id++;\n loaded: boolean = false;\n controller: Function; // actually IInjectable|string\n template: string;\n component: string;\n locals: any; // TODO: delete me\n\n constructor(public path: PathNode[], public viewDecl: Ng1ViewDeclaration, public factory: TemplateFactory) { }\n\n load() {\n let $q = services.$q;\n let context = new ResolveContext(this.path);\n let params = this.path.reduce((acc, node) => extend(acc, node.paramValues), {});\n\n let promises: any = {\n template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),\n controller: $q.when(this.getController(context))\n };\n\n return $q.all(promises).then((results) => {\n trace.traceViewServiceEvent(\"Loaded\", this);\n this.controller = results.controller;\n extend(this, results.template); // Either { template: \"tpl\" } or { component: \"cmpName\" }\n return this;\n });\n }\n\n getTemplate = (uiView, context: ResolveContext) =>\n this.component ? this.factory.makeComponentTemplate(uiView, context, this.component, this.viewDecl.bindings) : this.template;\n\n /**\n * Gets the controller for a view configuration.\n *\n * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.\n */\n getController(context: ResolveContext): (IInjectable|string|Promise) {\n let provider = this.viewDecl.controllerProvider;\n if (!isInjectable(provider)) return this.viewDecl.controller;\n let deps = services.$injector.annotate(provider);\n let providerFn = isArray(provider) ? tail( provider) : provider;\n let resolvable = new Resolvable(\"\", providerFn, deps);\n return resolvable.get(context);\n }\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.d.ts
new file mode 100644
index 00000000..76eae489
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.d.ts
@@ -0,0 +1,85 @@
+
+import { IAugmentedJQuery } from "angular";
+import { IInjectable, ResolveContext, RawParams } from "@uirouter/core";
+import { Ng1ViewDeclaration, TemplateFactoryProvider } from "./interface";
+/**
+ * Service which manages loading of templates from a ViewConfig.
+ */
+export declare class TemplateFactory implements TemplateFactoryProvider {
+ /** @hidden */ private _useHttp;
+ /** @hidden */ private $templateRequest;
+ /** @hidden */ private $templateCache;
+ /** @hidden */ private $http;
+ /** @hidden */ $get: (string | (($http: any, $templateCache: any, $injector: any) => this))[];
+ /** @hidden */
+ useHttpService(value: boolean): void;
+ /**
+ * Creates a template from a configuration object.
+ *
+ * @param config Configuration object for which to load a template.
+ * The following properties are search in the specified order, and the first one
+ * that is defined is used to create the template:
+ *
+ * @param params Parameters to pass to the template function.
+ * @param context The resolve context associated with the template's view
+ *
+ * @return {string|object} The template html as a string, or a promise for
+ * that string,or `null` if no template is configured.
+ */
+ fromConfig(config: Ng1ViewDeclaration, params: any, context: ResolveContext): Promise<{
+ template?: string;
+ component?: string;
+ }>;
+ /**
+ * Creates a template from a string or a function returning a string.
+ *
+ * @param template html template as a string or function that returns an html template as a string.
+ * @param params Parameters to pass to the template function.
+ *
+ * @return {string|object} The template html as a string, or a promise for that
+ * string.
+ */
+ fromString(template: (string | Function), params?: RawParams): any;
+ /**
+ * Loads a template from the a URL via `$http` and `$templateCache`.
+ *
+ * @param {string|Function} url url of the template to load, or a function
+ * that returns a url.
+ * @param {Object} params Parameters to pass to the url function.
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ fromUrl(url: (string | Function), params: any): any;
+ /**
+ * Creates a template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ fromProvider(provider: IInjectable, params: any, context: ResolveContext): Promise;
+ /**
+ * Creates a component's template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string} The template html as a string: "".
+ */
+ fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext): Promise;
+ /**
+ * Creates a template from a component's name
+ *
+ * This implements route-to-component.
+ * It works by retrieving the component (directive) metadata from the injector.
+ * It analyses the component's bindings, then constructs a template that instantiates the component.
+ * The template wires input and output bindings to resolves or from the parent component.
+ *
+ * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
+ * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
+ * @param component {string} Component's name in camel case.
+ * @param bindings An object defining the component's bindings: {foo: '<'}
+ * @return {string} The template as a string: "".
+ */
+ makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any): string;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.js
new file mode 100644
index 00000000..a7f6cfd7
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.js
@@ -0,0 +1,194 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/** @module view */
+/** for typedoc */
+var angular_1 = require("./angular");
+var core_1 = require("@uirouter/core");
+/**
+ * Service which manages loading of templates from a ViewConfig.
+ */
+var TemplateFactory = /** @class */ (function () {
+ function TemplateFactory() {
+ var _this = this;
+ /** @hidden */ this._useHttp = angular_1.ng.version.minor < 3;
+ /** @hidden */ this.$get = ['$http', '$templateCache', '$injector', function ($http, $templateCache, $injector) {
+ _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');
+ _this.$http = $http;
+ _this.$templateCache = $templateCache;
+ return _this;
+ }];
+ }
+ /** @hidden */
+ TemplateFactory.prototype.useHttpService = function (value) {
+ this._useHttp = value;
+ };
+ ;
+ /**
+ * Creates a template from a configuration object.
+ *
+ * @param config Configuration object for which to load a template.
+ * The following properties are search in the specified order, and the first one
+ * that is defined is used to create the template:
+ *
+ * @param params Parameters to pass to the template function.
+ * @param context The resolve context associated with the template's view
+ *
+ * @return {string|object} The template html as a string, or a promise for
+ * that string,or `null` if no template is configured.
+ */
+ TemplateFactory.prototype.fromConfig = function (config, params, context) {
+ var defaultTemplate = "";
+ var asTemplate = function (result) { return core_1.services.$q.when(result).then(function (str) { return ({ template: str }); }); };
+ var asComponent = function (result) { return core_1.services.$q.when(result).then(function (str) { return ({ component: str }); }); };
+ return (core_1.isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) :
+ core_1.isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) :
+ core_1.isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) :
+ core_1.isDefined(config.component) ? asComponent(config.component) :
+ core_1.isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) :
+ asTemplate(defaultTemplate));
+ };
+ ;
+ /**
+ * Creates a template from a string or a function returning a string.
+ *
+ * @param template html template as a string or function that returns an html template as a string.
+ * @param params Parameters to pass to the template function.
+ *
+ * @return {string|object} The template html as a string, or a promise for that
+ * string.
+ */
+ TemplateFactory.prototype.fromString = function (template, params) {
+ return core_1.isFunction(template) ? template(params) : template;
+ };
+ ;
+ /**
+ * Loads a template from the a URL via `$http` and `$templateCache`.
+ *
+ * @param {string|Function} url url of the template to load, or a function
+ * that returns a url.
+ * @param {Object} params Parameters to pass to the url function.
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ TemplateFactory.prototype.fromUrl = function (url, params) {
+ if (core_1.isFunction(url))
+ url = url(params);
+ if (url == null)
+ return null;
+ if (this._useHttp) {
+ return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })
+ .then(function (response) {
+ return response.data;
+ });
+ }
+ return this.$templateRequest(url);
+ };
+ ;
+ /**
+ * Creates a template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ TemplateFactory.prototype.fromProvider = function (provider, params, context) {
+ var deps = core_1.services.$injector.annotate(provider);
+ var providerFn = core_1.isArray(provider) ? core_1.tail(provider) : provider;
+ var resolvable = new core_1.Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ ;
+ /**
+ * Creates a component's template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string} The template html as a string: "".
+ */
+ TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {
+ var deps = core_1.services.$injector.annotate(provider);
+ var providerFn = core_1.isArray(provider) ? core_1.tail(provider) : provider;
+ var resolvable = new core_1.Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ ;
+ /**
+ * Creates a template from a component's name
+ *
+ * This implements route-to-component.
+ * It works by retrieving the component (directive) metadata from the injector.
+ * It analyses the component's bindings, then constructs a template that instantiates the component.
+ * The template wires input and output bindings to resolves or from the parent component.
+ *
+ * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
+ * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
+ * @param component {string} Component's name in camel case.
+ * @param bindings An object defining the component's bindings: {foo: '<'}
+ * @return {string} The template as a string: "".
+ */
+ TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {
+ bindings = bindings || {};
+ // Bind once prefix
+ var prefix = angular_1.ng.version.minor >= 3 ? "::" : "";
+ // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`
+ var kebob = function (camelCase) {
+ var kebobed = core_1.kebobString(camelCase);
+ return /^(x|data)-/.exec(kebobed) ? "x-" + kebobed : kebobed;
+ };
+ var attributeTpl = function (input) {
+ var name = input.name, type = input.type;
+ var attrName = kebob(name);
+ // If the ui-view has an attribute which matches a binding on the routed component
+ // then pass that attribute through to the routed component template.
+ // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`
+ if (uiView.attr(attrName) && !bindings[name])
+ return attrName + "='" + uiView.attr(attrName) + "'";
+ var resolveName = bindings[name] || name;
+ // Pre-evaluate the expression for "@" bindings by enclosing in {{ }}
+ // some-attr="{{ ::$resolve.someResolveName }}"
+ if (type === '@')
+ return attrName + "='{{" + prefix + "$resolve." + resolveName + "}}'";
+ // Wire "&" callbacks to resolves that return a callback function
+ // Get the result of the resolve (should be a function) and annotate it to get its arguments.
+ // some-attr="$resolve.someResolveResultName(foo, bar)"
+ if (type === '&') {
+ var res = context.getResolvable(resolveName);
+ var fn = res && res.data;
+ var args = fn && core_1.services.$injector.annotate(fn) || [];
+ // account for array style injection, i.e., ['foo', function(foo) {}]
+ var arrayIdxStr = core_1.isArray(fn) ? "[" + (fn.length - 1) + "]" : '';
+ return attrName + "='$resolve." + resolveName + arrayIdxStr + "(" + args.join(",") + ")'";
+ }
+ // some-attr="::$resolve.someResolveName"
+ return attrName + "='" + prefix + "$resolve." + resolveName + "'";
+ };
+ var attrs = getComponentBindings(component).map(attributeTpl).join(" ");
+ var kebobName = kebob(component);
+ return "<" + kebobName + " " + attrs + ">" + kebobName + ">";
+ };
+ ;
+ return TemplateFactory;
+}());
+exports.TemplateFactory = TemplateFactory;
+// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')
+function getComponentBindings(name) {
+ var cmpDefs = core_1.services.$injector.get(name + "Directive"); // could be multiple
+ if (!cmpDefs || !cmpDefs.length)
+ throw new Error("Unable to find component named '" + name + "'");
+ return cmpDefs.map(getBindings).reduce(core_1.unnestR, []);
+}
+// Given a directive definition, find its object input attributes
+// Use different properties, depending on the type of directive (component, bindToController, normal)
+var getBindings = function (def) {
+ if (core_1.isObject(def.bindToController))
+ return scopeBindings(def.bindToController);
+ return scopeBindings(def.scope);
+};
+// for ng 1.2 style, process the scope: { input: "=foo" }
+// for ng 1.3 through ng 1.5, process the component's bindToController: { input: "=foo" } object
+var scopeBindings = function (bindingsObj) { return Object.keys(bindingsObj || {})
+ .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; })
+ .filter(function (tuple) { return core_1.isDefined(tuple) && core_1.isArray(tuple[1]); })
+ .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); }); };
+//# sourceMappingURL=templateFactory.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.js.map
new file mode 100644
index 00000000..9c24126b
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/templateFactory.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "templateFactory.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/templateFactory.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA,mBAAmB;AACnB,kBA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./angular\";\nimport { IAugmentedJQuery } from \"angular\";\nimport {\n isArray, isDefined, isFunction, isObject, services, Obj, IInjectable, tail, kebobString, unnestR, ResolveContext,\n Resolvable, RawParams\n} from \"@uirouter/core\";\nimport { Ng1ViewDeclaration, TemplateFactoryProvider } from \"./interface\";\n\n/**\n * Service which manages loading of templates from a ViewConfig.\n */\nexport class TemplateFactory implements TemplateFactoryProvider {\n /** @hidden */ private _useHttp = angular.version.minor < 3;\n /** @hidden */ private $templateRequest;\n /** @hidden */ private $templateCache;\n /** @hidden */ private $http;\n\n /** @hidden */ $get = ['$http', '$templateCache', '$injector', ($http, $templateCache, $injector) => {\n this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');\n this.$http = $http;\n this.$templateCache = $templateCache;\n return this;\n }];\n\n /** @hidden */\n useHttpService(value: boolean) {\n this._useHttp = value;\n };\n\n /**\n * Creates a template from a configuration object.\n *\n * @param config Configuration object for which to load a template.\n * The following properties are search in the specified order, and the first one\n * that is defined is used to create the template:\n *\n * @param params Parameters to pass to the template function.\n * @param context The resolve context associated with the template's view\n *\n * @return {string|object} The template html as a string, or a promise for\n * that string,or `null` if no template is configured.\n */\n fromConfig(config: Ng1ViewDeclaration, params: any, context: ResolveContext): Promise<{ template?: string, component?: string }> {\n const defaultTemplate = \"\";\n\n const asTemplate = (result) => services.$q.when(result).then(str => ({ template: str }));\n const asComponent = (result) => services.$q.when(result).then(str => ({ component: str }));\n\n return (\n isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) :\n isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) :\n isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) :\n isDefined(config.component) ? asComponent(config.component) :\n isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) :\n asTemplate(defaultTemplate)\n );\n };\n\n /**\n * Creates a template from a string or a function returning a string.\n *\n * @param template html template as a string or function that returns an html template as a string.\n * @param params Parameters to pass to the template function.\n *\n * @return {string|object} The template html as a string, or a promise for that\n * string.\n */\n fromString(template: (string | Function), params?: RawParams) {\n return isFunction(template) ? ( template)(params) : template;\n };\n\n /**\n * Loads a template from the a URL via `$http` and `$templateCache`.\n *\n * @param {string|Function} url url of the template to load, or a function\n * that returns a url.\n * @param {Object} params Parameters to pass to the url function.\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n fromUrl(url: (string | Function), params: any) {\n if (isFunction(url)) url = ( url)(params);\n if (url == null) return null;\n\n if (this._useHttp) {\n return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })\n .then(function (response) {\n return response.data;\n });\n }\n\n return this.$templateRequest(url);\n };\n\n /**\n * Creates a template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string|Promise.} The template html as a string, or a promise\n * for that string.\n */\n fromProvider(provider: IInjectable, params: any, context: ResolveContext) {\n let deps = services.$injector.annotate(provider);\n let providerFn = isArray(provider) ? tail( provider) : provider;\n let resolvable = new Resolvable(\"\", providerFn, deps);\n return resolvable.get(context);\n };\n\n /**\n * Creates a component's template by invoking an injectable provider function.\n *\n * @param provider Function to invoke via `locals`\n * @param {Function} injectFn a function used to invoke the template provider\n * @return {string} The template html as a string: \"\".\n */\n fromComponentProvider(provider: IInjectable, params: any, context: ResolveContext) {\n let deps = services.$injector.annotate(provider);\n let providerFn = isArray(provider) ? tail( provider) : provider;\n let resolvable = new Resolvable(\"\", providerFn, deps);\n return resolvable.get(context);\n };\n\n /**\n * Creates a template from a component's name\n *\n * This implements route-to-component.\n * It works by retrieving the component (directive) metadata from the injector.\n * It analyses the component's bindings, then constructs a template that instantiates the component.\n * The template wires input and output bindings to resolves or from the parent component.\n *\n * @param uiView {object} The parent ui-view (for binding outputs to callbacks)\n * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)\n * @param component {string} Component's name in camel case.\n * @param bindings An object defining the component's bindings: {foo: '<'}\n * @return {string} The template as a string: \"\".\n */\n makeComponentTemplate(uiView: IAugmentedJQuery, context: ResolveContext, component: string, bindings?: any) {\n bindings = bindings || {};\n\n // Bind once prefix\n const prefix = angular.version.minor >= 3 ? \"::\" : \"\";\n // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`\n const kebob = (camelCase: string) => {\n const kebobed = kebobString(camelCase);\n return /^(x|data)-/.exec(kebobed) ? `x-${kebobed}` : kebobed;\n };\n\n\n const attributeTpl = (input: BindingTuple) => {\n let { name, type } = input;\n let attrName = kebob(name);\n // If the ui-view has an attribute which matches a binding on the routed component\n // then pass that attribute through to the routed component template.\n // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`\n if (uiView.attr(attrName) && !bindings[name])\n return `${attrName}='${uiView.attr(attrName)}'`;\n\n let resolveName = bindings[name] || name;\n // Pre-evaluate the expression for \"@\" bindings by enclosing in {{ }}\n // some-attr=\"{{ ::$resolve.someResolveName }}\"\n if (type === '@')\n return `${attrName}='{{${prefix}$resolve.${resolveName}}}'`;\n\n // Wire \"&\" callbacks to resolves that return a callback function\n // Get the result of the resolve (should be a function) and annotate it to get its arguments.\n // some-attr=\"$resolve.someResolveResultName(foo, bar)\"\n if (type === '&') {\n let res = context.getResolvable(resolveName);\n let fn = res && res.data;\n let args = fn && services.$injector.annotate(fn) || [];\n // account for array style injection, i.e., ['foo', function(foo) {}]\n let arrayIdxStr = isArray(fn) ? `[${fn.length - 1}]` : '';\n return `${attrName}='$resolve.${resolveName}${arrayIdxStr}(${args.join(\",\")})'`;\n }\n\n // some-attr=\"::$resolve.someResolveName\"\n return `${attrName}='${prefix}$resolve.${resolveName}'`;\n };\n\n let attrs = getComponentBindings(component).map(attributeTpl).join(\" \");\n let kebobName = kebob(component);\n return `<${kebobName} ${attrs}>${kebobName}>`;\n };\n}\n\n// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')\nfunction getComponentBindings(name: string) {\n let cmpDefs = services.$injector.get(name + \"Directive\"); // could be multiple\n if (!cmpDefs || !cmpDefs.length) throw new Error(`Unable to find component named '${name}'`);\n return cmpDefs.map(getBindings).reduce(unnestR, []);\n}\n\n// Given a directive definition, find its object input attributes\n// Use different properties, depending on the type of directive (component, bindToController, normal)\nconst getBindings = (def: any) => {\n if (isObject(def.bindToController)) return scopeBindings(def.bindToController);\n return scopeBindings(def.scope);\n};\n\ninterface BindingTuple {\n name: string;\n type: string;\n}\n\n// for ng 1.2 style, process the scope: { input: \"=foo\" }\n// for ng 1.3 through ng 1.5, process the component's bindToController: { input: \"=foo\" } object\nconst scopeBindings = (bindingsObj: Obj) => Object.keys(bindingsObj || {})\n // [ 'input', [ '=foo', '=', 'foo' ] ]\n .map(key => [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])])\n // skip malformed values\n .filter(tuple => isDefined(tuple) && isArray(tuple[1]))\n // { name: ('foo' || 'input'), type: '=' }\n .map(tuple => ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] } as BindingTuple));\n\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.d.ts
new file mode 100644
index 00000000..aa31bd77
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.d.ts
@@ -0,0 +1,157 @@
+/** @module url */ /** */
+import { UIRouter, UrlRouter, LocationServices, $InjectorLike, UrlRuleHandlerFn, UrlMatcher, IInjectable } from "@uirouter/core";
+export interface RawNg1RuleFunction {
+ ($injector: $InjectorLike, $location: LocationServices): string | void;
+}
+/**
+ * Manages rules for client-side URL
+ *
+ * ### Deprecation warning:
+ * This class is now considered to be an internal API
+ * Use the [[UrlService]] instead.
+ * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].
+ *
+ * This class manages the router rules for what to do when the URL changes.
+ *
+ * This provider remains for backwards compatibility.
+ *
+ * @deprecated
+ */
+export declare class UrlRouterProvider {
+ /** @hidden */ _router: UIRouter;
+ /** @hidden */ _urlRouter: UrlRouter;
+ /** @hidden */
+ constructor(router: UIRouter);
+ /** @hidden */
+ $get(): UrlRouter;
+ /**
+ * Registers a url handler function.
+ *
+ * Registers a low level url handler (a `rule`).
+ * A rule detects specific URL patterns and returns a redirect, or performs some action.
+ *
+ * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Here's an example of how you might allow case insensitive urls
+ * $urlRouterProvider.rule(function ($injector, $location) {
+ * var path = $location.path(),
+ * normalized = path.toLowerCase();
+ *
+ * if (path !== normalized) {
+ * return normalized;
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param ruleFn
+ * Handler function that takes `$injector` and `$location` services as arguments.
+ * You can use them to detect a url and return a different url as a string.
+ *
+ * @return [[UrlRouterProvider]] (`this`)
+ */
+ rule(ruleFn: RawNg1RuleFunction): UrlRouterProvider;
+ /**
+ * Defines the path or behavior to use when no url can be matched.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // if the path doesn't match any of the urls you configured
+ * // otherwise will take care of routing the user to the
+ * // specified url
+ * $urlRouterProvider.otherwise('/index');
+ *
+ * // Example of using function rule as param
+ * $urlRouterProvider.otherwise(function ($injector, $location) {
+ * return '/a/valid/url';
+ * });
+ * });
+ * ```
+ *
+ * @param rule
+ * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.
+ * The function version is passed two params: `$injector` and `$location` services, and should return a url string.
+ *
+ * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
+ */
+ otherwise(rule: string | RawNg1RuleFunction): UrlRouterProvider;
+ /**
+ * Registers a handler for a given url matching.
+ *
+ * If the handler is a string, it is
+ * treated as a redirect, and is interpolated according to the syntax of match
+ * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
+ *
+ * If the handler is a function, it is injectable.
+ * It gets invoked if `$location` matches.
+ * You have the option of inject the match object as `$match`.
+ *
+ * The handler can return
+ *
+ * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
+ * will continue trying to find another one that matches.
+ * - **string** which is treated as a redirect and passed to `$location.url()`
+ * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+ * if ($state.$current.navigable !== state ||
+ * !equalForKeys($match, $stateParams) {
+ * $state.transitionTo(state, $match, false);
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param what A pattern string to match, compiled as a [[UrlMatcher]].
+ * @param handler The path (or function that returns a path) that you want to redirect your user to.
+ * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]
+ *
+ * Note: the handler may also invoke arbitrary code, such as `$state.go()`
+ */
+ when(what: (RegExp | UrlMatcher | string), handler: string | IInjectable): this;
+ static injectableHandler(router: UIRouter, handler: any): UrlRuleHandlerFn;
+ /**
+ * Disables monitoring of the URL.
+ *
+ * Call this method before UI-Router has bootstrapped.
+ * It will stop UI-Router from performing the initial url sync.
+ *
+ * This can be useful to perform some asynchronous initialization before the router starts.
+ * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Prevent $urlRouter from automatically intercepting URL changes;
+ * $urlRouterProvider.deferIntercept();
+ * })
+ *
+ * app.run(function (MyService, $urlRouter, $http) {
+ * $http.get("/stuff").then(function(resp) {
+ * MyService.doStuff(resp.data);
+ * $urlRouter.listen();
+ * $urlRouter.sync();
+ * });
+ * });
+ * ```
+ *
+ * @param defer Indicates whether to defer location change interception.
+ * Passing no parameter is equivalent to `true`.
+ */
+ deferIntercept(defer?: boolean): void;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.js
new file mode 100644
index 00000000..698e2911
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.js
@@ -0,0 +1,206 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/** @module url */ /** */
+var core_1 = require("@uirouter/core");
+var core_2 = require("@uirouter/core");
+/**
+ * Manages rules for client-side URL
+ *
+ * ### Deprecation warning:
+ * This class is now considered to be an internal API
+ * Use the [[UrlService]] instead.
+ * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].
+ *
+ * This class manages the router rules for what to do when the URL changes.
+ *
+ * This provider remains for backwards compatibility.
+ *
+ * @deprecated
+ */
+var UrlRouterProvider = /** @class */ (function () {
+ /** @hidden */
+ function UrlRouterProvider(router) {
+ this._router = router;
+ this._urlRouter = router.urlRouter;
+ }
+ /** @hidden */
+ UrlRouterProvider.prototype.$get = function () {
+ var urlRouter = this._urlRouter;
+ urlRouter.update(true);
+ if (!urlRouter.interceptDeferred)
+ urlRouter.listen();
+ return urlRouter;
+ };
+ /**
+ * Registers a url handler function.
+ *
+ * Registers a low level url handler (a `rule`).
+ * A rule detects specific URL patterns and returns a redirect, or performs some action.
+ *
+ * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Here's an example of how you might allow case insensitive urls
+ * $urlRouterProvider.rule(function ($injector, $location) {
+ * var path = $location.path(),
+ * normalized = path.toLowerCase();
+ *
+ * if (path !== normalized) {
+ * return normalized;
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param ruleFn
+ * Handler function that takes `$injector` and `$location` services as arguments.
+ * You can use them to detect a url and return a different url as a string.
+ *
+ * @return [[UrlRouterProvider]] (`this`)
+ */
+ UrlRouterProvider.prototype.rule = function (ruleFn) {
+ var _this = this;
+ if (!core_2.isFunction(ruleFn))
+ throw new Error("'rule' must be a function");
+ var match = function () {
+ return ruleFn(core_2.services.$injector, _this._router.locationService);
+ };
+ var rule = new core_1.BaseUrlRule(match, core_2.identity);
+ this._urlRouter.rule(rule);
+ return this;
+ };
+ ;
+ /**
+ * Defines the path or behavior to use when no url can be matched.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // if the path doesn't match any of the urls you configured
+ * // otherwise will take care of routing the user to the
+ * // specified url
+ * $urlRouterProvider.otherwise('/index');
+ *
+ * // Example of using function rule as param
+ * $urlRouterProvider.otherwise(function ($injector, $location) {
+ * return '/a/valid/url';
+ * });
+ * });
+ * ```
+ *
+ * @param rule
+ * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.
+ * The function version is passed two params: `$injector` and `$location` services, and should return a url string.
+ *
+ * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
+ */
+ UrlRouterProvider.prototype.otherwise = function (rule) {
+ var _this = this;
+ var urlRouter = this._urlRouter;
+ if (core_2.isString(rule)) {
+ urlRouter.otherwise(rule);
+ }
+ else if (core_2.isFunction(rule)) {
+ urlRouter.otherwise(function () { return rule(core_2.services.$injector, _this._router.locationService); });
+ }
+ else {
+ throw new Error("'rule' must be a string or function");
+ }
+ return this;
+ };
+ ;
+ /**
+ * Registers a handler for a given url matching.
+ *
+ * If the handler is a string, it is
+ * treated as a redirect, and is interpolated according to the syntax of match
+ * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
+ *
+ * If the handler is a function, it is injectable.
+ * It gets invoked if `$location` matches.
+ * You have the option of inject the match object as `$match`.
+ *
+ * The handler can return
+ *
+ * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
+ * will continue trying to find another one that matches.
+ * - **string** which is treated as a redirect and passed to `$location.url()`
+ * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+ * if ($state.$current.navigable !== state ||
+ * !equalForKeys($match, $stateParams) {
+ * $state.transitionTo(state, $match, false);
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param what A pattern string to match, compiled as a [[UrlMatcher]].
+ * @param handler The path (or function that returns a path) that you want to redirect your user to.
+ * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]
+ *
+ * Note: the handler may also invoke arbitrary code, such as `$state.go()`
+ */
+ UrlRouterProvider.prototype.when = function (what, handler) {
+ if (core_2.isArray(handler) || core_2.isFunction(handler)) {
+ handler = UrlRouterProvider.injectableHandler(this._router, handler);
+ }
+ this._urlRouter.when(what, handler);
+ return this;
+ };
+ ;
+ UrlRouterProvider.injectableHandler = function (router, handler) {
+ return function (match) {
+ return core_2.services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });
+ };
+ };
+ /**
+ * Disables monitoring of the URL.
+ *
+ * Call this method before UI-Router has bootstrapped.
+ * It will stop UI-Router from performing the initial url sync.
+ *
+ * This can be useful to perform some asynchronous initialization before the router starts.
+ * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Prevent $urlRouter from automatically intercepting URL changes;
+ * $urlRouterProvider.deferIntercept();
+ * })
+ *
+ * app.run(function (MyService, $urlRouter, $http) {
+ * $http.get("/stuff").then(function(resp) {
+ * MyService.doStuff(resp.data);
+ * $urlRouter.listen();
+ * $urlRouter.sync();
+ * });
+ * });
+ * ```
+ *
+ * @param defer Indicates whether to defer location change interception.
+ * Passing no parameter is equivalent to `true`.
+ */
+ UrlRouterProvider.prototype.deferIntercept = function (defer) {
+ this._urlRouter.deferIntercept(defer);
+ };
+ ;
+ return UrlRouterProvider;
+}());
+exports.UrlRouterProvider = UrlRouterProvider;
+//# sourceMappingURL=urlRouterProvider.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.js.map
new file mode 100644
index 00000000..98e121a4
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/urlRouterProvider.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "urlRouterProvider.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/urlRouterProvider.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA,kBAAkB,CAAC,MAAM;AACzB,uCAGwB;AACxB,uCAAmF;AAMnF;;;;;;;;;;;;;GAaG;AACH;IAIE,cAAc;IACd,2BAAY,MAAgB;QAC1B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC;IACrC,CAAC;IAED,cAAc;IACd,gCAAI,GAAJ;QACE,IAAI,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;QAChC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACvB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC;YAAC,SAAS,CAAC,MAAM,EAAE,CAAC;QACrD,MAAM,CAAC,SAAS,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,gCAAI,GAAJ,UAAK,MAA0B;QAA/B,iBASC;QARC,EAAE,CAAC,CAAC,CAAC,iBAAU,CAAC,MAAM,CAAC,CAAC;YAAC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,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AAE,OAAO,CAAC,CAAC;QACvE,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,OAAc,CAAC,CAAC;QAC3C,MAAM,CAAC,IAAI,CAAC;IACd,CAAC;IAAA,CAAC;IAEK,mCAAiB,GAAxB,UAAyB,MAAgB,EAAE,OAAO;QAChD,MAAM,CAAC,UAAA,KAAK;YACR,OAAA,eAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAAhG,CAAgG,CAAC;IACvG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,0CAAc,GAAd,UAAe,KAAe;QAC5B,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAAA,CAAC;IACJ,wBAAC;AAAD,CAAC,AAzLD,IAyLC;AAzLY,8CAAiB",
+ "sourcesContent": [
+ "/** @module url */ /** */\nimport {\n UIRouter, UrlRouter, LocationServices, $InjectorLike, BaseUrlRule, UrlRuleHandlerFn, UrlMatcher,\n IInjectable\n} from \"@uirouter/core\";\nimport { services, isString, isFunction, isArray, identity } from \"@uirouter/core\";\n\nexport interface RawNg1RuleFunction {\n ($injector: $InjectorLike, $location: LocationServices): string|void;\n}\n\n/**\n * Manages rules for client-side URL\n *\n * ### Deprecation warning:\n * This class is now considered to be an internal API\n * Use the [[UrlService]] instead.\n * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].\n *\n * This class manages the router rules for what to do when the URL changes.\n *\n * This provider remains for backwards compatibility.\n *\n * @deprecated\n */\nexport class UrlRouterProvider {\n /** @hidden */ _router: UIRouter;\n /** @hidden */ _urlRouter: UrlRouter;\n\n /** @hidden */\n constructor(router: UIRouter) {\n this._router = router;\n this._urlRouter = router.urlRouter;\n }\n\n /** @hidden */\n $get() {\n let urlRouter = this._urlRouter;\n urlRouter.update(true);\n if (!urlRouter.interceptDeferred) urlRouter.listen();\n return urlRouter;\n }\n\n /**\n * Registers a url handler function.\n *\n * Registers a low level url handler (a `rule`).\n * A rule detects specific URL patterns and returns a redirect, or performs some action.\n *\n * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Here's an example of how you might allow case insensitive urls\n * $urlRouterProvider.rule(function ($injector, $location) {\n * var path = $location.path(),\n * normalized = path.toLowerCase();\n *\n * if (path !== normalized) {\n * return normalized;\n * }\n * });\n * });\n * ```\n *\n * @param ruleFn\n * Handler function that takes `$injector` and `$location` services as arguments.\n * You can use them to detect a url and return a different url as a string.\n *\n * @return [[UrlRouterProvider]] (`this`)\n */\n rule(ruleFn: RawNg1RuleFunction): UrlRouterProvider {\n if (!isFunction(ruleFn)) throw new Error(\"'rule' must be a function\");\n\n const match = () =>\n ruleFn(services.$injector, this._router.locationService);\n\n let rule = new BaseUrlRule(match, identity);\n this._urlRouter.rule(rule);\n return this;\n };\n\n /**\n * Defines the path or behavior to use when no url can be matched.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // if the path doesn't match any of the urls you configured\n * // otherwise will take care of routing the user to the\n * // specified url\n * $urlRouterProvider.otherwise('/index');\n *\n * // Example of using function rule as param\n * $urlRouterProvider.otherwise(function ($injector, $location) {\n * return '/a/valid/url';\n * });\n * });\n * ```\n *\n * @param rule\n * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.\n * The function version is passed two params: `$injector` and `$location` services, and should return a url string.\n *\n * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance\n */\n otherwise(rule: string | RawNg1RuleFunction): UrlRouterProvider {\n let urlRouter = this._urlRouter;\n\n if (isString(rule)) {\n urlRouter.otherwise(rule);\n } else if (isFunction(rule)) {\n urlRouter.otherwise(() => rule(services.$injector, this._router.locationService));\n } else {\n throw new Error(\"'rule' must be a string or function\");\n }\n\n return this;\n };\n\n /**\n * Registers a handler for a given url matching.\n *\n * If the handler is a string, it is\n * treated as a redirect, and is interpolated according to the syntax of match\n * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).\n *\n * If the handler is a function, it is injectable.\n * It gets invoked if `$location` matches.\n * You have the option of inject the match object as `$match`.\n *\n * The handler can return\n *\n * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`\n * will continue trying to find another one that matches.\n * - **string** which is treated as a redirect and passed to `$location.url()`\n * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * $urlRouterProvider.when($state.url, function ($match, $stateParams) {\n * if ($state.$current.navigable !== state ||\n * !equalForKeys($match, $stateParams) {\n * $state.transitionTo(state, $match, false);\n * }\n * });\n * });\n * ```\n *\n * @param what A pattern string to match, compiled as a [[UrlMatcher]].\n * @param handler The path (or function that returns a path) that you want to redirect your user to.\n * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]\n *\n * Note: the handler may also invoke arbitrary code, such as `$state.go()`\n */\n when(what: (RegExp|UrlMatcher|string), handler: string|IInjectable) {\n if (isArray(handler) || isFunction(handler)) {\n handler = UrlRouterProvider.injectableHandler(this._router, handler);\n }\n\n this._urlRouter.when(what, handler as any);\n return this;\n };\n\n static injectableHandler(router: UIRouter, handler): UrlRuleHandlerFn {\n return match =>\n services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });\n }\n\n /**\n * Disables monitoring of the URL.\n *\n * Call this method before UI-Router has bootstrapped.\n * It will stop UI-Router from performing the initial url sync.\n *\n * This can be useful to perform some asynchronous initialization before the router starts.\n * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.\n *\n * #### Example:\n * ```js\n * var app = angular.module('app', ['ui.router']);\n *\n * app.config(function ($urlRouterProvider) {\n * // Prevent $urlRouter from automatically intercepting URL changes;\n * $urlRouterProvider.deferIntercept();\n * })\n *\n * app.run(function (MyService, $urlRouter, $http) {\n * $http.get(\"/stuff\").then(function(resp) {\n * MyService.doStuff(resp.data);\n * $urlRouter.listen();\n * $urlRouter.sync();\n * });\n * });\n * ```\n *\n * @param defer Indicates whether to defer location change interception.\n * Passing no parameter is equivalent to `true`.\n */\n deferIntercept(defer?: boolean) {\n this._urlRouter.deferIntercept(defer);\n };\n}\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.d.ts b/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.d.ts
new file mode 100644
index 00000000..e4fc544f
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.d.ts
@@ -0,0 +1,9 @@
+export interface UIViewScrollProvider {
+ /**
+ * Uses standard anchorScroll behavior
+ *
+ * Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)
+ * service for scrolling based on the url anchor.
+ */
+ useAnchorScroll(): void;
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.js b/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.js
new file mode 100644
index 00000000..faf94dea
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.js
@@ -0,0 +1,23 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+/** @module ng1 */ /** */
+var angular_1 = require("./angular");
+/** @hidden */
+function $ViewScrollProvider() {
+ var useAnchorScroll = false;
+ this.useAnchorScroll = function () {
+ useAnchorScroll = true;
+ };
+ this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll, $timeout) {
+ if (useAnchorScroll) {
+ return $anchorScroll;
+ }
+ return function ($element) {
+ return $timeout(function () {
+ $element[0].scrollIntoView();
+ }, 0, false);
+ };
+ }];
+}
+angular_1.ng.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);
+//# sourceMappingURL=viewScroll.js.map
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.js.map b/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.js.map
new file mode 100644
index 00000000..79dc90da
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/lib/viewScroll.js.map
@@ -0,0 +1,13 @@
+{
+ "version": 3,
+ "file": "viewScroll.js",
+ "sourceRoot": "",
+ "sources": [
+ "@uirouter/angularjs/viewScroll.ts"
+ ],
+ "names": [],
+ "mappings": ";;AAAA,kBAAkB,CAAC,MAAM;AACzB,qCAA0C;AAgB1C,cAAc;AACd;IAEE,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,IAAI,CAAC,eAAe,GAAG;QACrB,eAAe,GAAG,IAAI,CAAC;IACzB,CAAC,CAAC;IAEF,IAAI,CAAC,IAAI,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,UAAU,aAAmC,EAAE,QAAyB;YAChH,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC;gBACpB,MAAM,CAAC,aAAa,CAAC;YACvB,CAAC;YAED,MAAM,CAAC,UAAU,QAAgB;gBAC/B,MAAM,CAAC,QAAQ,CAAC;oBACd,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC;gBAC/B,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;YACf,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED,YAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,QAAQ,CAAC,eAAe,EAA4B,mBAAmB,CAAC,CAAC",
+ "sourcesContent": [
+ "/** @module ng1 */ /** */\nimport { ng as angular } from \"./angular\";\nimport { IServiceProviderFactory } from \"angular\";\nimport IAnchorScrollService = angular.IAnchorScrollService;\nimport ITimeoutService = angular.ITimeoutService;\n\nexport interface UIViewScrollProvider {\n /**\n * Uses standard anchorScroll behavior\n *\n * Reverts [[$uiViewScroll]] back to using the core [`$anchorScroll`](http://docs.angularjs.org/api/ng.$anchorScroll)\n * service for scrolling based on the url anchor.\n */\n useAnchorScroll(): void;\n}\n\n\n/** @hidden */\nfunction $ViewScrollProvider() {\n\n var useAnchorScroll = false;\n\n this.useAnchorScroll = function () {\n useAnchorScroll = true;\n };\n\n this.$get = ['$anchorScroll', '$timeout', function ($anchorScroll: IAnchorScrollService, $timeout: ITimeoutService): Function {\n if (useAnchorScroll) {\n return $anchorScroll;\n }\n\n return function ($element: JQuery) {\n return $timeout(function () {\n $element[0].scrollIntoView();\n }, 0, false);\n };\n }];\n}\n\nangular.module('ui.router.state').provider('$uiViewScroll', $ViewScrollProvider);\n"
+ ]
+}
\ No newline at end of file
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/package.json b/public/app/vendor/node_modules/@uirouter/angularjs/package.json
new file mode 100644
index 00000000..447ba79d
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/package.json
@@ -0,0 +1,188 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "@uirouter/angularjs",
+ "scope": "@uirouter",
+ "escapedName": "@uirouter%2fangularjs",
+ "name": "@uirouter/angularjs",
+ "rawSpec": "",
+ "spec": "latest",
+ "type": "tag"
+ },
+ "/home/cycojesus/projets/ledgerrb/public/app/vendor"
+ ]
+ ],
+ "_from": "@uirouter/angularjs@latest",
+ "_id": "@uirouter/angularjs@1.0.10",
+ "_inCache": true,
+ "_location": "/@uirouter/angularjs",
+ "_nodeVersion": "8.5.0",
+ "_npmOperationalInternal": {
+ "host": "s3://npm-registry-packages",
+ "tmp": "tmp/angularjs-1.0.10.tgz_1508351207239_0.049824401969090104"
+ },
+ "_npmUser": {
+ "name": "christopherthielen",
+ "email": "christopherthielen@ikkyikkyikkypikangzoopboing.com"
+ },
+ "_npmVersion": "5.3.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "@uirouter/angularjs",
+ "scope": "@uirouter",
+ "escapedName": "@uirouter%2fangularjs",
+ "name": "@uirouter/angularjs",
+ "rawSpec": "",
+ "spec": "latest",
+ "type": "tag"
+ },
+ "_requiredBy": [
+ "#USER",
+ "/"
+ ],
+ "_resolved": "https://registry.npmjs.org/@uirouter/angularjs/-/angularjs-1.0.10.tgz",
+ "_shasum": "e18b0b65cd0d2d87165fad80294acfb2dc5e5277",
+ "_shrinkwrap": null,
+ "_spec": "@uirouter/angularjs",
+ "_where": "/home/cycojesus/projets/ledgerrb/public/app/vendor",
+ "bugs": {
+ "url": "https://github.com/angular-ui/ui-router/issues"
+ },
+ "contributors": [
+ {
+ "name": "Nate Abele",
+ "email": "nate@radify.io",
+ "url": "https://radify.io"
+ },
+ {
+ "name": "Chris Thielen",
+ "url": "https://github.com/christopherthielen"
+ },
+ {
+ "name": "Tim Kindberg",
+ "url": "https://github.com/timkindberg"
+ },
+ {
+ "name": "Karsten Sperling",
+ "url": "https://github.com/ksperling"
+ }
+ ],
+ "dependencies": {
+ "@uirouter/core": "5.0.11"
+ },
+ "description": "State-based routing for AngularJS 1.x",
+ "devDependencies": {
+ "@types/angular": "^1.5.14",
+ "@types/angular-animate": "^1.5.5",
+ "@types/angular-mocks": "1.5.11",
+ "@types/jasmine": "2.6.0",
+ "@types/jquery": "^1.10.31",
+ "@uirouter/publish-scripts": "2.0.2",
+ "conventional-changelog": "1.1.6",
+ "conventional-changelog-cli": "1.3.4",
+ "dts-downlevel": "^0.3.0",
+ "fork-ts-checker-webpack-plugin": "^0.2.8",
+ "jasmine-core": "2.8.0",
+ "karma": "1.7.1",
+ "karma-chrome-launcher": "2.2.0",
+ "karma-jasmine": "^1.0.2",
+ "karma-phantomjs-launcher": "^1.0.2",
+ "karma-sourcemap-loader": "^0.3.7",
+ "karma-webpack": "2.0.4",
+ "lodash": "^4.5.1",
+ "replace-in-file": "2.6.4",
+ "rollup": "0.50.0",
+ "rollup-plugin-node-resolve": "3.0.0",
+ "rollup-plugin-progress": "0.4.0",
+ "rollup-plugin-sourcemaps": "^0.4.1",
+ "rollup-plugin-uglify": "2.0.1",
+ "rollup-plugin-visualizer": "0.3.1",
+ "shelljs": "^0.7.0",
+ "shx": "0.2.2",
+ "ts-loader": "^2.3.7",
+ "tslint": "5.7.0",
+ "typedoc": "~0.5.0",
+ "typedoc-plugin-external-module-name": "^1.0.2",
+ "typedoc-plugin-internal-external": "^1.0.0",
+ "typedoc-plugin-ui-router": "^1.0.0",
+ "typescript": "2.5.3",
+ "ui-router-typedoc-themes": "^1.0.1",
+ "watch": "^0.18.0",
+ "webpack": "3.6.0",
+ "yargs": "^4.2.0"
+ },
+ "directories": {},
+ "dist": {
+ "integrity": "sha512-2TI1xnejF+HzOgSdjjv6oO0z9bchixNCR/sSgqNjCj9L5NNjVgBIs67WDwtTCejM80Ju5wqFeaZoL53Gf8x4kA==",
+ "shasum": "e18b0b65cd0d2d87165fad80294acfb2dc5e5277",
+ "tarball": "https://registry.npmjs.org/@uirouter/angularjs/-/angularjs-1.0.10.tgz"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ },
+ "gitHead": "d4acd8463674da09929f25c24ae73d2565458198",
+ "homepage": "https://ui-router.github.io",
+ "jsnext:main": "lib-esm/index.js",
+ "license": "MIT",
+ "main": "release/ui-router-angularjs.js",
+ "maintainers": [
+ {
+ "name": "elboman",
+ "email": "marco.botto@gmail.com"
+ },
+ {
+ "name": "nateabele",
+ "email": "nate.abele@gmail.com"
+ },
+ {
+ "name": "christopherthielen",
+ "email": "christopherthielen@ikkyikkyikkypikangzoopboing.com"
+ },
+ {
+ "name": "christopherthielen2",
+ "email": "christhielen@gmail.com"
+ }
+ ],
+ "name": "@uirouter/angularjs",
+ "optionalDependencies": {},
+ "peerDependencies": {
+ "angular": ">=1.2.0"
+ },
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/angular-ui/ui-router.git"
+ },
+ "scripts": {
+ "artifacts": "artifact_tagging",
+ "build": "npm run clean && npm run compile && npm run bundle && npm run fixmaps:lib && npm run fixmaps:bundle",
+ "bundle": "npm run bundle_router && npm run bundle_monolithic_router && npm run bundle_events && npm run bundle_resolve",
+ "bundle_events": "rollup -c --environment EVENTS && rollup -c --environment EVENTS,MINIFY",
+ "bundle_monolithic_router": "rollup -c --environment ROUTER,MONOLITHIC && rollup -c --environment ROUTER,MINIFY,MONOLITHIC",
+ "bundle_resolve": "rollup -c --environment RESOLVE && rollup -c --environment RESOLVE,MINIFY",
+ "bundle_router": "rollup -c --environment ROUTER && rollup -c --environment ROUTER,MINIFY",
+ "clean": "shx rm -rf lib lib-esm _doc build release *.log",
+ "compile": "tsc && tsc -m es6 --outDir lib-esm && npm run fixdts",
+ "debug": "karma start --singleRun=false --autoWatch=true --autoWatchInterval=1 --browsers=Chrome",
+ "docs": "./scripts/docs.js",
+ "fixdts": "dts-downlevel 'lib/**/*.d.ts' 'lib-esm/**/*.d.ts'",
+ "fixmaps:bundle": "tweak_sourcemap_paths -a --include 'release/**/*.js.map'",
+ "fixmaps:lib": "tweak_sourcemap_paths -a --include 'lib/**/*.js.map' 'lib-esm/**/*.js.map'",
+ "noimplicitany": "tsc --noEmit --noImplicitAny --moduleResolution node --target es6 test/noimplicitany.ts",
+ "package": "npm run build",
+ "prepublishOnly": "npm run build",
+ "publishdocs": "node scripts/publishdocs.js",
+ "release": "npm run noimplicitany && release --deps @uirouter/core && node ./scripts/bower_release.js",
+ "test": "npm run test:integrate",
+ "test:integrate": "tsc && npm run noimplicitany && npm run test:ng16 && npm run test:ng15 && npm run test:ng14 && npm run test:ng13 && npm run test:ng12",
+ "test:ng12": "karma start --ngversion 1.2",
+ "test:ng13": "karma start --ngversion 1.3",
+ "test:ng14": "karma start --ngversion 1.4",
+ "test:ng15": "karma start --ngversion 1.5",
+ "test:ng16": "karma start --ngversion 1.6",
+ "watch": "karma start --singleRun=false --autoWatch=true --autoWatchInterval=1"
+ },
+ "typings": "lib/index.d.ts",
+ "version": "1.0.10"
+}
diff --git a/public/app/vendor/node_modules/@uirouter/angularjs/release/angular-ui-router.js b/public/app/vendor/node_modules/@uirouter/angularjs/release/angular-ui-router.js
new file mode 100644
index 00000000..4e69b5e2
--- /dev/null
+++ b/public/app/vendor/node_modules/@uirouter/angularjs/release/angular-ui-router.js
@@ -0,0 +1,10075 @@
+/**
+ * State-based routing for AngularJS 1.x
+ * NOTICE: This monolithic bundle also bundles the @uirouter/core code.
+ * This causes it to be incompatible with plugins that depend on @uirouter/core.
+ * We recommend switching to the ui-router-core.js and ui-router-angularjs.js bundles instead.
+ * For more information, see https://ui-router.github.io/blog/uirouter-for-angularjs-umd-bundles
+ * @version v1.0.10
+ * @link https://ui-router.github.io
+ * @license MIT License, http://www.opensource.org/licenses/MIT
+ */
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('angular')) :
+ typeof define === 'function' && define.amd ? define(['exports', 'angular'], factory) :
+ (factory((global['@uirouter/angularjs'] = {}),global.angular));
+}(this, (function (exports,ng_from_import) { 'use strict';
+
+var ng_from_global = angular;
+var ng = (ng_from_import && ng_from_import.module) ? ng_from_import : ng_from_global;
+
+/**
+ * Higher order functions
+ *
+ * These utility functions are exported, but are subject to change without notice.
+ *
+ * @module common_hof
+ */ /** */
+/**
+ * Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.
+ *
+ * Given a function with N parameters, returns a new function that supports partial application.
+ * The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,
+ * where M is less than N, it returns a new function that accepts the remaining parameters. It continues to
+ * accept more parameters until all N parameters have been supplied.
+ *
+ *
+ * This contrived example uses a partially applied function as an predicate, which returns true
+ * if an object is found in both arrays.
+ * @example
+ * ```
+ * // returns true if an object is in both of the two arrays
+ * function inBoth(array1, array2, object) {
+ * return array1.indexOf(object) !== -1 &&
+ * array2.indexOf(object) !== 1;
+ * }
+ * let obj1, obj2, obj3, obj4, obj5, obj6, obj7
+ * let foos = [obj1, obj3]
+ * let bars = [obj3, obj4, obj5]
+ *
+ * // A curried "copy" of inBoth
+ * let curriedInBoth = curry(inBoth);
+ * // Partially apply both the array1 and array2
+ * let inFoosAndBars = curriedInBoth(foos, bars);
+ *
+ * // Supply the final argument; since all arguments are
+ * // supplied, the original inBoth function is then called.
+ * let obj1InBoth = inFoosAndBars(obj1); // false
+ *
+ * // Use the inFoosAndBars as a predicate.
+ * // Filter, on each iteration, supplies the final argument
+ * let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];
+ * let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]
+ *
+ * ```
+ *
+ * Stolen from: http://stackoverflow.com/questions/4394747/javascript-curry-function
+ *
+ * @param fn
+ * @returns {*|function(): (*|any)}
+ */
+function curry(fn) {
+ var initial_args = [].slice.apply(arguments, [1]);
+ var func_args_length = fn.length;
+ function curried(args) {
+ if (args.length >= func_args_length)
+ return fn.apply(null, args);
+ return function () {
+ return curried(args.concat([].slice.apply(arguments)));
+ };
+ }
+ return curried(initial_args);
+}
+/**
+ * Given a varargs list of functions, returns a function that composes the argument functions, right-to-left
+ * given: f(x), g(x), h(x)
+ * let composed = compose(f,g,h)
+ * then, composed is: f(g(h(x)))
+ */
+function compose() {
+ var args = arguments;
+ var start = args.length - 1;
+ return function () {
+ var i = start, result = args[start].apply(this, arguments);
+ while (i--)
+ result = args[i].call(this, result);
+ return result;
+ };
+}
+/**
+ * Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right
+ * given: f(x), g(x), h(x)
+ * let piped = pipe(f,g,h);
+ * then, piped is: h(g(f(x)))
+ */
+function pipe() {
+ var funcs = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ funcs[_i] = arguments[_i];
+ }
+ return compose.apply(null, [].slice.call(arguments).reverse());
+}
+/**
+ * Given a property name, returns a function that returns that property from an object
+ * let obj = { foo: 1, name: "blarg" };
+ * let getName = prop("name");
+ * getName(obj) === "blarg"
+ */
+var prop = function (name) {
+ return function (obj) { return obj && obj[name]; };
+};
+/**
+ * Given a property name and a value, returns a function that returns a boolean based on whether
+ * the passed object has a property that matches the value
+ * let obj = { foo: 1, name: "blarg" };
+ * let getName = propEq("name", "blarg");
+ * getName(obj) === true
+ */
+var propEq = curry(function (name, val, obj) { return obj && obj[name] === val; });
+/**
+ * Given a dotted property name, returns a function that returns a nested property from an object, or undefined
+ * let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, };
+ * let getName = prop("nestedObj.name");
+ * getName(obj) === "blarg"
+ * let propNotFound = prop("this.property.doesnt.exist");
+ * propNotFound(obj) === undefined
+ */
+var parse = function (name) {
+ return pipe.apply(null, name.split(".").map(prop));
+};
+/**
+ * Given a function that returns a truthy or falsey value, returns a
+ * function that returns the opposite (falsey or truthy) value given the same inputs
+ */
+var not = function (fn) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return !fn.apply(null, args);
+ };
+};
+/**
+ * Given two functions that return truthy or falsey values, returns a function that returns truthy
+ * if both functions return truthy for the given arguments
+ */
+function and(fn1, fn2) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return fn1.apply(null, args) && fn2.apply(null, args);
+ };
+}
+/**
+ * Given two functions that return truthy or falsey values, returns a function that returns truthy
+ * if at least one of the functions returns truthy for the given arguments
+ */
+function or(fn1, fn2) {
+ return function () {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ return fn1.apply(null, args) || fn2.apply(null, args);
+ };
+}
+/**
+ * Check if all the elements of an array match a predicate function
+ *
+ * @param fn1 a predicate function `fn1`
+ * @returns a function which takes an array and returns true if `fn1` is true for all elements of the array
+ */
+var all = function (fn1) {
+ return function (arr) { return arr.reduce(function (b, x) { return b && !!fn1(x); }, true); };
+};
+var any = function (fn1) {
+ return function (arr) { return arr.reduce(function (b, x) { return b || !!fn1(x); }, false); };
+};
+/** Given a class, returns a Predicate function that returns true if the object is of that class */
+var is = function (ctor) {
+ return function (obj) {
+ return (obj != null && obj.constructor === ctor || obj instanceof ctor);
+ };
+};
+/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */
+var eq = function (val) { return function (other) {
+ return val === other;
+}; };
+/** Given a value, returns a function which returns the value */
+var val = function (v) { return function () { return v; }; };
+function invoke(fnName, args) {
+ return function (obj) {
+ return obj[fnName].apply(obj, args);
+ };
+}
+/**
+ * Sorta like Pattern Matching (a functional programming conditional construct)
+ *
+ * See http://c2.com/cgi/wiki?PatternMatching
+ *
+ * This is a conditional construct which allows a series of predicates and output functions
+ * to be checked and then applied. Each predicate receives the input. If the predicate
+ * returns truthy, then its matching output function (mapping function) is provided with
+ * the input and, then the result is returned.
+ *
+ * Each combination (2-tuple) of predicate + output function should be placed in an array
+ * of size 2: [ predicate, mapFn ]
+ *
+ * These 2-tuples should be put in an outer array.
+ *
+ * @example
+ * ```
+ *
+ * // Here's a 2-tuple where the first element is the isString predicate
+ * // and the second element is a function that returns a description of the input
+ * let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
+ *
+ * // Second tuple: predicate "isNumber", mapfn returns a description
+ * let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
+ *
+ * let third = [ (input) => input === null, (input) => `Oh, null...` ];
+ *
+ * let fourth = [ (input) => input === undefined, (input) => `notdefined` ];
+ *
+ * let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
+ *
+ * console.log(descriptionOf(undefined)); // 'notdefined'
+ * console.log(descriptionOf(55)); // '(55) That's a number!'
+ * console.log(descriptionOf("foo")); // 'Here's your string foo'
+ * ```
+ *
+ * @param struct A 2D array. Each element of the array should be an array, a 2-tuple,
+ * with a Predicate and a mapping/output function
+ * @returns {function(any): *}
+ */
+function pattern(struct) {
+ return function (x) {
+ for (var i = 0; i < struct.length; i++) {
+ if (struct[i][0](x))
+ return struct[i][1](x);
+ }
+ };
+}
+
+/**
+ * @coreapi
+ * @module core
+ */
+/**
+ * Matches state names using glob-like pattern strings.
+ *
+ * Globs can be used in specific APIs including:
+ *
+ * - [[StateService.is]]
+ * - [[StateService.includes]]
+ * - The first argument to Hook Registration functions like [[TransitionService.onStart]]
+ * - [[HookMatchCriteria]] and [[HookMatchCriterion]]
+ *
+ * A `Glob` string is a pattern which matches state names.
+ * Nested state names are split into segments (separated by a dot) when processing.
+ * The state named `foo.bar.baz` is split into three segments ['foo', 'bar', 'baz']
+ *
+ * Globs work according to the following rules:
+ *
+ * ### Exact match:
+ *
+ * The glob `'A.B'` matches the state named exactly `'A.B'`.
+ *
+ * | Glob |Matches states named|Does not match state named|
+ * |:------------|:--------------------|:---------------------|
+ * | `'A'` | `'A'` | `'B'` , `'A.C'` |
+ * | `'A.B'` | `'A.B'` | `'A'` , `'A.B.C'` |
+ * | `'foo'` | `'foo'` | `'FOO'` , `'foo.bar'`|
+ *
+ * ### Single star (`*`)
+ *
+ * A single star (`*`) is a wildcard that matches exactly one segment.
+ *
+ * | Glob |Matches states named |Does not match state named |
+ * |:------------|:---------------------|:--------------------------|
+ * | `'*'` | `'A'` , `'Z'` | `'A.B'` , `'Z.Y.X'` |
+ * | `'A.*'` | `'A.B'` , `'A.C'` | `'A'` , `'A.B.C'` |
+ * | `'A.*.*'` | `'A.B.C'` , `'A.X.Y'`| `'A'`, `'A.B'` , `'Z.Y.X'`|
+ *
+ * ### Double star (`**`)
+ *
+ * A double star (`'**'`) is a wildcard that matches *zero or more segments*
+ *
+ * | Glob |Matches states named |Does not match state named |
+ * |:------------|:----------------------------------------------|:----------------------------------|
+ * | `'**'` | `'A'` , `'A.B'`, `'Z.Y.X'` | (matches all states) |
+ * | `'A.**'` | `'A'` , `'A.B'` , `'A.C.X'` | `'Z.Y.X'` |
+ * | `'**.X'` | `'X'` , `'A.X'` , `'Z.Y.X'` | `'A'` , `'A.login.Z'` |
+ * | `'A.**.X'` | `'A.X'` , `'A.B.X'` , `'A.B.C.X'` | `'A'` , `'A.B.C'` |
+ *
+ */
+var Glob = /** @class */ (function () {
+ function Glob(text) {
+ this.text = text;
+ this.glob = text.split('.');
+ var regexpString = this.text.split('.')
+ .map(function (seg) {
+ if (seg === '**')
+ return '(?:|(?:\\.[^.]*)*)';
+ if (seg === '*')
+ return '\\.[^.]*';
+ return '\\.' + seg;
+ }).join('');
+ this.regexp = new RegExp("^" + regexpString + "$");
+ }
+ Glob.prototype.matches = function (name) {
+ return this.regexp.test('.' + name);
+ };
+ /** Returns true if the string has glob-like characters in it */
+ Glob.is = function (text) {
+ return !!/[!,*]+/.exec(text);
+ };
+ /** Returns a glob from the string, or null if the string isn't Glob-like */
+ Glob.fromString = function (text) {
+ return Glob.is(text) ? new Glob(text) : null;
+ };
+ return Glob;
+}());
+
+/**
+ * Internal representation of a UI-Router state.
+ *
+ * Instances of this class are created when a [[StateDeclaration]] is registered with the [[StateRegistry]].
+ *
+ * A registered [[StateDeclaration]] is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding [[StateObject]] object.
+ *
+ * This class prototypally inherits from the corresponding [[StateDeclaration]].
+ * Each of its own properties (i.e., `hasOwnProperty`) are built using builders from the [[StateBuilder]].
+ */
+var StateObject = /** @class */ (function () {
+ /** @deprecated use State.create() */
+ function StateObject(config) {
+ return StateObject.create(config || {});
+ }
+ /**
+ * Create a state object to put the private/internal implementation details onto.
+ * The object's prototype chain looks like:
+ * (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)
+ *
+ * @param stateDecl the user-supplied State Declaration
+ * @returns {StateObject} an internal State object
+ */
+ StateObject.create = function (stateDecl) {
+ stateDecl = StateObject.isStateClass(stateDecl) ? new stateDecl() : stateDecl;
+ var state = inherit(inherit(stateDecl, StateObject.prototype));
+ stateDecl.$$state = function () { return state; };
+ state.self = stateDecl;
+ state.__stateObjectCache = {
+ nameGlob: Glob.fromString(state.name) // might return null
+ };
+ return state;
+ };
+ /**
+ * Returns true if the provided parameter is the same state.
+ *
+ * Compares the identity of the state against the passed value, which is either an object
+ * reference to the actual `State` instance, the original definition object passed to
+ * `$stateProvider.state()`, or the fully-qualified name.
+ *
+ * @param ref Can be one of (a) a `State` instance, (b) an object that was passed
+ * into `$stateProvider.state()`, (c) the fully-qualified name of a state as a string.
+ * @returns Returns `true` if `ref` matches the current `State` instance.
+ */
+ StateObject.prototype.is = function (ref) {
+ return this === ref || this.self === ref || this.fqn() === ref;
+ };
+ /**
+ * @deprecated this does not properly handle dot notation
+ * @returns Returns a dot-separated name of the state.
+ */
+ StateObject.prototype.fqn = function () {
+ if (!this.parent || !(this.parent instanceof this.constructor))
+ return this.name;
+ var name = this.parent.fqn();
+ return name ? name + "." + this.name : this.name;
+ };
+ /**
+ * Returns the root node of this state's tree.
+ *
+ * @returns The root of this state's tree.
+ */
+ StateObject.prototype.root = function () {
+ return this.parent && this.parent.root() || this;
+ };
+ /**
+ * Gets the state's `Param` objects
+ *
+ * Gets the list of [[Param]] objects owned by the state.
+ * If `opts.inherit` is true, it also includes the ancestor states' [[Param]] objects.
+ * If `opts.matchingKeys` exists, returns only `Param`s whose `id` is a key on the `matchingKeys` object
+ *
+ * @param opts options
+ */
+ StateObject.prototype.parameters = function (opts) {
+ opts = defaults(opts, { inherit: true, matchingKeys: null });
+ var inherited = opts.inherit && this.parent && this.parent.parameters() || [];
+ return inherited.concat(values(this.params))
+ .filter(function (param) { return !opts.matchingKeys || opts.matchingKeys.hasOwnProperty(param.id); });
+ };
+ /**
+ * Returns a single [[Param]] that is owned by the state
+ *
+ * If `opts.inherit` is true, it also searches the ancestor states` [[Param]]s.
+ * @param id the name of the [[Param]] to return
+ * @param opts options
+ */
+ StateObject.prototype.parameter = function (id, opts) {
+ if (opts === void 0) { opts = {}; }
+ return (this.url && this.url.parameter(id, opts) ||
+ find(values(this.params), propEq('id', id)) ||
+ opts.inherit && this.parent && this.parent.parameter(id));
+ };
+ StateObject.prototype.toString = function () {
+ return this.fqn();
+ };
+ /** Predicate which returns true if the object is an class with @State() decorator */
+ StateObject.isStateClass = function (stateDecl) {
+ return isFunction(stateDecl) && stateDecl['__uiRouterState'] === true;
+ };
+ /** Predicate which returns true if the object is an internal [[StateObject]] object */
+ StateObject.isState = function (obj) {
+ return isObject(obj['__stateObjectCache']);
+ };
+ return StateObject;
+}());
+
+/** Predicates
+ *
+ * These predicates return true/false based on the input.
+ * Although these functions are exported, they are subject to change without notice.
+ *
+ * @module common_predicates
+ */
+/** */
+var toStr = Object.prototype.toString;
+var tis = function (t) { return function (x) { return typeof (x) === t; }; };
+var isUndefined = tis('undefined');
+var isDefined = not(isUndefined);
+var isNull = function (o) { return o === null; };
+var isNullOrUndefined = or(isNull, isUndefined);
+var isFunction = tis('function');
+var isNumber = tis('number');
+var isString = tis('string');
+var isObject = function (x) { return x !== null && typeof x === 'object'; };
+var isArray = Array.isArray;
+var isDate = (function (x) { return toStr.call(x) === '[object Date]'; });
+var isRegExp = (function (x) { return toStr.call(x) === '[object RegExp]'; });
+var isState = StateObject.isState;
+/**
+ * Predicate which checks if a value is injectable
+ *
+ * A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array
+ * where all the elements in the array are Strings, except the last one, which is a Function
+ */
+function isInjectable(val$$1) {
+ if (isArray(val$$1) && val$$1.length) {
+ var head = val$$1.slice(0, -1), tail = val$$1.slice(-1);
+ return !(head.filter(not(isString)).length || tail.filter(not(isFunction)).length);
+ }
+ return isFunction(val$$1);
+}
+/**
+ * Predicate which checks if a value looks like a Promise
+ *
+ * It is probably a Promise if it's an object, and it has a `then` property which is a Function
+ */
+var isPromise = and(isObject, pipe(prop('then'), isFunction));
+
+var notImplemented = function (fnname) { return function () {
+ throw new Error(fnname + "(): No coreservices implementation for UI-Router is loaded.");
+}; };
+var services = {
+ $q: undefined,
+ $injector: undefined,
+};
+
+/**
+ * Random utility functions used in the UI-Router code
+ *
+ * These functions are exported, but are subject to change without notice.
+ *
+ * @preferred
+ * @module common
+ */
+/** for typedoc */
+var root = (typeof self === 'object' && self.self === self && self) ||
+ (typeof global === 'object' && global.global === global && global) || undefined;
+var angular$1 = root.angular || {};
+var fromJson = angular$1.fromJson || JSON.parse.bind(JSON);
+var toJson = angular$1.toJson || JSON.stringify.bind(JSON);
+var forEach = angular$1.forEach || _forEach;
+var extend = Object.assign || _extend;
+var equals = angular$1.equals || _equals;
+function identity(x) { return x; }
+function noop$1() { }
+/**
+ * Builds proxy functions on the `to` object which pass through to the `from` object.
+ *
+ * For each key in `fnNames`, creates a proxy function on the `to` object.
+ * The proxy function calls the real function on the `from` object.
+ *
+ *
+ * #### Example:
+ * This example creates an new class instance whose functions are prebound to the new'd object.
+ * ```js
+ * class Foo {
+ * constructor(data) {
+ * // Binds all functions from Foo.prototype to 'this',
+ * // then copies them to 'this'
+ * bindFunctions(Foo.prototype, this, this);
+ * this.data = data;
+ * }
+ *
+ * log() {
+ * console.log(this.data);
+ * }
+ * }
+ *
+ * let myFoo = new Foo([1,2,3]);
+ * var logit = myFoo.log;
+ * logit(); // logs [1, 2, 3] from the myFoo 'this' instance
+ * ```
+ *
+ * #### Example:
+ * This example creates a bound version of a service function, and copies it to another object
+ * ```
+ *
+ * var SomeService = {
+ * this.data = [3, 4, 5];
+ * this.log = function() {
+ * console.log(this.data);
+ * }
+ * }
+ *
+ * // Constructor fn
+ * function OtherThing() {
+ * // Binds all functions from SomeService to SomeService,
+ * // then copies them to 'this'
+ * bindFunctions(SomeService, this, SomeService);
+ * }
+ *
+ * let myOtherThing = new OtherThing();
+ * myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'
+ * ```
+ *
+ * @param source A function that returns the source object which contains the original functions to be bound
+ * @param target A function that returns the target object which will receive the bound functions
+ * @param bind A function that returns the object which the functions will be bound to
+ * @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object)
+ * @param latebind If true, the binding of the function is delayed until the first time it's invoked
+ */
+function createProxyFunctions(source, target, bind, fnNames, latebind) {
+ if (latebind === void 0) { latebind = false; }
+ var bindFunction = function (fnName) {
+ return source()[fnName].bind(bind());
+ };
+ var makeLateRebindFn = function (fnName) { return function lateRebindFunction() {
+ target[fnName] = bindFunction(fnName);
+ return target[fnName].apply(null, arguments);
+ }; };
+ fnNames = fnNames || Object.keys(source());
+ return fnNames.reduce(function (acc, name) {
+ acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);
+ return acc;
+ }, target);
+}
+/**
+ * prototypal inheritance helper.
+ * Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it
+ */
+var inherit = function (parent, extra) {
+ return extend(Object.create(parent), extra);
+};
+/** Given an array, returns true if the object is found in the array, (using indexOf) */
+var inArray = curry(_inArray);
+function _inArray(array, obj) {
+ return array.indexOf(obj) !== -1;
+}
+/**
+ * Given an array, and an item, if the item is found in the array, it removes it (in-place).
+ * The same array is returned
+ */
+var removeFrom = curry(_removeFrom);
+function _removeFrom(array, obj) {
+ var idx = array.indexOf(obj);
+ if (idx >= 0)
+ array.splice(idx, 1);
+ return array;
+}
+/** pushes a values to an array and returns the value */
+var pushTo = curry(_pushTo);
+function _pushTo(arr, val$$1) {
+ return (arr.push(val$$1), val$$1);
+}
+/** Given an array of (deregistration) functions, calls all functions and removes each one from the source array */
+var deregAll = function (functions) {
+ return functions.slice().forEach(function (fn) {
+ typeof fn === 'function' && fn();
+ removeFrom(functions, fn);
+ });
+};
+/**
+ * Applies a set of defaults to an options object. The options object is filtered
+ * to only those properties of the objects in the defaultsList.
+ * Earlier objects in the defaultsList take precedence when applying defaults.
+ */
+function defaults(opts) {
+ var defaultsList = [];
+ for (var _i = 1; _i < arguments.length; _i++) {
+ defaultsList[_i - 1] = arguments[_i];
+ }
+ var _defaultsList = defaultsList.concat({}).reverse();
+ var defaultVals = extend.apply(null, _defaultsList);
+ return extend({}, defaultVals, pick(opts || {}, Object.keys(defaultVals)));
+}
+/** Reduce function that merges each element of the list into a single object, using extend */
+var mergeR = function (memo, item) { return extend(memo, item); };
+/**
+ * Finds the common ancestor path between two states.
+ *
+ * @param {Object} first The first state.
+ * @param {Object} second The second state.
+ * @return {Array} Returns an array of state names in descending order, not including the root.
+ */
+function ancestors(first, second) {
+ var path = [];
+ for (var n in first.path) {
+ if (first.path[n] !== second.path[n])
+ break;
+ path.push(first.path[n]);
+ }
+ return path;
+}
+/**
+ * Return a copy of the object only containing the whitelisted properties.
+ *
+ * #### Example:
+ * ```
+ * var foo = { a: 1, b: 2, c: 3 };
+ * var ab = pick(foo, ['a', 'b']); // { a: 1, b: 2 }
+ * ```
+ * @param obj the source object
+ * @param propNames an Array of strings, which are the whitelisted property names
+ */
+function pick(obj, propNames) {
+ var objCopy = {};
+ for (var prop_1 in obj) {
+ if (propNames.indexOf(prop_1) !== -1) {
+ objCopy[prop_1] = obj[prop_1];
+ }
+ }
+ return objCopy;
+}
+/**
+ * Return a copy of the object omitting the blacklisted properties.
+ *
+ * @example
+ * ```
+ *
+ * var foo = { a: 1, b: 2, c: 3 };
+ * var ab = omit(foo, ['a', 'b']); // { c: 3 }
+ * ```
+ * @param obj the source object
+ * @param propNames an Array of strings, which are the blacklisted property names
+ */
+function omit(obj, propNames) {
+ return Object.keys(obj)
+ .filter(not(inArray(propNames)))
+ .reduce(function (acc, key) { return (acc[key] = obj[key], acc); }, {});
+}
+/**
+ * Maps an array, or object to a property (by name)
+ */
+function pluck(collection, propName) {
+ return map(collection, prop(propName));
+}
+/** Filters an Array or an Object's properties based on a predicate */
+function filter(collection, callback) {
+ var arr = isArray(collection), result = arr ? [] : {};
+ var accept = arr ? function (x) { return result.push(x); } : function (x, key) { return result[key] = x; };
+ forEach(collection, function (item, i) {
+ if (callback(item, i))
+ accept(item, i);
+ });
+ return result;
+}
+/** Finds an object from an array, or a property of an object, that matches a predicate */
+function find(collection, callback) {
+ var result;
+ forEach(collection, function (item, i) {
+ if (result)
+ return;
+ if (callback(item, i))
+ result = item;
+ });
+ return result;
+}
+/** Given an object, returns a new object, where each property is transformed by the callback function */
+var mapObj = map;
+/** Maps an array or object properties using a callback function */
+function map(collection, callback) {
+ var result = isArray(collection) ? [] : {};
+ forEach(collection, function (item, i) { return result[i] = callback(item, i); });
+ return result;
+}
+/**
+ * Given an object, return its enumerable property values
+ *
+ * @example
+ * ```
+ *
+ * let foo = { a: 1, b: 2, c: 3 }
+ * let vals = values(foo); // [ 1, 2, 3 ]
+ * ```
+ */
+var values = function (obj) {
+ return Object.keys(obj).map(function (key) { return obj[key]; });
+};
+/**
+ * Reduce function that returns true if all of the values are truthy.
+ *
+ * @example
+ * ```
+ *
+ * let vals = [ 1, true, {}, "hello world"];
+ * vals.reduce(allTrueR, true); // true
+ *
+ * vals.push(0);
+ * vals.reduce(allTrueR, true); // false
+ * ```
+ */
+var allTrueR = function (memo, elem) { return memo && elem; };
+/**
+ * Reduce function that returns true if any of the values are truthy.
+ *
+ * * @example
+ * ```
+ *
+ * let vals = [ 0, null, undefined ];
+ * vals.reduce(anyTrueR, true); // false
+ *
+ * vals.push("hello world");
+ * vals.reduce(anyTrueR, true); // true
+ * ```
+ */
+var anyTrueR = function (memo, elem) { return memo || elem; };
+/**
+ * Reduce function which un-nests a single level of arrays
+ * @example
+ * ```
+ *
+ * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ];
+ * input.reduce(unnestR, []) // [ "a", "b", "c", "d", [ "double, "nested" ] ]
+ * ```
+ */
+var unnestR = function (memo, elem) { return memo.concat(elem); };
+/**
+ * Reduce function which recursively un-nests all arrays
+ *
+ * @example
+ * ```
+ *
+ * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ];
+ * input.reduce(unnestR, []) // [ "a", "b", "c", "d", "double, "nested" ]
+ * ```
+ */
+var flattenR = function (memo, elem) {
+ return isArray(elem) ? memo.concat(elem.reduce(flattenR, [])) : pushR(memo, elem);
+};
+/**
+ * Reduce function that pushes an object to an array, then returns the array.
+ * Mostly just for [[flattenR]] and [[uniqR]]
+ */
+function pushR(arr, obj) {
+ arr.push(obj);
+ return arr;
+}
+/** Reduce function that filters out duplicates */
+var uniqR = function (acc, token) {
+ return inArray(acc, token) ? acc : pushR(acc, token);
+};
+/**
+ * Return a new array with a single level of arrays unnested.
+ *
+ * @example
+ * ```
+ *
+ * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ];
+ * unnest(input) // [ "a", "b", "c", "d", [ "double, "nested" ] ]
+ * ```
+ */
+var unnest = function (arr) { return arr.reduce(unnestR, []); };
+/**
+ * Return a completely flattened version of an array.
+ *
+ * @example
+ * ```
+ *
+ * let input = [ [ "a", "b" ], [ "c", "d" ], [ [ "double", "nested" ] ] ];
+ * flatten(input) // [ "a", "b", "c", "d", "double, "nested" ]
+ * ```
+ */
+var flatten = function (arr) { return arr.reduce(flattenR, []); };
+/**
+ * Given a .filter Predicate, builds a .filter Predicate which throws an error if any elements do not pass.
+ * @example
+ * ```
+ *
+ * let isNumber = (obj) => typeof(obj) === 'number';
+ * let allNumbers = [ 1, 2, 3, 4, 5 ];
+ * allNumbers.filter(assertPredicate(isNumber)); //OK
+ *
+ * let oneString = [ 1, 2, 3, 4, "5" ];
+ * oneString.filter(assertPredicate(isNumber, "Not all numbers")); // throws Error(""Not all numbers"");
+ * ```
+ */
+var assertPredicate = assertFn;
+/**
+ * Given a .map function, builds a .map function which throws an error if any mapped elements do not pass a truthyness test.
+ * @example
+ * ```
+ *
+ * var data = { foo: 1, bar: 2 };
+ *
+ * let keys = [ 'foo', 'bar' ]
+ * let values = keys.map(assertMap(key => data[key], "Key not found"));
+ * // values is [1, 2]
+ *
+ * let keys = [ 'foo', 'bar', 'baz' ]
+ * let values = keys.map(assertMap(key => data[key], "Key not found"));
+ * // throws Error("Key not found")
+ * ```
+ */
+var assertMap = assertFn;
+function assertFn(predicateOrMap, errMsg) {
+ if (errMsg === void 0) { errMsg = "assert failure"; }
+ return function (obj) {
+ var result = predicateOrMap(obj);
+ if (!result) {
+ throw new Error(isFunction(errMsg) ? errMsg(obj) : errMsg);
+ }
+ return result;
+ };
+}
+/**
+ * Like _.pairs: Given an object, returns an array of key/value pairs
+ *
+ * @example
+ * ```
+ *
+ * pairs({ foo: "FOO", bar: "BAR }) // [ [ "foo", "FOO" ], [ "bar": "BAR" ] ]
+ * ```
+ */
+var pairs = function (obj) {
+ return Object.keys(obj).map(function (key) { return [key, obj[key]]; });
+};
+/**
+ * Given two or more parallel arrays, returns an array of tuples where
+ * each tuple is composed of [ a[i], b[i], ... z[i] ]
+ *
+ * @example
+ * ```
+ *
+ * let foo = [ 0, 2, 4, 6 ];
+ * let bar = [ 1, 3, 5, 7 ];
+ * let baz = [ 10, 30, 50, 70 ];
+ * arrayTuples(foo, bar); // [ [0, 1], [2, 3], [4, 5], [6, 7] ]
+ * arrayTuples(foo, bar, baz); // [ [0, 1, 10], [2, 3, 30], [4, 5, 50], [6, 7, 70] ]
+ * ```
+ */
+function arrayTuples() {
+ var args = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ args[_i] = arguments[_i];
+ }
+ if (args.length === 0)
+ return [];
+ var maxArrayLen = args.reduce(function (min, arr) { return Math.min(arr.length, min); }, 9007199254740991); // aka 2^53 − 1 aka Number.MAX_SAFE_INTEGER
+ var i, result = [];
+ for (i = 0; i < maxArrayLen; i++) {
+ // This is a hot function
+ // Unroll when there are 1-4 arguments
+ switch (args.length) {
+ case 1:
+ result.push([args[0][i]]);
+ break;
+ case 2:
+ result.push([args[0][i], args[1][i]]);
+ break;
+ case 3:
+ result.push([args[0][i], args[1][i], args[2][i]]);
+ break;
+ case 4:
+ result.push([args[0][i], args[1][i], args[2][i], args[3][i]]);
+ break;
+ default:
+ result.push(args.map(function (array) { return array[i]; }));
+ break;
+ }
+ }
+ return result;
+}
+/**
+ * Reduce function which builds an object from an array of [key, value] pairs.
+ *
+ * Each iteration sets the key/val pair on the memo object, then returns the memo for the next iteration.
+ *
+ * Each keyValueTuple should be an array with values [ key: string, value: any ]
+ *
+ * @example
+ * ```
+ *
+ * var pairs = [ ["fookey", "fooval"], ["barkey", "barval"] ]
+ *
+ * var pairsToObj = pairs.reduce((memo, pair) => applyPairs(memo, pair), {})
+ * // pairsToObj == { fookey: "fooval", barkey: "barval" }
+ *
+ * // Or, more simply:
+ * var pairsToObj = pairs.reduce(applyPairs, {})
+ * // pairsToObj == { fookey: "fooval", barkey: "barval" }
+ * ```
+ */
+function applyPairs(memo, keyValTuple) {
+ var key, value;
+ if (isArray(keyValTuple))
+ key = keyValTuple[0], value = keyValTuple[1];
+ if (!isString(key))
+ throw new Error("invalid parameters to applyPairs");
+ memo[key] = value;
+ return memo;
+}
+/** Get the last element of an array */
+function tail(arr) {
+ return arr.length && arr[arr.length - 1] || undefined;
+}
+/**
+ * shallow copy from src to dest
+ */
+function copy(src, dest) {
+ if (dest)
+ Object.keys(dest).forEach(function (key) { return delete dest[key]; });
+ if (!dest)
+ dest = {};
+ return extend(dest, src);
+}
+/** Naive forEach implementation works with Objects or Arrays */
+function _forEach(obj, cb, _this) {
+ if (isArray(obj))
+ return obj.forEach(cb, _this);
+ Object.keys(obj).forEach(function (key) { return cb(obj[key], key); });
+}
+function _extend(toObj) {
+ for (var i = 1; i < arguments.length; i++) {
+ var obj = arguments[i];
+ if (!obj)
+ continue;
+ var keys = Object.keys(obj);
+ for (var j = 0; j < keys.length; j++) {
+ toObj[keys[j]] = obj[keys[j]];
+ }
+ }
+ return toObj;
+}
+function _equals(o1, o2) {
+ if (o1 === o2)
+ return true;
+ if (o1 === null || o2 === null)
+ return false;
+ if (o1 !== o1 && o2 !== o2)
+ return true; // NaN === NaN
+ var t1 = typeof o1, t2 = typeof o2;
+ if (t1 !== t2 || t1 !== 'object')
+ return false;
+ var tup = [o1, o2];
+ if (all(isArray)(tup))
+ return _arraysEq(o1, o2);
+ if (all(isDate)(tup))
+ return o1.getTime() === o2.getTime();
+ if (all(isRegExp)(tup))
+ return o1.toString() === o2.toString();
+ if (all(isFunction)(tup))
+ return true; // meh
+ var predicates = [isFunction, isArray, isDate, isRegExp];
+ if (predicates.map(any).reduce(function (b, fn) { return b || !!fn(tup); }, false))
+ return false;
+ var key, keys = {};
+ for (key in o1) {
+ if (!_equals(o1[key], o2[key]))
+ return false;
+ keys[key] = true;
+ }
+ for (key in o2) {
+ if (!keys[key])
+ return false;
+ }
+ return true;
+}
+function _arraysEq(a1, a2) {
+ if (a1.length !== a2.length)
+ return false;
+ return arrayTuples(a1, a2).reduce(function (b, t) { return b && _equals(t[0], t[1]); }, true);
+}
+// issue #2676
+var silenceUncaughtInPromise = function (promise) {
+ return promise.catch(function (e) { return 0; }) && promise;
+};
+var silentRejection = function (error) {
+ return silenceUncaughtInPromise(services.$q.reject(error));
+};
+
+/**
+ * @module common
+ */ /** for typedoc */
+var Queue = /** @class */ (function () {
+ function Queue(_items, _limit) {
+ if (_items === void 0) { _items = []; }
+ if (_limit === void 0) { _limit = null; }
+ this._items = _items;
+ this._limit = _limit;
+ }
+ Queue.prototype.enqueue = function (item) {
+ var items = this._items;
+ items.push(item);
+ if (this._limit && items.length > this._limit)
+ items.shift();
+ return item;
+ };
+ Queue.prototype.dequeue = function () {
+ if (this.size())
+ return this._items.splice(0, 1)[0];
+ };
+ Queue.prototype.clear = function () {
+ var current = this._items;
+ this._items = [];
+ return current;
+ };
+ Queue.prototype.size = function () {
+ return this._items.length;
+ };
+ Queue.prototype.remove = function (item) {
+ var idx = this._items.indexOf(item);
+ return idx > -1 && this._items.splice(idx, 1)[0];
+ };
+ Queue.prototype.peekTail = function () {
+ return this._items[this._items.length - 1];
+ };
+ Queue.prototype.peekHead = function () {
+ if (this.size())
+ return this._items[0];
+ };
+ return Queue;
+}());
+
+/**
+ * @coreapi
+ * @module transition
+ */ /** for typedoc */
+"use strict";
+
+(function (RejectType) {
+ RejectType[RejectType["SUPERSEDED"] = 2] = "SUPERSEDED";
+ RejectType[RejectType["ABORTED"] = 3] = "ABORTED";
+ RejectType[RejectType["INVALID"] = 4] = "INVALID";
+ RejectType[RejectType["IGNORED"] = 5] = "IGNORED";
+ RejectType[RejectType["ERROR"] = 6] = "ERROR";
+})(exports.RejectType || (exports.RejectType = {}));
+/** @hidden */ var id = 0;
+var Rejection = /** @class */ (function () {
+ function Rejection(type, message, detail) {
+ this.$id = id++;
+ this.type = type;
+ this.message = message;
+ this.detail = detail;
+ }
+ Rejection.prototype.toString = function () {
+ var detailString = function (d) {
+ return d && d.toString !== Object.prototype.toString ? d.toString() : stringify(d);
+ };
+ var detail = detailString(this.detail);
+ var _a = this, $id = _a.$id, type = _a.type, message = _a.message;
+ return "Transition Rejection($id: " + $id + " type: " + type + ", message: " + message + ", detail: " + detail + ")";
+ };
+ Rejection.prototype.toPromise = function () {
+ return extend(silentRejection(this), { _transitionRejection: this });
+ };
+ /** Returns true if the obj is a rejected promise created from the `asPromise` factory */
+ Rejection.isRejectionPromise = function (obj) {
+ return obj && (typeof obj.then === 'function') && is(Rejection)(obj._transitionRejection);
+ };
+ /** Returns a Rejection due to transition superseded */
+ Rejection.superseded = function (detail, options) {
+ var message = "The transition has been superseded by a different transition";
+ var rejection = new Rejection(exports.RejectType.SUPERSEDED, message, detail);
+ if (options && options.redirected) {
+ rejection.redirected = true;
+ }
+ return rejection;
+ };
+ /** Returns a Rejection due to redirected transition */
+ Rejection.redirected = function (detail) {
+ return Rejection.superseded(detail, { redirected: true });
+ };
+ /** Returns a Rejection due to invalid transition */
+ Rejection.invalid = function (detail) {
+ var message = "This transition is invalid";
+ return new Rejection(exports.RejectType.INVALID, message, detail);
+ };
+ /** Returns a Rejection due to ignored transition */
+ Rejection.ignored = function (detail) {
+ var message = "The transition was ignored";
+ return new Rejection(exports.RejectType.IGNORED, message, detail);
+ };
+ /** Returns a Rejection due to aborted transition */
+ Rejection.aborted = function (detail) {
+ var message = "The transition has been aborted";
+ return new Rejection(exports.RejectType.ABORTED, message, detail);
+ };
+ /** Returns a Rejection due to aborted transition */
+ Rejection.errored = function (detail) {
+ var message = "The transition errored";
+ return new Rejection(exports.RejectType.ERROR, message, detail);
+ };
+ /**
+ * Returns a Rejection
+ *
+ * Normalizes a value as a Rejection.
+ * If the value is already a Rejection, returns it.
+ * Otherwise, wraps and returns the value as a Rejection (Rejection type: ERROR).
+ *
+ * @returns `detail` if it is already a `Rejection`, else returns an ERROR Rejection.
+ */
+ Rejection.normalize = function (detail) {
+ return is(Rejection)(detail) ? detail : Rejection.errored(detail);
+ };
+ return Rejection;
+}());
+
+/**
+ * # Transition tracing (debug)
+ *
+ * Enable transition tracing to print transition information to the console,
+ * in order to help debug your application.
+ * Tracing logs detailed information about each Transition to your console.
+ *
+ * To enable tracing, import the [[Trace]] singleton and enable one or more categories.
+ *
+ * ### ES6
+ * ```js
+ * import {trace} from "ui-router-ng2"; // or "angular-ui-router"
+ * trace.enable(1, 5); // TRANSITION and VIEWCONFIG
+ * ```
+ *
+ * ### CJS
+ * ```js
+ * let trace = require("angular-ui-router").trace; // or "ui-router-ng2"
+ * trace.enable("TRANSITION", "VIEWCONFIG");
+ * ```
+ *
+ * ### Globals
+ * ```js
+ * let trace = window["angular-ui-router"].trace; // or "ui-router-ng2"
+ * trace.enable(); // Trace everything (very verbose)
+ * ```
+ *
+ * ### Angular 1:
+ * ```js
+ * app.run($trace => $trace.enable());
+ * ```
+ *
+ * @coreapi
+ * @module trace
+ */ /** for typedoc */
+/** @hidden */
+function uiViewString(uiview) {
+ if (!uiview)
+ return 'ui-view (defunct)';
+ var state = uiview.creationContext ? uiview.creationContext.name || '(root)' : '(none)';
+ return "[ui-view#" + uiview.id + " " + uiview.$type + ":" + uiview.fqn + " (" + uiview.name + "@" + state + ")]";
+}
+/** @hidden */
+var viewConfigString = function (viewConfig) {
+ var view = viewConfig.viewDecl;
+ var state = view.$context.name || '(root)';
+ return "[View#" + viewConfig.$id + " from '" + state + "' state]: target ui-view: '" + view.$uiViewName + "@" + view.$uiViewContextAnchor + "'";
+};
+/** @hidden */
+function normalizedCat(input) {
+ return isNumber(input) ? exports.Category[input] : exports.Category[exports.Category[input]];
+}
+/** @hidden */
+var consoleLog = Function.prototype.bind.call(console.log, console);
+/** @hidden */
+var consoletable = isFunction(console.table) ? console.table.bind(console) : consoleLog.bind(console);
+/**
+ * Trace categories Enum
+ *
+ * Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]
+ *
+ * `trace.enable(Category.TRANSITION)`
+ *
+ * These can also be provided using a matching string, or position ordinal
+ *
+ * `trace.enable("TRANSITION")`
+ *
+ * `trace.enable(1)`
+ */
+
+(function (Category) {
+ Category[Category["RESOLVE"] = 0] = "RESOLVE";
+ Category[Category["TRANSITION"] = 1] = "TRANSITION";
+ Category[Category["HOOK"] = 2] = "HOOK";
+ Category[Category["UIVIEW"] = 3] = "UIVIEW";
+ Category[Category["VIEWCONFIG"] = 4] = "VIEWCONFIG";
+})(exports.Category || (exports.Category = {}));
+/** @hidden */ var _tid = parse("$id");
+/** @hidden */ var _rid = parse("router.$id");
+/** @hidden */ var transLbl = function (trans) { return "Transition #" + _tid(trans) + "-" + _rid(trans); };
+/**
+ * Prints UI-Router Transition trace information to the console.
+ */
+var Trace = /** @class */ (function () {
+ /** @hidden */
+ function Trace() {
+ /** @hidden */
+ this._enabled = {};
+ this.approximateDigests = 0;
+ }
+ /** @hidden */
+ Trace.prototype._set = function (enabled, categories) {
+ var _this = this;
+ if (!categories.length) {
+ categories = Object.keys(exports.Category)
+ .map(function (k) { return parseInt(k, 10); })
+ .filter(function (k) { return !isNaN(k); })
+ .map(function (key) { return exports.Category[key]; });
+ }
+ categories.map(normalizedCat).forEach(function (category) { return _this._enabled[category] = enabled; });
+ };
+ Trace.prototype.enable = function () {
+ var categories = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ categories[_i] = arguments[_i];
+ }
+ this._set(true, categories);
+ };
+ Trace.prototype.disable = function () {
+ var categories = [];
+ for (var _i = 0; _i < arguments.length; _i++) {
+ categories[_i] = arguments[_i];
+ }
+ this._set(false, categories);
+ };
+ /**
+ * Retrieves the enabled stateus of a [[Category]]
+ *
+ * ```js
+ * trace.enabled("VIEWCONFIG"); // true or false
+ * ```
+ *
+ * @returns boolean true if the category is enabled
+ */
+ Trace.prototype.enabled = function (category) {
+ return !!this._enabled[normalizedCat(category)];
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceTransitionStart = function (trans) {
+ if (!this.enabled(exports.Category.TRANSITION))
+ return;
+ console.log(transLbl(trans) + ": Started -> " + stringify(trans));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceTransitionIgnored = function (trans) {
+ if (!this.enabled(exports.Category.TRANSITION))
+ return;
+ console.log(transLbl(trans) + ": Ignored <> " + stringify(trans));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceHookInvocation = function (step, trans, options) {
+ if (!this.enabled(exports.Category.HOOK))
+ return;
+ var event = parse("traceData.hookType")(options) || "internal", context = parse("traceData.context.state.name")(options) || parse("traceData.context")(options) || "unknown", name = functionToString(step.registeredHook.callback);
+ console.log(transLbl(trans) + ": Hook -> " + event + " context: " + context + ", " + maxLength(200, name));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceHookResult = function (hookResult, trans, transitionOptions) {
+ if (!this.enabled(exports.Category.HOOK))
+ return;
+ console.log(transLbl(trans) + ": <- Hook returned: " + maxLength(200, stringify(hookResult)));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceResolvePath = function (path, when, trans) {
+ if (!this.enabled(exports.Category.RESOLVE))
+ return;
+ console.log(transLbl(trans) + ": Resolving " + path + " (" + when + ")");
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceResolvableResolved = function (resolvable, trans) {
+ if (!this.enabled(exports.Category.RESOLVE))
+ return;
+ console.log(transLbl(trans) + ": <- Resolved " + resolvable + " to: " + maxLength(200, stringify(resolvable.data)));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceError = function (reason, trans) {
+ if (!this.enabled(exports.Category.TRANSITION))
+ return;
+ console.log(transLbl(trans) + ": <- Rejected " + stringify(trans) + ", reason: " + reason);
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceSuccess = function (finalState, trans) {
+ if (!this.enabled(exports.Category.TRANSITION))
+ return;
+ console.log(transLbl(trans) + ": <- Success " + stringify(trans) + ", final state: " + finalState.name);
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceUIViewEvent = function (event, viewData, extra) {
+ if (extra === void 0) { extra = ""; }
+ if (!this.enabled(exports.Category.UIVIEW))
+ return;
+ console.log("ui-view: " + padString(30, event) + " " + uiViewString(viewData) + extra);
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceUIViewConfigUpdated = function (viewData, context) {
+ if (!this.enabled(exports.Category.UIVIEW))
+ return;
+ this.traceUIViewEvent("Updating", viewData, " with ViewConfig from context='" + context + "'");
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceUIViewFill = function (viewData, html) {
+ if (!this.enabled(exports.Category.UIVIEW))
+ return;
+ this.traceUIViewEvent("Fill", viewData, " with: " + maxLength(200, html));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceViewSync = function (pairs) {
+ if (!this.enabled(exports.Category.VIEWCONFIG))
+ return;
+ var mapping = pairs.map(function (_a) {
+ var uiViewData = _a[0], config = _a[1];
+ var uiView = uiViewData.$type + ":" + uiViewData.fqn;
+ var view = config && config.viewDecl.$context.name + ": " + config.viewDecl.$name + " (" + config.viewDecl.$type + ")";
+ return { 'ui-view fqn': uiView, 'state: view name': view };
+ }).sort(function (a, b) { return a['ui-view fqn'].localeCompare(b['ui-view fqn']); });
+ consoletable(mapping);
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceViewServiceEvent = function (event, viewConfig) {
+ if (!this.enabled(exports.Category.VIEWCONFIG))
+ return;
+ console.log("VIEWCONFIG: " + event + " " + viewConfigString(viewConfig));
+ };
+ /** @internalapi called by ui-router code */
+ Trace.prototype.traceViewServiceUIViewEvent = function (event, viewData) {
+ if (!this.enabled(exports.Category.VIEWCONFIG))
+ return;
+ console.log("VIEWCONFIG: " + event + " " + uiViewString(viewData));
+ };
+ return Trace;
+}());
+/**
+ * The [[Trace]] singleton
+ *
+ * #### Example:
+ * ```js
+ * import {trace} from "angular-ui-router";
+ * trace.enable(1, 5);
+ * ```
+ */
+var trace = new Trace();
+
+(function (TransitionHookPhase) {
+ TransitionHookPhase[TransitionHookPhase["CREATE"] = 0] = "CREATE";
+ TransitionHookPhase[TransitionHookPhase["BEFORE"] = 1] = "BEFORE";
+ TransitionHookPhase[TransitionHookPhase["RUN"] = 2] = "RUN";
+ TransitionHookPhase[TransitionHookPhase["SUCCESS"] = 3] = "SUCCESS";
+ TransitionHookPhase[TransitionHookPhase["ERROR"] = 4] = "ERROR";
+})(exports.TransitionHookPhase || (exports.TransitionHookPhase = {}));
+
+(function (TransitionHookScope) {
+ TransitionHookScope[TransitionHookScope["TRANSITION"] = 0] = "TRANSITION";
+ TransitionHookScope[TransitionHookScope["STATE"] = 1] = "STATE";
+})(exports.TransitionHookScope || (exports.TransitionHookScope = {}));
+
+/**
+ * @coreapi
+ * @module state
+ */ /** for typedoc */
+/**
+ * Encapsulate the target (destination) state/params/options of a [[Transition]].
+ *
+ * This class is frequently used to redirect a transition to a new destination.
+ *
+ * See:
+ *
+ * - [[HookResult]]
+ * - [[TransitionHookFn]]
+ * - [[TransitionService.onStart]]
+ *
+ * To create a `TargetState`, use [[StateService.target]].
+ *
+ * ---
+ *
+ * This class wraps:
+ *
+ * 1) an identifier for a state
+ * 2) a set of parameters
+ * 3) and transition options
+ * 4) the registered state object (the [[StateDeclaration]])
+ *
+ * Many UI-Router APIs such as [[StateService.go]] take a [[StateOrName]] argument which can
+ * either be a *state object* (a [[StateDeclaration]] or [[StateObject]]) or a *state name* (a string).
+ * The `TargetState` class normalizes those options.
+ *
+ * A `TargetState` may be valid (the state being targeted exists in the registry)
+ * or invalid (the state being targeted is not registered).
+ */
+var TargetState = /** @class */ (function () {
+ /**
+ * The TargetState constructor
+ *
+ * Note: Do not construct a `TargetState` manually.
+ * To create a `TargetState`, use the [[StateService.target]] factory method.
+ *
+ * @param _stateRegistry The StateRegistry to use to look up the _definition
+ * @param _identifier An identifier for a state.
+ * Either a fully-qualified state name, or the object used to define the state.
+ * @param _params Parameters for the target state
+ * @param _options Transition options.
+ *
+ * @internalapi
+ */
+ function TargetState(_stateRegistry, _identifier, _params, _options) {
+ this._stateRegistry = _stateRegistry;
+ this._identifier = _identifier;
+ this._identifier = _identifier;
+ this._params = extend({}, _params || {});
+ this._options = extend({}, _options || {});
+ this._definition = _stateRegistry.matcher.find(_identifier, this._options.relative);
+ }
+ /** The name of the state this object targets */
+ TargetState.prototype.name = function () {
+ return this._definition && this._definition.name || this._identifier;
+ };
+ /** The identifier used when creating this TargetState */
+ TargetState.prototype.identifier = function () {
+ return this._identifier;
+ };
+ /** The target parameter values */
+ TargetState.prototype.params = function () {
+ return this._params;
+ };
+ /** The internal state object (if it was found) */
+ TargetState.prototype.$state = function () {
+ return this._definition;
+ };
+ /** The internal state declaration (if it was found) */
+ TargetState.prototype.state = function () {
+ return this._definition && this._definition.self;
+ };
+ /** The target options */
+ TargetState.prototype.options = function () {
+ return this._options;
+ };
+ /** True if the target state was found */
+ TargetState.prototype.exists = function () {
+ return !!(this._definition && this._definition.self);
+ };
+ /** True if the object is valid */
+ TargetState.prototype.valid = function () {
+ return !this.error();
+ };
+ /** If the object is invalid, returns the reason why */
+ TargetState.prototype.error = function () {
+ var base = this.options().relative;
+ if (!this._definition && !!base) {
+ var stateName = base.name ? base.name : base;
+ return "Could not resolve '" + this.name() + "' from state '" + stateName + "'";
+ }
+ if (!this._definition)
+ return "No such state '" + this.name() + "'";
+ if (!this._definition.self)
+ return "State '" + this.name() + "' has an invalid definition";
+ };
+ TargetState.prototype.toString = function () {
+ return "'" + this.name() + "'" + stringify(this.params());
+ };
+ /**
+ * Returns a copy of this TargetState which targets a different state.
+ * The new TargetState has the same parameter values and transition options.
+ *
+ * @param state The new state that should be targeted
+ */
+ TargetState.prototype.withState = function (state) {
+ return new TargetState(this._stateRegistry, state, this._params, this._options);
+ };
+ /**
+ * Returns a copy of this TargetState, using the specified parameter values.
+ *
+ * @param params the new parameter values to use
+ * @param replace When false (default) the new parameter values will be merged with the current values.
+ * When true the parameter values will be used instead of the current values.
+ */
+ TargetState.prototype.withParams = function (params, replace) {
+ if (replace === void 0) { replace = false; }
+ var newParams = replace ? params : extend({}, this._params, params);
+ return new TargetState(this._stateRegistry, this._identifier, newParams, this._options);
+ };
+ /**
+ * Returns a copy of this TargetState, using the specified Transition Options.
+ *
+ * @param options the new options to use
+ * @param replace When false (default) the new options will be merged with the current options.
+ * When true the options will be used instead of the current options.
+ */
+ TargetState.prototype.withOptions = function (options, replace) {
+ if (replace === void 0) { replace = false; }
+ var newOpts = replace ? options : extend({}, this._options, options);
+ return new TargetState(this._stateRegistry, this._identifier, this._params, newOpts);
+ };
+ /** Returns true if the object has a state property that might be a state or state name */
+ TargetState.isDef = function (obj) {
+ return obj && obj.state && (isString(obj.state) || isString(obj.state.name));
+ };
+ return TargetState;
+}());
+
+/**
+ * @coreapi
+ * @module transition
+ */
+/** for typedoc */
+var defaultOptions = {
+ current: noop$1,
+ transition: null,
+ traceData: {},
+ bind: null,
+};
+/** @hidden */
+var TransitionHook = /** @class */ (function () {
+ function TransitionHook(transition, stateContext, registeredHook, options) {
+ var _this = this;
+ this.transition = transition;
+ this.stateContext = stateContext;
+ this.registeredHook = registeredHook;
+ this.options = options;
+ this.isSuperseded = function () {
+ return _this.type.hookPhase === exports.TransitionHookPhase.RUN && !_this.options.transition.isActive();
+ };
+ this.options = defaults(options, defaultOptions);
+ this.type = registeredHook.eventType;
+ }
+ TransitionHook.prototype.logError = function (err) {
+ this.transition.router.stateService.defaultErrorHandler()(err);
+ };
+ TransitionHook.prototype.invokeHook = function () {
+ var _this = this;
+ var hook = this.registeredHook;
+ if (hook._deregistered)
+ return;
+ var notCurrent = this.getNotCurrentRejection();
+ if (notCurrent)
+ return notCurrent;
+ var options = this.options;
+ trace.traceHookInvocation(this, this.transition, options);
+ var invokeCallback = function () {
+ return hook.callback.call(options.bind, _this.transition, _this.stateContext);
+ };
+ var normalizeErr = function (err) {
+ return Rejection.normalize(err).toPromise();
+ };
+ var handleError = function (err) {
+ return hook.eventType.getErrorHandler(_this)(err);
+ };
+ var handleResult = function (result) {
+ return hook.eventType.getResultHandler(_this)(result);
+ };
+ try {
+ var result = invokeCallback();
+ if (!this.type.synchronous && isPromise(result)) {
+ return result.catch(normalizeErr)
+ .then(handleResult, handleError);
+ }
+ else {
+ return handleResult(result);
+ }
+ }
+ catch (err) {
+ // If callback throws (synchronously)
+ return handleError(Rejection.normalize(err));
+ }
+ finally {
+ if (hook.invokeLimit && ++hook.invokeCount >= hook.invokeLimit) {
+ hook.deregister();
+ }
+ }
+ };
+ /**
+ * This method handles the return value of a Transition Hook.
+ *
+ * A hook can return false (cancel), a TargetState (redirect),
+ * or a promise (which may later resolve to false or a redirect)
+ *
+ * This also handles "transition superseded" -- when a new transition
+ * was started while the hook was still running
+ */
+ TransitionHook.prototype.handleHookResult = function (result) {
+ var _this = this;
+ var notCurrent = this.getNotCurrentRejection();
+ if (notCurrent)
+ return notCurrent;
+ // Hook returned a promise
+ if (isPromise(result)) {
+ // Wait for the promise, then reprocess with the resulting value
+ return result.then(function (val$$1) { return _this.handleHookResult(val$$1); });
+ }
+ trace.traceHookResult(result, this.transition, this.options);
+ // Hook returned false
+ if (result === false) {
+ // Abort this Transition
+ return Rejection.aborted("Hook aborted transition").toPromise();
+ }
+ var isTargetState = is(TargetState);
+ // hook returned a TargetState
+ if (isTargetState(result)) {
+ // Halt the current Transition and redirect (a new Transition) to the TargetState.
+ return Rejection.redirected(result).toPromise();
+ }
+ };
+ /**
+ * Return a Rejection promise if the transition is no longer current due
+ * to a stopped router (disposed), or a new transition has started and superseded this one.
+ */
+ TransitionHook.prototype.getNotCurrentRejection = function () {
+ var router = this.transition.router;
+ // The router is stopped
+ if (router._disposed) {
+ return Rejection.aborted("UIRouter instance #" + router.$id + " has been stopped (disposed)").toPromise();
+ }
+ if (this.transition._aborted) {
+ return Rejection.aborted().toPromise();
+ }
+ // This transition is no longer current.
+ // Another transition started while this hook was still running.
+ if (this.isSuperseded()) {
+ // Abort this transition
+ return Rejection.superseded(this.options.current()).toPromise();
+ }
+ };
+ TransitionHook.prototype.toString = function () {
+ var _a = this, options = _a.options, registeredHook = _a.registeredHook;
+ var event = parse("traceData.hookType")(options) || "internal", context = parse("traceData.context.state.name")(options) || parse("traceData.context")(options) || "unknown", name = fnToString(registeredHook.callback);
+ return event + " context: " + context + ", " + maxLength(200, name);
+ };
+ /**
+ * Chains together an array of TransitionHooks.
+ *
+ * Given a list of [[TransitionHook]] objects, chains them together.
+ * Each hook is invoked after the previous one completes.
+ *
+ * #### Example:
+ * ```js
+ * var hooks: TransitionHook[] = getHooks();
+ * let promise: Promise = TransitionHook.chain(hooks);
+ *
+ * promise.then(handleSuccess, handleError);
+ * ```
+ *
+ * @param hooks the list of hooks to chain together
+ * @param waitFor if provided, the chain is `.then()`'ed off this promise
+ * @returns a `Promise` for sequentially invoking the hooks (in order)
+ */
+ TransitionHook.chain = function (hooks, waitFor) {
+ // Chain the next hook off the previous
+ var createHookChainR = function (prev, nextHook) {
+ return prev.then(function () { return nextHook.invokeHook(); });
+ };
+ return hooks.reduce(createHookChainR, waitFor || services.$q.when());
+ };
+ /**
+ * Invokes all the provided TransitionHooks, in order.
+ * Each hook's return value is checked.
+ * If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.
+ * If no hook returns a promise, then all hooks are processed synchronously.
+ *
+ * @param hooks the list of TransitionHooks to invoke
+ * @param doneCallback a callback that is invoked after all the hooks have successfully completed
+ *
+ * @returns a promise for the async result, or the result of the callback
+ */
+ TransitionHook.invokeHooks = function (hooks, doneCallback) {
+ for (var idx = 0; idx < hooks.length; idx++) {
+ var hookResult = hooks[idx].invokeHook();
+ if (isPromise(hookResult)) {
+ var remainingHooks = hooks.slice(idx + 1);
+ return TransitionHook.chain(remainingHooks, hookResult)
+ .then(doneCallback);
+ }
+ }
+ return doneCallback();
+ };
+ /**
+ * Run all TransitionHooks, ignoring their return value.
+ */
+ TransitionHook.runAllHooks = function (hooks) {
+ hooks.forEach(function (hook) { return hook.invokeHook(); });
+ };
+ /**
+ * These GetResultHandler(s) are used by [[invokeHook]] below
+ * Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])
+ */
+ TransitionHook.HANDLE_RESULT = function (hook) { return function (result) {
+ return hook.handleHookResult(result);
+ }; };
+ /**
+ * If the result is a promise rejection, log it.
+ * Otherwise, ignore the result.
+ */
+ TransitionHook.LOG_REJECTED_RESULT = function (hook) { return function (result) {
+ isPromise(result) && result.catch(function (err) {
+ return hook.logError(Rejection.normalize(err));
+ });
+ return undefined;
+ }; };
+ /**
+ * These GetErrorHandler(s) are used by [[invokeHook]] below
+ * Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
+ */
+ TransitionHook.LOG_ERROR = function (hook) { return function (error) {
+ return hook.logError(error);
+ }; };
+ TransitionHook.REJECT_ERROR = function (hook) { return function (error) {
+ return silentRejection(error);
+ }; };
+ TransitionHook.THROW_ERROR = function (hook) { return function (error) {
+ throw error;
+ }; };
+ return TransitionHook;
+}());
+
+/**
+ * @coreapi
+ * @module transition
+ */ /** for typedoc */
+/**
+ * Determines if the given state matches the matchCriteria
+ *
+ * @hidden
+ *
+ * @param state a State Object to test against
+ * @param criterion
+ * - If a string, matchState uses the string as a glob-matcher against the state name
+ * - If an array (of strings), matchState uses each string in the array as a glob-matchers against the state name
+ * and returns a positive match if any of the globs match.
+ * - If a function, matchState calls the function with the state and returns true if the function's result is truthy.
+ * @returns {boolean}
+ */
+function matchState(state, criterion) {
+ var toMatch = isString(criterion) ? [criterion] : criterion;
+ function matchGlobs(_state) {
+ var globStrings = toMatch;
+ for (var i = 0; i < globStrings.length; i++) {
+ var glob = new Glob(globStrings[i]);
+ if ((glob && glob.matches(_state.name)) || (!glob && globStrings[i] === _state.name)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ var matchFn = (isFunction(toMatch) ? toMatch : matchGlobs);
+ return !!matchFn(state);
+}
+/**
+ * @internalapi
+ * The registration data for a registered transition hook
+ */
+var RegisteredHook = /** @class */ (function () {
+ function RegisteredHook(tranSvc, eventType, callback, matchCriteria, removeHookFromRegistry, options) {
+ if (options === void 0) { options = {}; }
+ this.tranSvc = tranSvc;
+ this.eventType = eventType;
+ this.callback = callback;
+ this.matchCriteria = matchCriteria;
+ this.removeHookFromRegistry = removeHookFromRegistry;
+ this.invokeCount = 0;
+ this._deregistered = false;
+ this.priority = options.priority || 0;
+ this.bind = options.bind || null;
+ this.invokeLimit = options.invokeLimit;
+ }
+ /**
+ * Gets the matching [[PathNode]]s
+ *
+ * Given an array of [[PathNode]]s, and a [[HookMatchCriterion]], returns an array containing
+ * the [[PathNode]]s that the criteria matches, or `null` if there were no matching nodes.
+ *
+ * Returning `null` is significant to distinguish between the default
+ * "match-all criterion value" of `true` compared to a `() => true` function,
+ * when the nodes is an empty array.
+ *
+ * This is useful to allow a transition match criteria of `entering: true`
+ * to still match a transition, even when `entering === []`. Contrast that
+ * with `entering: (state) => true` which only matches when a state is actually
+ * being entered.
+ */
+ RegisteredHook.prototype._matchingNodes = function (nodes, criterion) {
+ if (criterion === true)
+ return nodes;
+ var matching = nodes.filter(function (node) { return matchState(node.state, criterion); });
+ return matching.length ? matching : null;
+ };
+ /**
+ * Gets the default match criteria (all `true`)
+ *
+ * Returns an object which has all the criteria match paths as keys and `true` as values, i.e.:
+ *
+ * ```js
+ * {
+ * to: true,
+ * from: true,
+ * entering: true,
+ * exiting: true,
+ * retained: true,
+ * }
+ */
+ RegisteredHook.prototype._getDefaultMatchCriteria = function () {
+ return map(this.tranSvc._pluginapi._getPathTypes(), function () { return true; });
+ };
+ /**
+ * Gets matching nodes as [[IMatchingNodes]]
+ *
+ * Create a IMatchingNodes object from the TransitionHookTypes that is roughly equivalent to:
+ *
+ * ```js
+ * let matches: IMatchingNodes = {
+ * to: _matchingNodes([tail(treeChanges.to)], mc.to),
+ * from: _matchingNodes([tail(treeChanges.from)], mc.from),
+ * exiting: _matchingNodes(treeChanges.exiting, mc.exiting),
+ * retained: _matchingNodes(treeChanges.retained, mc.retained),
+ * entering: _matchingNodes(treeChanges.entering, mc.entering),
+ * };
+ * ```
+ */
+ RegisteredHook.prototype._getMatchingNodes = function (treeChanges) {
+ var _this = this;
+ var criteria = extend(this._getDefaultMatchCriteria(), this.matchCriteria);
+ var paths = values(this.tranSvc._pluginapi._getPathTypes());
+ return paths.reduce(function (mn, pathtype) {
+ // STATE scope criteria matches against every node in the path.
+ // TRANSITION scope criteria matches against only the last node in the path
+ var isStateHook = pathtype.scope === exports.TransitionHookScope.STATE;
+ var path = treeChanges[pathtype.name] || [];
+ var nodes = isStateHook ? path : [tail(path)];
+ mn[pathtype.name] = _this._matchingNodes(nodes, criteria[pathtype.name]);
+ return mn;
+ }, {});
+ };
+ /**
+ * Determines if this hook's [[matchCriteria]] match the given [[TreeChanges]]
+ *
+ * @returns an IMatchingNodes object, or null. If an IMatchingNodes object is returned, its values
+ * are the matching [[PathNode]]s for each [[HookMatchCriterion]] (to, from, exiting, retained, entering)
+ */
+ RegisteredHook.prototype.matches = function (treeChanges) {
+ var matches = this._getMatchingNodes(treeChanges);
+ // Check if all the criteria matched the TreeChanges object
+ var allMatched = values(matches).every(identity);
+ return allMatched ? matches : null;
+ };
+ RegisteredHook.prototype.deregister = function () {
+ this.removeHookFromRegistry(this);
+ this._deregistered = true;
+ };
+ return RegisteredHook;
+}());
+/** @hidden Return a registration function of the requested type. */
+function makeEvent(registry, transitionService, eventType) {
+ // Create the object which holds the registered transition hooks.
+ var _registeredHooks = registry._registeredHooks = (registry._registeredHooks || {});
+ var hooks = _registeredHooks[eventType.name] = [];
+ var removeHookFn = removeFrom(hooks);
+ // Create hook registration function on the IHookRegistry for the event
+ registry[eventType.name] = hookRegistrationFn;
+ function hookRegistrationFn(matchObject, callback, options) {
+ if (options === void 0) { options = {}; }
+ var registeredHook = new RegisteredHook(transitionService, eventType, callback, matchObject, removeHookFn, options);
+ hooks.push(registeredHook);
+ return registeredHook.deregister.bind(registeredHook);
+ }
+ return hookRegistrationFn;
+}
+
+/**
+ * @coreapi
+ * @module transition
+ */ /** for typedoc */
+/**
+ * This class returns applicable TransitionHooks for a specific Transition instance.
+ *
+ * Hooks ([[RegisteredHook]]) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g.
+ * myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is
+ * determined by the type of hook)
+ *
+ * The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition.
+ *
+ * The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder
+ * instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private
+ * in the Transition class, so we must also provide the Transition's _treeChanges)
+ *
+ */
+var HookBuilder = /** @class */ (function () {
+ function HookBuilder(transition) {
+ this.transition = transition;
+ }
+ HookBuilder.prototype.buildHooksForPhase = function (phase) {
+ var _this = this;
+ var $transitions = this.transition.router.transitionService;
+ return $transitions._pluginapi._getEvents(phase)
+ .map(function (type) { return _this.buildHooks(type); })
+ .reduce(unnestR, [])
+ .filter(identity);
+ };
+ /**
+ * Returns an array of newly built TransitionHook objects.
+ *
+ * - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's [[TreeChanges]].
+ * - Finds [[PathNode]] (or `PathNode[]`) to use as the TransitionHook context(s)
+ * - For each of the [[PathNode]]s, creates a TransitionHook
+ *
+ * @param hookType the type of the hook registration function, e.g., 'onEnter', 'onFinish'.
+ */
+ HookBuilder.prototype.buildHooks = function (hookType) {
+ var transition = this.transition;
+ var treeChanges = transition.treeChanges();
+ // Find all the matching registered hooks for a given hook type
+ var matchingHooks = this.getMatchingHooks(hookType, treeChanges);
+ if (!matchingHooks)
+ return [];
+ var baseHookOptions = {
+ transition: transition,
+ current: transition.options().current
+ };
+ var makeTransitionHooks = function (hook) {
+ // Fetch the Nodes that caused this hook to match.
+ var matches = hook.matches(treeChanges);
+ // Select the PathNode[] that will be used as TransitionHook context objects
+ var matchingNodes = matches[hookType.criteriaMatchPath.name];
+ // Return an array of HookTuples
+ return matchingNodes.map(function (node) {
+ var _options = extend({
+ bind: hook.bind,
+ traceData: { hookType: hookType.name, context: node }
+ }, baseHookOptions);
+ var state = hookType.criteriaMatchPath.scope === exports.TransitionHookScope.STATE ? node.state.self : null;
+ var transitionHook = new TransitionHook(transition, state, hook, _options);
+ return { hook: hook, node: node, transitionHook: transitionHook };
+ });
+ };
+ return matchingHooks.map(makeTransitionHooks)
+ .reduce(unnestR, [])
+ .sort(tupleSort(hookType.reverseSort))
+ .map(function (tuple) { return tuple.transitionHook; });
+ };
+ /**
+ * Finds all RegisteredHooks from:
+ * - The Transition object instance hook registry
+ * - The TransitionService ($transitions) global hook registry
+ *
+ * which matched:
+ * - the eventType
+ * - the matchCriteria (to, from, exiting, retained, entering)
+ *
+ * @returns an array of matched [[RegisteredHook]]s
+ */
+ HookBuilder.prototype.getMatchingHooks = function (hookType, treeChanges) {
+ var isCreate = hookType.hookPhase === exports.TransitionHookPhase.CREATE;
+ // Instance and Global hook registries
+ var $transitions = this.transition.router.transitionService;
+ var registries = isCreate ? [$transitions] : [this.transition, $transitions];
+ return registries.map(function (reg) { return reg.getHooks(hookType.name); }) // Get named hooks from registries
+ .filter(assertPredicate(isArray, "broken event named: " + hookType.name)) // Sanity check
+ .reduce(unnestR, []) // Un-nest RegisteredHook[][] to RegisteredHook[] array
+ .filter(function (hook) { return hook.matches(treeChanges); }); // Only those satisfying matchCriteria
+ };
+ return HookBuilder;
+}());
+/**
+ * A factory for a sort function for HookTuples.
+ *
+ * The sort function first compares the PathNode depth (how deep in the state tree a node is), then compares
+ * the EventHook priority.
+ *
+ * @param reverseDepthSort a boolean, when true, reverses the sort order for the node depth
+ * @returns a tuple sort function
+ */
+function tupleSort(reverseDepthSort) {
+ if (reverseDepthSort === void 0) { reverseDepthSort = false; }
+ return function nodeDepthThenPriority(l, r) {
+ var factor = reverseDepthSort ? -1 : 1;
+ var depthDelta = (l.node.state.path.length - r.node.state.path.length) * factor;
+ return depthDelta !== 0 ? depthDelta : r.hook.priority - l.hook.priority;
+ };
+}
+
+/**
+ * @coreapi
+ * @module params
+ */
+/** */
+/**
+ * An internal class which implements [[ParamTypeDefinition]].
+ *
+ * A [[ParamTypeDefinition]] is a plain javascript object used to register custom parameter types.
+ * When a param type definition is registered, an instance of this class is created internally.
+ *
+ * This class has naive implementations for all the [[ParamTypeDefinition]] methods.
+ *
+ * Used by [[UrlMatcher]] when matching or formatting URLs, or comparing and validating parameter values.
+ *
+ * #### Example:
+ * ```js
+ * var paramTypeDef = {
+ * decode: function(val) { return parseInt(val, 10); },
+ * encode: function(val) { return val && val.toString(); },
+ * equals: function(a, b) { return this.is(a) && a === b; },
+ * is: function(val) { return angular.isNumber(val) && isFinite(val) && val % 1 === 0; },
+ * pattern: /\d+/
+ * }
+ *
+ * var paramType = new ParamType(paramTypeDef);
+ * ```
+ * @internalapi
+ */
+var ParamType = /** @class */ (function () {
+ /**
+ * @param def A configuration object which contains the custom type definition. The object's
+ * properties will override the default methods and/or pattern in `ParamType`'s public interface.
+ * @returns a new ParamType object
+ */
+ function ParamType(def) {
+ /** @inheritdoc */
+ this.pattern = /.*/;
+ /** @inheritdoc */
+ this.inherit = true;
+ extend(this, def);
+ }
+ // consider these four methods to be "abstract methods" that should be overridden
+ /** @inheritdoc */
+ ParamType.prototype.is = function (val, key) { return true; };
+ /** @inheritdoc */
+ ParamType.prototype.encode = function (val, key) { return val; };
+ /** @inheritdoc */
+ ParamType.prototype.decode = function (val, key) { return val; };
+ /** @inheritdoc */
+ ParamType.prototype.equals = function (a, b) { return a == b; };
+ ParamType.prototype.$subPattern = function () {
+ var sub = this.pattern.toString();
+ return sub.substr(1, sub.length - 2);
+ };
+ ParamType.prototype.toString = function () {
+ return "{ParamType:" + this.name + "}";
+ };
+ /** Given an encoded string, or a decoded object, returns a decoded object */
+ ParamType.prototype.$normalize = function (val) {
+ return this.is(val) ? val : this.decode(val);
+ };
+ /**
+ * Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.
+ * e.g.:
+ * - urlmatcher pattern "/path?{queryParam[]:int}"
+ * - url: "/path?queryParam=1&queryParam=2
+ * - $stateParams.queryParam will be [1, 2]
+ * if `mode` is "auto", then
+ * - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
+ * - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
+ */
+ ParamType.prototype.$asArray = function (mode, isSearch) {
+ if (!mode)
+ return this;
+ if (mode === "auto" && !isSearch)
+ throw new Error("'auto' array mode is for query parameters only");
+ return new ArrayType(this, mode);
+ };
+ return ParamType;
+}());
+/**
+ * Wraps up a `ParamType` object to handle array values.
+ * @internalapi
+ */
+function ArrayType(type, mode) {
+ var _this = this;
+ // Wrap non-array value as array
+ function arrayWrap(val) {
+ return isArray(val) ? val : (isDefined(val) ? [val] : []);
+ }
+ // Unwrap array value for "auto" mode. Return undefined for empty array.
+ function arrayUnwrap(val) {
+ switch (val.length) {
+ case 0: return undefined;
+ case 1: return mode === "auto" ? val[0] : val;
+ default: return val;
+ }
+ }
+ // Wraps type (.is/.encode/.decode) functions to operate on each value of an array
+ function arrayHandler(callback, allTruthyMode) {
+ return function handleArray(val) {
+ if (isArray(val) && val.length === 0)
+ return val;
+ var arr = arrayWrap(val);
+ var result = map(arr, callback);
+ return (allTruthyMode === true) ? filter(result, function (x) { return !x; }).length === 0 : arrayUnwrap(result);
+ };
+ }
+ // Wraps type (.equals) functions to operate on each value of an array
+ function arrayEqualsHandler(callback) {
+ return function handleArray(val1, val2) {
+ var left = arrayWrap(val1), right = arrayWrap(val2);
+ if (left.length !== right.length)
+ return false;
+ for (var i = 0; i < left.length; i++) {
+ if (!callback(left[i], right[i]))
+ return false;
+ }
+ return true;
+ };
+ }
+ ['encode', 'decode', 'equals', '$normalize'].forEach(function (name) {
+ var paramTypeFn = type[name].bind(type);
+ var wrapperFn = name === 'equals' ? arrayEqualsHandler : arrayHandler;
+ _this[name] = wrapperFn(paramTypeFn);
+ });
+ extend(this, {
+ dynamic: type.dynamic,
+ name: type.name,
+ pattern: type.pattern,
+ inherit: type.inherit,
+ is: arrayHandler(type.is.bind(type), true),
+ $arrayMode: mode
+ });
+}
+
+/**
+ * @coreapi
+ * @module params
+ */ /** for typedoc */
+/** @hidden */ var hasOwn = Object.prototype.hasOwnProperty;
+/** @hidden */ var isShorthand = function (cfg) {
+ return ["value", "type", "squash", "array", "dynamic"].filter(hasOwn.bind(cfg || {})).length === 0;
+};
+/** @internalapi */
+
+(function (DefType) {
+ DefType[DefType["PATH"] = 0] = "PATH";
+ DefType[DefType["SEARCH"] = 1] = "SEARCH";
+ DefType[DefType["CONFIG"] = 2] = "CONFIG";
+})(exports.DefType || (exports.DefType = {}));
+/** @hidden */
+function unwrapShorthand(cfg) {
+ cfg = isShorthand(cfg) && { value: cfg } || cfg;
+ getStaticDefaultValue['__cacheable'] = true;
+ function getStaticDefaultValue() {
+ return cfg.value;
+ }
+ return extend(cfg, {
+ $$fn: isInjectable(cfg.value) ? cfg.value : getStaticDefaultValue,
+ });
+}
+/** @hidden */
+function getType(cfg, urlType, location, id, paramTypes) {
+ if (cfg.type && urlType && urlType.name !== 'string')
+ throw new Error("Param '" + id + "' has two type configurations.");
+ if (cfg.type && urlType && urlType.name === 'string' && paramTypes.type(cfg.type))
+ return paramTypes.type(cfg.type);
+ if (urlType)
+ return urlType;
+ if (!cfg.type) {
+ var type = location === exports.DefType.CONFIG ? "any" :
+ location === exports.DefType.PATH ? "path" :
+ location === exports.DefType.SEARCH ? "query" : "string";
+ return paramTypes.type(type);
+ }
+ return cfg.type instanceof ParamType ? cfg.type : paramTypes.type(cfg.type);
+}
+/**
+ * @internalapi
+ * returns false, true, or the squash value to indicate the "default parameter url squash policy".
+ */
+function getSquashPolicy(config, isOptional, defaultPolicy) {
+ var squash = config.squash;
+ if (!isOptional || squash === false)
+ return false;
+ if (!isDefined(squash) || squash == null)
+ return defaultPolicy;
+ if (squash === true || isString(squash))
+ return squash;
+ throw new Error("Invalid squash policy: '" + squash + "'. Valid policies: false, true, or arbitrary string");
+}
+/** @internalapi */
+function getReplace(config, arrayMode, isOptional, squash) {
+ var replace, configuredKeys, defaultPolicy = [
+ { from: "", to: (isOptional || arrayMode ? undefined : "") },
+ { from: null, to: (isOptional || arrayMode ? undefined : "") },
+ ];
+ replace = isArray(config.replace) ? config.replace : [];
+ if (isString(squash))
+ replace.push({ from: squash, to: undefined });
+ configuredKeys = map(replace, prop("from"));
+ return filter(defaultPolicy, function (item) { return configuredKeys.indexOf(item.from) === -1; }).concat(replace);
+}
+/** @internalapi */
+var Param = /** @class */ (function () {
+ function Param(id, type, config, location, urlMatcherFactory) {
+ config = unwrapShorthand(config);
+ type = getType(config, type, location, id, urlMatcherFactory.paramTypes);
+ var arrayMode = getArrayMode();
+ type = arrayMode ? type.$asArray(arrayMode, location === exports.DefType.SEARCH) : type;
+ var isOptional = config.value !== undefined || location === exports.DefType.SEARCH;
+ var dynamic = isDefined(config.dynamic) ? !!config.dynamic : !!type.dynamic;
+ var raw = isDefined(config.raw) ? !!config.raw : !!type.raw;
+ var squash = getSquashPolicy(config, isOptional, urlMatcherFactory.defaultSquashPolicy());
+ var replace = getReplace(config, arrayMode, isOptional, squash);
+ var inherit$$1 = isDefined(config.inherit) ? !!config.inherit : !!type.inherit;
+ // array config: param name (param[]) overrides default settings. explicit config overrides param name.
+ function getArrayMode() {
+ var arrayDefaults = { array: (location === exports.DefType.SEARCH ? "auto" : false) };
+ var arrayParamNomenclature = id.match(/\[\]$/) ? { array: true } : {};
+ return extend(arrayDefaults, arrayParamNomenclature, config).array;
+ }
+ extend(this, { id: id, type: type, location: location, isOptional: isOptional, dynamic: dynamic, raw: raw, squash: squash, replace: replace, inherit: inherit$$1, array: arrayMode, config: config });
+ }
+ Param.prototype.isDefaultValue = function (value) {
+ return this.isOptional && this.type.equals(this.value(), value);
+ };
+ /**
+ * [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
+ * default value, which may be the result of an injectable function.
+ */
+ Param.prototype.value = function (value) {
+ var _this = this;
+ /**
+ * [Internal] Get the default value of a parameter, which may be an injectable function.
+ */
+ var getDefaultValue = function () {
+ if (_this._defaultValueCache)
+ return _this._defaultValueCache.defaultValue;
+ if (!services.$injector)
+ throw new Error("Injectable functions cannot be called at configuration time");
+ var defaultValue = services.$injector.invoke(_this.config.$$fn);
+ if (defaultValue !== null && defaultValue !== undefined && !_this.type.is(defaultValue))
+ throw new Error("Default value (" + defaultValue + ") for parameter '" + _this.id + "' is not an instance of ParamType (" + _this.type.name + ")");
+ if (_this.config.$$fn['__cacheable']) {
+ _this._defaultValueCache = { defaultValue: defaultValue };
+ }
+ return defaultValue;
+ };
+ var replaceSpecialValues = function (val$$1) {
+ for (var _i = 0, _a = _this.replace; _i < _a.length; _i++) {
+ var tuple = _a[_i];
+ if (tuple.from === val$$1)
+ return tuple.to;
+ }
+ return val$$1;
+ };
+ value = replaceSpecialValues(value);
+ return isUndefined(value) ? getDefaultValue() : this.type.$normalize(value);
+ };
+ Param.prototype.isSearch = function () {
+ return this.location === exports.DefType.SEARCH;
+ };
+ Param.prototype.validates = function (value) {
+ // There was no parameter value, but the param is optional
+ if ((isUndefined(value) || value === null) && this.isOptional)
+ return true;
+ // The value was not of the correct ParamType, and could not be decoded to the correct ParamType
+ var normalized = this.type.$normalize(value);
+ if (!this.type.is(normalized))
+ return false;
+ // The value was of the correct type, but when encoded, did not match the ParamType's regexp
+ var encoded = this.type.encode(normalized);
+ return !(isString(encoded) && !this.type.pattern.exec(encoded));
+ };
+ Param.prototype.toString = function () {
+ return "{Param:" + this.id + " " + this.type + " squash: '" + this.squash + "' optional: " + this.isOptional + "}";
+ };
+ Param.values = function (params, values$$1) {
+ if (values$$1 === void 0) { values$$1 = {}; }
+ var paramValues = {};
+ for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {
+ var param = params_1[_i];
+ paramValues[param.id] = param.value(values$$1[param.id]);
+ }
+ return paramValues;
+ };
+ /**
+ * Finds [[Param]] objects which have different param values
+ *
+ * Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects
+ *
+ * @param params: The list of Param objects to filter
+ * @param values1: The first set of parameter values
+ * @param values2: the second set of parameter values
+ *
+ * @returns any Param objects whose values were different between values1 and values2
+ */
+ Param.changed = function (params, values1, values2) {
+ if (values1 === void 0) { values1 = {}; }
+ if (values2 === void 0) { values2 = {}; }
+ return params.filter(function (param) { return !param.type.equals(values1[param.id], values2[param.id]); });
+ };
+ /**
+ * Checks if two param value objects are equal (for a set of [[Param]] objects)
+ *
+ * @param params The list of [[Param]] objects to check
+ * @param values1 The first set of param values
+ * @param values2 The second set of param values
+ *
+ * @returns true if the param values in values1 and values2 are equal
+ */
+ Param.equals = function (params, values1, values2) {
+ if (values1 === void 0) { values1 = {}; }
+ if (values2 === void 0) { values2 = {}; }
+ return Param.changed(params, values1, values2).length === 0;
+ };
+ /** Returns true if a the parameter values are valid, according to the Param definitions */
+ Param.validates = function (params, values$$1) {
+ if (values$$1 === void 0) { values$$1 = {}; }
+ return params.map(function (param) { return param.validates(values$$1[param.id]); }).reduce(allTrueR, true);
+ };
+ return Param;
+}());
+
+/** @module path */ /** for typedoc */
+/**
+ * @internalapi
+ *
+ * A node in a [[TreeChanges]] path
+ *
+ * For a [[TreeChanges]] path, this class holds the stateful information for a single node in the path.
+ * Each PathNode corresponds to a state being entered, exited, or retained.
+ * The stateful information includes parameter values and resolve data.
+ */
+var PathNode = /** @class */ (function () {
+ function PathNode(stateOrNode) {
+ if (stateOrNode instanceof PathNode) {
+ var node = stateOrNode;
+ this.state = node.state;
+ this.paramSchema = node.paramSchema.slice();
+ this.paramValues = extend({}, node.paramValues);
+ this.resolvables = node.resolvables.slice();
+ this.views = node.views && node.views.slice();
+ }
+ else {
+ var state = stateOrNode;
+ this.state = state;
+ this.paramSchema = state.parameters({ inherit: false });
+ this.paramValues = {};
+ this.resolvables = state.resolvables.map(function (res) { return res.clone(); });
+ }
+ }
+ /** Sets [[paramValues]] for the node, from the values of an object hash */
+ PathNode.prototype.applyRawParams = function (params) {
+ var getParamVal = function (paramDef) { return [paramDef.id, paramDef.value(params[paramDef.id])]; };
+ this.paramValues = this.paramSchema.reduce(function (memo, pDef) { return applyPairs(memo, getParamVal(pDef)); }, {});
+ return this;
+ };
+ /** Gets a specific [[Param]] metadata that belongs to the node */
+ PathNode.prototype.parameter = function (name) {
+ return find(this.paramSchema, propEq("id", name));
+ };
+ /**
+ * @returns true if the state and parameter values for another PathNode are
+ * equal to the state and param values for this PathNode
+ */
+ PathNode.prototype.equals = function (node, paramsFn) {
+ var diff = this.diff(node, paramsFn);
+ return diff && diff.length === 0;
+ };
+ /**
+ * Finds Params with different parameter values on another PathNode.
+ *
+ * Given another node (of the same state), finds the parameter values which differ.
+ * Returns the [[Param]] (schema objects) whose parameter values differ.
+ *
+ * Given another node for a different state, returns `false`
+ *
+ * @param node The node to compare to
+ * @param paramsFn A function that returns which parameters should be compared.
+ * @returns The [[Param]]s which differ, or null if the two nodes are for different states
+ */
+ PathNode.prototype.diff = function (node, paramsFn) {
+ if (this.state !== node.state)
+ return false;
+ var params = paramsFn ? paramsFn(this) : this.paramSchema;
+ return Param.changed(params, this.paramValues, node.paramValues);
+ };
+ /** Returns a clone of the PathNode */
+ PathNode.clone = function (node) {
+ return new PathNode(node);
+ };
+ return PathNode;
+}());
+
+/** @module path */ /** for typedoc */
+/**
+ * This class contains functions which convert TargetStates, Nodes and paths from one type to another.
+ */
+var PathUtils = /** @class */ (function () {
+ function PathUtils() {
+ }
+ /** Given a PathNode[], create an TargetState */
+ PathUtils.makeTargetState = function (registry, path) {
+ var state = tail(path).state;
+ return new TargetState(registry, state, path.map(prop("paramValues")).reduce(mergeR, {}), {});
+ };
+ PathUtils.buildPath = function (targetState) {
+ var toParams = targetState.params();
+ return targetState.$state().path.map(function (state) { return new PathNode(state).applyRawParams(toParams); });
+ };
+ /** Given a fromPath: PathNode[] and a TargetState, builds a toPath: PathNode[] */
+ PathUtils.buildToPath = function (fromPath, targetState) {
+ var toPath = PathUtils.buildPath(targetState);
+ if (targetState.options().inherit) {
+ return PathUtils.inheritParams(fromPath, toPath, Object.keys(targetState.params()));
+ }
+ return toPath;
+ };
+ /**
+ * Creates ViewConfig objects and adds to nodes.
+ *
+ * On each [[PathNode]], creates ViewConfig objects from the views: property of the node's state
+ */
+ PathUtils.applyViewConfigs = function ($view, path, states) {
+ // Only apply the viewConfigs to the nodes for the given states
+ path.filter(function (node) { return inArray(states, node.state); }).forEach(function (node) {
+ var viewDecls = values(node.state.views || {});
+ var subPath = PathUtils.subPath(path, function (n) { return n === node; });
+ var viewConfigs = viewDecls.map(function (view) { return $view.createViewConfig(subPath, view); });
+ node.views = viewConfigs.reduce(unnestR, []);
+ });
+ };
+ /**
+ * Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath
+ *
+ * For a parameter in a node to be inherited from the from path:
+ * - The toPath's node must have a matching node in the fromPath (by state).
+ * - The parameter name must not be found in the toKeys parameter array.
+ *
+ * Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some
+ * caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams,
+ * it is not inherited from the fromPath.
+ */
+ PathUtils.inheritParams = function (fromPath, toPath, toKeys) {
+ if (toKeys === void 0) { toKeys = []; }
+ function nodeParamVals(path, state) {
+ var node = find(path, propEq('state', state));
+ return extend({}, node && node.paramValues);
+ }
+ var noInherit = fromPath.map(function (node) { return node.paramSchema; })
+ .reduce(unnestR, [])
+ .filter(function (param) { return !param.inherit; })
+ .map(prop('id'));
+ /**
+ * Given an [[PathNode]] "toNode", return a new [[PathNode]] with param values inherited from the
+ * matching node in fromPath. Only inherit keys that aren't found in "toKeys" from the node in "fromPath""
+ */
+ function makeInheritedParamsNode(toNode) {
+ // All param values for the node (may include default key/vals, when key was not found in toParams)
+ var toParamVals = extend({}, toNode && toNode.paramValues);
+ // limited to only those keys found in toParams
+ var incomingParamVals = pick(toParamVals, toKeys);
+ toParamVals = omit(toParamVals, toKeys);
+ var fromParamVals = omit(nodeParamVals(fromPath, toNode.state) || {}, noInherit);
+ // extend toParamVals with any fromParamVals, then override any of those those with incomingParamVals
+ var ownParamVals = extend(toParamVals, fromParamVals, incomingParamVals);
+ return new PathNode(toNode.state).applyRawParams(ownParamVals);
+ }
+ // The param keys specified by the incoming toParams
+ return toPath.map(makeInheritedParamsNode);
+ };
+ /**
+ * Computes the tree changes (entering, exiting) between a fromPath and toPath.
+ */
+ PathUtils.treeChanges = function (fromPath, toPath, reloadState) {
+ var keep = 0, max = Math.min(fromPath.length, toPath.length);
+ var nodesMatch = function (node1, node2) {
+ return node1.equals(node2, PathUtils.nonDynamicParams);
+ };
+ while (keep < max && fromPath[keep].state !== reloadState && nodesMatch(fromPath[keep], toPath[keep])) {
+ keep++;
+ }
+ /** Given a retained node, return a new node which uses the to node's param values */
+ function applyToParams(retainedNode, idx) {
+ var cloned = PathNode.clone(retainedNode);
+ cloned.paramValues = toPath[idx].paramValues;
+ return cloned;
+ }
+ var from, retained, exiting, entering, to;
+ from = fromPath;
+ retained = from.slice(0, keep);
+ exiting = from.slice(keep);
+ // Create a new retained path (with shallow copies of nodes) which have the params of the toPath mapped
+ var retainedWithToParams = retained.map(applyToParams);
+ entering = toPath.slice(keep);
+ to = (retainedWithToParams).concat(entering);
+ return { from: from, to: to, retained: retained, exiting: exiting, entering: entering };
+ };
+ /**
+ * Returns a new path which is: the subpath of the first path which matches the second path.
+ *
+ * The new path starts from root and contains any nodes that match the nodes in the second path.
+ * It stops before the first non-matching node.
+ *
+ * Nodes are compared using their state property and their parameter values.
+ * If a `paramsFn` is provided, only the [[Param]] returned by the function will be considered when comparing nodes.
+ *
+ * @param pathA the first path
+ * @param pathB the second path
+ * @param paramsFn a function which returns the parameters to consider when comparing
+ *
+ * @returns an array of PathNodes from the first path which match the nodes in the second path
+ */
+ PathUtils.matching = function (pathA, pathB, paramsFn) {
+ var done = false;
+ var tuples = arrayTuples(pathA, pathB);
+ return tuples.reduce(function (matching, _a) {
+ var nodeA = _a[0], nodeB = _a[1];
+ done = done || !nodeA.equals(nodeB, paramsFn);
+ return done ? matching : matching.concat(nodeA);
+ }, []);
+ };
+ /**
+ * Returns true if two paths are identical.
+ *
+ * @param pathA
+ * @param pathB
+ * @param paramsFn a function which returns the parameters to consider when comparing
+ * @returns true if the the states and parameter values for both paths are identical
+ */
+ PathUtils.equals = function (pathA, pathB, paramsFn) {
+ return pathA.length === pathB.length &&
+ PathUtils.matching(pathA, pathB, paramsFn).length === pathA.length;
+ };
+ /**
+ * Return a subpath of a path, which stops at the first matching node
+ *
+ * Given an array of nodes, returns a subset of the array starting from the first node,
+ * stopping when the first node matches the predicate.
+ *
+ * @param path a path of [[PathNode]]s
+ * @param predicate a [[Predicate]] fn that matches [[PathNode]]s
+ * @returns a subpath up to the matching node, or undefined if no match is found
+ */
+ PathUtils.subPath = function (path, predicate) {
+ var node = find(path, predicate);
+ var elementIdx = path.indexOf(node);
+ return elementIdx === -1 ? undefined : path.slice(0, elementIdx + 1);
+ };
+ PathUtils.nonDynamicParams = function (node) {
+ return node.state.parameters({ inherit: false })
+ .filter(function (param) { return !param.dynamic; });
+ };
+ /** Gets the raw parameter values from a path */
+ PathUtils.paramValues = function (path) {
+ return path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});
+ };
+ return PathUtils;
+}());
+
+/**
+ * @coreapi
+ * @module resolve
+ */ /** for typedoc */
+// TODO: explicitly make this user configurable
+var defaultResolvePolicy = {
+ when: "LAZY",
+ async: "WAIT"
+};
+/**
+ * The basic building block for the resolve system.
+ *
+ * Resolvables encapsulate a state's resolve's resolveFn, the resolveFn's declared dependencies, the wrapped (.promise),
+ * and the unwrapped-when-complete (.data) result of the resolveFn.
+ *
+ * Resolvable.get() either retrieves the Resolvable's existing promise, or else invokes resolve() (which invokes the
+ * resolveFn) and returns the resulting promise.
+ *
+ * Resolvable.get() and Resolvable.resolve() both execute within a context path, which is passed as the first
+ * parameter to those fns.
+ */
+var Resolvable = /** @class */ (function () {
+ function Resolvable(arg1, resolveFn, deps, policy, data) {
+ this.resolved = false;
+ this.promise = undefined;
+ if (arg1 instanceof Resolvable) {
+ extend(this, arg1);
+ }
+ else if (isFunction(resolveFn)) {
+ if (isNullOrUndefined(arg1))
+ throw new Error("new Resolvable(): token argument is required");
+ if (!isFunction(resolveFn))
+ throw new Error("new Resolvable(): resolveFn argument must be a function");
+ this.token = arg1;
+ this.policy = policy;
+ this.resolveFn = resolveFn;
+ this.deps = deps || [];
+ this.data = data;
+ this.resolved = data !== undefined;
+ this.promise = this.resolved ? services.$q.when(this.data) : undefined;
+ }
+ else if (isObject(arg1) && arg1.token && isFunction(arg1.resolveFn)) {
+ var literal = arg1;
+ return new Resolvable(literal.token, literal.resolveFn, literal.deps, literal.policy, literal.data);
+ }
+ }
+ Resolvable.prototype.getPolicy = function (state) {
+ var thisPolicy = this.policy || {};
+ var statePolicy = state && state.resolvePolicy || {};
+ return {
+ when: thisPolicy.when || statePolicy.when || defaultResolvePolicy.when,
+ async: thisPolicy.async || statePolicy.async || defaultResolvePolicy.async,
+ };
+ };
+ /**
+ * Asynchronously resolve this Resolvable's data
+ *
+ * Given a ResolveContext that this Resolvable is found in:
+ * Wait for this Resolvable's dependencies, then invoke this Resolvable's function
+ * and update the Resolvable's state
+ */
+ Resolvable.prototype.resolve = function (resolveContext, trans) {
+ var _this = this;
+ var $q = services.$q;
+ // Gets all dependencies from ResolveContext and wait for them to be resolved
+ var getResolvableDependencies = function () {
+ return $q.all(resolveContext.getDependencies(_this).map(function (resolvable) {
+ return resolvable.get(resolveContext, trans);
+ }));
+ };
+ // Invokes the resolve function passing the resolved dependencies as arguments
+ var invokeResolveFn = function (resolvedDeps) {
+ return _this.resolveFn.apply(null, resolvedDeps);
+ };
+ /**
+ * For RXWAIT policy:
+ *
+ * Given an observable returned from a resolve function:
+ * - enables .cache() mode (this allows multicast subscribers)
+ * - then calls toPromise() (this triggers subscribe() and thus fetches)
+ * - Waits for the promise, then return the cached observable (not the first emitted value).
+ */
+ var waitForRx = function (observable$) {
+ var cached = observable$.cache(1);
+ return cached.take(1).toPromise().then(function () { return cached; });
+ };
+ // If the resolve policy is RXWAIT, wait for the observable to emit something. otherwise pass through.
+ var node = resolveContext.findNode(this);
+ var state = node && node.state;
+ var maybeWaitForRx = this.getPolicy(state).async === "RXWAIT" ? waitForRx : identity;
+ // After the final value has been resolved, update the state of the Resolvable
+ var applyResolvedValue = function (resolvedValue) {
+ _this.data = resolvedValue;
+ _this.resolved = true;
+ trace.traceResolvableResolved(_this, trans);
+ return _this.data;
+ };
+ // Sets the promise property first, then getsResolvableDependencies in the context of the promise chain. Always waits one tick.
+ return this.promise = $q.when()
+ .then(getResolvableDependencies)
+ .then(invokeResolveFn)
+ .then(maybeWaitForRx)
+ .then(applyResolvedValue);
+ };
+ /**
+ * Gets a promise for this Resolvable's data.
+ *
+ * Fetches the data and returns a promise.
+ * Returns the existing promise if it has already been fetched once.
+ */
+ Resolvable.prototype.get = function (resolveContext, trans) {
+ return this.promise || this.resolve(resolveContext, trans);
+ };
+ Resolvable.prototype.toString = function () {
+ return "Resolvable(token: " + stringify(this.token) + ", requires: [" + this.deps.map(stringify) + "])";
+ };
+ Resolvable.prototype.clone = function () {
+ return new Resolvable(this);
+ };
+ Resolvable.fromData = function (token, data) {
+ return new Resolvable(token, function () { return data; }, null, null, data);
+ };
+ return Resolvable;
+}());
+
+/** @internalapi */
+var resolvePolicies = {
+ when: {
+ LAZY: "LAZY",
+ EAGER: "EAGER"
+ },
+ async: {
+ WAIT: "WAIT",
+ NOWAIT: "NOWAIT",
+ RXWAIT: "RXWAIT"
+ }
+};
+
+/** @module resolve */
+/** for typedoc */
+var whens = resolvePolicies.when;
+var ALL_WHENS = [whens.EAGER, whens.LAZY];
+var EAGER_WHENS = [whens.EAGER];
+var NATIVE_INJECTOR_TOKEN = "Native Injector";
+/**
+ * Encapsulates Dependency Injection for a path of nodes
+ *
+ * UI-Router states are organized as a tree.
+ * A nested state has a path of ancestors to the root of the tree.
+ * When a state is being activated, each element in the path is wrapped as a [[PathNode]].
+ * A `PathNode` is a stateful object that holds things like parameters and resolvables for the state being activated.
+ *
+ * The ResolveContext closes over the [[PathNode]]s, and provides DI for the last node in the path.
+ */
+var ResolveContext = /** @class */ (function () {
+ function ResolveContext(_path) {
+ this._path = _path;
+ }
+ /** Gets all the tokens found in the resolve context, de-duplicated */
+ ResolveContext.prototype.getTokens = function () {
+ return this._path.reduce(function (acc, node) { return acc.concat(node.resolvables.map(function (r) { return r.token; })); }, []).reduce(uniqR, []);
+ };
+ /**
+ * Gets the Resolvable that matches the token
+ *
+ * Gets the last Resolvable that matches the token in this context, or undefined.
+ * Throws an error if it doesn't exist in the ResolveContext
+ */
+ ResolveContext.prototype.getResolvable = function (token) {
+ var matching = this._path.map(function (node) { return node.resolvables; })
+ .reduce(unnestR, [])
+ .filter(function (r) { return r.token === token; });
+ return tail(matching);
+ };
+ /** Returns the [[ResolvePolicy]] for the given [[Resolvable]] */
+ ResolveContext.prototype.getPolicy = function (resolvable) {
+ var node = this.findNode(resolvable);
+ return resolvable.getPolicy(node.state);
+ };
+ /**
+ * Returns a ResolveContext that includes a portion of this one
+ *
+ * Given a state, this method creates a new ResolveContext from this one.
+ * The new context starts at the first node (root) and stops at the node for the `state` parameter.
+ *
+ * #### Why
+ *
+ * When a transition is created, the nodes in the "To Path" are injected from a ResolveContext.
+ * A ResolveContext closes over a path of [[PathNode]]s and processes the resolvables.
+ * The "To State" can inject values from its own resolvables, as well as those from all its ancestor state's (node's).
+ * This method is used to create a narrower context when injecting ancestor nodes.
+ *
+ * @example
+ * `let ABCD = new ResolveContext([A, B, C, D]);`
+ *
+ * Given a path `[A, B, C, D]`, where `A`, `B`, `C` and `D` are nodes for states `a`, `b`, `c`, `d`:
+ * When injecting `D`, `D` should have access to all resolvables from `A`, `B`, `C`, `D`.
+ * However, `B` should only be able to access resolvables from `A`, `B`.
+ *
+ * When resolving for the `B` node, first take the full "To Path" Context `[A,B,C,D]` and limit to the subpath `[A,B]`.
+ * `let AB = ABCD.subcontext(a)`
+ */
+ ResolveContext.prototype.subContext = function (state) {
+ return new ResolveContext(PathUtils.subPath(this._path, function (node) { return node.state === state; }));
+ };
+ /**
+ * Adds Resolvables to the node that matches the state
+ *
+ * This adds a [[Resolvable]] (generally one created on the fly; not declared on a [[StateDeclaration.resolve]] block).
+ * The resolvable is added to the node matching the `state` parameter.
+ *
+ * These new resolvables are not automatically fetched.
+ * The calling code should either fetch them, fetch something that depends on them,
+ * or rely on [[resolvePath]] being called when some state is being entered.
+ *
+ * Note: each resolvable's [[ResolvePolicy]] is merged with the state's policy, and the global default.
+ *
+ * @param newResolvables the new Resolvables
+ * @param state Used to find the node to put the resolvable on
+ */
+ ResolveContext.prototype.addResolvables = function (newResolvables, state) {
+ var node = find(this._path, propEq('state', state));
+ var keys = newResolvables.map(function (r) { return r.token; });
+ node.resolvables = node.resolvables.filter(function (r) { return keys.indexOf(r.token) === -1; }).concat(newResolvables);
+ };
+ /**
+ * Returns a promise for an array of resolved path Element promises
+ *
+ * @param when
+ * @param trans
+ * @returns {Promise|any}
+ */
+ ResolveContext.prototype.resolvePath = function (when, trans) {
+ var _this = this;
+ if (when === void 0) { when = "LAZY"; }
+ // This option determines which 'when' policy Resolvables we are about to fetch.
+ var whenOption = inArray(ALL_WHENS, when) ? when : "LAZY";
+ // If the caller specified EAGER, only the EAGER Resolvables are fetched.
+ // if the caller specified LAZY, both EAGER and LAZY Resolvables are fetched.`
+ var matchedWhens = whenOption === resolvePolicies.when.EAGER ? EAGER_WHENS : ALL_WHENS;
+ // get the subpath to the state argument, if provided
+ trace.traceResolvePath(this._path, when, trans);
+ var matchesPolicy = function (acceptedVals, whenOrAsync) {
+ return function (resolvable) {
+ return inArray(acceptedVals, _this.getPolicy(resolvable)[whenOrAsync]);
+ };
+ };
+ // Trigger all the (matching) Resolvables in the path
+ // Reduce all the "WAIT" Resolvables into an array
+ var promises = this._path.reduce(function (acc, node) {
+ var nodeResolvables = node.resolvables.filter(matchesPolicy(matchedWhens, 'when'));
+ var nowait = nodeResolvables.filter(matchesPolicy(['NOWAIT'], 'async'));
+ var wait = nodeResolvables.filter(not(matchesPolicy(['NOWAIT'], 'async')));
+ // For the matching Resolvables, start their async fetch process.
+ var subContext = _this.subContext(node.state);
+ var getResult = function (r) { return r.get(subContext, trans)
+ .then(function (value) { return ({ token: r.token, value: value }); }); };
+ nowait.forEach(getResult);
+ return acc.concat(wait.map(getResult));
+ }, []);
+ // Wait for all the "WAIT" resolvables
+ return services.$q.all(promises);
+ };
+ ResolveContext.prototype.injector = function () {
+ return this._injector || (this._injector = new UIInjectorImpl(this));
+ };
+ ResolveContext.prototype.findNode = function (resolvable) {
+ return find(this._path, function (node) { return inArray(node.resolvables, resolvable); });
+ };
+ /**
+ * Gets the async dependencies of a Resolvable
+ *
+ * Given a Resolvable, returns its dependencies as a Resolvable[]
+ */
+ ResolveContext.prototype.getDependencies = function (resolvable) {
+ var _this = this;
+ var node = this.findNode(resolvable);
+ // Find which other resolvables are "visible" to the `resolvable` argument
+ // subpath stopping at resolvable's node, or the whole path (if the resolvable isn't in the path)
+ var subPath = PathUtils.subPath(this._path, function (x) { return x === node; }) || this._path;
+ var availableResolvables = subPath
+ .reduce(function (acc, _node) { return acc.concat(_node.resolvables); }, []) //all of subpath's resolvables
+ .filter(function (res) { return res !== resolvable; }); // filter out the `resolvable` argument
+ var getDependency = function (token) {
+ var matching = availableResolvables.filter(function (r) { return r.token === token; });
+ if (matching.length)
+ return tail(matching);
+ var fromInjector = _this.injector().getNative(token);
+ if (isUndefined(fromInjector)) {
+ throw new Error("Could not find Dependency Injection token: " + stringify(token));
+ }
+ return new Resolvable(token, function () { return fromInjector; }, [], fromInjector);
+ };
+ return resolvable.deps.map(getDependency);
+ };
+ return ResolveContext;
+}());
+var UIInjectorImpl = /** @class */ (function () {
+ function UIInjectorImpl(context) {
+ this.context = context;
+ this.native = this.get(NATIVE_INJECTOR_TOKEN) || services.$injector;
+ }
+ UIInjectorImpl.prototype.get = function (token) {
+ var resolvable = this.context.getResolvable(token);
+ if (resolvable) {
+ if (this.context.getPolicy(resolvable).async === 'NOWAIT') {
+ return resolvable.get(this.context);
+ }
+ if (!resolvable.resolved) {
+ throw new Error("Resolvable async .get() not complete:" + stringify(resolvable.token));
+ }
+ return resolvable.data;
+ }
+ return this.getNative(token);
+ };
+ UIInjectorImpl.prototype.getAsync = function (token) {
+ var resolvable = this.context.getResolvable(token);
+ if (resolvable)
+ return resolvable.get(this.context);
+ return services.$q.when(this.native.get(token));
+ };
+ UIInjectorImpl.prototype.getNative = function (token) {
+ return this.native && this.native.get(token);
+ };
+ return UIInjectorImpl;
+}());
+
+/**
+ * @coreapi
+ * @module transition
+ */
+/** for typedoc */
+/** @hidden */
+var stateSelf = prop("self");
+/**
+ * Represents a transition between two states.
+ *
+ * When navigating to a state, we are transitioning **from** the current state **to** the new state.
+ *
+ * This object contains all contextual information about the to/from states, parameters, resolves.
+ * It has information about all states being entered and exited as a result of the transition.
+ */
+var Transition = /** @class */ (function () {
+ /**
+ * Creates a new Transition object.
+ *
+ * If the target state is not valid, an error is thrown.
+ *
+ * @internalapi
+ *
+ * @param fromPath The path of [[PathNode]]s from which the transition is leaving. The last node in the `fromPath`
+ * encapsulates the "from state".
+ * @param targetState The target state and parameters being transitioned to (also, the transition options)
+ * @param router The [[UIRouter]] instance
+ */
+ function Transition(fromPath, targetState, router) {
+ var _this = this;
+ /** @hidden */
+ this._deferred = services.$q.defer();
+ /**
+ * This promise is resolved or rejected based on the outcome of the Transition.
+ *
+ * When the transition is successful, the promise is resolved
+ * When the transition is unsuccessful, the promise is rejected with the [[Rejection]] or javascript error
+ */
+ this.promise = this._deferred.promise;
+ /** @hidden Holds the hook registration functions such as those passed to Transition.onStart() */
+ this._registeredHooks = {};
+ /** @hidden */
+ this._hookBuilder = new HookBuilder(this);
+ /** Checks if this transition is currently active/running. */
+ this.isActive = function () {
+ return _this.router.globals.transition === _this;
+ };
+ this.router = router;
+ this._targetState = targetState;
+ if (!targetState.valid()) {
+ throw new Error(targetState.error());
+ }
+ // current() is assumed to come from targetState.options, but provide a naive implementation otherwise.
+ this._options = extend({ current: val(this) }, targetState.options());
+ this.$id = router.transitionService._transitionCount++;
+ var toPath = PathUtils.buildToPath(fromPath, targetState);
+ this._treeChanges = PathUtils.treeChanges(fromPath, toPath, this._options.reloadState);
+ this.createTransitionHookRegFns();
+ var onCreateHooks = this._hookBuilder.buildHooksForPhase(exports.TransitionHookPhase.CREATE);
+ TransitionHook.invokeHooks(onCreateHooks, function () { return null; });
+ this.applyViewConfigs(router);
+ }
+ /** @hidden */
+ Transition.prototype.onBefore = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onStart = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onExit = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onRetain = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onEnter = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onFinish = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onSuccess = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ Transition.prototype.onError = function (criteria, callback, options) { return; };
+ /** @hidden
+ * Creates the transition-level hook registration functions
+ * (which can then be used to register hooks)
+ */
+ Transition.prototype.createTransitionHookRegFns = function () {
+ var _this = this;
+ this.router.transitionService._pluginapi._getEvents()
+ .filter(function (type) { return type.hookPhase !== exports.TransitionHookPhase.CREATE; })
+ .forEach(function (type) { return makeEvent(_this, _this.router.transitionService, type); });
+ };
+ /** @internalapi */
+ Transition.prototype.getHooks = function (hookName) {
+ return this._registeredHooks[hookName];
+ };
+ Transition.prototype.applyViewConfigs = function (router) {
+ var enteringStates = this._treeChanges.entering.map(function (node) { return node.state; });
+ PathUtils.applyViewConfigs(router.transitionService.$view, this._treeChanges.to, enteringStates);
+ };
+ /**
+ * @internalapi
+ *
+ * @returns the internal from [State] object
+ */
+ Transition.prototype.$from = function () {
+ return tail(this._treeChanges.from).state;
+ };
+ /**
+ * @internalapi
+ *
+ * @returns the internal to [State] object
+ */
+ Transition.prototype.$to = function () {
+ return tail(this._treeChanges.to).state;
+ };
+ /**
+ * Returns the "from state"
+ *
+ * Returns the state that the transition is coming *from*.
+ *
+ * @returns The state declaration object for the Transition's ("from state").
+ */
+ Transition.prototype.from = function () {
+ return this.$from().self;
+ };
+ /**
+ * Returns the "to state"
+ *
+ * Returns the state that the transition is going *to*.
+ *
+ * @returns The state declaration object for the Transition's target state ("to state").
+ */
+ Transition.prototype.to = function () {
+ return this.$to().self;
+ };
+ /**
+ * Gets the Target State
+ *
+ * A transition's [[TargetState]] encapsulates the [[to]] state, the [[params]], and the [[options]] as a single object.
+ *
+ * @returns the [[TargetState]] of this Transition
+ */
+ Transition.prototype.targetState = function () {
+ return this._targetState;
+ };
+ /**
+ * Determines whether two transitions are equivalent.
+ * @deprecated
+ */
+ Transition.prototype.is = function (compare) {
+ if (compare instanceof Transition) {
+ // TODO: Also compare parameters
+ return this.is({ to: compare.$to().name, from: compare.$from().name });
+ }
+ return !((compare.to && !matchState(this.$to(), compare.to)) ||
+ (compare.from && !matchState(this.$from(), compare.from)));
+ };
+ Transition.prototype.params = function (pathname) {
+ if (pathname === void 0) { pathname = "to"; }
+ return Object.freeze(this._treeChanges[pathname].map(prop("paramValues")).reduce(mergeR, {}));
+ };
+ /**
+ * Creates a [[UIInjector]] Dependency Injector
+ *
+ * Returns a Dependency Injector for the Transition's target state (to state).
+ * The injector provides resolve values which the target state has access to.
+ *
+ * The `UIInjector` can also provide values from the native root/global injector (ng1/ng2).
+ *
+ * #### Example:
+ * ```js
+ * .onEnter({ entering: 'myState' }, trans => {
+ * var myResolveValue = trans.injector().get('myResolve');
+ * // Inject a global service from the global/native injector (if it exists)
+ * var MyService = trans.injector().get('MyService');
+ * })
+ * ```
+ *
+ * In some cases (such as `onBefore`), you may need access to some resolve data but it has not yet been fetched.
+ * You can use [[UIInjector.getAsync]] to get a promise for the data.
+ * #### Example:
+ * ```js
+ * .onBefore({}, trans => {
+ * return trans.injector().getAsync('myResolve').then(myResolveValue =>
+ * return myResolveValue !== 'ABORT';
+ * });
+ * });
+ * ```
+ *
+ * If a `state` is provided, the injector that is returned will be limited to resolve values that the provided state has access to.
+ * This can be useful if both a parent state `foo` and a child state `foo.bar` have both defined a resolve such as `data`.
+ * #### Example:
+ * ```js
+ * .onEnter({ to: 'foo.bar' }, trans => {
+ * // returns result of `foo` state's `data` resolve
+ * // even though `foo.bar` also has a `data` resolve
+ * var fooData = trans.injector('foo').get('data');
+ * });
+ * ```
+ *
+ * If you need resolve data from the exiting states, pass `'from'` as `pathName`.
+ * The resolve data from the `from` path will be returned.
+ * #### Example:
+ * ```js
+ * .onExit({ exiting: 'foo.bar' }, trans => {
+ * // Gets the resolve value of `data` from the exiting state.
+ * var fooData = trans.injector(null, 'foo.bar').get('data');
+ * });
+ * ```
+ *
+ *
+ * @param state Limits the resolves provided to only the resolves the provided state has access to.
+ * @param pathName Default: `'to'`: Chooses the path for which to create the injector. Use this to access resolves for `exiting` states.
+ *
+ * @returns a [[UIInjector]]
+ */
+ Transition.prototype.injector = function (state, pathName) {
+ if (pathName === void 0) { pathName = "to"; }
+ var path = this._treeChanges[pathName];
+ if (state)
+ path = PathUtils.subPath(path, function (node) { return node.state === state || node.state.name === state; });
+ return new ResolveContext(path).injector();
+ };
+ /**
+ * Gets all available resolve tokens (keys)
+ *
+ * This method can be used in conjunction with [[injector]] to inspect the resolve values
+ * available to the Transition.
+ *
+ * This returns all the tokens defined on [[StateDeclaration.resolve]] blocks, for the states
+ * in the Transition's [[TreeChanges.to]] path.
+ *
+ * #### Example:
+ * This example logs all resolve values
+ * ```js
+ * let tokens = trans.getResolveTokens();
+ * tokens.forEach(token => console.log(token + " = " + trans.injector().get(token)));
+ * ```
+ *
+ * #### Example:
+ * This example creates promises for each resolve value.
+ * This triggers fetches of resolves (if any have not yet been fetched).
+ * When all promises have all settled, it logs the resolve values.
+ * ```js
+ * let tokens = trans.getResolveTokens();
+ * let promise = tokens.map(token => trans.injector().getAsync(token));
+ * Promise.all(promises).then(values => console.log("Resolved values: " + values));
+ * ```
+ *
+ * Note: Angular 1 users whould use `$q.all()`
+ *
+ * @param pathname resolve context's path name (e.g., `to` or `from`)
+ *
+ * @returns an array of resolve tokens (keys)
+ */
+ Transition.prototype.getResolveTokens = function (pathname) {
+ if (pathname === void 0) { pathname = "to"; }
+ return new ResolveContext(this._treeChanges[pathname]).getTokens();
+ };
+ /**
+ * Dynamically adds a new [[Resolvable]] (i.e., [[StateDeclaration.resolve]]) to this transition.
+ *
+ * #### Example:
+ * ```js
+ * transitionService.onBefore({}, transition => {
+ * transition.addResolvable({
+ * token: 'myResolve',
+ * deps: ['MyService'],
+ * resolveFn: myService => myService.getData()
+ * });
+ * });
+ * ```
+ *
+ * @param resolvable a [[ResolvableLiteral]] object (or a [[Resolvable]])
+ * @param state the state in the "to path" which should receive the new resolve (otherwise, the root state)
+ */
+ Transition.prototype.addResolvable = function (resolvable, state) {
+ if (state === void 0) { state = ""; }
+ resolvable = is(Resolvable)(resolvable) ? resolvable : new Resolvable(resolvable);
+ var stateName = (typeof state === "string") ? state : state.name;
+ var topath = this._treeChanges.to;
+ var targetNode = find(topath, function (node) { return node.state.name === stateName; });
+ var resolveContext = new ResolveContext(topath);
+ resolveContext.addResolvables([resolvable], targetNode.state);
+ };
+ /**
+ * Gets the transition from which this transition was redirected.
+ *
+ * If the current transition is a redirect, this method returns the transition that was redirected.
+ *
+ * #### Example:
+ * ```js
+ * let transitionA = $state.go('A').transition
+ * transitionA.onStart({}, () => $state.target('B'));
+ * $transitions.onSuccess({ to: 'B' }, (trans) => {
+ * trans.to().name === 'B'; // true
+ * trans.redirectedFrom() === transitionA; // true
+ * });
+ * ```
+ *
+ * @returns The previous Transition, or null if this Transition is not the result of a redirection
+ */
+ Transition.prototype.redirectedFrom = function () {
+ return this._options.redirectedFrom || null;
+ };
+ /**
+ * Gets the original transition in a redirect chain
+ *
+ * A transition might belong to a long chain of multiple redirects.
+ * This method walks the [[redirectedFrom]] chain back to the original (first) transition in the chain.
+ *
+ * #### Example:
+ * ```js
+ * // states
+ * registry.register({ name: 'A', redirectTo: 'B' });
+ * registry.register({ name: 'B', redirectTo: 'C' });
+ * registry.register({ name: 'C', redirectTo: 'D' });
+ * registry.register({ name: 'D' });
+ *
+ * let transitionA = $state.go('A').transition
+ *
+ * $transitions.onSuccess({ to: 'D' }, (trans) => {
+ * trans.to().name === 'D'; // true
+ * trans.redirectedFrom().to().name === 'C'; // true
+ * trans.originalTransition() === transitionA; // true
+ * trans.originalTransition().to().name === 'A'; // true
+ * });
+ * ```
+ *
+ * @returns The original Transition that started a redirect chain
+ */
+ Transition.prototype.originalTransition = function () {
+ var rf = this.redirectedFrom();
+ return (rf && rf.originalTransition()) || this;
+ };
+ /**
+ * Get the transition options
+ *
+ * @returns the options for this Transition.
+ */
+ Transition.prototype.options = function () {
+ return this._options;
+ };
+ /**
+ * Gets the states being entered.
+ *
+ * @returns an array of states that will be entered during this transition.
+ */
+ Transition.prototype.entering = function () {
+ return map(this._treeChanges.entering, prop('state')).map(stateSelf);
+ };
+ /**
+ * Gets the states being exited.
+ *
+ * @returns an array of states that will be exited during this transition.
+ */
+ Transition.prototype.exiting = function () {
+ return map(this._treeChanges.exiting, prop('state')).map(stateSelf).reverse();
+ };
+ /**
+ * Gets the states being retained.
+ *
+ * @returns an array of states that are already entered from a previous Transition, that will not be
+ * exited during this Transition
+ */
+ Transition.prototype.retained = function () {
+ return map(this._treeChanges.retained, prop('state')).map(stateSelf);
+ };
+ /**
+ * Get the [[ViewConfig]]s associated with this Transition
+ *
+ * Each state can define one or more views (template/controller), which are encapsulated as `ViewConfig` objects.
+ * This method fetches the `ViewConfigs` for a given path in the Transition (e.g., "to" or "entering").
+ *
+ * @param pathname the name of the path to fetch views for:
+ * (`'to'`, `'from'`, `'entering'`, `'exiting'`, `'retained'`)
+ * @param state If provided, only returns the `ViewConfig`s for a single state in the path
+ *
+ * @returns a list of ViewConfig objects for the given path.
+ */
+ Transition.prototype.views = function (pathname, state) {
+ if (pathname === void 0) { pathname = "entering"; }
+ var path = this._treeChanges[pathname];
+ path = !state ? path : path.filter(propEq('state', state));
+ return path.map(prop("views")).filter(identity).reduce(unnestR, []);
+ };
+ Transition.prototype.treeChanges = function (pathname) {
+ return pathname ? this._treeChanges[pathname] : this._treeChanges;
+ };
+ /**
+ * Creates a new transition that is a redirection of the current one.
+ *
+ * This transition can be returned from a [[TransitionService]] hook to
+ * redirect a transition to a new state and/or set of parameters.
+ *
+ * @internalapi
+ *
+ * @returns Returns a new [[Transition]] instance.
+ */
+ Transition.prototype.redirect = function (targetState) {
+ var redirects = 1, trans = this;
+ while ((trans = trans.redirectedFrom()) != null) {
+ if (++redirects > 20)
+ throw new Error("Too many consecutive Transition redirects (20+)");
+ }
+ var redirectOpts = { redirectedFrom: this, source: "redirect" };
+ // If the original transition was caused by URL sync, then use { location: 'replace' }
+ // on the new transition (unless the target state explicitly specifies location: false).
+ // This causes the original url to be replaced with the url for the redirect target
+ // so the original url disappears from the browser history.
+ if (this.options().source === 'url' && targetState.options().location !== false) {
+ redirectOpts.location = 'replace';
+ }
+ var newOptions = extend({}, this.options(), targetState.options(), redirectOpts);
+ targetState = targetState.withOptions(newOptions, true);
+ var newTransition = this.router.transitionService.create(this._treeChanges.from, targetState);
+ var originalEnteringNodes = this._treeChanges.entering;
+ var redirectEnteringNodes = newTransition._treeChanges.entering;
+ // --- Re-use resolve data from original transition ---
+ // When redirecting from a parent state to a child state where the parent parameter values haven't changed
+ // (because of the redirect), the resolves fetched by the original transition are still valid in the
+ // redirected transition.
+ //
+ // This allows you to define a redirect on a parent state which depends on an async resolve value.
+ // You can wait for the resolve, then redirect to a child state based on the result.
+ // The redirected transition does not have to re-fetch the resolve.
+ // ---------------------------------------------------------
+ var nodeIsReloading = function (reloadState) { return function (node) {
+ return reloadState && node.state.includes[reloadState.name];
+ }; };
+ // Find any "entering" nodes in the redirect path that match the original path and aren't being reloaded
+ var matchingEnteringNodes = PathUtils.matching(redirectEnteringNodes, originalEnteringNodes, PathUtils.nonDynamicParams)
+ .filter(not(nodeIsReloading(targetState.options().reloadState)));
+ // Use the existing (possibly pre-resolved) resolvables for the matching entering nodes.
+ matchingEnteringNodes.forEach(function (node, idx) {
+ node.resolvables = originalEnteringNodes[idx].resolvables;
+ });
+ return newTransition;
+ };
+ /** @hidden If a transition doesn't exit/enter any states, returns any [[Param]] whose value changed */
+ Transition.prototype._changedParams = function () {
+ var tc = this._treeChanges;
+ /** Return undefined if it's not a "dynamic" transition, for the following reasons */
+ // If user explicitly wants a reload
+ if (this._options.reload)
+ return undefined;
+ // If any states are exiting or entering
+ if (tc.exiting.length || tc.entering.length)
+ return undefined;
+ // If to/from path lengths differ
+ if (tc.to.length !== tc.from.length)
+ return undefined;
+ // If the to/from paths are different
+ var pathsDiffer = arrayTuples(tc.to, tc.from)
+ .map(function (tuple) { return tuple[0].state !== tuple[1].state; })
+ .reduce(anyTrueR, false);
+ if (pathsDiffer)
+ return undefined;
+ // Find any parameter values that differ
+ var nodeSchemas = tc.to.map(function (node) { return node.paramSchema; });
+ var _a = [tc.to, tc.from].map(function (path) { return path.map(function (x) { return x.paramValues; }); }), toValues = _a[0], fromValues = _a[1];
+ var tuples = arrayTuples(nodeSchemas, toValues, fromValues);
+ return tuples.map(function (_a) {
+ var schema = _a[0], toVals = _a[1], fromVals = _a[2];
+ return Param.changed(schema, toVals, fromVals);
+ }).reduce(unnestR, []);
+ };
+ /**
+ * Returns true if the transition is dynamic.
+ *
+ * A transition is dynamic if no states are entered nor exited, but at least one dynamic parameter has changed.
+ *
+ * @returns true if the Transition is dynamic
+ */
+ Transition.prototype.dynamic = function () {
+ var changes = this._changedParams();
+ return !changes ? false : changes.map(function (x) { return x.dynamic; }).reduce(anyTrueR, false);
+ };
+ /**
+ * Returns true if the transition is ignored.
+ *
+ * A transition is ignored if no states are entered nor exited, and no parameter values have changed.
+ *
+ * @returns true if the Transition is ignored.
+ */
+ Transition.prototype.ignored = function () {
+ return !!this._ignoredReason();
+ };
+ /** @hidden */
+ Transition.prototype._ignoredReason = function () {
+ var pending = this.router.globals.transition;
+ var reloadState = this._options.reloadState;
+ var same = function (pathA, pathB) {
+ if (pathA.length !== pathB.length)
+ return false;
+ var matching = PathUtils.matching(pathA, pathB);
+ return pathA.length === matching.filter(function (node) { return !reloadState || !node.state.includes[reloadState.name]; }).length;
+ };
+ var newTC = this.treeChanges();
+ var pendTC = pending && pending.treeChanges();
+ if (pendTC && same(pendTC.to, newTC.to) && same(pendTC.exiting, newTC.exiting))
+ return "SameAsPending";
+ if (newTC.exiting.length === 0 && newTC.entering.length === 0 && same(newTC.from, newTC.to))
+ return "SameAsCurrent";
+ };
+ /**
+ * Runs the transition
+ *
+ * This method is generally called from the [[StateService.transitionTo]]
+ *
+ * @internalapi
+ *
+ * @returns a promise for a successful transition.
+ */
+ Transition.prototype.run = function () {
+ var _this = this;
+ var runAllHooks = TransitionHook.runAllHooks;
+ // Gets transition hooks array for the given phase
+ var getHooksFor = function (phase) {
+ return _this._hookBuilder.buildHooksForPhase(phase);
+ };
+ // When the chain is complete, then resolve or reject the deferred
+ var transitionSuccess = function () {
+ trace.traceSuccess(_this.$to(), _this);
+ _this.success = true;
+ _this._deferred.resolve(_this.to());
+ runAllHooks(getHooksFor(exports.TransitionHookPhase.SUCCESS));
+ };
+ var transitionError = function (reason) {
+ trace.traceError(reason, _this);
+ _this.success = false;
+ _this._deferred.reject(reason);
+ _this._error = reason;
+ runAllHooks(getHooksFor(exports.TransitionHookPhase.ERROR));
+ };
+ var runTransition = function () {
+ // Wait to build the RUN hook chain until the BEFORE hooks are done
+ // This allows a BEFORE hook to dynamically add additional RUN hooks via the Transition object.
+ var allRunHooks = getHooksFor(exports.TransitionHookPhase.RUN);
+ var done = function () { return services.$q.when(undefined); };
+ return TransitionHook.invokeHooks(allRunHooks, done);
+ };
+ var startTransition = function () {
+ var globals = _this.router.globals;
+ globals.lastStartedTransitionId = _this.$id;
+ globals.transition = _this;
+ globals.transitionHistory.enqueue(_this);
+ trace.traceTransitionStart(_this);
+ return services.$q.when(undefined);
+ };
+ var allBeforeHooks = getHooksFor(exports.TransitionHookPhase.BEFORE);
+ TransitionHook.invokeHooks(allBeforeHooks, startTransition)
+ .then(runTransition)
+ .then(transitionSuccess, transitionError);
+ return this.promise;
+ };
+ /**
+ * Checks if the Transition is valid
+ *
+ * @returns true if the Transition is valid
+ */
+ Transition.prototype.valid = function () {
+ return !this.error() || this.success !== undefined;
+ };
+ /**
+ * Aborts this transition
+ *
+ * Imperative API to abort a Transition.
+ * This only applies to Transitions that are not yet complete.
+ */
+ Transition.prototype.abort = function () {
+ // Do not set flag if the transition is already complete
+ if (isUndefined(this.success)) {
+ this._aborted = true;
+ }
+ };
+ /**
+ * The Transition error reason.
+ *
+ * If the transition is invalid (and could not be run), returns the reason the transition is invalid.
+ * If the transition was valid and ran, but was not successful, returns the reason the transition failed.
+ *
+ * @returns an error message explaining why the transition is invalid, or the reason the transition failed.
+ */
+ Transition.prototype.error = function () {
+ var state = this.$to();
+ if (state.self.abstract)
+ return "Cannot transition to abstract state '" + state.name + "'";
+ var paramDefs = state.parameters(), values$$1 = this.params();
+ var invalidParams = paramDefs.filter(function (param) { return !param.validates(values$$1[param.id]); });
+ if (invalidParams.length) {
+ return "Param values not valid for state '" + state.name + "'. Invalid params: [ " + invalidParams.map(function (param) { return param.id; }).join(', ') + " ]";
+ }
+ if (this.success === false)
+ return this._error;
+ };
+ /**
+ * A string representation of the Transition
+ *
+ * @returns A string representation of the Transition
+ */
+ Transition.prototype.toString = function () {
+ var fromStateOrName = this.from();
+ var toStateOrName = this.to();
+ var avoidEmptyHash = function (params) {
+ return (params["#"] !== null && params["#"] !== undefined) ? params : omit(params, ["#"]);
+ };
+ // (X) means the to state is invalid.
+ var id = this.$id, from = isObject(fromStateOrName) ? fromStateOrName.name : fromStateOrName, fromParams = stringify(avoidEmptyHash(this._treeChanges.from.map(prop('paramValues')).reduce(mergeR, {}))), toValid = this.valid() ? "" : "(X) ", to = isObject(toStateOrName) ? toStateOrName.name : toStateOrName, toParams = stringify(avoidEmptyHash(this.params()));
+ return "Transition#" + id + "( '" + from + "'" + fromParams + " -> " + toValid + "'" + to + "'" + toParams + " )";
+ };
+ /** @hidden */
+ Transition.diToken = Transition;
+ return Transition;
+}());
+
+/**
+ * Functions that manipulate strings
+ *
+ * Although these functions are exported, they are subject to change without notice.
+ *
+ * @module common_strings
+ */ /** */
+/**
+ * Returns a string shortened to a maximum length
+ *
+ * If the string is already less than the `max` length, return the string.
+ * Else return the string, shortened to `max - 3` and append three dots ("...").
+ *
+ * @param max the maximum length of the string to return
+ * @param str the input string
+ */
+function maxLength(max, str) {
+ if (str.length <= max)
+ return str;
+ return str.substr(0, max - 3) + "...";
+}
+/**
+ * Returns a string, with spaces added to the end, up to a desired str length
+ *
+ * If the string is already longer than the desired length, return the string.
+ * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.
+ *
+ * @param length the desired length of the string to return
+ * @param str the input string
+ */
+function padString(length, str) {
+ while (str.length < length)
+ str += " ";
+ return str;
+}
+function kebobString(camelCase) {
+ return camelCase
+ .replace(/^([A-Z])/, function ($1) { return $1.toLowerCase(); }) // replace first char
+ .replace(/([A-Z])/g, function ($1) { return "-" + $1.toLowerCase(); }); // replace rest
+}
+function functionToString(fn) {
+ var fnStr = fnToString(fn);
+ var namedFunctionMatch = fnStr.match(/^(function [^ ]+\([^)]*\))/);
+ var toStr = namedFunctionMatch ? namedFunctionMatch[1] : fnStr;
+ var fnName = fn['name'] || "";
+ if (fnName && toStr.match(/function \(/)) {
+ return 'function ' + fnName + toStr.substr(9);
+ }
+ return toStr;
+}
+function fnToString(fn) {
+ var _fn = isArray(fn) ? fn.slice(-1)[0] : fn;
+ return _fn && _fn.toString() || "undefined";
+}
+var stringifyPatternFn = null;
+var stringifyPattern = function (value) {
+ var isRejection = Rejection.isRejectionPromise;
+ stringifyPatternFn = stringifyPatternFn || pattern([
+ [not(isDefined), val("undefined")],
+ [isNull, val("null")],
+ [isPromise, val("[Promise]")],
+ [isRejection, function (x) { return x._transitionRejection.toString(); }],
+ [is(Rejection), invoke("toString")],
+ [is(Transition), invoke("toString")],
+ [is(Resolvable), invoke("toString")],
+ [isInjectable, functionToString],
+ [val(true), identity]
+ ]);
+ return stringifyPatternFn(value);
+};
+function stringify(o) {
+ var seen = [];
+ function format(val$$1) {
+ if (isObject(val$$1)) {
+ if (seen.indexOf(val$$1) !== -1)
+ return '[circular ref]';
+ seen.push(val$$1);
+ }
+ return stringifyPattern(val$$1);
+ }
+ return JSON.stringify(o, function (key, val$$1) { return format(val$$1); }).replace(/\\"/g, '"');
+}
+/** Returns a function that splits a string on a character or substring */
+var beforeAfterSubstr = function (char) { return function (str) {
+ if (!str)
+ return ["", ""];
+ var idx = str.indexOf(char);
+ if (idx === -1)
+ return [str, ""];
+ return [str.substr(0, idx), str.substr(idx + 1)];
+}; };
+var hostRegex = new RegExp('^(?:[a-z]+:)?//[^/]+/');
+var stripFile = function (str) { return str.replace(/\/[^/]*$/, ''); };
+var splitHash = beforeAfterSubstr("#");
+var splitQuery = beforeAfterSubstr("?");
+var splitEqual = beforeAfterSubstr("=");
+var trimHashVal = function (str) { return str ? str.replace(/^#/, "") : ""; };
+/**
+ * Splits on a delimiter, but returns the delimiters in the array
+ *
+ * #### Example:
+ * ```js
+ * var splitOnSlashes = splitOnDelim('/');
+ * splitOnSlashes("/foo"); // ["/", "foo"]
+ * splitOnSlashes("/foo/"); // ["/", "foo", "/"]
+ * ```
+ */
+function splitOnDelim(delim) {
+ var re = new RegExp("(" + delim + ")", "g");
+ return function (str) {
+ return str.split(re).filter(identity);
+ };
+}
+
+/**
+ * Reduce fn that joins neighboring strings
+ *
+ * Given an array of strings, returns a new array
+ * where all neighboring strings have been joined.
+ *
+ * #### Example:
+ * ```js
+ * let arr = ["foo", "bar", 1, "baz", "", "qux" ];
+ * arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ]
+ * ```
+ */
+function joinNeighborsR(acc, x) {
+ if (isString(tail(acc)) && isString(x))
+ return acc.slice(0, -1).concat(tail(acc) + x);
+ return pushR(acc, x);
+}
+
+/** @module common */ /** for typedoc */
+
+/**
+ * @coreapi
+ * @module params
+ */
+/** */
+/**
+ * A registry for parameter types.
+ *
+ * This registry manages the built-in (and custom) parameter types.
+ *
+ * The built-in parameter types are:
+ *
+ * - [[string]]
+ * - [[path]]
+ * - [[query]]
+ * - [[hash]]
+ * - [[int]]
+ * - [[bool]]
+ * - [[date]]
+ * - [[json]]
+ * - [[any]]
+ */
+var ParamTypes = /** @class */ (function () {
+ /** @internalapi */
+ function ParamTypes() {
+ /** @hidden */
+ this.enqueue = true;
+ /** @hidden */
+ this.typeQueue = [];
+ /** @internalapi */
+ this.defaultTypes = pick(ParamTypes.prototype, ["hash", "string", "query", "path", "int", "bool", "date", "json", "any"]);
+ // Register default types. Store them in the prototype of this.types.
+ var makeType = function (definition, name) {
+ return new ParamType(extend({ name: name }, definition));
+ };
+ this.types = inherit(map(this.defaultTypes, makeType), {});
+ }
+ /** @internalapi */
+ ParamTypes.prototype.dispose = function () {
+ this.types = {};
+ };
+ /**
+ * Registers a parameter type
+ *
+ * End users should call [[UrlMatcherFactory.type]], which delegates to this method.
+ */
+ ParamTypes.prototype.type = function (name, definition, definitionFn) {
+ if (!isDefined(definition))
+ return this.types[name];
+ if (this.types.hasOwnProperty(name))
+ throw new Error("A type named '" + name + "' has already been defined.");
+ this.types[name] = new ParamType(extend({ name: name }, definition));
+ if (definitionFn) {
+ this.typeQueue.push({ name: name, def: definitionFn });
+ if (!this.enqueue)
+ this._flushTypeQueue();
+ }
+ return this;
+ };
+ /** @internalapi */
+ ParamTypes.prototype._flushTypeQueue = function () {
+ while (this.typeQueue.length) {
+ var type = this.typeQueue.shift();
+ if (type.pattern)
+ throw new Error("You cannot override a type's .pattern at runtime.");
+ extend(this.types[type.name], services.$injector.invoke(type.def));
+ }
+ };
+ return ParamTypes;
+}());
+/** @hidden */
+function initDefaultTypes() {
+ var makeDefaultType = function (def) {
+ var valToString = function (val$$1) {
+ return val$$1 != null ? val$$1.toString() : val$$1;
+ };
+ var defaultTypeBase = {
+ encode: valToString,
+ decode: valToString,
+ is: is(String),
+ pattern: /.*/,
+ equals: function (a, b) { return a == b; },
+ };
+ return extend({}, defaultTypeBase, def);
+ };
+ // Default Parameter Type Definitions
+ extend(ParamTypes.prototype, {
+ string: makeDefaultType({}),
+ path: makeDefaultType({
+ pattern: /[^/]*/,
+ }),
+ query: makeDefaultType({}),
+ hash: makeDefaultType({
+ inherit: false,
+ }),
+ int: makeDefaultType({
+ decode: function (val$$1) { return parseInt(val$$1, 10); },
+ is: function (val$$1) {
+ return !isNullOrUndefined(val$$1) && this.decode(val$$1.toString()) === val$$1;
+ },
+ pattern: /-?\d+/,
+ }),
+ bool: makeDefaultType({
+ encode: function (val$$1) { return val$$1 && 1 || 0; },
+ decode: function (val$$1) { return parseInt(val$$1, 10) !== 0; },
+ is: is(Boolean),
+ pattern: /0|1/,
+ }),
+ date: makeDefaultType({
+ encode: function (val$$1) {
+ return !this.is(val$$1) ? undefined : [
+ val$$1.getFullYear(),
+ ('0' + (val$$1.getMonth() + 1)).slice(-2),
+ ('0' + val$$1.getDate()).slice(-2),
+ ].join("-");
+ },
+ decode: function (val$$1) {
+ if (this.is(val$$1))
+ return val$$1;
+ var match = this.capture.exec(val$$1);
+ return match ? new Date(match[1], match[2] - 1, match[3]) : undefined;
+ },
+ is: function (val$$1) { return val$$1 instanceof Date && !isNaN(val$$1.valueOf()); },
+ equals: function (l, r) {
+ return ['getFullYear', 'getMonth', 'getDate']
+ .reduce(function (acc, fn) { return acc && l[fn]() === r[fn](); }, true);
+ },
+ pattern: /[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,
+ capture: /([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/,
+ }),
+ json: makeDefaultType({
+ encode: toJson,
+ decode: fromJson,
+ is: is(Object),
+ equals: equals,
+ pattern: /[^/]*/,
+ }),
+ // does not encode/decode
+ any: makeDefaultType({
+ encode: identity,
+ decode: identity,
+ is: function () { return true; },
+ equals: equals,
+ }),
+ });
+}
+initDefaultTypes();
+
+/**
+ * @coreapi
+ * @module params
+ */
+/** */
+/** @internalapi */
+var StateParams = /** @class */ (function () {
+ function StateParams(params) {
+ if (params === void 0) { params = {}; }
+ extend(this, params);
+ }
+ /**
+ * Merges a set of parameters with all parameters inherited between the common parents of the
+ * current state and a given destination state.
+ *
+ * @param {Object} newParams The set of parameters which will be composited with inherited params.
+ * @param {Object} $current Internal definition of object representing the current state.
+ * @param {Object} $to Internal definition of object representing state to transition to.
+ */
+ StateParams.prototype.$inherit = function (newParams, $current, $to) {
+ var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = [];
+ for (var i in parents) {
+ if (!parents[i] || !parents[i].params)
+ continue;
+ parentParams = Object.keys(parents[i].params);
+ if (!parentParams.length)
+ continue;
+ for (var j in parentParams) {
+ if (inheritList.indexOf(parentParams[j]) >= 0)
+ continue;
+ inheritList.push(parentParams[j]);
+ inherited[parentParams[j]] = this[parentParams[j]];
+ }
+ }
+ return extend({}, inherited, newParams);
+ };
+
+ return StateParams;
+}());
+
+/** @module path */ /** for typedoc */
+
+/** @module resolve */ /** for typedoc */
+
+/** @module state */ /** for typedoc */
+var parseUrl = function (url) {
+ if (!isString(url))
+ return false;
+ var root$$1 = url.charAt(0) === '^';
+ return { val: root$$1 ? url.substring(1) : url, root: root$$1 };
+};
+function nameBuilder(state) {
+ return state.name;
+}
+function selfBuilder(state) {
+ state.self.$$state = function () { return state; };
+ return state.self;
+}
+function dataBuilder(state) {
+ if (state.parent && state.parent.data) {
+ state.data = state.self.data = inherit(state.parent.data, state.data);
+ }
+ return state.data;
+}
+var getUrlBuilder = function ($urlMatcherFactoryProvider, root$$1) {
+ return function urlBuilder(state) {
+ var stateDec = state;
+ // For future states, i.e., states whose name ends with `.**`,
+ // match anything that starts with the url prefix
+ if (stateDec && stateDec.url && stateDec.name && stateDec.name.match(/\.\*\*$/)) {
+ stateDec.url += "{remainder:any}"; // match any path (.*)
+ }
+ var parsed = parseUrl(stateDec.url), parent = state.parent;
+ var url = !parsed ? stateDec.url : $urlMatcherFactoryProvider.compile(parsed.val, {
+ params: state.params || {},
+ paramMap: function (paramConfig, isSearch) {
+ if (stateDec.reloadOnSearch === false && isSearch)
+ paramConfig = extend(paramConfig || {}, { dynamic: true });
+ return paramConfig;
+ }
+ });
+ if (!url)
+ return null;
+ if (!$urlMatcherFactoryProvider.isMatcher(url))
+ throw new Error("Invalid url '" + url + "' in state '" + state + "'");
+ return (parsed && parsed.root) ? url : ((parent && parent.navigable) || root$$1()).url.append(url);
+ };
+};
+var getNavigableBuilder = function (isRoot) {
+ return function navigableBuilder(state) {
+ return !isRoot(state) && state.url ? state : (state.parent ? state.parent.navigable : null);
+ };
+};
+var getParamsBuilder = function (paramFactory) {
+ return function paramsBuilder(state) {
+ var makeConfigParam = function (config, id) { return paramFactory.fromConfig(id, null, config); };
+ var urlParams = (state.url && state.url.parameters({ inherit: false })) || [];
+ var nonUrlParams = values(mapObj(omit(state.params || {}, urlParams.map(prop('id'))), makeConfigParam));
+ return urlParams.concat(nonUrlParams).map(function (p) { return [p.id, p]; }).reduce(applyPairs, {});
+ };
+};
+function pathBuilder(state) {
+ return state.parent ? state.parent.path.concat(state) : /*root*/ [state];
+}
+function includesBuilder(state) {
+ var includes = state.parent ? extend({}, state.parent.includes) : {};
+ includes[state.name] = true;
+ return includes;
+}
+/**
+ * This is a [[StateBuilder.builder]] function for the `resolve:` block on a [[StateDeclaration]].
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * validates the `resolve` property and converts it to a [[Resolvable]] array.
+ *
+ * resolve: input value can be:
+ *
+ * {
+ * // analyzed but not injected
+ * myFooResolve: function() { return "myFooData"; },
+ *
+ * // function.toString() parsed, "DependencyName" dep as string (not min-safe)
+ * myBarResolve: function(DependencyName) { return DependencyName.fetchSomethingAsPromise() },
+ *
+ * // Array split; "DependencyName" dep as string
+ * myBazResolve: [ "DependencyName", function(dep) { return dep.fetchSomethingAsPromise() },
+ *
+ * // Array split; DependencyType dep as token (compared using ===)
+ * myQuxResolve: [ DependencyType, function(dep) { return dep.fetchSometingAsPromise() },
+ *
+ * // val.$inject used as deps
+ * // where:
+ * // corgeResolve.$inject = ["DependencyName"];
+ * // function corgeResolve(dep) { dep.fetchSometingAsPromise() }
+ * // then "DependencyName" dep as string
+ * myCorgeResolve: corgeResolve,
+ *
+ * // inject service by name
+ * // When a string is found, desugar creating a resolve that injects the named service
+ * myGraultResolve: "SomeService"
+ * }
+ *
+ * or:
+ *
+ * [
+ * new Resolvable("myFooResolve", function() { return "myFooData" }),
+ * new Resolvable("myBarResolve", function(dep) { return dep.fetchSomethingAsPromise() }, [ "DependencyName" ]),
+ * { provide: "myBazResolve", useFactory: function(dep) { dep.fetchSomethingAsPromise() }, deps: [ "DependencyName" ] }
+ * ]
+ */
+function resolvablesBuilder(state) {
+ /** convert resolve: {} and resolvePolicy: {} objects to an array of tuples */
+ var objects2Tuples = function (resolveObj, resolvePolicies) {
+ return Object.keys(resolveObj || {}).map(function (token) { return ({ token: token, val: resolveObj[token], deps: undefined, policy: resolvePolicies[token] }); });
+ };
+ /** fetch DI annotations from a function or ng1-style array */
+ var annotate = function (fn) {
+ var $injector = services.$injector;
+ // ng1 doesn't have an $injector until runtime.
+ // If the $injector doesn't exist, use "deferred" literal as a
+ // marker indicating they should be annotated when runtime starts
+ return fn['$inject'] || ($injector && $injector.annotate(fn, $injector.strictDi)) || "deferred";
+ };
+ /** true if the object has both `token` and `resolveFn`, and is probably a [[ResolveLiteral]] */
+ var isResolveLiteral = function (obj) { return !!(obj.token && obj.resolveFn); };
+ /** true if the object looks like a provide literal, or a ng2 Provider */
+ var isLikeNg2Provider = function (obj) { return !!((obj.provide || obj.token) && (obj.useValue || obj.useFactory || obj.useExisting || obj.useClass)); };
+ /** true if the object looks like a tuple from obj2Tuples */
+ var isTupleFromObj = function (obj) { return !!(obj && obj.val && (isString(obj.val) || isArray(obj.val) || isFunction(obj.val))); };
+ /** extracts the token from a Provider or provide literal */
+ var token = function (p) { return p.provide || p.token; };
+ /** Given a literal resolve or provider object, returns a Resolvable */
+ var literal2Resolvable = pattern([
+ [prop('resolveFn'), function (p) { return new Resolvable(token(p), p.resolveFn, p.deps, p.policy); }],
+ [prop('useFactory'), function (p) { return new Resolvable(token(p), p.useFactory, (p.deps || p.dependencies), p.policy); }],
+ [prop('useClass'), function (p) { return new Resolvable(token(p), function () { return new p.useClass(); }, [], p.policy); }],
+ [prop('useValue'), function (p) { return new Resolvable(token(p), function () { return p.useValue; }, [], p.policy, p.useValue); }],
+ [prop('useExisting'), function (p) { return new Resolvable(token(p), identity, [p.useExisting], p.policy); }],
+ ]);
+ var tuple2Resolvable = pattern([
+ [pipe(prop("val"), isString), function (tuple) { return new Resolvable(tuple.token, identity, [tuple.val], tuple.policy); }],
+ [pipe(prop("val"), isArray), function (tuple) { return new Resolvable(tuple.token, tail(tuple.val), tuple.val.slice(0, -1), tuple.policy); }],
+ [pipe(prop("val"), isFunction), function (tuple) { return new Resolvable(tuple.token, tuple.val, annotate(tuple.val), tuple.policy); }],
+ ]);
+ var item2Resolvable = pattern([
+ [is(Resolvable), function (r) { return r; }],
+ [isResolveLiteral, literal2Resolvable],
+ [isLikeNg2Provider, literal2Resolvable],
+ [isTupleFromObj, tuple2Resolvable],
+ [val(true), function (obj) { throw new Error("Invalid resolve value: " + stringify(obj)); }]
+ ]);
+ // If resolveBlock is already an array, use it as-is.
+ // Otherwise, assume it's an object and convert to an Array of tuples
+ var decl = state.resolve;
+ var items = isArray(decl) ? decl : objects2Tuples(decl, state.resolvePolicy || {});
+ return items.map(item2Resolvable);
+}
+/**
+ * @internalapi A internal global service
+ *
+ * StateBuilder is a factory for the internal [[StateObject]] objects.
+ *
+ * When you register a state with the [[StateRegistry]], you register a plain old javascript object which
+ * conforms to the [[StateDeclaration]] interface. This factory takes that object and builds the corresponding
+ * [[StateObject]] object, which has an API and is used internally.
+ *
+ * Custom properties or API may be added to the internal [[StateObject]] object by registering a decorator function
+ * using the [[builder]] method.
+ */
+var StateBuilder = /** @class */ (function () {
+ function StateBuilder(matcher, urlMatcherFactory) {
+ this.matcher = matcher;
+ var self = this;
+ var root$$1 = function () { return matcher.find(""); };
+ var isRoot = function (state) { return state.name === ""; };
+ function parentBuilder(state) {
+ if (isRoot(state))
+ return null;
+ return matcher.find(self.parentName(state)) || root$$1();
+ }
+ this.builders = {
+ name: [nameBuilder],
+ self: [selfBuilder],
+ parent: [parentBuilder],
+ data: [dataBuilder],
+ // Build a URLMatcher if necessary, either via a relative or absolute URL
+ url: [getUrlBuilder(urlMatcherFactory, root$$1)],
+ // Keep track of the closest ancestor state that has a URL (i.e. is navigable)
+ navigable: [getNavigableBuilder(isRoot)],
+ params: [getParamsBuilder(urlMatcherFactory.paramFactory)],
+ // Each framework-specific ui-router implementation should define its own `views` builder
+ // e.g., src/ng1/statebuilders/views.ts
+ views: [],
+ // Keep a full path from the root down to this state as this is needed for state activation.
+ path: [pathBuilder],
+ // Speed up $state.includes() as it's used a lot
+ includes: [includesBuilder],
+ resolvables: [resolvablesBuilder]
+ };
+ }
+ /**
+ * Registers a [[BuilderFunction]] for a specific [[StateObject]] property (e.g., `parent`, `url`, or `path`).
+ * More than one BuilderFunction can be registered for a given property.
+ *
+ * The BuilderFunction(s) will be used to define the property on any subsequently built [[StateObject]] objects.
+ *
+ * @param name The name of the State property being registered for.
+ * @param fn The BuilderFunction which will be used to build the State property
+ * @returns a function which deregisters the BuilderFunction
+ */
+ StateBuilder.prototype.builder = function (name, fn) {
+ var builders = this.builders;
+ var array = builders[name] || [];
+ // Backwards compat: if only one builder exists, return it, else return whole arary.
+ if (isString(name) && !isDefined(fn))
+ return array.length > 1 ? array : array[0];
+ if (!isString(name) || !isFunction(fn))
+ return;
+ builders[name] = array;
+ builders[name].push(fn);
+ return function () { return builders[name].splice(builders[name].indexOf(fn, 1)) && null; };
+ };
+ /**
+ * Builds all of the properties on an essentially blank State object, returning a State object which has all its
+ * properties and API built.
+ *
+ * @param state an uninitialized State object
+ * @returns the built State object
+ */
+ StateBuilder.prototype.build = function (state) {
+ var _a = this, matcher = _a.matcher, builders = _a.builders;
+ var parent = this.parentName(state);
+ if (parent && !matcher.find(parent, undefined, false)) {
+ return null;
+ }
+ for (var key in builders) {
+ if (!builders.hasOwnProperty(key))
+ continue;
+ var chain = builders[key].reduce(function (parentFn, step) { return function (_state) { return step(_state, parentFn); }; }, noop$1);
+ state[key] = chain(state);
+ }
+ return state;
+ };
+ StateBuilder.prototype.parentName = function (state) {
+ // name = 'foo.bar.baz.**'
+ var name = state.name || "";
+ // segments = ['foo', 'bar', 'baz', '.**']
+ var segments = name.split('.');
+ // segments = ['foo', 'bar', 'baz']
+ var lastSegment = segments.pop();
+ // segments = ['foo', 'bar'] (ignore .** segment for future states)
+ if (lastSegment === '**')
+ segments.pop();
+ if (segments.length) {
+ if (state.parent) {
+ throw new Error("States that specify the 'parent:' property should not have a '.' in their name (" + name + ")");
+ }
+ // 'foo.bar'
+ return segments.join(".");
+ }
+ if (!state.parent)
+ return "";
+ return isString(state.parent) ? state.parent : state.parent.name;
+ };
+ StateBuilder.prototype.name = function (state) {
+ var name = state.name;
+ if (name.indexOf('.') !== -1 || !state.parent)
+ return name;
+ var parentName = isString(state.parent) ? state.parent : state.parent.name;
+ return parentName ? parentName + "." + name : name;
+ };
+ return StateBuilder;
+}());
+
+/** @module state */ /** for typedoc */
+var StateMatcher = /** @class */ (function () {
+ function StateMatcher(_states) {
+ this._states = _states;
+ }
+ StateMatcher.prototype.isRelative = function (stateName) {
+ stateName = stateName || "";
+ return stateName.indexOf(".") === 0 || stateName.indexOf("^") === 0;
+ };
+ StateMatcher.prototype.find = function (stateOrName, base, matchGlob) {
+ if (matchGlob === void 0) { matchGlob = true; }
+ if (!stateOrName && stateOrName !== "")
+ return undefined;
+ var isStr = isString(stateOrName);
+ var name = isStr ? stateOrName : stateOrName.name;
+ if (this.isRelative(name))
+ name = this.resolvePath(name, base);
+ var state = this._states[name];
+ if (state && (isStr || (!isStr && (state === stateOrName || state.self === stateOrName)))) {
+ return state;
+ }
+ else if (isStr && matchGlob) {
+ var _states = values(this._states);
+ var matches = _states.filter(function (state) {
+ return state.__stateObjectCache.nameGlob &&
+ state.__stateObjectCache.nameGlob.matches(name);
+ });
+ if (matches.length > 1) {
+ console.log("stateMatcher.find: Found multiple matches for " + name + " using glob: ", matches.map(function (match) { return match.name; }));
+ }
+ return matches[0];
+ }
+ return undefined;
+ };
+ StateMatcher.prototype.resolvePath = function (name, base) {
+ if (!base)
+ throw new Error("No reference point given for path '" + name + "'");
+ var baseState = this.find(base);
+ var splitName = name.split("."), i = 0, pathLength = splitName.length, current = baseState;
+ for (; i < pathLength; i++) {
+ if (splitName[i] === "" && i === 0) {
+ current = baseState;
+ continue;
+ }
+ if (splitName[i] === "^") {
+ if (!current.parent)
+ throw new Error("Path '" + name + "' not valid for state '" + baseState.name + "'");
+ current = current.parent;
+ continue;
+ }
+ break;
+ }
+ var relName = splitName.slice(i).join(".");
+ return current.name + (current.name && relName ? "." : "") + relName;
+ };
+ return StateMatcher;
+}());
+
+/** @module state */ /** for typedoc */
+/** @internalapi */
+var StateQueueManager = /** @class */ (function () {
+ function StateQueueManager($registry, $urlRouter, states, builder, listeners) {
+ this.$registry = $registry;
+ this.$urlRouter = $urlRouter;
+ this.states = states;
+ this.builder = builder;
+ this.listeners = listeners;
+ this.queue = [];
+ this.matcher = $registry.matcher;
+ }
+ /** @internalapi */
+ StateQueueManager.prototype.dispose = function () {
+ this.queue = [];
+ };
+ StateQueueManager.prototype.register = function (stateDecl) {
+ var queue = this.queue;
+ var state = StateObject.create(stateDecl);
+ var name = state.name;
+ if (!isString(name))
+ throw new Error("State must have a valid name");
+ if (this.states.hasOwnProperty(name) || inArray(queue.map(prop('name')), name))
+ throw new Error("State '" + name + "' is already defined");
+ queue.push(state);
+ this.flush();
+ return state;
+ };
+ StateQueueManager.prototype.flush = function () {
+ var _this = this;
+ var _a = this, queue = _a.queue, states = _a.states, builder = _a.builder;
+ var registered = [], // states that got registered
+ orphans = [], // states that don't yet have a parent registered
+ previousQueueLength = {}; // keep track of how long the queue when an orphan was first encountered
+ var getState = function (name) {
+ return _this.states.hasOwnProperty(name) && _this.states[name];
+ };
+ while (queue.length > 0) {
+ var state = queue.shift();
+ var name_1 = state.name;
+ var result = builder.build(state);
+ var orphanIdx = orphans.indexOf(state);
+ if (result) {
+ var existingState = getState(name_1);
+ if (existingState && existingState.name === name_1) {
+ throw new Error("State '" + name_1 + "' is already defined");
+ }
+ var existingFutureState = getState(name_1 + ".**");
+ if (existingFutureState) {
+ // Remove future state of the same name
+ this.$registry.deregister(existingFutureState);
+ }
+ states[name_1] = state;
+ this.attachRoute(state);
+ if (orphanIdx >= 0)
+ orphans.splice(orphanIdx, 1);
+ registered.push(state);
+ continue;
+ }
+ var prev = previousQueueLength[name_1];
+ previousQueueLength[name_1] = queue.length;
+ if (orphanIdx >= 0 && prev === queue.length) {
+ // Wait until two consecutive iterations where no additional states were dequeued successfully.
+ // throw new Error(`Cannot register orphaned state '${name}'`);
+ queue.push(state);
+ return states;
+ }
+ else if (orphanIdx < 0) {
+ orphans.push(state);
+ }
+ queue.push(state);
+ }
+ if (registered.length) {
+ this.listeners.forEach(function (listener) { return listener("registered", registered.map(function (s) { return s.self; })); });
+ }
+ return states;
+ };
+ StateQueueManager.prototype.attachRoute = function (state) {
+ if (state.abstract || !state.url)
+ return;
+ this.$urlRouter.rule(this.$urlRouter.urlRuleFactory.create(state));
+ };
+ return StateQueueManager;
+}());
+
+/**
+ * @coreapi
+ * @module state
+ */ /** for typedoc */
+var StateRegistry = /** @class */ (function () {
+ /** @internalapi */
+ function StateRegistry(_router) {
+ this._router = _router;
+ this.states = {};
+ this.listeners = [];
+ this.matcher = new StateMatcher(this.states);
+ this.builder = new StateBuilder(this.matcher, _router.urlMatcherFactory);
+ this.stateQueue = new StateQueueManager(this, _router.urlRouter, this.states, this.builder, this.listeners);
+ this._registerRoot();
+ }
+ /** @internalapi */
+ StateRegistry.prototype._registerRoot = function () {
+ var rootStateDef = {
+ name: '',
+ url: '^',
+ views: null,
+ params: {
+ '#': { value: null, type: 'hash', dynamic: true }
+ },
+ abstract: true
+ };
+ var _root = this._root = this.stateQueue.register(rootStateDef);
+ _root.navigable = null;
+ };
+ /** @internalapi */
+ StateRegistry.prototype.dispose = function () {
+ var _this = this;
+ this.stateQueue.dispose();
+ this.listeners = [];
+ this.get().forEach(function (state) { return _this.get(state) && _this.deregister(state); });
+ };
+ /**
+ * Listen for a State Registry events
+ *
+ * Adds a callback that is invoked when states are registered or deregistered with the StateRegistry.
+ *
+ * #### Example:
+ * ```js
+ * let allStates = registry.get();
+ *
+ * // Later, invoke deregisterFn() to remove the listener
+ * let deregisterFn = registry.onStatesChanged((event, states) => {
+ * switch(event) {
+ * case: 'registered':
+ * states.forEach(state => allStates.push(state));
+ * break;
+ * case: 'deregistered':
+ * states.forEach(state => {
+ * let idx = allStates.indexOf(state);
+ * if (idx !== -1) allStates.splice(idx, 1);
+ * });
+ * break;
+ * }
+ * });
+ * ```
+ *
+ * @param listener a callback function invoked when the registered states changes.
+ * The function receives two parameters, `event` and `state`.
+ * See [[StateRegistryListener]]
+ * @return a function that deregisters the listener
+ */
+ StateRegistry.prototype.onStatesChanged = function (listener) {
+ this.listeners.push(listener);
+ return function deregisterListener() {
+ removeFrom(this.listeners)(listener);
+ }.bind(this);
+ };
+ /**
+ * Gets the implicit root state
+ *
+ * Gets the root of the state tree.
+ * The root state is implicitly created by UI-Router.
+ * Note: this returns the internal [[StateObject]] representation, not a [[StateDeclaration]]
+ *
+ * @return the root [[StateObject]]
+ */
+ StateRegistry.prototype.root = function () {
+ return this._root;
+ };
+ /**
+ * Adds a state to the registry
+ *
+ * Registers a [[StateDeclaration]] or queues it for registration.
+ *
+ * Note: a state will be queued if the state's parent isn't yet registered.
+ *
+ * @param stateDefinition the definition of the state to register.
+ * @returns the internal [[StateObject]] object.
+ * If the state was successfully registered, then the object is fully built (See: [[StateBuilder]]).
+ * If the state was only queued, then the object is not fully built.
+ */
+ StateRegistry.prototype.register = function (stateDefinition) {
+ return this.stateQueue.register(stateDefinition);
+ };
+ /** @hidden */
+ StateRegistry.prototype._deregisterTree = function (state) {
+ var _this = this;
+ var all$$1 = this.get().map(function (s) { return s.$$state(); });
+ var getChildren = function (states) {
+ var children = all$$1.filter(function (s) { return states.indexOf(s.parent) !== -1; });
+ return children.length === 0 ? children : children.concat(getChildren(children));
+ };
+ var children = getChildren([state]);
+ var deregistered = [state].concat(children).reverse();
+ deregistered.forEach(function (state) {
+ var $ur = _this._router.urlRouter;
+ // Remove URL rule
+ $ur.rules().filter(propEq("state", state)).forEach($ur.removeRule.bind($ur));
+ // Remove state from registry
+ delete _this.states[state.name];
+ });
+ return deregistered;
+ };
+ /**
+ * Removes a state from the registry
+ *
+ * This removes a state from the registry.
+ * If the state has children, they are are also removed from the registry.
+ *
+ * @param stateOrName the state's name or object representation
+ * @returns {StateObject[]} a list of removed states
+ */
+ StateRegistry.prototype.deregister = function (stateOrName) {
+ var _state = this.get(stateOrName);
+ if (!_state)
+ throw new Error("Can't deregister state; not found: " + stateOrName);
+ var deregisteredStates = this._deregisterTree(_state.$$state());
+ this.listeners.forEach(function (listener) { return listener("deregistered", deregisteredStates.map(function (s) { return s.self; })); });
+ return deregisteredStates;
+ };
+ StateRegistry.prototype.get = function (stateOrName, base) {
+ var _this = this;
+ if (arguments.length === 0)
+ return Object.keys(this.states).map(function (name) { return _this.states[name].self; });
+ var found = this.matcher.find(stateOrName, base);
+ return found && found.self || null;
+ };
+ StateRegistry.prototype.decorator = function (name, func) {
+ return this.builder.builder(name, func);
+ };
+ return StateRegistry;
+}());
+
+/**
+ * @coreapi
+ * @module url
+ */
+/** for typedoc */
+/** @hidden */
+function quoteRegExp(string, param) {
+ var surroundPattern = ['', ''], result = string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&");
+ if (!param)
+ return result;
+ switch (param.squash) {
+ case false:
+ surroundPattern = ['(', ')' + (param.isOptional ? '?' : '')];
+ break;
+ case true:
+ result = result.replace(/\/$/, '');
+ surroundPattern = ['(?:\/(', ')|\/)?'];
+ break;
+ default:
+ surroundPattern = ["(" + param.squash + "|", ')?'];
+ break;
+ }
+ return result + surroundPattern[0] + param.type.pattern.source + surroundPattern[1];
+}
+/** @hidden */
+var memoizeTo = function (obj, prop$$1, fn) {
+ return obj[prop$$1] = obj[prop$$1] || fn();
+};
+/** @hidden */
+var splitOnSlash = splitOnDelim('/');
+/**
+ * Matches URLs against patterns.
+ *
+ * Matches URLs against patterns and extracts named parameters from the path or the search
+ * part of the URL.
+ *
+ * A URL pattern consists of a path pattern, optionally followed by '?' and a list of search (query)
+ * parameters. Multiple search parameter names are separated by '&'. Search parameters
+ * do not influence whether or not a URL is matched, but their values are passed through into
+ * the matched parameters returned by [[UrlMatcher.exec]].
+ *
+ * - *Path parameters* are defined using curly brace placeholders (`/somepath/{param}`)
+ * or colon placeholders (`/somePath/:param`).
+ *
+ * - *A parameter RegExp* may be defined for a param after a colon
+ * (`/somePath/{param:[a-zA-Z0-9]+}`) in a curly brace placeholder.
+ * The regexp must match for the url to be matched.
+ * Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.
+ *
+ * Note: a RegExp parameter will encode its value using either [[ParamTypes.path]] or [[ParamTypes.query]].
+ *
+ * - *Custom parameter types* may also be specified after a colon (`/somePath/{param:int}`) in curly brace parameters.
+ * See [[UrlMatcherFactory.type]] for more information.
+ *
+ * - *Catch-all parameters* are defined using an asterisk placeholder (`/somepath/*catchallparam`).
+ * A catch-all * parameter value will contain the remainder of the URL.
+ *
+ * ---
+ *
+ * Parameter names may contain only word characters (latin letters, digits, and underscore) and
+ * must be unique within the pattern (across both path and search parameters).
+ * A path parameter matches any number of characters other than '/'. For catch-all
+ * placeholders the path parameter matches any number of characters.
+ *
+ * Examples:
+ *
+ * * `'/hello/'` - Matches only if the path is exactly '/hello/'. There is no special treatment for
+ * trailing slashes, and patterns have to match the entire path, not just a prefix.
+ * * `'/user/:id'` - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or
+ * '/user/bob/details'. The second path segment will be captured as the parameter 'id'.
+ * * `'/user/{id}'` - Same as the previous example, but using curly brace syntax.
+ * * `'/user/{id:[^/]*}'` - Same as the previous example.
+ * * `'/user/{id:[0-9a-fA-F]{1,8}}'` - Similar to the previous example, but only matches if the id
+ * parameter consists of 1 to 8 hex digits.
+ * * `'/files/{path:.*}'` - Matches any URL starting with '/files/' and captures the rest of the
+ * path into the parameter 'path'.
+ * * `'/files/*path'` - ditto.
+ * * `'/calendar/{start:date}'` - Matches "/calendar/2014-11-12" (because the pattern defined
+ * in the built-in `date` ParamType matches `2014-11-12`) and provides a Date object in $stateParams.start
+ *
+ */
+var UrlMatcher = /** @class */ (function () {
+ /**
+ * @param pattern The pattern to compile into a matcher.
+ * @param paramTypes The [[ParamTypes]] registry
+ * @param config A configuration object
+ * - `caseInsensitive` - `true` if URL matching should be case insensitive, otherwise `false`, the default value (for backward compatibility) is `false`.
+ * - `strict` - `false` if matching against a URL with a trailing slash should be treated as equivalent to a URL without a trailing slash, the default value is `true`.
+ */
+ function UrlMatcher(pattern$$1, paramTypes, paramFactory, config) {
+ var _this = this;
+ this.config = config;
+ /** @hidden */
+ this._cache = { path: [this] };
+ /** @hidden */
+ this._children = [];
+ /** @hidden */
+ this._params = [];
+ /** @hidden */
+ this._segments = [];
+ /** @hidden */
+ this._compiled = [];
+ this.pattern = pattern$$1;
+ this.config = defaults(this.config, {
+ params: {},
+ strict: true,
+ caseInsensitive: false,
+ paramMap: identity
+ });
+ // Find all placeholders and create a compiled pattern, using either classic or curly syntax:
+ // '*' name
+ // ':' name
+ // '{' name '}'
+ // '{' name ':' regexp '}'
+ // The regular expression is somewhat complicated due to the need to allow curly braces
+ // inside the regular expression. The placeholder regexp breaks down as follows:
+ // ([:*])([\w\[\]]+) - classic placeholder ($1 / $2) (search version has - for snake-case)
+ // \{([\w\[\]]+)(?:\:\s*( ... ))?\} - curly brace placeholder ($3) with optional regexp/type ... ($4) (search version has - for snake-case
+ // (?: ... | ... | ... )+ - the regexp consists of any number of atoms, an atom being either
+ // [^{}\\]+ - anything other than curly braces or backslash
+ // \\. - a backslash escape
+ // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms
+ var placeholder = /([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, searchPlaceholder = /([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, last = 0, m, patterns = [];
+ var checkParamErrors = function (id) {
+ if (!UrlMatcher.nameValidator.test(id))
+ throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern$$1 + "'");
+ if (find(_this._params, propEq('id', id)))
+ throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern$$1 + "'");
+ };
+ // Split into static segments separated by path parameter placeholders.
+ // The number of segments is always 1 more than the number of parameters.
+ var matchDetails = function (m, isSearch) {
+ // IE[78] returns '' for unmatched groups instead of null
+ var id = m[2] || m[3];
+ var regexp = isSearch ? m[4] : m[4] || (m[1] === '*' ? '[\\s\\S]*' : null);
+ var makeRegexpType = function (regexp) { return inherit(paramTypes.type(isSearch ? "query" : "path"), {
+ pattern: new RegExp(regexp, _this.config.caseInsensitive ? 'i' : undefined)
+ }); };
+ return {
+ id: id,
+ regexp: regexp,
+ cfg: _this.config.params[id],
+ segment: pattern$$1.substring(last, m.index),
+ type: !regexp ? null : paramTypes.type(regexp) || makeRegexpType(regexp)
+ };
+ };
+ var p, segment;
+ while ((m = placeholder.exec(pattern$$1))) {
+ p = matchDetails(m, false);
+ if (p.segment.indexOf('?') >= 0)
+ break; // we're into the search part
+ checkParamErrors(p.id);
+ this._params.push(paramFactory.fromPath(p.id, p.type, this.config.paramMap(p.cfg, false)));
+ this._segments.push(p.segment);
+ patterns.push([p.segment, tail(this._params)]);
+ last = placeholder.lastIndex;
+ }
+ segment = pattern$$1.substring(last);
+ // Find any search parameter names and remove them from the last segment
+ var i = segment.indexOf('?');
+ if (i >= 0) {
+ var search = segment.substring(i);
+ segment = segment.substring(0, i);
+ if (search.length > 0) {
+ last = 0;
+ while ((m = searchPlaceholder.exec(search))) {
+ p = matchDetails(m, true);
+ checkParamErrors(p.id);
+ this._params.push(paramFactory.fromSearch(p.id, p.type, this.config.paramMap(p.cfg, true)));
+ last = placeholder.lastIndex;
+ // check if ?&
+ }
+ }
+ }
+ this._segments.push(segment);
+ this._compiled = patterns.map(function (pattern$$1) { return quoteRegExp.apply(null, pattern$$1); }).concat(quoteRegExp(segment));
+ }
+ /**
+ * Creates a new concatenated UrlMatcher
+ *
+ * Builds a new UrlMatcher by appending another UrlMatcher to this one.
+ *
+ * @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.
+ */
+ UrlMatcher.prototype.append = function (url) {
+ this._children.push(url);
+ url._cache = {
+ path: this._cache.path.concat(url),
+ parent: this,
+ pattern: null,
+ };
+ return url;
+ };
+ /** @hidden */
+ UrlMatcher.prototype.isRoot = function () {
+ return this._cache.path[0] === this;
+ };
+ /** Returns the input pattern string */
+ UrlMatcher.prototype.toString = function () {
+ return this.pattern;
+ };
+ /**
+ * Tests the specified url/path against this matcher.
+ *
+ * Tests if the given url matches this matcher's pattern, and returns an object containing the captured
+ * parameter values. Returns null if the path does not match.
+ *
+ * The returned object contains the values
+ * of any search parameters that are mentioned in the pattern, but their value may be null if
+ * they are not present in `search`. This means that search parameters are always treated
+ * as optional.
+ *
+ * #### Example:
+ * ```js
+ * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
+ * x: '1', q: 'hello'
+ * });
+ * // returns { id: 'bob', q: 'hello', r: null }
+ * ```
+ *
+ * @param path The URL path to match, e.g. `$location.path()`.
+ * @param search URL search parameters, e.g. `$location.search()`.
+ * @param hash URL hash e.g. `$location.hash()`.
+ * @param options
+ *
+ * @returns The captured parameter values.
+ */
+ UrlMatcher.prototype.exec = function (path, search, hash, options) {
+ var _this = this;
+ if (search === void 0) { search = {}; }
+ if (options === void 0) { options = {}; }
+ var match = memoizeTo(this._cache, 'pattern', function () {
+ return new RegExp([
+ '^',
+ unnest(_this._cache.path.map(prop('_compiled'))).join(''),
+ _this.config.strict === false ? '\/?' : '',
+ '$'
+ ].join(''), _this.config.caseInsensitive ? 'i' : undefined);
+ }).exec(path);
+ if (!match)
+ return null;
+ //options = defaults(options, { isolate: false });
+ var allParams = this.parameters(), pathParams = allParams.filter(function (param) { return !param.isSearch(); }), searchParams = allParams.filter(function (param) { return param.isSearch(); }), nPathSegments = this._cache.path.map(function (urlm) { return urlm._segments.length - 1; }).reduce(function (a, x) { return a + x; }), values$$1 = {};
+ if (nPathSegments !== match.length - 1)
+ throw new Error("Unbalanced capture group in route '" + this.pattern + "'");
+ function decodePathArray(string) {
+ var reverseString = function (str) { return str.split("").reverse().join(""); };
+ var unquoteDashes = function (str) { return str.replace(/\\-/g, "-"); };
+ var split = reverseString(string).split(/-(?!\\)/);
+ var allReversed = map(split, reverseString);
+ return map(allReversed, unquoteDashes).reverse();
+ }
+ for (var i = 0; i < nPathSegments; i++) {
+ var param = pathParams[i];
+ var value = match[i + 1];
+ // if the param value matches a pre-replace pair, replace the value before decoding.
+ for (var j = 0; j < param.replace.length; j++) {
+ if (param.replace[j].from === value)
+ value = param.replace[j].to;
+ }
+ if (value && param.array === true)
+ value = decodePathArray(value);
+ if (isDefined(value))
+ value = param.type.decode(value);
+ values$$1[param.id] = param.value(value);
+ }
+ searchParams.forEach(function (param) {
+ var value = search[param.id];
+ for (var j = 0; j < param.replace.length; j++) {
+ if (param.replace[j].from === value)
+ value = param.replace[j].to;
+ }
+ if (isDefined(value))
+ value = param.type.decode(value);
+ values$$1[param.id] = param.value(value);
+ });
+ if (hash)
+ values$$1["#"] = hash;
+ return values$$1;
+ };
+ /**
+ * @hidden
+ * Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.
+ *
+ * @returns {Array.} An array of [[Param]] objects. Must be treated as read-only. If the
+ * pattern has no parameters, an empty array is returned.
+ */
+ UrlMatcher.prototype.parameters = function (opts) {
+ if (opts === void 0) { opts = {}; }
+ if (opts.inherit === false)
+ return this._params;
+ return unnest(this._cache.path.map(function (matcher) { return matcher._params; }));
+ };
+ /**
+ * @hidden
+ * Returns a single parameter from this UrlMatcher by id
+ *
+ * @param id
+ * @param opts
+ * @returns {T|Param|any|boolean|UrlMatcher|null}
+ */
+ UrlMatcher.prototype.parameter = function (id, opts) {
+ var _this = this;
+ if (opts === void 0) { opts = {}; }
+ var findParam = function () {
+ for (var _i = 0, _a = _this._params; _i < _a.length; _i++) {
+ var param = _a[_i];
+ if (param.id === id)
+ return param;
+ }
+ };
+ var parent = this._cache.parent;
+ return findParam() || (opts.inherit !== false && parent && parent.parameter(id, opts)) || null;
+ };
+ /**
+ * Validates the input parameter values against this UrlMatcher
+ *
+ * Checks an object hash of parameters to validate their correctness according to the parameter
+ * types of this `UrlMatcher`.
+ *
+ * @param params The object hash of parameters to validate.
+ * @returns Returns `true` if `params` validates, otherwise `false`.
+ */
+ UrlMatcher.prototype.validates = function (params) {
+ var validParamVal = function (param, val$$1) {
+ return !param || param.validates(val$$1);
+ };
+ params = params || {};
+ // I'm not sure why this checks only the param keys passed in, and not all the params known to the matcher
+ var paramSchema = this.parameters().filter(function (paramDef) { return params.hasOwnProperty(paramDef.id); });
+ return paramSchema.map(function (paramDef) { return validParamVal(paramDef, params[paramDef.id]); }).reduce(allTrueR, true);
+ };
+ /**
+ * Given a set of parameter values, creates a URL from this UrlMatcher.
+ *
+ * Creates a URL that matches this pattern by substituting the specified values
+ * for the path and search parameters.
+ *
+ * #### Example:
+ * ```js
+ * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
+ * // returns '/user/bob?q=yes'
+ * ```
+ *
+ * @param values the values to substitute for the parameters in this pattern.
+ * @returns the formatted URL (path and optionally search part).
+ */
+ UrlMatcher.prototype.format = function (values$$1) {
+ if (values$$1 === void 0) { values$$1 = {}; }
+ // Build the full path of UrlMatchers (including all parent UrlMatchers)
+ var urlMatchers = this._cache.path;
+ // Extract all the static segments and Params (processed as ParamDetails)
+ // into an ordered array
+ var pathSegmentsAndParams = urlMatchers.map(UrlMatcher.pathSegmentsAndParams)
+ .reduce(unnestR, [])
+ .map(function (x) { return isString(x) ? x : getDetails(x); });
+ // Extract the query params into a separate array
+ var queryParams = urlMatchers.map(UrlMatcher.queryParams)
+ .reduce(unnestR, [])
+ .map(getDetails);
+ var isInvalid = function (param) { return param.isValid === false; };
+ if (pathSegmentsAndParams.concat(queryParams).filter(isInvalid).length) {
+ return null;
+ }
+ /**
+ * Given a Param, applies the parameter value, then returns detailed information about it
+ */
+ function getDetails(param) {
+ // Normalize to typed value
+ var value = param.value(values$$1[param.id]);
+ var isValid = param.validates(value);
+ var isDefaultValue = param.isDefaultValue(value);
+ // Check if we're in squash mode for the parameter
+ var squash = isDefaultValue ? param.squash : false;
+ // Allow the Parameter's Type to encode the value
+ var encoded = param.type.encode(value);
+ return { param: param, value: value, isValid: isValid, isDefaultValue: isDefaultValue, squash: squash, encoded: encoded };
+ }
+ // Build up the path-portion from the list of static segments and parameters
+ var pathString = pathSegmentsAndParams.reduce(function (acc, x) {
+ // The element is a static segment (a raw string); just append it
+ if (isString(x))
+ return acc + x;
+ // Otherwise, it's a ParamDetails.
+ var squash = x.squash, encoded = x.encoded, param = x.param;
+ // If squash is === true, try to remove a slash from the path
+ if (squash === true)
+ return (acc.match(/\/$/)) ? acc.slice(0, -1) : acc;
+ // If squash is a string, use the string for the param value
+ if (isString(squash))
+ return acc + squash;
+ if (squash !== false)
+ return acc; // ?
+ if (encoded == null)
+ return acc;
+ // If this parameter value is an array, encode the value using encodeDashes
+ if (isArray(encoded))
+ return acc + map(encoded, UrlMatcher.encodeDashes).join("-");
+ // If the parameter type is "raw", then do not encodeURIComponent
+ if (param.raw)
+ return acc + encoded;
+ // Encode the value
+ return acc + encodeURIComponent(encoded);
+ }, "");
+ // Build the query string by applying parameter values (array or regular)
+ // then mapping to key=value, then flattening and joining using "&"
+ var queryString = queryParams.map(function (paramDetails) {
+ var param = paramDetails.param, squash = paramDetails.squash, encoded = paramDetails.encoded, isDefaultValue = paramDetails.isDefaultValue;
+ if (encoded == null || (isDefaultValue && squash !== false))
+ return;
+ if (!isArray(encoded))
+ encoded = [encoded];
+ if (encoded.length === 0)
+ return;
+ if (!param.raw)
+ encoded = map(encoded, encodeURIComponent);
+ return encoded.map(function (val$$1) { return param.id + "=" + val$$1; });
+ }).filter(identity).reduce(unnestR, []).join("&");
+ // Concat the pathstring with the queryString (if exists) and the hashString (if exists)
+ return pathString + (queryString ? "?" + queryString : "") + (values$$1["#"] ? "#" + values$$1["#"] : "");
+ };
+ /** @hidden */
+ UrlMatcher.encodeDashes = function (str) {
+ return encodeURIComponent(str).replace(/-/g, function (c) { return "%5C%" + c.charCodeAt(0).toString(16).toUpperCase(); });
+ };
+ /** @hidden Given a matcher, return an array with the matcher's path segments and path params, in order */
+ UrlMatcher.pathSegmentsAndParams = function (matcher) {
+ var staticSegments = matcher._segments;
+ var pathParams = matcher._params.filter(function (p) { return p.location === exports.DefType.PATH; });
+ return arrayTuples(staticSegments, pathParams.concat(undefined))
+ .reduce(unnestR, [])
+ .filter(function (x) { return x !== "" && isDefined(x); });
+ };
+ /** @hidden Given a matcher, return an array with the matcher's query params */
+ UrlMatcher.queryParams = function (matcher) {
+ return matcher._params.filter(function (p) { return p.location === exports.DefType.SEARCH; });
+ };
+ /**
+ * Compare two UrlMatchers
+ *
+ * This comparison function converts a UrlMatcher into static and dynamic path segments.
+ * Each static path segment is a static string between a path separator (slash character).
+ * Each dynamic segment is a path parameter.
+ *
+ * The comparison function sorts static segments before dynamic ones.
+ */
+ UrlMatcher.compare = function (a, b) {
+ /**
+ * Turn a UrlMatcher and all its parent matchers into an array
+ * of slash literals '/', string literals, and Param objects
+ *
+ * This example matcher matches strings like "/foo/:param/tail":
+ * var matcher = $umf.compile("/foo").append($umf.compile("/:param")).append($umf.compile("/")).append($umf.compile("tail"));
+ * var result = segments(matcher); // [ '/', 'foo', '/', Param, '/', 'tail' ]
+ *
+ * Caches the result as `matcher._cache.segments`
+ */
+ var segments = function (matcher) {
+ return matcher._cache.segments = matcher._cache.segments ||
+ matcher._cache.path.map(UrlMatcher.pathSegmentsAndParams)
+ .reduce(unnestR, [])
+ .reduce(joinNeighborsR, [])
+ .map(function (x) { return isString(x) ? splitOnSlash(x) : x; })
+ .reduce(unnestR, []);
+ };
+ /**
+ * Gets the sort weight for each segment of a UrlMatcher
+ *
+ * Caches the result as `matcher._cache.weights`
+ */
+ var weights = function (matcher) {
+ return matcher._cache.weights = matcher._cache.weights ||
+ segments(matcher).map(function (segment) {
+ // Sort slashes first, then static strings, the Params
+ if (segment === '/')
+ return 1;
+ if (isString(segment))
+ return 2;
+ if (segment instanceof Param)
+ return 3;
+ });
+ };
+ /**
+ * Pads shorter array in-place (mutates)
+ */
+ var padArrays = function (l, r, padVal) {
+ var len = Math.max(l.length, r.length);
+ while (l.length < len)
+ l.push(padVal);
+ while (r.length < len)
+ r.push(padVal);
+ };
+ var weightsA = weights(a), weightsB = weights(b);
+ padArrays(weightsA, weightsB, 0);
+ var cmp, i, pairs$$1 = arrayTuples(weightsA, weightsB);
+ for (i = 0; i < pairs$$1.length; i++) {
+ cmp = pairs$$1[i][0] - pairs$$1[i][1];
+ if (cmp !== 0)
+ return cmp;
+ }
+ return 0;
+ };
+ /** @hidden */
+ UrlMatcher.nameValidator = /^\w+([-.]+\w+)*(?:\[\])?$/;
+ return UrlMatcher;
+}());
+
+/**
+ * @internalapi
+ * @module url
+ */ /** for typedoc */
+/**
+ * Factory for [[UrlMatcher]] instances.
+ *
+ * The factory is available to ng1 services as
+ * `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.
+ */
+var UrlMatcherFactory = /** @class */ (function () {
+ function UrlMatcherFactory() {
+ var _this = this;
+ /** @hidden */ this.paramTypes = new ParamTypes();
+ /** @hidden */ this._isCaseInsensitive = false;
+ /** @hidden */ this._isStrictMode = true;
+ /** @hidden */ this._defaultSquashPolicy = false;
+ /** @hidden */
+ this._getConfig = function (config) {
+ return extend({ strict: _this._isStrictMode, caseInsensitive: _this._isCaseInsensitive }, config);
+ };
+ /** @internalapi Creates a new [[Param]] for a given location (DefType) */
+ this.paramFactory = {
+ /** Creates a new [[Param]] from a CONFIG block */
+ fromConfig: function (id, type, config) {
+ return new Param(id, type, config, exports.DefType.CONFIG, _this);
+ },
+ /** Creates a new [[Param]] from a url PATH */
+ fromPath: function (id, type, config) {
+ return new Param(id, type, config, exports.DefType.PATH, _this);
+ },
+ /** Creates a new [[Param]] from a url SEARCH */
+ fromSearch: function (id, type, config) {
+ return new Param(id, type, config, exports.DefType.SEARCH, _this);
+ },
+ };
+ extend(this, { UrlMatcher: UrlMatcher, Param: Param });
+ }
+ /** @inheritdoc */
+ UrlMatcherFactory.prototype.caseInsensitive = function (value) {
+ return this._isCaseInsensitive = isDefined(value) ? value : this._isCaseInsensitive;
+ };
+ /** @inheritdoc */
+ UrlMatcherFactory.prototype.strictMode = function (value) {
+ return this._isStrictMode = isDefined(value) ? value : this._isStrictMode;
+ };
+ /** @inheritdoc */
+ UrlMatcherFactory.prototype.defaultSquashPolicy = function (value) {
+ if (isDefined(value) && value !== true && value !== false && !isString(value))
+ throw new Error("Invalid squash policy: " + value + ". Valid policies: false, true, arbitrary-string");
+ return this._defaultSquashPolicy = isDefined(value) ? value : this._defaultSquashPolicy;
+ };
+ /**
+ * Creates a [[UrlMatcher]] for the specified pattern.
+ *
+ * @param pattern The URL pattern.
+ * @param config The config object hash.
+ * @returns The UrlMatcher.
+ */
+ UrlMatcherFactory.prototype.compile = function (pattern, config) {
+ return new UrlMatcher(pattern, this.paramTypes, this.paramFactory, this._getConfig(config));
+ };
+ /**
+ * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
+ *
+ * @param object The object to perform the type check against.
+ * @returns `true` if the object matches the `UrlMatcher` interface, by
+ * implementing all the same methods.
+ */
+ UrlMatcherFactory.prototype.isMatcher = function (object) {
+ // TODO: typeof?
+ if (!isObject(object))
+ return false;
+ var result = true;
+ forEach(UrlMatcher.prototype, function (val, name) {
+ if (isFunction(val))
+ result = result && (isDefined(object[name]) && isFunction(object[name]));
+ });
+ return result;
+ };
+
+ /**
+ * Creates and registers a custom [[ParamType]] object
+ *
+ * A [[ParamType]] can be used to generate URLs with typed parameters.
+ *
+ * @param name The type name.
+ * @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.
+ * @param definitionFn A function that is injected before the app runtime starts.
+ * The result of this function should be a [[ParamTypeDefinition]].
+ * The result is merged into the existing `definition`.
+ * See [[ParamType]] for information on the values accepted.
+ *
+ * @returns - if a type was registered: the [[UrlMatcherFactory]]
+ * - if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined
+ *
+ * Note: Register custom types *before using them* in a state definition.
+ *
+ * See [[ParamTypeDefinition]] for examples
+ */
+ UrlMatcherFactory.prototype.type = function (name, definition, definitionFn) {
+ var type = this.paramTypes.type(name, definition, definitionFn);
+ return !isDefined(definition) ? type : this;
+ };
+
+ /** @hidden */
+ UrlMatcherFactory.prototype.$get = function () {
+ this.paramTypes.enqueue = false;
+ this.paramTypes._flushTypeQueue();
+ return this;
+ };
+
+ /** @internalapi */
+ UrlMatcherFactory.prototype.dispose = function () {
+ this.paramTypes.dispose();
+ };
+ return UrlMatcherFactory;
+}());
+
+/**
+ * @coreapi
+ * @module url
+ */ /** */
+/**
+ * Creates a [[UrlRule]]
+ *
+ * Creates a [[UrlRule]] from a:
+ *
+ * - `string`
+ * - [[UrlMatcher]]
+ * - `RegExp`
+ * - [[StateObject]]
+ * @internalapi
+ */
+var UrlRuleFactory = /** @class */ (function () {
+ function UrlRuleFactory(router) {
+ this.router = router;
+ }
+ UrlRuleFactory.prototype.compile = function (str) {
+ return this.router.urlMatcherFactory.compile(str);
+ };
+ UrlRuleFactory.prototype.create = function (what, handler) {
+ var _this = this;
+ var makeRule = pattern([
+ [isString, function (_what) { return makeRule(_this.compile(_what)); }],
+ [is(UrlMatcher), function (_what) { return _this.fromUrlMatcher(_what, handler); }],
+ [isState, function (_what) { return _this.fromState(_what, _this.router); }],
+ [is(RegExp), function (_what) { return _this.fromRegExp(_what, handler); }],
+ [isFunction, function (_what) { return new BaseUrlRule(_what, handler); }],
+ ]);
+ var rule = makeRule(what);
+ if (!rule)
+ throw new Error("invalid 'what' in when()");
+ return rule;
+ };
+ /**
+ * A UrlRule which matches based on a UrlMatcher
+ *
+ * The `handler` may be either a `string`, a [[UrlRuleHandlerFn]] or another [[UrlMatcher]]
+ *
+ * ## Handler as a function
+ *
+ * If `handler` is a function, the function is invoked with:
+ *
+ * - matched parameter values ([[RawParams]] from [[UrlMatcher.exec]])
+ * - url: the current Url ([[UrlParts]])
+ * - router: the router object ([[UIRouter]])
+ *
+ * #### Example:
+ * ```js
+ * var urlMatcher = $umf.compile("/foo/:fooId/:barId");
+ * var rule = factory.fromUrlMatcher(urlMatcher, match => "/home/" + match.fooId + "/" + match.barId);
+ * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
+ * var result = rule.handler(match); // '/home/123/456'
+ * ```
+ *
+ * ## Handler as UrlMatcher
+ *
+ * If `handler` is a UrlMatcher, the handler matcher is used to create the new url.
+ * The `handler` UrlMatcher is formatted using the matched param from the first matcher.
+ * The url is replaced with the result.
+ *
+ * #### Example:
+ * ```js
+ * var urlMatcher = $umf.compile("/foo/:fooId/:barId");
+ * var handler = $umf.compile("/home/:fooId/:barId");
+ * var rule = factory.fromUrlMatcher(urlMatcher, handler);
+ * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
+ * var result = rule.handler(match); // '/home/123/456'
+ * ```
+ */
+ UrlRuleFactory.prototype.fromUrlMatcher = function (urlMatcher, handler) {
+ var _handler = handler;
+ if (isString(handler))
+ handler = this.router.urlMatcherFactory.compile(handler);
+ if (is(UrlMatcher)(handler))
+ _handler = function (match) { return handler.format(match); };
+ function match(url) {
+ var match = urlMatcher.exec(url.path, url.search, url.hash);
+ return urlMatcher.validates(match) && match;
+ }
+ // Prioritize URLs, lowest to highest:
+ // - Some optional URL parameters, but none matched
+ // - No optional parameters in URL
+ // - Some optional parameters, some matched
+ // - Some optional parameters, all matched
+ function matchPriority(params) {
+ var optional = urlMatcher.parameters().filter(function (param) { return param.isOptional; });
+ if (!optional.length)
+ return 0.000001;
+ var matched = optional.filter(function (param) { return params[param.id]; });
+ return matched.length / optional.length;
+ }
+ var details = { urlMatcher: urlMatcher, matchPriority: matchPriority, type: "URLMATCHER" };
+ return extend(new BaseUrlRule(match, _handler), details);
+ };
+ /**
+ * A UrlRule which matches a state by its url
+ *
+ * #### Example:
+ * ```js
+ * var rule = factory.fromState($state.get('foo'), router);
+ * var match = rule.match('/foo/123/456'); // results in { fooId: '123', barId: '456' }
+ * var result = rule.handler(match);
+ * // Starts a transition to 'foo' with params: { fooId: '123', barId: '456' }
+ * ```
+ */
+ UrlRuleFactory.prototype.fromState = function (state, router) {
+ /**
+ * Handles match by transitioning to matched state
+ *
+ * First checks if the router should start a new transition.
+ * A new transition is not required if the current state's URL
+ * and the new URL are already identical
+ */
+ var handler = function (match) {
+ var $state = router.stateService;
+ var globals = router.globals;
+ if ($state.href(state, match) !== $state.href(globals.current, globals.params)) {
+ $state.transitionTo(state, match, { inherit: true, source: "url" });
+ }
+ };
+ var details = { state: state, type: "STATE" };
+ return extend(this.fromUrlMatcher(state.url, handler), details);
+ };
+ /**
+ * A UrlRule which matches based on a regular expression
+ *
+ * The `handler` may be either a [[UrlRuleHandlerFn]] or a string.
+ *
+ * ## Handler as a function
+ *
+ * If `handler` is a function, the function is invoked with:
+ *
+ * - regexp match array (from `regexp`)
+ * - url: the current Url ([[UrlParts]])
+ * - router: the router object ([[UIRouter]])
+ *
+ * #### Example:
+ * ```js
+ * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, match => "/home/" + match[1])
+ * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]
+ * var result = rule.handler(match); // '/home/bar'
+ * ```
+ *
+ * ## Handler as string
+ *
+ * If `handler` is a string, the url is *replaced by the string* when the Rule is invoked.
+ * The string is first interpolated using `string.replace()` style pattern.
+ *
+ * #### Example:
+ * ```js
+ * var rule = factory.fromRegExp(/^\/foo\/(bar|baz)$/, "/home/$1")
+ * var match = rule.match('/foo/bar'); // results in [ '/foo/bar', 'bar' ]
+ * var result = rule.handler(match); // '/home/bar'
+ * ```
+ */
+ UrlRuleFactory.prototype.fromRegExp = function (regexp, handler) {
+ if (regexp.global || regexp.sticky)
+ throw new Error("Rule RegExp must not be global or sticky");
+ /**
+ * If handler is a string, the url will be replaced by the string.
+ * If the string has any String.replace() style variables in it (like `$2`),
+ * they will be replaced by the captures from [[match]]
+ */
+ var redirectUrlTo = function (match) {
+ // Interpolates matched values into $1 $2, etc using a String.replace()-style pattern
+ return handler.replace(/\$(\$|\d{1,2})/, function (m, what) {
+ return match[what === '$' ? 0 : Number(what)];
+ });
+ };
+ var _handler = isString(handler) ? redirectUrlTo : handler;
+ var match = function (url) {
+ return regexp.exec(url.path);
+ };
+ var details = { regexp: regexp, type: "REGEXP" };
+ return extend(new BaseUrlRule(match, _handler), details);
+ };
+ UrlRuleFactory.isUrlRule = function (obj) {
+ return obj && ['type', 'match', 'handler'].every(function (key) { return isDefined(obj[key]); });
+ };
+ return UrlRuleFactory;
+}());
+/**
+ * A base rule which calls `match`
+ *
+ * The value from the `match` function is passed through to the `handler`.
+ * @internalapi
+ */
+var BaseUrlRule = /** @class */ (function () {
+ function BaseUrlRule(match, handler) {
+ var _this = this;
+ this.match = match;
+ this.type = "RAW";
+ this.matchPriority = function (match) { return 0 - _this.$id; };
+ this.handler = handler || identity;
+ }
+ return BaseUrlRule;
+}());
+
+/**
+ * @internalapi
+ * @module url
+ */
+/** for typedoc */
+/** @hidden */
+function appendBasePath(url, isHtml5, absolute, baseHref) {
+ if (baseHref === '/')
+ return url;
+ if (isHtml5)
+ return stripFile(baseHref) + url;
+ if (absolute)
+ return baseHref.slice(1) + url;
+ return url;
+}
+/** @hidden */
+var prioritySort = function (a, b) {
+ return (b.priority || 0) - (a.priority || 0);
+};
+/** @hidden */
+var typeSort = function (a, b) {
+ var weights = { "STATE": 4, "URLMATCHER": 4, "REGEXP": 3, "RAW": 2, "OTHER": 1 };
+ return (weights[a.type] || 0) - (weights[b.type] || 0);
+};
+/** @hidden */
+var urlMatcherSort = function (a, b) {
+ return !a.urlMatcher || !b.urlMatcher ? 0 : UrlMatcher.compare(a.urlMatcher, b.urlMatcher);
+};
+/** @hidden */
+var idSort = function (a, b) {
+ // Identically sorted STATE and URLMATCHER best rule will be chosen by `matchPriority` after each rule matches the URL
+ var useMatchPriority = { STATE: true, URLMATCHER: true };
+ var equal = useMatchPriority[a.type] && useMatchPriority[b.type];
+ return equal ? 0 : (a.$id || 0) - (b.$id || 0);
+};
+/**
+ * Default rule priority sorting function.
+ *
+ * Sorts rules by:
+ *
+ * - Explicit priority (set rule priority using [[UrlRulesApi.when]])
+ * - Rule type (STATE: 4, URLMATCHER: 4, REGEXP: 3, RAW: 2, OTHER: 1)
+ * - `UrlMatcher` specificity ([[UrlMatcher.compare]]): works for STATE and URLMATCHER types to pick the most specific rule.
+ * - Rule registration order (for rule types other than STATE and URLMATCHER)
+ * - Equally sorted State and UrlMatcher rules will each match the URL.
+ * Then, the *best* match is chosen based on how many parameter values were matched.
+ *
+ * @coreapi
+ */
+var defaultRuleSortFn;
+defaultRuleSortFn = function (a, b) {
+ var cmp = prioritySort(a, b);
+ if (cmp !== 0)
+ return cmp;
+ cmp = typeSort(a, b);
+ if (cmp !== 0)
+ return cmp;
+ cmp = urlMatcherSort(a, b);
+ if (cmp !== 0)
+ return cmp;
+ return idSort(a, b);
+};
+/**
+ * Updates URL and responds to URL changes
+ *
+ * ### Deprecation warning:
+ * This class is now considered to be an internal API
+ * Use the [[UrlService]] instead.
+ * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].
+ *
+ * This class updates the URL when the state changes.
+ * It also responds to changes in the URL.
+ */
+var UrlRouter = /** @class */ (function () {
+ /** @hidden */
+ function UrlRouter(router) {
+ /** @hidden */ this._sortFn = defaultRuleSortFn;
+ /** @hidden */ this._rules = [];
+ /** @hidden */ this.interceptDeferred = false;
+ /** @hidden */ this._id = 0;
+ /** @hidden */ this._sorted = false;
+ this._router = router;
+ this.urlRuleFactory = new UrlRuleFactory(router);
+ createProxyFunctions(val(UrlRouter.prototype), this, val(this));
+ }
+ /** @internalapi */
+ UrlRouter.prototype.dispose = function () {
+ this.listen(false);
+ this._rules = [];
+ delete this._otherwiseFn;
+ };
+ /** @inheritdoc */
+ UrlRouter.prototype.sort = function (compareFn) {
+ this._rules = this.stableSort(this._rules, this._sortFn = compareFn || this._sortFn);
+ this._sorted = true;
+ };
+ UrlRouter.prototype.ensureSorted = function () {
+ this._sorted || this.sort();
+ };
+ UrlRouter.prototype.stableSort = function (arr, compareFn) {
+ var arrOfWrapper = arr.map(function (elem, idx) { return ({ elem: elem, idx: idx }); });
+ arrOfWrapper.sort(function (wrapperA, wrapperB) {
+ var cmpDiff = compareFn(wrapperA.elem, wrapperB.elem);
+ return cmpDiff === 0
+ ? wrapperA.idx - wrapperB.idx
+ : cmpDiff;
+ });
+ return arrOfWrapper.map(function (wrapper) { return wrapper.elem; });
+ };
+ /**
+ * Given a URL, check all rules and return the best [[MatchResult]]
+ * @param url
+ * @returns {MatchResult}
+ */
+ UrlRouter.prototype.match = function (url) {
+ var _this = this;
+ this.ensureSorted();
+ url = extend({ path: '', search: {}, hash: '' }, url);
+ var rules = this.rules();
+ if (this._otherwiseFn)
+ rules.push(this._otherwiseFn);
+ // Checks a single rule. Returns { rule: rule, match: match, weight: weight } if it matched, or undefined
+ var checkRule = function (rule) {
+ var match = rule.match(url, _this._router);
+ return match && { match: match, rule: rule, weight: rule.matchPriority(match) };
+ };
+ // The rules are pre-sorted.
+ // - Find the first matching rule.
+ // - Find any other matching rule that sorted *exactly the same*, according to `.sort()`.
+ // - Choose the rule with the highest match weight.
+ var best;
+ for (var i = 0; i < rules.length; i++) {
+ // Stop when there is a 'best' rule and the next rule sorts differently than it.
+ if (best && this._sortFn(rules[i], best.rule) !== 0)
+ break;
+ var current = checkRule(rules[i]);
+ // Pick the best MatchResult
+ best = (!best || current && current.weight > best.weight) ? current : best;
+ }
+ return best;
+ };
+ /** @inheritdoc */
+ UrlRouter.prototype.sync = function (evt) {
+ if (evt && evt.defaultPrevented)
+ return;
+ var router = this._router, $url = router.urlService, $state = router.stateService;
+ var url = {
+ path: $url.path(), search: $url.search(), hash: $url.hash(),
+ };
+ var best = this.match(url);
+ var applyResult = pattern([
+ [isString, function (newurl) { return $url.url(newurl, true); }],
+ [TargetState.isDef, function (def) { return $state.go(def.state, def.params, def.options); }],
+ [is(TargetState), function (target) { return $state.go(target.state(), target.params(), target.options()); }],
+ ]);
+ applyResult(best && best.rule.handler(best.match, url, router));
+ };
+ /** @inheritdoc */
+ UrlRouter.prototype.listen = function (enabled) {
+ var _this = this;
+ if (enabled === false) {
+ this._stopFn && this._stopFn();
+ delete this._stopFn;
+ }
+ else {
+ return this._stopFn = this._stopFn || this._router.urlService.onChange(function (evt) { return _this.sync(evt); });
+ }
+ };
+ /**
+ * Internal API.
+ * @internalapi
+ */
+ UrlRouter.prototype.update = function (read) {
+ var $url = this._router.locationService;
+ if (read) {
+ this.location = $url.path();
+ return;
+ }
+ if ($url.path() === this.location)
+ return;
+ $url.url(this.location, true);
+ };
+ /**
+ * Internal API.
+ *
+ * Pushes a new location to the browser history.
+ *
+ * @internalapi
+ * @param urlMatcher
+ * @param params
+ * @param options
+ */
+ UrlRouter.prototype.push = function (urlMatcher, params, options) {
+ var replace = options && !!options.replace;
+ this._router.urlService.url(urlMatcher.format(params || {}), replace);
+ };
+ /**
+ * Builds and returns a URL with interpolated parameters
+ *
+ * #### Example:
+ * ```js
+ * matcher = $umf.compile("/about/:person");
+ * params = { person: "bob" };
+ * $bob = $urlRouter.href(matcher, params);
+ * // $bob == "/about/bob";
+ * ```
+ *
+ * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
+ * @param params An object of parameter values to fill the matcher's required parameters.
+ * @param options Options object. The options are:
+ *
+ * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
+ *
+ * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
+ */
+ UrlRouter.prototype.href = function (urlMatcher, params, options) {
+ var url = urlMatcher.format(params);
+ if (url == null)
+ return null;
+ options = options || { absolute: false };
+ var cfg = this._router.urlService.config;
+ var isHtml5 = cfg.html5Mode();
+ if (!isHtml5 && url !== null) {
+ url = "#" + cfg.hashPrefix() + url;
+ }
+ url = appendBasePath(url, isHtml5, options.absolute, cfg.baseHref());
+ if (!options.absolute || !url) {
+ return url;
+ }
+ var slash = (!isHtml5 && url ? '/' : ''), port = cfg.port();
+ port = (port === 80 || port === 443 ? '' : ':' + port);
+ return [cfg.protocol(), '://', cfg.host(), port, slash, url].join('');
+ };
+ /**
+ * Manually adds a URL Rule.
+ *
+ * Usually, a url rule is added using [[StateDeclaration.url]] or [[when]].
+ * This api can be used directly for more control (to register a [[BaseUrlRule]], for example).
+ * Rules can be created using [[UrlRouter.urlRuleFactory]], or create manually as simple objects.
+ *
+ * A rule should have a `match` function which returns truthy if the rule matched.
+ * It should also have a `handler` function which is invoked if the rule is the best match.
+ *
+ * @return a function that deregisters the rule
+ */
+ UrlRouter.prototype.rule = function (rule) {
+ var _this = this;
+ if (!UrlRuleFactory.isUrlRule(rule))
+ throw new Error("invalid rule");
+ rule.$id = this._id++;
+ rule.priority = rule.priority || 0;
+ this._rules.push(rule);
+ this._sorted = false;
+ return function () { return _this.removeRule(rule); };
+ };
+ /** @inheritdoc */
+ UrlRouter.prototype.removeRule = function (rule) {
+ removeFrom(this._rules, rule);
+ };
+ /** @inheritdoc */
+ UrlRouter.prototype.rules = function () {
+ this.ensureSorted();
+ return this._rules.slice();
+ };
+ /** @inheritdoc */
+ UrlRouter.prototype.otherwise = function (handler) {
+ var handlerFn = getHandlerFn(handler);
+ this._otherwiseFn = this.urlRuleFactory.create(val(true), handlerFn);
+ this._sorted = false;
+ };
+
+ /** @inheritdoc */
+ UrlRouter.prototype.initial = function (handler) {
+ var handlerFn = getHandlerFn(handler);
+ var matchFn = function (urlParts, router) {
+ return router.globals.transitionHistory.size() === 0 && !!/^\/?$/.exec(urlParts.path);
+ };
+ this.rule(this.urlRuleFactory.create(matchFn, handlerFn));
+ };
+
+ /** @inheritdoc */
+ UrlRouter.prototype.when = function (matcher, handler, options) {
+ var rule = this.urlRuleFactory.create(matcher, handler);
+ if (isDefined(options && options.priority))
+ rule.priority = options.priority;
+ this.rule(rule);
+ return rule;
+ };
+
+ /** @inheritdoc */
+ UrlRouter.prototype.deferIntercept = function (defer) {
+ if (defer === undefined)
+ defer = true;
+ this.interceptDeferred = defer;
+ };
+
+ return UrlRouter;
+}());
+function getHandlerFn(handler) {
+ if (!isFunction(handler) && !isString(handler) && !is(TargetState)(handler) && !TargetState.isDef(handler)) {
+ throw new Error("'handler' must be a string, function, TargetState, or have a state: 'newtarget' property");
+ }
+ return isFunction(handler) ? handler : val(handler);
+}
+
+/**
+ * @coreapi
+ * @module view
+ */ /** for typedoc */
+/**
+ * The View service
+ *
+ * This service pairs existing `ui-view` components (which live in the DOM)
+ * with view configs (from the state declaration objects: [[StateDeclaration.views]]).
+ *
+ * - After a successful Transition, the views from the newly entered states are activated via [[activateViewConfig]].
+ * The views from exited states are deactivated via [[deactivateViewConfig]].
+ * (See: the [[registerActivateViews]] Transition Hook)
+ *
+ * - As `ui-view` components pop in and out of existence, they register themselves using [[registerUIView]].
+ *
+ * - When the [[sync]] function is called, the registered `ui-view`(s) ([[ActiveUIView]])
+ * are configured with the matching [[ViewConfig]](s)
+ *
+ */
+var ViewService = /** @class */ (function () {
+ function ViewService() {
+ var _this = this;
+ this._uiViews = [];
+ this._viewConfigs = [];
+ this._viewConfigFactories = {};
+ this._pluginapi = {
+ _rootViewContext: this._rootViewContext.bind(this),
+ _viewConfigFactory: this._viewConfigFactory.bind(this),
+ _registeredUIViews: function () { return _this._uiViews; },
+ _activeViewConfigs: function () { return _this._viewConfigs; },
+ };
+ }
+ ViewService.prototype._rootViewContext = function (context) {
+ return this._rootContext = context || this._rootContext;
+ };
+
+ ViewService.prototype._viewConfigFactory = function (viewType, factory) {
+ this._viewConfigFactories[viewType] = factory;
+ };
+ ViewService.prototype.createViewConfig = function (path, decl) {
+ var cfgFactory = this._viewConfigFactories[decl.$type];
+ if (!cfgFactory)
+ throw new Error("ViewService: No view config factory registered for type " + decl.$type);
+ var cfgs = cfgFactory(path, decl);
+ return isArray(cfgs) ? cfgs : [cfgs];
+ };
+ /**
+ * Deactivates a ViewConfig.
+ *
+ * This function deactivates a `ViewConfig`.
+ * After calling [[sync]], it will un-pair from any `ui-view` with which it is currently paired.
+ *
+ * @param viewConfig The ViewConfig view to deregister.
+ */
+ ViewService.prototype.deactivateViewConfig = function (viewConfig) {
+ trace.traceViewServiceEvent("<- Removing", viewConfig);
+ removeFrom(this._viewConfigs, viewConfig);
+ };
+ ViewService.prototype.activateViewConfig = function (viewConfig) {
+ trace.traceViewServiceEvent("-> Registering", viewConfig);
+ this._viewConfigs.push(viewConfig);
+ };
+ ViewService.prototype.sync = function () {
+ var _this = this;
+ var uiViewsByFqn = this._uiViews.map(function (uiv) { return [uiv.fqn, uiv]; }).reduce(applyPairs, {});
+ // Return a weighted depth value for a uiView.
+ // The depth is the nesting depth of ui-views (based on FQN; times 10,000)
+ // plus the depth of the state that is populating the uiView
+ function uiViewDepth(uiView) {
+ var stateDepth = function (context) {
+ return context && context.parent ? stateDepth(context.parent) + 1 : 1;
+ };
+ return (uiView.fqn.split(".").length * 10000) + stateDepth(uiView.creationContext);
+ }
+ // Return the ViewConfig's context's depth in the context tree.
+ function viewConfigDepth(config) {
+ var context = config.viewDecl.$context, count = 0;
+ while (++count && context.parent)
+ context = context.parent;
+ return count;
+ }
+ // Given a depth function, returns a compare function which can return either ascending or descending order
+ var depthCompare = curry(function (depthFn, posNeg, left, right) { return posNeg * (depthFn(left) - depthFn(right)); });
+ var matchingConfigPair = function (uiView) {
+ var matchingConfigs = _this._viewConfigs.filter(ViewService.matches(uiViewsByFqn, uiView));
+ if (matchingConfigs.length > 1) {
+ // This is OK. Child states can target a ui-view that the parent state also targets (the child wins)
+ // Sort by depth and return the match from the deepest child
+ // console.log(`Multiple matching view configs for ${uiView.fqn}`, matchingConfigs);
+ matchingConfigs.sort(depthCompare(viewConfigDepth, -1)); // descending
+ }
+ return [uiView, matchingConfigs[0]];
+ };
+ var configureUIView = function (_a) {
+ var uiView = _a[0], viewConfig = _a[1];
+ // If a parent ui-view is reconfigured, it could destroy child ui-views.
+ // Before configuring a child ui-view, make sure it's still in the active uiViews array.
+ if (_this._uiViews.indexOf(uiView) !== -1)
+ uiView.configUpdated(viewConfig);
+ };
+ // Sort views by FQN and state depth. Process uiviews nearest the root first.
+ var pairs$$1 = this._uiViews.sort(depthCompare(uiViewDepth, 1)).map(matchingConfigPair);
+ trace.traceViewSync(pairs$$1);
+ pairs$$1.forEach(configureUIView);
+ };
+
+ /**
+ * Registers a `ui-view` component
+ *
+ * When a `ui-view` component is created, it uses this method to register itself.
+ * After registration the [[sync]] method is used to ensure all `ui-view` are configured with the proper [[ViewConfig]].
+ *
+ * Note: the `ui-view` component uses the `ViewConfig` to determine what view should be loaded inside the `ui-view`,
+ * and what the view's state context is.
+ *
+ * Note: There is no corresponding `deregisterUIView`.
+ * A `ui-view` should hang on to the return value of `registerUIView` and invoke it to deregister itself.
+ *
+ * @param uiView The metadata for a UIView
+ * @return a de-registration function used when the view is destroyed.
+ */
+ ViewService.prototype.registerUIView = function (uiView) {
+ trace.traceViewServiceUIViewEvent("-> Registering", uiView);
+ var uiViews = this._uiViews;
+ var fqnAndTypeMatches = function (uiv) { return uiv.fqn === uiView.fqn && uiv.$type === uiView.$type; };
+ if (uiViews.filter(fqnAndTypeMatches).length)
+ trace.traceViewServiceUIViewEvent("!!!! duplicate uiView named:", uiView);
+ uiViews.push(uiView);
+ this.sync();
+ return function () {
+ var idx = uiViews.indexOf(uiView);
+ if (idx === -1) {
+ trace.traceViewServiceUIViewEvent("Tried removing non-registered uiView", uiView);
+ return;
+ }
+ trace.traceViewServiceUIViewEvent("<- Deregistering", uiView);
+ removeFrom(uiViews)(uiView);
+ };
+ };
+
+ /**
+ * Returns the list of views currently available on the page, by fully-qualified name.
+ *
+ * @return {Array} Returns an array of fully-qualified view names.
+ */
+ ViewService.prototype.available = function () {
+ return this._uiViews.map(prop("fqn"));
+ };
+ /**
+ * Returns the list of views on the page containing loaded content.
+ *
+ * @return {Array} Returns an array of fully-qualified view names.
+ */
+ ViewService.prototype.active = function () {
+ return this._uiViews.filter(prop("$config")).map(prop("name"));
+ };
+ /**
+ * Normalizes a view's name from a state.views configuration block.
+ *
+ * This should be used by a framework implementation to calculate the values for
+ * [[_ViewDeclaration.$uiViewName]] and [[_ViewDeclaration.$uiViewContextAnchor]].
+ *
+ * @param context the context object (state declaration) that the view belongs to
+ * @param rawViewName the name of the view, as declared in the [[StateDeclaration.views]]
+ *
+ * @returns the normalized uiViewName and uiViewContextAnchor that the view targets
+ */
+ ViewService.normalizeUIViewTarget = function (context, rawViewName) {
+ if (rawViewName === void 0) { rawViewName = ""; }
+ // TODO: Validate incoming view name with a regexp to allow:
+ // ex: "view.name@foo.bar" , "^.^.view.name" , "view.name@^.^" , "" ,
+ // "@" , "$default@^" , "!$default.$default" , "!foo.bar"
+ var viewAtContext = rawViewName.split("@");
+ var uiViewName = viewAtContext[0] || "$default"; // default to unnamed view
+ var uiViewContextAnchor = isString(viewAtContext[1]) ? viewAtContext[1] : "^"; // default to parent context
+ // Handle relative view-name sugar syntax.
+ // Matches rawViewName "^.^.^.foo.bar" into array: ["^.^.^.foo.bar", "^.^.^", "foo.bar"],
+ var relativeViewNameSugar = /^(\^(?:\.\^)*)\.(.*$)/.exec(uiViewName);
+ if (relativeViewNameSugar) {
+ // Clobbers existing contextAnchor (rawViewName validation will fix this)
+ uiViewContextAnchor = relativeViewNameSugar[1]; // set anchor to "^.^.^"
+ uiViewName = relativeViewNameSugar[2]; // set view-name to "foo.bar"
+ }
+ if (uiViewName.charAt(0) === '!') {
+ uiViewName = uiViewName.substr(1);
+ uiViewContextAnchor = ""; // target absolutely from root
+ }
+ // handle parent relative targeting "^.^.^"
+ var relativeMatch = /^(\^(?:\.\^)*)$/;
+ if (relativeMatch.exec(uiViewContextAnchor)) {
+ var anchor = uiViewContextAnchor.split(".").reduce((function (anchor, x) { return anchor.parent; }), context);
+ uiViewContextAnchor = anchor.name;
+ }
+ else if (uiViewContextAnchor === '.') {
+ uiViewContextAnchor = context.name;
+ }
+ return { uiViewName: uiViewName, uiViewContextAnchor: uiViewContextAnchor };
+ };
+ /**
+ * Given a ui-view and a ViewConfig, determines if they "match".
+ *
+ * A ui-view has a fully qualified name (fqn) and a context object. The fqn is built from its overall location in
+ * the DOM, describing its nesting relationship to any parent ui-view tags it is nested inside of.
+ *
+ * A ViewConfig has a target ui-view name and a context anchor. The ui-view name can be a simple name, or
+ * can be a segmented ui-view path, describing a portion of a ui-view fqn.
+ *
+ * In order for a ui-view to match ViewConfig, ui-view's $type must match the ViewConfig's $type
+ *
+ * If the ViewConfig's target ui-view name is a simple name (no dots), then a ui-view matches if:
+ * - the ui-view's name matches the ViewConfig's target name
+ * - the ui-view's context matches the ViewConfig's anchor
+ *
+ * If the ViewConfig's target ui-view name is a segmented name (with dots), then a ui-view matches if:
+ * - There exists a parent ui-view where:
+ * - the parent ui-view's name matches the first segment (index 0) of the ViewConfig's target name
+ * - the parent ui-view's context matches the ViewConfig's anchor
+ * - And the remaining segments (index 1..n) of the ViewConfig's target name match the tail of the ui-view's fqn
+ *
+ * Example:
+ *
+ * DOM:
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * uiViews: [
+ * { fqn: "$default", creationContext: { name: "" } },
+ * { fqn: "$default.foo", creationContext: { name: "A" } },
+ * { fqn: "$default.foo.$default", creationContext: { name: "A.B" } }
+ * { fqn: "$default.foo.$default.bar", creationContext: { name: "A.B.C" } }
+ * ]
+ *
+ * These four view configs all match the ui-view with the fqn: "$default.foo.$default.bar":
+ *
+ * - ViewConfig1: { uiViewName: "bar", uiViewContextAnchor: "A.B.C" }
+ * - ViewConfig2: { uiViewName: "$default.bar", uiViewContextAnchor: "A.B" }
+ * - ViewConfig3: { uiViewName: "foo.$default.bar", uiViewContextAnchor: "A" }
+ * - ViewConfig4: { uiViewName: "$default.foo.$default.bar", uiViewContextAnchor: "" }
+ *
+ * Using ViewConfig3 as an example, it matches the ui-view with fqn "$default.foo.$default.bar" because:
+ * - The ViewConfig's segmented target name is: [ "foo", "$default", "bar" ]
+ * - There exists a parent ui-view (which has fqn: "$default.foo") where:
+ * - the parent ui-view's name "foo" matches the first segment "foo" of the ViewConfig's target name
+ * - the parent ui-view's context "A" matches the ViewConfig's anchor context "A"
+ * - And the remaining segments [ "$default", "bar" ].join("."_ of the ViewConfig's target name match
+ * the tail of the ui-view's fqn "default.bar"
+ *
+ * @internalapi
+ */
+ ViewService.matches = function (uiViewsByFqn, uiView) { return function (viewConfig) {
+ // Don't supply an ng1 ui-view with an ng2 ViewConfig, etc
+ if (uiView.$type !== viewConfig.viewDecl.$type)
+ return false;
+ // Split names apart from both viewConfig and uiView into segments
+ var vc = viewConfig.viewDecl;
+ var vcSegments = vc.$uiViewName.split(".");
+ var uivSegments = uiView.fqn.split(".");
+ // Check if the tails of the segment arrays match. ex, these arrays' tails match:
+ // vc: ["foo", "bar"], uiv fqn: ["$default", "foo", "bar"]
+ if (!equals(vcSegments, uivSegments.slice(0 - vcSegments.length)))
+ return false;
+ // Now check if the fqn ending at the first segment of the viewConfig matches the context:
+ // ["$default", "foo"].join(".") == "$default.foo", does the ui-view $default.foo context match?
+ var negOffset = (1 - vcSegments.length) || undefined;
+ var fqnToFirstSegment = uivSegments.slice(0, negOffset).join(".");
+ var uiViewContext = uiViewsByFqn[fqnToFirstSegment].creationContext;
+ return vc.$uiViewContextAnchor === (uiViewContext && uiViewContext.name);
+ }; };
+ return ViewService;
+}());
+
+/**
+ * @coreapi
+ * @module core
+ */ /** */
+/**
+ * Global router state
+ *
+ * This is where we hold the global mutable state such as current state, current
+ * params, current transition, etc.
+ */
+var UIRouterGlobals = /** @class */ (function () {
+ function UIRouterGlobals() {
+ /**
+ * Current parameter values
+ *
+ * The parameter values from the latest successful transition
+ */
+ this.params = new StateParams();
+ /** @internalapi */
+ this.lastStartedTransitionId = -1;
+ /** @internalapi */
+ this.transitionHistory = new Queue([], 1);
+ /** @internalapi */
+ this.successfulTransitions = new Queue([], 1);
+ }
+ UIRouterGlobals.prototype.dispose = function () {
+ this.transitionHistory.clear();
+ this.successfulTransitions.clear();
+ this.transition = null;
+ };
+ return UIRouterGlobals;
+}());
+
+/**
+ * @coreapi
+ * @module url
+ */ /** */
+/** @hidden */
+var makeStub = function (keys) {
+ return keys.reduce(function (acc, key) { return (acc[key] = notImplemented(key), acc); }, { dispose: noop$1 });
+};
+/** @hidden */ var locationServicesFns = ["url", "path", "search", "hash", "onChange"];
+/** @hidden */ var locationConfigFns = ["port", "protocol", "host", "baseHref", "html5Mode", "hashPrefix"];
+/** @hidden */ var umfFns = ["type", "caseInsensitive", "strictMode", "defaultSquashPolicy"];
+/** @hidden */ var rulesFns = ["sort", "when", "initial", "otherwise", "rules", "rule", "removeRule"];
+/** @hidden */ var syncFns = ["deferIntercept", "listen", "sync", "match"];
+/**
+ * API for URL management
+ */
+var UrlService = /** @class */ (function () {
+ /** @hidden */
+ function UrlService(router, lateBind) {
+ if (lateBind === void 0) { lateBind = true; }
+ this.router = router;
+ this.rules = {};
+ this.config = {};
+ // proxy function calls from UrlService to the LocationService/LocationConfig
+ var locationServices = function () { return router.locationService; };
+ createProxyFunctions(locationServices, this, locationServices, locationServicesFns, lateBind);
+ var locationConfig = function () { return router.locationConfig; };
+ createProxyFunctions(locationConfig, this.config, locationConfig, locationConfigFns, lateBind);
+ var umf = function () { return router.urlMatcherFactory; };
+ createProxyFunctions(umf, this.config, umf, umfFns);
+ var urlRouter = function () { return router.urlRouter; };
+ createProxyFunctions(urlRouter, this.rules, urlRouter, rulesFns);
+ createProxyFunctions(urlRouter, this, urlRouter, syncFns);
+ }
+ UrlService.prototype.url = function (newurl, replace, state) { return; };
+
+ /** @inheritdoc */
+ UrlService.prototype.path = function () { return; };
+
+ /** @inheritdoc */
+ UrlService.prototype.search = function () { return; };
+
+ /** @inheritdoc */
+ UrlService.prototype.hash = function () { return; };
+
+ /** @inheritdoc */
+ UrlService.prototype.onChange = function (callback) { return; };
+
+ /**
+ * Returns the current URL parts
+ *
+ * This method returns the current URL components as a [[UrlParts]] object.
+ *
+ * @returns the current url parts
+ */
+ UrlService.prototype.parts = function () {
+ return { path: this.path(), search: this.search(), hash: this.hash() };
+ };
+ UrlService.prototype.dispose = function () { };
+ /** @inheritdoc */
+ UrlService.prototype.sync = function (evt) { return; };
+ /** @inheritdoc */
+ UrlService.prototype.listen = function (enabled) { return; };
+
+ /** @inheritdoc */
+ UrlService.prototype.deferIntercept = function (defer) { return; };
+ /** @inheritdoc */
+ UrlService.prototype.match = function (urlParts) { return; };
+ /** @hidden */
+ UrlService.locationServiceStub = makeStub(locationServicesFns);
+ /** @hidden */
+ UrlService.locationConfigStub = makeStub(locationConfigFns);
+ return UrlService;
+}());
+
+/**
+ * @coreapi
+ * @module core
+ */ /** */
+/** @hidden */
+var _routerInstance = 0;
+/**
+ * The master class used to instantiate an instance of UI-Router.
+ *
+ * UI-Router (for each specific framework) will create an instance of this class during bootstrap.
+ * This class instantiates and wires the UI-Router services together.
+ *
+ * After a new instance of the UIRouter class is created, it should be configured for your app.
+ * For instance, app states should be registered with the [[UIRouter.stateRegistry]].
+ *
+ * ---
+ *
+ * Normally the framework code will bootstrap UI-Router.
+ * If you are bootstrapping UIRouter manually, tell it to monitor the URL by calling
+ * [[UrlService.listen]] then [[UrlService.sync]].
+ */
+var UIRouter = /** @class */ (function () {
+ /**
+ * Creates a new `UIRouter` object
+ *
+ * @param locationService a [[LocationServices]] implementation
+ * @param locationConfig a [[LocationConfig]] implementation
+ * @internalapi
+ */
+ function UIRouter(locationService, locationConfig) {
+ if (locationService === void 0) { locationService = UrlService.locationServiceStub; }
+ if (locationConfig === void 0) { locationConfig = UrlService.locationConfigStub; }
+ this.locationService = locationService;
+ this.locationConfig = locationConfig;
+ /** @hidden */ this.$id = _routerInstance++;
+ /** @hidden */ this._disposed = false;
+ /** @hidden */ this._disposables = [];
+ /** Provides trace information to the console */
+ this.trace = trace;
+ /** Provides services related to ui-view synchronization */
+ this.viewService = new ViewService();
+ /** Provides services related to Transitions */
+ this.transitionService = new TransitionService(this);
+ /** Global router state */
+ this.globals = new UIRouterGlobals();
+ /**
+ * Deprecated for public use. Use [[urlService]] instead.
+ * @deprecated Use [[urlService]] instead
+ */
+ this.urlMatcherFactory = new UrlMatcherFactory();
+ /**
+ * Deprecated for public use. Use [[urlService]] instead.
+ * @deprecated Use [[urlService]] instead
+ */
+ this.urlRouter = new UrlRouter(this);
+ /** Provides a registry for states, and related registration services */
+ this.stateRegistry = new StateRegistry(this);
+ /** Provides services related to states */
+ this.stateService = new StateService(this);
+ /** Provides services related to the URL */
+ this.urlService = new UrlService(this);
+ /** @hidden */
+ this._plugins = {};
+ this.viewService._pluginapi._rootViewContext(this.stateRegistry.root());
+ this.globals.$current = this.stateRegistry.root();
+ this.globals.current = this.globals.$current.self;
+ this.disposable(this.globals);
+ this.disposable(this.stateService);
+ this.disposable(this.stateRegistry);
+ this.disposable(this.transitionService);
+ this.disposable(this.urlRouter);
+ this.disposable(locationService);
+ this.disposable(locationConfig);
+ }
+ /** Registers an object to be notified when the router is disposed */
+ UIRouter.prototype.disposable = function (disposable) {
+ this._disposables.push(disposable);
+ };
+ /**
+ * Disposes this router instance
+ *
+ * When called, clears resources retained by the router by calling `dispose(this)` on all
+ * registered [[disposable]] objects.
+ *
+ * Or, if a `disposable` object is provided, calls `dispose(this)` on that object only.
+ *
+ * @param disposable (optional) the disposable to dispose
+ */
+ UIRouter.prototype.dispose = function (disposable) {
+ var _this = this;
+ if (disposable && isFunction(disposable.dispose)) {
+ disposable.dispose(this);
+ return undefined;
+ }
+ this._disposed = true;
+ this._disposables.slice().forEach(function (d) {
+ try {
+ typeof d.dispose === 'function' && d.dispose(_this);
+ removeFrom(_this._disposables, d);
+ }
+ catch (ignored) { }
+ });
+ };
+ /**
+ * Adds a plugin to UI-Router
+ *
+ * This method adds a UI-Router Plugin.
+ * A plugin can enhance or change UI-Router behavior using any public API.
+ *
+ * #### Example:
+ * ```js
+ * import { MyCoolPlugin } from "ui-router-cool-plugin";
+ *
+ * var plugin = router.addPlugin(MyCoolPlugin);
+ * ```
+ *
+ * ### Plugin authoring
+ *
+ * A plugin is simply a class (or constructor function) which accepts a [[UIRouter]] instance and (optionally) an options object.
+ *
+ * The plugin can implement its functionality using any of the public APIs of [[UIRouter]].
+ * For example, it may configure router options or add a Transition Hook.
+ *
+ * The plugin can then be published as a separate module.
+ *
+ * #### Example:
+ * ```js
+ * export class MyAuthPlugin implements UIRouterPlugin {
+ * constructor(router: UIRouter, options: any) {
+ * this.name = "MyAuthPlugin";
+ * let $transitions = router.transitionService;
+ * let $state = router.stateService;
+ *
+ * let authCriteria = {
+ * to: (state) => state.data && state.data.requiresAuth
+ * };
+ *
+ * function authHook(transition: Transition) {
+ * let authService = transition.injector().get('AuthService');
+ * if (!authService.isAuthenticated()) {
+ * return $state.target('login');
+ * }
+ * }
+ *
+ * $transitions.onStart(authCriteria, authHook);
+ * }
+ * }
+ * ```
+ *
+ * @param plugin one of:
+ * - a plugin class which implements [[UIRouterPlugin]]
+ * - a constructor function for a [[UIRouterPlugin]] which accepts a [[UIRouter]] instance
+ * - a factory function which accepts a [[UIRouter]] instance and returns a [[UIRouterPlugin]] instance
+ * @param options options to pass to the plugin class/factory
+ * @returns the registered plugin instance
+ */
+ UIRouter.prototype.plugin = function (plugin, options) {
+ if (options === void 0) { options = {}; }
+ var pluginInstance = new plugin(this, options);
+ if (!pluginInstance.name)
+ throw new Error("Required property `name` missing on plugin: " + pluginInstance);
+ this._disposables.push(pluginInstance);
+ return this._plugins[pluginInstance.name] = pluginInstance;
+ };
+ UIRouter.prototype.getPlugin = function (pluginName) {
+ return pluginName ? this._plugins[pluginName] : values(this._plugins);
+ };
+ return UIRouter;
+}());
+
+/** @module hooks */ /** */
+function addCoreResolvables(trans) {
+ trans.addResolvable({ token: UIRouter, deps: [], resolveFn: function () { return trans.router; }, data: trans.router }, "");
+ trans.addResolvable({ token: Transition, deps: [], resolveFn: function () { return trans; }, data: trans }, "");
+ trans.addResolvable({ token: '$transition$', deps: [], resolveFn: function () { return trans; }, data: trans }, "");
+ trans.addResolvable({ token: '$stateParams', deps: [], resolveFn: function () { return trans.params(); }, data: trans.params() }, "");
+ trans.entering().forEach(function (state) {
+ trans.addResolvable({ token: '$state$', deps: [], resolveFn: function () { return state; }, data: state }, state);
+ });
+}
+var registerAddCoreResolvables = function (transitionService) {
+ return transitionService.onCreate({}, addCoreResolvables);
+};
+
+/** @module hooks */ /** */
+/**
+ * A [[TransitionHookFn]] that redirects to a different state or params
+ *
+ * Registered using `transitionService.onStart({ to: (state) => !!state.redirectTo }, redirectHook);`
+ *
+ * See [[StateDeclaration.redirectTo]]
+ */
+var redirectToHook = function (trans) {
+ var redirect = trans.to().redirectTo;
+ if (!redirect)
+ return;
+ var $state = trans.router.stateService;
+ function handleResult(result) {
+ if (!result)
+ return;
+ if (result instanceof TargetState)
+ return result;
+ if (isString(result))
+ return $state.target(result, trans.params(), trans.options());
+ if (result['state'] || result['params'])
+ return $state.target(result['state'] || trans.to(), result['params'] || trans.params(), trans.options());
+ }
+ if (isFunction(redirect)) {
+ return services.$q.when(redirect(trans)).then(handleResult);
+ }
+ return handleResult(redirect);
+};
+var registerRedirectToHook = function (transitionService) {
+ return transitionService.onStart({ to: function (state) { return !!state.redirectTo; } }, redirectToHook);
+};
+
+/**
+ * A factory which creates an onEnter, onExit or onRetain transition hook function
+ *
+ * The returned function invokes the (for instance) state.onEnter hook when the
+ * state is being entered.
+ *
+ * @hidden
+ */
+function makeEnterExitRetainHook(hookName) {
+ return function (transition, state) {
+ var _state = state.$$state();
+ var hookFn = _state[hookName];
+ return hookFn(transition, state);
+ };
+}
+/**
+ * The [[TransitionStateHookFn]] for onExit
+ *
+ * When the state is being exited, the state's .onExit function is invoked.
+ *
+ * Registered using `transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);`
+ *
+ * See: [[IHookRegistry.onExit]]
+ */
+var onExitHook = makeEnterExitRetainHook('onExit');
+var registerOnExitHook = function (transitionService) {
+ return transitionService.onExit({ exiting: function (state) { return !!state.onExit; } }, onExitHook);
+};
+/**
+ * The [[TransitionStateHookFn]] for onRetain
+ *
+ * When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked.
+ *
+ * Registered using `transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);`
+ *
+ * See: [[IHookRegistry.onRetain]]
+ */
+var onRetainHook = makeEnterExitRetainHook('onRetain');
+var registerOnRetainHook = function (transitionService) {
+ return transitionService.onRetain({ retained: function (state) { return !!state.onRetain; } }, onRetainHook);
+};
+/**
+ * The [[TransitionStateHookFn]] for onEnter
+ *
+ * When the state is being entered, the state's .onEnter function is invoked.
+ *
+ * Registered using `transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);`
+ *
+ * See: [[IHookRegistry.onEnter]]
+ */
+var onEnterHook = makeEnterExitRetainHook('onEnter');
+var registerOnEnterHook = function (transitionService) {
+ return transitionService.onEnter({ entering: function (state) { return !!state.onEnter; } }, onEnterHook);
+};
+
+/** @module hooks */
+/** for typedoc */
+/**
+ * A [[TransitionHookFn]] which resolves all EAGER Resolvables in the To Path
+ *
+ * Registered using `transitionService.onStart({}, eagerResolvePath);`
+ *
+ * When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for.
+ *
+ * See [[StateDeclaration.resolve]]
+ */
+var eagerResolvePath = function (trans) {
+ return new ResolveContext(trans.treeChanges().to)
+ .resolvePath("EAGER", trans)
+ .then(noop$1);
+};
+var registerEagerResolvePath = function (transitionService) {
+ return transitionService.onStart({}, eagerResolvePath, { priority: 1000 });
+};
+/**
+ * A [[TransitionHookFn]] which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path
+ *
+ * Registered using `transitionService.onEnter({ entering: () => true }, lazyResolveState);`
+ *
+ * When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for.
+ *
+ * See [[StateDeclaration.resolve]]
+ */
+var lazyResolveState = function (trans, state) {
+ return new ResolveContext(trans.treeChanges().to)
+ .subContext(state.$$state())
+ .resolvePath("LAZY", trans)
+ .then(noop$1);
+};
+var registerLazyResolveState = function (transitionService) {
+ return transitionService.onEnter({ entering: val(true) }, lazyResolveState, { priority: 1000 });
+};
+
+/** @module hooks */ /** for typedoc */
+/**
+ * A [[TransitionHookFn]] which waits for the views to load
+ *
+ * Registered using `transitionService.onStart({}, loadEnteringViews);`
+ *
+ * Allows the views to do async work in [[ViewConfig.load]] before the transition continues.
+ * In angular 1, this includes loading the templates.
+ */
+var loadEnteringViews = function (transition) {
+ var $q = services.$q;
+ var enteringViews = transition.views("entering");
+ if (!enteringViews.length)
+ return;
+ return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(noop$1);
+};
+var registerLoadEnteringViews = function (transitionService) {
+ return transitionService.onFinish({}, loadEnteringViews);
+};
+/**
+ * A [[TransitionHookFn]] which activates the new views when a transition is successful.
+ *
+ * Registered using `transitionService.onSuccess({}, activateViews);`
+ *
+ * After a transition is complete, this hook deactivates the old views from the previous state,
+ * and activates the new views from the destination state.
+ *
+ * See [[ViewService]]
+ */
+var activateViews = function (transition) {
+ var enteringViews = transition.views("entering");
+ var exitingViews = transition.views("exiting");
+ if (!enteringViews.length && !exitingViews.length)
+ return;
+ var $view = transition.router.viewService;
+ exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); });
+ enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); });
+ $view.sync();
+};
+var registerActivateViews = function (transitionService) {
+ return transitionService.onSuccess({}, activateViews);
+};
+
+/**
+ * A [[TransitionHookFn]] which updates global UI-Router state
+ *
+ * Registered using `transitionService.onBefore({}, updateGlobalState);`
+ *
+ * Before a [[Transition]] starts, updates the global value of "the current transition" ([[Globals.transition]]).
+ * After a successful [[Transition]], updates the global values of "the current state"
+ * ([[Globals.current]] and [[Globals.$current]]) and "the current param values" ([[Globals.params]]).
+ *
+ * See also the deprecated properties:
+ * [[StateService.transition]], [[StateService.current]], [[StateService.params]]
+ */
+var updateGlobalState = function (trans) {
+ var globals = trans.router.globals;
+ var transitionSuccessful = function () {
+ globals.successfulTransitions.enqueue(trans);
+ globals.$current = trans.$to();
+ globals.current = globals.$current.self;
+ copy(trans.params(), globals.params);
+ };
+ var clearCurrentTransition = function () {
+ // Do not clear globals.transition if a different transition has started in the meantime
+ if (globals.transition === trans)
+ globals.transition = null;
+ };
+ trans.onSuccess({}, transitionSuccessful, { priority: 10000 });
+ trans.promise.then(clearCurrentTransition, clearCurrentTransition);
+};
+var registerUpdateGlobalState = function (transitionService) {
+ return transitionService.onCreate({}, updateGlobalState);
+};
+
+/**
+ * A [[TransitionHookFn]] which updates the URL after a successful transition
+ *
+ * Registered using `transitionService.onSuccess({}, updateUrl);`
+ */
+var updateUrl = function (transition) {
+ var options = transition.options();
+ var $state = transition.router.stateService;
+ var $urlRouter = transition.router.urlRouter;
+ // Dont update the url in these situations:
+ // The transition was triggered by a URL sync (options.source === 'url')
+ // The user doesn't want the url to update (options.location === false)
+ // The destination state, and all parents have no navigable url
+ if (options.source !== 'url' && options.location && $state.$current.navigable) {
+ var urlOptions = { replace: options.location === 'replace' };
+ $urlRouter.push($state.$current.navigable.url, $state.params, urlOptions);
+ }
+ $urlRouter.update(true);
+};
+var registerUpdateUrl = function (transitionService) {
+ return transitionService.onSuccess({}, updateUrl, { priority: 9999 });
+};
+
+/**
+ * A [[TransitionHookFn]] that performs lazy loading
+ *
+ * When entering a state "abc" which has a `lazyLoad` function defined:
+ * - Invoke the `lazyLoad` function (unless it is already in process)
+ * - Flag the hook function as "in process"
+ * - The function should return a promise (that resolves when lazy loading is complete)
+ * - Wait for the promise to settle
+ * - If the promise resolves to a [[LazyLoadResult]], then register those states
+ * - Flag the hook function as "not in process"
+ * - If the hook was successful
+ * - Remove the `lazyLoad` function from the state declaration
+ * - If all the hooks were successful
+ * - Retry the transition (by returning a TargetState)
+ *
+ * ```
+ * .state('abc', {
+ * component: 'fooComponent',
+ * lazyLoad: () => System.import('./fooComponent')
+ * });
+ * ```
+ *
+ * See [[StateDeclaration.lazyLoad]]
+ */
+var lazyLoadHook = function (transition) {
+ var router = transition.router;
+ function retryTransition() {
+ if (transition.originalTransition().options().source !== 'url') {
+ // The original transition was not triggered via url sync
+ // The lazy state should be loaded now, so re-try the original transition
+ var orig = transition.targetState();
+ return router.stateService.target(orig.identifier(), orig.params(), orig.options());
+ }
+ // The original transition was triggered via url sync
+ // Run the URL rules and find the best match
+ var $url = router.urlService;
+ var result = $url.match($url.parts());
+ var rule = result && result.rule;
+ // If the best match is a state, redirect the transition (instead
+ // of calling sync() which supersedes the current transition)
+ if (rule && rule.type === "STATE") {
+ var state = rule.state;
+ var params = result.match;
+ return router.stateService.target(state, params, transition.options());
+ }
+ // No matching state found, so let .sync() choose the best non-state match/otherwise
+ router.urlService.sync();
+ }
+ var promises = transition.entering()
+ .filter(function (state) { return !!state.$$state().lazyLoad; })
+ .map(function (state) { return lazyLoadState(transition, state); });
+ return services.$q.all(promises).then(retryTransition);
+};
+var registerLazyLoadHook = function (transitionService) {
+ return transitionService.onBefore({ entering: function (state) { return !!state.lazyLoad; } }, lazyLoadHook);
+};
+/**
+ * Invokes a state's lazy load function
+ *
+ * @param transition a Transition context
+ * @param state the state to lazy load
+ * @returns A promise for the lazy load result
+ */
+function lazyLoadState(transition, state) {
+ var lazyLoadFn = state.$$state().lazyLoad;
+ // Store/get the lazy load promise on/from the hookfn so it doesn't get re-invoked
+ var promise = lazyLoadFn['_promise'];
+ if (!promise) {
+ var success = function (result) {
+ delete state.lazyLoad;
+ delete state.$$state().lazyLoad;
+ delete lazyLoadFn['_promise'];
+ return result;
+ };
+ var error = function (err) {
+ delete lazyLoadFn['_promise'];
+ return services.$q.reject(err);
+ };
+ promise = lazyLoadFn['_promise'] =
+ services.$q.when(lazyLoadFn(transition, state))
+ .then(updateStateRegistry)
+ .then(success, error);
+ }
+ /** Register any lazy loaded state definitions */
+ function updateStateRegistry(result) {
+ if (result && Array.isArray(result.states)) {
+ result.states.forEach(function (state) { return transition.router.stateRegistry.register(state); });
+ }
+ return result;
+ }
+ return promise;
+}
+
+/**
+ * This class defines a type of hook, such as `onBefore` or `onEnter`.
+ * Plugins can define custom hook types, such as sticky states does for `onInactive`.
+ *
+ * @interalapi
+ */
+var TransitionEventType = /** @class */ (function () {
+ function TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {
+ if (reverseSort === void 0) { reverseSort = false; }
+ if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; }
+ if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; }
+ if (synchronous === void 0) { synchronous = false; }
+ this.name = name;
+ this.hookPhase = hookPhase;
+ this.hookOrder = hookOrder;
+ this.criteriaMatchPath = criteriaMatchPath;
+ this.reverseSort = reverseSort;
+ this.getResultHandler = getResultHandler;
+ this.getErrorHandler = getErrorHandler;
+ this.synchronous = synchronous;
+ }
+ return TransitionEventType;
+}());
+
+/** @module hooks */ /** */
+/**
+ * A [[TransitionHookFn]] that skips a transition if it should be ignored
+ *
+ * This hook is invoked at the end of the onBefore phase.
+ *
+ * If the transition should be ignored (because no parameter or states changed)
+ * then the transition is ignored and not processed.
+ */
+function ignoredHook(trans) {
+ var ignoredReason = trans._ignoredReason();
+ if (!ignoredReason)
+ return;
+ trace.traceTransitionIgnored(trans);
+ var pending = trans.router.globals.transition;
+ // The user clicked a link going back to the *current state* ('A')
+ // However, there is also a pending transition in flight (to 'B')
+ // Abort the transition to 'B' because the user now wants to be back at 'A'.
+ if (ignoredReason === 'SameAsCurrent' && pending) {
+ pending.abort();
+ }
+ return Rejection.ignored().toPromise();
+}
+var registerIgnoredTransitionHook = function (transitionService) {
+ return transitionService.onBefore({}, ignoredHook, { priority: -9999 });
+};
+
+/** @module hooks */ /** */
+/**
+ * A [[TransitionHookFn]] that rejects the Transition if it is invalid
+ *
+ * This hook is invoked at the end of the onBefore phase.
+ * If the transition is invalid (for example, param values do not validate)
+ * then the transition is rejected.
+ */
+function invalidTransitionHook(trans) {
+ if (!trans.valid()) {
+ throw new Error(trans.error());
+ }
+}
+var registerInvalidTransitionHook = function (transitionService) {
+ return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 });
+};
+
+/**
+ * @coreapi
+ * @module transition
+ */
+/** for typedoc */
+/**
+ * The default [[Transition]] options.
+ *
+ * Include this object when applying custom defaults:
+ * let reloadOpts = { reload: true, notify: true }
+ * let options = defaults(theirOpts, customDefaults, defaultOptions);
+ */
+var defaultTransOpts = {
+ location: true,
+ relative: null,
+ inherit: false,
+ notify: true,
+ reload: false,
+ custom: {},
+ current: function () { return null; },
+ source: "unknown"
+};
+/**
+ * This class provides services related to Transitions.
+ *
+ * - Most importantly, it allows global Transition Hooks to be registered.
+ * - It allows the default transition error handler to be set.
+ * - It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).
+ *
+ * At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.
+ */
+var TransitionService = /** @class */ (function () {
+ /** @hidden */
+ function TransitionService(_router) {
+ /** @hidden */
+ this._transitionCount = 0;
+ /** @hidden The transition hook types, such as `onEnter`, `onStart`, etc */
+ this._eventTypes = [];
+ /** @hidden The registered transition hooks */
+ this._registeredHooks = {};
+ /** @hidden The paths on a criteria object */
+ this._criteriaPaths = {};
+ this._router = _router;
+ this.$view = _router.viewService;
+ this._deregisterHookFns = {};
+ this._pluginapi = createProxyFunctions(val(this), {}, val(this), [
+ '_definePathType',
+ '_defineEvent',
+ '_getPathTypes',
+ '_getEvents',
+ 'getHooks',
+ ]);
+ this._defineCorePaths();
+ this._defineCoreEvents();
+ this._registerCoreTransitionHooks();
+ }
+ /**
+ * Registers a [[TransitionHookFn]], called *while a transition is being constructed*.
+ *
+ * Registers a transition lifecycle hook, which is invoked during transition construction.
+ *
+ * This low level hook should only be used by plugins.
+ * This can be a useful time for plugins to add resolves or mutate the transition as needed.
+ * The Sticky States plugin uses this hook to modify the treechanges.
+ *
+ * ### Lifecycle
+ *
+ * `onCreate` hooks are invoked *while a transition is being constructed*.
+ *
+ * ### Return value
+ *
+ * The hook's return value is ignored
+ *
+ * @internalapi
+ * @param criteria defines which Transitions the Hook should be invoked for.
+ * @param callback the hook function which will be invoked.
+ * @param options the registration options
+ * @returns a function which deregisters the hook.
+ */
+ TransitionService.prototype.onCreate = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onBefore = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onStart = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onExit = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onRetain = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onEnter = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onFinish = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onSuccess = function (criteria, callback, options) { return; };
+ /** @inheritdoc */
+ TransitionService.prototype.onError = function (criteria, callback, options) { return; };
+ /**
+ * dispose
+ * @internalapi
+ */
+ TransitionService.prototype.dispose = function (router) {
+ values(this._registeredHooks).forEach(function (hooksArray) { return hooksArray.forEach(function (hook) {
+ hook._deregistered = true;
+ removeFrom(hooksArray, hook);
+ }); });
+ };
+ /**
+ * Creates a new [[Transition]] object
+ *
+ * This is a factory function for creating new Transition objects.
+ * It is used internally by the [[StateService]] and should generally not be called by application code.
+ *
+ * @param fromPath the path to the current state (the from state)
+ * @param targetState the target state (destination)
+ * @returns a Transition
+ */
+ TransitionService.prototype.create = function (fromPath, targetState) {
+ return new Transition(fromPath, targetState, this._router);
+ };
+ /** @hidden */
+ TransitionService.prototype._defineCoreEvents = function () {
+ var Phase = exports.TransitionHookPhase;
+ var TH = TransitionHook;
+ var paths = this._criteriaPaths;
+ var NORMAL_SORT = false, REVERSE_SORT = true;
+ var ASYNCHRONOUS = false, SYNCHRONOUS = true;
+ this._defineEvent("onCreate", Phase.CREATE, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.THROW_ERROR, SYNCHRONOUS);
+ this._defineEvent("onBefore", Phase.BEFORE, 0, paths.to);
+ this._defineEvent("onStart", Phase.RUN, 0, paths.to);
+ this._defineEvent("onExit", Phase.RUN, 100, paths.exiting, REVERSE_SORT);
+ this._defineEvent("onRetain", Phase.RUN, 200, paths.retained);
+ this._defineEvent("onEnter", Phase.RUN, 300, paths.entering);
+ this._defineEvent("onFinish", Phase.RUN, 400, paths.to);
+ this._defineEvent("onSuccess", Phase.SUCCESS, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);
+ this._defineEvent("onError", Phase.ERROR, 0, paths.to, NORMAL_SORT, TH.LOG_REJECTED_RESULT, TH.LOG_ERROR, SYNCHRONOUS);
+ };
+ /** @hidden */
+ TransitionService.prototype._defineCorePaths = function () {
+ var STATE = exports.TransitionHookScope.STATE, TRANSITION = exports.TransitionHookScope.TRANSITION;
+ this._definePathType("to", TRANSITION);
+ this._definePathType("from", TRANSITION);
+ this._definePathType("exiting", STATE);
+ this._definePathType("retained", STATE);
+ this._definePathType("entering", STATE);
+ };
+ /** @hidden */
+ TransitionService.prototype._defineEvent = function (name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous) {
+ if (reverseSort === void 0) { reverseSort = false; }
+ if (getResultHandler === void 0) { getResultHandler = TransitionHook.HANDLE_RESULT; }
+ if (getErrorHandler === void 0) { getErrorHandler = TransitionHook.REJECT_ERROR; }
+ if (synchronous === void 0) { synchronous = false; }
+ var eventType = new TransitionEventType(name, hookPhase, hookOrder, criteriaMatchPath, reverseSort, getResultHandler, getErrorHandler, synchronous);
+ this._eventTypes.push(eventType);
+ makeEvent(this, this, eventType);
+ };
+
+ /** @hidden */
+ TransitionService.prototype._getEvents = function (phase) {
+ var transitionHookTypes = isDefined(phase) ?
+ this._eventTypes.filter(function (type) { return type.hookPhase === phase; }) :
+ this._eventTypes.slice();
+ return transitionHookTypes.sort(function (l, r) {
+ var cmpByPhase = l.hookPhase - r.hookPhase;
+ return cmpByPhase === 0 ? l.hookOrder - r.hookOrder : cmpByPhase;
+ });
+ };
+ /**
+ * Adds a Path to be used as a criterion against a TreeChanges path
+ *
+ * For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.
+ * It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`
+ * Each state in the exiting path is checked against the criteria and returned as part of the match.
+ *
+ * Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.
+ * It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`
+ * Only the tail of the `to` path is checked against the criteria and returned as part of the match.
+ *
+ * @hidden
+ */
+ TransitionService.prototype._definePathType = function (name, hookScope) {
+ this._criteriaPaths[name] = { name: name, scope: hookScope };
+ };
+ /** * @hidden */
+ TransitionService.prototype._getPathTypes = function () {
+ return this._criteriaPaths;
+ };
+ /** @hidden */
+ TransitionService.prototype.getHooks = function (hookName) {
+ return this._registeredHooks[hookName];
+ };
+ /** @hidden */
+ TransitionService.prototype._registerCoreTransitionHooks = function () {
+ var fns = this._deregisterHookFns;
+ fns.addCoreResolves = registerAddCoreResolvables(this);
+ fns.ignored = registerIgnoredTransitionHook(this);
+ fns.invalid = registerInvalidTransitionHook(this);
+ // Wire up redirectTo hook
+ fns.redirectTo = registerRedirectToHook(this);
+ // Wire up onExit/Retain/Enter state hooks
+ fns.onExit = registerOnExitHook(this);
+ fns.onRetain = registerOnRetainHook(this);
+ fns.onEnter = registerOnEnterHook(this);
+ // Wire up Resolve hooks
+ fns.eagerResolve = registerEagerResolvePath(this);
+ fns.lazyResolve = registerLazyResolveState(this);
+ // Wire up the View management hooks
+ fns.loadViews = registerLoadEnteringViews(this);
+ fns.activateViews = registerActivateViews(this);
+ // Updates global state after a transition
+ fns.updateGlobals = registerUpdateGlobalState(this);
+ // After globals.current is updated at priority: 10000
+ fns.updateUrl = registerUpdateUrl(this);
+ // Lazy load state trees
+ fns.lazyLoad = registerLazyLoadHook(this);
+ };
+ return TransitionService;
+}());
+
+/**
+ * @coreapi
+ * @module state
+ */
+/** */
+/**
+ * Provides state related service functions
+ *
+ * This class provides services related to ui-router states.
+ * An instance of this class is located on the global [[UIRouter]] object.
+ */
+var StateService = /** @class */ (function () {
+ /** @internalapi */
+ function StateService(router) {
+ this.router = router;
+ /** @internalapi */
+ this.invalidCallbacks = [];
+ /** @hidden */
+ this._defaultErrorHandler = function $defaultErrorHandler($error$) {
+ if ($error$ instanceof Error && $error$.stack) {
+ console.error($error$);
+ console.error($error$.stack);
+ }
+ else if ($error$ instanceof Rejection) {
+ console.error($error$.toString());
+ if ($error$.detail && $error$.detail.stack)
+ console.error($error$.detail.stack);
+ }
+ else {
+ console.error($error$);
+ }
+ };
+ var getters = ['current', '$current', 'params', 'transition'];
+ var boundFns = Object.keys(StateService.prototype).filter(not(inArray(getters)));
+ createProxyFunctions(val(StateService.prototype), this, val(this), boundFns);
+ }
+ Object.defineProperty(StateService.prototype, "transition", {
+ /**
+ * The [[Transition]] currently in progress (or null)
+ *
+ * This is a passthrough through to [[UIRouterGlobals.transition]]
+ */
+ get: function () { return this.router.globals.transition; },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(StateService.prototype, "params", {
+ /**
+ * The latest successful state parameters
+ *
+ * This is a passthrough through to [[UIRouterGlobals.params]]
+ */
+ get: function () { return this.router.globals.params; },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(StateService.prototype, "current", {
+ /**
+ * The current [[StateDeclaration]]
+ *
+ * This is a passthrough through to [[UIRouterGlobals.current]]
+ */
+ get: function () { return this.router.globals.current; },
+ enumerable: true,
+ configurable: true
+ });
+ Object.defineProperty(StateService.prototype, "$current", {
+ /**
+ * The current [[StateObject]]
+ *
+ * This is a passthrough through to [[UIRouterGlobals.$current]]
+ */
+ get: function () { return this.router.globals.$current; },
+ enumerable: true,
+ configurable: true
+ });
+ /** @internalapi */
+ StateService.prototype.dispose = function () {
+ this.defaultErrorHandler(noop$1);
+ this.invalidCallbacks = [];
+ };
+ /**
+ * Handler for when [[transitionTo]] is called with an invalid state.
+ *
+ * Invokes the [[onInvalid]] callbacks, in natural order.
+ * Each callback's return value is checked in sequence until one of them returns an instance of TargetState.
+ * The results of the callbacks are wrapped in $q.when(), so the callbacks may return promises.
+ *
+ * If a callback returns an TargetState, then it is used as arguments to $state.transitionTo() and the result returned.
+ *
+ * @internalapi
+ */
+ StateService.prototype._handleInvalidTargetState = function (fromPath, toState) {
+ var _this = this;
+ var fromState = PathUtils.makeTargetState(this.router.stateRegistry, fromPath);
+ var globals = this.router.globals;
+ var latestThing = function () { return globals.transitionHistory.peekTail(); };
+ var latest = latestThing();
+ var callbackQueue = new Queue(this.invalidCallbacks.slice());
+ var injector = new ResolveContext(fromPath).injector();
+ var checkForRedirect = function (result) {
+ if (!(result instanceof TargetState)) {
+ return;
+ }
+ var target = result;
+ // Recreate the TargetState, in case the state is now defined.
+ target = _this.target(target.identifier(), target.params(), target.options());
+ if (!target.valid()) {
+ return Rejection.invalid(target.error()).toPromise();
+ }
+ if (latestThing() !== latest) {
+ return Rejection.superseded().toPromise();
+ }
+ return _this.transitionTo(target.identifier(), target.params(), target.options());
+ };
+ function invokeNextCallback() {
+ var nextCallback = callbackQueue.dequeue();
+ if (nextCallback === undefined)
+ return Rejection.invalid(toState.error()).toPromise();
+ var callbackResult = services.$q.when(nextCallback(toState, fromState, injector));
+ return callbackResult.then(checkForRedirect).then(function (result) { return result || invokeNextCallback(); });
+ }
+ return invokeNextCallback();
+ };
+ /**
+ * Registers an Invalid State handler
+ *
+ * Registers a [[OnInvalidCallback]] function to be invoked when [[StateService.transitionTo]]
+ * has been called with an invalid state reference parameter
+ *
+ * Example:
+ * ```js
+ * stateService.onInvalid(function(to, from, injector) {
+ * if (to.name() === 'foo') {
+ * let lazyLoader = injector.get('LazyLoadService');
+ * return lazyLoader.load('foo')
+ * .then(() => stateService.target('foo'));
+ * }
+ * });
+ * ```
+ *
+ * @param {function} callback invoked when the toState is invalid
+ * This function receives the (invalid) toState, the fromState, and an injector.
+ * The function may optionally return a [[TargetState]] or a Promise for a TargetState.
+ * If one is returned, it is treated as a redirect.
+ *
+ * @returns a function which deregisters the callback
+ */
+ StateService.prototype.onInvalid = function (callback) {
+ this.invalidCallbacks.push(callback);
+ return function deregisterListener() {
+ removeFrom(this.invalidCallbacks)(callback);
+ }.bind(this);
+ };
+ /**
+ * Reloads the current state
+ *
+ * A method that force reloads the current state, or a partial state hierarchy.
+ * All resolves are re-resolved, and components reinstantiated.
+ *
+ * #### Example:
+ * ```js
+ * let app angular.module('app', ['ui.router']);
+ *
+ * app.controller('ctrl', function ($scope, $state) {
+ * $scope.reload = function(){
+ * $state.reload();
+ * }
+ * });
+ * ```
+ *
+ * Note: `reload()` is just an alias for:
+ *
+ * ```js
+ * $state.transitionTo($state.current, $state.params, {
+ * reload: true, inherit: false
+ * });
+ * ```
+ *
+ * @param reloadState A state name or a state object.
+ * If present, this state and all its children will be reloaded, but ancestors will not reload.
+ *
+ * #### Example:
+ * ```js
+ * //assuming app application consists of 3 states: 'contacts', 'contacts.detail', 'contacts.detail.item'
+ * //and current state is 'contacts.detail.item'
+ * let app angular.module('app', ['ui.router']);
+ *
+ * app.controller('ctrl', function ($scope, $state) {
+ * $scope.reload = function(){
+ * //will reload 'contact.detail' and nested 'contact.detail.item' states
+ * $state.reload('contact.detail');
+ * }
+ * });
+ * ```
+ *
+ * @returns A promise representing the state of the new transition. See [[StateService.go]]
+ */
+ StateService.prototype.reload = function (reloadState) {
+ return this.transitionTo(this.current, this.params, {
+ reload: isDefined(reloadState) ? reloadState : true,
+ inherit: false,
+ notify: false,
+ });
+ };
+
+ /**
+ * Transition to a different state and/or parameters
+ *
+ * Convenience method for transitioning to a new state.
+ *
+ * `$state.go` calls `$state.transitionTo` internally but automatically sets options to
+ * `{ location: true, inherit: true, relative: router.globals.$current, notify: true }`.
+ * This allows you to use either an absolute or relative `to` argument (because of `relative: router.globals.$current`).
+ * It also allows you to specify * only the parameters you'd like to update, while letting unspecified parameters
+ * inherit from the current parameter values (because of `inherit: true`).
+ *
+ * #### Example:
+ * ```js
+ * let app = angular.module('app', ['ui.router']);
+ *
+ * app.controller('ctrl', function ($scope, $state) {
+ * $scope.changeState = function () {
+ * $state.go('contact.detail');
+ * };
+ * });
+ * ```
+ *
+ * @param to Absolute state name, state object, or relative state path (relative to current state).
+ *
+ * Some examples:
+ *
+ * - `$state.go('contact.detail')` - will go to the `contact.detail` state
+ * - `$state.go('^')` - will go to the parent state
+ * - `$state.go('^.sibling')` - if current state is `home.child`, will go to the `home.sibling` state
+ * - `$state.go('.child.grandchild')` - if current state is home, will go to the `home.child.grandchild` state
+ *
+ * @param params A map of the parameters that will be sent to the state, will populate $stateParams.
+ *
+ * Any parameters that are not specified will be inherited from current parameter values (because of `inherit: true`).
+ * This allows, for example, going to a sibling state that shares parameters defined by a parent state.
+ *
+ * @param options Transition options
+ *
+ * @returns {promise} A promise representing the state of the new transition.
+ */
+ StateService.prototype.go = function (to, params, options) {
+ var defautGoOpts = { relative: this.$current, inherit: true };
+ var transOpts = defaults(options, defautGoOpts, defaultTransOpts);
+ return this.transitionTo(to, params, transOpts);
+ };
+
+ /**
+ * Creates a [[TargetState]]
+ *
+ * This is a factory method for creating a TargetState
+ *
+ * This may be returned from a Transition Hook to redirect a transition, for example.
+ */
+ StateService.prototype.target = function (identifier, params, options) {
+ if (options === void 0) { options = {}; }
+ // If we're reloading, find the state object to reload from
+ if (isObject(options.reload) && !options.reload.name)
+ throw new Error('Invalid reload state object');
+ var reg = this.router.stateRegistry;
+ options.reloadState = options.reload === true ? reg.root() : reg.matcher.find(options.reload, options.relative);
+ if (options.reload && !options.reloadState)
+ throw new Error("No such reload state '" + (isString(options.reload) ? options.reload : options.reload.name) + "'");
+ return new TargetState(this.router.stateRegistry, identifier, params, options);
+ };
+
+ StateService.prototype.getCurrentPath = function () {
+ var _this = this;
+ var globals = this.router.globals;
+ var latestSuccess = globals.successfulTransitions.peekTail();
+ var rootPath = function () { return [new PathNode(_this.router.stateRegistry.root())]; };
+ return latestSuccess ? latestSuccess.treeChanges().to : rootPath();
+ };
+ /**
+ * Low-level method for transitioning to a new state.
+ *
+ * The [[go]] method (which uses `transitionTo` internally) is recommended in most situations.
+ *
+ * #### Example:
+ * ```js
+ * let app = angular.module('app', ['ui.router']);
+ *
+ * app.controller('ctrl', function ($scope, $state) {
+ * $scope.changeState = function () {
+ * $state.transitionTo('contact.detail');
+ * };
+ * });
+ * ```
+ *
+ * @param to State name or state object.
+ * @param toParams A map of the parameters that will be sent to the state,
+ * will populate $stateParams.
+ * @param options Transition options
+ *
+ * @returns A promise representing the state of the new transition. See [[go]]
+ */
+ StateService.prototype.transitionTo = function (to, toParams, options) {
+ var _this = this;
+ if (toParams === void 0) { toParams = {}; }
+ if (options === void 0) { options = {}; }
+ var router = this.router;
+ var globals = router.globals;
+ options = defaults(options, defaultTransOpts);
+ var getCurrent = function () {
+ return globals.transition;
+ };
+ options = extend(options, { current: getCurrent });
+ var ref = this.target(to, toParams, options);
+ var currentPath = this.getCurrentPath();
+ if (!ref.exists())
+ return this._handleInvalidTargetState(currentPath, ref);
+ if (!ref.valid())
+ return silentRejection(ref.error());
+ /**
+ * Special handling for Ignored, Aborted, and Redirected transitions
+ *
+ * The semantics for the transition.run() promise and the StateService.transitionTo()
+ * promise differ. For instance, the run() promise may be rejected because it was
+ * IGNORED, but the transitionTo() promise is resolved because from the user perspective
+ * no error occurred. Likewise, the transition.run() promise may be rejected because of
+ * a Redirect, but the transitionTo() promise is chained to the new Transition's promise.
+ */
+ var rejectedTransitionHandler = function (transition) { return function (error) {
+ if (error instanceof Rejection) {
+ var isLatest = router.globals.lastStartedTransitionId === transition.$id;
+ if (error.type === exports.RejectType.IGNORED) {
+ isLatest && router.urlRouter.update();
+ // Consider ignored `Transition.run()` as a successful `transitionTo`
+ return services.$q.when(globals.current);
+ }
+ var detail = error.detail;
+ if (error.type === exports.RejectType.SUPERSEDED && error.redirected && detail instanceof TargetState) {
+ // If `Transition.run()` was redirected, allow the `transitionTo()` promise to resolve successfully
+ // by returning the promise for the new (redirect) `Transition.run()`.
+ var redirect = transition.redirect(detail);
+ return redirect.run().catch(rejectedTransitionHandler(redirect));
+ }
+ if (error.type === exports.RejectType.ABORTED) {
+ isLatest && router.urlRouter.update();
+ return services.$q.reject(error);
+ }
+ }
+ var errorHandler = _this.defaultErrorHandler();
+ errorHandler(error);
+ return services.$q.reject(error);
+ }; };
+ var transition = this.router.transitionService.create(currentPath, ref);
+ var transitionToPromise = transition.run().catch(rejectedTransitionHandler(transition));
+ silenceUncaughtInPromise(transitionToPromise); // issue #2676
+ // Return a promise for the transition, which also has the transition object on it.
+ return extend(transitionToPromise, { transition: transition });
+ };
+
+ /**
+ * Checks if the current state *is* the provided state
+ *
+ * Similar to [[includes]] but only checks for the full state name.
+ * If params is supplied then it will be tested for strict equality against the current
+ * active params object, so all params must match with none missing and no extras.
+ *
+ * #### Example:
+ * ```js
+ * $state.$current.name = 'contacts.details.item';
+ *
+ * // absolute name
+ * $state.is('contact.details.item'); // returns true
+ * $state.is(contactDetailItemStateObject); // returns true
+ * ```
+ *
+ * // relative name (. and ^), typically from a template
+ * // E.g. from the 'contacts.details' template
+ * ```html
+ *
Item
+ * ```
+ *
+ * @param stateOrName The state name (absolute or relative) or state object you'd like to check.
+ * @param params A param object, e.g. `{sectionId: section.id}`, that you'd like
+ * to test against the current active state.
+ * @param options An options object. The options are:
+ * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will
+ * test relative to `options.relative` state (or name).
+ *
+ * @returns Returns true if it is the state.
+ */
+ StateService.prototype.is = function (stateOrName, params, options) {
+ options = defaults(options, { relative: this.$current });
+ var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);
+ if (!isDefined(state))
+ return undefined;
+ if (this.$current !== state)
+ return false;
+ if (!params)
+ return true;
+ var schema = state.parameters({ inherit: true, matchingKeys: params });
+ return Param.equals(schema, Param.values(schema, params), this.params);
+ };
+
+ /**
+ * Checks if the current state *includes* the provided state
+ *
+ * A method to determine if the current active state is equal to or is the child of the
+ * state stateName. If any params are passed then they will be tested for a match as well.
+ * Not all the parameters need to be passed, just the ones you'd like to test for equality.
+ *
+ * #### Example when `$state.$current.name === 'contacts.details.item'`
+ * ```js
+ * // Using partial names
+ * $state.includes("contacts"); // returns true
+ * $state.includes("contacts.details"); // returns true
+ * $state.includes("contacts.details.item"); // returns true
+ * $state.includes("contacts.list"); // returns false
+ * $state.includes("about"); // returns false
+ * ```
+ *
+ * #### Glob Examples when `* $state.$current.name === 'contacts.details.item.url'`:
+ * ```js
+ * $state.includes("*.details.*.*"); // returns true
+ * $state.includes("*.details.**"); // returns true
+ * $state.includes("**.item.**"); // returns true
+ * $state.includes("*.details.item.url"); // returns true
+ * $state.includes("*.details.*.url"); // returns true
+ * $state.includes("*.details.*"); // returns false
+ * $state.includes("item.**"); // returns false
+ * ```
+ *
+ * @param stateOrName A partial name, relative name, glob pattern,
+ * or state object to be searched for within the current state name.
+ * @param params A param object, e.g. `{sectionId: section.id}`,
+ * that you'd like to test against the current active state.
+ * @param options An options object. The options are:
+ * - `relative`: If `stateOrName` is a relative state name and `options.relative` is set, .is will
+ * test relative to `options.relative` state (or name).
+ *
+ * @returns {boolean} Returns true if it does include the state
+ */
+ StateService.prototype.includes = function (stateOrName, params, options) {
+ options = defaults(options, { relative: this.$current });
+ var glob = isString(stateOrName) && Glob.fromString(stateOrName);
+ if (glob) {
+ if (!glob.matches(this.$current.name))
+ return false;
+ stateOrName = this.$current.name;
+ }
+ var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative), include = this.$current.includes;
+ if (!isDefined(state))
+ return undefined;
+ if (!isDefined(include[state.name]))
+ return false;
+ if (!params)
+ return true;
+ var schema = state.parameters({ inherit: true, matchingKeys: params });
+ return Param.equals(schema, Param.values(schema, params), this.params);
+ };
+
+ /**
+ * Generates a URL for a state and parameters
+ *
+ * Returns the url for the given state populated with the given params.
+ *
+ * #### Example:
+ * ```js
+ * expect($state.href("about.person", { person: "bob" })).toEqual("/about/bob");
+ * ```
+ *
+ * @param stateOrName The state name or state object you'd like to generate a url from.
+ * @param params An object of parameter values to fill the state's required parameters.
+ * @param options Options object. The options are:
+ *
+ * @returns {string} compiled state url
+ */
+ StateService.prototype.href = function (stateOrName, params, options) {
+ var defaultHrefOpts = {
+ lossy: true,
+ inherit: true,
+ absolute: false,
+ relative: this.$current,
+ };
+ options = defaults(options, defaultHrefOpts);
+ params = params || {};
+ var state = this.router.stateRegistry.matcher.find(stateOrName, options.relative);
+ if (!isDefined(state))
+ return null;
+ if (options.inherit)
+ params = this.params.$inherit(params, this.$current, state);
+ var nav = (state && options.lossy) ? state.navigable : state;
+ if (!nav || nav.url === undefined || nav.url === null) {
+ return null;
+ }
+ return this.router.urlRouter.href(nav.url, params, {
+ absolute: options.absolute,
+ });
+ };
+
+ /**
+ * Sets or gets the default [[transitionTo]] error handler.
+ *
+ * The error handler is called when a [[Transition]] is rejected or when any error occurred during the Transition.
+ * This includes errors caused by resolves and transition hooks.
+ *
+ * Note:
+ * This handler does not receive certain Transition rejections.
+ * Redirected and Ignored Transitions are not considered to be errors by [[StateService.transitionTo]].
+ *
+ * The built-in default error handler logs the error to the console.
+ *
+ * You can provide your own custom handler.
+ *
+ * #### Example:
+ * ```js
+ * stateService.defaultErrorHandler(function() {
+ * // Do not log transitionTo errors
+ * });
+ * ```
+ *
+ * @param handler a global error handler function
+ * @returns the current global error handler
+ */
+ StateService.prototype.defaultErrorHandler = function (handler) {
+ return this._defaultErrorHandler = handler || this._defaultErrorHandler;
+ };
+ StateService.prototype.get = function (stateOrName, base) {
+ var reg = this.router.stateRegistry;
+ if (arguments.length === 0)
+ return reg.get();
+ return reg.get(stateOrName, base || this.$current);
+ };
+ /**
+ * Lazy loads a state
+ *
+ * Explicitly runs a state's [[StateDeclaration.lazyLoad]] function.
+ *
+ * @param stateOrName the state that should be lazy loaded
+ * @param transition the optional Transition context to use (if the lazyLoad function requires an injector, etc)
+ * Note: If no transition is provided, a noop transition is created using the from the current state to the current state.
+ * This noop transition is not actually run.
+ *
+ * @returns a promise to lazy load
+ */
+ StateService.prototype.lazyLoad = function (stateOrName, transition) {
+ var state = this.get(stateOrName);
+ if (!state || !state.lazyLoad)
+ throw new Error("Can not lazy load " + stateOrName);
+ var currentPath = this.getCurrentPath();
+ var target = PathUtils.makeTargetState(this.router.stateRegistry, currentPath);
+ transition = transition || this.router.transitionService.create(currentPath, target);
+ return lazyLoadState(transition, state);
+ };
+ return StateService;
+}());
+
+/**
+ * # Transition subsystem
+ *
+ * This module contains APIs related to a Transition.
+ *
+ * See:
+ * - [[TransitionService]]
+ * - [[Transition]]
+ * - [[HookFn]], [[TransitionHookFn]], [[TransitionStateHookFn]], [[HookMatchCriteria]], [[HookResult]]
+ *
+ * @coreapi
+ * @preferred
+ * @module transition
+ */ /** for typedoc */
+
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+/**
+ * An angular1-like promise api
+ *
+ * This object implements four methods similar to the
+ * [angular 1 promise api](https://docs.angularjs.org/api/ng/service/$q)
+ *
+ * UI-Router evolved from an angular 1 library to a framework agnostic library.
+ * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.
+ *
+ * This API provides native ES6 promise support wrapped as a $q-like API.
+ * Internally, UI-Router uses this $q object to perform promise operations.
+ * The `angular-ui-router` (ui-router for angular 1) uses the $q API provided by angular.
+ *
+ * $q-like promise api
+ */
+var $q = {
+ /** Normalizes a value as a promise */
+ when: function (val) { return new Promise(function (resolve, reject) { return resolve(val); }); },
+ /** Normalizes a value as a promise rejection */
+ reject: function (val) { return new Promise(function (resolve, reject) { reject(val); }); },
+ /** @returns a deferred object, which has `resolve` and `reject` functions */
+ defer: function () {
+ var deferred = {};
+ deferred.promise = new Promise(function (resolve, reject) {
+ deferred.resolve = resolve;
+ deferred.reject = reject;
+ });
+ return deferred;
+ },
+ /** Like Promise.all(), but also supports object key/promise notation like $q */
+ all: function (promises) {
+ if (isArray(promises)) {
+ return Promise.all(promises);
+ }
+ if (isObject(promises)) {
+ // Convert promises map to promises array.
+ // When each promise resolves, map it to a tuple { key: key, val: val }
+ var chain = Object.keys(promises)
+ .map(function (key) { return promises[key].then(function (val) { return ({ key: key, val: val }); }); });
+ // Then wait for all promises to resolve, and convert them back to an object
+ return $q.all(chain).then(function (values) {
+ return values.reduce(function (acc, tuple) { acc[tuple.key] = tuple.val; return acc; }, {});
+ });
+ }
+ }
+};
+
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+// globally available injectables
+var globals = {};
+var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+var ARGUMENT_NAMES = /([^\s,]+)/g;
+/**
+ * A basic angular1-like injector api
+ *
+ * This object implements four methods similar to the
+ * [angular 1 dependency injector](https://docs.angularjs.org/api/auto/service/$injector)
+ *
+ * UI-Router evolved from an angular 1 library to a framework agnostic library.
+ * However, some of the `@uirouter/core` code uses these ng1 style APIs to support ng1 style dependency injection.
+ *
+ * This object provides a naive implementation of a globally scoped dependency injection system.
+ * It supports the following DI approaches:
+ *
+ * ### Function parameter names
+ *
+ * A function's `.toString()` is called, and the parameter names are parsed.
+ * This only works when the parameter names aren't "mangled" by a minifier such as UglifyJS.
+ *
+ * ```js
+ * function injectedFunction(FooService, BarService) {
+ * // FooService and BarService are injected
+ * }
+ * ```
+ *
+ * ### Function annotation
+ *
+ * A function may be annotated with an array of dependency names as the `$inject` property.
+ *
+ * ```js
+ * injectedFunction.$inject = [ 'FooService', 'BarService' ];
+ * function injectedFunction(fs, bs) {
+ * // FooService and BarService are injected as fs and bs parameters
+ * }
+ * ```
+ *
+ * ### Array notation
+ *
+ * An array provides the names of the dependencies to inject (as strings).
+ * The function is the last element of the array.
+ *
+ * ```js
+ * [ 'FooService', 'BarService', function (fs, bs) {
+ * // FooService and BarService are injected as fs and bs parameters
+ * }]
+ * ```
+ *
+ * @type {$InjectorLike}
+ */
+var $injector = {
+ /** Gets an object from DI based on a string token */
+ get: function (name) { return globals[name]; },
+ /** Returns true if an object named `name` exists in global DI */
+ has: function (name) { return $injector.get(name) != null; },
+ /**
+ * Injects a function
+ *
+ * @param fn the function to inject
+ * @param context the function's `this` binding
+ * @param locals An object with additional DI tokens and values, such as `{ someToken: { foo: 1 } }`
+ */
+ invoke: function (fn, context, locals) {
+ var all = extend({}, globals, locals || {});
+ var params = $injector.annotate(fn);
+ var ensureExist = assertPredicate(function (key) { return all.hasOwnProperty(key); }, function (key) { return "DI can't find injectable: '" + key + "'"; });
+ var args = params.filter(ensureExist).map(function (x) { return all[x]; });
+ if (isFunction(fn))
+ return fn.apply(context, args);
+ else
+ return fn.slice(-1)[0].apply(context, args);
+ },
+ /**
+ * Returns a function's dependencies
+ *
+ * Analyzes a function (or array) and returns an array of DI tokens that the function requires.
+ * @return an array of `string`s
+ */
+ annotate: function (fn) {
+ if (!isInjectable(fn))
+ throw new Error("Not an injectable function: " + fn);
+ if (fn && fn.$inject)
+ return fn.$inject;
+ if (isArray(fn))
+ return fn.slice(0, -1);
+ var fnStr = fn.toString().replace(STRIP_COMMENTS, '');
+ var result = fnStr.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')).match(ARGUMENT_NAMES);
+ return result || [];
+ }
+};
+
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+var keyValsToObjectR = function (accum, _a) {
+ var key = _a[0], val = _a[1];
+ if (!accum.hasOwnProperty(key)) {
+ accum[key] = val;
+ }
+ else if (isArray(accum[key])) {
+ accum[key].push(val);
+ }
+ else {
+ accum[key] = [accum[key], val];
+ }
+ return accum;
+};
+var getParams = function (queryString) {
+ return queryString.split("&").filter(identity).map(splitEqual).reduce(keyValsToObjectR, {});
+};
+function parseUrl$1(url) {
+ var orEmptyString = function (x) { return x || ""; };
+ var _a = splitHash(url).map(orEmptyString), beforehash = _a[0], hash = _a[1];
+ var _b = splitQuery(beforehash).map(orEmptyString), path = _b[0], search = _b[1];
+ return { path: path, search: search, hash: hash, url: url };
+}
+var buildUrl = function (loc) {
+ var path = loc.path();
+ var searchObject = loc.search();
+ var hash = loc.hash();
+ var search = Object.keys(searchObject).map(function (key) {
+ var param = searchObject[key];
+ var vals = isArray(param) ? param : [param];
+ return vals.map(function (val) { return key + "=" + val; });
+ }).reduce(unnestR, []).join("&");
+ return path + (search ? "?" + search : "") + (hash ? "#" + hash : "");
+};
+function locationPluginFactory(name, isHtml5, serviceClass, configurationClass) {
+ return function (router) {
+ var service = router.locationService = new serviceClass(router);
+ var configuration = router.locationConfig = new configurationClass(router, isHtml5);
+ function dispose(router) {
+ router.dispose(service);
+ router.dispose(configuration);
+ }
+ return { name: name, service: service, configuration: configuration, dispose: dispose };
+ };
+}
+
+/**
+ * @internalapi
+ * @module vanilla
+ */ /** */
+/** A base `LocationServices` */
+var BaseLocationServices = /** @class */ (function () {
+ function BaseLocationServices(router, fireAfterUpdate) {
+ var _this = this;
+ this.fireAfterUpdate = fireAfterUpdate;
+ this._listener = function (evt) { return _this._listeners.forEach(function (cb) { return cb(evt); }); };
+ this._listeners = [];
+ this.hash = function () { return parseUrl$1(_this._get()).hash; };
+ this.path = function () { return parseUrl$1(_this._get()).path; };
+ this.search = function () { return getParams(parseUrl$1(_this._get()).search); };
+ this._location = root.location;
+ this._history = root.history;
+ }
+ BaseLocationServices.prototype.url = function (url, replace) {
+ if (replace === void 0) { replace = true; }
+ if (isDefined(url) && url !== this._get()) {
+ this._set(null, null, url, replace);
+ if (this.fireAfterUpdate) {
+ this._listeners.forEach(function (cb) { return cb({ url: url }); });
+ }
+ }
+ return buildUrl(this);
+ };
+ BaseLocationServices.prototype.onChange = function (cb) {
+ var _this = this;
+ this._listeners.push(cb);
+ return function () { return removeFrom(_this._listeners, cb); };
+ };
+ BaseLocationServices.prototype.dispose = function (router) {
+ deregAll(this._listeners);
+ };
+ return BaseLocationServices;
+}());
+
+var __extends = (undefined && undefined.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+/** A `LocationServices` that uses the browser hash "#" to get/set the current location */
+var HashLocationService = /** @class */ (function (_super) {
+ __extends(HashLocationService, _super);
+ function HashLocationService(router) {
+ var _this = _super.call(this, router, false) || this;
+ root.addEventListener('hashchange', _this._listener, false);
+ return _this;
+ }
+ HashLocationService.prototype._get = function () {
+ return trimHashVal(this._location.hash);
+ };
+ HashLocationService.prototype._set = function (state, title, url, replace) {
+ this._location.hash = url;
+ };
+ HashLocationService.prototype.dispose = function (router) {
+ _super.prototype.dispose.call(this, router);
+ root.removeEventListener('hashchange', this._listener);
+ };
+ return HashLocationService;
+}(BaseLocationServices));
+
+var __extends$1 = (undefined && undefined.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+/** A `LocationServices` that gets/sets the current location from an in-memory object */
+var MemoryLocationService = /** @class */ (function (_super) {
+ __extends$1(MemoryLocationService, _super);
+ function MemoryLocationService(router) {
+ return _super.call(this, router, true) || this;
+ }
+ MemoryLocationService.prototype._get = function () {
+ return this._url;
+ };
+ MemoryLocationService.prototype._set = function (state, title, url, replace) {
+ this._url = url;
+ };
+ return MemoryLocationService;
+}(BaseLocationServices));
+
+var __extends$2 = (undefined && undefined.__extends) || (function () {
+ var extendStatics = Object.setPrototypeOf ||
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
+ return function (d, b) {
+ extendStatics(d, b);
+ function __() { this.constructor = d; }
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
+ };
+})();
+/**
+ * A `LocationServices` that gets/sets the current location using the browser's `location` and `history` apis
+ *
+ * Uses `history.pushState` and `history.replaceState`
+ */
+var PushStateLocationService = /** @class */ (function (_super) {
+ __extends$2(PushStateLocationService, _super);
+ function PushStateLocationService(router) {
+ var _this = _super.call(this, router, true) || this;
+ _this._config = router.urlService.config;
+ root.addEventListener('popstate', _this._listener, false);
+ return _this;
+ }
+
+ /**
+ * Gets the base prefix without:
+ * - trailing slash
+ * - trailing filename
+ * - protocol and hostname
+ *
+ * If , this returns '/base'.
+ * If , this returns '/base'.
+ *
+ * See: https://html.spec.whatwg.org/dev/semantics.html#the-base-element
+ */
+ PushStateLocationService.prototype._getBasePrefix = function () {
+ return stripFile(this._config.baseHref());
+ };
+ PushStateLocationService.prototype._get = function () {
+ var _a = this._location, pathname = _a.pathname, hash = _a.hash, search = _a.search;
+ search = splitQuery(search)[1]; // strip ? if found
+ hash = splitHash(hash)[1]; // strip # if found
+ var basePrefix = this._getBasePrefix();
+ var exactMatch = pathname === this._config.baseHref();
+ var startsWith = pathname.startsWith(basePrefix);
+ pathname = exactMatch ? '/' : startsWith ? pathname.substring(basePrefix.length) : pathname;
+ return pathname + (search ? '?' + search : '') + (hash ? '#' + hash : '');
+ };
+ PushStateLocationService.prototype._set = function (state, title, url, replace) {
+ var fullUrl = this._getBasePrefix() + url;
+ if (replace) {
+ this._history.replaceState(state, title, fullUrl);
+ }
+ else {
+ this._history.pushState(state, title, fullUrl);
+ }
+ };
+ PushStateLocationService.prototype.dispose = function (router) {
+ _super.prototype.dispose.call(this, router);
+ root.removeEventListener('popstate', this._listener);
+ };
+ return PushStateLocationService;
+}(BaseLocationServices));
+
+/** A `LocationConfig` mock that gets/sets all config from an in-memory object */
+var MemoryLocationConfig = /** @class */ (function () {
+ function MemoryLocationConfig() {
+ var _this = this;
+ this._baseHref = '';
+ this._port = 80;
+ this._protocol = "http";
+ this._host = "localhost";
+ this._hashPrefix = "";
+ this.port = function () { return _this._port; };
+ this.protocol = function () { return _this._protocol; };
+ this.host = function () { return _this._host; };
+ this.baseHref = function () { return _this._baseHref; };
+ this.html5Mode = function () { return false; };
+ this.hashPrefix = function (newval) { return isDefined(newval) ? _this._hashPrefix = newval : _this._hashPrefix; };
+ this.dispose = noop$1;
+ }
+ return MemoryLocationConfig;
+}());
+
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+/** A `LocationConfig` that delegates to the browser's `location` object */
+var BrowserLocationConfig = /** @class */ (function () {
+ function BrowserLocationConfig(router, _isHtml5) {
+ if (_isHtml5 === void 0) { _isHtml5 = false; }
+ this._isHtml5 = _isHtml5;
+ this._baseHref = undefined;
+ this._hashPrefix = "";
+ }
+ BrowserLocationConfig.prototype.port = function () {
+ if (location.port) {
+ return Number(location.port);
+ }
+ return this.protocol() === 'https' ? 443 : 80;
+ };
+ BrowserLocationConfig.prototype.protocol = function () {
+ return location.protocol.replace(/:/g, '');
+ };
+ BrowserLocationConfig.prototype.host = function () {
+ return location.hostname;
+ };
+ BrowserLocationConfig.prototype.html5Mode = function () {
+ return this._isHtml5;
+ };
+ BrowserLocationConfig.prototype.hashPrefix = function (newprefix) {
+ return isDefined(newprefix) ? this._hashPrefix = newprefix : this._hashPrefix;
+ };
+
+ BrowserLocationConfig.prototype.baseHref = function (href) {
+ return isDefined(href) ? this._baseHref = href :
+ isDefined(this._baseHref) ? this._baseHref : this.applyDocumentBaseHref();
+ };
+ BrowserLocationConfig.prototype.applyDocumentBaseHref = function () {
+ var baseTag = document.getElementsByTagName("base")[0];
+ return this._baseHref = baseTag ? baseTag.href.substr(location.origin.length) : "";
+ };
+ BrowserLocationConfig.prototype.dispose = function () { };
+ return BrowserLocationConfig;
+}());
+
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+function servicesPlugin(router) {
+ services.$injector = $injector;
+ services.$q = $q;
+ return { name: "vanilla.services", $q: $q, $injector: $injector, dispose: function () { return null; } };
+}
+/** A `UIRouterPlugin` uses the browser hash to get/set the current location */
+var hashLocationPlugin = locationPluginFactory('vanilla.hashBangLocation', false, HashLocationService, BrowserLocationConfig);
+/** A `UIRouterPlugin` that gets/sets the current location using the browser's `location` and `history` apis */
+var pushStateLocationPlugin = locationPluginFactory("vanilla.pushStateLocation", true, PushStateLocationService, BrowserLocationConfig);
+/** A `UIRouterPlugin` that gets/sets the current location from an in-memory object */
+var memoryLocationPlugin = locationPluginFactory("vanilla.memoryLocation", false, MemoryLocationService, MemoryLocationConfig);
+
+/**
+ * @internalapi
+ * @module vanilla
+ */
+/** */
+
+/**
+ * # Core classes and interfaces
+ *
+ * The classes and interfaces that are core to ui-router and do not belong
+ * to a more specific subsystem (such as resolve).
+ *
+ * @coreapi
+ * @preferred
+ * @module core
+ */ /** for typedoc */
+/** @internalapi */
+var UIRouterPluginBase = /** @class */ (function () {
+ function UIRouterPluginBase() {
+ }
+ UIRouterPluginBase.prototype.dispose = function (router) { };
+ return UIRouterPluginBase;
+}());
+
+/**
+ * @coreapi
+ * @module common
+ */ /** */
+
+
+
+var index$1 = Object.freeze({
+ root: root,
+ fromJson: fromJson,
+ toJson: toJson,
+ forEach: forEach,
+ extend: extend,
+ equals: equals,
+ identity: identity,
+ noop: noop$1,
+ createProxyFunctions: createProxyFunctions,
+ inherit: inherit,
+ inArray: inArray,
+ _inArray: _inArray,
+ removeFrom: removeFrom,
+ _removeFrom: _removeFrom,
+ pushTo: pushTo,
+ _pushTo: _pushTo,
+ deregAll: deregAll,
+ defaults: defaults,
+ mergeR: mergeR,
+ ancestors: ancestors,
+ pick: pick,
+ omit: omit,
+ pluck: pluck,
+ filter: filter,
+ find: find,
+ mapObj: mapObj,
+ map: map,
+ values: values,
+ allTrueR: allTrueR,
+ anyTrueR: anyTrueR,
+ unnestR: unnestR,
+ flattenR: flattenR,
+ pushR: pushR,
+ uniqR: uniqR,
+ unnest: unnest,
+ flatten: flatten,
+ assertPredicate: assertPredicate,
+ assertMap: assertMap,
+ assertFn: assertFn,
+ pairs: pairs,
+ arrayTuples: arrayTuples,
+ applyPairs: applyPairs,
+ tail: tail,
+ copy: copy,
+ _extend: _extend,
+ silenceUncaughtInPromise: silenceUncaughtInPromise,
+ silentRejection: silentRejection,
+ notImplemented: notImplemented,
+ services: services,
+ Glob: Glob,
+ curry: curry,
+ compose: compose,
+ pipe: pipe,
+ prop: prop,
+ propEq: propEq,
+ parse: parse,
+ not: not,
+ and: and,
+ or: or,
+ all: all,
+ any: any,
+ is: is,
+ eq: eq,
+ val: val,
+ invoke: invoke,
+ pattern: pattern,
+ isUndefined: isUndefined,
+ isDefined: isDefined,
+ isNull: isNull,
+ isNullOrUndefined: isNullOrUndefined,
+ isFunction: isFunction,
+ isNumber: isNumber,
+ isString: isString,
+ isObject: isObject,
+ isArray: isArray,
+ isDate: isDate,
+ isRegExp: isRegExp,
+ isState: isState,
+ isInjectable: isInjectable,
+ isPromise: isPromise,
+ Queue: Queue,
+ maxLength: maxLength,
+ padString: padString,
+ kebobString: kebobString,
+ functionToString: functionToString,
+ fnToString: fnToString,
+ stringify: stringify,
+ beforeAfterSubstr: beforeAfterSubstr,
+ hostRegex: hostRegex,
+ stripFile: stripFile,
+ splitHash: splitHash,
+ splitQuery: splitQuery,
+ splitEqual: splitEqual,
+ trimHashVal: trimHashVal,
+ splitOnDelim: splitOnDelim,
+ joinNeighborsR: joinNeighborsR,
+ get Category () { return exports.Category; },
+ Trace: Trace,
+ trace: trace,
+ get DefType () { return exports.DefType; },
+ Param: Param,
+ ParamTypes: ParamTypes,
+ StateParams: StateParams,
+ ParamType: ParamType,
+ PathNode: PathNode,
+ PathUtils: PathUtils,
+ resolvePolicies: resolvePolicies,
+ defaultResolvePolicy: defaultResolvePolicy,
+ Resolvable: Resolvable,
+ NATIVE_INJECTOR_TOKEN: NATIVE_INJECTOR_TOKEN,
+ ResolveContext: ResolveContext,
+ resolvablesBuilder: resolvablesBuilder,
+ StateBuilder: StateBuilder,
+ StateObject: StateObject,
+ StateMatcher: StateMatcher,
+ StateQueueManager: StateQueueManager,
+ StateRegistry: StateRegistry,
+ StateService: StateService,
+ TargetState: TargetState,
+ get TransitionHookPhase () { return exports.TransitionHookPhase; },
+ get TransitionHookScope () { return exports.TransitionHookScope; },
+ HookBuilder: HookBuilder,
+ matchState: matchState,
+ RegisteredHook: RegisteredHook,
+ makeEvent: makeEvent,
+ get RejectType () { return exports.RejectType; },
+ Rejection: Rejection,
+ Transition: Transition,
+ TransitionHook: TransitionHook,
+ TransitionEventType: TransitionEventType,
+ defaultTransOpts: defaultTransOpts,
+ TransitionService: TransitionService,
+ UrlMatcher: UrlMatcher,
+ UrlMatcherFactory: UrlMatcherFactory,
+ UrlRouter: UrlRouter,
+ UrlRuleFactory: UrlRuleFactory,
+ BaseUrlRule: BaseUrlRule,
+ UrlService: UrlService,
+ ViewService: ViewService,
+ UIRouterGlobals: UIRouterGlobals,
+ UIRouter: UIRouter,
+ $q: $q,
+ $injector: $injector,
+ BaseLocationServices: BaseLocationServices,
+ HashLocationService: HashLocationService,
+ MemoryLocationService: MemoryLocationService,
+ PushStateLocationService: PushStateLocationService,
+ MemoryLocationConfig: MemoryLocationConfig,
+ BrowserLocationConfig: BrowserLocationConfig,
+ keyValsToObjectR: keyValsToObjectR,
+ getParams: getParams,
+ parseUrl: parseUrl$1,
+ buildUrl: buildUrl,
+ locationPluginFactory: locationPluginFactory,
+ servicesPlugin: servicesPlugin,
+ hashLocationPlugin: hashLocationPlugin,
+ pushStateLocationPlugin: pushStateLocationPlugin,
+ memoryLocationPlugin: memoryLocationPlugin,
+ UIRouterPluginBase: UIRouterPluginBase
+});
+
+function getNg1ViewConfigFactory() {
+ var templateFactory = null;
+ return function (path, view) {
+ templateFactory = templateFactory || services.$injector.get("$templateFactory");
+ return [new Ng1ViewConfig(path, view, templateFactory)];
+ };
+}
+var hasAnyKey = function (keys, obj) {
+ return keys.reduce(function (acc, key) { return acc || isDefined(obj[key]); }, false);
+};
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `views`.
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
+ *
+ * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
+ * and applies the state-level configuration to a view named `$default`.
+ */
+function ng1ViewsBuilder(state) {
+ // Do not process root state
+ if (!state.parent)
+ return {};
+ var tplKeys = ['templateProvider', 'templateUrl', 'template', 'notify', 'async'], ctrlKeys = ['controller', 'controllerProvider', 'controllerAs', 'resolveAs'], compKeys = ['component', 'bindings', 'componentProvider'], nonCompKeys = tplKeys.concat(ctrlKeys), allViewKeys = compKeys.concat(nonCompKeys);
+ // Do not allow a state to have both state-level props and also a `views: {}` property.
+ // A state without a `views: {}` property can declare properties for the `$default` view as properties of the state.
+ // However, the `$default` approach should not be mixed with a separate `views: ` block.
+ if (isDefined(state.views) && hasAnyKey(allViewKeys, state)) {
+ throw new Error("State '" + state.name + "' has a 'views' object. " +
+ "It cannot also have \"view properties\" at the state level. " +
+ "Move the following properties into a view (in the 'views' object): " +
+ (" " + allViewKeys.filter(function (key) { return isDefined(state[key]); }).join(", ")));
+ }
+ var views = {}, viewsObject = state.views || { "$default": pick(state, allViewKeys) };
+ forEach(viewsObject, function (config, name) {
+ // Account for views: { "": { template... } }
+ name = name || "$default";
+ // Account for views: { header: "headerComponent" }
+ if (isString(config))
+ config = { component: config };
+ // Make a shallow copy of the config object
+ config = extend({}, config);
+ // Do not allow a view to mix props for component-style view with props for template/controller-style view
+ if (hasAnyKey(compKeys, config) && hasAnyKey(nonCompKeys, config)) {
+ throw new Error("Cannot combine: " + compKeys.join("|") + " with: " + nonCompKeys.join("|") + " in stateview: '" + name + "@" + state.name + "'");
+ }
+ config.resolveAs = config.resolveAs || '$resolve';
+ config.$type = "ng1";
+ config.$context = state;
+ config.$name = name;
+ var normalized = ViewService.normalizeUIViewTarget(config.$context, config.$name);
+ config.$uiViewName = normalized.uiViewName;
+ config.$uiViewContextAnchor = normalized.uiViewContextAnchor;
+ views[name] = config;
+ });
+ return views;
+}
+var id$1 = 0;
+var Ng1ViewConfig = /** @class */ (function () {
+ function Ng1ViewConfig(path, viewDecl, factory) {
+ var _this = this;
+ this.path = path;
+ this.viewDecl = viewDecl;
+ this.factory = factory;
+ this.$id = id$1++;
+ this.loaded = false;
+ this.getTemplate = function (uiView, context) {
+ return _this.component ? _this.factory.makeComponentTemplate(uiView, context, _this.component, _this.viewDecl.bindings) : _this.template;
+ };
+ }
+ Ng1ViewConfig.prototype.load = function () {
+ var _this = this;
+ var $q = services.$q;
+ var context = new ResolveContext(this.path);
+ var params = this.path.reduce(function (acc, node) { return extend(acc, node.paramValues); }, {});
+ var promises = {
+ template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),
+ controller: $q.when(this.getController(context))
+ };
+ return $q.all(promises).then(function (results) {
+ trace.traceViewServiceEvent("Loaded", _this);
+ _this.controller = results.controller;
+ extend(_this, results.template); // Either { template: "tpl" } or { component: "cmpName" }
+ return _this;
+ });
+ };
+ /**
+ * Gets the controller for a view configuration.
+ *
+ * @returns {Function|Promise.} Returns a controller, or a promise that resolves to a controller.
+ */
+ Ng1ViewConfig.prototype.getController = function (context) {
+ var provider = this.viewDecl.controllerProvider;
+ if (!isInjectable(provider))
+ return this.viewDecl.controller;
+ var deps = services.$injector.annotate(provider);
+ var providerFn = isArray(provider) ? tail(provider) : provider;
+ var resolvable = new Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+ return Ng1ViewConfig;
+}());
+
+/** @module view */
+/** for typedoc */
+/**
+ * Service which manages loading of templates from a ViewConfig.
+ */
+var TemplateFactory = /** @class */ (function () {
+ function TemplateFactory() {
+ var _this = this;
+ /** @hidden */ this._useHttp = ng.version.minor < 3;
+ /** @hidden */ this.$get = ['$http', '$templateCache', '$injector', function ($http, $templateCache, $injector) {
+ _this.$templateRequest = $injector.has && $injector.has('$templateRequest') && $injector.get('$templateRequest');
+ _this.$http = $http;
+ _this.$templateCache = $templateCache;
+ return _this;
+ }];
+ }
+ /** @hidden */
+ TemplateFactory.prototype.useHttpService = function (value) {
+ this._useHttp = value;
+ };
+
+ /**
+ * Creates a template from a configuration object.
+ *
+ * @param config Configuration object for which to load a template.
+ * The following properties are search in the specified order, and the first one
+ * that is defined is used to create the template:
+ *
+ * @param params Parameters to pass to the template function.
+ * @param context The resolve context associated with the template's view
+ *
+ * @return {string|object} The template html as a string, or a promise for
+ * that string,or `null` if no template is configured.
+ */
+ TemplateFactory.prototype.fromConfig = function (config, params, context) {
+ var defaultTemplate = "";
+ var asTemplate = function (result) { return services.$q.when(result).then(function (str) { return ({ template: str }); }); };
+ var asComponent = function (result) { return services.$q.when(result).then(function (str) { return ({ component: str }); }); };
+ return (isDefined(config.template) ? asTemplate(this.fromString(config.template, params)) :
+ isDefined(config.templateUrl) ? asTemplate(this.fromUrl(config.templateUrl, params)) :
+ isDefined(config.templateProvider) ? asTemplate(this.fromProvider(config.templateProvider, params, context)) :
+ isDefined(config.component) ? asComponent(config.component) :
+ isDefined(config.componentProvider) ? asComponent(this.fromComponentProvider(config.componentProvider, params, context)) :
+ asTemplate(defaultTemplate));
+ };
+
+ /**
+ * Creates a template from a string or a function returning a string.
+ *
+ * @param template html template as a string or function that returns an html template as a string.
+ * @param params Parameters to pass to the template function.
+ *
+ * @return {string|object} The template html as a string, or a promise for that
+ * string.
+ */
+ TemplateFactory.prototype.fromString = function (template, params) {
+ return isFunction(template) ? template(params) : template;
+ };
+
+ /**
+ * Loads a template from the a URL via `$http` and `$templateCache`.
+ *
+ * @param {string|Function} url url of the template to load, or a function
+ * that returns a url.
+ * @param {Object} params Parameters to pass to the url function.
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ TemplateFactory.prototype.fromUrl = function (url, params) {
+ if (isFunction(url))
+ url = url(params);
+ if (url == null)
+ return null;
+ if (this._useHttp) {
+ return this.$http.get(url, { cache: this.$templateCache, headers: { Accept: 'text/html' } })
+ .then(function (response) {
+ return response.data;
+ });
+ }
+ return this.$templateRequest(url);
+ };
+
+ /**
+ * Creates a template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string|Promise.} The template html as a string, or a promise
+ * for that string.
+ */
+ TemplateFactory.prototype.fromProvider = function (provider, params, context) {
+ var deps = services.$injector.annotate(provider);
+ var providerFn = isArray(provider) ? tail(provider) : provider;
+ var resolvable = new Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+
+ /**
+ * Creates a component's template by invoking an injectable provider function.
+ *
+ * @param provider Function to invoke via `locals`
+ * @param {Function} injectFn a function used to invoke the template provider
+ * @return {string} The template html as a string: "".
+ */
+ TemplateFactory.prototype.fromComponentProvider = function (provider, params, context) {
+ var deps = services.$injector.annotate(provider);
+ var providerFn = isArray(provider) ? tail(provider) : provider;
+ var resolvable = new Resolvable("", providerFn, deps);
+ return resolvable.get(context);
+ };
+
+ /**
+ * Creates a template from a component's name
+ *
+ * This implements route-to-component.
+ * It works by retrieving the component (directive) metadata from the injector.
+ * It analyses the component's bindings, then constructs a template that instantiates the component.
+ * The template wires input and output bindings to resolves or from the parent component.
+ *
+ * @param uiView {object} The parent ui-view (for binding outputs to callbacks)
+ * @param context The ResolveContext (for binding outputs to callbacks returned from resolves)
+ * @param component {string} Component's name in camel case.
+ * @param bindings An object defining the component's bindings: {foo: '<'}
+ * @return {string} The template as a string: "".
+ */
+ TemplateFactory.prototype.makeComponentTemplate = function (uiView, context, component, bindings) {
+ bindings = bindings || {};
+ // Bind once prefix
+ var prefix = ng.version.minor >= 3 ? "::" : "";
+ // Convert to kebob name. Add x- prefix if the string starts with `x-` or `data-`
+ var kebob = function (camelCase) {
+ var kebobed = kebobString(camelCase);
+ return /^(x|data)-/.exec(kebobed) ? "x-" + kebobed : kebobed;
+ };
+ var attributeTpl = function (input) {
+ var name = input.name, type = input.type;
+ var attrName = kebob(name);
+ // If the ui-view has an attribute which matches a binding on the routed component
+ // then pass that attribute through to the routed component template.
+ // Prefer ui-view wired mappings to resolve data, unless the resolve was explicitly bound using `bindings:`
+ if (uiView.attr(attrName) && !bindings[name])
+ return attrName + "='" + uiView.attr(attrName) + "'";
+ var resolveName = bindings[name] || name;
+ // Pre-evaluate the expression for "@" bindings by enclosing in {{ }}
+ // some-attr="{{ ::$resolve.someResolveName }}"
+ if (type === '@')
+ return attrName + "='{{" + prefix + "$resolve." + resolveName + "}}'";
+ // Wire "&" callbacks to resolves that return a callback function
+ // Get the result of the resolve (should be a function) and annotate it to get its arguments.
+ // some-attr="$resolve.someResolveResultName(foo, bar)"
+ if (type === '&') {
+ var res = context.getResolvable(resolveName);
+ var fn = res && res.data;
+ var args = fn && services.$injector.annotate(fn) || [];
+ // account for array style injection, i.e., ['foo', function(foo) {}]
+ var arrayIdxStr = isArray(fn) ? "[" + (fn.length - 1) + "]" : '';
+ return attrName + "='$resolve." + resolveName + arrayIdxStr + "(" + args.join(",") + ")'";
+ }
+ // some-attr="::$resolve.someResolveName"
+ return attrName + "='" + prefix + "$resolve." + resolveName + "'";
+ };
+ var attrs = getComponentBindings(component).map(attributeTpl).join(" ");
+ var kebobName = kebob(component);
+ return "<" + kebobName + " " + attrs + ">" + kebobName + ">";
+ };
+
+ return TemplateFactory;
+}());
+// Gets all the directive(s)' inputs ('@', '=', and '<') and outputs ('&')
+function getComponentBindings(name) {
+ var cmpDefs = services.$injector.get(name + "Directive"); // could be multiple
+ if (!cmpDefs || !cmpDefs.length)
+ throw new Error("Unable to find component named '" + name + "'");
+ return cmpDefs.map(getBindings).reduce(unnestR, []);
+}
+// Given a directive definition, find its object input attributes
+// Use different properties, depending on the type of directive (component, bindToController, normal)
+var getBindings = function (def) {
+ if (isObject(def.bindToController))
+ return scopeBindings(def.bindToController);
+ return scopeBindings(def.scope);
+};
+// for ng 1.2 style, process the scope: { input: "=foo" }
+// for ng 1.3 through ng 1.5, process the component's bindToController: { input: "=foo" } object
+var scopeBindings = function (bindingsObj) { return Object.keys(bindingsObj || {})
+ .map(function (key) { return [key, /^([=<@&])[?]?(.*)/.exec(bindingsObj[key])]; })
+ .filter(function (tuple) { return isDefined(tuple) && isArray(tuple[1]); })
+ .map(function (tuple) { return ({ name: tuple[1][2] || tuple[0], type: tuple[1][1] }); }); };
+
+/** @module ng1 */ /** for typedoc */
+/**
+ * The Angular 1 `StateProvider`
+ *
+ * The `$stateProvider` works similar to Angular's v1 router, but it focuses purely
+ * on state.
+ *
+ * A state corresponds to a "place" in the application in terms of the overall UI and
+ * navigation. A state describes (via the controller / template / view properties) what
+ * the UI looks like and does at that place.
+ *
+ * States often have things in common, and the primary way of factoring out these
+ * commonalities in this model is via the state hierarchy, i.e. parent/child states aka
+ * nested states.
+ *
+ * The `$stateProvider` provides interfaces to declare these states for your app.
+ */
+var StateProvider = /** @class */ (function () {
+ function StateProvider(stateRegistry, stateService) {
+ this.stateRegistry = stateRegistry;
+ this.stateService = stateService;
+ createProxyFunctions(val(StateProvider.prototype), this, val(this));
+ }
+ /**
+ * Decorates states when they are registered
+ *
+ * Allows you to extend (carefully) or override (at your own peril) the
+ * `stateBuilder` object used internally by [[StateRegistry]].
+ * This can be used to add custom functionality to ui-router,
+ * for example inferring templateUrl based on the state name.
+ *
+ * When passing only a name, it returns the current (original or decorated) builder
+ * function that matches `name`.
+ *
+ * The builder functions that can be decorated are listed below. Though not all
+ * necessarily have a good use case for decoration, that is up to you to decide.
+ *
+ * In addition, users can attach custom decorators, which will generate new
+ * properties within the state's internal definition. There is currently no clear
+ * use-case for this beyond accessing internal states (i.e. $state.$current),
+ * however, expect this to become increasingly relevant as we introduce additional
+ * meta-programming features.
+ *
+ * **Warning**: Decorators should not be interdependent because the order of
+ * execution of the builder functions in non-deterministic. Builder functions
+ * should only be dependent on the state definition object and super function.
+ *
+ *
+ * Existing builder functions and current return values:
+ *
+ * - **parent** `{object}` - returns the parent state object.
+ * - **data** `{object}` - returns state data, including any inherited data that is not
+ * overridden by own values (if any).
+ * - **url** `{object}` - returns a {@link ui.router.util.type:UrlMatcher UrlMatcher}
+ * or `null`.
+ * - **navigable** `{object}` - returns closest ancestor state that has a URL (aka is
+ * navigable).
+ * - **params** `{object}` - returns an array of state params that are ensured to
+ * be a super-set of parent's params.
+ * - **views** `{object}` - returns a views object where each key is an absolute view
+ * name (i.e. "viewName@stateName") and each value is the config object
+ * (template, controller) for the view. Even when you don't use the views object
+ * explicitly on a state config, one is still created for you internally.
+ * So by decorating this builder function you have access to decorating template
+ * and controller properties.
+ * - **ownParams** `{object}` - returns an array of params that belong to the state,
+ * not including any params defined by ancestor states.
+ * - **path** `{string}` - returns the full path from the root down to this state.
+ * Needed for state activation.
+ * - **includes** `{object}` - returns an object that includes every state that
+ * would pass a `$state.includes()` test.
+ *
+ * #### Example:
+ * Override the internal 'views' builder with a function that takes the state
+ * definition, and a reference to the internal function being overridden:
+ * ```js
+ * $stateProvider.decorator('views', function (state, parent) {
+ * let result = {},
+ * views = parent(state);
+ *
+ * angular.forEach(views, function (config, name) {
+ * let autoName = (state.name + '.' + name).replace('.', '/');
+ * config.templateUrl = config.templateUrl || '/partials/' + autoName + '.html';
+ * result[name] = config;
+ * });
+ * return result;
+ * });
+ *
+ * $stateProvider.state('home', {
+ * views: {
+ * 'contact.list': { controller: 'ListController' },
+ * 'contact.item': { controller: 'ItemController' }
+ * }
+ * });
+ * ```
+ *
+ *
+ * ```js
+ * // Auto-populates list and item views with /partials/home/contact/list.html,
+ * // and /partials/home/contact/item.html, respectively.
+ * $state.go('home');
+ * ```
+ *
+ * @param {string} name The name of the builder function to decorate.
+ * @param {object} func A function that is responsible for decorating the original
+ * builder function. The function receives two parameters:
+ *
+ * - `{object}` - state - The state config object.
+ * - `{object}` - super - The original builder function.
+ *
+ * @return {object} $stateProvider - $stateProvider instance
+ */
+ StateProvider.prototype.decorator = function (name, func) {
+ return this.stateRegistry.decorator(name, func) || this;
+ };
+ StateProvider.prototype.state = function (name, definition) {
+ if (isObject(name)) {
+ definition = name;
+ }
+ else {
+ definition.name = name;
+ }
+ this.stateRegistry.register(definition);
+ return this;
+ };
+ /**
+ * Registers an invalid state handler
+ *
+ * This is a passthrough to [[StateService.onInvalid]] for ng1.
+ */
+ StateProvider.prototype.onInvalid = function (callback) {
+ return this.stateService.onInvalid(callback);
+ };
+ return StateProvider;
+}());
+
+/** @module ng1 */ /** */
+/**
+ * This is a [[StateBuilder.builder]] function for angular1 `onEnter`, `onExit`,
+ * `onRetain` callback hooks on a [[Ng1StateDeclaration]].
+ *
+ * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
+ * ensures that those hooks are injectable for @uirouter/angularjs (ng1).
+ */
+var getStateHookBuilder = function (hookName) {
+ return function stateHookBuilder(state, parentFn) {
+ var hook = state[hookName];
+ var pathname = hookName === 'onExit' ? 'from' : 'to';
+ function decoratedNg1Hook(trans, state) {
+ var resolveContext = new ResolveContext(trans.treeChanges(pathname));
+ var locals = extend(getLocals(resolveContext), { $state$: state, $transition$: trans });
+ return services.$injector.invoke(hook, this, locals);
+ }
+ return hook ? decoratedNg1Hook : undefined;
+ };
+};
+
+/**
+ * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service
+ */
+var Ng1LocationServices = /** @class */ (function () {
+ function Ng1LocationServices($locationProvider) {
+ // .onChange() registry
+ this._urlListeners = [];
+ this.$locationProvider = $locationProvider;
+ var _lp = val($locationProvider);
+ createProxyFunctions(_lp, this, _lp, ['hashPrefix']);
+ }
+ Ng1LocationServices.prototype.dispose = function () { };
+ Ng1LocationServices.prototype.onChange = function (callback) {
+ var _this = this;
+ this._urlListeners.push(callback);
+ return function () { return removeFrom(_this._urlListeners)(callback); };
+ };
+ Ng1LocationServices.prototype.html5Mode = function () {
+ var html5Mode = this.$locationProvider.html5Mode();
+ html5Mode = isObject(html5Mode) ? html5Mode.enabled : html5Mode;
+ return html5Mode && this.$sniffer.history;
+ };
+ Ng1LocationServices.prototype.url = function (newUrl, replace, state) {
+ if (replace === void 0) { replace = false; }
+ if (newUrl)
+ this.$location.url(newUrl);
+ if (replace)
+ this.$location.replace();
+ if (state)
+ this.$location.state(state);
+ return this.$location.url();
+ };
+ Ng1LocationServices.prototype._runtimeServices = function ($rootScope, $location, $sniffer, $browser) {
+ var _this = this;
+ this.$location = $location;
+ this.$sniffer = $sniffer;
+ // Bind $locationChangeSuccess to the listeners registered in LocationService.onChange
+ $rootScope.$on("$locationChangeSuccess", function (evt) { return _this._urlListeners.forEach(function (fn) { return fn(evt); }); });
+ var _loc = val($location);
+ var _browser = val($browser);
+ // Bind these LocationService functions to $location
+ createProxyFunctions(_loc, this, _loc, ["replace", "path", "search", "hash"]);
+ // Bind these LocationConfig functions to $location
+ createProxyFunctions(_loc, this, _loc, ['port', 'protocol', 'host']);
+ // Bind these LocationConfig functions to $browser
+ createProxyFunctions(_browser, this, _browser, ['baseHref']);
+ };
+ /**
+ * Applys ng1-specific path parameter encoding
+ *
+ * The Angular 1 `$location` service is a bit weird.
+ * It doesn't allow slashes to be encoded/decoded bi-directionally.
+ *
+ * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
+ *
+ * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
+ *
+ * @param router
+ */
+ Ng1LocationServices.monkeyPatchPathParameterType = function (router) {
+ var pathType = router.urlMatcherFactory.type('path');
+ pathType.encode = function (val) {
+ return val != null ? val.toString().replace(/(~|\/)/g, function (m) { return ({ '~': '~~', '/': '~2F' }[m]); }) : val;
+ };
+ pathType.decode = function (val) {
+ return val != null ? val.toString().replace(/(~~|~2F)/g, function (m) { return ({ '~~': '~', '~2F': '/' }[m]); }) : val;
+ };
+ };
+ return Ng1LocationServices;
+}());
+
+/** @module url */ /** */
+/**
+ * Manages rules for client-side URL
+ *
+ * ### Deprecation warning:
+ * This class is now considered to be an internal API
+ * Use the [[UrlService]] instead.
+ * For configuring URL rules, use the [[UrlRulesApi]] which can be found as [[UrlService.rules]].
+ *
+ * This class manages the router rules for what to do when the URL changes.
+ *
+ * This provider remains for backwards compatibility.
+ *
+ * @deprecated
+ */
+var UrlRouterProvider = /** @class */ (function () {
+ /** @hidden */
+ function UrlRouterProvider(router) {
+ this._router = router;
+ this._urlRouter = router.urlRouter;
+ }
+ /** @hidden */
+ UrlRouterProvider.prototype.$get = function () {
+ var urlRouter = this._urlRouter;
+ urlRouter.update(true);
+ if (!urlRouter.interceptDeferred)
+ urlRouter.listen();
+ return urlRouter;
+ };
+ /**
+ * Registers a url handler function.
+ *
+ * Registers a low level url handler (a `rule`).
+ * A rule detects specific URL patterns and returns a redirect, or performs some action.
+ *
+ * If a rule returns a string, the URL is replaced with the string, and all rules are fired again.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Here's an example of how you might allow case insensitive urls
+ * $urlRouterProvider.rule(function ($injector, $location) {
+ * var path = $location.path(),
+ * normalized = path.toLowerCase();
+ *
+ * if (path !== normalized) {
+ * return normalized;
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param ruleFn
+ * Handler function that takes `$injector` and `$location` services as arguments.
+ * You can use them to detect a url and return a different url as a string.
+ *
+ * @return [[UrlRouterProvider]] (`this`)
+ */
+ UrlRouterProvider.prototype.rule = function (ruleFn) {
+ var _this = this;
+ if (!isFunction(ruleFn))
+ throw new Error("'rule' must be a function");
+ var match = function () {
+ return ruleFn(services.$injector, _this._router.locationService);
+ };
+ var rule = new BaseUrlRule(match, identity);
+ this._urlRouter.rule(rule);
+ return this;
+ };
+
+ /**
+ * Defines the path or behavior to use when no url can be matched.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // if the path doesn't match any of the urls you configured
+ * // otherwise will take care of routing the user to the
+ * // specified url
+ * $urlRouterProvider.otherwise('/index');
+ *
+ * // Example of using function rule as param
+ * $urlRouterProvider.otherwise(function ($injector, $location) {
+ * return '/a/valid/url';
+ * });
+ * });
+ * ```
+ *
+ * @param rule
+ * The url path you want to redirect to or a function rule that returns the url path or performs a `$state.go()`.
+ * The function version is passed two params: `$injector` and `$location` services, and should return a url string.
+ *
+ * @return {object} `$urlRouterProvider` - `$urlRouterProvider` instance
+ */
+ UrlRouterProvider.prototype.otherwise = function (rule) {
+ var _this = this;
+ var urlRouter = this._urlRouter;
+ if (isString(rule)) {
+ urlRouter.otherwise(rule);
+ }
+ else if (isFunction(rule)) {
+ urlRouter.otherwise(function () { return rule(services.$injector, _this._router.locationService); });
+ }
+ else {
+ throw new Error("'rule' must be a string or function");
+ }
+ return this;
+ };
+
+ /**
+ * Registers a handler for a given url matching.
+ *
+ * If the handler is a string, it is
+ * treated as a redirect, and is interpolated according to the syntax of match
+ * (i.e. like `String.replace()` for `RegExp`, or like a `UrlMatcher` pattern otherwise).
+ *
+ * If the handler is a function, it is injectable.
+ * It gets invoked if `$location` matches.
+ * You have the option of inject the match object as `$match`.
+ *
+ * The handler can return
+ *
+ * - **falsy** to indicate that the rule didn't match after all, then `$urlRouter`
+ * will continue trying to find another one that matches.
+ * - **string** which is treated as a redirect and passed to `$location.url()`
+ * - **void** or any **truthy** value tells `$urlRouter` that the url was handled.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * $urlRouterProvider.when($state.url, function ($match, $stateParams) {
+ * if ($state.$current.navigable !== state ||
+ * !equalForKeys($match, $stateParams) {
+ * $state.transitionTo(state, $match, false);
+ * }
+ * });
+ * });
+ * ```
+ *
+ * @param what A pattern string to match, compiled as a [[UrlMatcher]].
+ * @param handler The path (or function that returns a path) that you want to redirect your user to.
+ * @param ruleCallback [optional] A callback that receives the `rule` registered with [[UrlMatcher.rule]]
+ *
+ * Note: the handler may also invoke arbitrary code, such as `$state.go()`
+ */
+ UrlRouterProvider.prototype.when = function (what, handler) {
+ if (isArray(handler) || isFunction(handler)) {
+ handler = UrlRouterProvider.injectableHandler(this._router, handler);
+ }
+ this._urlRouter.when(what, handler);
+ return this;
+ };
+
+ UrlRouterProvider.injectableHandler = function (router, handler) {
+ return function (match) {
+ return services.$injector.invoke(handler, null, { $match: match, $stateParams: router.globals.params });
+ };
+ };
+ /**
+ * Disables monitoring of the URL.
+ *
+ * Call this method before UI-Router has bootstrapped.
+ * It will stop UI-Router from performing the initial url sync.
+ *
+ * This can be useful to perform some asynchronous initialization before the router starts.
+ * Once the initialization is complete, call [[listen]] to tell UI-Router to start watching and synchronizing the URL.
+ *
+ * #### Example:
+ * ```js
+ * var app = angular.module('app', ['ui.router']);
+ *
+ * app.config(function ($urlRouterProvider) {
+ * // Prevent $urlRouter from automatically intercepting URL changes;
+ * $urlRouterProvider.deferIntercept();
+ * })
+ *
+ * app.run(function (MyService, $urlRouter, $http) {
+ * $http.get("/stuff").then(function(resp) {
+ * MyService.doStuff(resp.data);
+ * $urlRouter.listen();
+ * $urlRouter.sync();
+ * });
+ * });
+ * ```
+ *
+ * @param defer Indicates whether to defer location change interception.
+ * Passing no parameter is equivalent to `true`.
+ */
+ UrlRouterProvider.prototype.deferIntercept = function (defer) {
+ this._urlRouter.deferIntercept(defer);
+ };
+
+ return UrlRouterProvider;
+}());
+
+/**
+ * # Angular 1 types
+ *
+ * UI-Router core provides various Typescript types which you can use for code completion and validating parameter values, etc.
+ * The customizations to the core types for Angular UI-Router are documented here.
+ *
+ * The optional [[$resolve]] service is also documented here.
+ *
+ * @module ng1
+ * @preferred
+ */
+/** for typedoc */
+ng.module("ui.router.angular1", []);
+var mod_init = ng.module('ui.router.init', []);
+var mod_util = ng.module('ui.router.util', ['ng', 'ui.router.init']);
+var mod_rtr = ng.module('ui.router.router', ['ui.router.util']);
+var mod_state = ng.module('ui.router.state', ['ui.router.router', 'ui.router.util', 'ui.router.angular1']);
+var mod_main = ng.module('ui.router', ['ui.router.init', 'ui.router.state', 'ui.router.angular1']);
+var mod_cmpt = ng.module('ui.router.compat', ['ui.router']); // tslint:disable-line
+var router = null;
+$uiRouter.$inject = ['$locationProvider'];
+/** This angular 1 provider instantiates a Router and exposes its services via the angular injector */
+function $uiRouter($locationProvider) {
+ // Create a new instance of the Router when the $uiRouterProvider is initialized
+ router = this.router = new UIRouter();
+ router.stateProvider = new StateProvider(router.stateRegistry, router.stateService);
+ // Apply ng1 specific StateBuilder code for `views`, `resolve`, and `onExit/Retain/Enter` properties
+ router.stateRegistry.decorator("views", ng1ViewsBuilder);
+ router.stateRegistry.decorator("onExit", getStateHookBuilder("onExit"));
+ router.stateRegistry.decorator("onRetain", getStateHookBuilder("onRetain"));
+ router.stateRegistry.decorator("onEnter", getStateHookBuilder("onEnter"));
+ router.viewService._pluginapi._viewConfigFactory('ng1', getNg1ViewConfigFactory());
+ var ng1LocationService = router.locationService = router.locationConfig = new Ng1LocationServices($locationProvider);
+ Ng1LocationServices.monkeyPatchPathParameterType(router);
+ // backwards compat: also expose router instance as $uiRouterProvider.router
+ router['router'] = router;
+ router['$get'] = $get;
+ $get.$inject = ['$location', '$browser', '$sniffer', '$rootScope', '$http', '$templateCache'];
+ function $get($location, $browser, $sniffer, $rootScope, $http, $templateCache) {
+ ng1LocationService._runtimeServices($rootScope, $location, $sniffer, $browser);
+ delete router['router'];
+ delete router['$get'];
+ return router;
+ }
+ return router;
+}
+var getProviderFor = function (serviceName) { return ['$uiRouterProvider', function ($urp) {
+ var service = $urp.router[serviceName];
+ service["$get"] = function () { return service; };
+ return service;
+ }]; };
+// This effectively calls $get() on `$uiRouterProvider` to trigger init (when ng enters runtime)
+runBlock.$inject = ['$injector', '$q', '$uiRouter'];
+function runBlock($injector, $q, $uiRouter) {
+ services.$injector = $injector;
+ services.$q = $q;
+ // The $injector is now available.
+ // Find any resolvables that had dependency annotation deferred
+ $uiRouter.stateRegistry.get()
+ .map(function (x) { return x.$$state().resolvables; })
+ .reduce(unnestR, [])
+ .filter(function (x) { return x.deps === "deferred"; })
+ .forEach(function (resolvable) { return resolvable.deps = $injector.annotate(resolvable.resolveFn, $injector.strictDi); });
+}
+// $urlRouter service and $urlRouterProvider
+var getUrlRouterProvider = function (uiRouter) {
+ return uiRouter.urlRouterProvider = new UrlRouterProvider(uiRouter);
+};
+// $state service and $stateProvider
+// $urlRouter service and $urlRouterProvider
+var getStateProvider = function () {
+ return extend(router.stateProvider, { $get: function () { return router.stateService; } });
+};
+watchDigests.$inject = ['$rootScope'];
+function watchDigests($rootScope) {
+ $rootScope.$watch(function () { trace.approximateDigests++; });
+}
+mod_init.provider("$uiRouter", $uiRouter);
+mod_rtr.provider('$urlRouter', ['$uiRouterProvider', getUrlRouterProvider]);
+mod_util.provider('$urlService', getProviderFor('urlService'));
+mod_util.provider('$urlMatcherFactory', ['$uiRouterProvider', function () { return router.urlMatcherFactory; }]);
+mod_util.provider('$templateFactory', function () { return new TemplateFactory(); });
+mod_state.provider('$stateRegistry', getProviderFor('stateRegistry'));
+mod_state.provider('$uiRouterGlobals', getProviderFor('globals'));
+mod_state.provider('$transitions', getProviderFor('transitionService'));
+mod_state.provider('$state', ['$uiRouterProvider', getStateProvider]);
+mod_state.factory('$stateParams', ['$uiRouter', function ($uiRouter) { return $uiRouter.globals.params; }]);
+mod_main.factory('$view', function () { return router.viewService; });
+mod_main.service("$trace", function () { return trace; });
+mod_main.run(watchDigests);
+mod_util.run(['$urlMatcherFactory', function ($urlMatcherFactory) { }]);
+mod_state.run(['$state', function ($state) { }]);
+mod_rtr.run(['$urlRouter', function ($urlRouter) { }]);
+mod_init.run(runBlock);
+/** @hidden TODO: find a place to move this */
+var getLocals = function (ctx) {
+ var tokens = ctx.getTokens().filter(isString);
+ var tuples = tokens.map(function (key) {
+ var resolvable = ctx.getResolvable(key);
+ var waitPolicy = ctx.getPolicy(resolvable).async;
+ return [key, waitPolicy === 'NOWAIT' ? resolvable.promise : resolvable.data];
+ });
+ return tuples.reduce(applyPairs, {});
+};
+
+/**
+ * # Angular 1 injectable services
+ *
+ * This is a list of the objects which can be injected using angular's injector.
+ *
+ * There are three different kind of injectable objects:
+ *
+ * ## **Provider** objects
+ * #### injectable into a `.config()` block during configtime
+ *
+ * - [[$uiRouterProvider]]: The UI-Router instance
+ * - [[$stateProvider]]: State registration
+ * - [[$transitionsProvider]]: Transition hooks
+ * - [[$urlServiceProvider]]: All URL related public APIs
+ *
+ * - [[$uiViewScrollProvider]]: Disable ui-router view scrolling
+ * - [[$urlRouterProvider]]: (deprecated) Url matching rules
+ * - [[$urlMatcherFactoryProvider]]: (deprecated) Url parsing config
+ *
+ * ## **Service** objects
+ * #### injectable globally during runtime
+ *
+ * - [[$uiRouter]]: The UI-Router instance
+ * - [[$trace]]: Enable transition trace/debug
+ * - [[$transitions]]: Transition hooks
+ * - [[$state]]: Imperative state related APIs
+ * - [[$stateRegistry]]: State registration
+ * - [[$urlService]]: All URL related public APIs
+ * - [[$uiRouterGlobals]]: Global variables
+ * - [[$uiViewScroll]]: Scroll an element into view
+ *
+ * - [[$stateParams]]: (deprecated) Global state param values
+ * - [[$urlRouter]]: (deprecated) URL synchronization
+ * - [[$urlMatcherFactory]]: (deprecated) URL parsing config
+ *
+ * ## **Per-Transition** objects
+ *
+ * - These kind of objects are injectable into:
+ * - Resolves ([[Ng1StateDeclaration.resolve]]),
+ * - Transition Hooks ([[TransitionService.onStart]], etc),
+ * - Routed Controllers ([[Ng1ViewDeclaration.controller]])
+ *
+ * #### Different instances are injected based on the [[Transition]]
+ *
+ * - [[$transition$]]: The current Transition object
+ * - [[$stateParams]]: State param values for pending Transition (deprecated)
+ * - Any resolve data defined using [[Ng1StateDeclaration.resolve]]
+ *
+ * @ng1api
+ * @preferred
+ * @module injectables
+ */ /** */
+/**
+ * The current (or pending) State Parameters
+ *
+ * An injectable global **Service Object** which holds the state parameters for the latest **SUCCESSFUL** transition.
+ *
+ * The values are not updated until *after* a `Transition` successfully completes.
+ *
+ * **Also:** an injectable **Per-Transition Object** object which holds the pending state parameters for the pending `Transition` currently running.
+ *
+ * ### Deprecation warning:
+ *
+ * The value injected for `$stateParams` is different depending on where it is injected.
+ *
+ * - When injected into an angular service, the object injected is the global **Service Object** with the parameter values for the latest successful `Transition`.
+ * - When injected into transition hooks, resolves, or view controllers, the object is the **Per-Transition Object** with the parameter values for the running `Transition`.
+ *
+ * Because of these confusing details, this service is deprecated.
+ *
+ * ### Instead of using the global `$stateParams` service object,
+ * inject [[$uiRouterGlobals]] and use [[UIRouterGlobals.params]]
+ *
+ * ```js
+ * MyService.$inject = ['$uiRouterGlobals'];
+ * function MyService($uiRouterGlobals) {
+ * return {
+ * paramValues: function () {
+ * return $uiRouterGlobals.params;
+ * }
+ * }
+ * }
+ * ```
+ *
+ * ### Instead of using the per-transition `$stateParams` object,
+ * inject the current `Transition` (as [[$transition$]]) and use [[Transition.params]]
+ *
+ * ```js
+ * MyController.$inject = ['$transition$'];
+ * function MyController($transition$) {
+ * var username = $transition$.params().username;
+ * // .. do something with username
+ * }
+ * ```
+ *
+ * ---
+ *
+ * This object can be injected into other services.
+ *
+ * #### Deprecated Example:
+ * ```js
+ * SomeService.$inject = ['$http', '$stateParams'];
+ * function SomeService($http, $stateParams) {
+ * return {
+ * getUser: function() {
+ * return $http.get('/api/users/' + $stateParams.username);
+ * }
+ * }
+ * };
+ * angular.service('SomeService', SomeService);
+ * ```
+ * @deprecated
+ */
+
+/**
+ * # Angular 1 Directives
+ *
+ * These are the directives included in UI-Router for Angular 1.
+ * These directives are used in templates to create viewports and link/navigate to states.
+ *
+ * @ng1api
+ * @preferred
+ * @module directives
+ */ /** for typedoc */
+/** @hidden */
+function parseStateRef(ref) {
+ var paramsOnly = ref.match(/^\s*({[^}]*})\s*$/), parsed;
+ if (paramsOnly)
+ ref = '(' + paramsOnly[1] + ')';
+ parsed = ref.replace(/\n/g, " ").match(/^\s*([^(]*?)\s*(\((.*)\))?\s*$/);
+ if (!parsed || parsed.length !== 4)
+ throw new Error("Invalid state ref '" + ref + "'");
+ return { state: parsed[1] || null, paramExpr: parsed[3] || null };
+}
+/** @hidden */
+function stateContext(el) {
+ var $uiView = el.parent().inheritedData('$uiView');
+ var path = parse('$cfg.path')($uiView);
+ return path ? tail(path).state.name : undefined;
+}
+/** @hidden */
+function processedDef($state, $element, def) {
+ var uiState = def.uiState || $state.current.name;
+ var uiStateOpts = extend(defaultOpts($element, $state), def.uiStateOpts || {});
+ var href = $state.href(uiState, def.uiStateParams, uiStateOpts);
+ return { uiState: uiState, uiStateParams: def.uiStateParams, uiStateOpts: uiStateOpts, href: href };
+}
+/** @hidden */
+function getTypeInfo(el) {
+ // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+ var isSvg = Object.prototype.toString.call(el.prop('href')) === '[object SVGAnimatedString]';
+ var isForm = el[0].nodeName === "FORM";
+ return {
+ attr: isForm ? "action" : (isSvg ? 'xlink:href' : 'href'),
+ isAnchor: el.prop("tagName").toUpperCase() === "A",
+ clickable: !isForm
+ };
+}
+/** @hidden */
+function clickHook(el, $state, $timeout, type, getDef) {
+ return function (e) {
+ var button = e.which || e.button, target = getDef();
+ if (!(button > 1 || e.ctrlKey || e.metaKey || e.shiftKey || el.attr('target'))) {
+ // HACK: This is to allow ng-clicks to be processed before the transition is initiated:
+ var transition = $timeout(function () {
+ $state.go(target.uiState, target.uiStateParams, target.uiStateOpts);
+ });
+ e.preventDefault();
+ // if the state has no URL, ignore one preventDefault from the directive.
+ var ignorePreventDefaultCount = type.isAnchor && !target.href ? 1 : 0;
+ e.preventDefault = function () {
+ if (ignorePreventDefaultCount-- <= 0)
+ $timeout.cancel(transition);
+ };
+ }
+ };
+}
+/** @hidden */
+function defaultOpts(el, $state) {
+ return {
+ relative: stateContext(el) || $state.$current,
+ inherit: true,
+ source: "sref"
+ };
+}
+/** @hidden */
+function bindEvents(element, scope, hookFn, uiStateOpts) {
+ var events;
+ if (uiStateOpts) {
+ events = uiStateOpts.events;
+ }
+ if (!isArray(events)) {
+ events = ['click'];
+ }
+ var on = element.on ? 'on' : 'bind';
+ for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
+ var event_1 = events_1[_i];
+ element[on](event_1, hookFn);
+ }
+ scope.$on('$destroy', function () {
+ var off = element.off ? 'off' : 'unbind';
+ for (var _i = 0, events_2 = events; _i < events_2.length; _i++) {
+ var event_2 = events_2[_i];
+ element[off](event_2, hookFn);
+ }
+ });
+}
+/**
+ * `ui-sref`: A directive for linking to a state
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * ### Linked State
+ * The attribute value of the `ui-sref` is the name of the state to link to.
+ *
+ * #### Example:
+ * This will activate the `home` state when the link is clicked.
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Relative Links
+ * You can also use relative state paths within `ui-sref`, just like a relative path passed to `$state.go()` ([[StateService.go]]).
+ * You just need to be aware that the path is relative to the state that *created* the link.
+ * This allows a state to create a relative `ui-sref` which always targets the same destination.
+ *
+ * #### Example:
+ * Both these links are relative to the parent state, even when a child state is currently active.
+ * ```html
+ * child 1 state
+ * child 2 state
+ * ```
+ *
+ * This link activates the parent state.
+ * ```html
+ * Return
+ * ```
+ *
+ * ### hrefs
+ * If the linked state has a URL, the directive will automatically generate and
+ * update the `href` attribute (using the [[StateService.href]] method).
+ *
+ * #### Example:
+ * Assuming the `users` state has a url of `/users/`
+ * ```html
+ * Users
+ * ```
+ *
+ * ### Parameter Values
+ * In addition to the state name, a `ui-sref` can include parameter values which are applied when activating the state.
+ * Param values can be provided in the `ui-sref` value after the state name, enclosed by parentheses.
+ * The content inside the parentheses is an expression, evaluated to the parameter values.
+ *
+ * #### Example:
+ * This example renders a list of links to users.
+ * The state's `userId` parameter value comes from each user's `user.id` property.
+ * ```html
+ *
+ * ```
+ *
+ * Note:
+ * The parameter values expression is `$watch`ed for updates.
+ *
+ * ### Transition Options
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-sref-opts` attribute.
+ * Options are restricted to `location`, `inherit`, and `reload`.
+ *
+ * #### Example:
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Other DOM Events
+ *
+ * You can also customize which DOM events to respond to (instead of `click`) by
+ * providing an `events` array in the `ui-sref-opts` attribute.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * ### Highlighting the active link
+ * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
+ *
+ * ### Examples
+ * If you have the following template:
+ *
+ * ```html
+ * Home
+ * About
+ * Next page
+ *
+ *
+ * ```
+ *
+ * Then (assuming the current state is `contacts`) the rendered html including hrefs would be:
+ *
+ * ```html
+ * Home
+ * About
+ * Next page
+ *
+ *
+ *
+ * Home
+ * ```
+ *
+ * ### Notes
+ *
+ * - You can use `ui-sref` to change **only the parameter values** by omitting the state name and parentheses.
+ * #### Example:
+ * Sets the `lang` parameter to `en` and remains on the same state.
+ *
+ * ```html
+ * English
+ * ```
+ *
+ * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
+ *
+ * - Unlike the parameter values expression, the state name is not `$watch`ed (for performance reasons).
+ * If you need to dynamically update the state being linked to, use the fully dynamic [[uiState]] directive.
+ */
+var uiSref;
+uiSref = ['$uiRouter', '$timeout',
+ function $StateRefDirective($uiRouter, $timeout) {
+ var $state = $uiRouter.stateService;
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function (scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var unlinkInfoFn = null;
+ var hookFn;
+ var rawDef = {};
+ var getDef = function () { return processedDef($state, element, rawDef); };
+ var ref = parseStateRef(attrs.uiSref);
+ rawDef.uiState = ref.state;
+ rawDef.uiStateOpts = attrs.uiSrefOpts ? scope.$eval(attrs.uiSrefOpts) : {};
+ function update() {
+ var def = getDef();
+ if (unlinkInfoFn)
+ unlinkInfoFn();
+ if (active)
+ unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);
+ if (def.href != null)
+ attrs.$set(type.attr, def.href);
+ }
+ if (ref.paramExpr) {
+ scope.$watch(ref.paramExpr, function (val) {
+ rawDef.uiStateParams = extend({}, val);
+ update();
+ }, true);
+ rawDef.uiStateParams = extend({}, scope.$eval(ref.paramExpr));
+ }
+ update();
+ scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));
+ scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));
+ if (!type.clickable)
+ return;
+ hookFn = clickHook(element, $state, $timeout, type, getDef);
+ bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
+ }
+ };
+ }];
+/**
+ * `ui-state`: A fully dynamic directive for linking to a state
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * **This directive is very similar to [[uiSref]], but it `$observe`s and `$watch`es/evaluates all its inputs.**
+ *
+ * A directive which links to a state (and optionally, parameters).
+ * When clicked, this directive activates the linked state with the supplied parameter values.
+ *
+ * ### Linked State
+ * The attribute value of `ui-state` is an expression which is `$watch`ed and evaluated as the state to link to.
+ * **This is in contrast with `ui-sref`, which takes a state name as a string literal.**
+ *
+ * #### Example:
+ * Create a list of links.
+ * ```html
+ *
+ * ```
+ *
+ * ### Relative Links
+ * If the expression evaluates to a relative path, it is processed like [[uiSref]].
+ * You just need to be aware that the path is relative to the state that *created* the link.
+ * This allows a state to create relative `ui-state` which always targets the same destination.
+ *
+ * ### hrefs
+ * If the linked state has a URL, the directive will automatically generate and
+ * update the `href` attribute (using the [[StateService.href]] method).
+ *
+ * ### Parameter Values
+ * In addition to the state name expression, a `ui-state` can include parameter values which are applied when activating the state.
+ * Param values should be provided using the `ui-state-params` attribute.
+ * The `ui-state-params` attribute value is `$watch`ed and evaluated as an expression.
+ *
+ * #### Example:
+ * This example renders a list of links with param values.
+ * The state's `userId` parameter value comes from each user's `user.id` property.
+ * ```html
+ *
+ * ```
+ *
+ * ### Transition Options
+ * You can specify [[TransitionOptions]] to pass to [[StateService.go]] by using the `ui-state-opts` attribute.
+ * Options are restricted to `location`, `inherit`, and `reload`.
+ * The value of the `ui-state-opts` is `$watch`ed and evaluated as an expression.
+ *
+ * #### Example:
+ * ```html
+ * Home
+ * ```
+ *
+ * ### Other DOM Events
+ *
+ * You can also customize which DOM events to respond to (instead of `click`) by
+ * providing an `events` array in the `ui-state-opts` attribute.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * ### Highlighting the active link
+ * This directive can be used in conjunction with [[uiSrefActive]] to highlight the active link.
+ *
+ * ### Notes
+ *
+ * - You can use `ui-params` to change **only the parameter values** by omitting the state name and supplying only `ui-state-params`.
+ * However, it might be simpler to use [[uiSref]] parameter-only links.
+ *
+ * #### Example:
+ * Sets the `lang` parameter to `en` and remains on the same state.
+ *
+ * ```html
+ * English
+ * ```
+ *
+ * - A middle-click, right-click, or ctrl-click is handled (natively) by the browser to open the href in a new window, for example.
+ * ```
+ */
+var uiState;
+uiState = ['$uiRouter', '$timeout',
+ function $StateRefDynamicDirective($uiRouter, $timeout) {
+ var $state = $uiRouter.stateService;
+ return {
+ restrict: 'A',
+ require: ['?^uiSrefActive', '?^uiSrefActiveEq'],
+ link: function (scope, element, attrs, uiSrefActive) {
+ var type = getTypeInfo(element);
+ var active = uiSrefActive[1] || uiSrefActive[0];
+ var unlinkInfoFn = null;
+ var hookFn;
+ var rawDef = {};
+ var getDef = function () { return processedDef($state, element, rawDef); };
+ var inputAttrs = ['uiState', 'uiStateParams', 'uiStateOpts'];
+ var watchDeregFns = inputAttrs.reduce(function (acc, attr) { return (acc[attr] = noop$1, acc); }, {});
+ function update() {
+ var def = getDef();
+ if (unlinkInfoFn)
+ unlinkInfoFn();
+ if (active)
+ unlinkInfoFn = active.$$addStateInfo(def.uiState, def.uiStateParams);
+ if (def.href != null)
+ attrs.$set(type.attr, def.href);
+ }
+ inputAttrs.forEach(function (field) {
+ rawDef[field] = attrs[field] ? scope.$eval(attrs[field]) : null;
+ attrs.$observe(field, function (expr) {
+ watchDeregFns[field]();
+ watchDeregFns[field] = scope.$watch(expr, function (newval) {
+ rawDef[field] = newval;
+ update();
+ }, true);
+ });
+ });
+ update();
+ scope.$on('$destroy', $uiRouter.stateRegistry.onStatesChanged(update));
+ scope.$on('$destroy', $uiRouter.transitionService.onSuccess({}, update));
+ if (!type.clickable)
+ return;
+ hookFn = clickHook(element, $state, $timeout, type, getDef);
+ bindEvents(element, scope, hookFn, rawDef.uiStateOpts);
+ }
+ };
+ }];
+/**
+ * `ui-sref-active` and `ui-sref-active-eq`: A directive that adds a CSS class when a `ui-sref` is active
+ *
+ * A directive working alongside [[uiSref]] and [[uiState]] to add classes to an element when the
+ * related directive's state is active (and remove them when it is inactive).
+ *
+ * The primary use-case is to highlight the active link in navigation menus,
+ * distinguishing it from the inactive menu items.
+ *
+ * ### Linking to a `ui-sref` or `ui-state`
+ * `ui-sref-active` can live on the same element as `ui-sref`/`ui-state`, or it can be on a parent element.
+ * If a `ui-sref-active` is a parent to more than one `ui-sref`/`ui-state`, it will apply the CSS class when **any of the links are active**.
+ *
+ * ### Matching
+ *
+ * The `ui-sref-active` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state **or any child state is active**.
+ * This is a "fuzzy match" which uses [[StateService.includes]].
+ *
+ * The `ui-sref-active-eq` directive applies the CSS class when the `ui-sref`/`ui-state`'s target state is directly active (not when child states are active).
+ * This is an "exact match" which uses [[StateService.is]].
+ *
+ * ### Parameter values
+ * If the `ui-sref`/`ui-state` includes parameter values, the current parameter values must match the link's values for the link to be highlighted.
+ * This allows a list of links to the same state with different parameters to be rendered, and the correct one highlighted.
+ *
+ * #### Example:
+ * ```html
+ *
+ * ```
+ *
+ * When the app state is `app.user` (or any child state),
+ * and contains the state parameter "user" with value "bilbobaggins",
+ * the resulting HTML will appear as (note the 'active' class):
+ *
+ * ```html
+ *
+ * ```
+ *
+ * ### Glob mode
+ *
+ * It is possible to pass `ui-sref-active` an expression that evaluates to an object.
+ * The objects keys represent active class names and values represent the respective state names/globs.
+ * `ui-sref-active` will match if the current active state **includes** any of
+ * the specified state names/globs, even the abstract ones.
+ *
+ * #### Example:
+ * Given the following template, with "admin" being an abstract state:
+ * ```html
+ *