export const clsHighlightScript: "\n(function(options) {\n    const rectColor = options.color;\n    const limit = options.limit;\n    const observer = new PerformanceObserver(list => {});\n    observer.observe({ type: 'layout-shift', buffered: true });\n    const entries = observer.takeRecords();\n    if (entries.length > 0) {\n        const canvas = document.createElement('canvas'); \n        canvas.style.width='100%';\n        canvas.style.height='100%';\n        canvas.width = window.innerWidth;\n        canvas.height = window.innerHeight;\n        canvas.style.position='absolute';\n        canvas.style.left=0;\n        canvas.style.top=0;\n        canvas.style.zIndex=2147483646;\n        canvas.id = \"browsertime-ls\";\n        document.body.appendChild(canvas);\n\n        function paintRectangle(context, clientRect, color) { \n            context.fillStyle = color;\n            context.globalAlpha = 0.03;\n            context.rect(Math.max(0,clientRect.x), Math.max(0,clientRect.y), Math.min(clientRect.width, window.innerWidth - clientRect.x) , Math.min(clientRect.height, window.innerHeight-clientRect.y));\n            context.fill();\n\n\n            context.strokeStyle = color;\n            context.globalAlpha = 1.0;\n            context.rect(Math.max(0,clientRect.x), Math.max(0,clientRect.y), Math.min(clientRect.width, window.innerWidth - clientRect.x) , Math.min(clientRect.height, window.innerHeight-clientRect.y));\n            context.stroke();\n        }\n\n        let maxSessionGap1sLimit5s = {}; \n        let max = 0; \n        let current = [];\n        let curr = 0; \n        let firstTs = Number.NEGATIVE_INFINITY;\n        let prevTs = Number.NEGATIVE_INFINITY;\n\n        for (let entry of entries) {\n            if (entry.hadRecentInput || entry.value <= limit) {\n                continue;\n            } \n        if (entry.startTime - firstTs > 5000 || entry.startTime - prevTs > 1000) {\n            firstTs = entry.startTime;\n            curr = 0;\n            maxSessionGap1sLimit5s[max] = [...current];\n            current = []; \n          }\n          prevTs = entry.startTime;\n          curr += entry.value;\n          max = Math.max(max, curr);\n          current.push(entry);\n        }\n\n          for (let entry of maxSessionGap1sLimit5s[max] || current) {\n            for (let source of entry.sources) {\n                if (source.previousRect && source.currentRect) {\n                    const context = canvas.getContext('2d');\n                    \n                    // paintRectangle(context, source.previousRect, \"yellow\", false);\n                    paintRectangle(context, source.currentRect, rectColor);\n                \n                    context.font = \"bolder 24px Arial\";\n                    context.fillStyle = \"black\";\n                    context.fillText(entry.value.toFixed(4), Math.max(0,source.currentRect.x) + 24,Math.max(0,source.currentRect.y) + 24);\n\n                }\n            }\n        }\n    }\n})(arguments[arguments.length - 1]);\n";
//# sourceMappingURL=lsHighlightScript.d.ts.map