1/*! PhotoSwipe - v4.1.0 - 2015-07-11 2 * http://photoswipe.com 3 * Copyright (c) 2015 Dmitry Semenov; */ 4! function (a, b) { 5 "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b() : a.PhotoSwipe = b() 6}(this, function () { 7 "use strict"; 8 var a = function (a, b, c, d) { 9 var e = { 10 features: null, 11 bind: function (a, b, c, d) { 12 var e = (d ? "remove" : "add") + "EventListener"; 13 b = b.split(" "); 14 for (var f = 0; f < b.length; f++) b[f] && a[e](b[f], c, !1) 15 }, 16 isArray: function (a) { 17 return a instanceof Array 18 }, 19 createEl: function (a, b) { 20 var c = document.createElement(b || "div"); 21 return a && (c.className = a), c 22 }, 23 getScrollY: function () { 24 var a = window.pageYOffset; 25 return void 0 !== a ? a : document.documentElement.scrollTop 26 }, 27 unbind: function (a, b, c) { 28 e.bind(a, b, c, !0) 29 }, 30 removeClass: function (a, b) { 31 var c = new RegExp("(\\s|^)" + b + "(\\s|$)"); 32 a.className = a.className.replace(c, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "") 33 }, 34 addClass: function (a, b) { 35 e.hasClass(a, b) || (a.className += (a.className ? " " : "") + b) 36 }, 37 hasClass: function (a, b) { 38 return a.className && new RegExp("(^|\\s)" + b + "(\\s|$)").test(a.className) 39 }, 40 getChildByClass: function (a, b) { 41 for (var c = a.firstChild; c;) { 42 if (e.hasClass(c, b)) return c; 43 c = c.nextSibling 44 } 45 }, 46 arraySearch: function (a, b, c) { 47 for (var d = a.length; d--;) 48 if (a[d][c] === b) return d; 49 return -1 50 }, 51 extend: function (a, b, c) { 52 for (var d in b) 53 if (b.hasOwnProperty(d)) { 54 if (c && a.hasOwnProperty(d)) continue; 55 a[d] = b[d] 56 } 57 }, 58 easing: { 59 sine: { 60 out: function (a) { 61 return Math.sin(a * (Math.PI / 2)) 62 }, 63 inOut: function (a) { 64 return -(Math.cos(Math.PI * a) - 1) / 2 65 } 66 }, 67 cubic: { 68 out: function (a) { 69 return --a * a * a + 1 70 } 71 } 72 }, 73 detectFeatures: function () { 74 if (e.features) return e.features; 75 var a = e.createEl(), 76 b = a.style, 77 c = "", 78 d = {}; 79 if (d.oldIE = document.all && !document.addEventListener, d.touch = "ontouchstart" in window, window.requestAnimationFrame && (d.raf = window.requestAnimationFrame, d.caf = window.cancelAnimationFrame), d.pointerEvent = navigator.pointerEnabled || navigator.msPointerEnabled, !d.pointerEvent) { 80 var f = navigator.userAgent; 81 if (/iP(hone|od)/.test(navigator.platform)) { 82 var g = navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/); 83 g && g.length > 0 && (g = parseInt(g[1], 10), g >= 1 && 8 > g && (d.isOldIOSPhone = !0)) 84 } 85 var h = f.match(/Android\s([0-9\.]*)/), 86 i = h ? h[1] : 0; 87 i = parseFloat(i), i >= 1 && (4.4 > i && (d.isOldAndroid = !0), d.androidVersion = i), d.isMobileOpera = /opera mini|o
87pera mobi/i.test(f) 88 } 89 for (var j, k, l = ["transform", "perspective", "animationName"], m = ["", "webkit", "Moz", "ms", "O"], n = 0; 4 > n; n++) { 90 c = m[n]; 91 for (var o = 0; 3 > o; o++) j = l[o], k = c + (c ? j.charAt(0).toUpperCase() + j.slice(1) : j), !d[j] && k in b && (d[j] = k); 92 c && !d.raf && (c = c.toLowerCase(), d.raf = window[c + "RequestAnimationFrame"], d.raf && (d.caf = window[c + "CancelAnimationFrame"] || window[c + "CancelRequestAnimationFrame"])) 93 } 94 if (!d.raf) { 95 var p = 0; 96 d.raf = function (a) { 97 var b = (new Date).getTime(), 98 c = Math.max(0, 16 - (b - p)), 99 d = window.setTimeout(function () { 100 a(b + c) 101 }, c); 102 return p = b + c, d 103 }, d.caf = function (a) { 104 clearTimeout(a) 105 } 106 } 107 return d.svg = !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect, e.features = d, d 108 } 109 }; 110 e.detectFeatures(), e.features.oldIE && (e.bind = function (a, b, c, d) { 111 b = b.split(" "); 112 for (var e, f = (d ? "detach" : "attach") + "Event", g = function () { 113 c.handleEvent.call(c) 114 }, h = 0; h < b.length; h++) 115 if (e = b[h]) 116 if ("object" == typeof c && c.handleEvent) { 117 if (d) { 118 if (!c["oldIE" + e]) return !1 119 } else c["oldIE" + e] = g; 120 a[f]("on" + e, c["oldIE" + e]) 121 } else a[f]("on" + e, c) 122 }); 123 var f = this, 124 g = 25, 125 h = 3, 126 i = { 127 allowPanToNext: !0, 128 spacing: .12, 129 bgOpacity: 1, 130 mouseUsed: !1, 131 loop: !0, 132 pinchToClose: !0, 133 closeOnScroll: !0, 134 closeOnVerticalDrag: !0, 135 verticalDragRange: .75, 136 hideAnimationDuration: 333, 137 showAnimationDuration: 333, 138 showHideOpacity: !1, 139 focus: !0, 140 escKey: !0, 141 arrowKeys: !0, 142 mainScrollEndFriction: .35, 143 panEndFriction: .35, 144 isClickableElement: function (a) { 145 return "A" === a.tagName 146 }, 147 getDoubleTapZoom: function (a, b) { 148 return a ? 1 : b.initialZoomLevel < .7 ? 1 : 1.33 149 }, 150 maxSpreadZoom: 1.33, 151 modal: !0, 152 scaleMode: "fit", 153 alwaysFadeIn: !1 154 }; 155 e.extend(i, d); 156 var j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, $, _, aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la = function () { 157 return { 158 x: 0, 159 y: 0 160 } 161 }, 162 ma = la(), 163 na = la(), 164 oa = la(), 165 pa = {}, 166 qa = 0, 167 ra = {}, 168 sa = la(), 169 ta = 0, 170 ua = !0, 171 va = [], 172 wa = {}, 173 xa = !1, 174 ya = function (a, b) { 175 e.extend(f, b.publicMethods), va.push(a) 176 }, 177 za = function (a) { 178 var b = _b(); 179 return a > b - 1 ? a - b : 0 > a ? b + a : a 180 }, 181 Aa = {}, 182 Ba = function (a, b) { 183 return Aa[a] || (Aa[a] = []), Aa[a].push(b) 184 }, 185 Ca = function (a) { 186 var b = Aa[a]; 187 if (b) { 188 var c = Array.prototype.slice.call(arguments); 189 c.shift(); 190 for (var d = 0; d < b.length; d++) b[d].apply(f, c) 191 } 192 }, 193 Da = function () { 194 return (new Date).getTime() 195 }, 196 Ea = function (a) { 197 ia = a, f.bg.style.opacity = a * i.bgOpacity 198 }, 199 Fa = function (a, b, c, d, e) { 200 (!xa || e && e !== f.currItem) && (d /= e ? e.fitRatio : f.currItem.fitRatio), a[E] = u + b + "px, " + c + "px" + v + " scale(" + d + ")" 201 }, 202 Ga = function (a) { 203 da && (a && (s > f.currItem.fitRatio ? xa || (lc(f.currItem, !1, !0), xa = !0) : xa && (lc(f.currItem), xa = !1)), Fa(da, oa.x, oa.y, s)) 204 }, 205 Ha = function (a) { 206 a.container && Fa(a.container.style, a.initialPosition.x, a.initialPosition.y, a.initialZoomLevel, a) 207 }, 208 Ia = function (a, b) { 209 b[E] = u + a + "px, 0px" + v 210 }, 211 Ja = function (a, b) { 212 if (!i.loop && b) { 213 var c = m + (sa.x * qa - a) / sa.x, 214 d = Math.round(a - sb.x); 215 (0 > c && d > 0 || c >
215= _b() - 1 && 0 > d) && (a = sb.x + d * i.mainScrollEndFriction) 216 } 217 sb.x = a, Ia(a, n) 218 }, 219 Ka = function (a, b) { 220 var c = tb[a] - ra[a]; 221 return na[a] + ma[a] + c - c * (b / t) 222 }, 223 La = function (a, b) { 224 a.x = b.x, a.y = b.y, b.id && (a.id = b.id) 225 }, 226 Ma = function (a) { 227 a.x = Math.round(a.x), a.y = Math.round(a.y) 228 }, 229 Na = null, 230 Oa = function () { 231 Na && (e.unbind(document, "mousemove", Oa), e.addClass(a, "pswp--has_mouse"), i.mouseUsed = !0, Ca("mouseUsed")), Na = setTimeout(function () { 232 Na = null 233 }, 100) 234 }, 235 Pa = function () { 236 e.bind(document, "keydown", f), N.transform && e.bind(f.scrollWrap, "click", f), i.mouseUsed || e.bind(document, "mousemove", Oa), e.bind(window, "resize scroll", f), Ca("bindEvents") 237 }, 238 Qa = function () { 239 e.unbind(window, "resize", f), e.unbind(window, "scroll", r.scroll), e.unbind(document, "keydown", f), e.unbind(document, "mousemove", Oa), N.transform && e.unbind(f.scrollWrap, "click", f), U && e.unbind(window, p, f), Ca("unbindEvents") 240 }, 241 Ra = function (a, b) { 242 var c = hc(f.currItem, pa, a); 243 return b && (ca = c), c 244 }, 245 Sa = function (a) { 246 return a || (a = f.currItem), a.initialZoomLevel 247 }, 248 Ta = function (a) { 249 return a || (a = f.currItem), a.w > 0 ? i.maxSpreadZoom : 1 250 }, 251 Ua = function (a, b, c, d) { 252 return d === f.currItem.initialZoomLevel ? (c[a] = f.currItem.initialPosition[a], !0) : (c[a] = Ka(a, d), c[a] > b.min[a] ? (c[a] = b.min[a], !0) : c[a] < b.max[a] ? (c[a] = b.max[a], !0) : !1) 253 }, 254 Va = function () { 255 if (E) { 256 var b = N.perspective && !G; 257 return u = "translate" + (b ? "3d(" : "("), void(v = N.perspective ? ", 0px)" : ")") 258 } 259 E = "left", e.addClass(a, "pswp--ie"), Ia = function (a, b) { 260 b.left = a + "px" 261 }, Ha = function (a) { 262 var b = a.fitRatio > 1 ? 1 : a.fitRatio, 263 c = a.container.style, 264 d = b * a.w, 265 e = b * a.h; 266 c.width = d + "px", c.height = e + "px", c.left = a.initialPosition.x + "px", c.top = a.initialPosition.y + "px" 267 }, Ga = function () { 268 if (da) { 269 var a = da, 270 b = f.currItem, 271 c = b.fitRatio > 1 ? 1 : b.fitRatio, 272 d = c * b.w, 273 e = c * b.h; 274 a.width = d + "px", a.height = e + "px", a.left = oa.x + "px", a.top = oa.y + "px" 275 } 276 } 277 }, 278 Wa = function (a) { 279 var b = ""; 280 i.escKey && 27 === a.keyCode ? b = "close" : i.arrowKeys && (37 === a.keyCode ? b = "prev" : 39 === a.keyCode && (b = "next")), b && (a.ctrlKey || a.altKey || a.shiftKey || a.metaKey || (a.preventDefault ? a.preventDefault() : a.returnValue = !1, f[b]())) 281 }, 282 Xa = function (a) { 283 a && (X || W || ea || S) && (a.preventDefault(), a.stopPropagation()) 284 }, 285 Ya = function () { 286 f.setScrollOffset(0, e.getScrollY()) 287 }, 288 Za = {}, 289 $a = 0, 290 _a = function (a) { 291 Za[a] && (Za[a].raf && I(Za[a].raf), $a--, delete Za[a]) 292 }, 293 ab = function (a) { 294 Za[a] && _a(a), Za[a] || ($a++, Za[a] = {}) 295 }, 296 bb = function () { 297 for (var a in Za) Za.hasOwnProperty(a) && _a(a) 298 }, 299 cb = function (a, b, c, d, e, f, g) { 300 var h, i = Da(); 301 ab(a); 302 var j = function () { 303 if (Za[a]) { 304 if (h = Da() - i, h >= d) return _a(a), f(c), void(g && g()); 305 f((c - b) * e(h / d) + b), Za[a].raf = H(j) 306 } 307 }; 308 j() 309 }, 310 db = { 311 shout: Ca, 312 listen: Ba, 313 viewportSize: pa, 314 options: i, 315 isMainScrollAnimating: function () { 316 return ea 317 }, 318 getZoomLevel: function () { 319 return s 320 }, 321 getCurrentIndex: function () { 322 return m 323 }, 324 isDragging: function () { 325 return U 326 }, 327 isZooming: function () { 328 return _ 329 }, 330 setScrollOffset: function (a, b) {
331 ra.x = a, M = ra.y = b, Ca("updateScrollOffset", ra) 332 }, 333 applyZoomPan: function (a, b, c, d) { 334 oa.x = b, oa.y = c, s = a, Ga(d) 335 }, 336 init: function () { 337 if (!j && !k) { 338 var c; 339 f.framework = e, f.template = a, f.bg = e.getChildByClass(a, "pswp__bg"), J = a.className, j = !0, N = e.detectFeatures(), H = N.raf, I = N.caf, E = N.transform, L = N.oldIE, f.scrollWrap = e.getChildByClass(a, "pswp__scroll-wrap"), f.container = e.getChildByClass(f.scrollWrap, "pswp__container"), n = f.container.style, f.itemHolders = y = [{ 340 el: f.container.children[0], 341 wrap: 0, 342 index: -1 343 }, { 344 el: f.container.children[1], 345 wrap: 0, 346 index: -1 347 }, { 348 el: f.container.children[2], 349 wrap: 0, 350 index: -1 351 }], y[0].el.style.display = y[2].el.style.display = "none", Va(), r = { 352 resize: f.updateSize, 353 scroll: Ya, 354 keydown: Wa, 355 click: Xa 356 }; 357 var d = N.isOldIOSPhone || N.isOldAndroid || N.isMobileOpera; 358 for (N.animationName && N.transform && !d || (i.showAnimationDuration = i.hideAnimationDuration = 0), c = 0; c < va.length; c++) f["init" + va[c]](); 359 if (b) { 360 var g = f.ui = new b(f, e); 361 g.init() 362 } 363 Ca("firstUpdate"), m = m || i.index || 0, (isNaN(m) || 0 > m || m >= _b()) && (m = 0), f.currItem = $b(m), (N.isOldIOSPhone || N.isOldAndroid) && (ua = !1), a.setAttribute("aria-hidden", "false"), i.modal && (ua ? a.style.position = "fixed" : (a.style.position = "absolute", a.style.top = e.getScrollY() + "px")), void 0 === M && (Ca("initialLayout"), M = K = e.getScrollY()); 364 var l = "pswp--open "; 365 for (i.mainClass && (l += i.mainClass + " "), i.showHideOpacity && (l += "pswp--animate_opacity "), l += G ? "pswp--touch" : "pswp--notouch", l += N.animationName ? " pswp--css_animation" : "", l += N.svg ? " pswp--svg" : "", e.addClass(a, l), f.updateSize(), o = -1, ta = null, c = 0; h > c; c++) Ia((c + o) * sa.x, y[c].el.style); 366 L || e.bind(f.scrollWrap, q, f), Ba("initialZoomInEnd", function () { 367 f.setContent(y[0], m - 1), f.setContent(y[2], m + 1), y[0].el.style.display = y[2].el.style.display = "block", i.focus && a.focus(), Pa() 368 }), f.setContent(y[1], m), f.updateCurrItem(), Ca("afterInit"), ua || (w = setInterval(function () { 369 $a || U || _ || s !== f.currItem.initialZoomLevel || f.updateSize() 370 }, 1e3)), e.addClass(a, "pswp--visible") 371 } 372 }, 373 close: function () { 374 j && (j = !1, k = !0, Ca("close"), Qa(), bc(f.currItem, null, !0, f.destroy)) 375 }, 376 destroy: function () { 377 Ca("destroy"), Wb && clearTimeout(Wb), a.setAttribute("aria-hidden", "true"), a.className = J, w && clearInterval(w), e.unbind(f.scrollWrap, q, f), e.unbind(window, "scroll", f), yb(), bb(), Aa = null 378 }, 379 panTo: function (a, b, c) { 380 c || (a > ca.min.x ? a = ca.min.x : a < ca.max.x && (a = ca.max.x), b > ca.min.y ? b = ca.min.y : b < ca.max.y && (b = ca.max.y)), oa.x = a, oa.y = b, Ga() 381 }, 382 handleEvent: function (a) { 383 a = a || window.event, r[a.type] && r[a.type](a) 384 }, 385 goTo: function (a) { 386 a = za(a); 387 var b = a - m; 388 ta = b, m = a, f.currItem = $b(m), qa -= b, Ja(sa.x * qa), bb(), ea = !1, f.updateCurrItem() 389 }, 390 next: function () { 391 f.goTo(m + 1) 392 }, 393 prev: function () { 394 f.goTo(m - 1) 395 }, 396 updateCurrZoomItem: function (a) { 397 if (a && Ca("beforeChange", 0), y[1].el.children.length) { 398 var b = y[1].el.children[0]; 399 da = e.hasClass(b, "pswp__zoom-wrap") ? b.style : null 400 } else da = null; 401 ca = f.currItem.bounds, t = s = f.currItem.initialZoomLevel, oa.x = ca.center.x, oa.y = ca.center.y, a && Ca("afterChange") 402 }, 403 invalidateCurrItems: function () { 404 x = !0; 405 for (var a = 0; h > a; a++) y[a].item && (y[a].item.needsUpdate = !0) 406 }, 407 updateCurrItem: function (a) { 408 if (0 !== ta) { 409 var b, c = Math.abs(ta); 410 if (!(a && 2 > c)) { 411 f.currItem = $b(m), xa = !1, Ca("beforeChange", ta), c >
vendor: 5,330 bytes, lines 411-515
411= h && (o += ta + (ta > 0 ? -h : h), c = h); 412 for (var d = 0; c > d; d++) ta > 0 ? (b = y.shift(), y[h - 1] = b, o++, Ia((o + 2) * sa.x, b.el.style), f.setContent(b, m - c + d + 1 + 1)) : (b = y.pop(), y.unshift(b), o--, Ia(o * sa.x, b.el.style), f.setContent(b, m + c - d - 1 - 1)); 413 if (da && 1 === Math.abs(ta)) { 414 var e = $b(z); 415 e.initialZoomLevel !== s && (hc(e, pa), lc(e), Ha(e)) 416 } 417 ta = 0, f.updateCurrZoomItem(), z = m, Ca("afterChange") 418 } 419 } 420 }, 421 updateSize: function (b) { 422 if (!ua && i.modal) { 423 var c = e.getScrollY(); 424 if (M !== c && (a.style.top = c + "px", M = c), !b && wa.x === window.innerWidth && wa.y === window.innerHeight) return; 425 wa.x = window.innerWidth, wa.y = window.innerHeight, a.style.height = wa.y + "px" 426 } 427 if (pa.x = f.scrollWrap.clientWidth, pa.y = f.scrollWrap.clientHeight, Ya(), sa.x = pa.x + Math.round(pa.x * i.spacing), sa.y = pa.y, Ja(sa.x * qa), Ca("beforeResize"), void 0 !== o) { 428 for (var d, g, j, k = 0; h > k; k++) d = y[k], Ia((k + o) * sa.x, d.el.style), j = m + k - 1, i.loop && _b() > 2 && (j = za(j)), g = $b(j), g && (x || g.needsUpdate || !g.bounds) ? (f.cleanSlide(g), f.setContent(d, j), 1 === k && (f.currItem = g, f.updateCurrZoomItem(!0)), g.needsUpdate = !1) : -1 === d.index && j >= 0 && f.setContent(d, j), g && g.container && (hc(g, pa), lc(g), Ha(g)); 429 x = !1 430 } 431 t = s = f.currItem.initialZoomLevel, ca = f.currItem.bounds, ca && (oa.x = ca.center.x, oa.y = ca.center.y, Ga(!0)), Ca("resize") 432 }, 433 zoomTo: function (a, b, c, d, f) { 434 b && (t = s, tb.x = Math.abs(b.x) - oa.x, tb.y = Math.abs(b.y) - oa.y, La(na, oa)); 435 var g = Ra(a, !1), 436 h = {}; 437 Ua("x", g, h, a), Ua("y", g, h, a); 438 var i = s, 439 j = { 440 x: oa.x, 441 y: oa.y 442 }; 443 Ma(h); 444 var k = function (b) { 445 1 === b ? (s = a, oa.x = h.x, oa.y = h.y) : (s = (a - i) * b + i, oa.x = (h.x - j.x) * b + j.x, oa.y = (h.y - j.y) * b + j.y), f && f(b), Ga(1 === b) 446 }; 447 c ? cb("customZoomTo", 0, 1, c, d || e.easing.sine.inOut, k) : k(1) 448 } 449 }, 450 eb = 30, 451 fb = 10, 452 gb = {}, 453 hb = {}, 454 ib = {}, 455 jb = {}, 456 kb = {}, 457 lb = [], 458 mb = {}, 459 nb = [], 460 ob = {}, 461 pb = 0, 462 qb = la(), 463 rb = 0, 464 sb = la(), 465 tb = la(), 466 ub = la(), 467 vb = function (a, b) { 468 return a.x === b.x && a.y === b.y 469 }, 470 wb = function (a, b) { 471 return Math.abs(a.x - b.x) < g && Math.abs(a.y - b.y) < g 472 }, 473 xb = function (a, b) { 474 return ob.x = Math.abs(a.x - b.x), ob.y = Math.abs(a.y - b.y), Math.sqrt(ob.x * ob.x + ob.y * ob.y) 475 }, 476 yb = function () { 477 Y && (I(Y), Y = null) 478 }, 479 zb = function () { 480 U && (Y = H(zb), Pb()) 481 }, 482 Ab = function () { 483 return !("fit" === i.scaleMode && s === f.currItem.initialZoomLevel) 484 }, 485 Bb = function (a, b) { 486 return a ? a.className && a.className.indexOf("pswp__scroll-wrap") > -1 ? !1 : b(a) ? a : Bb(a.parentNode, b) : !1 487 }, 488 Cb = {}, 489 Db = function (a, b) { 490 return Cb.prevent = !Bb(a.target, i.isClickableElement), Ca("preventDragEvent", a, b, Cb), Cb.prevent 491 }, 492 Eb = function (a, b) { 493 return b.x = a.pageX, b.y = a.pageY, b.id = a.identifier, b 494 }, 495 Fb = function (a, b, c) { 496 c.x = .5 * (a.x + b.x), c.y = .5 * (a.y + b.y) 497 }, 498 Gb = function (a, b, c) { 499 if (a - P > 50) { 500 var d = nb.length > 2 ? nb.shift() : {}; 501 d.x = b, d.y = c, nb.push(d), P = a 502 } 503 }, 504 Hb = function () { 505 var a = oa.y - f.currItem.initialPosition.y; 506 return 1 - Math.abs(a / (pa.y / 2)) 507 }, 508 Ib = {}, 509 Jb = {}, 510 Kb = [], 511 Lb = function (a) { 512 for (; Kb.length > 0;) Kb.pop(); 513 return F ? (ka = 0, lb.forEach(function (a) { 514 0 === ka ? Kb[0] = a : 1 === ka && (Kb[1] = a), ka++ 515 })) : a.type.indexOf("touch") > -1 ? a.touches && a.touches.length > 0 && (Kb[0] = Eb(a.touches[0], Ib), a.touches.length > 1 && (Kb[1] = Eb(a.touches[1], Jb))) : (Ib.x = a.pageX, Ib.y = a.pageY, Ib.id = "", Kb[0] = Ib), Kb
516 }, 517 Mb = function (a, b) { 518 var c, d, e, g, h = 0, 519 j = oa[a] + b[a], 520 k = b[a] > 0, 521 l = sb.x + b.x, 522 m = sb.x - mb.x; 523 return c = j > ca.min[a] || j < ca.max[a] ? i.panEndFriction : 1, j = oa[a] + b[a] * c, !i.allowPanToNext && s !== f.currItem.initialZoomLevel || (da ? "h" !== fa || "x" !== a || W || (k ? (j > ca.min[a] && (c = i.panEndFriction, h = ca.min[a] - j, d = ca.min[a] - na[a]), (0 >= d || 0 > m) && _b() > 1 ? (g = l, 0 > m && l > mb.x && (g = mb.x)) : ca.min.x !== ca.max.x && (e = j)) : (j < ca.max[a] && (c = i.panEndFriction, h = j - ca.max[a], d = na[a] - ca.max[a]), (0 >= d || m > 0) && _b() > 1 ? (g = l, m > 0 && l < mb.x && (g = mb.x)) : ca.min.x !== ca.max.x && (e = j))) : g = l, "x" !== a) ? void(ea || Z || s > f.currItem.fitRatio && (oa[a] += b[a] * c)) : (void 0 !== g && (Ja(g, !0), Z = g === mb.x ? !1 : !0), ca.min.x !== ca.max.x && (void 0 !== e ? oa.x = e : Z || (oa.x += b.x * c)), void 0 !== g) 524 }, 525 Nb = function (a) { 526 if (!("mousedown" === a.type && a.button > 0)) { 527 if (Zb) return void a.preventDefault(); 528 if (!T || "mousedown" !== a.type) { 529 if (Db(a, !0) && a.preventDefault(), Ca("pointerDown"), F) { 530 var b = e.arraySearch(lb, a.pointerId, "id"); 531 0 > b && (b = lb.length), lb[b] = { 532 x: a.pageX, 533 y: a.pageY, 534 id: a.pointerId 535 } 536 } 537 var c = Lb(a), 538 d = c.length; 539 $ = null, bb(), U && 1 !== d || (U = ga = !0, e.bind(window, p, f), R = ja = ha = S = Z = X = V = W = !1, fa = null, Ca("firstTouchStart", c), La(na, oa), ma.x = ma.y = 0, La(jb, c[0]), La(kb, jb), mb.x = sa.x * qa, nb = [{ 540 x: jb.x, 541 y: jb.y 542 }], P = O = Da(), Ra(s, !0), yb(), zb()), !_ && d > 1 && !ea && !Z && (t = s, W = !1, _ = V = !0, ma.y = ma.x = 0, La(na, oa), La(gb, c[0]), La(hb, c[1]), Fb(gb, hb, ub), tb.x = Math.abs(ub.x) - oa.x, tb.y = Math.abs(ub.y) - oa.y, aa = ba = xb(gb, hb)) 543 } 544 } 545 }, 546 Ob = function (a) { 547 if (a.preventDefault(), F) { 548 var b = e.arraySearch(lb, a.pointerId, "id"); 549 if (b > -1) { 550 var c = lb[b]; 551 c.x = a.pageX, c.y = a.pageY 552 } 553 } 554 if (U) { 555 var d = Lb(a); 556 if (fa || X || _) $ = d; 557 else if (sb.x !== sa.x * qa) fa = "h"; 558 else { 559 var f = Math.abs(d[0].x - jb.x) - Math.abs(d[0].y - jb.y); 560 Math.abs(f) >= fb && (fa = f > 0 ? "h" : "v", $ = d) 561 } 562 } 563 }, 564 Pb = function () { 565 if ($) { 566 var a = $.length; 567 if (0 !== a) 568 if (La(gb, $[0]), ib.x = gb.x - jb.x, ib.y = gb.y - jb.y, _ && a > 1) { 569 if (jb.x = gb.x, jb.y = gb.y, !ib.x && !ib.y && vb($[1], hb)) return; 570 La(hb, $[1]), W || (W = !0, Ca("zoomGestureStarted")); 571 var b = xb(gb, hb), 572 c = Ub(b); 573 c > f.currItem.initialZoomLevel + f.currItem.initialZoomLevel / 15 && (ja = !0); 574 var d = 1, 575 e = Sa(), 576 g = Ta(); 577 if (e > c) 578 if (i.pinchToClose && !ja && t <= f.currItem.initialZoomLevel) { 579 var h = e - c, 580 j = 1 - h / (e / 1.2); 581 Ea(j), Ca("onPinchClose", j), ha = !0 582 } else d = (e - c) / e, d > 1 && (d = 1), c = e - d * (e / 3); 583 else c > g && (d = (c - g) / (6 * e), d > 1 && (d = 1), c = g + d * e); 584 0 > d && (d = 0), aa = b, Fb(gb, hb, qb), ma.x += qb.x - ub.x, ma.y += qb.y - ub.y, La(ub, qb), oa.x = Ka("x", c), oa.y = Ka("y", c), R = c > s, s = c, Ga() 585 } else { 586 if (!fa) return; 587 if (ga && (ga = !1, Math.abs(ib.x) >= fb && (ib.x -= $[0].x - kb.x), Math.abs(ib.y) >= fb && (ib.y -= $[0].y - kb.y)), jb.x = gb.x, jb.y = gb.y, 0 === ib.x && 0 === ib.y) return; 588 if ("v" === fa && i.closeOnVerticalDrag && !Ab()) { 589 ma.y += ib.y, oa.y += ib.y; 590 var k = Hb(); 591 return S = !0, Ca("onVerticalDrag", k), Ea(k), void Ga() 592 } 593 Gb(Da(), gb.x, gb.y), X = !0, ca = f.currItem.bounds; 594 var l = Mb("x", ib); 595 l || (Mb("y", ib), Ma(oa), Ga()) 596 } 597 } 598 }, 599 Qb = function (a) { 600 if (N.isOldAndroid) { 601 if (T && "mouseup" === a.type) return; 602 a.type.indexOf("touch") > -1 && (clearTimeout(T), T = setTimeout(function () { 603 T = 0 604 }, 600)) 605 } 606 Ca("pointerUp"), Db(a, !1) && a.preventDefault(); 607 var b; 608 if (F) { 609 var c = e.arraySearch(lb, a.pointerId, "id"); 610 if (c > -1) 611 if (b = lb.splice(c, 1)[0], navigator.pointerEnabled) b.type = a.pointerType || "mouse"; 612 else { 613 var d = { 614 4: "mouse", 615 2: "touch", 616 3: "pen" 617 }; 618 b.type = d[a.pointerType], b.type || (b.type = a.pointerType || "mouse") 619 } 620 } 621 var g, h = Lb(a), 622 j = h.length; 623 if ("mouseup" === a.type && (j = 0), 2 === j) return $ = null, !0; 624 1 === j && La(kb, h[0]), 0 !== j || fa || ea || (b || ("mouseup" === a.type ? b = { 625 x: a.pageX, 626 y: a.pageY, 627 type: "mouse" 628 } : a.changedTouches && a.changedTouches[0] && (b = { 629 x: a.changedTouches[0].pageX, 630 y: a.changedTouches[0].pageY, 631 type: "touch" 632 })), Ca("touchRelease", a, b)); 633 var k = -1; 634 if (0 === j && (U = !1, e.unbind(window, p, f), yb(), _ ? k = 0 : -1 !== rb && (k = Da() - rb)), rb = 1 === j ? Da() :
vendor: 4,134 bytes, lines 634-684
634-1, g = -1 !== k && 150 > k ? "zoom" : "swipe", _ && 2 > j && (_ = !1, 1 === j && (g = "zoomPointerUp"), Ca("zoomGestureEnded")), $ = null, X || W || ea || S) 635 if (bb(), Q || (Q = Rb()), Q.calculateSwipeSpeed("x"), S) { 636 var l = Hb(); 637 if (l < i.verticalDragRange) f.close(); 638 else { 639 var m = oa.y, 640 n = ia; 641 cb("verticalDrag", 0, 1, 300, e.easing.cubic.out, function (a) { 642 oa.y = (f.currItem.initialPosition.y - m) * a + m, Ea((1 - n) * a + n), Ga() 643 }), Ca("onVerticalDrag", 1) 644 } 645 } else { 646 if ((Z || ea) && 0 === j) { 647 var o = Tb(g, Q); 648 if (o) return; 649 g = "zoomPointerUp" 650 } 651 if (!ea) return "swipe" !== g ? void Vb() : void(!Z && s > f.currItem.fitRatio && Sb(Q)) 652 } 653 }, 654 Rb = function () { 655 var a, b, c = { 656 lastFlickOffset: {}, 657 lastFlickDist: {}, 658 lastFlickSpeed: {}, 659 slowDownRatio: {}, 660 slowDownRatioReverse: {}, 661 speedDecelerationRatio: {}, 662 speedDecelerationRatioAbs: {}, 663 distanceOffset: {}, 664 backAnimDestination: {}, 665 backAnimStarted: {}, 666 calculateSwipeSpeed: function (d) { 667 nb.length > 1 ? (a = Da() - P + 50, b = nb[nb.length - 2][d]) : (a = Da() - O, b = kb[d]), c.lastFlickOffset[d] = jb[d] - b, c.lastFlickDist[d] = Math.abs(c.lastFlickOffset[d]), c.lastFlickDist[d] > 20 ? c.lastFlickSpeed[d] = c.lastFlickOffset[d] / a : c.lastFlickSpeed[d] = 0, Math.abs(c.lastFlickSpeed[d]) < .1 && (c.lastFlickSpeed[d] = 0), c.slowDownRatio[d] = .95, c.slowDownRatioReverse[d] = 1 - c.slowDownRatio[d], c.speedDecelerationRatio[d] = 1 668 }, 669 calculateOverBoundsAnimOffset: function (a, b) { 670 c.backAnimStarted[a] || (oa[a] > ca.min[a] ? c.backAnimDestination[a] = ca.min[a] : oa[a] < ca.max[a] && (c.backAnimDestination[a] = ca.max[a]), void 0 !== c.backAnimDestination[a] && (c.slowDownRatio[a] = .7, c.slowDownRatioReverse[a] = 1 - c.slowDownRatio[a], c.speedDecelerationRatioAbs[a] < .05 && (c.lastFlickSpeed[a] = 0, c.backAnimStarted[a] = !0, cb("bounceZoomPan" + a, oa[a], c.backAnimDestination[a], b || 300, e.easing.sine.out, function (b) { 671 oa[a] = b, Ga() 672 })))) 673 }, 674 calculateAnimOffset: function (a) { 675 c.backAnimStarted[a] || (c.speedDecelerationRatio[a] = c.speedDecelerationRatio[a] * (c.slowDownRatio[a] + c.slowDownRatioReverse[a] - c.slowDownRatioReverse[a] * c.timeDiff / 10), c.speedDecelerationRatioAbs[a] = Math.abs(c.lastFlickSpeed[a] * c.speedDecelerationRatio[a]), c.distanceOffset[a] = c.lastFlickSpeed[a] * c.speedDecelerationRatio[a] * c.timeDiff, oa[a] += c.distanceOffset[a]) 676 }, 677 panAnimLoop: function () { 678 return Za.zoomPan && (Za.zoomPan.raf = H(c.panAnimLoop), c.now = Da(), c.timeDiff = c.now - c.lastNow, c.lastNow = c.now, c.calculateAnimOffset("x"), c.calculateAnimOffset("y"), Ga(), c.calculateOverBoundsAnimOffset("x"), c.calculateOverBoundsAnimOffset("y"), c.speedDecelerationRatioAbs.x < .05 && c.speedDecelerationRatioAbs.y < .05) ? (oa.x = Math.round(oa.x), oa.y = Math.round(oa.y), Ga(), void _a("zoomPan")) : void 0 679 } 680 }; 681 return c 682 }, 683 Sb = function (a) { 684 return a.calculateSwipeSpeed("y"), ca = f.currItem.bounds, a.backAnimDestination = {}, a.backAnimStarted = {}, Math.abs(a.lastFlickSpeed.x) <= .05 && Math.abs(a.lastFlickSpeed.y) <= .05 ? (
684a.speedDecelerationRatioAbs.x = a.speedDecelerationRatioAbs.y = 0, a.calculateOverBoundsAnimOffset("x"), a.calculateOverBoundsAnimOffset("y"), !0) : (ab("zoomPan"), a.lastNow = Da(), void a.panAnimLoop()) 685 }, 686 Tb = function (a, b) { 687 var c; 688 ea || (pb = m); 689 var d; 690 if ("swipe" === a) { 691 var g = jb.x - kb.x, 692 h = b.lastFlickDist.x < 10; 693 g > eb && (h || b.lastFlickOffset.x > 20) ? d = -1 : -eb > g && (h || b.lastFlickOffset.x < -20) && (d = 1) 694 } 695 var j; 696 d && (m += d, 0 > m ? (m = i.loop ? _b() - 1 : 0, j = !0) : m >= _b() && (m = i.loop ? 0 : _b() - 1, j = !0), (!j || i.loop) && (ta += d, qa -= d, c = !0)); 697 var k, l = sa.x * qa, 698 n = Math.abs(l - sb.x); 699 return c || l > sb.x == b.lastFlickSpeed.x > 0 ? (k = Math.abs(b.lastFlickSpeed.x) > 0 ? n / Math.abs(b.lastFlickSpeed.x) : 333, k = Math.min(k, 400), k = Math.max(k, 250)) : k = 333, pb === m && (c = !1), ea = !0, Ca("mainScrollAnimStart"), cb("mainScroll", sb.x, l, k, e.easing.cubic.out, Ja, function () { 700 bb(), ea = !1, pb = -1, (c || pb !== m) && f.updateCurrItem(), Ca("mainScrollAnimComplete") 701 }), c && f.updateCurrItem(!0), c 702 }, 703 Ub = function (a) { 704 return 1 / ba * a * t 705 }, 706 Vb = function () { 707 var a = s, 708 b = Sa(), 709 c = Ta(); 710 b > s ? a = b : s > c && (a = c); 711 var d, g = 1, 712 h = ia; 713 return ha && !R && !ja && b > s ? (f.close(), !0) : (ha && (d = function (a) { 714 Ea((g - h) * a + h) 715 }), f.zoomTo(a, 0, 200, e.easing.cubic.out, d), !0) 716 }; 717 ya("Gestures", { 718 publicMethods: { 719 initGestures: function () { 720 var a = function (a, b, c, d, e) { 721 A = a + b, B = a + c, C = a + d, D = e ? a + e : "" 722 }; 723 F = N.pointerEvent, F && N.touch && (N.touch = !1), F ? navigator.pointerEnabled ? a("pointer", "down", "move", "up", "cancel") : a("MSPointer", "Down", "Move", "Up", "Cancel") : N.touch ? (a("touch", "start", "move", "end", "cancel"), G = !0) : a("mouse", "down", "move", "up"), p = B + " " + C + " " + D, q = A, F && !G && (G = navigator.maxTouchPoints > 1 || navigator.msMaxTouchPoints > 1), f.likelyTouchDevice = G, r[A] = Nb, r[B] = Ob, r[C] = Qb, D && (r[D] = r[C]), N.touch && (q += " mousedown", p += " mousemove mouseup", r.mousedown = r[A], r.mousemove = r[B], r.mouseup = r[C]), G || (i.allowPanToNext = !1) 724 } 725 } 726 }); 727 var Wb, Xb, Yb, Zb, $b, _b, ac, bc = function (b, c, d, g) { 728 Wb && clearTimeout(Wb), Zb = !0, Yb = !0; 729 var h; 730 b.initialLayout ? (h = b.initialLayout, b.initialLayout = null) : h = i.getThumbBoundsFn && i.getThumbBoundsFn(m); 731 var j = d ? i.hideAnimationDuration : i.showAnimationDuration, 732 k = function () { 733 _a("initialZoom"), d ? (f.template.removeAttribute("style"), f.bg.removeAttribute("style")) : (Ea(1), c && (c.style.display = "block"), e.addClass(a, "pswp--animated-in"), Ca("initialZoom" + (d ? "OutEnd" : "InEnd"))), g && g(), Zb = !1 734 }; 735 if (!j || !h || void 0 === h.x) { 736 var n = function () { 737 Ca("initialZoom" + (d ? "Out" : "In")), s = b.initialZoomLevel, La(oa, b.initialPosition), Ga(), a.style.opacity = d ? 0 : 1, Ea(1), k() 738 }; 739 return void n() 740 } 741 var o = function () { 742 var c = l, 743 g = !f.currItem.src || f.currItem.loadError || i.showHideOpacity; 744 b.miniImg && (b.miniImg.style.webkitBackfaceVisibility = "hidden"), d || (s = h.w / b.w, oa.x = h.x, oa.y = h.y - K, f[g ? "template" : "bg"].style.opacity = .001, Ga()), ab("initialZoom"), d && !c && e.removeClass(a, "pswp--animated-in"), g && (d ? e[(c ? "remove" : "add") + "Class"](a, "pswp--animate_opacity") : setTimeout(function () { 745 e.addClass(a, "pswp--animate_opacity") 746 }, 30)), Wb = setTimeout(function () { 747 if (Ca("initialZoom" + (d ? "Out" : "In")), d) { 748 var f = h.w / b.w, 749 i = { 750 x: oa.x, 751 y: oa.y 752 }, 753 l = s, 754 m = ia, 755 n = function (b) { 756 1 === b ? (s = f, oa.x = h.x, oa.y = h.y - M) : (s = (f - l) * b + l, oa.x = (h.x - i.x) * b + i.x, oa.y = (h.y - M - i.y) * b + i.y), Ga(), g ? a.style.opacity = 1 - b : Ea(m - b * m) 757 }; 758 c ? cb("initialZoom", 0, 1, j, e.easing.cubic.out, n, k) : (n(1), Wb = setTimeout(k, j + 20)) 759 } else s = b.initialZoomLevel, La(oa, b.initialPosition), Ga(), Ea(1), g ? a.style.opacity = 1 : Ea(1), Wb = setTimeout(k, j + 20) 760 }
760, d ? 25 : 90) 761 }; 762 o() 763 }, 764 cc = {}, 765 dc = [], 766 ec = { 767 index: 0, 768 errorMsg: '<div class="pswp__error-msg"><a href="%url%" target="_blank">The image</a> could not be loaded.</div>', 769 forceProgressiveLoading: !1, 770 preload: [1, 1], 771 getNumItemsFn: function () { 772 return Xb.length 773 } 774 }, 775 fc = function () { 776 return { 777 center: { 778 x: 0, 779 y: 0 780 }, 781 max: { 782 x: 0, 783 y: 0 784 }, 785 min: { 786 x: 0, 787 y: 0 788 } 789 } 790 }, 791 gc = function (a, b, c) { 792 var d = a.bounds; 793 d.center.x = Math.round((cc.x - b) / 2), d.center.y = Math.round((cc.y - c) / 2) + a.vGap.top, d.max.x = b > cc.x ? Math.round(cc.x - b) : d.center.x, d.max.y = c > cc.y ? Math.round(cc.y - c) + a.vGap.top : d.center.y, d.min.x = b > cc.x ? 0 : d.center.x, d.min.y = c > cc.y ? a.vGap.top : d.center.y 794 }, 795 hc = function (a, b, c) { 796 if (a.src && !a.loadError) { 797 var d = !c; 798 if (d && (a.vGap || (a.vGap = { 799 top: 0, 800 bottom: 0 801 }), Ca("parseVerticalMargin", a)), cc.x = b.x, cc.y = b.y - a.vGap.top - a.vGap.bottom, d) { 802 var e = cc.x / a.w, 803 f = cc.y / a.h; 804 a.fitRatio = f > e ? e : f; 805 var g = i.scaleMode; 806 "orig" === g ? c = 1 : "fit" === g && (c = a.fitRatio), c > 1 && (c = 1), a.initialZoomLevel = c, a.bounds || (a.bounds = fc()) 807 } 808 if (!c) return; 809 return gc(a, a.w * c, a.h * c), d && c === a.initialZoomLevel && (a.initialPosition = a.bounds.center), a.bounds 810 } 811 return a.w = a.h = 0, a.initialZoomLevel = a.fitRatio = 1, a.bounds = fc(), a.initialPosition = a.bounds.center, a.bounds 812 }, 813 ic = function (a, b, c, d, e, f) { 814 b.loadError || d && (b.imageAppended = !0, lc(b, d), c.appendChild(d), f && setTimeout(function () { 815 b && b.loaded && b.placeholder && (b.placeholder.style.display = "none", b.placeholder = null) 816 }, 500)) 817 }, 818 jc = function (a) { 819 a.loading = !0, a.loaded = !1; 820 var b = a.img = e.createEl("pswp__img", "img"), 821 c = function () { 822 a.loading = !1, a.loaded = !0, a.loadComplete ? a.loadComplete(a) : a.img = null, b.onload = b.onerror = null, b = null 823 }; 824 return b.onload = c, b.onerror = function () { 825 a.loadError = !0, c() 826 }, b.src = a.src, b 827 }, 828 kc = function (a, b) { 829 return a.src && a.loadError && a.container ? (b && (a.container.innerHTML = ""), a.container.innerHTML = i.errorMsg.replace("%url%", a.src), !0) : void 0 830 }, 831 lc = function (a, b, c) { 832 if (a.src) { 833 b || (b = a.container.lastChild); 834 var d = c ? a.w : Math.round(a.w * a.fitRatio), 835 e = c ? a.h : Math.round(a.h * a.fitRatio); 836 a.placeholder && !a.loaded && (a.placeholder.style.width = d + "px", a.placeholder.style.height = e + "px"), b.style.width = d + "px", b.style.height = e + "px" 837 } 838 }, 839 mc = function () { 840 if (dc.length) { 841 for (var a, b = 0; b < dc.length; b++) a = dc[b], a.holder.index === a.index && ic(a.index, a.item, a.baseDiv, a.img, !1, a.clearPlaceholder); 842 dc = [] 843 } 844 }; 845 ya("Controller", { 846 publicMethods: { 847 lazyLoadItem: function (a) { 848 a = za(a); 849 var b = $b(a); 850 !b || b.loaded || b.loading || (Ca("gettingData", a, b), b.src && jc(b)) 851 }, 852 initController: function () { 853 e.extend(i, ec, !0), f.items = Xb = c, $b = f.getItemAt, _b = i.getNumItemsFn, ac = i.loop, _b() < 3 && (i.loop = !1), Ba("beforeChange", function (a) { 854 var b, c = i.preload, 855 d = null === a ? !0 : a > 0, 856 e = Math.min(c[0], _b()), 857 g = Math.min(c[1], _b()); 858 for (b = 1; 859 (d ? g : e) >= b; b++) f.lazyLoadItem(m + b); 860 for (b = 1; 861 (d ? e : g) >= b; b++) f.lazyLoadItem(m - b) 862 }), Ba("initialLayout", function () { 863 f.currItem.initialLayout = i.getThumbBoundsFn && i.getThumbBoundsFn(m) 864 }), Ba("mainScrollAnimComplete", mc), Ba("initialZoomInEnd", mc), Ba("destroy", function () { 865 for (var a, b = 0; b < Xb.length; b++) a = Xb[b], a.container && (a.container = null), a.placeholder && (a.placeholder = null), a.img && (a.img = null), a.preloader && (a.preloader = null), a.loadError && (a.loaded = a.loadError = !1); 866 dc = null 867 }) 868 }, 869 getItemAt: function (a) { 870 return a >= 0 && void 0 !== Xb[a] ? Xb[a] : !1 871 }, 872 allowProgressiveImg: function () { 873 return i.forceProgressiveLoading || !G || i.mouseUsed || screen.width > 1200 874 }, 875 setContent: function (a, b) { 876 i.loop && (b = za(b)); 877 var c = f.getItemAt(a.index); 878 c && (c.container = null); 879 var d, g = f.getItemAt(b); 880 if (!g) return void(a.el.innerHTML = ""); 881 Ca("gettingData", b, g), a.index = b, a.item = g; 882 var h = g.container = e.createEl("pswp__zoom-wrap"); 883 if (!g.src && g.html && (g.html.tagName ? h.appendChild(g.html) : h.innerHTML = g.html), kc(g), hc(g, pa), !g.src || g.loadError || g.loaded) g.src && !g.loadError && (d = e.createEl("pswp__img", "img"), d.style.opacity = 1, d.src = g.src, lc(g, d), ic(b, g, h, d, !0)); 884 else { 885 if (g.loadComplete = function (c) { 886 if (j) { 887 if (a && a.index === b) { 888 if (kc(c, !0)) return c.loadComplete = c.img = null, hc(c, pa), Ha(c), void(a.index === m && f.updateCurrZoomItem()); 889 c.imageAppended ? !Zb && c.placeholder && (c.placeholder.style.display = "none", c.placeholder = null) : N.transform && (ea || Zb) ? dc.push({ 890 item: c, 891 baseDiv: h, 892 img: c.img, 893 index: b, 894 holder: a, 895 clearPlaceholder: !0 896 }) : ic(b, c, h, c.img, ea || Zb, !0) 897 } 898 c.loadComplete = null, c.img = null, Ca("imageLoadComplete", b, c) 899 } 900 }, e.features.transform) { 901 var k = "pswp__img pswp__img--placeholder"; 902 k += g.msrc ? "" : " pswp__img--placeholder--blank"; 903 var l = e.createEl(k, g.msrc ? "img" : ""); 904 g.msrc && (l.src = g.msrc), lc(g, l), h.appendChild(l), g.placeholder = l 905 } 906 g.loading || jc(g), f.allowProgressiveImg() && (!Yb && N.transform ? dc.push({ 907 item: g, 908 baseDiv: h, 909 img: g.img, 910 index: b, 911 holder: a 912 }) : ic(b, g, h, g.img, !0, !0)) 913 } 914 Yb || b !== m ? Ha(g) : (da = h.style, bc(g, d || g.img)), a.el.innerHTML = "", a.el.appendChild(h) 915 }, 916 cleanSlide: function (a) { 917 a.img && (a.img.onload = a.img.onerror = null), a.loaded = a.loading = a.img = a.imageAppended = !1 918 } 919 } 920 }); 921 var nc, oc = {}, 922 pc = function (a, b, c) { 923 var d = document.createEvent("CustomEvent"), 924 e = { 925 origEvent: a, 926 target: a.target, 927 releasePoint: b, 928 pointerType: c || "touch" 929 }; 930 d.initCustomEvent("pswpTap", !0, !0, e), a.target.dispatchEvent(d) 931 }; 932 ya("Tap", { 933 publicMethods: { 934 initTap: function () {
935 Ba("firstTouchStart", f.onTapStart), Ba("touchRelease", f.onTapRelease), Ba("destroy", function () { 936 oc = {}, nc = null 937 }) 938 }, 939 onTapStart: function (a) { 940 a.length > 1 && (clearTimeout(nc), nc = null) 941 }, 942 onTapRelease: function (a, b) { 943 if (b && !X && !V && !$a) { 944 var c = b; 945 if (nc && (clearTimeout(nc), nc = null, wb(c, oc))) return void Ca("doubleTap", c); 946 if ("mouse" === b.type) return void pc(a, b, "mouse"); 947 var d = a.target.tagName.toUpperCase(); 948 if ("BUTTON" === d || e.hasClass(a.target, "pswp__single-tap")) return void pc(a, b); 949 La(oc, c), nc = setTimeout(function () { 950 pc(a, b), nc = null 951 }, 300) 952 } 953 } 954 } 955 }); 956 var qc; 957 ya("DesktopZoom", { 958 publicMethods: { 959 initDesktopZoom: function () { 960 L || (G ? Ba("mouseUsed", function () { 961 f.setupDesktopZoom() 962 }) : f.setupDesktopZoom(!0)) 963 }, 964 setupDesktopZoom: function (b) { 965 qc = {}; 966 var c = "wheel mousewheel DOMMouseScroll"; 967 Ba("bindEvents", function () { 968 e.bind(a, c, f.handleMouseWheel) 969 }), Ba("unbindEvents", function () { 970 qc && e.unbind(a, c, f.handleMouseWheel) 971 }), f.mouseZoomedIn = !1; 972 var d, g = function () { 973 f.mouseZoomedIn && (e.removeClass(a, "pswp--zoomed-in"), f.mouseZoomedIn = !1), 1 > s ? e.addClass(a, "pswp--zoom-allowed") : e.removeClass(a, "pswp--zoom-allowed"), h() 974 }, 975 h = function () { 976 d && (e.removeClass(a, "pswp--dragging"), d = !1) 977 }; 978 Ba("resize", g), Ba("afterChange", g), Ba("pointerDown", function () { 979 f.mouseZoomedIn && (d = !0, e.addClass(a, "pswp--dragging")) 980 }), Ba("pointerUp", h), b || g() 981 }, 982 handleMouseWheel: function (a) { 983 if (s <= f.currItem.fitRatio) return i.modal && (!i.closeOnScroll || $a || U ? a.preventDefault() : E && Math.abs(a.deltaY) > 2 && (l = !0, f.close())), !0; 984 if (a.stopPropagation(), qc.x = 0, "deltaX" in a) 1 === a.deltaMode ? (qc.x = 18 * a.deltaX, qc.y = 18 * a.deltaY) : (qc.x = a.deltaX, qc.y = a.deltaY); 985 else if ("wheelDelta" in a) a.wheelDeltaX && (qc.x = -.16 * a.wheelDeltaX), a.wheelDeltaY ? qc.y = -.16 * a.wheelDeltaY : qc.y = -.16 * a.wheelDelta; 986 else { 987 if (!("detail" in a)) return; 988 qc.y = a.detail 989 } 990 Ra(s, !0); 991 var b = oa.x - qc.x, 992 c = oa.y - qc.y; 993 (i.modal || b <= ca.min.x && b >= ca.max.x && c <= ca.min.y && c >= ca.max.y) && a.preventDefault(), f.panTo(b, c) 994 }, 995 toggleDesktopZoom: function (b) { 996 b = b || { 997 x: pa.x / 2 + ra.x, 998 y: pa.y / 2 + ra.y 999 }; 1000 var c = i.getDoubleTapZoom(!0, f.currItem), 1001 d = s === c; 1002 f.mouseZoomedIn = !d, f.zoomTo(d ? f.currItem.initialZoomLevel : c, b, 333), e[(d ? "remove" : "add") + "Class"](a, "pswp--zoomed-in") 1003 } 1004 } 1005 }); 1006 var rc, sc, tc, uc, vc, wc, xc, yc, zc, Ac, Bc, Cc, Dc = { 1007 history: !0, 1008 galleryUID: 1 1009 }, 1010 Ec = function () { 1011 return Bc.hash.substring(1) 1012 }, 1013 Fc = function () { 1014 rc && clearTimeout(rc), tc && clearTimeout(tc) 1015 }, 1016 Gc = function () { 1017 var a = Ec(), 1018 b = {}; 1019 if (a.length < 5) return b; 1020 var c, d = a.split("&"); 1021 for (c = 0; c < d.length; c++) 1022 if (d[c]) { 1023 var e = d[c].split("="); 1024 e.length < 2 || (b[e[0]] = e[1]) 1025 } if (i.galleryPIDs) { 1026 var f = b.pid; 1027 for (b.pid = 0, c = 0; c < Xb.length; c++) 1028 if (Xb[c].pid === f) { 1029 b.pid = c; 1030 break 1031 } 1032 } else b.pid = parseInt(b.pid, 10) - 1; 1033 return b.pid < 0 && (b.pid = 0), b 1034 }, 1035 Hc = function () { 1036 if (tc && clearTimeout(tc), $a || U) return void(tc = setTimeout(Hc, 500)); 1037 uc ? clearTimeout(sc) : uc = !0; 1038 var a = m + 1, 1039 b = $b(m); 1040 b.hasOwnProperty("pid") && (a = b.pid); 1041 var c = xc + "&gid=" + i.galleryUID + "&pid=" + a; 1042 yc || -1 === Bc.hash.indexOf(c) && (Ac = !0); 1043 var d = Bc.href.split("#")[0] + "#" + c; 1044 Cc ? "#" + c !== window.location.hash && history[yc ? "replaceState" : "pushState"]("", document.title, d) : yc ? Bc.replace(d) : Bc.hash = c, yc = !0, sc = setTimeout(function () { 1045 uc = !1 1046 }, 60) 1047 }; 1048 ya("History", { 1049 publicMethods: { 1050 initHistory: function () { 1051 if (e.extend(i, Dc, !0), i.history) { 1052 Bc = window.location, Ac = !1, zc = !1, yc = !1, xc = Ec(), Cc = "pushState" in history, xc.indexOf("gid=") > -1 && (xc = xc.split("&gid=")[0], xc = xc.split("?gid=")[0]), Ba("afterChange", f.updateURL), Ba("unbindEvents", function () { 1053 e.unbind(window, "hashchange", f.onHashChange) 1054 }); 1055 var a = function () { 1056 wc = !0, zc || (Ac ? history.back() : xc ? Bc.hash = xc : Cc ? history.pushState("", document.title, Bc.pathname + Bc.search) : Bc.hash = ""), Fc() 1057 }; 1058 Ba("unbindEvents", function () { 1059 l && a() 1060 }), Ba("destroy", function () { 1061 wc || a() 1062 }), Ba("firstUpdate", function () { 1063 m = Gc().pid 1064 }); 1065 var b = xc.indexOf("pid="); 1066 b > -1 && (xc = xc.substring(0, b), "&" === xc.slice(-1) && (xc = xc.slice(0, -1))), setTimeout(function () { 1067 j && e.bind(window, "hashchange", f.onHashChange) 1068 }, 40) 1069 } 1070 }, 1071 onHashChange: function () { 1072 return Ec() === xc ? (zc = !0, void f.close()) : void(uc || (vc = !0, f.goTo(Gc().pid), vc = !1)) 1073 }, 1074 updateURL: function () { 1075 Fc(), vc || (yc ? rc = setTimeout(Hc, 800) : Hc()) 1076 } 1077 } 1078 }), e.extend(f, db) 1079 }; 1080 return a 1081}); 1082/*! PhotoSwipe Default UI - 4.1.0 - 2015-07-11 1083 * http://photoswipe.com 1084 * Copyright (c) 2015 Dmitry Semenov; */ 1085! function (a, b) { 1086 "function" == typeof define && define.amd ? define(b) : "object" == typeof exports ? module.exports = b() : a.PhotoSwipeUI_Default = b() 1087}(this, function () { 1088 "use strict"; 1089 var a = function (a, b) { 1090 var c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v = this, 1091 w = !1, 1092 x = !0, 1093 y = !0, 1094 z = { 1095 barsSize: { 1096 top: 44, 1097 bottom: "auto" 1098 }, 1099 closeElClasses: ["item", "caption", "zoom-wrap", "ui", "top-bar"], 1100 timeToIdle: 4e3, 1101 timeToIdleOutside: 1e3, 1102 loadingIndicatorDelay: 1e3, 1103 addCaptionHTMLFn: function (a, b) { 1104 return a.title ? (b.children[0].innerHTML = a.title, !0) : (b.children[0].innerHTML = "", !1) 1105 }, 1106 closeEl: !0, 1107 captionEl: !0, 1108 fullscreenEl: !0, 1109 zoomEl: !0, 1110 shareEl: !0, 1111 counterEl: !0,
1112 arrowEl: !0, 1113 preloaderEl: !0, 1114 tapToClose: !1, 1115 tapToToggleControls: !0, 1116 clickToCloseNonZoomable: !0, 1117 shareButtons: [{ 1118 id: "facebook", 1119 label: "Share on Facebook", 1120 url: "https://www.facebook.com/sharer/sharer.php?u={{url}}" 1121 }, { 1122 id: "twitter", 1123 label: "Tweet", 1124 url: "https://twitter.com/intent/tweet?text={{text}}&url={{url}}" 1125 }, { 1126 id: "pinterest", 1127 label: "Pin it", 1128 url: "http://www.pinterest.com/pin/create/button/?url={{url}}&media={{image_url}}&description={{text}}" 1129 }, { 1130 id: "download", 1131 label: "Download image", 1132 url: "{{raw_image_url}}", 1133 download: !0 1134 }], 1135 getImageURLForShare: function () { 1136 return a.currItem.src || "" 1137 }, 1138 getPageURLForShare: function () { 1139 return window.location.href 1140 }, 1141 getTextForShare: function () { 1142 return a.currItem.title || "" 1143 }, 1144 indexIndicatorSep: " / " 1145 }, 1146 A = function (a) { 1147 if (r) return !0; 1148 a = a || window.event, q.timeToIdle && q.mouseUsed && !k && K(); 1149 for (var c, d, e = a.target || a.srcElement, f = e.className, g = 0; g < S.length; g++) c = S[g], c.onTap && f.indexOf("pswp__" + c.name) > -1 && (c.onTap(), d = !0); 1150 if (d) { 1151 a.stopPropagation && a.stopPropagation(), r = !0; 1152 var h = b.features.isOldAndroid ? 600 : 30; 1153 s = setTimeout(function () { 1154 r = !1 1155 }, h) 1156 } 1157 }, 1158 B = function () { 1159 return !a.likelyTouchDevice || q.mouseUsed || screen.width > 1200 1160 }, 1161 C = function (a, c, d) { 1162 b[(d ? "add" : "remove") + "Class"](a, "pswp__" + c) 1163 }, 1164 D = function () { 1165 var a = 1 === q.getNumItemsFn(); 1166 a !== p && (C(d, "ui--one-slide", a), p = a) 1167 }, 1168 E = function () { 1169 C(i, "share-modal--hidden", y) 1170 }, 1171 F = function () { 1172 return y = !y, y ? (b.removeClass(i, "pswp__share-modal--fade-in"), setTimeout(function () { 1173 y && E() 1174 }, 300)) : (E(), setTimeout(function () { 1175 y || b.addClass(i, "pswp__share-modal--fade-in") 1176 }, 30)), y || H(), !1 1177 }, 1178 G = function (b) { 1179 b = b || window.event; 1180 var c = b.target || b.srcElement; 1181 return a.shout("shareLinkClick", b, c), c.href ? c.hasAttribute("download") ? !0 : (window.open(c.href, "pswp_share", "scrollbars=yes,resizable=yes,toolbar=no,location=yes,width=550,height=420,top=100,left=" + (window.screen ? Math.round(screen.width / 2 - 275) : 100)), y || F(), !1) : !1 1182 }, 1183 H = function () { 1184 for (var a, b, c, d, e, f = "", g = 0; g < q.shareButtons.length; g++) a = q.shareButtons[g], c = q.getImageURLForShare(a), d = q.getPageURLForShare(a), e = q.getTextForShare(a), b = a.url.replace("{{url}}", encodeURIComponent(d)).replace("{{image_url}}", encodeURIComponent(c)).replace("{{raw_image_url}}", c).replace("{{text}}", encodeURIComponent(e)), f += '<a href="' + b + '" target="_blank" class="pswp__share--' + a.id + '"' + (a.download ? "download" : "") + ">" + a.label + "</a>", q.parseShareButtonOut && (f = q.parseShareButtonOut(a, f)); 1185 i.children[0].innerHTML = f, i.children[0].onclick = G 1186 }, 1187 I = function (a) { 1188 for (var c = 0; c < q.closeElClasses.length; c++) 1189 if (b.hasClass(a, "pswp__" + q.closeElClasses[c])) return !0 1190 }, 1191 J = 0, 1192 K = function () { 1193 clearTimeout(u), J = 0, k && v.setIdle(!1) 1194 }, 1195 L = function (a) { 1196 a = a ? a : window.event; 1197 var b = a.relatedTarget || a.toElement; 1198 b && "HTML" !== b.nodeName || (clearTimeout(u), u = setTimeout(function () { 1199 v.setIdle(!0) 1200 }, q.timeToIdleOutside)) 1201 }, 1202 M = function () { 1203 q.fullscreenEl && (c || (c = v.getFullscreenAPI()), c ? (b.bind(document, c.eventK, v.updateFullscreen), v.updateFullscreen(), b.addClass(a.template, "pswp--supports-fs")) : b.removeClass(a.template, "pswp--supports-fs")) 1204 }, 1205 N = function () { 1206 q.preloaderEl && (O(!0), l("beforeChange", function () { 1207 clearTimeout(o), o = setTimeout(function () { 1208 a.currItem && a.currItem.loading ? (!a.allowProgressiveImg() || a.currItem.img && !a.currItem.img.naturalWi
1208dth) && O(!1) : O(!0) 1209 }, q.loadingIndicatorDelay) 1210 }), l("imageLoadComplete", function (b, c) { 1211 a.currItem === c && O(!0) 1212 })) 1213 }, 1214 O = function (a) { 1215 n !== a && (C(m, "preloader--active", !a), n = a) 1216 }, 1217 P = function (a) { 1218 var c = a.vGap; 1219 if (B()) { 1220 var g = q.barsSize; 1221 if (q.captionEl && "auto" === g.bottom) 1222 if (f || (f = b.createEl("pswp__caption pswp__caption--fake"), f.appendChild(b.createEl("pswp__caption__center")), d.insertBefore(f, e), b.addClass(d, "pswp__ui--fit")), q.addCaptionHTMLFn(a, f, !0)) { 1223 var h = f.clientHeight; 1224 c.bottom = parseInt(h, 10) || 44 1225 } else c.bottom = g.top; 1226 else c.bottom = "auto" === g.bottom ? 0 : g.bottom; 1227 c.top = g.top 1228 } else c.top = c.bottom = 0 1229 }, 1230 Q = function () { 1231 q.timeToIdle && l("mouseUsed", function () { 1232 b.bind(document, "mousemove", K), b.bind(document, "mouseout", L), t = setInterval(function () { 1233 J++, 2 === J && v.setIdle(!0) 1234 }, q.timeToIdle / 2) 1235 }) 1236 }, 1237 R = function () { 1238 l("onVerticalDrag", function (a) { 1239 x && .95 > a ? v.hideControls() : !x && a >= .95 && v.showControls() 1240 }); 1241 var a; 1242 l("onPinchClose", function (b) { 1243 x && .9 > b ? (v.hideControls(), a = !0) : a && !x && b > .9 && v.showControls() 1244 }), l("zoomGestureEnded", function () { 1245 a = !1, a && !x && v.showControls() 1246 }) 1247 }, 1248 S = [{ 1249 name: "caption", 1250 option: "captionEl", 1251 onInit: function (a) { 1252 e = a 1253 } 1254 }, { 1255 name: "share-modal", 1256 option: "shareEl", 1257 onInit: function (a) { 1258 i = a 1259 }, 1260 onTap: function () { 1261 F() 1262 } 1263 }, { 1264 name: "button--share", 1265 option: "shareEl", 1266 onInit: function (a) { 1267 h = a 1268 }, 1269 onTap: function () { 1270 F() 1271 } 1272 }, { 1273 name: "button--zoom", 1274 option: "zoomEl", 1275 onTap: a.toggleDesktopZoom 1276 }, { 1277 name: "counter", 1278 option: "counterEl", 1279 onInit: function (a) { 1280 g = a 1281 } 1282 }, { 1283 name: "button--close", 1284 option: "closeEl", 1285 onTap: a.close 1286 }, { 1287 name: "button--arrow--left", 1288 option: "arrowEl", 1289 onTap: a.prev 1290 }, { 1291 name: "button--arrow--right", 1292 option: "arrowEl", 1293 onTap: a.next 1294 }, { 1295 name: "button--fs", 1296 option: "fullscreenEl", 1297 onTap: function () { 1298 c.isFullscreen() ? c.exit() : c.enter() 1299 } 1300 }, { 1301 name: "preloader", 1302 option: "preloaderEl", 1303 onInit: function (a) { 1304 m = a 1305 } 1306 }], 1307 T = function () { 1308 var a, c, e, f = function (d) { 1309 if (d) 1310 for (var f = d.length, g = 0; f > g; g++) { 1311 a = d[g], c = a.className; 1312 for (var h = 0; h < S.length; h++) e = S[h], c.indexOf("pswp__" + e.name) > -1 && (q[e.option] ? (b.removeClass(a, "pswp__element--disabled"), e.onInit && e.onInit(a)) : b.addClass(a, "pswp__element--disabled")) 1313 } 1314 }; 1315 f(d.children); 1316 var g = b.getChildByClass(d, "pswp__top-bar"); 1317 g && f(g.children) 1318 }; 1319 v.init = function () { 1320 b.extend(a.options, z, !0), q = a.options, d = b.getChildByClass(a.scrollWrap, "psw
1320p__ui"), l = a.listen, R(), l("beforeChange", v.update), l("doubleTap", function (b) { 1321 var c = a.currItem.initialZoomLevel; 1322 a.getZoomLevel() !== c ? a.zoomTo(c, b, 333) : a.zoomTo(q.getDoubleTapZoom(!1, a.currItem), b, 333) 1323 }), l("preventDragEvent", function (a, b, c) { 1324 var d = a.target || a.srcElement; 1325 d && d.className && a.type.indexOf("mouse") > -1 && (d.className.indexOf("__caption") > 0 || /(SMALL|STRONG|EM)/i.test(d.tagName)) && (c.prevent = !1) 1326 }), l("bindEvents", function () { 1327 b.bind(d, "pswpTap click", A), b.bind(a.scrollWrap, "pswpTap", v.onGlobalTap), a.likelyTouchDevice || b.bind(a.scrollWrap, "mouseover", v.onMouseOver) 1328 }), l("unbindEvents", function () { 1329 y || F(), t && clearInterval(t), b.unbind(document, "mouseout", L), b.unbind(document, "mousemove", K), b.unbind(d, "pswpTap click", A), b.unbind(a.scrollWrap, "pswpTap", v.onGlobalTap), b.unbind(a.scrollWrap, "mouseover", v.onMouseOver), c && (b.unbind(document, c.eventK, v.updateFullscreen), c.isFullscreen() && (q.hideAnimationDuration = 0, c.exit()), c = null) 1330 }), l("destroy", function () { 1331 q.captionEl && (f && d.removeChild(f), b.removeClass(e, "pswp__caption--empty")), i && (i.children[0].onclick = null), b.removeClass(d, "pswp__ui--over-close"), b.addClass(d, "pswp__ui--hidden"), v.setIdle(!1) 1332 }), q.showAnimationDuration || b.removeClass(d, "pswp__ui--hidden"), l("initialZoomIn", function () { 1333 q.showAnimationDuration && b.removeClass(d, "pswp__ui--hidden") 1334 }), l("initialZoomOut", function () { 1335 b.addClass(d, "pswp__ui--hidden") 1336 }), l("parseVerticalMargin", P), T(), q.shareEl && h && i && (y = !0), D(), Q(), M(), N() 1337 }, v.setIdle = function (a) { 1338 k = a, C(d, "ui--idle", a) 1339 }, v.update = function () { 1340 x && a.currItem ? (v.updateIndexIndicator(), q.captionEl && (q.addCaptionHTMLFn(a.currItem, e), C(e, "caption--empty", !a.currItem.title)), w = !0) : w = !1, y || F(), D() 1341 }, v.updateFullscreen = function (d) { 1342 d && setTimeout(function () { 1343 a.setScrollOffset(0, b.getScrollY()) 1344 }, 50), b[(c.isFullscreen() ? "add" : "remove") + "Class"](a.template, "pswp--fs") 1345 }, v.updateIndexIndicator = function () { 1346 q.counterEl && (g.innerHTML = a.getCurrentIndex() + 1 + q.indexIndicatorSep + q.getNumItemsFn()) 1347 }, v.onGlobalTap = function (c) { 1348 c = c || window.event; 1349 var d = c.target || c.srcElement; 1350 if (!r) 1351 if (c.detail && "mouse" === c.detail.pointerType) { 1352 if (I(d)) return void a.close(); 1353 b.hasClass(d, "pswp__img") && (1 === a.getZoomLevel() && a.getZoomLevel() <= a.currItem.fitRatio ? q.clickToCloseNonZoomable && a.close() : a.toggleDesktopZoom(c.detail.releasePoint)) 1354 } else if (q.tapToToggleControls && (x ? v.hideControls() : v.showControls()), q.tapToClose && (b.hasClass(d, "pswp__img") || I(d))) return void a.close() 1355 }, v.onMouseOver = function (a) { 1356 a = a || window.event; 1357 var b = a.target || a.srcElement; 1358 C(d, "ui--over-close", I(b)) 1359 }, v.hideControls = function () { 1360 b.addClass(d, "pswp__ui--hidden"), x = !1 1361 }, v.showControls = function () { 1362 x = !0, w || v.update(), b.removeClass(d, "pswp__ui--hidden") 1363 }, v.supportsFullscreen = function () { 1364 var a = document; 1365 return !!(a.exitFullscreen || a.mozCancelFullScreen || a.webkitExitFullscreen || a.msExitFullscreen) 1366 }, v.getFullscreenAPI = function () { 1367 var b, c = document.documentElement, 1368 d = "fullscreenchange"; 1369 return c.requestFullscreen ? b = { 1370 enterK: "requestFullscreen", 1371 exitK: "exitFullscreen", 1372 elementK: "fullscreenElement", 1373 eventK: d 1374 } : c.mozRequestFullScreen ? b = { 1375 enterK: "mozRequestFullScreen", 1376 exitK: "mozCancelFullScreen", 1377 elementK: "mozFullScreenElement", 1378 eventK: "moz" + d 1379 } : c.webkitRequestFullscreen ? b = { 1380 enterK: "webkitRequestFullscreen", 1381 exitK: "webkitExitFullscreen", 1382 elementK: "webkitFullscreenElement", 1383 eventK: "webkit" + d 1384 } : c.msRequestFullscreen && (b = { 1385 enterK: "msRequestFullscreen", 1386 exitK: "msExitFullscreen", 1387 elementK: "msFullscreenElement", 1388 eventK: "MSFullscreenChange" 1389 }), b && (b.enter = function () { 1390 return j = q.closeOnScroll, q.closeOnScroll = !1, "webkitRequestFullscreen" !== this.enterK ? a.template[this.enterK]() : void a.template[this.enterK](Element.ALLOW_KEYBOARD_INPUT) 1391 }, b.exit = function () { 1392 return q.closeOnScroll = j, document[this.exitK]() 1393 }, b.isFullscreen = function () { 1394 return document[this.elementK] 1395 }), b 1396 } 1397 }; 1398 return a 1399}); 1400 1401/*! jQuery PhotoSwipe Wrapper 1402 * Copyright (c) 2015 Watanabe Takashi URL:http://www.free-jquery.com/ 1403 * Released under the MIT license 1404 * http://opensource.org/licenses/mit-license.php 1405 * 1406 * 1407 */ 1408; 1409(function ($) { 1410 $.fn.photoSwipe = function (options) { 1411 var $this = $(this), 1412 $target = $this.is('a') ? $this : $('a', $this), 1413 images = {}, 1414 uidkey = "data-pswp-uid", 1415 defaults = { 1416 barsSize: { 1417 top: 0, 1418 bottom: 'auto' 1419 }, 1420 bgOpacity: 0.85, 1421 captionArea: true,
1422 shareButton: false, 1423 fullScreenButton: false, 1424 zoonButton: false, 1425 preloaderButton: false, 1426 topToClose: true, 1427 tapToToggleControls: true, 1428 animationDuration: 200, 1429 maxSpreadZoom: 1, 1430 history: false 1431 }; 1432 options = $.extend(defaults, options); 1433 var init = function () { 1434 var open = function (id, $targetLink) { 1435 var pswpElement = $('.pswp')[0], 1436 gallery, 1437 datas, 1438 thumbnails = parseThumbnails($targetLink), 1439 items = thumbnails.items, 1440 index = thumbnails.index; 1441 datas = { 1442 galleryUID: $targetLink.attr('data-pswp-uid'), 1443 getThumbBoundsFn: function (index) { 1444 var $thumbnail = $('img', items[index].el), 1445 pageYScroll = window.pageYOffset || document.documentElement.scrollTop, 1446 rect = $thumbnail[0].getBoundingClientRect(); 1447 return { 1448 x: rect.left, 1449 y: rect.top + pageYScroll, 1450 w: rect.width 1451 }; 1452 }, 1453 addCaptionHTMLFn: function (item, captionEl, isFake) { 1454 if (!item.title) { 1455 captionEl.children[0].innerText = ''; 1456 return false; 1457 } 1458 var html = item.title; 1459 if (item.author) { 1460 html += '<br/><small>Photo: ' + item.author + '</small>'; 1461 } 1462 captionEl.children[0].innerHTML = html; 1463 return true; 1464 }, 1465 captionEl: options.captionArea, 1466 shareEl: options.shareButton, 1467 fullscreenEl: options.fullScreenButton, 1468 zoomEl: options.zoomButton, 1469 bgOpacity: options.bgOpacity, 1470 preloaderEl: options.preloaderButton, 1471 topToClose: options.topToClose, 1472 tapToToggleControls: options.tapToToggleControls, 1473 barsSize: options.barsSize, 1474 showAnimationDuration: options.animationDuration, 1475 hodeAnimationDuration: options.animationDuration, 1476 maxSpreadZoom: options.maxSpreadZoom, 1477 history: options.history, 1478 'index': index 1479 }; 1480 1481 gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, datas); 1482 var realViewportWidth, 1483 useLargeImages = false, 1484 firstResize = true, 1485 imageSrcWillChange; 1486 gallery.listen('beforeResize', function () { 1487 var dpiRatio = window.devicePixelRatio ? window.devicePixelRatio : 1; 1488 dpiRatio = Math.min(dpiRatio, 2.5); 1489 realViewportWidth = gallery.viewportSize.x * dpiRatio; 1490 1491 if (realViewportWidth >= 1200 || (!gallery.likelyTouchDevice && realViewportWidth > 800) || screen.width > 1200) { 1492 if (!useLargeImages) { 1493 useLargeImages = true; 1494 imageSrcWillChange = true; 1495 } 1496 } else { 1497 if (useLargeImages) { 1498 useLargeImages = false; 1499 imageSrcWillChange = true; 1500 } 1501 } 1502 1503 if (imageSrcWillChange && !firstResize) { 1504 gallery.invalidateCurrItems(); 1505 } 1506 1507 if (firstResize) { 1508 firstResize = false;
1509 } 1510 1511 imageSrcWillChange = false; 1512 1513 }); 1514 1515 gallery.init(); 1516 }, 1517 closest = function closest(el, fn) { 1518 return el && (fn(el) ? el : closest(el.parentNode, fn)); 1519 }, 1520 getImage = function (src) { 1521 return images[src]; 1522 }, 1523 getTargetPhotos = function ($targetLink) { 1524 var rel = $targetLink.attr('data-rel'); 1525 if (!rel) { 1526 return [$targetLink]; 1527 } 1528 var photos = []; 1529 $target.each(function () { 1530 if ($(this).is('[data-rel="' + rel + '"]')) { 1531 photos.push($(this)); 1532 } 1533 }); 1534 return photos; 1535 }, 1536 parseThumbnails = function ($targetLink) { 1537 var photos = getTargetPhotos($targetLink), 1538 max = photos.length, 1539 items = [], 1540 item, index = -1; 1541 for (var i = 0; i < max; ++i) { 1542 var $photo = photos[i], 1543 photoSrc = $photo.attr('href'), 1544 img = getImage(photoSrc); 1545 if ($photo.attr(uidkey) === $targetLink.attr(uidkey)) { 1546 index = i; 1547 } 1548 item = { 1549 src: photoSrc, 1550 w: img.width, 1551 h: img.height, 1552 author: $photo.attr('data-author'), 1553 title: $photo.attr('title'), 1554 msrc: $('img', $photo).attr('src') 1555 }; 1556 1557 item.el = $photo; 1558 item.o = { 1559 src: item.src, 1560 w: item.w, 1561 h: item.h 1562 }; 1563 items.push(item); 1564 } 1565 return { 1566 'items': items, 1567 'index': index 1568 }; 1569 }, 1570 setuid = function (comp) { 1571 var uid = 1; 1572 $target.each(function () { 1573 if ($(this).is('a')) { 1574 $(this).attr(uidkey, uid); 1575 var imgSrc = $(this).attr('href'); 1576 if (!(imgSrc in images)) { 1577 var img = new Image(); 1578 img.src = imgSrc; 1579 images[imgSrc] = null; 1580 img.onload = function () { 1581 images[imgSrc] = img; 1582 }; 1583 img.onerror = function () { 1584 images[imgSrc] = img; 1585 } 1586 } 1587 ++uid; 1588 } 1589 }); 1590 }; 1591 setuid(); 1592 $target.on('click', function () { 1593 var $click = $(this), 1594 uid = $click.attr(uidkey); 1595 open(uid, $click); 1596 return false; 1597 }); 1598 var photoswipeParseHash = function () { 1599 var hash = window.location.hash.substring(1), 1600 params = {}; 1601 if (hash.length < 5) { // pid=1 1602 return params; 1603 } 1604 var vars = hash.split('&'); 1605 for (var i = 0; i < vars.length; i++) { 1606 if (!vars[i]) { 1607 continue; 1608 } 1609 var pair = vars[i].split('='); 1610 if (pair.length < 2) { 1611 continue; 1612 } 1613 params[pair[0]] = pair[1]; 1614 } 1615 if (params.gid) { 1616 params.gid = parseInt(params.gid, 10); 1617 } 1618 return params; 1619 }; 1620 1621 var hashData = photoswipeParseHash(); 1622 if (hashData.pid && hashData.gid) { 1623 var openHash = function () { 1624 for (var key in images) { 1625 if (!images[key]) { 1626 setTimeout(openHash, 400); 1627 return; 1628 } 1629 } 1630 open(hashData.pid, $('a[' + uidkey + '="' + hashData.gid + '"]')); 1631 }; 1632 openHash(); 1633 } 1634 }; 1635 init(); 1636 }; 1637 $(function () { 1638 var pswptag = '<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true"><div class="pswp__bg"></div><div class="pswp__scroll-wrap"><div class="pswp__container"><div class="pswp__item"></div><div class="pswp__item"></div><div class="pswp__item"></div></div><div class="pswp__ui pswp__ui--hidden"><div class="pswp__top-bar"><div class="pswp__counter"></div><button class="pswp__button pswp__button--close" title="Close (Esc)"></button><button class="pswp__button pswp__button--share" title="Share"></button><button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button><button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button><div class="pswp__preloader"><div class="pswp__preloader__icn"><div class="pswp__preloader__cut"><div class="pswp__preloader__donut"></div></div></div></div></div><div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap"><div class="pswp__share-tooltip"></div> </div><button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)"></button><button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)"></button><div class="pswp__caption"><div class="pswp__caption__center"></div></div></div></div></div>'; 1639 if ($('.pswp').length === 0) { 1640 $('body').append(pswptag); 1641 } 1642 }); 1643})(jQuery);
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.