react-image-lightbox
Advanced tools
Comparing version 3.0.3 to 3.1.0
@@ -1,3 +0,3 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-modal")):"function"==typeof define&&define.amd?define(["react","react-modal"],t):"object"==typeof exports?exports.ReactImageLightbox=t(require("react"),require("react-modal")):e.ReactImageLightbox=t(e.react,e["react-modal"])}(this,function(e,t){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";e.exports=i(2)["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MIN_ZOOM_LEVEL=0,t.MAX_ZOOM_LEVEL=300,t.ZOOM_RATIO=1.007,t.ZOOM_BUTTON_INCREMENT_SIZE=100,t.WHEEL_MOVE_X_THRESHOLD=200,t.WHEEL_MOVE_Y_THRESHOLD=1,t.KEYS={ESC:27,LEFT_ARROW:37,RIGHT_ARROW:39}},function(e,t,i){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},u=i(8),d=o(u),c=i(9),h=o(c),m=i(3),f=i(1),g=i(7),p=o(g),_=p["default"],v=(0,m.getIEVersion)();v<10&&(_=l({},_,{toolbarSide:_.toolbarSide+" "+_.toolbarSideNoFlex,toolbarLeftSide:_.toolbarLeftSide+" "+_.toolbarLeftSideNoFlex,toolbarRightSide:_.toolbarRightSide+" "+_.toolbarRightSideNoFlex}));var b=function(e){function t(e){n(this,t);var i=a(this,Object.getPrototypeOf(t).call(this,e));return i.state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:f.MIN_ZOOM_LEVEL,offsetX:0,offsetY:0},i.closeIfClickInner=i.closeIfClickInner.bind(i),i.handleImageDoubleClick=i.handleImageDoubleClick.bind(i),i.handleImageMouseWheel=i.handleImageMouseWheel.bind(i),i.handleKeyInput=i.handleKeyInput.bind(i),i.handleMouseUp=i.handleMouseUp.bind(i),i.handleOuterMouseDown=i.handleOuterMouseDown.bind(i),i.handleOuterMouseMove=i.handleOuterMouseMove.bind(i),i.handleOuterMousewheel=i.handleOuterMousewheel.bind(i),i.handleOuterTouchStart=i.handleOuterTouchStart.bind(i),i.handleOuterTouchMove=i.handleOuterTouchMove.bind(i),i.handleWindowResize=i.handleWindowResize.bind(i),i.handleZoomInButtonClick=i.handleZoomInButtonClick.bind(i),i.handleZoomOutButtonClick=i.handleZoomOutButtonClick.bind(i),i.requestClose=i.requestClose.bind(i),i.requestMoveNext=i.requestMoveNext.bind(i),i.requestMovePrev=i.requestMovePrev.bind(i),i}return r(t,e),s(t,[{key:"componentWillMount",value:function(){this.listenersAttached=!1,this.keyPressed=!1,this.imageCache={},this.lastKeyDownTime=0,this.resizeTimeout=null,this.wheelActionTimeout=null,this.resetScrollTimeout=null,this.scrollX=0,this.scrollY=0,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.dragStartOffsetX=0,this.dragStartOffsetY=0,this.keyCounter=0,this.moveRequested=!1,this.props.animationDisabled||this.setState({isClosing:!1})}},{key:"componentDidMount",value:function(){this.mounted=!0,this.attachListeners(),this.loadAllImages()}},{key:"componentWillReceiveProps",value:function(e){var t=this,i=!1,o={},n={};this.getSrcTypes().forEach(function(a){t.props[a.name]!==e[a.name]&&(i=!0,o[t.props[a.name]]=!0,n[e[a.name]]=!0)}),(i||this.moveRequested)&&(Object.keys(o).forEach(function(e){!(e in n)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)}),this.moveRequested=!1,this.loadAllImages(e))}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.detachListeners()}},{key:"attachListeners",value:function(){this.listenersAttached||(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("mouseup",this.handleMouseUp),window.addEventListener("touchend",this.handleMouseUp),(0,m.isInIframe)()&&(window.top.addEventListener("mouseup",this.handleMouseUp),window.top.addEventListener("touchend",this.handleMouseUp)),this.listenersAttached=!0)}},{key:"changeZoom",value:function(e,t,i){var o=(0,m.getWindowWidth)(),n=(0,m.getWindowHeight)(),a=Math.max(f.MIN_ZOOM_LEVEL,Math.min(f.MAX_ZOOM_LEVEL,e));if(a!==this.state.zoomLevel){if(a===f.MIN_ZOOM_LEVEL)return this.setState({zoomLevel:a,offsetX:0,offsetY:0});var r=this.getZoomMultiplier(),s=this.getZoomMultiplier(a),l=("undefined"!=typeof t?t:o/2)/o,u=("undefined"!=typeof i?i:n/2)/n,d=o/r,c=n/r,h=o/s,g=n/s,p=(h-d)*(l-.5),_=(g-c)*(u-.5),v=this.state.offsetX-p,b=this.state.offsetY-_,y=this.getMaxOffsets();this.state.zoomLevel>a&&(v=Math.max(y.minX,Math.min(y.maxX,v)),b=Math.max(y.minY,Math.min(y.maxY,b))),this.setState({zoomLevel:a,offsetX:v,offsetY:b})}}},{key:"closeIfClickInner",value:function(e){e.target.className.search(/\binner\b/)>-1&&this.requestClose(e)}},{key:"detachListeners",value:function(){this.listenersAttached&&(window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("touchend",this.handleMouseUp),(0,m.isInIframe)()&&(window.top.removeEventListener("mouseup",this.handleMouseUp),window.top.removeEventListener("touchend",this.handleMouseUp)),this.listenersAttached=!1)}},{key:"getBestImageForType",value:function(e){var t=this.props[e],i={};if(this.isImageLoaded(t))i=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props[e+"Thumbnail"]))return null;t=this.props[e+"Thumbnail"],i=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:i.height,width:i.width}}},{key:"getFitSizes",value:function(e,t,i){var o=(0,m.getWindowHeight)(),n=(0,m.getWindowWidth)(),a=o-2*this.props.imagePadding,r=n-2*this.props.imagePadding;i||(a=Math.min(a,t),r=Math.min(r,e));var s=r/a,l=e/t,u={};return s>l?(u.width=e*a/t,u.height=a):(u.width=r,u.height=t*r/e),u}},{key:"getMaxOffsets",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.state.zoomLevel:arguments[0],t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var i=(0,m.getWindowWidth)(),o=(0,m.getWindowHeight)(),n=this.getZoomMultiplier(e),a=0;a=t.width-i/n<0?(i/n-t.width)/2:(t.width-i/n)/2;var r=0;return r=t.height-o/n<0?(o/n-t.height)/2:(t.height-o/n)/2,{maxX:a,maxY:r,minX:-1*a,minY:-1*r}}},{key:"getOffsetXFromWindowCenter",value:function(e){var t=(0,m.getWindowWidth)();return t/2-e}},{key:"getOffsetYFromWindowCenter",value:function(e){var t=(0,m.getWindowHeight)();return t/2-e}},{key:"getSrcTypes",value:function(){return[{name:"mainSrc",keyEnding:"i"+this.keyCounter},{name:"mainSrcThumbnail",keyEnding:"t"+this.keyCounter},{name:"nextSrc",keyEnding:"i"+(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t"+(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i"+(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t"+(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.state.zoomLevel:arguments[0];return Math.pow(f.ZOOM_RATIO,e)}},{key:"handleKeyInput",value:function(e){if(e.stopPropagation(),!this.isAnimating()){if("keyup"===e.type)return void(this.lastKeyDownTime-=this.props.keyRepeatKeyupBonus);var t=e.which||e.keyCode,i=new Date;if(!(i.getTime()-this.lastKeyDownTime<this.props.keyRepeatLimit&&t!==f.KEYS.ESC))switch(this.lastKeyDownTime=i.getTime(),t){case f.KEYS.ESC:e.preventDefault(),this.requestClose(e);break;case f.KEYS.LEFT_ARROW:if(!this.props.prevSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMovePrev(e);break;case f.KEYS.RIGHT_ARROW:if(!this.props.nextSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMoveNext(e)}}}},{key:"handleOuterMousewheel",value:function(e){var t=this;e.preventDefault(),e.stopPropagation();var i=f.WHEEL_MOVE_X_THRESHOLD,o=0,n=500;if(clearTimeout(this.resetScrollTimeout),this.resetScrollTimeout=setTimeout(function(){t.scrollX=0,t.scrollY=0},300),null===this.wheelActionTimeout&&!this.isAnimating()){if(Math.abs(e.deltaY)<Math.abs(e.deltaX)){this.scrollY=0,this.scrollX+=e.deltaX;var a=i/2;this.scrollX>=i||e.deltaX>=a?(this.requestMoveNext(e),o=n,this.scrollX=0):(this.scrollX<=-1*i||e.deltaX<=-1*a)&&(this.requestMovePrev(e),o=n,this.scrollX=0)}0!==o&&(this.wheelActionTimeout=setTimeout(function(){t.wheelActionTimeout=null},o))}}},{key:"handleImageMouseWheel",value:function(e){e.preventDefault();var t=f.WHEEL_MOVE_Y_THRESHOLD;if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<t)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>f.MIN_ZOOM_LEVEL?this.changeZoom(f.MIN_ZOOM_LEVEL,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+f.ZOOM_BUTTON_INCREMENT_SIZE,e.clientX,e.clientY)}},{key:"handleMouseUp",value:function(){var e=this;if(this.isDragging){this.isDragging=!1;var t=this.getMaxOffsets(),i=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),o=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));i===this.state.offsetX&&o===this.state.offsetY||(this.setState({offsetX:i,offsetY:o,shouldAnimate:!0}),setTimeout(function(){e.setState({shouldAnimate:!1})},this.props.animationDuration))}}},{key:"handleMoveStart",value:function(e,t){this.state.zoomLevel<=f.MIN_ZOOM_LEVEL||(this.isDragging=!0,this.dragStartX=e,this.dragStartY=t,this.dragStartOffsetX=this.state.offsetX,this.dragStartOffsetY=this.state.offsetY)}},{key:"handleOuterMouseDown",value:function(e){e.preventDefault(),this.handleMoveStart(e.clientX,e.clientY)}},{key:"handleOuterTouchStart",value:function(e){var t=e.changedTouches[0];this.handleMoveStart(parseInt(t.clientX,10),parseInt(t.clientY,10))}},{key:"handleMove",value:function(e,t){if(this.isDragging){var i=this.getZoomMultiplier(),o=(this.dragStartX-e)/i+this.dragStartOffsetX,n=(this.dragStartY-t)/i+this.dragStartOffsetY;this.state.offsetX===o&&this.state.offsetY===n||this.setState({offsetX:o,offsetY:n})}}},{key:"handleOuterMouseMove",value:function(e){this.handleMove(e.clientX,e.clientY)}},{key:"handleOuterTouchMove",value:function(e){if(e.preventDefault(),!(this.state.zoomLevel<=f.MIN_ZOOM_LEVEL)){var t=e.changedTouches[0];this.handleMove(parseInt(t.clientX,10),parseInt(t.clientY,10))}}},{key:"handleWindowResize",value:function(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.forceUpdate.bind(this),100)}},{key:"handleZoomInButtonClick",value:function(){this.changeZoom(this.state.zoomLevel+f.ZOOM_BUTTON_INCREMENT_SIZE)}},{key:"handleZoomOutButtonClick",value:function(){this.changeZoom(this.state.zoomLevel-f.ZOOM_BUTTON_INCREMENT_SIZE)}},{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(e,t){var i=this;if(this.isImageLoaded(e))return void setTimeout(function(){t(null,i.imageCache[e].width,i.imageCache[e].height)},1);var o=this,n=new Image;n.onerror=function(){t("image load error")},n.onload=function(){o.imageCache[e]={loaded:!0,width:this.width,height:this.height},t(null,this.width,this.height)},n.src=e}},{key:"loadAllImages",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],i=function(t,i){return function(o){return o?void(window.console&&window.console.warn(o)):void(e.props[t]===i&&e.mounted&&e.forceUpdate())}};this.getSrcTypes().forEach(function(o){var n=o.name;t[n]&&!e.isImageLoaded(t[n])&&e.loadImage(t[n],i(n,t[n]))})}},{key:"requestClose",value:function(e){var t=this,i=function(){return t.props.onCloseRequest(e)};return this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?i():(this.setState({isClosing:!0}),void setTimeout(i,this.props.animationDuration))}},{key:"requestMove",value:function(e,t){var i=this,o={zoomLevel:f.MIN_ZOOM_LEVEL,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(o.shouldAnimate=!0,setTimeout(function(){return i.setState({shouldAnimate:!1})},this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter--,this.setState(o),this.props.onMovePrevRequest(t)):(this.keyCounter++,this.setState(o),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 e=this,t={};!this.props.animationDisabled&&this.isAnimating()&&(t=l({},t,{transition:["transform","left","top","right","bottom"].map(function(t){return t+" "+e.props.animationDuration+"ms"}).join(", ")}));var i={};this.getSrcTypes().forEach(function(e){var t=e.name,o=e.keyEnding;i[t]=o});var o=[],n=function(n,a){var r=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(e.props[n]){var s=l({},r,t);e.state.zoomLevel>f.MIN_ZOOM_LEVEL&&(s.cursor="move");var u=e.getBestImageForType(n);if(null===u){var c=void 0;return c=v<10?d["default"].createElement("div",{className:_.loadingContainer__icon},(0,m.translate)("Loading...")):d["default"].createElement("div",{className:"ril-loading-circle "+_.loadingCircle+" "+_.loadingContainer__icon},d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint}),d["default"].createElement("div",{className:"ril-loading-circle-point "+_.loadingCirclePoint})),void o.push(d["default"].createElement("div",{className:a+" "+_.image+" not-loaded ril-not-loaded",style:s,key:e.props[n]+i[n]},d["default"].createElement("div",{className:_.loadingContainer},c)))}s.width=u.width,s.height=u.height;var h=u.src;e.props.discourageDownloads?(s.backgroundImage="url('"+h+"')",o.push(d["default"].createElement("div",{className:a+" "+_.image+" "+_.imageDiscourager,onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,style:s,key:h+i[n]},d["default"].createElement("div",{className:"download-blocker ril-download-blocker "+_.downloadBlocker})))):o.push(d["default"].createElement("img",{className:a+" "+_.image,onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,style:s,src:h,key:h+i[n],alt:e.props.imageTitle||(0,m.translate)("Image")}))}},a=this.getZoomMultiplier();n("nextSrc","image-next ril-image-next "+_.imageNext),n("mainSrc","image-current ril-image-current",{transform:"scale3d("+a+", "+a+", 1)",left:-1*a*this.state.offsetX,right:a*this.state.offsetX,top:-1*a*this.state.offsetY,bottom:a*this.state.offsetY}),n("prevSrc","image-prev ril-image-prev "+_.imagePrev);var r=function(){},s=[_.toolbarItemChild,_.builtinButton,_.zoomInButton],u=[_.toolbarItemChild,_.builtinButton,_.zoomOutButton],c=this.handleZoomInButtonClick,g=this.handleZoomOutButtonClick;this.state.zoomLevel===f.MAX_ZOOM_LEVEL&&(s.push(_.builtinButtonDisabled),c=r),this.state.zoomLevel===f.MIN_ZOOM_LEVEL&&(u.push(_.builtinButtonDisabled),g=r),this.isAnimating()&&(c=r,g=r);var p={overlay:{zIndex:1e3,backgroundColor:"transparent"},content:{backgroundColor:"transparent",border:"none",borderRadius:0,top:0,left:0,right:0,bottom:0}};return d["default"].createElement(h["default"],{isOpen:!0,onRequestClose:r,style:p,onAfterOpen:function(){return e.outerEl&&e.outerEl.focus()}},d["default"].createElement("div",{className:"outer ril-outer "+_.outer+" "+_.outerAnimating+(this.state.isClosing?" closing ril-closing "+_.outerClosing:""),style:{transition:"opacity "+this.props.animationDuration+"ms",animationDuration:this.props.animationDuration+"ms",animationDirection:this.state.isClosing?"normal":"reverse"},ref:function(t){e.outerEl=t},onWheel:this.handleOuterMousewheel,onMouseMove:this.handleOuterMouseMove,onMouseDown:this.handleOuterMouseDown,onTouchStart:this.handleOuterTouchStart,onTouchMove:this.handleOuterTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},d["default"].createElement("div",{className:"inner ril-inner "+_.inner,onClick:this.props.clickOutsideToClose?this.closeIfClickInner:r},o),this.props.prevSrc?d["default"].createElement("button",{type:"button",className:"prev-button ril-prev-button "+_.navButtons+" "+_.navButtonPrev,key:"prev",onClick:this.isAnimating()?r:this.requestMovePrev}):"",this.props.nextSrc?d["default"].createElement("button",{type:"button",className:"next-button ril-next-button "+_.navButtons+" "+_.navButtonNext,key:"next",onClick:this.isAnimating()?r:this.requestMoveNext}):"",d["default"].createElement("div",{className:"toolbar ril-toolbar "+_.toolbar},d["default"].createElement("ul",{className:"toolbar-left ril-toolbar-left "+_.toolbarSide+" "+_.toolbarLeftSide},d["default"].createElement("li",{className:_.toolbarItem},d["default"].createElement("span",{className:_.toolbarItemChild},this.props.imageTitle))),d["default"].createElement("ul",{className:"toolbar-right ril-toolbar-right "+_.toolbarSide+" "+_.toolbarRightSide},this.props.toolbarButtons?this.props.toolbarButtons.map(function(e,t){return d["default"].createElement("li",{key:t,className:_.toolbarItem},e)}):"",d["default"].createElement("li",{className:_.toolbarItem},d["default"].createElement("button",{type:"button",key:"zoom-in",className:"zoom-in ril-zoom-in "+s.join(" "),onClick:c})),d["default"].createElement("li",{className:_.toolbarItem},d["default"].createElement("button",{type:"button",key:"zoom-out",className:"zoom-out ril-zoom-out "+u.join(" "),onClick:g})),d["default"].createElement("li",{className:_.toolbarItem},d["default"].createElement("button",{type:"button",key:"close",className:"close ril-close "+_.toolbarItemChild+(" "+_.builtinButton+" "+_.closeButton),onClick:this.isAnimating()?r:this.requestClose}))))))}}]),t}(u.Component);b.propTypes={mainSrc:u.PropTypes.string.isRequired,prevSrc:u.PropTypes.string,nextSrc:u.PropTypes.string,mainSrcThumbnail:u.PropTypes.string,prevSrcThumbnail:u.PropTypes.string,nextSrcThumbnail:u.PropTypes.string,onCloseRequest:u.PropTypes.func.isRequired,onMovePrevRequest:u.PropTypes.func,onMoveNextRequest:u.PropTypes.func,discourageDownloads:u.PropTypes.bool,animationDisabled:u.PropTypes.bool,animationOnKeyInput:u.PropTypes.bool,animationDuration:u.PropTypes.number,keyRepeatLimit:u.PropTypes.number,keyRepeatKeyupBonus:u.PropTypes.number,imageTitle:u.PropTypes.node,toolbarButtons:u.PropTypes.arrayOf(u.PropTypes.node),imagePadding:u.PropTypes.number,clickOutsideToClose:u.PropTypes.bool},b.defaultProps={onMovePrevRequest:function(){},onMoveNextRequest:function(){},discourageDownloads:!1,animationDisabled:!1,animationOnKeyInput:!1,animationDuration:300,keyRepeatLimit:180,keyRepeatKeyupBonus:40,imagePadding:10,clickOutsideToClose:!0},t["default"]=b},function(e,t){"use strict";function i(){var e=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);return e?parseInt(e[1],10):void 0}function o(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!e)return"";var i=e;return t&&Object.keys(t).forEach(function(e){i=i.replace(e,t[e])}),i}function n(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function a(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function r(){try{return window.self!==window.top}catch(e){return!0}}Object.defineProperty(t,"__esModule",{value:!0}),t.getIEVersion=i,t.translate=o,t.getWindowWidth=n,t.getWindowHeight=a,t.isInIframe=r},function(e,t,i){t=e.exports=i(5)(),t.push([e.id,'@-webkit-keyframes closeWindow___2Hlon{0%{opacity:1}to{opacity:0}}@keyframes closeWindow___2Hlon{0%{opacity:1}to{opacity:0}}.outer___2lDXy{background-color:rgba(0,0,0,.85);position:fixed;top:0;left:0;right:0;bottom:0;z-index:1000;width:100%;height:100%}.outerClosing___1EQGK{opacity:0}.inner___1rfRQ{left:0;right:0}.image___2FLq2,.inner___1rfRQ{position:absolute;top:0;bottom:0}.image___2FLq2{margin:auto;max-width:100%;max-height:100%}.imagePrev___F6xVQ{left:-100%;right:100%}.imageNext___1uRqJ{left:100%;right:-100%}.imageDiscourager___3-CUB{background-repeat:no-repeat;background-position:50%;background-size:contain}.navButtons___3kNVF{border:none;position:absolute;top:0;bottom:0;width:20px;height:34px;padding:40px 30px;margin:auto;cursor:pointer;opacity:.7}.navButtons___3kNVF:hover{opacity:1}.navButtons___3kNVF:active{opacity:.7}.navButtonPrev___2vBS8{left:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDE5LDMgLTIsLTIgLTE2LDE2IDE2LDE2IDEsLTEgLTE1LC0xNSAxNSwtMTUgeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==") no-repeat 50%}.navButtonNext___30R2i{right:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDEsMyAyLC0yIDE2LDE2IC0xNiwxNiAtMSwtMSAxNSwtMTUgLTE1LC0xNSB6IiBmaWxsPSIjRkZGIi8+PC9zdmc+") no-repeat 50%}.downloadBlocker___3rU9-{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");background-size:cover}.toolbar___1xYly{background-color:rgba(0,0,0,.5);position:absolute;left:0;top:0;right:0;height:50px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.toolbarSide___3FYWk{height:50px;margin:0}.toolbarSideNoFlex___KxqgW{height:auto;line-height:50px;max-width:48%;position:absolute;top:0;bottom:0}.toolbarLeftSide___8beAg{padding-left:20px;padding-right:0;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis}.toolbarLeftSideNoFlex___3O3cZ{left:0;overflow:visible}.toolbarRightSide___1Sdfc{padding-left:0;padding-right:20px;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.toolbarRightSideNoFlex___oa0FT{right:0}.toolbarItem___3WbMb{display:inline-block;line-height:50px;padding:0;color:#fff;font-size:120%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toolbarItemChild___2U_MP{vertical-align:middle}.builtinButton___1zqo6{width:40px;height:35px;cursor:pointer;border:none;opacity:.7}.builtinButton___1zqo6:hover{opacity:1}.builtinButton___1zqo6:active{outline:none}.builtinButtonDisabled___3uvqe{cursor:default;opacity:.5}.builtinButtonDisabled___3uvqe:hover{opacity:.5}.closeButton___3BdAF{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIj48cGF0aCBkPSJtIDEsMyAxLjI1LC0xLjI1IDcuNSw3LjUgNy41LC03LjUgMS4yNSwxLjI1IC03LjUsNy41IDcuNSw3LjUgLTEuMjUsMS4yNSAtNy41LC03LjUgLTcuNSw3LjUgLTEuMjUsLTEuMjUgNy41LC03LjUgLTcuNSwtNy41IHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=") no-repeat 50%}.zoomInButton___3xtuX{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PHBhdGggZD0iTTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+") no-repeat 50%}.zoomOutButton___38PZx{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=") no-repeat 50%}.outerAnimating___2-fZi{-webkit-animation-name:closeWindow___2Hlon;animation-name:closeWindow___2Hlon}@-webkit-keyframes pointFade___2RA5J{0%,19.999%,to{opacity:0}20%{opacity:1}}@keyframes pointFade___2RA5J{0%,19.999%,to{opacity:0}20%{opacity:1}}.loadingCircle___3JNJg{width:60px;height:60px;position:relative}.loadingCirclePoint___3md-S{width:100%;height:100%;position:absolute;left:0;top:0}.loadingCirclePoint___3md-S:before{content:\'\';display:block;margin:0 auto;width:15%;height:15%;background-color:#fff;border-radius:30%;-webkit-animation:pointFade___2RA5J 1.2s infinite ease-in-out both;animation:pointFade___2RA5J 1.2s infinite ease-in-out both}.loadingCirclePoint___3md-S:nth-of-type(1){-webkit-transform:rotate(0deg);transform:rotate(0deg)}.loadingCirclePoint___3md-S:nth-of-type(1):before,.loadingCirclePoint___3md-S:nth-of-type(7):before{-webkit-animation-delay:-1.2s;animation-delay:-1.2s}.loadingCirclePoint___3md-S:nth-of-type(2){-webkit-transform:rotate(30deg);transform:rotate(30deg)}.loadingCirclePoint___3md-S:nth-of-type(8){-webkit-transform:rotate(210deg);transform:rotate(210deg)}.loadingCirclePoint___3md-S:nth-of-type(2):before,.loadingCirclePoint___3md-S:nth-of-type(8):before{-webkit-animation-delay:-1s;animation-delay:-1s}.loadingCirclePoint___3md-S:nth-of-type(3){-webkit-transform:rotate(60deg);transform:rotate(60deg)}.loadingCirclePoint___3md-S:nth-of-type(9){-webkit-transform:rotate(240deg);transform:rotate(240deg)}.loadingCirclePoint___3md-S:nth-of-type(3):before,.loadingCirclePoint___3md-S:nth-of-type(9):before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.loadingCirclePoint___3md-S:nth-of-type(4){-webkit-transform:rotate(90deg);transform:rotate(90deg)}.loadingCirclePoint___3md-S:nth-of-type(10){-webkit-transform:rotate(270deg);transform:rotate(270deg)}.loadingCirclePoint___3md-S:nth-of-type(4):before,.loadingCirclePoint___3md-S:nth-of-type(10):before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.loadingCirclePoint___3md-S:nth-of-type(5){-webkit-transform:rotate(120deg);transform:rotate(120deg)}.loadingCirclePoint___3md-S:nth-of-type(11){-webkit-transform:rotate(300deg);transform:rotate(300deg)}.loadingCirclePoint___3md-S:nth-of-type(5):before,.loadingCirclePoint___3md-S:nth-of-type(11):before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.loadingCirclePoint___3md-S:nth-of-type(6){-webkit-transform:rotate(150deg);transform:rotate(150deg)}.loadingCirclePoint___3md-S:nth-of-type(12){-webkit-transform:rotate(330deg);transform:rotate(330deg)}.loadingCirclePoint___3md-S:nth-of-type(6):before,.loadingCirclePoint___3md-S:nth-of-type(12):before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.loadingCirclePoint___3md-S:nth-of-type(7){-webkit-transform:rotate(180deg);transform:rotate(180deg)}.loadingCirclePoint___3md-S:nth-of-type(13){-webkit-transform:rotate(1turn);transform:rotate(1turn)}.loadingCirclePoint___3md-S:nth-of-type(7):before,.loadingCirclePoint___3md-S:nth-of-type(13):before{-webkit-animation-delay:0ms;animation-delay:0ms}.loadingContainer___2vaJ-{position:absolute;top:0;right:0;bottom:0;left:0}.loadingContainer__icon___1wQQz{color:#fff;position:absolute;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}',""]),t.locals={outer:"outer___2lDXy",outerClosing:"outerClosing___1EQGK",inner:"inner___1rfRQ",image:"image___2FLq2",imagePrev:"imagePrev___F6xVQ",imageNext:"imageNext___1uRqJ",imageDiscourager:"imageDiscourager___3-CUB",navButtons:"navButtons___3kNVF",navButtonPrev:"navButtonPrev___2vBS8",navButtonNext:"navButtonNext___30R2i",downloadBlocker:"downloadBlocker___3rU9-",toolbar:"toolbar___1xYly",toolbarSide:"toolbarSide___3FYWk",toolbarSideNoFlex:"toolbarSideNoFlex___KxqgW",toolbarLeftSide:"toolbarLeftSide___8beAg",toolbarLeftSideNoFlex:"toolbarLeftSideNoFlex___3O3cZ",toolbarRightSide:"toolbarRightSide___1Sdfc",toolbarRightSideNoFlex:"toolbarRightSideNoFlex___oa0FT",toolbarItem:"toolbarItem___3WbMb",toolbarItemChild:"toolbarItemChild___2U_MP",builtinButton:"builtinButton___1zqo6",builtinButtonDisabled:"builtinButtonDisabled___3uvqe",closeButton:"closeButton___3BdAF",zoomInButton:"zoomInButton___3xtuX",zoomOutButton:"zoomOutButton___38PZx",outerAnimating:"outerAnimating___2-fZi",closeWindow:"closeWindow___2Hlon",loadingCircle:"loadingCircle___3JNJg",loadingCirclePoint:"loadingCirclePoint___3md-S",pointFade:"pointFade___2RA5J",loadingContainer:"loadingContainer___2vaJ-",loadingContainer__icon:"loadingContainer__icon___1wQQz"}},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var i=this[t];i[2]?e.push("@media "+i[2]+"{"+i[1]+"}"):e.push(i[1])}return e.join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(o[a]=!0)}for(n=0;n<t.length;n++){var r=t[n];"number"==typeof r[0]&&o[r[0]]||(i&&!r[2]?r[2]=i:i&&(r[2]="("+r[2]+") and ("+i+")"),e.push(r))}},e}},function(e,t,i){function o(e,t){for(var i=0;i<e.length;i++){var o=e[i],n=m[o.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](o.parts[a]);for(;a<o.parts.length;a++)n.parts.push(u(o.parts[a],t))}else{for(var r=[],a=0;a<o.parts.length;a++)r.push(u(o.parts[a],t));m[o.id]={id:o.id,refs:1,parts:r}}}}function n(e){for(var t=[],i={},o=0;o<e.length;o++){var n=e[o],a=n[0],r=n[1],s=n[2],l=n[3],u={css:r,media:s,sourceMap:l};i[a]?i[a].parts.push(u):t.push(i[a]={id:a,parts:[u]})}return t}function a(e,t){var i=p(),o=b[b.length-1];if("top"===e.insertAt)o?o.nextSibling?i.insertBefore(t,o.nextSibling):i.appendChild(t):i.insertBefore(t,i.firstChild),b.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");i.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=b.indexOf(e);t>=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",a(e,t),t}function l(e){var t=document.createElement("link");return t.rel="stylesheet",a(e,t),t}function u(e,t){var i,o,n;if(t.singleton){var a=v++;i=_||(_=s(t)),o=d.bind(null,i,a,!1),n=d.bind(null,i,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=l(t),o=h.bind(null,i),n=function(){r(i),i.href&&URL.revokeObjectURL(i.href)}):(i=s(t),o=c.bind(null,i),n=function(){r(i)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else n()}}function d(e,t,i,o){var n=i?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(t,n);else{var a=document.createTextNode(n),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(a,r[t]):e.appendChild(a)}}function c(e,t){var i=t.css,o=t.media; | ||
if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}function h(e,t){var i=t.css,o=t.sourceMap;o&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var n=new Blob([i],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(n),a&&URL.revokeObjectURL(a)}var m={},f=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},g=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=f(function(){return document.head||document.getElementsByTagName("head")[0]}),_=null,v=0,b=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=g()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var i=n(e);return o(i,t),function(e){for(var a=[],r=0;r<i.length;r++){var s=i[r],l=m[s.id];l.refs--,a.push(l)}if(e){var u=n(e);o(u,t)}for(var r=0;r<a.length;r++){var l=a[r];if(0===l.refs){for(var d=0;d<l.parts.length;d++)l.parts[d]();delete m[l.id]}}}};var y=function(){var e=[];return function(t,i){return e[t]=i,e.filter(Boolean).join("\n")}}()},function(e,t,i){var o=i(4);"string"==typeof o&&(o=[[e.id,o,""]]);i(6)(o,{});o.locals&&(e.exports=o.locals)},function(t,i){t.exports=e},function(e,i){e.exports=t}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-modal")):"function"==typeof define&&define.amd?define(["react","react-modal"],t):"object"==typeof exports?exports.ReactImageLightbox=t(require("react"),require("react-modal")):e.ReactImageLightbox=t(e.react,e["react-modal"])}(this,function(e,t){return function(e){function t(o){if(i[o])return i[o].exports;var n=i[o]={exports:{},id:o,loaded:!1};return e[o].call(n.exports,n,n.exports,t),n.loaded=!0,n.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){"use strict";e.exports=i(2)["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.MIN_ZOOM_LEVEL=0,t.MAX_ZOOM_LEVEL=300,t.ZOOM_RATIO=1.007,t.ZOOM_BUTTON_INCREMENT_SIZE=100,t.WHEEL_MOVE_X_THRESHOLD=200,t.WHEEL_MOVE_Y_THRESHOLD=1,t.KEYS={ESC:27,LEFT_ARROW:37,RIGHT_ARROW:39}},function(e,t,i){"use strict";function o(e){return e&&e.__esModule?e:{"default":e}}function n(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,i,o){return i&&e(t.prototype,i),o&&e(t,o),t}}(),u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},d=i(8),c=o(d),h=i(9),m=o(h),f=i(3),g=i(1),p=i(7),_=o(p),v=_["default"],b=(0,f.getIEVersion)();b<10&&(v=u({},v,{toolbarSide:v.toolbarSide+" "+v.toolbarSideNoFlex,toolbarLeftSide:v.toolbarLeftSide+" "+v.toolbarLeftSideNoFlex,toolbarRightSide:v.toolbarRightSide+" "+v.toolbarRightSideNoFlex}));var y=function(e){function t(e){a(this,t);var i=r(this,Object.getPrototypeOf(t).call(this,e));return i.state={isClosing:!e.animationDisabled,shouldAnimate:!1,zoomLevel:g.MIN_ZOOM_LEVEL,offsetX:0,offsetY:0},i.closeIfClickInner=i.closeIfClickInner.bind(i),i.handleImageDoubleClick=i.handleImageDoubleClick.bind(i),i.handleImageMouseWheel=i.handleImageMouseWheel.bind(i),i.handleKeyInput=i.handleKeyInput.bind(i),i.handleMouseUp=i.handleMouseUp.bind(i),i.handleOuterMouseDown=i.handleOuterMouseDown.bind(i),i.handleOuterMouseMove=i.handleOuterMouseMove.bind(i),i.handleOuterMousewheel=i.handleOuterMousewheel.bind(i),i.handleOuterTouchStart=i.handleOuterTouchStart.bind(i),i.handleOuterTouchMove=i.handleOuterTouchMove.bind(i),i.handleWindowResize=i.handleWindowResize.bind(i),i.handleZoomInButtonClick=i.handleZoomInButtonClick.bind(i),i.handleZoomOutButtonClick=i.handleZoomOutButtonClick.bind(i),i.requestClose=i.requestClose.bind(i),i.requestMoveNext=i.requestMoveNext.bind(i),i.requestMovePrev=i.requestMovePrev.bind(i),i}return l(t,e),s(t,[{key:"componentWillMount",value:function(){this.listenersAttached=!1,this.keyPressed=!1,this.imageCache={},this.lastKeyDownTime=0,this.resizeTimeout=null,this.wheelActionTimeout=null,this.resetScrollTimeout=null,this.scrollX=0,this.scrollY=0,this.isDragging=!1,this.dragStartX=0,this.dragStartY=0,this.dragStartOffsetX=0,this.dragStartOffsetY=0,this.keyCounter=0,this.moveRequested=!1,this.props.animationDisabled||this.setState({isClosing:!1})}},{key:"componentDidMount",value:function(){this.mounted=!0,this.attachListeners(),this.loadAllImages()}},{key:"componentWillReceiveProps",value:function(e){var t=this,i=!1,o={},n={};this.getSrcTypes().forEach(function(a){t.props[a.name]!==e[a.name]&&(i=!0,o[t.props[a.name]]=!0,n[e[a.name]]=!0)}),(i||this.moveRequested)&&(Object.keys(o).forEach(function(e){!(e in n)&&e in t.imageCache&&(t.imageCache[e].loaded=!1)}),this.moveRequested=!1,this.loadAllImages(e))}},{key:"componentWillUnmount",value:function(){this.mounted=!1,this.detachListeners()}},{key:"attachListeners",value:function(){this.listenersAttached||(window.addEventListener("resize",this.handleWindowResize),window.addEventListener("mouseup",this.handleMouseUp),window.addEventListener("touchend",this.handleMouseUp),(0,f.isInIframe)()&&(window.top.addEventListener("mouseup",this.handleMouseUp),window.top.addEventListener("touchend",this.handleMouseUp)),this.listenersAttached=!0)}},{key:"changeZoom",value:function(e,t,i){if(this.props.enableZoom){var o=Math.max(g.MIN_ZOOM_LEVEL,Math.min(g.MAX_ZOOM_LEVEL,e));if(o!==this.state.zoomLevel){if(o===g.MIN_ZOOM_LEVEL)return this.setState({zoomLevel:o,offsetX:0,offsetY:0});var n=this.getBestImageForType("mainSrc");if(null!==n){var a=this.getZoomMultiplier(),r=this.getZoomMultiplier(o),l=this.getLightboxRect(),s="undefined"!=typeof t?(t-l.left-(l.width-n.width)/2)/n.width:.5,u="undefined"!=typeof i?(i-l.top-(l.height-n.height)/2)/n.height:.5,d=n.width*a,c=n.height*a,h=n.width*r,m=n.height*r,f=(d-h)*(s-.5),p=(c-m)*(u-.5),_=this.state.offsetX-f,v=this.state.offsetY-p,b=this.getMaxOffsets();this.state.zoomLevel>o&&(_=Math.max(b.minX,Math.min(b.maxX,_)),v=Math.max(b.minY,Math.min(b.maxY,v))),this.setState({zoomLevel:o,offsetX:_,offsetY:v})}}}}},{key:"closeIfClickInner",value:function(e){e.target.className.search(/\binner\b/)>-1&&this.requestClose(e)}},{key:"detachListeners",value:function(){this.listenersAttached&&(window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("mouseup",this.handleMouseUp),window.removeEventListener("touchend",this.handleMouseUp),(0,f.isInIframe)()&&(window.top.removeEventListener("mouseup",this.handleMouseUp),window.top.removeEventListener("touchend",this.handleMouseUp)),this.listenersAttached=!1)}},{key:"getBestImageForType",value:function(e){var t=this.props[e],i={};if(this.isImageLoaded(t))i=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height);else{if(!this.isImageLoaded(this.props[e+"Thumbnail"]))return null;t=this.props[e+"Thumbnail"],i=this.getFitSizes(this.imageCache[t].width,this.imageCache[t].height,!0)}return{src:t,height:i.height,width:i.width}}},{key:"getFitSizes",value:function(e,t,i){var o=this.getLightboxRect(),n=o.height-2*this.props.imagePadding,a=o.width-2*this.props.imagePadding;i||(n=Math.min(n,t),a=Math.min(a,e));var r=a/n,l=e/t;return r>l?{width:e*n/t,height:n}:{width:a,height:t*a/e}}},{key:"getMaxOffsets",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.state.zoomLevel:arguments[0],t=this.getBestImageForType("mainSrc");if(null===t)return{maxX:0,minX:0,maxY:0,minY:0};var i=this.getLightboxRect(),o=this.getZoomMultiplier(e),n=0;n=o*t.width-i.width<0?(i.width-o*t.width)/2:(o*t.width-i.width)/2;var a=0;return a=o*t.height-i.height<0?(i.height-o*t.height)/2:(o*t.height-i.height)/2,{maxX:n,maxY:a,minX:-1*n,minY:-1*a}}},{key:"getSrcTypes",value:function(){return[{name:"mainSrc",keyEnding:"i"+this.keyCounter},{name:"mainSrcThumbnail",keyEnding:"t"+this.keyCounter},{name:"nextSrc",keyEnding:"i"+(this.keyCounter+1)},{name:"nextSrcThumbnail",keyEnding:"t"+(this.keyCounter+1)},{name:"prevSrc",keyEnding:"i"+(this.keyCounter-1)},{name:"prevSrcThumbnail",keyEnding:"t"+(this.keyCounter-1)}]}},{key:"getZoomMultiplier",value:function(){var e=arguments.length<=0||void 0===arguments[0]?this.state.zoomLevel:arguments[0];return Math.pow(g.ZOOM_RATIO,e)}},{key:"getLightboxRect",value:function(){return this.outerEl?this.outerEl.getBoundingClientRect():{width:(0,f.getWindowWidth)(),height:(0,f.getWindowHeight)(),top:0,right:0,bottom:0,left:0}}},{key:"handleKeyInput",value:function(e){if(e.stopPropagation(),!this.isAnimating()){if("keyup"===e.type)return void(this.lastKeyDownTime-=this.props.keyRepeatKeyupBonus);var t=e.which||e.keyCode,i=new Date;if(!(i.getTime()-this.lastKeyDownTime<this.props.keyRepeatLimit&&t!==g.KEYS.ESC))switch(this.lastKeyDownTime=i.getTime(),t){case g.KEYS.ESC:e.preventDefault(),this.requestClose(e);break;case g.KEYS.LEFT_ARROW:if(!this.props.prevSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMovePrev(e);break;case g.KEYS.RIGHT_ARROW:if(!this.props.nextSrc)return;e.preventDefault(),this.keyPressed=!0,this.requestMoveNext(e)}}}},{key:"handleOuterMousewheel",value:function(e){var t=this;e.preventDefault(),e.stopPropagation();var i=g.WHEEL_MOVE_X_THRESHOLD,o=0,n=500;if(clearTimeout(this.resetScrollTimeout),this.resetScrollTimeout=setTimeout(function(){t.scrollX=0,t.scrollY=0},300),null===this.wheelActionTimeout&&!this.isAnimating()){if(Math.abs(e.deltaY)<Math.abs(e.deltaX)){this.scrollY=0,this.scrollX+=e.deltaX;var a=i/2;this.scrollX>=i||e.deltaX>=a?(this.requestMoveNext(e),o=n,this.scrollX=0):(this.scrollX<=-1*i||e.deltaX<=-1*a)&&(this.requestMovePrev(e),o=n,this.scrollX=0)}0!==o&&(this.wheelActionTimeout=setTimeout(function(){t.wheelActionTimeout=null},o))}}},{key:"handleImageMouseWheel",value:function(e){e.preventDefault();var t=g.WHEEL_MOVE_Y_THRESHOLD;if(Math.abs(e.deltaY)>=Math.abs(e.deltaX)){if(e.stopPropagation(),Math.abs(e.deltaY)<t)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>g.MIN_ZOOM_LEVEL?this.changeZoom(g.MIN_ZOOM_LEVEL,e.clientX,e.clientY):this.changeZoom(this.state.zoomLevel+g.ZOOM_BUTTON_INCREMENT_SIZE,e.clientX,e.clientY)}},{key:"handleMouseUp",value:function(){var e=this;if(this.isDragging){this.isDragging=!1;var t=this.getMaxOffsets(),i=Math.max(t.minX,Math.min(t.maxX,this.state.offsetX)),o=Math.max(t.minY,Math.min(t.maxY,this.state.offsetY));i===this.state.offsetX&&o===this.state.offsetY||(this.setState({offsetX:i,offsetY:o,shouldAnimate:!0}),setTimeout(function(){e.setState({shouldAnimate:!1})},this.props.animationDuration))}}},{key:"handleMoveStart",value:function(e,t){this.state.zoomLevel<=g.MIN_ZOOM_LEVEL||(this.isDragging=!0,this.dragStartX=e,this.dragStartY=t,this.dragStartOffsetX=this.state.offsetX,this.dragStartOffsetY=this.state.offsetY)}},{key:"handleOuterMouseDown",value:function(e){e.preventDefault(),this.handleMoveStart(e.clientX,e.clientY)}},{key:"handleOuterTouchStart",value:function(e){var t=e.changedTouches[0];this.handleMoveStart(parseInt(t.clientX,10),parseInt(t.clientY,10))}},{key:"handleMove",value:function(e,t){if(this.isDragging){var i=this.dragStartX-e+this.dragStartOffsetX,o=this.dragStartY-t+this.dragStartOffsetY;this.state.offsetX===i&&this.state.offsetY===o||this.setState({offsetX:i,offsetY:o})}}},{key:"handleOuterMouseMove",value:function(e){this.handleMove(e.clientX,e.clientY)}},{key:"handleOuterTouchMove",value:function(e){if(e.preventDefault(),!(this.state.zoomLevel<=g.MIN_ZOOM_LEVEL)){var t=e.changedTouches[0];this.handleMove(parseInt(t.clientX,10),parseInt(t.clientY,10))}}},{key:"handleWindowResize",value:function(){clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.forceUpdate.bind(this),100)}},{key:"handleZoomInButtonClick",value:function(){this.changeZoom(this.state.zoomLevel+g.ZOOM_BUTTON_INCREMENT_SIZE)}},{key:"handleZoomOutButtonClick",value:function(){this.changeZoom(this.state.zoomLevel-g.ZOOM_BUTTON_INCREMENT_SIZE)}},{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(e,t){var i=this;if(this.isImageLoaded(e))return void setTimeout(function(){t(null,i.imageCache[e].width,i.imageCache[e].height)},1);var o=this,n=new Image;n.onerror=function(){t("image load error")},n.onload=function(){o.imageCache[e]={loaded:!0,width:this.width,height:this.height},t(null,this.width,this.height)},n.src=e}},{key:"loadAllImages",value:function(){var e=this,t=arguments.length<=0||void 0===arguments[0]?this.props:arguments[0],i=function(t,i){return function(o){return o?void(window.console&&window.console.warn(o)):void(e.props[t]===i&&e.mounted&&e.forceUpdate())}};this.getSrcTypes().forEach(function(o){var n=o.name;t[n]&&!e.isImageLoaded(t[n])&&e.loadImage(t[n],i(n,t[n]))})}},{key:"requestClose",value:function(e){var t=this,i=function(){return t.props.onCloseRequest(e)};return this.props.animationDisabled||"keydown"===e.type&&!this.props.animationOnKeyInput?i():(this.setState({isClosing:!0}),void setTimeout(i,this.props.animationDuration))}},{key:"requestMove",value:function(e,t){var i=this,o={zoomLevel:g.MIN_ZOOM_LEVEL,offsetX:0,offsetY:0};this.props.animationDisabled||this.keyPressed&&!this.props.animationOnKeyInput||(o.shouldAnimate=!0,setTimeout(function(){return i.setState({shouldAnimate:!1})},this.props.animationDuration)),this.keyPressed=!1,this.moveRequested=!0,"prev"===e?(this.keyCounter--,this.setState(o),this.props.onMovePrevRequest(t)):(this.keyCounter++,this.setState(o),this.props.onMoveNextRequest(t))}},{key:"requestMoveNext",value:function(e){this.requestMove("next",e)}},{key:"requestMovePrev",value:function(e){this.requestMove("prev",e)}},{key:"getTransform",value:function(e){var t=e.x,i=void 0===t?null:t,o=e.y,a=void 0===o?null:o,r=e.zoom,l=void 0===r?null:r,s=b<10,u=[];return null===i&&null===a||u.push(s?"translate("+(i||0)+"px,"+(a||0)+"px)":"translate3d("+(i||0)+"px,"+(a||0)+"px,0)"),null!==l&&u.push(s?"scale("+l+")":"scale3d("+l+","+l+",1)"),n({},s?"msTransform":"transform",0===u.length?"none":u.join(" "))}},{key:"render",value:function(){var e=this,t=this.props,i=t.animationDisabled,o=t.animationDuration,n=t.clickOutsideToClose,a=t.discourageDownloads,r=t.enableZoom,l=t.imageTitle,s=t.nextSrc,d=t.prevSrc,h=t.toolbarButtons,p=t.reactModalStyle,_=this.state,y=_.zoomLevel,I=_.offsetX,w=_.offsetY,M=_.isClosing,k=this.getLightboxRect(),S={};!i&&this.isAnimating()&&(S=u({},S,{transition:"transform "+o+"ms"}));var C={};this.getSrcTypes().forEach(function(e){var t=e.name,i=e.keyEnding;C[t]=i});var x=[],E=function(t,i){var o=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if(e.props[t]){var n=u({},o,S);y>g.MIN_ZOOM_LEVEL&&(n.cursor="move");var r=e.getBestImageForType(t);if(null===r){var s=void 0;return s=b<10?c["default"].createElement("div",{className:v.loadingContainer__icon},(0,f.translate)("Loading...")):c["default"].createElement("div",{className:"ril-loading-circle "+v.loadingCircle+" "+v.loadingContainer__icon},c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint}),c["default"].createElement("div",{className:"ril-loading-circle-point "+v.loadingCirclePoint})),void x.push(c["default"].createElement("div",{className:i+" "+v.image+" not-loaded ril-not-loaded",style:n,key:e.props[t]+C[t]},c["default"].createElement("div",{className:v.loadingContainer},s)))}n.width=r.width,n.height=r.height;var d=r.src;a?(n.backgroundImage="url('"+d+"')",x.push(c["default"].createElement("div",{className:i+" "+v.image+" "+v.imageDiscourager,onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,style:n,key:d+C[t]},c["default"].createElement("div",{className:"download-blocker ril-download-blocker "+v.downloadBlocker})))):x.push(c["default"].createElement("img",{className:i+" "+v.image,onDoubleClick:e.handleImageDoubleClick,onWheel:e.handleImageMouseWheel,style:n,src:d,key:d+C[t],alt:l||(0,f.translate)("Image")}))}},L=this.getZoomMultiplier();E("nextSrc","image-next ril-image-next "+v.imageNext,this.getTransform({x:k.width})),E("mainSrc","image-current ril-image-current",this.getTransform({x:-1*I,y:-1*w,zoom:L})),E("prevSrc","image-prev ril-image-prev "+v.imagePrev,this.getTransform({x:-1*k.width}));var T=function(){},P=[v.toolbarItemChild,v.builtinButton,v.zoomInButton],N=[v.toolbarItemChild,v.builtinButton,v.zoomOutButton],O=this.handleZoomInButtonClick,R=this.handleZoomOutButtonClick;y===g.MAX_ZOOM_LEVEL&&(P.push(v.builtinButtonDisabled),O=T),y===g.MIN_ZOOM_LEVEL&&(N.push(v.builtinButtonDisabled),R=T),this.isAnimating()&&(O=T,R=T);var B={overlay:u({zIndex:1e3,backgroundColor:"transparent"},p.overlay),content:u({backgroundColor:"transparent",overflow:"hidden",border:"none",borderRadius:0,padding:0,top:0,left:0,right:0,bottom:0},p.content)};return c["default"].createElement(m["default"],{isOpen:!0,onRequestClose:n?this.requestClose:T,onAfterOpen:function(){return e.outerEl&&e.outerEl.focus()},style:B},c["default"].createElement("div",{className:"outer ril-outer "+v.outer+" "+v.outerAnimating+(M?" closing ril-closing "+v.outerClosing:""),style:{transition:"opacity "+o+"ms",animationDuration:o+"ms",animationDirection:M?"normal":"reverse"},ref:function(t){e.outerEl=t},onWheel:this.handleOuterMousewheel,onMouseMove:this.handleOuterMouseMove,onMouseDown:this.handleOuterMouseDown,onTouchStart:this.handleOuterTouchStart,onTouchMove:this.handleOuterTouchMove,tabIndex:"-1",onKeyDown:this.handleKeyInput,onKeyUp:this.handleKeyInput},c["default"].createElement("div",{className:"inner ril-inner "+v.inner,onClick:n?this.closeIfClickInner:T},x),d?c["default"].createElement("button",{type:"button",className:"prev-button ril-prev-button "+v.navButtons+" "+v.navButtonPrev,key:"prev",onClick:this.isAnimating()?T:this.requestMovePrev}):"",s?c["default"].createElement("button",{type:"button",className:"next-button ril-next-button "+v.navButtons+" "+v.navButtonNext,key:"next",onClick:this.isAnimating()?T:this.requestMoveNext}):"",c["default"].createElement("div",{className:"toolbar ril-toolbar "+v.toolbar},c["default"].createElement("ul",{className:"toolbar-left ril-toolbar-left "+v.toolbarSide+" "+v.toolbarLeftSide},c["default"].createElement("li",{className:"ril-toolbar__item "+v.toolbarItem},c["default"].createElement("span",{className:"ril-toolbar__item__child "+v.toolbarItemChild},l))),c["default"].createElement("ul",{className:["toolbar-right","ril-toolbar-right",v.toolbarSide,v.toolbarRightSide].join(" ")},h?h.map(function(e,t){return c["default"].createElement("li",{key:t,className:"ril-toolbar__item "+v.toolbarItem},e)}):"",r&&c["default"].createElement("li",{className:"ril-toolbar__item "+v.toolbarItem},c["default"].createElement("button",{type:"button",key:"zoom-in",className:"zoom-in ril-zoom-in "+P.join(" "),onClick:O})),r&&c["default"].createElement("li",{className:"ril-toolbar__item "+v.toolbarItem},c["default"].createElement("button",{type:"button",key:"zoom-out",className:"zoom-out ril-zoom-out "+N.join(" "),onClick:R})),c["default"].createElement("li",{className:"ril-toolbar__item "+v.toolbarItem},c["default"].createElement("button",{type:"button",key:"close",className:"close ril-close ril-toolbar__item__child"+(" "+v.toolbarItemChild+" "+v.builtinButton+" "+v.closeButton),onClick:this.isAnimating()?T:this.requestClose}))))))}}]),t}(d.Component);y.propTypes={mainSrc:d.PropTypes.string.isRequired,prevSrc:d.PropTypes.string,nextSrc:d.PropTypes.string,mainSrcThumbnail:d.PropTypes.string,prevSrcThumbnail:d.PropTypes.string,nextSrcThumbnail:d.PropTypes.string,onCloseRequest:d.PropTypes.func.isRequired,onMovePrevRequest:d.PropTypes.func,onMoveNextRequest:d.PropTypes.func,discourageDownloads:d.PropTypes.bool,animationDisabled:d.PropTypes.bool,animationOnKeyInput:d.PropTypes.bool,animationDuration:d.PropTypes.number,keyRepeatLimit:d.PropTypes.number,keyRepeatKeyupBonus:d.PropTypes.number,imageTitle:d.PropTypes.node,reactModalStyle:d.PropTypes.object,imagePadding:d.PropTypes.number,toolbarButtons:d.PropTypes.arrayOf(d.PropTypes.node),clickOutsideToClose:d.PropTypes.bool,enableZoom:d.PropTypes.bool},y.defaultProps={onMovePrevRequest:function(){},onMoveNextRequest:function(){},discourageDownloads:!1,animationDisabled:!1,animationOnKeyInput:!1,animationDuration:300,keyRepeatLimit:180,keyRepeatKeyupBonus:40,reactModalStyle:{},imagePadding:10,clickOutsideToClose:!0,enableZoom:!0},t["default"]=y},function(e,t){"use strict";function i(){var e=navigator.userAgent.match(/(?:MSIE |Trident\/.*; rv:)(\d+)/);return e?parseInt(e[1],10):void 0}function o(e){var t=arguments.length<=1||void 0===arguments[1]?null:arguments[1];if(!e)return"";var i=e;return t&&Object.keys(t).forEach(function(e){i=i.replace(e,t[e])}),i}function n(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function a(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function r(){try{return window.self!==window.top}catch(e){return!0}}Object.defineProperty(t,"__esModule",{value:!0}),t.getIEVersion=i,t.translate=o,t.getWindowWidth=n,t.getWindowHeight=a,t.isInIframe=r},function(e,t,i){t=e.exports=i(5)(),t.push([e.id,'@-webkit-keyframes closeWindow___2Hlon{0%{opacity:1}to{opacity:0}}@keyframes closeWindow___2Hlon{0%{opacity:1}to{opacity:0}}.outer___2lDXy{background-color:rgba(0,0,0,.85);top:0;left:0;right:0;bottom:0;z-index:1000;width:100%;height:100%}.outerClosing___1EQGK{opacity:0}.image___2FLq2,.inner___1rfRQ{position:absolute;top:0;left:0;right:0;bottom:0}.image___2FLq2{margin:auto;max-width:100%;max-height:100%}.imageNext___1uRqJ,.imagePrev___F6xVQ{@extends .image}.imageDiscourager___3-CUB{background-repeat:no-repeat;background-position:50%;background-size:contain}.navButtons___3kNVF{border:none;position:absolute;top:0;bottom:0;width:20px;height:34px;padding:40px 30px;margin:auto;cursor:pointer;opacity:.7}.navButtons___3kNVF:hover{opacity:1}.navButtons___3kNVF:active{opacity:.7}.navButtonPrev___2vBS8{left:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDE5LDMgLTIsLTIgLTE2LDE2IDE2LDE2IDEsLTEgLTE1LC0xNSAxNSwtMTUgeiIgZmlsbD0iI0ZGRiIvPjwvc3ZnPg==") no-repeat 50%}.navButtonNext___30R2i{right:0;background:rgba(0,0,0,.2) url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjM0Ij48cGF0aCBkPSJtIDEsMyAyLC0yIDE2LDE2IC0xNiwxNiAtMSwtMSAxNSwtMTUgLTE1LC0xNSB6IiBmaWxsPSIjRkZGIi8+PC9zdmc+") no-repeat 50%}.downloadBlocker___3rU9-{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");background-size:cover}.toolbar___1xYly{background-color:rgba(0,0,0,.5);position:absolute;left:0;top:0;right:0;height:50px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.toolbarSide___3FYWk{height:50px;margin:0}.toolbarSideNoFlex___KxqgW{height:auto;line-height:50px;max-width:48%;position:absolute;top:0;bottom:0}.toolbarLeftSide___8beAg{padding-left:20px;padding-right:0;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;overflow:hidden;text-overflow:ellipsis}.toolbarLeftSideNoFlex___3O3cZ{left:0;overflow:visible}.toolbarRightSide___1Sdfc{padding-left:0;padding-right:20px;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto}.toolbarRightSideNoFlex___oa0FT{right:0}.toolbarItem___3WbMb{display:inline-block;line-height:50px;padding:0;color:#fff;font-size:120%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.toolbarItemChild___2U_MP{vertical-align:middle}.builtinButton___1zqo6{width:40px;height:35px;cursor:pointer;border:none;opacity:.7}.builtinButton___1zqo6:hover{opacity:1}.builtinButton___1zqo6:active{outline:none}.builtinButtonDisabled___3uvqe{cursor:default;opacity:.5}.builtinButtonDisabled___3uvqe:hover{opacity:.5}.closeButton___3BdAF{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgd2lkdGg9IjIwIiBoZWlnaHQ9IjIwIj48cGF0aCBkPSJtIDEsMyAxLjI1LC0xLjI1IDcuNSw3LjUgNy41LC03LjUgMS4yNSwxLjI1IC03LjUsNy41IDcuNSw3LjUgLTEuMjUsMS4yNSAtNy41LC03LjUgLTcuNSw3LjUgLTEuMjUsLTEuMjUgNy41LC03LjUgLTcuNSwtNy41IHoiIGZpbGw9IiNGRkYiLz48L3N2Zz4=") no-repeat 50%}.zoomInButton___3xtuX{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PHBhdGggZD0iTTEyIDV2NiIvPjwvZz48Y2lyY2xlIGN4PSIxMiIgY3k9IjgiIHI9IjciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIyIi8+PC9zdmc+") no-repeat 50%}.zoomOutButton___38PZx{background:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCI+PGcgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PHBhdGggZD0iTTEgMTlsNi02Ii8+PHBhdGggZD0iTTkgOGg2Ii8+PC9nPjxjaXJjbGUgY3g9IjEyIiBjeT0iOCIgcj0iNyIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZmZmIiBzdHJva2Utd2lkdGg9IjIiLz48L3N2Zz4=") no-repeat 50%}.outerAnimating___2-fZi{-webkit-animation-name:closeWindow___2Hlon;animation-name:closeWindow___2Hlon}@-webkit-keyframes pointFade___2RA5J{0%,19.999%,to{opacity:0}20%{opacity:1}}@keyframes pointFade___2RA5J{0%,19.999%,to{opacity:0}20%{opacity:1}}.loadingCircle___3JNJg{width:60px;height:60px;position:relative}.loadingCirclePoint___3md-S{width:100%;height:100%;position:absolute;left:0;top:0}.loadingCirclePoint___3md-S:before{content:\'\';display:block;margin:0 auto;width:15%;height:15%;background-color:#fff;border-radius:30%;-webkit-animation:pointFade___2RA5J 1.2s infinite ease-in-out both;animation:pointFade___2RA5J 1.2s infinite ease-in-out both}.loadingCirclePoint___3md-S:nth-of-type(1){-webkit-transform:rotate(0deg);transform:rotate(0deg)}.loadingCirclePoint___3md-S:nth-of-type(1):before,.loadingCirclePoint___3md-S:nth-of-type(7):before{-webkit-animation-delay:-1.2s;animation-delay:-1.2s}.loadingCirclePoint___3md-S:nth-of-type(2){-webkit-transform:rotate(30deg);transform:rotate(30deg)}.loadingCirclePoint___3md-S:nth-of-type(8){-webkit-transform:rotate(210deg);transform:rotate(210deg)}.loadingCirclePoint___3md-S:nth-of-type(2):before,.loadingCirclePoint___3md-S:nth-of-type(8):before{-webkit-animation-delay:-1s;animation-delay:-1s}.loadingCirclePoint___3md-S:nth-of-type(3){-webkit-transform:rotate(60deg);transform:rotate(60deg)}.loadingCirclePoint___3md-S:nth-of-type(9){-webkit-transform:rotate(240deg);transform:rotate(240deg)}.loadingCirclePoint___3md-S:nth-of-type(3):before,.loadingCirclePoint___3md-S:nth-of-type(9):before{-webkit-animation-delay:-.8s;animation-delay:-.8s}.loadingCirclePoint___3md-S:nth-of-type(4){-webkit-transform:rotate(90deg);transform:rotate(90deg)}.loadingCirclePoint___3md-S:nth-of-type(10){-webkit-transform:rotate(270deg);transform:rotate(270deg)}.loadingCirclePoint___3md-S:nth-of-type(4):before,.loadingCirclePoint___3md-S:nth-of-type(10):before{-webkit-animation-delay:-.6s;animation-delay:-.6s}.loadingCirclePoint___3md-S:nth-of-type(5){-webkit-transform:rotate(120deg);transform:rotate(120deg)}.loadingCirclePoint___3md-S:nth-of-type(11){-webkit-transform:rotate(300deg);transform:rotate(300deg)}.loadingCirclePoint___3md-S:nth-of-type(5):before,.loadingCirclePoint___3md-S:nth-of-type(11):before{-webkit-animation-delay:-.4s;animation-delay:-.4s}.loadingCirclePoint___3md-S:nth-of-type(6){-webkit-transform:rotate(150deg);transform:rotate(150deg)}.loadingCirclePoint___3md-S:nth-of-type(12){-webkit-transform:rotate(330deg);transform:rotate(330deg)}.loadingCirclePoint___3md-S:nth-of-type(6):before,.loadingCirclePoint___3md-S:nth-of-type(12):before{-webkit-animation-delay:-.2s;animation-delay:-.2s}.loadingCirclePoint___3md-S:nth-of-type(7){-webkit-transform:rotate(180deg);transform:rotate(180deg)}.loadingCirclePoint___3md-S:nth-of-type(13){-webkit-transform:rotate(1turn);transform:rotate(1turn)}.loadingCirclePoint___3md-S:nth-of-type(7):before,.loadingCirclePoint___3md-S:nth-of-type(13):before{-webkit-animation-delay:0ms;animation-delay:0ms}.loadingContainer___2vaJ-{position:absolute;top:0;right:0;bottom:0;left:0}.loadingContainer__icon___1wQQz{color:#fff;position:absolute;top:50%;left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}',""]),t.locals={outer:"outer___2lDXy",outerClosing:"outerClosing___1EQGK",inner:"inner___1rfRQ",image:"image___2FLq2",imagePrev:"imagePrev___F6xVQ",imageNext:"imageNext___1uRqJ",imageDiscourager:"imageDiscourager___3-CUB",navButtons:"navButtons___3kNVF",navButtonPrev:"navButtonPrev___2vBS8",navButtonNext:"navButtonNext___30R2i",downloadBlocker:"downloadBlocker___3rU9-",toolbar:"toolbar___1xYly",toolbarSide:"toolbarSide___3FYWk",toolbarSideNoFlex:"toolbarSideNoFlex___KxqgW",toolbarLeftSide:"toolbarLeftSide___8beAg",toolbarLeftSideNoFlex:"toolbarLeftSideNoFlex___3O3cZ",toolbarRightSide:"toolbarRightSide___1Sdfc",toolbarRightSideNoFlex:"toolbarRightSideNoFlex___oa0FT",toolbarItem:"toolbarItem___3WbMb",toolbarItemChild:"toolbarItemChild___2U_MP",builtinButton:"builtinButton___1zqo6",builtinButtonDisabled:"builtinButtonDisabled___3uvqe",closeButton:"closeButton___3BdAF",zoomInButton:"zoomInButton___3xtuX",zoomOutButton:"zoomOutButton___38PZx",outerAnimating:"outerAnimating___2-fZi",closeWindow:"closeWindow___2Hlon",loadingCircle:"loadingCircle___3JNJg",loadingCirclePoint:"loadingCirclePoint___3md-S",pointFade:"pointFade___2RA5J",loadingContainer:"loadingContainer___2vaJ-",loadingContainer__icon:"loadingContainer__icon___1wQQz"}},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;t<this.length;t++){var i=this[t];i[2]?e.push("@media "+i[2]+"{"+i[1]+"}"):e.push(i[1])}return e.join("")},e.i=function(t,i){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},n=0;n<this.length;n++){var a=this[n][0];"number"==typeof a&&(o[a]=!0)}for(n=0;n<t.length;n++){var r=t[n];"number"==typeof r[0]&&o[r[0]]||(i&&!r[2]?r[2]=i:i&&(r[2]="("+r[2]+") and ("+i+")"),e.push(r))}},e}},function(e,t,i){function o(e,t){for(var i=0;i<e.length;i++){var o=e[i],n=m[o.id];if(n){n.refs++;for(var a=0;a<n.parts.length;a++)n.parts[a](o.parts[a]);for(;a<o.parts.length;a++)n.parts.push(u(o.parts[a],t))}else{for(var r=[],a=0;a<o.parts.length;a++)r.push(u(o.parts[a],t));m[o.id]={id:o.id,refs:1,parts:r}}}}function n(e){for(var t=[],i={},o=0;o<e.length;o++){var n=e[o],a=n[0],r=n[1],l=n[2],s=n[3],u={css:r,media:l,sourceMap:s};i[a]?i[a].parts.push(u):t.push(i[a]={id:a,parts:[u]})}return t}function a(e,t){var i=p(),o=b[b.length-1];if("top"===e.insertAt)o?o.nextSibling?i.insertBefore(t,o.nextSibling):i.appendChild(t):i.insertBefore(t,i.firstChild),b.push(t);else{if("bottom"!==e.insertAt)throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");i.appendChild(t)}}function r(e){e.parentNode.removeChild(e);var t=b.indexOf(e);t>=0&&b.splice(t,1)}function l(e){var t=document.createElement("style");return t.type="text/css",a(e,t),t}function s(e){var t=document.createElement("link");return t.rel="stylesheet",a(e,t),t}function u(e,t){var i,o,n;if(t.singleton){var a=v++;i=_||(_=l(t)),o=d.bind(null,i,a,!1), | ||
n=d.bind(null,i,a,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(i=s(t),o=h.bind(null,i),n=function(){r(i),i.href&&URL.revokeObjectURL(i.href)}):(i=l(t),o=c.bind(null,i),n=function(){r(i)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else n()}}function d(e,t,i,o){var n=i?"":o.css;if(e.styleSheet)e.styleSheet.cssText=y(t,n);else{var a=document.createTextNode(n),r=e.childNodes;r[t]&&e.removeChild(r[t]),r.length?e.insertBefore(a,r[t]):e.appendChild(a)}}function c(e,t){var i=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=i;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(i))}}function h(e,t){var i=t.css,o=t.sourceMap;o&&(i+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var n=new Blob([i],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(n),a&&URL.revokeObjectURL(a)}var m={},f=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},g=f(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),p=f(function(){return document.head||document.getElementsByTagName("head")[0]}),_=null,v=0,b=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=g()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var i=n(e);return o(i,t),function(e){for(var a=[],r=0;r<i.length;r++){var l=i[r],s=m[l.id];s.refs--,a.push(s)}if(e){var u=n(e);o(u,t)}for(var r=0;r<a.length;r++){var s=a[r];if(0===s.refs){for(var d=0;d<s.parts.length;d++)s.parts[d]();delete m[s.id]}}}};var y=function(){var e=[];return function(t,i){return e[t]=i,e.filter(Boolean).join("\n")}}()},function(e,t,i){var o=i(4);"string"==typeof o&&(o=[[e.id,o,""]]);i(6)(o,{});o.locals&&(e.exports=o.locals)},function(t,i){t.exports=e},function(e,i){e.exports=t}])}); | ||
//# sourceMappingURL=react-image-lightbox.js.map |
{ | ||
"name": "react-image-lightbox", | ||
"version": "3.0.3", | ||
"version": "3.1.0", | ||
"description": "A lightbox component for React.js", | ||
@@ -20,3 +20,3 @@ "scripts": { | ||
"files": [ | ||
"dist" | ||
"dist" | ||
], | ||
@@ -51,7 +51,7 @@ "repository": { | ||
"css-loader": "^0.23.1", | ||
"eslint": "^2.9.0", | ||
"eslint": "^3.2.2", | ||
"eslint-config-blue-hour": "0.x.x", | ||
"eslint-plugin-import": "^1.10.2", | ||
"eslint-plugin-jsx-a11y": "^1.5.5", | ||
"eslint-plugin-react": "^5.2.2", | ||
"eslint-plugin-jsx-a11y": "^2.0.1", | ||
"eslint-plugin-react": "^6.0.0", | ||
"file-loader": "^0.9.0", | ||
@@ -58,0 +58,0 @@ "gh-pages": "^0.11.0", |
@@ -101,4 +101,6 @@ # React Image Lightbox | ||
toolbarButtons | node[] | | | Array of custom toolbar buttons | ||
reactModalStyle | Object | `{}` | | Set z-index style, etc., for the parent react-modal (format: https://github.com/reactjs/react-modal#styles ) | ||
imagePadding | number | `10` | | Padding (px) between the edge of the window and the lightbox | ||
clickOutsideToClose | bool | `true` | | When true, clicks outside of the image close the lightbox | ||
enableZoom | bool | `true` | | Set to false to disable zoom functionality and hide zoom buttons | ||
@@ -105,0 +107,0 @@ ## Contributing |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
236565
132
129