{"version":3,"file":"modal_controller-h63nBHUK.js","sources":["../../../app/javascript/controllers/modal_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\";\nimport { enter, leave } from \"el-transition\";\n\n// Connects to data-controller=\"modal\"\nexport default class extends Controller {\n  static targets = [\"content\"];\n\n  static values = {\n    showOnConnect: Boolean,\n    removeOnHide: Boolean\n  };\n\n  connect() {\n    if (this.showOnConnectValue) {\n      this.show();\n    }\n  }\n\n  show() {\n    enter(this.element);\n    enter(this.contentTarget);\n  }\n\n  hide() {\n    leave(this.contentTarget);\n    leave(this.element).then(() => {\n      if (this.removeOnHideValue) {\n        this.element.remove();\n      }\n    });\n  }\n}\n"],"names":["modal_controller","Controller","enter","leave","__publicField"],"mappings":"oWAIe,MAAKA,UAASC,CAAW,CAQtC,SAAU,CACJ,KAAK,oBACP,KAAK,KAAM,CAEjB,CAEE,MAAO,CACLC,EAAM,KAAK,OAAO,EAClBA,EAAM,KAAK,aAAa,CAC5B,CAEE,MAAO,CACLC,EAAM,KAAK,aAAa,EACxBA,EAAM,KAAK,OAAO,EAAE,KAAK,IAAM,CACzB,KAAK,mBACP,KAAK,QAAQ,OAAQ,CAE7B,CAAK,CACL,CACA,CA1BEC,EADkBJ,EACX,UAAU,CAAC,SAAS,GAE3BI,EAHkBJ,EAGX,SAAS,CACd,cAAe,QACf,aAAc,OACf"}