{"version":3,"mappings":";kTAGe,MAAKA,UAASC,CAAW,CAItC,SAAU,CACTC,EAAA,IAAC,mBAAgC,CAAC,sBAClCA,EAAA,IAAC,mBAAqC,CAAC,sBACvCA,EAAA,IAAC,mBAA6C,CAAC,sBAE9C,KAAK,eAAiB,CACpB,MAAO,WACP,SAAU,IACV,UAAW,eACX,UAAW,KAAK,KAAK,IAAI,WAAW,GAAK,KAAK,gBAAkB,OAChE,YAAa,GACb,cAAe,CACb,cAAe,EAChB,EACD,MAAO,GACP,OAAQ,GACT,EAED,KAAK,SAAWC,EACd,KAAK,iBAAmB,KAAK,eAAiB,KAAK,QACnD,CACE,QAAUC,GACRA,EAAU,aAAa,cAAc,GAAK,KAAK,QACjD,GAAG,KAAK,cAChB,CACK,EAEG,KAAK,mBACP,KAAK,UAAYC,EAAgB,KAAK,SAAU,CAC9C,MAAO,EACP,SAAU,IACV,eAAgB,0BAChB,GAAG,KAAK,cAChB,CAAO,GAGC,KAAK,WACP,KAAK,YAAc,IAAM,CAErB,KAAK,UACL,KAAK,SAAS,OACd,CAAC,KAAK,SAAS,MAAM,aAErB,KAAK,SAAS,KAAM,CAEvB,EACD,SAAS,iBAAiB,aAAc,KAAK,WAAW,EAE9D,CAEE,IAAI,SAAU,CACZ,OAAO,KAAK,KAAK,IAAI,SAAS,GAAK,KAAK,YAC5C,CAEE,YAAa,CACN,KAAK,kBACR,KAAK,SAAS,QAAS,EAErB,KAAK,aACP,SAAS,oBAAoB,aAAc,KAAK,WAAW,CAEjE,CACA,CAjEEC,EADkBN,EACX,UAAU,CAAC,SAAS,GAC3BM,EAFkBN,EAEX,SAAS,CAAE,QAAS,OAAQ,UAAW,MAAQ","names":["YTooltipController","Controller","__vitePreload","tippy","reference","createSingleton","__publicField"],"ignoreList":[],"sources":["../../../app/frontend/src/yobbers/js/controllers/y-tooltip-controller.js"],"sourcesContent":["import { Controller } from '@hotwired/stimulus';\nimport tippy, { createSingleton } from 'tippy.js';\n\nexport default class extends Controller {\n static targets = ['element'];\n static values = { content: String, placement: String };\n\n connect() {\n import('tippy.js/dist/tippy.css');\n import('tippy.js/themes/material.css');\n import('tippy.js/animations/scale-subtle.css');\n\n this.defaultOptions = {\n theme: 'material',\n duration: 100,\n animation: 'scale-subtle',\n placement: this.data.get('placement') || this.placementValue || 'auto',\n hideOnClick: true,\n popperOptions: {\n positionFixed: true\n },\n arrow: true,\n zIndex: 999\n };\n\n this.instance = tippy(\n this.hasElementTarget ? this.elementTargets : this.element,\n {\n content: (reference) =>\n reference.getAttribute('data-content') || this.content,\n ...this.defaultOptions\n }\n );\n\n if (this.hasElementTarget) {\n this.singleton = createSingleton(this.instance, {\n delay: 0,\n duration: 150,\n moveTransition: 'transform 0.1s ease-out',\n ...this.defaultOptions\n });\n }\n\n if (this.instance) {\n this.hideTooltip = () => {\n if (\n this.instance &&\n this.instance.state &&\n !this.instance.state.isDestroyed\n ) {\n this.instance.hide();\n }\n };\n document.addEventListener('modal:open', this.hideTooltip);\n }\n }\n\n get content() {\n return this.data.get('content') || this.contentValue;\n }\n\n disconnect() {\n if (!this.hasElementTarget) {\n this.instance.destroy();\n }\n if (this.hideTooltip) {\n document.removeEventListener('modal:open', this.hideTooltip);\n }\n }\n}\n"],"file":"assets/y-tooltip-controller-BT1eojtF.js"}