@stratusjs/angular 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/angular.bundle.js +1443 -492
  2. package/dist/angular.bundle.min.js +1 -1
  3. package/package.json +2 -2
  4. package/src/boot.js +1 -0
  5. package/src/boot.js.map +1 -1
  6. package/src/boot.min.js +1 -1
  7. package/src/boot.ts +1 -0
  8. package/src/editor/quill-break-blot.plugin.js +38 -0
  9. package/src/editor/quill-break-blot.plugin.js.map +1 -0
  10. package/src/editor/quill-break-blot.plugin.min.js +1 -0
  11. package/src/editor/quill-html-edit.plugin.js +164 -0
  12. package/src/editor/quill-html-edit.plugin.js.map +1 -0
  13. package/src/editor/quill-html-edit.plugin.min.js +1 -0
  14. package/src/editor/quill-image-format.plugin.js +50 -0
  15. package/src/editor/quill-image-format.plugin.js.map +1 -0
  16. package/src/editor/quill-image-format.plugin.min.js +1 -0
  17. package/src/editor/quill-input-button.plugin.js +98 -0
  18. package/src/editor/quill-input-button.plugin.js.map +1 -0
  19. package/src/editor/quill-input-button.plugin.min.js +1 -0
  20. package/src/froala/editor/froala-editor.directive.js +328 -0
  21. package/src/froala/editor/froala-editor.directive.js.map +1 -0
  22. package/src/froala/editor/froala-editor.directive.min.js +1 -0
  23. package/src/froala/editor/froala-editor.module.js +37 -0
  24. package/src/froala/editor/froala-editor.module.js.map +1 -0
  25. package/src/froala/editor/froala-editor.module.min.js +1 -0
  26. package/src/froala/editor/index.js +22 -0
  27. package/src/froala/editor/index.js.map +1 -0
  28. package/src/froala/editor/index.min.js +1 -0
  29. package/src/froala/plugins/image_manager.js +364 -0
  30. package/src/froala/plugins/image_manager.js.map +1 -0
  31. package/src/froala/plugins/image_manager.min.js +1 -0
  32. package/src/froala/plugins/inputButton.js +2 -0
  33. package/src/froala/plugins/inputButton.js.map +1 -1
  34. package/src/froala/plugins/inputButton.min.js +1 -1
  35. package/src/froala/plugins/inputButton.ts +2 -2
  36. package/src/froala/plugins/linkManager.js +2 -2
  37. package/src/froala/plugins/linkManager.js.map +1 -1
  38. package/src/froala/plugins/linkManager.min.js +1 -1
  39. package/src/froala/plugins/linkManager.ts +4 -4
  40. package/src/froala/view/froala-view.directive.js +49 -0
  41. package/src/froala/view/froala-view.directive.js.map +1 -0
  42. package/src/froala/view/froala-view.directive.min.js +1 -0
  43. package/src/froala/view/froala-view.module.js +37 -0
  44. package/src/froala/view/froala-view.module.js.map +1 -0
  45. package/src/froala/view/froala-view.module.min.js +1 -0
  46. package/src/froala/view/index.js +22 -0
  47. package/src/froala/view/index.js.map +1 -0
  48. package/src/froala/view/index.min.js +1 -0
  49. package/src/root/root.component.js +43 -0
  50. package/src/root/root.component.js.map +1 -0
  51. package/src/root/root.component.min.js +1 -0
  52. package/src/core/dialog.interface.js.map +0 -1
@@ -1,6 +1,6 @@
1
- System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/environment', '@stratusjs/core/misc', '@stratusjs/angularjs/services/model', '@stratusjs/angularjs/services/registry', '@stratusjs/core/events/eventManager', 'html2pdf', 'font-awesome', 'froala-plugins', 'froala-embedly', 'froala-font-awesome', 'froala-image-tui', 'froala-editor', '@stratusjs/core/datastore/xhr', '@agentepsilon/decko', 'toastify-js', '@stratusjs/angularjs/services/collection', 'zone.js/dist/zone'], (function (exports) {
1
+ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/environment', '@stratusjs/core/misc', '@stratusjs/angularjs/services/model', '@stratusjs/angularjs/services/registry', '@stratusjs/core/events/eventManager', 'html2pdf', 'font-awesome', 'froala-plugins', 'froala-embedly', 'froala-font-awesome', 'froala-image-tui', 'froala-editor', '@stratusjs/core/datastore/xhr', '@agentepsilon/decko', '@stratusjs/angular/core/root.component', 'toastify-js', '@stratusjs/angularjs/services/collection', 'zone.js/dist/zone'], (function (exports) {
2
2
  'use strict';
3
- var Stratus, _, uniqueId$3, snakeCase, head, isEmpty, isUndefined, isString, extend$1, debounce$2, isNumber, isBoolean, isArray$1, clone, isFunction$1, set, isNil, includes, isObject$2, assignIn, forEach, cookie, isJSON, safeUniqueId, Model, Registry, EventManager$1, FroalaEditor, XHR, debounce$1, Toastify, Collection;
3
+ var Stratus, _, uniqueId$3, snakeCase, head, isEmpty, isUndefined, isString, extend$1, debounce$2, isNumber, isBoolean, isArray$1, clone, isFunction$1, set, isNil, includes, isObject$2, assignIn, forEach, cookie, isJSON, safeUniqueId, Model, Registry, EventManager$1, FroalaEditor, XHR, debounce$1, RootComponent$1, Toastify, Collection;
4
4
  return {
5
5
  setters: [function (module) {
6
6
  Stratus = module.Stratus;
@@ -42,6 +42,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
42
42
  XHR = module.XHR;
43
43
  }, function (module) {
44
44
  debounce$1 = module.debounce;
45
+ }, function (module) {
46
+ RootComponent$1 = module.RootComponent;
45
47
  }, function (module) {
46
48
  Toastify = module["default"];
47
49
  }, function (module) {
@@ -80847,6 +80849,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80847
80849
  console.log('[restoreSnapshot]is focused:', this.editor.core.hasFocus());
80848
80850
  }
80849
80851
  this.editor.events.disableBlur();
80852
+ this.editor.events.focus();
80850
80853
  this.editor.snapshot.restore(this.snapshot);
80851
80854
  this.editor.events.enableBlur();
80852
80855
  return true;
@@ -80866,6 +80869,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
80866
80869
  console.log('[restoreSelection]is focused:', this.editor.core.hasFocus());
80867
80870
  }
80868
80871
  this.editor.events.disableBlur();
80872
+ this.editor.events.focus();
80869
80873
  this.editor.selection.restore();
80870
80874
  this.editor.events.enableBlur();
80871
80875
  return true;
@@ -81072,7 +81076,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81072
81076
  editor.link.insert(link.url, link.text, attrs);
81073
81077
  },
81074
81078
  autoSaveSelection: true,
81075
- maintainSnapshot: true,
81076
81079
  autoRestoreSelection: true,
81077
81080
  debug
81078
81081
  });
@@ -81095,8 +81098,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
81095
81098
  FroalaEditor.RegisterCommand('linkManager', {
81096
81099
  title: 'Insert from Link Library',
81097
81100
  undo: false,
81098
- focus: false,
81101
+ focus: true,
81099
81102
  modal: true,
81103
+ refreshOnCallback: false,
81100
81104
  callback() {
81101
81105
  this.linkManager.onClick();
81102
81106
  },
@@ -124802,11 +124806,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124802
124806
  /** Width of the map. Set this to `null` if you'd like to control the width through CSS. */
124803
124807
  this.width = DEFAULT_WIDTH;
124804
124808
  this._options = DEFAULT_OPTIONS;
124805
- /**
124806
- * See
124807
- * https://developers.google.com/maps/documentation/javascript/events#auth-errors
124808
- */
124809
- this.authFailure = new EventEmitter();
124810
124809
  /**
124811
124810
  * See
124812
124811
  * https://developers.google.com/maps/documentation/javascript/reference/map#Map.bounds_changed
@@ -124907,13 +124906,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124907
124906
  'https://developers.google.com/maps/documentation/javascript/' +
124908
124907
  'tutorial#Loading_the_Maps_API');
124909
124908
  }
124910
- this._existingAuthFailureCallback = googleMapsWindow.gm_authFailure;
124911
- googleMapsWindow.gm_authFailure = () => {
124912
- if (this._existingAuthFailureCallback) {
124913
- this._existingAuthFailureCallback();
124914
- }
124915
- this.authFailure.emit();
124916
- };
124917
124909
  }
124918
124910
  }
124919
124911
  set center(center) {
@@ -124962,10 +124954,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
124962
124954
  }
124963
124955
  ngOnDestroy() {
124964
124956
  this._eventManager.destroy();
124965
- if (this._isBrowser) {
124966
- const googleMapsWindow = window;
124967
- googleMapsWindow.gm_authFailure = this._existingAuthFailureCallback;
124968
- }
124969
124957
  }
124970
124958
  /**
124971
124959
  * See
@@ -125152,7 +125140,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
125152
125140
  center: [{ type: Input }],
125153
125141
  zoom: [{ type: Input }],
125154
125142
  options: [{ type: Input }],
125155
- authFailure: [{ type: Output }],
125156
125143
  boundsChanged: [{ type: Output }],
125157
125144
  centerChanged: [{ type: Output }],
125158
125145
  mapClick: [{ type: Output }],
@@ -125505,131 +125492,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
125505
125492
  circleRightclick: [{ type: Output }]
125506
125493
  };
125507
125494
 
125508
- /**
125509
- * @license
125510
- * Copyright Google LLC All Rights Reserved.
125511
- *
125512
- * Use of this source code is governed by an MIT-style license that can be
125513
- * found in the LICENSE file at https://angular.io/license
125514
- */
125515
- /**
125516
- * Angular component that renders a Google Maps Directions Renderer via the Google Maps
125517
- * JavaScript API.
125518
- *
125519
- * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsRenderer
125520
- */
125521
- class MapDirectionsRenderer {
125522
- constructor(_googleMap, _ngZone) {
125523
- this._googleMap = _googleMap;
125524
- this._ngZone = _ngZone;
125525
- this._eventManager = new MapEventManager(this._ngZone);
125526
- /**
125527
- * See developers.google.com/maps/documentation/javascript/reference/directions
125528
- * #DirectionsRenderer.directions_changed
125529
- */
125530
- this.directionsChanged = this._eventManager.getLazyEmitter('directions_changed');
125531
- }
125532
- /**
125533
- * See developers.google.com/maps/documentation/javascript/reference/directions
125534
- * #DirectionsRendererOptions.directions
125535
- */
125536
- set directions(directions) {
125537
- this._directions = directions;
125538
- }
125539
- /**
125540
- * See developers.google.com/maps/documentation/javascript/reference/directions
125541
- * #DirectionsRendererOptions
125542
- */
125543
- set options(options) {
125544
- this._options = options;
125545
- }
125546
- ngOnInit() {
125547
- if (this._googleMap._isBrowser) {
125548
- // Create the object outside the zone so its events don't trigger change detection.
125549
- // We'll bring it back in inside the `MapEventManager` only for the events that the
125550
- // user has subscribed to.
125551
- this._ngZone.runOutsideAngular(() => {
125552
- this.directionsRenderer = new google.maps.DirectionsRenderer(this._combineOptions());
125553
- });
125554
- this._assertInitialized();
125555
- this.directionsRenderer.setMap(this._googleMap.googleMap);
125556
- this._eventManager.setTarget(this.directionsRenderer);
125557
- }
125558
- }
125559
- ngOnChanges(changes) {
125560
- if (this.directionsRenderer) {
125561
- if (changes['options']) {
125562
- this.directionsRenderer.setOptions(this._combineOptions());
125563
- }
125564
- if (changes['directions'] && this._directions !== undefined) {
125565
- this.directionsRenderer.setDirections(this._directions);
125566
- }
125567
- }
125568
- }
125569
- ngOnDestroy() {
125570
- this._eventManager.destroy();
125571
- if (this.directionsRenderer) {
125572
- this.directionsRenderer.setMap(null);
125573
- }
125574
- }
125575
- /**
125576
- * See developers.google.com/maps/documentation/javascript/reference/directions
125577
- * #DirectionsRenderer.getDirections
125578
- */
125579
- getDirections() {
125580
- this._assertInitialized();
125581
- return this.directionsRenderer.getDirections();
125582
- }
125583
- /**
125584
- * See developers.google.com/maps/documentation/javascript/reference/directions
125585
- * #DirectionsRenderer.getPanel
125586
- */
125587
- getPanel() {
125588
- this._assertInitialized();
125589
- return this.directionsRenderer.getPanel();
125590
- }
125591
- /**
125592
- * See developers.google.com/maps/documentation/javascript/reference/directions
125593
- * #DirectionsRenderer.getRouteIndex
125594
- */
125595
- getRouteIndex() {
125596
- this._assertInitialized();
125597
- return this.directionsRenderer.getRouteIndex();
125598
- }
125599
- _combineOptions() {
125600
- const options = this._options || {};
125601
- return Object.assign(Object.assign({}, options), { directions: this._directions || options.directions, map: this._googleMap.googleMap });
125602
- }
125603
- _assertInitialized() {
125604
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
125605
- if (!this._googleMap.googleMap) {
125606
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
125607
- 'Please wait for the API to load before trying to interact with it.');
125608
- }
125609
- if (!this.directionsRenderer) {
125610
- throw Error('Cannot interact with a Google Map Directions Renderer before it has been ' +
125611
- 'initialized. Please wait for the Directions Renderer to load before trying ' +
125612
- 'to interact with it.');
125613
- }
125614
- }
125615
- }
125616
- }
125617
- MapDirectionsRenderer.decorators = [
125618
- { type: Directive, args: [{
125619
- selector: 'map-directions-renderer',
125620
- exportAs: 'mapDirectionsRenderer',
125621
- },] }
125622
- ];
125623
- MapDirectionsRenderer.ctorParameters = () => [
125624
- { type: GoogleMap },
125625
- { type: NgZone }
125626
- ];
125627
- MapDirectionsRenderer.propDecorators = {
125628
- directions: [{ type: Input }],
125629
- options: [{ type: Input }],
125630
- directionsChanged: [{ type: Output }]
125631
- };
125632
-
125633
125495
  /**
125634
125496
  * @license
125635
125497
  * Copyright Google LLC All Rights Reserved.
@@ -126298,20 +126160,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126298
126160
  set options(options) {
126299
126161
  this._options = options;
126300
126162
  }
126301
- /**
126302
- * Icon to be used for the marker.
126303
- * See: https://developers.google.com/maps/documentation/javascript/reference/marker#Icon
126304
- */
126305
- set icon(icon) {
126306
- this._icon = icon;
126307
- }
126308
- /**
126309
- * Whether the marker is visible.
126310
- * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.visible
126311
- */
126312
- set visible(value) {
126313
- this._visible = value;
126314
- }
126315
126163
  ngOnInit() {
126316
126164
  if (this._googleMap._isBrowser) {
126317
126165
  // Create the object outside the zone so its events don't trigger change detection.
@@ -126326,7 +126174,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126326
126174
  }
126327
126175
  }
