Socket
Socket
Sign inDemoInstall

fela-dom

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fela-dom - npm Package Compare versions

Comparing version 12.0.0-rc.0 to 12.0.0-rc.1

3

es/dom/rehydration/generateCacheEntry.js

@@ -7,6 +7,7 @@ import { generateCSSSelector } from 'fela-utils';

var specificityPrefix = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : '';
var propertyPriority = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
return {
type: type,
className: className,
selector: generateCSSSelector(className, pseudo, specificityPrefix),
selector: generateCSSSelector(className, pseudo, specificityPrefix, propertyPriority),
declaration: property + ':' + value,

@@ -13,0 +14,0 @@ pseudo: pseudo,

@@ -26,3 +26,3 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }

if (!regexMap[specificityPrefix]) {
regexMap[specificityPrefix] = new RegExp("".concat(escapeRegExp(specificityPrefix), "[.]([0-9a-z_-]+)([.][0-9a-z_-]+){0,}([^{]+)?{([^:]+):([^}]+)}"), 'gi');
regexMap[specificityPrefix] = new RegExp("".concat(escapeRegExp(specificityPrefix), "[.]([0-9a-z_-]+)(([.][0-9a-z_-]+){0,})([^{]+)?{([^:]+):([^}]+)}"), 'gi');
}

@@ -33,2 +33,20 @@

function rehydrateClassList(classList, className) {
if (classList) {
var regex = new RegExp("(([.]".concat(className, ")+)?(.*)?"), '');
var _classList$match = classList.match(regex),
_classList$match2 = _slicedToArray(_classList$match, 4),
match = _classList$match2[0],
repeated = _classList$match2[1],
selector = _classList$match2[2],
_classList$match2$ = _classList$match2[3],
other = _classList$match2$ === void 0 ? '' : _classList$match2$;
return [other, repeated ? repeated.length / selector.length + 1 : 1];
}
return ['', 1];
}
export default function rehydrateRules(css) {

@@ -46,17 +64,23 @@ var media = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

while (decl = DECL_REGEX.exec(css)) {
// $FlowFixMe
var _decl = decl,
_decl2 = _slicedToArray(_decl, 6),
_decl2 = _slicedToArray(_decl, 7),
ruleSet = _decl2[0],
className = _decl2[1],
_ = _decl2[2],
pseudo = _decl2[3],
property = _decl2[4],
value = _decl2[5];
classList = _decl2[2],
_ = _decl2[3],
_decl2$ = _decl2[4],
pseudo = _decl2$ === void 0 ? '' : _decl2$,
property = _decl2[5],
value = _decl2[6];
/* eslint-enable */
var _rehydrateClassList = rehydrateClassList(classList, className),
_rehydrateClassList2 = _slicedToArray(_rehydrateClassList, 2),
classes = _rehydrateClassList2[0],
propertyPriority = _rehydrateClassList2[1];
var declarationReference = generateDeclarationReference( // keep css custom properties as lower-cased props
property.indexOf('--') === 0 ? property : camelCaseProperty(property), value, pseudo, media, support);
cache[declarationReference] = generateCacheEntry(RULE_TYPE, className, property, value, pseudo, media, support, specificityPrefix);
property.indexOf('--') === 0 ? property : camelCaseProperty(property), value, classes + pseudo, media, support);
cache[declarationReference] = generateCacheEntry(RULE_TYPE, className, property, value, classes + pseudo, media, support, specificityPrefix, propertyPriority);
}

@@ -63,0 +87,0 @@

@@ -15,6 +15,7 @@ "use strict";

