npm-pkg-hook 1.1.5 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.eslintrc.js +19 -113
  2. package/.eslintrc.json +127 -108
  3. package/.github/pull_request_template.md +17 -17
  4. package/.github/workflows/pepeline.yaml +29 -29
  5. package/next.config.js +2 -5
  6. package/package.json +27 -24
  7. package/script.txt +6 -6
  8. package/src/config/client/errors.js +14 -14
  9. package/src/config/client/index.js +1 -1
  10. package/src/hooks/getCategoriesWithProduct/helpers/index.js +7 -0
  11. package/src/hooks/getCategoriesWithProduct/index.js +62 -0
  12. package/src/hooks/getSession/index.js +18 -18
  13. package/src/hooks/index.js +13 -9
  14. package/src/hooks/useAcumulateDate/index.js +1 -1
  15. package/src/hooks/useAnimationFrame/index.js +45 -45
  16. package/src/hooks/useAsideCart/helpers/index.js +22 -0
  17. package/src/hooks/useAsideCart/index.js +156 -0
  18. package/src/hooks/useAsideCart/queries.js +10 -0
  19. package/src/hooks/useBanner/index.js +11 -11
  20. package/src/hooks/useCart/index.js +2 -0
  21. package/src/hooks/useCart/queries.js +164 -0
  22. package/src/hooks/useCart/useCart/helpers/index.js +75 -0
  23. package/src/hooks/useCart/useCart/index.js +411 -0
  24. package/src/hooks/useCart/useGetCart/index.js +31 -0
  25. package/src/hooks/useCatWithProduct/index.js +15 -15
  26. package/src/hooks/useCatWithProduct/queries.js +1 -1
  27. package/src/hooks/useCatWithProductClient/index.js +48 -0
  28. package/src/hooks/useCatWithProductClient/queries.js +55 -0
  29. package/src/hooks/useCategoriesProduct/index.js +12 -12
  30. package/src/hooks/useCategoriesProduct/queries.js +16 -16
  31. package/src/hooks/useCategoryInStore/index.js +39 -36
  32. package/src/hooks/useCategoryInStore/queries.js +78 -78
  33. package/src/hooks/useCategoryStore/index.js +2 -2
  34. package/src/hooks/useChartData/index.js +159 -156
  35. package/src/hooks/useChartData/useChartData/index.js +199 -197
  36. package/src/hooks/useChartData/useChartDataAllOrders/index.js +94 -94
  37. package/src/hooks/useCheckbox/index.js +115 -115
  38. package/src/hooks/useClients/index.js +12 -14
  39. package/src/hooks/useClients/queries.js +1 -1
  40. package/src/hooks/useConnection/index.js +20 -21
  41. package/src/hooks/useCreateProduct/helpers/useEditImageProduct/index.js +6 -2
  42. package/src/hooks/useCreateProduct/index.js +22 -19
  43. package/src/hooks/useDeleteSubProductOptional/index.js +31 -30
  44. package/src/hooks/useDeleteSubProductOptional/queries.js +10 -10
  45. package/src/hooks/useDessert/helpers/index.js +51 -51
  46. package/src/hooks/useDessert/index.js +56 -65
  47. package/src/hooks/useDevices/index.js +35 -36
  48. package/src/hooks/useDevices/queries.js +19 -19
  49. package/src/hooks/useDropzone/index.js +94 -79
  50. package/src/hooks/useDynamicAuth/index.js +13 -13
  51. package/src/hooks/useDynamicAuth/queries.js +24 -24
  52. package/src/hooks/useEmployee/queries.js +1 -1
  53. package/src/hooks/useEvent/index.js +33 -33
  54. package/src/hooks/useFavoriteStores/index.js +19 -0
  55. package/src/hooks/useFavoriteStores/queries.js +47 -0
  56. package/src/hooks/useFetchJson/index.js +25 -25
  57. package/src/hooks/useFingerprintjs/index.js +172 -176
  58. package/src/hooks/useFormTools/index.js +12 -11
  59. package/src/hooks/useFormatDate/index.js +20 -21
  60. package/src/hooks/useFormatNumberPhone/index.js +9 -9
  61. package/src/hooks/useFullScreenMode/index.js +65 -65
  62. package/src/hooks/useGenerateNumberArray/index.js +17 -17
  63. package/src/hooks/useGetExtProductFoodsSubOptionalAll/index.js +14 -0
  64. package/src/hooks/useGetFoodRecomended/index.js +33 -0
  65. package/src/hooks/useGetFoodRecomended/queries.js +47 -0
  66. package/src/hooks/useGetMinPrice/index.js +8 -0
  67. package/src/hooks/useGetMinPrice/queries.js +7 -0
  68. package/src/hooks/useGetOneStoreRating/index.js +40 -0
  69. package/src/hooks/useGetOneStoreRating/queries.js +18 -0
  70. package/src/hooks/useGoogleLogin/index.js +160 -161
  71. package/src/hooks/useHover/index.js +29 -29
  72. package/src/hooks/useImageOptimization/index.js +15 -15
  73. package/src/hooks/useImageWeight/index.js +18 -19
  74. package/src/hooks/useImagesStore/index.js +139 -140
  75. package/src/hooks/useImagesStore/queries.js +19 -18
  76. package/src/hooks/useInnerHtml/index.js +39 -38
  77. package/src/hooks/useIntersection/index.js +4 -4
  78. package/src/hooks/useKeypress/index.js +28 -28
  79. package/src/hooks/useLazyScript/index.js +35 -36
  80. package/src/hooks/useLocalSorage/index.js +2 -2
  81. package/src/hooks/useLocationNavigate/index.js +54 -54
  82. package/src/hooks/useLogout/index.js +24 -24
  83. package/src/hooks/useManageQueryParams/index.js +36 -37
  84. package/src/hooks/useMobile/index.js +39 -38
  85. package/src/hooks/useMutateHeight/index.js +15 -16
  86. package/src/hooks/useOrderClient/index.js +5 -0
  87. package/src/hooks/useOrders/index.js +10 -16
  88. package/src/hooks/useOrders/queries.js +1 -1
  89. package/src/hooks/useProductsFood/index.js +32 -32
  90. package/src/hooks/useProductsFood/queriesStore.js +49 -48
  91. package/src/hooks/useProductsFood/useEditProduct.js +2 -4
  92. package/src/hooks/useProductsFood/usetagsProducts.js +83 -83
  93. package/src/hooks/useProviders/index.js +3 -3
  94. package/src/hooks/useProviders/queries.js +31 -31
  95. package/src/hooks/useProviders/useProvidersCreateStore/index.js +12 -13
  96. package/src/hooks/useProviders/useProvidersDataStore/index.js +24 -24
  97. package/src/hooks/useProvidersStore/index.js +24 -24
  98. package/src/hooks/useProvidersStore/queries.js +31 -31
  99. package/src/hooks/useRatingArrayData/index.js +54 -0
  100. package/src/hooks/{useRatingData → useRatingArrayData}/queries.js +19 -18
  101. package/src/hooks/useReactToPrint/index.js +1120 -1098
  102. package/src/hooks/useRemoveExtraProductFoodsOptional/index.js +23 -23
  103. package/src/hooks/useRemoveExtraProductFoodsOptional/queries.js +48 -48
  104. package/src/hooks/useReport/index.js +9 -9
  105. package/src/hooks/useReport/queries.js +1 -1
  106. package/src/hooks/useRestaurant/index.js +19 -19
  107. package/src/hooks/useRestaurant/queries.js +80 -80
  108. package/src/hooks/useSales/index.js +476 -451
  109. package/src/hooks/useSales/queries.js +14 -15
  110. package/src/hooks/useSales/useGetAllSales/index.js +25 -25
  111. package/src/hooks/useSales/useTotalSales.js +18 -18
  112. package/src/hooks/useSaveAvailableProduct/helpers/index.js +29 -29
  113. package/src/hooks/useSaveAvailableProduct/index.js +16 -16
  114. package/src/hooks/useSaveAvailableProduct/queries.js +1 -1
  115. package/src/hooks/useSchedule/index.js +33 -36
  116. package/src/hooks/useSchedule/index.jsx +22 -22
  117. package/src/hooks/useSchedule/queries.js +34 -35
  118. package/src/hooks/useScheduleData/index.js +123 -171
  119. package/src/hooks/useScroll/index.js +56 -57
  120. package/src/hooks/useScrollRotate/index.js +16 -14
  121. package/src/hooks/useSetSession/index.js +16 -16
  122. package/src/hooks/useSetState/index.js +3 -3
  123. package/src/hooks/useStatusOpenStore/helpers/index.js +101 -102
  124. package/src/hooks/useStatusOpenStore/index.js +172 -173
  125. package/src/hooks/useStatusOrdersClient/helpers/index.js +14 -0
  126. package/src/hooks/useStatusOrdersClient/index.js +17 -0
  127. package/src/hooks/useStatusOrdersClient/queries.js +80 -0
  128. package/src/hooks/useStore/index.js +40 -25
  129. package/src/hooks/useStore/queries.js +162 -136
  130. package/src/hooks/useStoreCalendar/index.js +5 -7
  131. package/src/hooks/useStoreContacts/index.js +16 -16
  132. package/src/hooks/useStoreContacts/queries.js +1 -1
  133. package/src/hooks/useTimeAgo/useTimeAgo.js +39 -39
  134. package/src/hooks/useUpdateCart/index.js +34 -28
  135. package/src/hooks/useUpdateExistingOrders/index.js +35 -35
  136. package/src/hooks/useUpdateExtProductFoodsSubOptional/index.js +38 -37
  137. package/src/hooks/useUser/index.js +1 -1
  138. package/src/hooks/useUser/queries.js +1 -1
  139. package/src/hooks/useWindowSize/index.js +38 -38
  140. package/src/mock/dessert/index.js +16 -16
  141. package/src/mock/index.js +1 -2
  142. package/src/utils/index.js +42 -45
  143. package/src/hooks/useRatingData/index.js +0 -53
  144. package/src/hooks/useSalesClient/index.js +0 -1
