{"version":3,"file":"identity_controller-BkBgkiiL.js","sources":["../../../app/javascript/controllers/contact/identity_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\"\n\nimport {useRemove} from \"../mixins/useRemove\"\n\nexport default class extends Controller {\n static targets = [\"removedInput\", \"removeButton\"]\n\n connect() {\n useRemove(this, {\n afterRemove: () => {\n if(this.hasRemovedInputTarget) {\n this.removedInputTarget.disabled = false\n document.getElementById(\"contact_form\").appendChild(this.removedInputTarget)\n }\n }\n })\n }\n\n onContactIdentityRemove() {\n if(this.onlyIdentity) {\n this.removeButtonTarget.classList.add(\"hidden\")\n }\n }\n\n disconnect() {\n this.dispatch(\"removed\", {\n target: document.documentElement,\n })\n }\n\n // private\n\n get onlyIdentity() {\n return document.querySelectorAll(\"[data-contact-identity]\").length === 1\n }\n}\n"],"names":["IdentityController","Controller","useRemove","__publicField"],"mappings":"wPAIe,MAAKA,UAASC,CAAW,CAGtC,SAAU,CACRC,EAAU,KAAM,CACd,YAAa,IAAM,CACd,KAAK,wBACN,KAAK,mBAAmB,SAAW,GACnC,SAAS,eAAe,cAAc,EAAE,YAAY,KAAK,kBAAkB,EAErF,CACK,CAAA,CACL,CAEE,yBAA0B,CACrB,KAAK,cACN,KAAK,mBAAmB,UAAU,IAAI,QAAQ,CAEpD,CAEE,YAAa,CACX,KAAK,SAAS,UAAW,CACvB,OAAQ,SAAS,eAClB,CAAA,CACL,CAIE,IAAI,cAAe,CACjB,OAAO,SAAS,iBAAiB,yBAAyB,EAAE,SAAW,CAC3E,CACA,CA9BEC,EADkBH,EACX,UAAU,CAAC,eAAgB,cAAc"}