@bigbinary/neeto-site-blocks 1.2.11 → 1.3.0

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.cjs.js CHANGED
@@ -15533,6 +15533,29 @@ var Media = function Media(_ref) {
15533
15533
  }, otherProps));
15534
15534
  };
15535
15535
 
15536
+ var PageNavigation = function PageNavigation(_ref) {
15537
+ var Icon = _ref.Icon,
15538
+ isStart = _ref.isStart,
15539
+ onClick = _ref.onClick,
15540
+ _ref$className = _ref.className,
15541
+ className = _ref$className === void 0 ? "" : _ref$className;
15542
+ var StyledIcon = styled__default["default"](Icon)(function () {
15543
+ return {
15544
+ borderColor: "#1F2433"
15545
+ };
15546
+ });
15547
+ return /*#__PURE__*/React__default["default"].createElement("button", {
15548
+ onClick: onClick,
15549
+ className: classnames("col-span-1", {
15550
+ "col-start-1": isStart,
15551
+ "col-start-12 flex justify-end": !isStart
15552
+ }, className)
15553
+ }, /*#__PURE__*/React__default["default"].createElement(StyledIcon, {
15554
+ fill: "#66C1D4",
15555
+ size: 52
15556
+ }));
15557
+ };
15558
+
15536
15559
  var Pagination$1 = function Pagination(_ref) {
15537
15560
  var _classnames, _classnames2;
15538
15561
  var swiper = _ref.swiper,
@@ -16075,6 +16098,20 @@ function createElement(tag, classes) {
16075
16098
  el.classList.add(...(Array.isArray(classes) ? classes : [classes]));
16076
16099
  return el;
16077
16100
  }
16101
+ function elementOffset(el) {
16102
+ const window = getWindow();
16103
+ const document = getDocument();
16104
+ const box = el.getBoundingClientRect();
16105
+ const body = document.body;
16106
+ const clientTop = el.clientTop || body.clientTop || 0;
16107
+ const clientLeft = el.clientLeft || body.clientLeft || 0;
16108
+ const scrollTop = el === window ? window.scrollY : el.scrollTop;
16109
+ const scrollLeft = el === window ? window.scrollX : el.scrollLeft;
16110
+ return {
16111
+ top: box.top + scrollTop - clientTop,
16112
+ left: box.left + scrollLeft - clientLeft
16113
+ };
16114
+ }
16078
16115
  function elementPrevAll(el, selector) {
16079
16116
  const prevEls = [];
16080
16117
  while (el.previousElementSibling) {
@@ -23450,6 +23487,29 @@ function requireFollowRedirects () {
23450
23487
  var assert = require$$4__default["default"];
23451
23488
  var debug = requireDebug();
23452
23489
 
23490
+ // Whether to use the native URL object or the legacy url module
23491
+ var useNativeURL = false;
23492
+ try {
23493
+ assert(new URL());
23494
+ }
23495
+ catch (error) {
23496
+ useNativeURL = error.code === "ERR_INVALID_URL";
23497
+ }
23498
+
23499
+ // URL fields to preserve in copy operations
23500
+ var preservedUrlFields = [
23501
+ "auth",
23502
+ "host",
23503
+ "hostname",
23504
+ "href",
23505
+ "path",
23506
+ "pathname",
23507
+ "port",
23508
+ "protocol",
23509
+ "query",
23510
+ "search",
23511
+ ];
23512
+
23453
23513
  // Create handlers that pass events from native requests
23454
23514
  var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
23455
23515
  var eventHandlers = Object.create(null);
@@ -23459,19 +23519,20 @@ function requireFollowRedirects () {
23459
23519
  };
23460
23520
  });
23461
23521
 
23522
+ // Error types with codes
23462
23523
  var InvalidUrlError = createErrorType(
23463
23524
  "ERR_INVALID_URL",
23464
23525
  "Invalid URL",
23465
23526
  TypeError
23466
23527
  );
23467
- // Error types with codes
23468
23528
  var RedirectionError = createErrorType(
23469
23529
  "ERR_FR_REDIRECTION_FAILURE",
23470
23530
  "Redirected request failed"
23471
23531
  );
23472
23532
  var TooManyRedirectsError = createErrorType(
23473
23533
  "ERR_FR_TOO_MANY_REDIRECTS",
23474
- "Maximum number of redirects exceeded"
23534
+ "Maximum number of redirects exceeded",
23535
+ RedirectionError
23475
23536
  );
23476
23537
  var MaxBodyLengthExceededError = createErrorType(
23477
23538
  "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
@@ -23482,6 +23543,9 @@ function requireFollowRedirects () {
23482
23543
  "write after end"
23483
23544
  );
23484
23545
 
23546
+ // istanbul ignore next
23547
+ var destroy = Writable.prototype.destroy || noop;
23548
+
23485
23549
  // An HTTP(S) request that can be redirected
23486
23550
  function RedirectableRequest(options, responseCallback) {
23487
23551
  // Initialize the request
@@ -23503,7 +23567,13 @@ function requireFollowRedirects () {
23503
23567
  // React to responses of native requests
23504
23568
  var self = this;
23505
23569
  this._onNativeResponse = function (response) {
23506
- self._processResponse(response);
23570
+ try {
23571
+ self._processResponse(response);
23572
+ }
23573
+ catch (cause) {
23574
+ self.emit("error", cause instanceof RedirectionError ?
23575
+ cause : new RedirectionError({ cause: cause }));
23576
+ }
23507
23577
  };
23508
23578
 
23509
23579
  // Perform the first request
@@ -23512,10 +23582,17 @@ function requireFollowRedirects () {
23512
23582
  RedirectableRequest.prototype = Object.create(Writable.prototype);
23513
23583
 
23514
23584
  RedirectableRequest.prototype.abort = function () {
23515
- abortRequest(this._currentRequest);
23585
+ destroyRequest(this._currentRequest);
23586
+ this._currentRequest.abort();
23516
23587
  this.emit("abort");
23517
23588
  };
23518
23589
 
23590
+ RedirectableRequest.prototype.destroy = function (error) {
23591
+ destroyRequest(this._currentRequest, error);
23592
+ destroy.call(this, error);
23593
+ return this;
23594
+ };
23595
+
23519
23596
  // Writes buffered data to the current native request
23520
23597
  RedirectableRequest.prototype.write = function (data, encoding, callback) {
23521
23598
  // Writing is not allowed if end has been called
@@ -23628,6 +23705,7 @@ function requireFollowRedirects () {
23628
23705
  self.removeListener("abort", clearTimer);
23629
23706
  self.removeListener("error", clearTimer);
23630
23707
  self.removeListener("response", clearTimer);
23708
+ self.removeListener("close", clearTimer);
23631
23709
  if (callback) {
23632
23710
  self.removeListener("timeout", callback);
23633
23711
  }
@@ -23654,6 +23732,7 @@ function requireFollowRedirects () {
23654
23732
  this.on("abort", clearTimer);
23655
23733
  this.on("error", clearTimer);
23656
23734
  this.on("response", clearTimer);
23735
+ this.on("close", clearTimer);
23657
23736
 
23658
23737
  return this;
23659
23738
  };
@@ -23712,8 +23791,7 @@ function requireFollowRedirects () {
23712
23791
  var protocol = this._options.protocol;
23713
23792
  var nativeProtocol = this._options.nativeProtocols[protocol];
23714
23793
  if (!nativeProtocol) {
23715
- this.emit("error", new TypeError("Unsupported protocol " + protocol));
23716
- return;
23794
+ throw new TypeError("Unsupported protocol " + protocol);
23717
23795
  }
23718
23796
 
23719
23797
  // If specified, use the agent corresponding to the protocol
@@ -23805,15 +23883,14 @@ function requireFollowRedirects () {
23805
23883
  }
23806
23884
 
23807
23885
  // The response is a redirect, so abort the current request
23808
- abortRequest(this._currentRequest);
23886
+ destroyRequest(this._currentRequest);
23809
23887
  // Discard the remainder of the response to avoid waiting for data
23810
23888
  response.destroy();
23811
23889
 
23812
23890
  // RFC7231§6.4: A client SHOULD detect and intervene
23813
23891
  // in cyclical redirections (i.e., "infinite" redirection loops).
23814
23892
  if (++this._redirectCount > this._options.maxRedirects) {
23815
- this.emit("error", new TooManyRedirectsError());
23816
- return;
23893
+ throw new TooManyRedirectsError();
23817
23894
  }
23818
23895
 
23819
23896
  // Store the request headers if applicable
@@ -23847,33 +23924,23 @@ function requireFollowRedirects () {
23847
23924
  var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
23848
23925
 
23849
23926
  // If the redirect is relative, carry over the host of the last request
23850
- var currentUrlParts = url.parse(this._currentUrl);
23927
+ var currentUrlParts = parseUrl(this._currentUrl);
23851
23928
  var currentHost = currentHostHeader || currentUrlParts.host;
23852
23929
  var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
23853
23930
  url.format(Object.assign(currentUrlParts, { host: currentHost }));
23854
23931
 
23855
- // Determine the URL of the redirection
23856
- var redirectUrl;
23857
- try {
23858
- redirectUrl = url.resolve(currentUrl, location);
23859
- }
23860
- catch (cause) {
23861
- this.emit("error", new RedirectionError({ cause: cause }));
23862
- return;
23863
- }
23864
-
23865
23932
  // Create the redirected request
23866
- debug("redirecting to", redirectUrl);
23933
+ var redirectUrl = resolveUrl(location, currentUrl);
23934
+ debug("redirecting to", redirectUrl.href);
23867
23935
  this._isRedirect = true;
23868
- var redirectUrlParts = url.parse(redirectUrl);
23869
- Object.assign(this._options, redirectUrlParts);
23936
+ spreadUrlObject(redirectUrl, this._options);
23870
23937
 
23871
23938
  // Drop confidential headers when redirecting to a less secure protocol
23872
23939
  // or to a different domain that is not a superdomain
23873
- if (redirectUrlParts.protocol !== currentUrlParts.protocol &&
23874
- redirectUrlParts.protocol !== "https:" ||
23875
- redirectUrlParts.host !== currentHost &&
23876
- !isSubdomain(redirectUrlParts.host, currentHost)) {
23940
+ if (redirectUrl.protocol !== currentUrlParts.protocol &&
23941
+ redirectUrl.protocol !== "https:" ||
23942
+ redirectUrl.host !== currentHost &&
23943
+ !isSubdomain(redirectUrl.host, currentHost)) {
23877
23944
  removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
23878
23945
  }
23879
23946
 
@@ -23888,23 +23955,12 @@ function requireFollowRedirects () {
23888
23955
  method: method,
23889
23956
  headers: requestHeaders,
23890
23957
  };
23891
- try {
23892
- beforeRedirect(this._options, responseDetails, requestDetails);
23893
- }
23894
- catch (err) {
23895
- this.emit("error", err);
23896
- return;
23897
- }
23958
+ beforeRedirect(this._options, responseDetails, requestDetails);
23898
23959
  this._sanitizeOptions(this._options);
23899
23960
  }
23900
23961
 
23901
23962
  // Perform the redirected request
23902
- try {
23903
- this._performRequest();
23904
- }
23905
- catch (cause) {
23906
- this.emit("error", new RedirectionError({ cause: cause }));
23907
- }
23963
+ this._performRequest();
23908
23964
  };
23909
23965
 
23910
23966
  // Wraps the key/value object of protocols with redirect functionality
@@ -23924,27 +23980,16 @@ function requireFollowRedirects () {
23924
23980
 
23925
23981
  // Executes a request, following redirects
23926
23982
  function request(input, options, callback) {
23927
- // Parse parameters
23928
- if (isString(input)) {
23929
- var parsed;
23930
- try {
23931
- parsed = urlToOptions(new URL(input));
23932
- }
23933
- catch (err) {
23934
- /* istanbul ignore next */
23935
- parsed = url.parse(input);
23936
- }
23937
- if (!isString(parsed.protocol)) {
23938
- throw new InvalidUrlError({ input });
23939
- }
23940
- input = parsed;
23983
+ // Parse parameters, ensuring that input is an object
23984
+ if (isURL(input)) {
23985
+ input = spreadUrlObject(input);
23941
23986
  }
23942
- else if (URL && (input instanceof URL)) {
23943
- input = urlToOptions(input);
23987
+ else if (isString(input)) {
23988
+ input = spreadUrlObject(parseUrl(input));
23944
23989
  }
23945
23990
  else {
23946
23991
  callback = options;
23947
- options = input;
23992
+ options = validateUrl(input);
23948
23993
  input = { protocol: protocol };
23949
23994
  }
23950
23995
  if (isFunction(options)) {
@@ -23983,27 +24028,57 @@ function requireFollowRedirects () {
23983
24028
  return exports;
23984
24029
  }
23985
24030
 
23986
- /* istanbul ignore next */
23987
24031
  function noop() { /* empty */ }
23988
24032
 
23989
- // from https://github.com/nodejs/node/blob/master/lib/internal/url.js
23990
- function urlToOptions(urlObject) {
23991
- var options = {
23992
- protocol: urlObject.protocol,
23993
- hostname: urlObject.hostname.startsWith("[") ?
23994
- /* istanbul ignore next */
23995
- urlObject.hostname.slice(1, -1) :
23996
- urlObject.hostname,
23997
- hash: urlObject.hash,
23998
- search: urlObject.search,
23999
- pathname: urlObject.pathname,
24000
- path: urlObject.pathname + urlObject.search,
24001
- href: urlObject.href,
24002
- };
24003
- if (urlObject.port !== "") {
24004
- options.port = Number(urlObject.port);
24033
+ function parseUrl(input) {
24034
+ var parsed;
24035
+ /* istanbul ignore else */
24036
+ if (useNativeURL) {
24037
+ parsed = new URL(input);
24038
+ }
24039
+ else {
24040
+ // Ensure the URL is valid and absolute
24041
+ parsed = validateUrl(url.parse(input));
24042
+ if (!isString(parsed.protocol)) {
24043
+ throw new InvalidUrlError({ input });
24044
+ }
24045
+ }
24046
+ return parsed;
24047
+ }
24048
+
24049
+ function resolveUrl(relative, base) {
24050
+ /* istanbul ignore next */
24051
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
24052
+ }
24053
+
24054
+ function validateUrl(input) {
24055
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
24056
+ throw new InvalidUrlError({ input: input.href || input });
24005
24057
  }
24006
- return options;
24058
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
24059
+ throw new InvalidUrlError({ input: input.href || input });
24060
+ }
24061
+ return input;
24062
+ }
24063
+
24064
+ function spreadUrlObject(urlObject, target) {
24065
+ var spread = target || {};
24066
+ for (var key of preservedUrlFields) {
24067
+ spread[key] = urlObject[key];
24068
+ }
24069
+
24070
+ // Fix IPv6 hostname
24071
+ if (spread.hostname.startsWith("[")) {
24072
+ spread.hostname = spread.hostname.slice(1, -1);
24073
+ }
24074
+ // Ensure port is a number
24075
+ if (spread.port !== "") {
24076
+ spread.port = Number(spread.port);
24077
+ }
24078
+ // Concatenate path
24079
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
24080
+
24081
+ return spread;
24007
24082
  }
24008
24083
 
24009
24084
  function removeMatchingHeaders(regex, headers) {
@@ -24029,17 +24104,25 @@ function requireFollowRedirects () {
24029
24104
 
24030
24105
  // Attach constructor and set default properties
24031
24106
  CustomError.prototype = new (baseClass || Error)();
24032
- CustomError.prototype.constructor = CustomError;
24033
- CustomError.prototype.name = "Error [" + code + "]";
24107
+ Object.defineProperties(CustomError.prototype, {
24108
+ constructor: {
24109
+ value: CustomError,
24110
+ enumerable: false,
24111
+ },
24112
+ name: {
24113
+ value: "Error [" + code + "]",
24114
+ enumerable: false,
24115
+ },
24116
+ });
24034
24117
  return CustomError;
24035
24118
  }
24036
24119
 
24037
- function abortRequest(request) {
24120
+ function destroyRequest(request, error) {
24038
24121
  for (var event of events) {
24039
24122
  request.removeListener(event, eventHandlers[event]);
24040
24123
  }
24041
24124
  request.on("error", noop);
24042
- request.abort();
24125
+ request.destroy(error);
24043
24126
  }
24044
24127
 
24045
24128
  function isSubdomain(subdomain, domain) {
@@ -24060,6 +24143,10 @@ function requireFollowRedirects () {
24060
24143
  return typeof value === "object" && ("length" in value);
24061
24144
  }
24062
24145
 
24146
+ function isURL(value) {
24147
+ return URL && value instanceof URL;
24148
+ }
24149
+
24063
24150
  // Exports
24064
24151
  followRedirects.exports = wrap({ http: http, https: https });
24065
24152
  followRedirects.exports.wrap = wrap;
@@ -38799,6 +38886,119 @@ var FooterWithLinks = function FooterWithLinks(_ref) {
38799
38886
  }, copyrightText));
38800
38887
  };
38801
38888
 
38889
+ /* eslint-disable consistent-return */
38890
+ function Keyboard(_ref) {
38891
+ let {
38892
+ swiper,
38893
+ extendParams,
38894
+ on,
38895
+ emit
38896
+ } = _ref;
38897
+ const document = getDocument();
38898
+ const window = getWindow();
38899
+ swiper.keyboard = {
38900
+ enabled: false
38901
+ };
38902
+ extendParams({
38903
+ keyboard: {
38904
+ enabled: false,
38905
+ onlyInViewport: true,
38906
+ pageUpDown: true
38907
+ }
38908
+ });
38909
+ function handle(event) {
38910
+ if (!swiper.enabled) return;
38911
+ const {
38912
+ rtlTranslate: rtl
38913
+ } = swiper;
38914
+ let e = event;
38915
+ if (e.originalEvent) e = e.originalEvent; // jquery fix
38916
+ const kc = e.keyCode || e.charCode;
38917
+ const pageUpDown = swiper.params.keyboard.pageUpDown;
38918
+ const isPageUp = pageUpDown && kc === 33;
38919
+ const isPageDown = pageUpDown && kc === 34;
38920
+ const isArrowLeft = kc === 37;
38921
+ const isArrowRight = kc === 39;
38922
+ const isArrowUp = kc === 38;
38923
+ const isArrowDown = kc === 40;
38924
+ // Directions locks
38925
+ if (!swiper.allowSlideNext && (swiper.isHorizontal() && isArrowRight || swiper.isVertical() && isArrowDown || isPageDown)) {
38926
+ return false;
38927
+ }
38928
+ if (!swiper.allowSlidePrev && (swiper.isHorizontal() && isArrowLeft || swiper.isVertical() && isArrowUp || isPageUp)) {
38929
+ return false;
38930
+ }
38931
+ if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
38932
+ return undefined;
38933
+ }
38934
+ if (document.activeElement && document.activeElement.nodeName && (document.activeElement.nodeName.toLowerCase() === 'input' || document.activeElement.nodeName.toLowerCase() === 'textarea')) {
38935
+ return undefined;
38936
+ }
38937
+ if (swiper.params.keyboard.onlyInViewport && (isPageUp || isPageDown || isArrowLeft || isArrowRight || isArrowUp || isArrowDown)) {
38938
+ let inView = false;
38939
+ // Check that swiper should be inside of visible area of window
38940
+ if (elementParents(swiper.el, `.${swiper.params.slideClass}, swiper-slide`).length > 0 && elementParents(swiper.el, `.${swiper.params.slideActiveClass}`).length === 0) {
38941
+ return undefined;
38942
+ }
38943
+ const el = swiper.el;
38944
+ const swiperWidth = el.clientWidth;
38945
+ const swiperHeight = el.clientHeight;
38946
+ const windowWidth = window.innerWidth;
38947
+ const windowHeight = window.innerHeight;
38948
+ const swiperOffset = elementOffset(el);
38949
+ if (rtl) swiperOffset.left -= el.scrollLeft;
38950
+ const swiperCoord = [[swiperOffset.left, swiperOffset.top], [swiperOffset.left + swiperWidth, swiperOffset.top], [swiperOffset.left, swiperOffset.top + swiperHeight], [swiperOffset.left + swiperWidth, swiperOffset.top + swiperHeight]];
38951
+ for (let i = 0; i < swiperCoord.length; i += 1) {
38952
+ const point = swiperCoord[i];
38953
+ if (point[0] >= 0 && point[0] <= windowWidth && point[1] >= 0 && point[1] <= windowHeight) {
38954
+ if (point[0] === 0 && point[1] === 0) continue; // eslint-disable-line
38955
+ inView = true;
38956
+ }
38957
+ }
38958
+ if (!inView) return undefined;
38959
+ }
38960
+ if (swiper.isHorizontal()) {
38961
+ if (isPageUp || isPageDown || isArrowLeft || isArrowRight) {
38962
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
38963
+ }
38964
+ if ((isPageDown || isArrowRight) && !rtl || (isPageUp || isArrowLeft) && rtl) swiper.slideNext();
38965
+ if ((isPageUp || isArrowLeft) && !rtl || (isPageDown || isArrowRight) && rtl) swiper.slidePrev();
38966
+ } else {
38967
+ if (isPageUp || isPageDown || isArrowUp || isArrowDown) {
38968
+ if (e.preventDefault) e.preventDefault();else e.returnValue = false;
38969
+ }
38970
+ if (isPageDown || isArrowDown) swiper.slideNext();
38971
+ if (isPageUp || isArrowUp) swiper.slidePrev();
38972
+ }
38973
+ emit('keyPress', kc);
38974
+ return undefined;
38975
+ }
38976
+ function enable() {
38977
+ if (swiper.keyboard.enabled) return;
38978
+ document.addEventListener('keydown', handle);
38979
+ swiper.keyboard.enabled = true;
38980
+ }
38981
+ function disable() {
38982
+ if (!swiper.keyboard.enabled) return;
38983
+ document.removeEventListener('keydown', handle);
38984
+ swiper.keyboard.enabled = false;
38985
+ }
38986
+ on('init', () => {
38987
+ if (swiper.params.keyboard.enabled) {
38988
+ enable();
38989
+ }
38990
+ });
38991
+ on('destroy', () => {
38992
+ if (swiper.keyboard.enabled) {
38993
+ disable();
38994
+ }
38995
+ });
38996
+ Object.assign(swiper.keyboard, {
38997
+ enable,
38998
+ disable
38999
+ });
39000
+ }
39001
+
38802
39002
  /* eslint-disable consistent-return */
38803
39003
  function Mousewheel(_ref) {
38804
39004
  let {
@@ -39676,6 +39876,145 @@ function Pagination(_ref) {
39676
39876
  });
39677
39877
  }
39678
39878
 
39879
+ function History(_ref) {
39880
+ let {
39881
+ swiper,
39882
+ extendParams,
39883
+ on
39884
+ } = _ref;
39885
+ extendParams({
39886
+ history: {
39887
+ enabled: false,
39888
+ root: '',
39889
+ replaceState: false,
39890
+ key: 'slides',
39891
+ keepQuery: false
39892
+ }
39893
+ });
39894
+ let initialized = false;
39895
+ let paths = {};
39896
+ const slugify = text => {
39897
+ return text.toString().replace(/\s+/g, '-').replace(/[^\w-]+/g, '').replace(/--+/g, '-').replace(/^-+/, '').replace(/-+$/, '');
39898
+ };
39899
+ const getPathValues = urlOverride => {
39900
+ const window = getWindow();
39901
+ let location;
39902
+ if (urlOverride) {
39903
+ location = new URL(urlOverride);
39904
+ } else {
39905
+ location = window.location;
39906
+ }
39907
+ const pathArray = location.pathname.slice(1).split('/').filter(part => part !== '');
39908
+ const total = pathArray.length;
39909
+ const key = pathArray[total - 2];
39910
+ const value = pathArray[total - 1];
39911
+ return {
39912
+ key,
39913
+ value
39914
+ };
39915
+ };
39916
+ const setHistory = (key, index) => {
39917
+ const window = getWindow();
39918
+ if (!initialized || !swiper.params.history.enabled) return;
39919
+ let location;
39920
+ if (swiper.params.url) {
39921
+ location = new URL(swiper.params.url);
39922
+ } else {
39923
+ location = window.location;
39924
+ }
39925
+ const slide = swiper.slides[index];
39926
+ let value = slugify(slide.getAttribute('data-history'));
39927
+ if (swiper.params.history.root.length > 0) {
39928
+ let root = swiper.params.history.root;
39929
+ if (root[root.length - 1] === '/') root = root.slice(0, root.length - 1);
39930
+ value = `${root}/${key ? `${key}/` : ''}${value}`;
39931
+ } else if (!location.pathname.includes(key)) {
39932
+ value = `${key ? `${key}/` : ''}${value}`;
39933
+ }
39934
+ if (swiper.params.history.keepQuery) {
39935
+ value += location.search;
39936
+ }
39937
+ const currentState = window.history.state;
39938
+ if (currentState && currentState.value === value) {
39939
+ return;
39940
+ }
39941
+ if (swiper.params.history.replaceState) {
39942
+ window.history.replaceState({
39943
+ value
39944
+ }, null, value);
39945
+ } else {
39946
+ window.history.pushState({
39947
+ value
39948
+ }, null, value);
39949
+ }
39950
+ };
39951
+ const scrollToSlide = (speed, value, runCallbacks) => {
39952
+ if (value) {
39953
+ for (let i = 0, length = swiper.slides.length; i < length; i += 1) {
39954
+ const slide = swiper.slides[i];
39955
+ const slideHistory = slugify(slide.getAttribute('data-history'));
39956
+ if (slideHistory === value) {
39957
+ const index = swiper.getSlideIndex(slide);
39958
+ swiper.slideTo(index, speed, runCallbacks);
39959
+ }
39960
+ }
39961
+ } else {
39962
+ swiper.slideTo(0, speed, runCallbacks);
39963
+ }
39964
+ };
39965
+ const setHistoryPopState = () => {
39966
+ paths = getPathValues(swiper.params.url);
39967
+ scrollToSlide(swiper.params.speed, paths.value, false);
39968
+ };
39969
+ const init = () => {
39970
+ const window = getWindow();
39971
+ if (!swiper.params.history) return;
39972
+ if (!window.history || !window.history.pushState) {
39973
+ swiper.params.history.enabled = false;
39974
+ swiper.params.hashNavigation.enabled = true;
39975
+ return;
39976
+ }
39977
+ initialized = true;
39978
+ paths = getPathValues(swiper.params.url);
39979
+ if (!paths.key && !paths.value) {
39980
+ if (!swiper.params.history.replaceState) {
39981
+ window.addEventListener('popstate', setHistoryPopState);
39982
+ }
39983
+ return;
39984
+ }
39985
+ scrollToSlide(0, paths.value, swiper.params.runCallbacksOnInit);
39986
+ if (!swiper.params.history.replaceState) {
39987
+ window.addEventListener('popstate', setHistoryPopState);
39988
+ }
39989
+ };
39990
+ const destroy = () => {
39991
+ const window = getWindow();
39992
+ if (!swiper.params.history.replaceState) {
39993
+ window.removeEventListener('popstate', setHistoryPopState);
39994
+ }
39995
+ };
39996
+ on('init', () => {
39997
+ if (swiper.params.history.enabled) {
39998
+ init();
39999
+ }
40000
+ });
40001
+ on('destroy', () => {
40002
+ if (swiper.params.history.enabled) {
40003
+ destroy();
40004
+ }
40005
+ });
40006
+ on('transitionEnd _freeModeNoMomentumRelease', () => {
40007
+ if (initialized) {
40008
+ setHistory(swiper.params.history.key, swiper.activeIndex);
40009
+ }
40010
+ });
40011
+ on('slideChange', () => {
40012
+ if (initialized && swiper.params.cssMode) {
40013
+ setHistory(swiper.params.history.key, swiper.activeIndex);
40014
+ }
40015
+ });
40016
+ }
40017
+
39679
40018
  /* eslint no-underscore-dangle: "off" */
39680
40019
  /* eslint no-use-before-define: "off" */
39681
40020
  function Autoplay(_ref) {
@@ -41343,6 +41682,134 @@ var PricingInCardView = function PricingInCardView(_ref) {
41343
41682
  })));
41344
41683
  };
41345
41684
 
41685
+ var Slides = function Slides(_ref) {
41686
+ var configurations = _ref.configurations,
41687
+ _ref$className = _ref.className,
41688
+ className = _ref$className === void 0 ? "" : _ref$className,
41689
+ id = _ref.id;
41690
+ var _useState = React.useState(0),
41691
+ _useState2 = _slicedToArray__default["default"](_useState, 2),
41692
+ activeIndex = _useState2[0],
41693
+ setActiveIndex = _useState2[1];
41694
+ var swiperRef = React.useRef(null);
41695
+ var properties = configurations.properties,
41696
+ design = configurations.design;
41697
+ var _properties$content$s = properties.content.slides,
41698
+ slides = _properties$content$s === void 0 ? [] : _properties$content$s,
41699
+ src = properties.backgroundImage.src,
41700
+ enableAnimation = properties.enableAnimation;
41701
+ var baseClasses = "grid grid-cols-12 items-center gap-y-4 sm:gap-x-4 grid-flow-row-dense";
41702
+ var renderSwiperSlide = function renderSwiperSlide(_ref2) {
41703
+ var title = _ref2.title,
41704
+ logoUrl = _ref2.logoUrl,
41705
+ subTitle = _ref2.subTitle,
41706
+ layout = _ref2.layout,
41707
+ imageUrl = _ref2.imageUrl;
41708
+ if (layout === "titleWithSubTitle") {
41709
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledImage$1, {
41710
+ className: "absolute top-8 right-12 w-20",
41711
+ src: logoUrl
41712
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
41713
+ className: "col-span-12"
41714
+ }, /*#__PURE__*/React__default["default"].createElement(Typography$1, {
41715
+ isTitle: true,
41716
+ component: "h1",
41717
+ style: design.title
41718
+ }, title), /*#__PURE__*/React__default["default"].createElement(Typography$1, {
41719
+ isTitle: true,
41720
+ component: "h1",
41721
+ style: design.subTitle
41722
+ }, subTitle)));
41723
+ }
41724
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(StyledImage$1, {
41725
+ className: "absolute top-8 right-12 w-20",
41726
+ src: logoUrl
41727
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
41728
+ className: "bottom-0 col-span-12 flex w-full justify-center sm:absolute sm:col-span-10 sm:col-start-2"
41729
+ }, /*#__PURE__*/React__default["default"].createElement(StyledImage$1, {
41730
+ src: imageUrl
41731
+ })));
41732
+ };
41733
+ return /*#__PURE__*/React__default["default"].createElement(MotionWrapper, {
41734
+ enableAnimation: enableAnimation,
41735
+ id: id,
41736
+ backgroundImage: mergeLeft({
41737
+ src: src
41738
+ }, design.backgroundImage),
41739
+ className: "relative flex items-center justify-between",
41740
+ design: mergeDesign(design.body, 80)
41741
+ }, /*#__PURE__*/React__default["default"].createElement(PageNavigation, {
41742
+ activeIndex: activeIndex,
41743
+ slides: slides,
41744
+ swiperRef: swiperRef,
41745
+ isStart: true,
41746
+ Icon: ArrowLeftS$1,
41747
+ className: "absolute left-0 top-1/2 z-20 sm:left-2 lg:left-28",
41748
+ onClick: function onClick() {
41749
+ var _swiperRef$current;
41750
+ return (_swiperRef$current = swiperRef.current) === null || _swiperRef$current === void 0 ? void 0 : _swiperRef$current.slidePrev();
41751
+ }
41752
+ }), /*#__PURE__*/React__default["default"].createElement(Swiper, {
41753
+ loop: true,
41754
+ history: {
41755
+ enabled: true,
41756
+ key: id
41757
+ },
41758
+ keyboard: {
41759
+ enabled: true,
41760
+ onlyInViewport: true
41761
+ },
41762
+ modules: [History, Keyboard],
41763
+ spaceBetween: 10,
41764
+ onSlideChange: function onSlideChange(swiper) {
41765
+ return setActiveIndex(swiper.activeIndex);
41766
+ },
41767
+ onSwiper: function onSwiper(swiper) {
41768
+ swiperRef.current = swiper;
41769
+ }
41770
+ }, slides.map(function (_ref3, index) {
41771
+ var title = _ref3.title,
41772
+ url = _ref3.url,
41773
+ logoUrl = _ref3.logoUrl,
41774
+ subTitle = _ref3.subTitle,
41775
+ layout = _ref3.layout,
41776
+ imageUrl = _ref3.imageUrl,
41777
+ backgroundImage = _ref3.backgroundImage;
41778
+ return /*#__PURE__*/React__default["default"].createElement(SwiperSlide, {
41779
+ className: classnames("my-auto", className),
41780
+ "data-history": url,
41781
+ key: getUniqueKey(title, index)
41782
+ }, /*#__PURE__*/React__default["default"].createElement(StyledWrapper, {
41783
+ isRootWrapper: true,
41784
+ backgroundImage: mergeLeft({
41785
+ src: backgroundImage.src
41786
+ }, design.backgroundImage),
41787
+ className: classnames("neeto-site-block-wrapper relative lg:w-9/12", baseClasses),
41788
+ design: mergeRight(design.container, {
41789
+ paddingHorizontal: design.body.paddingHorizontal
41790
+ })
41791
+ }, /*#__PURE__*/React__default["default"].createElement(StyledImage$1, {
41792
+ className: "absolute top-8 right-12 w-20",
41793
+ src: logoUrl
41794
+ }), renderSwiperSlide({
41795
+ title: title,
41796
+ logoUrl: logoUrl,
41797
+ subTitle: subTitle,
41798
+ layout: layout,
41799
+ imageUrl: imageUrl
41800
+ })));
41801
+ })), /*#__PURE__*/React__default["default"].createElement(PageNavigation, {
41802
+ activeIndex: activeIndex,
41803
+ swiperRef: swiperRef,
41804
+ Icon: ArrowRightS$1,
41805
+ className: "absolute top-1/2 right-0 z-20 sm:right-2 lg:right-28",
41806
+ onClick: function onClick() {
41807
+ var _swiperRef$current2;
41808
+ return (_swiperRef$current2 = swiperRef.current) === null || _swiperRef$current2 === void 0 ? void 0 : _swiperRef$current2.slideNext();
41809
+ }
41810
+ }));
41811
+ };
41812
+
41346
41813
  var _excluded$1 = ["configurations", "className", "id"];
41347
41814
  var TestimonialWithSlider = function TestimonialWithSlider(_ref) {
41348
41815
  var configurations = _ref.configurations,
@@ -41573,6 +42040,7 @@ exports.Icons = index;
41573
42040
  exports.LogoClouds = LogoClouds;
41574
42041
  exports.Paragraph = Paragraph;
41575
42042
  exports.PricingInCardView = PricingInCardView;
42043
+ exports.Slides = Slides;
41576
42044
  exports.TestimonialWithSlider = TestimonialWithSlider;
41577
42045
  exports.TestimonialWithVerticalView = TestimonialWithVerticalView;
41578
42046
  //# sourceMappingURL=index.cjs.js.map