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QAAQ,MAAO,IAAIA,QAAQ,MAAO,IAAIA,QAAQ,MAAO,MAAKC,OAC9GP,EAAIQ,IAERC,GAAoBvC,EAAAA,EAAAA,KAAsB,WAEhD,GAAIuC,EAAkBC,OAAQ,CAC1B,MAAMC,EAAS/C,SAASgD,cAAc,OACtCD,EAAOH,IAAMP,EACbU,EAAOE,UAAY,gBAEnB,MAAMC,EAAmBL,EAAkB,GAC3CK,EAAiBC,YAAYJ,GAC7BG,EAAiBE,UAAUC,IAAI,iB,KAO3C/C,EAAAA,EAAAA,KAAsB,WAAWgD,SAAQC,IACrCA,EAAEC,iBAAiB,SAAS,KACxB,KAAOD,EAAEE,kBACLF,EAAEG,YAAYH,EAAEE,kBAEpBF,EAAEH,UAAUO,OAAO,iBAAiB,GACtC,KAKNrD,EAAAA,EAAAA,KAAsB,OAAOgD,SAAQC,IACjCA,EAAEC,iBAAiB,SAASI,IACpBA,EAAEC,kBAAkBC,kBACpB3B,EAAYyB,EAAEC,O,GAEpB,G","sources":["webpack://bm3giraffe/./WebRoot/js/util.ts","webpack://bm3giraffe/webpack/bootstrap","webpack://bm3giraffe/webpack/runtime/define property getters","webpack://bm3giraffe/webpack/runtime/hasOwnProperty shorthand","webpack://bm3giraffe/webpack/runtime/make namespace object","webpack://bm3giraffe/./WebRoot/js/fs-img.ts"],"sourcesContent":["function first(selector: string, root?: Element) : T {\r\n const foundElement = (root || document).querySelector(selector);\r\n if (!foundElement) {\r\n throw new Error(`element '${selector}' was not found.`);\r\n } else {\r\n return foundElement as T;\r\n }\r\n}\r\n\r\nfunction tryFirst(selector: string, root?: Element): T | null {\r\n const foundElement = (root || document).querySelector(selector);\r\n if (!foundElement) {\r\n console.warn(`element '${selector}' was not found.`);\r\n }\r\n return foundElement;\r\n}\r\n\r\nfunction all(selector: string, root?: Element): Array {\r\n return Array.from((root || document).querySelectorAll(selector));\r\n}\r\n\r\n\r\nexport {\r\n first,\r\n tryFirst,\r\n all\r\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","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { all } from './util';\n\n// include this, then mark images with class \"fs\"\n\n\nconst canShowFullscreen = true;\n\n// click event that triggers the fullscreen image display for the given HTMLImageElement\nconst showFsImage = (img: HTMLImageElement) => {\n if (canShowFullscreen) {\n const url =\n img.srcset\n ? img.srcset.split(',').map(s => s.replace(\" 1x\", \"\").replace(\" 2x\", \"\").replace(\" 3x\", \"\").replace(\" 4x\", \"\")).pop() || img.src\n : img.src\n\n const fsImageContainers = all('.fs-img');\n\n if (fsImageContainers.length) {\n const newImg = document.createElement('img');\n newImg.src = url;\n newImg.className = \"fs-img__image\";\n\n const fsImageContainer = fsImageContainers[0];\n fsImageContainer.appendChild(newImg);\n fsImageContainer.classList.add('fs-img__active');\n }\n }\n}\n\n// prepares the fullscreen image container\n\nall('.fs-img').forEach(i => {\n i.addEventListener('click', () => {\n while (i.lastElementChild) {\n i.removeChild(i.lastElementChild); // deletes all content\n }\n i.classList.remove('fs-img__active'); // then makes it disappear\n })\n});\n\n\n// prepares the fullscreen-enabled images\nall('.fs').forEach(i => {\n i.addEventListener('click', e => {\n if (e.target instanceof HTMLImageElement) {\n showFsImage(e.target);\n }\n })\n});\n\nexport {\n showFsImage\n}"],"names":["first","selector","root","foundElement","document","querySelector","Error","tryFirst","console","warn","all","Array","from","querySelectorAll","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","showFsImage","img","url","srcset","split","map","s","replace","pop","src","fsImageContainers","length","newImg","createElement","className","fsImageContainer","appendChild","classList","add","forEach","i","addEventListener","lastElementChild","removeChild","remove","e","target","HTMLImageElement"],"sourceRoot":""}