@mjhls/mjh-framework 1.0.192 → 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) {
@@ -17234,22 +17251,27 @@ var FigureComponent = function FigureComponent(_ref) {
17234
17251
  null,
17235
17252
  React__default.createElement(
17236
17253
  Figure,
17237
- {
17238
- className: 'd-block',
17239
- style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imgFloat, margin: figureMargin },
17240
- onClick: function onClick() {
17241
- setOpenImgSrc(urlFor$1(node$$1, client).url());
17242
- setOpenImg(true);
17243
- } },
17254
+ { className: 'd-block', style: { width: imageWidth, maxWidth: '100%', clear: 'both', float: imgFloat, margin: figureMargin } },
17244
17255
  link ? React__default.createElement(
17245
17256
  'a',
17246
- { target: blank ? '_blank' : '_self' },
17257
+ { target: blank ? '_blank' : '_self', href: link },
17247
17258
  React__default.createElement(Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
17248
17259
  caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
17249
17260
  ) : React__default.createElement(
17250
17261
  React__default.Fragment,
17251
17262
  null,
17252
- React__default.createElement(Figure.Image, { style: { width: '100%' }, className: 'figure-image', ref: imgElement, onLoad: loadImg, src: urlFor$1(node$$1, client).url(), alt: alt && alt }),
17263
+ React__default.createElement(Figure.Image, {
17264
+ style: { width: '100%' },
17265
+ className: 'figure-image',
17266
+ ref: imgElement,
17267
+ onLoad: loadImg,
17268
+ src: urlFor$1(node$$1, client).url(),
17269
+ alt: alt && alt,
17270
+ onClick: function onClick() {
17271
+ setOpenImgSrc(urlFor$1(node$$1, client).url());
17272
+ setOpenImg(true);
17273
+ }
17274
+ }),
17253
17275
  caption && React__default.createElement('div', { dangerouslySetInnerHTML: { __html: '<span class=\'figure-caption\'>' + caption + '</span>' } })
17254
17276
  )
17255
17277
  ),
@@ -17336,21 +17358,18 @@ var Slideshow = function Slideshow(_ref) {
17336
17358
  );
17337
17359
  };
17338
17360
 
17339
- var isArray$1 = Array.isArray;
17340
- var keyList = Object.keys;
17341
- var hasProp = Object.prototype.hasOwnProperty;
17361
+ // do not edit .js files directly - edit src/index.jst
17362
+
17363
+
17342
17364
 
17343
17365
  var fastDeepEqual = function equal(a, b) {
17344
17366
  if (a === b) return true;
17345
17367
 
17346
17368
  if (a && b && typeof a == 'object' && typeof b == 'object') {
17347
- var arrA = isArray$1(a)
17348
- , arrB = isArray$1(b)
17349
- , i
17350
- , length
17351
- , key;
17369
+ if (a.constructor !== b.constructor) return false;
17352
17370
 
17353
- if (arrA && arrB) {
17371
+ var length, i, keys;
17372
+ if (Array.isArray(a)) {
17354
17373
  length = a.length;
17355
17374
  if (length != b.length) return false;
17356
17375
  for (i = length; i-- !== 0;)
@@ -17358,35 +17377,29 @@ var fastDeepEqual = function equal(a, b) {
17358
17377
  return true;
17359
17378
  }
17360
17379
 
17361
- if (arrA != arrB) return false;
17362
17380
 
17363
- var dateA = a instanceof Date
17364
- , dateB = b instanceof Date;
17365
- if (dateA != dateB) return false;
17366
- if (dateA && dateB) return a.getTime() == b.getTime();
17367
17381
 
17368
- var regexpA = a instanceof RegExp
17369
- , regexpB = b instanceof RegExp;
17370
- if (regexpA != regexpB) return false;
17371
- 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();
17372
17385
 
17373
- var keys = keyList(a);
17386
+ keys = Object.keys(a);
17374
17387
  length = keys.length;
17375
-
17376
- if (length !== keyList(b).length)
17377
- return false;
17388
+ if (length !== Object.keys(b).length) return false;
17378
17389
 
17379
17390
  for (i = length; i-- !== 0;)
17380
- if (!hasProp.call(b, keys[i])) return false;
17391
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
17381
17392
 
17382
17393
  for (i = length; i-- !== 0;) {
17383
- key = keys[i];
17394
+ var key = keys[i];
17395
+
17384
17396
  if (!equal(a[key], b[key])) return false;
17385
17397
  }
17386
17398
 
17387
17399
  return true;
17388
17400
  }
17389
17401
 
17402
+ // true if both NaN, false otherwise
17390
17403
  return a!==a && b!==b;
17391
17404
  };
17392
17405
 
@@ -18631,7 +18644,7 @@ function formatValue(ctx, value, recurseTimes) {
18631
18644
  var base = '', array = false, braces = ['{', '}'];
18632
18645
 
18633
18646
  // Make Array say that they are Array
18634
- if (isArray$2(value)) {
18647
+ if (isArray$1(value)) {
18635
18648
  array = true;
18636
18649
  braces = ['[', ']'];
18637
18650
  }
@@ -18810,7 +18823,7 @@ function reduceToSingleString(output, base, braces) {
18810
18823
 
18811
18824
  // NOTE: These type checking functions intentionally don't use `instanceof`
18812
18825
  // because it is fragile and can be easily faked with `Object.create()`.
18813
- function isArray$2(ar) {
18826
+ function isArray$1(ar) {
18814
18827
  return Array.isArray(ar);
18815
18828
  }
18816
18829
 
@@ -18937,7 +18950,7 @@ var util = {
18937
18950
  isNullOrUndefined: isNullOrUndefined,
18938
18951
  isNull: isNull,
18939
18952
  isBoolean: isBoolean,
18940
- isArray: isArray$2,
18953
+ isArray: isArray$1,
18941
18954
  inspect: inspect,
18942
18955
  deprecate: deprecate,
18943
18956
  format: format,
@@ -19604,201 +19617,237 @@ module.exports = exports['default'];
19604
19617
 
19605
19618
  var youTubePlayer = unwrapExports(dist);
19606
19619
 
19607
- 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; }; }();
19608
-
19609
- 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); }
19610
19621
 
19611
19622
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19612
19623
 
19613
- 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; }
19614
19633
 
19615
- 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; }
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); }
19616
19637
 
