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nB,0BAED,SAAUmD,EAAOC,GACXD,EAAM9I,QAAQ,SAASuF,KAAK,eAAe1E,OAAS,GAEtDiI,EAAM9I,QAAQ,SAASuF,KAAK,oBAAoByD,SAElD5D,KAAKrF,MAAM0H,WAAW,kBAAmBqB,GACrCC,GACFD,EAAM9I,QAAQ,SAASuF,KAAK,eAAeP,KAAK+D,EAEnD,4BAED,SAAYD,GACV1D,KAAKrF,MAAM0H,WAAW,qBAAsBqB,EAC7C,qBAED,SAAKxD,GACH,OAAOzF,EAAEoJ,KAAK7D,KAAKmC,IAAK,CACtB2B,OAAQ,OACRvD,KAAK,GAAD,OAAKP,KAAKrF,MAAMoJ,YAAhB,sBAAyC/D,KAAKgE,UAAU9D,KAE/D,M,8EAAA,EAjGkBgC,GCFrBzH,GAAE,WACA0E,OAAOC,QAAUD,OAAOC,SAAW,CAAC,EACpCD,OAAOC,QAAQ6E,iBAAmB,IAAI/B,EAAiBzH,EAAE,4BACzD0E,OAAOC,QAAQ6E,iBAAiBhC,MAHjC,I,QCMDiC,EAAAA,M","sources":["webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/app/packs/src/decidim/friendly_signup/setup_confirmations.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/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.26.7/app/packs/src/decidim/icon.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/app/packs/src/decidim/friendly_signup/lib/password_toggler.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/app/packs/src/decidim/friendly_signup/setup_password.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/app/packs/src/decidim/friendly_signup/lib/instant_validator.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/app/packs/src/decidim/friendly_signup/setup_validations.js","webpack://app/../usr/local/bundle/bundler/gems/decidim-module-friendly_signup-455543991dbf/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\": 51990\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 = 72016;","// 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","iconAttributes","extend","title","ariaLabel","Reflect","deleteProperty","htmlAttributes","forEach","key","newKey","replace","ucw","toLowerCase","iconsPath","window","Decidim","config","get","elHtml","$el","prepend","attr","append","html","PasswordToggler","$password","$confirmation","this","first","$input","find","$inputConfirmation","texts","showPassword","data","hidePassword","hiddenPassword","shownPassword","icons","show","createControls","hide","$button","_this","toggleVisibiliy","off","detach","$inputGroup","replaceWith","$buttonGroup","$statusText","wrap","after","parent","preventDefault","isText","text","addClass","removeClass","passwordToggler","init","InstantValidator","url","timeoutId","foundation","value","validate","currentTarget","clearTimeout","setTimeout","TIMEOUT","trim","$target","$recheck","tamper","post","done","response","_this2","setFeedback","isTampered","valid","clearErrors","addErrors","error","$dest","msg","remove","ajax","method","serialize","attribute","instantValidator","require"],"sourceRoot":""}