{"version":3,"file":"footer_controller-6hHbAhNO.js","sources":["../../../app/javascript/controllers/compose/footer_controller.js"],"sourcesContent":["import ApplicationController from '../application_controller'\n\nexport default class extends ApplicationController {\n static values = {\n limit: { type: Number, default: 60 }\n }\n\n static targets = ['input']\n\n sync(e) {\n const { target } = e\n\n if(target.value.length > this.limitValue) {\n target.value = target.value.substring(0, this.limitValue)\n }\n\n this.dispatch('change', {\n detail: target.value,\n })\n }\n\n restore({ detail: value }) {\n this.inputTarget.value = value\n }\n\n update({ detail: footer }) {\n if(!footer) return\n\n this.inputTarget.value = footer.value || ''\n this.inputTarget.dispatchEvent(new Event('input', { bubbles: true }))\n\n this.dispatch('change', {\n detail: this.inputTarget.value,\n })\n }\n\n disable() {\n super.disable(this.inputTarget)\n this.addClass(this.inputTarget, 'text-night-20')\n\n this.addClass(this.element, 'grayscale', 'cursor-not-allowed')\n\n if(!this.inputTarget.value) {\n this.hide()\n }\n }\n\n enable() {\n super.enable(this.inputTarget)\n this.removeClass(this.inputTarget, 'text-night-20')\n\n this.removeClass(this.element, 'grayscale', 'cursor-not-allowed')\n\n if(!this.inputTarget.value) {\n this.show()\n }\n }\n\n clear() {\n this.inputTarget.value = ''\n this.disable()\n }\n\n preventEnter(e) {\n e.preventDefault()\n e.stopPropagation()\n }\n}\n"],"names":["footer_controller","ApplicationController","e","target","value","footer","__publicField"],"mappings":"uNAEe,MAAKA,UAASC,CAAsB,CAOjD,KAAKC,EAAG,CACN,KAAM,CAAE,OAAAC,CAAM,EAAKD,EAEhBC,EAAO,MAAM,OAAS,KAAK,aAC5BA,EAAO,MAAQA,EAAO,MAAM,UAAU,EAAG,KAAK,UAAU,GAG1D,KAAK,SAAS,SAAU,CACtB,OAAQA,EAAO,KAChB,CAAA,CACL,CAEE,QAAQ,CAAE,OAAQC,GAAS,CACzB,KAAK,YAAY,MAAQA,CAC7B,CAEE,OAAO,CAAE,OAAQC,GAAU,CACrBA,IAEJ,KAAK,YAAY,MAAQA,EAAO,OAAS,GACzC,KAAK,YAAY,cAAc,IAAI,MAAM,QAAS,CAAE,QAAS,GAAM,CAAC,EAEpE,KAAK,SAAS,SAAU,CACtB,OAAQ,KAAK,YAAY,KAC1B,CAAA,EACL,CAEE,SAAU,CACR,MAAM,QAAQ,KAAK,WAAW,EAC9B,KAAK,SAAS,KAAK,YAAa,eAAe,EAE/C,KAAK,SAAS,KAAK,QAAS,YAAa,oBAAoB,EAEzD,KAAK,YAAY,OACnB,KAAK,KAAI,CAEf,CAEE,QAAS,CACP,MAAM,OAAO,KAAK,WAAW,EAC7B,KAAK,YAAY,KAAK,YAAa,eAAe,EAElD,KAAK,YAAY,KAAK,QAAS,YAAa,oBAAoB,EAE5D,KAAK,YAAY,OACnB,KAAK,KAAI,CAEf,CAEE,OAAQ,CACN,KAAK,YAAY,MAAQ,GACzB,KAAK,QAAO,CAChB,CAEE,aAAaH,EAAG,CACdA,EAAE,eAAc,EAChBA,EAAE,gBAAe,CACrB,CACA,CAhEEI,EADkBN,EACX,SAAS,CACd,MAAO,CAAE,KAAM,OAAQ,QAAS,EAAE,CACtC,GAEEM,EALkBN,EAKX,UAAU,CAAC,OAAO"}