126328
126176
  ngOnChanges(changes) {
126329
- const { marker, _title, _position, _label, _clickable, _icon, _visible } = this;
126177
+ const { marker, _title, _position, _label, _clickable } = this;
126330
126178
  if (marker) {
126331
126179
  if (changes['options']) {
126332
126180
  marker.setOptions(this._combineOptions());
@@ -126343,12 +126191,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126343
126191
  if (changes['clickable'] && _clickable !== undefined) {
126344
126192
  marker.setClickable(_clickable);
126345
126193
  }
126346
- if (changes['icon'] && _icon) {
126347
- marker.setIcon(_icon);
126348
- }
126349
- if (changes['visible'] && _visible !== undefined) {
126350
- marker.setVisible(_visible);
126351
- }
126352
126194
  }
126353
126195
  }
126354
126196
  ngOnDestroy() {
@@ -126460,9 +126302,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126460
126302
  }
126461
126303
  /** Creates a combined options object using the passed-in options and the individual inputs. */
126462
126304
  _combineOptions() {
126463
- var _a, _b;
126464
126305
  const options = this._options || DEFAULT_MARKER_OPTIONS;
126465
- return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: (_a = this._clickable) !== null && _a !== void 0 ? _a : options.clickable, map: this._googleMap.googleMap, icon: this._icon || options.icon, visible: (_b = this._visible) !== null && _b !== void 0 ? _b : options.visible });
126306
+ return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: this._clickable !== undefined ? this._clickable : options.clickable, map: this._googleMap.googleMap });
126466
126307
  }
126467
126308
  _assertInitialized() {
126468
126309
  if (typeof ngDevMode === 'undefined' || ngDevMode) {
@@ -126493,8 +126334,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126493
126334
  label: [{ type: Input }],
126494
126335
  clickable: [{ type: Input }],
126495
126336
  options: [{ type: Input }],
126496
- icon: [{ type: Input }],
126497
- visible: [{ type: Input }],
126498
126337
  animationChanged: [{ type: Output }],
126499
126338
  mapClick: [{ type: Output }],
126500
126339
  clickableChanged: [{ type: Output }],
@@ -126525,8 +126364,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126525
126364
  * Use of this source code is governed by an MIT-style license that can be
126526
126365
  * found in the LICENSE file at https://angular.io/license
126527
126366
  */
126528
- /** Default options for a clusterer. */
126529
- const DEFAULT_CLUSTERER_OPTIONS = {};
126530
126367
  /**
126531
126368
  * Angular component for implementing a Google Maps Marker Clusterer.
126532
126369
  *
@@ -126551,8 +126388,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126551
126388
  * googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#clusteringend
126552
126389
  */
126553
126390
  this.clusteringend = this._eventManager.getLazyEmitter('clusteringend');
126554
- /** Emits when a cluster has been clicked. */
126555
- this.clusterClick = this._eventManager.getLazyEmitter('click');
126556
126391
  this._canInitialize = this._googleMap._isBrowser;
126557
126392
  }
126558
126393
  set averageCenter(averageCenter) {
@@ -126603,17 +126438,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126603
126438
  set zoomOnClick(zoomOnClick) {
126604
126439
  this._zoomOnClick = zoomOnClick;
126605
126440
  }
126606
- set options(options) {
126607
- this._options = options;
126608
- }
126609
126441
  ngOnInit() {
126610
126442
  if (this._canInitialize) {
126611
- const clustererWindow = window;
126612
- if (!clustererWindow.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
126613
- throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +
126614
- 'Please install the MarkerClustererPlus library: ' +
126615
- 'https://github.com/googlemaps/js-markerclustererplus');
126616
- }
126617
126443
  // Create the object outside the zone so its events don't trigger change detection.
126618
126444
  // We'll bring it back in inside the `MapEventManager` only for the events that the
126619
126445
  // user has subscribed to.
@@ -126632,9 +126458,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126632
126458
  ngOnChanges(changes) {
126633
126459
  const { markerClusterer: clusterer, ariaLabelFn, _averageCenter, _batchSizeIE, _calculator, _styles, _clusterClass, _enableRetinaIcons, _gridSize, _ignoreHidden, _imageExtension, _imagePath, _imageSizes, _maxZoom, _minimumClusterSize, _title, _zIndex, _zoomOnClick } = this;
126634
126460
  if (clusterer) {
126635
- if (changes['options']) {
126636
- clusterer.setOptions(this._combineOptions());
126637
- }
126638
126461
  if (changes['ariaLabelFn']) {
126639
126462
  clusterer.ariaLabelFn = ariaLabelFn;
126640
126463
  }
@@ -126644,7 +126467,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126644
126467
  if (changes['batchSizeIE'] && _batchSizeIE !== undefined) {
126645
126468
  clusterer.setBatchSizeIE(_batchSizeIE);
126646
126469
  }
126647
- if (changes['calculator'] && !!_calculator) {
126470
+ if (changes['calculator'] && _calculator) {
126648
126471
  clusterer.setCalculator(_calculator);
126649
126472
  }
126650
126473
  if (changes['clusterClass'] && _clusterClass !== undefined) {
@@ -126777,9 +126600,26 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126777
126600
  return this.markerClusterer.getZoomOnClick();
126778
126601
  }
126779
126602
  _combineOptions() {
126780
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
126781
- const options = this._options || DEFAULT_CLUSTERER_OPTIONS;
126782
- return Object.assign(Object.assign({}, options), { ariaLabelFn: (_a = this.ariaLabelFn) !== null && _a !== void 0 ? _a : options.ariaLabelFn, averageCenter: (_b = this._averageCenter) !== null && _b !== void 0 ? _b : options.averageCenter, batchSize: (_c = this.batchSize) !== null && _c !== void 0 ? _c : options.batchSize, batchSizeIE: (_d = this._batchSizeIE) !== null && _d !== void 0 ? _d : options.batchSizeIE, calculator: (_e = this._calculator) !== null && _e !== void 0 ? _e : options.calculator, clusterClass: (_f = this._clusterClass) !== null && _f !== void 0 ? _f : options.clusterClass, enableRetinaIcons: (_g = this._enableRetinaIcons) !== null && _g !== void 0 ? _g : options.enableRetinaIcons, gridSize: (_h = this._gridSize) !== null && _h !== void 0 ? _h : options.gridSize, ignoreHidden: (_j = this._ignoreHidden) !== null && _j !== void 0 ? _j : options.ignoreHidden, imageExtension: (_k = this._imageExtension) !== null && _k !== void 0 ? _k : options.imageExtension, imagePath: (_l = this._imagePath) !== null && _l !== void 0 ? _l : options.imagePath, imageSizes: (_m = this._imageSizes) !== null && _m !== void 0 ? _m : options.imageSizes, maxZoom: (_o = this._maxZoom) !== null && _o !== void 0 ? _o : options.maxZoom, minimumClusterSize: (_p = this._minimumClusterSize) !== null && _p !== void 0 ? _p : options.minimumClusterSize, styles: (_q = this._styles) !== null && _q !== void 0 ? _q : options.styles, title: (_r = this._title) !== null && _r !== void 0 ? _r : options.title, zIndex: (_s = this._zIndex) !== null && _s !== void 0 ? _s : options.zIndex, zoomOnClick: (_t = this._zoomOnClick) !== null && _t !== void 0 ? _t : options.zoomOnClick });
126603
+ return {
126604
+ ariaLabelFn: this.ariaLabelFn,
126605
+ averageCenter: this._averageCenter,
126606
+ batchSize: this.batchSize,
126607
+ batchSizeIE: this._batchSizeIE,
126608
+ calculator: this._calculator,
126609
+ clusterClass: this._clusterClass,
126610
+ enableRetinaIcons: this._enableRetinaIcons,
126611
+ gridSize: this._gridSize,
126612
+ ignoreHidden: this._ignoreHidden,
126613
+ imageExtension: this._imageExtension,
126614
+ imagePath: this._imagePath,
126615
+ imageSizes: this._imageSizes,
126616
+ maxZoom: this._maxZoom,
126617
+ minimumClusterSize: this._minimumClusterSize,
126618
+ styles: this._styles,
126619
+ title: this._title,
126620
+ zIndex: this._zIndex,
126621
+ zoomOnClick: this._zoomOnClick,
126622
+ };
126783
126623
  }
126784
126624
  _watchForMarkerChanges() {
126785
126625
  this._assertInitialized();
@@ -126862,10 +126702,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
126862
126702
  title: [{ type: Input }],
126863
126703
  zIndex: [{ type: Input }],
126864
126704
  zoomOnClick: [{ type: Input }],
126865
- options: [{ type: Input }],
126866
126705
  clusteringbegin: [{ type: Output }],
126867
126706
  clusteringend: [{ type: Output }],
126868
- clusterClick: [{ type: Output }],
126869
126707
  _markers: [{ type: ContentChildren, args: [MapMarker, { descendants: true },] }]
126870
126708
  };
126871
126709
 
@@ -127265,7 +127103,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127265
127103
  /**
127266
127104
  * See
127267
127105
  * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged
127268
- */ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
127106
+ */
127107
+ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
127269
127108
  /**
127270
127109
  * See
127271
127110
  * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click
@@ -127566,132 +127405,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127566
127405
  },] }
127567
127406
  ];
127568
127407
 
127569
- /**
127570
- * @license
127571
- * Copyright Google LLC All Rights Reserved.
127572
- *
127573
- * Use of this source code is governed by an MIT-style license that can be
127574
- * found in the LICENSE file at https://angular.io/license
127575
- */
127576
- /**
127577
- * Angular directive that renders a Google Maps heatmap via the Google Maps JavaScript API.
127578
- *
127579
- * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
127580
- */
127581
- class MapHeatmapLayer {
127582
- constructor(_googleMap, _ngZone) {
127583
- this._googleMap = _googleMap;
127584
- this._ngZone = _ngZone;
127585
- }
127586
- /**
127587
- * Data shown on the heatmap.
127588
- * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
127589
- */
127590
- set data(data) {
127591
- this._data = data;
127592
- }
127593
- /**
127594
- * Options used to configure the heatmap. See:
127595
- * developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayerOptions
127596
- */
127597
- set options(options) {
127598
- this._options = options;
127599
- }
127600
- ngOnInit() {
127601
- var _a, _b;
127602
- if (this._googleMap._isBrowser) {
127603
- if (!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.visualization) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
127604
- throw Error('Namespace `google.maps.visualization` not found, cannot construct heatmap. ' +
127605
- 'Please install the Google Maps JavaScript API with the "visualization" library: ' +
127606
- 'https://developers.google.com/maps/documentation/javascript/visualization');
127607
- }
127608
- // Create the object outside the zone so its events don't trigger change detection.
127609
- // We'll bring it back in inside the `MapEventManager` only for the events that the
127610
- // user has subscribed to.
127611
- this._ngZone.runOutsideAngular(() => {
127612
- this.heatmap = new google.maps.visualization.HeatmapLayer(this._combineOptions());
127613
- });
127614
- this._assertInitialized();
127615
- this.heatmap.setMap(this._googleMap.googleMap);
127616
- }
127617
- }
127618
- ngOnChanges(changes) {
127619
- const { _data, heatmap } = this;
127620
- if (heatmap) {
127621
- if (changes['options']) {
127622
- heatmap.setOptions(this._combineOptions());
127623
- }
127624
- if (changes['data'] && _data !== undefined) {
127625
- heatmap.setData(this._normalizeData(_data));
127626
- }
127627
- }
127628
- }
127629
- ngOnDestroy() {
127630
- if (this.heatmap) {
127631
- this.heatmap.setMap(null);
127632
- }
127633
- }
127634
- /**
127635
- * Gets the data that is currently shown on the heatmap.
127636
- * See: developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayer
127637
- */
127638
- getData() {
127639
- this._assertInitialized();
127640
- return this.heatmap.getData();
127641
- }
127642
- /** Creates a combined options object using the passed-in options and the individual inputs. */
127643
- _combineOptions() {
127644
- const options = this._options || {};
127645
- return Object.assign(Object.assign({}, options), { data: this._normalizeData(this._data || options.data || []), map: this._googleMap.googleMap });
127646
- }
127647
- /**
127648
- * Most Google Maps APIs support both `LatLng` objects and `LatLngLiteral`. The latter is more
127649
- * convenient to write out, because the Google Maps API doesn't have to have been loaded in order
127650
- * to construct them. The `HeatmapLayer` appears to be an exception that only allows a `LatLng`
127651
- * object, or it throws a runtime error. Since it's more convenient and we expect that Angular
127652
- * users will load the API asynchronously, we allow them to pass in a `LatLngLiteral` and we
127653
- * convert it to a `LatLng` object before passing it off to Google Maps.
127654
- */
127655
- _normalizeData(data) {
127656
- const result = [];
127657
- data.forEach(item => {
127658
- result.push(isLatLngLiteral(item) ? new google.maps.LatLng(item.lat, item.lng) : item);
127659
- });
127660
- return result;
127661
- }
127662
- /** Asserts that the heatmap object has been initialized. */
127663
- _assertInitialized() {
127664
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
127665
- if (!this._googleMap.googleMap) {
127666
- throw Error('Cannot access Google Map information before the API has been initialized. ' +
127667
- 'Please wait for the API to load before trying to interact with it.');
127668
- }
127669
- if (!this.heatmap) {
127670
- throw Error('Cannot interact with a Google Map HeatmapLayer before it has been ' +
127671
- 'initialized. Please wait for the heatmap to load before trying to interact with it.');
127672
- }
127673
- }
127674
- }
127675
- }
127676
- MapHeatmapLayer.decorators = [
127677
- { type: Directive, args: [{
127678
- selector: 'map-heatmap-layer',
127679
- exportAs: 'mapHeatmapLayer',
127680
- },] }
127681
- ];
127682
- MapHeatmapLayer.ctorParameters = () => [
127683
- { type: GoogleMap },
127684
- { type: NgZone }
127685
- ];
127686
- MapHeatmapLayer.propDecorators = {
127687
- data: [{ type: Input }],
127688
- options: [{ type: Input }]
127689
- };
127690
- /** Asserts that an object is a `LatLngLiteral`. */
127691
- function isLatLngLiteral(value) {
127692
- return value && typeof value.lat === 'number' && typeof value.lng === 'number';
127693
- }
127694
-
127695
127408
  /**
127696
127409
  * @license
127697
127410
  * Copyright Google LLC All Rights Reserved.
@@ -127704,7 +127417,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127704
127417
  MapBaseLayer,
127705
127418
  MapBicyclingLayer,
127706
127419
  MapCircle,
127707
- MapDirectionsRenderer,
127708
127420
  MapGroundOverlay,
127709
127421
  MapInfoWindow,
127710
127422
  MapKmlLayer,
@@ -127715,7 +127427,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127715
127427
  MapRectangle,
127716
127428
  MapTrafficLayer,
127717
127429
  MapTransitLayer,
127718
- MapHeatmapLayer,
127719
127430
  ];
127720
127431
  class GoogleMapsModule {
127721
127432
  }
@@ -127726,95 +127437,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
127726
127437
  },] }
127727
127438
  ];
127728
127439
 
127729
- /**
127730
- * @license
127731
- * Copyright Google LLC All Rights Reserved.
127732
- *
127733
- * Use of this source code is governed by an MIT-style license that can be
127734
- * found in the LICENSE file at https://angular.io/license
127735
- */
127736
- /**
127737
- * Angular service that wraps the Google Maps DirectionsService from the Google Maps JavaScript
127738
- * API.
127739
- *
127740
- * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService
127741
- */
127742
- class MapDirectionsService {
127743
- constructor(_ngZone) {
127744
- this._ngZone = _ngZone;
127745
- }
127746
- /**
127747
- * See
127748
- * developers.google.com/maps/documentation/javascript/reference/directions
127749
- * #DirectionsService.route
127750
- */
127751
- route(request) {
127752
- return new Observable(observer => {
127753
- // Initialize the `DirectionsService` lazily since the Google Maps API may
127754
- // not have been loaded when the provider is instantiated.
127755
- if (!this._directionsService) {
127756
- this._directionsService = new google.maps.DirectionsService();
127757
- }
127758
- const callback = (result, status) => {
127759
- this._ngZone.run(() => {
127760
- observer.next({ result, status });
127761
- observer.complete();
127762
- });
127763
- };
127764
- this._directionsService.route(request, callback);
127765
- });
127766
- }
127767
- }
127768
- MapDirectionsService.ɵprov = ɵɵdefineInjectable({ factory: function MapDirectionsService_Factory() { return new MapDirectionsService(ɵɵinject(NgZone)); }, token: MapDirectionsService, providedIn: "root" });
127769
- MapDirectionsService.decorators = [
127770
- { type: Injectable, args: [{ providedIn: 'root' },] }
127771
- ];
127772
- MapDirectionsService.ctorParameters = () => [
127773
- { type: NgZone }
127774
- ];
127775
-
127776
- /**
127777
- * @license
127778
- * Copyright Google LLC All Rights Reserved.
127779
- *
127780
- * Use of this source code is governed by an MIT-style license that can be
127781
- * found in the LICENSE file at https://angular.io/license
127782
- */
127783
- /**
127784
- * Angular service that wraps the Google Maps Geocoder from the Google Maps JavaScript API.
127785
- * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
127786
- */
127787
- class MapGeocoder {
127788
- constructor(_ngZone) {
127789
- this._ngZone = _ngZone;
127790
- }
127791
- /**
127792
- * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode
127793
- */
127794
- geocode(request) {
127795
- return new Observable(observer => {
127796
- // Initialize the `Geocoder` lazily since the Google Maps API may
127797
- // not have been loaded when the provider is instantiated.
127798
- if (!this._geocoder) {
127799
- this._geocoder = new google.maps.Geocoder();
127800
- }
127801
- this._geocoder.geocode(request, (results, status) => {
127802
- this._ngZone.run(() => {
127803
- observer.next({ results, status });
127804
- observer.complete();
127805
- });
127806
- });
127807
- });
127808
- }
127809
- }
127810
- MapGeocoder.ɵprov = ɵɵdefineInjectable({ factory: function MapGeocoder_Factory() { return new MapGeocoder(ɵɵinject(NgZone)); }, token: MapGeocoder, providedIn: "root" });
127811
- MapGeocoder.decorators = [
127812
- { type: Injectable, args: [{ providedIn: 'root' },] }
127813
- ];
127814
- MapGeocoder.ctorParameters = () => [
127815
- { type: NgZone }
127816
- ];
127817
-
127818
127440
  var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
127819
127441
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
127820
127442
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -128457,11 +128079,25 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128457
128079
  step((generator = generator.apply(thisArg, _arguments || [])).next());
128458
128080
  });
128459
128081
  };
128082
+ class StripeComponent extends RootComponent$1 {
128083
+ constructor() {
128084
+ super(...arguments);
128085
+ this.styled = false;
128086
+ this.initialized = false;
128087
+ }
128088
+ }
128089
+ __decorate$8([
128090
+ Input(),
128091
+ __metadata$7("design:type", String)
128092
+ ], StripeComponent.prototype, "elementId", void 0);
128093
+ class StripeListComponent extends StripeComponent {
128094
+ }
128460
128095
  let StripeService = class StripeService {
128461
128096
  constructor() {
128462
128097
  this.publishKey = '';
128463
128098
  this.Stripe = {};
128464
- this.collections = [];
128099
+ this.instanceOnEmitters = {};
128100
+ this.collections = {};
128465
128101
  this.initializing = false;
128466
128102
  this.initialized = false;
128467
128103
  Stratus.Services.Stripe = this;
@@ -128575,12 +128211,29 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128575
128211
  return this.Stripe.stripe.confirmCardSetup(clientSecret, stripeData, options);
128576
128212
  });
128577
128213
  }
