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-thickbox.js

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

3,633 lines 121.5 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/Thickbox.js":
2307 /*!**********************************************************!*\
2308 !*** ../include/js/front-end/src/Lightboxes/Thickbox.js ***!
2309 \**********************************************************/
2310 /*! flagged exports */
2311 /*! export PhotonicThickbox [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 Object.defineProperty(exports, "__esModule", ({
2320 value: true
2321 }));
2322 exports.PhotonicThickbox = void 0;
2323
2324 var _Lightbox = __webpack_require__(/*! ./Lightbox */ "../include/js/front-end/src/Lightboxes/Lightbox.js");
2325
2326 class PhotonicThickbox extends _Lightbox.Lightbox {
2327 constructor($) {
2328 super();
2329 this.$ = $;
2330 }
2331
2332 }
2333
2334 exports.PhotonicThickbox = PhotonicThickbox;
2335
2336 /***/ }),
2337
2338 /***/ "../include/js/front-end/src/Listeners.js":
2339 /*!************************************************!*\
2340 !*** ../include/js/front-end/src/Listeners.js ***!
2341 \************************************************/
2342 /*! flagged exports */
2343 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2344 /*! export addAllListeners [provided] [no usage info] [missing usage info prevents renaming] */
2345 /*! export addHelperMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2346 /*! export addLazyLoadListener [provided] [no usage info] [missing usage info prevents renaming] */
2347 /*! export addLevel2ClickListener [provided] [no usage info] [missing usage info prevents renaming] */
2348 /*! export addLevel3ExpandListener [provided] [no usage info] [missing usage info prevents renaming] */
2349 /*! export addMoreButtonListener [provided] [no usage info] [missing usage info prevents renaming] */
2350 /*! export addPasswordSubmitListener [provided] [no usage info] [missing usage info prevents renaming] */
2351 /*! export addSlideUpEnterListener [provided] [no usage info] [missing usage info prevents renaming] */
2352 /*! export addSlideUpLeaveListener [provided] [no usage info] [missing usage info prevents renaming] */
2353 /*! other exports [not provided] [no usage info] */
2354 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2355 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2356
2357
2358
2359 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2360
2361 Object.defineProperty(exports, "__esModule", ({
2362 value: true
2363 }));
2364 exports.addAllListeners = exports.addLazyLoadListener = exports.addSlideUpLeaveListener = exports.addSlideUpEnterListener = exports.addHelperMoreButtonListener = exports.addMoreButtonListener = exports.addLevel3ExpandListener = exports.addPasswordSubmitListener = exports.addLevel2ClickListener = void 0;
2365
2366 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2367
2368 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2369
2370 var Requests = _interopRequireWildcard(__webpack_require__(/*! ./Requests */ "../include/js/front-end/src/Requests.js"));
2371
2372 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2373
2374 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
2375
2376 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
2377
2378 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2379
2380 // .photonic-level-2-thumb:not(".gallery-page")
2381 var addLevel2ClickListener = () => {
2382 document.addEventListener('click', e => {
2383 if (!(e.target instanceof Element) || !e.target.closest('.photonic-level-2-thumb') || Photonic_JS.lightbox_library === 'none') {
2384 return;
2385 }
2386
2387 var clicked = e.target.closest('.photonic-level-2-thumb');
2388
2389 if (Util.hasClass(clicked, 'gallery-page')) {
2390 return;
2391 }
2392
2393 e.preventDefault();
2394 var container = clicked.closest('.photonic-level-2-container');
2395 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2396 var provider = galleryData['platform'],
2397 singular = galleryData['singular'],
2398 query = container.getAttribute('data-photonic-query');
2399 var args = {
2400 "panel_id": clicked.getAttribute('id'),
2401 "popup": galleryData['popup'],
2402 "photo_count": galleryData['photo-count'],
2403 "photo_more": galleryData['photo-more'] || '',
2404 "query": query
2405 };
2406 if (provider === 'google' || provider === 'zenfolio') args.thumb_size = galleryData['thumb-size'];
2407
2408 if (provider === 'flickr' || provider === 'smug' || provider === 'google' || provider === 'zenfolio') {
2409 args.overlay_size = galleryData['overlay-size'];
2410 args.overlay_video_size = galleryData['overlay-video-size'];
2411 }
2412
2413 if (provider === 'google') {
2414 args.overlay_crop = galleryData['overlay-crop'];
2415 }
2416
2417 Requests.displayLevel2(provider, singular, args);
2418 }, false);
2419 }; // .photonic-password-submit
2420
2421
2422 exports.addLevel2ClickListener = addLevel2ClickListener;
2423
2424 var addPasswordSubmitListener = () => {
2425 document.addEventListener('click', e => {
2426 if (!(e.target instanceof Element) || !e.target.closest('.photonic-password-submit')) {
2427 return;
2428 }
2429
2430 e.preventDefault();
2431 var clicked = e.target.closest('.photonic-password-submit');
2432 var modal = clicked.closest('.photonic-password-prompter'),
2433 container = clicked.closest('.photonic-level-2-container');
2434 var galleryData = JSON.parse(container.getAttribute('data-photonic'));
2435 var album_id = modal.getAttribute('id');
2436 var components = album_id.split('-');
2437 var provider = galleryData['platform'],
2438 singular_type = galleryData['singular'],
2439 album_key = components.slice(4).join('-'),
2440 thumb_id = "photonic-".concat(provider, "-").concat(singular_type, "-thumb-").concat(album_key),
2441 thumb = document.getElementById("".concat(thumb_id)),
2442 query = container.getAttribute('data-photonic-query');
2443 var password = modal.querySelector('input[name="photonic-' + provider + '-password"]');
2444 password = password.value;
2445
2446 var prompter = _Core.Core.prompterList["#photonic-".concat(provider, "-").concat(singular_type, "-prompter-").concat(album_key)];
2447
2448 if (prompter !== undefined && prompter !== null) {
2449 prompter.hide();
2450 }
2451
2452 _Core.Core.showSpinner();
2453
2454 var args = {
2455 'panel_id': thumb_id,
2456 "popup": galleryData['popup'],
2457 "photo_count": galleryData['photo-count'],
2458 "photo_more": galleryData['photo-more'] || '',
2459 "query": query
2460 };
2461
2462 if (provider === 'smug') {
2463 args.password = password;
2464 args.overlay_size = galleryData['overlay-size'];
2465 } else if (provider === 'zenfolio') {
2466 args.password = password;
2467 args.realm_id = thumb.getAttribute('data-photonic-realm');
2468 args.thumb_size = galleryData['thumb-size'];
2469 args.overlay_size = galleryData['overlay-size'];
2470 args.overlay_video_size = galleryData['overlay-video-size'];
2471 }
2472
2473 Requests.processRequest(provider, singular_type, album_key, args);
2474 }, false);
2475 }; // a.photonic-level-3-expand
2476
2477
2478 exports.addPasswordSubmitListener = addPasswordSubmitListener;
2479
2480 var addLevel3ExpandListener = () => {
2481 document.addEventListener('click', e => {
2482 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-level-3-expand')) {
2483 return;
2484 }
2485
2486 e.preventDefault();
2487 var current = e.target.closest('a.photonic-level-3-expand'),
2488 header = current.parentNode.parentNode.parentNode,
2489 stream = header.parentNode;
2490
2491 if (current.classList.contains('photonic-level-3-expand-plus')) {
2492 Requests.processL3Request(current, header, {
2493 'view': 'collections',
2494 'node': current.getAttribute('data-photonic-level-3'),
2495 'layout': current.getAttribute('data-photonic-layout'),
2496 'stream': stream.getAttribute('id')
2497 });
2498 } else if (current.classList.contains('photonic-level-3-expand-up')) {
2499 var display = Util.next(header, '.photonic-stream');
2500 Util.slideUpDown(display, 'hide');
2501 current.classList.remove('photonic-level-3-expand-up');
2502 current.classList.add('photonic-level-3-expand-down');
2503 current.setAttribute('title', Photonic_JS.maximize_panel === undefined ? 'Show' : Photonic_JS.maximize_panel);
2504 } else if (current.classList.contains('photonic-level-3-expand-down')) {
2505 var _display = Util.next(header, '.photonic-stream'); // Util.slideDown(display);
2506
2507
2508 Util.slideUpDown(_display, 'show');
2509 current.classList.remove('photonic-level-3-expand-down');
2510 current.classList.add('photonic-level-3-expand-up');
2511 current.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
2512 }
2513 }, false);
2514 }; // a.photonic-more-button.photonic-more-dynamic
2515
2516
2517 exports.addLevel3ExpandListener = addLevel3ExpandListener;
2518
2519 var addMoreButtonListener = () => {
2520 document.addEventListener('click', e => {
2521 if (!(e.target instanceof Element) || !e.target.closest('a.photonic-more-button.photonic-more-dynamic')) {
2522 return;
2523 }
2524
2525 e.preventDefault();
2526 var clicked = e.target.closest('a.photonic-more-button.photonic-more-dynamic');
2527 var container = clicked.parentNode.querySelector('.photonic-level-1-container, .photonic-level-2-container');
2528 var query = container.getAttribute('data-photonic-query'),
2529 provider = container.getAttribute('data-photonic-platform'),
2530 level = container.classList.contains('photonic-level-1-container') ? 'level-1' : 'level-2',
2531 containerId = container.getAttribute('id'),
2532 existing = container.querySelectorAll('figure');
2533
2534 _Core.Core.showSpinner();
2535
2536 Util.post(Photonic_JS.ajaxurl, {
2537 'action': 'photonic_load_more',
2538 'provider': provider,
2539 'query': query
2540 }, data => {
2541 var ret = Util.getElement(data),
2542 images = ret.querySelectorAll(".photonic-".concat(level)),
2543 more_button = ret.querySelector('.photonic-more-button'),
2544 one_existing = container.querySelector('a.photonic-lb');
2545 var anchors = [];
2546
2547 if (one_existing !== null) {
2548 images.forEach(image => {
2549 var a = image.querySelector('a');
2550
2551 if (a !== null) {
2552 a.setAttribute('rel', one_existing.getAttribute('rel'));
2553
2554 if (a.getAttribute('data-fancybox') != null) {
2555 a.setAttribute('data-fancybox', one_existing.getAttribute('data-fancybox'));
2556 } else if (a.getAttribute('data-rel') != null) {
2557 a.setAttribute('data-rel', one_existing.getAttribute('data-rel'));
2558 } else if (a.getAttribute('data-strip-group') != null) {
2559 a.setAttribute('data-strip-group', one_existing.getAttribute('data-strip-group'));
2560 } else if (a.getAttribute('data-gall') != null) {
2561 a.setAttribute('data-gall', one_existing.getAttribute('data-gall'));
2562 }
2563
2564 anchors.push(a);
2565 }
2566 });
2567 } // Can't do this above, which is only for L1
2568
2569
2570 images.forEach(image => container.appendChild(image));
2571
2572 _Core.Core.moveHTML5External();
2573
2574 if (images.length === 0) {
2575 _Core.Core.hideLoading();
2576
2577 Util.fadeOut(clicked);
2578 clicked.remove();
2579 }
2580
2581 var lightbox = _Core.Core.getLightbox();
2582
2583 if (Photonic_JS.lightbox_library === 'imagelightbox') {
2584 if (one_existing != null) {
2585 lightbox = _Core.Core.getLightboxList()['a[rel="' + one_existing.getAttribute('rel') + '"]'];
2586
2587 if (level === 'level-1') {
2588 lightbox.addToImageLightbox(anchors);
2589 }
2590 }
2591 } else if (Photonic_JS.lightbox_library === 'lightcase') {
2592 if (one_existing != null) {
2593 lightbox.initialize('a[data-rel="' + one_existing.getAttribute('data-rel') + '"]');
2594 }
2595 } else if (Photonic_JS.lightbox_library === 'lightgallery') {
2596 if (one_existing !== null) {
2597 lightbox = _Core.Core.getLightboxList()[one_existing.getAttribute('rel')];
2598 var galleryItems = [...lightbox.galleryItems];
2599 images.forEach(image => {
2600 var a = image.querySelector('a');
2601 var img = a.querySelector('img');
2602 var videoAttr;
2603
2604 if (a.getAttribute('data-photonic-media-type') === 'video') {
2605 videoAttr = JSON.parse(a.getAttribute('data-video'));
2606 }
2607
2608 galleryItems.push({
2609 "alt": img.getAttribute('alt'),
2610 "downloadUrl": a.getAttribute('data-download-url'),
2611 "src": a.getAttribute('data-photonic-media-type') === 'video' ? videoAttr.source[0].src : a.getAttribute('href'),
2612 "subHtml": a.getAttribute('data-sub-html'),
2613 "thumb": img.getAttribute('src')
2614 });
2615 });
2616 lightbox.updateSlides(galleryItems, 0);
2617 lightbox.refresh();
2618 } else {
2619 lightbox.initialize(container);
2620 }
2621 } else if (Photonic_JS.lightbox_library === 'venobox') {
2622 if (one_existing !== null) {
2623 var gallId = one_existing.getAttribute('data-gall');
2624
2625 if (one_existing.closest('.photonic-panel')) {
2626 gallId = one_existing.closest('.photonic-panel').getAttribute('id');
2627 }
2628
2629 lightbox.initialize('#' + gallId, true);
2630 }
2631 } else if (['bigpicture', 'featherlight', 'glightbox', 'spotlight'].includes(Photonic_JS.lightbox_library)) {
2632 lightbox.initialize(container);
2633 } else if (Photonic_JS.lightbox_library === 'baguettebox') {
2634 lightbox.initialize(null, true);
2635 } else if (Photonic_JS.lightbox_library === 'fancybox3') {
2636 if (one_existing != null) {
2637 lightbox.initialize(null, one_existing.getAttribute('data-fancybox'));
2638 }
2639 } else if (Photonic_JS.lightbox_library === 'photoswipe') {
2640 lightbox.initialize();
2641 }
2642
2643 function doImageLayout(images) {
2644 var new_query = ret.querySelector('.photonic-random-layout,.photonic-standard-layout,.photonic-masonry-layout,.photonic-mosaic-layout,.modal-gallery');
2645
2646 if (new_query != null) {
2647 container.setAttribute('data-photonic-query', new_query.getAttribute('data-photonic-query'));
2648 }
2649
2650 if (more_button == null) {
2651 Util.fadeOut(clicked);
2652 clicked.remove();
2653 }
2654
2655 if (Util.hasClass(container, 'photonic-mosaic-layout')) {
2656 (0, _Mosaic.Mosaic)(false, false, '#' + containerId);
2657 } else if (Util.hasClass(container, 'photonic-random-layout')) {
2658 (0, _Justified.JustifiedGrid)(false, false, '#' + containerId, lightbox);
2659 } else if (Util.hasClass(container, 'photonic-masonry-layout')) {
2660 images.forEach(image => {
2661 var img = image.querySelector('img');
2662 Util.fadeIn(img);
2663 img.style.display = 'block';
2664 });
2665
2666 _Core.Core.hideLoading();
2667 } else if (Util.hasClass(container, 'photonic-masonry-horizontal-layout')) {
2668 var existingCount = existing.length;
2669 images.forEach((image, idx) => {
2670 image.setAttribute('data-photonic-idx', existingCount + idx); // const img = image.querySelector('img');
2671 // Util.fadeIn(img);
2672 // img.style.display = 'block';
2673 });
2674 (0, _MasonryHorizontal.MasonryHorizontal)(false, false, '#' + containerId);
2675
2676 _Core.Core.hideLoading();
2677 } else {
2678 container.querySelectorAll('.photonic-' + level).forEach(el => {
2679 el.style.display = 'inline-block';
2680 });
2681
2682 _Core.Core.standardizeTitleWidths();
2683
2684 _Core.Core.hideLoading();
2685 }
2686
2687 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2688 }
2689
2690 if (container.classList.contains('sizes-present')) {
2691 _Core.Core.watchForImages(images);
2692
2693 doImageLayout(images);
2694 } else {
2695 _Core.Core.waitForImages(images).then(() => {
2696 doImageLayout(images);
2697 });
2698 }
2699 });
2700 });
2701 }; // input[type="button"].photonic-helper-more
2702
2703
2704 exports.addMoreButtonListener = addMoreButtonListener;
2705
2706 var addHelperMoreButtonListener = () => {
2707 document.addEventListener('click', e => {
2708 if (!(e.target instanceof Element) || !e.target.closest('input[type="button"].photonic-helper-more')) {
2709 return;
2710 }
2711
2712 e.preventDefault();
2713
2714 _Core.Core.showSpinner();
2715
2716 var clicked = e.target.closest('input[type="button"].photonic-helper-more');
2717 var table = clicked.closest('table');
2718 var nextToken = clicked.getAttribute('data-photonic-token') === undefined ? null : clicked.getAttribute('data-photonic-token'),
2719 provider = clicked.getAttribute('data-photonic-platform'),
2720 accessType = clicked.getAttribute('data-photonic-access');
2721 var args = {
2722 'action': 'photonic_helper_shortcode_more',
2723 'provider': provider,
2724 'access': accessType
2725 };
2726
2727 if (nextToken) {
2728 args.nextPageToken = nextToken;
2729 }
2730
2731 if (provider === 'google') {
2732 Util.post(Photonic_JS.ajaxurl, args, data => {
2733 var ret = Util.getElement(data);
2734 ret = Array.from(ret.getElementsByTagName('tr'));
2735
2736 if (ret.length > 0) {
2737 var tr = clicked.closest('tr');
2738
2739 if (tr) {
2740 tr.remove();
2741 }
2742
2743 ret.forEach((node, i) => {
2744 if (i !== 0) {
2745 table.appendChild(node);
2746 }
2747 });
2748 }
2749
2750 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2751
2752 _Core.Core.hideLoading();
2753 });
2754 }
2755 });
2756 };
2757
2758 exports.addHelperMoreButtonListener = addHelperMoreButtonListener;
2759
2760 var addSlideUpEnterListener = () => {
2761 document.addEventListener('mouseover', e => {
2762 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2763
2764 if (e.target instanceof Element && e.target.closest(slideup)) {
2765 var node = e.target.closest(slideup);
2766 var title = node.querySelector('.photonic-title');
2767 Util.slideUpTitle(title, 'show');
2768 node.setAttribute('title', '');
2769 }
2770 }, true);
2771 };
2772
2773 exports.addSlideUpEnterListener = addSlideUpEnterListener;
2774
2775 var addSlideUpLeaveListener = () => {
2776 document.addEventListener('mouseout', e => {
2777 var slideup = '.title-display-hover-slideup-show a, .photonic-slideshow.title-display-hover-slideup-show li';
2778
2779 if (e.target instanceof Element && e.target.closest(slideup)) {
2780 var node = e.target.closest(slideup);
2781 var title = node.querySelector('.photonic-title');
2782 Util.slideUpTitle(title, 'hide');
2783 node.setAttribute('title', Util.getText(node.getAttribute('data-title')));
2784 }
2785 }, true);
2786 };
2787
2788 exports.addSlideUpLeaveListener = addSlideUpLeaveListener;
2789
2790 var addLazyLoadListener = () => {
2791 var buttons = document.documentElement.querySelectorAll('input.photonic-show-gallery-button');
2792 Array.prototype.forEach.call(buttons, button => {
2793 button.addEventListener('click', Requests.lazyLoad);
2794 });
2795 buttons = document.documentElement.querySelectorAll('input.photonic-js-load-button');
2796 Array.prototype.forEach.call(buttons, button => {
2797 button.addEventListener('click', Requests.lazyLoad);
2798 button.click();
2799 });
2800 };
2801
2802 exports.addLazyLoadListener = addLazyLoadListener;
2803
2804 var addAllListeners = () => {
2805 addLevel2ClickListener();
2806 addPasswordSubmitListener();
2807 addLevel3ExpandListener();
2808 addMoreButtonListener();
2809 addHelperMoreButtonListener();
2810 addSlideUpEnterListener();
2811 addSlideUpLeaveListener();
2812 addLazyLoadListener();
2813 };
2814
2815 exports.addAllListeners = addAllListeners;
2816
2817 /***/ }),
2818
2819 /***/ "../include/js/front-end/src/Requests.js":
2820 /*!***********************************************!*\
2821 !*** ../include/js/front-end/src/Requests.js ***!
2822 \***********************************************/
2823 /*! flagged exports */
2824 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
2825 /*! export displayLevel2 [provided] [no usage info] [missing usage info prevents renaming] */
2826 /*! export lazyLoad [provided] [no usage info] [missing usage info prevents renaming] */
2827 /*! export processL3Request [provided] [no usage info] [missing usage info prevents renaming] */
2828 /*! export processRequest [provided] [no usage info] [missing usage info prevents renaming] */
2829 /*! other exports [not provided] [no usage info] */
2830 /*! runtime requirements: __webpack_exports__, __webpack_require__ */
2831 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2832
2833
2834
2835 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
2836
2837 Object.defineProperty(exports, "__esModule", ({
2838 value: true
2839 }));
2840 exports.lazyLoad = exports.processL3Request = exports.displayLevel2 = exports.processRequest = void 0;
2841
2842 var _Core = __webpack_require__(/*! ./Core */ "../include/js/front-end/src/Core.js");
2843
2844 var Util = _interopRequireWildcard(__webpack_require__(/*! ./Util */ "../include/js/front-end/src/Util.js"));
2845
2846 var _Justified = __webpack_require__(/*! ./Layouts/Justified */ "../include/js/front-end/src/Layouts/Justified.js");
2847
2848 var _Masonry = __webpack_require__(/*! ./Layouts/Masonry */ "../include/js/front-end/src/Layouts/Masonry.js");
2849
2850 var _MasonryHorizontal = __webpack_require__(/*! ./Layouts/MasonryHorizontal */ "../include/js/front-end/src/Layouts/MasonryHorizontal.js");
2851
2852 var _Mosaic = __webpack_require__(/*! ./Layouts/Mosaic */ "../include/js/front-end/src/Layouts/Mosaic.js");
2853
2854 var _Tooltip = __webpack_require__(/*! ./Components/Tooltip */ "../include/js/front-end/src/Components/Tooltip.js");
2855
2856 var _Modal = __webpack_require__(/*! ./Components/Modal */ "../include/js/front-end/src/Components/Modal.js");
2857
2858 var spinners = 0;
2859
2860 var bypassPopup = data => {
2861 _Core.Core.hideLoading();
2862
2863 var panel;
2864
2865 if (data instanceof Element) {
2866 panel = data;
2867 } else {
2868 panel = Util.getElement(data).firstElementChild;
2869 }
2870
2871 Util.hide(panel);
2872 var images = panel.querySelectorAll('img');
2873 images.forEach(image => {
2874 if ((image.getAttribute('src') === null || image.getAttribute('src') === '') && image.getAttribute('data-src') !== null) {
2875 image.setAttribute('src', image.getAttribute('data-src'));
2876 image.removeAttribute('data-src');
2877 }
2878 });
2879 document.body.appendChild(panel);
2880
2881 _Core.Core.moveHTML5External();
2882
2883 var lightbox = _Core.Core.getLightbox();
2884
2885 if (lightbox !== undefined && lightbox !== null) {
2886 lightbox.initializeForNewContainer('#' + panel.getAttribute('id'));
2887 }
2888
2889 var thumbs = panel.querySelectorAll('.photonic-lb');
2890
2891 if (thumbs.length > 0) {
2892 _Core.Core.setDeep('#' + thumbs[0].getAttribute('data-photonic-deep'));
2893
2894 var evt = new MouseEvent('click', {
2895 bubbles: true,
2896 cancelable: true,
2897 view: window
2898 }); // If cancelled, don't dispatch our event
2899
2900 !thumbs[0].dispatchEvent(evt);
2901 }
2902 };
2903
2904 var displayPopup = (data, provider, popup, panelId) => {
2905 var safePanelId = panelId.replace('.', '\\.'); // FOR EXISTING ELEMENTS WHICH NEED SANITIZED PANELID
2906
2907 var div = Util.getElement(data).firstElementChild;
2908 var grid = div.querySelector('.modal-gallery');
2909
2910 var doImageLayout = () => {
2911 var popupPanel = document.querySelector('#photonic-' + provider + '-' + popup + '-' + safePanelId);
2912
2913 if (popupPanel) {
2914 popupPanel.appendChild(div);
2915 Util.show(popupPanel);
2916 }
2917
2918 (0, _Modal.Modal)(div, {
2919 modalTarget: 'photonic-' + provider + '-panel-' + safePanelId,
2920 color: '#000',
2921 width: Photonic_JS.gallery_panel_width + '%',
2922 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
2923 });
2924
2925 _Core.Core.moveHTML5External();
2926
2927 var lightbox = _Core.Core.getLightbox();
2928
2929 if (lightbox !== undefined && lightbox !== null) {
2930 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
2931 }
2932
2933 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
2934
2935 _Core.Core.hideLoading();
2936 };
2937
2938 if (grid.classList.contains('sizes-present')) {
2939 _Core.Core.watchForImages(grid);
2940
2941 doImageLayout();
2942 } else {
2943 _Core.Core.waitForImages(grid).then(() => {
2944 doImageLayout();
2945 });
2946 }
2947 };
2948
2949 var redisplayPopupContents = (provider, panelId, panel, args) => {
2950 var panelEl = Util.getElement(panel);
2951
2952 if ('show' === args['popup']) {
2953 _Core.Core.hideLoading();
2954
2955 (0, _Modal.Modal)(panelEl, {
2956 modalTarget: 'photonic-' + provider + '-panel-' + panelId,
2957 color: '#000',
2958 width: Photonic_JS.gallery_panel_width + '%',
2959 closeFromRight: (100 - Photonic_JS.gallery_panel_width) / 2 + '%'
2960 });
2961 } else {
2962 bypassPopup(document.getElementById('photonic-' + provider + '-panel-' + panelId));
2963 }
2964 };
2965
2966 var processRequest = (provider, type, identifier, args) => {
2967 args['action'] = 'photonic_display_level_2_contents';
2968 Util.post(Photonic_JS.ajaxurl, args, function (data) {
2969 if (data.substr(0, Photonic_JS.password_failed.length) === Photonic_JS.password_failed) {
2970 _Core.Core.hideLoading();
2971
2972 var prompter = '#photonic-' + provider + '-' + type + '-prompter-' + identifier;
2973 var prompterDialog = _Core.Core.prompterList[prompter];
2974
2975 if (prompterDialog !== undefined && prompterDialog !== null) {
2976 prompterDialog.show();
2977 }
2978 } else {
2979 if ('show' === args['popup']) {
2980 displayPopup(data, provider, type, identifier);
2981 } else {
2982 if (data !== '') {
2983 bypassPopup(data);
2984 } else {
2985 _Core.Core.hideLoading();
2986 }
2987 }
2988 }
2989 });
2990 };
2991
2992 exports.processRequest = processRequest;
2993
2994 var displayLevel2 = (provider, type, args) => {
2995 var identifier = args['panel_id'].substr(('photonic-' + provider + '-' + type + '-thumb-').length);
2996 var panel = '#photonic-' + provider + '-panel-' + identifier;
2997 var existing = document.getElementById('photonic-' + provider + '-panel-' + identifier);
2998
2999 if (existing == null) {
3000 existing = document.getElementById(args['panel_id']);
3001
3002 if (existing.classList.contains('photonic-' + provider + '-passworded')) {
3003 _Core.Core.initializePasswordPrompter("#photonic-".concat(provider, "-").concat(type, "-prompter-").concat(identifier));
3004 } else {
3005 _Core.Core.showSpinner();
3006
3007 processRequest(provider, type, identifier, args);
3008 }
3009 } else {
3010 _Core.Core.showSpinner();
3011
3012 redisplayPopupContents(provider, identifier, panel, args);
3013 }
3014 };
3015
3016 exports.displayLevel2 = displayLevel2;
3017
3018 var processL3Request = (clicked, header, args) => {
3019 args['action'] = 'photonic_display_level_3_contents';
3020
3021 _Core.Core.showSpinner();
3022
3023 var lightbox = _Core.Core.getLightbox();
3024
3025 Util.post(Photonic_JS.ajaxurl, args, function (data) {
3026 var insert = Util.getElement(data);
3027
3028 if (header) {
3029 var layout = insert.querySelector('.photonic-level-2-container');
3030 var container = header.parentNode;
3031 var returnedStream = insert.firstElementChild;
3032 var collectionId = args.node.substr('flickr-collection-'.length);
3033 returnedStream.setAttribute('id', args.stream + '-' + collectionId);
3034 container.insertBefore(returnedStream, header.nextSibling);
3035
3036 if (layout.classList.contains('photonic-random-layout')) {
3037 (0, _Justified.JustifiedGrid)(false, false, null, lightbox);
3038 } else if (layout.classList.contains('photonic-mosaic-layout')) {
3039 (0, _Mosaic.Mosaic)(false, false);
3040 } else if (layout.classList.contains('photonic-masonry-layout')) {
3041 (0, _Masonry.Masonry)(false, false);
3042 } else if (layout.classList.contains('photonic-masonry-horizontal-layout')) {
3043 (0, _MasonryHorizontal.MasonryHorizontal)(false, false);
3044 } else if (layout.classList.contains('sizes-present')) {
3045 _Core.Core.watchForImages(layout);
3046 }
3047
3048 var level2 = returnedStream.querySelectorAll('.photonic-level-2');
3049 level2.forEach(function (item) {
3050 item.style.display = 'inline-block';
3051 });
3052 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3053 clicked.classList.remove('photonic-level-3-expand-plus');
3054 clicked.classList.add('photonic-level-3-expand-up');
3055 clicked.setAttribute('title', Photonic_JS.minimize_panel === undefined ? 'Hide' : Photonic_JS.minimize_panel);
3056 }
3057
3058 _Core.Core.hideLoading();
3059 });
3060 };
3061
3062 exports.processL3Request = processL3Request;
3063
3064 var lazyLoad = evt => {
3065 spinners++;
3066
3067 _Core.Core.showSpinner();
3068
3069 var clicked = evt.currentTarget;
3070 var shortcode = clicked.getAttribute('data-photonic-shortcode');
3071 var args = {
3072 'action': 'photonic_lazy_load',
3073 'shortcode': shortcode
3074 };
3075
3076 var countdownSpinners = () => {
3077 spinners--;
3078
3079 if (spinners <= 0) {
3080 _Core.Core.hideLoading();
3081 }
3082 };
3083
3084 Util.post(Photonic_JS.ajaxurl, args, data => {
3085 var div = document.createElement('div');
3086 div.innerHTML = data;
3087 div = div.firstElementChild;
3088
3089 if (div) {
3090 var divId = div.getAttribute('id');
3091 var divClass = divId.substring(0, divId.lastIndexOf('-'));
3092 var streams = document.documentElement.querySelectorAll('.' + divClass);
3093 var max = 0;
3094 streams.forEach(stream => {
3095 var streamId = stream.getAttribute('id');
3096 streamId = streamId.substring(streamId.lastIndexOf('-') + 1);
3097 streamId = parseInt(streamId, 10);
3098 max = Math.max(max, streamId);
3099 });
3100 max = max + 1;
3101 var regex = new RegExp(divId, 'gi');
3102 div.innerHTML = data.replace(regex, divClass + '-' + max).replace('photonic-slideshow-' + divId.substring(divId.lastIndexOf('-') + 1), 'photonic-slideshow-' + max);
3103 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
3104
3105 div.querySelectorAll('figure.photonic-level-2').forEach(figure => {
3106 if (figure.getAttribute('id') != null) {
3107 var figId = figure.getAttribute('id');
3108 var modId = figId.substring(0, figId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3109
3110 figure.setAttribute('id', modId);
3111 var anchor = figure.querySelector('a');
3112
3113 if (anchor.getAttribute('id') != null) {
3114 var anchorId = anchor.getAttribute('id');
3115 var modAnchorId = anchorId.substring(0, anchorId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3116
3117 anchor.setAttribute('id', modAnchorId);
3118 }
3119
3120 var prompter = figure.querySelector('.photonic-password-prompter');
3121
3122 if (prompter != null && prompter.getAttribute('id') != null) {
3123 var prompterId = prompter.getAttribute('id');
3124 var modPrompterId = prompterId.substring(0, prompterId.lastIndexOf('-') + 1) + max; // Replace last part of id with the "max"
3125
3126 prompter.setAttribute('id', modPrompterId);
3127 }
3128 }
3129 });
3130 clicked.insertAdjacentElement('afterend', div);
3131 var newDivId = divClass + '-' + max;
3132
3133 var lightbox = _Core.Core.getLightbox();
3134
3135 if (lightbox !== undefined && lightbox !== null) {
3136 lightbox.initializeForNewContainer('#' + div.getAttribute('id'));
3137 }
3138
3139 if (document.querySelectorAll('#' + newDivId + ' .photonic-random-layout').length > 0) {
3140 (0, _Justified.JustifiedGrid)(false, true, '#' + newDivId + ' .photonic-random-layout', lightbox);
3141 spinners--;
3142 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-layout').length > 0) {
3143 (0, _Masonry.Masonry)(false, true, '#' + newDivId + ' .photonic-masonry-layout');
3144 spinners--;
3145 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-masonry-horizontal-layout').length > 0) {
3146 (0, _MasonryHorizontal.MasonryHorizontal)(false, true, '#' + newDivId + ' .photonic-masonry-horizontal-layout');
3147 spinners--;
3148 } else if (document.querySelectorAll('#' + newDivId + ' .photonic-mosaic-layout').length > 0) {
3149 (0, _Mosaic.Mosaic)(false, true, '#' + newDivId + ' .photonic-mosaic-layout');
3150 spinners--;
3151 } // Slider(document.querySelector('#photonic-slideshow-' + max));
3152
3153
3154 if (div.classList.contains('sizes-present') || div.querySelector('.sizes-present') !== null) {
3155 _Core.Core.watchForImages(div);
3156
3157 _Core.Core.standardizeTitleWidths();
3158
3159 countdownSpinners();
3160 } else {
3161 _Core.Core.waitForImages(div).then(() => {
3162 var standard = document.documentElement.querySelectorAll('#' + newDivId + ' .photonic-standard-layout .photonic-level-1, ' + '#' + newDivId + ' .photonic-standard-layout .photonic-level-2');
3163 standard.forEach(image => {
3164 image.style.display = 'inline-block';
3165 });
3166
3167 _Core.Core.standardizeTitleWidths();
3168
3169 countdownSpinners();
3170 });
3171 }
3172
3173 _Core.Core.moveHTML5External();
3174
3175 clicked.parentNode.removeChild(clicked);
3176 (0, _Tooltip.Tooltip)('[data-photonic-tooltip]', '.photonic-tooltip-container');
3177
3178 if (spinners <= 0) {
3179 _Core.Core.hideLoading();
3180 }
3181 }
3182 });
3183 };
3184
3185 exports.lazyLoad = lazyLoad;
3186
3187 /***/ }),
3188
3189 /***/ "../include/js/front-end/src/Util.js":
3190 /*!*******************************************!*\
3191 !*** ../include/js/front-end/src/Util.js ***!
3192 \*******************************************/
3193 /*! flagged exports */
3194 /*! export HTMLSanitizer [provided] [no usage info] [missing usage info prevents renaming] */
3195 /*! export __esModule [provided] [no usage info] [missing usage info prevents renaming] */
3196 /*! export fadeIn [provided] [no usage info] [missing usage info prevents renaming] */
3197 /*! export fadeOut [provided] [no usage info] [missing usage info prevents renaming] */
3198 /*! export get [provided] [no usage info] [missing usage info prevents renaming] */
3199 /*! export getElement [provided] [no usage info] [missing usage info prevents renaming] */
3200 /*! export getText [provided] [no usage info] [missing usage info prevents renaming] */
3201 /*! export hasClass [provided] [no usage info] [missing usage info prevents renaming] */
3202 /*! export hide [provided] [no usage info] [missing usage info prevents renaming] */
3203 /*! export next [provided] [no usage info] [missing usage info prevents renaming] */
3204 /*! export post [provided] [no usage info] [missing usage info prevents renaming] */
3205 /*! export show [provided] [no usage info] [missing usage info prevents renaming] */
3206 /*! export slideUpDown [provided] [no usage info] [missing usage info prevents renaming] */
3207 /*! export slideUpTitle [provided] [no usage info] [missing usage info prevents renaming] */
3208 /*! other exports [not provided] [no usage info] */
3209 /*! runtime requirements: __webpack_exports__ */
3210 /***/ ((__unused_webpack_module, exports) => {
3211
3212
3213
3214 Object.defineProperty(exports, "__esModule", ({
3215 value: true
3216 }));
3217 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;
3218
3219 // Utilities for Photonic
3220 var hasClass = (element, className) => {
3221 if (element.classList) {
3222 return element.classList.contains(className);
3223 } else {
3224 return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className);
3225 }
3226 };
3227
3228 exports.hasClass = hasClass;
3229
3230 function ajax(method, url, args, callback) {
3231 var xhr = new XMLHttpRequest();
3232 xhr.open(method, url);
3233
3234 xhr.onreadystatechange = function () {
3235 if (xhr.readyState === 4) {
3236 if (xhr.status === 200) {
3237 var data = xhr.responseText;
3238 callback(data);
3239 }
3240 }
3241 };
3242
3243 var form = new FormData();
3244
3245 for (var [key, value] of Object.entries(args)) {
3246 form.append(key, value);
3247 }
3248
3249 xhr.send(form);
3250 }
3251
3252 var post = (url, args, callback) => {
3253 ajax('POST', url, args, callback);
3254 };
3255
3256 exports.post = post;
3257
3258 var get = (url, args, callback) => {
3259 ajax('GET', url, args, callback);
3260 };
3261
3262 exports.get = get;
3263
3264 var next = (elem, selector) => {
3265 var sibling = elem.nextElementSibling;
3266 if (!selector) return sibling;
3267
3268 while (sibling) {
3269 if (sibling.matches(selector)) return sibling;
3270 sibling = sibling.nextElementSibling;
3271 }
3272 };
3273
3274 exports.next = next;
3275
3276 var getElement = value => {
3277 var parser = new DOMParser();
3278 var doc = parser.parseFromString(value, 'text/html');
3279 return doc.body;
3280 };
3281
3282 exports.getElement = getElement;
3283
3284 var getText = value => {
3285 // Not using innerHTML because of vulnerability to XSS
3286 if (value == null) {
3287 return '';
3288 }
3289
3290 return value.replace(/<[^>]+>/g, '');
3291 };
3292
3293 exports.getText = getText;
3294
3295 var slideUpDown = (element, state) => {
3296 if (element != null && element.classList) {
3297 if (!element.classList.contains('photonic-can-slide')) {
3298 element.classList.add('photonic-can-slide');
3299 }
3300
3301 if ('show' === state) {
3302 element.classList.remove('photonic-can-slide-hide');
3303 element.style.height = "".concat(element.scrollHeight, "px");
3304 } else {
3305 element.classList.add('photonic-can-slide-hide');
3306 element.style.height = 0;
3307 }
3308 }
3309 };
3310
3311 exports.slideUpDown = slideUpDown;
3312
3313 var slideUpTitle = (element, state) => {
3314 if (element && element.classList) {
3315 if ('show' === state) {
3316 var currentPadding = 0;
3317
3318 if (element.offsetHeight) {
3319 currentPadding = parseInt(getComputedStyle(element).paddingTop.slice(0, -2)) * 2;
3320 }
3321
3322 element.style.height = element.scrollHeight + 6 - currentPadding + 'px';
3323 element.classList.add('slideup-show');
3324 } else {
3325 element.style.height = '';
3326 element.classList.remove('slideup-show');
3327 }
3328 }
3329 };
3330
3331 exports.slideUpTitle = slideUpTitle;
3332
3333 var fadeIn = el => {
3334 if (!hasClass(el, 'fade-in')) {
3335 el.style.display = 'block';
3336 el.style.visibility = 'visible';
3337 el.classList.add('fade-in');
3338 }
3339 };
3340
3341 exports.fadeIn = fadeIn;
3342
3343 var fadeOut = (el, duration) => {
3344 var s = el.style,
3345 step = 25 / (duration || 500);
3346 s.opacity = s.opacity || 1;
3347
3348 (function fade() {
3349 s.opacity -= step;
3350
3351 if (s.opacity < 0) {
3352 s.display = "none";
3353 el.classList.remove('fade-in');
3354 } else {
3355 setTimeout(fade, 25);
3356 }
3357 })();
3358 }; // get the default display style of an element
3359
3360
3361 exports.fadeOut = fadeOut;
3362
3363 var defaultDisplay = tag => {
3364 var iframe = document.createElement('iframe');
3365 iframe.setAttribute('frameborder', 0);
3366 iframe.setAttribute('width', 0);
3367 iframe.setAttribute('height', 0);
3368 document.documentElement.appendChild(iframe);
3369 var doc = (iframe.contentWindow || iframe.contentDocument).document; // IE support
3370
3371 doc.write();
3372 doc.close();
3373 var testEl = doc.createElement(tag);
3374 doc.documentElement.appendChild(testEl);
3375 var display = (window.getComputedStyle ? getComputedStyle(testEl, null) : testEl.currentStyle).display;
3376 iframe.parentNode.removeChild(iframe);
3377 return display;
3378 }; // actual show/hide function used by show() and hide() below
3379
3380
3381 var showHide = (el, show) => {
3382 var value = el.getAttribute('data-olddisplay'),
3383 display = el.style.display,
3384 computedDisplay = (window.getComputedStyle ? getComputedStyle(el, null) : el.currentStyle).display;
3385
3386 if (show) {
3387 if (!value && display === 'none') el.style.display = '';
3388 if (el.style.display === '' && computedDisplay === 'none') value = value || defaultDisplay(el.nodeName);
3389 } else {
3390 if (display && display !== 'none' || !(computedDisplay === 'none')) el.setAttribute('data-olddisplay', computedDisplay === 'none' ? display : computedDisplay);
3391 }
3392
3393 if (!show || el.style.display === 'none' || el.style.display === '') el.style.display = show ? value || '' : 'none';
3394 }; // helper functions
3395
3396
3397 var show = el => showHide(el, true);
3398
3399 exports.show = show;
3400
3401 var hide = el => showHide(el); //JavaScript HTML Sanitizer v2.0.3, (c) Alexander Yumashev, Jitbit Software.
3402 //homepage https://github.com/jitbit/HtmlSanitizer
3403 //License: MIT https://github.com/jitbit/HtmlSanitizer/blob/master/LICENSE
3404
3405
3406 exports.hide = hide;
3407 var HTMLSanitizer = new function () {
3408 var _tagWhitelist = {
3409 'A': true,
3410 'ABBR': true,
3411 'B': true,
3412 'BLOCKQUOTE': true,
3413 'BODY': true,
3414 'BR': true,
3415 'CENTER': true,
3416 'CODE': true,
3417 'DD': true,
3418 'DIV': true,
3419 'DL': true,
3420 'DT': true,
3421 'EM': true,
3422 'FONT': true,
3423 'H1': true,
3424 'H2': true,
3425 'H3': true,
3426 'H4': true,
3427 'H5': true,
3428 'H6': true,
3429 'HR': true,
3430 'I': true,
3431 'IMG': true,
3432 'LABEL': true,
3433 'LI': true,
3434 'OL': true,
3435 'P': true,
3436 'PRE': true,
3437 'SMALL': true,
3438 'SOURCE': true,
3439 'SPAN': true,
3440 'STRONG': true,
3441 'SUB': true,
3442 'SUP': true,
3443 'TABLE': true,
3444 'TBODY': true,
3445 'TR': true,
3446 'TD': true,
3447 'TH': true,
3448 'THEAD': true,
3449 'UL': true,
3450 'U': true,
3451 'VIDEO': true
3452 };
3453 var _contentTagWhiteList = {
3454 'FORM': true,
3455 'GOOGLE-SHEETS-HTML-ORIGIN': true
3456 }; //tags that will be converted to DIVs
3457
3458 var _attributeWhitelist = {
3459 'align': true,
3460 'color': true,
3461 'controls': true,
3462 'height': true,
3463 'href': true,
3464 'id': true,
3465 'src': true,
3466 'style': true,
3467 'target': true,
3468 'title': true,
3469 'type': true,
3470 'width': true
3471 };
3472 var _cssWhitelist = {
3473 'background-color': true,
3474 'color': true,
3475 'font-size': true,
3476 'font-weight': true,
3477 'text-align': true,
3478 'text-decoration': true,
3479 'width': true
3480 };
3481 var _schemaWhiteList = ['http:', 'https:', 'data:', 'm-files:', 'file:', 'ftp:', 'mailto:', 'pw:']; //which "protocols" are allowed in "href", "src" etc
3482
3483 var _uriAttributes = {
3484 'href': true,
3485 'action': true
3486 };
3487
3488 var _parser = new DOMParser();
3489
3490 this.SanitizeHTML = (input, extraSelector) => {
3491 if (input == null) return null;
3492 input = input.trim();
3493 if (input === "") return ""; //to save performance
3494 //firefox "bogus node" workaround for wysiwyg's
3495
3496 if (input === "<br>") return "";
3497 if (input.indexOf("<body") === -1) input = "<body>" + input + "</body>"; //add "body" otherwise some tags are skipped, like <style>
3498
3499 var doc = _parser.parseFromString(input, "text/html"); //DOM clobbering check (damn you firefox)
3500
3501
3502 if (doc.body.tagName !== 'BODY') doc.body.remove();
3503 if (typeof doc.createElement !== 'function') doc.createElement.remove();
3504
3505 function makeSanitizedCopy(node) {
3506 var newNode;
3507
3508 if (node.nodeType === Node.TEXT_NODE) {
3509 newNode = node.cloneNode(true);
3510 } else if (node.nodeType === Node.ELEMENT_NODE && (_tagWhitelist[node.tagName] || _contentTagWhiteList[node.tagName] || extraSelector && node.matches(extraSelector))) {
3511 //is tag allowed?
3512 if (_contentTagWhiteList[node.tagName]) newNode = doc.createElement('DIV'); //convert to DIV
3513 else newNode = doc.createElement(node.tagName);
3514
3515 for (var i = 0; i < node.attributes.length; i++) {
3516 var attr = node.attributes[i];
3517
3518 if (_attributeWhitelist[attr.name]) {
3519 if (attr.name === "style") {
3520 for (var s = 0; s < node.style.length; s++) {
3521 var styleName = node.style[s];
3522 if (_cssWhitelist[styleName]) newNode.style.setProperty(styleName, node.style.getPropertyValue(styleName));
3523 }
3524 } else {
3525 if (_uriAttributes[attr.name]) {
3526 //if this is a "uri" attribute, that can have "javascript:" or something
3527 if (attr.value.indexOf(":") > -1 && !startsWithAny(attr.value, _schemaWhiteList)) continue;
3528 }
3529
3530 newNode.setAttribute(attr.name, attr.value);
3531 }
3532 }
3533 }
3534
3535 for (var _i = 0; _i < node.childNodes.length; _i++) {
3536 var subCopy = makeSanitizedCopy(node.childNodes[_i]);
3537 newNode.appendChild(subCopy, false);
3538 } //remove useless empty spans (lots of those when pasting from MS Outlook)
3539
3540
3541 if ((newNode.tagName === "SPAN" || newNode.tagName === "B" || newNode.tagName === "I" || newNode.tagName === "U") && newNode.innerHTML.trim() === "") {
3542 return doc.createDocumentFragment();
3543 }
3544 } else {
3545 newNode = doc.createDocumentFragment();
3546 }
3547
3548 return newNode;
3549 }
3550
3551 var resultElement = makeSanitizedCopy(doc.body);
3552 return resultElement.innerHTML.replace(/div><div/g, "div>\n<div"); //replace is just for cleaner code
3553 };
3554
3555 function startsWithAny(str, substrings) {
3556 for (var i = 0; i < substrings.length; i++) {
3557 if (str.indexOf(substrings[i]) === 0) {
3558 return true;
3559 }
3560 }
3561
3562 return false;
3563 }
3564
3565 this.AllowedTags = _tagWhitelist;
3566 this.AllowedAttributes = _attributeWhitelist;
3567 this.AllowedCssStyles = _cssWhitelist;
3568 this.AllowedSchemas = _schemaWhiteList;
3569 }();
3570 exports.HTMLSanitizer = HTMLSanitizer;
3571
3572 /***/ })
3573
3574 /******/ });
3575 /************************************************************************/
3576 /******/ // The module cache
3577 /******/ var __webpack_module_cache__ = {};
3578 /******/
3579 /******/ // The require function
3580 /******/ function __webpack_require__(moduleId) {
3581 /******/ // Check if module is in cache
3582 /******/ if(__webpack_module_cache__[moduleId]) {
3583 /******/ return __webpack_module_cache__[moduleId].exports;
3584 /******/ }
3585 /******/ // Create a new module (and put it into the cache)
3586 /******/ var module = __webpack_module_cache__[moduleId] = {
3587 /******/ // no module.id needed
3588 /******/ // no module.loaded needed
3589 /******/ exports: {}
3590 /******/ };
3591 /******/
3592 /******/ // Execute the module function
3593 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
3594 /******/
3595 /******/ // Return the exports of the module
3596 /******/ return module.exports;
3597 /******/ }
3598 /******/
3599 /************************************************************************/
3600 (() => {
3601 /*!*******************************************************!*\
3602 !*** ../include/js/front-end/src/Entries/Thickbox.js ***!
3603 \*******************************************************/
3604 /*! unknown exports (runtime-defined) */
3605 /*! runtime requirements: __webpack_require__ */
3606
3607
3608 var _interopRequireWildcard = __webpack_require__(/*! @babel/runtime/helpers/interopRequireWildcard */ "../../../../../node_modules/@babel/runtime/helpers/interopRequireWildcard.js");
3609
3610 var _Core = __webpack_require__(/*! ../Core */ "../include/js/front-end/src/Core.js");
3611
3612 var _Thickbox = __webpack_require__(/*! ../Lightboxes/Thickbox */ "../include/js/front-end/src/Lightboxes/Thickbox.js");
3613
3614 var Listeners = _interopRequireWildcard(__webpack_require__(/*! ../Listeners */ "../include/js/front-end/src/Listeners.js"));
3615
3616 var Layout = _interopRequireWildcard(__webpack_require__(/*! ../Layouts/Layout */ "../include/js/front-end/src/Layouts/Layout.js"));
3617
3618 jQuery(document).ready(function ($) {
3619 var lightbox = new _Thickbox.PhotonicThickbox($);
3620
3621 _Core.Core.setLightbox(lightbox);
3622
3623 lightbox.initialize();
3624
3625 _Core.Core.executeCommon();
3626
3627 Listeners.addAllListeners();
3628 Layout.initializeLayouts(lightbox);
3629 });
3630 })();
3631
3632 /******/ })()
3633 ;