PluginProbe
Photonic Gallery & Lightbox for Flickr, SmugMug & Others / 3.34
Photonic Gallery & Lightbox for Flickr, SmugMug & Others v3.34
3.37 3.36 3.35 3.34 3.33 2.19 2.20 2.21 2.22 2.23 2.24 2.25 2.26 2.27 2.28 2.29 2.30 2.31 2.32 2.33 2.34 2.40 2.41 2.42 2.43 All 142 releases
photonic / include / js / front-end / out / photonic-lightcase.js

photonic-lightcase.js in Photonic Gallery & Lightbox for Flickr, SmugMug & Others 3.34, at include/js/front-end/out/photonic-lightcase.js

3,743 lines 125.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /******/ (() => { // webpackBootstrap
2 /******/ "use strict";
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
6 /*!******************************************************************************!*\
7 !*** ../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
8 \******************************************************************************/
9 /*! unknown exports (runtime-defined) */
10 /*! runtime requirements: module */
11 /*! CommonJS bailout: module.exports is used directly at 39:0-14 */
12 /***/ ((module) => {
13
14
15
16 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
17 try {
18 var info = gen[key](arg);
19 var value = info.value;
20 } catch (error) {
21 reject(error);
22 return;
23 }
24
25 if (info.done) {
26 resolve(value);
27 } else {
28 Promise.resolve(value).then(_next, _throw);
29 }
30 }
31
32 function _asyncToGenerator(fn) {
33 return function () {
34 var self = this,
35 args = arguments;
36 return new Promise(function (resolve, reject) {
37 var gen = fn.apply(self, args);
38
39 function _next(value) {
40 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
41 }
42
43 function _throw(err) {
44 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
45 }
46
47 _next(undefined);
48 });
49 };
50 }
51
52 module.exports = _asyncToGenerator;
53
54 /***/ }),
55
56 /***/ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js":
57 /*!****************************************************************************!*\
58 !*** ../../../../../node_modules/@babel/runtime/helpers/defineProperty.js ***!
59 \****************************************************************************/
60 /*! unknown exports (runtime-defined) */
61 /*! runtime requirements: module */
62 /*! CommonJS bailout: module.exports is used directly at 18:0-14 */
63 /***/ ((module) => {
64
65
66
67 function _defineProperty(obj, key, value) {
68 if (key in obj) {
69 Object.defineProperty(obj, key, {
70 value: value,
71 enumerable: true,
72 configurable: true,
73 writable: true
74 });
75 } else {
76 obj[key] = value;
77 }
78
79 return obj;
80 }
81
82 module.exports = _defineProperty;
83
84 /***/ }),
85
86 /***/ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
87 /*!***********************************************************************************!*\
88 !*** ../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
89 \***********************************************************************************/
90 /*! unknown exports (runtime-defined) */
91 /*! runtime requirements: module */
92 /*! CommonJS bailout: module.exports is used directly at 9:0-14 */
93 /***/ ((module) => {
94
95
96
97 function _interopRequireDefault(obj) {
98 return obj && obj.__esModule ? obj : {
99 "default": obj
100 };
101 }
102
103 module.exports = _interopRequireDefault;
104
105 /***/ }),
106
107 /***/ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js":
108 /*!************************************************************************************!*\
109 !*** ../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js ***!
110 \************************************************************************************/
111 /*! unknown exports (runtime-defined) */
112 /*! runtime requirements: module, __webpack_require__ */
113 /*! CommonJS bailout: module.exports is used directly at 57:0-14 */
114 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
115
116
117
118 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../../../../../node_modules/@babel/runtime/helpers/typeof.js");
119
120 function _getRequireWildcardCache() {
121 if (typeof WeakMap !== "function") return null;
122 var cache = new WeakMap();
123
124 _getRequireWildcardCache = function _getRequireWildcardCache() {
125 return cache;
126 };
127
128 return cache;
129 }
130
131 function _interopRequireWildcard(obj) {
132 if (obj && obj.__esModule) {
133 return obj;
134 }
135
136 if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") {
137 return {
138 "default": obj
139 };
140 }
141
142 var cache = _getRequireWildcardCache();
143
144 if (cache && cache.has(obj)) {
145 return cache.get(obj);
146 }
147
148 var newObj = {};
149 var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
150
151 for (var key in obj) {
152 if (Object.prototype.hasOwnProperty.call(obj, key)) {
153 var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
154
155 if (desc && (desc.get || desc.set)) {
156 Object.defineProperty(newObj, key, desc);
157 } else {
158 newObj[key] = obj[key];
159 }
160 }
161 }
162
163 newObj["default"] = obj;
164
165 if (cache) {
166 cache.set(obj, newObj);
167 }
168
169 return newObj;
170 }
171
172 module.exports = _interopRequireWildcard;
173
174 /***/ }),
175
176 /***/ "../../../../../node_modules/@babel/runtime/helpers/typeof.js":
177 /*!********************************************************************!*\
178 !*** ../../../../../node_modules/@babel/runtime/helpers/typeof.js ***!
179 \********************************************************************/
180 /*! unknown exports (runtime-defined) */
181 /*! runtime requirements: module */
182 /*! CommonJS bailout: module.exports is used directly at 7:4-18 */
183 /*! CommonJS bailout: module.exports is used directly at 11:4-18 */
184 /*! CommonJS bailout: module.exports is used directly at 19:0-14 */
185 /***/ ((module) => {
186
187
188
189 function _typeof(obj) {
190 "@babel/helpers - typeof";
191
192 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
193 module.exports = _typeof = function _typeof(obj) {
194 return typeof obj;
195 };
196 } else {
197 module.exports = _typeof = function _typeof(obj) {
198 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
199 };
200 }
201
202 return _typeof(obj);
203 }
204
205 module.exports = _typeof;
206
207 /***/ }),
208
209 /***/ "../include/js/front-end/src/Components/Modal.js":
210 /*!*******************************************************!*\
211 !*** ../include/js/front-end/src/Components/Modal.js ***!
212 \*******************************************************/
213 /*! flagged exports */
214 /*! export Modal [provided] [no usage info] [missing usage info prevents renaming] */
215 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
216 /*! other exports [not provided] [no usage info] */
217 /*! runtime requirements: __webpack_exports__ */
218 /***/ ((__unused_webpack_module, exports) => {
219
220
221
222 Object.defineProperty(exports, "__esModule", ({
223 value: true
224 }));
225 exports.Modal = void 0;
226
227 /*
228 * Photonic Modal
229 * Used as the overlay panel
230 * License: MIT
231 */
232 var Modal = function Modal(modal, options) {
233 var body = document.body; //Defaults
234
235 var settings = Object.assign({
236 modalTarget: 'photonicModal',
237 closeCSS: '',
238 closeFromRight: 0,
239 width: '80%',
240 height: '100%',
241 top: '0px',
242 left: '0px',
243 zIndexIn: '9999',
244 zIndexOut: '-9999',
245 color: '#39BEB9',
246 opacityIn: '1',
247 opacityOut: '0',
248 animationDuration: '.6s',
249 overflow: 'auto'
250 }, options);
251 var overlay = document.querySelector('.photonicModalOverlay'),
252 scrollable = document.querySelector('.photonicModalOverlayScrollable');
253
254 if (!overlay) {
255 overlay = document.createElement('div');
256 overlay.className = 'photonicModalOverlay';
257 scrollable = document.createElement('div');
258 scrollable.className = 'photonicModalOverlayScrollable';
259 overlay.appendChild(scrollable);
260 body.appendChild(overlay);
261 }
262
263 var closeIcon = modal.querySelector('.photonicModalClose');
264
265 if (!closeIcon) {
266 closeIcon = document.createElement('a');
267 closeIcon.className = 'photonicModalClose ' + settings.closeCSS;
268 closeIcon.style.right = settings.closeFromRight;
269 closeIcon.innerHTML = '×';
270 closeIcon.setAttribute('href', '#');
271 modal.insertAdjacentElement('afterbegin', closeIcon);
272 }
273
274 closeIcon = modal.querySelector('.photonicModalClose');
275 var id = document.querySelector('#' + settings.modalTarget); // Default Classes
276 // id.addClass('photonicModal');
277 // id.addClass(settings.modalTarget+'-off');
278 //Init styles
279
280 var initStyles = {
281 'width': settings.width,
282 'height': settings.height,
283 'top': settings.top,
284 'left': settings.left,
285 'background-color': settings.color,
286 'overflow-y': settings.overflow,
287 'z-index': settings.zIndexOut,
288 'opacity': settings.opacityOut,
289 '-webkit-animation-duration': settings.animationDuration,
290 '-moz-animation-duration': settings.animationDuration,
291 '-ms-animation-duration': settings.animationDuration,
292 'animation-duration': settings.animationDuration
293 };
294
295 if (id) {
296 id.classList.add('photonicModal');
297 id.classList.add(settings.modalTarget + '-off');
298 var style = '';
299
300 for (var [key, value] of Object.entries(initStyles)) {
301 style += "".concat(key, ": ").concat(value, "; ");
302 }
303
304 id.style.cssText += style; // initStyles.reduce((a, v, i) => a + i + ': ' + v + ';');
305
306 open(id);
307 }
308
309 closeIcon.addEventListener('click', function (event) {
310 event.preventDefault();
311 document.documentElement.style.overflow = 'auto';
312 document.body.style.overflow = 'auto';
313
314 if (id.classList.contains(settings.modalTarget + '-on')) {
315 id.classList.remove(settings.modalTarget + '-on');
316 id.classList.add(settings.modalTarget + '-off');
317 }
318
319 if (id.classList.contains(settings.modalTarget + '-off')) {
320 id.addEventListener('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', afterClose, {
321 once: true
322 });
323 }
324
325 id.style.overflowY = 'hidden';
326 slideUp(id); // Util.slideUpDown(id.closest('.photonicModalOverlayScrollable'), 'hide');
327
328 overlay.style.overflowY = 'hidden'; // Util.fadeOut(overlay);
329
330 overlay.style.display = 'none';
331 });
332
333 function slideDown(element) {
334 element.style.height = 'auto';
335 element.style.height = "".concat(element.scrollHeight, "px");
336 element.style.height = 'auto';
337 }
338
339 var slideUp = element => {
340 element.style.height = 0;
341 element.style.display = 'none';
342 };
343
344 function open(el) {
345 document.documentElement.style.overflow = 'hidden';
346 document.body.style.overflow = 'hidden';
347
348 if (el.classList.contains(settings.modalTarget + '-off')) {
349 el.classList.remove(settings.modalTarget + '-off');
350 el.classList.add(settings.modalTarget + '-on');
351 }
352
353 if (el.classList.contains(settings.modalTarget + '-on')) {
354 el.style.opacity = settings.opacityIn;
355 el.style.zIndex = settings.zIndexIn;
356 }
357
358 overlay.style.overflowY = settings.overflow;
359 overlay.style.display = 'block'; // Util.fadeIn(overlay);
360
361 scrollable.appendChild(el);
362 el.style.display = 'block';
363 el.style.overflowY = settings.overflow;
364 slideDown(scrollable); // Util.slideUpDown(scrollable, 'show');
365 }
366
367 function afterClose() {
368 id.style.zIndex = settings.zIndexOut;
369 }
370 };
371
372 exports.Modal = Modal;
373
374 /***/ }),
375
376 /***/ "../include/js/front-end/src/Components/Prompter.js":
377 /*!**********************************************************!*\
378 !*** ../include/js/front-end/src/Components/Prompter.js ***!
379 \**********************************************************/
380 /*! flagged exports */
381 /*! export Prompter [provided] [no usage info] [missing usage info prevents renaming] */
382 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
383 /*! other exports [not provided] [no usage info] */
384 /*! runtime requirements: __webpack_exports__ */
385 /***/ ((__unused_webpack_module, exports) => {
386
387
388
389 Object.defineProperty(exports, "__esModule", ({
390 value: true
391 }));
392 exports.Prompter = void 0;
393
394 /**
395 * Photonic Prompter
396 * Used for interactive dialogs, e.g. the Photonic password prompter.
397 *
398 * GPL v3.0
399 */
400
401 /*
402 * var myPrompter = Prompter('htmlID');
403 *
404 * id: The HTML id of the object
405 */
406 class Prompter {
407 constructor(id) {
408 this.events = {
409 onShow: new Event('onShow'),
410 onConfirm: new Event('onConfirm'),
411 onHide: new Event('onHide')
412 };
413 this.modal = document.getElementById(id);
414 this.classClose = '.close';
415 this.classCancel = '.cancel';
416 this.classConfirm = '.confirm';
417 this.btnsOpen = [];
418 }
419 /*
420 * Prompter.show() :
421 *
422 * Shows the modal
423 */
424
425
426 show() {
427 this.modal.dispatchEvent(this.events.onShow);
428 this.modal.style.display = "block";
429 return this;
430 }
431 /* Prompter.hide() :
432 *
433 * Hides the modal
434 */
435
436
437 hide() {
438 this.modal.dispatchEvent(this.events.onHide);
439 this.modal.style.display = "none";
440 return this;
441 }
442 /*
443 * Prompter.removeEvents() :
444 *
445 * Removes the events (by cloning the modal)
446 */
447
448
449 removeEvents() {
450 var clone = this.modal.cloneNode(true);
451 this.modal.parentNode.replaceChild(clone, this.modal);
452 this.modal = clone;
453 return this;
454 }
455 /*
456 * Prompter.on(event, callback):
457 *
458 * Connect an event.
459 *
460 * event:
461 * - 'onShow': Called when the modal is shown (via Prompter.show() or a bound button)
462 * - 'onConfirm': Called when the modal when the user sends the data (via the element with the class '.confirm')
463 * - 'onHide': Called when the modal is hidden (via Prompter.hide() or a bound button)
464 * callback: The function to call on the event
465 *
466 */
467
468
469 on(event, callback) {
470 this.modal.addEventListener(event, callback);
471 return this;
472 }
473 /*
474 * Prompter.attach() :
475 *
476 * Attaches the click events on the elements with classes ".confirm", ".hide", ".cancel" plus the elements to show the modal
477 */
478
479
480 attach() {
481 var i;
482 var items = [];
483 var self = this;
484 items = this.modal.querySelectorAll(self.classClose);
485
486 for (i = items.length - 1; i >= 0; i--) {
487 items[i].addEventListener('click', function () {
488 self.hide();
489 });
490 }
491
492 items = self.modal.querySelectorAll(self.classCancel);
493
494 for (i = items.length - 1; i >= 0; i--) {
495 items[i].addEventListener('click', function () {
496 self.hide();
497 });
498 }
499
500 items = self.modal.querySelectorAll(self.classConfirm);
501
502 for (i = items.length - 1; i >= 0; i--) {
503 items[i].addEventListener('click', function () {
504 self.modal.dispatchEvent(self.events.onConfirm);
505 self.hide();
506 });
507 }
508
509 for (i = self.btnsOpen.length - 1; i >= 0; i--) {
510 self.btnsOpen[i].addEventListener('click', function () {
511 self.show();
512 });
513 }
514
515 return self;
516 }
517 /*
518 * Attach an external element that will open the modal.
519 * Prompter.addOpenBtn(element)
520 *
521 * element: Any HTML element a button, div, span,...
522 */
523
524
525 addOpenBtn(element) {
526 this.btnsOpen.push(element);
527 }
528
529 }
530
531 exports.Prompter = Prompter;
532
533 /***/ }),
534
535 /***/ "../include/js/front-end/src/Components/Tooltip.js":
536 /*!*********************************************************!*\
537 !*** ../include/js/front-end/src/Components/Tooltip.js ***!
538 \*********************************************************/
539 /*! flagged exports */
540 /*! export Tooltip [provided] [no usage info] [missing usage info prevents renaming] */
541 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
542 /*! other exports [not provided] [no usage info] */
543 /*! runtime requirements: __webpack_exports__ */
544 /***/ ((__unused_webpack_module, exports) => {
545
546
547
548 Object.defineProperty(exports, "__esModule", ({
549 value: true
550 }));
551 exports.Tooltip = void 0;
552
553 /*
554 * Photonic Tooltip
555 * License: MIT
556 */
557 var Tooltip = function Tooltip(selector, tooltip_element) {
558 var tooltip, tooltipClass, elemEdges, tooltipElems; // From https://locutus.io/php/strings/strip_tags/, or https://stackoverflow.com/questions/5601903/jquery-almost-equivalent-of-phps-strip-tags/46483672#46483672
559
560 function strip_tags(input, allowed) {
561 allowed = (((allowed || '') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
562 var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;
563 var commentsAndPhpTags = /<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;
564 return input.replace(commentsAndPhpTags, '').replace(tags, function ($0, $1) {
565 return allowed.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : '';
566 });
567 }
568
569 function create(tooltip, elm) {
570 var tooltipText = elm.getAttribute('data-photonic-tooltip');
571 tooltipText = strip_tags(tooltipText, '<br><strong><em><b><i><p>');
572
573 if (tooltipText !== '') {
574 elm.setAttribute('title', ''); // Blank out the regular title
575 // elemEdges relative to the viewport.
576
577 elemEdges = elm.getBoundingClientRect();
578 var tooltipTextNode = document.createTextNode(tooltipText);
579 tooltip.innerHTML = tooltipText; // ''; // Reset, or upon refresh the node gets repeated
580 // tooltip.appendChild(tooltipTextNode);
581 // Remove no-display + set the correct classname based on the position
582 // of the elm.
583
584 if (elemEdges.left > window.innerWidth - 100) {
585 tooltip.className = 'photonic-tooltip-container tooltip-left';
586 } else if (elemEdges.left + elemEdges.width / 2 < 100) {
587 tooltip.className = 'photonic-tooltip-container tooltip-right';
588 } else {
589 tooltip.className = 'photonic-tooltip-container tooltip-center';
590 }
591 }
592 }
593
594 function position(tooltip, elm) {
595 var tooltipText = elm.getAttribute('data-photonic-tooltip');
596
597 if (tooltipText !== '') {
598 if (elemEdges === undefined) {
599 elemEdges = elm.getBoundingClientRect();
600 } // 10 = arrow height
601
602
603 var elm_top = elemEdges.top + elemEdges.height + window.scrollY;
604 var viewport_edges = window.innerWidth - 100; // Position tooltip on the left side of the elm if the elm touches
605 // the viewports right edge and elm width is < 50px.
606
607 if (elemEdges.left + window.scrollX > viewport_edges && elemEdges.width < 50) {
608 tooltip.style.left = elemEdges.left + window.scrollX - (tooltip.offsetWidth + elemEdges.width) + 'px';
609 tooltip.style.top = elm.offsetTop + 'px'; // Position tooltip on the left side of the elm if the elm touches
610 // the viewports right edge and elm width is > 50px.
611 } else if (elemEdges.left + window.scrollX > viewport_edges && elemEdges.width > 50) {
612 tooltip.style.left = elemEdges.left + window.scrollX - tooltip.offsetWidth - 20 + 'px';
613 tooltip.style.top = elm.offsetTop + 'px';
614 } else if (elemEdges.left + window.scrollX + elemEdges.width / 2 < 100) {
615 // position tooltip on the right side of the elm.
616 tooltip.style.left = elemEdges.left + window.scrollX + elemEdges.width + 20 + 'px';
617 tooltip.style.top = elm.offsetTop + 'px';
618 } else {
619 // Position the toolbox in the center of the elm.
620 var centered = elemEdges.left + window.scrollX + elemEdges.width / 2 - tooltip.offsetWidth / 2;
621 tooltip.style.left = centered + 'px';
622 tooltip.style.top = elm_top + 'px';
623 }
624 }
625 }
626
627 function show(evt) {
628 create(tooltip, evt.currentTarget);
629 position(tooltip, evt.currentTarget);
630 }
631
632 function hide(evt) {
633 tooltip.className = tooltipClass + ' no-display';
634
635 if (tooltip.innerText !== '') {
636 tooltip.removeChild(tooltip.firstChild);
637 tooltip.removeAttribute('style');
638 var element = evt.currentTarget;
639 element.setAttribute('title', element.getAttribute('data-photonic-tooltip'));
640 }
641 }
642
643 function init() {
644 tooltipElems = document.documentElement.querySelectorAll(selector);
645 tooltip = document.documentElement.querySelector(tooltip_element);
646 tooltipClass = tooltip_element.replace(/^\.+/g, '');
647
648 if (tooltip === null || tooltip.length === 0) {
649 tooltip = document.createElement('div');
650 tooltip.className = tooltipClass + ' no-display';
651 document.body.appendChild(tooltip);
652 }
653
654 tooltipElems.forEach(elm => {
655 elm.removeEventListener('mouseenter', show);
656 elm.removeEventListener('mouseleave', hide);
657 elm.addEventListener('mouseenter', show, false);
658 elm.addEventListener('mouseleave', hide, false);
659 });
660 }
661
662 init();
663 };
664
665 exports.Tooltip = Tooltip;
666
667 /***/ }),
668
669 /***/ "../include/js/front-end/src/Core.js":
670 /*!*******************************************!*\
671 !*** ../include/js/front-end/src/Core.js ***!
672 \*******************************************/
673 /*! flagged exports */
674 /*! export Core [provided] [no usage info] [missing usage info prevents renaming] */
675 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
676 /*! other exports [not provided] [no usage info] */
677 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
678 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
679
680
681
682 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
683
684 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
685
686 Object.defineProperty(exports, "__esModule", ({
687 value: true
688 }));
689 exports.Core = void 0;
690
691 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../../../../../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
692
693 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js"));
694
695 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
696
697 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
698
699 var _Prompter = __webpack_require__(/*! ./Components/Prompter */ "../include/js/front-end/src/Components/Prompter.js");
700
701 class Core {}
702
703 exports.Core = Core;
704 (0, _defineProperty2.default)(Core, "lightboxList", []);
705 (0, _defineProperty2.default)(Core, "prompterList", []);
706 (0, _defineProperty2.default)(Core, "lightbox", void 0);
707 (0, _defineProperty2.default)(Core, "deep", location.hash);
708 (0, _defineProperty2.default)(Core, "setLightbox", lb => Core.lightbox = lb);
709 (0, _defineProperty2.default)(Core, "getLightbox", () => Core.lightbox);
710 (0, _defineProperty2.default)(Core, "setDeep", d => Core.deep = d);
711 (0, _defineProperty2.default)(Core, "getDeep", () => Core.deep);
712 (0, _defineProperty2.default)(Core, "addToLightboxList", (idx, lightbox) => Core.lightboxList[idx] = lightbox);
713 (0, _defineProperty2.default)(Core, "getLightboxList", () => Core.lightboxList);
714 (0, _defineProperty2.default)(Core, "showSpinner", () => {
715 var loading = document.getElementsByClassName('photonic-loading');
716
717 if (loading.length > 0) {
718 loading = loading[0];
719 } else {
720 loading = document.createElement('div');
721 loading.className = 'photonic-loading';
722 }
723
724 loading.style.display = 'block';
725 document.body.appendChild(loading);
726 });
727 (0, _defineProperty2.default)(Core, "hideLoading", () => {
728 var loading = document.getElementsByClassName('photonic-loading');
729
730 if (loading.length > 0) {
731 loading = loading[0];
732 loading.style.display = 'none';
733 }
734 });
735 (0, _defineProperty2.default)(Core, "initializePasswordPrompter", selector => {
736 var selectorNoHash = selector.replace(/^#+/g, '');
737 var prompter = new _Prompter.Prompter(selectorNoHash);
738 prompter.attach();
739 Core.prompterList[selector] = prompter;
740 prompter.show();
741 });
742 (0, _defineProperty2.default)(Core, "moveHTML5External", () => {
743 var videos = document.getElementById('photonic-html5-external-videos');
744
745 if (!videos) {
746 videos = document.createElement('div');
747 videos.id = 'photonic-html5-external-videos';
748 videos.style.display = 'none';
749 document.body.appendChild(videos);
750 }
751
752 var current = document.querySelectorAll('.photonic-html5-external');
753
754 if (current) {
755 var cLen = current.length;
756
757 for (var c = 0; c < cLen; c++) {
758 current[c].classList.remove('photonic-html5-external');
759 videos.appendChild(current[c]);
760 }
761 }
762 });
763 (0, _defineProperty2.default)(Core, "blankSlideupTitle", () => {
764 document.querySelectorAll('.title-display-slideup-stick, .photonic-slideshow.title-display-slideup-stick').forEach(item => {
765 Array.from(item.getElementsByTagName('a')).forEach(a => {
766 a.setAttribute('title', '');
767 });
768 });
769 });
770 (0, _defineProperty2.default)(Core, "showSlideupTitle", () => {
771 var titles = document.documentElement.querySelectorAll('.title-display-slideup-stick a .photonic-title');
772 var len = titles.length;
773
774 for (var i = 0; i < len; i++) {
775 titles[i].style.display = 'block';
776 }
777 });
778 (0, _defineProperty2.default)(Core, "waitForImages", /*#__PURE__*/function () {
779 var _ref = (0, _asyncToGenerator2.default)(function* (selector) {
780 var images = Core.getImagesFromSelector(selector);
781 var imageUrlArray = [];
782 var anchorArray = [];
783 var setDimensions = false;
784
785 if (selector instanceof Element && selector.getAttribute('data-photonic-platform') === 'instagram') {
786 setDimensions = true;
787 }
788
789 images.forEach(img => {
790 imageUrlArray.push(img.getAttribute('src'));
791 anchorArray.push(img.parentElement);
792 });
793 var promiseArray = []; // create an array for promises
794
795 var imageArray = []; // array for the images
796
797 var _loop = function _loop(idx, imageUrl) {
798 promiseArray.push(new Promise(resolve => {
799 var img = new Image();
800
801 img.onload = () => {
802 if (setDimensions) {
803 anchorArray[idx].setAttribute('data-pswp-width', img.naturalWidth);
804 anchorArray[idx].setAttribute('data-pswp-height', img.naturalHeight);
805 }
806
807 resolve();
808 };
809
810 img.src = imageUrl;
811 imageArray.push(img);
812 }));
813 };
814
815 for (var [idx, imageUrl] of imageUrlArray.entries()) {
816 _loop(idx, imageUrl);
817 }
818
819 yield Promise.all(promiseArray); // wait for all the images to be loaded
820
821 return imageArray;
822 });
823
824 return function (_x) {
825 return _ref.apply(this, arguments);
826 };
827 }());
828 (0, _defineProperty2.default)(Core, "loadSingleImage", /*#__PURE__*/function () {
829 var _ref2 = (0, _asyncToGenerator2.default)(function* (image) {
830 var promiseArray = [];
831 var retImage = null;
832 promiseArray.push(new Promise(resolve => {
833 var img = new Image();
834
835 img.onload = () => {
836 resolve();
837 };
838
839 if (image.getAttribute('data-src') !== null) {
840 img.src = image.getAttribute('data-src');
841 } else {
842 img.src = image.getAttribute('src'); // Leave the 'src' in just as a backup. E.g. Gallery header images
843 }
844
845 retImage = img;
846 }));
847 yield Promise.all(promiseArray);
848 return retImage;
849 });
850
851 return function (_x2) {
852 return _ref2.apply(this, arguments);
853 };
854 }());
855 (0, _defineProperty2.default)(Core, "watchForImages", selector => {
856 var images = Core.getImagesFromSelector(selector);
857 var intersectionObserver = new IntersectionObserver((items, observer) => {
858 items.forEach(item => {
859 if (item.isIntersecting || item.intersectionRatio > 0) {
860 var image = item.target;
861 image.closest('a').classList.add('photonic-image-loading');
862 Core.loadSingleImage(image).then(() => {
863 if (image.getAttribute('data-src') !== null && image.getAttribute('data-src') !== '') {
864 image.src = image.getAttribute('data-src');
865 image.setAttribute('data-src', '');
866 image.setAttribute('data-loaded', 'true');
867 }
868
869 image.closest('a').classList.remove('photonic-image-loading');
870 Util.fadeIn(image);
871 });
872 observer.unobserve(image);
873 }
874 });
875 });
876 images.forEach(image => {
877 intersectionObserver.observe(image);
878 });
879 });
880 (0, _defineProperty2.default)(Core, "getImagesFromSelector", selector => {
881 var images = [];
882
883 if (typeof selector === 'string') {
884 document.querySelectorAll(selector).forEach(selection => {
885 images = Array.from(selection.getElementsByTagName('img'));
886 });
887 } else if (selector instanceof Element) {
888 images = Array.from(selector.getElementsByTagName('img'));
889 } else if (selector instanceof NodeList) {
890 selector.forEach(selection => {
891 images.push(selection.querySelector('img'));
892 });
893 }
894
895 return images;
896 });
897 (0, _defineProperty2.default)(Core, "standardizeTitleWidths", () => {
898 var self = Core;
899
900 var setWidths = grid => {
901 grid.querySelectorAll('.photonic-thumb').forEach(item => {
902 var img = item.getElementsByTagName('img');
903
904 if (img != null) {
905 img = img[0];
906 var title = item.querySelector('.photonic-title-info');
907
908 if (title) {
909 title.style.width = img.width + 'px';
910 }
911 }
912 });
913 };
914
915 document.querySelectorAll('.photonic-standard-layout.title-display-below, .photonic-standard-layout.title-display-hover-slideup-show, .photonic-standard-layout.title-display-slideup-stick').forEach(grid => {
916 if (grid.classList.contains('sizes-present')) {
917 self.watchForImages(grid);
918 setWidths(grid);
919 } else {
920 self.waitForImages(grid).then(() => {
921 setWidths(grid);
922 });
923 }
924 });
925 });
926 (0, _defineProperty2.default)(Core, "sanitizeTitles", () => {
927 var thumbs = document.querySelectorAll('.photonic-stream a, a.photonic-level-2-thumb');
928 thumbs.forEach(thumb => {
929 if (!thumb.parentNode.classList.contains('photonic-header-title')) {
930 var title = thumb.getAttribute('title'); // Not doing innerHTML, which is susceptible to XSS
931
932 thumb.setAttribute('title', Util.getText(title));
933 var dataTitle = thumb.getAttribute('data-title');
934 thumb.setAttribute('data-title', Util.HTMLSanitizer.SanitizeHTML(dataTitle));
935 }
936 });
937 });
938 (0, _defineProperty2.default)(Core, "initializeTooltips", () => {
939 if (document.querySelector('.title-display-tooltip a, .photonic-slideshow.title-display-tooltip img') != null) {
940 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
941 }
942 });
943 (0, _defineProperty2.default)(Core, "showRegularGrids", () => {
944 document.querySelectorAll('.photonic-standard-layout').forEach(grid => {
945 if (grid.classList.contains('sizes-present')) {
946 Core.watchForImages(grid);
947 } else {
948 Core.waitForImages(grid).then(() => {
949 grid.querySelectorAll('.photonic-level-1, .photonic-level-2').forEach(item => {
950 item.style.display = 'inline-block';
951 });
952 });
953 }
954 });
955 });
956 (0, _defineProperty2.default)(Core, "executeCommon", () => {
957 Core.moveHTML5External();
958 Core.blankSlideupTitle();
959 Core.standardizeTitleWidths();
960 Core.sanitizeTitles();
961 Core.initializeTooltips();
962 Core.showRegularGrids();
963 });
964
965 /***/ }),
966
967 /***/ "../include/js/front-end/src/Layouts/Justified.js":
968 /*!********************************************************!*\
969 !*** ../include/js/front-end/src/Layouts/Justified.js ***!
970 \********************************************************/
971 /*! flagged exports */
972 /*! export JustifiedGrid [provided] [no usage info] [missing usage info prevents renaming] */
973 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
974 /*! other exports [not provided] [no usage info] */
975 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
976 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
977
978
979
980 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
981
982 Object.defineProperty(exports, "__esModule", ({
983 value: true
984 }));
985 exports.JustifiedGrid = void 0;
986
987 var _Core = __webpack_require__(/*! ../Core.js */ "../include/js/front-end/src/Core.js");
988
989 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util.js */ "../include/js/front-end/src/Util.js"));
990
991 /**
992 * Photonic Justified Grid Layout (JS-based)
993 * Photonic can render a justified grid using CSS or JS. The CSS layout is the default. The JS one is used when the sizes of the images are not available upfront.
994 * The CSS layout renders quicker, but the JS layouts are a lot prettier.
995 *
996 * License: GPL v3.0
997 */
998 var linearMin = arr => {
999 var computed, result, x, _i, _len;
1000
1001 for (_i = 0, _len = arr.length; _i < _len; _i++) {
1002 x = arr[_i];
1003 computed = x[0];
1004
1005 if (!result || computed < result.computed) {
1006 result = {
1007 value: x,
1008 computed: computed
1009 };
1010 }
1011 }
1012
1013 return result.value;
1014 };
1015
1016 var linearPartition = (seq, k) => {
1017 var ans, i, j, m, n, solution, table, x, y, _i, _j, _k, _l;
1018
1019 n = seq.length;
1020
1021 if (k <= 0) {
1022 return [];
1023 }
1024
1025 if (k > n) {
1026 return seq.map(x => [x]);
1027 }
1028
1029 table = (() => {
1030 var _i, _results;
1031
1032 _results = [];
1033
1034 for (y = _i = 0; 0 <= n ? _i < n : _i > n; y = 0 <= n ? ++_i : --_i) {
1035 _results.push(function () {
1036 var _j, _results1;
1037
1038 _results1 = [];
1039
1040 for (x = _j = 0; 0 <= k ? _j < k : _j > k; x = 0 <= k ? ++_j : --_j) {
1041 _results1.push(0);
1042 }
1043
1044 return _results1;
1045 }());
1046 }
1047
1048 return _results;
1049 })();
1050
1051 solution = (() => {
1052 var _i, _ref, _results;
1053
1054 _results = [];
1055
1056 for (y = _i = 0, _ref = n - 1; 0 <= _ref ? _i < _ref : _i > _ref; y = 0 <= _ref ? ++_i : --_i) {
1057 _results.push(function () {
1058 var _j, _ref1, _results1;
1059
1060 _results1 = [];
1061
1062 for (x = _j = 0, _ref1 = k - 1; 0 <= _ref1 ? _j < _ref1 : _j > _ref1; x = 0 <= _ref1 ? ++_j : --_j) {
1063 _results1.push(0);
1064 }
1065
1066 return _results1;
1067 }());
1068 }
1069
1070 return _results;
1071 })();
1072
1073 for (i = _i = 0; 0 <= n ? _i < n : _i > n; i = 0 <= n ? ++_i : --_i) {
1074 table[i][0] = seq[i] + (i ? table[i - 1][0] : 0);
1075 }
1076
1077 for (j = _j = 0; 0 <= k ? _j < k : _j > k; j = 0 <= k ? ++_j : --_j) {
1078 table[0][j] = seq[0];
1079 }
1080
1081 for (i = _k = 1; 1 <= n ? _k < n : _k > n; i = 1 <= n ? ++_k : --_k) {
1082 for (j = _l = 1; 1 <= k ? _l < k : _l > k; j = 1 <= k ? ++_l : --_l) {
1083 m = linearMin((() => {
1084 var _m, _results;
1085
1086 _results = [];
1087
1088 for (x = _m = 0; 0 <= i ? _m < i : _m > i; x = 0 <= i ? ++_m : --_m) {
1089 _results.push([Math.max(table[x][j - 1], table[i][0] - table[x][0]), x]);
1090 }
1091
1092 return _results;
1093 })());
1094 table[i][j] = m[0];
1095 solution[i - 1][j - 1] = m[1];
1096 }
1097 }
1098
1099 n = n - 1;
1100 k = k - 2;
1101 ans = [];
1102
1103 while (k >= 0) {
1104 ans = [(() => {
1105 var _m, _ref, _ref1, _results;
1106
1107 _results = [];
1108
1109 for (i = _m = _ref = solution[n - 1][k] + 1, _ref1 = n + 1; _ref <= _ref1 ? _m < _ref1 : _m > _ref1; i = _ref <= _ref1 ? ++_m : --_m) {
1110 _results.push(seq[i]);
1111 }
1112
1113 return _results;
1114 })()].concat(ans);
1115 n = solution[n - 1][k];
1116 k = k - 1;
1117 }
1118
1119 return [(() => {
1120 var _m, _ref, _results;
1121
1122 _results = [];
1123
1124 for (i = _m = 0, _ref = n + 1; 0 <= _ref ? _m < _ref : _m > _ref; i = 0 <= _ref ? ++_m : --_m) {
1125 _results.push(seq[i]);
1126 }
1127
1128 return _results;
1129 })()].concat(ans);
1130 };
1131
1132 function part(seq, k) {
1133 if (k <= 0) {
1134 return [];
1135 }
1136
1137 while (k) {
1138 try {
1139 return linearPartition(seq, k--);
1140 } catch (_error) {//
1141 }
1142 }
1143 }
1144
1145 var JustifiedGrid = (resized, jsLoaded, selector, lightbox) => {
1146 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Justified Grid');
1147 var selection = document.querySelectorAll(selector);
1148
1149 if (selector == null || selection.length === 0) {
1150 selection = document.querySelectorAll('.photonic-random-layout');
1151 }
1152
1153 if (!resized && selection.length > 0) {
1154 _Core.Core.showSpinner();
1155 }
1156
1157 var setupTitles = () => {
1158 _Core.Core.blankSlideupTitle();
1159
1160 _Core.Core.showSlideupTitle();
1161
1162 if (!resized && !jsLoaded) {
1163 _Core.Core.hideLoading();
1164 }
1165 };
1166
1167 selection.forEach(container => {
1168 // If there are some nodes for which the sizes are missing, play safe and run this in JS mode.
1169 // Otherwise render the gallery using CSS, and just display the images once they have downloaded.
1170 if (container.classList.contains('sizes-missing') || !window.CSS || !CSS.supports('color', 'var(--fake-var)')) {
1171 var viewportWidth = Math.floor(container.getBoundingClientRect().width),
1172 windowHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0),
1173 idealHeight = Math.max(parseInt(windowHeight / 4), Photonic_JS.tile_min_height);
1174 var gap = Photonic_JS.tile_spacing * 2;
1175
1176 _Core.Core.waitForImages(container).then(() => {
1177 var photos = [],
1178 images = Array.from(container.getElementsByTagName('img'));
1179 images.forEach(image => {
1180 if (image.closest('.photonic-panel') !== null) {
1181 return;
1182 }
1183
1184 var div = image.parentNode.parentNode;
1185
1186 if (!(image.naturalHeight === 0 || image.naturalHeight === undefined || image.naturalWidth === undefined)) {
1187 photos.push({
1188 tile: div,
1189 aspect_ratio: image.naturalWidth / image.naturalHeight
1190 });
1191 }
1192 });
1193 var summedWidth = photos.reduce((sum, p) => sum += p.aspect_ratio * idealHeight + gap, 0);
1194 var rows = Math.max(Math.round(summedWidth / viewportWidth), 1),
1195 // At least 1 row should be shown
1196 weights = photos.map(p => Math.round(p.aspect_ratio * 100));
1197 var partition = part(weights, rows);
1198 var index = 0;
1199 var oLen = partition.length;
1200
1201 for (var o = 0; o < oLen; o++) {
1202 var onePart = partition[o];
1203 var summedRatios = void 0;
1204 var rowBuffer = photos.slice(index, index + onePart.length);
1205 index = index + onePart.length;
1206 summedRatios = rowBuffer.reduce((sum, p) => sum += p.aspect_ratio, 0);
1207 var rLen = rowBuffer.length;
1208
1209 for (var r = 0; r < rLen; r++) {
1210 var item = rowBuffer[r],
1211 existing = item.tile;
1212 existing.style.width = parseInt(viewportWidth / summedRatios * item.aspect_ratio) + "px";
1213 existing.style.height = parseInt(viewportWidth / summedRatios) + "px";
1214 }
1215 }
1216
1217 container.querySelectorAll('.photonic-thumb, .photonic-thumb img').forEach(thumb => Util.fadeIn(thumb));
1218 setupTitles();
1219 });
1220 } else {
1221 _Core.Core.watchForImages(container);
1222
1223 setupTitles();
1224 }
1225
1226 if (lightbox && !resized) {
1227 if (Photonic_JS.lightbox_library === 'lightcase') {
1228 lightbox.initialize('.photonic-random-layout');
1229 } else if (['bigpicture', 'featherlight', 'glightbox'].indexOf(Photonic_JS.lightbox_library) > -1) {
1230 lightbox.initialize(container);
1231 } else if (Photonic_JS.lightbox_library === 'fancybox3') {
1232 lightbox.initialize('.photonic-random-layout');
1233 } else if (Photonic_JS.lightbox_library === 'photoswipe') {
1234 lightbox.initialize();
1235 }
1236 }
1237 });
1238 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Justified Grid');
1239 };
1240
1241 exports.JustifiedGrid = JustifiedGrid;
1242
1243 /***/ }),
1244
1245 /***/ "../include/js/front-end/src/Layouts/Layout.js":
1246 /*!*****************************************************!*\
1247 !*** ../include/js/front-end/src/Layouts/Layout.js ***!
1248 \*****************************************************/
1249 /*! flagged exports */
1250 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1251 /*! export initializeLayouts [provided] [no usage info] [missing usage info prevents renaming] */
1252 /*! other exports [not provided] [no usage info] */
1253 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1254 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1255
1256
1257
1258 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1259
1260 Object.defineProperty(exports, "__esModule", ({
1261 value: true
1262 }));
1263 exports.initializeLayouts = void 0;
1264
1265 var _Justified = __webpack_require__(/*! ./Justified */ "../include/js/front-end/src/Layouts/Justified.js");
1266
1267 var _Mosaic = __webpack_require__(/*! ./Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
1268
1269 var _Masonry = __webpack_require__(/*! ./Masonry */ "../include/js/front-end/src/Layouts/Masonry.js");
1270
1271 var _MasonryHorizontal = __webpack_require__(/*! ./MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
1272
1273 var Slider = _interopRequireWildcard(__webpack_require__(/*! ./Slider */ "../include/js/front-end/src/Layouts/Slider.js"));
1274
1275 var initializeLayouts = lightbox => {
1276 (0, _Justified.JustifiedGrid)(false, false, null, lightbox);
1277 (0, _Mosaic.Mosaic)(false, false);
1278 (0, _Masonry.Masonry)(false, false);
1279 (0, _MasonryHorizontal.MasonryHorizontal)(false, false);
1280 Slider.initializeSliders();
1281 window.addEventListener('resize', () => {
1282 (0, _Justified.JustifiedGrid)(true, false, '.photonic-random-layout.sizes-missing');
1283 (0, _Mosaic.Mosaic)(true, false);
1284 (0, _Masonry.Masonry)(true, false);
1285 (0, _MasonryHorizontal.MasonryHorizontal)(true, false);
1286 });
1287 };
1288
1289 exports.initializeLayouts = initializeLayouts;
1290
1291 /***/ }),
1292
1293 /***/ "../include/js/front-end/src/Layouts/Masonry.js":
1294 /*!******************************************************!*\
1295 !*** ../include/js/front-end/src/Layouts/Masonry.js ***!
1296 \******************************************************/
1297 /*! flagged exports */
1298 /*! export Masonry [provided] [no usage info] [missing usage info prevents renaming] */
1299 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1300 /*! other exports [not provided] [no usage info] */
1301 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1302 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1303
1304
1305
1306 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1307
1308 Object.defineProperty(exports, "__esModule", ({
1309 value: true
1310 }));
1311 exports.Masonry = void 0;
1312
1313 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1314
1315 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1316
1317 /**
1318 * Photonic Masonry Layout
1319 * The Masonry layout is primarily controlled using CSS columns. The JS component is to facilitate responsive behaviour and breakpoints.
1320 *
1321 * License: GPL v3.0
1322 */
1323 var Masonry = (resized, jsLoaded, selector) => {
1324 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Masonry');
1325 var selection = document.querySelectorAll(selector);
1326
1327 if (selector == null || selection.length === 0) {
1328 selection = document.querySelectorAll('.photonic-masonry-layout');
1329 }
1330
1331 if (!resized && selection.length > 0) {
1332 _Core.Core.showSpinner();
1333 }
1334
1335 var minWidth = isNaN(Photonic_JS.masonry_min_width) || parseInt(Photonic_JS.masonry_min_width) <= 0 ? 200 : Photonic_JS.masonry_min_width;
1336 minWidth = parseInt(minWidth);
1337 selection.forEach(grid => {
1338 var columns = grid.getAttribute('data-photonic-gallery-columns');
1339 columns = isNaN(parseInt(columns)) || parseInt(columns) <= 0 ? 3 : parseInt(columns);
1340
1341 var buildLayout = (grid, fadeIn) => {
1342 var viewportWidth = Math.floor(grid.getBoundingClientRect().width),
1343 idealColumns = viewportWidth / columns > minWidth ? columns : Math.floor(viewportWidth / minWidth);
1344
1345 if (idealColumns !== undefined && idealColumns !== null) {
1346 grid.style.columnCount = idealColumns.toString();
1347 }
1348
1349 if (fadeIn) {
1350 Array.from(grid.getElementsByTagName('img')).forEach(img => {
1351 Util.fadeIn(img);
1352 });
1353 }
1354
1355 _Core.Core.showSlideupTitle();
1356
1357 if (!resized && !jsLoaded) {
1358 _Core.Core.hideLoading();
1359 }
1360 };
1361
1362 if (grid.classList.contains('sizes-present')) {
1363 _Core.Core.watchForImages(grid);
1364
1365 buildLayout(grid, false);
1366 } else {
1367 _Core.Core.waitForImages(grid).then(() => {
1368 buildLayout(grid, true);
1369 });
1370 }
1371 });
1372 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Masonry');
1373 };
1374
1375 exports.Masonry = Masonry;
1376
1377 /***/ }),
1378
1379 /***/ "../include/js/front-end/src/Layouts/MasonryHorizontal.js":
1380 /*!****************************************************************!*\
1381 !*** ../include/js/front-end/src/Layouts/MasonryHorizontal.js ***!
1382 \****************************************************************/
1383 /*! flagged exports */
1384 /*! export MasonryHorizontal [provided] [no usage info] [missing usage info prevents renaming] */
1385 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1386 /*! other exports [not provided] [no usage info] */
1387 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1388 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1389
1390
1391
1392 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1393
1394 Object.defineProperty(exports, "__esModule", ({
1395 value: true
1396 }));
1397 exports.MasonryHorizontal = void 0;
1398
1399 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1400
1401 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1402
1403 /**
1404 * Photonic Masonry Layout
1405 * The Masonry layout is primarily controlled using CSS columns. The JS component is to facilitate responsive behaviour and breakpoints.
1406 *
1407 * License: GPL v3.0
1408 */
1409 var MasonryHorizontal = (resized, jsLoaded, selector) => {
1410 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Horizontal Masonry');
1411 var selection = document.querySelectorAll(selector);
1412
1413 if (selector == null || selection.length === 0) {
1414 selection = document.querySelectorAll('.photonic-masonry-horizontal-layout');
1415 }
1416
1417 if (!resized && selection.length > 0) {
1418 _Core.Core.showSpinner();
1419 }
1420
1421 var minWidth = isNaN(Photonic_JS.masonry_min_width) || parseInt(Photonic_JS.masonry_min_width) <= 0 ? 200 : Photonic_JS.masonry_min_width;
1422 minWidth = parseInt(minWidth);
1423 selection.forEach(grid => {
1424 var columns = grid.getAttribute('data-photonic-gallery-columns');
1425 columns = isNaN(parseInt(columns)) || parseInt(columns) <= 0 ? 3 : parseInt(columns);
1426
1427 var buildLayout = (grid, fadeIn) => {
1428 var figures = grid.querySelectorAll('figure');
1429 var inputFigures = [],
1430 outputFigures = [];
1431 figures.forEach(figure => {
1432 inputFigures[figure.getAttribute('data-photonic-idx')] = figure;
1433 });
1434 var viewportWidth = Math.floor(grid.getBoundingClientRect().width),
1435 idealColumns = viewportWidth / columns > minWidth ? columns : Math.floor(viewportWidth / minWidth);
1436
1437 if (idealColumns !== undefined && idealColumns !== null) {
1438 grid.style.columnCount = idealColumns.toString();
1439 var col = 0;
1440
1441 while (col < idealColumns) {
1442 for (var idx = 0; idx < inputFigures.length; idx += idealColumns) {
1443 var _val = inputFigures[idx + col];
1444
1445 if (_val !== undefined) {
1446 outputFigures.push(_val);
1447 }
1448 }
1449
1450 col++;
1451 }
1452
1453 if (outputFigures.length === inputFigures.length) {
1454 var fragment = document.createDocumentFragment();
1455 outputFigures.forEach(figure => {
1456 grid.appendChild(figure);
1457 });
1458 }
1459 }
1460
1461 if (fadeIn) {
1462 Array.from(grid.getElementsByTagName('img')).forEach(img => {
1463 Util.fadeIn(img);
1464 });
1465 }
1466
1467 _Core.Core.showSlideupTitle();
1468
1469 if (!resized && !jsLoaded) {
1470 _Core.Core.hideLoading();
1471 }
1472 };
1473
1474 if (grid.classList.contains('sizes-present')) {
1475 _Core.Core.watchForImages(grid);
1476
1477 buildLayout(grid, !resized);
1478 } else {
1479 _Core.Core.waitForImages(grid).then(() => {
1480 buildLayout(grid, true);
1481 });
1482 }
1483 });
1484 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Horizontal Masonry');
1485 };
1486
1487 exports.MasonryHorizontal = MasonryHorizontal;
1488
1489 /***/ }),
1490
1491 /***/ "../include/js/front-end/src/Layouts/Mosaic.js":
1492 /*!*****************************************************!*\
1493 !*** ../include/js/front-end/src/Layouts/Mosaic.js ***!
1494 \*****************************************************/
1495 /*! flagged exports */
1496 /*! export Mosaic [provided] [no usage info] [missing usage info prevents renaming] */
1497 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1498 /*! other exports [not provided] [no usage info] */
1499 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1500 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1501
1502
1503
1504 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
1505
1506 Object.defineProperty(exports, "__esModule", ({
1507 value: true
1508 }));
1509 exports.Mosaic = void 0;
1510
1511 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1512
1513 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
1514
1515 /**
1516 * Photonic Mosaic Layout
1517 * Arranges photos similar to JetPack tiles, but without any of the limitations of JetPack tiles. JS-based, responsive, and images are not affected by resolution issues.
1518 *
1519 * License: GPL V3.0
1520 */
1521 var getDistribution = (setSize, max, min) => {
1522 var distribution = [];
1523 var processed = 0;
1524
1525 while (processed < setSize) {
1526 if (setSize - processed <= max && processed > 0) {
1527 distribution.push(setSize - processed);
1528 processed += setSize - processed;
1529 } else {
1530 var current = Math.max(Math.floor(Math.random() * max + 1), min);
1531 current = Math.min(current, setSize - processed);
1532 distribution.push(current);
1533 processed += current;
1534 }
1535 }
1536
1537 return distribution;
1538 };
1539
1540 var arrayAlternate = (array, remainder) => array.filter((value, index) => index % 2 === remainder);
1541
1542 var setUniformHeightsForRow = array => {
1543 // First, order the array by increasing height
1544 array.sort((a, b) => a.height - b.height);
1545 array[0].new_height = array[0].height;
1546 array[0].new_width = array[0].width;
1547
1548 for (var i = 1; i < array.length; i++) {
1549 array[i].new_height = array[0].height;
1550 array[i].new_width = array[i].new_height * array[i].aspect_ratio;
1551 }
1552
1553 var new_width = array.reduce((sum, p) => sum += p.new_width, 0);
1554 return {
1555 elements: array,
1556 height: array[0].new_height,
1557 width: new_width,
1558 aspect_ratio: new_width / array[0].new_height
1559 };
1560 };
1561
1562 var finalizeTiledLayout = (components, containers) => {
1563 var cLength = components.length;
1564
1565 for (var c = 0; c < cLength; c++) {
1566 var component = components[c];
1567 var rowY = component.y,
1568 otherRowHeight = 0,
1569 container = void 0;
1570 var ceLen = component.elements.length;
1571
1572 for (var e = 0; e < ceLen; e++) {
1573 var element = component.elements[e];
1574
1575 if (element.photo_position !== undefined) {
1576 // Component is a single image
1577 container = containers[element.photo_position];
1578 container.style.width = component.new_width + 'px';
1579 container.style.height = component.new_height + 'px';
1580 container.style.top = component.y + 'px';
1581 container.style.left = component.x + 'px';
1582 } else {
1583 // Component is a clique (element is a row). Widths and Heights of cliques have been calculated. But the rows in cliques need to be recalculated
1584 element.new_width = component.new_width;
1585
1586 if (otherRowHeight === 0) {
1587 element.new_height = element.new_width / element.aspect_ratio;
1588 otherRowHeight = element.new_height;
1589 } else {
1590 element.new_height = component.new_height - otherRowHeight;
1591 }
1592
1593 element.x = component.x;
1594 element.y = rowY;
1595 rowY += element.new_height;
1596 var totalWidth = element.elements.reduce((sum, p) => sum += p.new_width, 0);
1597 var rowX = 0;
1598 var eLength = element.elements.length;
1599
1600 for (var i = 0; i < eLength; i++) {
1601 var image = element.elements[i];
1602 image.new_width = element.new_width * image.new_width / totalWidth;
1603 image.new_height = element.new_height; //image.new_width / image.aspect_ratio;
1604
1605 image.x = rowX;
1606 rowX += image.new_width;
1607 container = containers[image.photo_position];
1608 container.style.width = Math.floor(image.new_width) + 'px';
1609 container.style.height = Math.floor(image.new_height) + 'px';
1610 container.style.top = Math.floor(element.y) + 'px';
1611 container.style.left = Math.floor(element.x + image.x) + 'px';
1612 }
1613 }
1614 }
1615 }
1616 };
1617
1618 var doImageLayout = (grid, needToWait) => {
1619 var viewportWidth = Math.floor(grid.getBoundingClientRect().width),
1620 triggerWidth = isNaN(Photonic_JS.mosaic_trigger_width) || parseInt(Photonic_JS.mosaic_trigger_width) <= 0 ? 200 : parseInt(Photonic_JS.mosaic_trigger_width),
1621 maxInRow = Math.floor(viewportWidth / triggerWidth),
1622 minInRow = viewportWidth >= triggerWidth * 2 ? 2 : 1,
1623 photos = [];
1624 var setSize;
1625 var containers = [],
1626 images = Array.from(grid.getElementsByTagName('img'));
1627 images.forEach((image, position) => {
1628 if (image.closest('.photonic-panel') != null) {
1629 return;
1630 }
1631
1632 var a = image.parentNode;
1633 var div = a.parentNode;
1634 div.setAttribute('data-photonic-photo-index', position);
1635 containers[position] = div;
1636 var height = needToWait ? image.naturalHeight : image.getAttribute('height'),
1637 width = needToWait ? image.naturalWidth : image.getAttribute('width');
1638
1639 if (!(height === 0 || height === undefined || width === undefined)) {
1640 var aspectRatio = width / height;
1641 photos.push({
1642 src: image.src,
1643 width: width,
1644 height: height,
1645 aspect_ratio: aspectRatio,
1646 photo_position: position
1647 });
1648 }
1649 });
1650 setSize = photos.length;
1651 var distribution = getDistribution(setSize, maxInRow, minInRow); // We got our random distribution. Let's divide the photos up according to the distribution.
1652
1653 var groups = [],
1654 startIdx = 0;
1655 distribution.forEach(size => {
1656 groups.push(photos.slice(startIdx, startIdx + size));
1657 startIdx += size;
1658 });
1659 var groupY = 0; // We now have our groups of photos. We need to find the optimal layout for each group.
1660
1661 groups.forEach(group => {
1662 // First, order the group by aspect ratio
1663 group.sort((a, b) => a.aspect_ratio - b.aspect_ratio); // Next, pick a random layout
1664
1665 var groupLayout;
1666
1667 if (group.length === 1) {
1668 groupLayout = [1];
1669 } else if (group.length === 2) {
1670 groupLayout = [1, 1];
1671 } else {
1672 groupLayout = getDistribution(group.length, group.length - 1, 1);
1673 } // Now, LAYOUT, BABY!!!
1674
1675
1676 var cliqueF = 0,
1677 cliqueL = group.length - 1,
1678 cliques = [],
1679 indices = [];
1680
1681 for (var i = 2; i <= maxInRow; i++) {
1682 var index = groupLayout.indexOf(i);
1683
1684 while (-1 < index && cliqueF < cliqueL) {
1685 // Ideal Layout: one landscape, one portrait. But we will take any 2 with contrasting aspect ratios
1686 var clique = [],
1687 j = 0;
1688
1689 while (j < i && cliqueF <= cliqueL) {
1690 clique.push(group[cliqueF++]); // One with a low aspect ratio
1691
1692 j++;
1693
1694 if (j < i && cliqueF <= cliqueL) {
1695 clique.push(group[cliqueL--]); // One with a high aspect ratio
1696
1697 j++;
1698 }
1699 } // Clique is formed. Add it to the list of cliques.
1700
1701
1702 cliques.push(clique);
1703 indices.push(index); // Keep track of the position of the clique in the row
1704
1705 index = groupLayout.indexOf(i, index + 1);
1706 }
1707 } // The ones that are not in any clique (i.e. the ones in the middle) will be given their own columns in the row.
1708
1709
1710 var remainder = group.slice(cliqueF, cliqueL + 1); // Now let's layout the cliques individually. Each clique is its own column.
1711
1712 var rowLayout = [];
1713 cliques.forEach((clique, cliqueIdx) => {
1714 var toss = Math.floor(Math.random() * 2); // 0 --> Groups of smallest and largest, or 1 --> Alternating
1715
1716 var oneRow, otherRow;
1717
1718 if (toss === 0) {
1719 // Group the ones with the lowest aspect ratio together, and the ones with the highest aspect ratio together.
1720 // Lay one group at the top and the other at the bottom
1721 var wide = Math.max(Math.floor(Math.random() * (clique.length / 2 - 1)), 1);
1722 oneRow = clique.slice(0, wide);
1723 otherRow = clique.slice(wide);
1724 } else {
1725 // Group alternates together.
1726 // Lay one group at the top and the other at the bottom
1727 oneRow = arrayAlternate(clique, 0);
1728 otherRow = arrayAlternate(clique, 1);
1729 } // Make heights consistent within rows:
1730
1731
1732 oneRow = setUniformHeightsForRow(oneRow);
1733 otherRow = setUniformHeightsForRow(otherRow); // Now make widths consistent
1734
1735 oneRow.new_width = Math.min(oneRow.width, otherRow.width);
1736 oneRow.new_height = oneRow.new_width / oneRow.aspect_ratio;
1737 otherRow.new_width = oneRow.new_width;
1738 otherRow.new_height = otherRow.new_width / otherRow.aspect_ratio;
1739 rowLayout.push({
1740 elements: [oneRow, otherRow],
1741 height: oneRow.new_height + otherRow.new_height,
1742 width: oneRow.new_width,
1743 aspect_ratio: oneRow.new_width / (oneRow.new_height + otherRow.new_height),
1744 element_position: indices[cliqueIdx]
1745 });
1746 });
1747 rowLayout.sort((a, b) => a.element_position - b.element_position);
1748 var orderedRowLayout = [];
1749
1750 for (var position = 0; position < groupLayout.length; position++) {
1751 var cliqueExists = indices.indexOf(position) > -1;
1752
1753 if (cliqueExists) {
1754 orderedRowLayout.push(rowLayout.shift());
1755 } else {
1756 var rem = remainder.shift();
1757 orderedRowLayout.push({
1758 elements: [rem],
1759 height: rem.height,
1760 width: rem.width,
1761 aspect_ratio: rem.aspect_ratio
1762 });
1763 }
1764 } // Main Row layout is fully constructed and ordered. Now we need to balance heights and widths of all cliques with the "remainder"
1765
1766
1767 var totalAspect = orderedRowLayout.reduce((sum, p) => sum += p.aspect_ratio, 0);
1768 var elementX = 0;
1769 orderedRowLayout.forEach(component => {
1770 component.new_width = component.aspect_ratio / totalAspect * viewportWidth;
1771 component.new_height = component.new_width / component.aspect_ratio;
1772 component.y = groupY;
1773 component.x = elementX;
1774 elementX += component.new_width;
1775 });
1776 groupY += orderedRowLayout[0].new_height;
1777 finalizeTiledLayout(orderedRowLayout, containers);
1778 });
1779 grid.style.height = groupY + 'px';
1780 };
1781
1782 var Mosaic = (resized, jsLoaded, selector) => {
1783 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.time('Mosaic');
1784 var selection = document.querySelectorAll(selector);
1785
1786 if (selector == null || selection.length === 0) {
1787 selection = document.querySelectorAll('.photonic-mosaic-layout');
1788 }
1789
1790 if (!resized && selection.length > 0) {
1791 _Core.Core.showSpinner();
1792 }
1793
1794 selection.forEach(grid => {
1795 if (!grid.hasChildNodes()) {
1796 return;
1797 }
1798
1799 if (grid.classList.contains('sizes-present')) {
1800 _Core.Core.watchForImages(grid);
1801
1802 doImageLayout(grid, false);
1803
1804 _Core.Core.showSlideupTitle();
1805
1806 if (!resized && !jsLoaded) {
1807 _Core.Core.hideLoading();
1808 }
1809 } else {
1810 _Core.Core.waitForImages(grid).then(() => {
1811 if (!grid.classList.contains('sizes-present')) {
1812 doImageLayout(grid, true);
1813 }
1814
1815 Array.from(grid.getElementsByTagName('img')).forEach(image => Util.fadeIn(image));
1816
1817 _Core.Core.showSlideupTitle();
1818
1819 if (!resized && !jsLoaded) {
1820 _Core.Core.hideLoading();
1821 }
1822 });
1823 }
1824 });
1825 if (console !== undefined && Photonic_JS.debug_on !== '0' && Photonic_JS.debug_on !== '') console.timeEnd('Mosaic');
1826 }; //Mosaic(false);
1827
1828
1829 exports.Mosaic = Mosaic;
1830
1831 /***/ }),
1832
1833 /***/ "../include/js/front-end/src/Layouts/Slider.js":
1834 /*!*****************************************************!*\
1835 !*** ../include/js/front-end/src/Layouts/Slider.js ***!
1836 \*****************************************************/
1837 /*! flagged exports */
1838 /*! export Slider [provided] [no usage info] [missing usage info prevents renaming] */
1839 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1840 /*! export initializeSliders [provided] [no usage info] [missing usage info prevents renaming] */
1841 /*! other exports [not provided] [no usage info] */
1842 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1843 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1844
1845
1846
1847 Object.defineProperty(exports, "__esModule", ({
1848 value: true
1849 }));
1850 exports.initializeSliders = exports.Slider = void 0;
1851
1852 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
1853
1854 var adaptiveHeight = (slideshow, slide, splide) => {
1855 var options = splide.options;
1856 var currentlyActive = splide.index;
1857
1858 if (slide.isWithin(parseInt(currentlyActive), parseInt(options.perPage) - 1)) {
1859 var allSlides = splide.Components.Elements.slides;
1860 var lastVisible = parseInt(currentlyActive) + parseInt(options.perPage);
1861 var visibleSlides = allSlides.slice(currentlyActive, lastVisible);
1862 var maxHeight = 0; // Need requestAnimationFrame, otherwise offsetHeight returns 0 for first photo
1863
1864 requestAnimationFrame(() => {
1865 Array.prototype.forEach.call(visibleSlides, visible => {
1866 var visibleImage = visible.querySelector('img');
1867 var offsetHeight = visibleImage.offsetHeight;
1868
1869 if (visibleImage && offsetHeight > maxHeight) {
1870 maxHeight = offsetHeight;
1871 }
1872 });
1873 slide.slide.style.height = "".concat(maxHeight, "px");
1874 var splideTrack = slideshow.querySelector('.splide__track');
1875 var splideTrackHeight = splideTrack ? splideTrack.offsetHeight : 0;
1876
1877 if (maxHeight !== splideTrackHeight) {
1878 var splideList = slideshow.querySelector('.splide__list');
1879 splideList.style.height = "".concat(maxHeight, "px");
1880 splideTrack.style.height = "".concat(maxHeight, "px");
1881 }
1882 });
1883 }
1884 };
1885
1886 var fixedHeight = (slideshow, splideObj) => {
1887 var maxHeight = 0,
1888 maxAspect = 0,
1889 containerWidth = slideshow.offsetWidth,
1890 children = slideshow.querySelectorAll('.splide__slide img');
1891 Array.prototype.forEach.call(children, img => {
1892 if (img.naturalHeight !== 0) {
1893 var childAspect = img.naturalWidth / img.naturalHeight;
1894
1895 if (childAspect >= maxAspect) {
1896 maxAspect = childAspect;
1897 var heightFactor = img.naturalWidth > containerWidth ? containerWidth / img.naturalWidth : 1;
1898 var cols = parseInt(splideObj.options.perPage, 10);
1899
1900 if (!isNaN(cols) && cols !== 0) {
1901 heightFactor = heightFactor / cols;
1902 }
1903
1904 maxHeight = img.naturalHeight * heightFactor;
1905 }
1906 }
1907 });
1908 Array.prototype.forEach.call(children, img => {
1909 img.style.height = maxHeight + 'px';
1910 });
1911 Array.prototype.forEach.call(slideshow.querySelectorAll('.splide__slide, .splide__list'), slideOrList => {
1912 slideOrList.style.height = maxHeight + 'px';
1913 });
1914 slideshow.style.height = maxHeight + 'px';
1915 };
1916
1917 var Slider = slideshow => {
1918 if (slideshow) {
1919 var content = slideshow.querySelector('.photonic-slideshow-content');
1920
1921 if (content) {
1922 _Core.Core.waitForImages(slideshow).then(() => {
1923 var idStr = '#' + slideshow.getAttribute('id');
1924 var splideThumbs = document.querySelector(idStr + '-thumbs');
1925
1926 if (splideThumbs != null) {
1927 splideThumbs = new Splide(idStr + '-thumbs');
1928 splideThumbs.mount();
1929 }
1930
1931 var splide = new Splide(idStr);
1932 splide.on('mounted resize', function (slide) {
1933 if (slideshow.classList.contains('photonic-slideshow-side-white') || slideshow.classList.contains('photonic-slideshow-start-next')) {
1934 fixedHeight(slideshow, splide);
1935 }
1936 });
1937 splide.on('visible', function (slide) {
1938 if (slideshow.classList.contains('photonic-slideshow-adapt-height')) {
1939 adaptiveHeight(slideshow, slide, splide);
1940 }
1941 });
1942
1943 if (splideThumbs == null) {
1944 splide.mount();
1945 } else {
1946 splide.sync(splideThumbs).mount();
1947 }
1948
1949 slideshow.querySelectorAll('img').forEach(img => {
1950 img.style.display = 'inline';
1951 });
1952 });
1953 }
1954 }
1955 };
1956
1957 exports.Slider = Slider;
1958
1959 var initializeSliders = () => {
1960 var primarySliders = document.querySelectorAll('.photonic-slideshow');
1961
1962 if (typeof Splide != "undefined") {
1963 primarySliders.forEach(slideshow => Slider(slideshow));
1964 } else if (console !== undefined && primarySliders.length > 0) {
1965 console.error('Splide not found! Please ensure that the Splide script is available and loaded before Photonic.');
1966 }
1967 };
1968
1969 exports.initializeSliders = initializeSliders;
1970
1971 /***/ }),
1972
1973 /***/ "../include/js/front-end/src/Lightboxes/Lightbox.js":
1974 /*!**********************************************************!*\
1975 !*** ../include/js/front-end/src/Lightboxes/Lightbox.js ***!
1976 \**********************************************************/
1977 /*! flagged exports */
1978 /*! export Lightbox [provided] [no usage info] [missing usage info prevents renaming] */
1979 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
1980 /*! other exports [not provided] [no usage info] */
1981 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
1982 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1983
1984
1985
1986 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1987
1988 Object.defineProperty(exports, "__esModule", ({
1989 value: true
1990 }));
1991 exports.Lightbox = void 0;
1992
1993 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../../../../node_modules/@babel/runtime/helpers/defineProperty.js"));
1994
1995 class Lightbox {
1996 constructor() {
1997 (0, _defineProperty2.default)(this, "deep", void 0);
1998 (0, _defineProperty2.default)(this, "lastDeep", void 0);
1999 this.socialIcons = "<div id='photonic-social'>" + "<a class='photonic-share-fb' href='https://www.facebook.com/sharer/sharer.php?u={photonic_share_link}&amp;title={photonic_share_title}&amp;picture={photonic_share_image}' target='_blank' title='Share on Facebook'><div class='icon-facebook'></div></a>" + "<a class='photonic-share-twitter' href='https://twitter.com/share?url={photonic_share_link}&amp;text={photonic_share_title}' target='_blank' title='Share on Twitter'><div class='icon-twitter'></div></a>" + "<a class='photonic-share-pinterest' data-pin-do='buttonPin' href='https://www.pinterest.com/pin/create/button/?url={photonic_share_link}&media={photonic_share_image}&description={photonic_share_title}' data-pin-custom='true' target='_blank' title='Share on Pinterest'><div class='icon-pinterest'></div></a>" + "</div>";
2000 this.videoIndex = 1;
2001 }
2002
2003 getVideoSize(url, baseline) {
2004 return new Promise(resolve => {
2005 // create the video element
2006 var video = document.createElement('video'); // place a listener on it
2007
2008 video.addEventListener("loadedmetadata", function () {
2009 // retrieve dimensions
2010 var height = this.videoHeight,
2011 width = this.videoWidth;
2012 var videoAspectRatio = this.videoWidth / this.videoHeight,
2013 baseAspectRatio = baseline.width / baseline.height;
2014 var newWidth, newHeight;
2015
2016 if (baseAspectRatio > videoAspectRatio) {
2017 // Window is wider than it needs to be ... constrain by window height
2018 newHeight = baseline.height;
2019 newWidth = width * newHeight / height;
2020 } else {
2021 // Window is narrower than it needs to be ... constrain by window width
2022 newWidth = baseline.width;
2023 newHeight = height * newWidth / width;
2024 } // send back result
2025
2026
2027 resolve({
2028 height: height,
2029 width: width,
2030 newHeight: newHeight,
2031 newWidth: newWidth
2032 });
2033 }, false); // start download meta-data
2034
2035 video.src = url;
2036 });
2037 }
2038
2039 getImageSize(url, baseline) {
2040 return new Promise(function (resolve) {
2041 var image = document.createElement('img'); // place a listener on it
2042
2043 image.addEventListener("load", function () {
2044 // retrieve dimensions
2045 var height = this.height,
2046 width = this.width,
2047 imageAspectRatio = this.width / this.height,
2048 baseAspectRatio = baseline.width / baseline.height;
2049 var newWidth, newHeight;
2050
2051 if (baseAspectRatio > imageAspectRatio) {
2052 // Window is wider than it needs to be ... constrain by window height
2053 newHeight = baseline.height;
2054 newWidth = width * newHeight / height;
2055 } else {
2056 // Window is narrower than it needs to be ... constrain by window width
2057 newWidth = baseline.width;
2058 newHeight = height * newWidth / width;
2059 } // send back result
2060
2061
2062 resolve({
2063 height: height,
2064 width: width,
2065 newHeight: newHeight,
2066 newWidth: newWidth
2067 });
2068 }, false); // start download meta-data
2069
2070 image.src = url;
2071 });
2072 }
2073
2074 addSocial(selector, shareable, position) {
2075 if ((Photonic_JS.social_media === undefined || Photonic_JS.social_media === '') && shareable['buy'] === undefined) {
2076 return;
2077 }
2078
2079 var socialEl = document.getElementById('photonic-social');
2080
2081 if (socialEl !== null) {
2082 socialEl.parentNode.removeChild(socialEl);
2083 }
2084
2085 var addTo;
2086
2087 if (position === undefined || position === null) {
2088 addTo = 'beforeend';
2089 } else {
2090 addTo = position;
2091 }
2092
2093 if (location.hash !== '') {
2094 var social = this.socialIcons.replace(/{photonic_share_link}/g, encodeURIComponent(shareable['url'])).replace(/{photonic_share_title}/g, encodeURIComponent(shareable['title'])).replace(/{photonic_share_image}/g, encodeURIComponent(shareable['image']));
2095 var selectorEl;
2096
2097 if (typeof selector === 'string') {
2098 selectorEl = document.documentElement.querySelector(selector);
2099 } else {
2100 selectorEl = selector;
2101 }
2102
2103 if (selectorEl !== null) {
2104 selectorEl.insertAdjacentHTML(addTo, social);
2105 }
2106
2107 if (Photonic_JS.social_media === undefined || Photonic_JS.social_media === '') {
2108 var socialMediaIcons = document.documentElement.querySelectorAll('.photonic-share-fb, .photonic-share-twitter, .photonic-share-pinterest');
2109 Array.prototype.forEach.call(socialMediaIcons, function (socialIcon) {
2110 socialIcon.parentNode.removeChild(socialIcon);
2111 });
2112 }
2113 }
2114 }
2115
2116 setHash(a) {
2117 if (Photonic_JS.deep_linking === undefined || Photonic_JS.deep_linking === 'none' || a === null || a === undefined) {
2118 return;
2119 }
2120
2121 var hash = typeof a === 'string' ? a : a.getAttribute('data-photonic-deep');
2122
2123 if (hash === undefined) {
2124 return;
2125 }
2126
2127 if (typeof window.history.pushState === 'function' && Photonic_JS.deep_linking === 'yes-history') {
2128 window.history.pushState({}, document.title, '#' + hash);
2129 } else if (typeof window.history.replaceState === 'function' && Photonic_JS.deep_linking === 'no-history') {
2130 window.history.replaceState({}, document.title, '#' + hash);
2131 } else {
2132 document.location.hash = hash;
2133 }
2134 }
2135
2136 unsetHash() {
2137 this.lastDeep = this.lastDeep === undefined || this.deep !== '' ? location.hash : this.lastDeep;
2138
2139 if (window.history && 'replaceState' in window.history) {
2140 history.replaceState({}, document.title, location.href.substr(0, location.href.length - location.hash.length));
2141 } else {
2142 window.location.hash = '';
2143 }
2144 }
2145
2146 changeHash(e) {
2147 if (e.type === 'load') {
2148 var hash = window.location.hash;
2149 hash = hash.substr(1);
2150
2151 if (hash && hash !== '') {
2152 var allMatches = document.querySelectorAll('[data-photonic-deep="' + hash + '"]');
2153
2154 if (allMatches.length > 0) {
2155 var thumbToClick = allMatches[0];
2156 var event = document.createEvent('HTMLEvents');
2157 event.initEvent('click', true, false);
2158 thumbToClick.dispatchEvent(event);
2159 }
2160 }
2161 } else {
2162 var node = this.deep;
2163
2164 if (node != null) {
2165 if (node.length > 1) {
2166 if (window.location.hash && node.indexOf('#access_token=') !== -1) {
2167 this.unsetHash();
2168 } else {
2169 node = node.substr(1);
2170
2171 var _allMatches = document.querySelectorAll('[data-photonic-deep="' + node + '"]');
2172
2173 if (_allMatches.length > 0) {
2174 var _thumbToClick = _allMatches[0];
2175
2176 var _event = document.createEvent('HTMLEvents');
2177
2178 _event.initEvent('click', true, false);
2179
2180 _thumbToClick.dispatchEvent(_event);
2181
2182 this.setHash(node);
2183 }
2184 }
2185 }
2186 }
2187 }
2188 }
2189
2190 catchYouTubeURL(url) {
2191 var regExp = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*)(?:(\?t|&t|\?start|&start)=(\d+))?.*/,
2192 match = url.match(regExp);
2193
2194 if (match && match[2].length === 11) {
2195 var obj = {
2196 url: match[2]
2197 };
2198
2199 if (match[4] !== undefined) {
2200 obj.timestamp = match[4];
2201 }
2202
2203 return obj;
2204 }
2205 }
2206
2207 catchVimeoURL(url) {
2208 var regExp = /(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/,
2209 match = url.match(regExp);
2210
2211 if (match) {
2212 return match[1];
2213 }
2214 }
2215
2216 soloImages() {
2217 var a = document.querySelectorAll('a[href]');
2218 var solos = Array.from(a).filter(elem => /(\.jpg|\.jpeg|\.bmp|\.gif|\.png)/i.test(elem.getAttribute('href'))).filter(elem => !elem.classList.contains('photonic-lb'));
2219 solos.forEach(solo => {
2220 solo.classList.add("photonic-" + Photonic_JS.lightbox_library);
2221 solo.classList.add("photonic-" + Photonic_JS.lightbox_library + '-solo');
2222 solo.classList.add(Photonic_JS.lightbox_library);
2223 });
2224 return solos;
2225 }
2226
2227 changeVideoURL(element, regular, embed, poster) {// Implemented in individual lightboxes. Empty for unsupported lightboxes
2228 }
2229
2230 hostedVideo(a) {// Implemented in individual lightboxes. Empty for unsupported lightboxes
2231 }
2232
2233 soloVideos() {
2234 var self = this;
2235
2236 if (Photonic_JS.lightbox_for_videos) {
2237 var a = document.querySelectorAll('a[href]');
2238 a.forEach(function (anchor) {
2239 var regular, embed, poster;
2240 var href = anchor.getAttribute('href'),
2241 youTube = self.catchYouTubeURL(href),
2242 vimeo = self.catchVimeoURL(href);
2243
2244 if (youTube !== undefined) {
2245 var ytSrc = youTube.url,
2246 ytTimeStamp = youTube.timestamp,
2247 regularT = '',
2248 embedT = '';
2249
2250 if (ytTimeStamp !== undefined) {
2251 regularT = '&t=' + ytTimeStamp;
2252 embedT = '?start=' + ytTimeStamp;
2253 }
2254
2255 regular = 'https://youtube.com/watch?v=' + ytSrc + regularT;
2256 embed = 'https://youtube.com/embed/' + ytSrc + embedT;
2257 poster = 'https://img.youtube.com/vi/' + ytSrc + '/hddefault.jpg';
2258 } else if (vimeo !== undefined) {
2259 regular = 'https://vimeo.com/' + vimeo;
2260 embed = 'https://player.vimeo.com/video/' + vimeo;
2261 }
2262
2263 if (regular !== undefined) {
2264 anchor.classList.add(Photonic_JS.lightbox_library + "-video");
2265 self.changeVideoURL(anchor, regular, embed, poster);
2266 self.modifyAdditionalVideoProperties(anchor);
2267 }
2268
2269 self.hostedVideo(anchor);
2270 });
2271 }
2272 }
2273
2274 handleSolos() {
2275 if (Photonic_JS.lightbox_for_all) {
2276 this.soloImages();
2277 }
2278
2279 this.soloVideos();
2280
2281 if (Photonic_JS.deep_linking !== undefined && Photonic_JS.deep_linking !== 'none') {
2282 window.addEventListener('load', this.changeHash);
2283 window.addEventListener('hashchange', this.changeHash);
2284 }
2285 }
2286
2287 initialize() {
2288 this.handleSolos(); // Implemented by child classes
2289 }
2290
2291 initializeForNewContainer(containerId) {// Implemented by individual lightboxes. Empty for cases where not required
2292 }
2293
2294 initializeForExisting() {// Implemented by child classes
2295 }
2296
2297 modifyAdditionalVideoProperties(anchor) {// Implemented by individual lightboxes. Empty for cases where not required
2298 }
2299
2300 }
2301
2302 exports.Lightbox = Lightbox;
2303
2304 /***/ }),
2305
2306 /***/ "../include/js/front-end/src/Lightboxes/Lightcase.js":
2307 /*!***********************************************************!*\
2308 !*** ../include/js/front-end/src/Lightboxes/Lightcase.js ***!
2309 \***********************************************************/
2310 /*! flagged exports */
2311 /*! export PhotonicLightcase [provided] [no usage info] [missing usage info prevents renaming] */
2312 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2313 /*! other exports [not provided] [no usage info] */
2314 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2315 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2316
2317
2318
2319 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2320
2321 Object.defineProperty(exports, "__esModule", ({
2322 value: true
2323 }));
2324 exports.PhotonicLightcase = void 0;
2325
2326 var _Lightbox = __webpack_require__(/*! ./Lightbox */ "../include/js/front-end/src/Lightboxes/Lightbox.js");
2327
2328 var Util = _interopRequireWildcard(__webpack_require__(/*! ../Util */ "../include/js/front-end/src/Util.js"));
2329
2330 class PhotonicLightcase extends _Lightbox.Lightbox {
2331 constructor($) {
2332 super();
2333 this.$ = $;
2334 }
2335
2336 soloImages() {
2337 var $ = this.$;
2338 $('a[href]').filter(function () {
2339 return /(\.jpg|\.jpeg|\.bmp|\.gif|\.png)/i.test($(this).attr('href'));
2340 }).filter(function () {
2341 var res = new RegExp('photonic-lb').test($(this).attr('class'));
2342 return !res;
2343 }).attr("data-rel", 'photonic-lightcase');
2344 }
2345
2346 changeVideoURL(element, regular, embed) {
2347 var $ = this.$;
2348 $(element).attr('href', embed);
2349 $(element).attr("data-rel", 'photonic-lightcase-video');
2350 }
2351
2352 hostedVideo(a) {
2353 var $ = this.$;
2354 var html5 = $(a).attr('href').match(new RegExp(/(\.mp4|\.webm|\.ogg)/i));
2355 var css = $(a).attr('class');
2356 css = css !== undefined && css.includes('photonic-lb');
2357
2358 if (html5 !== null && !css) {
2359 $(a).addClass(Photonic_JS.lightbox_library + "-html5-video");
2360 $(a).attr("data-rel", 'photonic-html5-video');
2361 this.videoIndex++;
2362 }
2363 }
2364
2365 initialize(selector, group) {
2366 var $ = this.$;
2367 this.handleSolos();
2368 var self = this;
2369 $(selector).each(function (i, current) {
2370 var lightbox_selector,
2371 rel = $(current).find('a.photonic-lightcase');
2372
2373 if (rel.length > 0) {
2374 rel = $(rel[0]).data('rel');
2375 }
2376
2377 lightbox_selector = selector.indexOf('data-rel') > -1 ? selector : 'a[data-rel="' + rel + '"]';
2378 $(lightbox_selector).lightcase({
2379 showSequenceInfo: false,
2380 transition: Photonic_JS.lc_transition_effect,
2381 slideshow: Photonic_JS.slideshow_mode,
2382 timeout: Photonic_JS.slideshow_interval,
2383 navigateEndless: Photonic_JS.lightbox_loop === '1',
2384 disableShrink: Photonic_JS.lc_disable_shrink === '1',
2385 attrPrefix: '',
2386 caption: ' ',
2387 swipe: true,
2388 onStart: {
2389 getVideoSize: function getVideoSize() {
2390 var elem = this,
2391 videoURL = $(elem).attr('data-html5-href'); // || $(elem).attr('href');
2392
2393 if (lightbox_selector.indexOf('photonic-html5-video') > -1 || videoURL !== undefined) {
2394 self.getVideoSize(videoURL === undefined ? $(elem).attr('href') : videoURL, {
2395 height: window.innerHeight * 0.8,
2396 width: 800
2397 }).then(function (dimensions) {
2398 $(elem).attr('data-lc-options', '{"width": ' + Math.round(dimensions.newWidth) + ', "height": ' + Math.round(dimensions.newHeight) + '}');
2399 $('#lightcase-content').find('video').attr({
2400 width: Math.round(dimensions.newWidth),
2401 height: Math.round(dimensions.newHeight)
2402 }).css({
2403 width: Math.round(dimensions.newWidth),
2404 height: Math.round(dimensions.newHeight)
2405 });
2406 lightcase.resize({
2407 width: Math.round(dimensions.newWidth),
2408 height: Math.round(dimensions.newHeight)
2409 });
2410 });
2411 }
2412 }
2413 },
2414 onFinish: {
2415 setHash: function setHash() {
2416 if (this.length > 0) {
2417 self.setHash(this[0]);
2418 }
2419
2420 var shareable = {
2421 'url': location.href,
2422 'title': Util.getText($(this).data('title')),
2423 'image': $(this).attr('href')
2424 };
2425 self.addSocial('#lightcase-info', shareable);
2426 }
2427 },
2428 onClose: {
2429 unsetHash: self.unsetHash
2430 }
2431 });
2432 });
2433 }
2434
2435 initializeForNewContainer(containerId) {
2436 this.initialize(containerId);
2437 }
2438
2439 }
2440
2441 exports.PhotonicLightcase = PhotonicLightcase;
2442
2443 /***/ }),
2444
2445 /***/ "../include/js/front-end/src/Listeners.js":
2446 /*!************************************************!*\
2447 !*** ../include/js/front-end/src/Listeners.js ***!
2448 \************************************************/
2449 /*! flagged exports */
2450 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2451 /*! export addAllListeners [provided] [no usage info] [missing usage info prevents renaming] */
2452 /*! export addHelperMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2453 /*! export addLazyLoadListener [provided] [no usage info] [missing usage info prevents renaming] */
2454 /*! export addLevel2ClickListener [provided] [no usage info] [missing usage info prevents renaming] */
2455 /*! export addLevel3ExpandListener [provided] [no usage info] [missing usage info prevents renaming] */
2456 /*! export addMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2457 /*! export addPasswordSubmitListener [provided] [no usage info] [missing usage info prevents renaming] */
2458 /*! export addSlideUpEnterListener [provided] [no usage info] [missing usage info prevents renaming] */
2459 /*! export addSlideUpLeaveListener [provided] [no usage info] [missing usage info prevents renaming] */
2460 /*! other exports [not provided] [no usage info] */
2461 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2462 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2463
2464
2465
2466 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2467
2468 Object.defineProperty(exports, "__esModule", ({
2469 value: true
2470 }));
2471 exports.addAllListeners = exports.addLazyLoadListener = exports.addSlideUpLeaveListener = exports.addSlideUpEnterListener = exports.addHelperMoreButtonListener = exports.addMoreButtonListener = exports.addLevel3ExpandListener = exports.addPasswordSubmitListener = exports.addLevel2ClickListener = void 0;
2472
2473 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2474
2475 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2476
2477 var Requests = _interopRequireWildcard(__webpack_require__(/*! ./Requests */ "../include/js/front-end/src/Requests.js"));
2478
2479 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2480
2481 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
2482
2483 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
2484
2485 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2486
2487 // .photonic-level-2-thumb:not(".gallery-page")
2488 var addLevel2ClickListener = () => {
2489 document.addEventListener('click', e => {
2490 if (!(e.target instanceof Element) || !e.target.closest('.photonic-level-2-thumb') || Photonic_JS.lightbox_library === 'none') {
2491 return;
2492 }
2493
2494 var clicked = e.target.closest('.photonic-level-2-thumb');
2495
2496 if (Util.hasClass(clicked, 'gallery-page')) {
2497 return;
2498 }
2499
2500 e.preventDefault();
2501 var container = clicked.closest('.photonic-level-2-container');
2502 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2503 var provider = galleryData['platform'],
2504 singular = galleryData['singular'],
2505 query = container.getAttribute('data-photonic-query');
2506 var args = {
2507 "panel_id": clicked.getAttribute('id'),
2508 "popup": galleryData['popup'],
2509 "photo_count": galleryData['photo-count'],
2510 "photo_more": galleryData['photo-more'] || '',
2511 "query": query
2512 };
2513 if (provider === 'google' || provider === 'zenfolio') args.thumb_size = galleryData['thumb-size'];
2514
2515 if (provider === 'flickr' || provider === 'smug' || provider === 'google' || provider === 'zenfolio') {
2516 args.overlay_size = galleryData['overlay-size'];
2517 args.overlay_video_size = galleryData['overlay-video-size'];
2518 }
2519
2520 if (provider === 'google') {
2521 args.overlay_crop = galleryData['overlay-crop'];
2522 }
2523
2524 Requests.displayLevel2(provider, singular, args);
2525 }, false);
2526 }; // .photonic-password-submit
2527
2528
2529 exports.addLevel2ClickListener = addLevel2ClickListener;
2530
2531 var addPasswordSubmitListener = () => {
2532 document.addEventListener('click', e => {
2533 if (!(e.target instanceof Element) || !e.target.closest('.photonic-password-submit')) {
2534 return;
2535 }
2536
2537 e.preventDefault();
2538 var clicked = e.target.closest('.photonic-password-submit');
2539 var modal = clicked.closest('.photonic-password-prompter'),
2540 container = clicked.closest('.photonic-level-2-container');
2541 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2542 var album_id = modal.getAttribute('id');
2543 var components = album_id.split('-');
2544 var provider = galleryData['platform'],
2545 singular_type = galleryData['singular'],
2546 album_key = components.slice(4).join('-'),
2547 thumb_id = "photonic-".concat(provider, "-").concat(singular_type, "-thumb-").concat(album_key),
2548 thumb = document.getElementById("".concat(thumb_id)),
2549 query = container.getAttribute('data-photonic-query');
2550 var password = modal.querySelector('input[name="photonic-' + provider + '-password"]');
2551 password = password.value;
2552
2553 var prompter = _Core.Core.prompterList["#photonic-".concat(provider, "-").concat(singular_type, "-prompter-").concat(album_key)];
2554
2555 if (prompter !== undefined && prompter !== null) {
2556 prompter.hide();
2557 }
2558
2559 _Core.Core.showSpinner();
2560
2561 var args = {
2562 'panel_id': thumb_id,
2563 "popup": galleryData['popup'],
2564 "photo_count": galleryData['photo-count'],
2565 "photo_more": galleryData['photo-more'] || '',
2566 "query": query
2567 };
2568
2569 if (provider === 'smug') {
2570 args.password = password;
2571 args.overlay_size = galleryData['overlay-size'];
2572 } else if (provider === 'zenfolio') {
2573 args.password = password;
2574 args.realm_id = thumb.getAttribute('data-photonic-realm');
2575 args.thumb_size = galleryData['thumb-size'];
2576 args.overlay_size = galleryData['overlay-size'];
2577 args.overlay_video_size = galleryData['overlay-video-size'];
2578 }
2579
2580 Requests.processRequest(provider, singular_type, album_key, args);
2581 }, false);
2582 }; // a.photonic-level-3-expand
2583
2584
2585 exports.addPasswordSubmitListener = addPasswordSubmitListener;
2586
2587 var addLevel3ExpandListener = () => {
2588 document.addEventListener('click', e => {
2589 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-level-3-expand')) {
2590 return;
2591 }
2592
2593 e.preventDefault();
2594 var current = e.target.closest('a.photonic-level-3-expand'),
2595 header = current.parentNode.parentNode.parentNode,
2596 stream = header.parentNode;
2597
2598 if (current.classList.contains('photonic-level-3-expand-plus')) {
2599 Requests.processL3Request(current, header, {
2600 'view': 'collections',
2601 'node': current.getAttribute('data-photonic-level-3'),
2602 'layout': current.getAttribute('data-photonic-layout'),
2603 'stream': stream.getAttribute('id')
2604 });
2605 } else if (current.classList.contains('photonic-level-3-expand-up')) {
2606 var display = Util.next(header, '.photonic-stream');
2607 Util.slideUpDown(display, 'hide');
2608 current.classList.remove('photonic-level-3-expand-up');
2609 current.classList.add('photonic-level-3-expand-down');
2610 current.setAttribute('title', Photonic_JS.maximize_panel === undefined ? 'Show' : Photonic_JS.maximize_panel);
2611 } else if (current.classList.contains('photonic-level-3-expand-down')) {
2612 var _display = Util.next(header, '.photonic-stream'); // Util.slideDown(display);
2613
2614
2615 Util.slideUpDown(_display, 'show');
2616 current.classList.remove('photonic-level-3-expand-down');
2617 current.classList.add('photonic-level-3-expand-up');
2618 current.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
2619 }
2620 }, false);
2621 }; // a.photonic-more-button.photonic-more-dynamic
2622
2623
2624 exports.addLevel3ExpandListener = addLevel3ExpandListener;
2625
2626 var addMoreButtonListener = () => {
2627 document.addEventListener('click', e => {
2628 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-more-button.photonic-more-dynamic')) {
2629 return;
2630 }
2631
2632 e.preventDefault();
2633 var clicked = e.target.closest('a.photonic-more-button.photonic-more-dynamic');
2634 var container = clicked.parentNode.querySelector('.photonic-level-1-container, .photonic-level-2-container');
2635 var query = container.getAttribute('data-photonic-query'),
2636 provider = container.getAttribute('data-photonic-platform'),
2637 level = container.classList.contains('photonic-level-1-container') ? 'level-1' : 'level-2',
2638 containerId = container.getAttribute('id'),
2639 existing = container.querySelectorAll('figure');
2640
2641 _Core.Core.showSpinner();
2642
2643 Util.post(Photonic_JS.ajaxurl, {
2644 'action': 'photonic_load_more',
2645 'provider': provider,
2646 'query': query
2647 }, data => {
2648 var ret = Util.getElement(data),
2649 images = ret.querySelectorAll(".photonic-".concat(level)),
2650 more_button = ret.querySelector('.photonic-more-button'),
2651 one_existing = container.querySelector('a.photonic-lb');
2652 var anchors = [];
2653
2654 if (one_existing !== null) {
2655 images.forEach(image => {
2656 var a = image.querySelector('a');
2657
2658 if (a !== null) {
2659 a.setAttribute('rel', one_existing.getAttribute('rel'));
2660
2661 if (a.getAttribute('data-fancybox') != null) {
2662 a.setAttribute('data-fancybox', one_existing.getAttribute('data-fancybox'));
2663 } else if (a.getAttribute('data-rel') != null) {
2664 a.setAttribute('data-rel', one_existing.getAttribute('data-rel'));
2665 } else if (a.getAttribute('data-strip-group') != null) {
2666 a.setAttribute('data-strip-group', one_existing.getAttribute('data-strip-group'));
2667 } else if (a.getAttribute('data-gall') != null) {
2668 a.setAttribute('data-gall', one_existing.getAttribute('data-gall'));
2669 }
2670
2671 anchors.push(a);
2672 }
2673 });
2674 } // Can't do this above, which is only for L1
2675
2676
2677 images.forEach(image => container.appendChild(image));
2678
2679 _Core.Core.moveHTML5External();
2680
2681 if (images.length === 0) {
2682 _Core.Core.hideLoading();
2683
2684 Util.fadeOut(clicked);
2685 clicked.remove();
2686 }
2687
2688 var lightbox = _Core.Core.getLightbox();
2689
2690 if (Photonic_JS.lightbox_library === 'imagelightbox') {
2691 if (one_existing != null) {
2692 lightbox = _Core.Core.getLightboxList()['a[rel="' + one_existing.getAttribute('rel') + '"]'];
2693
2694 if (level === 'level-1') {
2695 lightbox.addToImageLightbox(anchors);
2696 }
2697 }
2698 } else if (Photonic_JS.lightbox_library === 'lightcase') {
2699 if (one_existing != null) {
2700 lightbox.initialize('a[data-rel="' + one_existing.getAttribute('data-rel') + '"]');
2701 }
2702 } else if (Photonic_JS.lightbox_library === 'lightgallery') {
2703 if (one_existing !== null) {
2704 lightbox = _Core.Core.getLightboxList()[one_existing.getAttribute('rel')];
2705 var galleryItems = [...lightbox.galleryItems];
2706 images.forEach(image => {
2707 var a = image.querySelector('a');
2708 var img = a.querySelector('img');
2709 var videoAttr;
2710
2711 if (a.getAttribute('data-photonic-media-type') === 'video') {
2712 videoAttr = JSON.parse(a.getAttribute('data-video'));
2713 }
2714
2715 galleryItems.push({
2716 "alt": img.getAttribute('alt'),
2717 "downloadUrl": a.getAttribute('data-download-url'),
2718 "src": a.getAttribute('data-photonic-media-type') === 'video' ? videoAttr.source[0].src : a.getAttribute('href'),
2719 "subHtml": a.getAttribute('data-sub-html'),
2720 "thumb": img.getAttribute('src')
2721 });
2722 });
2723 lightbox.updateSlides(galleryItems, 0);
2724 lightbox.refresh();
2725 } else {
2726 lightbox.initialize(container);
2727 }
2728 } else if (Photonic_JS.lightbox_library === 'venobox') {
2729 if (one_existing !== null) {
2730 var gallId = one_existing.getAttribute('data-gall');
2731
2732 if (one_existing.closest('.photonic-panel')) {
2733 gallId = one_existing.closest('.photonic-panel').getAttribute('id');
2734 }
2735
2736 lightbox.initialize('#' + gallId, true);
2737 }
2738 } else if (['bigpicture', 'featherlight', 'glightbox', 'spotlight'].includes(Photonic_JS.lightbox_library)) {
2739 lightbox.initialize(container);
2740 } else if (Photonic_JS.lightbox_library === 'baguettebox') {
2741 lightbox.initialize(null, true);
2742 } else if (Photonic_JS.lightbox_library === 'fancybox3') {
2743 if (one_existing != null) {
2744 lightbox.initialize(null, one_existing.getAttribute('data-fancybox'));
2745 }
2746 } else if (Photonic_JS.lightbox_library === 'photoswipe') {
2747 lightbox.initialize();
2748 }
2749
2750 function doImageLayout(images) {
2751 var new_query = ret.querySelector('.photonic-random-layout,.photonic-standard-layout,.photonic-masonry-layout,.photonic-mosaic-layout,.modal-gallery');
2752
2753 if (new_query != null) {
2754 container.setAttribute('data-photonic-query', new_query.getAttribute('data-photonic-query'));
2755 }
2756
2757 if (more_button == null) {
2758 Util.fadeOut(clicked);
2759 clicked.remove();
2760 }
2761
2762 if (Util.hasClass(container, 'photonic-mosaic-layout')) {
2763 (0, _Mosaic.Mosaic)(false, false, '#' + containerId);
2764 } else if (Util.hasClass(container, 'photonic-random-layout')) {
2765 (0, _Justified.JustifiedGrid)(false, false, '#' + containerId, lightbox);
2766 } else if (Util.hasClass(container, 'photonic-masonry-layout')) {
2767 images.forEach(image => {
2768 var img = image.querySelector('img');
2769 Util.fadeIn(img);
2770 img.style.display = 'block';
2771 });
2772
2773 _Core.Core.hideLoading();
2774 } else if (Util.hasClass(container, 'photonic-masonry-horizontal-layout')) {
2775 var existingCount = existing.length;
2776 images.forEach((image, idx) => {
2777 image.setAttribute('data-photonic-idx', existingCount + idx); // const img = image.querySelector('img');
2778 // Util.fadeIn(img);
2779 // img.style.display = 'block';
2780 });
2781 (0, _MasonryHorizontal.MasonryHorizontal)(false, false, '#' + containerId);
2782
2783 _Core.Core.hideLoading();
2784 } else {
2785 container.querySelectorAll('.photonic-' + level).forEach(el => {
2786 el.style.display = 'inline-block';
2787 });
2788
2789 _Core.Core.standardizeTitleWidths();
2790
2791 _Core.Core.hideLoading();
2792 }
2793
2794 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2795 }
2796
2797 if (container.classList.contains('sizes-present')) {
2798 _Core.Core.watchForImages(images);
2799
2800 doImageLayout(images);
2801 } else {
2802 _Core.Core.waitForImages(images).then(() => {
2803 doImageLayout(images);
2804 });
2805 }
2806 });
2807 });
2808 }; // input[type="button"].photonic-helper-more
2809
2810
2811 exports.addMoreButtonListener = addMoreButtonListener;
2812
2813 var addHelperMoreButtonListener = () => {
2814 document.addEventListener('click', e => {
2815 if (!(e.target instanceof Element) || !e.target.closest('input[type="button"].photonic-helper-more')) {
2816 return;
2817 }
2818
2819 e.preventDefault();
2820
2821 _Core.Core.showSpinner();
2822
2823 var clicked = e.target.closest('input[type="button"].photonic-helper-more');
2824 var table = clicked.closest('table');
2825 var nextToken = clicked.getAttribute('data-photonic-token') === undefined ? null : clicked.getAttribute('data-photonic-token'),
2826 provider = clicked.getAttribute('data-photonic-platform'),
2827 accessType = clicked.getAttribute('data-photonic-access');
2828 var args = {
2829 'action': 'photonic_helper_shortcode_more',
2830 'provider': provider,
2831 'access': accessType
2832 };
2833
2834 if (nextToken) {
2835 args.nextPageToken = nextToken;
2836 }
2837
2838 if (provider === 'google') {
2839 Util.post(Photonic_JS.ajaxurl, args, data => {
2840 var ret = Util.getElement(data);
2841 ret = Array.from(ret.getElementsByTagName('tr'));
2842
2843 if (ret.length > 0) {
2844 var tr = clicked.closest('tr');
2845
2846 if (tr) {
2847 tr.remove();
2848 }
2849
2850 ret.forEach((node, i) => {
2851 if (i !== 0) {
2852 table.appendChild(node);
2853 }
2854 });
2855 }
2856
2857 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2858
2859 _Core.Core.hideLoading();
2860 });
2861 }
2862 });
2863 };
2864
2865 exports.addHelperMoreButtonListener = addHelperMoreButtonListener;
2866
2867 var addSlideUpEnterListener = () => {
2868 document.addEventListener('mouseover', e => {
2869 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2870
2871 if (e.target instanceof Element && e.target.closest(slideup)) {
2872 var node = e.target.closest(slideup);
2873 var title = node.querySelector('.photonic-title');
2874 Util.slideUpTitle(title, 'show');
2875 node.setAttribute('title', '');
2876 }
2877 }, true);
2878 };
2879
2880 exports.addSlideUpEnterListener = addSlideUpEnterListener;
2881
2882 var addSlideUpLeaveListener = () => {
2883 document.addEventListener('mouseout', e => {
2884 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2885
2886 if (e.target instanceof Element && e.target.closest(slideup)) {
2887 var node = e.target.closest(slideup);
2888 var title = node.querySelector('.photonic-title');
2889 Util.slideUpTitle(title, 'hide');
2890 node.setAttribute('title', Util.getText(node.getAttribute('data-title')));
2891 }
2892 }, true);
2893 };
2894
2895 exports.addSlideUpLeaveListener = addSlideUpLeaveListener;
2896
2897 var addLazyLoadListener = () => {
2898 var buttons = document.documentElement.querySelectorAll('input.photonic-show-gallery-button');
2899 Array.prototype.forEach.call(buttons, button => {
2900 button.addEventListener('click', Requests.lazyLoad);
2901 });
2902 buttons = document.documentElement.querySelectorAll('input.photonic-js-load-button');
2903 Array.prototype.forEach.call(buttons, button => {
2904 button.addEventListener('click', Requests.lazyLoad);
2905 button.click();
2906 });
2907 };
2908
2909 exports.addLazyLoadListener = addLazyLoadListener;
2910
2911 var addAllListeners = () => {
2912 addLevel2ClickListener();
2913 addPasswordSubmitListener();
2914 addLevel3ExpandListener();
2915 addMoreButtonListener();
2916 addHelperMoreButtonListener();
2917 addSlideUpEnterListener();
2918 addSlideUpLeaveListener();
2919 addLazyLoadListener();
2920 };
2921
2922 exports.addAllListeners = addAllListeners;
2923
2924 /***/ }),
2925
2926 /***/ "../include/js/front-end/src/Requests.js":
2927 /*!***********************************************!*\
2928 !*** ../include/js/front-end/src/Requests.js ***!
2929 \***********************************************/
2930 /*! flagged exports */
2931 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2932 /*! export displayLevel2 [provided] [no usage info] [missing usage info prevents renaming] */
2933 /*! export lazyLoad [provided] [no usage info] [missing usage info prevents renaming] */
2934 /*! export processL3Request [provided] [no usage info] [missing usage info prevents renaming] */
2935 /*! export processRequest [provided] [no usage info] [missing usage info prevents renaming] */
2936 /*! other exports [not provided] [no usage info] */
2937 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2938 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2939
2940
2941
2942 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2943
2944 Object.defineProperty(exports, "__esModule", ({
2945 value: true
2946 }));
2947 exports.lazyLoad = exports.processL3Request = exports.displayLevel2 = exports.processRequest = void 0;
2948
2949 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2950
2951 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2952
2953 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2954
2955 var _Masonry = __webpack_require__(/*! ./Layouts/Masonry */ "../include/js/front-end/src/Layouts/Masonry.js");
2956
2957 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2958
2959 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
2960
2961 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
2962
2963 var _Modal = __webpack_require__(/*! ./Components/Modal */ "../include/js/front-end/src/Components/Modal.js");
2964
2965 var spinners = 0;
2966
2967 var bypassPopup = data => {
2968 _Core.Core.hideLoading();
2969
2970 var panel;
2971
2972 if (data instanceof Element) {
2973 panel = data;
2974 } else {
2975 panel = Util.getElement(data).firstElementChild;
2976 }
2977
2978 Util.hide(panel);
2979 var images = panel.querySelectorAll('img');
2980 images.forEach(image => {
2981 if ((image.getAttribute('src') === null || image.getAttribute('src') === '') && image.getAttribute('data-src') !== null) {
2982 image.setAttribute('src', image.getAttribute('data-src'));
2983 image.removeAttribute('data-src');
2984 }
2985 });
2986 document.body.appendChild(panel);
2987
2988 _Core.Core.moveHTML5External();
2989
2990 var lightbox = _Core.Core.getLightbox();
2991
2992 if (lightbox !== undefined && lightbox !== null) {
2993 lightbox.initializeForNewContainer('#' + panel.getAttribute('id'));
2994 }
2995
2996 var thumbs = panel.querySelectorAll('.photonic-lb');
2997
2998 if (thumbs.length > 0) {
2999 _Core.Core.setDeep('#' + thumbs[0].getAttribute('data-photonic-deep'));
3000
3001 var evt = new MouseEvent('click', {
3002 bubbles: true,
3003 cancelable: true,
3004 view: window
3005 }); // If cancelled, don't dispatch our event
3006
3007 !thumbs[0].dispatchEvent(evt);
3008 }
3009 };
3010
3011 var displayPopup = (data, provider, popup, panelId) => {
3012 var safePanelId = panelId.replace('.', '\\.'); // FOR EXISTING ELEMENTS WHICH NEED SANITIZED PANELID
3013
3014 var div = Util.getElement(data).firstElementChild;
3015 var grid = div.querySelector('.modal-gallery');
3016
3017 var doImageLayout = () => {
3018 var popupPanel = document.querySelector('#photonic-' + provider + '-' + popup + '-' + safePanelId);
3019
3020 if (popupPanel) {
3021 popupPanel.appendChild(div);
3022 Util.show(popupPanel);
3023 }
3024
3025 (0, _Modal.Modal)(div, {
3026 modalTarget: 'photonic-' + provider + '-panel-' + safePanelId,
3027 color: '#000',
3028 width: Photonic_JS.gallery_panel_width + '%',
3029 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
3030 });
3031
3032 _Core.Core.moveHTML5External();
3033
3034 var lightbox = _Core.Core.getLightbox();
3035
3036 if (lightbox !== undefined && lightbox !== null) {
3037 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3038 }
3039
3040 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3041
3042 _Core.Core.hideLoading();
3043 };
3044
3045 if (grid.classList.contains('sizes-present')) {
3046 _Core.Core.watchForImages(grid);
3047
3048 doImageLayout();
3049 } else {
3050 _Core.Core.waitForImages(grid).then(() => {
3051 doImageLayout();
3052 });
3053 }
3054 };
3055
3056 var redisplayPopupContents = (provider, panelId, panel, args) => {
3057 var panelEl = Util.getElement(panel);
3058
3059 if ('show' === args['popup']) {
3060 _Core.Core.hideLoading();
3061
3062 (0, _Modal.Modal)(panelEl, {
3063 modalTarget: 'photonic-' + provider + '-panel-' + panelId,
3064 color: '#000',
3065 width: Photonic_JS.gallery_panel_width + '%',
3066 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
3067 });
3068 } else {
3069 bypassPopup(document.getElementById('photonic-' + provider + '-panel-' + panelId));
3070 }
3071 };
3072
3073 var processRequest = (provider, type, identifier, args) => {
3074 args['action'] = 'photonic_display_level_2_contents';
3075 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3076 if (data.substr(0, Photonic_JS.password_failed.length) === Photonic_JS.password_failed) {
3077 _Core.Core.hideLoading();
3078
3079 var prompter = '#photonic-' + provider + '-' + type + '-prompter-' + identifier;
3080 var prompterDialog = _Core.Core.prompterList[prompter];
3081
3082 if (prompterDialog !== undefined && prompterDialog !== null) {
3083 prompterDialog.show();
3084 }
3085 } else {
3086 if ('show' === args['popup']) {
3087 displayPopup(data, provider, type, identifier);
3088 } else {
3089 if (data !== '') {
3090 bypassPopup(data);
3091 } else {
3092 _Core.Core.hideLoading();
3093 }
3094 }
3095 }
3096 });
3097 };
3098
3099 exports.processRequest = processRequest;
3100
3101 var displayLevel2 = (provider, type, args) => {
3102 var identifier = args['panel_id'].substr(('photonic-' + provider + '-' + type + '-thumb-').length);
3103 var panel = '#photonic-' + provider + '-panel-' + identifier;
3104 var existing = document.getElementById('photonic-' + provider + '-panel-' + identifier);
3105
3106 if (existing == null) {
3107 existing = document.getElementById(args['panel_id']);
3108
3109 if (existing.classList.contains('photonic-' + provider + '-passworded')) {
3110 _Core.Core.initializePasswordPrompter("#photonic-".concat(provider, "-").concat(type, "-prompter-").concat(identifier));
3111 } else {
3112 _Core.Core.showSpinner();
3113
3114 processRequest(provider, type, identifier, args);
3115 }
3116 } else {
3117 _Core.Core.showSpinner();
3118
3119 redisplayPopupContents(provider, identifier, panel, args);
3120 }
3121 };
3122
3123 exports.displayLevel2 = displayLevel2;
3124
3125 var processL3Request = (clicked, header, args) => {
3126 args['action'] = 'photonic_display_level_3_contents';
3127
3128 _Core.Core.showSpinner();
3129
3130 var lightbox = _Core.Core.getLightbox();
3131
3132 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3133 var insert = Util.getElement(data);
3134
3135 if (header) {
3136 var layout = insert.querySelector('.photonic-level-2-container');
3137 var container = header.parentNode;
3138 var returnedStream = insert.firstElementChild;
3139 var collectionId = args.node.substr('flickr-collection-'.length);
3140 returnedStream.setAttribute('id', args.stream + '-' + collectionId);
3141 container.insertBefore(returnedStream, header.nextSibling);
3142
3143 if (layout.classList.contains('photonic-random-layout')) {
3144 (0, _Justified.JustifiedGrid)(false, false, null, lightbox);
3145 } else if (layout.classList.contains('photonic-mosaic-layout')) {
3146 (0, _Mosaic.Mosaic)(false, false);
3147 } else if (layout.classList.contains('photonic-masonry-layout')) {
3148 (0, _Masonry.Masonry)(false, false);
3149 } else if (layout.classList.contains('photonic-masonry-horizontal-layout')) {
3150 (0, _MasonryHorizontal.MasonryHorizontal)(false, false);
3151 } else if (layout.classList.contains('sizes-present')) {
3152 _Core.Core.watchForImages(layout);
3153 }
3154
3155 var level2 = returnedStream.querySelectorAll('.photonic-level-2');
3156 level2.forEach(function (item) {
3157 item.style.display = 'inline-block';
3158 });
3159 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3160 clicked.classList.remove('photonic-level-3-expand-plus');
3161 clicked.classList.add('photonic-level-3-expand-up');
3162 clicked.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
3163 }
3164
3165 _Core.Core.hideLoading();
3166 });
3167 };
3168
3169 exports.processL3Request = processL3Request;
3170
3171 var lazyLoad = evt => {
3172 spinners++;
3173
3174 _Core.Core.showSpinner();
3175
3176 var clicked = evt.currentTarget;
3177 var shortcode = clicked.getAttribute('data-photonic-shortcode');
3178 var args = {
3179 'action': 'photonic_lazy_load',
3180 'shortcode': shortcode
3181 };
3182
3183 var countdownSpinners = () => {
3184 spinners--;
3185
3186 if (spinners <= 0) {
3187 _Core.Core.hideLoading();
3188 }
3189 };
3190
3191 Util.post(Photonic_JS.ajaxurl, args, data => {
3192 var div = document.createElement('div');
3193 div.innerHTML = data;
3194 div = div.firstElementChild;
3195
3196 if (div) {
3197 var divId = div.getAttribute('id');
3198 var divClass = divId.substring(0, divId.lastIndexOf('-'));
3199 var streams = document.documentElement.querySelectorAll('.' + divClass);
3200 var max = 0;
3201 streams.forEach(stream => {
3202 var streamId = stream.getAttribute('id');
3203 streamId = streamId.substring(streamId.lastIndexOf('-') + 1);
3204 streamId = parseInt(streamId, 10);
3205 max = Math.max(max, streamId);
3206 });
3207 max = max + 1;
3208 var regex = new RegExp(divId, 'gi');
3209 div.innerHTML = data.replace(regex, divClass + '-' + max).replace('photonic-slideshow-' + divId.substring(divId.lastIndexOf('-') + 1), 'photonic-slideshow-' + max);
3210 div = div.firstElementChild; // Level 2 elements get their own ids, which need to be readjusted because the back-end always assigns them a gallery_index of 1
3211
3212 div.querySelectorAll('figure.photonic-level-2').forEach(figure => {
3213 if (figure.getAttribute('id') != null) {
3214 var figId = figure.getAttribute('id');
3215 var modId = figId.substring(0, figId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3216
3217 figure.setAttribute('id', modId);
3218 var anchor = figure.querySelector('a');
3219
3220 if (anchor.getAttribute('id') != null) {
3221 var anchorId = anchor.getAttribute('id');
3222 var modAnchorId = anchorId.substring(0, anchorId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3223
3224 anchor.setAttribute('id', modAnchorId);
3225 }
3226
3227 var prompter = figure.querySelector('.photonic-password-prompter');
3228
3229 if (prompter != null && prompter.getAttribute('id') != null) {
3230 var prompterId = prompter.getAttribute('id');
3231 var modPrompterId = prompterId.substring(0, prompterId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3232
3233 prompter.setAttribute('id', modPrompterId);
3234 }
3235 }
3236 });
3237 clicked.insertAdjacentElement('afterend', div);
3238 var newDivId = divClass + '-' + max;
3239
3240 var lightbox = _Core.Core.getLightbox();
3241
3242 if (lightbox !== undefined && lightbox !== null) {
3243 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3244 }
3245
3246 if (document.querySelectorAll('#' + newDivId + ' .photonic-random-layout').length > 0) {
3247 (0, _Justified.JustifiedGrid)(false, true, '#' + newDivId + ' .photonic-random-layout', lightbox);
3248 spinners--;
3249 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-layout').length > 0) {
3250 (0, _Masonry.Masonry)(false, true, '#' + newDivId + ' .photonic-masonry-layout');
3251 spinners--;
3252 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-horizontal-layout').length > 0) {
3253 (0, _MasonryHorizontal.MasonryHorizontal)(false, true, '#' + newDivId + ' .photonic-masonry-horizontal-layout');
3254 spinners--;
3255 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-mosaic-layout').length > 0) {
3256 (0, _Mosaic.Mosaic)(false, true, '#' + newDivId + ' .photonic-mosaic-layout');
3257 spinners--;
3258 } // Slider(document.querySelector('#photonic-slideshow-' + max));
3259
3260
3261 if (div.classList.contains('sizes-present') || div.querySelector('.sizes-present') !== null) {
3262 _Core.Core.watchForImages(div);
3263
3264 _Core.Core.standardizeTitleWidths();
3265
3266 countdownSpinners();
3267 } else {
3268 _Core.Core.waitForImages(div).then(() => {
3269 var standard = document.documentElement.querySelectorAll('#' + newDivId + ' .photonic-standard-layout .photonic-level-1, ' + '#' + newDivId + ' .photonic-standard-layout .photonic-level-2');
3270 standard.forEach(image => {
3271 image.style.display = 'inline-block';
3272 });
3273
3274 _Core.Core.standardizeTitleWidths();
3275
3276 countdownSpinners();
3277 });
3278 }
3279
3280 _Core.Core.moveHTML5External();
3281
3282 clicked.parentNode.removeChild(clicked);
3283 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3284
3285 if (spinners <= 0) {
3286 _Core.Core.hideLoading();
3287 }
3288 }
3289 });
3290 };
3291
3292 exports.lazyLoad = lazyLoad;
3293
3294 /***/ }),
3295
3296 /***/ "../include/js/front-end/src/Util.js":
3297 /*!*******************************************!*\
3298 !*** ../include/js/front-end/src/Util.js ***!
3299 \*******************************************/
3300 /*! flagged exports */
3301 /*! export HTMLSanitizer [provided] [no usage info] [missing usage info prevents renaming] */
3302 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
3303 /*! export fadeIn [provided] [no usage info] [missing usage info prevents renaming] */
3304 /*! export fadeOut [provided] [no usage info] [missing usage info prevents renaming] */
3305 /*! export get [provided] [no usage info] [missing usage info prevents renaming] */
3306 /*! export getElement [provided] [no usage info] [missing usage info prevents renaming] */
3307 /*! export getText [provided] [no usage info] [missing usage info prevents renaming] */
3308 /*! export hasClass [provided] [no usage info] [missing usage info prevents renaming] */
3309 /*! export hide [provided] [no usage info] [missing usage info prevents renaming] */
3310 /*! export next [provided] [no usage info] [missing usage info prevents renaming] */
3311 /*! export post [provided] [no usage info] [missing usage info prevents renaming] */
3312 /*! export show [provided] [no usage info] [missing usage info prevents renaming] */
3313 /*! export slideUpDown [provided] [no usage info] [missing usage info prevents renaming] */
3314 /*! export slideUpTitle [provided] [no usage info] [missing usage info prevents renaming] */
3315 /*! other exports [not provided] [no usage info] */
3316 /*! runtime requirements: __webpack_exports__ */
3317 /***/ ((__unused_webpack_module, exports) => {
3318
3319
3320
3321 Object.defineProperty(exports, "__esModule", ({
3322 value: true
3323 }));
3324 exports.HTMLSanitizer = exports.hide = exports.show = exports.fadeOut = exports.fadeIn = exports.slideUpTitle = exports.slideUpDown = exports.getText = exports.getElement = exports.next = exports.get = exports.post = exports.hasClass = void 0;
3325
3326 // Utilities for Photonic
3327 var hasClass = (element, className) => {
3328 if (element.classList) {
3329 return element.classList.contains(className);
3330 } else {
3331 return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
3332 }
3333 };
3334
3335 exports.hasClass = hasClass;
3336
3337 function ajax(method, url, args, callback) {
3338 var xhr = new XMLHttpRequest();
3339 xhr.open(method, url);
3340
3341 xhr.onreadystatechange = function () {
3342 if (xhr.readyState === 4) {
3343 if (xhr.status === 200) {
3344 var data = xhr.responseText;
3345 callback(data);
3346 }
3347 }
3348 };
3349
3350 var form = new FormData();
3351
3352 for (var [key, value] of Object.entries(args)) {
3353 form.append(key, value);
3354 }
3355
3356 xhr.send(form);
3357 }
3358
3359 var post = (url, args, callback) => {
3360 ajax('POST', url, args, callback);
3361 };
3362
3363 exports.post = post;
3364
3365 var get = (url, args, callback) => {
3366 ajax('GET', url, args, callback);
3367 };
3368
3369 exports.get = get;
3370
3371 var next = (elem, selector) => {
3372 var sibling = elem.nextElementSibling;
3373 if (!selector) return sibling;
3374
3375 while (sibling) {
3376 if (sibling.matches(selector)) return sibling;
3377 sibling = sibling.nextElementSibling;
3378 }
3379 };
3380
3381 exports.next = next;
3382
3383 var getElement = value => {
3384 var parser = new DOMParser();
3385 var doc = parser.parseFromString(value, 'text/html');
3386 return doc.body;
3387 };
3388
3389 exports.getElement = getElement;
3390
3391 var getText = value => {
3392 // Not using innerHTML because of vulnerability to XSS
3393 if (value == null) {
3394 return '';
3395 }
3396
3397 return value.replace(/<[^>]+>/g, '');
3398 };
3399
3400 exports.getText = getText;
3401
3402 var slideUpDown = (element, state) => {
3403 if (element != null && element.classList) {
3404 if (!element.classList.contains('photonic-can-slide')) {
3405 element.classList.add('photonic-can-slide');
3406 }
3407
3408 if ('show' === state) {
3409 element.classList.remove('photonic-can-slide-hide');
3410 element.style.height = "".concat(element.scrollHeight, "px");
3411 } else {
3412 element.classList.add('photonic-can-slide-hide');
3413 element.style.height = 0;
3414 }
3415 }
3416 };
3417
3418 exports.slideUpDown = slideUpDown;
3419
3420 var slideUpTitle = (element, state) => {
3421 if (element && element.classList) {
3422 if ('show' === state) {
3423 var currentPadding = 0;
3424
3425 if (element.offsetHeight) {
3426 currentPadding = parseInt(getComputedStyle(element).paddingTop.slice(0, -2)) * 2;
3427 }
3428
3429 element.style.height = element.scrollHeight + 6 - currentPadding + 'px';
3430 element.classList.add('slideup-show');
3431 } else {
3432 element.style.height = '';
3433 element.classList.remove('slideup-show');
3434 }
3435 }
3436 };
3437
3438 exports.slideUpTitle = slideUpTitle;
3439
3440 var fadeIn = el => {
3441 if (!hasClass(el, 'fade-in')) {
3442 el.style.display = 'block';
3443 el.style.visibility = 'visible';
3444 el.classList.add('fade-in');
3445 }
3446 };
3447
3448 exports.fadeIn = fadeIn;
3449
3450 var fadeOut = (el, duration) => {
3451 var s = el.style,
3452 step = 25 / (duration || 500);
3453 s.opacity = s.opacity || 1;
3454
3455 (function fade() {
3456 s.opacity -= step;
3457
3458 if (s.opacity < 0) {
3459 s.display = "none";
3460 el.classList.remove('fade-in');
3461 } else {
3462 setTimeout(fade, 25);
3463 }
3464 })();
3465 }; // get the default display style of an element
3466
3467
3468 exports.fadeOut = fadeOut;
3469
3470 var defaultDisplay = tag => {
3471 var iframe = document.createElement('iframe');
3472 iframe.setAttribute('frameborder', 0);
3473 iframe.setAttribute('width', 0);
3474 iframe.setAttribute('height', 0);
3475 document.documentElement.appendChild(iframe);
3476 var doc = (iframe.contentWindow || iframe.contentDocument).document; // IE support
3477
3478 doc.write();
3479 doc.close();
3480 var testEl = doc.createElement(tag);
3481 doc.documentElement.appendChild(testEl);
3482 var display = (window.getComputedStyle ? getComputedStyle(testEl, null) : testEl.currentStyle).display;
3483 iframe.parentNode.removeChild(iframe);
3484 return display;
3485 }; // actual show/hide function used by show() and hide() below
3486
3487
3488 var showHide = (el, show) => {
3489 var value = el.getAttribute('data-olddisplay'),
3490 display = el.style.display,
3491 computedDisplay = (window.getComputedStyle ? getComputedStyle(el, null) : el.currentStyle).display;
3492
3493 if (show) {
3494 if (!value && display === 'none') el.style.display = '';
3495 if (el.style.display === '' && computedDisplay === 'none') value = value || defaultDisplay(el.nodeName);
3496 } else {
3497 if (display && display !== 'none' || !(computedDisplay === 'none')) el.setAttribute('data-olddisplay', computedDisplay === 'none' ? display : computedDisplay);
3498 }
3499
3500 if (!show || el.style.display === 'none' || el.style.display === '') el.style.display = show ? value || '' : 'none';
3501 }; // helper functions
3502
3503
3504 var show = el => showHide(el, true);
3505
3506 exports.show = show;
3507
3508 var hide = el => showHide(el); //JavaScript HTML Sanitizer v2.0.3, (c) Alexander Yumashev, Jitbit Software.
3509 //homepage https://github.com/jitbit/HtmlSanitizer
3510 //License: MIT https://github.com/jitbit/HtmlSanitizer/blob/master/LICENSE
3511
3512
3513 exports.hide = hide;
3514 var HTMLSanitizer = new function () {
3515 var _tagWhitelist = {
3516 'A': true,
3517 'ABBR': true,
3518 'B': true,
3519 'BLOCKQUOTE': true,
3520 'BODY': true,
3521 'BR': true,
3522 'CENTER': true,
3523 'CODE': true,
3524 'DD': true,
3525 'DIV': true,
3526 'DL': true,
3527 'DT': true,
3528 'EM': true,
3529 'FONT': true,
3530 'H1': true,
3531 'H2': true,
3532 'H3': true,
3533 'H4': true,
3534 'H5': true,
3535 'H6': true,
3536 'HR': true,
3537 'I': true,
3538 'IMG': true,
3539 'LABEL': true,
3540 'LI': true,
3541 'OL': true,
3542 'P': true,
3543 'PRE': true,
3544 'SMALL': true,
3545 'SOURCE': true,
3546 'SPAN': true,
3547 'STRONG': true,
3548 'SUB': true,
3549 'SUP': true,
3550 'TABLE': true,
3551 'TBODY': true,
3552 'TR': true,
3553 'TD': true,
3554 'TH': true,
3555 'THEAD': true,
3556 'UL': true,
3557 'U': true,
3558 'VIDEO': true
3559 };
3560 var _contentTagWhiteList = {
3561 'FORM': true,
3562 'GOOGLE-SHEETS-HTML-ORIGIN': true
3563 }; //tags that will be converted to DIVs
3564
3565 var _attributeWhitelist = {
3566 'align': true,
3567 'color': true,
3568 'controls': true,
3569 'height': true,
3570 'href': true,
3571 'id': true,
3572 'src': true,
3573 'style': true,
3574 'target': true,
3575 'title': true,
3576 'type': true,
3577 'width': true
3578 };
3579 var _cssWhitelist = {
3580 'background-color': true,
3581 'color': true,
3582 'font-size': true,
3583 'font-weight': true,
3584 'text-align': true,
3585 'text-decoration': true,
3586 'width': true
3587 };
3588 var _schemaWhiteList = ['http:', 'https:', 'data:', 'm-files:', 'file:', 'ftp:', 'mailto:', 'pw:']; //which "protocols" are allowed in "href", "src" etc
3589
3590 var _uriAttributes = {
3591 'href': true,
3592 'action': true
3593 };
3594
3595 var _parser = new DOMParser();
3596
3597 this.SanitizeHTML = (input, extraSelector) => {
3598 if (input == null) return null;
3599 input = input.trim();
3600 if (input === "") return ""; //to save performance
3601 //firefox "bogus node" workaround for wysiwyg's
3602
3603 if (input === "<br>") return "";
3604 if (input.indexOf("<body") === -1) input = "<body>" + input + "</body>"; //add "body" otherwise some tags are skipped, like <style>
3605
3606 var doc = _parser.parseFromString(input, "text/html"); //DOM clobbering check (damn you firefox)
3607
3608
3609 if (doc.body.tagName !== 'BODY') doc.body.remove();
3610 if (typeof doc.createElement !== 'function') doc.createElement.remove();
3611
3612 function makeSanitizedCopy(node) {
3613 var newNode;
3614
3615 if (node.nodeType === Node.TEXT_NODE) {
3616 newNode = node.cloneNode(true);
3617 } else if (node.nodeType === Node.ELEMENT_NODE && (_tagWhitelist[node.tagName] || _contentTagWhiteList[node.tagName] || extraSelector && node.matches(extraSelector))) {
3618 //is tag allowed?
3619 if (_contentTagWhiteList[node.tagName]) newNode = doc.createElement('DIV'); //convert to DIV
3620 else newNode = doc.createElement(node.tagName);
3621
3622 for (var i = 0; i < node.attributes.length; i++) {
3623 var attr = node.attributes[i];
3624
3625 if (_attributeWhitelist[attr.name]) {
3626 if (attr.name === "style") {
3627 for (var s = 0; s < node.style.length; s++) {
3628 var styleName = node.style[s];
3629 if (_cssWhitelist[styleName]) newNode.style.setProperty(styleName, node.style.getPropertyValue(styleName));
3630 }
3631 } else {
3632 if (_uriAttributes[attr.name]) {
3633 //if this is a "uri" attribute, that can have "javascript:" or something
3634 if (attr.value.indexOf(":") > -1 && !startsWithAny(attr.value, _schemaWhiteList)) continue;
3635 }
3636
3637 newNode.setAttribute(attr.name, attr.value);
3638 }
3639 }
3640 }
3641
3642 for (var _i = 0; _i < node.childNodes.length; _i++) {
3643 var subCopy = makeSanitizedCopy(node.childNodes[_i]);
3644 newNode.appendChild(subCopy, false);
3645 } //remove useless empty spans (lots of those when pasting from MS Outlook)
3646
3647
3648 if ((newNode.tagName === "SPAN" || newNode.tagName === "B" || newNode.tagName === "I" || newNode.tagName === "U") && newNode.innerHTML.trim() === "") {
3649 return doc.createDocumentFragment();
3650 }
3651 } else {
3652 newNode = doc.createDocumentFragment();
3653 }
3654
3655 return newNode;
3656 }
3657
3658 var resultElement = makeSanitizedCopy(doc.body);
3659 return resultElement.innerHTML.replace(/div><div/g, "div>\n<div"); //replace is just for cleaner code
3660 };
3661
3662 function startsWithAny(str, substrings) {
3663 for (var i = 0; i < substrings.length; i++) {
3664 if (str.indexOf(substrings[i]) === 0) {
3665 return true;
3666 }
3667 }
3668
3669 return false;
3670 }
3671
3672 this.AllowedTags = _tagWhitelist;
3673 this.AllowedAttributes = _attributeWhitelist;
3674 this.AllowedCssStyles = _cssWhitelist;
3675 this.AllowedSchemas = _schemaWhiteList;
3676 }();
3677 exports.HTMLSanitizer = HTMLSanitizer;
3678
3679 /***/ })
3680
3681 /******/ });
3682 /************************************************************************/
3683 /******/ // The module cache
3684 /******/ var __webpack_module_cache__ = {};
3685 /******/
3686 /******/ // The require function
3687 /******/ function __webpack_require__(moduleId) {
3688 /******/ // Check if module is in cache
3689 /******/ if(__webpack_module_cache__[moduleId]) {
3690 /******/ return __webpack_module_cache__[moduleId].exports;
3691 /******/ }
3692 /******/ // Create a new module (and put it into the cache)
3693 /******/ var module = __webpack_module_cache__[moduleId] = {
3694 /******/ // no module.id needed
3695 /******/ // no module.loaded needed
3696 /******/ exports: {}
3697 /******/ };
3698 /******/
3699 /******/ // Execute the module function
3700 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3701 /******/
3702 /******/ // Return the exports of the module
3703 /******/ return module.exports;
3704 /******/ }
3705 /******/
3706 /************************************************************************/
3707 (() => {
3708 /*!********************************************************!*\
3709 !*** ../include/js/front-end/src/Entries/Lightcase.js ***!
3710 \********************************************************/
3711 /*! unknown exports (runtime-defined) */
3712 /*! runtime requirements: __webpack_require__ */
3713
3714
3715 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
3716
3717 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
3718
3719 var _Lightcase = __webpack_require__(/*! ../Lightboxes/Lightcase */ "../include/js/front-end/src/Lightboxes/Lightcase.js");
3720
3721 var Listeners = _interopRequireWildcard(__webpack_require__(/*! ../Listeners */ "../include/js/front-end/src/Listeners.js"));
3722
3723 var Layout = _interopRequireWildcard(__webpack_require__(/*! ../Layouts/Layout */ "../include/js/front-end/src/Layouts/Layout.js"));
3724
3725 jQuery(document).ready(function ($) {
3726 var lightbox = new _Lightcase.PhotonicLightcase($);
3727
3728 _Core.Core.setLightbox(lightbox);
3729
3730 lightbox.initialize('.photonic-standard-layout,.photonic-masonry-layout,.photonic-mosaic-layout');
3731 lightbox.initialize('a[data-rel="photonic-lightcase"]');
3732 lightbox.initialize('a[data-rel="photonic-lightcase-video"]');
3733 lightbox.initialize('a[data-rel="photonic-html5-video"]');
3734
3735 _Core.Core.executeCommon();
3736
3737 Listeners.addAllListeners();
3738 Layout.initializeLayouts(lightbox);
3739 });
3740 })();
3741
3742 /******/ })()
3743 ;