No Description

style-inject.es-b888177c.js 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  2. function unwrapExports (x) {
  3. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  4. }
  5. function createCommonjsModule(fn, module) {
  6. return module = { exports: {} }, fn(module, module.exports), module.exports;
  7. }
  8. function getCjsExportFromNamespace (n) {
  9. return n && n['default'] || n;
  10. }
  11. function _classCallCheck(instance, Constructor) {
  12. if (!(instance instanceof Constructor)) {
  13. throw new TypeError("Cannot call a class as a function");
  14. }
  15. }
  16. function _defineProperties(target, props) {
  17. for (var i = 0; i < props.length; i++) {
  18. var descriptor = props[i];
  19. descriptor.enumerable = descriptor.enumerable || false;
  20. descriptor.configurable = true;
  21. if ("value" in descriptor) descriptor.writable = true;
  22. Object.defineProperty(target, descriptor.key, descriptor);
  23. }
  24. }
  25. function _createClass(Constructor, protoProps, staticProps) {
  26. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  27. if (staticProps) _defineProperties(Constructor, staticProps);
  28. return Constructor;
  29. }
  30. function _defineProperty(obj, key, value) {
  31. if (key in obj) {
  32. Object.defineProperty(obj, key, {
  33. value: value,
  34. enumerable: true,
  35. configurable: true,
  36. writable: true
  37. });
  38. } else {
  39. obj[key] = value;
  40. }
  41. return obj;
  42. }
  43. function ownKeys(object, enumerableOnly) {
  44. var keys = Object.keys(object);
  45. if (Object.getOwnPropertySymbols) {
  46. var symbols = Object.getOwnPropertySymbols(object);
  47. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  48. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  49. });
  50. keys.push.apply(keys, symbols);
  51. }
  52. return keys;
  53. }
  54. function _objectSpread2(target) {
  55. for (var i = 1; i < arguments.length; i++) {
  56. var source = arguments[i] != null ? arguments[i] : {};
  57. if (i % 2) {
  58. ownKeys(Object(source), true).forEach(function (key) {
  59. _defineProperty(target, key, source[key]);
  60. });
  61. } else if (Object.getOwnPropertyDescriptors) {
  62. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  63. } else {
  64. ownKeys(Object(source)).forEach(function (key) {
  65. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  66. });
  67. }
  68. }
  69. return target;
  70. }
  71. function _inherits(subClass, superClass) {
  72. if (typeof superClass !== "function" && superClass !== null) {
  73. throw new TypeError("Super expression must either be null or a function");
  74. }
  75. subClass.prototype = Object.create(superClass && superClass.prototype, {
  76. constructor: {
  77. value: subClass,
  78. writable: true,
  79. configurable: true
  80. }
  81. });
  82. if (superClass) _setPrototypeOf(subClass, superClass);
  83. }
  84. function _getPrototypeOf(o) {
  85. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  86. return o.__proto__ || Object.getPrototypeOf(o);
  87. };
  88. return _getPrototypeOf(o);
  89. }
  90. function _setPrototypeOf(o, p) {
  91. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  92. o.__proto__ = p;
  93. return o;
  94. };
  95. return _setPrototypeOf(o, p);
  96. }
  97. function _assertThisInitialized(self) {
  98. if (self === void 0) {
  99. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  100. }
  101. return self;
  102. }
  103. function _possibleConstructorReturn(self, call) {
  104. if (call && (typeof call === "object" || typeof call === "function")) {
  105. return call;
  106. }
  107. return _assertThisInitialized(self);
  108. }
  109. function _slicedToArray(arr, i) {
  110. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  111. }
  112. function _arrayWithHoles(arr) {
  113. if (Array.isArray(arr)) return arr;
  114. }
  115. function _iterableToArrayLimit(arr, i) {
  116. if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
  117. return;
  118. }
  119. var _arr = [];
  120. var _n = true;
  121. var _d = false;
  122. var _e = undefined;
  123. try {
  124. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  125. _arr.push(_s.value);
  126. if (i && _arr.length === i) break;
  127. }
  128. } catch (err) {
  129. _d = true;
  130. _e = err;
  131. } finally {
  132. try {
  133. if (!_n && _i["return"] != null) _i["return"]();
  134. } finally {
  135. if (_d) throw _e;
  136. }
  137. }
  138. return _arr;
  139. }
  140. function _nonIterableRest() {
  141. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  142. }
  143. function styleInject(css, ref) {
  144. if ( ref === void 0 ) ref = {};
  145. var insertAt = ref.insertAt;
  146. if (!css || typeof document === 'undefined') { return; }
  147. var head = document.head || document.getElementsByTagName('head')[0];
  148. var style = document.createElement('style');
  149. style.type = 'text/css';
  150. if (insertAt === 'top') {
  151. if (head.firstChild) {
  152. head.insertBefore(style, head.firstChild);
  153. } else {
  154. head.appendChild(style);
  155. }
  156. } else {
  157. head.appendChild(style);
  158. }
  159. if (style.styleSheet) {
  160. style.styleSheet.cssText = css;
  161. } else {
  162. style.appendChild(document.createTextNode(css));
  163. }
  164. }
  165. export { _defineProperty as _, commonjsGlobal as a, _inherits as b, createCommonjsModule as c, _createClass as d, _classCallCheck as e, _possibleConstructorReturn as f, getCjsExportFromNamespace as g, _getPrototypeOf as h, _objectSpread2 as i, _slicedToArray as j, _assertThisInitialized as k, styleInject as s, unwrapExports as u };
  166. //# sourceMappingURL=style-inject.es-b888177c.js.map