UNPKG

next-csrf

Version:

CSRF mitigation library for Next.js

1 lines 1.75 kB
{"ast":null,"code":"\"use strict\";\n\nexports.__esModule = true;\nexports.displayContent = displayContent; // This function is used to remove Next.js' no-FOUC styles workaround for using\n// `style-loader` in development. It must be called before hydration, or else\n// rendering won't have the correct computed values in effects.\n\nfunction displayContent(callback) {\n ;\n (window.requestAnimationFrame || setTimeout)(function () {\n for (var x = document.querySelectorAll('[data-next-hide-fouc]'), i = x.length; i--;) {\n x[i].parentNode.removeChild(x[i]);\n }\n\n if (callback) {\n callback();\n }\n });\n}","map":{"version":3,"sources":["../../../client/dev/fouc.js"],"names":["window","x","document","i","callback"],"mappings":";;;yCAAA;AACA;AACA;;AACO,SAAA,cAAA,CAAA,QAAA,EAAkC;AACvC;AAAC,GAACA,MAAM,CAANA,qBAAAA,IAAD,UAAA,EAA6C,YAAY;AACxD,SACE,IAAIC,CAAC,GAAGC,QAAQ,CAARA,gBAAAA,CAAR,uBAAQA,CAAR,EAA4DC,CAAC,GAAGF,CAAC,CADnE,MAAA,EAEEE,CAFF,EAAA,GAIE;AACAF,MAAAA,CAAC,CAADA,CAAC,CAADA,CAAAA,UAAAA,CAAAA,WAAAA,CAA4BA,CAAC,CAA7BA,CAA6B,CAA7BA;AAEF;;AAAA,QAAA,QAAA,EAAc;AACZG,MAAAA,QAAQ;AAEX;AAXA,GAAA;AAYF","sourcesContent":["// This function is used to remove Next.js' no-FOUC styles workaround for using\n// `style-loader` in development. It must be called before hydration, or else\n// rendering won't have the correct computed values in effects.\nexport function displayContent(callback) {\n ;(window.requestAnimationFrame || setTimeout)(function () {\n for (\n var x = document.querySelectorAll('[data-next-hide-fouc]'), i = x.length;\n i--;\n\n ) {\n x[i].parentNode.removeChild(x[i])\n }\n if (callback) {\n callback()\n }\n })\n}\n"]},"metadata":{},"sourceType":"script"}