a zip code crypto-currency system good for red ONLY

animations.umd.js 52KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641
  1. /**
  2. * @license Angular v5.2.11
  3. * (c) 2010-2018 Google, Inc. https://angular.io/
  4. * License: MIT
  5. */
  6. (function (global, factory) {
  7. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  8. typeof define === 'function' && define.amd ? define('@angular/animations', ['exports'], factory) :
  9. (factory((global.ng = global.ng || {}, global.ng.animations = {})));
  10. }(this, (function (exports) { 'use strict';
  11. /**
  12. * @license Angular v5.2.11
  13. * (c) 2010-2018 Google, Inc. https://angular.io/
  14. * License: MIT
  15. */
  16. /**
  17. * @fileoverview added by tsickle
  18. * @suppress {checkTypes} checked by tsc
  19. */
  20. /**
  21. * AnimationBuilder is an injectable service that is available when the {\@link
  22. * BrowserAnimationsModule BrowserAnimationsModule} or {\@link NoopAnimationsModule
  23. * NoopAnimationsModule} modules are used within an application.
  24. *
  25. * The purpose if this service is to produce an animation sequence programmatically within an
  26. * angular component or directive.
  27. *
  28. * Programmatic animations are first built and then a player is created when the build animation is
  29. * attached to an element.
  30. *
  31. * ```ts
  32. * // remember to include the BrowserAnimationsModule module for this to work...
  33. * import {AnimationBuilder} from '\@angular/animations';
  34. *
  35. * class MyCmp {
  36. * constructor(private _builder: AnimationBuilder) {}
  37. *
  38. * makeAnimation(element: any) {
  39. * // first build the animation
  40. * const myAnimation = this._builder.build([
  41. * style({ width: 0 }),
  42. * animate(1000, style({ width: '100px' }))
  43. * ]);
  44. *
  45. * // then create a player from it
  46. * const player = myAnimation.create(element);
  47. *
  48. * player.play();
  49. * }
  50. * }
  51. * ```
  52. *
  53. * When an animation is built an instance of {\@link AnimationFactory AnimationFactory} will be
  54. * returned. Using that an {\@link AnimationPlayer AnimationPlayer} can be created which can then be
  55. * used to start the animation.
  56. *
  57. * \@experimental Animation support is experimental.
  58. * @abstract
  59. */
  60. var AnimationBuilder = /** @class */ (function () {
  61. function AnimationBuilder() {
  62. }
  63. return AnimationBuilder;
  64. }());
  65. /**
  66. * An instance of `AnimationFactory` is returned from {\@link AnimationBuilder#build
  67. * AnimationBuilder.build}.
  68. *
  69. * \@experimental Animation support is experimental.
  70. * @abstract
  71. */
  72. var AnimationFactory = /** @class */ (function () {
  73. function AnimationFactory() {
  74. }
  75. return AnimationFactory;
  76. }());
  77. /**
  78. * @fileoverview added by tsickle
  79. * @suppress {checkTypes} checked by tsc
  80. */
  81. /**
  82. * @license
  83. * Copyright Google Inc. All Rights Reserved.
  84. *
  85. * Use of this source code is governed by an MIT-style license that can be
  86. * found in the LICENSE file at https://angular.io/license
  87. * @record
  88. */
  89. /**
  90. * \@experimental Animation support is experimental.
  91. */
  92. var AUTO_STYLE = '*';
  93. /**
  94. * \@experimental Animation support is experimental.
  95. * @record
  96. */
  97. /**
  98. * Metadata representing the entry of animations. Instances of this interface are provided via the
  99. * animation DSL when the {\@link trigger trigger animation function} is called.
  100. *
  101. * \@experimental Animation support is experimental.
  102. * @record
  103. */
  104. /**
  105. * Metadata representing the entry of animations. Instances of this interface are provided via the
  106. * animation DSL when the {\@link state state animation function} is called.
  107. *
  108. * \@experimental Animation support is experimental.
  109. * @record
  110. */
  111. /**
  112. * Metadata representing the entry of animations. Instances of this interface are provided via the
  113. * animation DSL when the {\@link transition transition animation function} is called.
  114. *
  115. * \@experimental Animation support is experimental.
  116. * @record
  117. */
  118. /**
  119. * \@experimental Animation support is experimental.
  120. * @record
  121. */
  122. /**
  123. * \@experimental Animation support is experimental.
  124. * @record
  125. */
  126. /**
  127. * Metadata representing the entry of animations. Instances of this interface are provided via the
  128. * animation DSL when the {\@link keyframes keyframes animation function} is called.
  129. *
  130. * \@experimental Animation support is experimental.
  131. * @record
  132. */
  133. /**
  134. * Metadata representing the entry of animations. Instances of this interface are provided via the
  135. * animation DSL when the {\@link style style animation function} is called.
  136. *
  137. * \@experimental Animation support is experimental.
  138. * @record
  139. */
  140. /**
  141. * Metadata representing the entry of animations. Instances of this interface are provided via the
  142. * animation DSL when the {\@link animate animate animation function} is called.
  143. *
  144. * \@experimental Animation support is experimental.
  145. * @record
  146. */
  147. /**
  148. * Metadata representing the entry of animations. Instances of this interface are provided via the
  149. * animation DSL when the {\@link animateChild animateChild animation function} is called.
  150. *
  151. * \@experimental Animation support is experimental.
  152. * @record
  153. */
  154. /**
  155. * Metadata representing the entry of animations. Instances of this interface are provided via the
  156. * animation DSL when the {\@link useAnimation useAnimation animation function} is called.
  157. *
  158. * \@experimental Animation support is experimental.
  159. * @record
  160. */
  161. /**
  162. * Metadata representing the entry of animations. Instances of this interface are provided via the
  163. * animation DSL when the {\@link sequence sequence animation function} is called.
  164. *
  165. * \@experimental Animation support is experimental.
  166. * @record
  167. */
  168. /**
  169. * Metadata representing the entry of animations. Instances of this interface are provided via the
  170. * animation DSL when the {\@link group group animation function} is called.
  171. *
  172. * \@experimental Animation support is experimental.
  173. * @record
  174. */
  175. /**
  176. * Metadata representing the entry of animations. Instances of this interface are provided via the
  177. * animation DSL when the {\@link stagger stagger animation function} is called.
  178. *
  179. * \@experimental Animation support is experimental.
  180. * @record
  181. */
  182. /**
  183. * `trigger` is an animation-specific function that is designed to be used inside of Angular's
  184. * animation DSL language. If this information is new, please navigate to the
  185. * {\@link Component#animations component animations metadata page} to gain a better
  186. * understanding of how animations in Angular are used.
  187. *
  188. * `trigger` Creates an animation trigger which will a list of {\@link state state} and
  189. * {\@link transition transition} entries that will be evaluated when the expression
  190. * bound to the trigger changes.
  191. *
  192. * Triggers are registered within the component annotation data under the
  193. * {\@link Component#animations animations section}. An animation trigger can be placed on an element
  194. * within a template by referencing the name of the trigger followed by the expression value that
  195. * the
  196. * trigger is bound to (in the form of `[\@triggerName]="expression"`.
  197. *
  198. * Animation trigger bindings strigify values and then match the previous and current values against
  199. * any linked transitions. If a boolean value is provided into the trigger binding then it will both
  200. * be represented as `1` or `true` and `0` or `false` for a true and false boolean values
  201. * respectively.
  202. *
  203. * ### Usage
  204. *
  205. * `trigger` will create an animation trigger reference based on the provided `name` value. The
  206. * provided `animation` value is expected to be an array consisting of {\@link state state} and
  207. * {\@link transition transition} declarations.
  208. *
  209. * ```typescript
  210. * \@Component({
  211. * selector: 'my-component',
  212. * templateUrl: 'my-component-tpl.html',
  213. * animations: [
  214. * trigger("myAnimationTrigger", [
  215. * state(...),
  216. * state(...),
  217. * transition(...),
  218. * transition(...)
  219. * ])
  220. * ]
  221. * })
  222. * class MyComponent {
  223. * myStatusExp = "something";
  224. * }
  225. * ```
  226. *
  227. * The template associated with this component will make use of the `myAnimationTrigger` animation
  228. * trigger by binding to an element within its template code.
  229. *
  230. * ```html
  231. * <!-- somewhere inside of my-component-tpl.html -->
  232. * <div [\@myAnimationTrigger]="myStatusExp">...</div>
  233. * ```
  234. *
  235. * ## Disable Animations
  236. * A special animation control binding called `\@.disabled` can be placed on an element which will
  237. * then disable animations for any inner animation triggers situated within the element as well as
  238. * any animations on the element itself.
  239. *
  240. * When true, the `\@.disabled` binding will prevent all animations from rendering. The example
  241. * below shows how to use this feature:
  242. *
  243. * ```ts
  244. * \@Component({
  245. * selector: 'my-component',
  246. * template: `
  247. * <div [\@.disabled]="isDisabled">
  248. * <div [\@childAnimation]="exp"></div>
  249. * </div>
  250. * `,
  251. * animations: [
  252. * trigger("childAnimation", [
  253. * // ...
  254. * ])
  255. * ]
  256. * })
  257. * class MyComponent {
  258. * isDisabled = true;
  259. * exp = '...';
  260. * }
  261. * ```
  262. *
  263. * The `\@childAnimation` trigger will not animate because `\@.disabled` prevents it from happening
  264. * (when true).
  265. *
  266. * Note that `\@.disabled` will only disable all animations (this means any animations running on
  267. * the same element will also be disabled).
  268. *
  269. * ### Disabling Animations Application-wide
  270. * When an area of the template is set to have animations disabled, **all** inner components will
  271. * also have their animations disabled as well. This means that all animations for an angular
  272. * application can be disabled by placing a host binding set on `\@.disabled` on the topmost Angular
  273. * component.
  274. *
  275. * ```ts
  276. * import {Component, HostBinding} from '\@angular/core';
  277. *
  278. * \@Component({
  279. * selector: 'app-component',
  280. * templateUrl: 'app.component.html',
  281. * })
  282. * class AppComponent {
  283. * \@HostBinding('\@.disabled')
  284. * public animationsDisabled = true;
  285. * }
  286. * ```
  287. *
  288. * ### What about animations that us `query()` and `animateChild()`?
  289. * Despite inner animations being disabled, a parent animation can {\@link query query} for inner
  290. * elements located in disabled areas of the template and still animate them as it sees fit. This is
  291. * also the case for when a sub animation is queried by a parent and then later animated using {\@link
  292. * animateChild animateChild}.
  293. *
  294. * \@experimental Animation support is experimental.
  295. * @param {?} name
  296. * @param {?} definitions
  297. * @return {?}
  298. */
  299. function trigger(name, definitions) {
  300. return { type: 7 /* Trigger */, name: name, definitions: definitions, options: {} };
  301. }
  302. /**
  303. * `animate` is an animation-specific function that is designed to be used inside of Angular's
  304. * animation DSL language. If this information is new, please navigate to the {\@link
  305. * Component#animations component animations metadata page} to gain a better understanding of
  306. * how animations in Angular are used.
  307. *
  308. * `animate` specifies an animation step that will apply the provided `styles` data for a given
  309. * amount of time based on the provided `timing` expression value. Calls to `animate` are expected
  310. * to be used within {\@link sequence an animation sequence}, {\@link group group}, or {\@link
  311. * transition transition}.
  312. *
  313. * ### Usage
  314. *
  315. * The `animate` function accepts two input parameters: `timing` and `styles`:
  316. *
  317. * - `timing` is a string based value that can be a combination of a duration with optional delay
  318. * and easing values. The format for the expression breaks down to `duration delay easing`
  319. * (therefore a value such as `1s 100ms ease-out` will be parse itself into `duration=1000,
  320. * delay=100, easing=ease-out`. If a numeric value is provided then that will be used as the
  321. * `duration` value in millisecond form.
  322. * - `styles` is the style input data which can either be a call to {\@link style style} or {\@link
  323. * keyframes keyframes}. If left empty then the styles from the destination state will be collected
  324. * and used (this is useful when describing an animation step that will complete an animation by
  325. * {\@link transition#the-final-animate-call animating to the final state}).
  326. *
  327. * ```typescript
  328. * // various functions for specifying timing data
  329. * animate(500, style(...))
  330. * animate("1s", style(...))
  331. * animate("100ms 0.5s", style(...))
  332. * animate("5s ease", style(...))
  333. * animate("5s 10ms cubic-bezier(.17,.67,.88,.1)", style(...))
  334. *
  335. * // either style() of keyframes() can be used
  336. * animate(500, style({ background: "red" }))
  337. * animate(500, keyframes([
  338. * style({ background: "blue" })),
  339. * style({ background: "red" }))
  340. * ])
  341. * ```
  342. *
  343. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  344. *
  345. * \@experimental Animation support is experimental.
  346. * @param {?} timings
  347. * @param {?=} styles
  348. * @return {?}
  349. */
  350. function animate(timings, styles) {
  351. if (styles === void 0) { styles = null; }
  352. return { type: 4 /* Animate */, styles: styles, timings: timings };
  353. }
  354. /**
  355. * `group` is an animation-specific function that is designed to be used inside of Angular's
  356. * animation DSL language. If this information is new, please navigate to the {\@link
  357. * Component#animations component animations metadata page} to gain a better understanding of
  358. * how animations in Angular are used.
  359. *
  360. * `group` specifies a list of animation steps that are all run in parallel. Grouped animations are
  361. * useful when a series of styles must be animated/closed off at different starting/ending times.
  362. *
  363. * The `group` function can either be used within a {\@link sequence sequence} or a {\@link transition
  364. * transition} and it will only continue to the next instruction once all of the inner animation
  365. * steps have completed.
  366. *
  367. * ### Usage
  368. *
  369. * The `steps` data that is passed into the `group` animation function can either consist of {\@link
  370. * style style} or {\@link animate animate} function calls. Each call to `style()` or `animate()`
  371. * within a group will be executed instantly (use {\@link keyframes keyframes} or a {\@link
  372. * animate#usage animate() with a delay value} to offset styles to be applied at a later time).
  373. *
  374. * ```typescript
  375. * group([
  376. * animate("1s", { background: "black" }))
  377. * animate("2s", { color: "white" }))
  378. * ])
  379. * ```
  380. *
  381. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  382. *
  383. * \@experimental Animation support is experimental.
  384. * @param {?} steps
  385. * @param {?=} options
  386. * @return {?}
  387. */
  388. function group(steps, options) {
  389. if (options === void 0) { options = null; }
  390. return { type: 3 /* Group */, steps: steps, options: options };
  391. }
  392. /**
  393. * `sequence` is an animation-specific function that is designed to be used inside of Angular's
  394. * animation DSL language. If this information is new, please navigate to the {\@link
  395. * Component#animations component animations metadata page} to gain a better understanding of
  396. * how animations in Angular are used.
  397. *
  398. * `sequence` Specifies a list of animation steps that are run one by one. (`sequence` is used by
  399. * default when an array is passed as animation data into {\@link transition transition}.)
  400. *
  401. * The `sequence` function can either be used within a {\@link group group} or a {\@link transition
  402. * transition} and it will only continue to the next instruction once each of the inner animation
  403. * steps have completed.
  404. *
  405. * To perform animation styling in parallel with other animation steps then have a look at the
  406. * {\@link group group} animation function.
  407. *
  408. * ### Usage
  409. *
  410. * The `steps` data that is passed into the `sequence` animation function can either consist of
  411. * {\@link style style} or {\@link animate animate} function calls. A call to `style()` will apply the
  412. * provided styling data immediately while a call to `animate()` will apply its styling data over a
  413. * given time depending on its timing data.
  414. *
  415. * ```typescript
  416. * sequence([
  417. * style({ opacity: 0 })),
  418. * animate("1s", { opacity: 1 }))
  419. * ])
  420. * ```
  421. *
  422. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  423. *
  424. * \@experimental Animation support is experimental.
  425. * @param {?} steps
  426. * @param {?=} options
  427. * @return {?}
  428. */
  429. function sequence(steps, options) {
  430. if (options === void 0) { options = null; }
  431. return { type: 2 /* Sequence */, steps: steps, options: options };
  432. }
  433. /**
  434. * `style` is an animation-specific function that is designed to be used inside of Angular's
  435. * animation DSL language. If this information is new, please navigate to the {\@link
  436. * Component#animations component animations metadata page} to gain a better understanding of
  437. * how animations in Angular are used.
  438. *
  439. * `style` declares a key/value object containing CSS properties/styles that can then be used for
  440. * {\@link state animation states}, within an {\@link sequence animation sequence}, or as styling data
  441. * for both {\@link animate animate} and {\@link keyframes keyframes}.
  442. *
  443. * ### Usage
  444. *
  445. * `style` takes in a key/value string map as data and expects one or more CSS property/value pairs
  446. * to be defined.
  447. *
  448. * ```typescript
  449. * // string values are used for css properties
  450. * style({ background: "red", color: "blue" })
  451. *
  452. * // numerical (pixel) values are also supported
  453. * style({ width: 100, height: 0 })
  454. * ```
  455. *
  456. * #### Auto-styles (using `*`)
  457. *
  458. * When an asterix (`*`) character is used as a value then it will be detected from the element
  459. * being animated and applied as animation data when the animation starts.
  460. *
  461. * This feature proves useful for a state depending on layout and/or environment factors; in such
  462. * cases the styles are calculated just before the animation starts.
  463. *
  464. * ```typescript
  465. * // the steps below will animate from 0 to the
  466. * // actual height of the element
  467. * style({ height: 0 }),
  468. * animate("1s", style({ height: "*" }))
  469. * ```
  470. *
  471. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  472. *
  473. * \@experimental Animation support is experimental.
  474. * @param {?} tokens
  475. * @return {?}
  476. */
  477. function style(tokens) {
  478. return { type: 6 /* Style */, styles: tokens, offset: null };
  479. }
  480. /**
  481. * `state` is an animation-specific function that is designed to be used inside of Angular's
  482. * animation DSL language. If this information is new, please navigate to the {\@link
  483. * Component#animations component animations metadata page} to gain a better understanding of
  484. * how animations in Angular are used.
  485. *
  486. * `state` declares an animation state within the given trigger. When a state is active within a
  487. * component then its associated styles will persist on the element that the trigger is attached to
  488. * (even when the animation ends).
  489. *
  490. * To animate between states, have a look at the animation {\@link transition transition} DSL
  491. * function. To register states to an animation trigger please have a look at the {\@link trigger
  492. * trigger} function.
  493. *
  494. * #### The `void` state
  495. *
  496. * The `void` state value is a reserved word that angular uses to determine when the element is not
  497. * apart of the application anymore (e.g. when an `ngIf` evaluates to false then the state of the
  498. * associated element is void).
  499. *
  500. * #### The `*` (default) state
  501. *
  502. * The `*` state (when styled) is a fallback state that will be used if the state that is being
  503. * animated is not declared within the trigger.
  504. *
  505. * ### Usage
  506. *
  507. * `state` will declare an animation state with its associated styles
  508. * within the given trigger.
  509. *
  510. * - `stateNameExpr` can be one or more state names separated by commas.
  511. * - `styles` refers to the {\@link style styling data} that will be persisted on the element once
  512. * the state has been reached.
  513. *
  514. * ```typescript
  515. * // "void" is a reserved name for a state and is used to represent
  516. * // the state in which an element is detached from from the application.
  517. * state("void", style({ height: 0 }))
  518. *
  519. * // user-defined states
  520. * state("closed", style({ height: 0 }))
  521. * state("open, visible", style({ height: "*" }))
  522. * ```
  523. *
  524. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  525. *
  526. * \@experimental Animation support is experimental.
  527. * @param {?} name
  528. * @param {?} styles
  529. * @param {?=} options
  530. * @return {?}
  531. */
  532. function state(name, styles, options) {
  533. return { type: 0 /* State */, name: name, styles: styles, options: options };
  534. }
  535. /**
  536. * `keyframes` is an animation-specific function that is designed to be used inside of Angular's
  537. * animation DSL language. If this information is new, please navigate to the {\@link
  538. * Component#animations component animations metadata page} to gain a better understanding of
  539. * how animations in Angular are used.
  540. *
  541. * `keyframes` specifies a collection of {\@link style style} entries each optionally characterized
  542. * by an `offset` value.
  543. *
  544. * ### Usage
  545. *
  546. * The `keyframes` animation function is designed to be used alongside the {\@link animate animate}
  547. * animation function. Instead of applying animations from where they are currently to their
  548. * destination, keyframes can describe how each style entry is applied and at what point within the
  549. * animation arc (much like CSS Keyframe Animations do).
  550. *
  551. * For each `style()` entry an `offset` value can be set. Doing so allows to specifiy at what
  552. * percentage of the animate time the styles will be applied.
  553. *
  554. * ```typescript
  555. * // the provided offset values describe when each backgroundColor value is applied.
  556. * animate("5s", keyframes([
  557. * style({ backgroundColor: "red", offset: 0 }),
  558. * style({ backgroundColor: "blue", offset: 0.2 }),
  559. * style({ backgroundColor: "orange", offset: 0.3 }),
  560. * style({ backgroundColor: "black", offset: 1 })
  561. * ]))
  562. * ```
  563. *
  564. * Alternatively, if there are no `offset` values used within the style entries then the offsets
  565. * will be calculated automatically.
  566. *
  567. * ```typescript
  568. * animate("5s", keyframes([
  569. * style({ backgroundColor: "red" }) // offset = 0
  570. * style({ backgroundColor: "blue" }) // offset = 0.33
  571. * style({ backgroundColor: "orange" }) // offset = 0.66
  572. * style({ backgroundColor: "black" }) // offset = 1
  573. * ]))
  574. * ```
  575. *
  576. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  577. *
  578. * \@experimental Animation support is experimental.
  579. * @param {?} steps
  580. * @return {?}
  581. */
  582. function keyframes(steps) {
  583. return { type: 5 /* Keyframes */, steps: steps };
  584. }
  585. /**
  586. * `transition` is an animation-specific function that is designed to be used inside of Angular's
  587. * animation DSL language. If this information is new, please navigate to the {\@link
  588. * Component#animations component animations metadata page} to gain a better understanding of
  589. * how animations in Angular are used.
  590. *
  591. * `transition` declares the {\@link sequence sequence of animation steps} that will be run when the
  592. * provided `stateChangeExpr` value is satisfied. The `stateChangeExpr` consists of a `state1 =>
  593. * state2` which consists of two known states (use an asterix (`*`) to refer to a dynamic starting
  594. * and/or ending state).
  595. *
  596. * A function can also be provided as the `stateChangeExpr` argument for a transition and this
  597. * function will be executed each time a state change occurs. If the value returned within the
  598. * function is true then the associated animation will be run.
  599. *
  600. * Animation transitions are placed within an {\@link trigger animation trigger}. For an transition
  601. * to animate to a state value and persist its styles then one or more {\@link state animation
  602. * states} is expected to be defined.
  603. *
  604. * ### Usage
  605. *
  606. * An animation transition is kicked off the `stateChangeExpr` predicate evaluates to true based on
  607. * what the previous state is and what the current state has become. In other words, if a transition
  608. * is defined that matches the old/current state criteria then the associated animation will be
  609. * triggered.
  610. *
  611. * ```typescript
  612. * // all transition/state changes are defined within an animation trigger
  613. * trigger("myAnimationTrigger", [
  614. * // if a state is defined then its styles will be persisted when the
  615. * // animation has fully completed itself
  616. * state("on", style({ background: "green" })),
  617. * state("off", style({ background: "grey" })),
  618. *
  619. * // a transition animation that will be kicked off when the state value
  620. * // bound to "myAnimationTrigger" changes from "on" to "off"
  621. * transition("on => off", animate(500)),
  622. *
  623. * // it is also possible to do run the same animation for both directions
  624. * transition("on <=> off", animate(500)),
  625. *
  626. * // or to define multiple states pairs separated by commas
  627. * transition("on => off, off => void", animate(500)),
  628. *
  629. * // this is a catch-all state change for when an element is inserted into
  630. * // the page and the destination state is unknown
  631. * transition("void => *", [
  632. * style({ opacity: 0 }),
  633. * animate(500)
  634. * ]),
  635. *
  636. * // this will capture a state change between any states
  637. * transition("* => *", animate("1s 0s")),
  638. *
  639. * // you can also go full out and include a function
  640. * transition((fromState, toState) => {
  641. * // when `true` then it will allow the animation below to be invoked
  642. * return fromState == "off" && toState == "on";
  643. * }, animate("1s 0s"))
  644. * ])
  645. * ```
  646. *
  647. * The template associated with this component will make use of the `myAnimationTrigger` animation
  648. * trigger by binding to an element within its template code.
  649. *
  650. * ```html
  651. * <!-- somewhere inside of my-component-tpl.html -->
  652. * <div [\@myAnimationTrigger]="myStatusExp">...</div>
  653. * ```
  654. *
  655. * #### The final `animate` call
  656. *
  657. * If the final step within the transition steps is a call to `animate()` that **only** uses a
  658. * timing value with **no style data** then it will be automatically used as the final animation arc
  659. * for the element to animate itself to the final state. This involves an automatic mix of
  660. * adding/removing CSS styles so that the element will be in the exact state it should be for the
  661. * applied state to be presented correctly.
  662. *
  663. * ```
  664. * // start off by hiding the element, but make sure that it animates properly to whatever state
  665. * // is currently active for "myAnimationTrigger"
  666. * transition("void => *", [
  667. * style({ opacity: 0 }),
  668. * animate(500)
  669. * ])
  670. * ```
  671. *
  672. * ### Using :enter and :leave
  673. *
  674. * Given that enter (insertion) and leave (removal) animations are so common, the `transition`
  675. * function accepts both `:enter` and `:leave` values which are aliases for the `void => *` and `*
  676. * => void` state changes.
  677. *
  678. * ```
  679. * transition(":enter", [
  680. * style({ opacity: 0 }),
  681. * animate(500, style({ opacity: 1 }))
  682. * ]),
  683. * transition(":leave", [
  684. * animate(500, style({ opacity: 0 }))
  685. * ])
  686. * ```
  687. *
  688. * ### Boolean values
  689. * if a trigger binding value is a boolean value then it can be matched using a transition
  690. * expression that compares `true` and `false` or `1` and `0`.
  691. *
  692. * ```
  693. * // in the template
  694. * <div [\@openClose]="open ? true : false">...</div>
  695. *
  696. * // in the component metadata
  697. * trigger('openClose', [
  698. * state('true', style({ height: '*' })),
  699. * state('false', style({ height: '0px' })),
  700. * transition('false <=> true', animate(500))
  701. * ])
  702. * ```
  703. *
  704. * ### Using :increment and :decrement
  705. * In addition to the :enter and :leave transition aliases, the :increment and :decrement aliases
  706. * can be used to kick off a transition when a numeric value has increased or decreased in value.
  707. *
  708. * ```
  709. * import {group, animate, query, transition, style, trigger} from '\@angular/animations';
  710. * import {Component} from '\@angular/core';
  711. *
  712. * \@Component({
  713. * selector: 'banner-carousel-component',
  714. * styles: [`
  715. * .banner-container {
  716. * position:relative;
  717. * height:500px;
  718. * overflow:hidden;
  719. * }
  720. * .banner-container > .banner {
  721. * position:absolute;
  722. * left:0;
  723. * top:0;
  724. * font-size:200px;
  725. * line-height:500px;
  726. * font-weight:bold;
  727. * text-align:center;
  728. * width:100%;
  729. * }
  730. * `],
  731. * template: `
  732. * <button (click)="previous()">Previous</button>
  733. * <button (click)="next()">Next</button>
  734. * <hr>
  735. * <div [\@bannerAnimation]="selectedIndex" class="banner-container">
  736. * <div class="banner" *ngFor="let banner of banners"> {{ banner }} </div>
  737. * </div>
  738. * `,
  739. * animations: [
  740. * trigger('bannerAnimation', [
  741. * transition(":increment", group([
  742. * query(':enter', [
  743. * style({ left: '100%' }),
  744. * animate('0.5s ease-out', style('*'))
  745. * ]),
  746. * query(':leave', [
  747. * animate('0.5s ease-out', style({ left: '-100%' }))
  748. * ])
  749. * ])),
  750. * transition(":decrement", group([
  751. * query(':enter', [
  752. * style({ left: '-100%' }),
  753. * animate('0.5s ease-out', style('*'))
  754. * ]),
  755. * query(':leave', [
  756. * animate('0.5s ease-out', style({ left: '100%' }))
  757. * ])
  758. * ]))
  759. * ])
  760. * ]
  761. * })
  762. * class BannerCarouselComponent {
  763. * allBanners: string[] = ['1', '2', '3', '4'];
  764. * selectedIndex: number = 0;
  765. *
  766. * get banners() {
  767. * return [this.allBanners[this.selectedIndex]];
  768. * }
  769. *
  770. * previous() {
  771. * this.selectedIndex = Math.max(this.selectedIndex - 1, 0);
  772. * }
  773. *
  774. * next() {
  775. * this.selectedIndex = Math.min(this.selectedIndex + 1, this.allBanners.length - 1);
  776. * }
  777. * }
  778. * ```
  779. *
  780. * {\@example core/animation/ts/dsl/animation_example.ts region='Component'}
  781. *
  782. * \@experimental Animation support is experimental.
  783. * @param {?} stateChangeExpr
  784. * @param {?} steps
  785. * @param {?=} options
  786. * @return {?}
  787. */
  788. function transition(stateChangeExpr, steps, options) {
  789. if (options === void 0) { options = null; }
  790. return { type: 1 /* Transition */, expr: stateChangeExpr, animation: steps, options: options };
  791. }
  792. /**
  793. * `animation` is an animation-specific function that is designed to be used inside of Angular's
  794. * animation DSL language.
  795. *
  796. * `var myAnimation = animation(...)` is designed to produce a reusable animation that can be later
  797. * invoked in another animation or sequence. Reusable animations are designed to make use of
  798. * animation parameters and the produced animation can be used via the `useAnimation` method.
  799. *
  800. * ```
  801. * var fadeAnimation = animation([
  802. * style({ opacity: '{{ start }}' }),
  803. * animate('{{ time }}',
  804. * style({ opacity: '{{ end }}'}))
  805. * ], { params: { time: '1000ms', start: 0, end: 1 }});
  806. * ```
  807. *
  808. * If parameters are attached to an animation then they act as **default parameter values**. When an
  809. * animation is invoked via `useAnimation` then parameter values are allowed to be passed in
  810. * directly. If any of the passed in parameter values are missing then the default values will be
  811. * used.
  812. *
  813. * ```
  814. * useAnimation(fadeAnimation, {
  815. * params: {
  816. * time: '2s',
  817. * start: 1,
  818. * end: 0
  819. * }
  820. * })
  821. * ```
  822. *
  823. * If one or more parameter values are missing before animated then an error will be thrown.
  824. *
  825. * \@experimental Animation support is experimental.
  826. * @param {?} steps
  827. * @param {?=} options
  828. * @return {?}
  829. */
  830. function animation(steps, options) {
  831. if (options === void 0) { options = null; }
  832. return { type: 8 /* Reference */, animation: steps, options: options };
  833. }
  834. /**
  835. * `animateChild` is an animation-specific function that is designed to be used inside of Angular's
  836. * animation DSL language. It works by allowing a queried element to execute its own
  837. * animation within the animation sequence.
  838. *
  839. * Each time an animation is triggered in angular, the parent animation
  840. * will always get priority and any child animations will be blocked. In order
  841. * for a child animation to run, the parent animation must query each of the elements
  842. * containing child animations and then allow the animations to run using `animateChild`.
  843. *
  844. * The example HTML code below shows both parent and child elements that have animation
  845. * triggers that will execute at the same time.
  846. *
  847. * ```html
  848. * <!-- parent-child.component.html -->
  849. * <button (click)="exp =! exp">Toggle</button>
  850. * <hr>
  851. *
  852. * <div [\@parentAnimation]="exp">
  853. * <header>Hello</header>
  854. * <div [\@childAnimation]="exp">
  855. * one
  856. * </div>
  857. * <div [\@childAnimation]="exp">
  858. * two
  859. * </div>
  860. * <div [\@childAnimation]="exp">
  861. * three
  862. * </div>
  863. * </div>
  864. * ```
  865. *
  866. * Now when the `exp` value changes to true, only the `parentAnimation` animation will animate
  867. * because it has priority. However, using `query` and `animateChild` each of the inner animations
  868. * can also fire:
  869. *
  870. * ```ts
  871. * // parent-child.component.ts
  872. * import {trigger, transition, animate, style, query, animateChild} from '\@angular/animations';
  873. * \@Component({
  874. * selector: 'parent-child-component',
  875. * animations: [
  876. * trigger('parentAnimation', [
  877. * transition('false => true', [
  878. * query('header', [
  879. * style({ opacity: 0 }),
  880. * animate(500, style({ opacity: 1 }))
  881. * ]),
  882. * query('\@childAnimation', [
  883. * animateChild()
  884. * ])
  885. * ])
  886. * ]),
  887. * trigger('childAnimation', [
  888. * transition('false => true', [
  889. * style({ opacity: 0 }),
  890. * animate(500, style({ opacity: 1 }))
  891. * ])
  892. * ])
  893. * ]
  894. * })
  895. * class ParentChildCmp {
  896. * exp: boolean = false;
  897. * }
  898. * ```
  899. *
  900. * In the animation code above, when the `parentAnimation` transition kicks off it first queries to
  901. * find the header element and fades it in. It then finds each of the sub elements that contain the
  902. * `\@childAnimation` trigger and then allows for their animations to fire.
  903. *
  904. * This example can be further extended by using stagger:
  905. *
  906. * ```ts
  907. * query('\@childAnimation', stagger(100, [
  908. * animateChild()
  909. * ]))
  910. * ```
  911. *
  912. * Now each of the sub animations start off with respect to the `100ms` staggering step.
  913. *
  914. * ## The first frame of child animations
  915. * When sub animations are executed using `animateChild` the animation engine will always apply the
  916. * first frame of every sub animation immediately at the start of the animation sequence. This way
  917. * the parent animation does not need to set any initial styling data on the sub elements before the
  918. * sub animations kick off.
  919. *
  920. * In the example above the first frame of the `childAnimation`'s `false => true` transition
  921. * consists of a style of `opacity: 0`. This is applied immediately when the `parentAnimation`
  922. * animation transition sequence starts. Only then when the `\@childAnimation` is queried and called
  923. * with `animateChild` will it then animate to its destination of `opacity: 1`.
  924. *
  925. * Note that this feature designed to be used alongside {\@link query query()} and it will only work
  926. * with animations that are assigned using the Angular animation DSL (this means that CSS keyframes
  927. * and transitions are not handled by this API).
  928. *
  929. * \@experimental Animation support is experimental.
  930. * @param {?=} options
  931. * @return {?}
  932. */
  933. function animateChild(options) {
  934. if (options === void 0) { options = null; }
  935. return { type: 9 /* AnimateChild */, options: options };
  936. }
  937. /**
  938. * `useAnimation` is an animation-specific function that is designed to be used inside of Angular's
  939. * animation DSL language. It is used to kick off a reusable animation that is created using {\@link
  940. * animation animation()}.
  941. *
  942. * \@experimental Animation support is experimental.
  943. * @param {?} animation
  944. * @param {?=} options
  945. * @return {?}
  946. */
  947. function useAnimation(animation, options) {
  948. if (options === void 0) { options = null; }
  949. return { type: 10 /* AnimateRef */, animation: animation, options: options };
  950. }
  951. /**
  952. * `query` is an animation-specific function that is designed to be used inside of Angular's
  953. * animation DSL language.
  954. *
  955. * query() is used to find one or more inner elements within the current element that is
  956. * being animated within the sequence. The provided animation steps are applied
  957. * to the queried element (by default, an array is provided, then this will be
  958. * treated as an animation sequence).
  959. *
  960. * ### Usage
  961. *
  962. * query() is designed to collect mutiple elements and works internally by using
  963. * `element.querySelectorAll`. An additional options object can be provided which
  964. * can be used to limit the total amount of items to be collected.
  965. *
  966. * ```js
  967. * query('div', [
  968. * animate(...),
  969. * animate(...)
  970. * ], { limit: 1 })
  971. * ```
  972. *
  973. * query(), by default, will throw an error when zero items are found. If a query
  974. * has the `optional` flag set to true then this error will be ignored.
  975. *
  976. * ```js
  977. * query('.some-element-that-may-not-be-there', [
  978. * animate(...),
  979. * animate(...)
  980. * ], { optional: true })
  981. * ```
  982. *
  983. * ### Special Selector Values
  984. *
  985. * The selector value within a query can collect elements that contain angular-specific
  986. * characteristics
  987. * using special pseudo-selectors tokens.
  988. *
  989. * These include:
  990. *
  991. * - Querying for newly inserted/removed elements using `query(":enter")`/`query(":leave")`
  992. * - Querying all currently animating elements using `query(":animating")`
  993. * - Querying elements that contain an animation trigger using `query("\@triggerName")`
  994. * - Querying all elements that contain an animation triggers using `query("\@*")`
  995. * - Including the current element into the animation sequence using `query(":self")`
  996. *
  997. *
  998. * Each of these pseudo-selector tokens can be merged together into a combined query selector
  999. * string:
  1000. *
  1001. * ```
  1002. * query(':self, .record:enter, .record:leave, \@subTrigger', [...])
  1003. * ```
  1004. *
  1005. * ### Demo
  1006. *
  1007. * ```
  1008. * \@Component({
  1009. * selector: 'inner',
  1010. * template: `
  1011. * <div [\@queryAnimation]="exp">
  1012. * <h1>Title</h1>
  1013. * <div class="content">
  1014. * Blah blah blah
  1015. * </div>
  1016. * </div>
  1017. * `,
  1018. * animations: [
  1019. * trigger('queryAnimation', [
  1020. * transition('* => goAnimate', [
  1021. * // hide the inner elements
  1022. * query('h1', style({ opacity: 0 })),
  1023. * query('.content', style({ opacity: 0 })),
  1024. *
  1025. * // animate the inner elements in, one by one
  1026. * query('h1', animate(1000, style({ opacity: 1 })),
  1027. * query('.content', animate(1000, style({ opacity: 1 })),
  1028. * ])
  1029. * ])
  1030. * ]
  1031. * })
  1032. * class Cmp {
  1033. * exp = '';
  1034. *
  1035. * goAnimate() {
  1036. * this.exp = 'goAnimate';
  1037. * }
  1038. * }
  1039. * ```
  1040. *
  1041. * \@experimental Animation support is experimental.
  1042. * @param {?} selector
  1043. * @param {?} animation
  1044. * @param {?=} options
  1045. * @return {?}
  1046. */
  1047. function query(selector, animation, options) {
  1048. if (options === void 0) { options = null; }
  1049. return { type: 11 /* Query */, selector: selector, animation: animation, options: options };
  1050. }
  1051. /**
  1052. * `stagger` is an animation-specific function that is designed to be used inside of Angular's
  1053. * animation DSL language. It is designed to be used inside of an animation {\@link query query()}
  1054. * and works by issuing a timing gap between after each queried item is animated.
  1055. *
  1056. * ### Usage
  1057. *
  1058. * In the example below there is a container element that wraps a list of items stamped out
  1059. * by an ngFor. The container element contains an animation trigger that will later be set
  1060. * to query for each of the inner items.
  1061. *
  1062. * ```html
  1063. * <!-- list.component.html -->
  1064. * <button (click)="toggle()">Show / Hide Items</button>
  1065. * <hr />
  1066. * <div [\@listAnimation]="items.length">
  1067. * <div *ngFor="let item of items">
  1068. * {{ item }}
  1069. * </div>
  1070. * </div>
  1071. * ```
  1072. *
  1073. * The component code for this looks as such:
  1074. *
  1075. * ```ts
  1076. * import {trigger, transition, style, animate, query, stagger} from '\@angular/animations';
  1077. * \@Component({
  1078. * templateUrl: 'list.component.html',
  1079. * animations: [
  1080. * trigger('listAnimation', [
  1081. * //...
  1082. * ])
  1083. * ]
  1084. * })
  1085. * class ListComponent {
  1086. * items = [];
  1087. *
  1088. * showItems() {
  1089. * this.items = [0,1,2,3,4];
  1090. * }
  1091. *
  1092. * hideItems() {
  1093. * this.items = [];
  1094. * }
  1095. *
  1096. * toggle() {
  1097. * this.items.length ? this.hideItems() : this.showItems();
  1098. * }
  1099. * }
  1100. * ```
  1101. *
  1102. * And now for the animation trigger code:
  1103. *
  1104. * ```ts
  1105. * trigger('listAnimation', [
  1106. * transition('* => *', [ // each time the binding value changes
  1107. * query(':leave', [
  1108. * stagger(100, [
  1109. * animate('0.5s', style({ opacity: 0 }))
  1110. * ])
  1111. * ]),
  1112. * query(':enter', [
  1113. * style({ opacity: 0 }),
  1114. * stagger(100, [
  1115. * animate('0.5s', style({ opacity: 1 }))
  1116. * ])
  1117. * ])
  1118. * ])
  1119. * ])
  1120. * ```
  1121. *
  1122. * Now each time the items are added/removed then either the opacity
  1123. * fade-in animation will run or each removed item will be faded out.
  1124. * When either of these animations occur then a stagger effect will be
  1125. * applied after each item's animation is started.
  1126. *
  1127. * \@experimental Animation support is experimental.
  1128. * @param {?} timings
  1129. * @param {?} animation
  1130. * @return {?}
  1131. */
  1132. function stagger(timings, animation) {
  1133. return { type: 12 /* Stagger */, timings: timings, animation: animation };
  1134. }
  1135. /**
  1136. * @fileoverview added by tsickle
  1137. * @suppress {checkTypes} checked by tsc
  1138. */
  1139. /**
  1140. * @license
  1141. * Copyright Google Inc. All Rights Reserved.
  1142. *
  1143. * Use of this source code is governed by an MIT-style license that can be
  1144. * found in the LICENSE file at https://angular.io/license
  1145. * @param {?} cb
  1146. * @return {?}
  1147. */
  1148. function scheduleMicroTask(cb) {
  1149. Promise.resolve(null).then(cb);
  1150. }
  1151. /**
  1152. * @fileoverview added by tsickle
  1153. * @suppress {checkTypes} checked by tsc
  1154. */
  1155. /**
  1156. * AnimationPlayer controls an animation sequence that was produced from a programmatic animation.
  1157. * (see {\@link AnimationBuilder AnimationBuilder} for more information on how to create programmatic
  1158. * animations.)
  1159. *
  1160. * \@experimental Animation support is experimental.
  1161. * @record
  1162. */
  1163. /**
  1164. * \@experimental Animation support is experimental.
  1165. */
  1166. var NoopAnimationPlayer = /** @class */ (function () {
  1167. function NoopAnimationPlayer() {
  1168. this._onDoneFns = [];
  1169. this._onStartFns = [];
  1170. this._onDestroyFns = [];
  1171. this._started = false;
  1172. this._destroyed = false;
  1173. this._finished = false;
  1174. this.parentPlayer = null;
  1175. this.totalTime = 0;
  1176. }
  1177. /**
  1178. * @return {?}
  1179. */
  1180. NoopAnimationPlayer.prototype._onFinish = /**
  1181. * @return {?}
  1182. */
  1183. function () {
  1184. if (!this._finished) {
  1185. this._finished = true;
  1186. this._onDoneFns.forEach(function (fn) { return fn(); });
  1187. this._onDoneFns = [];
  1188. }
  1189. };
  1190. /**
  1191. * @param {?} fn
  1192. * @return {?}
  1193. */
  1194. NoopAnimationPlayer.prototype.onStart = /**
  1195. * @param {?} fn
  1196. * @return {?}
  1197. */
  1198. function (fn) { this._onStartFns.push(fn); };
  1199. /**
  1200. * @param {?} fn
  1201. * @return {?}
  1202. */
  1203. NoopAnimationPlayer.prototype.onDone = /**
  1204. * @param {?} fn
  1205. * @return {?}
  1206. */
  1207. function (fn) { this._onDoneFns.push(fn); };
  1208. /**
  1209. * @param {?} fn
  1210. * @return {?}
  1211. */
  1212. NoopAnimationPlayer.prototype.onDestroy = /**
  1213. * @param {?} fn
  1214. * @return {?}
  1215. */
  1216. function (fn) { this._onDestroyFns.push(fn); };
  1217. /**
  1218. * @return {?}
  1219. */
  1220. NoopAnimationPlayer.prototype.hasStarted = /**
  1221. * @return {?}
  1222. */
  1223. function () { return this._started; };
  1224. /**
  1225. * @return {?}
  1226. */
  1227. NoopAnimationPlayer.prototype.init = /**
  1228. * @return {?}
  1229. */
  1230. function () { };
  1231. /**
  1232. * @return {?}
  1233. */
  1234. NoopAnimationPlayer.prototype.play = /**
  1235. * @return {?}
  1236. */
  1237. function () {
  1238. if (!this.hasStarted()) {
  1239. this._onStart();
  1240. this.triggerMicrotask();
  1241. }
  1242. this._started = true;
  1243. };
  1244. /* @internal */
  1245. /**
  1246. * @return {?}
  1247. */
  1248. NoopAnimationPlayer.prototype.triggerMicrotask = /**
  1249. * @return {?}
  1250. */
  1251. function () {
  1252. var _this = this;
  1253. scheduleMicroTask(function () { return _this._onFinish(); });
  1254. };
  1255. /**
  1256. * @return {?}
  1257. */
  1258. NoopAnimationPlayer.prototype._onStart = /**
  1259. * @return {?}
  1260. */
  1261. function () {
  1262. this._onStartFns.forEach(function (fn) { return fn(); });
  1263. this._onStartFns = [];
  1264. };
  1265. /**
  1266. * @return {?}
  1267. */
  1268. NoopAnimationPlayer.prototype.pause = /**
  1269. * @return {?}
  1270. */
  1271. function () { };
  1272. /**
  1273. * @return {?}
  1274. */
  1275. NoopAnimationPlayer.prototype.restart = /**
  1276. * @return {?}
  1277. */
  1278. function () { };
  1279. /**
  1280. * @return {?}
  1281. */
  1282. NoopAnimationPlayer.prototype.finish = /**
  1283. * @return {?}
  1284. */
  1285. function () { this._onFinish(); };
  1286. /**
  1287. * @return {?}
  1288. */
  1289. NoopAnimationPlayer.prototype.destroy = /**
  1290. * @return {?}
  1291. */
  1292. function () {
  1293. if (!this._destroyed) {
  1294. this._destroyed = true;
  1295. if (!this.hasStarted()) {
  1296. this._onStart();
  1297. }
  1298. this.finish();
  1299. this._onDestroyFns.forEach(function (fn) { return fn(); });
  1300. this._onDestroyFns = [];
  1301. }
  1302. };
  1303. /**
  1304. * @return {?}
  1305. */
  1306. NoopAnimationPlayer.prototype.reset = /**
  1307. * @return {?}
  1308. */
  1309. function () { };
  1310. /**
  1311. * @param {?} p
  1312. * @return {?}
  1313. */
  1314. NoopAnimationPlayer.prototype.setPosition = /**
  1315. * @param {?} p
  1316. * @return {?}
  1317. */
  1318. function (p) { };
  1319. /**
  1320. * @return {?}
  1321. */
  1322. NoopAnimationPlayer.prototype.getPosition = /**
  1323. * @return {?}
  1324. */
  1325. function () { return 0; };
  1326. /* @internal */
  1327. /**
  1328. * @param {?} phaseName
  1329. * @return {?}
  1330. */
  1331. NoopAnimationPlayer.prototype.triggerCallback = /**
  1332. * @param {?} phaseName
  1333. * @return {?}
  1334. */
  1335. function (phaseName) {
  1336. var /** @type {?} */ methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
  1337. methods.forEach(function (fn) { return fn(); });
  1338. methods.length = 0;
  1339. };
  1340. return NoopAnimationPlayer;
  1341. }());
  1342. /**
  1343. * @fileoverview added by tsickle
  1344. * @suppress {checkTypes} checked by tsc
  1345. */
  1346. /**
  1347. * @license
  1348. * Copyright Google Inc. All Rights Reserved.
  1349. *
  1350. * Use of this source code is governed by an MIT-style license that can be
  1351. * found in the LICENSE file at https://angular.io/license
  1352. */
  1353. var AnimationGroupPlayer = /** @class */ (function () {
  1354. function AnimationGroupPlayer(_players) {
  1355. var _this = this;
  1356. this._onDoneFns = [];
  1357. this._onStartFns = [];
  1358. this._finished = false;
  1359. this._started = false;
  1360. this._destroyed = false;
  1361. this._onDestroyFns = [];
  1362. this.parentPlayer = null;
  1363. this.totalTime = 0;
  1364. this.players = _players;
  1365. var /** @type {?} */ doneCount = 0;
  1366. var /** @type {?} */ destroyCount = 0;
  1367. var /** @type {?} */ startCount = 0;
  1368. var /** @type {?} */ total = this.players.length;
  1369. if (total == 0) {
  1370. scheduleMicroTask(function () { return _this._onFinish(); });
  1371. }
  1372. else {
  1373. this.players.forEach(function (player) {
  1374. player.onDone(function () {
  1375. if (++doneCount == total) {
  1376. _this._onFinish();
  1377. }
  1378. });
  1379. player.onDestroy(function () {
  1380. if (++destroyCount == total) {
  1381. _this._onDestroy();
  1382. }
  1383. });
  1384. player.onStart(function () {
  1385. if (++startCount == total) {
  1386. _this._onStart();
  1387. }
  1388. });
  1389. });
  1390. }
  1391. this.totalTime = this.players.reduce(function (time, player) { return Math.max(time, player.totalTime); }, 0);
  1392. }
  1393. /**
  1394. * @return {?}
  1395. */
  1396. AnimationGroupPlayer.prototype._onFinish = /**
  1397. * @return {?}
  1398. */
  1399. function () {
  1400. if (!this._finished) {
  1401. this._finished = true;
  1402. this._onDoneFns.forEach(function (fn) { return fn(); });
  1403. this._onDoneFns = [];
  1404. }
  1405. };
  1406. /**
  1407. * @return {?}
  1408. */
  1409. AnimationGroupPlayer.prototype.init = /**
  1410. * @return {?}
  1411. */
  1412. function () { this.players.forEach(function (player) { return player.init(); }); };
  1413. /**
  1414. * @param {?} fn
  1415. * @return {?}
  1416. */
  1417. AnimationGroupPlayer.prototype.onStart = /**
  1418. * @param {?} fn
  1419. * @return {?}
  1420. */
  1421. function (fn) { this._onStartFns.push(fn); };
  1422. /**
  1423. * @return {?}
  1424. */
  1425. AnimationGroupPlayer.prototype._onStart = /**
  1426. * @return {?}
  1427. */
  1428. function () {
  1429. if (!this.hasStarted()) {
  1430. this._started = true;
  1431. this._onStartFns.forEach(function (fn) { return fn(); });
  1432. this._onStartFns = [];
  1433. }
  1434. };
  1435. /**
  1436. * @param {?} fn
  1437. * @return {?}
  1438. */
  1439. AnimationGroupPlayer.prototype.onDone = /**
  1440. * @param {?} fn
  1441. * @return {?}
  1442. */
  1443. function (fn) { this._onDoneFns.push(fn); };
  1444. /**
  1445. * @param {?} fn
  1446. * @return {?}
  1447. */
  1448. AnimationGroupPlayer.prototype.onDestroy = /**
  1449. * @param {?} fn
  1450. * @return {?}
  1451. */
  1452. function (fn) { this._onDestroyFns.push(fn); };
  1453. /**
  1454. * @return {?}
  1455. */
  1456. AnimationGroupPlayer.prototype.hasStarted = /**
  1457. * @return {?}
  1458. */
  1459. function () { return this._started; };
  1460. /**
  1461. * @return {?}
  1462. */
  1463. AnimationGroupPlayer.prototype.play = /**
  1464. * @return {?}
  1465. */
  1466. function () {
  1467. if (!this.parentPlayer) {
  1468. this.init();
  1469. }
  1470. this._onStart();
  1471. this.players.forEach(function (player) { return player.play(); });
  1472. };
  1473. /**
  1474. * @return {?}
  1475. */
  1476. AnimationGroupPlayer.prototype.pause = /**
  1477. * @return {?}
  1478. */
  1479. function () { this.players.forEach(function (player) { return player.pause(); }); };
  1480. /**
  1481. * @return {?}
  1482. */
  1483. AnimationGroupPlayer.prototype.restart = /**
  1484. * @return {?}
  1485. */
  1486. function () { this.players.forEach(function (player) { return player.restart(); }); };
  1487. /**
  1488. * @return {?}
  1489. */
  1490. AnimationGroupPlayer.prototype.finish = /**
  1491. * @return {?}
  1492. */
  1493. function () {
  1494. this._onFinish();
  1495. this.players.forEach(function (player) { return player.finish(); });
  1496. };
  1497. /**
  1498. * @return {?}
  1499. */
  1500. AnimationGroupPlayer.prototype.destroy = /**
  1501. * @return {?}
  1502. */
  1503. function () { this._onDestroy(); };
  1504. /**
  1505. * @return {?}
  1506. */
  1507. AnimationGroupPlayer.prototype._onDestroy = /**
  1508. * @return {?}
  1509. */
  1510. function () {
  1511. if (!this._destroyed) {
  1512. this._destroyed = true;
  1513. this._onFinish();
  1514. this.players.forEach(function (player) { return player.destroy(); });
  1515. this._onDestroyFns.forEach(function (fn) { return fn(); });
  1516. this._onDestroyFns = [];
  1517. }
  1518. };
  1519. /**
  1520. * @return {?}
  1521. */
  1522. AnimationGroupPlayer.prototype.reset = /**
  1523. * @return {?}
  1524. */
  1525. function () {
  1526. this.players.forEach(function (player) { return player.reset(); });
  1527. this._destroyed = false;
  1528. this._finished = false;
  1529. this._started = false;
  1530. };
  1531. /**
  1532. * @param {?} p
  1533. * @return {?}
  1534. */
  1535. AnimationGroupPlayer.prototype.setPosition = /**
  1536. * @param {?} p
  1537. * @return {?}
  1538. */
  1539. function (p) {
  1540. var /** @type {?} */ timeAtPosition = p * this.totalTime;
  1541. this.players.forEach(function (player) {
  1542. var /** @type {?} */ position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1;
  1543. player.setPosition(position);
  1544. });
  1545. };
  1546. /**
  1547. * @return {?}
  1548. */
  1549. AnimationGroupPlayer.prototype.getPosition = /**
  1550. * @return {?}
  1551. */
  1552. function () {
  1553. var /** @type {?} */ min = 0;
  1554. this.players.forEach(function (player) {
  1555. var /** @type {?} */ p = player.getPosition();
  1556. min = Math.min(p, min);
  1557. });
  1558. return min;
  1559. };
  1560. /**
  1561. * @return {?}
  1562. */
  1563. AnimationGroupPlayer.prototype.beforeDestroy = /**
  1564. * @return {?}
  1565. */
  1566. function () {
  1567. this.players.forEach(function (player) {
  1568. if (player.beforeDestroy) {
  1569. player.beforeDestroy();
  1570. }
  1571. });
  1572. };
  1573. /* @internal */
  1574. /**
  1575. * @param {?} phaseName
  1576. * @return {?}
  1577. */
  1578. AnimationGroupPlayer.prototype.triggerCallback = /**
  1579. * @param {?} phaseName
  1580. * @return {?}
  1581. */
  1582. function (phaseName) {
  1583. var /** @type {?} */ methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
  1584. methods.forEach(function (fn) { return fn(); });
  1585. methods.length = 0;
  1586. };
  1587. return AnimationGroupPlayer;
  1588. }());
  1589. /**
  1590. * @fileoverview added by tsickle
  1591. * @suppress {checkTypes} checked by tsc
  1592. */
  1593. var ɵPRE_STYLE = '!';
  1594. exports.AnimationBuilder = AnimationBuilder;
  1595. exports.AnimationFactory = AnimationFactory;
  1596. exports.AUTO_STYLE = AUTO_STYLE;
  1597. exports.animate = animate;
  1598. exports.animateChild = animateChild;
  1599. exports.animation = animation;
  1600. exports.group = group;
  1601. exports.keyframes = keyframes;
  1602. exports.query = query;
  1603. exports.sequence = sequence;
  1604. exports.stagger = stagger;
  1605. exports.state = state;
  1606. exports.style = style;
  1607. exports.transition = transition;
  1608. exports.trigger = trigger;
  1609. exports.useAnimation = useAnimation;
  1610. exports.NoopAnimationPlayer = NoopAnimationPlayer;
  1611. exports.ɵAnimationGroupPlayer = AnimationGroupPlayer;
  1612. exports.ɵPRE_STYLE = ɵPRE_STYLE;
  1613. Object.defineProperty(exports, '__esModule', { value: true });
  1614. })));
  1615. //# sourceMappingURL=animations.umd.js.map