{"version":3,"sources":["jsdelivr-header.js","/npm/@stimulus-components/popover@7.0.0/dist/stimulus-popover.mjs"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gECLA,MAAM,EAAW,cAAuB,CAAW,CACjD,MAAM,KAAK,EAAO,CAChB,MAAM,EAAU,EAAM,cACtB,IAAI,EAAU,KACd,GAAI,KAAK,iBAAmB,EAAU,KAAK,cAAc,UAAY,EAAU,MAAM,KAAK,MAAK,EAAI,CAAC,EAClG,OACF,MAAM,EAAW,SAAS,YAAW,EAAG,yBAAyB,CAAO,EACxE,EAAQ,YAAY,CAAQ,CAC9B,CACA,MAAO,CACL,KAAK,eAAiB,KAAK,WAAW,OAAM,CAC9C,CACA,MAAM,OAAQ,CACZ,GAAI,CAAC,KAAK,cAAe,CACvB,GAAI,CAAC,KAAK,YAAa,CACrB,QAAQ,MAAM,0EAA0E,EACxF,MACF,CACA,MAAM,EAAW,MAAM,MAAM,KAAK,QAAQ,EAC1C,KAAK,cAAgB,MAAM,EAAS,KAAI,CAC1C,CACA,OAAO,KAAK,aACd,CACF,EACA,EAAS,QAAU,CAAC,OAAQ,SAAS,EAAG,EAAS,OAAS,CACxD,IAAK,MACP,EACG,IAAC,EAAU","file":"/npm/@stimulus-components/popover@7.0.0/dist/stimulus-popover.mjs/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/@stimulus-components/popover@7.0.0/dist/stimulus-popover.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { Controller } from \"@hotwired/stimulus\";\nconst _Popover = class _Popover extends Controller {\n  async show(event) {\n    const element = event.currentTarget;\n    let content = null;\n    if (this.hasContentTarget ? content = this.contentTarget.innerHTML : content = await this.fetch(), !content)\n      return;\n    const fragment = document.createRange().createContextualFragment(content);\n    element.appendChild(fragment);\n  }\n  hide() {\n    this.hasCardTarget && this.cardTarget.remove();\n  }\n  async fetch() {\n    if (!this.remoteContent) {\n      if (!this.hasUrlValue) {\n        console.error(\"[stimulus-popover] You need to pass an url to fetch the popover content.\");\n        return;\n      }\n      const response = await fetch(this.urlValue);\n      this.remoteContent = await response.text();\n    }\n    return this.remoteContent;\n  }\n};\n_Popover.targets = [\"card\", \"content\"], _Popover.values = {\n  url: String\n};\nlet Popover = _Popover;\nexport {\n  Popover as default\n};\n"]}