Нет описания

style-inject.es-c7b50579.js 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. 'use strict';
  2. var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
  3. function unwrapExports (x) {
  4. return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
  5. }
  6. function createCommonjsModule(fn, module) {
  7. return module = { exports: {} }, fn(module, module.exports), module.exports;
  8. }
  9. function getCjsExportFromNamespace (n) {
  10. return n && n['default'] || n;
  11. }
  12. function _classCallCheck(instance, Constructor) {
  13. if (!(instance instanceof Constructor)) {
  14. throw new TypeError("Cannot call a class as a function");
  15. }
  16. }
  17. function _defineProperties(target, props) {
  18. for (var i = 0; i < props.length; i++) {
  19. var descriptor = props[i];
  20. descriptor.enumerable = descriptor.enumerable || false;
  21. descriptor.configurable = true;
  22. if ("value" in descriptor) descriptor.writable = true;
  23. Object.defineProperty(target, descriptor.key, descriptor);
  24. }
  25. }
  26. function _createClass(Constructor, protoProps, staticProps) {
  27. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  28. if (staticProps) _defineProperties(Constructor, staticProps);
  29. return Constructor;
  30. }
  31. function _defineProperty(obj, key, value) {
  32. if (key in obj) {
  33. Object.defineProperty(obj, key, {
  34. value: value,
  35. enumerable: true,
  36. configurable: true,
  37. writable: true
  38. });
  39. } else {
  40. obj[key] = value;
  41. }
  42. return obj;
  43. }
  44. function _inherits(subClass, superClass) {
  45. if (typeof superClass !== "function" && superClass !== null) {
  46. throw new TypeError("Super expression must either be null or a function");
  47. }
  48. subClass.prototype = Object.create(superClass && superClass.prototype, {
  49. constructor: {
  50. value: subClass,
  51. writable: true,
  52. configurable: true
  53. }
  54. });
  55. if (superClass) _setPrototypeOf(subClass, superClass);
  56. }
  57. function _getPrototypeOf(o) {
  58. _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
  59. return o.__proto__ || Object.getPrototypeOf(o);
  60. };
  61. return _getPrototypeOf(o);
  62. }
  63. function _setPrototypeOf(o, p) {
  64. _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
  65. o.__proto__ = p;
  66. return o;
  67. };
  68. return _setPrototypeOf(o, p);
  69. }
  70. function _assertThisInitialized(self) {
  71. if (self === void 0) {
  72. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  73. }
  74. return self;
  75. }
  76. function _possibleConstructorReturn(self, call) {
  77. if (call && (typeof call === "object" || typeof call === "function")) {
  78. return call;
  79. }
  80. return _assertThisInitialized(self);
  81. }
  82. function _slicedToArray(arr, i) {
  83. return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
  84. }
  85. function _arrayWithHoles(arr) {
  86. if (Array.isArray(arr)) return arr;
  87. }
  88. function _iterableToArrayLimit(arr, i) {
  89. if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
  90. return;
  91. }
  92. var _arr = [];
  93. var _n = true;
  94. var _d = false;
  95. var _e = undefined;
  96. try {
  97. for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
  98. _arr.push(_s.value);
  99. if (i && _arr.length === i) break;
  100. }
  101. } catch (err) {
  102. _d = true;
  103. _e = err;
  104. } finally {
  105. try {
  106. if (!_n && _i["return"] != null) _i["return"]();
  107. } finally {
  108. if (_d) throw _e;
  109. }
  110. }
  111. return _arr;
  112. }
  113. function _nonIterableRest() {
  114. throw new TypeError("Invalid attempt to destructure non-iterable instance");
  115. }
  116. var classnames = createCommonjsModule(function (module) {
  117. /*!
  118. Copyright (c) 2017 Jed Watson.
  119. Licensed under the MIT License (MIT), see
  120. http://jedwatson.github.io/classnames
  121. */
  122. /* global define */
  123. (function () {
  124. var hasOwn = {}.hasOwnProperty;
  125. function classNames () {
  126. var classes = [];
  127. for (var i = 0; i < arguments.length; i++) {
  128. var arg = arguments[i];
  129. if (!arg) continue;
  130. var argType = typeof arg;
  131. if (argType === 'string' || argType === 'number') {
  132. classes.push(arg);
  133. } else if (Array.isArray(arg) && arg.length) {
  134. var inner = classNames.apply(null, arg);
  135. if (inner) {
  136. classes.push(inner);
  137. }
  138. } else if (argType === 'object') {
  139. for (var key in arg) {
  140. if (hasOwn.call(arg, key) && arg[key]) {
  141. classes.push(key);
  142. }
  143. }
  144. }
  145. }
  146. return classes.join(' ');
  147. }
  148. if ( module.exports) {
  149. classNames.default = classNames;
  150. module.exports = classNames;
  151. } else {
  152. window.classNames = classNames;
  153. }
  154. }());
  155. });
  156. function styleInject(css, ref) {
  157. if ( ref === void 0 ) ref = {};
  158. var insertAt = ref.insertAt;
  159. if (!css || typeof document === 'undefined') { return; }
  160. var head = document.head || document.getElementsByTagName('head')[0];
  161. var style = document.createElement('style');
  162. style.type = 'text/css';
  163. if (insertAt === 'top') {
  164. if (head.firstChild) {
  165. head.insertBefore(style, head.firstChild);
  166. } else {
  167. head.appendChild(style);
  168. }
  169. } else {
  170. head.appendChild(style);
  171. }
  172. if (style.styleSheet) {
  173. style.styleSheet.cssText = css;
  174. } else {
  175. style.appendChild(document.createTextNode(css));
  176. }
  177. }
  178. exports._classCallCheck = _classCallCheck;
  179. exports._createClass = _createClass;
  180. exports._defineProperty = _defineProperty;
  181. exports._getPrototypeOf = _getPrototypeOf;
  182. exports._inherits = _inherits;
  183. exports._possibleConstructorReturn = _possibleConstructorReturn;
  184. exports._slicedToArray = _slicedToArray;
  185. exports.classnames = classnames;
  186. exports.commonjsGlobal = commonjsGlobal;
  187. exports.createCommonjsModule = createCommonjsModule;
  188. exports.getCjsExportFromNamespace = getCjsExportFromNamespace;
  189. exports.styleInject = styleInject;
  190. exports.unwrapExports = unwrapExports;
  191. //# sourceMappingURL=style-inject.es-c7b50579.js.map