@adstore/templates 2.1.3 → 2.1.4
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.
- package/dist/resize-observer-e4b9a440.js +288 -0
- package/dist/style.css +1 -1627
- package/dist/templates.es.js +1934 -2713
- package/dist/templates.umd.js +5 -3595
- package/package.json +1 -1
@@ -0,0 +1,288 @@
|
|
1
|
+
var c = [], ne = function() {
|
2
|
+
return c.some(function(e) {
|
3
|
+
return e.activeTargets.length > 0;
|
4
|
+
});
|
5
|
+
}, oe = function() {
|
6
|
+
return c.some(function(e) {
|
7
|
+
return e.skippedTargets.length > 0;
|
8
|
+
});
|
9
|
+
}, P = "ResizeObserver loop completed with undelivered notifications.", se = function() {
|
10
|
+
var e;
|
11
|
+
typeof ErrorEvent == "function" ? e = new ErrorEvent("error", {
|
12
|
+
message: P
|
13
|
+
}) : (e = document.createEvent("Event"), e.initEvent("error", !1, !1), e.message = P), window.dispatchEvent(e);
|
14
|
+
}, b;
|
15
|
+
(function(e) {
|
16
|
+
e.BORDER_BOX = "border-box", e.CONTENT_BOX = "content-box", e.DEVICE_PIXEL_CONTENT_BOX = "device-pixel-content-box";
|
17
|
+
})(b || (b = {}));
|
18
|
+
var u = function(e) {
|
19
|
+
return Object.freeze(e);
|
20
|
+
}, ae = function() {
|
21
|
+
function e(t, r) {
|
22
|
+
this.inlineSize = t, this.blockSize = r, u(this);
|
23
|
+
}
|
24
|
+
return e;
|
25
|
+
}(), q = function() {
|
26
|
+
function e(t, r, i, n) {
|
27
|
+
return this.x = t, this.y = r, this.width = i, this.height = n, this.top = this.y, this.left = this.x, this.bottom = this.top + this.height, this.right = this.left + this.width, u(this);
|
28
|
+
}
|
29
|
+
return e.prototype.toJSON = function() {
|
30
|
+
var t = this, r = t.x, i = t.y, n = t.top, s = t.right, o = t.bottom, h = t.left, d = t.width, v = t.height;
|
31
|
+
return { x: r, y: i, top: n, right: s, bottom: o, left: h, width: d, height: v };
|
32
|
+
}, e.fromRect = function(t) {
|
33
|
+
return new e(t.x, t.y, t.width, t.height);
|
34
|
+
}, e;
|
35
|
+
}(), C = function(e) {
|
36
|
+
return e instanceof SVGElement && "getBBox" in e;
|
37
|
+
}, G = function(e) {
|
38
|
+
if (C(e)) {
|
39
|
+
var t = e.getBBox(), r = t.width, i = t.height;
|
40
|
+
return !r && !i;
|
41
|
+
}
|
42
|
+
var n = e, s = n.offsetWidth, o = n.offsetHeight;
|
43
|
+
return !(s || o || e.getClientRects().length);
|
44
|
+
}, I = function(e) {
|
45
|
+
var t;
|
46
|
+
if (e instanceof Element)
|
47
|
+
return !0;
|
48
|
+
var r = (t = e == null ? void 0 : e.ownerDocument) === null || t === void 0 ? void 0 : t.defaultView;
|
49
|
+
return !!(r && e instanceof r.Element);
|
50
|
+
}, ve = function(e) {
|
51
|
+
switch (e.tagName) {
|
52
|
+
case "INPUT":
|
53
|
+
if (e.type !== "image")
|
54
|
+
break;
|
55
|
+
case "VIDEO":
|
56
|
+
case "AUDIO":
|
57
|
+
case "EMBED":
|
58
|
+
case "OBJECT":
|
59
|
+
case "CANVAS":
|
60
|
+
case "IFRAME":
|
61
|
+
case "IMG":
|
62
|
+
return !0;
|
63
|
+
}
|
64
|
+
return !1;
|
65
|
+
}, p = typeof window < "u" ? window : {}, z = /* @__PURE__ */ new WeakMap(), _ = /auto|scroll/, ce = /^tb|vertical/, ue = /msie|trident/i.test(p.navigator && p.navigator.userAgent), a = function(e) {
|
66
|
+
return parseFloat(e || "0");
|
67
|
+
}, f = function(e, t, r) {
|
68
|
+
return e === void 0 && (e = 0), t === void 0 && (t = 0), r === void 0 && (r = !1), new ae((r ? t : e) || 0, (r ? e : t) || 0);
|
69
|
+
}, W = u({
|
70
|
+
devicePixelContentBoxSize: f(),
|
71
|
+
borderBoxSize: f(),
|
72
|
+
contentBoxSize: f(),
|
73
|
+
contentRect: new q(0, 0, 0, 0)
|
74
|
+
}), J = function(e, t) {
|
75
|
+
if (t === void 0 && (t = !1), z.has(e) && !t)
|
76
|
+
return z.get(e);
|
77
|
+
if (G(e))
|
78
|
+
return z.set(e, W), W;
|
79
|
+
var r = getComputedStyle(e), i = C(e) && e.ownerSVGElement && e.getBBox(), n = !ue && r.boxSizing === "border-box", s = ce.test(r.writingMode || ""), o = !i && _.test(r.overflowY || ""), h = !i && _.test(r.overflowX || ""), d = i ? 0 : a(r.paddingTop), v = i ? 0 : a(r.paddingRight), R = i ? 0 : a(r.paddingBottom), l = i ? 0 : a(r.paddingLeft), Q = i ? 0 : a(r.borderTopWidth), Z = i ? 0 : a(r.borderRightWidth), $ = i ? 0 : a(r.borderBottomWidth), j = i ? 0 : a(r.borderLeftWidth), D = l + v, k = d + R, y = j + Z, T = Q + $, N = h ? e.offsetHeight - T - e.clientHeight : 0, A = o ? e.offsetWidth - y - e.clientWidth : 0, ee = n ? D + y : 0, te = n ? k + T : 0, g = i ? i.width : a(r.width) - ee - A, x = i ? i.height : a(r.height) - te - N, re = g + D + A + y, ie = x + k + N + T, M = u({
|
80
|
+
devicePixelContentBoxSize: f(Math.round(g * devicePixelRatio), Math.round(x * devicePixelRatio), s),
|
81
|
+
borderBoxSize: f(re, ie, s),
|
82
|
+
contentBoxSize: f(g, x, s),
|
83
|
+
contentRect: new q(l, d, g, x)
|
84
|
+
});
|
85
|
+
return z.set(e, M), M;
|
86
|
+
}, U = function(e, t, r) {
|
87
|
+
var i = J(e, r), n = i.borderBoxSize, s = i.contentBoxSize, o = i.devicePixelContentBoxSize;
|
88
|
+
switch (t) {
|
89
|
+
case b.DEVICE_PIXEL_CONTENT_BOX:
|
90
|
+
return o;
|
91
|
+
case b.BORDER_BOX:
|
92
|
+
return n;
|
93
|
+
default:
|
94
|
+
return s;
|
95
|
+
}
|
96
|
+
}, he = function() {
|
97
|
+
function e(t) {
|
98
|
+
var r = J(t);
|
99
|
+
this.target = t, this.contentRect = r.contentRect, this.borderBoxSize = u([r.borderBoxSize]), this.contentBoxSize = u([r.contentBoxSize]), this.devicePixelContentBoxSize = u([r.devicePixelContentBoxSize]);
|
100
|
+
}
|
101
|
+
return e;
|
102
|
+
}(), Y = function(e) {
|
103
|
+
if (G(e))
|
104
|
+
return 1 / 0;
|
105
|
+
for (var t = 0, r = e.parentNode; r; )
|
106
|
+
t += 1, r = r.parentNode;
|
107
|
+
return t;
|
108
|
+
}, de = function() {
|
109
|
+
var e = 1 / 0, t = [];
|
110
|
+
c.forEach(function(o) {
|
111
|
+
if (o.activeTargets.length !== 0) {
|
112
|
+
var h = [];
|
113
|
+
o.activeTargets.forEach(function(v) {
|
114
|
+
var R = new he(v.target), l = Y(v.target);
|
115
|
+
h.push(R), v.lastReportedSize = U(v.target, v.observedBox), l < e && (e = l);
|
116
|
+
}), t.push(function() {
|
117
|
+
o.callback.call(o.observer, h, o.observer);
|
118
|
+
}), o.activeTargets.splice(0, o.activeTargets.length);
|
119
|
+
}
|
120
|
+
});
|
121
|
+
for (var r = 0, i = t; r < i.length; r++) {
|
122
|
+
var n = i[r];
|
123
|
+
n();
|
124
|
+
}
|
125
|
+
return e;
|
126
|
+
}, L = function(e) {
|
127
|
+
c.forEach(function(r) {
|
128
|
+
r.activeTargets.splice(0, r.activeTargets.length), r.skippedTargets.splice(0, r.skippedTargets.length), r.observationTargets.forEach(function(n) {
|
129
|
+
n.isActive() && (Y(n.target) > e ? r.activeTargets.push(n) : r.skippedTargets.push(n));
|
130
|
+
});
|
131
|
+
});
|
132
|
+
}, fe = function() {
|
133
|
+
var e = 0;
|
134
|
+
for (L(e); ne(); )
|
135
|
+
e = de(), L(e);
|
136
|
+
return oe() && se(), e > 0;
|
137
|
+
}, m, K = [], le = function() {
|
138
|
+
return K.splice(0).forEach(function(e) {
|
139
|
+
return e();
|
140
|
+
});
|
141
|
+
}, pe = function(e) {
|
142
|
+
if (!m) {
|
143
|
+
var t = 0, r = document.createTextNode(""), i = { characterData: !0 };
|
144
|
+
new MutationObserver(function() {
|
145
|
+
return le();
|
146
|
+
}).observe(r, i), m = function() {
|
147
|
+
r.textContent = "".concat(t ? t-- : t++);
|
148
|
+
};
|
149
|
+
}
|
150
|
+
K.push(e), m();
|
151
|
+
}, be = function(e) {
|
152
|
+
pe(function() {
|
153
|
+
requestAnimationFrame(e);
|
154
|
+
});
|
155
|
+
}, w = 0, ge = function() {
|
156
|
+
return !!w;
|
157
|
+
}, xe = 250, ze = { attributes: !0, characterData: !0, childList: !0, subtree: !0 }, F = [
|
158
|
+
"resize",
|
159
|
+
"load",
|
160
|
+
"transitionend",
|
161
|
+
"animationend",
|
162
|
+
"animationstart",
|
163
|
+
"animationiteration",
|
164
|
+
"keyup",
|
165
|
+
"keydown",
|
166
|
+
"mouseup",
|
167
|
+
"mousedown",
|
168
|
+
"mouseover",
|
169
|
+
"mouseout",
|
170
|
+
"blur",
|
171
|
+
"focus"
|
172
|
+
], H = function(e) {
|
173
|
+
return e === void 0 && (e = 0), Date.now() + e;
|
174
|
+
}, B = !1, Ee = function() {
|
175
|
+
function e() {
|
176
|
+
var t = this;
|
177
|
+
this.stopped = !0, this.listener = function() {
|
178
|
+
return t.schedule();
|
179
|
+
};
|
180
|
+
}
|
181
|
+
return e.prototype.run = function(t) {
|
182
|
+
var r = this;
|
183
|
+
if (t === void 0 && (t = xe), !B) {
|
184
|
+
B = !0;
|
185
|
+
var i = H(t);
|
186
|
+
be(function() {
|
187
|
+
var n = !1;
|
188
|
+
try {
|
189
|
+
n = fe();
|
190
|
+
} finally {
|
191
|
+
if (B = !1, t = i - H(), !ge())
|
192
|
+
return;
|
193
|
+
n ? r.run(1e3) : t > 0 ? r.run(t) : r.start();
|
194
|
+
}
|
195
|
+
});
|
196
|
+
}
|
197
|
+
}, e.prototype.schedule = function() {
|
198
|
+
this.stop(), this.run();
|
199
|
+
}, e.prototype.observe = function() {
|
200
|
+
var t = this, r = function() {
|
201
|
+
return t.observer && t.observer.observe(document.body, ze);
|
202
|
+
};
|
203
|
+
document.body ? r() : p.addEventListener("DOMContentLoaded", r);
|
204
|
+
}, e.prototype.start = function() {
|
205
|
+
var t = this;
|
206
|
+
this.stopped && (this.stopped = !1, this.observer = new MutationObserver(this.listener), this.observe(), F.forEach(function(r) {
|
207
|
+
return p.addEventListener(r, t.listener, !0);
|
208
|
+
}));
|
209
|
+
}, e.prototype.stop = function() {
|
210
|
+
var t = this;
|
211
|
+
this.stopped || (this.observer && this.observer.disconnect(), F.forEach(function(r) {
|
212
|
+
return p.removeEventListener(r, t.listener, !0);
|
213
|
+
}), this.stopped = !0);
|
214
|
+
}, e;
|
215
|
+
}(), S = new Ee(), V = function(e) {
|
216
|
+
!w && e > 0 && S.start(), w += e, !w && S.stop();
|
217
|
+
}, Oe = function(e) {
|
218
|
+
return !C(e) && !ve(e) && getComputedStyle(e).display === "inline";
|
219
|
+
}, we = function() {
|
220
|
+
function e(t, r) {
|
221
|
+
this.target = t, this.observedBox = r || b.CONTENT_BOX, this.lastReportedSize = {
|
222
|
+
inlineSize: 0,
|
223
|
+
blockSize: 0
|
224
|
+
};
|
225
|
+
}
|
226
|
+
return e.prototype.isActive = function() {
|
227
|
+
var t = U(this.target, this.observedBox, !0);
|
228
|
+
return Oe(this.target) && (this.lastReportedSize = t), this.lastReportedSize.inlineSize !== t.inlineSize || this.lastReportedSize.blockSize !== t.blockSize;
|
229
|
+
}, e;
|
230
|
+
}(), Re = function() {
|
231
|
+
function e(t, r) {
|
232
|
+
this.activeTargets = [], this.skippedTargets = [], this.observationTargets = [], this.observer = t, this.callback = r;
|
233
|
+
}
|
234
|
+
return e;
|
235
|
+
}(), E = /* @__PURE__ */ new WeakMap(), X = function(e, t) {
|
236
|
+
for (var r = 0; r < e.length; r += 1)
|
237
|
+
if (e[r].target === t)
|
238
|
+
return r;
|
239
|
+
return -1;
|
240
|
+
}, O = function() {
|
241
|
+
function e() {
|
242
|
+
}
|
243
|
+
return e.connect = function(t, r) {
|
244
|
+
var i = new Re(t, r);
|
245
|
+
E.set(t, i);
|
246
|
+
}, e.observe = function(t, r, i) {
|
247
|
+
var n = E.get(t), s = n.observationTargets.length === 0;
|
248
|
+
X(n.observationTargets, r) < 0 && (s && c.push(n), n.observationTargets.push(new we(r, i && i.box)), V(1), S.schedule());
|
249
|
+
}, e.unobserve = function(t, r) {
|
250
|
+
var i = E.get(t), n = X(i.observationTargets, r), s = i.observationTargets.length === 1;
|
251
|
+
n >= 0 && (s && c.splice(c.indexOf(i), 1), i.observationTargets.splice(n, 1), V(-1));
|
252
|
+
}, e.disconnect = function(t) {
|
253
|
+
var r = this, i = E.get(t);
|
254
|
+
i.observationTargets.slice().forEach(function(n) {
|
255
|
+
return r.unobserve(t, n.target);
|
256
|
+
}), i.activeTargets.splice(0, i.activeTargets.length);
|
257
|
+
}, e;
|
258
|
+
}(), ye = function() {
|
259
|
+
function e(t) {
|
260
|
+
if (arguments.length === 0)
|
261
|
+
throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");
|
262
|
+
if (typeof t != "function")
|
263
|
+
throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");
|
264
|
+
O.connect(this, t);
|
265
|
+
}
|
266
|
+
return e.prototype.observe = function(t, r) {
|
267
|
+
if (arguments.length === 0)
|
268
|
+
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
269
|
+
if (!I(t))
|
270
|
+
throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
271
|
+
O.observe(this, t, r);
|
272
|
+
}, e.prototype.unobserve = function(t) {
|
273
|
+
if (arguments.length === 0)
|
274
|
+
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");
|
275
|
+
if (!I(t))
|
276
|
+
throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");
|
277
|
+
O.unobserve(this, t);
|
278
|
+
}, e.prototype.disconnect = function() {
|
279
|
+
O.disconnect(this);
|
280
|
+
}, e.toString = function() {
|
281
|
+
return "function ResizeObserver () { [polyfill code] }";
|
282
|
+
}, e;
|
283
|
+
}();
|
284
|
+
export {
|
285
|
+
ye as ResizeObserver,
|
286
|
+
he as ResizeObserverEntry,
|
287
|
+
ae as ResizeObserverSize
|
288
|
+
};
|