128578
- registerCollection(collection) {
128579
- this.collections.push(collection);
128214
+ registerCollection(component, collection) {
128215
+ this.collections[component.uid] = { uid: component.uid, component, collection };
128580
128216
  }
128581
- fetchCollections() {
128582
- this.collections.forEach((collection) => {
128583
- collection.fetch().then();
128217
+ fetchCollections(uid) {
128218
+ return __awaiter$6(this, void 0, void 0, function* () {
128219
+ let uids;
128220
+ if (isString(uid) &&
128221
+ uid.length > 0) {
128222
+ uids = [uid];
128223
+ }
128224
+ else {
128225
+ uids = Object.keys(this.collections);
128226
+ }
128227
+ const uidList = [];
128228
+ uids.forEach((uidName) => {
128229
+ if (Object.prototype.hasOwnProperty.call(this.collections, uidName)) {
128230
+ uidList.push(() => __awaiter$6(this, void 0, void 0, function* () {
128231
+ yield this.collections[uidName].collection.fetch();
128232
+ this.emitManual('collectionUpdated', uidName, this.collections[uidName].component, this.collections[uidName].collection);
128233
+ }));
128234
+ }
128235
+ });
128236
+ yield Promise.all(uidList.map(fn => fn()));
128584
128237
  });
128585
128238
  }
128586
128239
  createElement(id, publishKey, paymentMethodType, options, mountElement) {
@@ -128644,6 +128297,53 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128644
128297
  this.currentElement = undefined;
128645
128298
  }
128646
128299
  }
128300
+ emit(emitterName, component, ...variables) {
128301
+ this.emitManual(emitterName, component.elementId, component, variables);
128302
+ }
128303
+ emitManual(emitterName, uid, component, ...variables) {
128304
+ var _a, _b;
128305
+ var _c, _d;
128306
+ if (Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, uid) &&
128307
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[uid], emitterName)) {
128308
+ Object.values(this.instanceOnEmitters[uid][emitterName]).forEach((emitter) => {
128309
+ try {
128310
+ emitter(component, variables);
128311
+ }
128312
+ catch (e) {
128313
+ console.error(e, 'issue sending back emitter on', uid, emitterName, emitter);
128314
+ }
128315
+ });
128316
+ }
128317
+ if (emitterName === 'init') {
128318
+ (_a = (_c = this.instanceOnEmitters)[uid]) !== null && _a !== void 0 ? _a : (_c[uid] = {});
128319
+ (_b = (_d = this.instanceOnEmitters[uid])[emitterName]) !== null && _b !== void 0 ? _b : (_d[emitterName] = {});
128320
+ }
128321
+ }
128322
+ removeOnManual(emitterName, emitterId, onId) {
128323
+ if (Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, emitterId) &&
128324
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[emitterId], emitterName) &&
128325
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[emitterId][emitterName], onId)) {
128326
+ delete this.instanceOnEmitters[emitterId][emitterName][onId];
128327
+ }
128328
+ }
128329
+ on(uid, emitterName, callback) {
128330
+ if (emitterName === 'init' &&
128331
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, uid) &&
128332
+ Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[uid], emitterName) &&
128333
+ Object.prototype.hasOwnProperty.call(Stratus.Instances, uid)) {
128334
+ callback(Stratus.Instances[uid]);
128335
+ return;
128336
+ }
128337
+ if (!Object.prototype.hasOwnProperty.call(this.instanceOnEmitters, uid)) {
128338
+ this.instanceOnEmitters[uid] = {};
128339
+ }
128340
+ if (!Object.prototype.hasOwnProperty.call(this.instanceOnEmitters[uid], emitterName)) {
128341
+ this.instanceOnEmitters[uid][emitterName] = {};
128342
+ }
128343
+ const onId = uniqueId$3();
128344
+ this.instanceOnEmitters[uid][emitterName][onId] = callback;
128345
+ return () => { this.removeOnManual(uid, emitterName, onId); };
128346
+ }
128647
128347
  };
128648
128348
  StripeService = __decorate$8([
128649
128349
  Injectable({
@@ -128677,7 +128377,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128677
128377
  const packageName$5 = 'stripe';
128678
128378
  const componentName$5 = 'payment-method';
128679
128379
  const localDir$3 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$5}/src/`;
128680
- let StripePaymentMethodComponent = class StripePaymentMethodComponent extends RootComponent {
128380
+ let StripePaymentMethodComponent = class StripePaymentMethodComponent extends StripeComponent {
128681
128381
  constructor(elementRef, sanitizer, Stripe, dialogRef, dialogData) {
128682
128382
  super();
128683
128383
  this.elementRef = elementRef;
@@ -128688,8 +128388,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128688
128388
  this.title = `${packageName$5}_${componentName$5}_component`;
128689
128389
  this.urlRoot = '/Api';
128690
128390
  this.paymentMethodApiPath = 'PaymentMethod';
128691
- this.styled = false;
128692
- this.initialized = false;
128693
128391
  this.cardComplete = false;
128694
128392
  this.cardSaved = false;
128695
128393
  this.formPending = false;
@@ -128709,7 +128407,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128709
128407
  console.error('CSS Failed to load for Component:', this);
128710
128408
  this.styled = false;
128711
128409
  });
128712
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "_", "urlRoot", "paymentMethodApiPath", "styled", "initialized", "cardComplete", "cardSaved", "formPending", "clientSecret", "publishKey", "formMessage", "detailedBillingInfo", "defaultBillingInfo", "billingInfo", "cardId", "elementRef", "sanitizer", "Stripe", "dialogRef", "dialogData", "ngOnInit", "isEditable", "isBillingDetailsFilled", "isSubmittable", "saveCard", "dialogClose", "ngOnDestroy", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh"]);
128410
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "_", "urlRoot", "paymentMethodApiPath", "cardComplete", "cardSaved", "formPending", "clientSecret", "publishKey", "formMessage", "detailedBillingInfo", "defaultBillingInfo", "billingInfo", "cardId", "elementRef", "sanitizer", "Stripe", "dialogRef", "dialogData", "ngOnInit", "isEditable", "isBillingDetailsFilled", "isSubmittable", "saveCard", "dialogClose", "ngOnDestroy", "uid", "elementId", "styled", "initialized", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh"]);
128713
128411
  if (!isEmpty(this.dialogData)) {
128714
128412
  const keysPossible = ["clientSecret", "publishKey", "formMessage", "urlRoot", "paymentMethodApiPath", "detailedBillingInfo", "defaultBillingInfo"];
128715
128413
  Object.keys(this.dialogData).forEach((attr) => {
@@ -128799,7 +128497,13 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128799
128497
  yield model.save();
128800
128498
  this.cardSaved = true;
128801
128499
  this.formPending = false;
128802
- this.Stripe.fetchCollections();
128500
+ yield this.Stripe.fetchCollections();
128501
+ const cardDetails = {
128502
+ type: 'card',
128503
+ name: this.billingInfo.name,
128504
+ email: this.billingInfo.email
128505
+ };
128506
+ this.Stripe.emitManual('paymentMethodCreated', 'Stripe', this, cardDetails);
128803
128507
  }
128804
128508
  else {
128805
128509
  this.formPending = false;
@@ -128821,10 +128525,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128821
128525
  super.ngOnDestroy();
128822
128526
  }
128823
128527
  };
128824
- __decorate$7([
128825
- Input(),
128826
- __metadata$6("design:type", String)
128827
- ], StripePaymentMethodComponent.prototype, "elementId", void 0);
128828
128528
  __decorate$7([
128829
128529
  Input(),
128830
128530
  __metadata$6("design:type", String)
@@ -128889,16 +128589,17 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128889
128589
  const packageName$4 = 'stripe';
128890
128590
  const componentName$4 = 'payment-method-item';
128891
128591
  const localDir$2 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$4}/src/`;
128892
- let StripePaymentMethodItemComponent = class StripePaymentMethodItemComponent extends RootComponent {
128893
- constructor(dialog, elementRef, sanitizer) {
128592
+ let StripePaymentMethodItemComponent = class StripePaymentMethodItemComponent extends StripeComponent {
128593
+ constructor(dialog, elementRef, sanitizer, Stripe) {
128894
128594
  super();
128895
128595
  this.dialog = dialog;
128896
128596
  this.elementRef = elementRef;
128897
128597
  this.sanitizer = sanitizer;
128598
+ this.Stripe = Stripe;
128898
128599
  this.title = `${packageName$4}_${componentName$4}_component`;
128899
128600
  this.editable = false;
128900
- this.styled = false;
128901
- this.initialized = false;
128601
+ this.templateStyle = 'default';
128602
+ this.urlRoot = '/Api';
128902
128603
  this.uid = safeUniqueId('sa', snakeCase(this.title));
128903
128604
  Stratus.Instances[this.uid] = this;
128904
128605
  this.elementId = this.elementId || this.uid;
@@ -128910,11 +128611,14 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128910
128611
  console.error('CSS Failed to load for Component:', this);
128911
128612
  this.styled = false;
128912
128613
  });
128913
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "model", "editable", "styled", "initialized", "dialog", "elementRef", "sanitizer", "ngOnInit", "getCardLogoUrl", "isExpired", "isExpiring", "deletePM", "deletePMConfirmation", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128614
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "model", "editable", "templateStyle", "urlRoot", "dialog", "elementRef", "sanitizer", "Stripe", "ngOnInit", "getCardLogoUrl", "isExpired", "isExpiring", "deletePM", "deletePMConfirmation", "uid", "elementId", "styled", "initialized", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128914
128615
  }
128915
128616
  ngOnInit() {
128916
128617
  return __awaiter$4(this, void 0, void 0, function* () {
128917
128618
  this.initialized = true;
128619
+ if (this.urlRoot) {
128620
+ this.model.urlRoot = `${this.urlRoot}${this.model.target ? '/' + this.model.target : ''}`;
128621
+ }
128918
128622
  });
128919
128623
  }
128920
128624
  getCardLogoUrl(brand) {
@@ -128972,22 +128676,12 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128972
128676
  if (!dialogResult) {
128973
128677
  return;
128974
128678
  }
128975
- let collection;
128976
- if (this.model.collection) {
128977
- collection = this.model.collection;
128978
- }
128979
128679
  yield this.model.destroy();
128980
- if (collection) {
128981
- collection.fetch();
128982
- }
128680
+ this.Stripe.fetchCollections();
128983
128681
  }));
128984
128682
  return dialog;
128985
128683
  }
128986
128684
  };
