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,QAAQ8E,iBAAmB,IAAI9B,EAAiB7H,EAAE,4BACzD4E,OAAOC,QAAQ8E,iBAAiB/B,MAClC,I,SCEAgC,EAAAA,M","sources":["webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/src/decidim/friendly_signup/setup_confirmations.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/images/ sync ^\\.\\/.*$","webpack://app/webpack/bootstrap","webpack://app/webpack/runtime/hasOwnProperty shorthand","webpack://app/webpack/runtime/publicPath","webpack://app/../usr/local/bundle/gems/decidim-core-0.27.4/app/packs/src/decidim/icon.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/src/decidim/friendly_signup/lib/password_toggler.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/src/decidim/friendly_signup/setup_password.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/src/decidim/friendly_signup/lib/instant_validator.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/src/decidim/friendly_signup/setup_validations.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-e3f7843b1d5e/app/packs/entrypoints/decidim_friendly_signup.js"],"sourcesContent":["$(() => {\n const $inputs = $('.confirmation-code-inputs input[type=\"number\"]');\n const $form = $inputs.closest(\"form\");\n const intRegex = /^\\d+$/;\n let disableManual = false;\n\n // Parses the individual digits into the individual boxes.\n const pasteValues = (element, $first) => {\n const values = element.split(\"\");\n let $inputBox = $first;\n\n $(values).each((index) => {\n $inputBox.val(values[index]);\n $inputBox = $inputBox.next('input[type=\"number\"]');\n if ($inputBox.length === 0) {\n $form.submit();\n }\n });\n };\n\n $inputs.on(\"focus\", (e) => {\n $(e.target).select();\n });\n\n // Prevents user from manually entering non-digits.\n $inputs.on(\"input.fromManual\", (e) => {\n if (disableManual) {\n return;\n }\n const $this = $(e.target);\n if (intRegex.test($this.val())) {\n pasteValues($this.val(), $this);\n $this.next('input[type=\"number\"]').focus();\n } else {\n $this.val(\"\");\n }\n });\n\n $inputs.on(\"paste\", (evt) => {\n const $this = $(evt.target);\n const originalValue = $this.val();\n $this.val(\"\");\n disableManual = true;\n $this.one(\"input.fromPaste\", (e) => {\n const $currentInputBox = $(e.target);\n\n const pastedValue = $currentInputBox.val();\n if (intRegex.test(pastedValue)) {\n pasteValues(pastedValue, $inputs.eq(0));\n }\n else {\n $this.val(originalValue);\n }\n disableManual = false;\n });\n });\n});\n","var map = {\n\t\"./decidim/friendly_signup/icon.svg\": 82959\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 33936;","// 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","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","__webpack_require__.p = \"/decidim-packs/\";","const DEFAULT_ATTRIBUTES = {\n role: \"img\",\n \"aria-hidden\": \"true\"\n};\n\n/**\n * Generates a Decidim icon element and returns it as a string.\n * @param {String} iconKey - the key of the icon to be generated\n * @param {Object} attributes - extra attributes to define for the icon SVG\n * @param {int} wait - number of milliseconds to wait before executing the function.\n * @private\n * @returns {Void} - Returns nothing.\n */\nexport default function icon(iconKey, attributes = {}) {\n const iconAttributes = $.extend(DEFAULT_ATTRIBUTES, attributes);\n const title = iconAttributes.title || iconAttributes.ariaLabel;\n Reflect.deleteProperty(iconAttributes, \"title\");\n\n const htmlAttributes = {\n \"class\": `icon icon--${iconKey}`\n };\n Object.keys(iconAttributes).forEach((key) => {\n // Convert the key to dash-format.\n const newKey = key.replace(/([A-Z])/g, (ucw) => `-${ucw[0].toLowerCase()}`);\n if (typeof htmlAttributes[key] === \"undefined\") {\n htmlAttributes[newKey] = iconAttributes[key];\n } else {\n htmlAttributes[newKey] = `${htmlAttributes[newKey]} ${iconAttributes[key]}`;\n }\n });\n\n const iconsPath = window.Decidim.config.get(\"icons_path\");\n const elHtml = ``;\n const $el = $(elHtml);\n if (title) {\n $el.prepend(`${title}`);\n } else {\n // This keeps accessibility audit tools happy\n $el.prepend(`${iconKey}`);\n // Force hidden if title is not defined\n htmlAttributes[\"aria-hidden\"] = \"true\";\n }\n $el.attr(htmlAttributes);\n\n return $(\"
\").append($el).html();\n}\n","import icon from \"src/decidim/icon\"\n\nexport default class PasswordToggler {\n constructor($password, $confirmation) {\n this.$password = $password.first();\n this.$confirmation = $confirmation.first();\n this.$input = this.$password.find('input[type=\"password\"]');\n this.$inputConfirmation = this.$confirmation.find('input[type=\"password\"]');\n this.$form = this.$input.closest(\"form\");\n this.texts = {\n showPassword: this.$password.data(\"showPassword\") || \"Show password\",\n hidePassword: this.$password.data(\"hidePassword\") || \"Hide password\",\n hiddenPassword: this.$password.data(\"hiddenPassword\") || \"Your password is hidden\",\n shownPassword: this.$password.data(\"shownPassword\") || \"Your password is shown\"\n }\n this.icons = {\n show: icon(\"eye\", {title: this.texts.showPassword})\n }\n }\n\n // Call init() to hide the password confirmation and add a \"view password\" inline button\n init() {\n this.createControls();\n this.$confirmation.hide();\n this.$button.on(\"click.password_toggler\", (evt) => this.toggleVisibiliy(evt));\n this.$input.on(\"change.password_toggler\", () => {\n this.$inputConfirmation.val(this.$input.val());\n });\n // to prevent browsers trying to use autocomplete, turn the type back to password before submitting\n this.$form.on(\"submit.password_toggler\", () => {\n this.$inputConfirmation.val(this.$input.val());\n this.hidePassword();\n });\n }\n\n // Call destroy() to switch back to the original password/password confirmation boxes\n destroy() {\n this.$button.off(\"click.password_toggler\");\n this.$input.off(\"change.password_toggler\");\n this.$form.off(\"submit.password_toggler\");\n const $input = this.$input.detach();\n this.$inputGroup.replaceWith($input);\n this.$confirmation.show();\n }\n\n createControls() {\n this.$button = $(``);\n this.$buttonGroup = $('');\n this.$statusText = $(`${this.texts.hiddenPassword}`);\n // ensure error message is handled by foundation abide\n this.$input.next(\".form-error\").attr(\"data-form-error-for\", this.$input.attr(\"id\"));\n this.$buttonGroup.html(this.$button);\n this.$input.wrap('').\n after(this.$statusText).\n after(this.$buttonGroup);\n this.$inputGroup = this.$input.parent();\n }\n\n toggleVisibiliy(evt) {\n evt.preventDefault();\n if (this.isText()) {\n this.hidePassword();\n } else {\n this.showPassword();\n }\n }\n\n showPassword() {\n this.$statusText.text(this.texts.shownPassword);\n this.$button.attr(\"aria-label\", this.texts.hidePassword).addClass(\"crossed\");\n this.$input.attr(\"type\", \"text\");\n }\n\n hidePassword() {\n this.$statusText.text(this.texts.hiddenPassword);\n this.$button.attr(\"aria-label\", this.texts.showPassword).removeClass(\"crossed\")\n this.$input.attr(\"type\", \"password\");\n }\n\n isText() {\n return this.$input.attr(\"type\") === \"text\"\n }\n}\n","import PasswordToggler from \"src/decidim/friendly_signup/lib/password_toggler\";\n\n$(() => {\n window.Decidim = window.Decidim || {};\n window.Decidim.passwordToggler = new PasswordToggler($(\".user-password\"), $(\".user-password-confirmation\"));\n window.Decidim.passwordToggler.init();\n});\n","/* eslint-disable line-comment-position, no-ternary, no-inline-comments */\n\n// Instant, server-side validation\n// compatible with abide classes https://get.foundation/sites/docs/abide.html\nexport default class InstantValidator {\n // ms before xhr check\n get TIMEOUT() {\n return 600;\n }\n\n constructor($form) {\n this.$form = $form;\n this.$inputs = $form.find(\"[data-instant-attribute]\");\n this.url = this.$form.data(\"validationUrl\");\n this.timeoutId = null;\n }\n\n init() {\n if (!this.url || !this.$form.length) {\n return;\n }\n this.$form.foundation(\"disableValidation\");\n // this final validation prevents abide from resetting the field when user loses focus\n this.$inputs.on(\"blur\", (evt) => {\n // If it's empty (or not tampered), run the validation\n if (this.value($(evt.target)) === \"\") {\n this.validate($(evt.target));\n }\n });\n this.$inputs.on(\"input\", (evt) => {\n let $input = $(evt.currentTarget);\n clearTimeout(this.timeoutId);\n this.timeoutId = setTimeout(() => {\n this.validate($input);\n }, this.TIMEOUT);\n });\n }\n\n value($input) {\n return $input.val().trim();\n }\n\n attribute($input) {\n return $input.data(\"instantAttribute\");\n }\n\n target($input) {\n const $target = this.$form.find($input.data(\"instantTarget\"));\n return $target.length\n ? $target\n : $input;\n }\n\n validate($input) {\n let $recheck = $($input.data(\"instantRecheck\"));\n this.tamper($input);\n this.post($input).done((response) => {\n this.setFeedback(response, $input);\n });\n\n if ($recheck.length && this.isTampered($recheck)) {\n this.validate($recheck)\n }\n }\n\n setFeedback(data, $input) {\n if (data.valid) {\n this.clearErrors($input);\n } else {\n this.addErrors(this.target($input), data.error);\n }\n }\n\n tamper($dest) {\n $dest.data(\"tampered\", $dest.val().trim() !== \"\");\n }\n\n isTampered($dest) {\n return $dest.data(\"tampered\");\n }\n\n addErrors($dest, msg) {\n if ($dest.closest(\"label\").find(\".form-error\").length > 1) {\n // Decidim may add and additional error class that does not play well with abide\n $dest.closest(\"label\").find(\".form-error:last\").remove();\n }\n this.$form.foundation(\"addErrorClasses\", $dest);\n if (msg) {\n $dest.closest(\"label\").find(\".form-error\").html(msg);\n }\n }\n\n clearErrors($dest) {\n this.$form.foundation(\"removeErrorClasses\", $dest);\n }\n\n post($input) {\n return $.ajax(this.url, {\n method: \"POST\",\n data: `${this.$form.serialize()}&attribute=${this.attribute($input)}`\n });\n }\n}\n","import InstantValidator from \"src/decidim/friendly_signup/lib/instant_validator\";\n\n$(() => {\n window.Decidim = window.Decidim || {};\n window.Decidim.instantValidator = new InstantValidator($(\"form.instant-validation\"));\n window.Decidim.instantValidator.init();\n});\n","import \"src/decidim/friendly_signup/setup_password\"\nimport \"src/decidim/friendly_signup/setup_validations\"\nimport \"src/decidim/friendly_signup/setup_confirmations\"\n\n// CSS\nimport \"entrypoints/decidim_friendly_signup.scss\";\n\n// Images\nrequire.context(\"../images\", true)\n"],"names":["$","$inputs","$form","closest","intRegex","disableManual","pasteValues","element","$first","values","split","$inputBox","each","index","val","next","length","submit","on","e","target","select","$this","test","focus","evt","originalValue","one","pastedValue","eq","map","webpackContext","req","id","webpackContextResolve","__webpack_require__","o","Error","code","keys","Object","resolve","module","exports","__webpack_module_cache__","moduleId","cachedModule","undefined","__webpack_modules__","obj","prop","prototype","hasOwnProperty","call","p","DEFAULT_ATTRIBUTES","role","icon","iconKey","attributes","arguments","iconAttributes","extend","title","ariaLabel","Reflect","deleteProperty","htmlAttributes","concat","forEach","key","newKey","replace","ucw","toLowerCase","iconsPath","window","Decidim","config","get","elHtml","$el","prepend","attr","append","html","PasswordToggler","$password","$confirmation","_classCallCheck","this","first","$input","find","$inputConfirmation","texts","showPassword","data","hidePassword","hiddenPassword","shownPassword","icons","show","value","_this","createControls","hide","$button","toggleVisibiliy","off","detach","$inputGroup","replaceWith","$buttonGroup","$statusText","wrap","after","parent","preventDefault","isText","text","addClass","removeClass","passwordToggler","init","InstantValidator","url","timeoutId","foundation","validate","currentTarget","clearTimeout","setTimeout","TIMEOUT","trim","$target","_this2","$recheck","tamper","post","done","response","setFeedback","isTampered","valid","clearErrors","addErrors","error","$dest","msg","remove","ajax","method","serialize","attribute","instantValidator","require"],"sourceRoot":""}