@prom-ui/core 1.7.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/Avatar/package.json +1 -1
  2. package/Backdrop/package.json +1 -1
  3. package/Body/package.json +1 -1
  4. package/BodyContext/package.json +1 -1
  5. package/BodyProvider/package.json +1 -1
  6. package/Box/package.json +1 -1
  7. package/Button/package.json +1 -1
  8. package/ButtonPageUp/package.json +1 -1
  9. package/Checkbox/package.json +1 -1
  10. package/Flex/package.json +1 -1
  11. package/Grid/package.json +1 -1
  12. package/Icon/package.json +1 -1
  13. package/Image/package.json +1 -1
  14. package/ImageEmoji/package.json +1 -1
  15. package/Input/package.json +1 -1
  16. package/InputField/package.json +1 -1
  17. package/KeyPress/package.json +1 -1
  18. package/Line/package.json +1 -1
  19. package/Link/package.json +1 -1
  20. package/List/package.json +1 -1
  21. package/Media/package.json +1 -1
  22. package/OutsideClick/package.json +1 -1
  23. package/Overlay/package.json +1 -1
  24. package/PhotoGallery/cjs/index.development.js +12 -4
  25. package/PhotoGallery/cjs/index.development.v2.js +12 -4
  26. package/PhotoGallery/cjs/index.production.js +1 -1
  27. package/PhotoGallery/cjs/index.production.v2.js +1 -1
  28. package/PhotoGallery/index.d.ts +2 -0
  29. package/PhotoGallery/package.json +1 -1
  30. package/Picture/package.json +1 -1
  31. package/Portal/package.json +1 -1
  32. package/QRCode/package.json +1 -1
  33. package/Rating/package.json +1 -1
  34. package/RatingSelect/package.json +1 -1
  35. package/SafeQuery/package.json +1 -1
  36. package/Scroll/package.json +1 -1
  37. package/ScrollControls/package.json +1 -1
  38. package/SimpleSlider/package.json +1 -1
  39. package/Skeleton/package.json +1 -1
  40. package/Spinner/package.json +1 -1
  41. package/Text/package.json +1 -1
  42. package/TextEmoji/package.json +1 -1
  43. package/Tooltip/package.json +1 -1
  44. package/Tumbler/package.json +1 -1
  45. package/package.json +2 -2
  46. package/useBodyTTag/package.json +1 -1
  47. package/useDebounce/package.json +1 -1
  48. package/useForwardRef/package.json +1 -1
  49. package/useId/package.json +1 -1
  50. package/useIsMounted/package.json +1 -1
  51. package/useKeyPress/package.json +1 -1
  52. package/useMedia/package.json +1 -1
  53. package/useOutsideClick/package.json +1 -1
  54. package/usePortal/package.json +1 -1
  55. package/useScrollPosition/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Avatar",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Backdrop",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Body/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Body",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/BodyContext",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/BodyProvider",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Box/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Box",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Button",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ButtonPageUp",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Checkbox",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Flex/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Flex",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Grid/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Grid",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Icon/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Icon",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Image",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ImageEmoji",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Input",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/InputField",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/KeyPress",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Line/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Line",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Link/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Link",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/List/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/List",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Media",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/OutsideClick",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Overlay",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -706,7 +706,8 @@ var definePinchZoom = function definePinchZoom() {
706
706
  * Creates the expected html structure
707
707
  */
