1(window.__LOADABLE_LOADED_CHUNKS__=window.__LOADABLE_LOADED_CHUNKS__||[]).push([[3],{1620:function(e,t,n){"use strict";n.r(t);var i=n(42),o=n(0),a=n.n(o),r=n(3),s=n(163),l=n(1732),u=n(45),c=(n(1733),function(e,t){var n=t.length;if(1===n)return{main:e};var i=t.indexOf(e);return{main:e,next:t[(i+1)%n],previous:t[(i+n-1)%n]}}),h=Object(r.c)({nextLabel:{id:"components.organisms.Lightbox.nextLabel",defaultMessage:"Next image"},previousLabel:{id:"components.organisms.Lightbox.previousLabel",defaultMessage:"Previous image"},zoomInLabel:{id:"components.organisms.Lightbox.zoomInLabel",defaultMessage:"Zoom in"},zoomOutLabel:{id:"components.organisms.Lightbox.zoomOutLabel",defaultMessage:"Zoom out"},closeLabel:{id:"components.organisms.Lightbox.closeLabel",defaultMessage:"Close"}});t.default=function(e){var t=e.mainImageSrc,n=e.imagesSrc,r=void 0===n?[]:n,m=e.imageFormat,d=void 0===m?"zoomable":m,p=e.onCloseRequest,f=e.onAfterOpen,v=Object(s.a)(),g=function(e,t){var n=Object(o.useState)(c(e,t)),a=Object(i.a)(n,2),r=a[0],s=a[1],l=r.next,u=Object(o.useCallback)((function(){l&&s(c(l,t))}),[l,t]),h=r.previous;return{navigation:r,moveToNext:u,moveToPrevious:Object(o.useCallback)((function(){h&&s(c(h,t))}),[h,t])}}(t,r),b=g.navigation,y=g.moveToNext,k=g.moveToPrevious;return t?a.a.createElement(l.a,{mainSrc:Object(u.b)(b.main,d),nextSrc:b.next?Object(u.b)(b.next,d):null,prevSrc:b.previous?Object(u.b)(b.previous,d):null,onAfterOpen:f,onCloseRequest:p,onMoveNextRequest:y,onMovePrevRequest:k,nextLabel:v.formatMessage(h.nextLabel),previousLabel:v.formatMessage(h.previousLabel),zoomInLabel:v.formatMessage(h.zoomInLabel),zoomOutLabel:v.formatMessage(h.zoomOutLabel),closeLabel:v.formatMessage(h.closeLabel)}):null}},1732:function(e,t,n){"use strict";(function(e){var i=n(0),o=n.n(i),a=n(2),r=n.n(a),s=n(267),l=n.n(s);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e,t){return!t||"object"!==typeof t&&"function"!==typeof t?v(e):t}function b(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=p(e);if(t){var o=p(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return g(this,n)}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var i,o,a=[],r=!0,s=!1;try{for(n=n.call(e);!(r=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);r=!0);}catch(l){s=!0,o=l}finally{try{r||null==n.return||n.return()}finally{if(s)throw o}}return a}(e,t)||w(e,t)||function(){throw new TypeError("Invalid attempt to de
1structure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||w(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(e,t){if(e){if("string"===typeof e)return S(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function M(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!e)return"";var n=e;return t&&Object.keys(t).forEach((function(e){n=n.replace(e,t[e])})),n}function _(){return"undefined"!==typeof e.window?e.window.innerWidth:0}var E=function(){try{return e.window.location.hostname!==e.window.parent.location.hostname}catch(t){return!0}};var C=27,L=37,T=39,O=function(t){!function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,t);var n,i,a,r=b(s);function s(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=r.call(this,e)).state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:0,offsetX:0,offsetY:0,loadErrorStatus:{}},t.outerEl=o.a.createRef(),t.zoomInBtn=o.a.createRef(),t.zoomOutBtn=o.a.createRef(),t.caption=o.a.createRef(),t.closeIfClickInner=t.closeIfClickInner.bind(v(t)),t.handleImageDoubleClick=t.handleImageDoubleClick.bind(v(t)),t.handleImageMouseWheel=t.handleImageMouseWheel.bind(v(t)),t.handleKeyInput=t.handleKeyInput.bind(v(t)),t.handleMouseUp=t.handleMouseUp.bind(v(t)),t.handleMouseDown=t.handleMouseDown.bind(v(t)),t.handleMouseMove=t.handleMouseMove.bind(v(t)),t.handleOuterMousewheel=t.handleOuterMousewheel.bind(v(t)),t.handleTouchStart=t.handleTouchStart.bind(v(t)),t.handleTouchMove=t.handleTouchMove.bind(v(t)),t.handleTouchEnd=t.handleTouchEnd.bind(v(t)),t.handlePointerEvent=t.handlePointerEvent.bind(v(t)),t.handleCaptionMousewheel=t.handleCaptionMousewheel.bind(v(t)),t.handleWindowResize=t.handleWindowResize.bind(v(t)),t.handleZoomInButtonClick=t.handleZoomInButtonClick.bind(v(t)),t.handleZoomOutButtonClick=t.handleZoomOutButtonClick.bind(v(t)),t.requestClose=t.requestClose.bind(v(t)),t.requestMoveNext=t.requestMoveNext.bind(v(t)),t.requestMovePrev=t.requestMovePrev.bind(v(t)),t.timeouts=[],t.currentAction=0,t.eventsSource=0,t.pointerList=[],t.preventInnerClose=!1,t.preventInnerCloseTimeout=null,t.keyPressed=!1,t.imageCache={},t.lastKeyDownTime=0,t.resizeTimeout=null,t.wheelActionTimeout=null,t.resetScrollTimeout=null,t.scrollX=0,t.scrollY=0,t.moveStartX=0,t.moveStartY=0,t.moveStartOffsetX=0,t.moveStartOffsetY=0,t.swipeStartX=0,t.swipeStartY=0,t.swipeEndX=0,t.swipeEndY=0,t.pinchTouchList=null,t.pinchDistance=0,t.keyCounter=0,t.moveRequested=!1,t}return n=s,i=[{key:"componentDidMount",value:function(){var t=this;this.props.animationDisabled||this.setState({isClosing:!1}),this.windowContext=function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.window.self;return n===e.window.top||E()?n:t(n.parent)}(),this.listeners={resize:this.handleWindowResize,mouseup:this.handleMouseUp,touchend:this.handleTouchEnd,touchcancel:this.handleTouchEnd,pointerdown:this.handlePointerEvent,pointermove:this.handlePointerEvent,pointerup:this.handlePointerEvent,pointercancel:this.handlePointerEvent},Object.keys(this.listeners).forEach((function(e){t.windowContext.addEventListener(e,t.listeners[e])})),this.loadAllImages()}},{key:"shouldComponentUpdate",value:function(e){var t=this;
1return this.getSrcTypes().forEach((function(n){t.props[n.name]!==e[n.name]&&(t.moveRequested=!1)})),!this.moveRequested}},{key:"componentDidUpdate",value:function(e){var t=this,n=!1,i={},o={};this.getSrcTypes().forEach((function(a){e[a.name]!==t.props[a.name]&&(n=!0,i[e[a.name]]=!0,o[t.props[a.name]]=!0)})),(n||this.moveRequested)&&(Object.keys(i).forEach((function(e){!(e in o)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)})),this.moveRequested=!1,this.loadAllImages(this.props))}},{key:"componentWillUnmount",value:function(){var e=this;this.didUnmount=!0,Object.keys(this.listeners).forEach((function(t){e.windowContext.removeEventListener(t,e.listeners[t])})),this.timeouts.forEach((function(e){return clearTimeout(e)}))}},{key:"setTimeout",value:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e,t){var n=this,i=setTimeout((function(){n.timeouts=n.timeouts.filter((function(e){return e!==i})),e()}),t);return this.timeouts.push(i),i}))},{key:"setPreventInnerClose",value:function(){var e=this;this.preventInnerCloseTimeout&&this.clearTimeout(this.preventInnerCloseTimeout),this.preventInnerClose=!0,this.preventInnerCloseTimeout=this.setTimeout((function(){e.preventInnerClose=!1,e.preventInnerCloseTimeout=null}),100)}},{key:"getBestImageForType",value:function(e){var t=this.props[e],n={};if(this.isImageLoaded(t))n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props["".concat(e,"Thumbnail")]))return null;t=this.props["".concat(e,"Thumbnail")],n=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:this.imageCache[t].height,width:this.imageCache[t].width,targetHeight:n.height,targetWidth:n.width}}},{key:"getFitSizes",value:function(e,t,n){var i=this.getLightboxRect(),o=i.height-2*this.props.imagePadding,a=i.width-2*this.props.imagePadding;return n||(o=Math.min(o,t),a=Math.min(a,e)),a/o>e/t?{width:e*o/t,height:o}:{width:a,height:t*a/e}}},{key:"getMaxOffsets",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel,t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var n=this.getLightboxRect(),i=this.getZoomMultiplier(e),o=0,a=0;return{maxX:o=i*t.width-n.width<0?(n.width-i*t.width)/2:(i*t.width-n.width)/2,maxY:a=i*t.height-n.height<0?(n.height-i*t.height)/2:(i*t.height-n.height)/2,minX:-1*o,minY:-1*a}}},{key:"getSrcTypes",value:function(){return[{name:"mainSrc",keyEnding:"i".concat(this.keyCounter)},{name:"mainSrcThumbnail",keyEnding:"t".concat(this.keyCounter)},{name:"nextSrc",keyEnding:"i".concat(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t".concat(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i".concat(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t".concat(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.zoomLevel;return Math.pow(1.007,e)}},{key:"getLightboxRect",value:function(){return this.outerEl.current?this.outerEl.current.getBoundingClientRect():{width:_(),height:"undefined"!==typeof e.window?e.window.innerHeight:0,top:0,right:0,bottom:0,left:0}}},{key:"clearTimeout",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){this.timeouts=this.timeouts.filter((function(t){return t!==e})),clearTimeout(e)}))},{key:"changeZoom",value:function(e,t,n){if(this.props.enableZoom){var i=Math.max(0,Math.min(300,e));if(i!==this.state.zoomLevel)if(0!==i){var o=this.getBestImageForType("mainSrc");if(null!==o){var a=this.getZoomMultiplier(),r=this.getZoomMultiplier(i),s=this.getLightboxRect(),l="undefined"!==typeof t?t-s.left:s.width/2,u="undefined"!==typeof n?n-s.top:s.height/2,c=(s.width-o.width*a)/2,h=(s.height-o.height*a)/2,m=l-(l-(c-this.state.offsetX))/a*r,d=u-(u-(h-this.state.offsetY))/a*r,p=(s.width-o.width*r)/2-m,f=(s.height-o.height*r)/2-d;if(3!==this.currentAction){var v=this.getMaxOffsets();this.state.zoomLevel>i&&(p=Math.max(v.minX,Math.min(v.maxX,p)),f=Math.max(v.minY,Math.min(v.maxY,f)))}this.setState({zoomLevel:i,offsetX:p,offsetY:f})}}else this.setState({zoomLevel:i,offsetX:0,offsetY:0})}}},{key:"closeIfClickInner",value:function(e){!this.preventInnerClose&&e.target.className.search(/\bril-inner\b/)>-1&&this.requestClose(e)}},{key:"handleKeyInput",value:function(e){if(e.stopPropagation(),!this.isAnimating())if("keyup"!==e.type){var t=e.which||e.keyCode,n=new Date;if(!(n.getTime()-this.lastKeyDownTime<this.props.keyRepeatLimit&&t!==C))switch(this.lastKeyDownTime=n.getTime(),t){case C:e.preventDefault(),this.requestClose(e);break;case L:if(!this.props.prevSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMovePrev(e);break;case T:if(!this.props.nextSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMoveNext(e)}}else this.lastKeyDownTime-=this.props.keyRepeatKeyupBonus}},{key:"handleOuterMousewheel",value:function(e){var t=this;e.stopPropagation();var n=0;this.clearTimeout(this.resetScrollTimeout),this.resetScrollTimeout=this.setTimeout((function(){t.scrollX=0,t.scrollY=0}),300),null!==this.wheelActionTimeout||this.isAnimating()||(Math.abs(e.deltaY)<Math.abs(e.deltaX)&&(this.scrollY=0,this.scrollX+=e.deltaX,this.scrollX>=200||e.deltaX>=100?(this.requestMoveNext(e),n=500,this.scrollX=0):(this.scrollX<=-200||e.deltaX<=-100)&&(this.requestMovePrev(e),n=500,this.scrollX=0)),0!==n&&(this.wheelActionTimeout=this.setTimeout((function(){t.wheelActionTimeout=null}),n)))}}
1,{key:"handleImageMouseWheel",value:function(e){if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<1)return;this.scrollX=0,this.scrollY+=e.deltaY,this.changeZoom(this.state.zoomLevel-e.deltaY,e.clientX,e.clientY)}}},{key:"handleImageDoubleClick",value:function(e){this.state.zoomLevel>0?this.changeZoom(0,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+100,e.clientX,e.clientY)}},{key:"shouldHandleEvent",value:function(e){if(this.eventsSource===e)return!0;if(0===this.eventsSource)return this.eventsSource=e,!0;switch(e){case 1:return!1;case 2:return this.eventsSource=2,this.filterPointersBySource(),!0;case 3:return 1===this.eventsSource&&(this.eventsSource=3,this.filterPointersBySource(),!0);default:return!1}}},{key:"addPointer",value:function(e){this.pointerList.push(e)}},{key:"removePointer",value:function(e){this.pointerList=this.pointerList.filter((function(t){return t.id!==e.id}))}},{key:"filterPointersBySource",value:function(){var e=this;this.pointerList=this.pointerList.filter((function(t){return t.source===e.eventsSource}))}},{key:"handleMouseDown",value:function(e){this.shouldHandleEvent(1)&&s.isTargetMatchImage(e.target)&&(this.addPointer(s.parseMouseEvent(e)),this.multiPointerStart(e))}},{key:"handleMouseMove",value:function(e){this.shouldHandleEvent(1)&&this.multiPointerMove(e,[s.parseMouseEvent(e)])}},{key:"handleMouseUp",value:function(e){this.shouldHandleEvent(1)&&(this.removePointer(s.parseMouseEvent(e)),this.multiPointerEnd(e))}},{key:"handlePointerEvent",value:function(e){if(this.shouldHandleEvent(3))switch(e.type){case"pointerdown":s.isTargetMatchImage(e.target)&&(this.addPointer(s.parsePointerEvent(e)),this.multiPointerStart(e));break;case"pointermove":this.multiPointerMove(e,[s.parsePointerEvent(e)]);break;case"pointerup":case"pointercancel":this.removePointer(s.parsePointerEvent(e)),this.multiPointerEnd(e)}}},{key:"handleTouchStart",value:function(e){var t=this;this.shouldHandleEvent(2)&&s.isTargetMatchImage(e.target)&&([].forEach.call(e.changedTouches,(function(e){return t.addPointer(s.parseTouchPointer(e))})),this.multiPointerStart(e))}},{key:"handleTouchMove",value:function(e){this.shouldHandleEvent(2)&&this.multiPointerMove(e,[].map.call(e.changedTouches,(function(e){return s.parseTouchPointer(e)})))}},{key:"handleTouchEnd",value:function(e){var t=this;this.shouldHandleEvent(2)&&([].map.call(e.changedTouches,(function(e){return t.removePointer(s.parseTouchPointer(e))})),this.multiPointerEnd(e))}},{key:"decideMoveOrSwipe",value:function(e){this.state.zoomLevel<=0?this.handleSwipeStart(e):this.handleMoveStart(e)}},{key:"multiPointerStart",value:function(e){switch(this.handleEnd(null),this.pointerList.length){case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"multiPointerMove",value:function(e,t){switch(this.currentAction){case 1:e.preventDefault(),this.handleMove(t[0]);break;case 2:e.preventDefault(),this.handleSwipe(t[0]);break;case 3:e.preventDefault(),this.handlePinch(t)}}},{key:"multiPointerEnd",value:function(e){switch(0!==this.currentAction&&(this.setPreventInnerClose(),this.handleEnd(e)),this.pointerList.length){case 0:this.eventsSource=0;break;case 1:e.preventDefault(),this.decideMoveOrSwipe(this.pointerList[0]);break;case 2:e.preventDefault(),this.handlePinchStart(this.pointerList)}}},{key:"handleEnd",value:function(e){switch(this.currentAction){case 1:this.handleMoveEnd(e);break;case 2:this.handleSwipeEnd(e);break;case 3:this.handlePinchEnd(e)}}},{key:"handleMoveStart",value:function(e){var t=e.x,n=e.y;this.props.enableZoom&&(this.currentAction=1,this.moveStartX=t,this.moveStartY=n,this.moveStartOffsetX=this.state.offsetX,this.moveStartOffsetY=this.state.offsetY)}},{key:"handleMove",value:function(e){var t=e.x,n=e.y,i=this.moveStartX-t+this.moveStartOffsetX,o=this.moveStartY-n+this.moveStartOffsetY;this.state.offsetX===i&&this.state.offsetY===o||this.setState({offsetX:i,offsetY:o})}},{key:"handleMoveEnd",value:function(){var e=this;this.currentAction=0,this.moveStartX=0,this.moveStartY=0,this.moveStartOffsetX=0,this.moveStartOffsetY=0;var t=this.getMaxOffsets(),n=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),i=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));n===this.state.offsetX&&i===this.state.offsetY||(this.setState({offsetX:n,offsetY:i,shouldAnimate:!0}),this.setTimeout((function(){e.setState({shouldAnimate:!1})}),this.props.animationDuration))}},{key:"handleSwipeStart",value:function(e){var t=e.x,n=e.y;this.currentAction=2,this.swipeStartX=t,this.swipeStartY=n,this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipe",value:function(e){var t=e.x,n=e.y;this.swipeEndX=t,this.swipeEndY=n}},{key:"handleSwipeEnd",value:function(e){var t=this.swipeEndX-this.swipeStartX,n=Math.abs(t),i=Math.abs(this.swipeEndY-this.swipeStartY);if(this.currentAction=0,this.swipeStartX=0,this.swipeStartY=0,this.swipeEndX=0,this.swipeEndY=0,!(!e||this.isAnimating()||n<1.5*i)){if(n<200&&n<this.getLightboxRect().width/4)return;t>0&&this.props.prevSrc?(e.preventDefault(),this.requestMovePrev()):t<0&&this.props.nextSrc&&(e.preventDefault(),this.requestMoveNext())}}},{key:"calculatePinchDistance",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,t=y(e,2),n=t[0],i=t[1];return Math.sqrt(Math.pow(n.x-i.x,2)+Math.pow(n.y-i.y,2))}},{key:"calculatePinchCenter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pinchTouchList,t=y(e,2),n=t[0],i=t[1];return{x:n.x-(n.x-i.x)/2,y:n.y-(n.y-i.y)/2}}},{key:"handlePinchStart",value:function(e){this.props.enableZoom&&(this.currentAction=3,this.pinchTouchList=e.map((function(e){return{id:e.id,x:e.x,y:e.y}})),this.pinchDistance=this.calculatePinchDistance())}},{key:"handlePinch",value:function(e){this.pinchTouchList=this.pinchTouchList.map((function(t){for(var n=0;n<e.length;n+=1)if(e[n].id===t.id)return e[n];return t}));var t=this.calculatePinchDistance(),n=this.state.zoomLevel+t-this.pinchDistance;this.pinchDistance=t;var i=this.calculatePinchCenter(this.pinchTouchList),o=i.x,a=i.y;this.changeZoom(n,o,a)}},{key:"handlePinchEnd",value:function(){this.currentAction=0,this.pinchTouchList=null,this.pinchDistance=0}},{key:"handleWindowResize",value:function(){this.clearTimeout(this.resizeTimeout),this.resizeTimeout=this.setTimeout(this.forceUpdate.bind(this),100)}},{key:"handleZoomInButtonClick",value:function(){var e=this.state.zoomLevel+100;this.changeZoom(e),300===e&&this.zoomOutBtn.current.focus()}},{key:"handleZoomOutButtonClick",value:function(){var e=this.state.zoomLevel-100;this.changeZoom(e),0===e&&this.zoomInBtn.current.focus()}},{key:"handleCaptionMousewheel",value:function(e){if(e.stopPropagation(),this.caption.current){var t=this.caption.current.getBoundingClientRect().height,n=this.caption.current,i=n.scrollHeight,o=n.scrollTop;(e.deltaY>0&&t+o>=i||e.deltaY<0&&o<=0)&&e.preventDefault()}}},{key:"isAnimating",value:function(){return this.state.shouldAnimate||this.state.isClosing}},{key:"isImageLoaded",value:function(e){return e&&e in this.imageCache&&this.imageCache[e].loaded}},{key:"loadImage",value:function(t,n,i){var o=this;if(this.isImageLoaded(n))this.setTimeout((function(){i()}),1);else{var a=new e.Image;this.props.imageCrossOrigin&&(a.crossOrigin=this.props.imageCrossOrigin),a.onerror=function(e){o.props.onImageLoadError(n,t,e),o.setState((function(e){return{loadErrorStatus:c(c({},e.loadErrorStatus),{},m({},t,!0))}})),i(e)},a.onload=function(){o.props.onImageLoad(n,t,a),o.imageCache[n]={loaded:!0,width:a.width,height:a.height},i()},a.src=n}}},{key:"loadAllImages",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=function(t,n){return function(i){i||e.props[t]!==n||e.didUnmount||e.forceUpdate()}};
1this.getSrcTypes().forEach((function(i){var o=i.name;t[o]&&e.state.loadErrorStatus[o]&&e.setState((function(e){return{loadErrorStatus:c(c({},e.loadErrorStatus),{},m({},o,!1))}})),t[o]&&!e.isImageLoaded(t[o])&&e.loadImage(o,t[o],n(o,t[o]))}))}},{key:"requestClose",value:function(e){var t=this,n=function(){return t.props.onCloseRequest(e)};this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?n():(this.setState({isClosing:!0}),this.setTimeout(n,this.props.animationDuration))}},{key:"requestMove",value:function(e,t){var n=this,i={zoomLevel:0,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(i.shouldAnimate=!0,this.setTimeout((function(){return n.setState({shouldAnimate:!1})}),this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter-=1,this.setState(i),this.props.onMovePrevRequest(t)):(this.keyCounter+=1,this.setState(i),this.props.onMoveNextRequest(t))}},{key:"requestMoveNext",value:function(e){this.requestMove("next",e)}},{key:"requestMovePrev",value:function(e){this.requestMove("prev",e)}},{key:"render",value:function(){var t=this,n=this.props,i=n.animationDisabled,a=n.animationDuration,r=n.clickOutsideToClose,u=n.discourageDownloads,h=n.enableZoom,m=n.imageTitle,p=n.nextSrc,f=n.prevSrc,v=n.toolbarButtons,g=n.reactModalStyle,b=n.onAfterOpen,y=n.imageCrossOrigin,w=n.reactModalProps,S=n.loader,_=this.state,E=_.zoomLevel,C=_.offsetX,L=_.offsetY,T=_.isClosing,O=_.loadErrorStatus,I=this.getLightboxRect(),x={};!i&&this.isAnimating()&&(x=c(c({},x),{},{transition:"transform ".concat(a,"ms")}));var P={};this.getSrcTypes().forEach((function(e){var t=e.name,n=e.keyEnding;P[t]=n}));var D=[],z=function(e,n,i){if(t.props[e]){var a,r=t.getBestImageForType(e),l=c(c({},x),s.getTransform(c(c({},i),r)));if(E>0&&(l.cursor="move"),null===r&&(a=O,Object.keys(a).some((function(e){return a[e]}))))D.push(o.a.createElement("div",{className:"".concat(n," ril__image ril-errored"),style:l,key:t.props[e]+P[e]},o.a.createElement("div",{className:"ril__errorContainer"},t.props.imageLoadErrorMessage)));else if(null!==r){var h=r.src;u?(l.backgroundImage="url('".concat(h,"')"),D.push(o.a.createElement("div",{className:"".concat(n," ril__image ril__imageDiscourager"),onDoubleClick:t.handleImageDoubleClick,onWheel:t.handleImageMouseWheel,style:l,key:h+P[e]},o.a.createElement("div",{className:"ril-download-blocker ril__downloadBlocker"})))):D.push(o.a.createElement("img",d({},y?{crossOrigin:y}:{},{className:"".concat(n," ril__image"),onDoubleClick:t.handleImageDoubleClick,onWheel:t.handleImageMouseWheel,onDragStart:function(e){return e.preventDefault()},style:l,src:h,key:h+P[e],alt:"string"===typeof m?m:M("Image"),draggable:!1})))}else{var p=void 0!==S?S:o.a.createElement("div",{className:"ril-loading-circle ril__loadingCircle ril__loadingContainer__icon"},k(new Array(12)).map((function(e,t){return o.a.createElement("div",{key:t,className:"ril-loading-circle-point ril__loadingCirclePoint"})})));D.push(o.a.createElement("div",{className:"".concat(n," ril__image ril-not-loaded"),style:l,key:t.props[e]+P[e]},o.a.createElement("div",{className:"ril__loadingContainer"},p)))}}},A=this.getZoomMultiplier();z("nextSrc","ril-image-next ril__imageNext",{x:I.width}),z("mainSrc","ril-image-current",{x:-1*C,y:-1*L,zoom:A}),z("prevSrc","ril-image-prev ril__imagePrev",{x:-1*I.width});var X={overlay:c({zIndex:1e3,backgroundColor:"transparent"},g.overlay),content:c({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},g.content)};return o.a.createElement(l.a,d({isOpen:!0,onRequestClose:r?this.requestClose:void 0,onAfterOpen:function(){t.outerEl.current&&t.outerEl.current.focus(),b()},style:X,contentLabel:M("Lightbox"),appElement:"undefined"!==typeof e.window?e.window.document.body:void 0},w),o.a.createElement("div",{className:"ril-outer ril__outer ril__outerAnimating ".concat(this.props.wrapperClassName," ").concat(T?"ril-closing ril__outerClosing":""),style:{transition:"opacity ".concat(a,"ms"),animationDuration:"".concat(a,"ms"),animationDirection:T?"normal":"reverse"},ref:this.outerEl,onWheel:this.handleOuterMousewheel,onMouseMove:this.handleMouseMove,onMouseDown:this.handleMouseDown,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},o.a.createElement("div",{className:"ril-inner ril__inner",onClick:r?this.closeIfClickInner:void 0},D),f&&o.a.createElement("button",{type:"button",className:"ril-prev-button ril__navButtons ril__navButtonPrev",key:"prev","aria-label":this.props.prevLabel,title:this.props.prevLabel,onClick:this.isAnimating()?void 0:this.requestMovePrev}),p&&o.a.createElement("button",{type:"button",className:"ril-next-button ril__navButtons ril__navButtonNext",key:"next","aria-label":this.props.nextLabel,title:this.props.nextLabel,onClick:this.isAnimating()?void 0:this.requestMoveNext}),o.a.createElement("div",{className:"ril-toolbar ril__toolbar"},o.a.createElement("ul",{className:"ril-toolbar-left ril__toolbarSide ril__toolbarLeftSide"},o.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},o.a.createElement("span",{className:"ril-toolbar__item__child ril__toolbarItemChild"},m))),o.a.createElement("ul",{className:"ril-toolbar-right ril__toolbarSide ril__toolbarRightSide"},v&&v.map((function(e,t){return o.a.createElement("li",{key:"button_".concat(t+1),className:"ril-toolbar__item ril__toolbarItem"},e)})),h&&o.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},o.a.createElement("button",{type:"button",key:"zoom-in","aria-label":this.props.zoomInLabel,title:this.props.zoomInLabel,className:["ril-zoom-in","ril__toolbarItemChild","ril__builtinButton","ril__zoomInButton"].concat(k(300===E?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomInBtn,disabled:this.isAnimating()||300===E,onClick:this.isAnimating()||300===E?void 0:this.handleZoomInButtonClick})),h&&o.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},o.a.createElement("button",{type:"button",key:"zoom-out","aria-label":this.props.zoomOutLabel,title:this.props.zoomOutLabel,className:["ril-zoom-out","ril__toolbarItemChild","ril__builtinButton","ril__zoomOutButton"].concat(k(0===E?["ril__builtinButtonDisabled"]:[])).join(" "),ref:this.zoomOutBtn,disabled:this.isAnimating()||0===E,onClick:this.isAnimating()||0===E?void 0:this.handleZoomOutButtonClick})),o.a.createElement("li",{className:"ril-toolbar__item ril__toolbarItem"},o.a.createElement("button",{type:"button",key:"close","aria-label":this.props.closeLabel,title:this.props.closeLabel,className:"ril-close ril-toolbar__item__child ril__toolbarItemChild ril__builtinButton ril__closeButton",onClick:this.isAnimating()?void 0:this.requestClose})))),this.props.imageCaption&&o.a.createElement("div",{onWheel:this.handleCaptionMousewheel,onMouseDown:function(e){return e.stopPropagation()},className:"ril-caption ril__caption",ref:this.caption},o.a.createElement("div",{className:"ril-caption-content ril__captionContent"},this.props.imageCaption))))}}],a=[{key:"isTargetMatchImage",value:function(e){return e&&/ril-image-current/.test(e.className)}},{key:"parseMouseEvent",value:function(e){return{id:"mouse",source:1,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parseTouchPointer",value:function(e){return{id:e.identifier,source:2,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"parsePointerEvent",value:function(e){return{id:e.pointerId,source:3,x:parseInt(e.clientX,10),y:parseInt(e.clientY,10)}}},{key:"getTransform",value:function(e){var t=e.x,n=void 0===t?0:t,i=e.y,o=void 0===i?0:i,a=e.zoom,r=void 0===a?1:a,s=e.width,l=e.targetWidth,u=n,c=_();s>c&&(u+=(c-s)/2);var h=r*(l/s);return{transform:"translate3d(".concat(u,"px,").concat(o,"px,0) scale3d(").concat(h,",").concat(h,",1)")}}}
1],i&&h(n.prototype,i),a&&h(n,a),s}(i.Component);O.propTypes={mainSrc:r.a.string.isRequired,prevSrc:r.a.string,nextSrc:r.a.string,mainSrcThumbnail:r.a.string,prevSrcThumbnail:r.a.string,nextSrcThumbnail:r.a.string,onCloseRequest:r.a.func.isRequired,onMovePrevRequest:r.a.func,onMoveNextRequest:r.a.func,onImageLoadError:r.a.func,onImageLoad:r.a.func,onAfterOpen:r.a.func,discourageDownloads:r.a.bool,animationDisabled:r.a.bool,animationOnKeyInput:r.a.bool,animationDuration:r.a.number,keyRepeatLimit:r.a.number,keyRepeatKeyupBonus:r.a.number,imageTitle:r.a.node,imageCaption:r.a.node,imageCrossOrigin:r.a.string,reactModalStyle:r.a.shape({}),imagePadding:r.a.number,wrapperClassName:r.a.string,toolbarButtons:r.a.arrayOf(r.a.node),clickOutsideToClose:r.a.bool,enableZoom:r.a.bool,reactModalProps:r.a.shape({}),nextLabel:r.a.string,prevLabel:r.a.string,zoomInLabel:r.a.string,zoomOutLabel:r.a.string,closeLabel:r.a.string,imageLoadErrorMessage:r.a.node,loader:r.a.node},O.defaultProps={imageTitle:null,imageCaption:null,toolbarButtons:null,reactModalProps:{},animationDisabled:!1,animationDuration:300,animationOnKeyInput:!1,clickOutsideToClose:!0,closeLabel:"Close lightbox",discourageDownloads:!1,enableZoom:!0,imagePadding:10,imageCrossOrigin:null,keyRepeatKeyupBonus:40,keyRepeatLimit:180,mainSrcThumbnail:null,nextLabel:"Next image",nextSrc:null,nextSrcThumbnail:null,onAfterOpen:function(){},onImageLoadError:function(){},onImageLoad:function(){},onMoveNextRequest:function(){},onMovePrevRequest:function(){},prevLabel:"Previous image",prevSrc:null,prevSrcThumbnail:null,reactModalStyle:{},wrapperClassName:"",zoomInLabel:"Zoom in",zoomOutLabel:"Zoom out",imageLoadErrorMessage:"This image failed to load",loader:void 0},t.a=O}).call(this,n(109))},1733:function(e,t,n){}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.