19617
- /**
19618
- * Check whether a `props` change should result in the video being updated.
19619
- *
19620
- * @param {Object} prevProps
19621
- * @param {Object} props
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; }
19643
+
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; }
19645
+
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
19622
19652
  */
19653
+
19623
19654
  function shouldUpdateVideo(prevProps, props) {
19624
19655
  // A changing video should always trigger an update
19625
19656
  if (prevProps.videoId !== props.videoId) {
19626
19657
  return true;
19627
- }
19628
-
19629
- // 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
19630
19659
  // update.
19660
+
19661
+
19631
19662
  var prevVars = prevProps.opts.playerVars || {};
19632
19663
  var vars = props.opts.playerVars || {};
19633
-
19634
19664
  return prevVars.start !== vars.start || prevVars.end !== vars.end;
19635
19665
  }
19636
-
19637
- /**
19638
- * Neutralise API options that only require a video update, leaving only options
19639
- * that require a player reset. The results can then be compared to see if a
19640
- * player reset is necessary.
19641
- *
19642
- * @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
19643
19672
  */
19673
+
19674
+
19644
19675
  function filterResetOptions(opts) {
19645
- return _extends$1({}, opts, {
19646
- playerVars: _extends$1({}, opts.playerVars, {
19676
+ return _objectSpread({}, opts, {
19677
+ playerVars: _objectSpread({}, opts.playerVars, {
19647
19678
  autoplay: 0,
19648
19679
  start: 0,
19649
19680
  end: 0
19650
19681
  })
19651
19682
  });
19652
19683
  }
19653
-
19654
- /**
19655
- * Check whether a `props` change should result in the player being reset.
19656
- * The player is reset when the `props.opts` change, except if the only change
19657
- * is in the `start` and `end` playerVars, because a video update can deal with
19658
- * those.
19659
- *
19660
- * @param {Object} prevProps
19661
- * @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
19662
19692
  */
19693
+
19694
+
19663
19695
  function shouldResetPlayer(prevProps, props) {
19664
19696
  return !fastDeepEqual(filterResetOptions(prevProps.opts), filterResetOptions(props.opts));
19665
19697
  }
19666
-
19667
- /**
19668
- * Check whether a props change should result in an id or className update.
19669
- *
19670
- * @param {Object} prevProps
19671
- * @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
19672
19703
  */
19704
+
19705
+
19673
19706
  function shouldUpdatePlayer(prevProps, props) {
19674
19707
  return prevProps.id !== props.id || prevProps.className !== props.className;
19675
19708
  }
19676
19709
 
19677
- var YouTube = function (_React$Component) {
19710
+ var YouTube = /*#__PURE__*/function (_React$Component) {
19678
19711
  _inherits(YouTube, _React$Component);
19679
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
+ */
19680
19720
  function YouTube(props) {
19721
+ var _this;
19722
+
19681
19723
  _classCallCheck(this, YouTube);
19682
19724
 
19683
- var _this = _possibleConstructorReturn(this, (YouTube.__proto__ || Object.getPrototypeOf(YouTube)).call(this, props));
19725
+ _this = _super.call(this, props);
19684
19726
 
19685
- _this.onPlayerReady = function (event) {
19727
+ _defineProperty(_assertThisInitialized(_this), "onPlayerReady", function (event) {
19686
19728
  return _this.props.onReady(event);
19687
- };
19729
+ });
19688
19730
 
19689
- _this.onPlayerError = function (event) {
19731
+ _defineProperty(_assertThisInitialized(_this), "onPlayerError", function (event) {
19690
19732
  return _this.props.onError(event);
19691
- };
19733
+ });
19692
19734
 
19693
- _this.onPlayerStateChange = function (event) {
19735
+ _defineProperty(_assertThisInitialized(_this), "onPlayerStateChange", function (event) {
19694
19736
  _this.props.onStateChange(event);
19695
- switch (event.data) {
19696
19737
 
19738
+ switch (event.data) {
19697
19739
  case YouTube.PlayerState.ENDED:
19698
19740
  _this.props.onEnd(event);
19741
+
19699
19742
  break;
19700
19743
 
19701
19744
  case YouTube.PlayerState.PLAYING:
19702
19745
  _this.props.onPlay(event);
19746
+
19703
19747
  break;
19704
19748
 
19705
19749
  case YouTube.PlayerState.PAUSED:
19706
19750
  _this.props.onPause(event);
19751
+
19707
19752
  break;
19708
19753
 
19709
19754
  default:
19710
19755
  }
19711
- };
19756
+ });
19712
19757
 
19713
- _this.onPlayerPlaybackRateChange = function (event) {
19758
+ _defineProperty(_assertThisInitialized(_this), "onPlayerPlaybackRateChange", function (event) {
19714
19759
  return _this.props.onPlaybackRateChange(event);
19715
- };
19760
+ });
19716
19761
 
19717
- _this.onPlayerPlaybackQualityChange = function (event) {
19762
+ _defineProperty(_assertThisInitialized(_this), "onPlayerPlaybackQualityChange", function (event) {
19718
19763
  return _this.props.onPlaybackQualityChange(event);
19719
- };
19764
+ });
19720
19765
 
19721
- _this.createPlayer = function () {
19766
+ _defineProperty(_assertThisInitialized(_this), "createPlayer", function () {
19722
19767
  // do not attempt to create a player server-side, it won't work
19723
- if (typeof document === 'undefined') return;
19724
- // create player
19725
- var playerOpts = _extends$1({}, _this.props.opts, {
19768
+ if (typeof document === 'undefined') return; // create player
19769
+
19770
+ var playerOpts = _objectSpread({}, _this.props.opts, {
19726
19771
  // preload the `videoId` video if one is already given
19727
19772
  videoId: _this.props.videoId
19728
19773
  });
19729
- _this.internalPlayer = youTubePlayer(_this.container, playerOpts);
19730
- // attach event handlers
19774
+
19775
+ _this.internalPlayer = youTubePlayer(_this.container, playerOpts); // attach event handlers
19776
+
19731
19777
  _this.internalPlayer.on('ready', _this.onPlayerReady);
19778
+
19732
19779
  _this.internalPlayer.on('error', _this.onPlayerError);
19780
+
19733
19781
  _this.internalPlayer.on('stateChange', _this.onPlayerStateChange);
19782
+
19734
19783
  _this.internalPlayer.on('playbackRateChange', _this.onPlayerPlaybackRateChange);
19784
+
19735
19785
  _this.internalPlayer.on('playbackQualityChange', _this.onPlayerPlaybackQualityChange);
19736
- };
19786
+ });
19737
19787
 
19738
- _this.resetPlayer = function () {
19788
+ _defineProperty(_assertThisInitialized(_this), "resetPlayer", function () {
19739
19789
  return _this.internalPlayer.destroy().then(_this.createPlayer);
19740
- };
19790
+ });
19741
19791
 
19742
- _this.updatePlayer = function () {
19792
+ _defineProperty(_assertThisInitialized(_this), "updatePlayer", function () {
19743
19793
  _this.internalPlayer.getIframe().then(function (iframe) {
19744
19794
  if (_this.props.id) iframe.setAttribute('id', _this.props.id);else iframe.removeAttribute('id');
19745
19795
  if (_this.props.className) iframe.setAttribute('class', _this.props.className);else iframe.removeAttribute('class');
19746
19796
  });
19747
- };
19797
+ });
19748
19798
 
19749
- _this.updateVideo = function () {
19799
+ _defineProperty(_assertThisInitialized(_this), "updateVideo", function () {
19750
19800
  if (typeof _this.props.videoId === 'undefined' || _this.props.videoId === null) {
19751
19801
  _this.internalPlayer.stopVideo();
19802
+
19752
19803
  return;
19753
- }
19804
+ } // set queueing options
19805
+
19754
19806
 
19755
- // set queueing options
19756
19807
  var autoplay = false;
19757
19808
  var opts = {
19758
19809
  videoId: _this.props.videoId
19759
19810
  };
19811
+
19760
19812
  if ('playerVars' in _this.props.opts) {
19761
19813
  autoplay = _this.props.opts.playerVars.autoplay === 1;
19814
+
19762
19815
  if ('start' in _this.props.opts.playerVars) {
19763
19816
  opts.startSeconds = _this.props.opts.playerVars.start;
19764
19817
  }
19818
+
19765
19819
  if ('end' in _this.props.opts.playerVars) {
19766
19820
  opts.endSeconds = _this.props.opts.playerVars.end;
19767
19821
  }
19768
- }
19822
+ } // if autoplay is enabled loadVideoById
19823
+
19769
19824
 
19770
- // if autoplay is enabled loadVideoById
19771
19825
  if (autoplay) {
19772
19826
  _this.internalPlayer.loadVideoById(opts);
19827
+
19773
19828
  return;
19774
- }
19775
- // default behaviour just cues the video
19829
+ } // default behaviour just cues the video
19830
+
19831
+
19776
19832
  _this.internalPlayer.cueVideoById(opts);
19777
- };
19833
+ });
19778
19834
 
19779
- _this.refContainer = function (container) {
19835
+ _defineProperty(_assertThisInitialized(_this), "refContainer", function (container) {
19780
19836
  _this.container = container;
19781
- };
19837
+ });
19782
19838
 
19783
19839
  _this.container = null;
19784
19840
  _this.internalPlayer = null;
19785
19841
  return _this;
19786
19842
  }
19787
19843
 
19788
- /**
19789
- * Expose PlayerState constants for convenience. These constants can also be
19790
- * accessed through the global YT object after the YouTube IFrame API is instantiated.
19791
- * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19792
- */
19793
-
19794
-
19795
19844
  _createClass(YouTube, [{
19796
- key: 'componentDidMount',
19845
+ key: "componentDidMount",
19797
19846
  value: function componentDidMount() {
19798
19847
  this.createPlayer();
19799
19848
  }
19800
19849
  }, {
19801
- key: 'componentDidUpdate',
19850
+ key: "componentDidUpdate",
19802
19851
  value: function componentDidUpdate(prevProps) {
19803
19852
  if (shouldUpdatePlayer(prevProps, this.props)) {
19804
19853
  this.updatePlayer();
@@ -19813,112 +19862,58 @@ var YouTube = function (_React$Component) {
19813
19862
  }
19814
19863
  }
19815
19864
  }, {
19816
- key: 'componentWillUnmount',
19865
+ key: "componentWillUnmount",
19817
19866
  value: function componentWillUnmount() {
19818
- /**
19819
- * Note: The `youtube-player` package that is used promisifies all Youtube
19820
- * Player API calls, which introduces a delay of a tick before it actually
19821
- * gets destroyed. Since React attempts to remove the element instantly
19822
- * 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.
19823
19872
  */
19824
19873
  this.internalPlayer.destroy();
19825
19874
  }
19826
-
19827
- /**
19828
- * https://developers.google.com/youtube/iframe_api_reference#onReady
19829
- *
19830
- * @param {Object} event
19831
- * @param {Object} target - player object
19832
- */
19833
-
19834
-
19835
- /**
19836
- * https://developers.google.com/youtube/iframe_api_reference#onError
19837
- *
19838
- * @param {Object} event
19839
- * @param {Integer} data - error type
19840
- * @param {Object} target - player object
19841
- */
19842
-
19843
-
19844
- /**
19845
- * https://developers.google.com/youtube/iframe_api_reference#onStateChange
19846
- *
19847
- * @param {Object} event
19848
- * @param {Integer} data - status change type
19849
- * @param {Object} target - actual YT player
19850
- */
19851
-
19852
-
19853
- /**
19854
- * https://developers.google.com/youtube/iframe_api_reference#onPlaybackRateChange
19855
- *
19856
- * @param {Object} event
19857
- * @param {Float} data - playback rate
19858
- * @param {Object} target - actual YT player
19859
- */
19860
-
19861
-
19862
- /**
19863
- * https://developers.google.com/youtube/iframe_api_reference#onPlaybackQualityChange
19864
- *
19865
- * @param {Object} event
19866
- * @param {String} data - playback quality
19867
- * @param {Object} target - actual YT player
19868
- */
19869
-
19870
-
19871
- /**
19872
- * Initialize the Youtube Player API on the container and attach event handlers
19873
- */
19874
-
19875
-
19876
- /**
19877
- * Shorthand for destroying and then re-creating the Youtube Player
19878
- */
19879
-
19880
-
19881
- /**
19882
- * Method to update the id and class of the Youtube Player iframe.
19883
- * React should update this automatically but since the Youtube Player API
19884
- * replaced the DIV that is mounted by React we need to do this manually.
19885
- */
19886
-
19887
-
19888
- /**
19889
- * Call Youtube Player API methods to update the currently playing video.
19890
- * Depeding on the `opts.playerVars.autoplay` this function uses one of two
19891
- * 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
19892
19880
  */
19893
19881
 
19894
19882
  }, {
19895
- key: 'render',
19883
+ key: "render",
19896
19884
  value: function render() {
19897
- return React__default.createElement(
19898
- 'div',
19899
- { className: this.props.containerClassName },
19900
- React__default.createElement('div', { id: this.props.id, className: this.props.className, ref: this.refContainer })
19901
- );
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
+ }));
19902
19892
  }
19903
19893
  }]);
19904
19894
 
19905
19895
  return YouTube;
19906
19896
  }(React__default.Component);
19907
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
+
19908
19907
  YouTube.propTypes = {
19909
19908
  videoId: PropTypes.string,
19910
-
19911
19909
  // custom ID for player element
19912
19910
  id: PropTypes.string,
19913
-
19914
19911
  // custom class name for player element
19915
19912
  className: PropTypes.string,
19916
19913
  // custom class name for player container element
19917
19914
  containerClassName: PropTypes.string,
19918
-
19919
19915
  // https://developers.google.com/youtube/iframe_api_reference#Loading_a_Video_Player
19920
19916
  opts: PropTypes.objectOf(PropTypes.any),
19921
-
19922
19917
  // event subscriptions
19923
19918
  onReady: PropTypes.func,
19924
19919
  onError: PropTypes.func,
@@ -19930,6 +19925,7 @@ YouTube.propTypes = {
19930
19925
  onPlaybackQualityChange: PropTypes.func
19931
19926
  };
19932
19927
  YouTube.defaultProps = {
19928
+ videoId: null,
19933
19929
  id: null,
19934
19930
  className: null,
19935
19931
  opts: {},
@@ -19943,14 +19939,6 @@ YouTube.defaultProps = {
19943
19939
  onPlaybackRateChange: function onPlaybackRateChange() {},
19944
19940
  onPlaybackQualityChange: function onPlaybackQualityChange() {}
19945
19941
  };
19946
- YouTube.PlayerState = {
19947
- UNSTARTED: -1,
19948
- ENDED: 0,
19949
- PLAYING: 1,
19950
- PAUSED: 2,
19951
- BUFFERING: 3,
19952
- CUED: 5
19953
- };
19954
19942
 
19955
19943
  var YouTubePlayer$1 = function YouTubePlayer(_ref) {
19956
19944
  var url = _ref.url;
@@ -20612,7 +20600,7 @@ function checksum(str) {
20612
20600
  return hash;
20613
20601
  }
20614
20602
 
20615
- 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); }
20616
20604
 
20617
20605
 
20618
20606
 
@@ -20623,7 +20611,7 @@ var isDefined = function isDefined(val) {
20623
20611
 
20624
20612
  var mergeSerializers = function mergeSerializers(defaultSerializers, userSerializers) {
20625
20613
  return Object.keys(defaultSerializers).reduce(function (acc, key) {
20626
- var type = _typeof$1(defaultSerializers[key]);
20614
+ var type = _typeof$2(defaultSerializers[key]);
20627
20615
 
20628
20616
  if (type === 'function') {
20629
20617
  acc[key] = isDefined(userSerializers[key]) ? userSerializers[key] : defaultSerializers[key];
@@ -21796,8 +21784,8 @@ var window_1 = win;
21796
21784
 
21797
21785
  /*! @name @brightcove/react-player-loader @version 1.4.0 @license Apache-2.0 */
21798
21786
 
21799
- function _extends$2() {
21800
- _extends$2 = Object.assign || function (target) {
21787
+ function _extends$1() {
21788
+ _extends$1 = Object.assign || function (target) {
21801
21789
  for (var i = 1; i < arguments.length; i++) {
21802
21790
  var source = arguments[i];
21803
21791
 
@@ -21811,7 +21799,7 @@ function _extends$2() {
21811
21799
  return target;
21812
21800
  };
21813
21801
 
21814
- return _extends$2.apply(this, arguments);
21802
+ return _extends$1.apply(this, arguments);
21815
21803
  }
21816
21804
 
21817
21805
  function _inheritsLoose(subClass, superClass) {
@@ -21820,7 +21808,7 @@ function _inheritsLoose(subClass, superClass) {
21820
21808
  subClass.__proto__ = superClass;
21821
21809
  }
21822
21810
 
21823
- function _assertThisInitialized(self) {
21811
+ function _assertThisInitialized$1(self) {
21824
21812
  if (self === void 0) {
21825
21813
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
21826
21814
  }
@@ -21853,7 +21841,7 @@ var version$1 = "1.7.1";
21853
21841
  /*! @name @brightcove/player-url @version 1.2.0 @license Apache-2.0 */
21854
21842
  var version$1$1 = "1.2.0";
21855
21843
 
21856
- 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) {
21857
21845
  return typeof obj;
21858
21846
  } : function (obj) {
21859
21847
  return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
@@ -21988,7 +21976,7 @@ var brightcovePlayerUrl = function brightcovePlayerUrl(_ref) {
21988
21976
 
21989
21977
  var qs = '';
21990
21978
 
21991
- if (iframe && queryParams && (typeof queryParams === 'undefined' ? 'undefined' : _typeof$2(queryParams)) === 'object') {
21979
+ if (iframe && queryParams && (typeof queryParams === 'undefined' ? 'undefined' : _typeof$3(queryParams)) === 'object') {
21992
21980
  qs = getQueryString$1(queryParams);
21993
21981
  }
21994
21982
 
@@ -23049,7 +23037,7 @@ function (_React$Component) {
23049
23037
  _this.refNode = ref;
23050
23038
  };
23051
23039
 
23052
- _this.loadPlayer = _this.loadPlayer.bind(_assertThisInitialized(_this));
23040
+ _this.loadPlayer = _this.loadPlayer.bind(_assertThisInitialized$1(_this));
23053
23041
  return _this;
23054
23042
  }
23055
23043
  /**
@@ -23070,7 +23058,7 @@ function (_React$Component) {
23070
23058
  var userSuccess = this.props.onSuccess;
23071
23059
  var userFailure = this.props.onFailure;
23072
23060
 
23073
- var options = _extends$2({}, this.props, {
23061
+ var options = _extends$1({}, this.props, {
23074
23062
  refNode: this.refNode,
23075
23063
  refNodeInsert: 'append',
23076
23064
  onSuccess: function onSuccess(_ref) {
@@ -23379,7 +23367,7 @@ function (_React$Component) {
23379
23367
  ;
23380
23368
 
23381
23369
  _proto.render = function render() {
23382
- var props = _extends$2({
23370
+ var props = _extends$1({
23383
23371
  className: 'brightcove-react-player-loader'
23384
23372
  }, this.props.attrs, {
23385
23373
  ref: this.setRefNode
@@ -28477,7 +28465,7 @@ var Slideshow$1 = function Slideshow(_ref) {
28477
28465
  { className: 'p-2' },
28478
28466
  slide.slideshowImage.caption && React__default.createElement(
28479
28467
  'h3',
28480
- null,
28468
+ { style: { padding: '0px' } },
28481
28469
  slide.slideshowImage.caption
28482
28470
  ),
28483
28471
  slide.description && React__default.createElement(BlockContent, { blocks: slide.description, serializers: getSerializers$1(serializerArguments) })
@@ -28836,7 +28824,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
28836
28824
  React__default.createElement(
28837
28825
  Breadcrumb.Item,
28838
28826
  { active: true },
28839
- currentPath
28827
+ currentPath.indexOf('?page') !== -1 ? currentPath.slice(NaN, currentPath.indexOf('?page')) : currentPath
28840
28828
  ),
28841
28829
  React__default.createElement(
28842
28830
  'style',