{"version":3,"sources":["jsdelivr-header.js","/npm/use-no-sleep@0.3.1/lib/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNO,YAAa,oBACX,UAAW,QAAS,aAAgB,eACtC,IAAI,WAAa,SAAU,GAC9B,IAAI,EAAK,UAAS,GAAQ,EAAiB,EAAG,GAAI,EAAoB,EAAG,GACrE,EAAU,SAAQ,WAAc,OAAO,IAAI,OAAW,GAAG,IAC7D,WAAU,WACF,IAAmB,IAGnB,EACA,EAAQ,SAGR,EAAQ,UAEZ,EAAkB,GACtB,GAAG,CAAC,EAAgB,EAAS,GACjC,iBACe","file":"/npm/use-no-sleep@0.3.1/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/use-no-sleep@0.3.1/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import NoSleep from \"nosleep.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nexport var useNoSleep = function (enabled) {\n    var _a = useState(false), alreadyEnabled = _a[0], setAlreadyEnabled = _a[1];\n    var noSleep = useMemo(function () { return new NoSleep(); }, []);\n    useEffect(function () {\n        if (alreadyEnabled === enabled) {\n            return;\n        }\n        if (enabled) {\n            noSleep.enable();\n        }\n        else {\n            noSleep.disable();\n        }\n        setAlreadyEnabled(enabled);\n    }, [alreadyEnabled, enabled, noSleep]);\n};\nexport default useNoSleep;\n"]}