{"version":3,"file":"share_controller-DbEQhrO8.js","names":[],"sources":["../../../app/javascript/entrypoints/site_controllers/share_controller.js"],"sourcesContent":["import { Controller } from \"@hotwired/stimulus\"\n\n// \"Copy link\" button of the article share box (no third-party scripts).\nexport default class extends Controller {\n static targets = [\"button\"]\n static values = { copied: String }\n\n async copy(event) {\n const label = this.buttonTarget.textContent\n try {\n await navigator.clipboard.writeText(event.params.url)\n this.buttonTarget.textContent = this.copiedValue\n } catch {\n window.prompt(\"\", event.params.url)\n }\n setTimeout(() => { this.buttonTarget.textContent = label }, 1800)\n }\n}\n"],"mappings":"4GAGA,EAAA,cAA6B,CAAW,CACtC,OAAO,QAAU,CAAC,SAAS,CAC3B,OAAO,OAAS,CAAE,OAAQ,OAAQ,CAElC,MAAM,KAAK,EAAO,CAChB,IAAM,EAAQ,KAAK,aAAa,YAChC,GAAI,CACF,MAAM,UAAU,UAAU,UAAU,EAAM,OAAO,IAAI,CACrD,KAAK,aAAa,YAAc,KAAK,iBAC/B,CACN,OAAO,OAAO,GAAI,EAAM,OAAO,IAAI,CAErC,eAAiB,CAAE,KAAK,aAAa,YAAc,GAAS,KAAK"}