{
  "version": 3,
  "sources": ["tooltip.js"],
  "sourcesContent": ["import tippy from \"../vendor/tippy-6.3.7.esm.min.js\";\n\nconst DELAY_MS = [250, 0];\n\n/*\n * Every element with `data-tooltip` gets its words in a tooltip when hovered\n * or focused - drawn on the page or later, by a template or a component - and\n * a native `title` never stands in for one. The Tippy instance is made the\n * first time the element is reached, and reads the attribute each time it\n * shows, so changing the words is changing the attribute.\n *\n * A disabled button gets no mouse events, so a tooltip about why it is\n * disabled goes on an element around it (`.tooltip-anchor`), not on the\n * button itself. A tooltip is never the only name an icon button has: it\n * carries an `aria-label` as well. Nothing shows on a touch screen, where a\n * tap is the button's. The look is `css/components/_tooltip.css`.\n */\n\nconst textOf = (element) => element.dataset.tooltip ?? \"\";\n\n/**\n * A modal dialog and the viewer sit above everything in the body, so a\n * tooltip inside one is drawn there.\n */\nconst containerOf = (element) =>\n    element.closest(\"dialog[open], .pswp\") ?? document.body;\n\nfunction create(element) {\n    return tippy(element, {\n        content: textOf(element),\n        delay: DELAY_MS,\n        arrow: false,\n        offset: [0, 8],\n        maxWidth: 260,\n        placement: \"bottom\",\n        theme: \"photo\",\n        touch: false,\n        appendTo: containerOf,\n        onShow(instance) {\n            const text = textOf(instance.reference);\n            if (!text) {\n                return false;\n            }\n            instance.setContent(text);\n            return undefined;\n        },\n        showOnCreate: true,\n    });\n}\n\nfunction reach(event) {\n    const element = event.target.closest?.(\"[data-tooltip]\");\n    if (element && !element._tippy && textOf(element)) {\n        create(element);\n    }\n}\n\ndocument.addEventListener(\"mouseover\", reach);\ndocument.addEventListener(\"focusin\", reach);\n\n/**\n * Show `text` in a tooltip on `target`, or take it away when `text` is empty -\n * for words that change while the page is open. Setting `data-tooltip` does\n * the same.\n */\nexport function setTooltip(target, text) {\n    const element = target.jquery ? target[0] : target;\n    if (!element) {\n        return;\n    }\n    if (!text) {\n        delete element.dataset.tooltip;\n        element._tippy?.hide();\n        return;\n    }\n    element.dataset.tooltip = text;\n    element._tippy?.setContent(text);\n}\n"],
  "mappings": "AAAA,OAAOA,MAAW,mCAElB,MAAMC,EAAW,CAAC,IAAK,CAAC,EAgBlBC,EAAUC,GAAYA,EAAQ,QAAQ,SAAW,GAMjDC,EAAeD,GACjBA,EAAQ,QAAQ,qBAAqB,GAAK,SAAS,KAEvD,SAASE,EAAOF,EAAS,CACrB,OAAOH,EAAMG,EAAS,CAClB,QAASD,EAAOC,CAAO,EACvB,MAAOF,EACP,MAAO,GACP,OAAQ,CAAC,EAAG,CAAC,EACb,SAAU,IACV,UAAW,SACX,MAAO,QACP,MAAO,GACP,SAAUG,EACV,OAAOE,EAAU,CACb,MAAMC,EAAOL,EAAOI,EAAS,SAAS,EACtC,GAAI,CAACC,EACD,MAAO,GAEXD,EAAS,WAAWC,CAAI,CAE5B,EACA,aAAc,EAClB,CAAC,CACL,CAEA,SAASC,EAAMC,EAAO,CAClB,MAAMN,EAAUM,EAAM,OAAO,UAAU,gBAAgB,EACnDN,GAAW,CAACA,EAAQ,QAAUD,EAAOC,CAAO,GAC5CE,EAAOF,CAAO,CAEtB,CAEA,SAAS,iBAAiB,YAAaK,CAAK,EAC5C,SAAS,iBAAiB,UAAWA,CAAK,EAOnC,gBAAS,WAAWE,EAAQH,EAAM,CACrC,MAAMJ,EAAUO,EAAO,OAASA,EAAO,CAAC,EAAIA,EAC5C,GAAKP,EAGL,IAAI,CAACI,EAAM,CACP,OAAOJ,EAAQ,QAAQ,QACvBA,EAAQ,QAAQ,KAAK,EACrB,MACJ,CACAA,EAAQ,QAAQ,QAAUI,EAC1BJ,EAAQ,QAAQ,WAAWI,CAAI,EACnC",
  "names": ["tippy", "DELAY_MS", "textOf", "element", "containerOf", "create", "instance", "text", "reach", "event", "target"]
}
