@mjhls/mjh-framework 1.0.193 → 1.0.194

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.
package/dist/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import React__default, { Component, useState, useEffect, useRef, createContext, createElement } from 'react';
1
+ import React__default, { Component, useState, useEffect, useRef, createElement, createContext } from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import reactDom from 'react-dom';
4
4
  import Container from 'react-bootstrap/Container';
@@ -761,6 +761,8 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
761
761
 
762
762
  return new Promise(function (resolve) {
763
763
  _this3.getGoogletag().then(function (googletag) {
764
+ _this3.configureInitialOptions(googletag);
765
+
764
766
  slotsToInitialize.forEach(function (currentSlotId) {
765
767
  registeredSlots[currentSlotId].loading = false;
766
768
  googletag.cmd.push(function () {
@@ -824,14 +826,25 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
824
826
  });
825
827
  });
826
828
  },
827
- configureOptions: function configureOptions(googletag) {
829
+ // configure those gpt parameters that need to be set before pubsads service
830
+ // initialization.
831
+ configureInitialOptions: function configureInitialOptions(googletag) {
828
832
  var _this4 = this;
829
833
 
834
+ googletag.cmd.push(function () {
835
+ if (_this4.disableInitialLoadIsEnabled()) {
836
+ googletag.pubads().disableInitialLoad();
837
+ }
838
+ });
839
+ },
840
+ configureOptions: function configureOptions(googletag) {
841
+ var _this5 = this;
842
+
830
843
  googletag.cmd.push(function () {
831
844
  var pubadsService = googletag.pubads();
832
- pubadsService.setRequestNonPersonalizedAds(_this4.personalizedAdsEnabled() ? 0 : 1);
845
+ pubadsService.setRequestNonPersonalizedAds(_this5.personalizedAdsEnabled() ? 0 : 1);
833
846
 
834
- var targetingArguments = _this4.getTargetingArguments(); // set global targetting arguments
847
+ var targetingArguments = _this5.getTargetingArguments(); // set global targetting arguments
835
848
 
836
849
 
837
850
  Object.keys(targetingArguments).forEach(function (varName) {
@@ -840,16 +853,16 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
840
853
  }
841
854
  }); // set global adSense attributes
842
855
 
843
- var adSenseAttributes = _this4.getAdSenseAttributes();
856
+ var adSenseAttributes = _this5.getAdSenseAttributes();
844
857
 
845
858
  Object.keys(adSenseAttributes).forEach(function (key) {
846
859
  pubadsService.set(key, adSenseAttributes[key]);
847
860
  });
848
861
 
849
- if (_this4.lazyLoadIsEnabled()) {
862
+ if (_this5.lazyLoadIsEnabled()) {
850
863
  var args = [];
851
864
 
852
- var config = _this4.getLazyLoadConfig();
865
+ var config = _this5.getLazyLoadConfig();
853
866
 
854
867
  if (config !== null) {
855
868
  args.push(config);
@@ -858,16 +871,12 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
858
871
  pubadsService.enableLazyLoad.call(args);
859
872
  }
860
873
 
861
- if (_this4.singleRequestIsEnabled()) {
874
+ if (_this5.singleRequestIsEnabled()) {
862
875
  pubadsService.enableSingleRequest();
863
876
  }
864
877
 
865
- if (_this4.disableInitialLoadIsEnabled()) {
866
- pubadsService.disableInitialLoad();
867
- }
868
-
869
- if (_this4.collapseEmptyDivs === true || _this4.collapseEmptyDivs === false) {
870
- pubadsService.collapseEmptyDivs(_this4.collapseEmptyDivs);
878
+ if (_this5.collapseEmptyDivs === true || _this5.collapseEmptyDivs === false) {
879
+ pubadsService.collapseEmptyDivs(_this5.collapseEmptyDivs);
871
880
  }
872
881
  });
873
882
  },
@@ -909,10 +918,10 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
909
918
  }
910
919
  },
911
920
  gptRefreshAds: function gptRefreshAds(slots) {
912
- var _this5 = this;
921
+ var _this6 = this;
913
922
 
914
923
  return this.getGoogletag().then(function (googletag) {
915
- _this5.configureOptions(googletag);
924
+ _this6.configureOptions(googletag);
916
925
 
917
926
  googletag.cmd.push(function () {
918
927
  var pubadsService = googletag.pubads();
@@ -923,14 +932,14 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
923
932
  });
924
933
  },
925
934
  reload: function reload() {
926
- var _this6 = this;
935
+ var _this7 = this;
927
936
 
928
937
  return this.destroyGPTSlots.apply(this, arguments).then(function () {
929
- return _this6.load();
938
+ return _this7.load();
930
939
  });
931
940
  },
932
941
  destroyGPTSlots: function destroyGPTSlots() {
933
- var _this7 = this;
942
+ var _this8 = this;
934
943
 
935
944
  for (var _len4 = arguments.length, slotsToDestroy = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
936
945
  slotsToDestroy[_key4] = arguments[_key4];
@@ -950,7 +959,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
950
959
  slots.push(slot);
951
960
  }
952
961
 
953
- _this7.getGoogletag().then(function (googletag) {
962
+ _this8.getGoogletag().then(function (googletag) {
954
963
  googletag.cmd.push(function () {
955
964
  if (managerAlreadyInitialized === true) {
956
965
  if (slotsToDestroy.length > 0) {
@@ -973,7 +982,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
973
982
  });
974
983
  },
975
984
  registerSlot: function registerSlot(_ref) {
976
- var _this8 = this;
985
+ var _this9 = this;
977
986
 
978
987
  var slotId = _ref.slotId,
979
988
  dfpNetworkId = _ref.dfpNetworkId,
@@ -1012,7 +1021,7 @@ var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0
1012
1021
  gptSlot = slot.gptSlot;
1013
1022
 
1014
1023
  if (loading === false && !gptSlot) {
1015
- _this8.load(slotId);
1024
+ _this9.load(slotId);
1016
1025
  }
1017
1026
  }
1018
1027
  });
@@ -7940,6 +7949,7 @@ exports.SPEC_NAME_TO_URL_NAME_MAPPINGS = [
7940
7949
  ['quality', 'q'],
7941
7950
  ['fit', 'fit'],
7942
7951
  ['crop', 'crop'],
7952
+ ['saturation', 'sat'],
7943
7953
  ['auto', 'auto'],
7944
7954
  ['dpr', 'dpr']
7945
7955
  ];
@@ -7976,9 +7986,9 @@ function urlForImage(options) {
7976
7986
  // If irrelevant, or if we are requested to: don't perform crop/fit based on
7977
7987
  // the crop/hotspot.
7978
7988
  if (!(spec.rect || spec.focalPoint || spec.ignoreImageParams || spec.crop)) {
7979
- spec = __assign({}, spec, fit({ crop: crop, hotspot: hotspot }, spec));
7989
+ spec = __assign(__assign({}, spec), fit({ crop: crop, hotspot: hotspot }, spec));
7980
7990
  }
7981
- return specToImageUrl(__assign({}, spec, { asset: asset }));
7991
+ return specToImageUrl(__assign(__assign({}, spec), { asset: asset }));
7982
7992
  }
7983
7993
  exports.default = urlForImage;
7984
7994
  // eslint-disable-next-line complexity
@@ -8000,7 +8010,7 @@ function specToImageUrl(spec) {
8000
8010
  }
8001
8011
  if (spec.focalPoint) {
8002
8012
  params.push("fp-x=" + spec.focalPoint.x);
8003
- params.push("fp-x=" + spec.focalPoint.y);
8013
+ params.push("fp-y=" + spec.focalPoint.y);
8004
8014
  }
8005
8015
  var flip = [spec.flipHorizontal && 'h', spec.flipVertical && 'v'].filter(Boolean).join('');
8006
8016
  if (flip) {
@@ -8134,7 +8144,8 @@ function urlBuilder(options) {
8134
8144
  var client = options;
8135
8145
  if (isSanityClient(client)) {
8136
8146
  // Inherit config from client
8137
- var _a = client.clientConfig, apiHost = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
8147
+ var _a = client.clientConfig, apiUrl = _a.apiHost, projectId = _a.projectId, dataset = _a.dataset;
8148
+ var apiHost = apiUrl || 'https://api.sanity.io';
8138
8149
  return new ImageUrlBuilder(null, {
8139
8150
  baseUrl: apiHost.replace(/^https:\/\/api\./, 'https://cdn.'),
8140
8151
  projectId: projectId,
@@ -8148,7 +8159,7 @@ exports.default = urlBuilder;
8148
8159
  var ImageUrlBuilder = /** @class */ (function () {
8149
8160
  function ImageUrlBuilder(parent, options) {
8150
8161
  this.options = parent
8151
- ? __assign({}, (parent.options || {}), (options || {})) : __assign({}, (options || {})); // Copy options
8162
+ ? __assign(__assign({}, (parent.options || {})), (options || {})) : __assign({}, (options || {})); // Copy options
8152
8163
  }
8153
8164
  ImageUrlBuilder.prototype.withOptions = function (options) {
8154
8165
  var baseUrl = options.baseUrl || '';
@@ -8265,6 +8276,10 @@ var ImageUrlBuilder = /** @class */ (function () {
8265
8276
  }
8266
8277
  return this.withOptions({ crop: value });
8267
8278
  };
8279
+ // Saturation
8280
+ ImageUrlBuilder.prototype.saturation = function (saturation) {
8281
+ return this.withOptions({ saturation: saturation });
8282
+ };
8268
8283
  ImageUrlBuilder.prototype.auto = function (value) {
8269
8284
  if (validAutoModes.indexOf(value) === -1) {
8270
8285
  throw new Error("Invalid auto mode \"" + value + "\"");
@@ -8281,10 +8296,12 @@ var ImageUrlBuilder = /** @class */ (function () {
8281
8296
  };
8282
8297
  return ImageUrlBuilder;
8283
8298
  }());
8299
+ exports.ImageUrlBuilder = ImageUrlBuilder;
8284
8300
 
8285
8301
  });
8286
8302
 
8287
8303
  unwrapExports(builder);
8304
+ var builder_1 = builder.ImageUrlBuilder;
8288
8305
 
8289
8306
  var node = createCommonjsModule(function (module) {
8290
8307
  var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
@@ -17341,21 +17358,18 @@ var Slideshow = function Slideshow(_ref) {
17341
17358
  );
17342
17359
  };
17343
17360
 
17344
- var isArray$1 = Array.isArray;
17345
- var keyList = Object.keys;
17346
- var hasProp = Object.prototype.hasOwnProperty;
17361
+ // do not edit .js files directly - edit src/index.jst
17362
+
17363
+
17347
17364
 
17348
17365
  var fastDeepEqual = function equal(a, b) {
17349
17366
  if (a === b) return true;
17350
17367
 
17351
17368
  if (a && b && typeof a == 'object' && typeof b == 'object') {
17352
- var arrA = isArray$1(a)
17353
- , arrB = isArray$1(b)
17354
- , i
17355
- , length
17356
- , key;
17369
+ if (a.constructor !== b.constructor) return false;
17357
17370
 
17358
- if (arrA && arrB) {
17371
+ var length, i, keys;
17372
+ if (Array.isArray(a)) {
17359
17373
  length = a.length;
17360
17374
  if (length != b.length) return false;
17361
17375
  for (i = length; i-- !== 0;)
@@ -17363,35 +17377,29 @@ var fastDeepEqual = function equal(a, b) {
17363
17377
  return true;
17364
17378
  }
17365
17379
 
17366
- if (arrA != arrB) return false;
17367
17380
 
17368
- var dateA = a instanceof Date
17369
- , dateB = b instanceof Date;
17370
- if (dateA != dateB) return false;
17371
- if (dateA && dateB) return a.getTime() == b.getTime();
17372
17381
 
17373
- var regexpA = a instanceof RegExp
17374
- , regexpB = b instanceof RegExp;
17375
- if (regexpA != regexpB) return false;
17376
- if (regexpA && regexpB) return a.toString() == b.toString();
17382
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
17383
+ if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
17384
+ if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
17377
17385
 
17378
- var keys = keyList(a);
17386
+ keys = Object.keys(a);
17379
17387
  length = keys.length;
17380
-
17381
- if (length !== keyList(b).length)
17382
- return false;
17388
+ if (length !== Object.keys(b).length) return false;
17383
17389
 
17384
17390
  for (i = length; i-- !== 0;)
17385
- if (!hasProp.call(b, keys[i])) return false;
17391
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
17386
17392
 
17387
17393
  for (i = length; i-- !== 0;) {
17388
- key = keys[i];
17394
+ var key = keys[i];
17395
+
17389
17396
  if (!equal(a[key], b[key])) return false;
17390
17397
  }
17391
17398
 
17392
17399
  return true;
17393
17400
  }
17394
17401
 
17402
+ // true if both NaN, false otherwise
17395
17403
  return a!==a && b!==b;
17396
17404
  };
17397
17405
 
@@ -18636,7 +18644,7 @@ function formatValue(ctx, value, recurseTimes) {
18636
18644
  var base = '', array = false, braces = ['{', '}'];
18637
18645
 
18638
18646
  // Make Array say that they are Array
18639
- if (isArray$2(value)) {
18647
+ if (isArray$1(value)) {
18640
18648
  array = true;
18641
18649
  braces = ['[', ']'];
18642
18650
  }
@@ -18815,7 +18823,7 @@ function reduceToSingleString(output, base, braces) {
18815
18823
 
18816
18824
  // NOTE: These type checking functions intentionally don't use `instanceof`
18817
18825
  // because it is fragile and can be easily faked with `Object.create()`.
18818
- function isArray$2(ar) {
18826
+ function isArray$1(ar) {
18819
18827
  return Array.isArray(ar);
18820
18828
  }
18821
18829
 
@@ -18942,7 +18950,7 @@ var util = {
18942
18950
  isNullOrUndefined: isNullOrUndefined,
18943
18951
  isNull: isNull,
18944
18952
  isBoolean: isBoolean,
18945
- isArray: isArray$2,
18953
+ isArray: isArray$1,
18946
18954
  inspect: inspect,
18947
18955
  deprecate: deprecate,
18948
18956
  format: format,
@@ -19609,201 +19617,237 @@ module.exports = exports['default'];
19609
19617
 
19610
19618
  var youTubePlayer = unwrapExports(dist);
19611
19619
 
19612
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
19613
-
19614
- var _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
19620
+ function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
19615
19621
 
19616
19622
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19617
19623
 
19618
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
19624
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19625
+
19626
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
19627
+
19628
+ function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19629
+
19630
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
19631
+
19632
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19633
+
19634
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
19635
+
19636
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
19637
+
19638
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
19639
+
19640
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19641
+
19642
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19619
19643
 
19620
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
19644
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19621
19645
 
19622
- /**
19623
- * Check whether a `props` change should result in the video being updated.
19624
- *
19625
- * @param {Object} prevProps
19626
- * @param {Object} props
19646
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19647
+ /**
19648
+ * Check whether a `props` change should result in the video being updated.
19649
+ *
19650
+ * @param {Object} prevProps
19651
+ * @param {Object} props
19627
19652
  */
19653
+
19628
19654
  function shouldUpdateVideo(prevProps, props) {
19629
19655
  // A changing video should always trigger an update
19630
19656
  if (prevProps.videoId !== props.videoId) {
19631
19657
  return true;
19632
- }
19633
-
19634
- // Otherwise, a change in the start/end time playerVars also requires a player
19658
+ } // Otherwise, a change in the start/end time playerVars also requires a player
19635
19659
  // update.
19660
+
19661
+
19636
19662
  var prevVars = prevProps.opts.playerVars || {};
19637
19663
  var vars = props.opts.playerVars || {};
19638
-
19639
19664
  return prevVars.start !== vars.start || prevVars.end !== vars.end;
19640
19665
  }
19641
-
19642
- /**
19643
- * Neutralise API options that only require a video update, leaving only options
19644
- * that require a player reset. The results can then be compared to see if a
19645
- * player reset is necessary.
19646
- *
19647
- * @param {Object} opts
19666
+ /**
19667
+ * Neutralize API options that only require a video update, leaving only options
19668
+ * that require a player reset. The results can then be compared to see if a
19669
+ * player reset is necessary.
19670
+ *
19671
+ * @param {Object} opts
19648
19672
  */
19673
+
19674
+
19649
19675
  function filterResetOptions(opts) {
19650
- return _extends$1({}, opts, {
19651
- playerVars: _extends$1({}, opts.playerVars, {
19676
+ return _objectSpread({}, opts, {
19677
+ playerVars: _objectSpread({}, opts.playerVars, {
19652
19678
  autoplay: 0,
19653
19679
  start: 0,
19654
19680
  end: 0
19655
19681
  })
19656
19682
  });
19657
19683
  }
19658
-
19659
- /**
19660
- * Check whether a `props` change should result in the player being reset.
19661
- * The player is reset when the `props.opts` change, except if the only change
19662
- * is in the `start` and `end` playerVars, because a video update can deal with
19663
- * those.
19664
- *
19665
- * @param {Object} prevProps
19666
- * @param {Object} props
19684
+ /**
19685
+ * Check whether a `props` change should result in the player being reset.
19686
+ * The player is reset when the `props.opts` change, except if the only change
19687
+ * is in the `start` and `end` playerVars, because a video update can deal with
19688
+ * those.
19689
+ *
19690
+ * @param {Object} prevProps
19691
+ * @param {Object} props
19667
19692
  */
19693
+
19694
+
19668
19695
  function shouldResetPlayer(prevProps, props) {
19669
19696
  return !fastDeepEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts));
19670
19697
  }
19671
-
19672
- /**
19673
- * Check whether a props change should result in an id or className update.
19674
- *
19675
- * @param {Object} prevProps
19676
- * @param {Object} props
19698
+ /**
19699
+ * Check whether a props change should result in an id or className update.
19700
+ *
19701
+ * @param {Object} prevProps
19702
+ * @param {Object} props
19677
19703
  */
19704
+
19705
+
19678
19706
  function shouldUpdatePlayer(prevProps, props) {
19679
19707
  return prevProps.id !== props.id || prevProps.className !== props.className;
19680
19708
  }
19681
19709
 
19682
- var YouTube = function (_React$Component) {
19710
+ var YouTube = /*#__PURE__*/function (_React$Component) {
19683
19711
  _inherits(YouTube, _React$Component);
19684
19712
 
19713
+ var _super = _createSuper(YouTube);
19714
+
19715
+ /**
19716
+ * Expose PlayerState constants for convenience. These constants can also be
19717
+ * accessed through the global YT object after the YouTube IFrame API is instantiated.
19718
+ * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19719
+ */
19685
19720
  function YouTube(props) {
19721
+ var _this;
19722
+
19686
19723
  _classCallCheck(this, YouTube);
19687
19724
 
19688
- var _this = _possibleConstructorReturn(this, (YouTube.__proto__ || Object.getPrototypeOf(YouTube)).call(this, props));
19725
+ _this = _super.call(this, props);
19689
19726
 
19690
- _this.onPlayerReady = function (event) {
19727
+ _defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
19691
19728
  return _this.props.onReady(event);
19692
- };
19729
+ });
19693
19730
 
19694
- _this.onPlayerError = function (event) {
19731
+ _defineProperty(_assertThisInitialized(_this), "onPlayerError", function (event) {
19695
19732
  return _this.props.onError(event);
19696
- };
19733
+ });
19697
19734
 
19698
- _this.onPlayerStateChange = function (event) {
19735
+ _defineProperty(_assertThisInitialized(_this), "onPlayerStateChange", function (event) {
19699
19736
  _this.props.onStateChange(event);
19700
- switch (event.data) {
19701
19737
 
19738
+ switch (event.data) {
19702
19739
  case YouTube.PlayerState.ENDED:
19703
19740
  _this.props.onEnd(event);
19741
+
19704
19742
  break;
19705
19743
 
19706
19744
  case YouTube.PlayerState.PLAYING:
19707
19745
  _this.props.onPlay(event);
19746
+
19708
19747
  break;
19709
19748
 
19710
19749
  case YouTube.PlayerState.PAUSED:
19711
19750
  _this.props.onPause(event);
19751
+
19712
19752
  break;
19713
19753
 
19714
19754
  default:
19715
19755
  }
19716
- };
19756
+ });
19717
19757
 
19718
- _this.onPlayerPlaybackRateChange = function (event) {
19758
+ _defineProperty(_assertThisInitialized(_this), "onPlayerPlaybackRateChange", function (event) {
19719
19759
  return _this.props.onPlaybackRateChange(event);
19720
- };
19760
+ });
19721
19761
 
19722
- _this.onPlayerPlaybackQualityChange = function (event) {
19762
+ _defineProperty(_assertThisInitialized(_this), "onPlayerPlaybackQualityChange", function (event) {
19723
19763
  return _this.props.onPlaybackQualityChange(event);
19724
- };
19764
+ });
19725
19765
 
19726
- _this.createPlayer = function () {
19766
+ _defineProperty(_assertThisInitialized(_this), "createPlayer", function () {
19727
19767
  // do not attempt to create a player server-side, it won't work
19728
- if (typeof document === 'undefined') return;
19729
- // create player
19730
- var playerOpts = _extends$1({}, _this.props.opts, {
19768
+ if (typeof document === 'undefined') return; // create player
19769
+
19770
+ var playerOpts = _objectSpread({}, _this.props.opts, {
19731
19771
  // preload the `videoId` video if one is already given
19732
19772
  videoId: _this.props.videoId
19733
19773
  });
19734
- _this.internalPlayer = youTubePlayer(_this.container, playerOpts);
19735
- // attach event handlers
19774
+
19775
+ _this.internalPlayer = youTubePlayer(_this.container, playerOpts); // attach event handlers
19776
+
19736
19777
  _this.internalPlayer.on('ready', _this.onPlayerReady);
19778
+
19737
19779
  _this.internalPlayer.on('error', _this.onPlayerError);
19780
+
19738
19781
  _this.internalPlayer.on('stateChange', _this.onPlayerStateChange);
19782
+
19739
19783
  _this.internalPlayer.on('playbackRateChange', _this.onPlayerPlaybackRateChange);
19784
+
19740
19785
  _this.internalPlayer.on('playbackQualityChange', _this.onPlayerPlaybackQualityChange);
19741
- };
19786
+ });
19742
19787
 
19743
- _this.resetPlayer = function () {
19788
+ _defineProperty(_assertThisInitialized(_this), "resetPlayer", function () {
19744
19789
  return _this.internalPlayer.destroy().then(_this.createPlayer);
19745
- };
19790
+ });
19746
19791
 
19747
- _this.updatePlayer = function () {
19792
+ _defineProperty(_assertThisInitialized(_this), "updatePlayer", function () {
19748
19793
  _this.internalPlayer.getIframe().then(function (iframe) {
19749
19794
  if (_this.props.id) iframe.setAttribute('id', _this.props.id);else iframe.removeAttribute('id');
19750
19795
  if (_this.props.className) iframe.setAttribute('class', _this.props.className);else iframe.removeAttribute('class');
19751
19796
  });
19752
- };
19797
+ });
19753
19798
 
19754
- _this.updateVideo = function () {
19799
+ _defineProperty(_assertThisInitialized(_this), "updateVideo", function () {
19755
19800
  if (typeof _this.props.videoId === 'undefined' || _this.props.videoId === null) {
19756
19801
  _this.internalPlayer.stopVideo();
19802
+
19757
19803
  return;
19758
- }
19804
+ } // set queueing options
19805
+
19759
19806
 
19760
- // set queueing options
19761
19807
  var autoplay = false;
19762
19808
  var opts = {
19763
19809
  videoId: _this.props.videoId
19764
19810
  };
19811
+
19765
19812
  if ('playerVars' in _this.props.opts) {
19766
19813
  autoplay = _this.props.opts.playerVars.autoplay === 1;
19814
+
19767
19815
  if ('start' in _this.props.opts.playerVars) {
19768
19816
  opts.startSeconds = _this.props.opts.playerVars.start;
19769
19817
  }
19818
+
19770
19819
  if ('end' in _this.props.opts.playerVars) {
19771
19820
  opts.endSeconds = _this.props.opts.playerVars.end;
19772
19821
  }
19773
- }
19822
+ } // if autoplay is enabled loadVideoById
19823
+
19774
19824
 
19775
- // if autoplay is enabled loadVideoById
19776
19825
  if (autoplay) {
19777
19826
  _this.internalPlayer.loadVideoById(opts);
19827
+
19778
19828
  return;
19779
- }
19780
- // default behaviour just cues the video
19829
+ } // default behaviour just cues the video
19830
+
19831
+
19781
19832
  _this.internalPlayer.cueVideoById(opts);
19782
- };
19833
+ });
19783
19834
 
19784
- _this.refContainer = function (container) {
19835
+ _defineProperty(_assertThisInitialized(_this), "refContainer", function (container) {
19785
19836
  _this.container = container;
19786
- };
19837
+ });
19787
19838
 
19788
19839
  _this.container = null;
19789
19840
  _this.internalPlayer = null;
19790
19841
  return _this;
19791
19842
  }
19792
19843
 
19793
- /**
19794
- * Expose PlayerState constants for convenience. These constants can also be
19795
- * accessed through the global YT object after the YouTube IFrame API is instantiated.
19796
- * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19797
- */
19798
-
19799
-
19800
19844
  _createClass(YouTube, [{
19801
- key: 'componentDidMount',
19845
+ key: "componentDidMount",
19802
19846
  value: function componentDidMount() {
19803
19847
  this.createPlayer();
19804
19848
  }
19805
19849
  }, {
19806
- key: 'componentDidUpdate',
19850
+ key: "componentDidUpdate",
19807
19851
  value: function componentDidUpdate(prevProps) {
19808
19852
  if (shouldUpdatePlayer(prevProps, this.props)) {
19809
19853
  this.updatePlayer();
@@ -19818,112 +19862,58 @@ var YouTube = function (_React$Component) {
19818
19862
  }
19819
19863
  }
19820
19864
  }, {
19821
- key: 'componentWillUnmount',
19865
+ key: "componentWillUnmount",
19822
19866
  value: function componentWillUnmount() {
19823
- /**
19824
- * Note: The `youtube-player` package that is used promisifies all Youtube
19825
- * Player API calls, which introduces a delay of a tick before it actually
19826
- * gets destroyed. Since React attempts to remove the element instantly
19827
- * this method isn't quick enough to reset the container element.
19867
+ /**
19868
+ * Note: The `youtube-player` package that is used promisifies all YouTube
19869
+ * Player API calls, which introduces a delay of a tick before it actually
19870
+ * gets destroyed. Since React attempts to remove the element instantly
19871
+ * this method isn't quick enough to reset the container element.
19828
19872
  */
19829
19873
  this.internalPlayer.destroy();
19830
19874
  }
19831
-
19832
- /**
19833
- * https://developers.google.com/youtube/iframe_api_reference#onReady
19834
- *
19835
- * @param {Object} event
19836
- * @param {Object} target - player object
19837
- */
19838
-
19839
-
19840
- /**
19841
- * https://developers.google.com/youtube/iframe_api_reference#onError
19842
- *
19843
- * @param {Object} event
19844
- * @param {Integer} data - error type
19845
- * @param {Object} target - player object
19846
- */
19847
-
19848
-
19849
- /**
19850
- * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19851
- *
19852
- * @param {Object} event
19853
- * @param {Integer} data - status change type
19854
- * @param {Object} target - actual YT player
19855
- */
19856
-
19857
-
19858
- /**
19859
- * https://developers.google.com/youtube/iframe_api_reference#onPlaybackRateChange
19860
- *
19861
- * @param {Object} event
19862
- * @param {Float} data - playback rate
19863
- * @param {Object} target - actual YT player
19864
- */
19865
-
19866
-
19867
- /**
19868
- * https://developers.google.com/youtube/iframe_api_reference#onPlaybackQualityChange
19869
- *
19870
- * @param {Object} event
19871
- * @param {String} data - playback quality
19872
- * @param {Object} target - actual YT player
19873
- */
19874
-
19875
-
19876
- /**
19877
- * Initialize the Youtube Player API on the container and attach event handlers
19878
- */
19879
-
19880
-
19881
- /**
19882
- * Shorthand for destroying and then re-creating the Youtube Player
19883
- */
19884
-
19885
-
19886
- /**
19887
- * Method to update the id and class of the Youtube Player iframe.
19888
- * React should update this automatically but since the Youtube Player API
19889
- * replaced the DIV that is mounted by React we need to do this manually.
19890
- */
19891
-
19892
-
19893
- /**
19894
- * Call Youtube Player API methods to update the currently playing video.
19895
- * Depeding on the `opts.playerVars.autoplay` this function uses one of two
19896
- * Youtube Player API methods to update the video.
19875
+ /**
19876
+ * https://developers.google.com/youtube/iframe_api_reference#onReady
19877
+ *
19878
+ * @param {Object} event
19879
+ * @param {Object} target - player object
19897
19880
  */
19898
19881
 
19899
19882
  }, {
19900
- key: 'render',
19883
+ key: "render",
19901
19884
  value: function render() {
19902
- return React__default.createElement(
19903
- 'div',
19904
- { className: this.props.containerClassName },
19905
- React__default.createElement('div', { id: this.props.id, className: this.props.className, ref: this.refContainer })
19906
- );
19885
+ return /*#__PURE__*/React__default.createElement("div", {
19886
+ className: this.props.containerClassName
19887
+ }, /*#__PURE__*/React__default.createElement("div", {
19888
+ id: this.props.id,
19889
+ className: this.props.className,
19890
+ ref: this.refContainer
19891
+ }));
19907
19892
  }
19908
19893
  }]);
19909
19894
 
19910
19895
  return YouTube;
19911
19896
  }(React__default.Component);
19912
19897
 
19898
+ _defineProperty(YouTube, "PlayerState", {
19899
+ UNSTARTED: -1,
19900
+ ENDED: 0,
19901
+ PLAYING: 1,
19902
+ PAUSED: 2,
19903
+ BUFFERING: 3,
19904
+ CUED: 5
19905
+ });
19906
+
19913
19907
  YouTube.propTypes = {
19914
19908
  videoId: PropTypes.string,
19915
-
19916
19909
  // custom ID for player element
19917
19910
  id: PropTypes.string,
19918
-
19919
19911
  // custom class name for player element
19920
19912
  className: PropTypes.string,
19921
19913
  // custom class name for player container element
19922
19914
  containerClassName: PropTypes.string,
19923
-
19924
19915
  // https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
19925
19916
  opts: PropTypes.objectOf(PropTypes.any),
19926
-
19927
19917
  // event subscriptions
19928
19918
  onReady: PropTypes.func,
19929
19919
  onError: PropTypes.func,
@@ -19935,6 +19925,7 @@ YouTube.propTypes = {
19935
19925
  onPlaybackQualityChange: PropTypes.func
19936
19926
  };
19937
19927
  YouTube.defaultProps = {
19928
+ videoId: null,
19938
19929
  id: null,
19939
19930
  className: null,
19940
19931
  opts: {},
@@ -19948,14 +19939,6 @@ YouTube.defaultProps = {
19948
19939
  onPlaybackRateChange: function onPlaybackRateChange() {},
19949
19940
  onPlaybackQualityChange: function onPlaybackQualityChange() {}
19950
19941
  };
19951
- YouTube.PlayerState = {
19952
- UNSTARTED: -1,
19953
- ENDED: 0,
19954
- PLAYING: 1,
19955
- PAUSED: 2,
19956
- BUFFERING: 3,
19957
- CUED: 5
19958
- };
19959
19942
 
19960
19943
  var YouTubePlayer$1 = function YouTubePlayer(_ref) {
19961
19944
  var url = _ref.url;
@@ -20617,7 +20600,7 @@ function checksum(str) {
20617
20600
  return hash;
20618
20601
  }
20619
20602
 
20620
- function _typeof$1(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
20603
+ function _typeof$2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
20621
20604
 
20622
20605
 
20623
20606
 
@@ -20628,7 +20611,7 @@ var isDefined = function isDefined(val) {
20628
20611
 
20629
20612
  var mergeSerializers = function mergeSerializers(defaultSerializers, userSerializers) {
20630
20613
  return Object.keys(defaultSerializers).reduce(function (acc, key) {
20631
- var type = _typeof$1(defaultSerializers[key]);
20614
+ var type = _typeof$2(defaultSerializers[key]);
20632
20615
 
20633
20616
  if (type === 'function') {
20634
20617
  acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
@@ -21801,8 +21784,8 @@ var window_1 = win;
21801
21784
 
21802
21785
  /*! @name @brightcove/react-player-loader @version 1.4.0 @license Apache-2.0 */
21803
21786
 
21804
- function _extends$2() {
21805
- _extends$2 = Object.assign || function (target) {
21787
+ function _extends$1() {
21788
+ _extends$1 = Object.assign || function (target) {
21806
21789
  for (var i = 1; i < arguments.length; i++) {
21807
21790
  var source = arguments[i];
21808
21791
 
@@ -21816,7 +21799,7 @@ function _extends$2() {
21816
21799
  return target;
21817
21800
  };
21818
21801
 
21819
- return _extends$2.apply(this, arguments);
21802
+ return _extends$1.apply(this, arguments);
21820
21803
  }
21821
21804
 
21822
21805
  function _inheritsLoose(subClass, superClass) {
@@ -21825,7 +21808,7 @@ function _inheritsLoose(subClass, superClass) {
21825
21808
  subClass.__proto__ = superClass;
21826
21809
  }
21827
21810
 
21828
- function _assertThisInitialized(self) {
21811
+ function _assertThisInitialized$1(self) {
21829
21812
  if (self === void 0) {
21830
21813
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
21831
21814
  }
@@ -21858,7 +21841,7 @@ var version$1 = "1.7.1";
21858
21841
  /*! @name @brightcove/player-url @version 1.2.0 @license Apache-2.0 */
21859
21842
  var version$1$1 = "1.2.0";
21860
21843
 
21861
- var _typeof$2 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
21844
+ var _typeof$3 = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) {
21862
21845
  return typeof obj;
21863
21846
  } : function (obj) {
21864
21847
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
@@ -21993,7 +21976,7 @@ var brightcovePlayerUrl = function brightcovePlayerUrl(_ref) {
21993
21976
 
21994
21977
  var qs = '';
21995
21978
 
21996
- if (iframe && queryParams && (typeof queryParams === 'undefined' ? 'undefined' : _typeof$2(queryParams)) === 'object') {
21979
+ if (iframe && queryParams && (typeof queryParams === 'undefined' ? 'undefined' : _typeof$3(queryParams)) === 'object') {
21997
21980
  qs = getQueryString$1(queryParams);
21998
21981
  }
21999
21982
 
@@ -23054,7 +23037,7 @@ function (_React$Component) {
23054
23037
  _this.refNode = ref;
23055
23038
  };
23056
23039
 
23057
- _this.loadPlayer = _this.loadPlayer.bind(_assertThisInitialized(_this));
23040
+ _this.loadPlayer = _this.loadPlayer.bind(_assertThisInitialized$1(_this));
23058
23041
  return _this;
23059
23042
  }
23060
23043
  /**
@@ -23075,7 +23058,7 @@ function (_React$Component) {
23075
23058
  var userSuccess = this.props.onSuccess;
23076
23059
  var userFailure = this.props.onFailure;
23077
23060
 
23078
- var options = _extends$2({}, this.props, {
23061
+ var options = _extends$1({}, this.props, {
23079
23062
  refNode: this.refNode,
23080
23063
  refNodeInsert: 'append',
23081
23064
  onSuccess: function onSuccess(_ref) {
@@ -23384,7 +23367,7 @@ function (_React$Component) {
23384
23367
  ;
23385
23368
 
23386
23369
  _proto.render = function render() {
23387
- var props = _extends$2({
23370
+ var props = _extends$1({
23388
23371
  className: 'brightcove-react-player-loader'
23389
23372
  }, this.props.attrs, {
23390
23373
  ref: this.setRefNode
@@ -28482,7 +28465,7 @@ var Slideshow$1 = function Slideshow(_ref) {
28482
28465
  { className: 'p-2' },
28483
28466
  slide.slideshowImage.caption && React__default.createElement(
28484
28467
  'h3',
28485
- null,
28468
+ { style: { padding: '0px' } },
28486
28469
  slide.slideshowImage.caption
28487
28470
  ),
28488
28471
  slide.description && React__default.createElement(BlockContent, { blocks: slide.description, serializers: getSerializers$1(serializerArguments) })
@@ -28841,7 +28824,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
28841
28824
  React__default.createElement(
28842
28825
  Breadcrumb.Item,
28843
28826
  { active: true },
28844
- currentPath
28827
+ currentPath.indexOf('?page') !== -1 ? currentPath.slice(NaN, currentPath.indexOf('?page')) : currentPath
28845
28828
  ),
28846
28829
  React__default.createElement(
28847
28830
  'style',