128987
- __decorate$6([
128988
- Input(),
128989
- __metadata$5("design:type", String)
128990
- ], StripePaymentMethodItemComponent.prototype, "elementId", void 0);
128991
128685
  __decorate$6([
128992
128686
  Input(),
128993
128687
  __metadata$5("design:type", Model)
@@ -128996,6 +128690,14 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
128996
128690
  Input(),
128997
128691
  __metadata$5("design:type", Object)
128998
128692
  ], StripePaymentMethodItemComponent.prototype, "editable", void 0);
128693
+ __decorate$6([
128694
+ Input(),
128695
+ __metadata$5("design:type", Object)
128696
+ ], StripePaymentMethodItemComponent.prototype, "templateStyle", void 0);
128697
+ __decorate$6([
128698
+ Input(),
128699
+ __metadata$5("design:type", Object)
128700
+ ], StripePaymentMethodItemComponent.prototype, "urlRoot", void 0);
128999
128701
  StripePaymentMethodItemComponent = __decorate$6([
129000
128702
  Component({
129001
128703
  selector: `sa-${packageName$4}-${componentName$4}`,
@@ -129003,7 +128705,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129003
128705
  }),
129004
128706
  __metadata$5("design:paramtypes", [MatDialog,
129005
128707
  ElementRef,
129006
- DomSanitizer])
128708
+ DomSanitizer,
128709
+ StripeService])
129007
128710
  ], StripePaymentMethodItemComponent);
129008
128711
 
129009
128712
  var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
@@ -129024,19 +128727,21 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129024
128727
  step((generator = generator.apply(thisArg, _arguments || [])).next());
129025
128728
  });
129026
128729
  };
128730
+ !cookie('env') ? '.min' : '';
129027
128731
  const packageName$3 = 'stripe';
129028
128732
  const componentName$3 = 'payment-method-item-display';
