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,EACT,IAAS,KAAK,MAAM,EAAc,EAAI,EAAS,GAC/C,KAAS,KAAK,MAAM,EAAa,EAAI,EAAQ,KAG9C,EAAO,MAAM,GAAY,OAAO,GAEhC,EAAE,MAAM,OAAO,SAAS,GAAQ,OAAO,KAExC,IACC,KAAK,MAAS,GACd,KAAK,QAAS,EAAG,MACnB,IAGA,KAAK,MAAQ,KAAK,KAAK,WAAW,GAAG,GAAG,YAAW,GAEnD,KAAK,KAAK,MAAM,KAAK,OAAS,EAAI,MAAM,OAAS,IAAI,IAAI,OAAQ,KAAK,MAA0B,GAApB,EAAE,QAAQ,SAAiB,EAAI,MAAQ,KAAK,MAAqB,GAAb,KAAK,QACtI,EAEA,WAAY,SAAU,EAAM,GAEvB,EAAI,MAAM,OAAS,EACtB,EAAI,QAAQ,QAAS,EAMtB,EAAI,OAA0B,QAAlB,EAAK,SAAqB,EAAI,IAAS,EAAW,OAAI,EACnE,EAEA,UAAW,SAAU,EAAM,GAEtB,KAAK,KACR,KAAK,SAAS,EAAM,GAGpB,KAAK,KAAK,EAAM,GAIjB,KAAK,KAAK,WAAW,YAAY,UAAU,GAAG,EAAI,OAAO,SAAS,SACnE,EAGA,SAAU,SAAU,EAAM,GACrB,KAAK,MACR,KAAK,KAAK,MAAK,GAAM,QAAQ,CAC5B,KAAQ,KAAK,MAA0B,GAApB,EAAE,QAAQ,SAAiB,EAAI,MAAQ,KAAK,MAAqB,GAAb,KAAK,SAC1E,IAEL,EAEA,YAAa,WACR,KAAK,MACR,KAAK,KAAK,SAGX,KAAK,KAAQ,KACb,KAAK,KAAQ,KACb,KAAK,MAAQ,CACd,EAGF,CApJC,CAoJC","file":"/npm/jquery.fancybox@2.1.5/source/helpers/jquery.fancybox-thumbs.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/jquery.fancybox@2.1.5/source/helpers/jquery.fancybox-thumbs.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n"," /*!\n * Thumbnail helper for fancyBox\n * version: 1.0.7 (Mon, 01 Oct 2012)\n * @requires fancyBox v2.0 or later\n *\n * Usage:\n *     $(\".fancybox\").fancybox({\n *         helpers : {\n *             thumbs: {\n *                 width  : 50,\n *                 height : 50\n *             }\n *         }\n *     });\n *\n */\n;(function ($) {\n\t//Shortcut for fancyBox object\n\tvar F = $.fancybox;\n\n\t//Add helper object\n\tF.helpers.thumbs = {\n\t\tdefaults : {\n\t\t\twidth    : 50,       // thumbnail width\n\t\t\theight   : 50,       // thumbnail height\n\t\t\tposition : 'bottom', // 'top' or 'bottom'\n\t\t\tsource   : function ( item ) {  // function to obtain the URL of the thumbnail image\n\t\t\t\tvar href;\n\n\t\t\t\tif (item.element) {\n\t\t\t\t\thref = $(item.element).find('img').attr('src');\n\t\t\t\t}\n\n\t\t\t\tif (!href && item.type === 'image' && item.href) {\n\t\t\t\t\thref = item.href;\n\t\t\t\t}\n\n\t\t\t\treturn href;\n\t\t\t}\n\t\t},\n\n\t\twrap  : null,\n\t\tlist  : null,\n\t\twidth : 0,\n\n\t\tinit: function (opts, obj) {\n\t\t\tvar that = this,\n\t\t\t\tlist,\n\t\t\t\tthumbWidth  = opts.width,\n\t\t\t\tthumbHeight = opts.height,\n\t\t\t\tthumbSource = opts.source;\n\n\t\t\t//Build list structure\n\t\t\tlist = '';\n\n\t\t\tfor (var n = 0; n < obj.group.length; n++) {\n\t\t\t\tlist += '<li><a style=\"width:' + thumbWidth + 'px;height:' + thumbHeight + 'px;\" href=\"javascript:jQuery.fancybox.jumpto(' + n + ');\"></a></li>';\n\t\t\t}\n\n\t\t\tthis.wrap = $('<div id=\"fancybox-thumbs\"></div>').addClass(opts.position).appendTo('body');\n\t\t\tthis.list = $('<ul>' + list + '</ul>').appendTo(this.wrap);\n\n\t\t\t//Load each thumbnail\n\t\t\t$.each(obj.group, function (i) {\n\t\t\t\tvar el   = obj.group[ i ],\n\t\t\t\t\thref = thumbSource( el );\n\n\t\t\t\tif (!href) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$(\"<img />\").on(\"load\", function () {\n\t\t\t\t\tvar width  = this.width,\n\t\t\t\t\t\theight = this.height,\n\t\t\t\t\t\twidthRatio, heightRatio, parent;\n\n\t\t\t\t\tif (!that.list || !width || !height) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Calculate thumbnail width/height and center it\n\t\t\t\t\twidthRatio  = width / thumbWidth;\n\t\t\t\t\theightRatio = height / thumbHeight;\n\n\t\t\t\t\tparent = that.list.children().eq(i).find('a');\n\n\t\t\t\t\tif (widthRatio >= 1 && heightRatio >= 1) {\n\t\t\t\t\t\tif (widthRatio > heightRatio) {\n\t\t\t\t\t\t\twidth  = Math.floor(width / heightRatio);\n\t\t\t\t\t\t\theight = thumbHeight;\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twidth  = thumbWidth;\n\t\t\t\t\t\t\theight = Math.floor(height / widthRatio);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$(this).css({\n\t\t\t\t\t\twidth  : width,\n\t\t\t\t\t\theight : height,\n\t\t\t\t\t\ttop    : Math.floor(thumbHeight / 2 - height / 2),\n\t\t\t\t\t\tleft   : Math.floor(thumbWidth / 2 - width / 2)\n\t\t\t\t\t});\n\n\t\t\t\t\tparent.width(thumbWidth).height(thumbHeight);\n\n\t\t\t\t\t$(this).hide().appendTo(parent).fadeIn(300);\n\n\t\t\t\t})\n\t\t\t\t.attr('src',   href)\n\t\t\t\t.attr('title', el.title);\n\t\t\t});\n\n\t\t\t//Set initial width\n\t\t\tthis.width = this.list.children().eq(0).outerWidth(true);\n\n\t\t\tthis.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5)));\n\t\t},\n\n\t\tbeforeLoad: function (opts, obj) {\n\t\t\t//Remove self if gallery do not have at least two items\n\t\t\tif (obj.group.length < 2) {\n\t\t\t\tobj.helpers.thumbs = false;\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Increase bottom margin to give space for thumbs\n\t\t\tobj.margin[ opts.position === 'top' ? 0 : 2 ] += ((opts.height) + 15);\n\t\t},\n\n\t\tafterShow: function (opts, obj) {\n\t\t\t//Check if exists and create or update list\n\t\t\tif (this.list) {\n\t\t\t\tthis.onUpdate(opts, obj);\n\n\t\t\t} else {\n\t\t\t\tthis.init(opts, obj);\n\t\t\t}\n\n\t\t\t//Set active element\n\t\t\tthis.list.children().removeClass('active').eq(obj.index).addClass('active');\n\t\t},\n\n\t\t//Center list\n\t\tonUpdate: function (opts, obj) {\n\t\t\tif (this.list) {\n\t\t\t\tthis.list.stop(true).animate({\n\t\t\t\t\t'left': Math.floor($(window).width() * 0.5 - (obj.index * this.width + this.width * 0.5))\n\t\t\t\t}, 150);\n\t\t\t}\n\t\t},\n\n\t\tbeforeClose: function () {\n\t\t\tif (this.wrap) {\n\t\t\t\tthis.wrap.remove();\n\t\t\t}\n\n\t\t\tthis.wrap  = null;\n\t\t\tthis.list  = null;\n\t\t\tthis.width = 0;\n\t\t}\n\t}\n\n}(jQuery));\n"]}