708
708
  setupMarkup: function setupMarkup() {
709
- this.container = buildElement('<div class="pinch-zoom-container"></div>');
709
+ // this.container = buildElement('<div class="pinch-zoom-container"></div>');
710
+ this.container = buildElement('<div class="pinch-zoom-container" style="height: 100%;"></div>');
710
711
  this.el.parentNode.insertBefore(this.container, this.el);
711
712
  this.container.appendChild(this.el);
712
713
  this.container.style.overflow = 'hidden';
@@ -1024,7 +1025,8 @@ var MainPhotosImage = /*#__PURE__*/React__namespace.forwardRef(function (_ref, r
1024
1025
  if (imgRef.current && !isVideo) {
1025
1026
  pinchZoomRef.current = new PinchZoom(imgRef.current, {
1026
1027
  draggableUnzoomed: false,
1027
- animationDuration: 200
1028
+ animationDuration: 200,
1029
+ setOffsetsOnce: false
1028
1030
  });
1029
1031
  }
1030
1032
  });
@@ -1242,6 +1244,8 @@ var PhotoGallery = function PhotoGallery(_ref) {
1242
1244
  _ref$visibleIndex = _ref.visibleIndex,
1243
1245
  visibleIndex = _ref$visibleIndex === void 0 ? 0 : _ref$visibleIndex,
1244
1246
  items = _ref.items,
1247
+ _ref$zIndex = _ref.zIndex,
1248
+ zIndex = _ref$zIndex === void 0 ? 5000 : _ref$zIndex,
1245
1249
  onClose = _ref.onClose,
1246
1250
  onChange = _ref.onChange;
1247
1251
  var refIsAllowChangePreviewPhoto = React__namespace.useRef(true);
@@ -1320,7 +1324,8 @@ var PhotoGallery = function PhotoGallery(_ref) {
1320
1324
  };
1321
1325
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Backdrop.Backdrop, {
1322
1326
  isOpen: isOpen,
1323
- onClick: onCloseHandle
1327
+ onClick: onCloseHandle,
1328
+ zIndex: zIndex
1324
1329
  }), /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.CSSTransition, {
1325
1330
  "in": isOpen,
1326
1331
  timeout: 240,
@@ -1332,7 +1337,10 @@ var PhotoGallery = function PhotoGallery(_ref) {
1332
1337
  }, /*#__PURE__*/React__namespace.createElement(Portal.Portal, null, /*#__PURE__*/React__namespace.createElement("div", {
1333
1338
  className: css.root,
1334
1339
  "data-qaid": "photo_gallery",
1335
- "data-testid": "photo_gallery"
1340
+ "data-testid": "photo_gallery",
1341
+ style: {
1342
+ zIndex: zIndex
1343
+ }
1336
1344
  }, /*#__PURE__*/React__namespace.createElement(ScrollLock__default.default, null), /*#__PURE__*/React__namespace.createElement(KeyPress.KeyPress, {
1337
1345
  code: "Escape",
1338
1346
  onKeyUp: onCloseHandle
@@ -706,7 +706,8 @@ var definePinchZoom = function definePinchZoom() {
706
706
  * Creates the expected html structure
707
707
  */
708
708
  setupMarkup: function setupMarkup() {
709
- this.container = buildElement('<div class="pinch-zoom-container"></div>');
709
+ // this.container = buildElement('<div class="pinch-zoom-container"></div>');
710
+ this.container = buildElement('<div class="pinch-zoom-container" style="height: 100%;"></div>');
710
711
  this.el.parentNode.insertBefore(this.container, this.el);
711
712
  this.container.appendChild(this.el);
712
713
  this.container.style.overflow = 'hidden';
@@ -1024,7 +1025,8 @@ var MainPhotosImage = /*#__PURE__*/React__namespace.forwardRef(function (_ref, r
1024
1025
  if (imgRef.current && !isVideo) {
1025
1026
  pinchZoomRef.current = new PinchZoom(imgRef.current, {
1026
1027
  draggableUnzoomed: false,
1027
- animationDuration: 200
1028
+ animationDuration: 200,
1029
+ setOffsetsOnce: false
1028
1030
  });
1029
1031
  }
1030
1032
  });
@@ -1242,6 +1244,8 @@ var PhotoGallery = function PhotoGallery(_ref) {
1242
1244
  _ref$visibleIndex = _ref.visibleIndex,
1243
1245
  visibleIndex = _ref$visibleIndex === void 0 ? 0 : _ref$visibleIndex,
1244
1246
  items = _ref.items,
1247
+ _ref$zIndex = _ref.zIndex,
1248
+ zIndex = _ref$zIndex === void 0 ? 5000 : _ref$zIndex,
1245
1249
  onClose = _ref.onClose,
1246
1250
  onChange = _ref.onChange;
1247
1251
  var refIsAllowChangePreviewPhoto = React__namespace.useRef(true);
@@ -1320,7 +1324,8 @@ var PhotoGallery = function PhotoGallery(_ref) {
1320
1324
  };
1321
1325
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Backdrop.Backdrop, {
1322
1326
  isOpen: isOpen,
1323
- onClick: onCloseHandle
1327
+ onClick: onCloseHandle,
1328
+ zIndex: zIndex
1324
1329
  }), /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.CSSTransition, {
1325
1330
  "in": isOpen,
1326
1331
  timeout: 240,
@@ -1332,7 +1337,10 @@ var PhotoGallery = function PhotoGallery(_ref) {
1332
1337
  }, /*#__PURE__*/React__namespace.createElement(Portal.Portal, null, /*#__PURE__*/React__namespace.createElement("div", {
1333
1338
  className: css.root,
1334
1339
  "data-qaid": "photo_gallery",
1335
- "data-testid": "photo_gallery"
1340
+ "data-testid": "photo_gallery",
1341
+ style: {
1342
+ zIndex: zIndex
1343
+ }
1336
1344
  }, /*#__PURE__*/React__namespace.createElement(ScrollLock__default.default, null), /*#__PURE__*/React__namespace.createElement(KeyPress.KeyPress, {
1337
1345
  code: "Escape",
1338
1346
  onKeyUp: onCloseHandle
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-scrolllock"),n=require("react-transition-group"),i=require("@prom-ui/core/Backdrop"),o=require("@prom-ui/core/KeyPress"),r=require("@prom-ui/core/Portal"),a=require("@prom-ui/core/ScrollControls"),s=require("react-scrolllock/dist/utils"),l=require("@prom-ui/core/Icon"),c=require("@prom-ui/icons/Play"),u=require("@prom-ui/core/Button"),h=require("@prom-ui/core/useBodyTTag"),d=require("@prom-ui/icons/Close");function f(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function m(t){if(t&&"object"==typeof t&&"default"in t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var p=m(t),g=f(e);function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,r,a,s=[],l=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=r.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function b(t){var e=t.currentTarget;return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?(t.stopPropagation(),!0):(t.preventDefault(),!1)}var E,w=!("undefined"==typeof window||!window.document||!window.document.createElement)&&!(!window.addEventListener&&!window.attachEvent),x=function(t){var e=t.isActive,n=void 0!==e&&e,i=t.scrollRef,o=t.children;return p.useEffect((function(){if(n&&w&&null!=i&&i.current)return i.current.addEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.addEventListener("touchmove",b,s.listenerOptions),function(){n&&w&&null!=i&&i.current&&(i.current.removeEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.removeEventListener("touchmove",b,s.listenerOptions))}})),p.createElement(p.Fragment,null,o)},O=new Map,T=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O.has(e)&&(cancelAnimationFrame(O.get(e)),O.delete(e));var i=requestAnimationFrame((function(){var i=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=o.top+e.scrollTop-i.top-i.height/2+o.height/2,a=o.left+e.scrollLeft-i.left-i.width/2+o.width/2;a<0&&(a=0),r<0&&(r=0),e.scrollTo({behavior:n?"smooth":"instant",top:r,left:a})}));O.set(e,i)},z=function(t){var e=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/.exec(t);return e&&e[1]},_=function(t){var e=z(t);return"https://img.youtube.com/vi/".concat(e,"/0.jpg")},I=function(){var t=function(t,e){this.el=t,this.zoomFactor=1,this.lastScale=1,this.offset={x:0,y:0},this.initialOffset={x:0,y:0},this.options=Object.assign({},this.defaults,e),this.setupMarkup(),this.bindEvents(),this.update(),this.isImageLoaded(this.el)&&(this.updateAspectRatio(),this.setupOffsets()),this.enable()},e=function(t,e){return t+e};t.prototype={defaults:{tapZoomFactor:2,zoomOutFactor:1.3,animationDuration:300,maxZoom:4,minZoom:.5,draggableUnzoomed:!0,lockDragAxis:!1,setOffsetsOnce:!1,use2d:!0,useMouseWheel:!1,verticalPadding:0,horizontalPadding:0,onZoomStart:null,onZoomEnd:null,onZoomUpdate:null,onDragStart:null,onDragEnd:null,onDragUpdate:null,onDoubleTap:null,onMouseWheel:null},handleDragStart:function(t){"function"==typeof this.options.onDragStart&&this.options.onDragStart(this,t),this.stopAnimation(),this.lastDragPosition=!1,this.hasInteraction=!0,this.handleDrag(t)},handleDrag:function(t){var e="touchmove"===t.type?this.getTouches(t)[0]:this.getPointer(t);this.drag(e,this.lastDragPosition),this.offset=this.sanitizeOffset(this.offset),this.lastDragPosition=e},handleDragEnd:function(){"function"==typeof this.options.onDragEnd&&this.options.onDragEnd(this,event),this.end()},handleZoomStart:function(t){"function"==typeof this.options.onZoomStart&&this.options.onZoomStart(this,t),this.stopAnimation(),this.lastScale=1,this.nthZoom=0,this.lastZoomCenter=!1,this.hasInteraction=!0},handleZoom:function(t,e){var n=this.getTouchCenter(this.getTouches(t)),i=e/this.lastScale;this.lastScale=e,this.nthZoom+=1,this.nthZoom>3&&(this.scale(i,n),this.drag(n,this.lastZoomCenter)),this.lastZoomCenter=n},handleZoomEnd:function(){"function"==typeof this.options.onZoomEnd&&this.options.onZoomEnd(this,event),this.end()},handleDoubleTap:function(t){var e=this.getTouches(t)[0],n=this.zoomFactor>1?1:this.options.tapZoomFactor,i=this.zoomFactor,o=function(t){this.scaleTo(i+t*(n-i),e)}.bind(this);this.hasInteraction||(this.isDoubleTap=!0,i>n&&(e=this.getCurrentZoomCenter()),this.animate(this.options.animationDuration,o,this.swing),"function"==typeof this.options.onDoubleTap&&this.options.onDoubleTap(this,t))},handleMouseWheel:function(t){var e=this.getPointer(t),n=Math.min(Math.max(this.options.minZoom,this.lastScale+-.01*t.deltaY),this.options.maxZoom),i=n/this.lastScale;this.scale(i,e),this.lastScale=n,this.update(),"function"==typeof this.options.onMouseWheel&&this.options.onMouseWheel(this,t)},computeInitialOffset:function(){this.initialOffset={x:-Math.abs(this.el.offsetWidth*this.getInitialZoomFactor()-this.container.offsetWidth)/2,y:-Math.abs(this.el.offsetHeight*this.getInitialZoomFactor()-this.container.offsetHeight)/2}},resetOffset:function(){this.offset.x=this.initialOffset.x,this.offset.y=this.initialOffset.y},isImageLoaded:function(t){return"IMG"===t.nodeName?t.complete&&0!==t.naturalHeight:Array.from(t.querySelectorAll("img")).every(this.isImageLoaded)},setupOffsets:function(){this.options.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this.computeInitialOffset(),this.resetOffset())},sanitizeOffset:function(t){var e=this.el.offsetWidth*this.getInitialZoomFactor()*this.zoomFactor,n=this.el.offsetHeight*this.getInitialZoomFactor()*this.zoomFactor,i=e-this.getContainerX()+this.options.horizontalPadding,o=n-this.getContainerY()+this.options.verticalPadding,r=Math.max(i,0),a=Math.max(o,0),s=Math.min(i,0)-this.options.horizontalPadding,l=Math.min(o,0)-this.options.verticalPadding;return{x:Math.min(Math.max(t.x,s),r),y:Math.min(Math.max(t.y,l),a)}},scaleTo:function(t,e){this.scale(t/this.zoomFactor,e)},scale:function(t,e){t=this.scaleZoomFactor(t),this.addOffset({x:(t-1)*(e.x+this.offset.x),y:(t-1)*(e.y+this.offset.y)}),"function"==typeof this.options.onZoomUpdate&&this.options.onZoomUpdate(this,event)},scaleZoomFactor:function(t){var e=this.zoomFactor;return this.zoomFactor*=t,this.zoomFactor=Math.min(this.options.maxZoom,Math.max(this.zoomFactor,this.options.minZoom)),this.zoomFactor/e},canDrag:function(){return this.options.draggableUnzoomed||!((t=this.zoomFactor)>(e=1)-.01&&t<e+.01);var t,e},drag:function(t,e){e&&(this.options.lockDragAxis?Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?this.addOffset({x:-(t.x-e.x),y:0}):this.addOffset({y:-(t.y-e.y),x:0}):this.addOffset({y:-(t.y-e.y),x:-(t.x-e.x)}),"function"==typeof this.options.onDragUpdate&&this.options.onDragUpdate(this,event))},getTouchCenter:function(t){return this.getVectorAvg(t)},getVectorAvg:function(t){return{x:t.map((function(t){return t.x})).reduce(e)/t.length,y:t.map((function(t){return t.y})).reduce(e)/t.length}},addOffset:function(t){this.offset={x:this.offset.x+t.x,y:this.offset.y+t.y}},sanitize:function(){this.zoomFactor<this.options.zoomOutFactor?this.zoomOutAnimation():this.isInsaneOffset(this.offset)&&this.sanitizeOffsetAnimation()},isInsaneOffset:function(t){var e=this.sanitizeOffset(t);return e.x!==t.x||e.y!==t.y},sanitizeOffsetAnimation:function(){var t=this.sanitizeOffset(this.offset),e=this.offset.x,n=this.offset.y,i=function(i){this.offset.x=e+i*(t.x-e),this.offset.y=n+i*(t.y-n),this.update()}.bind(this);this.animate(this.options.animationDuration,i,this.swing)},zoomOutAnimation:function(){if(1!==this.zoomFactor){var t=this.zoomFactor,e=this.getCurrentZoomCenter(),n=function(n){this.scaleTo(t+n*(1-t),e)}.bind(this);this.animate(this.options.animationDuration,n,this.swing)}},updateAspectRatio:function(){this.unsetContainerY(),this.setContainerY(this.container.parentElement.offsetHeight)},getInitialZoomFactor:function(){var t=this.container.offsetWidth/this.el.offsetWidth,e=this.container.offsetHeight/this.el.offsetHeight;return Math.min(t,e)},getAspectRatio:function(){return this.el.offsetWidth/this.el.offsetHeight},getCurrentZoomCenter:function(){var t=this.offset.x-this.initialOffset.x,e=-1*this.offset.x-t/(1/this.zoomFactor-1),n=this.offset.y-this.initialOffset.y;return{x:e,y:-1*this.offset.y-n/(1/this.zoomFactor-1)}},getTouches:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,r=e.left+i;return Array.prototype.slice.call(t.touches).map((function(t){return{x:t.pageX-r,y:t.pageY-o}}))},getPointer:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,r=e.left+i;return{x:t.pageX-r,y:t.pageY-o}},animate:function(t,e,n,i){var o=(new Date).getTime(),r=function(){if(this.inAnimation){var a=(new Date).getTime()-o,s=a/t;a>=t?(e(1),i&&i(),this.update(),this.stopAnimation(),this.update()):(n&&(s=n(s)),e(s),this.update(),requestAnimationFrame(r))}}.bind(this);this.inAnimation=!0,requestAnimationFrame(r)},stopAnimation:function(){this.inAnimation=!1},swing:function(t){return-Math.cos(t*Math.PI)/2+.5},getContainerX:function(){return this.container.offsetWidth},getContainerY:function(){return this.container.offsetHeight},setContainerY:function(t){return this.container.style.height=t+"px"},unsetContainerY:function(){this.container.style.height=null},setupMarkup:function(){var t,e;this.container=(t='<div class="pinch-zoom-container"></div>',(e=document.implementation.createHTMLDocument("")).body.innerHTML=t,Array.from(e.body.children)[0]),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el),this.container.style.overflow="hidden",this.container.style.position="relative",this.el.style.webkitTransformOrigin="0% 0%",this.el.style.mozTransformOrigin="0% 0%",this.el.style.msTransformOrigin="0% 0%",this.el.style.oTransformOrigin="0% 0%",this.el.style.transformOrigin="0% 0%",this.el.style.position="absolute",this.el.style.backfaceVisibility="hidden",this.el.style.willChange="transform"},end:function(){this.hasInteraction=!1,this.sanitize(),this.update()},bindEvents:function(){var t=this;n(this.container,this),this.resizeHandler=this.update.bind(this),window.addEventListener("resize",this.resizeHandler),Array.from(this.el.querySelectorAll("img")).forEach((function(e){e.addEventListener("load",t.update.bind(t))})),"IMG"===this.el.nodeName&&this.el.addEventListener("load",this.update.bind(this))},update:function(t){t&&"resize"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),t&&"load"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),this.updatePlanned||(this.updatePlanned=!0,window.setTimeout(function(){this.updatePlanned=!1;var t=this.getInitialZoomFactor()*this.zoomFactor,e=-this.offset.x/t,n=-this.offset.y/t,i="scale3d("+t+", "+t+",1) translate3d("+e+"px,"+n+"px,0px)",o="scale("+t+", "+t+") translate("+e+"px,"+n+"px)",r=function(){this.clone&&(this.clone.parentNode.removeChild(this.clone),delete this.clone)}.bind(this);!this.options.use2d||this.hasInteraction||this.inAnimation?(this.is3d=!0,r(),this.el.style.webkitTransform=i,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=i):(this.is3d&&(this.clone=this.el.cloneNode(!0),this.clone.style.pointerEvents="none",this.container.appendChild(this.clone),window.setTimeout(r,200)),this.el.style.webkitTransform=o,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=o,this.is3d=!1)}.bind(this),0))},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},destroy:function(){window.removeEventListener("resize",this.resizeHandler),this.container&&(this.container.remove(),this.container=null)},reset:function(){this.zoomOutAnimation()}};var n=function(t,e){var n=null,i=0,o=null,r=null,a=function(t,i){if(n!==t){if(n&&!t)switch(n){case"zoom":e.handleZoomEnd(i);break;case"drag":e.handleDragEnd(i)}switch(t){case"zoom":e.handleZoomStart(i);break;case"drag":e.handleDragStart(i)}}n=t},s=function(t){2===i?a("zoom"):1===i&&e.canDrag()?a("drag",t):a(null,t)},l=function(t){return Array.from(t).map((function(t){return{x:t.pageX,y:t.pageY}}))},c=function(t,e){var n,i;return n=t.x-e.x,i=t.y-e.y,Math.sqrt(n*n+i*i)},u=function(t){t.stopPropagation(),t.preventDefault()},h=!0;t.addEventListener("touchstart",(function(t){e.enabled&&(h=!0,i=t.touches.length,function(t){var r=(new Date).getTime();if(i>1&&(o=null),r-o<300)switch(u(t),e.handleDoubleTap(t),n){case"zoom":e.handleZoomEnd(t);break;case"drag":e.handleDragEnd(t)}else e.isDoubleTap=!1;1===i&&(o=r)}(t))}),{passive:!1}),t.addEventListener("touchmove",(function(t){if(e.enabled&&!e.isDoubleTap){if(h)s(t),n&&u(t),r=l(t.touches);else{switch(n){case"zoom":2==r.length&&2==t.touches.length&&e.handleZoom(t,function(t,e){var n=c(t[0],t[1]);return c(e[0],e[1])/n}(r,l(t.touches)));break;case"drag":e.handleDrag(t)}n&&(u(t),e.update())}h=!1}}),{passive:!1}),t.addEventListener("touchend",(function(t){e.enabled&&(i=t.touches.length,s(t))})),e.options.useMouseWheel&&(t.addEventListener("mousewheel",(function(t){e.enabled&&(u(t),e.handleMouseWheel(t))})),t.addEventListener("mousedown",(function(t){e.enabled&&(h=!0,i=1)}),{passive:!0}),t.addEventListener("mousemove",(function(t){e.enabled&&(h?(s(t),n&&u(t)):("drag"===n&&e.handleDrag(t),n&&(u(t),e.update())),h=!1)}),{passive:!1}),t.addEventListener("mouseup",(function(t){e.enabled&&(i=0,s(t))}),{passive:!0}))};return t}(),A={scrolling:"BeLzR",root:"nJWgH",layout:"BDoOb",layoutHeader:"iNVA1",layoutContent:"C-jWr",layoutSection:"_3FXm5",layoutAside:"ABw2b",header:"meCSL",headerTitle:"NpSWI",headerClose:"-B9Zg",mainPhotoScrollControls:"ckcap",mainPhoto:"-r4WP BeLzR",mainPhotoItem:"Q7wDI",mainPhotoImage:"NrcBT",mainPhotoIframe:"kObZY",preview:"_86-3f BeLzR",previewItem:"gnB8m",previewButton:"L4PR-",previewImage:"_8dsDI",videoPlayLabel:"_2kU58",videoPlayLabelIcon:"WR7T8",enter:"sM8Qu",exit:"veHZr",enterActive:"VP4oy",exitActive:"AMPJ3"},C=p.forwardRef((function(t,e){var n=t.src,i=t.videoSrc,o=p.useRef(null),r=p.useRef(null),a=p.useRef(null),s=!!i,l=function(){var t,e;null===(t=r.current)||void 0===t||t.reset(),null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")};return p.useEffect((function(){return requestAnimationFrame((function(){a.current&&!s&&(r.current=new I(a.current,{draggableUnzoomed:!1,animationDuration:200}))})),function(){var t;null===(t=r.current)||void 0===t||t.destroy()}}),[i]),p.useImperativeHandle(e,(function(){return{reset:l}}),[]),s?p.createElement("iframe",{ref:o,className:A.mainPhotoIframe,src:i,width:"100%",height:"100%",allowFullScreen:!0,title:"",loading:"lazy","data-qaid":"photo_gallery_main_video","data-testid":"photo_gallery_main_video"}):p.createElement("img",{ref:a,className:A.mainPhotoImage,src:n,width:"100%",height:"100%",alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_main_image","data-testid":"photo_gallery_main_image"})})),D=p.forwardRef((function(t,e){var n=t.items,i=t.onChange,o=p.useRef([]),r=p.useRef(0),s=p.useRef(null),l=function(){o.current.forEach((function(t){null==t||t.reset()}))},c=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=s.current)||void 0===e?void 0:e.children[t];l(),i&&T(i,s.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:c}}),[]);var u=function(){if(s.current){var t=function(t,e){var n=t.scrollLeft/t.scrollWidth*e;return Math.round(n)}(s.current,n.length);r.current!==t&&(r.current=t,i(t),l())}};return p.createElement(a.ScrollControls,{ref:s,className:A.mainPhotoScrollControls,showOnHover:!0,hideOnDisabled:!0},(function(t){return p.createElement(x,{scrollRef:t,isActive:!0},p.createElement("div",{ref:t,className:A.mainPhoto,onScroll:u},n.map((function(t,e){var n,i=t.type,r=t.src,a="video"===i,s=a?_(r):r,l=a?(n=z(r),"https://youtube.com/embed/".concat(n,"?enablejsapi=1&rel=0")):void 0;return p.createElement("div",{key:e,className:A.mainPhotoItem,"data-qaid":"photo_gallery_main_item","data-testid":"photo_gallery_main_item"},p.createElement(C,{ref:function(t){return o.current[e]=t},src:s,videoSrc:l}))}))))}))})),P=p.forwardRef((function(t,e){var n=t.items,i=t.selectedIndex,o=t.onChange,r=p.useRef(null),a=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=r.current)||void 0===e?void 0:e.children[t];i&&T(i,r.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:a}}),[]);return p.createElement(x,{scrollRef:r,isActive:!0},p.createElement("div",{ref:r,className:A.preview},n.map((function(t,e){var n=t.type,r=t.src,a="video"===n,s=a?_(r):r;return p.createElement("div",{key:e,className:A.previewItem,"data-qaid":"photo_gallery_preview_item","data-testid":"photo_gallery_preview_item"},p.createElement("button",{className:A.previewButton,type:"button",onClick:function(){return function(t){o(t)}(e)},disabled:i===e,"data-qaid":"photo_gallery_preview_button","data-testid":"photo_gallery_preview_button"},p.createElement("img",{className:A.previewImage,src:s,width:58,height:58,alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_preview_image","data-testid":"photo_gallery_preview_image"}),a&&p.createElement("div",{className:A.videoPlayLabel,"data-qaid":"photo_gallery_preview_play","data-testid":"photo_gallery_preview_play"},p.createElement(l.Icon,{className:A.videoPlayLabelIcon,"icon-as":c.SvgPlay}))))}))))})),S=function(t){var e,n,i=t.title,o=t.onClose,r=t.selectedIndex,a=t.itemsLength,s=r+1,c=(0,h.useBodyTTag().t)(E||(e=["Фото "," из ",""],n||(n=e.slice(0)),E=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))),s,a);return p.createElement("div",{className:A.header},p.createElement("div",{className:A.headerTitle,"data-qaid":"photo_gallery_title","data-testid":"photo_gallery_title"},i||c),p.createElement("div",{className:A.headerClose},p.createElement(u.Button,{"button-padding":"xxs","button-theme":"black-inherit",type:"button",onClick:o,"data-qaid":"photo_gallery_close_button","data-testid":"photo_gallery_close_button"},p.createElement(l.Icon,{"icon-as":d.SvgClose,style:{width:24,height:24}}))))};exports.PhotoGallery=function(t){var e=t.isOpen,a=t.title,s=t.visibleIndex,l=void 0===s?0:s,c=t.items,u=t.onClose,h=t.onChange,d=p.useRef(!0),f=p.useRef(null),m=p.useRef(null),y=v(p.useState(l),2),b=y[0],E=y[1];p.useEffect((function(){e&&"function"==typeof h&&h(b)}),[b]),p.useEffect((function(){var t,n;e&&(E(l),null===(t=m.current)||void 0===t||t.scrollToIndex(l,!1),null===(n=f.current)||void 0===n||n.scrollToIndex(l,!1))}),[e]),p.useEffect((function(){var t;if(!e)return function(){};var n=null,i=function(){n&&clearTimeout(n)},o=function(){i(),n=setTimeout((function(){var t,e;null===(t=m.current)||void 0===t||t.scrollToIndex(b,!1),null===(e=f.current)||void 0===e||e.scrollToIndex(b,!1)}),100)};return window.addEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.addEventListener("change",o),function(){var t;i(),window.removeEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.removeEventListener("change",o)}}),[e,b]);var w=function(t){var e,n;d.current=!1,E(t),null===(e=m.current)||void 0===e||e.scrollToIndex(t),null===(n=f.current)||void 0===n||n.scrollToIndex(t)},x=function(){u(b)};return p.createElement(p.Fragment,null,p.createElement(i.Backdrop,{isOpen:e,onClick:x}),p.createElement(n.CSSTransition,{in:e,timeout:240,classNames:A,unmountOnExit:!0},p.createElement(r.Portal,null,p.createElement("div",{className:A.root,"data-qaid":"photo_gallery","data-testid":"photo_gallery"},p.createElement(g.default,null),p.createElement(o.KeyPress,{code:"Escape",onKeyUp:x}),p.createElement(o.KeyPress,{code:"ArrowLeft",onKeyUp:function(){0!==b&&w(b-1)}}),p.createElement(o.KeyPress,{code:"ArrowRight",onKeyUp:function(){b!==c.length-1&&w(b+1)}}),p.createElement("div",{className:A.layout},p.createElement("header",{className:A.layoutHeader},p.createElement(S,{title:a,selectedIndex:b,itemsLength:c.length,onClose:x})),p.createElement("div",{className:A.layoutContent},p.createElement("section",{className:A.layoutSection},p.createElement(D,{ref:f,items:c,onChange:function(t){var e;d.current&&(E(t),null===(e=m.current)||void 0===e||e.scrollToIndex(t));d.current||b!==t||(d.current=!0)}})),c.length>1&&p.createElement("aside",{className:A.layoutAside},p.createElement(P,{ref:m,items:c,selectedIndex:b,onChange:w}))))))))},require("./style.production.css");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-scrolllock"),n=require("react-transition-group"),i=require("@prom-ui/core/Backdrop"),o=require("@prom-ui/core/KeyPress"),r=require("@prom-ui/core/Portal"),a=require("@prom-ui/core/ScrollControls"),s=require("react-scrolllock/dist/utils"),l=require("@prom-ui/core/Icon"),c=require("@prom-ui/icons/Play"),u=require("@prom-ui/core/Button"),h=require("@prom-ui/core/useBodyTTag"),d=require("@prom-ui/icons/Close");function f(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function m(t){if(t&&"object"==typeof t&&"default"in t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var p=m(t),g=f(e);function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,r,a,s=[],l=!0,c=!1;try{if(r=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=r.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function b(t){var e=t.currentTarget;return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?(t.stopPropagation(),!0):(t.preventDefault(),!1)}var E,w=!("undefined"==typeof window||!window.document||!window.document.createElement)&&!(!window.addEventListener&&!window.attachEvent),x=function(t){var e=t.isActive,n=void 0!==e&&e,i=t.scrollRef,o=t.children;return p.useEffect((function(){if(n&&w&&null!=i&&i.current)return i.current.addEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.addEventListener("touchmove",b,s.listenerOptions),function(){n&&w&&null!=i&&i.current&&(i.current.removeEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.removeEventListener("touchmove",b,s.listenerOptions))}})),p.createElement(p.Fragment,null,o)},O=new Map,z=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O.has(e)&&(cancelAnimationFrame(O.get(e)),O.delete(e));var i=requestAnimationFrame((function(){var i=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=o.top+e.scrollTop-i.top-i.height/2+o.height/2,a=o.left+e.scrollLeft-i.left-i.width/2+o.width/2;a<0&&(a=0),r<0&&(r=0),e.scrollTo({behavior:n?"smooth":"instant",top:r,left:a})}));O.set(e,i)},I=function(t){var e=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/.exec(t);return e&&e[1]},T=function(t){var e=I(t);return"https://img.youtube.com/vi/".concat(e,"/0.jpg")},_=function(){var t=function(t,e){this.el=t,this.zoomFactor=1,this.lastScale=1,this.offset={x:0,y:0},this.initialOffset={x:0,y:0},this.options=Object.assign({},this.defaults,e),this.setupMarkup(),this.bindEvents(),this.update(),this.isImageLoaded(this.el)&&(this.updateAspectRatio(),this.setupOffsets()),this.enable()},e=function(t,e){return t+e};t.prototype={defaults:{tapZoomFactor:2,zoomOutFactor:1.3,animationDuration:300,maxZoom:4,minZoom:.5,draggableUnzoomed:!0,lockDragAxis:!1,setOffsetsOnce:!1,use2d:!0,useMouseWheel:!1,verticalPadding:0,horizontalPadding:0,onZoomStart:null,onZoomEnd:null,onZoomUpdate:null,onDragStart:null,onDragEnd:null,onDragUpdate:null,onDoubleTap:null,onMouseWheel:null},handleDragStart:function(t){"function"==typeof this.options.onDragStart&&this.options.onDragStart(this,t),this.stopAnimation(),this.lastDragPosition=!1,this.hasInteraction=!0,this.handleDrag(t)},handleDrag:function(t){var e="touchmove"===t.type?this.getTouches(t)[0]:this.getPointer(t);this.drag(e,this.lastDragPosition),this.offset=this.sanitizeOffset(this.offset),this.lastDragPosition=e},handleDragEnd:function(){"function"==typeof this.options.onDragEnd&&this.options.onDragEnd(this,event),this.end()},handleZoomStart:function(t){"function"==typeof this.options.onZoomStart&&this.options.onZoomStart(this,t),this.stopAnimation(),this.lastScale=1,this.nthZoom=0,this.lastZoomCenter=!1,this.hasInteraction=!0},handleZoom:function(t,e){var n=this.getTouchCenter(this.getTouches(t)),i=e/this.lastScale;this.lastScale=e,this.nthZoom+=1,this.nthZoom>3&&(this.scale(i,n),this.drag(n,this.lastZoomCenter)),this.lastZoomCenter=n},handleZoomEnd:function(){"function"==typeof this.options.onZoomEnd&&this.options.onZoomEnd(this,event),this.end()},handleDoubleTap:function(t){var e=this.getTouches(t)[0],n=this.zoomFactor>1?1:this.options.tapZoomFactor,i=this.zoomFactor,o=function(t){this.scaleTo(i+t*(n-i),e)}.bind(this);this.hasInteraction||(this.isDoubleTap=!0,i>n&&(e=this.getCurrentZoomCenter()),this.animate(this.options.animationDuration,o,this.swing),"function"==typeof this.options.onDoubleTap&&this.options.onDoubleTap(this,t))},handleMouseWheel:function(t){var e=this.getPointer(t),n=Math.min(Math.max(this.options.minZoom,this.lastScale+-.01*t.deltaY),this.options.maxZoom),i=n/this.lastScale;this.scale(i,e),this.lastScale=n,this.update(),"function"==typeof this.options.onMouseWheel&&this.options.onMouseWheel(this,t)},computeInitialOffset:function(){this.initialOffset={x:-Math.abs(this.el.offsetWidth*this.getInitialZoomFactor()-this.container.offsetWidth)/2,y:-Math.abs(this.el.offsetHeight*this.getInitialZoomFactor()-this.container.offsetHeight)/2}},resetOffset:function(){this.offset.x=this.initialOffset.x,this.offset.y=this.initialOffset.y},isImageLoaded:function(t){return"IMG"===t.nodeName?t.complete&&0!==t.naturalHeight:Array.from(t.querySelectorAll("img")).every(this.isImageLoaded)},setupOffsets:function(){this.options.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this.computeInitialOffset(),this.resetOffset())},sanitizeOffset:function(t){var e=this.el.offsetWidth*this.getInitialZoomFactor()*this.zoomFactor,n=this.el.offsetHeight*this.getInitialZoomFactor()*this.zoomFactor,i=e-this.getContainerX()+this.options.horizontalPadding,o=n-this.getContainerY()+this.options.verticalPadding,r=Math.max(i,0),a=Math.max(o,0),s=Math.min(i,0)-this.options.horizontalPadding,l=Math.min(o,0)-this.options.verticalPadding;return{x:Math.min(Math.max(t.x,s),r),y:Math.min(Math.max(t.y,l),a)}},scaleTo:function(t,e){this.scale(t/this.zoomFactor,e)},scale:function(t,e){t=this.scaleZoomFactor(t),this.addOffset({x:(t-1)*(e.x+this.offset.x),y:(t-1)*(e.y+this.offset.y)}),"function"==typeof this.options.onZoomUpdate&&this.options.onZoomUpdate(this,event)},scaleZoomFactor:function(t){var e=this.zoomFactor;return this.zoomFactor*=t,this.zoomFactor=Math.min(this.options.maxZoom,Math.max(this.zoomFactor,this.options.minZoom)),this.zoomFactor/e},canDrag:function(){return this.options.draggableUnzoomed||!((t=this.zoomFactor)>(e=1)-.01&&t<e+.01);var t,e},drag:function(t,e){e&&(this.options.lockDragAxis?Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?this.addOffset({x:-(t.x-e.x),y:0}):this.addOffset({y:-(t.y-e.y),x:0}):this.addOffset({y:-(t.y-e.y),x:-(t.x-e.x)}),"function"==typeof this.options.onDragUpdate&&this.options.onDragUpdate(this,event))},getTouchCenter:function(t){return this.getVectorAvg(t)},getVectorAvg:function(t){return{x:t.map((function(t){return t.x})).reduce(e)/t.length,y:t.map((function(t){return t.y})).reduce(e)/t.length}},addOffset:function(t){this.offset={x:this.offset.x+t.x,y:this.offset.y+t.y}},sanitize:function(){this.zoomFactor<this.options.zoomOutFactor?this.zoomOutAnimation():this.isInsaneOffset(this.offset)&&this.sanitizeOffsetAnimation()},isInsaneOffset:function(t){var e=this.sanitizeOffset(t);return e.x!==t.x||e.y!==t.y},sanitizeOffsetAnimation:function(){var t=this.sanitizeOffset(this.offset),e=this.offset.x,n=this.offset.y,i=function(i){this.offset.x=e+i*(t.x-e),this.offset.y=n+i*(t.y-n),this.update()}.bind(this);this.animate(this.options.animationDuration,i,this.swing)},zoomOutAnimation:function(){if(1!==this.zoomFactor){var t=this.zoomFactor,e=this.getCurrentZoomCenter(),n=function(n){this.scaleTo(t+n*(1-t),e)}.bind(this);this.animate(this.options.animationDuration,n,this.swing)}},updateAspectRatio:function(){this.unsetContainerY(),this.setContainerY(this.container.parentElement.offsetHeight)},getInitialZoomFactor:function(){var t=this.container.offsetWidth/this.el.offsetWidth,e=this.container.offsetHeight/this.el.offsetHeight;return Math.min(t,e)},getAspectRatio:function(){return this.el.offsetWidth/this.el.offsetHeight},getCurrentZoomCenter:function(){var t=this.offset.x-this.initialOffset.x,e=-1*this.offset.x-t/(1/this.zoomFactor-1),n=this.offset.y-this.initialOffset.y;return{x:e,y:-1*this.offset.y-n/(1/this.zoomFactor-1)}},getTouches:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,r=e.left+i;return Array.prototype.slice.call(t.touches).map((function(t){return{x:t.pageX-r,y:t.pageY-o}}))},getPointer:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,r=e.left+i;return{x:t.pageX-r,y:t.pageY-o}},animate:function(t,e,n,i){var o=(new Date).getTime(),r=function(){if(this.inAnimation){var a=(new Date).getTime()-o,s=a/t;a>=t?(e(1),i&&i(),this.update(),this.stopAnimation(),this.update()):(n&&(s=n(s)),e(s),this.update(),requestAnimationFrame(r))}}.bind(this);this.inAnimation=!0,requestAnimationFrame(r)},stopAnimation:function(){this.inAnimation=!1},swing:function(t){return-Math.cos(t*Math.PI)/2+.5},getContainerX:function(){return this.container.offsetWidth},getContainerY:function(){return this.container.offsetHeight},setContainerY:function(t){return this.container.style.height=t+"px"},unsetContainerY:function(){this.container.style.height=null},setupMarkup:function(){var t,e;this.container=(t='<div class="pinch-zoom-container" style="height: 100%;"></div>',(e=document.implementation.createHTMLDocument("")).body.innerHTML=t,Array.from(e.body.children)[0]),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el),this.container.style.overflow="hidden",this.container.style.position="relative",this.el.style.webkitTransformOrigin="0% 0%",this.el.style.mozTransformOrigin="0% 0%",this.el.style.msTransformOrigin="0% 0%",this.el.style.oTransformOrigin="0% 0%",this.el.style.transformOrigin="0% 0%",this.el.style.position="absolute",this.el.style.backfaceVisibility="hidden",this.el.style.willChange="transform"},end:function(){this.hasInteraction=!1,this.sanitize(),this.update()},bindEvents:function(){var t=this;n(this.container,this),this.resizeHandler=this.update.bind(this),window.addEventListener("resize",this.resizeHandler),Array.from(this.el.querySelectorAll("img")).forEach((function(e){e.addEventListener("load",t.update.bind(t))})),"IMG"===this.el.nodeName&&this.el.addEventListener("load",this.update.bind(this))},update:function(t){t&&"resize"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),t&&"load"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),this.updatePlanned||(this.updatePlanned=!0,window.setTimeout(function(){this.updatePlanned=!1;var t=this.getInitialZoomFactor()*this.zoomFactor,e=-this.offset.x/t,n=-this.offset.y/t,i="scale3d("+t+", "+t+",1) translate3d("+e+"px,"+n+"px,0px)",o="scale("+t+", "+t+") translate("+e+"px,"+n+"px)",r=function(){this.clone&&(this.clone.parentNode.removeChild(this.clone),delete this.clone)}.bind(this);!this.options.use2d||this.hasInteraction||this.inAnimation?(this.is3d=!0,r(),this.el.style.webkitTransform=i,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=i):(this.is3d&&(this.clone=this.el.cloneNode(!0),this.clone.style.pointerEvents="none",this.container.appendChild(this.clone),window.setTimeout(r,200)),this.el.style.webkitTransform=o,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=o,this.is3d=!1)}.bind(this),0))},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},destroy:function(){window.removeEventListener("resize",this.resizeHandler),this.container&&(this.container.remove(),this.container=null)},reset:function(){this.zoomOutAnimation()}};var n=function(t,e){var n=null,i=0,o=null,r=null,a=function(t,i){if(n!==t){if(n&&!t)switch(n){case"zoom":e.handleZoomEnd(i);break;case"drag":e.handleDragEnd(i)}switch(t){case"zoom":e.handleZoomStart(i);break;case"drag":e.handleDragStart(i)}}n=t},s=function(t){2===i?a("zoom"):1===i&&e.canDrag()?a("drag",t):a(null,t)},l=function(t){return Array.from(t).map((function(t){return{x:t.pageX,y:t.pageY}}))},c=function(t,e){var n,i;return n=t.x-e.x,i=t.y-e.y,Math.sqrt(n*n+i*i)},u=function(t){t.stopPropagation(),t.preventDefault()},h=!0;t.addEventListener("touchstart",(function(t){e.enabled&&(h=!0,i=t.touches.length,function(t){var r=(new Date).getTime();if(i>1&&(o=null),r-o<300)switch(u(t),e.handleDoubleTap(t),n){case"zoom":e.handleZoomEnd(t);break;case"drag":e.handleDragEnd(t)}else e.isDoubleTap=!1;1===i&&(o=r)}(t))}),{passive:!1}),t.addEventListener("touchmove",(function(t){if(e.enabled&&!e.isDoubleTap){if(h)s(t),n&&u(t),r=l(t.touches);else{switch(n){case"zoom":2==r.length&&2==t.touches.length&&e.handleZoom(t,function(t,e){var n=c(t[0],t[1]);return c(e[0],e[1])/n}(r,l(t.touches)));break;case"drag":e.handleDrag(t)}n&&(u(t),e.update())}h=!1}}),{passive:!1}),t.addEventListener("touchend",(function(t){e.enabled&&(i=t.touches.length,s(t))})),e.options.useMouseWheel&&(t.addEventListener("mousewheel",(function(t){e.enabled&&(u(t),e.handleMouseWheel(t))})),t.addEventListener("mousedown",(function(t){e.enabled&&(h=!0,i=1)}),{passive:!0}),t.addEventListener("mousemove",(function(t){e.enabled&&(h?(s(t),n&&u(t)):("drag"===n&&e.handleDrag(t),n&&(u(t),e.update())),h=!1)}),{passive:!1}),t.addEventListener("mouseup",(function(t){e.enabled&&(i=0,s(t))}),{passive:!0}))};return t}(),A={scrolling:"BeLzR",root:"nJWgH",layout:"BDoOb",layoutHeader:"iNVA1",layoutContent:"C-jWr",layoutSection:"_3FXm5",layoutAside:"ABw2b",header:"meCSL",headerTitle:"NpSWI",headerClose:"-B9Zg",mainPhotoScrollControls:"ckcap",mainPhoto:"-r4WP BeLzR",mainPhotoItem:"Q7wDI",mainPhotoImage:"NrcBT",mainPhotoIframe:"kObZY",preview:"_86-3f BeLzR",previewItem:"gnB8m",previewButton:"L4PR-",previewImage:"_8dsDI",videoPlayLabel:"_2kU58",videoPlayLabelIcon:"WR7T8",enter:"sM8Qu",exit:"veHZr",enterActive:"VP4oy",exitActive:"AMPJ3"},C=p.forwardRef((function(t,e){var n=t.src,i=t.videoSrc,o=p.useRef(null),r=p.useRef(null),a=p.useRef(null),s=!!i,l=function(){var t,e;null===(t=r.current)||void 0===t||t.reset(),null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")};return p.useEffect((function(){return requestAnimationFrame((function(){a.current&&!s&&(r.current=new _(a.current,{draggableUnzoomed:!1,animationDuration:200,setOffsetsOnce:!1}))})),function(){var t;null===(t=r.current)||void 0===t||t.destroy()}}),[i]),p.useImperativeHandle(e,(function(){return{reset:l}}),[]),s?p.createElement("iframe",{ref:o,className:A.mainPhotoIframe,src:i,width:"100%",height:"100%",allowFullScreen:!0,title:"",loading:"lazy","data-qaid":"photo_gallery_main_video","data-testid":"photo_gallery_main_video"}):p.createElement("img",{ref:a,className:A.mainPhotoImage,src:n,width:"100%",height:"100%",alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_main_image","data-testid":"photo_gallery_main_image"})})),D=p.forwardRef((function(t,e){var n=t.items,i=t.onChange,o=p.useRef([]),r=p.useRef(0),s=p.useRef(null),l=function(){o.current.forEach((function(t){null==t||t.reset()}))},c=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=s.current)||void 0===e?void 0:e.children[t];l(),i&&z(i,s.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:c}}),[]);var u=function(){if(s.current){var t=function(t,e){var n=t.scrollLeft/t.scrollWidth*e;return Math.round(n)}(s.current,n.length);r.current!==t&&(r.current=t,i(t),l())}};return p.createElement(a.ScrollControls,{ref:s,className:A.mainPhotoScrollControls,showOnHover:!0,hideOnDisabled:!0},(function(t){return p.createElement(x,{scrollRef:t,isActive:!0},p.createElement("div",{ref:t,className:A.mainPhoto,onScroll:u},n.map((function(t,e){var n,i=t.type,r=t.src,a="video"===i,s=a?T(r):r,l=a?(n=I(r),"https://youtube.com/embed/".concat(n,"?enablejsapi=1&rel=0")):void 0;return p.createElement("div",{key:e,className:A.mainPhotoItem,"data-qaid":"photo_gallery_main_item","data-testid":"photo_gallery_main_item"},p.createElement(C,{ref:function(t){return o.current[e]=t},src:s,videoSrc:l}))}))))}))})),P=p.forwardRef((function(t,e){var n=t.items,i=t.selectedIndex,o=t.onChange,r=p.useRef(null),a=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=r.current)||void 0===e?void 0:e.children[t];i&&z(i,r.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:a}}),[]);return p.createElement(x,{scrollRef:r,isActive:!0},p.createElement("div",{ref:r,className:A.preview},n.map((function(t,e){var n=t.type,r=t.src,a="video"===n,s=a?T(r):r;return p.createElement("div",{key:e,className:A.previewItem,"data-qaid":"photo_gallery_preview_item","data-testid":"photo_gallery_preview_item"},p.createElement("button",{className:A.previewButton,type:"button",onClick:function(){return function(t){o(t)}(e)},disabled:i===e,"data-qaid":"photo_gallery_preview_button","data-testid":"photo_gallery_preview_button"},p.createElement("img",{className:A.previewImage,src:s,width:58,height:58,alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_preview_image","data-testid":"photo_gallery_preview_image"}),a&&p.createElement("div",{className:A.videoPlayLabel,"data-qaid":"photo_gallery_preview_play","data-testid":"photo_gallery_preview_play"},p.createElement(l.Icon,{className:A.videoPlayLabelIcon,"icon-as":c.SvgPlay}))))}))))})),S=function(t){var e,n,i=t.title,o=t.onClose,r=t.selectedIndex,a=t.itemsLength,s=r+1,c=(0,h.useBodyTTag().t)(E||(e=["Фото "," из ",""],n||(n=e.slice(0)),E=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))),s,a);return p.createElement("div",{className:A.header},p.createElement("div",{className:A.headerTitle,"data-qaid":"photo_gallery_title","data-testid":"photo_gallery_title"},i||c),p.createElement("div",{className:A.headerClose},p.createElement(u.Button,{"button-padding":"xxs","button-theme":"black-inherit",type:"button",onClick:o,"data-qaid":"photo_gallery_close_button","data-testid":"photo_gallery_close_button"},p.createElement(l.Icon,{"icon-as":d.SvgClose,style:{width:24,height:24}}))))};exports.PhotoGallery=function(t){var e=t.isOpen,a=t.title,s=t.visibleIndex,l=void 0===s?0:s,c=t.items,u=t.zIndex,h=void 0===u?5e3:u,d=t.onClose,f=t.onChange,m=p.useRef(!0),y=p.useRef(null),b=p.useRef(null),E=v(p.useState(l),2),w=E[0],x=E[1];p.useEffect((function(){e&&"function"==typeof f&&f(w)}),[w]),p.useEffect((function(){var t,n;e&&(x(l),null===(t=b.current)||void 0===t||t.scrollToIndex(l,!1),null===(n=y.current)||void 0===n||n.scrollToIndex(l,!1))}),[e]),p.useEffect((function(){var t;if(!e)return function(){};var n=null,i=function(){n&&clearTimeout(n)},o=function(){i(),n=setTimeout((function(){var t,e;null===(t=b.current)||void 0===t||t.scrollToIndex(w,!1),null===(e=y.current)||void 0===e||e.scrollToIndex(w,!1)}),100)};return window.addEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.addEventListener("change",o),function(){var t;i(),window.removeEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.removeEventListener("change",o)}}),[e,w]);var O=function(t){var e,n;m.current=!1,x(t),null===(e=b.current)||void 0===e||e.scrollToIndex(t),null===(n=y.current)||void 0===n||n.scrollToIndex(t)},z=function(){d(w)};return p.createElement(p.Fragment,null,p.createElement(i.Backdrop,{isOpen:e,onClick:z,zIndex:h}),p.createElement(n.CSSTransition,{in:e,timeout:240,classNames:A,unmountOnExit:!0},p.createElement(r.Portal,null,p.createElement("div",{className:A.root,"data-qaid":"photo_gallery","data-testid":"photo_gallery",style:{zIndex:h}},p.createElement(g.default,null),p.createElement(o.KeyPress,{code:"Escape",onKeyUp:z}),p.createElement(o.KeyPress,{code:"ArrowLeft",onKeyUp:function(){0!==w&&O(w-1)}}),p.createElement(o.KeyPress,{code:"ArrowRight",onKeyUp:function(){w!==c.length-1&&O(w+1)}}),p.createElement("div",{className:A.layout},p.createElement("header",{className:A.layoutHeader},p.createElement(S,{title:a,selectedIndex:w,itemsLength:c.length,onClose:z})),p.createElement("div",{className:A.layoutContent},p.createElement("section",{className:A.layoutSection},p.createElement(D,{ref:y,items:c,onChange:function(t){var e;m.current&&(x(t),null===(e=b.current)||void 0===e||e.scrollToIndex(t));m.current||w!==t||(m.current=!0)}})),c.length>1&&p.createElement("aside",{className:A.layoutAside},p.createElement(P,{ref:b,items:c,selectedIndex:w,onChange:O}))))))))},require("./style.production.css");
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-scrolllock"),n=require("react-transition-group"),i=require("@prom-ui/core/Backdrop"),o=require("@prom-ui/core/KeyPress"),a=require("@prom-ui/core/Portal"),r=require("@prom-ui/core/ScrollControls"),s=require("react-scrolllock/dist/utils"),l=require("@prom-ui/core/Icon"),c=require("@prom-ui/icons/Play"),u=require("@prom-ui/core/Button"),h=require("@prom-ui/core/useBodyTTag"),d=require("@prom-ui/icons/Close");function f(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function m(t){if(t&&"object"==typeof t&&"default"in t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var p=m(t),g=f(e);function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,a,r,s=[],l=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function b(t){var e=t.currentTarget;return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?(t.stopPropagation(),!0):(t.preventDefault(),!1)}var E,w=!("undefined"==typeof window||!window.document||!window.document.createElement)&&!(!window.addEventListener&&!window.attachEvent),x=function(t){var e=t.isActive,n=void 0!==e&&e,i=t.scrollRef,o=t.children;return p.useEffect((function(){if(n&&w&&null!=i&&i.current)return i.current.addEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.addEventListener("touchmove",b,s.listenerOptions),function(){n&&w&&null!=i&&i.current&&(i.current.removeEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.removeEventListener("touchmove",b,s.listenerOptions))}})),p.createElement(p.Fragment,null,o)},O=new Map,T=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O.has(e)&&(cancelAnimationFrame(O.get(e)),O.delete(e));var i=requestAnimationFrame((function(){var i=e.getBoundingClientRect(),o=t.getBoundingClientRect(),a=o.top+e.scrollTop-i.top-i.height/2+o.height/2,r=o.left+e.scrollLeft-i.left-i.width/2+o.width/2;r<0&&(r=0),a<0&&(a=0),e.scrollTo({behavior:n?"smooth":"instant",top:a,left:r})}));O.set(e,i)},z=function(t){var e=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/.exec(t);return e&&e[1]},I=function(t){var e=z(t);return"https://img.youtube.com/vi/".concat(e,"/0.jpg")},_=function(){var t=function(t,e){this.el=t,this.zoomFactor=1,this.lastScale=1,this.offset={x:0,y:0},this.initialOffset={x:0,y:0},this.options=Object.assign({},this.defaults,e),this.setupMarkup(),this.bindEvents(),this.update(),this.isImageLoaded(this.el)&&(this.updateAspectRatio(),this.setupOffsets()),this.enable()},e=function(t,e){return t+e};t.prototype={defaults:{tapZoomFactor:2,zoomOutFactor:1.3,animationDuration:300,maxZoom:4,minZoom:.5,draggableUnzoomed:!0,lockDragAxis:!1,setOffsetsOnce:!1,use2d:!0,useMouseWheel:!1,verticalPadding:0,horizontalPadding:0,onZoomStart:null,onZoomEnd:null,onZoomUpdate:null,onDragStart:null,onDragEnd:null,onDragUpdate:null,onDoubleTap:null,onMouseWheel:null},handleDragStart:function(t){"function"==typeof this.options.onDragStart&&this.options.onDragStart(this,t),this.stopAnimation(),this.lastDragPosition=!1,this.hasInteraction=!0,this.handleDrag(t)},handleDrag:function(t){var e="touchmove"===t.type?this.getTouches(t)[0]:this.getPointer(t);this.drag(e,this.lastDragPosition),this.offset=this.sanitizeOffset(this.offset),this.lastDragPosition=e},handleDragEnd:function(){"function"==typeof this.options.onDragEnd&&this.options.onDragEnd(this,event),this.end()},handleZoomStart:function(t){"function"==typeof this.options.onZoomStart&&this.options.onZoomStart(this,t),this.stopAnimation(),this.lastScale=1,this.nthZoom=0,this.lastZoomCenter=!1,this.hasInteraction=!0},handleZoom:function(t,e){var n=this.getTouchCenter(this.getTouches(t)),i=e/this.lastScale;this.lastScale=e,this.nthZoom+=1,this.nthZoom>3&&(this.scale(i,n),this.drag(n,this.lastZoomCenter)),this.lastZoomCenter=n},handleZoomEnd:function(){"function"==typeof this.options.onZoomEnd&&this.options.onZoomEnd(this,event),this.end()},handleDoubleTap:function(t){var e=this.getTouches(t)[0],n=this.zoomFactor>1?1:this.options.tapZoomFactor,i=this.zoomFactor,o=function(t){this.scaleTo(i+t*(n-i),e)}.bind(this);this.hasInteraction||(this.isDoubleTap=!0,i>n&&(e=this.getCurrentZoomCenter()),this.animate(this.options.animationDuration,o,this.swing),"function"==typeof this.options.onDoubleTap&&this.options.onDoubleTap(this,t))},handleMouseWheel:function(t){var e=this.getPointer(t),n=Math.min(Math.max(this.options.minZoom,this.lastScale+-.01*t.deltaY),this.options.maxZoom),i=n/this.lastScale;this.scale(i,e),this.lastScale=n,this.update(),"function"==typeof this.options.onMouseWheel&&this.options.onMouseWheel(this,t)},computeInitialOffset:function(){this.initialOffset={x:-Math.abs(this.el.offsetWidth*this.getInitialZoomFactor()-this.container.offsetWidth)/2,y:-Math.abs(this.el.offsetHeight*this.getInitialZoomFactor()-this.container.offsetHeight)/2}},resetOffset:function(){this.offset.x=this.initialOffset.x,this.offset.y=this.initialOffset.y},isImageLoaded:function(t){return"IMG"===t.nodeName?t.complete&&0!==t.naturalHeight:Array.from(t.querySelectorAll("img")).every(this.isImageLoaded)},setupOffsets:function(){this.options.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this.computeInitialOffset(),this.resetOffset())},sanitizeOffset:function(t){var e=this.el.offsetWidth*this.getInitialZoomFactor()*this.zoomFactor,n=this.el.offsetHeight*this.getInitialZoomFactor()*this.zoomFactor,i=e-this.getContainerX()+this.options.horizontalPadding,o=n-this.getContainerY()+this.options.verticalPadding,a=Math.max(i,0),r=Math.max(o,0),s=Math.min(i,0)-this.options.horizontalPadding,l=Math.min(o,0)-this.options.verticalPadding;return{x:Math.min(Math.max(t.x,s),a),y:Math.min(Math.max(t.y,l),r)}},scaleTo:function(t,e){this.scale(t/this.zoomFactor,e)},scale:function(t,e){t=this.scaleZoomFactor(t),this.addOffset({x:(t-1)*(e.x+this.offset.x),y:(t-1)*(e.y+this.offset.y)}),"function"==typeof this.options.onZoomUpdate&&this.options.onZoomUpdate(this,event)},scaleZoomFactor:function(t){var e=this.zoomFactor;return this.zoomFactor*=t,this.zoomFactor=Math.min(this.options.maxZoom,Math.max(this.zoomFactor,this.options.minZoom)),this.zoomFactor/e},canDrag:function(){return this.options.draggableUnzoomed||!((t=this.zoomFactor)>(e=1)-.01&&t<e+.01);var t,e},drag:function(t,e){e&&(this.options.lockDragAxis?Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?this.addOffset({x:-(t.x-e.x),y:0}):this.addOffset({y:-(t.y-e.y),x:0}):this.addOffset({y:-(t.y-e.y),x:-(t.x-e.x)}),"function"==typeof this.options.onDragUpdate&&this.options.onDragUpdate(this,event))},getTouchCenter:function(t){return this.getVectorAvg(t)},getVectorAvg:function(t){return{x:t.map((function(t){return t.x})).reduce(e)/t.length,y:t.map((function(t){return t.y})).reduce(e)/t.length}},addOffset:function(t){this.offset={x:this.offset.x+t.x,y:this.offset.y+t.y}},sanitize:function(){this.zoomFactor<this.options.zoomOutFactor?this.zoomOutAnimation():this.isInsaneOffset(this.offset)&&this.sanitizeOffsetAnimation()},isInsaneOffset:function(t){var e=this.sanitizeOffset(t);return e.x!==t.x||e.y!==t.y},sanitizeOffsetAnimation:function(){var t=this.sanitizeOffset(this.offset),e=this.offset.x,n=this.offset.y,i=function(i){this.offset.x=e+i*(t.x-e),this.offset.y=n+i*(t.y-n),this.update()}.bind(this);this.animate(this.options.animationDuration,i,this.swing)},zoomOutAnimation:function(){if(1!==this.zoomFactor){var t=this.zoomFactor,e=this.getCurrentZoomCenter(),n=function(n){this.scaleTo(t+n*(1-t),e)}.bind(this);this.animate(this.options.animationDuration,n,this.swing)}},updateAspectRatio:function(){this.unsetContainerY(),this.setContainerY(this.container.parentElement.offsetHeight)},getInitialZoomFactor:function(){var t=this.container.offsetWidth/this.el.offsetWidth,e=this.container.offsetHeight/this.el.offsetHeight;return Math.min(t,e)},getAspectRatio:function(){return this.el.offsetWidth/this.el.offsetHeight},getCurrentZoomCenter:function(){var t=this.offset.x-this.initialOffset.x,e=-1*this.offset.x-t/(1/this.zoomFactor-1),n=this.offset.y-this.initialOffset.y;return{x:e,y:-1*this.offset.y-n/(1/this.zoomFactor-1)}},getTouches:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,a=e.left+i;return Array.prototype.slice.call(t.touches).map((function(t){return{x:t.pageX-a,y:t.pageY-o}}))},getPointer:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,a=e.left+i;return{x:t.pageX-a,y:t.pageY-o}},animate:function(t,e,n,i){var o=(new Date).getTime(),a=function(){if(this.inAnimation){var r=(new Date).getTime()-o,s=r/t;r>=t?(e(1),i&&i(),this.update(),this.stopAnimation(),this.update()):(n&&(s=n(s)),e(s),this.update(),requestAnimationFrame(a))}}.bind(this);this.inAnimation=!0,requestAnimationFrame(a)},stopAnimation:function(){this.inAnimation=!1},swing:function(t){return-Math.cos(t*Math.PI)/2+.5},getContainerX:function(){return this.container.offsetWidth},getContainerY:function(){return this.container.offsetHeight},setContainerY:function(t){return this.container.style.height=t+"px"},unsetContainerY:function(){this.container.style.height=null},setupMarkup:function(){var t,e;this.container=(t='<div class="pinch-zoom-container"></div>',(e=document.implementation.createHTMLDocument("")).body.innerHTML=t,Array.from(e.body.children)[0]),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el),this.container.style.overflow="hidden",this.container.style.position="relative",this.el.style.webkitTransformOrigin="0% 0%",this.el.style.mozTransformOrigin="0% 0%",this.el.style.msTransformOrigin="0% 0%",this.el.style.oTransformOrigin="0% 0%",this.el.style.transformOrigin="0% 0%",this.el.style.position="absolute",this.el.style.backfaceVisibility="hidden",this.el.style.willChange="transform"},end:function(){this.hasInteraction=!1,this.sanitize(),this.update()},bindEvents:function(){var t=this;n(this.container,this),this.resizeHandler=this.update.bind(this),window.addEventListener("resize",this.resizeHandler),Array.from(this.el.querySelectorAll("img")).forEach((function(e){e.addEventListener("load",t.update.bind(t))})),"IMG"===this.el.nodeName&&this.el.addEventListener("load",this.update.bind(this))},update:function(t){t&&"resize"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),t&&"load"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),this.updatePlanned||(this.updatePlanned=!0,window.setTimeout(function(){this.updatePlanned=!1;var t=this.getInitialZoomFactor()*this.zoomFactor,e=-this.offset.x/t,n=-this.offset.y/t,i="scale3d("+t+", "+t+",1) translate3d("+e+"px,"+n+"px,0px)",o="scale("+t+", "+t+") translate("+e+"px,"+n+"px)",a=function(){this.clone&&(this.clone.parentNode.removeChild(this.clone),delete this.clone)}.bind(this);!this.options.use2d||this.hasInteraction||this.inAnimation?(this.is3d=!0,a(),this.el.style.webkitTransform=i,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=i):(this.is3d&&(this.clone=this.el.cloneNode(!0),this.clone.style.pointerEvents="none",this.container.appendChild(this.clone),window.setTimeout(a,200)),this.el.style.webkitTransform=o,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=o,this.is3d=!1)}.bind(this),0))},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},destroy:function(){window.removeEventListener("resize",this.resizeHandler),this.container&&(this.container.remove(),this.container=null)},reset:function(){this.zoomOutAnimation()}};var n=function(t,e){var n=null,i=0,o=null,a=null,r=function(t,i){if(n!==t){if(n&&!t)switch(n){case"zoom":e.handleZoomEnd(i);break;case"drag":e.handleDragEnd(i)}switch(t){case"zoom":e.handleZoomStart(i);break;case"drag":e.handleDragStart(i)}}n=t},s=function(t){2===i?r("zoom"):1===i&&e.canDrag()?r("drag",t):r(null,t)},l=function(t){return Array.from(t).map((function(t){return{x:t.pageX,y:t.pageY}}))},c=function(t,e){var n,i;return n=t.x-e.x,i=t.y-e.y,Math.sqrt(n*n+i*i)},u=function(t){t.stopPropagation(),t.preventDefault()},h=!0;t.addEventListener("touchstart",(function(t){e.enabled&&(h=!0,i=t.touches.length,function(t){var a=(new Date).getTime();if(i>1&&(o=null),a-o<300)switch(u(t),e.handleDoubleTap(t),n){case"zoom":e.handleZoomEnd(t);break;case"drag":e.handleDragEnd(t)}else e.isDoubleTap=!1;1===i&&(o=a)}(t))}),{passive:!1}),t.addEventListener("touchmove",(function(t){if(e.enabled&&!e.isDoubleTap){if(h)s(t),n&&u(t),a=l(t.touches);else{switch(n){case"zoom":2==a.length&&2==t.touches.length&&e.handleZoom(t,function(t,e){var n=c(t[0],t[1]);return c(e[0],e[1])/n}(a,l(t.touches)));break;case"drag":e.handleDrag(t)}n&&(u(t),e.update())}h=!1}}),{passive:!1}),t.addEventListener("touchend",(function(t){e.enabled&&(i=t.touches.length,s(t))})),e.options.useMouseWheel&&(t.addEventListener("mousewheel",(function(t){e.enabled&&(u(t),e.handleMouseWheel(t))})),t.addEventListener("mousedown",(function(t){e.enabled&&(h=!0,i=1)}),{passive:!0}),t.addEventListener("mousemove",(function(t){e.enabled&&(h?(s(t),n&&u(t)):("drag"===n&&e.handleDrag(t),n&&(u(t),e.update())),h=!1)}),{passive:!1}),t.addEventListener("mouseup",(function(t){e.enabled&&(i=0,s(t))}),{passive:!0}))};return t}(),C={scrolling:"q1DKc",root:"KiBKq",layout:"JBDok",layoutHeader:"tVG4b",layoutContent:"O43ff",layoutSection:"CvZb6",layoutAside:"fdKgJ",header:"xfAad",headerTitle:"QiOEy",headerClose:"qdl3x",mainPhotoScrollControls:"PeY3Y",mainPhoto:"QIMHy q1DKc",mainPhotoItem:"aZCyk",mainPhotoImage:"_2aEr5",mainPhotoIframe:"kThdT",preview:"F-k0z q1DKc",previewItem:"jf683",previewButton:"VAXOP",previewImage:"Mx2Y-",videoPlayLabel:"jQiDN",videoPlayLabelIcon:"wSdjd",enter:"Lnosr",exit:"NW-xY",enterActive:"LrirU",exitActive:"L6st-"},A=p.forwardRef((function(t,e){var n=t.src,i=t.videoSrc,o=p.useRef(null),a=p.useRef(null),r=p.useRef(null),s=!!i,l=function(){var t,e;null===(t=a.current)||void 0===t||t.reset(),null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")};return p.useEffect((function(){return requestAnimationFrame((function(){r.current&&!s&&(a.current=new _(r.current,{draggableUnzoomed:!1,animationDuration:200}))})),function(){var t;null===(t=a.current)||void 0===t||t.destroy()}}),[i]),p.useImperativeHandle(e,(function(){return{reset:l}}),[]),s?p.createElement("iframe",{ref:o,className:C.mainPhotoIframe,src:i,width:"100%",height:"100%",allowFullScreen:!0,title:"",loading:"lazy","data-qaid":"photo_gallery_main_video","data-testid":"photo_gallery_main_video"}):p.createElement("img",{ref:r,className:C.mainPhotoImage,src:n,width:"100%",height:"100%",alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_main_image","data-testid":"photo_gallery_main_image"})})),D=p.forwardRef((function(t,e){var n=t.items,i=t.onChange,o=p.useRef([]),a=p.useRef(0),s=p.useRef(null),l=function(){o.current.forEach((function(t){null==t||t.reset()}))},c=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=s.current)||void 0===e?void 0:e.children[t];l(),i&&T(i,s.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:c}}),[]);var u=function(){if(s.current){var t=function(t,e){var n=t.scrollLeft/t.scrollWidth*e;return Math.round(n)}(s.current,n.length);a.current!==t&&(a.current=t,i(t),l())}};return p.createElement(r.ScrollControls,{ref:s,className:C.mainPhotoScrollControls,showOnHover:!0,hideOnDisabled:!0},(function(t){return p.createElement(x,{scrollRef:t,isActive:!0},p.createElement("div",{ref:t,className:C.mainPhoto,onScroll:u},n.map((function(t,e){var n,i=t.type,a=t.src,r="video"===i,s=r?I(a):a,l=r?(n=z(a),"https://youtube.com/embed/".concat(n,"?enablejsapi=1&rel=0")):void 0;return p.createElement("div",{key:e,className:C.mainPhotoItem,"data-qaid":"photo_gallery_main_item","data-testid":"photo_gallery_main_item"},p.createElement(A,{ref:function(t){return o.current[e]=t},src:s,videoSrc:l}))}))))}))})),P=p.forwardRef((function(t,e){var n=t.items,i=t.selectedIndex,o=t.onChange,a=p.useRef(null),r=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=a.current)||void 0===e?void 0:e.children[t];i&&T(i,a.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:r}}),[]);return p.createElement(x,{scrollRef:a,isActive:!0},p.createElement("div",{ref:a,className:C.preview},n.map((function(t,e){var n=t.type,a=t.src,r="video"===n,s=r?I(a):a;return p.createElement("div",{key:e,className:C.previewItem,"data-qaid":"photo_gallery_preview_item","data-testid":"photo_gallery_preview_item"},p.createElement("button",{className:C.previewButton,type:"button",onClick:function(){return function(t){o(t)}(e)},disabled:i===e,"data-qaid":"photo_gallery_preview_button","data-testid":"photo_gallery_preview_button"},p.createElement("img",{className:C.previewImage,src:s,width:58,height:58,alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_preview_image","data-testid":"photo_gallery_preview_image"}),r&&p.createElement("div",{className:C.videoPlayLabel,"data-qaid":"photo_gallery_preview_play","data-testid":"photo_gallery_preview_play"},p.createElement(l.Icon,{className:C.videoPlayLabelIcon,"icon-as":c.SvgPlay}))))}))))})),S=function(t){var e,n,i=t.title,o=t.onClose,a=t.selectedIndex,r=t.itemsLength,s=a+1,c=(0,h.useBodyTTag().t)(E||(e=["Фото "," из ",""],n||(n=e.slice(0)),E=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))),s,r);return p.createElement("div",{className:C.header},p.createElement("div",{className:C.headerTitle,"data-qaid":"photo_gallery_title","data-testid":"photo_gallery_title"},i||c),p.createElement("div",{className:C.headerClose},p.createElement(u.Button,{"button-padding":"xxs","button-theme":"black-inherit",type:"button",onClick:o,"data-qaid":"photo_gallery_close_button","data-testid":"photo_gallery_close_button"},p.createElement(l.Icon,{"icon-as":d.SvgClose,style:{width:24,height:24}}))))};exports.PhotoGallery=function(t){var e=t.isOpen,r=t.title,s=t.visibleIndex,l=void 0===s?0:s,c=t.items,u=t.onClose,h=t.onChange,d=p.useRef(!0),f=p.useRef(null),m=p.useRef(null),y=v(p.useState(l),2),b=y[0],E=y[1];p.useEffect((function(){e&&"function"==typeof h&&h(b)}),[b]),p.useEffect((function(){var t,n;e&&(E(l),null===(t=m.current)||void 0===t||t.scrollToIndex(l,!1),null===(n=f.current)||void 0===n||n.scrollToIndex(l,!1))}),[e]),p.useEffect((function(){var t;if(!e)return function(){};var n=null,i=function(){n&&clearTimeout(n)},o=function(){i(),n=setTimeout((function(){var t,e;null===(t=m.current)||void 0===t||t.scrollToIndex(b,!1),null===(e=f.current)||void 0===e||e.scrollToIndex(b,!1)}),100)};return window.addEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.addEventListener("change",o),function(){var t;i(),window.removeEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.removeEventListener("change",o)}}),[e,b]);var w=function(t){var e,n;d.current=!1,E(t),null===(e=m.current)||void 0===e||e.scrollToIndex(t),null===(n=f.current)||void 0===n||n.scrollToIndex(t)},x=function(){u(b)};return p.createElement(p.Fragment,null,p.createElement(i.Backdrop,{isOpen:e,onClick:x}),p.createElement(n.CSSTransition,{in:e,timeout:240,classNames:C,unmountOnExit:!0},p.createElement(a.Portal,null,p.createElement("div",{className:C.root,"data-qaid":"photo_gallery","data-testid":"photo_gallery"},p.createElement(g.default,null),p.createElement(o.KeyPress,{code:"Escape",onKeyUp:x}),p.createElement(o.KeyPress,{code:"ArrowLeft",onKeyUp:function(){0!==b&&w(b-1)}}),p.createElement(o.KeyPress,{code:"ArrowRight",onKeyUp:function(){b!==c.length-1&&w(b+1)}}),p.createElement("div",{className:C.layout},p.createElement("header",{className:C.layoutHeader},p.createElement(S,{title:r,selectedIndex:b,itemsLength:c.length,onClose:x})),p.createElement("div",{className:C.layoutContent},p.createElement("section",{className:C.layoutSection},p.createElement(D,{ref:f,items:c,onChange:function(t){var e;d.current&&(E(t),null===(e=m.current)||void 0===e||e.scrollToIndex(t));d.current||b!==t||(d.current=!0)}})),c.length>1&&p.createElement("aside",{className:C.layoutAside},p.createElement(P,{ref:m,items:c,selectedIndex:b,onChange:w}))))))))},require("./style.production.v2.css");
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("react"),e=require("react-scrolllock"),n=require("react-transition-group"),i=require("@prom-ui/core/Backdrop"),o=require("@prom-ui/core/KeyPress"),a=require("@prom-ui/core/Portal"),r=require("@prom-ui/core/ScrollControls"),s=require("react-scrolllock/dist/utils"),l=require("@prom-ui/core/Icon"),c=require("@prom-ui/icons/Play"),u=require("@prom-ui/core/Button"),h=require("@prom-ui/core/useBodyTTag"),d=require("@prom-ui/icons/Close");function f(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function m(t){if(t&&"object"==typeof t&&"default"in t)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var p=m(t),g=f(e);function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,a,r,s=[],l=!0,c=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=a.call(n)).done)&&(s.push(i.value),s.length!==e);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw o}}return s}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function b(t){var e=t.currentTarget;return e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth?(t.stopPropagation(),!0):(t.preventDefault(),!1)}var E,x=!("undefined"==typeof window||!window.document||!window.document.createElement)&&!(!window.addEventListener&&!window.attachEvent),w=function(t){var e=t.isActive,n=void 0!==e&&e,i=t.scrollRef,o=t.children;return p.useEffect((function(){if(n&&x&&null!=i&&i.current)return i.current.addEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.addEventListener("touchmove",b,s.listenerOptions),function(){n&&x&&null!=i&&i.current&&(i.current.removeEventListener("touchstart",s.preventInertiaScroll,s.listenerOptions),i.current.removeEventListener("touchmove",b,s.listenerOptions))}})),p.createElement(p.Fragment,null,o)},O=new Map,z=function(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];O.has(e)&&(cancelAnimationFrame(O.get(e)),O.delete(e));var i=requestAnimationFrame((function(){var i=e.getBoundingClientRect(),o=t.getBoundingClientRect(),a=o.top+e.scrollTop-i.top-i.height/2+o.height/2,r=o.left+e.scrollLeft-i.left-i.width/2+o.width/2;r<0&&(r=0),a<0&&(a=0),e.scrollTo({behavior:n?"smooth":"instant",top:a,left:r})}));O.set(e,i)},T=function(t){var e=/^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?v(?:i)?=|\&v(?:i)?=))([^#\&\?]*).*/.exec(t);return e&&e[1]},I=function(t){var e=T(t);return"https://img.youtube.com/vi/".concat(e,"/0.jpg")},_=function(){var t=function(t,e){this.el=t,this.zoomFactor=1,this.lastScale=1,this.offset={x:0,y:0},this.initialOffset={x:0,y:0},this.options=Object.assign({},this.defaults,e),this.setupMarkup(),this.bindEvents(),this.update(),this.isImageLoaded(this.el)&&(this.updateAspectRatio(),this.setupOffsets()),this.enable()},e=function(t,e){return t+e};t.prototype={defaults:{tapZoomFactor:2,zoomOutFactor:1.3,animationDuration:300,maxZoom:4,minZoom:.5,draggableUnzoomed:!0,lockDragAxis:!1,setOffsetsOnce:!1,use2d:!0,useMouseWheel:!1,verticalPadding:0,horizontalPadding:0,onZoomStart:null,onZoomEnd:null,onZoomUpdate:null,onDragStart:null,onDragEnd:null,onDragUpdate:null,onDoubleTap:null,onMouseWheel:null},handleDragStart:function(t){"function"==typeof this.options.onDragStart&&this.options.onDragStart(this,t),this.stopAnimation(),this.lastDragPosition=!1,this.hasInteraction=!0,this.handleDrag(t)},handleDrag:function(t){var e="touchmove"===t.type?this.getTouches(t)[0]:this.getPointer(t);this.drag(e,this.lastDragPosition),this.offset=this.sanitizeOffset(this.offset),this.lastDragPosition=e},handleDragEnd:function(){"function"==typeof this.options.onDragEnd&&this.options.onDragEnd(this,event),this.end()},handleZoomStart:function(t){"function"==typeof this.options.onZoomStart&&this.options.onZoomStart(this,t),this.stopAnimation(),this.lastScale=1,this.nthZoom=0,this.lastZoomCenter=!1,this.hasInteraction=!0},handleZoom:function(t,e){var n=this.getTouchCenter(this.getTouches(t)),i=e/this.lastScale;this.lastScale=e,this.nthZoom+=1,this.nthZoom>3&&(this.scale(i,n),this.drag(n,this.lastZoomCenter)),this.lastZoomCenter=n},handleZoomEnd:function(){"function"==typeof this.options.onZoomEnd&&this.options.onZoomEnd(this,event),this.end()},handleDoubleTap:function(t){var e=this.getTouches(t)[0],n=this.zoomFactor>1?1:this.options.tapZoomFactor,i=this.zoomFactor,o=function(t){this.scaleTo(i+t*(n-i),e)}.bind(this);this.hasInteraction||(this.isDoubleTap=!0,i>n&&(e=this.getCurrentZoomCenter()),this.animate(this.options.animationDuration,o,this.swing),"function"==typeof this.options.onDoubleTap&&this.options.onDoubleTap(this,t))},handleMouseWheel:function(t){var e=this.getPointer(t),n=Math.min(Math.max(this.options.minZoom,this.lastScale+-.01*t.deltaY),this.options.maxZoom),i=n/this.lastScale;this.scale(i,e),this.lastScale=n,this.update(),"function"==typeof this.options.onMouseWheel&&this.options.onMouseWheel(this,t)},computeInitialOffset:function(){this.initialOffset={x:-Math.abs(this.el.offsetWidth*this.getInitialZoomFactor()-this.container.offsetWidth)/2,y:-Math.abs(this.el.offsetHeight*this.getInitialZoomFactor()-this.container.offsetHeight)/2}},resetOffset:function(){this.offset.x=this.initialOffset.x,this.offset.y=this.initialOffset.y},isImageLoaded:function(t){return"IMG"===t.nodeName?t.complete&&0!==t.naturalHeight:Array.from(t.querySelectorAll("img")).every(this.isImageLoaded)},setupOffsets:function(){this.options.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this.computeInitialOffset(),this.resetOffset())},sanitizeOffset:function(t){var e=this.el.offsetWidth*this.getInitialZoomFactor()*this.zoomFactor,n=this.el.offsetHeight*this.getInitialZoomFactor()*this.zoomFactor,i=e-this.getContainerX()+this.options.horizontalPadding,o=n-this.getContainerY()+this.options.verticalPadding,a=Math.max(i,0),r=Math.max(o,0),s=Math.min(i,0)-this.options.horizontalPadding,l=Math.min(o,0)-this.options.verticalPadding;return{x:Math.min(Math.max(t.x,s),a),y:Math.min(Math.max(t.y,l),r)}},scaleTo:function(t,e){this.scale(t/this.zoomFactor,e)},scale:function(t,e){t=this.scaleZoomFactor(t),this.addOffset({x:(t-1)*(e.x+this.offset.x),y:(t-1)*(e.y+this.offset.y)}),"function"==typeof this.options.onZoomUpdate&&this.options.onZoomUpdate(this,event)},scaleZoomFactor:function(t){var e=this.zoomFactor;return this.zoomFactor*=t,this.zoomFactor=Math.min(this.options.maxZoom,Math.max(this.zoomFactor,this.options.minZoom)),this.zoomFactor/e},canDrag:function(){return this.options.draggableUnzoomed||!((t=this.zoomFactor)>(e=1)-.01&&t<e+.01);var t,e},drag:function(t,e){e&&(this.options.lockDragAxis?Math.abs(t.x-e.x)>Math.abs(t.y-e.y)?this.addOffset({x:-(t.x-e.x),y:0}):this.addOffset({y:-(t.y-e.y),x:0}):this.addOffset({y:-(t.y-e.y),x:-(t.x-e.x)}),"function"==typeof this.options.onDragUpdate&&this.options.onDragUpdate(this,event))},getTouchCenter:function(t){return this.getVectorAvg(t)},getVectorAvg:function(t){return{x:t.map((function(t){return t.x})).reduce(e)/t.length,y:t.map((function(t){return t.y})).reduce(e)/t.length}},addOffset:function(t){this.offset={x:this.offset.x+t.x,y:this.offset.y+t.y}},sanitize:function(){this.zoomFactor<this.options.zoomOutFactor?this.zoomOutAnimation():this.isInsaneOffset(this.offset)&&this.sanitizeOffsetAnimation()},isInsaneOffset:function(t){var e=this.sanitizeOffset(t);return e.x!==t.x||e.y!==t.y},sanitizeOffsetAnimation:function(){var t=this.sanitizeOffset(this.offset),e=this.offset.x,n=this.offset.y,i=function(i){this.offset.x=e+i*(t.x-e),this.offset.y=n+i*(t.y-n),this.update()}.bind(this);this.animate(this.options.animationDuration,i,this.swing)},zoomOutAnimation:function(){if(1!==this.zoomFactor){var t=this.zoomFactor,e=this.getCurrentZoomCenter(),n=function(n){this.scaleTo(t+n*(1-t),e)}.bind(this);this.animate(this.options.animationDuration,n,this.swing)}},updateAspectRatio:function(){this.unsetContainerY(),this.setContainerY(this.container.parentElement.offsetHeight)},getInitialZoomFactor:function(){var t=this.container.offsetWidth/this.el.offsetWidth,e=this.container.offsetHeight/this.el.offsetHeight;return Math.min(t,e)},getAspectRatio:function(){return this.el.offsetWidth/this.el.offsetHeight},getCurrentZoomCenter:function(){var t=this.offset.x-this.initialOffset.x,e=-1*this.offset.x-t/(1/this.zoomFactor-1),n=this.offset.y-this.initialOffset.y;return{x:e,y:-1*this.offset.y-n/(1/this.zoomFactor-1)}},getTouches:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,a=e.left+i;return Array.prototype.slice.call(t.touches).map((function(t){return{x:t.pageX-a,y:t.pageY-o}}))},getPointer:function(t){var e=this.container.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop,i=document.documentElement.scrollLeft||document.body.scrollLeft,o=e.top+n,a=e.left+i;return{x:t.pageX-a,y:t.pageY-o}},animate:function(t,e,n,i){var o=(new Date).getTime(),a=function(){if(this.inAnimation){var r=(new Date).getTime()-o,s=r/t;r>=t?(e(1),i&&i(),this.update(),this.stopAnimation(),this.update()):(n&&(s=n(s)),e(s),this.update(),requestAnimationFrame(a))}}.bind(this);this.inAnimation=!0,requestAnimationFrame(a)},stopAnimation:function(){this.inAnimation=!1},swing:function(t){return-Math.cos(t*Math.PI)/2+.5},getContainerX:function(){return this.container.offsetWidth},getContainerY:function(){return this.container.offsetHeight},setContainerY:function(t){return this.container.style.height=t+"px"},unsetContainerY:function(){this.container.style.height=null},setupMarkup:function(){var t,e;this.container=(t='<div class="pinch-zoom-container" style="height: 100%;"></div>',(e=document.implementation.createHTMLDocument("")).body.innerHTML=t,Array.from(e.body.children)[0]),this.el.parentNode.insertBefore(this.container,this.el),this.container.appendChild(this.el),this.container.style.overflow="hidden",this.container.style.position="relative",this.el.style.webkitTransformOrigin="0% 0%",this.el.style.mozTransformOrigin="0% 0%",this.el.style.msTransformOrigin="0% 0%",this.el.style.oTransformOrigin="0% 0%",this.el.style.transformOrigin="0% 0%",this.el.style.position="absolute",this.el.style.backfaceVisibility="hidden",this.el.style.willChange="transform"},end:function(){this.hasInteraction=!1,this.sanitize(),this.update()},bindEvents:function(){var t=this;n(this.container,this),this.resizeHandler=this.update.bind(this),window.addEventListener("resize",this.resizeHandler),Array.from(this.el.querySelectorAll("img")).forEach((function(e){e.addEventListener("load",t.update.bind(t))})),"IMG"===this.el.nodeName&&this.el.addEventListener("load",this.update.bind(this))},update:function(t){t&&"resize"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),t&&"load"===t.type&&(this.updateAspectRatio(),this.setupOffsets()),this.updatePlanned||(this.updatePlanned=!0,window.setTimeout(function(){this.updatePlanned=!1;var t=this.getInitialZoomFactor()*this.zoomFactor,e=-this.offset.x/t,n=-this.offset.y/t,i="scale3d("+t+", "+t+",1) translate3d("+e+"px,"+n+"px,0px)",o="scale("+t+", "+t+") translate("+e+"px,"+n+"px)",a=function(){this.clone&&(this.clone.parentNode.removeChild(this.clone),delete this.clone)}.bind(this);!this.options.use2d||this.hasInteraction||this.inAnimation?(this.is3d=!0,a(),this.el.style.webkitTransform=i,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=i):(this.is3d&&(this.clone=this.el.cloneNode(!0),this.clone.style.pointerEvents="none",this.container.appendChild(this.clone),window.setTimeout(a,200)),this.el.style.webkitTransform=o,this.el.style.mozTransform=o,this.el.style.msTransform=o,this.el.style.oTransform=o,this.el.style.transform=o,this.is3d=!1)}.bind(this),0))},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},destroy:function(){window.removeEventListener("resize",this.resizeHandler),this.container&&(this.container.remove(),this.container=null)},reset:function(){this.zoomOutAnimation()}};var n=function(t,e){var n=null,i=0,o=null,a=null,r=function(t,i){if(n!==t){if(n&&!t)switch(n){case"zoom":e.handleZoomEnd(i);break;case"drag":e.handleDragEnd(i)}switch(t){case"zoom":e.handleZoomStart(i);break;case"drag":e.handleDragStart(i)}}n=t},s=function(t){2===i?r("zoom"):1===i&&e.canDrag()?r("drag",t):r(null,t)},l=function(t){return Array.from(t).map((function(t){return{x:t.pageX,y:t.pageY}}))},c=function(t,e){var n,i;return n=t.x-e.x,i=t.y-e.y,Math.sqrt(n*n+i*i)},u=function(t){t.stopPropagation(),t.preventDefault()},h=!0;t.addEventListener("touchstart",(function(t){e.enabled&&(h=!0,i=t.touches.length,function(t){var a=(new Date).getTime();if(i>1&&(o=null),a-o<300)switch(u(t),e.handleDoubleTap(t),n){case"zoom":e.handleZoomEnd(t);break;case"drag":e.handleDragEnd(t)}else e.isDoubleTap=!1;1===i&&(o=a)}(t))}),{passive:!1}),t.addEventListener("touchmove",(function(t){if(e.enabled&&!e.isDoubleTap){if(h)s(t),n&&u(t),a=l(t.touches);else{switch(n){case"zoom":2==a.length&&2==t.touches.length&&e.handleZoom(t,function(t,e){var n=c(t[0],t[1]);return c(e[0],e[1])/n}(a,l(t.touches)));break;case"drag":e.handleDrag(t)}n&&(u(t),e.update())}h=!1}}),{passive:!1}),t.addEventListener("touchend",(function(t){e.enabled&&(i=t.touches.length,s(t))})),e.options.useMouseWheel&&(t.addEventListener("mousewheel",(function(t){e.enabled&&(u(t),e.handleMouseWheel(t))})),t.addEventListener("mousedown",(function(t){e.enabled&&(h=!0,i=1)}),{passive:!0}),t.addEventListener("mousemove",(function(t){e.enabled&&(h?(s(t),n&&u(t)):("drag"===n&&e.handleDrag(t),n&&(u(t),e.update())),h=!1)}),{passive:!1}),t.addEventListener("mouseup",(function(t){e.enabled&&(i=0,s(t))}),{passive:!0}))};return t}(),C={scrolling:"q1DKc",root:"KiBKq",layout:"JBDok",layoutHeader:"tVG4b",layoutContent:"O43ff",layoutSection:"CvZb6",layoutAside:"fdKgJ",header:"xfAad",headerTitle:"QiOEy",headerClose:"qdl3x",mainPhotoScrollControls:"PeY3Y",mainPhoto:"QIMHy q1DKc",mainPhotoItem:"aZCyk",mainPhotoImage:"_2aEr5",mainPhotoIframe:"kThdT",preview:"F-k0z q1DKc",previewItem:"jf683",previewButton:"VAXOP",previewImage:"Mx2Y-",videoPlayLabel:"jQiDN",videoPlayLabelIcon:"wSdjd",enter:"Lnosr",exit:"NW-xY",enterActive:"LrirU",exitActive:"L6st-"},A=p.forwardRef((function(t,e){var n=t.src,i=t.videoSrc,o=p.useRef(null),a=p.useRef(null),r=p.useRef(null),s=!!i,l=function(){var t,e;null===(t=a.current)||void 0===t||t.reset(),null===(e=o.current)||void 0===e||null===(e=e.contentWindow)||void 0===e||e.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")};return p.useEffect((function(){return requestAnimationFrame((function(){r.current&&!s&&(a.current=new _(r.current,{draggableUnzoomed:!1,animationDuration:200,setOffsetsOnce:!1}))})),function(){var t;null===(t=a.current)||void 0===t||t.destroy()}}),[i]),p.useImperativeHandle(e,(function(){return{reset:l}}),[]),s?p.createElement("iframe",{ref:o,className:C.mainPhotoIframe,src:i,width:"100%",height:"100%",allowFullScreen:!0,title:"",loading:"lazy","data-qaid":"photo_gallery_main_video","data-testid":"photo_gallery_main_video"}):p.createElement("img",{ref:r,className:C.mainPhotoImage,src:n,width:"100%",height:"100%",alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_main_image","data-testid":"photo_gallery_main_image"})})),D=p.forwardRef((function(t,e){var n=t.items,i=t.onChange,o=p.useRef([]),a=p.useRef(0),s=p.useRef(null),l=function(){o.current.forEach((function(t){null==t||t.reset()}))},c=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=s.current)||void 0===e?void 0:e.children[t];l(),i&&z(i,s.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:c}}),[]);var u=function(){if(s.current){var t=function(t,e){var n=t.scrollLeft/t.scrollWidth*e;return Math.round(n)}(s.current,n.length);a.current!==t&&(a.current=t,i(t),l())}};return p.createElement(r.ScrollControls,{ref:s,className:C.mainPhotoScrollControls,showOnHover:!0,hideOnDisabled:!0},(function(t){return p.createElement(w,{scrollRef:t,isActive:!0},p.createElement("div",{ref:t,className:C.mainPhoto,onScroll:u},n.map((function(t,e){var n,i=t.type,a=t.src,r="video"===i,s=r?I(a):a,l=r?(n=T(a),"https://youtube.com/embed/".concat(n,"?enablejsapi=1&rel=0")):void 0;return p.createElement("div",{key:e,className:C.mainPhotoItem,"data-qaid":"photo_gallery_main_item","data-testid":"photo_gallery_main_item"},p.createElement(A,{ref:function(t){return o.current[e]=t},src:s,videoSrc:l}))}))))}))})),P=p.forwardRef((function(t,e){var n=t.items,i=t.selectedIndex,o=t.onChange,a=p.useRef(null),r=function(t){var e,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=null===(e=a.current)||void 0===e?void 0:e.children[t];i&&z(i,a.current,n)};p.useImperativeHandle(e,(function(){return{scrollToIndex:r}}),[]);return p.createElement(w,{scrollRef:a,isActive:!0},p.createElement("div",{ref:a,className:C.preview},n.map((function(t,e){var n=t.type,a=t.src,r="video"===n,s=r?I(a):a;return p.createElement("div",{key:e,className:C.previewItem,"data-qaid":"photo_gallery_preview_item","data-testid":"photo_gallery_preview_item"},p.createElement("button",{className:C.previewButton,type:"button",onClick:function(){return function(t){o(t)}(e)},disabled:i===e,"data-qaid":"photo_gallery_preview_button","data-testid":"photo_gallery_preview_button"},p.createElement("img",{className:C.previewImage,src:s,width:58,height:58,alt:"",decoding:"async",loading:"lazy","data-qaid":"photo_gallery_preview_image","data-testid":"photo_gallery_preview_image"}),r&&p.createElement("div",{className:C.videoPlayLabel,"data-qaid":"photo_gallery_preview_play","data-testid":"photo_gallery_preview_play"},p.createElement(l.Icon,{className:C.videoPlayLabelIcon,"icon-as":c.SvgPlay}))))}))))})),S=function(t){var e,n,i=t.title,o=t.onClose,a=t.selectedIndex,r=t.itemsLength,s=a+1,c=(0,h.useBodyTTag().t)(E||(e=["Фото "," из ",""],n||(n=e.slice(0)),E=Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))),s,r);return p.createElement("div",{className:C.header},p.createElement("div",{className:C.headerTitle,"data-qaid":"photo_gallery_title","data-testid":"photo_gallery_title"},i||c),p.createElement("div",{className:C.headerClose},p.createElement(u.Button,{"button-padding":"xxs","button-theme":"black-inherit",type:"button",onClick:o,"data-qaid":"photo_gallery_close_button","data-testid":"photo_gallery_close_button"},p.createElement(l.Icon,{"icon-as":d.SvgClose,style:{width:24,height:24}}))))};exports.PhotoGallery=function(t){var e=t.isOpen,r=t.title,s=t.visibleIndex,l=void 0===s?0:s,c=t.items,u=t.zIndex,h=void 0===u?5e3:u,d=t.onClose,f=t.onChange,m=p.useRef(!0),y=p.useRef(null),b=p.useRef(null),E=v(p.useState(l),2),x=E[0],w=E[1];p.useEffect((function(){e&&"function"==typeof f&&f(x)}),[x]),p.useEffect((function(){var t,n;e&&(w(l),null===(t=b.current)||void 0===t||t.scrollToIndex(l,!1),null===(n=y.current)||void 0===n||n.scrollToIndex(l,!1))}),[e]),p.useEffect((function(){var t;if(!e)return function(){};var n=null,i=function(){n&&clearTimeout(n)},o=function(){i(),n=setTimeout((function(){var t,e;null===(t=b.current)||void 0===t||t.scrollToIndex(x,!1),null===(e=y.current)||void 0===e||e.scrollToIndex(x,!1)}),100)};return window.addEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.addEventListener("change",o),function(){var t;i(),window.removeEventListener("resize",o),null===(t=window)||void 0===t||null===(t=t.matchMedia("(orientation: portrait)"))||void 0===t||t.removeEventListener("change",o)}}),[e,x]);var O=function(t){var e,n;m.current=!1,w(t),null===(e=b.current)||void 0===e||e.scrollToIndex(t),null===(n=y.current)||void 0===n||n.scrollToIndex(t)},z=function(){d(x)};return p.createElement(p.Fragment,null,p.createElement(i.Backdrop,{isOpen:e,onClick:z,zIndex:h}),p.createElement(n.CSSTransition,{in:e,timeout:240,classNames:C,unmountOnExit:!0},p.createElement(a.Portal,null,p.createElement("div",{className:C.root,"data-qaid":"photo_gallery","data-testid":"photo_gallery",style:{zIndex:h}},p.createElement(g.default,null),p.createElement(o.KeyPress,{code:"Escape",onKeyUp:z}),p.createElement(o.KeyPress,{code:"ArrowLeft",onKeyUp:function(){0!==x&&O(x-1)}}),p.createElement(o.KeyPress,{code:"ArrowRight",onKeyUp:function(){x!==c.length-1&&O(x+1)}}),p.createElement("div",{className:C.layout},p.createElement("header",{className:C.layoutHeader},p.createElement(S,{title:r,selectedIndex:x,itemsLength:c.length,onClose:z})),p.createElement("div",{className:C.layoutContent},p.createElement("section",{className:C.layoutSection},p.createElement(D,{ref:y,items:c,onChange:function(t){var e;m.current&&(w(t),null===(e=b.current)||void 0===e||e.scrollToIndex(t));m.current||x!==t||(m.current=!0)}})),c.length>1&&p.createElement("aside",{className:C.layoutAside},p.createElement(P,{ref:b,items:c,selectedIndex:x,onChange:O}))))))))},require("./style.production.v2.css");
@@ -15,5 +15,7 @@ export type PhotoGalleryProps = {
15
15
  type: 'image' | 'video';
16
16
  src: string;
17
17
  }[];
18
+ /** Размещением по z-оси */
19
+ zIndex?: number;
18
20
  };
19
21
  export declare const PhotoGallery: React.FC<PhotoGalleryProps>;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/PhotoGallery",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Picture",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Portal",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/QRCode",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Rating",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/RatingSelect",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SafeQuery",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Scroll",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/ScrollControls",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/SimpleSlider",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Skeleton",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Spinner",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/Text/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Text",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/TextEmoji",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Tooltip",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/Tumbler",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prom-ui/core",
3
3
  "author": "e.marchenko",
4
- "version": "1.7.0",
4
+ "version": "1.7.1",
5
5
  "description": "core ui blocks",
6
6
  "scripts": {
7
7
  "ts-types": "tsc --project tsconfig.build.json --declaration --emitDeclarationOnly",
@@ -72,5 +72,5 @@
72
72
  "optional": true
73
73
  }
74
74
  },
75
- "gitHead": "8c3ada42a3f951f006b70cbb7a483ed37d083c0a"
75
+ "gitHead": "f2f48356a89e0ab5fe9c4f0248bfcf15bc8d1d19"
76
76
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useBodyTTag",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useDebounce",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useForwardRef",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useId",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useIsMounted",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useKeyPress",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useMedia",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useOutsideClick",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/usePortal",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prom-ui/core/useScrollPosition",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "sideEffects": [