var specificityPrefix = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : '';
var propertyPriority = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : 1;
return {
type: type,
className: className,
selector: (0, _felaUtils.generateCSSSelector)(className, pseudo, specificityPrefix),
selector: (0, _felaUtils.generateCSSSelector)(className, pseudo, specificityPrefix, propertyPriority),
declaration: property + ':' + value,

@@ -21,0 +22,0 @@ pseudo: pseudo,

@@ -38,3 +38,3 @@ "use strict";

if (!regexMap[specificityPrefix]) {
regexMap[specificityPrefix] = new RegExp("".concat(escapeRegExp(specificityPrefix), "[.]([0-9a-z_-]+)([.][0-9a-z_-]+){0,}([^{]+)?{([^:]+):([^}]+)}"), 'gi');
regexMap[specificityPrefix] = new RegExp("".concat(escapeRegExp(specificityPrefix), "[.]([0-9a-z_-]+)(([.][0-9a-z_-]+){0,})([^{]+)?{([^:]+):([^}]+)}"), 'gi');
}

@@ -45,2 +45,20 @@

function rehydrateClassList(classList, className) {
if (classList) {
var regex = new RegExp("(([.]".concat(className, ")+)?(.*)?"), '');
var _classList$match = classList.match(regex),
_classList$match2 = _slicedToArray(_classList$match, 4),
match = _classList$match2[0],
repeated = _classList$match2[1],
selector = _classList$match2[2],
_classList$match2$ = _classList$match2[3],
other = _classList$match2$ === void 0 ? '' : _classList$match2$;
return [other, repeated ? repeated.length / selector.length + 1 : 1];
}
return ['', 1];
}
function rehydrateRules(css) {

@@ -58,17 +76,23 @@ var media = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';

while (decl = DECL_REGEX.exec(css)) {
// $FlowFixMe
var _decl = decl,
_decl2 = _slicedToArray(_decl, 6),
_decl2 = _slicedToArray(_decl, 7),
ruleSet = _decl2[0],
className = _decl2[1],
_ = _decl2[2],
pseudo = _decl2[3],
property = _decl2[4],
value = _decl2[5];
classList = _decl2[2],
_ = _decl2[3],
_decl2$ = _decl2[4],
pseudo = _decl2$ === void 0 ? '' : _decl2$,
property = _decl2[5],
value = _decl2[6];
/* eslint-enable */
var _rehydrateClassList = rehydrateClassList(classList, className),
_rehydrateClassList2 = _slicedToArray(_rehydrateClassList, 2),
classes = _rehydrateClassList2[0],
propertyPriority = _rehydrateClassList2[1];
var declarationReference = (0, _felaUtils.generateDeclarationReference)( // keep css custom properties as lower-cased props
property.indexOf('--') === 0 ? property : (0, _cssInJsUtils.camelCaseProperty)(property), value, pseudo, media, support);
cache[declarationReference] = (0, _generateCacheEntry["default"])(_felaUtils.RULE_TYPE, className, property, value, pseudo, media, support, specificityPrefix);
property.indexOf('--') === 0 ? property : (0, _cssInJsUtils.camelCaseProperty)(property), value, classes + pseudo, media, support);
cache[declarationReference] = (0, _generateCacheEntry["default"])(_felaUtils.RULE_TYPE, className, property, value, classes + pseudo, media, support, specificityPrefix, propertyPriority);
}

@@ -75,0 +99,0 @@

{
"name": "fela-dom",
"version": "12.0.0-rc.0",
"version": "12.0.0-rc.1",
"description": "Fela package for working with the DOM",

@@ -17,5 +17,5 @@ "main": "lib/index.js",

"scripts": {
"setup": "yarn build",
"setup": "pnpm build",
"clean": "rimraf lib es coverage",
"build": "yarn clean && yarn build:es && yarn build:lib",
"build": "pnpm clean && pnpm build:es && pnpm build:lib",
"build:es": "babel src --out-dir es --ignore **/__tests__",

@@ -28,3 +28,3 @@ "build:lib": "cross-env BABEL_ENV=commonjs babel src --out-dir lib --ignore **/__tests__",

"test": "jest --config=jest.config.js",
"coverage": "yarn test --coverage"
"coverage": "pnpm test --coverage"
},

@@ -45,3 +45,3 @@ "repository": "https://github.com/robinweser/fela/",

"fast-loops": "^1.0.1",
"fela-utils": "^12.0.0-rc.0",
"fela-utils": "^12.0.0-rc.1",
"sort-css-media-queries": "^1.4.3"

@@ -61,5 +61,5 @@ },

"cross-env": "^6.0.3",
"fela": "^12.0.0-rc.0",
"fela-preset-web": "^12.0.0-rc.0",
"fela-tools": "^12.0.0-rc.0",
"fela": "^12.0.0-rc.1",
"fela-preset-web": "^12.0.0-rc.1",
"fela-tools": "^12.0.0-rc.1",
"jest": "^26.6.0",

@@ -72,3 +72,3 @@ "js-beautify": "^1.14.0",

},
"gitHead": "00f02f410f17a7693479ea3349bb3a9f223359af"
"gitHead": "20e073d04b1a97beb6a099e160b0813db845a5e9"
}

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("FelaDom",[],e):"object"==typeof exports?exports.FelaDom=e():t.FelaDom=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}({2:function(t,e,r){"use strict";function n(t,e){for(var r in t)e(t[r],r,t)}r.r(e),r.d(e,"render",(function(){return h})),r.d(e,"rehydrate",(function(){return Y})),r.d(e,"renderToMarkup",(function(){return lt})),r.d(e,"renderToSheetList",(function(){return pt}));function o(t,e){return"".concat(t,"{").concat(e,"}")}function i(t){var e=t.type,r=t.media,n=t.support,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,i=r?'[media="'.concat(r,'"]'):":not([media])",u=n?'[data-fela-support="true"]':':not([data-fela-support="true"])';return o.querySelector('[data-fela-type="'.concat(e,'"]').concat(u).concat(i))}function u(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e,r){var n=e.type,o=e.media,i=e.support;switch(n){case"FONT":case"STATIC":case"KEYFRAME":return t[0];case"RULE":var a=t.map((function(t){return t.media})).filter((function(t){return 0!==t.length}));if(o){var c=[].concat(u(a),[o]).sort(r),l=c.indexOf(o)+1,f=c[l];if(f)return f===o&&i?t.find((function(t){return t.media===c[c.indexOf(o)+2]})):t.find((function(t){return t.media===f}))}else{var s=a.sort(r)[0];if(!i){var d=t.find((function(t){return void 0!==t.getAttribute("data-fela-support")&&""===t.media&&"RULE"===t.getAttribute("data-fela-type")}));if(d)return d}if(s)return t.find((function(t){return t.media===s}))}}}function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=e.head||{},i=t.type,u=t.media,a=t.support,f=e.createElement("style");for(var d in f.setAttribute("data-fela-type",i),f.type="text/css",a&&f.setAttribute("data-fela-support","true"),u&&(f.media=u),n)f.setAttribute(d,n[d]);if(void 0!==("undefined"==typeof window?"undefined":s(window))&&window.FelaConfig)for(var p in window.FelaConfig.styleNodeAttributes)f.setAttribute(p,window.FelaConfig.styleNodeAttributes[p]);var y=o.querySelectorAll("[data-fela-type]"),b=c(l(y),t,r);return b?o.insertBefore(f,b):o.appendChild(f),f}function p(t){var e=t.type,r=t.media,n=void 0===r?"":r,o=t.support;return e+n+(void 0===o?"":o)}function y(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n=p(t);if(!e.nodes[n]){var o=i(t,r)||d(t,r,e.sortMediaQuery,e.styleNodeAttributes);e.nodes[n]=o}return e.nodes[n]}function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.length||0===e.length?0:t.indexOf(t.find((function(t){return null!==e.match(t)})))+1}function m(t,e){return"@supports ".concat(t,"{").concat(e,"}")}function v(t,e,r){var n=t.selector,i=t.declaration,u=t.support,a=t.media,c=t.pseudo,l=a+u;try{var f=b(e.ruleOrder,c),s=r.sheet.cssRules,d=s.length;if(0===f)d=void 0===e.scoreIndex[l]?0:e.scoreIndex[l]+1;else for(var p=e.scoreIndex[l]||0,y=s.length;p<y;++p)if(s[p].score>f){d=p;break}var v=o(n,i);if(u.length>0){var h=m(u,v);r.sheet.insertRule(h,d)}else r.sheet.insertRule(v,d);0===f&&(e.scoreIndex[l]=d),s[d].score=f}catch(t){}}function h(t,e){t.updateSubscription||(t.scoreIndex={},t.nodes={},t.updateSubscription=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return function(r){if("CLEAR"===r.type)return n(t.nodes,(function(t){return t.parentNode.removeChild(t)})),t.nodes={},void(t.scoreIndex={});var i=y(r,t,e);switch(r.type){case"KEYFRAME":-1===i.textContent.indexOf(r.keyframe)&&(i.textContent+=r.keyframe);break;case"FONT":-1===i.textContent.indexOf(r.fontFace)&&(i.textContent+=r.fontFace);break;case"STATIC":var u=r.selector?o(r.selector,r.css):r.css;-1===i.textContent.indexOf(u)&&(i.textContent+=u);break;case"RULE":v(r,t,i)}}}(t,e),t.subscribe(t.updateSubscription),n(t.cache,t._emitChange))}function g(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r],r,n,t)}function A(t){return t.split("{")[0].slice(9).trim()}function O(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return o+n+r+t+e}var S=/-([a-z])/g,R=/^Ms/g,j={};function w(t){return t[1].toUpperCase()}function x(t){if(j.hasOwnProperty(t))return j[t];var e=t.replace(S,w).replace(R,"ms");return j[t]=e,e}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=".".concat(t).repeat(n);return"".concat(r).concat(o).concat(e)}function I(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"";return{type:t,className:e,selector:E(e,o,a),declaration:r+":"+n,pseudo:o,media:i,support:u}}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var C={};function T(t){return C[t]||(C[t]=new RegExp("".concat(t.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),"[.]([0-9a-z_-]+)([.][0-9a-z_-]+){0,}([^{]+)?{([^:]+):([^}]+)}"),"gi")),C[t]}function F(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",u=T(i);e=u.exec(t);){var a=e,c=M(a,6),l=(c[0],c[1]),f=(c[2],c[3]),s=c[4],d=c[5],p=O(0===s.indexOf("--")?s:x(s),d,f,r,n);o[p]=I("RULE",l,s,d,f,r,n,i)}return o}function U(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var N=/@supports[^{]+\{([\s\S]+?})\s*}/gi;function L(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";e=N.exec(t);){var i=e,u=U(i,2),a=u[0],c=u[1],l=A(a);F(c,r,l,n,o)}return n}function _(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return D(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var $=/@(-webkit-|-moz-)?keyframes ([a-z_][a-z0-9-_]*)(\{.*?(?=}})}})/gi;function z(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=$.exec(t);){var n=e,o=_(n,4),i=o[0],u=(o[1],o[2]),a=o[3];r[a]?r[a].keyframe+=i:r[a]={type:"KEYFRAME",keyframe:i,name:u}}return r}var q,K=/[.][a-z0-9_-]*/gi;function Y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;h(t,e),g(e.querySelectorAll("[data-fela-type]"),(function(e){var r=e.getAttribute("data-fela-rehydration")||-1,n=t.uniqueRuleIdentifier||parseInt(r,10);if(-1!==n){var o=e.getAttribute("data-fela-type")||"",i=e.getAttribute("media")||"",u=e.getAttribute("data-fela-support")||"",a=e.textContent;t.uniqueRuleIdentifier=n;var c=o+i+u;if(t.nodes[c]=e,"RULE"===o){if(u?L(a,i,t.cache,t.specificityPrefix):F(a,i,"",t.cache,t.specificityPrefix),e.sheet&&e.sheet.cssRules){var l=i+u;g(e.sheet.cssRules,(function(e,r){var n=e.conditionText?e.cssRules[0].selectorText:e.selectorText,o=b(t.ruleOrder,n.split(K)[1]);0===o&&(t.scoreIndex[l]=r),e.score=o}))}}else"KEYFRAME"===o&&z(a,t.cache)}}))}function Q(t,e,r){for(var n in t)r=e(r,t[n],n,t);return r}function B(t,e,r){for(var n=0,o=t.length;n<o;++n)r=e(r,t[n],n,o,t);return r}function G(t){return function(t){if(Array.isArray(t))return H(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return H(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function J(t){return function(t){if(Array.isArray(t))return V(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return V(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return V(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function W(t,e){return B(Q(t,(function(r,n,o){var i=function(t,e){for(var r=-1,n=0;n<t.length;n++)if(e(t[n])){r=n;break}return r}(r,(function(r){return e(t[r],r)>e(n,o)}));return-1!==i?function(t,e,r){return[].concat(G(t.slice(0,r)),[e],G(t.slice(r,t.length)))}(r,o,i):[].concat(J(r),[o])}),[]),(function(e,r){return e[r]=t[r],e}),{})}function X(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Z=(X(q={},"RULE",(function(t,e){var r=e.selector,n=e.declaration,i=e.support,u=e.media,a=o(r,n);i?u?(t.supportMediaRules[u]||(t.supportMediaRules[u]={}),t.supportMediaRules[u][i]||(t.supportMediaRules[u][i]=""),t.supportMediaRules[u][i]+=a):(t.supportRules[i]||(t.supportRules[i]=""),t.supportRules[i]+=a):u?(t.mediaRules[u]||(t.mediaRules[u]=""),t.mediaRules[u]+=a):t.rules+=a})),X(q,"FONT",(function(t,e){var r=e.fontFace;t.fontFaces+=r})),X(q,"KEYFRAME",(function(t,e){var r=e.keyframe;t.keyframes+=r})),X(q,"STATIC",(function(t,e){var r=e.css,n=e.selector;t.statics+=n?o(n,r):r})),q);function tt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=W(t,(function(t){return b(e,t.pseudo)}));return Q(r,(function(t,e){var r=Z[e.type];return r&&r(t,e),t}),{mediaRules:{},supportRules:{},supportMediaRules:{},fontFaces:"",statics:"",keyframes:"",rules:""})}var et={fontFaces:"FONT",statics:"STATIC",keyframes:"KEYFRAME",rules:"RULE"};function rt(t){return Q(t,(function(t,e,r){return e.length>0&&(t+=m(r,e)),t}),"")}function nt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},u=r.length>0?' media="'.concat(r,'"'):"",a=o?' data-fela-support="true"':"",c=Q(i,(function(t,e,r){return t+" "+r+'="'+e+'"'}),"");return'<style type="text/css" data-fela-rehydration="'.concat(n,'" data-fela-type="').concat(e,'"').concat(a).concat(u).concat(c,">").concat(t,"</style>")}var ot=/^[a-z0-9_-]*$/gi;function it(t){return 0===t.selectorPrefix.length||null!==t.selectorPrefix.match(ot)?t.uniqueRuleIdentifier:-1}function ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(r),!0).forEach((function(e){ct(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ct(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lt(t){var e=tt(t.cache,t.ruleOrder),r=it(t),n=Q(et,(function(n,o,i){return e[i].length>0&&(n+=nt(e[i],o,"",r,!1,t.styleNodeAttributes)),n}),""),o=rt(e.supportRules);return o&&(n+=nt(o,"RULE","",r,!0,t.styleNodeAttributes)),B(Object.keys(at(at({},e.supportMediaRules),e.mediaRules)).sort(t.sortMediaQuery),(function(n,o){if(e.mediaRules[o]&&e.mediaRules[o].length>0&&(n+=nt(e.mediaRules[o],"RULE",o,r,!1,t.styleNodeAttributes)),e.supportMediaRules[o]){var i=rt(e.supportMediaRules[o]);i.length>0&&(n+=nt(i,"RULE",o,r,!0,t.styleNodeAttributes))}return n}),n)}function ft(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function st(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ft(Object(r),!0).forEach((function(e){dt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ft(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function dt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pt(t){var e=tt(t.cache,t.ruleOrder),r=it(t),n=Q(et,(function(n,o,i){return e[i].length>0&&n.push({css:e[i],rehydration:r,attributes:t.styleNodeAttributes,type:o}),n}),[]),o=rt(e.supportRules);return o&&n.push({css:o,type:"RULE",rehydration:r,attributes:t.styleNodeAttributes,support:!0}),B(Object.keys(st(st({},e.supportMediaRules),e.mediaRules)).sort(t.sortMediaQuery),(function(n,o){if(e.mediaRules[o]&&e.mediaRules[o].length>0&&n.push({css:e.mediaRules[o],type:"RULE",rehydration:r,attributes:t.styleNodeAttributes,media:o}),e.supportMediaRules[o]){var i=rt(e.supportMediaRules[o]);i.length>0&&n.push({css:i,type:"RULE",rehydration:r,attributes:t.styleNodeAttributes,support:!0,media:o})}return n}),n)}}})}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("FelaDom",[],e):"object"==typeof exports?exports.FelaDom=e():t.FelaDom=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}({2:function(t,e,r){"use strict";function n(t,e){for(var r in t)e(t[r],r,t)}r.r(e),r.d(e,"render",(function(){return h})),r.d(e,"rehydrate",(function(){return Q})),r.d(e,"renderToMarkup",(function(){return ft})),r.d(e,"renderToSheetList",(function(){return yt}));function o(t,e){return"".concat(t,"{").concat(e,"}")}function i(t){var e=t.type,r=t.media,n=t.support,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,i=r?'[media="'.concat(r,'"]'):":not([media])",u=n?'[data-fela-support="true"]':':not([data-fela-support="true"])';return o.querySelector('[data-fela-type="'.concat(e,'"]').concat(u).concat(i))}function u(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function c(t,e,r){var n=e.type,o=e.media,i=e.support;switch(n){case"FONT":case"STATIC":case"KEYFRAME":return t[0];case"RULE":var a=t.map((function(t){return t.media})).filter((function(t){return 0!==t.length}));if(o){var c=[].concat(u(a),[o]).sort(r),l=c.indexOf(o)+1,f=c[l];if(f)return f===o&&i?t.find((function(t){return t.media===c[c.indexOf(o)+2]})):t.find((function(t){return t.media===f}))}else{var s=a.sort(r)[0];if(!i){var d=t.find((function(t){return void 0!==t.getAttribute("data-fela-support")&&""===t.media&&"RULE"===t.getAttribute("data-fela-type")}));if(d)return d}if(s)return t.find((function(t){return t.media===s}))}}}function l(t){return function(t){if(Array.isArray(t))return f(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=e.head||{},i=t.type,u=t.media,a=t.support,f=e.createElement("style");for(var d in f.setAttribute("data-fela-type",i),f.type="text/css",a&&f.setAttribute("data-fela-support","true"),u&&(f.media=u),n)f.setAttribute(d,n[d]);if(void 0!==("undefined"==typeof window?"undefined":s(window))&&window.FelaConfig)for(var p in window.FelaConfig.styleNodeAttributes)f.setAttribute(p,window.FelaConfig.styleNodeAttributes[p]);var y=o.querySelectorAll("[data-fela-type]"),b=c(l(y),t,r);return b?o.insertBefore(f,b):o.appendChild(f),f}function p(t){var e=t.type,r=t.media,n=void 0===r?"":r,o=t.support;return e+n+(void 0===o?"":o)}function y(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:document,n=p(t);if(!e.nodes[n]){var o=i(t,r)||d(t,r,e.sortMediaQuery,e.styleNodeAttributes);e.nodes[n]=o}return e.nodes[n]}function b(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return 0===t.length||0===e.length?0:t.indexOf(t.find((function(t){return null!==e.match(t)})))+1}function v(t,e){return"@supports ".concat(t,"{").concat(e,"}")}function m(t,e,r){var n=t.selector,i=t.declaration,u=t.support,a=t.media,c=t.pseudo,l=a+u;try{var f=b(e.ruleOrder,c),s=r.sheet.cssRules,d=s.length;if(0===f)d=void 0===e.scoreIndex[l]?0:e.scoreIndex[l]+1;else for(var p=e.scoreIndex[l]||0,y=s.length;p<y;++p)if(s[p].score>f){d=p;break}var m=o(n,i);if(u.length>0){var h=v(u,m);r.sheet.insertRule(h,d)}else r.sheet.insertRule(m,d);0===f&&(e.scoreIndex[l]=d),s[d].score=f}catch(t){}}function h(t,e){t.updateSubscription||(t.scoreIndex={},t.nodes={},t.updateSubscription=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return function(r){if("CLEAR"===r.type)return n(t.nodes,(function(t){return t.parentNode.removeChild(t)})),t.nodes={},void(t.scoreIndex={});var i=y(r,t,e);switch(r.type){case"KEYFRAME":-1===i.textContent.indexOf(r.keyframe)&&(i.textContent+=r.keyframe);break;case"FONT":-1===i.textContent.indexOf(r.fontFace)&&(i.textContent+=r.fontFace);break;case"STATIC":var u=r.selector?o(r.selector,r.css):r.css;-1===i.textContent.indexOf(u)&&(i.textContent+=u);break;case"RULE":m(r,t,i)}}}(t,e),t.subscribe(t.updateSubscription),n(t.cache,t._emitChange))}function g(t,e){for(var r=0,n=t.length;r<n;++r)e(t[r],r,n,t)}function A(t){return t.split("{")[0].slice(9).trim()}function O(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return o+n+r+t+e}var R=/-([a-z])/g,S=/^Ms/g,j={};function w(t){return t[1].toUpperCase()}function x(t){if(j.hasOwnProperty(t))return j[t];var e=t.replace(R,w).replace(S,"ms");return j[t]=e,e}function E(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,o=".".concat(t).repeat(n);return"".concat(r).concat(o).concat(e)}function I(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",a=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:1;return{type:t,className:e,selector:E(e,o,a,c),declaration:r+":"+n,pseudo:o,media:i,support:u}}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return P(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return P(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var C={};function T(t){return C[t]||(C[t]=new RegExp("".concat(t.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),"[.]([0-9a-z_-]+)(([.][0-9a-z_-]+){0,})([^{]+)?{([^:]+):([^}]+)}"),"gi")),C[t]}function F(t,e){if(t){var r=new RegExp("(([.]".concat(e,")+)?(.*)?"),""),n=M(t.match(r),4),o=(n[0],n[1]),i=n[2],u=n[3];return[void 0===u?"":u,o?o.length/i.length+1:1]}return["",1]}function U(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",u=T(i);e=u.exec(t);){var a=e,c=M(a,7),l=(c[0],c[1]),f=c[2],s=(c[3],c[4]),d=void 0===s?"":s,p=c[5],y=c[6],b=F(f,l),v=M(b,2),m=v[0],h=v[1],g=O(0===p.indexOf("--")?p:x(p),y,m+d,r,n);o[g]=I("RULE",l,p,y,m+d,r,n,i,h)}return o}function k(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return N(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var L=/@supports[^{]+\{([\s\S]+?})\s*}/gi;function _(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";e=L.exec(t);){var i=e,u=k(i,2),a=u[0],c=u[1],l=A(a);U(c,r,l,n,o)}return n}function D(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],u=!0,a=!1;try{for(r=r.call(t);!(u=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==r.return||r.return()}finally{if(a)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return $(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var z=/@(-webkit-|-moz-)?keyframes ([a-z_][a-z0-9-_]*)(\{.*?(?=}})}})/gi;function q(t){for(var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=z.exec(t);){var n=e,o=D(n,4),i=o[0],u=(o[1],o[2]),a=o[3];r[a]?r[a].keyframe+=i:r[a]={type:"KEYFRAME",keyframe:i,name:u}}return r}var K,Y=/[.][a-z0-9_-]*/gi;function Q(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;h(t,e),g(e.querySelectorAll("[data-fela-type]"),(function(e){var r=e.getAttribute("data-fela-rehydration")||-1,n=t.uniqueRuleIdentifier||parseInt(r,10);if(-1!==n){var o=e.getAttribute("data-fela-type")||"",i=e.getAttribute("media")||"",u=e.getAttribute("data-fela-support")||"",a=e.textContent;t.uniqueRuleIdentifier=n;var c=o+i+u;if(t.nodes[c]=e,"RULE"===o){if(u?_(a,i,t.cache,t.specificityPrefix):U(a,i,"",t.cache,t.specificityPrefix),e.sheet&&e.sheet.cssRules){var l=i+u;g(e.sheet.cssRules,(function(e,r){var n=e.conditionText?e.cssRules[0].selectorText:e.selectorText,o=b(t.ruleOrder,n.split(Y)[1]);0===o&&(t.scoreIndex[l]=r),e.score=o}))}}else"KEYFRAME"===o&&q(a,t.cache)}}))}function B(t,e,r){for(var n in t)r=e(r,t[n],n,t);return r}function G(t,e,r){for(var n=0,o=t.length;n<o;++n)r=e(r,t[n],n,o,t);return r}function H(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return J(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return J(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function V(t){return function(t){if(Array.isArray(t))return W(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return W(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return W(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function W(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function X(t,e){return G(B(t,(function(r,n,o){var i=function(t,e){for(var r=-1,n=0;n<t.length;n++)if(e(t[n])){r=n;break}return r}(r,(function(r){return e(t[r],r)>e(n,o)}));return-1!==i?function(t,e,r){return[].concat(H(t.slice(0,r)),[e],H(t.slice(r,t.length)))}(r,o,i):[].concat(V(r),[o])}),[]),(function(e,r){return e[r]=t[r],e}),{})}function Z(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var tt=(Z(K={},"RULE",(function(t,e){var r=e.selector,n=e.declaration,i=e.support,u=e.media,a=o(r,n);i?u?(t.supportMediaRules[u]||(t.supportMediaRules[u]={}),t.supportMediaRules[u][i]||(t.supportMediaRules[u][i]=""),t.supportMediaRules[u][i]+=a):(t.supportRules[i]||(t.supportRules[i]=""),t.supportRules[i]+=a):u?(t.mediaRules[u]||(t.mediaRules[u]=""),t.mediaRules[u]+=a):t.rules+=a})),Z(K,"FONT",(function(t,e){var r=e.fontFace;t.fontFaces+=r})),Z(K,"KEYFRAME",(function(t,e){var r=e.keyframe;t.keyframes+=r})),Z(K,"STATIC",(function(t,e){var r=e.css,n=e.selector;t.statics+=n?o(n,r):r})),K);function et(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=X(t,(function(t){return b(e,t.pseudo)}));return B(r,(function(t,e){var r=tt[e.type];return r&&r(t,e),t}),{mediaRules:{},supportRules:{},supportMediaRules:{},fontFaces:"",statics:"",keyframes:"",rules:""})}var rt={fontFaces:"FONT",statics:"STATIC",keyframes:"KEYFRAME",rules:"RULE"};function nt(t){return B(t,(function(t,e,r){return e.length>0&&(t+=v(r,e)),t}),"")}function ot(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},u=r.length>0?' media="'.concat(r,'"'):"",a=o?' data-fela-support="true"':"",c=B(i,(function(t,e,r){return t+" "+r+'="'+e+'"'}),"");return'<style type="text/css" data-fela-rehydration="'.concat(n,'" data-fela-type="').concat(e,'"').concat(a).concat(u).concat(c,">").concat(t,"</style>")}var it=/^[a-z0-9_-]*$/gi;function ut(t){return 0===t.selectorPrefix.length||null!==t.selectorPrefix.match(it)?t.uniqueRuleIdentifier:-1}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?at(Object(r),!0).forEach((function(e){lt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function lt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ft(t){var e=et(t.cache,t.ruleOrder),r=ut(t),n=B(rt,(function(n,o,i){return e[i].length>0&&(n+=ot(e[i],o,"",r,!1,t.styleNodeAttributes)),n}),""),o=nt(e.supportRules);return o&&(n+=ot(o,"RULE","",r,!0,t.styleNodeAttributes)),G(Object.keys(ct(ct({},e.supportMediaRules),e.mediaRules)).sort(t.sortMediaQuery),(function(n,o){if(e.mediaRules[o]&&e.mediaRules[o].length>0&&(n+=ot(e.mediaRules[o],"RULE",o,r,!1,t.styleNodeAttributes)),e.supportMediaRules[o]){var i=nt(e.supportMediaRules[o]);i.length>0&&(n+=ot(i,"RULE",o,r,!0,t.styleNodeAttributes))}return n}),n)}function st(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function dt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?st(Object(r),!0).forEach((function(e){pt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function pt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yt(t){var e=et(t.cache,t.ruleOrder),r=ut(t),n=B(rt,(function(n,o,i){return e[i].length>0&&n.push({css:e[i],rehydration:r,attributes:t.styleNodeAttributes,type:o}),n}),[]),o=nt(e.supportRules);return o&&n.push({css:o,type:"RULE",rehydration:r,attributes:t.styleNodeAttributes,support:!0}),G(Object.keys(dt(dt({},e.supportMediaRules),e.mediaRules)).sort(t.sortMediaQuery),(function(n,o){if(e.mediaRules[o]&&e.mediaRules[o].length>0&&n.push({css:e.mediaRules[o],type:"RULE",rehydration:r,attributes:t.styleNodeAttributes,media:o}),e.supportMediaRules[o]){var i=nt(e.supportMediaRules[o]);i.length>0&&n.push({css:i,type:"RULE",rehydration:r,attributes:t.styleNodeAttributes,support:!0,media:o})}return n}),n)}}})}));
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc