(function (global, factory){
typeof exports==='object'&&typeof module!=='undefined' ? module.exports=factory() :
typeof define==='function'&&define.amd ? define(factory) :
(global=typeof globalThis!=='undefined' ? globalThis:global||self, global.fjGallery=factory());
})(this, (function (){ 'use strict';
let win;
if('undefined'!==typeof window){
win=window;
}else if('undefined'!==typeof global){
win=global;
}else if('undefined'!==typeof self){
win=self;
}else{
win={};}
var global$1=win;
function throttle(delay, callback, options){
var _ref=options||{},
_ref$noTrailing=_ref.noTrailing,
noTrailing=_ref$noTrailing===void 0 ? false:_ref$noTrailing,
_ref$noLeading=_ref.noLeading,
noLeading=_ref$noLeading===void 0 ? false:_ref$noLeading,
_ref$debounceMode=_ref.debounceMode,
debounceMode=_ref$debounceMode===void 0 ? undefined:_ref$debounceMode;
var timeoutID;
var cancelled=false;
var lastExec=0;
function clearExistingTimeout(){
if(timeoutID){
clearTimeout(timeoutID);
}}
function cancel(options){
var _ref2=options||{},
_ref2$upcomingOnly=_ref2.upcomingOnly,
upcomingOnly=_ref2$upcomingOnly===void 0 ? false:_ref2$upcomingOnly;
clearExistingTimeout();
cancelled = !upcomingOnly;
}
function wrapper(){
for (var _len=arguments.length, arguments_=new Array(_len), _key=0; _key < _len; _key++){
arguments_[_key]=arguments[_key];
}
var self=this;
var elapsed=Date.now() - lastExec;
if(cancelled){
return;
}
function exec(){
lastExec=Date.now();
callback.apply(self, arguments_);
}
function clear(){
timeoutID=undefined;
}
if(!noLeading&&debounceMode&&!timeoutID){
exec();
}
clearExistingTimeout();
if(debounceMode===undefined&&elapsed > delay){
if(noLeading){
lastExec=Date.now();
if(!noTrailing){
timeoutID=setTimeout(debounceMode ? clear:exec, delay);
}}else{
exec();
}}else if(noTrailing!==true){
timeoutID=setTimeout(debounceMode ? clear:exec, debounceMode===undefined ? delay - elapsed:delay);
}}
wrapper.cancel=cancel;
return wrapper;
}
function debounce(delay, callback, options){
var _ref=options||{},
_ref$atBegin=_ref.atBegin,
atBegin=_ref$atBegin===void 0 ? false:_ref$atBegin;
return throttle(delay, callback, {
debounceMode: atBegin!==false
});
}
var rafSchd=function rafSchd(fn){
var lastArgs=[];
var frameId=null;
var wrapperFn=function wrapperFn(){
for (var _len=arguments.length, args=new Array(_len), _key=0; _key < _len; _key++){
args[_key]=arguments[_key];
}
lastArgs=args;
if(frameId){
return;
}
frameId=requestAnimationFrame(function (){
frameId=null;
fn.apply(void 0, lastArgs);
});
};
wrapperFn.cancel=function (){
if(!frameId){
return;
}
cancelAnimationFrame(frameId);
frameId=null;
};
return wrapperFn;
};
var row={exports: {}};
var Row$1=row.exports=function (params){
this.top=params.top;
this.left=params.left;
this.width=params.width;
this.spacing=params.spacing;
this.targetRowHeight=params.targetRowHeight;
this.targetRowHeightTolerance=params.targetRowHeightTolerance;
this.minAspectRatio=this.width / params.targetRowHeight * (1 - params.targetRowHeightTolerance);
this.maxAspectRatio=this.width / params.targetRowHeight * (1 + params.targetRowHeightTolerance);
this.edgeCaseMinRowHeight=params.edgeCaseMinRowHeight;
this.edgeCaseMaxRowHeight=params.edgeCaseMaxRowHeight;
this.widowLayoutStyle=params.widowLayoutStyle;
this.isBreakoutRow=params.isBreakoutRow;
this.items=[];
this.height=0;
};
Row$1.prototype={
addItem: function (itemData){
var newItems=this.items.concat(itemData),
rowWidthWithoutSpacing=this.width - (newItems.length - 1) * this.spacing,
newAspectRatio=newItems.reduce(function (sum, item){
return sum + item.aspectRatio;
}, 0),
targetAspectRatio=rowWidthWithoutSpacing / this.targetRowHeight,
previousRowWidthWithoutSpacing,
previousAspectRatio,
previousTargetAspectRatio;
if(this.isBreakoutRow){
if(this.items.length===0){
if(itemData.aspectRatio >=1){
this.items.push(itemData);
this.completeLayout(rowWidthWithoutSpacing / itemData.aspectRatio, 'justify');
return true;
}}
}
if(newAspectRatio < this.minAspectRatio){
this.items.push(Object.assign({}, itemData));
return true;
}else if(newAspectRatio > this.maxAspectRatio){
if(this.items.length===0){
this.items.push(Object.assign({}, itemData));
this.completeLayout(rowWidthWithoutSpacing / newAspectRatio, 'justify');
return true;
}
previousRowWidthWithoutSpacing=this.width - (this.items.length - 1) * this.spacing;
previousAspectRatio=this.items.reduce(function (sum, item){
return sum + item.aspectRatio;
}, 0);
previousTargetAspectRatio=previousRowWidthWithoutSpacing / this.targetRowHeight;
if(Math.abs(newAspectRatio - targetAspectRatio) > Math.abs(previousAspectRatio - previousTargetAspectRatio)){
this.completeLayout(previousRowWidthWithoutSpacing / previousAspectRatio, 'justify');
return false;
}else{
this.items.push(Object.assign({}, itemData));
this.completeLayout(rowWidthWithoutSpacing / newAspectRatio, 'justify');
return true;
}}else{
this.items.push(Object.assign({}, itemData));
this.completeLayout(rowWidthWithoutSpacing / newAspectRatio, 'justify');
return true;
}},
isLayoutComplete: function (){
return this.height > 0;
},
completeLayout: function (newHeight, widowLayoutStyle){
var itemWidthSum=this.left,
rowWidthWithoutSpacing=this.width - (this.items.length - 1) * this.spacing,
clampedToNativeRatio,
clampedHeight,
errorWidthPerItem,
roundedCumulativeErrors,
singleItemGeometry,
centerOffset;
if(typeof widowLayoutStyle==='undefined'||['justify', 'center', 'left'].indexOf(widowLayoutStyle) < 0){
widowLayoutStyle='left';
}
clampedHeight=Math.max(this.edgeCaseMinRowHeight, Math.min(newHeight, this.edgeCaseMaxRowHeight));
if(newHeight!==clampedHeight){
this.height=clampedHeight;
clampedToNativeRatio=rowWidthWithoutSpacing / clampedHeight / (rowWidthWithoutSpacing / newHeight);
}else{
this.height=newHeight;
clampedToNativeRatio=1.0;
}
this.items.forEach(function (item){
item.top=this.top;
item.width=item.aspectRatio * this.height * clampedToNativeRatio;
item.height=this.height;
item.left=itemWidthSum;
itemWidthSum +=item.width + this.spacing;
}, this);
if(widowLayoutStyle==='justify'){
itemWidthSum -=this.spacing + this.left;
errorWidthPerItem=(itemWidthSum - this.width) / this.items.length;
roundedCumulativeErrors=this.items.map(function (item, i){
return Math.round((i + 1) * errorWidthPerItem);
});
if(this.items.length===1){
singleItemGeometry=this.items[0];
singleItemGeometry.width -=Math.round(errorWidthPerItem);
}else{
this.items.forEach(function (item, i){
if(i > 0){
item.left -=roundedCumulativeErrors[i - 1];
item.width -=roundedCumulativeErrors[i] - roundedCumulativeErrors[i - 1];
}else{
item.width -=roundedCumulativeErrors[i];
}});
}}else if(widowLayoutStyle==='center'){
centerOffset=(this.width - itemWidthSum) / 2;
this.items.forEach(function (item){
item.left +=centerOffset + this.spacing;
}, this);
}},
forceComplete: function (fitToWidth, rowHeight){
if(typeof rowHeight==='number'){
this.completeLayout(rowHeight, this.widowLayoutStyle);
}else{
this.completeLayout(this.targetRowHeight, this.widowLayoutStyle);
}},
getItems: function (){
return this.items;
}};
var Row=row.exports;
function createNewRow(layoutConfig, layoutData){
var isBreakoutRow;
if(layoutConfig.fullWidthBreakoutRowCadence!==false){
if((layoutData._rows.length + 1) % layoutConfig.fullWidthBreakoutRowCadence===0){
isBreakoutRow=true;
}}
return new Row({
top: layoutData._containerHeight,
left: layoutConfig.containerPadding.left,
width: layoutConfig.containerWidth - layoutConfig.containerPadding.left - layoutConfig.containerPadding.right,
spacing: layoutConfig.boxSpacing.horizontal,
targetRowHeight: layoutConfig.targetRowHeight,
targetRowHeightTolerance: layoutConfig.targetRowHeightTolerance,
edgeCaseMinRowHeight: 0.5 * layoutConfig.targetRowHeight,
edgeCaseMaxRowHeight: 2 * layoutConfig.targetRowHeight,
rightToLeft: false,
isBreakoutRow: isBreakoutRow,
widowLayoutStyle: layoutConfig.widowLayoutStyle
});
}
function addRow(layoutConfig, layoutData, row){
layoutData._rows.push(row);
layoutData._layoutItems=layoutData._layoutItems.concat(row.getItems());
layoutData._containerHeight +=row.height + layoutConfig.boxSpacing.vertical;
return row.items;
}
function computeLayout(layoutConfig, layoutData, itemLayoutData){
var laidOutItems=[],
itemAdded,
currentRow,
nextToLastRowHeight;
if(layoutConfig.forceAspectRatio){
itemLayoutData.forEach(function (itemData){
itemData.forcedAspectRatio=true;
itemData.aspectRatio=layoutConfig.forceAspectRatio;
});
}
itemLayoutData.some(function (itemData, i){
if(isNaN(itemData.aspectRatio)){
throw new Error("Item " + i + " has an invalid aspect ratio");
}
if(!currentRow){
currentRow=createNewRow(layoutConfig, layoutData);
}
itemAdded=currentRow.addItem(itemData);
if(currentRow.isLayoutComplete()){
laidOutItems=laidOutItems.concat(addRow(layoutConfig, layoutData, currentRow));
if(layoutData._rows.length >=layoutConfig.maxNumRows){
currentRow=null;
return true;
}
currentRow=createNewRow(layoutConfig, layoutData);
if(!itemAdded){
itemAdded=currentRow.addItem(itemData);
if(currentRow.isLayoutComplete()){
laidOutItems=laidOutItems.concat(addRow(layoutConfig, layoutData, currentRow));
if(layoutData._rows.length >=layoutConfig.maxNumRows){
currentRow=null;
return true;
}
currentRow=createNewRow(layoutConfig, layoutData);
}}
}});
if(currentRow&&currentRow.getItems().length&&layoutConfig.showWidows){
if(layoutData._rows.length){
if(layoutData._rows[layoutData._rows.length - 1].isBreakoutRow){
nextToLastRowHeight=layoutData._rows[layoutData._rows.length - 1].targetRowHeight;
}else{
nextToLastRowHeight=layoutData._rows[layoutData._rows.length - 1].height;
}
currentRow.forceComplete(false, nextToLastRowHeight);
}else{
currentRow.forceComplete(false);
}
laidOutItems=laidOutItems.concat(addRow(layoutConfig, layoutData, currentRow));
layoutConfig._widowCount=currentRow.getItems().length;
}
layoutData._containerHeight=layoutData._containerHeight - layoutConfig.boxSpacing.vertical;
layoutData._containerHeight=layoutData._containerHeight + layoutConfig.containerPadding.bottom;
return {
containerHeight: layoutData._containerHeight,
widowCount: layoutConfig._widowCount,
boxes: layoutData._layoutItems
};}
var lib=function (input, config){
var layoutConfig={};
var layoutData={};
var defaults={
containerWidth: 1060,
containerPadding: 10,
boxSpacing: 10,
targetRowHeight: 320,
targetRowHeightTolerance: 0.25,
maxNumRows: Number.POSITIVE_INFINITY,
forceAspectRatio: false,
showWidows: true,
fullWidthBreakoutRowCadence: false,
widowLayoutStyle: 'left'
};
var containerPadding={};
var boxSpacing={};
config=config||{};
layoutConfig=Object.assign(defaults, config);
containerPadding.top = !isNaN(parseFloat(layoutConfig.containerPadding.top)) ? layoutConfig.containerPadding.top:layoutConfig.containerPadding;
containerPadding.right = !isNaN(parseFloat(layoutConfig.containerPadding.right)) ? layoutConfig.containerPadding.right:layoutConfig.containerPadding;
containerPadding.bottom = !isNaN(parseFloat(layoutConfig.containerPadding.bottom)) ? layoutConfig.containerPadding.bottom:layoutConfig.containerPadding;
containerPadding.left = !isNaN(parseFloat(layoutConfig.containerPadding.left)) ? layoutConfig.containerPadding.left:layoutConfig.containerPadding;
boxSpacing.horizontal = !isNaN(parseFloat(layoutConfig.boxSpacing.horizontal)) ? layoutConfig.boxSpacing.horizontal:layoutConfig.boxSpacing;
boxSpacing.vertical = !isNaN(parseFloat(layoutConfig.boxSpacing.vertical)) ? layoutConfig.boxSpacing.vertical:layoutConfig.boxSpacing;
layoutConfig.containerPadding=containerPadding;
layoutConfig.boxSpacing=boxSpacing;
layoutData._layoutItems=[];
layoutData._awakeItems=[];
layoutData._inViewportItems=[];
layoutData._leadingOrphans=[];
layoutData._trailingOrphans=[];
layoutData._containerHeight=layoutConfig.containerPadding.top;
layoutData._rows=[];
layoutData._orphans=[];
layoutConfig._widowCount=0;
return computeLayout(layoutConfig, layoutData, input.map(function (item){
if(item.width&&item.height){
return {
aspectRatio: item.width / item.height
};}else{
return {
aspectRatio: item
};}}));
};
function ready(callback){
if('complete'===document.readyState||'interactive'===document.readyState){
callback();
}else{
document.addEventListener('DOMContentLoaded', callback, {
capture: true,
once: true,
passive: true
});
}}
function getImgDimensions(img, cb){
let interval;
let hasSize=false;
let addedListeners=false;
const onHasSize=()=> {
if(hasSize){
cb(hasSize);
return;
}
if(!img.naturalWidth){
return;
}
hasSize={
width: img.naturalWidth,
height: img.naturalHeight
};
cb(hasSize);
clearInterval(interval);
if(addedListeners){
removeListeners();
}};
const onLoaded=()=> {
onHasSize();
};
const onError=()=> {
onHasSize();
};
const checkSize=()=> {
if(0 < img.naturalWidth){
onHasSize();
}};
const addListeners=()=> {
addedListeners=true;
img.addEventListener('load', onLoaded);
img.addEventListener('error', onError);
};
const removeListeners=()=> {
addedListeners=false;
img.removeEventListener('load', onLoaded);
img.removeEventListener('error', onError);
};
checkSize();
if(!hasSize){
addListeners();
interval=setInterval(checkSize, 100);
}}
const fjGalleryList=[];
const updateFjGallery=rafSchd(()=> {
fjGalleryList.forEach(item=> {
item.resize();
});
});
global$1.addEventListener('resize', updateFjGallery);
global$1.addEventListener('orientationchange', updateFjGallery);
global$1.addEventListener('load', updateFjGallery);
ready(()=> {
updateFjGallery();
});
let instanceID=0;
class FJGallery {
constructor(container, userOptions){
const self=this;
self.instanceID=instanceID;
instanceID +=1;
self.$container=container;
self.images=[];
self.defaults={
itemSelector: '.fj-gallery-item',
imageSelector: 'img',
gutter: 10,
rowHeight: 320,
rowHeightTolerance: 0.25,
maxRowsCount: Number.POSITIVE_INFINITY,
lastRow: 'left',
transitionDuration: '0.3s',
calculateItemsHeight: false,
resizeDebounce: 100,
isRtl: 'rtl'===self.css(self.$container, 'direction'),
onInit: null,
onDestroy: null,
onAppendImages: null,
onBeforeJustify: null,
onJustify: null
};
const dataOptions=self.$container.dataset||{};
const pureDataOptions={};
Object.keys(dataOptions).forEach(key=> {
const loweCaseOption=key.substr(0, 1).toLowerCase() + key.substr(1);
if(loweCaseOption&&'undefined'!==typeof self.defaults[loweCaseOption]){
pureDataOptions[loweCaseOption]=dataOptions[key];
}});
self.options={ ...self.defaults,
...pureDataOptions,
...userOptions
};
self.pureOptions={ ...self.options
};
self.resize=debounce(self.options.resizeDebounce, self.resize);
self.justify=rafSchd(self.justify.bind(self));
self.init();
}
css(el, styles){
if('string'===typeof styles){
return global$1.getComputedStyle(el).getPropertyValue(styles);
}
Object.keys(styles).forEach(key=> {
el.style[key]=styles[key];
});
return el;
}
applyTransition($item, properties){
const self=this;
self.onTransitionEnd($item)();
self.css($item, {
'transition-property': properties.join(', '),
'transition-duration': self.options.transitionDuration
});
$item.addEventListener('transitionend', self.onTransitionEnd($item, properties), false);
}
onTransitionEnd($item){
const self=this;
return ()=> {
self.css($item, {
'transition-property': '',
'transition-duration': ''
});
$item.removeEventListener('transitionend', self.onTransitionEnd($item));
};}
addToFjGalleryList(){
fjGalleryList.push(this);
updateFjGallery();
}
removeFromFjGalleryList(){
const self=this;
fjGalleryList.forEach((item, key)=> {
if(item.instanceID===self.instanceID){
fjGalleryList.splice(key, 1);
}});
}
init(){
const self=this;
self.appendImages(self.$container.querySelectorAll(self.options.itemSelector));
self.addToFjGalleryList();
if(self.options.onInit){
self.options.onInit.call(self);
}}
appendImages($images){
const self=this;
if(global$1.jQuery&&$images instanceof global$1.jQuery){
$images=$images.get();
}
if(!$images||!$images.length){
return;
}
$images.forEach($item=> {
if($item&&!$item.fjGalleryImage&&$item.querySelector){
const $image=$item.querySelector(self.options.imageSelector);
if($image){
$item.fjGalleryImage=self;
const data={
$item,
$image,
width: parseFloat($image.getAttribute('width'))||false,
height: parseFloat($image.getAttribute('height'))||false,
loadSizes(){
const itemData=this;
getImgDimensions($image, dimensions=> {
if(itemData.width!==dimensions.width||itemData.height!==dimensions.height){
itemData.width=dimensions.width;
itemData.height=dimensions.height;
self.resize();
}});
}};
data.loadSizes();
self.images.push(data);
}}
});
if(self.options.onAppendImages){
self.options.onAppendImages.call(self, [$images]);
}
self.justify();
}
justify(){
const self=this;
const justifyArray=[];
self.justifyCount=(self.justifyCount||0) + 1;
if(self.options.onBeforeJustify){
self.options.onBeforeJustify.call(self);
}
self.images.forEach(data=> {
if(data.width&&data.height){
justifyArray.push(data.width / data.height);
}});
const justifiedOptions={
containerWidth: self.$container.getBoundingClientRect().width,
containerPadding: {
top: parseFloat(self.css(self.$container, 'padding-top'))||0,
right: parseFloat(self.css(self.$container, 'padding-right'))||0,
bottom: parseFloat(self.css(self.$container, 'padding-bottom'))||0,
left: parseFloat(self.css(self.$container, 'padding-left'))||0
},
boxSpacing: self.options.gutter,
targetRowHeight: self.options.rowHeight,
targetRowHeightTolerance: self.options.rowHeightTolerance,
maxNumRows: self.options.maxRowsCount,
showWidows: 'hide'!==self.options.lastRow
};
const justifiedData=lib(justifyArray, justifiedOptions);
if(justifiedData.widowCount&&('center'===self.options.lastRow||'right'===self.options.lastRow)){
const lastItemData=justifiedData.boxes[justifiedData.boxes.length - 1];
let gapSize=justifiedOptions.containerWidth - lastItemData.width - lastItemData.left;
if('center'===self.options.lastRow){
gapSize /=2;
}
if('right'===self.options.lastRow){
gapSize -=justifiedOptions.containerPadding.right;
}
for (let i=1; i <=justifiedData.widowCount; i +=1){
justifiedData.boxes[justifiedData.boxes.length - i].left=justifiedData.boxes[justifiedData.boxes.length - i].left + gapSize;
}}
if(self.options.isRtl){
justifiedData.boxes.forEach((boxData, i)=> {
justifiedData.boxes[i].left=justifiedOptions.containerWidth - justifiedData.boxes[i].left - justifiedData.boxes[i].width - justifiedOptions.containerPadding.right + justifiedOptions.containerPadding.left;
});
}
let i=0;
let additionalTopOffset=0;
const rowsMaxHeight={};
self.images.forEach((data, imgI)=> {
if(justifiedData.boxes[i]&&data.width&&data.height){
if(self.options.calculateItemsHeight&&'undefined'===typeof rowsMaxHeight[justifiedData.boxes[i].top]&&Object.keys(rowsMaxHeight).length){
additionalTopOffset +=rowsMaxHeight[Object.keys(rowsMaxHeight).pop()] - justifiedData.boxes[imgI - 1].height;
}
if(self.options.transitionDuration&&1 < self.justifyCount){
self.applyTransition(data.$item, ['transform']);
}
self.css(data.$item, {
display: '',
position: 'absolute',
transform: `translateX(${justifiedData.boxes[i].left}px) translateY(${justifiedData.boxes[i].top + additionalTopOffset}px) translateZ(0)`,
width: `${justifiedData.boxes[i].width}px`
});
if(self.options.calculateItemsHeight){
const rect=data.$item.getBoundingClientRect();
if('undefined'===typeof rowsMaxHeight[justifiedData.boxes[i].top]||rowsMaxHeight[justifiedData.boxes[i].top] < rect.height){
rowsMaxHeight[justifiedData.boxes[i].top]=rect.height;
}}
i +=1;
}else{
self.css(data.$item, {
display: 'none'
});
}});
if(self.options.calculateItemsHeight&&Object.keys(rowsMaxHeight).length){
additionalTopOffset +=rowsMaxHeight[Object.keys(rowsMaxHeight).pop()] - justifiedData.boxes[justifiedData.boxes.length - 1].height;
}
if(self.options.transitionDuration){
self.applyTransition(self.$container, ['height']);
}
self.css(self.$container, {
height: `${justifiedData.containerHeight + additionalTopOffset}px`
});
if(self.options.onJustify){
self.options.onJustify.call(self);
}}
updateOptions(options){
const self=this;
self.options={ ...self.options,
...options
};
self.justify();
}
destroy(){
const self=this;
self.removeFromFjGalleryList();
self.justifyCount=0;
if(self.options.onDestroy){
self.options.onDestroy.call(self);
}
self.css(self.$container, {
height: '',
transition: ''
});
self.images.forEach(data=> {
self.css(data.$item, {
position: '',
transform: '',
transition: '',
width: '',
height: ''
});
});
self.images.forEach(val=> {
delete val.$item.fjGalleryImage;
});
delete self.$container.fjGallery;
}
resize(){
const self=this;
self.justify();
}}
const fjGallery=function (items, options, ...args){
if('object'===typeof HTMLElement ? items instanceof HTMLElement:items&&'object'===typeof items&&null!==items&&1===items.nodeType&&'string'===typeof items.nodeName){
items=[items];
}
const len=items.length;
let k=0;
let ret;
for (k; k < len; k +=1){
if('object'===typeof options||'undefined'===typeof options){
if(!items[k].fjGallery){
items[k].fjGallery=new FJGallery(items[k], options);
}}else if(items[k].fjGallery){
ret=items[k].fjGallery[options].apply(items[k].fjGallery, args);
}
if('undefined'!==typeof ret){
return ret;
}}
return items;
};
fjGallery.constructor=FJGallery;
const $=global$1.jQuery;
if('undefined'!==typeof $){
const oldInit=fjGallery.constructor.prototype.init;
fjGallery.constructor.prototype.init=function (){
$(this.$container).data('fjGallery', this);
if(oldInit){
oldInit.call(this);
}};
const oldDestroy=fjGallery.constructor.prototype.destroy;
fjGallery.constructor.prototype.destroy=function (){
if(this.$container){
$(this.$container).removeData('fjGallery');
}
if(oldDestroy){
oldDestroy.call(this);
}};
const $Plugin=function (...args){
Array.prototype.unshift.call(args, this);
const res=fjGallery.apply(global$1, args);
return 'object'!==typeof res ? res:this;
};
$Plugin.constructor=fjGallery.constructor;
const old$Plugin=$.fn.fjGallery;
$.fn.fjGallery=$Plugin;
$.fn.fjGallery.noConflict=function (){
$.fn.fjGallery=old$Plugin;
return this;
};}
return fjGallery;
}));