{"version":3,"file":"gallery.bundle.js","mappings":"qBAAAA,EAAOC,QAAU,wqL,UCIjBD,EAAOC,QAAU,SAASC,GACzB,SAASC,EAAIC,GACQ,oBAAZC,UACJA,QAAQD,OAASC,QAAQF,KAAK,kBAAmBC,EACtD,CAOA,IAC2B,oBAAfE,YAJmB,oBAAhBC,aAA2D,oBAArBC,iBAKnDF,WAAWJ,GACe,oBAATO,KACjBA,KAAKC,KAAK,KAAMR,GAEhBC,EAAI,wCAEN,CAAE,MAAOC,GACRD,EAAIC,EACL,CACD,C,GCzBIO,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAab,QAGrB,IAAID,EAASW,EAAyBE,GAAY,CAGjDZ,QAAS,CAAC,GAOX,OAHAe,EAAoBH,GAAUb,EAAQA,EAAOC,QAASW,GAG/CZ,EAAOC,OACf,CCtBA,EAAQ,IAAR,CAAkI,EAAQ,K","sources":["webpack://RNAEKka/./wwwroot/scripts/gallery.js","webpack://RNAEKka/./node_modules/script-loader/addScript.js","webpack://RNAEKka/webpack/bootstrap","webpack://RNAEKka/./wwwroot/scripts/gallery.js?715e"],"sourcesContent":["module.exports = \"function gallery() {\\r\\n var patterns = [\\r\\n {\\r\\n id: 1,\\r\\n dimensions: [\\r\\n {\\r\\n width: 365, height: 220, colspan: 1\\r\\n }\\r\\n ],\\r\\n colcount: 3\\r\\n },\\r\\n {\\r\\n id: 2,\\r\\n dimensions: [\\r\\n { width: 360, height: 454, colspan: 1 },\\r\\n { width: 754, height: 454, colspan: 3 }\\r\\n ],\\r\\n colcount: 4\\r\\n },\\r\\n {\\r\\n id: 3,\\r\\n dimensions: [\\r\\n { width: 559, height: 337, colspan: 2 },\\r\\n { width: 268, height: 337, colspan: 1 }\\r\\n ],\\r\\n colcount: 4\\r\\n }\\r\\n ];\\r\\n\\r\\n var patterns1200 = [\\r\\n {\\r\\n id: 4,\\r\\n dimensions: [\\r\\n { width: '100%', height: 200, colspan: 2, styles: { width: '100%', height: '100%', objectFit: 'cover' } },\\r\\n { width: '100%', height: 419, colspan: 2, styles: { width: '100%', height: '100%', objectFit: 'cover' } },\\r\\n { width: '48%', height: 200, colspan: 1, styles: { width: '100%', height: '100%', objectFit: 'cover' } }\\r\\n ],\\r\\n colcount: 2\\r\\n }\\r\\n ]\\r\\n\\r\\n var lastPatternUsed = {\\r\\n pattern: null,\\r\\n remainingCols: 0\\r\\n };\\r\\n\\r\\n var previousPatternId = null;\\r\\n\\r\\n function randomizer(min, max) {\\r\\n const randomNumber = Math.random() * (max - min) + min;\\r\\n const roundedNumber = Math.round(randomNumber);\\r\\n return roundedNumber;\\r\\n }\\r\\n\\r\\n function createImage(dimension, src) {\\r\\n var img = document.createElement('img');\\r\\n img.src = src + (typeof dimension.width === 'number' ?\\r\\n `?width=${dimension.width}&height=${dimension.height}` :\\r\\n `?height=${dimension.height}`);\\r\\n\\r\\n if (dimension.styles) {\\r\\n Object.keys(dimension.styles).forEach(function (key) {\\r\\n img.style[key] = dimension.styles[key];\\r\\n });\\r\\n }\\r\\n\\r\\n img.loading = \\\"lazy\\\";\\r\\n img.alt = 'galleryimg';\\r\\n return img;\\r\\n }\\r\\n\\r\\n return {\\r\\n toPhotoBook: function (node) {\\r\\n do {\\r\\n var imgs = node.find('[data-new=\\\"true\\\"]');\\r\\n var pattern;\\r\\n\\r\\n if (document.body.getBoundingClientRect().width <= 1200) {\\r\\n pattern = patterns1200[0];\\r\\n }\\r\\n else {\\r\\n if (previousPatternId != null) {\\r\\n var filteredPattern = patterns.filter(x => x.id !== previousPatternId);\\r\\n pattern = filteredPattern[randomizer(0, filteredPattern.length - 1)];\\r\\n }\\r\\n else {\\r\\n pattern = patterns[randomizer(0, 2)];\\r\\n }\\r\\n }\\r\\n \\r\\n var colCount = pattern.colcount;\\r\\n var remainingCol = colCount;\\r\\n\\r\\n if (lastPatternUsed != null && lastPatternUsed.pattern != null) {\\r\\n pattern = lastPatternUsed.pattern;\\r\\n colCount = lastPatternUsed.pattern.colcount;\\r\\n }\\r\\n else {\\r\\n // if the number of images left is less than the column count of the pattern,\\r\\n // store current pattern for later use\\r\\n if (colCount > imgs.length) {\\r\\n colCount = imgs.length;\\r\\n lastPatternUsed = { pattern };\\r\\n }\\r\\n }\\r\\n\\r\\n previousPatternId = pattern.id;\\r\\n \\r\\n var dimension;\\r\\n for (var i = 0; i < colCount; i++) {\\r\\n var elem = imgs[i];\\r\\n if (elem == undefined) {\\r\\n break;\\r\\n }\\r\\n\\r\\n if (remainingCol <= 0) {\\r\\n lastPatternUsed = null;\\r\\n break;\\r\\n }\\r\\n\\r\\n if (pattern.id == 1) {\\r\\n dimension = pattern.dimensions[0];\\r\\n }\\r\\n else if (pattern.id == 2) {\\r\\n dimension = dimension != null ?\\r\\n pattern.dimensions.find(x => x != dimension) :\\r\\n pattern.dimensions[randomizer(0, 1)];\\r\\n }\\r\\n else {\\r\\n // Checks if there is enough space in the row\\r\\n // Selects a random dimension if has enough space\\r\\n dimension = dimension != null && dimension.colspan > remainingCol || remainingCol == 1 ?\\r\\n pattern.dimensions.find(x => x.colspan == 1) :\\r\\n pattern.dimensions[randomizer(0, pattern.dimensions.length - 1)];\\r\\n }\\r\\n\\r\\n remainingCol = remainingCol - dimension.colspan;\\r\\n \\r\\n elem.style.width = typeof (dimension.width) == 'number' ? dimension.width + \\\"px\\\" : dimension.width;\\r\\n elem.style.height = dimension.height + \\\"px\\\";\\r\\n\\r\\n elem.append(createImage(dimension, elem.getAttribute('data-img')));\\r\\n elem.removeAttribute(\\\"data-new\\\");\\r\\n }\\r\\n }\\r\\n while (node.find('[data-new=\\\"true\\\"]').length > 0);\\r\\n\\r\\n node.css({ \\\"opacity\\\": \\\"1\\\"});\\r\\n }\\r\\n }\\r\\n}\"","/*\n\tMIT License http://www.opensource.org/licenses/mit-license.php\n\tAuthor Tobias Koppers @sokra\n*/\nmodule.exports = function(src) {\n\tfunction log(error) {\n\t\t(typeof console !== \"undefined\")\n\t\t&& (console.error || console.log)(\"[Script Loader]\", error);\n\t}\n\n\t// Check for IE =< 8\n\tfunction isIE() {\n\t\treturn typeof attachEvent !== \"undefined\" && typeof addEventListener === \"undefined\";\n\t}\n\n\ttry {\n\t\tif (typeof execScript !== \"undefined\" && isIE()) {\n\t\t\texecScript(src);\n\t\t} else if (typeof eval !== \"undefined\") {\n\t\t\teval.call(null, src);\n\t\t} else {\n\t\t\tlog(\"EvalError: No eval function available\");\n\t\t}\n\t} catch (error) {\n\t\tlog(error);\n\t}\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","require(\"!!C:\\\\Users\\\\omm\\\\source\\\\repo\\\\ekka\\\\rna-ekka-umbraco-website\\\\RNAEkka.Web\\\\node_modules\\\\script-loader\\\\addScript.js\")(require(\"!!C:\\\\Users\\\\omm\\\\source\\\\repo\\\\ekka\\\\rna-ekka-umbraco-website\\\\RNAEkka.Web\\\\node_modules\\\\raw-loader\\\\index.js!C:\\\\Users\\\\omm\\\\source\\\\repo\\\\ekka\\\\rna-ekka-umbraco-website\\\\RNAEkka.Web\\\\wwwroot\\\\scripts\\\\gallery.js\"))"],"names":["module","exports","src","log","error","console","execScript","attachEvent","addEventListener","eval","call","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__"],"sourceRoot":""}