{"version":3,"mappings":";iRAEA,SAAwBA,GAAwB,CAC9C,OACGC,MAAA,OAAI,UAAU,8DACb,SAACA,MAAAC,EAAA,CAAe,QAAQ,OAAO,KAAK,KAAK,UAAU,aAAa,CAClE,EAEJ,CCGA,MAAMC,EAAqBC,EAAA,KAAK,IAAMC,EAAA,WAAO,kCAAsB,EAAC,oKAQpE,SAAwBC,EAAyB,CAC/C,OAAAC,EACA,KAAAC,EACA,WAAAC,CACF,EAAU,CACF,MAAAC,EAAcC,EAAsC,IAAI,EACxD,CAACC,EAAMC,CAAO,EAAIC,WAAS,EAAK,EAChC,CAACC,EAAwBC,CAAyB,EAAIF,WAAS,IAAI,EAErE,OAACJ,GAAeF,IAAS,KAClBP,EAAA,IAAAgB,WAAA,IAIThB,EAAA,IAAC,OACC,UAAWiB,EACT,gBAAgBX,CAAM,GACtB,yBACAK,EAAO,kBAAoB,8BAC7B,EAEA,SAACO,OAAAC,WAAA,CAAS,SAAUnB,MAACD,IAAsB,EACzC,UAAAC,EAAA,IAACoB,EAAA,CACC,IAAKL,EACL,QAAUM,GAAM,CACdA,EAAE,eAAe,EACjBA,EAAE,gBAAgB,EACVT,EAACU,GAAM,CAACA,CAAC,CACnB,EACA,UAAWL,EACT,6DACAN,EACI,UACA,wEACN,EAEA,SAAAX,EAAA,IAACuB,EAAA,CACC,KAAMZ,EAAOa,EAAUC,EACvB,KAAK,MACL,UAAU,uCACZ,EACF,EAECd,GACCX,EAAA,IAACE,EAAA,CACC,OAAAI,EACA,WAAAE,EACA,uBAAAM,EACA,MAAO,IAAMF,EAAQ,EAAK,EAC5B,GAEJ,GAGN","names":["LoadingDetailsSpinner","jsx","LoadingSpinner","BookDetailsPopover","lazy","__vitePreload","BookDetailsPopoverButton","bookId","size","referrerId","showPopover","useIsScreenSizeBiggerThanTailwindSize","open","setOpen","useState","buttonReferenceElement","setButtonReferenceElement","Fragment","classNames","jsxs","Suspense","Button","e","o","Icon","faTimes","faBookOpen"],"ignoreList":[],"sources":["../../../app/javascript/features/BookDetailsPopover/components/LoadingDetailsSpinner.tsx","../../../app/javascript/features/BookDetailsPopover/components/BookDetailsPopoverButton.tsx"],"sourcesContent":["import LoadingSpinner from \"hardcover-ui/components/LoadingSpinner\";\n\nexport default function LoadingDetailsSpinner() {\n return (\n
\n \n
\n );\n}\n","/* eslint-disable import/no-cycle */\nimport { useState, Suspense, lazy } from \"react\";\nimport { useIsScreenSizeBiggerThanTailwindSize } from \"hooks/useIsScreenSizeBiggerThanTailwindSize\";\nimport { CoverProps } from \"hardcover-ui/theme/components/cover\";\nimport classNames from \"lib/classNames\";\nimport Button from \"hardcover-ui/components/Button\";\nimport Icon from \"hardcover-ui/components/Icon\";\nimport faBookOpen from \"icons/solid/book-open.svg\";\nimport faTimes from \"icons/solid/xmark.svg\";\nimport LoadingDetailsSpinner from \"./LoadingDetailsSpinner\";\n\nconst BookDetailsPopover = lazy(() => import(\"./BookDetailsPopover\"));\n\ninterface Props {\n bookId: number;\n size: CoverProps[\"size\"];\n referrerId?: number;\n}\n\nexport default function BookDetailsPopoverButton({\n bookId,\n size,\n referrerId,\n}: Props) {\n const showPopover = useIsScreenSizeBiggerThanTailwindSize(\"lg\");\n const [open, setOpen] = useState(false);\n const [buttonReferenceElement, setButtonReferenceElement] = useState(null);\n\n if (!showPopover || size === \"xs\") {\n return <>;\n }\n\n return (\n \n }>\n {\n e.preventDefault();\n e.stopPropagation();\n setOpen((o) => !o);\n }}\n className={classNames(\n \"absolute bottom-0 left-0 z-20 rounded-tr-lg transition-all\",\n open\n ? \"bg-card\"\n : \"bg-white/80 dark:bg-gray-700/80 dark:hover:bg-gray-800 hover:bg-white \"\n )}\n >\n \n \n\n {open && (\n setOpen(false)}\n />\n )}\n \n \n );\n}\n"],"file":"assets/BookDetailsPopoverButton-CzIz_qj9.js"}