129029
- let StripePaymentMethodItemDisplayComponent = class StripePaymentMethodItemDisplayComponent extends RootComponent {
128733
+ `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$3}/src/`;
128734
+ let StripePaymentMethodItemDisplayComponent = class StripePaymentMethodItemDisplayComponent extends StripeComponent {
129030
128735
  constructor(elementRef, sanitizer) {
129031
128736
  super();
129032
128737
  this.elementRef = elementRef;
129033
128738
  this.sanitizer = sanitizer;
129034
128739
  this.title = `${packageName$3}_${componentName$3}_component`;
129035
- this.initialized = false;
128740
+ this.templateStyle = 'default';
129036
128741
  this.uid = safeUniqueId('sa', snakeCase(this.title));
129037
128742
  Stratus.Instances[this.uid] = this;
129038
128743
  this.elementId = this.elementId || this.uid;
129039
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "initialized", "elementId", "model", "name", "brand", "last4", "expMonth", "expYear", "elementRef", "sanitizer", "ngOnInit", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128744
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "model", "name", "brand", "last4", "expMonth", "expYear", "templateStyle", "elementRef", "sanitizer", "ngOnInit", "uid", "elementId", "styled", "initialized", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129040
128745
  }
129041
128746
  ngOnInit() {
129042
128747
  return __awaiter$3(this, void 0, void 0, function* () {
@@ -129077,10 +128782,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129077
128782
  });
129078
128783
  }
129079
128784
  };
129080
- __decorate$5([
129081
- Input(),
129082
- __metadata$4("design:type", String)
129083
- ], StripePaymentMethodItemDisplayComponent.prototype, "elementId", void 0);
129084
128785
  __decorate$5([
129085
128786
  Input(),
129086
128787
  __metadata$4("design:type", String)
@@ -129101,10 +128802,14 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129101
128802
  Input(),
129102
128803
  __metadata$4("design:type", Number)
129103
128804
  ], StripePaymentMethodItemDisplayComponent.prototype, "expYear", void 0);
128805
+ __decorate$5([
128806
+ Input(),
128807
+ __metadata$4("design:type", Object)
128808
+ ], StripePaymentMethodItemDisplayComponent.prototype, "templateStyle", void 0);
129104
128809
  StripePaymentMethodItemDisplayComponent = __decorate$5([
129105
128810
  Component({
129106
128811
  selector: `sa-${packageName$3}-${componentName$3}`,
129107
- template: '<sa-stripe-payment-method-item *ngIf="initialized" [(model)]="model" [editable]="false"></sa-stripe-payment-method-item>',
128812
+ template: '<sa-stripe-payment-method-item *ngIf="initialized" [(model)]="model" [editable]="false" [templateStyle]="templateStyle"></sa-stripe-payment-method-item>',
129108
128813
  }),
129109
128814
  __metadata$4("design:paramtypes", [ElementRef,
129110
128815
  DomSanitizer])
@@ -129132,7 +128837,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129132
128837
  const packageName$2 = 'stripe';
129133
128838
  const componentName$2 = 'payment-method-list';
129134
128839
  const localDir$1 = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$2}/src/`;
129135
- let StripePaymentMethodListComponent = class StripePaymentMethodListComponent extends RootComponent {
128840
+ let StripePaymentMethodListComponent = class StripePaymentMethodListComponent extends StripeListComponent {
129136
128841
  constructor(elementRef, ref, sanitizer, Stripe) {
129137
128842
  super();
129138
128843
  this.elementRef = elementRef;
@@ -129140,8 +128845,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129140
128845
  this.sanitizer = sanitizer;
129141
128846
  this.Stripe = Stripe;
129142
128847
  this.title = `${packageName$2}_${componentName$2}_component`;
129143
- this.styled = false;
129144
- this.initialized = false;
129145
128848
  this.urlRoot = '/Api';
129146
128849
  this.paymentMethodApiPath = 'PaymentMethod';
129147
128850
  this.addCardButtonText = 'Add Payment Method';
@@ -129158,7 +128861,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129158
128861
  console.error('CSS Failed to load for Component:', this);
129159
128862
  this.styled = false;
129160
128863
  });
129161
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "styled", "initialized", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "paymentCollection", "elementRef", "ref", "sanitizer", "Stripe", "ngOnInit", "fetchPaymentMethods", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
128864
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "elementRef", "ref", "sanitizer", "Stripe", "ngOnInit", "collection", "uid", "elementId", "styled", "initialized", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129162
128865
  const apiOptions = {
129163
128866
  autoSave: false,
129164
128867
  target: this.paymentMethodApiPath,
@@ -129167,7 +128870,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129167
128870
  if (this.urlRoot) {
129168
128871
  apiOptions.urlRoot = this.urlRoot;
129169
128872
  }
129170
- this.paymentCollection = new Collection(apiOptions);
128873
+ this.collection = new Collection(apiOptions);
129171
128874
  if (this.defaultBillingName) {
129172
128875
  this.defaultBillingInfo.name = this.defaultBillingName;
129173
128876
  }
@@ -129195,22 +128898,16 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129195
128898
  }
129196
128899
  ngOnInit() {
129197
128900
  return __awaiter$2(this, void 0, void 0, function* () {
129198
- yield this.fetchPaymentMethods();
129199
- this.Stripe.registerCollection(this.paymentCollection);
128901
+ this.Stripe.registerCollection(this, this.collection);
128902
+ this.Stripe.fetchCollections(this.uid).then();
129200
128903
  this.initialized = true;
129201
- });
129202
- }
129203
- fetchPaymentMethods() {
129204
- return __awaiter$2(this, void 0, void 0, function* () {
129205
- yield this.paymentCollection.fetch();
129206
- yield this.refresh();
128904
+ this.Stripe.emit('init', this);
128905
+ this.Stripe.on(this.uid, 'collectionUpdated', (_source, _collection) => {
128906
+ this.refresh();
128907
+ });
129207
128908
  });
129208
128909
  }
129209
128910
  };
129210
- __decorate$4([
129211
- Input(),
129212
- __metadata$3("design:type", String)
129213
- ], StripePaymentMethodListComponent.prototype, "elementId", void 0);
129214
128911
  __decorate$4([
129215
128912
  Input(),
129216
128913
  __metadata$3("design:type", String)
@@ -129300,7 +128997,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129300
128997
  const packageName$1 = 'stripe';
129301
128998
  const componentName$1 = 'payment-method-selector';
129302
128999
  const localDir = `${Stratus.BaseUrl}${Stratus.DeploymentPath}@stratusjs/${packageName$1}/src/`;
129303
- let StripePaymentMethodSelectorComponent = class StripePaymentMethodSelectorComponent extends RootComponent {
129000
+ let StripePaymentMethodSelectorComponent = class StripePaymentMethodSelectorComponent extends StripeListComponent {
129304
129001
  constructor(elementRef, fb, ref, sanitizer, Stripe) {
129305
129002
  super();
129306
129003
  this.elementRef = elementRef;
@@ -129309,11 +129006,11 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129309
129006
  this.sanitizer = sanitizer;
129310
129007
  this.Stripe = Stripe;
129311
129008
  this.title = `${packageName$1}_${componentName$1}_component`;
129312
- this.styled = false;
129313
- this.initialized = false;
129314
129009
  this.urlRoot = '/Api';
129315
129010
  this.paymentMethodApiPath = 'PaymentMethod';
129316
129011
  this.addCardButtonText = 'Add Payment Method';
129012
+ this.selectCardButtonText = 'Select Default Payment Method';
129013
+ this.selectedTemplateStyle = 'default';
129317
129014
  this.disabled = false;
129318
129015
  this.defaultBillingInfo = { address: {} };
129319
129016
  this.fieldName = 'paymentSelection';
@@ -129336,7 +129033,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129336
129033
  this.styled = false;
129337
129034
  this.refresh().then();
129338
129035
  });
129339
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "styled", "initialized", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "registryModel", "paymentMethodApiPath", "addCardButtonText", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "fieldName", "fieldNameId", "registry", "fetched", "model", "dataSub", "subscriber", "form", "paymentCollection", "elementRef", "fb", "ref", "sanitizer", "Stripe", "ngOnInit", "fetchPaymentMethods", "valueChanged", "normalizeOut", "normalizeIn", "fetchData", "objectComparisonFunction", "dataDefer", "dataRef", "handleObservableError", "isPMExpired", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129036
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "target", "targetSuffix", "id", "manifest", "decouple", "direct", "api", "urlRoot", "registryModel", "paymentMethodApiPath", "addCardButtonText", "selectCardButtonText", "selectedTemplateStyle", "disabled", "property", "detailedBillingInfo", "defaultBillingName", "defaultBillingEmail", "defaultBillingPhone", "defaultBillingZip", "defaultBillingState", "defaultBillingCity", "defaultBillingAddress1", "defaultBillingAddress2", "defaultBillingInfo", "fieldName", "fieldNameId", "registry", "fetched", "model", "dataSub", "subscriber", "form", "paymentSelect", "elementRef", "fb", "ref", "sanitizer", "Stripe", "ngOnInit", "valueChanged", "normalizeOut", "normalizeIn", "fetchData", "objectComparisonFunction", "dataDefer", "dataRef", "handleObservableError", "isPMExpired", "selectorListClose", "selectorListOpen", "collection", "uid", "elementId", "styled", "initialized", "hydrate", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129340
129037
  const apiOptions = {
129341
129038
  autoSave: false,
129342
129039
  target: this.paymentMethodApiPath,
@@ -129345,7 +129042,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129345
129042
  if (this.urlRoot) {
129346
129043
  apiOptions.urlRoot = this.urlRoot;
129347
129044
  }
129348
- this.paymentCollection = new Collection(apiOptions);
129045
+ this.collection = new Collection(apiOptions);
129349
129046
  if (this.defaultBillingName) {
129350
129047
  this.defaultBillingInfo.name = this.defaultBillingName;
129351
129048
  }
@@ -129411,16 +129108,28 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129411
129108
  return;
129412
129109
  }
129413
129110
  this.valueChanged(value);
129414
- });
129415
- yield this.fetchPaymentMethods();
129416
- this.Stripe.registerCollection(this.paymentCollection);
129111
+ }).then();
129112
+ this.Stripe.registerCollection(this, this.collection);
129113
+ this.Stripe.fetchCollections(this.uid).then();
129417
129114
  this.initialized = true;
129418
- });
129419
- }
129420
- fetchPaymentMethods() {
129421
- return __awaiter$1(this, void 0, void 0, function* () {
129422
- yield this.paymentCollection.fetch();
129423
- yield this.refresh();
129115
+ this.Stripe.emit('init', this);
129116
+ this.Stripe.on(this.uid, 'collectionUpdated', (_source, _collection) => {
129117
+ this.refresh();
129118
+ this.selectorListClose();
129119
+ });
129120
+ this.Stripe.on('Stripe', 'paymentMethodCreated', (_source, details) => {
129121
+ const newCardDetails = details[0];
129122
+ if (!isEmpty(newCardDetails.type) &&
129123
+ !isEmpty(newCardDetails.name) &&
129124
+ !isEmpty(newCardDetails.email)) {
129125
+ const newPM = this.collection.models.slice(-1)[0];
129126
+ if (newPM.get('type') === newCardDetails.type &&
129127
+ newPM.get('name') === newCardDetails.name &&
129128
+ newPM.get('email') === newCardDetails.email) {
129129
+ this.valueChanged(newPM);
129130
+ }
129131
+ }
129132
+ });
129424
129133
  });
129425
129134
  }
129426
129135
  valueChanged(value) {
@@ -129496,11 +129205,23 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129496
129205
  }
129497
129206
  return paymentMethod.data.exp_month < month;
129498
129207
  }
129208
+ selectorListClose(ev) {
129209
+ if (ev) {
129210
+ ev.preventDefault();
129211
+ }
129212
+ if (this.paymentSelect && this.paymentSelect.panelOpen) {
129213
+ this.paymentSelect.close();
129214
+ }
129215
+ }
129216
+ selectorListOpen(ev) {
129217
+ if (ev) {
129218
+ ev.preventDefault();
129219
+ }
129220
+ if (this.paymentSelect && !this.paymentSelect.panelOpen) {
129221
+ this.paymentSelect.open();
129222
+ }
129223
+ }
129499
129224
  };
129500
- __decorate$3([
129501
- Input(),
129502
- __metadata$2("design:type", String)
129503
- ], StripePaymentMethodSelectorComponent.prototype, "elementId", void 0);
129504
129225
  __decorate$3([
129505
129226
  Input(),
129506
129227
  __metadata$2("design:type", String)
@@ -129545,6 +129266,14 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129545
129266
  Input(),
129546
129267
  __metadata$2("design:type", String)
129547
129268
  ], StripePaymentMethodSelectorComponent.prototype, "addCardButtonText", void 0);
129269
+ __decorate$3([
129270
+ Input(),
129271
+ __metadata$2("design:type", String)
129272
+ ], StripePaymentMethodSelectorComponent.prototype, "selectCardButtonText", void 0);
129273
+ __decorate$3([
129274
+ Input(),
129275
+ __metadata$2("design:type", Object)
129276
+ ], StripePaymentMethodSelectorComponent.prototype, "selectedTemplateStyle", void 0);
129548
129277
  __decorate$3([
129549
129278
  Input(),
129550
129279
  __metadata$2("design:type", Object)
@@ -129589,6 +129318,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129589
129318
  Input(),
129590
129319
  __metadata$2("design:type", String)
129591
129320
  ], StripePaymentMethodSelectorComponent.prototype, "defaultBillingAddress2", void 0);
129321
+ __decorate$3([
129322
+ ViewChild('paymentSelect', { static: false }),
129323
+ __metadata$2("design:type", MatSelect)
129324
+ ], StripePaymentMethodSelectorComponent.prototype, "paymentSelect", void 0);
129592
129325
  StripePaymentMethodSelectorComponent = __decorate$3([
129593
129326
  Component({
129594
129327
  selector: `sa-${packageName$1}-${componentName$1}`,
@@ -129622,7 +129355,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129622
129355
  };
129623
129356
  const packageName = 'stripe';
129624
129357
  const componentName = 'setup-intent';
129625
- let StripeSetupIntentComponent = class StripeSetupIntentComponent extends RootComponent {
129358
+ let StripeSetupIntentComponent = class StripeSetupIntentComponent extends StripeComponent {
129626
129359
  constructor(elementRef, sanitizer, dialog) {
129627
129360
  super();
129628
129361
  this.elementRef = elementRef;
@@ -129639,7 +129372,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129639
129372
  this.uid = safeUniqueId('sa', snakeCase(this.title));
129640
129373
  Stratus.Instances[this.uid] = this;
129641
129374
  this.elementId = this.elementId || this.uid;
129642
- this.hydrate(this.elementRef, this.sanitizer, ["title", "uid", "elementId", "styled", "initialized", "newPaymentMethodPrompt", "newPaymentMethodPending", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "detailedBillingInfo", "defaultBillingInfo", "elementRef", "sanitizer", "dialog", "ngOnInit", "addPaymentMethod", "inputPaymentMethod", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129375
+ this.hydrate(this.elementRef, this.sanitizer, ["title", "styled", "initialized", "newPaymentMethodPrompt", "newPaymentMethodPending", "urlRoot", "paymentMethodApiPath", "addCardButtonText", "detailedBillingInfo", "defaultBillingInfo", "elementRef", "sanitizer", "dialog", "ngOnInit", "addPaymentMethod", "inputPaymentMethod", "uid", "elementId", "hydrate", "ref", "disableRefresh", "stagger", "reloading", "refresh", "ngOnDestroy"]);
129643
129376
  }
129644
129377
  ngOnInit() {
129645
129378
  this.initialized = true;
@@ -129712,10 +129445,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
129712
129445
  });
129713
129446
  }
129714
129447
  };
129715
- __decorate$2([
129716
- Input(),
129717
- __metadata$1("design:type", String)
129718
- ], StripeSetupIntentComponent.prototype, "elementId", void 0);
129719
129448
  __decorate$2([
129720
129449
  Input(),
129721
129450
  __metadata$1("design:type", String)
@@ -161376,6 +161105,1228 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
161376
161105
  })
161377
161106
  .catch(err => console.error('@stratusjs/angular failed to initialize!', err));
161378
161107
 
161108
+ System.register(["quill", "@stratusjs/core/environment"], function (exports_1, context_1) {
161109
+ var quill_1, environment_1, Break, Embed, QuillBreak;
161110
+ context_1 && context_1.id;
161111
+ return {
161112
+ setters: [
161113
+ function (quill_1_1) {
161114
+ quill_1 = quill_1_1;
161115
+ },
161116
+ function (environment_1_1) {
161117
+ environment_1 = environment_1_1;
161118
+ }
161119
+ ],
161120
+ execute: function () {
161121
+ Break = quill_1.default.import('blots/break');
161122
+ Embed = quill_1.default.import('blots/embed');
161123
+ QuillBreak = class QuillBreak extends Break {
161124
+ length() {
161125
+ return 1;
161126
+ }
161127
+ value() {
161128
+ return '\n';
161129
+ }
161130
+ insertInto(parent, ref) {
161131
+ if (environment_1.cookie('env')) {
161132
+ console.log('insertInto:', parent, ref);
161133
+ }
161134
+ Embed.prototype.insertInto.call(this, parent, ref);
161135
+ }
161136
+ };
161137
+ exports_1("QuillBreak", QuillBreak);
161138
+ QuillBreak.blotName = 'break';
161139
+ QuillBreak.tagName = 'BR';
161140
+ }
161141
+ };
161142
+ });
161143
+
161144
+ System.register(["quill"], function (exports_1, context_1) {
161145
+ var quill_1, debug, Logger, QuillHtmlEditPlugin;
161146
+ context_1 && context_1.id;
161147
+ function $create(elName) {
161148
+ return document.createElement(elName);
161149
+ }
161150
+ function $setAttr(el, key, value) {
161151
+ return el.setAttribute(key, value);
161152
+ }
161153
+ function launchPopupEditor(quill, options) {
161154
+ const htmlFromEditor = quill.container.querySelector('.ql-editor').innerHTML;
161155
+ const popupContainer = $create('div');
161156
+ const overlayContainer = $create('div');
161157
+ const msg = options.msg || 'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced';
161158
+ const cancelText = options.cancelText || 'Cancel';
161159
+ const okText = options.okText || 'Ok';
161160
+ $setAttr(overlayContainer, 'class', 'ql-html-overlayContainer');
161161
+ $setAttr(popupContainer, 'class', 'ql-html-popupContainer');
161162
+ const popupTitle = $create('i');
161163
+ $setAttr(popupTitle, 'class', 'ql-html-popupTitle');
161164
+ popupTitle.innerText = msg;
161165
+ const textContainer = $create('div');
161166
+ textContainer.appendChild(popupTitle);
161167
+ $setAttr(textContainer, 'class', 'ql-html-textContainer');
161168
+ const textArea = $create('textarea');
161169
+ $setAttr(textArea, 'class', 'ql-html-textArea');
161170
+ textArea.value = formatHTML(htmlFromEditor);
161171
+ const buttonCancel = $create('button');
161172
+ buttonCancel.innerHTML = cancelText;
161173
+ $setAttr(buttonCancel, 'class', 'ql-html-buttonCancel');
161174
+ const buttonOk = $create('button');
161175
+ buttonOk.innerHTML = okText;
161176
+ const buttonGroup = $create('div');
161177
+ $setAttr(buttonGroup, 'class', 'ql-html-buttonGroup');
161178
+ buttonGroup.appendChild(buttonCancel);
161179
+ buttonGroup.appendChild(buttonOk);
161180
+ textContainer.appendChild(textArea);
161181
+ textContainer.appendChild(buttonGroup);
161182
+ popupContainer.appendChild(textContainer);
161183
+ overlayContainer.appendChild(popupContainer);
161184
+ document.body.appendChild(overlayContainer);
161185
+ buttonCancel.onclick = () => {
161186
+ document.body.removeChild(overlayContainer);
161187
+ };
161188
+ overlayContainer.onclick = buttonCancel.onclick;
161189
+ popupContainer.onclick = (e) => {
161190
+ e.preventDefault();
161191
+ e.stopPropagation();
161192
+ };
161193
+ buttonOk.onclick = () => {
161194
+ const output = textArea.value.split(/\r?\n/g).map((el) => el.trim());
161195
+ const noNewlines = output.join('');
161196
+ quill.container.querySelector('.ql-editor').innerHTML = noNewlines;
161197
+ document.body.removeChild(overlayContainer);
161198
+ };
161199
+ }
161200
+ function formatHTML(code) {
161201
+ const whitespace = ' '.repeat(2);
161202
+ let currentIndent = 0;
161203
+ const newlineChar = '\n';
161204
+ let char = null;
161205
+ let nextChar = null;
161206
+ let result = '';
161207
+ for (let pos = 0; pos <= code.length; pos++) {
161208
+ char = code.substr(pos, 1);
161209
+ nextChar = code.substr(pos + 1, 1);
161210
+ const isBrTag = code.substr(pos, 4) === '<br>';
161211
+ const isOpeningTag = char === '<' && nextChar !== '/' && !isBrTag;
161212
+ const isClosingTag = char === '<' && nextChar === '/' && !isBrTag;
161213
+ if (isBrTag) {
161214
+ result += newlineChar;
161215
+ currentIndent--;
161216
+ pos += 4;
161217
+ }
161218
+ if (isOpeningTag) {
161219
+ result += newlineChar + whitespace.repeat(currentIndent);
161220
+ currentIndent++;
161221
+ }
161222
+ else if (isClosingTag) {
161223
+ if (--currentIndent < 0) {
161224
+ currentIndent = 0;
161225
+ }
161226
+ result += newlineChar + whitespace.repeat(currentIndent);
161227
+ }
161228
+ else if (char === ' ' && nextChar === ' ') {
161229
+ char = '';
161230
+ }
161231
+ else if (char === newlineChar) {
161232
+ if (code.substr(pos, code.substr(pos).indexOf('<')).trim() === '') {
161233
+ char = '';
161234
+ }
161235
+ }
161236
+ result += char;
161237
+ }
161238
+ Logger.log('formatHTML', {
161239
+ before: code,
161240
+ after: result
161241
+ });
161242
+ return result;
161243
+ }
161244
+ return {
161245
+ setters: [
161246
+ function (quill_1_1) {
161247
+ quill_1 = quill_1_1;
161248
+ }
161249
+ ],
161250
+ execute: function () {
161251
+ debug = false;
161252
+ Logger = {
161253
+ prefixString() {
161254
+ return `</> quill-html-edit-button: `;
161255
+ },
161256
+ get log() {
161257
+ if (!debug) {
161258
+ return () => { };
161259
+ }
161260
+ const boundLogFn = console.log.bind(console, this.prefixString());
161261
+ return boundLogFn;
161262
+ }
161263
+ };
161264
+ QuillHtmlEditPlugin = class QuillHtmlEditPlugin {
161265
+ constructor(quill, options) {
161266
+ debug = options && options.debug;
161267
+ Logger.log('logging enabled');
161268
+ const toolbarModule = quill.getModule('toolbar');
161269
+ if (!toolbarModule) {
161270
+ throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');
161271
+ }
161272
+ this.registerDivModule();
161273
+ const toolbarEl = toolbarModule.container;
161274
+ const buttonContainer = $create('span');
161275
+ $setAttr(buttonContainer, 'class', 'ql-formats');
161276
+ const button = $create('button');
161277
+ button.innerHTML = options.buttonHTML || '&lt;&gt;';
161278
+ button.title = options.buttonTitle || 'Show HTML source';
161279
+ button.onclick = (e) => {
161280
+ e.preventDefault();
161281
+ launchPopupEditor(quill, options);
161282
+ };
161283
+ buttonContainer.appendChild(button);
161284
+ toolbarEl.appendChild(buttonContainer);
161285
+ }
161286
+ registerDivModule() {
161287
+ const Block = quill_1.default.import('blots/block');
161288
+ class Div extends Block {
161289
+ }
161290
+ Div.tagName = 'div';
161291
+ Div.blotName = 'div';
161292
+ Div.allowedChildren = Block.allowedChildren;
161293
+ Div.allowedChildren.push(Block);
161294
+ quill_1.default.register(Div);
161295
+ }
161296
+ };
161297
+ exports_1("QuillHtmlEditPlugin", QuillHtmlEditPlugin);
161298
+ exports_1("default", QuillHtmlEditPlugin);
161299
+ }
161300
+ };
161301
+ });
161302
+
161303
+ System.register(["quill"], function (exports_1, context_1) {
161304
+ var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
161305
+ context_1 && context_1.id;
161306
+ return {
161307
+ setters: [
161308
+ function (quill_1_1) {
161309
+ quill_1 = quill_1_1;
161310
+ }
161311
+ ],
161312
+ execute: function () {
161313
+ BaseImage = quill_1.default.import('formats/image');
161314
+ ATTRIBUTES = [
161315
+ 'alt',
161316
+ 'height',
161317
+ 'width',
161318
+ 'stratus-src',
161319
+ 'stratusSrc'
161320
+ ];
161321
+ QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
161322
+ constructor() {
161323
+ super(...arguments);
161324
+ this.blotName = 'imageCustom';
161325
+ this.tagName = 'IMG';
161326
+ }
161327
+ format(name, value) {
161328
+ console.log('format:', name, value, this.domNode.getAttribute('src'));
161329
+ if (ATTRIBUTES.indexOf(name) === -1) {
161330
+ super.format(name, value);
161331
+ return;
161332
+ }
161333
+ if (!value) {
161334
+ this.domNode.removeAttribute(name);
161335
+ return;
161336
+ }
161337
+ if (name === 'stratus-src') {
161338
+ console.log('stratus-src:', value);
161339
+ }
161340
+ if (name === 'stratusSrc') {
161341
+ console.log('stratusSrc:', value);
161342
+ }
161343
+ this.domNode.setAttribute(name, value);
161344
+ }
161345
+ };
161346
+ exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
161347
+ }
161348
+ };
161349
+ });
161350
+
161351
+ System.register(["@stratusjs/runtime/stratus", "lodash", "quill"], function (exports_1, context_1) {
161352
+ var stratus_1, lodash_1, quill_1, QuillInputButtonPlugin;
161353
+ context_1 && context_1.id;
161354
+ return {
161355
+ setters: [
161356
+ function (stratus_1_1) {
161357
+ stratus_1 = stratus_1_1;
161358
+ },
161359
+ function (lodash_1_1) {
161360
+ lodash_1 = lodash_1_1;
161361
+ },
161362
+ function (quill_1_1) {
161363
+ quill_1 = quill_1_1;
161364
+ }
161365
+ ],
161366
+ execute: function () {
161367
+ QuillInputButtonPlugin = class QuillInputButtonPlugin {
161368
+ constructor(quill, options) {
161369
+ this.debug = false;
161370
+ this.buttonHTML = '<i class="fas fa-carrot"></i>';
161371
+ this.buttonTitle = 'Input Button';
161372
+ this.name = 'inputButton';
161373
+ this.eventName = 'input-button';
161374
+ this.uid = lodash_1.default.uniqueId(`quill_input_button_`);
161375
+ stratus_1.Stratus.Instances[this.uid] = this;
161376
+ this.debug = options && options.debug;
161377
+ if (!options || typeof options !== 'object') {
161378
+ options = {};
161379
+ }
161380
+ this.buttonHTML = options.buttonHTML || this.buttonHTML;
161381
+ this.buttonTitle = options.buttonTitle || this.buttonTitle;
161382
+ this.name = options.name || this.name;
161383
+ this.eventName = options.eventName || this.eventName;
161384
+ this.createToolbarModule(quill);
161385
+ }
161386
+ createToolbarModule(quill) {
161387
+ const toolbarModule = quill.getModule('toolbar');
161388
+ if (!toolbarModule) {
161389
+ throw new Error(`quill.${this.name} requires the "toolbar" module`);
161390
+ }
161391
+ this.registerDivModule();
161392
+ const toolbarEl = toolbarModule.container;
161393
+ const buttonContainer = document.createElement('span');
161394
+ buttonContainer.setAttribute('class', 'ql-formats');
161395
+ const button = document.createElement('button');
161396
+ button.innerHTML = this.buttonHTML;
161397
+ button.title = this.buttonTitle;
161398
+ button.onclick = (e) => {
161399
+ e.preventDefault();
161400
+ this.onClick(quill);
161401
+ };
161402
+ buttonContainer.appendChild(button);
161403
+ toolbarEl.appendChild(buttonContainer);
161404
+ }
161405
+ registerDivModule() {
161406
+ const Block = quill_1.default.import('blots/block');
161407
+ class Div extends Block {
161408
+ }
161409
+ Div.tagName = 'div';
161410
+ Div.blotName = 'div';
161411
+ Div.allowedChildren = Block.allowedChildren;
161412
+ Div.allowedChildren.push(Block);
161413
+ quill_1.default.register(Div);
161414
+ }
161415
+ findUID(el) {
161416
+ if ('uid' in el.dataset) {
161417
+ return el.dataset.uid;
161418
+ }
161419
+ return this.findUID(el.parentElement);
161420
+ }
161421
+ getInstance(uid) {
161422
+ if (!(uid in stratus_1.Stratus.Instances)) {
161423
+ return undefined;
161424
+ }
161425
+ return stratus_1.Stratus.Instances[uid];
161426
+ }
161427
+ onClick(quill) {
161428
+ const container = quill.container;
161429
+ const uid = this.findUID(container);
161430
+ const instance = this.getInstance(uid);
161431
+ if (!instance) {
161432
+ return;
161433
+ }
161434
+ instance.trigger(this.eventName, null, this);
161435
+ }
161436
+ trigger(name, data, callee) {
161437
+ if (this.debug) {
161438
+ console.log(`quill.${this.name}.trigger:`, name, data, callee);
161439
+ }
161440
+ }
161441
+ };
161442
+ exports_1("QuillInputButtonPlugin", QuillInputButtonPlugin);
161443
+ }
161444
+ };
161445
+ });
161446
+
161447
+ System.register(["reflect-metadata", "lodash", "@angular/core"], function (exports_1, context_1) {
161448
+ var lodash_1, core_1, RootComponent;
161449
+ context_1 && context_1.id;
161450
+ return {
161451
+ setters: [
161452
+ function (_1) {
161453
+ },
161454
+ function (lodash_1_1) {
161455
+ lodash_1 = lodash_1_1;
161456
+ },
161457
+ function (core_1_1) {
161458
+ core_1 = core_1_1;
161459
+ }
161460
+ ],
161461
+ execute: function () {
161462
+ RootComponent = class RootComponent {
161463
+ hydrate(elementRef, sanitizer, attrs) {
161464
+ lodash_1.default.forEach(attrs, (attr) => {
161465
+ const metaDataKeys = Reflect.getMetadataKeys(this, attr);
161466
+ if (!lodash_1.default.includes(metaDataKeys, 'design:type')) {
161467
+ return;
161468
+ }
161469
+ const attrKebab = lodash_1.default.kebabCase(attr);
161470
+ const variants = [
161471
+ attrKebab,
161472
+ 'data-' + attrKebab
161473
+ ];
161474
+ const variant = lodash_1.default.find(variants, (v) => elementRef.nativeElement.hasAttribute(v));
161475
+ if (lodash_1.default.isEmpty(variant)) {
161476
+ return;
161477
+ }
161478
+ const value = sanitizer.sanitize(core_1.SecurityContext.HTML, elementRef.nativeElement.getAttribute(variant));
161479
+ lodash_1.default.set(this, attr, value);
161480
+ });
161481
+ }
161482
+ };
161483
+ exports_1("RootComponent", RootComponent);
161484
+ }
161485
+ };
161486
+ });
161487
+
161488
+ System.register(["@angular/forms", "@angular/core", "froala-editor"], function (exports_1, context_1) {
161489
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161490
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161491
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161492
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161493
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161494
+ };
161495
+ var __metadata = (this && this.__metadata) || function (k, v) {
161496
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
161497
+ };
161498
+ var FroalaEditorDirective_1, forms_1, core_1, froala_editor_1, FroalaEditorDirective;
161499
+ context_1 && context_1.id;
161500
+ return {
161501
+ setters: [
161502
+ function (forms_1_1) {
161503
+ forms_1 = forms_1_1;
161504
+ },
161505
+ function (core_1_1) {
161506
+ core_1 = core_1_1;
161507
+ },
161508
+ function (froala_editor_1_1) {
161509
+ froala_editor_1 = froala_editor_1_1;
161510
+ }
161511
+ ],
161512
+ execute: function () {
161513
+ FroalaEditorDirective = FroalaEditorDirective_1 = class FroalaEditorDirective {
161514
+ constructor(el, zone) {
161515
+ this.zone = zone;
161516
+ this._opts = {
161517
+ immediateAngularModelUpdate: false,
161518
+ angularIgnoreAttrs: null
161519
+ };
161520
+ this.SPECIAL_TAGS = ['img', 'button', 'input', 'a'];
161521
+ this.INNER_HTML_ATTR = 'innerHTML';
161522
+ this._hasSpecialTag = false;
161523
+ this._editorInitialized = false;
161524
+ this._oldModel = null;
161525
+ this.froalaModelChange = new core_1.EventEmitter();
161526
+ this.froalaInit = new core_1.EventEmitter();
161527
+ this.onChange = (_) => {
161528
+ };
161529
+ this.onTouched = () => {
161530
+ };
161531
+ const element = el.nativeElement;
161532
+ if (this.SPECIAL_TAGS.indexOf(element.tagName.toLowerCase()) != -1) {
161533
+ this._hasSpecialTag = true;
161534
+ }
161535
+ this._element = element;
161536
+ this.zone = zone;
161537
+ }
161538
+ set froalaEditor(opts) {
161539
+ this._opts = this.clone(opts || this._opts);
161540
+ this._opts = Object.assign({}, this._opts);
161541
+ }
161542
+ set froalaModel(content) {
161543
+ this.updateEditor(content);
161544
+ }
161545
+ writeValue(content) {
161546
+ this.updateEditor(content);
161547
+ }
161548
+ registerOnChange(fn) {
161549
+ this.onChange = fn;
161550
+ }
161551
+ registerOnTouched(fn) {
161552
+ this.onTouched = fn;
161553
+ }
161554
+ clone(item) {
161555
+ const me = this;
161556
+ if (!item) {
161557
+ return item;
161558
+ }
161559
+ const types = [Number, String, Boolean];
161560
+ let result;
161561
+ types.forEach((type) => {
161562
+ if (item instanceof type) {
161563
+ result = type(item);
161564
+ }
161565
+ });
161566
+ if (typeof result === 'undefined') {
161567
+ if (Object.prototype.toString.call(item) === '[object Array]') {
161568
+ result = [];
161569
+ item.forEach((child, index, array) => {
161570
+ result[index] = me.clone(child);
161571
+ });
161572
+ }
161573
+ else if (typeof item === 'object') {
161574
+ if (item.nodeType && typeof item.cloneNode === 'function') {
161575
+ result = item.cloneNode(true);
161576
+ }
161577
+ else if (!item.prototype) {
161578
+ if (item instanceof Date) {
161579
+ result = new Date(item);
161580
+ }
161581
+ else {
161582
+ result = {};
161583
+ for (const i in item) {
161584
+ result[i] = me.clone(item[i]);
161585
+ }
161586
+ }
161587
+ }
161588
+ else {
161589
+ {
161590
+ result = item;
161591
+ }
161592
+ }
161593
+ }
161594
+ else {
161595
+ result = item;
161596
+ }
161597
+ }
161598
+ return result;
161599
+ }
161600
+ updateEditor(content) {
161601
+ if (JSON.stringify(this._oldModel) === JSON.stringify(content)) {
161602
+ return;
161603
+ }
161604
+ if (!this._hasSpecialTag) {
161605
+ this._oldModel = content;
161606
+ }
161607
+ else {
161608
+ this._model = content;
161609
+ }
161610
+ if (this._editorInitialized) {
161611
+ if (!this._hasSpecialTag) {
161612
+ this._editor.html.set(content);
161613
+ }
161614
+ else {
161615
+ this.setContent();
161616
+ }
161617
+ }
161618
+ else {
161619
+ if (!this._hasSpecialTag) {
161620
+ this._element.innerHTML = content || '';
161621
+ }
161622
+ else {
161623
+ this.setContent();
161624
+ }
161625
+ }
161626
+ }
161627
+ updateModel() {
161628
+ this.zone.run(() => {
161629
+ let modelContent = null;
161630
+ if (this._hasSpecialTag) {
161631
+ const attributeNodes = this._element.attributes;
161632
+ const attrs = {};
161633
+ for (let i = 0; i < attributeNodes.length; i++) {
161634
+ const attrName = attributeNodes[i].name;
161635
+ if (this._opts.angularIgnoreAttrs && this._opts.angularIgnoreAttrs.indexOf(attrName) != -1) {
161636
+ continue;
161637
+ }
161638
+ attrs[attrName] = attributeNodes[i].value;
161639
+ }
161640
+ if (this._element.innerHTML) {
161641
+ attrs[this.INNER_HTML_ATTR] = this._element.innerHTML;
161642
+ }
161643
+ modelContent = attrs;
161644
+ }
161645
+ else {
161646
+ const returnedHtml = this._editor.html.get();
161647
+ if (typeof returnedHtml === 'string') {
161648
+ modelContent = returnedHtml;
161649
+ }
161650
+ }
161651
+ if (this._oldModel !== modelContent) {
161652
+ this._oldModel = modelContent;
161653
+ this.froalaModelChange.emit(modelContent);
161654
+ this.onChange(modelContent);
161655
+ }
161656
+ });
161657
+ }
161658
+ registerEvent(eventName, callback) {
161659
+ if (!eventName || !callback) {
161660
+ return;
161661
+ }
161662
+ if (!this._opts.events) {
161663
+ this._opts.events = {};
161664
+ }
161665
+ this._opts.events[eventName] = callback;
161666
+ }
161667
+ initListeners() {
161668
+ const self = this;
161669
+ if (this._editor.events) {
161670
+ this._editor.events.on('contentChanged', function () {
161671
+ self.updateModel();
161672
+ });
161673
+ this._editor.events.on('mousedown', function () {
161674
+ setTimeout(function () {
161675
+ self.onTouched();
161676
+ }, 0);
161677
+ });
161678
+ if (this._opts.immediateAngularModelUpdate) {
161679
+ this._editor.events.on('keyup', function () {
161680
+ setTimeout(function () {
161681
+ self.updateModel();
161682
+ }, 0);
161683
+ });
161684
+ }
161685
+ }
161686
+ this._editorInitialized = true;
161687
+ }
161688
+ createEditor() {
161689
+ if (this._editorInitialized) {
161690
+ return;
161691
+ }
161692
+ this.setContent(true);
161693
+ this.zone.runOutsideAngular(() => {
161694
+ if (!this._opts.events) {
161695
+ this._opts.events = {};
161696
+ }
161697
+ this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
161698
+ const existingInitCallback = this._opts.events.initialized;
161699
+ if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
161700
+ this._opts.events.initialized = () => {
161701
+ this.initListeners();
161702
+ existingInitCallback && existingInitCallback.call(this._editor, this);
161703
+ };
161704
+ this._opts.events.initialized.overridden = true;
161705
+ }
161706
+ this._editor = new froala_editor_1.default(this._element, this._opts);
161707
+ });
161708
+ }
161709
+ setHtml() {
161710
+ this._editor.html.set(this._model || '');
161711
+ this._editor.undo.reset();
161712
+ this._editor.undo.saveStep();
161713
+ }
161714
+ setContent(firstTime = false) {
161715
+ const self = this;
161716
+ if (this._model || this._model === '') {
161717
+ this._oldModel = this._model;
161718
+ if (this._hasSpecialTag) {
161719
+ const tags = this._model;
161720
+ if (tags) {
161721
+ for (const attr in tags) {
161722
+ if (tags.hasOwnProperty(attr) && attr != this.INNER_HTML_ATTR) {
161723
+ this._element.setAttribute(attr, tags[attr]);
161724
+ }
161725
+ }
161726
+ if (tags.hasOwnProperty(this.INNER_HTML_ATTR)) {
161727
+ this._element.innerHTML = tags[this.INNER_HTML_ATTR];
161728
+ }
161729
+ }
161730
+ }
161731
+ else {
161732
+ if (firstTime) {
161733
+ this.registerEvent('initialized', function () {
161734
+ self.setHtml();
161735
+ });
161736
+ }
161737
+ else {
161738
+ self.setHtml();
161739
+ }
161740
+ }
161741
+ }
161742
+ }
161743
+ destroyEditor() {
161744
+ if (this._editorInitialized) {
161745
+ this._editor.destroy();
161746
+ this._editorInitialized = false;
161747
+ }
161748
+ }
161749
+ getEditor() {
161750
+ if (this._element) {
161751
+ return this._editor;
161752
+ }
161753
+ return null;
161754
+ }
161755
+ generateManualController() {
161756
+ const controls = {
161757
+ initialize: this.createEditor.bind(this),
161758
+ destroy: this.destroyEditor.bind(this),
161759
+ getEditor: this.getEditor.bind(this),
161760
+ };
161761
+ this.froalaInit.emit(controls);
161762
+ }
161763
+ ngAfterViewInit() {
161764
+ if (!this.froalaInit.observers.length) {
161765
+ this.createEditor();
161766
+ }
161767
+ else {
161768
+ this.generateManualController();
161769
+ }
161770
+ }
161771
+ ngOnDestroy() {
161772
+ this.destroyEditor();
161773
+ }
161774
+ };
161775
+ __decorate([
161776
+ core_1.Input(),
161777
+ __metadata("design:type", Object),
161778
+ __metadata("design:paramtypes", [Object])
161779
+ ], FroalaEditorDirective.prototype, "froalaEditor", null);
161780
+ __decorate([
161781
+ core_1.Input(),
161782
+ __metadata("design:type", Object),
161783
+ __metadata("design:paramtypes", [Object])
161784
+ ], FroalaEditorDirective.prototype, "froalaModel", null);
161785
+ __decorate([
161786
+ core_1.Output(),
161787
+ __metadata("design:type", core_1.EventEmitter)
161788
+ ], FroalaEditorDirective.prototype, "froalaModelChange", void 0);
161789
+ __decorate([
161790
+ core_1.Output(),
161791
+ __metadata("design:type", core_1.EventEmitter)
161792
+ ], FroalaEditorDirective.prototype, "froalaInit", void 0);
161793
+ FroalaEditorDirective = FroalaEditorDirective_1 = __decorate([
161794
+ core_1.Directive({
161795
+ selector: '[froalaEditor]',
161796
+ exportAs: 'froalaEditor',
161797
+ providers: [
161798
+ {
161799
+ provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(() => FroalaEditorDirective_1),
161800
+ multi: true
161801
+ }
161802
+ ]
161803
+ }),
161804
+ __metadata("design:paramtypes", [core_1.ElementRef, core_1.NgZone])
161805
+ ], FroalaEditorDirective);
161806
+ exports_1("FroalaEditorDirective", FroalaEditorDirective);
161807
+ }
161808
+ };
161809
+ });
161810
+
161811
+ System.register(["@angular/core", "@stratusjs/angular/froala/editor/froala-editor.directive"], function (exports_1, context_1) {
161812
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161813
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161814
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161815
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161816
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161817
+ };
161818
+ var FroalaEditorModule_1, core_1, froala_editor_directive_1, FroalaEditorModule;
161819
+ context_1 && context_1.id;
161820
+ return {
161821
+ setters: [
161822
+ function (core_1_1) {
161823
+ core_1 = core_1_1;
161824
+ },
161825
+ function (froala_editor_directive_1_1) {
161826
+ froala_editor_directive_1 = froala_editor_directive_1_1;
161827
+ }
161828
+ ],
161829
+ execute: function () {
161830
+ FroalaEditorModule = FroalaEditorModule_1 = class FroalaEditorModule {
161831
+ static forRoot() {
161832
+ return { ngModule: FroalaEditorModule_1, providers: [] };
161833
+ }
161834
+ };
161835
+ FroalaEditorModule = FroalaEditorModule_1 = __decorate([
161836
+ core_1.NgModule({
161837
+ declarations: [froala_editor_directive_1.FroalaEditorDirective],
161838
+ exports: [froala_editor_directive_1.FroalaEditorDirective]
161839
+ })
161840
+ ], FroalaEditorModule);
161841
+ exports_1("FroalaEditorModule", FroalaEditorModule);
161842
+ }
161843
+ };
161844
+ });
161845
+
161846
+ System.register(["@stratusjs/angular/froala/editor/froala-editor.directive", "@stratusjs/angular/froala/editor/froala-editor.module"], function (exports_1, context_1) {
161847
+ context_1 && context_1.id;
161848
+ return {
161849
+ setters: [
161850
+ function (froala_editor_directive_1_1) {
161851
+ exports_1({
161852
+ "FroalaEditorDirective": froala_editor_directive_1_1["FroalaEditorDirective"]
161853
+ });
161854
+ },
161855
+ function (froala_editor_module_1_1) {
161856
+ exports_1({
161857
+ "FroalaEditorModule": froala_editor_module_1_1["FroalaEditorModule"]
161858
+ });
161859
+ }
161860
+ ],
161861
+ execute: function () {
161862
+ }
161863
+ };
161864
+ });
161865
+
161866
+ System.register(["@angular/core"], function (exports_1, context_1) {
161867
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161868
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161869
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161870
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161871
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161872
+ };
161873
+ var __metadata = (this && this.__metadata) || function (k, v) {
161874
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
161875
+ };
161876
+ var core_1, FroalaViewDirective;
161877
+ context_1 && context_1.id;
161878
+ return {
161879
+ setters: [
161880
+ function (core_1_1) {
161881
+ core_1 = core_1_1;
161882
+ }
161883
+ ],
161884
+ execute: function () {
161885
+ FroalaViewDirective = class FroalaViewDirective {
161886
+ constructor(renderer, element) {
161887
+ this.renderer = renderer;
161888
+ this._element = element.nativeElement;
161889
+ }
161890
+ set froalaView(content) {
161891
+ this._element.innerHTML = content;
161892
+ }
161893
+ ngAfterViewInit() {
161894
+ this.renderer.addClass(this._element, 'fr-view');
161895
+ }
161896
+ };
161897
+ __decorate([
161898
+ core_1.Input(),
161899
+ __metadata("design:type", String),
161900
+ __metadata("design:paramtypes", [String])
161901
+ ], FroalaViewDirective.prototype, "froalaView", null);
161902
+ FroalaViewDirective = __decorate([
161903
+ core_1.Directive({
161904
+ selector: '[froalaView]'
161905
+ }),
161906
+ __metadata("design:paramtypes", [core_1.Renderer2, core_1.ElementRef])
161907
+ ], FroalaViewDirective);
161908
+ exports_1("FroalaViewDirective", FroalaViewDirective);
161909
+ }
161910
+ };
161911
+ });
161912
+
161913
+ System.register(["@angular/core", "@stratusjs/angular/froala/view/froala-view.directive"], function (exports_1, context_1) {
161914
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
161915
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
161916
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
161917
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
161918
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
161919
+ };
161920
+ var FroalaViewModule_1, core_1, froala_view_directive_1, FroalaViewModule;
161921
+ context_1 && context_1.id;
161922
+ return {
161923
+ setters: [
161924
+ function (core_1_1) {
161925
+ core_1 = core_1_1;
161926
+ },
161927
+ function (froala_view_directive_1_1) {
161928
+ froala_view_directive_1 = froala_view_directive_1_1;
161929
+ }
161930
+ ],
161931
+ execute: function () {
161932
+ FroalaViewModule = FroalaViewModule_1 = class FroalaViewModule {
161933
+ static forRoot() {
161934
+ return { ngModule: FroalaViewModule_1, providers: [] };
161935
+ }
161936
+ };
161937
+ FroalaViewModule = FroalaViewModule_1 = __decorate([
161938
+ core_1.NgModule({
161939
+ declarations: [froala_view_directive_1.FroalaViewDirective],
161940
+ exports: [froala_view_directive_1.FroalaViewDirective]
161941
+ })
161942
+ ], FroalaViewModule);
161943
+ exports_1("FroalaViewModule", FroalaViewModule);
161944
+ }
161945
+ };
161946
+ });
161947
+
161948
+ System.register(["@stratusjs/angular/froala/view/froala-view.directive", "@stratusjs/angular/froala/view/froala-view.module"], function (exports_1, context_1) {
161949
+ context_1 && context_1.id;
161950
+ return {
161951
+ setters: [
161952
+ function (froala_view_directive_1_1) {
161953
+ exports_1({
161954
+ "FroalaViewDirective": froala_view_directive_1_1["FroalaViewDirective"]
161955
+ });
161956
+ },
161957
+ function (froala_view_module_1_1) {
161958
+ exports_1({
161959
+ "FroalaViewModule": froala_view_module_1_1["FroalaViewModule"]
161960
+ });
161961
+ }
161962
+ ],
161963
+ execute: function () {
161964
+ }
161965
+ };
161966
+ });
161967
+
161968
+ /*!
161969
+ * froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
161970
+ * License https://froala.com/wysiwyg-editor/terms/
161971
+ * Copyright 2014-2020 Froala Labs
161972
+ */
161973
+ System.register(["froala-editor"], function (exports_1, context_1) {
161974
+ var froala_editor_1;
161975
+ context_1 && context_1.id;
161976
+ return {
161977
+ setters: [
161978
+ function (froala_editor_1_1) {
161979
+ froala_editor_1 = froala_editor_1_1;
161980
+ }
161981
+ ],
161982
+ execute: function () {
161983
+ /*!
161984
+ * froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
161985
+ * License https://froala.com/wysiwyg-editor/terms/
161986
+ * Copyright 2014-2020 Froala Labs
161987
+ */
161988
+ if (((froala_editor_1.default && froala_editor_1.default.hasOwnProperty('default') ? froala_editor_1.default.default : froala_editor_1.default),
161989
+ Object.assign(froala_editor_1.default.DEFAULTS, {
161990
+ imageManagerLoadURL: 'https://i.froala.com/load-files',
161991
+ imageManagerLoadMethod: 'get',
161992
+ imageManagerLoadParams: {},
161993
+ imageManagerPreloader: null,
161994
+ imageManagerDeleteURL: '',
161995
+ imageManagerDeleteMethod: 'post',
161996
+ imageManagerDeleteParams: {},
161997
+ imageManagerPageSize: 12,
161998
+ imageManagerScrollOffset: 20,
161999
+ imageManagerToggleTags: !0,
162000
+ }),
162001
+ (froala_editor_1.default.PLUGINS.imageManagerCustom = (s) => {
162002
+ let g, l, i, o, d, m, c, f, u, p, h, v = s.$, M = 'image_manager', e = 10, b = 11, w = 12, C = 13, L = 14, D = 15, t = 21, r = 22, n = {};
162003
+ function y() {
162004
+ let e = v(window).outerWidth();
162005
+ return e < 768 ? 2 : e < 1200 ? 3 : 4;
162006
+ }
162007
+ function I() {
162008
+ d.empty();
162009
+ for (let e = 0; e < h; e++) {
162010
+ d.append('<div class="fr-list-column"></div>');
162011
+ }
162012
+ }
162013
+ function P() {
162014
+ if (u < c.length
162015
+ && (d.outerHeight() <= i.outerHeight() + s.opts.imageManagerScrollOffset
162016
+ || i.scrollTop() + s.opts.imageManagerScrollOffset > d.outerHeight() - i.outerHeight())) {
162017
+ f++;
162018
+ for (let e = s.opts.imageManagerPageSize * (f - 1); e < Math.min(c.length, s.opts.imageManagerPageSize * f); e++) {
162019
+ a(c[e]);
162020
+ }
162021
+ }
162022
+ }
162023
+ function a(n) {
162024
+ let i = new Image(), o = v(document.createElement('div'))
162025
+ .attr('class', 'fr-image-container fr-empty fr-image-' + p++)
162026
+ .attr('data-loading', s.language.translate('Loading') + '..')
162027
+ .attr('data-deleting', s.language.translate('Deleting') + '..');
162028
+ R(!1),
162029
+ (i.onload = function () {
162030
+ o.height(Math.floor((o.width() / i.width) * i.height));
162031
+ let t = v(document.createElement('img'));
162032
+ if (n.thumb) {
162033
+ t.attr('src', n.thumb);
162034
+ }
162035
+ else {
162036
+ if ((O(L, n), !n.url)) {
162037
+ return O(D, n), !1;
162038
+ }
162039
+ t.attr('src', n.url);
162040
+ }
162041
+ if ((n.url && t.attr('data-url', n.url), n.tag)) {
162042
+ if ((l.find('.fr-modal-more.fr-not-available').removeClass('fr-not-available'), l.find('.fr-modal-tags').show(), 0 <= n.tag.indexOf(','))) {
162043
+ for (let e = n.tag.split(','), a = 0; a < e.length; a++) {
162044
+ (e[a] =
162045
+ e[a].trim()), 0 === m.find('a[title="'.concat(e[a], '"]')).length && m.append('<a role="button" title="'.concat(e[a], '">').concat(e[a], '</a>'));
162046
+ }
162047
+ t.attr('data-tag', e.join());
162048
+ }
162049
+ else {
162050
+ 0 === m.find('a[title="'.concat(n.tag.trim(), '"]')).length && m.append('<a role="button" title="'.concat(n.tag.trim(), '">').concat(n.tag.trim(), '</a>')), t.attr('data-tag', n.tag.trim());
162051
+ }
162052
+ }
162053
+ for (let r in (n.name && t.attr('alt', n.name), n)) {
162054
+ n.hasOwnProperty(r) && 'thumb' !== r && 'url' !== r && 'tag' !== r && t.attr('data-'.concat(r), n[r]);
162055
+ }
162056
+ o
162057
+ .append(t)
162058
+ .append(v(s.icon.create('imageManagerDelete')).addClass('fr-delete-img').attr('title', s.language.translate('Delete')))
162059
+ .append(v(s.icon.create('imageManagerInsert')).addClass('fr-insert-img').attr('title', s.language.translate('Insert'))),
162060
+ m.find('.fr-selected-tag').each(function (e, a) {
162061
+ j(t, a.text) || o.hide();
162062
+ }),
162063
+ t.on('load', function () {
162064
+ o.removeClass('fr-empty'),
162065
+ o.height('auto'),
162066
+ u++,
162067
+ E(T(parseInt(t
162068
+ .parent()
162069
+ .attr('class')
162070
+ .match(/fr-image-(\d+)/)[1], 10) + 1)),
162071
+ R(!1),
162072
+ u % s.opts.imageManagerPageSize === 0 && P();
162073
+ }),
162074
+ s.events.trigger('imageManager.imageLoaded', [t]);
162075
+ }),
162076
+ (i.onerror = () => {
162077
+ u++,
162078
+ o.remove(),
162079
+ E(T(parseInt(o.attr('class').match(/fr-image-(\d+)/)[1], 10) + 1)),
162080
+ O(e, n),
162081
+ u % s.opts.imageManagerPageSize === 0 && P();
162082
+ }),
162083
+ (i.src = n.thumb || n.url),
162084
+ S().append(o);
162085
+ }
162086
+ function S() {
162087
+ let r, n;
162088
+ return (d.find('.fr-list-column').each((e, a) => {
162089
+ let t = v(a);
162090
+ 0 === e ? ((n = t.outerHeight()), (r = t)) : t.outerHeight() < n && ((n = t.outerHeight()), (r = t));
162091
+ }),
162092
+ r);
162093
+ }
162094
+ function T(e) {
162095
+ e === undefined && (e = 0);
162096
+ for (let a = [], t = p - 1; e <= t; t--) {
162097
+ let r = d.find('.fr-image-'.concat(t));
162098
+ r.length && (a.push(r), v(document.createElement('div')).attr('id', 'fr-image-hidden-container').append(r), d.find('.fr-image-'.concat(t)).remove());
162099
+ }
162100
+ return a;
162101
+ }
162102
+ function E(e) {
162103
+ for (let a = e.length - 1; 0 <= a; a--) {
162104
+ S().append(e[a]);
162105
+ }
162106
+ }
162107
+ function R(e) {
162108
+ if ((e === undefined && (e = !0), !g.isVisible())) {
162109
+ return !0;
162110
+ }
162111
+ let a = y();
162112
+ if (a !== h) {
162113
+ h = a;
162114
+ let t = T();
162115
+ I(), E(t);
162116
+ }
162117
+ s.modals.resize(M), e && P();
162118
+ }
162119
+ function U(e) {
162120
+ for (let a, t = e[0].attributes, r = t.length, n = {}; r--;) {
162121
+ t[r] && 'src' !== (a = t[r].name) && (n[a] = t[r].value);
162122
+ }
162123
+ return n;
162124
+ }
162125
+ function x(e) {
162126
+ let a = v(e.currentTarget).siblings('img'), t = g.data('instance') || s, r = g.data('current-image');
162127
+ if ((s.modals.hide(M), t.image.showProgressBar(), r)) {
162128
+ r.data('fr-old-src', r.attr('src')), r.trigger('click');
162129
+ }
162130
+ else {
162131
+ t.events.focus(!0), t.selection.restore();
162132
+ let n = t.position.getBoundingRect(), i = n.left + n.width / 2 + v(s.doc).scrollLeft(), o = n.top + n.height + v(s.doc).scrollTop();
162133
+ t.popups.setContainer('image.insert', s.$sc), t.popups.show('image.insert', i, o);
162134
+ }
162135
+ t.image.insert(a.data('url'), !1, U(a), r);
162136
+ }
162137
+ function H(e) {
162138
+ let i = v(e.currentTarget).siblings('img'), a = s.language.translate('Are you sure? Image will be deleted.');
162139
+ confirm(a) &&
162140
+ (s.opts.imageManagerDeleteURL
162141
+ ? !1 !== s.events.trigger('imageManager.beforeDeleteImage', [i]) &&
162142
+ (i.parent().addClass('fr-image-deleting'),
162143
+ v(this).ajax({
162144
+ method: s.opts.imageManagerDeleteMethod,
162145
+ url: s.opts.imageManagerDeleteURL,
162146
+ data: Object.assign(Object.assign({ src: i.attr('src') }, U(i)), s.opts.imageManagerDeleteParams),
162147
+ crossDomain: s.opts.requestWithCORS,
162148
+ withCredentials: s.opts.requestWithCredentials,
162149
+ headers: s.opts.requestHeaders,
162150
+ done(e, a, t) {
162151
+ s.events.trigger('imageManager.imageDeleted', [e]);
162152
+ let r = T(parseInt(i
162153
+ .parent()
162154
+ .attr('class')
162155
+ .match(/fr-image-(\d+)/)[1], 10) + 1);
162156
+ i.parent().remove(),
162157
+ E(r),
162158
+ (function n() {
162159
+ g.find('#fr-modal-tags > a').each(function () {
162160
+ 0 === g.find('#fr-image-list [data-tag*="'.concat(v(this).text(), '"]')).length && v(this).removeClass('fr-selected-tag').hide();
162161
+ }),
162162
+ _();
162163
+ })(),
162164
+ R(!0);
162165
+ },
162166
+ fail(e) {
162167
+ O(t, e.response || e.responseText);
162168
+ },
162169
+ }))
162170
+ : O(r));
162171
+ }
162172
+ function O(e, a) {
162173
+ 10 <= e && e < 20
162174
+ ? o.hide()
162175
+ : 20 <= e && e < 30 && v('.fr-image-deleting').removeClass('fr-image-deleting'), s.events.trigger('imageManager.error', [
162176
+ { code: e, message: n[e] },
162177
+ a
162178
+ ]);
162179
+ }
162180
+ function q() {
162181
+ let e = l.find('.fr-modal-head-line').outerHeight(), a = m.outerHeight();
162182
+ l.toggleClass('fr-show-tags'), l.hasClass('fr-show-tags')
162183
+ ? (l.css('height', e + a), i.css('marginTop', e + a), m.find('a').css('opacity', 1))
162184
+ : (l.css('height', e), i.css('marginTop', e), m.find('a').css('opacity', 0));
162185
+ }
162186
+ function _() {
162187
+ let e = m.find('.fr-selected-tag');
162188
+ 0 < e.length
162189
+ ? (d.find('img').parents().show(),
162190
+ e.each((e, r) => {
162191
+ d.find('img').each(function (e, a) {
162192
+ let t = v(a);
162193
+ j(t, r.text) || t.parent().hide();
162194
+ });
162195
+ }))
162196
+ : d.find('img').parents().show(),
162197
+ E(T()),
162198
+ P();
162199
+ }
162200
+ function k(e) {
162201
+ e.preventDefault();
162202
+ let a = v(e.currentTarget);
162203
+ a.toggleClass('fr-selected-tag'), s.opts.imageManagerToggleTags && a.siblings('a').removeClass('fr-selected-tag'), _();
162204
+ }
162205
+ function j(e, a) {
162206
+ for (let t = (e.attr('data-tag') || '').split(','), r = 0; r < t.length; r++) {
162207
+ if (t[r] === a) {
162208
+ return !0;
162209
+ }
162210
+ }
162211
+ return !1;
162212
+ }
162213
+ return ((n[e] = 'Image cannot be loaded from the passed link.'),
162214
+ (n[b] = 'Error during load images request.'),
162215
+ (n[w] = 'Missing imageManagerLoadURL option.'),
162216
+ (n[C] = 'Parsing load response failed.'),
162217
+ (n[L] = 'Missing image thumb.'),
162218
+ (n[D] = 'Missing image URL.'),
162219
+ (n[t] = 'Error during delete image request.'),
162220
+ (n[r] = 'Missing imageManagerDeleteURL option.'),
162221
+ {
162222
+ require: ['image'],
162223
+ _init: function z() {
162224
+ if (!s.$wp && 'IMG' !== s.el.tagName) {
162225
+ return !1;
162226
+ }
162227
+ },
162228
+ show: function G() {
162229
+ if (!g) {
162230
+ let e, a = '<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'
162231
+ .concat(s.sid, '"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="')
162232
+ .concat(froala_editor_1.default.SVG.tags, '"/></svg></button><h4 data-text="true">')
162233
+ .concat(s.language.translate('Manage Images'), '</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');
162234
+ (e = s.opts.imageManagerPreloader
162235
+ ? '<img class="fr-preloader" id="fr-preloader" alt="'.concat(s.language.translate('Loading'), '.." src="').concat(s.opts.imageManagerPreloader, '" style="display: none;">')
162236
+ : '<span class="fr-preloader" id="fr-preloader" style="display: none;">'.concat(s.language.translate('Loading'), '</span>')),
162237
+ (e += '<div class="fr-image-list" id="fr-image-list"></div>');
162238
+ let t = s.modals.create(M, a, e);
162239
+ (g = t.$modal), (l = t.$head), (i = t.$body);
162240
+ }
162241
+ g.data('current-image', s.image.get()),
162242
+ s.modals.show(M),
162243
+ o ||
162244
+ (function r() {
162245
+ (o = g.find('#fr-preloader')),
162246
+ (d = g.find('#fr-image-list')),
162247
+ (m = g.find('#fr-modal-tags')),
162248
+ (h = y()),
162249
+ I(),
162250
+ l.css('height', l.find('.fr-modal-head-line').outerHeight()),
162251
+ s.events.$on(v(s.o_win), 'resize', () => {
162252
+ R(!!c);
162253
+ }),
162254
+ s.events.bindClick(d, '.fr-insert-img', x),
162255
+ s.events.bindClick(d, '.fr-delete-img', H),
162256
+ s.helpers.isMobile() &&
162257
+ (s.events.bindClick(d, 'div.fr-image-container', (e) => {
162258
+ g.find('.fr-mobile-selected').removeClass('fr-mobile-selected'),
162259
+ v(e.currentTarget).addClass('fr-mobile-selected');
162260
+ }),
162261
+ g.on(s._mousedown, () => {
162262
+ g.find('.fr-mobile-selected').removeClass('fr-mobile-selected');
162263
+ })),
162264
+ g.on(s._mousedown + ' ' + s._mouseup, (e) => {
162265
+ e.stopPropagation();
162266
+ }),
162267
+ g.on(s._mousedown, '*', () => {
162268
+ s.events.disableBlur();
162269
+ }),
162270
+ i.on('scroll', P),
162271
+ s.events.bindClick(g, 'button#fr-modal-more-'.concat(s.sid), q),
162272
+ s.events.bindClick(m, 'a', k);
162273
+ })(),
162274
+ (function n() {
162275
+ o.show(),
162276
+ d.find('.fr-list-column').empty(),
162277
+ s.opts.imageManagerLoadURL
162278
+ ? v(this).ajax({
162279
+ url: s.opts.imageManagerLoadURL,
162280
+ method: s.opts.imageManagerLoadMethod,
162281
+ data: s.opts.imageManagerLoadParams,
162282
+ crossDomain: s.opts.requestWithCORS,
162283
+ withCredentials: s.opts.requestWithCredentials,
162284
+ headers: s.opts.requestHeaders,
162285
+ done(e, a, t) {
162286
+ s.events.trigger('imageManager.imagesLoaded', [e]),
162287
+ (function r(e, a) {
162288
+ try {
162289
+ d.find('.fr-list-column').empty(), (p = u = f = 0), (c = JSON.parse(e)), P();
162290
+ }
162291
+ catch (t) {
162292
+ O(C, a);
162293
+ }
162294
+ })(e, t.response),
162295
+ o.hide();
162296
+ },
162297
+ fail(e) {
162298
+ O(b, e.response || e.responseText);
162299
+ },
162300
+ })
162301
+ : O(w);
162302
+ })();
162303
+ },
162304
+ hide: function N() {
162305
+ s.modals.hide(M);
162306
+ },
162307
+ });
162308
+ }),
162309
+ !froala_editor_1.default.PLUGINS.image)) {
162310
+ throw new Error('Image manager plugin requires image plugin.');
162311
+ }
162312
+ froala_editor_1.default.DEFAULTS.imageInsertButtons.push('imageManagerCustom'),
162313
+ froala_editor_1.default.RegisterCommand('imageManagerCustom', {
162314
+ title: 'Browse',
162315
+ undo: !1,
162316
+ focus: !1,
162317
+ modal: !0,
162318
+ callback() {
162319
+ this.imageManagerCustom.show();
162320
+ },
162321
+ plugin: 'imageManagerCustom',
162322
+ }),
162323
+ froala_editor_1.default.DefineIcon('imageManagerCustom', { NAME: 'folder', SVG_KEY: 'imageManager' }),
162324
+ froala_editor_1.default.DefineIcon('imageManagerCustomInsert', { NAME: 'plus', SVG_KEY: 'add' }),
162325
+ froala_editor_1.default.DefineIcon('imageManagerCustomDelete', { NAME: 'trash', SVG_KEY: 'remove' });
162326
+ }
162327
+ };
162328
+ });
162329
+
161379
162330
  FroalaEditor.DEFAULTS = Object.assign(FroalaEditor.DEFAULTS, {});
161380
162331
  FroalaEditor.PLUGINS.menuButton = function menuButton(editor) {
161381
162332
  let inputButton;