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QG,GAZ5BA,KACW,WAA3BA,EAAEC,aAAa,UACwB,UAAnCD,EAAEC,aAAa,iBAGfD,EAAEE,aAAa,WAAY,Q,EAOkBC,CAAeH,IAAG,GACrE,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/disable-form-button.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(() => {\n\n const buttonListener = (b: HTMLButtonElement) => {\n if (b.getAttribute('type') === 'submit') {\n if (b.getAttribute('data-disable') === 'false') {\n // don't disable the button if it has a value set. disabled buttons won't post their value!\n } else {\n b.setAttribute('disabled', 'true');\n }\n }\n }\n\n all('form').forEach(f => {\n f.addEventListener('submit', () => {\n all('button', f).forEach(b => buttonListener(b));\n });\n });\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","forEach","f","addEventListener","b","getAttribute","setAttribute","buttonListener"],"sourceRoot":""}