@@ -1,1201 +1,1223 @@
1
+ /* eslint-disable no-proto */
2
+ /* eslint-disable no-undef */
3
+ /* eslint-disable promise/param-names */
4
+ /* eslint-disable no-cond-assign */
5
+ /* eslint-disable no-use-before-define */
6
+ /* eslint-disable no-unsafe-finally */
7
+ /* eslint-disable no-redeclare */
8
+ /* eslint-disable new-cap */
9
+ /* eslint-disable no-var */
10
+ /* eslint-disable no-void */
11
+ /* eslint-disable no-sequences */
12
+ /* eslint-disable no-unused-expressions */
1
13
  !(function (e, t) {
2
- "object" == typeof exports && "object" == typeof module
3
- ? (module.exports = t(require("react"), require("react-dom")))
4
- : "function" == typeof define && define.amd
5
- ? define("lib", ["react", "react-dom"], t)
6
- : "object" == typeof exports
7
- ? (exports.lib = t(require("react"), require("react-dom")))
8
- : (e.lib = t(e.react, e["react-dom"]));
9
- })("undefined" != typeof self ? self : this, function (e, t) {
10
- return (function () {
11
- "use strict";
12
- var n = {
13
- 655: function (e, t, n) {
14
- n.r(t),
15
- n.d(t, {
16
- __assign: function () {
17
- return i;
18
- },
19
- __asyncDelegator: function () {
20
- return E;
21
- },
22
- __asyncGenerator: function () {
23
- return x;
24
- },
25
- __asyncValues: function () {
26
- return S;
27
- },
28
- __await: function () {
29
- return O;
30
- },
31
- __awaiter: function () {
32
- return h;
33
- },
34
- __classPrivateFieldGet: function () {
35
- return k;
36
- },
37
- __classPrivateFieldIn: function () {
38
- return R;
39
- },
40
- __classPrivateFieldSet: function () {
41
- return M;
42
- },
43
- __createBinding: function () {
44
- return g;
45
- },
46
- __decorate: function () {
47
- return c;
48
- },
49
- __esDecorate: function () {
50
- return u;
51
- },
52
- __exportStar: function () {
53
- return b;
54
- },
55
- __extends: function () {
56
- return o;
57
- },
58
- __generator: function () {
59
- return y;
60
- },
61
- __importDefault: function () {
62
- return C;
63
- },
64
- __importStar: function () {
65
- return A;
66
- },
67
- __makeTemplateObject: function () {
68
- return j;
69
- },
70
- __metadata: function () {
71
- return p;
72
- },
73
- __param: function () {
74
- return l;
75
- },
76
- __propKey: function () {
77
- return f;
78
- },
79
- __read: function () {
80
- return m;
81
- },
82
- __rest: function () {
83
- return a;
84
- },
85
- __runInitializers: function () {
86
- return s;
87
- },
88
- __setFunctionName: function () {
89
- return d;
90
- },
91
- __spread: function () {
92
- return w;
93
- },
94
- __spreadArray: function () {
95
- return P;
96
- },
97
- __spreadArrays: function () {
98
- return _;
99
- },
100
- __values: function () {
101
- return v;
102
- },
103
- });
104
- var r = function (e, t) {
105
- return (
106
- (r =
14
+ typeof exports === 'object' && typeof module === 'object'
15
+ ? (module.exports = t(require('react'), require('react-dom')))
16
+ : typeof define === 'function' && define.amd
17
+ ? define('lib', ['react', 'react-dom'], t)
18
+ : typeof exports === 'object'
19
+ ? (exports.lib = t(require('react'), require('react-dom')))
20
+ : (e.lib = t(e.react, e['react-dom']))
21
+ })(typeof self !== 'undefined' ? self : this, function (e, t) {
22
+ return (function () {
23
+ 'use strict'
24
+ const n = {
25
+ 655: function (e, t, n) {
26
+ n.r(t),
27
+ n.d(t, {
28
+ __assign: function () {
29
+ return i
30
+ },
31
+ __asyncDelegator: function () {
32
+ return E
33
+ },
34
+ __asyncGenerator: function () {
35
+ return x
36
+ },
37
+ __asyncValues: function () {
38
+ return S
39
+ },
40
+ __await: function () {
41
+ return O
42
+ },
43
+ __awaiter: function () {
44
+ return h
45
+ },
46
+ __classPrivateFieldGet: function () {
47
+ return k
48
+ },
49
+ __classPrivateFieldIn: function () {
50
+ return R
51
+ },
52
+ __classPrivateFieldSet: function () {
53
+ return M
54
+ },
55
+ __createBinding: function () {
56
+ return g
57
+ },
58
+ __decorate: function () {
59
+ return c
60
+ },
61
+ __esDecorate: function () {
62
+ return u
63
+ },
64
+ __exportStar: function () {
65
+ return b
66
+ },
67
+ __extends: function () {
68
+ return o
69
+ },
70
+ __generator: function () {
71
+ return y
72
+ },
73
+ __importDefault: function () {
74
+ return C
75
+ },
76
+ __importStar: function () {
77
+ return A
78
+ },
79
+ __makeTemplateObject: function () {
80
+ return j
81
+ },
82
+ __metadata: function () {
83
+ return p
84
+ },
85
+ __param: function () {
86
+ return l
87
+ },
88
+ __propKey: function () {
89
+ return f
90
+ },
91
+ __read: function () {
92
+ return m
93
+ },
94
+ __rest: function () {
95
+ return a
96
+ },
97
+ __runInitializers: function () {
98
+ return s
99
+ },
100
+ __setFunctionName: function () {
101
+ return d
102
+ },
103
+ __spread: function () {
104
+ return w
105
+ },
106
+ __spreadArray: function () {
107
+ return P
108
+ },
109
+ __spreadArrays: function () {
110
+ return _
111
+ },
112
+ __values: function () {
113
+ return v
114
+ }
115
+ })
116
+ let r = function (e, t) {
117
+ return (
118
+ (r =
107
119
  Object.setPrototypeOf ||
108
120
  ({ __proto__: [] } instanceof Array &&
109
121
  function (e, t) {
110
- e.__proto__ = t;
122
+ e.__proto__ = t
111
123
  }) ||
112
124
  function (e, t) {
113
- for (var n in t)
114
- Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
125
+ for (const n in t) { Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]) }
115
126
  }),
116
- r(e, t)
117
- );
118
- };
119
- function o(e, t) {
120
- if ("function" != typeof t && null !== t)
121
- throw new TypeError(
122
- "Class extends value " +
127
+ r(e, t)
128
+ )
129
+ }
130
+ function o (e, t) {
131
+ if (typeof t !== 'function' && t !== null) {
132
+ throw new TypeError(
133
+ 'Class extends value ' +
123
134
  String(t) +
124
- " is not a constructor or null"
125
- );
126
- function n() {
127
- this.constructor = e;
128
- }
129
- r(e, t),
130
- (e.prototype =
131
- null === t
135
+ ' is not a constructor or null'
136
+ )
137
+ }
138
+ function n () {
139
+ this.constructor = e
140
+ }
141
+ r(e, t),
142
+ (e.prototype =
143
+ t === null
132
144
  ? Object.create(t)
133
- : ((n.prototype = t.prototype), new n()));
134
- }
135
- var i = function () {
136
- return (
137
- (i =
145
+ : ((n.prototype = t.prototype), new n()))
146
+ }
147
+ var i = function () {
148
+ return (
149
+ (i =
138
150
  Object.assign ||
139
151
  function (e) {
140
- for (var t, n = 1, r = arguments.length; n < r; n++)
141
- for (var o in (t = arguments[n]))
152
+ for (var t, n = 1, r = arguments.length; n < r; n++) {
153
+ for (const o in (t = arguments[n])) {
142
154
  Object.prototype.hasOwnProperty.call(t, o) &&
143
- (e[o] = t[o]);
144
- return e;
155
+ (e[o] = t[o])
156
+ }
157
+ }
158
+ return e
145
159
  }),
146
- i.apply(this, arguments)
147
- );
148
- };
149
- function a(e, t) {
150
- var n = {};
151
- for (var r in e)
152
- Object.prototype.hasOwnProperty.call(e, r) &&
160
+ i.apply(this, arguments)
161
+ )
162
+ }
163
+ function a (e, t) {
164
+ const n = {}
165
+ for (var r in e) {
166
+ Object.prototype.hasOwnProperty.call(e, r) &&
153
167
  t.indexOf(r) < 0 &&
154
- (n[r] = e[r]);
155
- if (
156
- null != e &&
157
- "function" == typeof Object.getOwnPropertySymbols
158
- ) {
159
- var o = 0;
160
- for (r = Object.getOwnPropertySymbols(e); o < r.length; o++)
161
- t.indexOf(r[o]) < 0 &&
168
+ (n[r] = e[r])
169
+ }
170
+ if (
171
+ e != null &&
172
+ typeof Object.getOwnPropertySymbols === 'function'
173
+ ) {
174
+ let o = 0
175
+ for (r = Object.getOwnPropertySymbols(e); o < r.length; o++) {
176
+ t.indexOf(r[o]) < 0 &&
162
177
  Object.prototype.propertyIsEnumerable.call(e, r[o]) &&
163
- (n[r[o]] = e[r[o]]);
164
- }
165
- return n;
178
+ (n[r[o]] = e[r[o]])
166
179
  }
167
- function c(e, t, n, r) {
168
- var o,
169
- i = arguments.length,
170
- a =
180
+ }
181
+ return n
182
+ }
183
+ function c (e, t, n, r) {
184
+ let o
185
+ const i = arguments.length
186
+ let a =
171
187
  i < 3
172
188
  ? t
173
- : null === r
174
- ? (r = Object.getOwnPropertyDescriptor(t, n))
175
- : r;
176
- if (
177
- "object" == typeof Reflect &&
178
- "function" == typeof Reflect.decorate
179
- )
180
- a = Reflect.decorate(e, t, n, r);
181
- else
182
- for (var c = e.length - 1; c >= 0; c--)
183
- (o = e[c]) &&
184
- (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
185
- return i > 3 && a && Object.defineProperty(t, n, a), a;
189
+ : r === null
190
+ ? (r = Object.getOwnPropertyDescriptor(t, n))
191
+ : r
192
+ if (
193
+ typeof Reflect === 'object' &&
194
+ typeof Reflect.decorate === 'function'
195
+ ) { a = Reflect.decorate(e, t, n, r) } else {
196
+ for (let c = e.length - 1; c >= 0; c--) {
197
+ (o = e[c]) &&
198
+ (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a)
186
199
  }
187
- function l(e, t) {
188
- return function (n, r) {
189
- t(n, r, e);
190
- };
191
- }
192
- function u(e, t, n, r, o, i) {
193
- function a(e) {
194
- if (void 0 !== e && "function" != typeof e)
195
- throw new TypeError("Function expected");
196
- return e;
197
- }
198
- for (
199
- var c,
200
- l = r.kind,
201
- u = "getter" === l ? "get" : "setter" === l ? "set" : "value",
202
- s = !t && e ? (r.static ? e : e.prototype) : null,
203
- f = t || (s ? Object.getOwnPropertyDescriptor(s, r.name) : {}),
204
- d = !1,
205
- p = n.length - 1;
206
- p >= 0;
207
- p--
208
- ) {
209
- var h = {};
210
- for (var y in r) h[y] = "access" === y ? {} : r[y];
211
- for (var y in r.access) h.access[y] = r.access[y];
212
- h.addInitializer = function (e) {
213
- if (d)
214
- throw new TypeError(
215
- "Cannot add initializers after decoration has completed"
216
- );
217
- i.push(a(e || null));
218
- };
219
- var g = (0, n[p])(
220
- "accessor" === l ? { get: f.get, set: f.set } : f[u],
221
- h
222
- );
223
- if ("accessor" === l) {
224
- if (void 0 === g) continue;
225
- if (null === g || "object" != typeof g)
226
- throw new TypeError("Object expected");
227
- (c = a(g.get)) && (f.get = c),
228
- (c = a(g.set)) && (f.set = c),
229
- (c = a(g.init)) && o.push(c);
230
- } else (c = a(g)) && ("field" === l ? o.push(c) : (f[u] = c));
200
+ }
201
+ return i > 3 && a && Object.defineProperty(t, n, a), a
202
+ }
203
+ function l (e, t) {
204
+ return function (n, r) {
205
+ t(n, r, e)
206
+ }
207
+ }
208
+ function u (e, t, n, r, o, i) {
209
+ function a (e) {
210
+ if (void 0 !== e && typeof e !== 'function') { throw new TypeError('Function expected') }
211
+ return e
212
+ }
213
+ for (
214
+ var c,
215
+ l = r.kind,
216
+ u = l === 'getter' ? 'get' : l === 'setter' ? 'set' : 'value',
217
+ s = !t && e ? (r.static ? e : e.prototype) : null,
218
+ f = t || (s ? Object.getOwnPropertyDescriptor(s, r.name) : {}),
219
+ d = !1,
220
+ p = n.length - 1;
221
+ p >= 0;
222
+ p--
223
+ ) {
224
+ const h = {}
225
+ for (var y in r) h[y] = y === 'access' ? {} : r[y]
226
+ for (var y in r.access) h.access[y] = r.access[y]
227
+ h.addInitializer = function (e) {
228
+ if (d) {
229
+ throw new TypeError(
230
+ 'Cannot add initializers after decoration has completed'
231
+ )
231
232
  }
232
- s && Object.defineProperty(s, r.name, f), (d = !0);
233
- }
234
- function s(e, t, n) {
235
- for (var r = arguments.length > 2, o = 0; o < t.length; o++)
236
- n = r ? t[o].call(e, n) : t[o].call(e);
237
- return r ? n : void 0;
238
- }
239
- function f(e) {
240
- return "symbol" == typeof e ? e : "".concat(e);
233
+ i.push(a(e || null))
241
234
  }
242
- function d(e, t, n) {
243
- return (
244
- "symbol" == typeof t &&
245
- (t = t.description ? "[".concat(t.description, "]") : ""),
246
- Object.defineProperty(e, "name", {
247
- configurable: !0,
248
- value: n ? "".concat(n, " ", t) : t,
249
- })
250
- );
235
+ const g = (0, n[p])(
236
+ l === 'accessor' ? { get: f.get, set: f.set } : f[u],
237
+ h
238
+ )
239
+ if (l === 'accessor') {
240
+ if (void 0 === g) continue
241
+ if (g === null || typeof g !== 'object') { throw new TypeError('Object expected') }
242
+ (c = a(g.get)) && (f.get = c),
243
+ (c = a(g.set)) && (f.set = c),
244
+ (c = a(g.init)) && o.push(c)
245
+ } else (c = a(g)) && (l === 'field' ? o.push(c) : (f[u] = c))
246
+ }
247
+ s && Object.defineProperty(s, r.name, f), (d = !0)
248
+ }
249
+ function s (e, t, n) {
250
+ for (var r = arguments.length > 2, o = 0; o < t.length; o++) { n = r ? t[o].call(e, n) : t[o].call(e) }
251
+ return r ? n : void 0
252
+ }
253
+ function f (e) {
254
+ return typeof e === 'symbol' ? e : ''.concat(e)
255
+ }
256
+ function d (e, t, n) {
257
+ return (
258
+ typeof t === 'symbol' &&
259
+ (t = t.description ? '['.concat(t.description, ']') : ''),
260
+ Object.defineProperty(e, 'name', {
261
+ configurable: !0,
262
+ value: n ? ''.concat(n, ' ', t) : t
263
+ })
264
+ )
265
+ }
266
+ function p (e, t) {
267
+ if (
268
+ typeof Reflect === 'object' &&
269
+ typeof Reflect.metadata === 'function'
270
+ ) { return Reflect.metadata(e, t) }
271
+ }
272
+ function h (e, t, n, r) {
273
+ return new (n || (n = Promise))(function (o, i) {
274
+ function a (e) {
275
+ try {
276
+ l(r.next(e))
277
+ } catch (e) {
278
+ i(e)
279
+ }
251
280
  }
252
- function p(e, t) {
253
- if (
254
- "object" == typeof Reflect &&
255
- "function" == typeof Reflect.metadata
256
- )
257
- return Reflect.metadata(e, t);
281
+ function c (e) {
282
+ try {
283
+ l(r.throw(e))
284
+ } catch (e) {
285
+ i(e)
286
+ }
258
287
  }
259
- function h(e, t, n, r) {
260
- return new (n || (n = Promise))(function (o, i) {
261
- function a(e) {
262
- try {
263
- l(r.next(e));
264
- } catch (e) {
265
- i(e);
266
- }
267
- }
268
- function c(e) {
269
- try {
270
- l(r.throw(e));
271
- } catch (e) {
272
- i(e);
273
- }
274
- }
275
- function l(e) {
276
- var t;
277
- e.done
278
- ? o(e.value)
279
- : ((t = e.value),
280
- t instanceof n
281
- ? t
282
- : new n(function (e) {
283
- e(t);
284
- })).then(a, c);
285
- }
286
- l((r = r.apply(e, t || [])).next());
287
- });
288
+ function l (e) {
289
+ let t
290
+ e.done
291
+ ? o(e.value)
292
+ : ((t = e.value),
293
+ t instanceof n
294
+ ? t
295
+ : new n(function (e) {
296
+ e(t)
297
+ })).then(a, c)
288
298
  }
289
- function y(e, t) {
290
- var n,
291
- r,
292
- o,
293
- i,
294
- a = {
295
- label: 0,
296
- sent: function () {
297
- if (1 & o[0]) throw o[1];
298
- return o[1];
299
- },
300
- trys: [],
301
- ops: [],
302
- };
303
- return (
304
- (i = { next: c(0), throw: c(1), return: c(2) }),
305
- "function" == typeof Symbol &&
299
+ l((r = r.apply(e, t || [])).next())
300
+ })
301
+ }
302
+ function y (e, t) {
303
+ let n
304
+ let r
305
+ let o
306
+ let i
307
+ let a = {
308
+ label: 0,
309
+ sent: function () {
310
+ if (1 & o[0]) throw o[1]
311
+ return o[1]
312
+ },
313
+ trys: [],
314
+ ops: []
315
+ }
316
+ return (
317
+ (i = { next: c(0), throw: c(1), return: c(2) }),
318
+ typeof Symbol === 'function' &&
306
319
  (i[Symbol.iterator] = function () {
307
- return this;
320
+ return this
308
321
  }),
309
- i
310
- );
311
- function c(c) {
312
- return function (l) {
313
- return (function (c) {
314
- if (n) throw new TypeError("Generator is already executing.");
315
- for (; i && ((i = 0), c[0] && (a = 0)), a; )
316
- try {
317
- if (
318
- ((n = 1),
319
- r &&
322
+ i
323
+ )
324
+ function c (c) {
325
+ return function (l) {
326
+ return (function (c) {
327
+ if (n) throw new TypeError('Generator is already executing.')
328
+ for (; i && ((i = 0), c[0] && (a = 0)), a;) {
329
+ try {
330
+ if (
331
+ ((n = 1),
332
+ r &&
320
333
  (o =
321
334
  2 & c[0]
322
335
  ? r.return
323
336
  : c[0]
324
- ? r.throw || ((o = r.return) && o.call(r), 0)
325
- : r.next) &&
337
+ ? r.throw || ((o = r.return) && o.call(r), 0)
338
+ : r.next) &&
326
339
  !(o = o.call(r, c[1])).done)
327
- )
328
- return o;
329
- switch (((r = 0), o && (c = [2 & c[0], o.value]), c[0])) {
330
- case 0:
331
- case 1:
332
- o = c;
333
- break;
334
- case 4:
335
- return a.label++, { value: c[1], done: !1 };
336
- case 5:
337
- a.label++, (r = c[1]), (c = [0]);
338
- continue;
339
- case 7:
340
- (c = a.ops.pop()), a.trys.pop();
341
- continue;
342
- default:
343
- if (
344
- !(
345
- (o =
340
+ ) { return o }
341
+ switch (((r = 0), o && (c = [2 & c[0], o.value]), c[0])) {
342
+ case 0:
343
+ case 1:
344
+ o = c
345
+ break
346
+ case 4:
347
+ return a.label++, { value: c[1], done: !1 }
348
+ case 5:
349
+ a.label++, (r = c[1]), (c = [0])
350
+ continue
351
+ case 7:
352
+ (c = a.ops.pop()), a.trys.pop()
353
+ continue
354
+ default:
355
+ if (
356
+ !(
357
+ (o =
346
358
  (o = a.trys).length > 0 && o[o.length - 1]) ||
347
- (6 !== c[0] && 2 !== c[0])
348
- )
349
- ) {
350
- a = 0;
351
- continue;
352
- }
353
- if (
354
- 3 === c[0] &&
359
+ (c[0] !== 6 && c[0] !== 2)
360
+ )
361
+ ) {
362
+ a = 0
363
+ continue
364
+ }
365
+ if (
366
+ c[0] === 3 &&
355
367
  (!o || (c[1] > o[0] && c[1] < o[3]))
356
- ) {
357
- a.label = c[1];
358
- break;
359
- }
360
- if (6 === c[0] && a.label < o[1]) {
361
- (a.label = o[1]), (o = c);
362
- break;
363
- }
364
- if (o && a.label < o[2]) {
365
- (a.label = o[2]), a.ops.push(c);
366
- break;
367
- }
368
- o[2] && a.ops.pop(), a.trys.pop();
369
- continue;
368
+ ) {
369
+ a.label = c[1]
370
+ break
370
371
  }
371
- c = t.call(e, a);
372
- } catch (e) {
373
- (c = [6, e]), (r = 0);
374
- } finally {
375
- n = o = 0;
376
- }
377
- if (5 & c[0]) throw c[1];
378
- return { value: c[0] ? c[1] : void 0, done: !0 };
379
- })([c, l]);
380
- };
381
- }
372
+ if (c[0] === 6 && a.label < o[1]) {
373
+ (a.label = o[1]), (o = c)
374
+ break
375
+ }
376
+ if (o && a.label < o[2]) {
377
+ (a.label = o[2]), a.ops.push(c)
378
+ break
379
+ }
380
+ o[2] && a.ops.pop(), a.trys.pop()
381
+ continue
382
+ }
383
+ c = t.call(e, a)
384
+ } catch (e) {
385
+ (c = [6, e]), (r = 0)
386
+ } finally {
387
+ n = o = 0
388
+ }
389
+ }
390
+ if (5 & c[0]) throw c[1]
391
+ return { value: c[0] ? c[1] : void 0, done: !0 }
392
+ })([c, l])
382
393
  }
383
- var g = Object.create
384
- ? function (e, t, n, r) {
385
- void 0 === r && (r = n);
386
- var o = Object.getOwnPropertyDescriptor(t, n);
387
- (o &&
388
- !("get" in o
394
+ }
395
+ }
396
+ var g = Object.create
397
+ ? function (e, t, n, r) {
398
+ void 0 === r && (r = n)
399
+ let o = Object.getOwnPropertyDescriptor(t, n);
400
+ (o &&
401
+ !('get' in o
389
402
  ? !t.__esModule
390
403
  : o.writable || o.configurable)) ||
391
404
  (o = {
392
405
  enumerable: !0,
393
406
  get: function () {
394
- return t[n];
395
- },
407
+ return t[n]
408
+ }
396
409
  }),
397
- Object.defineProperty(e, r, o);
398
- }
399
- : function (e, t, n, r) {
400
- void 0 === r && (r = n), (e[r] = t[n]);
401
- };
402
- function b(e, t) {
403
- for (var n in e)
404
- "default" === n ||
410
+ Object.defineProperty(e, r, o)
411
+ }
412
+ : function (e, t, n, r) {
413
+ void 0 === r && (r = n), (e[r] = t[n])
414
+ }
415
+ function b (e, t) {
416
+ for (const n in e) {
417
+ n === 'default' ||
405
418
  Object.prototype.hasOwnProperty.call(t, n) ||
406
- g(t, e, n);
407
- }
408
- function v(e) {
409
- var t = "function" == typeof Symbol && Symbol.iterator,
410
- n = t && e[t],
411
- r = 0;
412
- if (n) return n.call(e);
413
- if (e && "number" == typeof e.length)
414
- return {
415
- next: function () {
416
- return (
417
- e && r >= e.length && (e = void 0),
418
- { value: e && e[r++], done: !e }
419
- );
420
- },
421
- };
422
- throw new TypeError(
423
- t ? "Object is not iterable." : "Symbol.iterator is not defined."
424
- );
425
- }
426
- function m(e, t) {
427
- var n = "function" == typeof Symbol && e[Symbol.iterator];
428
- if (!n) return e;
429
- var r,
430
- o,
431
- i = n.call(e),
432
- a = [];
433
- try {
434
- for (; (void 0 === t || t-- > 0) && !(r = i.next()).done; )
435
- a.push(r.value);
436
- } catch (e) {
437
- o = { error: e };
438
- } finally {
439
- try {
440
- r && !r.done && (n = i.return) && n.call(i);
441
- } finally {
442
- if (o) throw o.error;
443
- }
419
+ g(t, e, n)
420
+ }
421
+ }
422
+ function v (e) {
423
+ const t = typeof Symbol === 'function' && Symbol.iterator
424
+ const n = t && e[t]
425
+ let r = 0
426
+ if (n) return n.call(e)
427
+ if (e && typeof e.length === 'number') {
428
+ return {
429
+ next: function () {
430
+ return (
431
+ e && r >= e.length && (e = void 0),
432
+ { value: e && e[r++], done: !e }
433
+ )
444
434
  }
445
- return a;
446
435
  }
447
- function w() {
448
- for (var e = [], t = 0; t < arguments.length; t++)
449
- e = e.concat(m(arguments[t]));
450
- return e;
436
+ }
437
+ throw new TypeError(
438
+ t ? 'Object is not iterable.' : 'Symbol.iterator is not defined.'
439
+ )
440
+ }
441
+ function m (e, t) {
442
+ let n = typeof Symbol === 'function' && e[Symbol.iterator]
443
+ if (!n) return e
444
+ let r
445
+ let o
446
+ const i = n.call(e)
447
+ const a = []
448
+ try {
449
+ for (; (void 0 === t || t-- > 0) && !(r = i.next()).done;) { a.push(r.value) }
450
+ } catch (e) {
451
+ o = { error: e }
452
+ } finally {
453
+ try {
454
+ r && !r.done && (n = i.return) && n.call(i)
455
+ } finally {
456
+ if (o) throw o.error
451
457
  }
452
- function _() {
453
- for (var e = 0, t = 0, n = arguments.length; t < n; t++)
454
- e += arguments[t].length;
455
- var r = Array(e),
456
- o = 0;
457
- for (t = 0; t < n; t++)
458
- for (var i = arguments[t], a = 0, c = i.length; a < c; a++, o++)
459
- r[o] = i[a];
460
- return r;
461
- }
462
- function P(e, t, n) {
463
- if (n || 2 === arguments.length)
464
- for (var r, o = 0, i = t.length; o < i; o++)
465
- (!r && o in t) ||
458
+ }
459
+ return a
460
+ }
461
+ function w () {
462
+ for (var e = [], t = 0; t < arguments.length; t++) { e = e.concat(m(arguments[t])) }
463
+ return e
464
+ }
465
+ function _ () {
466
+ for (var e = 0, t = 0, n = arguments.length; t < n; t++) { e += arguments[t].length }
467
+ const r = Array(e)
468
+ let o = 0
469
+ for (t = 0; t < n; t++) {
470
+ for (let i = arguments[t], a = 0, c = i.length; a < c; a++, o++) { r[o] = i[a] }
471
+ }
472
+ return r
473
+ }
474
+ function P (e, t, n) {
475
+ if (n || arguments.length === 2) {
476
+ for (var r, o = 0, i = t.length; o < i; o++) {
477
+ (!r && o in t) ||
466
478
  (r || (r = Array.prototype.slice.call(t, 0, o)),
467
- (r[o] = t[o]));
468
- return e.concat(r || Array.prototype.slice.call(t));
469
- }
470
- function O(e) {
471
- return this instanceof O ? ((this.v = e), this) : new O(e);
479
+ (r[o] = t[o]))
472
480
  }
473
- function x(e, t, n) {
474
- if (!Symbol.asyncIterator)
475
- throw new TypeError("Symbol.asyncIterator is not defined.");
476
- var r,
477
- o = n.apply(e, t || []),
478
- i = [];
479
- return (
480
- (r = {}),
481
- a("next"),
482
- a("throw"),
483
- a("return"),
484
- (r[Symbol.asyncIterator] = function () {
485
- return this;
486
- }),
487
- r
488
- );
489
- function a(e) {
490
- o[e] &&
481
+ }
482
+ return e.concat(r || Array.prototype.slice.call(t))
483
+ }
484
+ function O (e) {
485
+ return this instanceof O ? ((this.v = e), this) : new O(e)
486
+ }
487
+ function x (e, t, n) {
488
+ if (!Symbol.asyncIterator) { throw new TypeError('Symbol.asyncIterator is not defined.') }
489
+ let r
490
+ const o = n.apply(e, t || [])
491
+ const i = []
492
+ return (
493
+ (r = {}),
494
+ a('next'),
495
+ a('throw'),
496
+ a('return'),
497
+ (r[Symbol.asyncIterator] = function () {
498
+ return this
499
+ }),
500
+ r
501
+ )
502
+ function a (e) {
503
+ o[e] &&
491
504
  (r[e] = function (t) {
492
505
  return new Promise(function (n, r) {
493
- i.push([e, t, n, r]) > 1 || c(e, t);
494
- });
495
- });
496
- }
497
- function c(e, t) {
498
- try {
499
- (n = o[e](t)).value instanceof O
500
- ? Promise.resolve(n.value.v).then(l, u)
501
- : s(i[0][2], n);
502
- } catch (e) {
503
- s(i[0][3], e);
504
- }
505
- var n;
506
- }
507
- function l(e) {
508
- c("next", e);
509
- }
510
- function u(e) {
511
- c("throw", e);
512
- }
513
- function s(e, t) {
514
- e(t), i.shift(), i.length && c(i[0][0], i[0][1]);
515
- }
506
+ i.push([e, t, n, r]) > 1 || c(e, t)
507
+ })
508
+ })
509
+ }
510
+ function c (e, t) {
511
+ try {
512
+ (n = o[e](t)).value instanceof O
513
+ ? Promise.resolve(n.value.v).then(l, u)
514
+ : s(i[0][2], n)
515
+ } catch (e) {
516
+ s(i[0][3], e)
516
517
  }
517
- function E(e) {
518
- var t, n;
519
- return (
520
- (t = {}),
521
- r("next"),
522
- r("throw", function (e) {
523
- throw e;
524
- }),
525
- r("return"),
526
- (t[Symbol.iterator] = function () {
527
- return this;
528
- }),
529
- t
530
- );
531
- function r(r, o) {
532
- t[r] = e[r]
533
- ? function (t) {
534
- return (n = !n)
535
- ? { value: O(e[r](t)), done: !1 }
536
- : o
537
- ? o(t)
538
- : t;
539
- }
540
- : o;
518
+ let n
519
+ }
520
+ function l (e) {
521
+ c('next', e)
522
+ }
523
+ function u (e) {
524
+ c('throw', e)
525
+ }
526
+ function s (e, t) {
527
+ e(t), i.shift(), i.length && c(i[0][0], i[0][1])
528
+ }
529
+ }
530
+ function E (e) {
531
+ let t, n
532
+ return (
533
+ (t = {}),
534
+ r('next'),
535
+ r('throw', function (e) {
536
+ throw e
537
+ }),
538
+ r('return'),
539
+ (t[Symbol.iterator] = function () {
540
+ return this
541
+ }),
542
+ t
543
+ )
544
+ function r (r, o) {
545
+ t[r] = e[r]
546
+ ? function (t) {
547
+ return (n = !n)
548
+ ? { value: O(e[r](t)), done: !1 }
549
+ : o
550
+ ? o(t)
551
+ : t
541
552
  }
542
- }
543
- function S(e) {
544
- if (!Symbol.asyncIterator)
545
- throw new TypeError("Symbol.asyncIterator is not defined.");
546
- var t,
547
- n = e[Symbol.asyncIterator];
548
- return n
549
- ? n.call(e)
550
- : ((e = v(e)),
551
- (t = {}),
552
- r("next"),
553
- r("throw"),
554
- r("return"),
555
- (t[Symbol.asyncIterator] = function () {
556
- return this;
557
- }),
558
- t);
559
- function r(n) {
560
- t[n] =
553
+ : o
554
+ }
555
+ }
556
+ function S (e) {
557
+ if (!Symbol.asyncIterator) { throw new TypeError('Symbol.asyncIterator is not defined.') }
558
+ let t
559
+ const n = e[Symbol.asyncIterator]
560
+ return n
561
+ ? n.call(e)
562
+ : ((e = v(e)),
563
+ (t = {}),
564
+ r('next'),
565
+ r('throw'),
566
+ r('return'),
567
+ (t[Symbol.asyncIterator] = function () {
568
+ return this
569
+ }),
570
+ t)
571
+ function r (n) {
572
+ t[n] =
561
573
  e[n] &&
562
574
  function (t) {
563
575
  return new Promise(function (r, o) {
564
576
  !(function (e, t, n, r) {
565
577
  Promise.resolve(r).then(function (t) {
566
- e({ value: t, done: n });
567
- }, t);
568
- })(r, o, (t = e[n](t)).done, t.value);
569
- });
570
- };
571
- }
572
- }
573
- function j(e, t) {
574
- return (
575
- Object.defineProperty
576
- ? Object.defineProperty(e, "raw", { value: t })
577
- : (e.raw = t),
578
- e
579
- );
580
- }
581
- var T = Object.create
582
- ? function (e, t) {
583
- Object.defineProperty(e, "default", {
584
- enumerable: !0,
585
- value: t,
586
- });
587
- }
588
- : function (e, t) {
589
- e.default = t;
590
- };
591
- function A(e) {
592
- if (e && e.__esModule) return e;
593
- var t = {};
594
- if (null != e)
595
- for (var n in e)
596
- "default" !== n &&
578
+ e({ value: t, done: n })
579
+ }, t)
580
+ })(r, o, (t = e[n](t)).done, t.value)
581
+ })
582
+ }
583
+ }
584
+ }
585
+ function j (e, t) {
586
+ return (
587
+ Object.defineProperty
588
+ ? Object.defineProperty(e, 'raw', { value: t })
589
+ : (e.raw = t),
590
+ e
591
+ )
592
+ }
593
+ const T = Object.create
594
+ ? function (e, t) {
595
+ Object.defineProperty(e, 'default', {
596
+ enumerable: !0,
597
+ value: t
598
+ })
599
+ }
600
+ : function (e, t) {
601
+ e.default = t
602
+ }
603
+ function A (e) {
604
+ if (e && e.__esModule) return e
605
+ const t = {}
606
+ if (e != null) {
607
+ for (const n in e) {
608
+ n !== 'default' &&
597
609
  Object.prototype.hasOwnProperty.call(e, n) &&
598
- g(t, e, n);
599
- return T(t, e), t;
610
+ g(t, e, n)
600
611
  }
601
- function C(e) {
602
- return e && e.__esModule ? e : { default: e };
603
- }
604
- function k(e, t, n, r) {
605
- if ("a" === n && !r)
606
- throw new TypeError(
607
- "Private accessor was defined without a getter"
608
- );
609
- if ("function" == typeof t ? e !== t || !r : !t.has(e))
610
- throw new TypeError(
611
- "Cannot read private member from an object whose class did not declare it"
612
- );
613
- return "m" === n
614
- ? r
615
- : "a" === n
616
- ? r.call(e)
617
- : r
612
+ }
613
+ return T(t, e), t
614
+ }
615
+ function C (e) {
616
+ return e && e.__esModule ? e : { default: e }
617
+ }
618
+ function k (e, t, n, r) {
619
+ if (n === 'a' && !r) {
620
+ throw new TypeError(
621
+ 'Private accessor was defined without a getter'
622
+ )
623
+ }
624
+ if (typeof t === 'function' ? e !== t || !r : !t.has(e)) {
625
+ throw new TypeError(
626
+ 'Cannot read private member from an object whose class did not declare it'
627
+ )
628
+ }
629
+ return n === 'm'
630
+ ? r
631
+ : n === 'a'
632
+ ? r.call(e)
633
+ : r
618
634
  ? r.value
619
- : t.get(e);
620
- }
621
- function M(e, t, n, r, o) {
622
- if ("m" === r)
623
- throw new TypeError("Private method is not writable");
624
- if ("a" === r && !o)
625
- throw new TypeError(
626
- "Private accessor was defined without a setter"
627
- );
628
- if ("function" == typeof t ? e !== t || !o : !t.has(e))
629
- throw new TypeError(
630
- "Cannot write private member to an object whose class did not declare it"
631
- );
632
- return (
633
- "a" === r ? o.call(e, n) : o ? (o.value = n) : t.set(e, n), n
634
- );
635
- }
636
- function R(e, t) {
637
- if (null === t || ("object" != typeof t && "function" != typeof t))
638
- throw new TypeError("Cannot use 'in' operator on non-object");
639
- return "function" == typeof e ? t === e : e.has(t);
640
- }
641
- },
642
- 156: function (t) {
643
- t.exports = e;
644
- },
645
- 111: function (e) {
646
- e.exports = t;
647
- },
648
- },
649
- r = {};
650
- function o(e) {
651
- var t = r[e];
652
- if (void 0 !== t) return t.exports;
653
- var i = (r[e] = { exports: {} });
654
- return n[e](i, i.exports, o), i.exports;
635
+ : t.get(e)
636
+ }
637
+ function M (e, t, n, r, o) {
638
+ if (r === 'm') { throw new TypeError('Private method is not writable') }
639
+ if (r === 'a' && !o) {
640
+ throw new TypeError(
641
+ 'Private accessor was defined without a setter'
642
+ )
643
+ }
644
+ if (typeof t === 'function' ? e !== t || !o : !t.has(e)) {
645
+ throw new TypeError(
646
+ 'Cannot write private member to an object whose class did not declare it'
647
+ )
648
+ }
649
+ return (
650
+ r === 'a' ? o.call(e, n) : o ? (o.value = n) : t.set(e, n), n
651
+ )
652
+ }
653
+ function R (e, t) {
654
+ if (t === null || (typeof t !== 'object' && typeof t !== 'function')) { throw new TypeError("Cannot use 'in' operator on non-object") }
655
+ return typeof e === 'function' ? t === e : e.has(t)
656
+ }
657
+ },
658
+ 156: function (t) {
659
+ t.exports = e
660
+ },
661
+ 111: function (e) {
662
+ e.exports = t
655
663
  }
656
- (o.d = function (e, t) {
657
- for (var n in t)
658
- o.o(t, n) &&
664
+ }
665
+ const r = {}
666
+ function o (e) {
667
+ const t = r[e]
668
+ if (void 0 !== t) return t.exports
669
+ const i = (r[e] = { exports: {} })
670
+ return n[e](i, i.exports, o), i.exports
671
+ }
672
+ (o.d = function (e, t) {
673
+ for (const n in t) {
674
+ o.o(t, n) &&
659
675
  !o.o(e, n) &&
660
- Object.defineProperty(e, n, { enumerable: !0, get: t[n] });
661
- }),
662
- (o.o = function (e, t) {
663
- return Object.prototype.hasOwnProperty.call(e, t);
664
- }),
665
- (o.r = function (e) {
666
- "undefined" != typeof Symbol &&
676
+ Object.defineProperty(e, n, { enumerable: !0, get: t[n] })
677
+ }
678
+ }),
679
+ (o.o = function (e, t) {
680
+ return Object.prototype.hasOwnProperty.call(e, t)
681
+ }),
682
+ (o.r = function (e) {
683
+ typeof Symbol !== 'undefined' &&
667
684
  Symbol.toStringTag &&
668
- Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }),
669
- Object.defineProperty(e, "__esModule", { value: !0 });
670
- });
671
- var i = {};
672
- return (
673
- (function () {
674
- var e = i;
675
- Object.defineProperty(e, "__esModule", { value: !0 }),
676
- (e.useReactToPrint = e.PrintContextConsumer = void 0);
677
- var t = o(655),
678
- n = o(156),
679
- r = o(111),
680
- a = Object.prototype.hasOwnProperty.call(n, "createContext"),
681
- c =
682
- Object.prototype.hasOwnProperty.call(n, "useMemo") &&
683
- Object.prototype.hasOwnProperty.call(n, "useCallback"),
684
- l = a ? n.createContext({}) : null;
685
- e.PrintContextConsumer = l
686
- ? l.Consumer
687
- : function () {
688
- return null;
689
- };
690
- var u = {
691
- copyStyles: !0,
692
- pageStyle:
693
- "\n @page {\n /* Remove browser default header (title) and footer (url) */\n padding: 10px;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n color-adjust: exact; /* Firefox */\n }\n }\n ",
694
- removeAfterPrint: !1,
695
- suppressErrors: !1,
696
- },
697
- s = (function (e) {
698
- function o() {
699
- var n = (null !== e && e.apply(this, arguments)) || this;
700
- return (
701
- (n.startPrint = function (e) {
702
- var t = n.props,
703
- r = t.onAfterPrint,
704
- o = t.onPrintError,
705
- i = t.print,
706
- a = t.documentTitle;
707
- setTimeout(function () {
708
- var t, c;
709
- if (e.contentWindow) {
710
- if ((e.contentWindow.focus(), i))
711
- i(e)
712
- .then(n.handleRemoveIframe)
713
- .catch(function (e) {
714
- o
715
- ? o("print", e)
716
- : n.logMessages([
717
- "An error was thrown by the specified `print` function",
718
- ]);
719
- });
720
- else if (e.contentWindow.print) {
721
- var l =
722
- null !==
723
- (c =
724
- null === (t = e.contentDocument) || void 0 === t
685
+ Object.defineProperty(e, Symbol.toStringTag, { value: 'Module' }),
686
+ Object.defineProperty(e, '__esModule', { value: !0 })
687
+ })
688
+ const i = {}
689
+ return (
690
+ (function () {
691
+ const e = i
692
+ Object.defineProperty(e, '__esModule', { value: !0 }),
693
+ (e.useReactToPrint = e.PrintContextConsumer = void 0)
694
+ const t = o(655)
695
+ const n = o(156)
696
+ const r = o(111)
697
+ const a = Object.prototype.hasOwnProperty.call(n, 'createContext')
698
+ const c =
699
+ Object.prototype.hasOwnProperty.call(n, 'useMemo') &&
700
+ Object.prototype.hasOwnProperty.call(n, 'useCallback')
701
+ const l = a ? n.createContext({}) : null
702
+ e.PrintContextConsumer = l
703
+ ? l.Consumer
704
+ : function () {
705
+ return null
706
+ }
707
+ const u = {
708
+ copyStyles: !0,
709
+ pageStyle:
710
+ '\n @page {\n /* Remove browser default header (title) and footer (url) */\n padding: 10px;\n }\n @media print {\n body {\n /* Tell browsers to print background colors */\n -webkit-print-color-adjust: exact; /* Chrome/Safari/Edge/Opera */\n color-adjust: exact; /* Firefox */\n }\n }\n ',
711
+ removeAfterPrint: !1,
712
+ suppressErrors: !1
713
+ }
714
+ const s = (function (e) {
715
+ function o () {
716
+ const n = (e !== null && e.apply(this, arguments)) || this
717
+ return (
718
+ (n.startPrint = function (e) {
719
+ const t = n.props
720
+ const r = t.onAfterPrint
721
+ const o = t.onPrintError
722
+ const i = t.print
723
+ const a = t.documentTitle
724
+ setTimeout(function () {
725
+ let t, c
726
+ if (e.contentWindow) {
727
+ if ((e.contentWindow.focus(), i)) {
728
+ i(e)
729
+ .then(n.handleRemoveIframe)
730
+ .catch(function (e) {
731
+ o
732
+ ? o('print', e)
733
+ : n.logMessages([
734
+ 'An error was thrown by the specified `print` function'
735
+ ])
736
+ })
737
+ } else if (e.contentWindow.print) {
738
+ const l =
739
+ (c =
740
+ (t = e.contentDocument) === null || void 0 === t
725
741
  ? void 0
726
- : t.title) && void 0 !== c
742
+ : t.title) !==
743
+ null && void 0 !== c
727
744
  ? c
728
- : "",
729
- u = e.ownerDocument.title;
730
- a &&
745
+ : ''
746
+ const u = e.ownerDocument.title
747
+ a &&
731
748
  ((e.ownerDocument.title = a),
732
749
  e.contentDocument && (e.contentDocument.title = a)),
733
- e.contentWindow.print(),
734
- a &&
750
+ e.contentWindow.print(),
751
+ a &&
735
752
  ((e.ownerDocument.title = u),
736
- e.contentDocument && (e.contentDocument.title = l));
737
- } else
738
- n.logMessages([
739
- "Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes.",
740
- ]);
741
- r && r(), n.handleRemoveIframe();
742
- } else n.logMessages(["Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/"]);
743
- }, 500);
744
- }),
745
- (n.triggerPrint = function (e) {
746
- var t = n.props,
747
- r = t.onBeforePrint,
748
- o = t.onPrintError;
749
- if (r) {
750
- var i = r();
751
- i && "function" == typeof i.then
752
- ? i
753
- .then(function () {
754
- n.startPrint(e);
755
- })
756
- .catch(function (e) {
757
- o && o("onBeforePrint", e);
758
- })
759
- : n.startPrint(e);
760
- } else n.startPrint(e);
761
- }),
762
- (n.handleClick = function () {
763
- var e = n.props,
764
- t = e.onBeforeGetContent,
765
- r = e.onPrintError;
766
- if (t) {
767
- var o = t();
768
- o && "function" == typeof o.then
769
- ? o.then(n.handlePrint).catch(function (e) {
770
- r && r("onBeforeGetContent", e);
771
- })
772
- : n.handlePrint();
773
- } else n.handlePrint();
774
- }),
775
- (n.handlePrint = function () {
776
- var e = n.props,
777
- o = e.bodyClass,
778
- i = e.content,
779
- a = e.copyStyles,
780
- c = e.fonts,
781
- l = e.pageStyle,
782
- u = e.nonce,
783
- s = i();
784
- if (void 0 !== s)
785
- if (null !== s) {
786
- var f = document.createElement("iframe");
787
- (f.width = "".concat(
788
- document.documentElement.clientWidth,
789
- "px"
790
- )),
791
- (f.height = "".concat(
792
- document.documentElement.clientHeight,
793
- "px"
794
- )),
795
- (f.style.position = "absolute"),
796
- (f.style.top = "-".concat(
797
- document.documentElement.clientHeight + 100,
798
- "px"
799
- )),
800
- (f.style.left = "-".concat(
801
- document.documentElement.clientWidth + 100,
802
- "px"
803
- )),
804
- (f.id = "printWindow"),
805
- (f.srcdoc = "<!DOCTYPE html>");
806
- var d = (0, r.findDOMNode)(s);
807
- if (d) {
808
- var p = d.cloneNode(!0),
809
- h = p instanceof Text,
810
- y = document.querySelectorAll(
811
- "link[rel='stylesheet']"
812
- ),
813
- g = h ? [] : p.querySelectorAll("img"),
814
- b = h ? [] : p.querySelectorAll("video"),
815
- v = c ? c.length : 0;
816
- (n.numResourcesToLoad =
753
+ e.contentDocument && (e.contentDocument.title = l))
754
+ } else {
755
+ n.logMessages([
756
+ 'Printing for this browser is not currently possible: the browser does not have a `print` method available for iframes.'
757
+ ])
758
+ }
759
+ r && r(), n.handleRemoveIframe()
760
+ } else n.logMessages(['Printing failed because the `contentWindow` of the print iframe did not load. This is possibly an error with `react-to-print`. Please file an issue: https://github.com/gregnb/react-to-print/issues/'])
761
+ }, 500)
762
+ }),
763
+ (n.triggerPrint = function (e) {
764
+ const t = n.props
765
+ const r = t.onBeforePrint
766
+ const o = t.onPrintError
767
+ if (r) {
768
+ const i = r()
769
+ i && typeof i.then === 'function'
770
+ ? i
771
+ .then(function () {
772
+ n.startPrint(e)
773
+ })
774
+ .catch(function (e) {
775
+ o && o('onBeforePrint', e)
776
+ })
777
+ : n.startPrint(e)
778
+ } else n.startPrint(e)
779
+ }),
780
+ (n.handleClick = function () {
781
+ const e = n.props
782
+ const t = e.onBeforeGetContent
783
+ const r = e.onPrintError
784
+ if (t) {
785
+ const o = t()
786
+ o && typeof o.then === 'function'
787
+ ? o.then(n.handlePrint).catch(function (e) {
788
+ r && r('onBeforeGetContent', e)
789
+ })
790
+ : n.handlePrint()
791
+ } else n.handlePrint()
792
+ }),
793
+ (n.handlePrint = function () {
794
+ const e = n.props
795
+ const o = e.bodyClass
796
+ const i = e.content
797
+ const a = e.copyStyles
798
+ const c = e.fonts
799
+ const l = e.pageStyle
800
+ const u = e.nonce
801
+ const s = i()
802
+ if (void 0 !== s) {
803
+ if (s !== null) {
804
+ const f = document.createElement('iframe');
805
+ (f.width = ''.concat(
806
+ document.documentElement.clientWidth,
807
+ 'px'
808
+ )),
809
+ (f.height = ''.concat(
810
+ document.documentElement.clientHeight,
811
+ 'px'
812
+ )),
813
+ (f.style.position = 'absolute'),
814
+ (f.style.top = '-'.concat(
815
+ document.documentElement.clientHeight + 100,
816
+ 'px'
817
+ )),
818
+ (f.style.left = '-'.concat(
819
+ document.documentElement.clientWidth + 100,
820
+ 'px'
821
+ )),
822
+ (f.id = 'printWindow'),
823
+ (f.srcdoc = '<!DOCTYPE html>')
824
+ const d = (0, r.findDOMNode)(s)
825
+ if (d) {
826
+ const p = d.cloneNode(!0)
827
+ const h = p instanceof Text
828
+ const y = document.querySelectorAll(
829
+ "link[rel='stylesheet']"
830
+ )
831
+ const g = h ? [] : p.querySelectorAll('img')
832
+ const b = h ? [] : p.querySelectorAll('video')
833
+ const v = c ? c.length : 0;
834
+ (n.numResourcesToLoad =
817
835
  y.length + g.length + b.length + v),
818
- (n.resourcesLoaded = []),
819
- (n.resourcesErrored = []);
820
- var m = function (e, r) {
821
- n.resourcesLoaded.includes(e)
822
- ? n.logMessages(
823
- [
824
- "Tried to mark a resource that has already been handled",
825
- e,
826
- ],
827
- "debug"
828
- )
829
- : (r
830
- ? (n.logMessages(
831
- t.__spreadArray(
832
- [
833
- '"react-to-print" was unable to load a resource but will continue attempting to print the page',
834
- ],
835
- t.__read(r),
836
- !1
837
- )
838
- ),
839
- n.resourcesErrored.push(e))
840
- : n.resourcesLoaded.push(e),
841
- n.resourcesLoaded.length +
836
+ (n.resourcesLoaded = []),
837
+ (n.resourcesErrored = [])
838
+ const m = function (e, r) {
839
+ n.resourcesLoaded.includes(e)
840
+ ? n.logMessages(
841
+ [
842
+ 'Tried to mark a resource that has already been handled',
843
+ e
844
+ ],
845
+ 'debug'
846
+ )
847
+ : (r
848
+ ? (n.logMessages(
849
+ t.__spreadArray(
850
+ [
851
+ '"react-to-print" was unable to load a resource but will continue attempting to print the page'
852
+ ],
853
+ t.__read(r),
854
+ !1
855
+ )
856
+ ),
857
+ n.resourcesErrored.push(e))
858
+ : n.resourcesLoaded.push(e),
859
+ n.resourcesLoaded.length +
842
860
  n.resourcesErrored.length ===
843
- n.numResourcesToLoad && n.triggerPrint(f));
844
- };
845
- (f.onload = function () {
846
- var e, r, i, s;
847
- f.onload = null;
848
- var y =
861
+ n.numResourcesToLoad && n.triggerPrint(f))
862
+ };
863
+ (f.onload = function () {
864
+ let e, r, i, s
865
+ f.onload = null
866
+ const y =
849
867
  f.contentDocument ||
850
- (null === (r = f.contentWindow) || void 0 === r
868
+ ((r = f.contentWindow) === null || void 0 === r
851
869
  ? void 0
852
- : r.document);
853
- if (y) {
854
- y.body.appendChild(p),
855
- c &&
856
- ((null === (i = f.contentDocument) ||
870
+ : r.document)
871
+ if (y) {
872
+ y.body.appendChild(p),
873
+ c &&
874
+ (((i = f.contentDocument) === null ||
857
875
  void 0 === i
858
876
  ? void 0
859
877
  : i.fonts) &&
860
- (null === (s = f.contentWindow) || void 0 === s
878
+ ((s = f.contentWindow) === null || void 0 === s
861
879
  ? void 0
862
880
  : s.FontFace)
863
881
  ? c.forEach(function (e) {
864
- var t = new FontFace(e.family, e.source, {
865
- weight: e.weight,
866
- style: e.style,
867
- });
868
- f.contentDocument.fonts.add(t),
869
- t.loaded
870
- .then(function () {
871
- m(t);
872
- })
873
- .catch(function (e) {
874
- m(t, [
875
- "Failed loading the font:",
876
- t,
877
- "Load error:",
878
- e,
879
- ]);
880
- });
882
+ const t = new FontFace(e.family, e.source, {
883
+ weight: e.weight,
884
+ style: e.style
881
885
  })
886
+ f.contentDocument.fonts.add(t),
887
+ t.loaded
888
+ .then(function () {
889
+ m(t)
890
+ })
891
+ .catch(function (e) {
892
+ m(t, [
893
+ 'Failed loading the font:',
894
+ t,
895
+ 'Load error:',
896
+ e
897
+ ])
898
+ })
899
+ })
882
900
  : (c.forEach(function (e) {
883
- return m(e);
901
+ return m(e)
884
902
  }),
885
903
  n.logMessages([
886
- '"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page',
887
- ])));
888
- var v = "function" == typeof l ? l() : l;
889
- if ("string" != typeof v)
890
- n.logMessages([
891
- '"react-to-print" expected a "string" from `pageStyle` but received "'.concat(
892
- typeof v,
893
- '". Styles from `pageStyle` will not be applied.'
894
- ),
895
- ]);
896
- else {
897
- var w = y.createElement("style");
898
- u &&
899
- (w.setAttribute("nonce", u),
900
- y.head.setAttribute("nonce", u)),
901
- w.appendChild(y.createTextNode(v)),
902
- y.head.appendChild(w);
903
- }
904
- if (
905
- (o &&
904
+ '"react-to-print" is not able to load custom fonts because the browser does not support the FontFace API but will continue attempting to print the page'
905
+ ])))
906
+ const v = typeof l === 'function' ? l() : l
907
+ if (typeof v !== 'string') {
908
+ n.logMessages([
909
+ '"react-to-print" expected a "string" from `pageStyle` but received "'.concat(
910
+ typeof v,
911
+ '". Styles from `pageStyle` will not be applied.'
912
+ )
913
+ ])
914
+ } else {
915
+ const w = y.createElement('style')
916
+ u &&
917
+ (w.setAttribute('nonce', u),
918
+ y.head.setAttribute('nonce', u)),
919
+ w.appendChild(y.createTextNode(v)),
920
+ y.head.appendChild(w)
921
+ }
922
+ if (
923
+ (o &&
906
924
  (e = y.body.classList).add.apply(
907
925
  e,
908
926
  t.__spreadArray(
909
927
  [],
910
- t.__read(o.split(" ")),
928
+ t.__read(o.split(' ')),
911
929
  !1
912
930
  )
913
931
  ),
914
- !h)
915
- ) {
916
- for (
917
- var _ = h ? [] : d.querySelectorAll("canvas"),
918
- P = y.querySelectorAll("canvas"),
919
- O = 0;
920
- O < _.length;
921
- ++O
922
- ) {
923
- var x = _[O],
924
- E = P[O].getContext("2d");
925
- E && E.drawImage(x, 0, 0);
926
- }
927
- var S = function (e) {
928
- var t = g[e],
929
- n = t.getAttribute("src");
930
- if (n) {
931
- var r = new Image();
932
- (r.onload = function () {
933
- return m(t);
932
+ !h)
933
+ ) {
934
+ for (
935
+ var _ = h ? [] : d.querySelectorAll('canvas'),
936
+ P = y.querySelectorAll('canvas'),
937
+ O = 0;
938
+ O < _.length;
939
+ ++O
940
+ ) {
941
+ const x = _[O]
942
+ const E = P[O].getContext('2d')
943
+ E && E.drawImage(x, 0, 0)
944
+ }
945
+ const S = function (e) {
946
+ const t = g[e]
947
+ const n = t.getAttribute('src')
948
+ if (n) {
949
+ const r = new Image();
950
+ (r.onload = function () {
951
+ return m(t)
952
+ }),
953
+ (r.onerror = function (e, n, r, o, i) {
954
+ return m(t, [
955
+ 'Error loading <img>',
956
+ t,
957
+ 'Error',
958
+ i
959
+ ])
960
+ }),
961
+ (r.src = n)
962
+ } else {
963
+ m(t, [
964
+ 'Found an <img> tag with an empty "src" attribute. This prevents pre-loading it. The <img> is:',
965
+ t
966
+ ])
967
+ }
968
+ }
969
+ for (O = 0; O < g.length; O++) S(O)
970
+ const j = function (e) {
971
+ const t = b[e]
972
+ t.preload = 'auto'
973
+ const n = t.getAttribute('poster')
974
+ if (n) {
975
+ const r = new Image();
976
+ (r.onload = function () {
977
+ return m(t)
978
+ }),
979
+ (r.onerror = function (e, r, o, i, a) {
980
+ return m(t, [
981
+ 'Error loading video poster',
982
+ n,
983
+ 'for video',
984
+ t,
985
+ 'Error:',
986
+ a
987
+ ])
988
+ }),
989
+ (r.src = n)
990
+ } else {
991
+ t.readyState >= 2
992
+ ? m(t)
993
+ : ((t.onloadeddata = function () {
994
+ return m(t)
934
995
  }),
935
- (r.onerror = function (e, n, r, o, i) {
936
- return m(t, [
937
- "Error loading <img>",
938
- t,
939
- "Error",
940
- i,
941
- ]);
942
- }),
943
- (r.src = n);
944
- } else
945
- m(t, [
946
- 'Found an <img> tag with an empty "src" attribute. This prevents pre-loading it. The <img> is:',
947
- t,
948
- ]);
949
- };
950
- for (O = 0; O < g.length; O++) S(O);
951
- var j = function (e) {
952
- var t = b[e];
953
- t.preload = "auto";
954
- var n = t.getAttribute("poster");
955
- if (n) {
956
- var r = new Image();
957
- (r.onload = function () {
958
- return m(t);
996
+ (t.onerror = function (e, n, r, o, i) {
997
+ return m(t, [
998
+ 'Error loading video',
999
+ t,
1000
+ 'Error',
1001
+ i
1002
+ ])
959
1003
  }),
960
- (r.onerror = function (e, r, o, i, a) {
961
- return m(t, [
962
- "Error loading video poster",
963
- n,
964
- "for video",
965
- t,
966
- "Error:",
967
- a,
968
- ]);
969
- }),
970
- (r.src = n);
971
- } else
972
- t.readyState >= 2
973
- ? m(t)
974
- : ((t.onloadeddata = function () {
975
- return m(t);
976
- }),
977
- (t.onerror = function (e, n, r, o, i) {
978
- return m(t, [
979
- "Error loading video",
980
- t,
981
- "Error",
982
- i,
983
- ]);
984
- }),
985
- (t.onstalled = function () {
986
- return m(t, [
987
- "Loading video stalled, skipping",
988
- t,
989
- ]);
990
- }));
991
- };
992
- for (O = 0; O < b.length; O++) j(O);
993
- var T = "input",
994
- A = d.querySelectorAll(T),
995
- C = y.querySelectorAll(T);
996
- for (O = 0; O < A.length; O++)
997
- C[O].value = A[O].value;
998
- var k = "input[type=checkbox],input[type=radio]",
999
- M = d.querySelectorAll(k),
1000
- R = y.querySelectorAll(k);
1001
- for (O = 0; O < M.length; O++)
1002
- R[O].checked = M[O].checked;
1003
- var D = "select",
1004
- I = d.querySelectorAll(D),
1005
- q = y.querySelectorAll(D);
1006
- for (O = 0; O < I.length; O++)
1007
- q[O].value = I[O].value;
1004
+ (t.onstalled = function () {
1005
+ return m(t, [
1006
+ 'Loading video stalled, skipping',
1007
+ t
1008
+ ])
1009
+ }))
1008
1010
  }
1009
- if (a)
1010
- for (
1011
- var F = document.querySelectorAll(
1012
- "style, link[rel='stylesheet']"
1013
- ),
1014
- L = function (e, t) {
1015
- var r = F[e];
1016
- if ("style" === r.tagName.toLowerCase()) {
1017
- var o = y.createElement(r.tagName),
1018
- i = r.sheet;
1019
- if (i) {
1020
- var a = "";
1021
- try {
1022
- for (
1023
- var c = i.cssRules.length, l = 0;
1024
- l < c;
1025
- ++l
1026
- )
1027
- "string" ==
1028
- typeof i.cssRules[l].cssText &&
1029
- (a += "".concat(
1011
+ }
1012
+ for (O = 0; O < b.length; O++) j(O)
1013
+ const T = 'input'
1014
+ const A = d.querySelectorAll(T)
1015
+ const C = y.querySelectorAll(T)
1016
+ for (O = 0; O < A.length; O++) { C[O].value = A[O].value }
1017
+ const k = 'input[type=checkbox],input[type=radio]'
1018
+ const M = d.querySelectorAll(k)
1019
+ const R = y.querySelectorAll(k)
1020
+ for (O = 0; O < M.length; O++) { R[O].checked = M[O].checked }
1021
+ const D = 'select'
1022
+ const I = d.querySelectorAll(D)
1023
+ const q = y.querySelectorAll(D)
1024
+ for (O = 0; O < I.length; O++) { q[O].value = I[O].value }
1025
+ }
1026
+ if (a) {
1027
+ for (
1028
+ var F = document.querySelectorAll(
1029
+ "style, link[rel='stylesheet']"
1030
+ ),
1031
+ L = function (e, t) {
1032
+ const r = F[e]
1033
+ if (r.tagName.toLowerCase() === 'style') {
1034
+ const o = y.createElement(r.tagName)
1035
+ const i = r.sheet
1036
+ if (i) {
1037
+ let a = ''
1038
+ try {
1039
+ for (
1040
+ var c = i.cssRules.length, l = 0;
1041
+ l < c;
1042
+ ++l
1043
+ ) {
1044
+ typeof i.cssRules[l].cssText ===
1045
+ 'string' &&
1046
+ (a += ''.concat(
1030
1047
  i.cssRules[l].cssText,
1031
- "\r\n"
1032
- ));
1033
- } catch (e) {
1034
- n.logMessages(
1035
- [
1036
- "A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/gregnb/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.",
1037
- r,
1038
- ],
1039
- "warning"
1040
- );
1041
- }
1042
- o.setAttribute(
1043
- "id",
1044
- "react-to-print-".concat(e)
1045
- ),
1046
- u && o.setAttribute("nonce", u),
1047
- o.appendChild(y.createTextNode(a)),
1048
- y.head.appendChild(o);
1048
+ '\r\n'
1049
+ ))
1049
1050
  }
1050
- } else if (r.getAttribute("href"))
1051
- if (r.hasAttribute("disabled"))
1052
- n.logMessages(
1053
- [
1054
- "`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:",
1055
- r,
1056
- ],
1057
- "warning"
1058
- ),
1059
- m(r);
1060
- else {
1061
- for (
1062
- var s = y.createElement(r.tagName),
1063
- f = ((l = 0), r.attributes.length);
1064
- l < f;
1065
- ++l
1066
- ) {
1067
- var d = r.attributes[l];
1068
- d &&
1069
- s.setAttribute(
1070
- d.nodeName,
1071
- d.nodeValue || ""
1072
- );
1073
- }
1074
- (s.onload = function () {
1075
- return m(s);
1076
- }),
1077
- (s.onerror = function (
1078
- e,
1079
- t,
1080
- n,
1081
- r,
1082
- o
1083
- ) {
1084
- return m(s, [
1085
- "Failed to load",
1086
- s,
1087
- "Error:",
1088
- o,
1089
- ]);
1090
- }),
1091
- u && s.setAttribute("nonce", u),
1092
- y.head.appendChild(s);
1093
- }
1094
- else
1051
+ } catch (e) {
1095
1052
  n.logMessages(
1096
1053
  [
1097
- "`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:",
1098
- r,
1054
+ 'A stylesheet could not be accessed. This is likely due to the stylesheet having cross-origin imports, and many browsers block script access to cross-origin stylesheets. See https://github.com/gregnb/react-to-print/issues/429 for details. You may be able to load the sheet by both marking the stylesheet with the cross `crossorigin` attribute, and setting the `Access-Control-Allow-Origin` header on the server serving the stylesheet. Alternatively, host the stylesheet on your domain to avoid this issue entirely.',
1055
+ r
1099
1056
  ],
1100
- "warning"
1101
- ),
1102
- m(r);
1103
- },
1104
- W = ((O = 0), F.length);
1105
- O < W;
1106
- ++O
1107
- )
1108
- L(O);
1109
- }
1110
- (0 !== n.numResourcesToLoad && a) ||
1111
- n.triggerPrint(f);
1112
- }),
1113
- n.handleRemoveIframe(!0),
1114
- document.body.appendChild(f);
1115
- } else
1116
- n.logMessages([
1117
- '"react-to-print" could not locate the DOM node corresponding with the `content` prop',
1118
- ]);
1119
- } else
1120
- n.logMessages([
1121
- 'There is nothing to print because the "content" prop returned "null". Please ensure "content" is renderable before allowing "react-to-print" to be called.',
1122
- ]);
1123
- else
1057
+ 'warning'
1058
+ )
1059
+ }
1060
+ o.setAttribute(
1061
+ 'id',
1062
+ 'react-to-print-'.concat(e)
1063
+ ),
1064
+ u && o.setAttribute('nonce', u),
1065
+ o.appendChild(y.createTextNode(a)),
1066
+ y.head.appendChild(o)
1067
+ }
1068
+ } else if (r.getAttribute('href')) {
1069
+ if (r.hasAttribute('disabled')) {
1070
+ n.logMessages(
1071
+ [
1072
+ '`react-to-print` encountered a <link> tag with a `disabled` attribute and will ignore it. Note that the `disabled` attribute is deprecated, and some browsers ignore it. You should stop using it. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link#attr-disabled. The <link> is:',
1073
+ r
1074
+ ],
1075
+ 'warning'
1076
+ ),
1077
+ m(r)
1078
+ } else {
1079
+ for (
1080
+ var s = y.createElement(r.tagName),
1081
+ f = ((l = 0), r.attributes.length);
1082
+ l < f;
1083
+ ++l
1084
+ ) {
1085
+ const d = r.attributes[l]
1086
+ d &&
1087
+ s.setAttribute(
1088
+ d.nodeName,
1089
+ d.nodeValue || ''
1090
+ )
1091
+ }
1092
+ (s.onload = function () {
1093
+ return m(s)
1094
+ }),
1095
+ (s.onerror = function (
1096
+ e,
1097
+ t,
1098
+ n,
1099
+ r,
1100
+ o
1101
+ ) {
1102
+ return m(s, [
1103
+ 'Failed to load',
1104
+ s,
1105
+ 'Error:',
1106
+ o
1107
+ ])
1108
+ }),
1109
+ u && s.setAttribute('nonce', u),
1110
+ y.head.appendChild(s)
1111
+ }
1112
+ } else {
1113
+ n.logMessages(
1114
+ [
1115
+ '`react-to-print` encountered a <link> tag with an empty `href` attribute. In addition to being invalid HTML, this can cause problems in many browsers, and so the <link> was not loaded. The <link> is:',
1116
+ r
1117
+ ],
1118
+ 'warning'
1119
+ ),
1120
+ m(r)
1121
+ }
1122
+ },
1123
+ W = ((O = 0), F.length);
1124
+ O < W;
1125
+ ++O
1126
+ ) { L(O) }
1127
+ }
1128
+ }
1129
+ (n.numResourcesToLoad !== 0 && a) ||
1130
+ n.triggerPrint(f)
1131
+ }),
1132
+ n.handleRemoveIframe(!0),
1133
+ document.body.appendChild(f)
1134
+ } else {
1124
1135
  n.logMessages([
1125
- "To print a functional component ensure it is wrapped with `React.forwardRef`, and ensure the forwarded ref is used. See the README for an example: https://github.com/gregnb/react-to-print#examples",
1126
- ]);
1127
- }),
1128
- (n.handleRemoveIframe = function (e) {
1129
- var t = n.props.removeAfterPrint;
1130
- if (e || t) {
1131
- var r = document.getElementById("printWindow");
1132
- r && document.body.removeChild(r);
1136
+ '"react-to-print" could not locate the DOM node corresponding with the `content` prop'
1137
+ ])
1133
1138
  }
1134
- }),
1135
- (n.logMessages = function (e, t) {
1136
- void 0 === t && (t = "error"),
1137
- n.props.suppressErrors ||
1138
- ("error" === t
1139
+ } else {
1140
+ n.logMessages([
1141
+ 'There is nothing to print because the "content" prop returned "null". Please ensure "content" is renderable before allowing "react-to-print" to be called.'
1142
+ ])
1143
+ }
1144
+ } else {
1145
+ n.logMessages([
1146
+ 'To print a functional component ensure it is wrapped with `React.forwardRef`, and ensure the forwarded ref is used. See the README for an example: https://github.com/gregnb/react-to-print#examples'
1147
+ ])
1148
+ }
1149
+ }),
1150
+ (n.handleRemoveIframe = function (e) {
1151
+ const t = n.props.removeAfterPrint
1152
+ if (e || t) {
1153
+ const r = document.getElementById('printWindow')
1154
+ r && document.body.removeChild(r)
1155
+ }
1156
+ }),
1157
+ (n.logMessages = function (e, t) {
1158
+ void 0 === t && (t = 'error'),
1159
+ n.props.suppressErrors ||
1160
+ (t === 'error'
1139
1161
  ? console.error(e)
1140
- : "warning" === t
1141
- ? console.warn(e)
1142
- : "debug" === t && console.debug(e));
1143
- }),
1144
- n
1145
- );
1146
- }
1147
- return (
1148
- t.__extends(o, e),
1149
- (o.prototype.render = function () {
1150
- var e = this.props,
1151
- t = e.children,
1152
- r = e.trigger;
1153
- if (r)
1154
- return n.cloneElement(r(), { onClick: this.handleClick });
1155
- if (!l)
1156
- return (
1157
- this.logMessages([
1158
- '"react-to-print" requires React ^16.3.0 to be able to use "PrintContext"',
1159
- ]),
1160
- null
1161
- );
1162
- var o = { handlePrint: this.handleClick };
1163
- return n.createElement(l.Provider, { value: o }, t);
1164
- }),
1165
- (o.defaultProps = u),
1166
- o
1167
- );
1168
- })(n.Component);
1169
- (e.default = s),
1170
- (e.useReactToPrint = function (e) {
1171
- if (!c)
1162
+ : t === 'warning'
1163
+ ? console.warn(e)
1164
+ : t === 'debug' && console.debug(e))
1165
+ }),
1166
+ n
1167
+ )
1168
+ }
1169
+ return (
1170
+ t.__extends(o, e),
1171
+ (o.prototype.render = function () {
1172
+ const e = this.props
1173
+ const t = e.children
1174
+ const r = e.trigger
1175
+ if (r) { return n.cloneElement(r(), { onClick: this.handleClick }) }
1176
+ if (!l) {
1172
1177
  return (
1173
- e.suppressErrors ||
1178
+ this.logMessages([
1179
+ '"react-to-print" requires React ^16.3.0 to be able to use "PrintContext"'
1180
+ ]),
1181
+ null
1182
+ )
1183
+ }
1184
+ const o = { handlePrint: this.handleClick }
1185
+ return n.createElement(l.Provider, { value: o }, t)
1186
+ }),
1187
+ (o.defaultProps = u),
1188
+ o
1189
+ )
1190
+ })(n.Component);
1191
+ (e.default = s),
1192
+ (e.useReactToPrint = function (e) {
1193
+ if (!c) {
1194
+ return (
1195
+ e.suppressErrors ||
1174
1196
  console.error(
1175
1197
  '"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"'
1176
1198
  ),
1177
- function () {
1178
- throw new Error(
1179
- '"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"'
1180
- );
1181
- }
1182
- );
1183
- var r = n.useMemo(
1184
- function () {
1185
- return new s(t.__assign(t.__assign({}, u), e));
1186
- },
1187
- [e]
1188
- );
1189
- return n.useCallback(
1190
- function () {
1191
- return r.handleClick();
1192
- },
1193
- [r]
1194
- );
1195
- });
1196
- })(),
1197
- i
1198
- );
1199
- })();
1200
- });
1201
-
1199
+ function () {
1200
+ throw new Error(
1201
+ '"react-to-print" requires React ^16.8.0 to be able to use "useReactToPrint"'
1202
+ )
1203
+ }
1204
+ )
1205
+ }
1206
+ const r = n.useMemo(
1207
+ function () {
1208
+ return new s(t.__assign(t.__assign({}, u), e))
1209
+ },
1210
+ [e]
1211
+ )
1212
+ return n.useCallback(
1213
+ function () {
1214
+ return r.handleClick()
1215
+ },
1216
+ [r]
1217
+ )
1218
+ })
1219
+ })(),
1220
+ i
1221
+ )
1222
+ })()
1223
+ })