1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', { value: true });
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | const CONTENT_REF_ID = 'r';
|
9 | const ORG_LOCATION_ID = 'o';
|
10 | const SLOT_NODE_ID = 's';
|
11 | const TEXT_NODE_ID = 't';
|
12 | const XLINK_NS = 'http://www.w3.org/1999/xlink';
|
13 |
|
14 | const attrHandler = {
|
15 | get(obj, prop) {
|
16 | if (prop in obj) {
|
17 | return obj[prop];
|
18 | }
|
19 | if (typeof prop !== 'symbol' && !isNaN(prop)) {
|
20 | return obj.__items[prop];
|
21 | }
|
22 | return undefined;
|
23 | },
|
24 | };
|
25 | const createAttributeProxy = (caseInsensitive) => new Proxy(new MockAttributeMap(caseInsensitive), attrHandler);
|
26 | class MockAttributeMap {
|
27 | constructor(caseInsensitive = false) {
|
28 | this.caseInsensitive = caseInsensitive;
|
29 | this.__items = [];
|
30 | }
|
31 | get length() {
|
32 | return this.__items.length;
|
33 | }
|
34 | item(index) {
|
35 | return this.__items[index] || null;
|
36 | }
|
37 | setNamedItem(attr) {
|
38 | attr.namespaceURI = null;
|
39 | this.setNamedItemNS(attr);
|
40 | }
|
41 | setNamedItemNS(attr) {
|
42 | if (attr != null && attr.value != null) {
|
43 | attr.value = String(attr.value);
|
44 | }
|
45 | const existingAttr = this.__items.find(a => a.name === attr.name && a.namespaceURI === attr.namespaceURI);
|
46 | if (existingAttr != null) {
|
47 | existingAttr.value = attr.value;
|
48 | }
|
49 | else {
|
50 | this.__items.push(attr);
|
51 | }
|
52 | }
|
53 | getNamedItem(attrName) {
|
54 | if (this.caseInsensitive) {
|
55 | attrName = attrName.toLowerCase();
|
56 | }
|
57 | return this.getNamedItemNS(null, attrName);
|
58 | }
|
59 | getNamedItemNS(namespaceURI, attrName) {
|
60 | namespaceURI = getNamespaceURI(namespaceURI);
|
61 | return (this.__items.find(attr => attr.name === attrName && getNamespaceURI(attr.namespaceURI) === namespaceURI) || null);
|
62 | }
|
63 | removeNamedItem(attr) {
|
64 | this.removeNamedItemNS(attr);
|
65 | }
|
66 | removeNamedItemNS(attr) {
|
67 | for (let i = 0, ii = this.__items.length; i < ii; i++) {
|
68 | if (this.__items[i].name === attr.name && this.__items[i].namespaceURI === attr.namespaceURI) {
|
69 | this.__items.splice(i, 1);
|
70 | break;
|
71 | }
|
72 | }
|
73 | }
|
74 | [Symbol.iterator]() {
|
75 | let i = 0;
|
76 | return {
|
77 | next: () => ({
|
78 | done: i === this.length,
|
79 | value: this.item(i++),
|
80 | }),
|
81 | };
|
82 | }
|
83 | get [Symbol.toStringTag]() {
|
84 | return 'MockAttributeMap';
|
85 | }
|
86 | }
|
87 | function getNamespaceURI(namespaceURI) {
|
88 | return namespaceURI === XLINK_NS ? null : namespaceURI;
|
89 | }
|
90 | function cloneAttributes(srcAttrs, sortByName = false) {
|
91 | const dstAttrs = new MockAttributeMap(srcAttrs.caseInsensitive);
|
92 | if (srcAttrs != null) {
|
93 | const attrLen = srcAttrs.length;
|
94 | if (sortByName && attrLen > 1) {
|
95 | const sortedAttrs = [];
|
96 | for (let i = 0; i < attrLen; i++) {
|
97 | const srcAttr = srcAttrs.item(i);
|
98 | const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
|
99 | sortedAttrs.push(dstAttr);
|
100 | }
|
101 | sortedAttrs.sort(sortAttributes).forEach(attr => {
|
102 | dstAttrs.setNamedItemNS(attr);
|
103 | });
|
104 | }
|
105 | else {
|
106 | for (let i = 0; i < attrLen; i++) {
|
107 | const srcAttr = srcAttrs.item(i);
|
108 | const dstAttr = new MockAttr(srcAttr.name, srcAttr.value, srcAttr.namespaceURI);
|
109 | dstAttrs.setNamedItemNS(dstAttr);
|
110 | }
|
111 | }
|
112 | }
|
113 | return dstAttrs;
|
114 | }
|
115 | function sortAttributes(a, b) {
|
116 | if (a.name < b.name)
|
117 | return -1;
|
118 | if (a.name > b.name)
|
119 | return 1;
|
120 | return 0;
|
121 | }
|
122 | class MockAttr {
|
123 | constructor(attrName, attrValue, namespaceURI = null) {
|
124 | this._name = attrName;
|
125 | this._value = String(attrValue);
|
126 | this._namespaceURI = namespaceURI;
|
127 | }
|
128 | get name() {
|
129 | return this._name;
|
130 | }
|
131 | set name(value) {
|
132 | this._name = value;
|
133 | }
|
134 | get value() {
|
135 | return this._value;
|
136 | }
|
137 | set value(value) {
|
138 | this._value = String(value);
|
139 | }
|
140 | get nodeName() {
|
141 | return this._name;
|
142 | }
|
143 | set nodeName(value) {
|
144 | this._name = value;
|
145 | }
|
146 | get nodeValue() {
|
147 | return this._value;
|
148 | }
|
149 | set nodeValue(value) {
|
150 | this._value = String(value);
|
151 | }
|
152 | get namespaceURI() {
|
153 | return this._namespaceURI;
|
154 | }
|
155 | set namespaceURI(namespaceURI) {
|
156 | this._namespaceURI = namespaceURI;
|
157 | }
|
158 | }
|
159 |
|
160 | class MockCustomElementRegistry {
|
161 | constructor(win) {
|
162 | this.win = win;
|
163 | }
|
164 | define(tagName, cstr, options) {
|
165 | if (tagName.toLowerCase() !== tagName) {
|
166 | throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': "${tagName}" is not a valid custom element name`);
|
167 | }
|
168 | if (this.__registry == null) {
|
169 | this.__registry = new Map();
|
170 | }
|
171 | this.__registry.set(tagName, { cstr, options });
|
172 | if (this.__whenDefined != null) {
|
173 | const whenDefinedResolveFns = this.__whenDefined.get(tagName);
|
174 | if (whenDefinedResolveFns != null) {
|
175 | whenDefinedResolveFns.forEach(whenDefinedResolveFn => {
|
176 | whenDefinedResolveFn();
|
177 | });
|
178 | whenDefinedResolveFns.length = 0;
|
179 | this.__whenDefined.delete(tagName);
|
180 | }
|
181 | }
|
182 | const doc = this.win.document;
|
183 | if (doc != null) {
|
184 | const hosts = doc.querySelectorAll(tagName);
|
185 | hosts.forEach(host => {
|
186 | if (upgradedElements.has(host) === false) {
|
187 | tempDisableCallbacks.add(doc);
|
188 | const upgradedCmp = createCustomElement(this, doc, tagName);
|
189 | for (let i = 0; i < host.childNodes.length; i++) {
|
190 | const childNode = host.childNodes[i];
|
191 | childNode.remove();
|
192 | upgradedCmp.appendChild(childNode);
|
193 | }
|
194 | tempDisableCallbacks.delete(doc);
|
195 | if (proxyElements.has(host)) {
|
196 | proxyElements.set(host, upgradedCmp);
|
197 | }
|
198 | }
|
199 | fireConnectedCallback(host);
|
200 | });
|
201 | }
|
202 | }
|
203 | get(tagName) {
|
204 | if (this.__registry != null) {
|
205 | const def = this.__registry.get(tagName.toLowerCase());
|
206 | if (def != null) {
|
207 | return def.cstr;
|
208 | }
|
209 | }
|
210 | return undefined;
|
211 | }
|
212 | upgrade(_rootNode) {
|
213 |
|
214 | }
|
215 | clear() {
|
216 | if (this.__registry != null) {
|
217 | this.__registry.clear();
|
218 | }
|
219 | if (this.__whenDefined != null) {
|
220 | this.__whenDefined.clear();
|
221 | }
|
222 | }
|
223 | whenDefined(tagName) {
|
224 | tagName = tagName.toLowerCase();
|
225 | if (this.__registry != null && this.__registry.has(tagName) === true) {
|
226 | return Promise.resolve();
|
227 | }
|
228 | return new Promise(resolve => {
|
229 | if (this.__whenDefined == null) {
|
230 | this.__whenDefined = new Map();
|
231 | }
|
232 | let whenDefinedResolveFns = this.__whenDefined.get(tagName);
|
233 | if (whenDefinedResolveFns == null) {
|
234 | whenDefinedResolveFns = [];
|
235 | this.__whenDefined.set(tagName, whenDefinedResolveFns);
|
236 | }
|
237 | whenDefinedResolveFns.push(resolve);
|
238 | });
|
239 | }
|
240 | }
|
241 | function createCustomElement(customElements, ownerDocument, tagName) {
|
242 | const Cstr = customElements.get(tagName);
|
243 | if (Cstr != null) {
|
244 | const cmp = new Cstr(ownerDocument);
|
245 | cmp.nodeName = tagName.toUpperCase();
|
246 | upgradedElements.add(cmp);
|
247 | return cmp;
|
248 | }
|
249 | const host = new Proxy({}, {
|
250 | get(obj, prop) {
|
251 | const elm = proxyElements.get(host);
|
252 | if (elm != null) {
|
253 | return elm[prop];
|
254 | }
|
255 | return obj[prop];
|
256 | },
|
257 | set(obj, prop, val) {
|
258 | const elm = proxyElements.get(host);
|
259 | if (elm != null) {
|
260 | elm[prop] = val;
|
261 | }
|
262 | else {
|
263 | obj[prop] = val;
|
264 | }
|
265 | return true;
|
266 | },
|
267 | has(obj, prop) {
|
268 | const elm = proxyElements.get(host);
|
269 | if (prop in elm) {
|
270 | return true;
|
271 | }
|
272 | if (prop in obj) {
|
273 | return true;
|
274 | }
|
275 | return false;
|
276 | },
|
277 | });
|
278 | const elm = new MockHTMLElement(ownerDocument, tagName);
|
279 | proxyElements.set(host, elm);
|
280 | return host;
|
281 | }
|
282 | const proxyElements = new WeakMap();
|
283 | const upgradedElements = new WeakSet();
|
284 | function connectNode(ownerDocument, node) {
|
285 | node.ownerDocument = ownerDocument;
|
286 | if (node.nodeType === 1 ) {
|
287 | if (ownerDocument != null && node.nodeName.includes('-')) {
|
288 | const win = ownerDocument.defaultView;
|
289 | if (win != null && typeof node.connectedCallback === 'function' && node.isConnected) {
|
290 | fireConnectedCallback(node);
|
291 | }
|
292 | const shadowRoot = node.shadowRoot;
|
293 | if (shadowRoot != null) {
|
294 | shadowRoot.childNodes.forEach(childNode => {
|
295 | connectNode(ownerDocument, childNode);
|
296 | });
|
297 | }
|
298 | }
|
299 | node.childNodes.forEach(childNode => {
|
300 | connectNode(ownerDocument, childNode);
|
301 | });
|
302 | }
|
303 | else {
|
304 | node.childNodes.forEach(childNode => {
|
305 | childNode.ownerDocument = ownerDocument;
|
306 | });
|
307 | }
|
308 | }
|
309 | function fireConnectedCallback(node) {
|
310 | if (typeof node.connectedCallback === 'function') {
|
311 | if (tempDisableCallbacks.has(node.ownerDocument) === false) {
|
312 | try {
|
313 | node.connectedCallback();
|
314 | }
|
315 | catch (e) {
|
316 | console.error(e);
|
317 | }
|
318 | }
|
319 | }
|
320 | }
|
321 | function disconnectNode(node) {
|
322 | if (node.nodeType === 1 ) {
|
323 | if (node.nodeName.includes('-') === true && typeof node.disconnectedCallback === 'function') {
|
324 | if (tempDisableCallbacks.has(node.ownerDocument) === false) {
|
325 | try {
|
326 | node.disconnectedCallback();
|
327 | }
|
328 | catch (e) {
|
329 | console.error(e);
|
330 | }
|
331 | }
|
332 | }
|
333 | node.childNodes.forEach(disconnectNode);
|
334 | }
|
335 | }
|
336 | function attributeChanged(node, attrName, oldValue, newValue) {
|
337 | attrName = attrName.toLowerCase();
|
338 | const observedAttributes = node.constructor.observedAttributes;
|
339 | if (Array.isArray(observedAttributes) === true && observedAttributes.some(obs => obs.toLowerCase() === attrName) === true) {
|
340 | try {
|
341 | node.attributeChangedCallback(attrName, oldValue, newValue);
|
342 | }
|
343 | catch (e) {
|
344 | console.error(e);
|
345 | }
|
346 | }
|
347 | }
|
348 | function checkAttributeChanged(node) {
|
349 | return node.nodeName.includes('-') === true && typeof node.attributeChangedCallback === 'function';
|
350 | }
|
351 | const tempDisableCallbacks = new Set();
|
352 |
|
353 | function dataset(elm) {
|
354 | const ds = {};
|
355 | const attributes = elm.attributes;
|
356 | const attrLen = attributes.length;
|
357 | for (let i = 0; i < attrLen; i++) {
|
358 | const attr = attributes.item(i);
|
359 | const nodeName = attr.nodeName;
|
360 | if (nodeName.startsWith('data-')) {
|
361 | ds[dashToPascalCase(nodeName)] = attr.nodeValue;
|
362 | }
|
363 | }
|
364 | return new Proxy(ds, {
|
365 | get(_obj, camelCaseProp) {
|
366 | return ds[camelCaseProp];
|
367 | },
|
368 | set(_obj, camelCaseProp, value) {
|
369 | const dataAttr = toDataAttribute(camelCaseProp);
|
370 | elm.setAttribute(dataAttr, value);
|
371 | return true;
|
372 | },
|
373 | });
|
374 | }
|
375 | function toDataAttribute(str) {
|
376 | return ('data-' +
|
377 | String(str)
|
378 | .replace(/([A-Z0-9])/g, g => ' ' + g[0])
|
379 | .trim()
|
380 | .replace(/ /g, '-')
|
381 | .toLowerCase());
|
382 | }
|
383 | function dashToPascalCase(str) {
|
384 | str = String(str).substr(5);
|
385 | return str
|
386 | .split('-')
|
387 | .map((segment, index) => {
|
388 | if (index === 0) {
|
389 | return segment.charAt(0).toLowerCase() + segment.slice(1);
|
390 | }
|
391 | return segment.charAt(0).toUpperCase() + segment.slice(1);
|
392 | })
|
393 | .join('');
|
394 | }
|
395 |
|
396 |
|
397 | const Sizzle = (function() {
|
398 | const window = {
|
399 | document: {
|
400 | createElement() {
|
401 | return {};
|
402 | },
|
403 | nodeType: 9,
|
404 | documentElement: {
|
405 | nodeType: 1,
|
406 | nodeName: 'HTML'
|
407 | }
|
408 | }
|
409 | };
|
410 | const module = { exports: {} };
|
411 |
|
412 |
|
413 | !function(e){var t,n,r,i,o,u,l,a,c,s,d,f,p,h,g,m,y,v,w,b="sizzle"+1*new Date,N=e.document,C=0,x=0,E=ae(),A=ae(),S=ae(),D=ae(),T=function(e,t){return e===t&&(d=!0),0},L={}.hasOwnProperty,q=[],I=q.pop,B=q.push,R=q.push,$=q.slice,k=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return -1},H="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",P="(?:\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",z="\\["+M+"*("+P+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+P+"))|)"+M+"*\\]",F=":("+P+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+z+")*)|.*)\\)|)",O=new RegExp(M+"+","g"),j=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),G=new RegExp("^"+M+"*,"+M+"*"),U=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),V=new RegExp(M+"|>"),X=new RegExp(F),J=new RegExp("^"+P+"$"),K={ID:new RegExp("^#("+P+")"),CLASS:new RegExp("^\\.("+P+")"),TAG:new RegExp("^("+P+"|[*])"),ATTR:new RegExp("^"+z),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+H+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/HTML$/i,W=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){f();},ue=ve(function(e){return !0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{R.apply(q=$.call(N.childNodes),N.childNodes),q[N.childNodes.length].nodeType;}catch(e){R={apply:q.length?function(e,t){B.apply(e,$.call(t));}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1;}};}function le(e,t,r,i){var o,l,c,s,d,h,y,v=t&&t.ownerDocument,N=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==N&&9!==N&&11!==N)return r;if(!i&&(f(t),t=t||p,g)){if(11!==N&&(d=_.exec(e)))if(o=d[1]){if(9===N){if(!(c=t.getElementById(o)))return r;if(c.id===o)return r.push(c),r}else if(v&&(c=v.getElementById(o))&&w(t,c)&&c.id===o)return r.push(c),r}else {if(d[2])return R.apply(r,t.getElementsByTagName(e)),r;if((o=d[3])&&n.getElementsByClassName&&t.getElementsByClassName)return R.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!D[e+" "]&&(!m||!m.test(e))&&(1!==N||"object"!==t.nodeName.toLowerCase())){if(y=e,v=t,1===N&&(V.test(e)||U.test(e))){(v=ee.test(e)&&ge(t.parentNode)||t)===t&&n.scope||((s=t.getAttribute("id"))?s=s.replace(re,ie):t.setAttribute("id",s=b)),l=(h=u(e)).length;while(l--)h[l]=(s?"#"+s:":scope")+" "+ye(h[l]);y=h.join(",");}try{return R.apply(r,v.querySelectorAll(y)),r}catch(t){D(e,!0);}finally{s===b&&t.removeAttribute("id");}}}return a(e.replace(j,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function ce(e){return e[b]=!0,e}function se(e){var t=p.createElement("fieldset");try{return !!e(t)}catch(e){return !1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null;}}function de(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t;}function fe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return -1;return e?1:-1}function pe(e){return function(t){return "form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ue(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return ce(function(t){return t=+t,ce(function(n,r){var i,o=e([],n.length,t),u=o.length;while(u--)n[i=o[u]]&&(n[i]=!(r[i]=n[i]));})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}n=le.support={},o=le.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return !Q.test(t||n&&n.nodeName||"HTML")},f=le.setDocument=function(e){var t,i,u=e?e.ownerDocument||e:N;return u!=p&&9===u.nodeType&&u.documentElement?(p=u,h=p.documentElement,g=!o(p),N!=p&&(i=p.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",oe,!1):i.attachEvent&&i.attachEvent("onunload",oe)),n.scope=se(function(e){return h.appendChild(e).appendChild(p.createElement("div")),void 0!==e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),n.attributes=se(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=se(function(e){return e.appendChild(p.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Z.test(p.getElementsByClassName),n.getById=se(function(e){return h.appendChild(e).id=b,!p.getElementsByName||!p.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(te,ne);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return [o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return [o]}return []}}),r.find.TAG=n.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&g)return t.getElementsByClassName(e)},y=[],m=[],(n.qsa=Z.test(p.querySelectorAll))&&(se(function(e){var t;h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&m.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||m.push("\\["+M+"*(?:value|"+H+")"),e.querySelectorAll("[id~="+b+"-]").length||m.push("~="),(t=p.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||m.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||m.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||m.push(".#.+[+~]"),e.querySelectorAll("\\\f"),m.push("[\\r\\n\\f]");}),se(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=p.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&m.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&m.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&m.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),m.push(",.*:");})),(n.matchesSelector=Z.test(v=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&se(function(e){n.disconnectedMatch=v.call(e,"*"),v.call(e,"[s!='']:x"),y.push("!=",F);}),m=m.length&&new RegExp(m.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(h.compareDocumentPosition),w=t||Z.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return !0;return !1},T=t?function(e,t){if(e===t)return d=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e==p||e.ownerDocument==N&&w(N,e)?-1:t==p||t.ownerDocument==N&&w(N,t)?1:s?k(s,e)-k(s,t):0:4&r?-1:1)}:function(e,t){if(e===t)return d=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,u=[e],l=[t];if(!i||!o)return e==p?-1:t==p?1:i?-1:o?1:s?k(s,e)-k(s,t):0;if(i===o)return fe(e,t);n=e;while(n=n.parentNode)u.unshift(n);n=t;while(n=n.parentNode)l.unshift(n);while(u[r]===l[r])r++;return r?fe(u[r],l[r]):u[r]==N?-1:l[r]==N?1:0},p):p},le.matches=function(e,t){return le(e,null,null,t)},le.matchesSelector=function(e,t){if(f(e),n.matchesSelector&&g&&!D[t+" "]&&(!y||!y.test(t))&&(!m||!m.test(t)))try{var r=v.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){D(t,!0);}return le(t,p,null,[e]).length>0},le.contains=function(e,t){return (e.ownerDocument||e)!=p&&f(e),w(e,t)},le.attr=function(e,t){(e.ownerDocument||e)!=p&&f(e);var i=r.attrHandle[t.toLowerCase()],o=i&&L.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},le.escape=function(e){return (e+"").replace(re,ie)},le.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},le.uniqueSort=function(e){var t,r=[],i=0,o=0;if(d=!n.detectDuplicates,s=!n.sortStable&&e.slice(0),e.sort(T),d){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1);}return s=null,e},i=le.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e);}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=le.selectors={cacheLength:50,createPseudo:ce,match:K,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||le.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&le.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return K.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return "*"===e?function(){return !0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=le.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(O," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),u="last"!==e.slice(-4),l="of-type"===t;return 1===r&&0===i?function(e){return !!e.parentNode}:function(t,n,a){var c,s,d,f,p,h,g=o!==u?"nextSibling":"previousSibling",m=t.parentNode,y=l&&t.nodeName.toLowerCase(),v=!a&&!l,w=!1;if(m){if(o){while(g){f=t;while(f=f[g])if(l?f.nodeName.toLowerCase()===y:1===f.nodeType)return !1;h=g="only"===e&&!h&&"nextSibling";}return !0}if(h=[u?m.firstChild:m.lastChild],u&&v){w=(p=(c=(s=(d=(f=m)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===C&&c[1])&&c[2],f=p&&m.childNodes[p];while(f=++p&&f&&f[g]||(w=p=0)||h.pop())if(1===f.nodeType&&++w&&f===t){s[e]=[C,p,w];break}}else if(v&&(w=p=(c=(s=(d=(f=t)[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]||[])[0]===C&&c[1]),!1===w)while(f=++p&&f&&f[g]||(w=p=0)||h.pop())if((l?f.nodeName.toLowerCase()===y:1===f.nodeType)&&++w&&(v&&((s=(d=f[b]||(f[b]={}))[f.uniqueID]||(d[f.uniqueID]={}))[e]=[C,w]),f===t))break;return (w-=i)===r||w%r==0&&w/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||le.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?ce(function(e,n){var r,o=i(e,t),u=o.length;while(u--)e[r=k(e,o[u])]=!(n[r]=o[u]);}):function(e){return i(e,0,n)}):i}},pseudos:{not:ce(function(e){var t=[],n=[],r=l(e.replace(j,"$1"));return r[b]?ce(function(e,t,n,i){var o,u=r(e,null,i,[]),l=e.length;while(l--)(o=u[l])&&(e[l]=!(t[l]=o));}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:ce(function(e){return function(t){return le(e,t).length>0}}),contains:ce(function(e){return e=e.replace(te,ne),function(t){return (t.textContent||i(t)).indexOf(e)>-1}}),lang:ce(function(e){return J.test(e||"")||le.error("unsupported lang: "+e),e=e.replace(te,ne).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return (n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return !1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:pe(!1),disabled:pe(!0),checked:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return !1;return !0},parent:function(e){return !r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return W.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return "input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return "input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return [0]}),last:he(function(e,t){return [t-1]}),eq:he(function(e,t,n){return [n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in {radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=function(e){return function(t){return "input"===t.nodeName.toLowerCase()&&t.type===e}}(t);for(t in {submit:!0,reset:!0})r.pseudos[t]=function(e){return function(t){var n=t.nodeName.toLowerCase();return ("input"===n||"button"===n)&&t.type===e}}(t);function me(){}me.prototype=r.filters=r.pseudos,r.setFilters=new me,u=le.tokenize=function(e,t){var n,i,o,u,l,a,c,s=A[e+" "];if(s)return t?0:s.slice(0);l=e,a=[],c=r.preFilter;while(l){n&&!(i=G.exec(l))||(i&&(l=l.slice(i[0].length)||l),a.push(o=[])),n=!1,(i=U.exec(l))&&(n=i.shift(),o.push({value:n,type:i[0].replace(j," ")}),l=l.slice(n.length));for(u in r.filter)!(i=K[u].exec(l))||c[u]&&!(i=c[u](i))||(n=i.shift(),o.push({value:n,type:u,matches:i}),l=l.slice(n.length));if(!n)break}return t?l.length:l?le.error(e):A(e,a).slice(0)};function ye(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function ve(e,t,n){var r=t.dir,i=t.next,o=i||r,u=n&&"parentNode"===o,l=x++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||u)return e(t,n,i);return !1}:function(t,n,a){var c,s,d,f=[C,l];if(a){while(t=t[r])if((1===t.nodeType||u)&&e(t,n,a))return !0}else while(t=t[r])if(1===t.nodeType||u)if(d=t[b]||(t[b]={}),s=d[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else {if((c=s[o])&&c[0]===C&&c[1]===l)return f[2]=c[2];if(s[o]=f,f[2]=e(t,n,a))return !0}return !1}}function we(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return !1;return !0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)le(e,t[r],n);return n}function Ne(e,t,n,r,i){for(var o,u=[],l=0,a=e.length,c=null!=t;l<a;l++)(o=e[l])&&(n&&!n(o,r,i)||(u.push(o),c&&t.push(l)));return u}function Ce(e,t,n,r,i,o){return r&&!r[b]&&(r=Ce(r)),i&&!i[b]&&(i=Ce(i,o)),ce(function(o,u,l,a){var c,s,d,f=[],p=[],h=u.length,g=o||be(t||"*",l.nodeType?[l]:l,[]),m=!e||!o&&t?g:Ne(g,f,e,l,a),y=n?i||(o?e:h||r)?[]:u:m;if(n&&n(m,y,l,a),r){c=Ne(y,p),r(c,[],l,a),s=c.length;while(s--)(d=c[s])&&(y[p[s]]=!(m[p[s]]=d));}if(o){if(i||e){if(i){c=[],s=y.length;while(s--)(d=y[s])&&c.push(m[s]=d);i(null,y=[],c,a);}s=y.length;while(s--)(d=y[s])&&(c=i?k(o,d):f[s])>-1&&(o[c]=!(u[c]=d));}}else y=Ne(y===u?y.splice(h,y.length):y),i?i(null,u,y,a):R.apply(u,y);})}function xe(e){for(var t,n,i,o=e.length,u=r.relative[e[0].type],l=u||r.relative[" "],a=u?1:0,s=ve(function(e){return e===t},l,!0),d=ve(function(e){return k(t,e)>-1},l,!0),f=[function(e,n,r){var i=!u&&(r||n!==c)||((t=n).nodeType?s(e,n,r):d(e,n,r));return t=null,i}];a<o;a++)if(n=r.relative[e[a].type])f=[ve(we(f),n)];else {if((n=r.filter[e[a].type].apply(null,e[a].matches))[b]){for(i=++a;i<o;i++)if(r.relative[e[i].type])break;return Ce(a>1&&we(f),a>1&&ye(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(j,"$1"),n,a<i&&xe(e.slice(a,i)),i<o&&xe(e=e.slice(i)),i<o&&ye(e))}f.push(n);}return we(f)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,u,l,a,s){var d,h,m,y=0,v="0",w=o&&[],b=[],N=c,x=o||i&&r.find.TAG("*",s),E=C+=null==N?1:Math.random()||.1,A=x.length;for(s&&(c=u==p||u||s);v!==A&&null!=(d=x[v]);v++){if(i&&d){h=0,u||d.ownerDocument==p||(f(d),l=!g);while(m=e[h++])if(m(d,u||p,l)){a.push(d);break}s&&(C=E);}n&&((d=!m&&d)&&y--,o&&w.push(d));}if(y+=v,n&&v!==y){h=0;while(m=t[h++])m(w,b,u,l);if(o){if(y>0)while(v--)w[v]||b[v]||(b[v]=I.call(a));b=Ne(b);}R.apply(a,b),s&&!o&&b.length>0&&y+t.length>1&&le.uniqueSort(a);}return s&&(C=E,c=N),w};return n?ce(o):o}l=le.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=u(e)),n=t.length;while(n--)(o=xe(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e;}return o},a=le.select=function(e,t,n,i){var o,a,c,s,d,f="function"==typeof e&&e,p=!i&&u(e=f.selector||e);if(n=n||[],1===p.length){if((a=p[0]=p[0].slice(0)).length>2&&"ID"===(c=a[0]).type&&9===t.nodeType&&g&&r.relative[a[1].type]){if(!(t=(r.find.ID(c.matches[0].replace(te,ne),t)||[])[0]))return n;f&&(t=t.parentNode),e=e.slice(a.shift().value.length);}o=K.needsContext.test(e)?0:a.length;while(o--){if(c=a[o],r.relative[s=c.type])break;if((d=r.find[s])&&(i=d(c.matches[0].replace(te,ne),ee.test(a[0].type)&&ge(t.parentNode)||t))){if(a.splice(o,1),!(e=i.length&&ye(a)))return R.apply(n,i),n;break}}}return (f||l(e,p))(i,t,!g,n,!t||ee.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(T).join("")===b,n.detectDuplicates=!!d,f(),n.sortDetached=se(function(e){return 1&e.compareDocumentPosition(p.createElement("fieldset"))}),se(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||de("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&se(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||de("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),se(function(e){return null==e.getAttribute("disabled")})||de(H,function(e,t,n){var r;if(!n)return !0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null});var Ae=e.Sizzle;le.noConflict=function(){return e.Sizzle===le&&(e.Sizzle=Ae),le},"function"==typeof define&&define.amd?define(function(){return le}):"undefined"!=typeof module&&module.exports?module.exports=le:e.Sizzle=le;}(window);
|
414 |
|
415 |
|
416 | return module.exports;
|
417 | })();
|
418 |
|
419 | function matches(selector, elm) {
|
420 | const r = Sizzle.matches(selector, [elm]);
|
421 | return r.length > 0;
|
422 | }
|
423 | function selectOne(selector, elm) {
|
424 | const r = Sizzle(selector, elm);
|
425 | return r[0] || null;
|
426 | }
|
427 | function selectAll(selector, elm) {
|
428 | return Sizzle(selector, elm);
|
429 | }
|
430 |
|
431 | class MockClassList {
|
432 | constructor(elm) {
|
433 | this.elm = elm;
|
434 | }
|
435 | add(...classNames) {
|
436 | const clsNames = getItems(this.elm);
|
437 | let updated = false;
|
438 | classNames.forEach(className => {
|
439 | className = String(className);
|
440 | validateClass(className);
|
441 | if (clsNames.includes(className) === false) {
|
442 | clsNames.push(className);
|
443 | updated = true;
|
444 | }
|
445 | });
|
446 | if (updated) {
|
447 | this.elm.setAttributeNS(null, 'class', clsNames.join(' '));
|
448 | }
|
449 | }
|
450 | remove(...classNames) {
|
451 | const clsNames = getItems(this.elm);
|
452 | let updated = false;
|
453 | classNames.forEach(className => {
|
454 | className = String(className);
|
455 | validateClass(className);
|
456 | const index = clsNames.indexOf(className);
|
457 | if (index > -1) {
|
458 | clsNames.splice(index, 1);
|
459 | updated = true;
|
460 | }
|
461 | });
|
462 | if (updated) {
|
463 | this.elm.setAttributeNS(null, 'class', clsNames.filter(c => c.length > 0).join(' '));
|
464 | }
|
465 | }
|
466 | contains(className) {
|
467 | className = String(className);
|
468 | return getItems(this.elm).includes(className);
|
469 | }
|
470 | toggle(className) {
|
471 | className = String(className);
|
472 | if (this.contains(className) === true) {
|
473 | this.remove(className);
|
474 | }
|
475 | else {
|
476 | this.add(className);
|
477 | }
|
478 | }
|
479 | get length() {
|
480 | return getItems(this.elm).length;
|
481 | }
|
482 | item(index) {
|
483 | return getItems(this.elm)[index];
|
484 | }
|
485 | toString() {
|
486 | return getItems(this.elm).join(' ');
|
487 | }
|
488 | }
|
489 | function validateClass(className) {
|
490 | if (className === '') {
|
491 | throw new Error('The token provided must not be empty.');
|
492 | }
|
493 | if (/\s/.test(className)) {
|
494 | throw new Error(`The token provided ('${className}') contains HTML space characters, which are not valid in tokens.`);
|
495 | }
|
496 | }
|
497 | function getItems(elm) {
|
498 | const className = elm.getAttribute('class');
|
499 | if (typeof className === 'string' && className.length > 0) {
|
500 | return className
|
501 | .trim()
|
502 | .split(' ')
|
503 | .filter(c => c.length > 0);
|
504 | }
|
505 | return [];
|
506 | }
|
507 |
|
508 | class MockCSSStyleDeclaration {
|
509 | constructor() {
|
510 | this._styles = new Map();
|
511 | }
|
512 | setProperty(prop, value) {
|
513 | prop = jsCaseToCssCase(prop);
|
514 | if (value == null || value === '') {
|
515 | this._styles.delete(prop);
|
516 | }
|
517 | else {
|
518 | this._styles.set(prop, String(value));
|
519 | }
|
520 | }
|
521 | getPropertyValue(prop) {
|
522 | prop = jsCaseToCssCase(prop);
|
523 | return String(this._styles.get(prop) || '');
|
524 | }
|
525 | removeProperty(prop) {
|
526 | prop = jsCaseToCssCase(prop);
|
527 | this._styles.delete(prop);
|
528 | }
|
529 | get length() {
|
530 | return this._styles.size;
|
531 | }
|
532 | get cssText() {
|
533 | const cssText = [];
|
534 | this._styles.forEach((value, prop) => {
|
535 | cssText.push(`${prop}: ${value};`);
|
536 | });
|
537 | return cssText.join(' ').trim();
|
538 | }
|
539 | set cssText(cssText) {
|
540 | if (cssText == null || cssText === '') {
|
541 | this._styles.clear();
|
542 | return;
|
543 | }
|
544 | cssText.split(';').forEach(rule => {
|
545 | rule = rule.trim();
|
546 | if (rule.length > 0) {
|
547 | const splt = rule.split(':');
|
548 | if (splt.length > 1) {
|
549 | const prop = splt[0].trim();
|
550 | const value = splt[1].trim();
|
551 | if (prop !== '' && value !== '') {
|
552 | this._styles.set(jsCaseToCssCase(prop), value);
|
553 | }
|
554 | }
|
555 | }
|
556 | });
|
557 | }
|
558 | }
|
559 | function createCSSStyleDeclaration() {
|
560 | return new Proxy(new MockCSSStyleDeclaration(), cssProxyHandler);
|
561 | }
|
562 | const cssProxyHandler = {
|
563 | get(cssStyle, prop) {
|
564 | if (prop in cssStyle) {
|
565 | return cssStyle[prop];
|
566 | }
|
567 | prop = cssCaseToJsCase(prop);
|
568 | return cssStyle.getPropertyValue(prop);
|
569 | },
|
570 | set(cssStyle, prop, value) {
|
571 | if (prop in cssStyle) {
|
572 | cssStyle[prop] = value;
|
573 | }
|
574 | else {
|
575 | cssStyle.setProperty(prop, value);
|
576 | }
|
577 | return true;
|
578 | },
|
579 | };
|
580 | function cssCaseToJsCase(str) {
|
581 |
|
582 | if (str.length > 1 && str.includes('-') === true) {
|
583 | str = str
|
584 | .toLowerCase()
|
585 | .split('-')
|
586 | .map(segment => segment.charAt(0).toUpperCase() + segment.slice(1))
|
587 | .join('');
|
588 | str = str.substr(0, 1).toLowerCase() + str.substr(1);
|
589 | }
|
590 | return str;
|
591 | }
|
592 | function jsCaseToCssCase(str) {
|
593 |
|
594 | if (str.length > 1 && str.includes('-') === false && /[A-Z]/.test(str) === true) {
|
595 | str = str
|
596 | .replace(/([A-Z])/g, g => ' ' + g[0])
|
597 | .trim()
|
598 | .replace(/ /g, '-')
|
599 | .toLowerCase();
|
600 | }
|
601 | return str;
|
602 | }
|
603 |
|
604 | class MockEvent {
|
605 | constructor(type, eventInitDict) {
|
606 | this.bubbles = false;
|
607 | this.cancelBubble = false;
|
608 | this.cancelable = false;
|
609 | this.composed = false;
|
610 | this.currentTarget = null;
|
611 | this.defaultPrevented = false;
|
612 | this.srcElement = null;
|
613 | this.target = null;
|
614 | if (typeof type !== 'string') {
|
615 | throw new Error(`Event type required`);
|
616 | }
|
617 | this.type = type;
|
618 | this.timeStamp = Date.now();
|
619 | if (eventInitDict != null) {
|
620 | Object.assign(this, eventInitDict);
|
621 | }
|
622 | }
|
623 | preventDefault() {
|
624 | this.defaultPrevented = true;
|
625 | }
|
626 | stopPropagation() {
|
627 | this.cancelBubble = true;
|
628 | }
|
629 | stopImmediatePropagation() {
|
630 | this.cancelBubble = true;
|
631 | }
|
632 | }
|
633 | class MockCustomEvent extends MockEvent {
|
634 | constructor(type, customEventInitDic) {
|
635 | super(type);
|
636 | this.detail = null;
|
637 | if (customEventInitDic != null) {
|
638 | Object.assign(this, customEventInitDic);
|
639 | }
|
640 | }
|
641 | }
|
642 | class MockKeyboardEvent extends MockEvent {
|
643 | constructor(type, keyboardEventInitDic) {
|
644 | super(type);
|
645 | this.code = '';
|
646 | this.key = '';
|
647 | this.altKey = false;
|
648 | this.ctrlKey = false;
|
649 | this.metaKey = false;
|
650 | this.shiftKey = false;
|
651 | this.location = 0;
|
652 | this.repeat = false;
|
653 | if (keyboardEventInitDic != null) {
|
654 | Object.assign(this, keyboardEventInitDic);
|
655 | }
|
656 | }
|
657 | }
|
658 | class MockMouseEvent extends MockEvent {
|
659 | constructor(type, mouseEventInitDic) {
|
660 | super(type);
|
661 | this.screenX = 0;
|
662 | this.screenY = 0;
|
663 | this.clientX = 0;
|
664 | this.clientY = 0;
|
665 | this.ctrlKey = false;
|
666 | this.shiftKey = false;
|
667 | this.altKey = false;
|
668 | this.metaKey = false;
|
669 | this.button = 0;
|
670 | this.buttons = 0;
|
671 | this.relatedTarget = null;
|
672 | if (mouseEventInitDic != null) {
|
673 | Object.assign(this, mouseEventInitDic);
|
674 | }
|
675 | }
|
676 | }
|
677 | class MockEventListener {
|
678 | constructor(type, handler) {
|
679 | this.type = type;
|
680 | this.handler = handler;
|
681 | }
|
682 | }
|
683 | function addEventListener(elm, type, handler) {
|
684 | const target = elm;
|
685 | if (target.__listeners == null) {
|
686 | target.__listeners = [];
|
687 | }
|
688 | target.__listeners.push(new MockEventListener(type, handler));
|
689 | }
|
690 | function removeEventListener(elm, type, handler) {
|
691 | const target = elm;
|
692 | if (target != null && Array.isArray(target.__listeners) === true) {
|
693 | const elmListener = target.__listeners.find(e => e.type === type && e.handler === handler);
|
694 | if (elmListener != null) {
|
695 | const index = target.__listeners.indexOf(elmListener);
|
696 | target.__listeners.splice(index, 1);
|
697 | }
|
698 | }
|
699 | }
|
700 | function resetEventListeners(target) {
|
701 | if (target != null && target.__listeners != null) {
|
702 | target.__listeners = null;
|
703 | }
|
704 | }
|
705 | function triggerEventListener(elm, ev) {
|
706 | if (elm == null || ev.cancelBubble === true) {
|
707 | return;
|
708 | }
|
709 | const target = elm;
|
710 | ev.currentTarget = elm;
|
711 | if (Array.isArray(target.__listeners) === true) {
|
712 | const listeners = target.__listeners.filter(e => e.type === ev.type);
|
713 | listeners.forEach(listener => {
|
714 | try {
|
715 | listener.handler.call(target, ev);
|
716 | }
|
717 | catch (err) {
|
718 | console.error(err);
|
719 | }
|
720 | });
|
721 | }
|
722 | if (ev.bubbles === false) {
|
723 | return;
|
724 | }
|
725 | if (elm.nodeName === "#document" ) {
|
726 | triggerEventListener(elm.defaultView, ev);
|
727 | }
|
728 | else {
|
729 | triggerEventListener(elm.parentElement, ev);
|
730 | }
|
731 | }
|
732 | function dispatchEvent(currentTarget, ev) {
|
733 | ev.target = currentTarget;
|
734 | triggerEventListener(currentTarget, ev);
|
735 | return true;
|
736 | }
|
737 |
|
738 | function serializeNodeToHtml(elm, opts = {}) {
|
739 | const output = {
|
740 | currentLineWidth: 0,
|
741 | indent: 0,
|
742 | isWithinBody: false,
|
743 | text: [],
|
744 | };
|
745 | if (opts.prettyHtml) {
|
746 | if (typeof opts.indentSpaces !== 'number') {
|
747 | opts.indentSpaces = 2;
|
748 | }
|
749 | if (typeof opts.newLines !== 'boolean') {
|
750 | opts.newLines = true;
|
751 | }
|
752 | opts.approximateLineWidth = -1;
|
753 | }
|
754 | else {
|
755 | opts.prettyHtml = false;
|
756 | if (typeof opts.newLines !== 'boolean') {
|
757 | opts.newLines = false;
|
758 | }
|
759 | if (typeof opts.indentSpaces !== 'number') {
|
760 | opts.indentSpaces = 0;
|
761 | }
|
762 | }
|
763 | if (typeof opts.approximateLineWidth !== 'number') {
|
764 | opts.approximateLineWidth = -1;
|
765 | }
|
766 | if (typeof opts.removeEmptyAttributes !== 'boolean') {
|
767 | opts.removeEmptyAttributes = true;
|
768 | }
|
769 | if (typeof opts.removeAttributeQuotes !== 'boolean') {
|
770 | opts.removeAttributeQuotes = false;
|
771 | }
|
772 | if (typeof opts.removeBooleanAttributeQuotes !== 'boolean') {
|
773 | opts.removeBooleanAttributeQuotes = false;
|
774 | }
|
775 | if (typeof opts.removeHtmlComments !== 'boolean') {
|
776 | opts.removeHtmlComments = false;
|
777 | }
|
778 | if (typeof opts.serializeShadowRoot !== 'boolean') {
|
779 | opts.serializeShadowRoot = false;
|
780 | }
|
781 | if (opts.outerHtml) {
|
782 | serializeToHtml(elm, opts, output, false);
|
783 | }
|
784 | else {
|
785 | for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
|
786 | serializeToHtml(elm.childNodes[i], opts, output, false);
|
787 | }
|
788 | }
|
789 | if (output.text[0] === '\n') {
|
790 | output.text.shift();
|
791 | }
|
792 | if (output.text[output.text.length - 1] === '\n') {
|
793 | output.text.pop();
|
794 | }
|
795 | return output.text.join('');
|
796 | }
|
797 | function serializeToHtml(node, opts, output, isShadowRoot) {
|
798 | if (node.nodeType === 1 || isShadowRoot) {
|
799 | const tagName = isShadowRoot ? 'mock:shadow-root' : getTagName(node);
|
800 | if (tagName === 'body') {
|
801 | output.isWithinBody = true;
|
802 | }
|
803 | const ignoreTag = opts.excludeTags != null && opts.excludeTags.includes(tagName);
|
804 | if (ignoreTag === false) {
|
805 | const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
|
806 | if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
807 | output.text.push('\n');
|
808 | output.currentLineWidth = 0;
|
809 | }
|
810 | if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
|
811 | for (let i = 0; i < output.indent; i++) {
|
812 | output.text.push(' ');
|
813 | }
|
814 | output.currentLineWidth += output.indent;
|
815 | }
|
816 | output.text.push('<' + tagName);
|
817 | output.currentLineWidth += tagName.length + 1;
|
818 | const attrsLength = node.attributes.length;
|
819 | const attributes = opts.prettyHtml && attrsLength > 1
|
820 | ? cloneAttributes(node.attributes, true)
|
821 | : node.attributes;
|
822 | for (let i = 0; i < attrsLength; i++) {
|
823 | const attr = attributes.item(i);
|
824 | const attrName = attr.name;
|
825 | if (attrName === 'style') {
|
826 | continue;
|
827 | }
|
828 | let attrValue = attr.value;
|
829 | if (opts.removeEmptyAttributes && attrValue === '' && REMOVE_EMPTY_ATTR.has(attrName)) {
|
830 | continue;
|
831 | }
|
832 | const attrNamespaceURI = attr.namespaceURI;
|
833 | if (attrNamespaceURI == null) {
|
834 | output.currentLineWidth += attrName.length + 1;
|
835 | if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
|
836 | output.text.push('\n' + attrName);
|
837 | output.currentLineWidth = 0;
|
838 | }
|
839 | else {
|
840 | output.text.push(' ' + attrName);
|
841 | }
|
842 | }
|
843 | else if (attrNamespaceURI === 'http://www.w3.org/XML/1998/namespace') {
|
844 | output.text.push(' xml:' + attrName);
|
845 | output.currentLineWidth += attrName.length + 5;
|
846 | }
|
847 | else if (attrNamespaceURI === 'http://www.w3.org/2000/xmlns/') {
|
848 | if (attrName !== 'xmlns') {
|
849 | output.text.push(' xmlns:' + attrName);
|
850 | output.currentLineWidth += attrName.length + 7;
|
851 | }
|
852 | else {
|
853 | output.text.push(' ' + attrName);
|
854 | output.currentLineWidth += attrName.length + 1;
|
855 | }
|
856 | }
|
857 | else if (attrNamespaceURI === XLINK_NS) {
|
858 | output.text.push(' xlink:' + attrName);
|
859 | output.currentLineWidth += attrName.length + 7;
|
860 | }
|
861 | else {
|
862 | output.text.push(' ' + attrNamespaceURI + ':' + attrName);
|
863 | output.currentLineWidth += attrNamespaceURI.length + attrName.length + 2;
|
864 | }
|
865 | if (opts.prettyHtml && attrName === 'class') {
|
866 | attrValue = attr.value = attrValue
|
867 | .split(' ')
|
868 | .filter(t => t !== '')
|
869 | .sort()
|
870 | .join(' ')
|
871 | .trim();
|
872 | }
|
873 | if (attrValue === '') {
|
874 | if (opts.removeBooleanAttributeQuotes && BOOLEAN_ATTR.has(attrName)) {
|
875 | continue;
|
876 | }
|
877 | if (opts.removeEmptyAttributes && attrName.startsWith('data-')) {
|
878 | continue;
|
879 | }
|
880 | }
|
881 | if (opts.removeAttributeQuotes && CAN_REMOVE_ATTR_QUOTES.test(attrValue)) {
|
882 | output.text.push('=' + escapeString(attrValue, true));
|
883 | output.currentLineWidth += attrValue.length + 1;
|
884 | }
|
885 | else {
|
886 | output.text.push('="' + escapeString(attrValue, true) + '"');
|
887 | output.currentLineWidth += attrValue.length + 3;
|
888 | }
|
889 | }
|
890 | if (node.hasAttribute('style')) {
|
891 | const cssText = node.style.cssText;
|
892 | if (opts.approximateLineWidth > 0 &&
|
893 | output.currentLineWidth + cssText.length + 10 > opts.approximateLineWidth) {
|
894 | output.text.push(`\nstyle="${cssText}">`);
|
895 | output.currentLineWidth = 0;
|
896 | }
|
897 | else {
|
898 | output.text.push(` style="${cssText}">`);
|
899 | output.currentLineWidth += cssText.length + 10;
|
900 | }
|
901 | }
|
902 | else {
|
903 | output.text.push('>');
|
904 | output.currentLineWidth += 1;
|
905 | }
|
906 | }
|
907 | if (EMPTY_ELEMENTS.has(tagName) === false) {
|
908 | if (opts.serializeShadowRoot && node.shadowRoot != null) {
|
909 | output.indent = output.indent + opts.indentSpaces;
|
910 | serializeToHtml(node.shadowRoot, opts, output, true);
|
911 | output.indent = output.indent - opts.indentSpaces;
|
912 | if (opts.newLines &&
|
913 | (node.childNodes.length === 0 ||
|
914 | (node.childNodes.length === 1 &&
|
915 | node.childNodes[0].nodeType === 3 &&
|
916 | node.childNodes[0].nodeValue.trim() === ''))) {
|
917 | output.text.push('\n');
|
918 | output.currentLineWidth = 0;
|
919 | for (let i = 0; i < output.indent; i++) {
|
920 | output.text.push(' ');
|
921 | }
|
922 | output.currentLineWidth += output.indent;
|
923 | }
|
924 | }
|
925 | if (opts.excludeTagContent == null || opts.excludeTagContent.includes(tagName) === false) {
|
926 | const childNodes = tagName === 'template' ? node.content.childNodes : node.childNodes;
|
927 | const childNodeLength = childNodes.length;
|
928 | if (childNodeLength > 0) {
|
929 | if (childNodeLength === 1 &&
|
930 | childNodes[0].nodeType === 3 &&
|
931 | (typeof childNodes[0].nodeValue !== 'string' || childNodes[0].nodeValue.trim() === '')) ;
|
932 | else {
|
933 | const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
|
934 | if (!isWithinWhitespaceSensitiveNode && opts.indentSpaces > 0 && ignoreTag === false) {
|
935 | output.indent = output.indent + opts.indentSpaces;
|
936 | }
|
937 | for (let i = 0; i < childNodeLength; i++) {
|
938 | serializeToHtml(childNodes[i], opts, output, false);
|
939 | }
|
940 | if (ignoreTag === false) {
|
941 | if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
942 | output.text.push('\n');
|
943 | output.currentLineWidth = 0;
|
944 | }
|
945 | if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
|
946 | output.indent = output.indent - opts.indentSpaces;
|
947 | for (let i = 0; i < output.indent; i++) {
|
948 | output.text.push(' ');
|
949 | }
|
950 | output.currentLineWidth += output.indent;
|
951 | }
|
952 | }
|
953 | }
|
954 | }
|
955 | if (ignoreTag === false) {
|
956 | output.text.push('</' + tagName + '>');
|
957 | output.currentLineWidth += tagName.length + 3;
|
958 | }
|
959 | }
|
960 | }
|
961 | if (opts.approximateLineWidth > 0 && STRUCTURE_ELEMENTS.has(tagName)) {
|
962 | output.text.push('\n');
|
963 | output.currentLineWidth = 0;
|
964 | }
|
965 | if (tagName === 'body') {
|
966 | output.isWithinBody = false;
|
967 | }
|
968 | }
|
969 | else if (node.nodeType === 3 ) {
|
970 | let textContent = node.nodeValue;
|
971 | if (typeof textContent === 'string') {
|
972 | const trimmedTextContent = textContent.trim();
|
973 | if (trimmedTextContent === '') {
|
974 |
|
975 | if (isWithinWhitespaceSensitive(node)) {
|
976 |
|
977 |
|
978 | output.text.push(textContent);
|
979 | output.currentLineWidth += textContent.length;
|
980 | }
|
981 | else if (opts.approximateLineWidth > 0 && !output.isWithinBody) ;
|
982 | else if (!opts.prettyHtml) {
|
983 |
|
984 |
|
985 |
|
986 | output.currentLineWidth += 1;
|
987 | if (opts.approximateLineWidth > 0 && output.currentLineWidth > opts.approximateLineWidth) {
|
988 |
|
989 |
|
990 |
|
991 | output.text.push('\n');
|
992 | output.currentLineWidth = 0;
|
993 | }
|
994 | else {
|
995 |
|
996 | output.text.push(' ');
|
997 | }
|
998 | }
|
999 | }
|
1000 | else {
|
1001 |
|
1002 | const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 || opts.prettyHtml ? isWithinWhitespaceSensitive(node) : false;
|
1003 | if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
1004 | output.text.push('\n');
|
1005 | output.currentLineWidth = 0;
|
1006 | }
|
1007 | if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
|
1008 | for (let i = 0; i < output.indent; i++) {
|
1009 | output.text.push(' ');
|
1010 | }
|
1011 | output.currentLineWidth += output.indent;
|
1012 | }
|
1013 | let textContentLength = textContent.length;
|
1014 | if (textContentLength > 0) {
|
1015 |
|
1016 | const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1
|
1017 | ? node.parentNode.nodeName
|
1018 | : null;
|
1019 | if (NON_ESCAPABLE_CONTENT.has(parentTagName)) {
|
1020 |
|
1021 |
|
1022 | if (isWithinWhitespaceSensitive(node)) {
|
1023 | output.text.push(textContent);
|
1024 | }
|
1025 | else {
|
1026 | output.text.push(trimmedTextContent);
|
1027 | textContentLength = trimmedTextContent.length;
|
1028 | }
|
1029 | output.currentLineWidth += textContentLength;
|
1030 | }
|
1031 | else {
|
1032 |
|
1033 | if (opts.prettyHtml && !isWithinWhitespaceSensitiveNode) {
|
1034 |
|
1035 | output.text.push(escapeString(textContent.replace(/\s\s+/g, ' ').trim(), false));
|
1036 | output.currentLineWidth += textContentLength;
|
1037 | }
|
1038 | else {
|
1039 |
|
1040 | if (isWithinWhitespaceSensitive(node)) {
|
1041 | output.currentLineWidth += textContentLength;
|
1042 | }
|
1043 | else {
|
1044 |
|
1045 |
|
1046 | if (/\s/.test(textContent.charAt(0))) {
|
1047 | textContent = ' ' + textContent.trimLeft();
|
1048 | }
|
1049 | textContentLength = textContent.length;
|
1050 | if (textContentLength > 1) {
|
1051 | if (/\s/.test(textContent.charAt(textContentLength - 1))) {
|
1052 | if (opts.approximateLineWidth > 0 &&
|
1053 | output.currentLineWidth + textContentLength > opts.approximateLineWidth) {
|
1054 | textContent = textContent.trimRight() + '\n';
|
1055 | output.currentLineWidth = 0;
|
1056 | }
|
1057 | else {
|
1058 | textContent = textContent.trimRight() + ' ';
|
1059 | }
|
1060 | }
|
1061 | }
|
1062 | output.currentLineWidth += textContentLength;
|
1063 | }
|
1064 | output.text.push(escapeString(textContent, false));
|
1065 | }
|
1066 | }
|
1067 | }
|
1068 | }
|
1069 | }
|
1070 | }
|
1071 | else if (node.nodeType === 8 ) {
|
1072 | const nodeValue = node.nodeValue;
|
1073 | if (opts.removeHtmlComments) {
|
1074 | const isHydrateAnnotation = nodeValue.startsWith(CONTENT_REF_ID + '.') ||
|
1075 | nodeValue.startsWith(ORG_LOCATION_ID + '.') ||
|
1076 | nodeValue.startsWith(SLOT_NODE_ID + '.') ||
|
1077 | nodeValue.startsWith(TEXT_NODE_ID + '.');
|
1078 | if (!isHydrateAnnotation) {
|
1079 | return;
|
1080 | }
|
1081 | }
|
1082 | const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
|
1083 | if (opts.newLines && !isWithinWhitespaceSensitiveNode) {
|
1084 | output.text.push('\n');
|
1085 | output.currentLineWidth = 0;
|
1086 | }
|
1087 | if (opts.indentSpaces > 0 && !isWithinWhitespaceSensitiveNode) {
|
1088 | for (let i = 0; i < output.indent; i++) {
|
1089 | output.text.push(' ');
|
1090 | }
|
1091 | output.currentLineWidth += output.indent;
|
1092 | }
|
1093 | output.text.push('<!--' + nodeValue + '-->');
|
1094 | output.currentLineWidth += nodeValue.length + 7;
|
1095 | }
|
1096 | else if (node.nodeType === 10 ) {
|
1097 | output.text.push('<!doctype html>');
|
1098 | }
|
1099 | }
|
1100 | const AMP_REGEX = /&/g;
|
1101 | const NBSP_REGEX = /\u00a0/g;
|
1102 | const DOUBLE_QUOTE_REGEX = /"/g;
|
1103 | const LT_REGEX = /</g;
|
1104 | const GT_REGEX = />/g;
|
1105 | const CAN_REMOVE_ATTR_QUOTES = /^[^ \t\n\f\r"'`=<>\/\\-]+$/;
|
1106 | function getTagName(element) {
|
1107 | if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
|
1108 | return element.nodeName.toLowerCase();
|
1109 | }
|
1110 | else {
|
1111 | return element.nodeName;
|
1112 | }
|
1113 | }
|
1114 | function escapeString(str, attrMode) {
|
1115 | str = str.replace(AMP_REGEX, '&').replace(NBSP_REGEX, ' ');
|
1116 | if (attrMode) {
|
1117 | return str.replace(DOUBLE_QUOTE_REGEX, '"');
|
1118 | }
|
1119 | return str.replace(LT_REGEX, '<').replace(GT_REGEX, '>');
|
1120 | }
|
1121 | function isWithinWhitespaceSensitive(node) {
|
1122 | while (node != null) {
|
1123 | if (WHITESPACE_SENSITIVE.has(node.nodeName)) {
|
1124 | return true;
|
1125 | }
|
1126 | node = node.parentNode;
|
1127 | }
|
1128 | return false;
|
1129 | }
|
1130 | const NON_ESCAPABLE_CONTENT = new Set([
|
1131 | 'STYLE',
|
1132 | 'SCRIPT',
|
1133 | 'IFRAME',
|
1134 | 'NOSCRIPT',
|
1135 | 'XMP',
|
1136 | 'NOEMBED',
|
1137 | 'NOFRAMES',
|
1138 | 'PLAINTEXT',
|
1139 | ]);
|
1140 | const WHITESPACE_SENSITIVE = new Set([
|
1141 | 'CODE',
|
1142 | 'OUTPUT',
|
1143 | 'PLAINTEXT',
|
1144 | 'PRE',
|
1145 | 'SCRIPT',
|
1146 | 'TEMPLATE',
|
1147 | 'TEXTAREA',
|
1148 | ]);
|
1149 | const EMPTY_ELEMENTS = new Set([
|
1150 | 'area',
|
1151 | 'base',
|
1152 | 'basefont',
|
1153 | 'bgsound',
|
1154 | 'br',
|
1155 | 'col',
|
1156 | 'embed',
|
1157 | 'frame',
|
1158 | 'hr',
|
1159 | 'img',
|
1160 | 'input',
|
1161 | 'keygen',
|
1162 | 'link',
|
1163 | 'meta',
|
1164 | 'param',
|
1165 | 'source',
|
1166 | 'trace',
|
1167 | 'wbr',
|
1168 | ]);
|
1169 | const REMOVE_EMPTY_ATTR = new Set(['class', 'dir', 'id', 'lang', 'name', 'title']);
|
1170 | const BOOLEAN_ATTR = new Set([
|
1171 | 'allowfullscreen',
|
1172 | 'async',
|
1173 | 'autofocus',
|
1174 | 'autoplay',
|
1175 | 'checked',
|
1176 | 'compact',
|
1177 | 'controls',
|
1178 | 'declare',
|
1179 | 'default',
|
1180 | 'defaultchecked',
|
1181 | 'defaultmuted',
|
1182 | 'defaultselected',
|
1183 | 'defer',
|
1184 | 'disabled',
|
1185 | 'enabled',
|
1186 | 'formnovalidate',
|
1187 | 'hidden',
|
1188 | 'indeterminate',
|
1189 | 'inert',
|
1190 | 'ismap',
|
1191 | 'itemscope',
|
1192 | 'loop',
|
1193 | 'multiple',
|
1194 | 'muted',
|
1195 | 'nohref',
|
1196 | 'nomodule',
|
1197 | 'noresize',
|
1198 | 'noshade',
|
1199 | 'novalidate',
|
1200 | 'nowrap',
|
1201 | 'open',
|
1202 | 'pauseonexit',
|
1203 | 'readonly',
|
1204 | 'required',
|
1205 | 'reversed',
|
1206 | 'scoped',
|
1207 | 'seamless',
|
1208 | 'selected',
|
1209 | 'sortable',
|
1210 | 'truespeed',
|
1211 | 'typemustmatch',
|
1212 | 'visible',
|
1213 | ]);
|
1214 | const STRUCTURE_ELEMENTS = new Set([
|
1215 | 'html',
|
1216 | 'body',
|
1217 | 'head',
|
1218 | 'iframe',
|
1219 | 'meta',
|
1220 | 'link',
|
1221 | 'base',
|
1222 | 'title',
|
1223 | 'script',
|
1224 | 'style',
|
1225 | ]);
|
1226 |
|
1227 |
|
1228 | const e=function(e){const t=[65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111];var n="�",s={EOF:-1,NULL:0,TABULATION:9,CARRIAGE_RETURN:13,LINE_FEED:10,FORM_FEED:12,SPACE:32,EXCLAMATION_MARK:33,QUOTATION_MARK:34,NUMBER_SIGN:35,AMPERSAND:38,APOSTROPHE:39,HYPHEN_MINUS:45,SOLIDUS:47,DIGIT_0:48,DIGIT_9:57,SEMICOLON:59,LESS_THAN_SIGN:60,EQUALS_SIGN:61,GREATER_THAN_SIGN:62,QUESTION_MARK:63,LATIN_CAPITAL_A:65,LATIN_CAPITAL_F:70,LATIN_CAPITAL_X:88,LATIN_CAPITAL_Z:90,RIGHT_SQUARE_BRACKET:93,GRAVE_ACCENT:96,LATIN_SMALL_A:97,LATIN_SMALL_F:102,LATIN_SMALL_X:120,LATIN_SMALL_Z:122,REPLACEMENT_CHARACTER:65533},r=function(e){return e>=55296&&e<=57343},i=function(e){return 32!==e&&10!==e&&13!==e&&9!==e&&12!==e&&e>=1&&e<=31||e>=127&&e<=159},o=function(e){return e>=64976&&e<=65007||t.indexOf(e)>-1},a="unexpected-null-character",T="invalid-first-character-of-tag-name",E="missing-semicolon-after-character-reference",h="eof-before-tag-name",c="eof-in-tag",_="missing-whitespace-after-doctype-public-keyword",l="missing-whitespace-between-doctype-public-and-system-identifiers",m="missing-whitespace-after-doctype-system-keyword",p="missing-quote-before-doctype-public-identifier",A="missing-quote-before-doctype-system-identifier",u="missing-doctype-public-identifier",N="missing-doctype-system-identifier",d="abrupt-doctype-public-identifier",C="abrupt-doctype-system-identifier",O="eof-in-script-html-comment-like-text",f="eof-in-doctype",S="abrupt-closing-of-empty-comment",R="eof-in-comment",I="absence-of-digits-in-numeric-character-reference",L="end-tag-without-matching-open-element",k="misplaced-start-tag-for-head-element";const M=s;var g=new Uint16Array([4,52,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,106,303,412,810,1432,1701,1796,1987,2114,2360,2420,2484,3170,3251,4140,4393,4575,4610,5106,5512,5728,6117,6274,6315,6345,6427,6516,7002,7910,8733,9323,9870,10170,10631,10893,11318,11386,11467,12773,13092,14474,14922,15448,15542,16419,17666,18166,18611,19004,19095,19298,19397,4,16,69,77,97,98,99,102,103,108,109,110,111,112,114,115,116,117,140,150,158,169,176,194,199,210,216,222,226,242,256,266,283,294,108,105,103,5,198,1,59,148,1,198,80,5,38,1,59,156,1,38,99,117,116,101,5,193,1,59,167,1,193,114,101,118,101,59,1,258,4,2,105,121,182,191,114,99,5,194,1,59,189,1,194,59,1,1040,114,59,3,55349,56580,114,97,118,101,5,192,1,59,208,1,192,112,104,97,59,1,913,97,99,114,59,1,256,100,59,1,10835,4,2,103,112,232,237,111,110,59,1,260,102,59,3,55349,56632,112,108,121,70,117,110,99,116,105,111,110,59,1,8289,105,110,103,5,197,1,59,264,1,197,4,2,99,115,272,277,114,59,3,55349,56476,105,103,110,59,1,8788,105,108,100,101,5,195,1,59,292,1,195,109,108,5,196,1,59,301,1,196,4,8,97,99,101,102,111,114,115,117,321,350,354,383,388,394,400,405,4,2,99,114,327,336,107,115,108,97,115,104,59,1,8726,4,2,118,119,342,345,59,1,10983,101,100,59,1,8966,121,59,1,1041,4,3,99,114,116,362,369,379,97,117,115,101,59,1,8757,110,111,117,108,108,105,115,59,1,8492,97,59,1,914,114,59,3,55349,56581,112,102,59,3,55349,56633,101,118,101,59,1,728,99,114,59,1,8492,109,112,101,113,59,1,8782,4,14,72,79,97,99,100,101,102,104,105,108,111,114,115,117,442,447,456,504,542,547,569,573,577,616,678,784,790,796,99,121,59,1,1063,80,89,5,169,1,59,454,1,169,4,3,99,112,121,464,470,497,117,116,101,59,1,262,4,2,59,105,476,478,1,8914,116,97,108,68,105,102,102,101,114,101,110,116,105,97,108,68,59,1,8517,108,101,121,115,59,1,8493,4,4,97,101,105,111,514,520,530,535,114,111,110,59,1,268,100,105,108,5,199,1,59,528,1,199,114,99,59,1,264,110,105,110,116,59,1,8752,111,116,59,1,266,4,2,100,110,553,560,105,108,108,97,59,1,184,116,101,114,68,111,116,59,1,183,114,59,1,8493,105,59,1,935,114,99,108,101,4,4,68,77,80,84,591,596,603,609,111,116,59,1,8857,105,110,117,115,59,1,8854,108,117,115,59,1,8853,105,109,101,115,59,1,8855,111,4,2,99,115,623,646,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8754,101,67,117,114,108,121,4,2,68,81,658,671,111,117,98,108,101,81,117,111,116,101,59,1,8221,117,111,116,101,59,1,8217,4,4,108,110,112,117,688,701,736,753,111,110,4,2,59,101,696,698,1,8759,59,1,10868,4,3,103,105,116,709,717,722,114,117,101,110,116,59,1,8801,110,116,59,1,8751,111,117,114,73,110,116,101,103,114,97,108,59,1,8750,4,2,102,114,742,745,59,1,8450,111,100,117,99,116,59,1,8720,110,116,101,114,67,108,111,99,107,119,105,115,101,67,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8755,111,115,115,59,1,10799,99,114,59,3,55349,56478,112,4,2,59,67,803,805,1,8915,97,112,59,1,8781,4,11,68,74,83,90,97,99,101,102,105,111,115,834,850,855,860,865,888,903,916,921,1011,1415,4,2,59,111,840,842,1,8517,116,114,97,104,100,59,1,10513,99,121,59,1,1026,99,121,59,1,1029,99,121,59,1,1039,4,3,103,114,115,873,879,883,103,101,114,59,1,8225,114,59,1,8609,104,118,59,1,10980,4,2,97,121,894,900,114,111,110,59,1,270,59,1,1044,108,4,2,59,116,910,912,1,8711,97,59,1,916,114,59,3,55349,56583,4,2,97,102,927,998,4,2,99,109,933,992,114,105,116,105,99,97,108,4,4,65,68,71,84,950,957,978,985,99,117,116,101,59,1,180,111,4,2,116,117,964,967,59,1,729,98,108,101,65,99,117,116,101,59,1,733,114,97,118,101,59,1,96,105,108,100,101,59,1,732,111,110,100,59,1,8900,102,101,114,101,110,116,105,97,108,68,59,1,8518,4,4,112,116,117,119,1021,1026,1048,1249,102,59,3,55349,56635,4,3,59,68,69,1034,1036,1041,1,168,111,116,59,1,8412,113,117,97,108,59,1,8784,98,108,101,4,6,67,68,76,82,85,86,1065,1082,1101,1189,1211,1236,111,110,116,111,117,114,73,110,116,101,103,114,97,108,59,1,8751,111,4,2,116,119,1089,1092,59,1,168,110,65,114,114,111,119,59,1,8659,4,2,101,111,1107,1141,102,116,4,3,65,82,84,1117,1124,1136,114,114,111,119,59,1,8656,105,103,104,116,65,114,114,111,119,59,1,8660,101,101,59,1,10980,110,103,4,2,76,82,1149,1177,101,102,116,4,2,65,82,1158,1165,114,114,111,119,59,1,10232,105,103,104,116,65,114,114,111,119,59,1,10234,105,103,104,116,65,114,114,111,119,59,1,10233,105,103,104,116,4,2,65,84,1199,1206,114,114,111,119,59,1,8658,101,101,59,1,8872,112,4,2,65,68,1218,1225,114,114,111,119,59,1,8657,111,119,110,65,114,114,111,119,59,1,8661,101,114,116,105,99,97,108,66,97,114,59,1,8741,110,4,6,65,66,76,82,84,97,1264,1292,1299,1352,1391,1408,114,114,111,119,4,3,59,66,85,1276,1278,1283,1,8595,97,114,59,1,10515,112,65,114,114,111,119,59,1,8693,114,101,118,101,59,1,785,101,102,116,4,3,82,84,86,1310,1323,1334,105,103,104,116,86,101,99,116,111,114,59,1,10576,101,101,86,101,99,116,111,114,59,1,10590,101,99,116,111,114,4,2,59,66,1345,1347,1,8637,97,114,59,1,10582,105,103,104,116,4,2,84,86,1362,1373,101,101,86,101,99,116,111,114,59,1,10591,101,99,116,111,114,4,2,59,66,1384,1386,1,8641,97,114,59,1,10583,101,101,4,2,59,65,1399,1401,1,8868,114,114,111,119,59,1,8615,114,114,111,119,59,1,8659,4,2,99,116,1421,1426,114,59,3,55349,56479,114,111,107,59,1,272,4,16,78,84,97,99,100,102,103,108,109,111,112,113,115,116,117,120,1466,1470,1478,1489,1515,1520,1525,1536,1544,1593,1609,1617,1650,1664,1668,1677,71,59,1,330,72,5,208,1,59,1476,1,208,99,117,116,101,5,201,1,59,1487,1,201,4,3,97,105,121,1497,1503,1512,114,111,110,59,1,282,114,99,5,202,1,59,1510,1,202,59,1,1069,111,116,59,1,278,114,59,3,55349,56584,114,97,118,101,5,200,1,59,1534,1,200,101,109,101,110,116,59,1,8712,4,2,97,112,1550,1555,99,114,59,1,274,116,121,4,2,83,86,1563,1576,109,97,108,108,83,113,117,97,114,101,59,1,9723,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9643,4,2,103,112,1599,1604,111,110,59,1,280,102,59,3,55349,56636,115,105,108,111,110,59,1,917,117,4,2,97,105,1624,1640,108,4,2,59,84,1631,1633,1,10869,105,108,100,101,59,1,8770,108,105,98,114,105,117,109,59,1,8652,4,2,99,105,1656,1660,114,59,1,8496,109,59,1,10867,97,59,1,919,109,108,5,203,1,59,1675,1,203,4,2,105,112,1683,1689,115,116,115,59,1,8707,111,110,101,110,116,105,97,108,69,59,1,8519,4,5,99,102,105,111,115,1713,1717,1722,1762,1791,121,59,1,1060,114,59,3,55349,56585,108,108,101,100,4,2,83,86,1732,1745,109,97,108,108,83,113,117,97,114,101,59,1,9724,101,114,121,83,109,97,108,108,83,113,117,97,114,101,59,1,9642,4,3,112,114,117,1770,1775,1781,102,59,3,55349,56637,65,108,108,59,1,8704,114,105,101,114,116,114,102,59,1,8497,99,114,59,1,8497,4,12,74,84,97,98,99,100,102,103,111,114,115,116,1822,1827,1834,1848,1855,1877,1882,1887,1890,1896,1978,1984,99,121,59,1,1027,5,62,1,59,1832,1,62,109,109,97,4,2,59,100,1843,1845,1,915,59,1,988,114,101,118,101,59,1,286,4,3,101,105,121,1863,1869,1874,100,105,108,59,1,290,114,99,59,1,284,59,1,1043,111,116,59,1,288,114,59,3,55349,56586,59,1,8921,112,102,59,3,55349,56638,101,97,116,101,114,4,6,69,70,71,76,83,84,1915,1933,1944,1953,1959,1971,113,117,97,108,4,2,59,76,1925,1927,1,8805,101,115,115,59,1,8923,117,108,108,69,113,117,97,108,59,1,8807,114,101,97,116,101,114,59,1,10914,101,115,115,59,1,8823,108,97,110,116,69,113,117,97,108,59,1,10878,105,108,100,101,59,1,8819,99,114,59,3,55349,56482,59,1,8811,4,8,65,97,99,102,105,111,115,117,2005,2012,2026,2032,2036,2049,2073,2089,82,68,99,121,59,1,1066,4,2,99,116,2018,2023,101,107,59,1,711,59,1,94,105,114,99,59,1,292,114,59,1,8460,108,98,101,114,116,83,112,97,99,101,59,1,8459,4,2,112,114,2055,2059,102,59,1,8461,105,122,111,110,116,97,108,76,105,110,101,59,1,9472,4,2,99,116,2079,2083,114,59,1,8459,114,111,107,59,1,294,109,112,4,2,68,69,2097,2107,111,119,110,72,117,109,112,59,1,8782,113,117,97,108,59,1,8783,4,14,69,74,79,97,99,100,102,103,109,110,111,115,116,117,2144,2149,2155,2160,2171,2189,2194,2198,2209,2245,2307,2329,2334,2341,99,121,59,1,1045,108,105,103,59,1,306,99,121,59,1,1025,99,117,116,101,5,205,1,59,2169,1,205,4,2,105,121,2177,2186,114,99,5,206,1,59,2184,1,206,59,1,1048,111,116,59,1,304,114,59,1,8465,114,97,118,101,5,204,1,59,2207,1,204,4,3,59,97,112,2217,2219,2238,1,8465,4,2,99,103,2225,2229,114,59,1,298,105,110,97,114,121,73,59,1,8520,108,105,101,115,59,1,8658,4,2,116,118,2251,2281,4,2,59,101,2257,2259,1,8748,4,2,103,114,2265,2271,114,97,108,59,1,8747,115,101,99,116,105,111,110,59,1,8898,105,115,105,98,108,101,4,2,67,84,2293,2300,111,109,109,97,59,1,8291,105,109,101,115,59,1,8290,4,3,103,112,116,2315,2320,2325,111,110,59,1,302,102,59,3,55349,56640,97,59,1,921,99,114,59,1,8464,105,108,100,101,59,1,296,4,2,107,109,2347,2352,99,121,59,1,1030,108,5,207,1,59,2358,1,207,4,5,99,102,111,115,117,2372,2386,2391,2397,2414,4,2,105,121,2378,2383,114,99,59,1,308,59,1,1049,114,59,3,55349,56589,112,102,59,3,55349,56641,4,2,99,101,2403,2408,114,59,3,55349,56485,114,99,121,59,1,1032,107,99,121,59,1,1028,4,7,72,74,97,99,102,111,115,2436,2441,2446,2452,2467,2472,2478,99,121,59,1,1061,99,121,59,1,1036,112,112,97,59,1,922,4,2,101,121,2458,2464,100,105,108,59,1,310,59,1,1050,114,59,3,55349,56590,112,102,59,3,55349,56642,99,114,59,3,55349,56486,4,11,74,84,97,99,101,102,108,109,111,115,116,2508,2513,2520,2562,2585,2981,2986,3004,3011,3146,3167,99,121,59,1,1033,5,60,1,59,2518,1,60,4,5,99,109,110,112,114,2532,2538,2544,2548,2558,117,116,101,59,1,313,98,100,97,59,1,923,103,59,1,10218,108,97,99,101,116,114,102,59,1,8466,114,59,1,8606,4,3,97,101,121,2570,2576,2582,114,111,110,59,1,317,100,105,108,59,1,315,59,1,1051,4,2,102,115,2591,2907,116,4,10,65,67,68,70,82,84,85,86,97,114,2614,2663,2672,2728,2735,2760,2820,2870,2888,2895,4,2,110,114,2620,2633,103,108,101,66,114,97,99,107,101,116,59,1,10216,114,111,119,4,3,59,66,82,2644,2646,2651,1,8592,97,114,59,1,8676,105,103,104,116,65,114,114,111,119,59,1,8646,101,105,108,105,110,103,59,1,8968,111,4,2,117,119,2679,2692,98,108,101,66,114,97,99,107,101,116,59,1,10214,110,4,2,84,86,2699,2710,101,101,86,101,99,116,111,114,59,1,10593,101,99,116,111,114,4,2,59,66,2721,2723,1,8643,97,114,59,1,10585,108,111,111,114,59,1,8970,105,103,104,116,4,2,65,86,2745,2752,114,114,111,119,59,1,8596,101,99,116,111,114,59,1,10574,4,2,101,114,2766,2792,101,4,3,59,65,86,2775,2777,2784,1,8867,114,114,111,119,59,1,8612,101,99,116,111,114,59,1,10586,105,97,110,103,108,101,4,3,59,66,69,2806,2808,2813,1,8882,97,114,59,1,10703,113,117,97,108,59,1,8884,112,4,3,68,84,86,2829,2841,2852,111,119,110,86,101,99,116,111,114,59,1,10577,101,101,86,101,99,116,111,114,59,1,10592,101,99,116,111,114,4,2,59,66,2863,2865,1,8639,97,114,59,1,10584,101,99,116,111,114,4,2,59,66,2881,2883,1,8636,97,114,59,1,10578,114,114,111,119,59,1,8656,105,103,104,116,97,114,114,111,119,59,1,8660,115,4,6,69,70,71,76,83,84,2922,2936,2947,2956,2962,2974,113,117,97,108,71,114,101,97,116,101,114,59,1,8922,117,108,108,69,113,117,97,108,59,1,8806,114,101,97,116,101,114,59,1,8822,101,115,115,59,1,10913,108,97,110,116,69,113,117,97,108,59,1,10877,105,108,100,101,59,1,8818,114,59,3,55349,56591,4,2,59,101,2992,2994,1,8920,102,116,97,114,114,111,119,59,1,8666,105,100,111,116,59,1,319,4,3,110,112,119,3019,3110,3115,103,4,4,76,82,108,114,3030,3058,3070,3098,101,102,116,4,2,65,82,3039,3046,114,114,111,119,59,1,10229,105,103,104,116,65,114,114,111,119,59,1,10231,105,103,104,116,65,114,114,111,119,59,1,10230,101,102,116,4,2,97,114,3079,3086,114,114,111,119,59,1,10232,105,103,104,116,97,114,114,111,119,59,1,10234,105,103,104,116,97,114,114,111,119,59,1,10233,102,59,3,55349,56643,101,114,4,2,76,82,3123,3134,101,102,116,65,114,114,111,119,59,1,8601,105,103,104,116,65,114,114,111,119,59,1,8600,4,3,99,104,116,3154,3158,3161,114,59,1,8466,59,1,8624,114,111,107,59,1,321,59,1,8810,4,8,97,99,101,102,105,111,115,117,3188,3192,3196,3222,3227,3237,3243,3248,112,59,1,10501,121,59,1,1052,4,2,100,108,3202,3213,105,117,109,83,112,97,99,101,59,1,8287,108,105,110,116,114,102,59,1,8499,114,59,3,55349,56592,110,117,115,80,108,117,115,59,1,8723,112,102,59,3,55349,56644,99,114,59,1,8499,59,1,924,4,9,74,97,99,101,102,111,115,116,117,3271,3276,3283,3306,3422,3427,4120,4126,4137,99,121,59,1,1034,99,117,116,101,59,1,323,4,3,97,101,121,3291,3297,3303,114,111,110,59,1,327,100,105,108,59,1,325,59,1,1053,4,3,103,115,119,3314,3380,3415,97,116,105,118,101,4,3,77,84,86,3327,3340,3365,101,100,105,117,109,83,112,97,99,101,59,1,8203,104,105,4,2,99,110,3348,3357,107,83,112,97,99,101,59,1,8203,83,112,97,99,101,59,1,8203,101,114,121,84,104,105,110,83,112,97,99,101,59,1,8203,116,101,100,4,2,71,76,3389,3405,114,101,97,116,101,114,71,114,101,97,116,101,114,59,1,8811,101,115,115,76,101,115,115,59,1,8810,76,105,110,101,59,1,10,114,59,3,55349,56593,4,4,66,110,112,116,3437,3444,3460,3464,114,101,97,107,59,1,8288,66,114,101,97,107,105,110,103,83,112,97,99,101,59,1,160,102,59,1,8469,4,13,59,67,68,69,71,72,76,78,80,82,83,84,86,3492,3494,3517,3536,3578,3657,3685,3784,3823,3860,3915,4066,4107,1,10988,4,2,111,117,3500,3510,110,103,114,117,101,110,116,59,1,8802,112,67,97,112,59,1,8813,111,117,98,108,101,86,101,114,116,105,99,97,108,66,97,114,59,1,8742,4,3,108,113,120,3544,3552,3571,101,109,101,110,116,59,1,8713,117,97,108,4,2,59,84,3561,3563,1,8800,105,108,100,101,59,3,8770,824,105,115,116,115,59,1,8708,114,101,97,116,101,114,4,7,59,69,70,71,76,83,84,3600,3602,3609,3621,3631,3637,3650,1,8815,113,117,97,108,59,1,8817,117,108,108,69,113,117,97,108,59,3,8807,824,114,101,97,116,101,114,59,3,8811,824,101,115,115,59,1,8825,108,97,110,116,69,113,117,97,108,59,3,10878,824,105,108,100,101,59,1,8821,117,109,112,4,2,68,69,3666,3677,111,119,110,72,117,109,112,59,3,8782,824,113,117,97,108,59,3,8783,824,101,4,2,102,115,3692,3724,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3709,3711,3717,1,8938,97,114,59,3,10703,824,113,117,97,108,59,1,8940,115,4,6,59,69,71,76,83,84,3739,3741,3748,3757,3764,3777,1,8814,113,117,97,108,59,1,8816,114,101,97,116,101,114,59,1,8824,101,115,115,59,3,8810,824,108,97,110,116,69,113,117,97,108,59,3,10877,824,105,108,100,101,59,1,8820,101,115,116,101,100,4,2,71,76,3795,3812,114,101,97,116,101,114,71,114,101,97,116,101,114,59,3,10914,824,101,115,115,76,101,115,115,59,3,10913,824,114,101,99,101,100,101,115,4,3,59,69,83,3838,3840,3848,1,8832,113,117,97,108,59,3,10927,824,108,97,110,116,69,113,117,97,108,59,1,8928,4,2,101,105,3866,3881,118,101,114,115,101,69,108,101,109,101,110,116,59,1,8716,103,104,116,84,114,105,97,110,103,108,101,4,3,59,66,69,3900,3902,3908,1,8939,97,114,59,3,10704,824,113,117,97,108,59,1,8941,4,2,113,117,3921,3973,117,97,114,101,83,117,4,2,98,112,3933,3952,115,101,116,4,2,59,69,3942,3945,3,8847,824,113,117,97,108,59,1,8930,101,114,115,101,116,4,2,59,69,3963,3966,3,8848,824,113,117,97,108,59,1,8931,4,3,98,99,112,3981,4e3,4045,115,101,116,4,2,59,69,3990,3993,3,8834,8402,113,117,97,108,59,1,8840,99,101,101,100,115,4,4,59,69,83,84,4015,4017,4025,4037,1,8833,113,117,97,108,59,3,10928,824,108,97,110,116,69,113,117,97,108,59,1,8929,105,108,100,101,59,3,8831,824,101,114,115,101,116,4,2,59,69,4056,4059,3,8835,8402,113,117,97,108,59,1,8841,105,108,100,101,4,4,59,69,70,84,4080,4082,4089,4100,1,8769,113,117,97,108,59,1,8772,117,108,108,69,113,117,97,108,59,1,8775,105,108,100,101,59,1,8777,101,114,116,105,99,97,108,66,97,114,59,1,8740,99,114,59,3,55349,56489,105,108,100,101,5,209,1,59,4135,1,209,59,1,925,4,14,69,97,99,100,102,103,109,111,112,114,115,116,117,118,4170,4176,4187,4205,4212,4217,4228,4253,4259,4292,4295,4316,4337,4346,108,105,103,59,1,338,99,117,116,101,5,211,1,59,4185,1,211,4,2,105,121,4193,4202,114,99,5,212,1,59,4200,1,212,59,1,1054,98,108,97,99,59,1,336,114,59,3,55349,56594,114,97,118,101,5,210,1,59,4226,1,210,4,3,97,101,105,4236,4241,4246,99,114,59,1,332,103,97,59,1,937,99,114,111,110,59,1,927,112,102,59,3,55349,56646,101,110,67,117,114,108,121,4,2,68,81,4272,4285,111,117,98,108,101,81,117,111,116,101,59,1,8220,117,111,116,101,59,1,8216,59,1,10836,4,2,99,108,4301,4306,114,59,3,55349,56490,97,115,104,5,216,1,59,4314,1,216,105,4,2,108,109,4323,4332,100,101,5,213,1,59,4330,1,213,101,115,59,1,10807,109,108,5,214,1,59,4344,1,214,101,114,4,2,66,80,4354,4380,4,2,97,114,4360,4364,114,59,1,8254,97,99,4,2,101,107,4372,4375,59,1,9182,101,116,59,1,9140,97,114,101,110,116,104,101,115,105,115,59,1,9180,4,9,97,99,102,104,105,108,111,114,115,4413,4422,4426,4431,4435,4438,4448,4471,4561,114,116,105,97,108,68,59,1,8706,121,59,1,1055,114,59,3,55349,56595,105,59,1,934,59,1,928,117,115,77,105,110,117,115,59,1,177,4,2,105,112,4454,4467,110,99,97,114,101,112,108,97,110,101,59,1,8460,102,59,1,8473,4,4,59,101,105,111,4481,4483,4526,4531,1,10939,99,101,100,101,115,4,4,59,69,83,84,4498,4500,4507,4519,1,8826,113,117,97,108,59,1,10927,108,97,110,116,69,113,117,97,108,59,1,8828,105,108,100,101,59,1,8830,109,101,59,1,8243,4,2,100,112,4537,4543,117,99,116,59,1,8719,111,114,116,105,111,110,4,2,59,97,4555,4557,1,8759,108,59,1,8733,4,2,99,105,4567,4572,114,59,3,55349,56491,59,1,936,4,4,85,102,111,115,4585,4594,4599,4604,79,84,5,34,1,59,4592,1,34,114,59,3,55349,56596,112,102,59,1,8474,99,114,59,3,55349,56492,4,12,66,69,97,99,101,102,104,105,111,114,115,117,4636,4642,4650,4681,4704,4763,4767,4771,5047,5069,5081,5094,97,114,114,59,1,10512,71,5,174,1,59,4648,1,174,4,3,99,110,114,4658,4664,4668,117,116,101,59,1,340,103,59,1,10219,114,4,2,59,116,4675,4677,1,8608,108,59,1,10518,4,3,97,101,121,4689,4695,4701,114,111,110,59,1,344,100,105,108,59,1,342,59,1,1056,4,2,59,118,4710,4712,1,8476,101,114,115,101,4,2,69,85,4722,4748,4,2,108,113,4728,4736,101,109,101,110,116,59,1,8715,117,105,108,105,98,114,105,117,109,59,1,8651,112,69,113,117,105,108,105,98,114,105,117,109,59,1,10607,114,59,1,8476,111,59,1,929,103,104,116,4,8,65,67,68,70,84,85,86,97,4792,4840,4849,4905,4912,4972,5022,5040,4,2,110,114,4798,4811,103,108,101,66,114,97,99,107,101,116,59,1,10217,114,111,119,4,3,59,66,76,4822,4824,4829,1,8594,97,114,59,1,8677,101,102,116,65,114,114,111,119,59,1,8644,101,105,108,105,110,103,59,1,8969,111,4,2,117,119,4856,4869,98,108,101,66,114,97,99,107,101,116,59,1,10215,110,4,2,84,86,4876,4887,101,101,86,101,99,116,111,114,59,1,10589,101,99,116,111,114,4,2,59,66,4898,4900,1,8642,97,114,59,1,10581,108,111,111,114,59,1,8971,4,2,101,114,4918,4944,101,4,3,59,65,86,4927,4929,4936,1,8866,114,114,111,119,59,1,8614,101,99,116,111,114,59,1,10587,105,97,110,103,108,101,4,3,59,66,69,4958,4960,4965,1,8883,97,114,59,1,10704,113,117,97,108,59,1,8885,112,4,3,68,84,86,4981,4993,5004,111,119,110,86,101,99,116,111,114,59,1,10575,101,101,86,101,99,116,111,114,59,1,10588,101,99,116,111,114,4,2,59,66,5015,5017,1,8638,97,114,59,1,10580,101,99,116,111,114,4,2,59,66,5033,5035,1,8640,97,114,59,1,10579,114,114,111,119,59,1,8658,4,2,112,117,5053,5057,102,59,1,8477,110,100,73,109,112,108,105,101,115,59,1,10608,105,103,104,116,97,114,114,111,119,59,1,8667,4,2,99,104,5087,5091,114,59,1,8475,59,1,8625,108,101,68,101,108,97,121,101,100,59,1,10740,4,13,72,79,97,99,102,104,105,109,111,113,115,116,117,5134,5150,5157,5164,5198,5203,5259,5265,5277,5283,5374,5380,5385,4,2,67,99,5140,5146,72,99,121,59,1,1065,121,59,1,1064,70,84,99,121,59,1,1068,99,117,116,101,59,1,346,4,5,59,97,101,105,121,5176,5178,5184,5190,5195,1,10940,114,111,110,59,1,352,100,105,108,59,1,350,114,99,59,1,348,59,1,1057,114,59,3,55349,56598,111,114,116,4,4,68,76,82,85,5216,5227,5238,5250,111,119,110,65,114,114,111,119,59,1,8595,101,102,116,65,114,114,111,119,59,1,8592,105,103,104,116,65,114,114,111,119,59,1,8594,112,65,114,114,111,119,59,1,8593,103,109,97,59,1,931,97,108,108,67,105,114,99,108,101,59,1,8728,112,102,59,3,55349,56650,4,2,114,117,5289,5293,116,59,1,8730,97,114,101,4,4,59,73,83,85,5306,5308,5322,5367,1,9633,110,116,101,114,115,101,99,116,105,111,110,59,1,8851,117,4,2,98,112,5329,5347,115,101,116,4,2,59,69,5338,5340,1,8847,113,117,97,108,59,1,8849,101,114,115,101,116,4,2,59,69,5358,5360,1,8848,113,117,97,108,59,1,8850,110,105,111,110,59,1,8852,99,114,59,3,55349,56494,97,114,59,1,8902,4,4,98,99,109,112,5395,5420,5475,5478,4,2,59,115,5401,5403,1,8912,101,116,4,2,59,69,5411,5413,1,8912,113,117,97,108,59,1,8838,4,2,99,104,5426,5468,101,101,100,115,4,4,59,69,83,84,5440,5442,5449,5461,1,8827,113,117,97,108,59,1,10928,108,97,110,116,69,113,117,97,108,59,1,8829,105,108,100,101,59,1,8831,84,104,97,116,59,1,8715,59,1,8721,4,3,59,101,115,5486,5488,5507,1,8913,114,115,101,116,4,2,59,69,5498,5500,1,8835,113,117,97,108,59,1,8839,101,116,59,1,8913,4,11,72,82,83,97,99,102,104,105,111,114,115,5536,5546,5552,5567,5579,5602,5607,5655,5695,5701,5711,79,82,78,5,222,1,59,5544,1,222,65,68,69,59,1,8482,4,2,72,99,5558,5563,99,121,59,1,1035,121,59,1,1062,4,2,98,117,5573,5576,59,1,9,59,1,932,4,3,97,101,121,5587,5593,5599,114,111,110,59,1,356,100,105,108,59,1,354,59,1,1058,114,59,3,55349,56599,4,2,101,105,5613,5631,4,2,114,116,5619,5627,101,102,111,114,101,59,1,8756,97,59,1,920,4,2,99,110,5637,5647,107,83,112,97,99,101,59,3,8287,8202,83,112,97,99,101,59,1,8201,108,100,101,4,4,59,69,70,84,5668,5670,5677,5688,1,8764,113,117,97,108,59,1,8771,117,108,108,69,113,117,97,108,59,1,8773,105,108,100,101,59,1,8776,112,102,59,3,55349,56651,105,112,108,101,68,111,116,59,1,8411,4,2,99,116,5717,5722,114,59,3,55349,56495,114,111,107,59,1,358,4,14,97,98,99,100,102,103,109,110,111,112,114,115,116,117,5758,5789,5805,5823,5830,5835,5846,5852,5921,5937,6089,6095,6101,6108,4,2,99,114,5764,5774,117,116,101,5,218,1,59,5772,1,218,114,4,2,59,111,5781,5783,1,8607,99,105,114,59,1,10569,114,4,2,99,101,5796,5800,121,59,1,1038,118,101,59,1,364,4,2,105,121,5811,5820,114,99,5,219,1,59,5818,1,219,59,1,1059,98,108,97,99,59,1,368,114,59,3,55349,56600,114,97,118,101,5,217,1,59,5844,1,217,97,99,114,59,1,362,4,2,100,105,5858,5905,101,114,4,2,66,80,5866,5892,4,2,97,114,5872,5876,114,59,1,95,97,99,4,2,101,107,5884,5887,59,1,9183,101,116,59,1,9141,97,114,101,110,116,104,101,115,105,115,59,1,9181,111,110,4,2,59,80,5913,5915,1,8899,108,117,115,59,1,8846,4,2,103,112,5927,5932,111,110,59,1,370,102,59,3,55349,56652,4,8,65,68,69,84,97,100,112,115,5955,5985,5996,6009,6026,6033,6044,6075,114,114,111,119,4,3,59,66,68,5967,5969,5974,1,8593,97,114,59,1,10514,111,119,110,65,114,114,111,119,59,1,8645,111,119,110,65,114,114,111,119,59,1,8597,113,117,105,108,105,98,114,105,117,109,59,1,10606,101,101,4,2,59,65,6017,6019,1,8869,114,114,111,119,59,1,8613,114,114,111,119,59,1,8657,111,119,110,97,114,114,111,119,59,1,8661,101,114,4,2,76,82,6052,6063,101,102,116,65,114,114,111,119,59,1,8598,105,103,104,116,65,114,114,111,119,59,1,8599,105,4,2,59,108,6082,6084,1,978,111,110,59,1,933,105,110,103,59,1,366,99,114,59,3,55349,56496,105,108,100,101,59,1,360,109,108,5,220,1,59,6115,1,220,4,9,68,98,99,100,101,102,111,115,118,6137,6143,6148,6152,6166,6250,6255,6261,6267,97,115,104,59,1,8875,97,114,59,1,10987,121,59,1,1042,97,115,104,4,2,59,108,6161,6163,1,8873,59,1,10982,4,2,101,114,6172,6175,59,1,8897,4,3,98,116,121,6183,6188,6238,97,114,59,1,8214,4,2,59,105,6194,6196,1,8214,99,97,108,4,4,66,76,83,84,6209,6214,6220,6231,97,114,59,1,8739,105,110,101,59,1,124,101,112,97,114,97,116,111,114,59,1,10072,105,108,100,101,59,1,8768,84,104,105,110,83,112,97,99,101,59,1,8202,114,59,3,55349,56601,112,102,59,3,55349,56653,99,114,59,3,55349,56497,100,97,115,104,59,1,8874,4,5,99,101,102,111,115,6286,6292,6298,6303,6309,105,114,99,59,1,372,100,103,101,59,1,8896,114,59,3,55349,56602,112,102,59,3,55349,56654,99,114,59,3,55349,56498,4,4,102,105,111,115,6325,6330,6333,6339,114,59,3,55349,56603,59,1,926,112,102,59,3,55349,56655,99,114,59,3,55349,56499,4,9,65,73,85,97,99,102,111,115,117,6365,6370,6375,6380,6391,6405,6410,6416,6422,99,121,59,1,1071,99,121,59,1,1031,99,121,59,1,1070,99,117,116,101,5,221,1,59,6389,1,221,4,2,105,121,6397,6402,114,99,59,1,374,59,1,1067,114,59,3,55349,56604,112,102,59,3,55349,56656,99,114,59,3,55349,56500,109,108,59,1,376,4,8,72,97,99,100,101,102,111,115,6445,6450,6457,6472,6477,6501,6505,6510,99,121,59,1,1046,99,117,116,101,59,1,377,4,2,97,121,6463,6469,114,111,110,59,1,381,59,1,1047,111,116,59,1,379,4,2,114,116,6483,6497,111,87,105,100,116,104,83,112,97,99,101,59,1,8203,97,59,1,918,114,59,1,8488,112,102,59,1,8484,99,114,59,3,55349,56501,4,16,97,98,99,101,102,103,108,109,110,111,112,114,115,116,117,119,6550,6561,6568,6612,6622,6634,6645,6672,6699,6854,6870,6923,6933,6963,6974,6983,99,117,116,101,5,225,1,59,6559,1,225,114,101,118,101,59,1,259,4,6,59,69,100,105,117,121,6582,6584,6588,6591,6600,6609,1,8766,59,3,8766,819,59,1,8767,114,99,5,226,1,59,6598,1,226,116,101,5,180,1,59,6607,1,180,59,1,1072,108,105,103,5,230,1,59,6620,1,230,4,2,59,114,6628,6630,1,8289,59,3,55349,56606,114,97,118,101,5,224,1,59,6643,1,224,4,2,101,112,6651,6667,4,2,102,112,6657,6663,115,121,109,59,1,8501,104,59,1,8501,104,97,59,1,945,4,2,97,112,6678,6692,4,2,99,108,6684,6688,114,59,1,257,103,59,1,10815,5,38,1,59,6697,1,38,4,2,100,103,6705,6737,4,5,59,97,100,115,118,6717,6719,6724,6727,6734,1,8743,110,100,59,1,10837,59,1,10844,108,111,112,101,59,1,10840,59,1,10842,4,7,59,101,108,109,114,115,122,6753,6755,6758,6762,6814,6835,6848,1,8736,59,1,10660,101,59,1,8736,115,100,4,2,59,97,6770,6772,1,8737,4,8,97,98,99,100,101,102,103,104,6790,6793,6796,6799,6802,6805,6808,6811,59,1,10664,59,1,10665,59,1,10666,59,1,10667,59,1,10668,59,1,10669,59,1,10670,59,1,10671,116,4,2,59,118,6821,6823,1,8735,98,4,2,59,100,6830,6832,1,8894,59,1,10653,4,2,112,116,6841,6845,104,59,1,8738,59,1,197,97,114,114,59,1,9084,4,2,103,112,6860,6865,111,110,59,1,261,102,59,3,55349,56658,4,7,59,69,97,101,105,111,112,6886,6888,6891,6897,6900,6904,6908,1,8776,59,1,10864,99,105,114,59,1,10863,59,1,8778,100,59,1,8779,115,59,1,39,114,111,120,4,2,59,101,6917,6919,1,8776,113,59,1,8778,105,110,103,5,229,1,59,6931,1,229,4,3,99,116,121,6941,6946,6949,114,59,3,55349,56502,59,1,42,109,112,4,2,59,101,6957,6959,1,8776,113,59,1,8781,105,108,100,101,5,227,1,59,6972,1,227,109,108,5,228,1,59,6981,1,228,4,2,99,105,6989,6997,111,110,105,110,116,59,1,8755,110,116,59,1,10769,4,16,78,97,98,99,100,101,102,105,107,108,110,111,112,114,115,117,7036,7041,7119,7135,7149,7155,7219,7224,7347,7354,7463,7489,7786,7793,7814,7866,111,116,59,1,10989,4,2,99,114,7047,7094,107,4,4,99,101,112,115,7058,7064,7073,7080,111,110,103,59,1,8780,112,115,105,108,111,110,59,1,1014,114,105,109,101,59,1,8245,105,109,4,2,59,101,7088,7090,1,8765,113,59,1,8909,4,2,118,119,7100,7105,101,101,59,1,8893,101,100,4,2,59,103,7113,7115,1,8965,101,59,1,8965,114,107,4,2,59,116,7127,7129,1,9141,98,114,107,59,1,9142,4,2,111,121,7141,7146,110,103,59,1,8780,59,1,1073,113,117,111,59,1,8222,4,5,99,109,112,114,116,7167,7181,7188,7193,7199,97,117,115,4,2,59,101,7176,7178,1,8757,59,1,8757,112,116,121,118,59,1,10672,115,105,59,1,1014,110,111,117,59,1,8492,4,3,97,104,119,7207,7210,7213,59,1,946,59,1,8502,101,101,110,59,1,8812,114,59,3,55349,56607,103,4,7,99,111,115,116,117,118,119,7241,7262,7288,7305,7328,7335,7340,4,3,97,105,117,7249,7253,7258,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,4,3,100,112,116,7270,7275,7281,111,116,59,1,10752,108,117,115,59,1,10753,105,109,101,115,59,1,10754,4,2,113,116,7294,7300,99,117,112,59,1,10758,97,114,59,1,9733,114,105,97,110,103,108,101,4,2,100,117,7318,7324,111,119,110,59,1,9661,112,59,1,9651,112,108,117,115,59,1,10756,101,101,59,1,8897,101,100,103,101,59,1,8896,97,114,111,119,59,1,10509,4,3,97,107,111,7362,7436,7458,4,2,99,110,7368,7432,107,4,3,108,115,116,7377,7386,7394,111,122,101,110,103,101,59,1,10731,113,117,97,114,101,59,1,9642,114,105,97,110,103,108,101,4,4,59,100,108,114,7411,7413,7419,7425,1,9652,111,119,110,59,1,9662,101,102,116,59,1,9666,105,103,104,116,59,1,9656,107,59,1,9251,4,2,49,51,7442,7454,4,2,50,52,7448,7451,59,1,9618,59,1,9617,52,59,1,9619,99,107,59,1,9608,4,2,101,111,7469,7485,4,2,59,113,7475,7478,3,61,8421,117,105,118,59,3,8801,8421,116,59,1,8976,4,4,112,116,119,120,7499,7504,7517,7523,102,59,3,55349,56659,4,2,59,116,7510,7512,1,8869,111,109,59,1,8869,116,105,101,59,1,8904,4,12,68,72,85,86,98,100,104,109,112,116,117,118,7549,7571,7597,7619,7655,7660,7682,7708,7715,7721,7728,7750,4,4,76,82,108,114,7559,7562,7565,7568,59,1,9559,59,1,9556,59,1,9558,59,1,9555,4,5,59,68,85,100,117,7583,7585,7588,7591,7594,1,9552,59,1,9574,59,1,9577,59,1,9572,59,1,9575,4,4,76,82,108,114,7607,7610,7613,7616,59,1,9565,59,1,9562,59,1,9564,59,1,9561,4,7,59,72,76,82,104,108,114,7635,7637,7640,7643,7646,7649,7652,1,9553,59,1,9580,59,1,9571,59,1,9568,59,1,9579,59,1,9570,59,1,9567,111,120,59,1,10697,4,4,76,82,108,114,7670,7673,7676,7679,59,1,9557,59,1,9554,59,1,9488,59,1,9484,4,5,59,68,85,100,117,7694,7696,7699,7702,7705,1,9472,59,1,9573,59,1,9576,59,1,9516,59,1,9524,105,110,117,115,59,1,8863,108,117,115,59,1,8862,105,109,101,115,59,1,8864,4,4,76,82,108,114,7738,7741,7744,7747,59,1,9563,59,1,9560,59,1,9496,59,1,9492,4,7,59,72,76,82,104,108,114,7766,7768,7771,7774,7777,7780,7783,1,9474,59,1,9578,59,1,9569,59,1,9566,59,1,9532,59,1,9508,59,1,9500,114,105,109,101,59,1,8245,4,2,101,118,7799,7804,118,101,59,1,728,98,97,114,5,166,1,59,7812,1,166,4,4,99,101,105,111,7824,7829,7834,7846,114,59,3,55349,56503,109,105,59,1,8271,109,4,2,59,101,7841,7843,1,8765,59,1,8909,108,4,3,59,98,104,7855,7857,7860,1,92,59,1,10693,115,117,98,59,1,10184,4,2,108,109,7872,7885,108,4,2,59,101,7879,7881,1,8226,116,59,1,8226,112,4,3,59,69,101,7894,7896,7899,1,8782,59,1,10926,4,2,59,113,7905,7907,1,8783,59,1,8783,4,15,97,99,100,101,102,104,105,108,111,114,115,116,117,119,121,7942,8021,8075,8080,8121,8126,8157,8279,8295,8430,8446,8485,8491,8707,8726,4,3,99,112,114,7950,7956,8007,117,116,101,59,1,263,4,6,59,97,98,99,100,115,7970,7972,7977,7984,7998,8003,1,8745,110,100,59,1,10820,114,99,117,112,59,1,10825,4,2,97,117,7990,7994,112,59,1,10827,112,59,1,10823,111,116,59,1,10816,59,3,8745,65024,4,2,101,111,8013,8017,116,59,1,8257,110,59,1,711,4,4,97,101,105,117,8031,8046,8056,8061,4,2,112,114,8037,8041,115,59,1,10829,111,110,59,1,269,100,105,108,5,231,1,59,8054,1,231,114,99,59,1,265,112,115,4,2,59,115,8069,8071,1,10828,109,59,1,10832,111,116,59,1,267,4,3,100,109,110,8088,8097,8104,105,108,5,184,1,59,8095,1,184,112,116,121,118,59,1,10674,116,5,162,2,59,101,8112,8114,1,162,114,100,111,116,59,1,183,114,59,3,55349,56608,4,3,99,101,105,8134,8138,8154,121,59,1,1095,99,107,4,2,59,109,8146,8148,1,10003,97,114,107,59,1,10003,59,1,967,114,4,7,59,69,99,101,102,109,115,8174,8176,8179,8258,8261,8268,8273,1,9675,59,1,10691,4,3,59,101,108,8187,8189,8193,1,710,113,59,1,8791,101,4,2,97,100,8200,8223,114,114,111,119,4,2,108,114,8210,8216,101,102,116,59,1,8634,105,103,104,116,59,1,8635,4,5,82,83,97,99,100,8235,8238,8241,8246,8252,59,1,174,59,1,9416,115,116,59,1,8859,105,114,99,59,1,8858,97,115,104,59,1,8861,59,1,8791,110,105,110,116,59,1,10768,105,100,59,1,10991,99,105,114,59,1,10690,117,98,115,4,2,59,117,8288,8290,1,9827,105,116,59,1,9827,4,4,108,109,110,112,8305,8326,8376,8400,111,110,4,2,59,101,8313,8315,1,58,4,2,59,113,8321,8323,1,8788,59,1,8788,4,2,109,112,8332,8344,97,4,2,59,116,8339,8341,1,44,59,1,64,4,3,59,102,108,8352,8354,8358,1,8705,110,59,1,8728,101,4,2,109,120,8365,8371,101,110,116,59,1,8705,101,115,59,1,8450,4,2,103,105,8382,8395,4,2,59,100,8388,8390,1,8773,111,116,59,1,10861,110,116,59,1,8750,4,3,102,114,121,8408,8412,8417,59,3,55349,56660,111,100,59,1,8720,5,169,2,59,115,8424,8426,1,169,114,59,1,8471,4,2,97,111,8436,8441,114,114,59,1,8629,115,115,59,1,10007,4,2,99,117,8452,8457,114,59,3,55349,56504,4,2,98,112,8463,8474,4,2,59,101,8469,8471,1,10959,59,1,10961,4,2,59,101,8480,8482,1,10960,59,1,10962,100,111,116,59,1,8943,4,7,100,101,108,112,114,118,119,8507,8522,8536,8550,8600,8697,8702,97,114,114,4,2,108,114,8516,8519,59,1,10552,59,1,10549,4,2,112,115,8528,8532,114,59,1,8926,99,59,1,8927,97,114,114,4,2,59,112,8545,8547,1,8630,59,1,10557,4,6,59,98,99,100,111,115,8564,8566,8573,8587,8592,8596,1,8746,114,99,97,112,59,1,10824,4,2,97,117,8579,8583,112,59,1,10822,112,59,1,10826,111,116,59,1,8845,114,59,1,10821,59,3,8746,65024,4,4,97,108,114,118,8610,8623,8663,8672,114,114,4,2,59,109,8618,8620,1,8631,59,1,10556,121,4,3,101,118,119,8632,8651,8656,113,4,2,112,115,8639,8645,114,101,99,59,1,8926,117,99,99,59,1,8927,101,101,59,1,8910,101,100,103,101,59,1,8911,101,110,5,164,1,59,8670,1,164,101,97,114,114,111,119,4,2,108,114,8684,8690,101,102,116,59,1,8630,105,103,104,116,59,1,8631,101,101,59,1,8910,101,100,59,1,8911,4,2,99,105,8713,8721,111,110,105,110,116,59,1,8754,110,116,59,1,8753,108,99,116,121,59,1,9005,4,19,65,72,97,98,99,100,101,102,104,105,106,108,111,114,115,116,117,119,122,8773,8778,8783,8821,8839,8854,8887,8914,8930,8944,9036,9041,9058,9197,9227,9258,9281,9297,9305,114,114,59,1,8659,97,114,59,1,10597,4,4,103,108,114,115,8793,8799,8805,8809,103,101,114,59,1,8224,101,116,104,59,1,8504,114,59,1,8595,104,4,2,59,118,8816,8818,1,8208,59,1,8867,4,2,107,108,8827,8834,97,114,111,119,59,1,10511,97,99,59,1,733,4,2,97,121,8845,8851,114,111,110,59,1,271,59,1,1076,4,3,59,97,111,8862,8864,8880,1,8518,4,2,103,114,8870,8876,103,101,114,59,1,8225,114,59,1,8650,116,115,101,113,59,1,10871,4,3,103,108,109,8895,8902,8907,5,176,1,59,8900,1,176,116,97,59,1,948,112,116,121,118,59,1,10673,4,2,105,114,8920,8926,115,104,116,59,1,10623,59,3,55349,56609,97,114,4,2,108,114,8938,8941,59,1,8643,59,1,8642,4,5,97,101,103,115,118,8956,8986,8989,8996,9001,109,4,3,59,111,115,8965,8967,8983,1,8900,110,100,4,2,59,115,8975,8977,1,8900,117,105,116,59,1,9830,59,1,9830,59,1,168,97,109,109,97,59,1,989,105,110,59,1,8946,4,3,59,105,111,9009,9011,9031,1,247,100,101,5,247,2,59,111,9020,9022,1,247,110,116,105,109,101,115,59,1,8903,110,120,59,1,8903,99,121,59,1,1106,99,4,2,111,114,9048,9053,114,110,59,1,8990,111,112,59,1,8973,4,5,108,112,116,117,119,9070,9076,9081,9130,9144,108,97,114,59,1,36,102,59,3,55349,56661,4,5,59,101,109,112,115,9093,9095,9109,9116,9122,1,729,113,4,2,59,100,9102,9104,1,8784,111,116,59,1,8785,105,110,117,115,59,1,8760,108,117,115,59,1,8724,113,117,97,114,101,59,1,8865,98,108,101,98,97,114,119,101,100,103,101,59,1,8966,110,4,3,97,100,104,9153,9160,9172,114,114,111,119,59,1,8595,111,119,110,97,114,114,111,119,115,59,1,8650,97,114,112,111,111,110,4,2,108,114,9184,9190,101,102,116,59,1,8643,105,103,104,116,59,1,8642,4,2,98,99,9203,9211,107,97,114,111,119,59,1,10512,4,2,111,114,9217,9222,114,110,59,1,8991,111,112,59,1,8972,4,3,99,111,116,9235,9248,9252,4,2,114,121,9241,9245,59,3,55349,56505,59,1,1109,108,59,1,10742,114,111,107,59,1,273,4,2,100,114,9264,9269,111,116,59,1,8945,105,4,2,59,102,9276,9278,1,9663,59,1,9662,4,2,97,104,9287,9292,114,114,59,1,8693,97,114,59,1,10607,97,110,103,108,101,59,1,10662,4,2,99,105,9311,9315,121,59,1,1119,103,114,97,114,114,59,1,10239,4,18,68,97,99,100,101,102,103,108,109,110,111,112,113,114,115,116,117,120,9361,9376,9398,9439,9444,9447,9462,9495,9531,9585,9598,9614,9659,9755,9771,9792,9808,9826,4,2,68,111,9367,9372,111,116,59,1,10871,116,59,1,8785,4,2,99,115,9382,9392,117,116,101,5,233,1,59,9390,1,233,116,101,114,59,1,10862,4,4,97,105,111,121,9408,9414,9430,9436,114,111,110,59,1,283,114,4,2,59,99,9421,9423,1,8790,5,234,1,59,9428,1,234,108,111,110,59,1,8789,59,1,1101,111,116,59,1,279,59,1,8519,4,2,68,114,9453,9458,111,116,59,1,8786,59,3,55349,56610,4,3,59,114,115,9470,9472,9482,1,10906,97,118,101,5,232,1,59,9480,1,232,4,2,59,100,9488,9490,1,10902,111,116,59,1,10904,4,4,59,105,108,115,9505,9507,9515,9518,1,10905,110,116,101,114,115,59,1,9191,59,1,8467,4,2,59,100,9524,9526,1,10901,111,116,59,1,10903,4,3,97,112,115,9539,9544,9564,99,114,59,1,275,116,121,4,3,59,115,118,9554,9556,9561,1,8709,101,116,59,1,8709,59,1,8709,112,4,2,49,59,9571,9583,4,2,51,52,9577,9580,59,1,8196,59,1,8197,1,8195,4,2,103,115,9591,9594,59,1,331,112,59,1,8194,4,2,103,112,9604,9609,111,110,59,1,281,102,59,3,55349,56662,4,3,97,108,115,9622,9635,9640,114,4,2,59,115,9629,9631,1,8917,108,59,1,10723,117,115,59,1,10865,105,4,3,59,108,118,9649,9651,9656,1,949,111,110,59,1,949,59,1,1013,4,4,99,115,117,118,9669,9686,9716,9747,4,2,105,111,9675,9680,114,99,59,1,8790,108,111,110,59,1,8789,4,2,105,108,9692,9696,109,59,1,8770,97,110,116,4,2,103,108,9705,9710,116,114,59,1,10902,101,115,115,59,1,10901,4,3,97,101,105,9724,9729,9734,108,115,59,1,61,115,116,59,1,8799,118,4,2,59,68,9741,9743,1,8801,68,59,1,10872,112,97,114,115,108,59,1,10725,4,2,68,97,9761,9766,111,116,59,1,8787,114,114,59,1,10609,4,3,99,100,105,9779,9783,9788,114,59,1,8495,111,116,59,1,8784,109,59,1,8770,4,2,97,104,9798,9801,59,1,951,5,240,1,59,9806,1,240,4,2,109,114,9814,9822,108,5,235,1,59,9820,1,235,111,59,1,8364,4,3,99,105,112,9834,9838,9843,108,59,1,33,115,116,59,1,8707,4,2,101,111,9849,9859,99,116,97,116,105,111,110,59,1,8496,110,101,110,116,105,97,108,101,59,1,8519,4,12,97,99,101,102,105,106,108,110,111,112,114,115,9896,9910,9914,9921,9954,9960,9967,9989,9994,10027,10036,10164,108,108,105,110,103,100,111,116,115,101,113,59,1,8786,121,59,1,1092,109,97,108,101,59,1,9792,4,3,105,108,114,9929,9935,9950,108,105,103,59,1,64259,4,2,105,108,9941,9945,103,59,1,64256,105,103,59,1,64260,59,3,55349,56611,108,105,103,59,1,64257,108,105,103,59,3,102,106,4,3,97,108,116,9975,9979,9984,116,59,1,9837,105,103,59,1,64258,110,115,59,1,9649,111,102,59,1,402,4,2,112,114,1e4,10005,102,59,3,55349,56663,4,2,97,107,10011,10016,108,108,59,1,8704,4,2,59,118,10022,10024,1,8916,59,1,10969,97,114,116,105,110,116,59,1,10765,4,2,97,111,10042,10159,4,2,99,115,10048,10155,4,6,49,50,51,52,53,55,10062,10102,10114,10135,10139,10151,4,6,50,51,52,53,54,56,10076,10083,10086,10093,10096,10099,5,189,1,59,10081,1,189,59,1,8531,5,188,1,59,10091,1,188,59,1,8533,59,1,8537,59,1,8539,4,2,51,53,10108,10111,59,1,8532,59,1,8534,4,3,52,53,56,10122,10129,10132,5,190,1,59,10127,1,190,59,1,8535,59,1,8540,53,59,1,8536,4,2,54,56,10145,10148,59,1,8538,59,1,8541,56,59,1,8542,108,59,1,8260,119,110,59,1,8994,99,114,59,3,55349,56507,4,17,69,97,98,99,100,101,102,103,105,106,108,110,111,114,115,116,118,10206,10217,10247,10254,10268,10273,10358,10363,10374,10380,10385,10406,10458,10464,10470,10497,10610,4,2,59,108,10212,10214,1,8807,59,1,10892,4,3,99,109,112,10225,10231,10244,117,116,101,59,1,501,109,97,4,2,59,100,10239,10241,1,947,59,1,989,59,1,10886,114,101,118,101,59,1,287,4,2,105,121,10260,10265,114,99,59,1,285,59,1,1075,111,116,59,1,289,4,4,59,108,113,115,10283,10285,10288,10308,1,8805,59,1,8923,4,3,59,113,115,10296,10298,10301,1,8805,59,1,8807,108,97,110,116,59,1,10878,4,4,59,99,100,108,10318,10320,10324,10345,1,10878,99,59,1,10921,111,116,4,2,59,111,10332,10334,1,10880,4,2,59,108,10340,10342,1,10882,59,1,10884,4,2,59,101,10351,10354,3,8923,65024,115,59,1,10900,114,59,3,55349,56612,4,2,59,103,10369,10371,1,8811,59,1,8921,109,101,108,59,1,8503,99,121,59,1,1107,4,4,59,69,97,106,10395,10397,10400,10403,1,8823,59,1,10898,59,1,10917,59,1,10916,4,4,69,97,101,115,10416,10419,10434,10453,59,1,8809,112,4,2,59,112,10426,10428,1,10890,114,111,120,59,1,10890,4,2,59,113,10440,10442,1,10888,4,2,59,113,10448,10450,1,10888,59,1,8809,105,109,59,1,8935,112,102,59,3,55349,56664,97,118,101,59,1,96,4,2,99,105,10476,10480,114,59,1,8458,109,4,3,59,101,108,10489,10491,10494,1,8819,59,1,10894,59,1,10896,5,62,6,59,99,100,108,113,114,10512,10514,10527,10532,10538,10545,1,62,4,2,99,105,10520,10523,59,1,10919,114,59,1,10874,111,116,59,1,8919,80,97,114,59,1,10645,117,101,115,116,59,1,10876,4,5,97,100,101,108,115,10557,10574,10579,10599,10605,4,2,112,114,10563,10570,112,114,111,120,59,1,10886,114,59,1,10616,111,116,59,1,8919,113,4,2,108,113,10586,10592,101,115,115,59,1,8923,108,101,115,115,59,1,10892,101,115,115,59,1,8823,105,109,59,1,8819,4,2,101,110,10616,10626,114,116,110,101,113,113,59,3,8809,65024,69,59,3,8809,65024,4,10,65,97,98,99,101,102,107,111,115,121,10653,10658,10713,10718,10724,10760,10765,10786,10850,10875,114,114,59,1,8660,4,4,105,108,109,114,10668,10674,10678,10684,114,115,112,59,1,8202,102,59,1,189,105,108,116,59,1,8459,4,2,100,114,10690,10695,99,121,59,1,1098,4,3,59,99,119,10703,10705,10710,1,8596,105,114,59,1,10568,59,1,8621,97,114,59,1,8463,105,114,99,59,1,293,4,3,97,108,114,10732,10748,10754,114,116,115,4,2,59,117,10741,10743,1,9829,105,116,59,1,9829,108,105,112,59,1,8230,99,111,110,59,1,8889,114,59,3,55349,56613,115,4,2,101,119,10772,10779,97,114,111,119,59,1,10533,97,114,111,119,59,1,10534,4,5,97,109,111,112,114,10798,10803,10809,10839,10844,114,114,59,1,8703,116,104,116,59,1,8763,107,4,2,108,114,10816,10827,101,102,116,97,114,114,111,119,59,1,8617,105,103,104,116,97,114,114,111,119,59,1,8618,102,59,3,55349,56665,98,97,114,59,1,8213,4,3,99,108,116,10858,10863,10869,114,59,3,55349,56509,97,115,104,59,1,8463,114,111,107,59,1,295,4,2,98,112,10881,10887,117,108,108,59,1,8259,104,101,110,59,1,8208,4,15,97,99,101,102,103,105,106,109,110,111,112,113,115,116,117,10925,10936,10958,10977,10990,11001,11039,11045,11101,11192,11220,11226,11237,11285,11299,99,117,116,101,5,237,1,59,10934,1,237,4,3,59,105,121,10944,10946,10955,1,8291,114,99,5,238,1,59,10953,1,238,59,1,1080,4,2,99,120,10964,10968,121,59,1,1077,99,108,5,161,1,59,10975,1,161,4,2,102,114,10983,10986,59,1,8660,59,3,55349,56614,114,97,118,101,5,236,1,59,10999,1,236,4,4,59,105,110,111,11011,11013,11028,11034,1,8520,4,2,105,110,11019,11024,110,116,59,1,10764,116,59,1,8749,102,105,110,59,1,10716,116,97,59,1,8489,108,105,103,59,1,307,4,3,97,111,112,11053,11092,11096,4,3,99,103,116,11061,11065,11088,114,59,1,299,4,3,101,108,112,11073,11076,11082,59,1,8465,105,110,101,59,1,8464,97,114,116,59,1,8465,104,59,1,305,102,59,1,8887,101,100,59,1,437,4,5,59,99,102,111,116,11113,11115,11121,11136,11142,1,8712,97,114,101,59,1,8453,105,110,4,2,59,116,11129,11131,1,8734,105,101,59,1,10717,100,111,116,59,1,305,4,5,59,99,101,108,112,11154,11156,11161,11179,11186,1,8747,97,108,59,1,8890,4,2,103,114,11167,11173,101,114,115,59,1,8484,99,97,108,59,1,8890,97,114,104,107,59,1,10775,114,111,100,59,1,10812,4,4,99,103,112,116,11202,11206,11211,11216,121,59,1,1105,111,110,59,1,303,102,59,3,55349,56666,97,59,1,953,114,111,100,59,1,10812,117,101,115,116,5,191,1,59,11235,1,191,4,2,99,105,11243,11248,114,59,3,55349,56510,110,4,5,59,69,100,115,118,11261,11263,11266,11271,11282,1,8712,59,1,8953,111,116,59,1,8949,4,2,59,118,11277,11279,1,8948,59,1,8947,59,1,8712,4,2,59,105,11291,11293,1,8290,108,100,101,59,1,297,4,2,107,109,11305,11310,99,121,59,1,1110,108,5,239,1,59,11316,1,239,4,6,99,102,109,111,115,117,11332,11346,11351,11357,11363,11380,4,2,105,121,11338,11343,114,99,59,1,309,59,1,1081,114,59,3,55349,56615,97,116,104,59,1,567,112,102,59,3,55349,56667,4,2,99,101,11369,11374,114,59,3,55349,56511,114,99,121,59,1,1112,107,99,121,59,1,1108,4,8,97,99,102,103,104,106,111,115,11404,11418,11433,11438,11445,11450,11455,11461,112,112,97,4,2,59,118,11413,11415,1,954,59,1,1008,4,2,101,121,11424,11430,100,105,108,59,1,311,59,1,1082,114,59,3,55349,56616,114,101,101,110,59,1,312,99,121,59,1,1093,99,121,59,1,1116,112,102,59,3,55349,56668,99,114,59,3,55349,56512,4,23,65,66,69,72,97,98,99,100,101,102,103,104,106,108,109,110,111,112,114,115,116,117,118,11515,11538,11544,11555,11560,11721,11780,11818,11868,12136,12160,12171,12203,12208,12246,12275,12327,12509,12523,12569,12641,12732,12752,4,3,97,114,116,11523,11528,11532,114,114,59,1,8666,114,59,1,8656,97,105,108,59,1,10523,97,114,114,59,1,10510,4,2,59,103,11550,11552,1,8806,59,1,10891,97,114,59,1,10594,4,9,99,101,103,109,110,112,113,114,116,11580,11586,11594,11600,11606,11624,11627,11636,11694,117,116,101,59,1,314,109,112,116,121,118,59,1,10676,114,97,110,59,1,8466,98,100,97,59,1,955,103,4,3,59,100,108,11615,11617,11620,1,10216,59,1,10641,101,59,1,10216,59,1,10885,117,111,5,171,1,59,11634,1,171,114,4,8,59,98,102,104,108,112,115,116,11655,11657,11669,11673,11677,11681,11685,11690,1,8592,4,2,59,102,11663,11665,1,8676,115,59,1,10527,115,59,1,10525,107,59,1,8617,112,59,1,8619,108,59,1,10553,105,109,59,1,10611,108,59,1,8610,4,3,59,97,101,11702,11704,11709,1,10923,105,108,59,1,10521,4,2,59,115,11715,11717,1,10925,59,3,10925,65024,4,3,97,98,114,11729,11734,11739,114,114,59,1,10508,114,107,59,1,10098,4,2,97,107,11745,11758,99,4,2,101,107,11752,11755,59,1,123,59,1,91,4,2,101,115,11764,11767,59,1,10635,108,4,2,100,117,11774,11777,59,1,10639,59,1,10637,4,4,97,101,117,121,11790,11796,11811,11815,114,111,110,59,1,318,4,2,100,105,11802,11807,105,108,59,1,316,108,59,1,8968,98,59,1,123,59,1,1083,4,4,99,113,114,115,11828,11832,11845,11864,97,59,1,10550,117,111,4,2,59,114,11840,11842,1,8220,59,1,8222,4,2,100,117,11851,11857,104,97,114,59,1,10599,115,104,97,114,59,1,10571,104,59,1,8626,4,5,59,102,103,113,115,11880,11882,12008,12011,12031,1,8804,116,4,5,97,104,108,114,116,11895,11913,11935,11947,11996,114,114,111,119,4,2,59,116,11905,11907,1,8592,97,105,108,59,1,8610,97,114,112,111,111,110,4,2,100,117,11925,11931,111,119,110,59,1,8637,112,59,1,8636,101,102,116,97,114,114,111,119,115,59,1,8647,105,103,104,116,4,3,97,104,115,11959,11974,11984,114,114,111,119,4,2,59,115,11969,11971,1,8596,59,1,8646,97,114,112,111,111,110,115,59,1,8651,113,117,105,103,97,114,114,111,119,59,1,8621,104,114,101,101,116,105,109,101,115,59,1,8907,59,1,8922,4,3,59,113,115,12019,12021,12024,1,8804,59,1,8806,108,97,110,116,59,1,10877,4,5,59,99,100,103,115,12043,12045,12049,12070,12083,1,10877,99,59,1,10920,111,116,4,2,59,111,12057,12059,1,10879,4,2,59,114,12065,12067,1,10881,59,1,10883,4,2,59,101,12076,12079,3,8922,65024,115,59,1,10899,4,5,97,100,101,103,115,12095,12103,12108,12126,12131,112,112,114,111,120,59,1,10885,111,116,59,1,8918,113,4,2,103,113,12115,12120,116,114,59,1,8922,103,116,114,59,1,10891,116,114,59,1,8822,105,109,59,1,8818,4,3,105,108,114,12144,12150,12156,115,104,116,59,1,10620,111,111,114,59,1,8970,59,3,55349,56617,4,2,59,69,12166,12168,1,8822,59,1,10897,4,2,97,98,12177,12198,114,4,2,100,117,12184,12187,59,1,8637,4,2,59,108,12193,12195,1,8636,59,1,10602,108,107,59,1,9604,99,121,59,1,1113,4,5,59,97,99,104,116,12220,12222,12227,12235,12241,1,8810,114,114,59,1,8647,111,114,110,101,114,59,1,8990,97,114,100,59,1,10603,114,105,59,1,9722,4,2,105,111,12252,12258,100,111,116,59,1,320,117,115,116,4,2,59,97,12267,12269,1,9136,99,104,101,59,1,9136,4,4,69,97,101,115,12285,12288,12303,12322,59,1,8808,112,4,2,59,112,12295,12297,1,10889,114,111,120,59,1,10889,4,2,59,113,12309,12311,1,10887,4,2,59,113,12317,12319,1,10887,59,1,8808,105,109,59,1,8934,4,8,97,98,110,111,112,116,119,122,12345,12359,12364,12421,12446,12467,12474,12490,4,2,110,114,12351,12355,103,59,1,10220,114,59,1,8701,114,107,59,1,10214,103,4,3,108,109,114,12373,12401,12409,101,102,116,4,2,97,114,12382,12389,114,114,111,119,59,1,10229,105,103,104,116,97,114,114,111,119,59,1,10231,97,112,115,116,111,59,1,10236,105,103,104,116,97,114,114,111,119,59,1,10230,112,97,114,114,111,119,4,2,108,114,12433,12439,101,102,116,59,1,8619,105,103,104,116,59,1,8620,4,3,97,102,108,12454,12458,12462,114,59,1,10629,59,3,55349,56669,117,115,59,1,10797,105,109,101,115,59,1,10804,4,2,97,98,12480,12485,115,116,59,1,8727,97,114,59,1,95,4,3,59,101,102,12498,12500,12506,1,9674,110,103,101,59,1,9674,59,1,10731,97,114,4,2,59,108,12517,12519,1,40,116,59,1,10643,4,5,97,99,104,109,116,12535,12540,12548,12561,12564,114,114,59,1,8646,111,114,110,101,114,59,1,8991,97,114,4,2,59,100,12556,12558,1,8651,59,1,10605,59,1,8206,114,105,59,1,8895,4,6,97,99,104,105,113,116,12583,12589,12594,12597,12614,12635,113,117,111,59,1,8249,114,59,3,55349,56513,59,1,8624,109,4,3,59,101,103,12606,12608,12611,1,8818,59,1,10893,59,1,10895,4,2,98,117,12620,12623,59,1,91,111,4,2,59,114,12630,12632,1,8216,59,1,8218,114,111,107,59,1,322,5,60,8,59,99,100,104,105,108,113,114,12660,12662,12675,12680,12686,12692,12698,12705,1,60,4,2,99,105,12668,12671,59,1,10918,114,59,1,10873,111,116,59,1,8918,114,101,101,59,1,8907,109,101,115,59,1,8905,97,114,114,59,1,10614,117,101,115,116,59,1,10875,4,2,80,105,12711,12716,97,114,59,1,10646,4,3,59,101,102,12724,12726,12729,1,9667,59,1,8884,59,1,9666,114,4,2,100,117,12739,12746,115,104,97,114,59,1,10570,104,97,114,59,1,10598,4,2,101,110,12758,12768,114,116,110,101,113,113,59,3,8808,65024,69,59,3,8808,65024,4,14,68,97,99,100,101,102,104,105,108,110,111,112,115,117,12803,12809,12893,12908,12914,12928,12933,12937,13011,13025,13032,13049,13052,13069,68,111,116,59,1,8762,4,4,99,108,112,114,12819,12827,12849,12887,114,5,175,1,59,12825,1,175,4,2,101,116,12833,12836,59,1,9794,4,2,59,101,12842,12844,1,10016,115,101,59,1,10016,4,2,59,115,12855,12857,1,8614,116,111,4,4,59,100,108,117,12869,12871,12877,12883,1,8614,111,119,110,59,1,8615,101,102,116,59,1,8612,112,59,1,8613,107,101,114,59,1,9646,4,2,111,121,12899,12905,109,109,97,59,1,10793,59,1,1084,97,115,104,59,1,8212,97,115,117,114,101,100,97,110,103,108,101,59,1,8737,114,59,3,55349,56618,111,59,1,8487,4,3,99,100,110,12945,12954,12985,114,111,5,181,1,59,12952,1,181,4,4,59,97,99,100,12964,12966,12971,12976,1,8739,115,116,59,1,42,105,114,59,1,10992,111,116,5,183,1,59,12983,1,183,117,115,4,3,59,98,100,12995,12997,13e3,1,8722,59,1,8863,4,2,59,117,13006,13008,1,8760,59,1,10794,4,2,99,100,13017,13021,112,59,1,10971,114,59,1,8230,112,108,117,115,59,1,8723,4,2,100,112,13038,13044,101,108,115,59,1,8871,102,59,3,55349,56670,59,1,8723,4,2,99,116,13058,13063,114,59,3,55349,56514,112,111,115,59,1,8766,4,3,59,108,109,13077,13079,13087,1,956,116,105,109,97,112,59,1,8888,97,112,59,1,8888,4,24,71,76,82,86,97,98,99,100,101,102,103,104,105,106,108,109,111,112,114,115,116,117,118,119,13142,13165,13217,13229,13247,13330,13359,13414,13420,13508,13513,13579,13602,13626,13631,13762,13767,13855,13936,13995,14214,14285,14312,14432,4,2,103,116,13148,13152,59,3,8921,824,4,2,59,118,13158,13161,3,8811,8402,59,3,8811,824,4,3,101,108,116,13173,13200,13204,102,116,4,2,97,114,13181,13188,114,114,111,119,59,1,8653,105,103,104,116,97,114,114,111,119,59,1,8654,59,3,8920,824,4,2,59,118,13210,13213,3,8810,8402,59,3,8810,824,105,103,104,116,97,114,114,111,119,59,1,8655,4,2,68,100,13235,13241,97,115,104,59,1,8879,97,115,104,59,1,8878,4,5,98,99,110,112,116,13259,13264,13270,13275,13308,108,97,59,1,8711,117,116,101,59,1,324,103,59,3,8736,8402,4,5,59,69,105,111,112,13287,13289,13293,13298,13302,1,8777,59,3,10864,824,100,59,3,8779,824,115,59,1,329,114,111,120,59,1,8777,117,114,4,2,59,97,13316,13318,1,9838,108,4,2,59,115,13325,13327,1,9838,59,1,8469,4,2,115,117,13336,13344,112,5,160,1,59,13342,1,160,109,112,4,2,59,101,13352,13355,3,8782,824,59,3,8783,824,4,5,97,101,111,117,121,13371,13385,13391,13407,13411,4,2,112,114,13377,13380,59,1,10819,111,110,59,1,328,100,105,108,59,1,326,110,103,4,2,59,100,13399,13401,1,8775,111,116,59,3,10861,824,112,59,1,10818,59,1,1085,97,115,104,59,1,8211,4,7,59,65,97,100,113,115,120,13436,13438,13443,13466,13472,13478,13494,1,8800,114,114,59,1,8663,114,4,2,104,114,13450,13454,107,59,1,10532,4,2,59,111,13460,13462,1,8599,119,59,1,8599,111,116,59,3,8784,824,117,105,118,59,1,8802,4,2,101,105,13484,13489,97,114,59,1,10536,109,59,3,8770,824,105,115,116,4,2,59,115,13503,13505,1,8708,59,1,8708,114,59,3,55349,56619,4,4,69,101,115,116,13523,13527,13563,13568,59,3,8807,824,4,3,59,113,115,13535,13537,13559,1,8817,4,3,59,113,115,13545,13547,13551,1,8817,59,3,8807,824,108,97,110,116,59,3,10878,824,59,3,10878,824,105,109,59,1,8821,4,2,59,114,13574,13576,1,8815,59,1,8815,4,3,65,97,112,13587,13592,13597,114,114,59,1,8654,114,114,59,1,8622,97,114,59,1,10994,4,3,59,115,118,13610,13612,13623,1,8715,4,2,59,100,13618,13620,1,8956,59,1,8954,59,1,8715,99,121,59,1,1114,4,7,65,69,97,100,101,115,116,13647,13652,13656,13661,13665,13737,13742,114,114,59,1,8653,59,3,8806,824,114,114,59,1,8602,114,59,1,8229,4,4,59,102,113,115,13675,13677,13703,13725,1,8816,116,4,2,97,114,13684,13691,114,114,111,119,59,1,8602,105,103,104,116,97,114,114,111,119,59,1,8622,4,3,59,113,115,13711,13713,13717,1,8816,59,3,8806,824,108,97,110,116,59,3,10877,824,4,2,59,115,13731,13734,3,10877,824,59,1,8814,105,109,59,1,8820,4,2,59,114,13748,13750,1,8814,105,4,2,59,101,13757,13759,1,8938,59,1,8940,105,100,59,1,8740,4,2,112,116,13773,13778,102,59,3,55349,56671,5,172,3,59,105,110,13787,13789,13829,1,172,110,4,4,59,69,100,118,13800,13802,13806,13812,1,8713,59,3,8953,824,111,116,59,3,8949,824,4,3,97,98,99,13820,13823,13826,59,1,8713,59,1,8951,59,1,8950,105,4,2,59,118,13836,13838,1,8716,4,3,97,98,99,13846,13849,13852,59,1,8716,59,1,8958,59,1,8957,4,3,97,111,114,13863,13892,13899,114,4,4,59,97,115,116,13874,13876,13883,13888,1,8742,108,108,101,108,59,1,8742,108,59,3,11005,8421,59,3,8706,824,108,105,110,116,59,1,10772,4,3,59,99,101,13907,13909,13914,1,8832,117,101,59,1,8928,4,2,59,99,13920,13923,3,10927,824,4,2,59,101,13929,13931,1,8832,113,59,3,10927,824,4,4,65,97,105,116,13946,13951,13971,13982,114,114,59,1,8655,114,114,4,3,59,99,119,13961,13963,13967,1,8603,59,3,10547,824,59,3,8605,824,103,104,116,97,114,114,111,119,59,1,8603,114,105,4,2,59,101,13990,13992,1,8939,59,1,8941,4,7,99,104,105,109,112,113,117,14011,14036,14060,14080,14085,14090,14106,4,4,59,99,101,114,14021,14023,14028,14032,1,8833,117,101,59,1,8929,59,3,10928,824,59,3,55349,56515,111,114,116,4,2,109,112,14045,14050,105,100,59,1,8740,97,114,97,108,108,101,108,59,1,8742,109,4,2,59,101,14067,14069,1,8769,4,2,59,113,14075,14077,1,8772,59,1,8772,105,100,59,1,8740,97,114,59,1,8742,115,117,4,2,98,112,14098,14102,101,59,1,8930,101,59,1,8931,4,3,98,99,112,14114,14157,14171,4,4,59,69,101,115,14124,14126,14130,14133,1,8836,59,3,10949,824,59,1,8840,101,116,4,2,59,101,14141,14144,3,8834,8402,113,4,2,59,113,14151,14153,1,8840,59,3,10949,824,99,4,2,59,101,14164,14166,1,8833,113,59,3,10928,824,4,4,59,69,101,115,14181,14183,14187,14190,1,8837,59,3,10950,824,59,1,8841,101,116,4,2,59,101,14198,14201,3,8835,8402,113,4,2,59,113,14208,14210,1,8841,59,3,10950,824,4,4,103,105,108,114,14224,14228,14238,14242,108,59,1,8825,108,100,101,5,241,1,59,14236,1,241,103,59,1,8824,105,97,110,103,108,101,4,2,108,114,14254,14269,101,102,116,4,2,59,101,14263,14265,1,8938,113,59,1,8940,105,103,104,116,4,2,59,101,14279,14281,1,8939,113,59,1,8941,4,2,59,109,14291,14293,1,957,4,3,59,101,115,14301,14303,14308,1,35,114,111,59,1,8470,112,59,1,8199,4,9,68,72,97,100,103,105,108,114,115,14332,14338,14344,14349,14355,14369,14376,14408,14426,97,115,104,59,1,8877,97,114,114,59,1,10500,112,59,3,8781,8402,97,115,104,59,1,8876,4,2,101,116,14361,14365,59,3,8805,8402,59,3,62,8402,110,102,105,110,59,1,10718,4,3,65,101,116,14384,14389,14393,114,114,59,1,10498,59,3,8804,8402,4,2,59,114,14399,14402,3,60,8402,105,101,59,3,8884,8402,4,2,65,116,14414,14419,114,114,59,1,10499,114,105,101,59,3,8885,8402,105,109,59,3,8764,8402,4,3,65,97,110,14440,14445,14468,114,114,59,1,8662,114,4,2,104,114,14452,14456,107,59,1,10531,4,2,59,111,14462,14464,1,8598,119,59,1,8598,101,97,114,59,1,10535,4,18,83,97,99,100,101,102,103,104,105,108,109,111,112,114,115,116,117,118,14512,14515,14535,14560,14597,14603,14618,14643,14657,14662,14701,14741,14747,14769,14851,14877,14907,14916,59,1,9416,4,2,99,115,14521,14531,117,116,101,5,243,1,59,14529,1,243,116,59,1,8859,4,2,105,121,14541,14557,114,4,2,59,99,14548,14550,1,8858,5,244,1,59,14555,1,244,59,1,1086,4,5,97,98,105,111,115,14572,14577,14583,14587,14591,115,104,59,1,8861,108,97,99,59,1,337,118,59,1,10808,116,59,1,8857,111,108,100,59,1,10684,108,105,103,59,1,339,4,2,99,114,14609,14614,105,114,59,1,10687,59,3,55349,56620,4,3,111,114,116,14626,14630,14640,110,59,1,731,97,118,101,5,242,1,59,14638,1,242,59,1,10689,4,2,98,109,14649,14654,97,114,59,1,10677,59,1,937,110,116,59,1,8750,4,4,97,99,105,116,14672,14677,14693,14698,114,114,59,1,8634,4,2,105,114,14683,14687,114,59,1,10686,111,115,115,59,1,10683,110,101,59,1,8254,59,1,10688,4,3,97,101,105,14709,14714,14719,99,114,59,1,333,103,97,59,1,969,4,3,99,100,110,14727,14733,14736,114,111,110,59,1,959,59,1,10678,117,115,59,1,8854,112,102,59,3,55349,56672,4,3,97,101,108,14755,14759,14764,114,59,1,10679,114,112,59,1,10681,117,115,59,1,8853,4,7,59,97,100,105,111,115,118,14785,14787,14792,14831,14837,14841,14848,1,8744,114,114,59,1,8635,4,4,59,101,102,109,14802,14804,14817,14824,1,10845,114,4,2,59,111,14811,14813,1,8500,102,59,1,8500,5,170,1,59,14822,1,170,5,186,1,59,14829,1,186,103,111,102,59,1,8886,114,59,1,10838,108,111,112,101,59,1,10839,59,1,10843,4,3,99,108,111,14859,14863,14873,114,59,1,8500,97,115,104,5,248,1,59,14871,1,248,108,59,1,8856,105,4,2,108,109,14884,14893,100,101,5,245,1,59,14891,1,245,101,115,4,2,59,97,14901,14903,1,8855,115,59,1,10806,109,108,5,246,1,59,14914,1,246,98,97,114,59,1,9021,4,12,97,99,101,102,104,105,108,109,111,114,115,117,14948,14992,14996,15033,15038,15068,15090,15189,15192,15222,15427,15441,114,4,4,59,97,115,116,14959,14961,14976,14989,1,8741,5,182,2,59,108,14968,14970,1,182,108,101,108,59,1,8741,4,2,105,108,14982,14986,109,59,1,10995,59,1,11005,59,1,8706,121,59,1,1087,114,4,5,99,105,109,112,116,15009,15014,15019,15024,15027,110,116,59,1,37,111,100,59,1,46,105,108,59,1,8240,59,1,8869,101,110,107,59,1,8241,114,59,3,55349,56621,4,3,105,109,111,15046,15057,15063,4,2,59,118,15052,15054,1,966,59,1,981,109,97,116,59,1,8499,110,101,59,1,9742,4,3,59,116,118,15076,15078,15087,1,960,99,104,102,111,114,107,59,1,8916,59,1,982,4,2,97,117,15096,15119,110,4,2,99,107,15103,15115,107,4,2,59,104,15110,15112,1,8463,59,1,8462,118,59,1,8463,115,4,9,59,97,98,99,100,101,109,115,116,15140,15142,15148,15151,15156,15168,15171,15179,15184,1,43,99,105,114,59,1,10787,59,1,8862,105,114,59,1,10786,4,2,111,117,15162,15165,59,1,8724,59,1,10789,59,1,10866,110,5,177,1,59,15177,1,177,105,109,59,1,10790,119,111,59,1,10791,59,1,177,4,3,105,112,117,15200,15208,15213,110,116,105,110,116,59,1,10773,102,59,3,55349,56673,110,100,5,163,1,59,15220,1,163,4,10,59,69,97,99,101,105,110,111,115,117,15244,15246,15249,15253,15258,15334,15347,15367,15416,15421,1,8826,59,1,10931,112,59,1,10935,117,101,59,1,8828,4,2,59,99,15264,15266,1,10927,4,6,59,97,99,101,110,115,15280,15282,15290,15299,15303,15329,1,8826,112,112,114,111,120,59,1,10935,117,114,108,121,101,113,59,1,8828,113,59,1,10927,4,3,97,101,115,15311,15319,15324,112,112,114,111,120,59,1,10937,113,113,59,1,10933,105,109,59,1,8936,105,109,59,1,8830,109,101,4,2,59,115,15342,15344,1,8242,59,1,8473,4,3,69,97,115,15355,15358,15362,59,1,10933,112,59,1,10937,105,109,59,1,8936,4,3,100,102,112,15375,15378,15404,59,1,8719,4,3,97,108,115,15386,15392,15398,108,97,114,59,1,9006,105,110,101,59,1,8978,117,114,102,59,1,8979,4,2,59,116,15410,15412,1,8733,111,59,1,8733,105,109,59,1,8830,114,101,108,59,1,8880,4,2,99,105,15433,15438,114,59,3,55349,56517,59,1,968,110,99,115,112,59,1,8200,4,6,102,105,111,112,115,117,15462,15467,15472,15478,15485,15491,114,59,3,55349,56622,110,116,59,1,10764,112,102,59,3,55349,56674,114,105,109,101,59,1,8279,99,114,59,3,55349,56518,4,3,97,101,111,15499,15520,15534,116,4,2,101,105,15506,15515,114,110,105,111,110,115,59,1,8461,110,116,59,1,10774,115,116,4,2,59,101,15528,15530,1,63,113,59,1,8799,116,5,34,1,59,15540,1,34,4,21,65,66,72,97,98,99,100,101,102,104,105,108,109,110,111,112,114,115,116,117,120,15586,15609,15615,15620,15796,15855,15893,15931,15977,16001,16039,16183,16204,16222,16228,16285,16312,16318,16363,16408,16416,4,3,97,114,116,15594,15599,15603,114,114,59,1,8667,114,59,1,8658,97,105,108,59,1,10524,97,114,114,59,1,10511,97,114,59,1,10596,4,7,99,100,101,110,113,114,116,15636,15651,15656,15664,15687,15696,15770,4,2,101,117,15642,15646,59,3,8765,817,116,101,59,1,341,105,99,59,1,8730,109,112,116,121,118,59,1,10675,103,4,4,59,100,101,108,15675,15677,15680,15683,1,10217,59,1,10642,59,1,10661,101,59,1,10217,117,111,5,187,1,59,15694,1,187,114,4,11,59,97,98,99,102,104,108,112,115,116,119,15721,15723,15727,15739,15742,15746,15750,15754,15758,15763,15767,1,8594,112,59,1,10613,4,2,59,102,15733,15735,1,8677,115,59,1,10528,59,1,10547,115,59,1,10526,107,59,1,8618,112,59,1,8620,108,59,1,10565,105,109,59,1,10612,108,59,1,8611,59,1,8605,4,2,97,105,15776,15781,105,108,59,1,10522,111,4,2,59,110,15788,15790,1,8758,97,108,115,59,1,8474,4,3,97,98,114,15804,15809,15814,114,114,59,1,10509,114,107,59,1,10099,4,2,97,107,15820,15833,99,4,2,101,107,15827,15830,59,1,125,59,1,93,4,2,101,115,15839,15842,59,1,10636,108,4,2,100,117,15849,15852,59,1,10638,59,1,10640,4,4,97,101,117,121,15865,15871,15886,15890,114,111,110,59,1,345,4,2,100,105,15877,15882,105,108,59,1,343,108,59,1,8969,98,59,1,125,59,1,1088,4,4,99,108,113,115,15903,15907,15914,15927,97,59,1,10551,100,104,97,114,59,1,10601,117,111,4,2,59,114,15922,15924,1,8221,59,1,8221,104,59,1,8627,4,3,97,99,103,15939,15966,15970,108,4,4,59,105,112,115,15950,15952,15957,15963,1,8476,110,101,59,1,8475,97,114,116,59,1,8476,59,1,8477,116,59,1,9645,5,174,1,59,15975,1,174,4,3,105,108,114,15985,15991,15997,115,104,116,59,1,10621,111,111,114,59,1,8971,59,3,55349,56623,4,2,97,111,16007,16028,114,4,2,100,117,16014,16017,59,1,8641,4,2,59,108,16023,16025,1,8640,59,1,10604,4,2,59,118,16034,16036,1,961,59,1,1009,4,3,103,110,115,16047,16167,16171,104,116,4,6,97,104,108,114,115,116,16063,16081,16103,16130,16143,16155,114,114,111,119,4,2,59,116,16073,16075,1,8594,97,105,108,59,1,8611,97,114,112,111,111,110,4,2,100,117,16093,16099,111,119,110,59,1,8641,112,59,1,8640,101,102,116,4,2,97,104,16112,16120,114,114,111,119,115,59,1,8644,97,114,112,111,111,110,115,59,1,8652,105,103,104,116,97,114,114,111,119,115,59,1,8649,113,117,105,103,97,114,114,111,119,59,1,8605,104,114,101,101,116,105,109,101,115,59,1,8908,103,59,1,730,105,110,103,100,111,116,115,101,113,59,1,8787,4,3,97,104,109,16191,16196,16201,114,114,59,1,8644,97,114,59,1,8652,59,1,8207,111,117,115,116,4,2,59,97,16214,16216,1,9137,99,104,101,59,1,9137,109,105,100,59,1,10990,4,4,97,98,112,116,16238,16252,16257,16278,4,2,110,114,16244,16248,103,59,1,10221,114,59,1,8702,114,107,59,1,10215,4,3,97,102,108,16265,16269,16273,114,59,1,10630,59,3,55349,56675,117,115,59,1,10798,105,109,101,115,59,1,10805,4,2,97,112,16291,16304,114,4,2,59,103,16298,16300,1,41,116,59,1,10644,111,108,105,110,116,59,1,10770,97,114,114,59,1,8649,4,4,97,99,104,113,16328,16334,16339,16342,113,117,111,59,1,8250,114,59,3,55349,56519,59,1,8625,4,2,98,117,16348,16351,59,1,93,111,4,2,59,114,16358,16360,1,8217,59,1,8217,4,3,104,105,114,16371,16377,16383,114,101,101,59,1,8908,109,101,115,59,1,8906,105,4,4,59,101,102,108,16394,16396,16399,16402,1,9657,59,1,8885,59,1,9656,116,114,105,59,1,10702,108,117,104,97,114,59,1,10600,59,1,8478,4,19,97,98,99,100,101,102,104,105,108,109,111,112,113,114,115,116,117,119,122,16459,16466,16472,16572,16590,16672,16687,16746,16844,16850,16924,16963,16988,17115,17121,17154,17206,17614,17656,99,117,116,101,59,1,347,113,117,111,59,1,8218,4,10,59,69,97,99,101,105,110,112,115,121,16494,16496,16499,16513,16518,16531,16536,16556,16564,16569,1,8827,59,1,10932,4,2,112,114,16505,16508,59,1,10936,111,110,59,1,353,117,101,59,1,8829,4,2,59,100,16524,16526,1,10928,105,108,59,1,351,114,99,59,1,349,4,3,69,97,115,16544,16547,16551,59,1,10934,112,59,1,10938,105,109,59,1,8937,111,108,105,110,116,59,1,10771,105,109,59,1,8831,59,1,1089,111,116,4,3,59,98,101,16582,16584,16587,1,8901,59,1,8865,59,1,10854,4,7,65,97,99,109,115,116,120,16606,16611,16634,16642,16646,16652,16668,114,114,59,1,8664,114,4,2,104,114,16618,16622,107,59,1,10533,4,2,59,111,16628,16630,1,8600,119,59,1,8600,116,5,167,1,59,16640,1,167,105,59,1,59,119,97,114,59,1,10537,109,4,2,105,110,16659,16665,110,117,115,59,1,8726,59,1,8726,116,59,1,10038,114,4,2,59,111,16679,16682,3,55349,56624,119,110,59,1,8994,4,4,97,99,111,121,16697,16702,16716,16739,114,112,59,1,9839,4,2,104,121,16708,16713,99,121,59,1,1097,59,1,1096,114,116,4,2,109,112,16724,16729,105,100,59,1,8739,97,114,97,108,108,101,108,59,1,8741,5,173,1,59,16744,1,173,4,2,103,109,16752,16770,109,97,4,3,59,102,118,16762,16764,16767,1,963,59,1,962,59,1,962,4,8,59,100,101,103,108,110,112,114,16788,16790,16795,16806,16817,16828,16832,16838,1,8764,111,116,59,1,10858,4,2,59,113,16801,16803,1,8771,59,1,8771,4,2,59,69,16812,16814,1,10910,59,1,10912,4,2,59,69,16823,16825,1,10909,59,1,10911,101,59,1,8774,108,117,115,59,1,10788,97,114,114,59,1,10610,97,114,114,59,1,8592,4,4,97,101,105,116,16860,16883,16891,16904,4,2,108,115,16866,16878,108,115,101,116,109,105,110,117,115,59,1,8726,104,112,59,1,10803,112,97,114,115,108,59,1,10724,4,2,100,108,16897,16900,59,1,8739,101,59,1,8995,4,2,59,101,16910,16912,1,10922,4,2,59,115,16918,16920,1,10924,59,3,10924,65024,4,3,102,108,112,16932,16938,16958,116,99,121,59,1,1100,4,2,59,98,16944,16946,1,47,4,2,59,97,16952,16954,1,10692,114,59,1,9023,102,59,3,55349,56676,97,4,2,100,114,16970,16985,101,115,4,2,59,117,16978,16980,1,9824,105,116,59,1,9824,59,1,8741,4,3,99,115,117,16996,17028,17089,4,2,97,117,17002,17015,112,4,2,59,115,17009,17011,1,8851,59,3,8851,65024,112,4,2,59,115,17022,17024,1,8852,59,3,8852,65024,117,4,2,98,112,17035,17062,4,3,59,101,115,17043,17045,17048,1,8847,59,1,8849,101,116,4,2,59,101,17056,17058,1,8847,113,59,1,8849,4,3,59,101,115,17070,17072,17075,1,8848,59,1,8850,101,116,4,2,59,101,17083,17085,1,8848,113,59,1,8850,4,3,59,97,102,17097,17099,17112,1,9633,114,4,2,101,102,17106,17109,59,1,9633,59,1,9642,59,1,9642,97,114,114,59,1,8594,4,4,99,101,109,116,17131,17136,17142,17148,114,59,3,55349,56520,116,109,110,59,1,8726,105,108,101,59,1,8995,97,114,102,59,1,8902,4,2,97,114,17160,17172,114,4,2,59,102,17167,17169,1,9734,59,1,9733,4,2,97,110,17178,17202,105,103,104,116,4,2,101,112,17188,17197,112,115,105,108,111,110,59,1,1013,104,105,59,1,981,115,59,1,175,4,5,98,99,109,110,112,17218,17351,17420,17423,17427,4,9,59,69,100,101,109,110,112,114,115,17238,17240,17243,17248,17261,17267,17279,17285,17291,1,8834,59,1,10949,111,116,59,1,10941,4,2,59,100,17254,17256,1,8838,111,116,59,1,10947,117,108,116,59,1,10945,4,2,69,101,17273,17276,59,1,10955,59,1,8842,108,117,115,59,1,10943,97,114,114,59,1,10617,4,3,101,105,117,17299,17335,17339,116,4,3,59,101,110,17308,17310,17322,1,8834,113,4,2,59,113,17317,17319,1,8838,59,1,10949,101,113,4,2,59,113,17330,17332,1,8842,59,1,10955,109,59,1,10951,4,2,98,112,17345,17348,59,1,10965,59,1,10963,99,4,6,59,97,99,101,110,115,17366,17368,17376,17385,17389,17415,1,8827,112,112,114,111,120,59,1,10936,117,114,108,121,101,113,59,1,8829,113,59,1,10928,4,3,97,101,115,17397,17405,17410,112,112,114,111,120,59,1,10938,113,113,59,1,10934,105,109,59,1,8937,105,109,59,1,8831,59,1,8721,103,59,1,9834,4,13,49,50,51,59,69,100,101,104,108,109,110,112,115,17455,17462,17469,17476,17478,17481,17496,17509,17524,17530,17536,17548,17554,5,185,1,59,17460,1,185,5,178,1,59,17467,1,178,5,179,1,59,17474,1,179,1,8835,59,1,10950,4,2,111,115,17487,17491,116,59,1,10942,117,98,59,1,10968,4,2,59,100,17502,17504,1,8839,111,116,59,1,10948,115,4,2,111,117,17516,17520,108,59,1,10185,98,59,1,10967,97,114,114,59,1,10619,117,108,116,59,1,10946,4,2,69,101,17542,17545,59,1,10956,59,1,8843,108,117,115,59,1,10944,4,3,101,105,117,17562,17598,17602,116,4,3,59,101,110,17571,17573,17585,1,8835,113,4,2,59,113,17580,17582,1,8839,59,1,10950,101,113,4,2,59,113,17593,17595,1,8843,59,1,10956,109,59,1,10952,4,2,98,112,17608,17611,59,1,10964,59,1,10966,4,3,65,97,110,17622,17627,17650,114,114,59,1,8665,114,4,2,104,114,17634,17638,107,59,1,10534,4,2,59,111,17644,17646,1,8601,119,59,1,8601,119,97,114,59,1,10538,108,105,103,5,223,1,59,17664,1,223,4,13,97,98,99,100,101,102,104,105,111,112,114,115,119,17694,17709,17714,17737,17742,17749,17754,17860,17905,17957,17964,18090,18122,4,2,114,117,17700,17706,103,101,116,59,1,8982,59,1,964,114,107,59,1,9140,4,3,97,101,121,17722,17728,17734,114,111,110,59,1,357,100,105,108,59,1,355,59,1,1090,111,116,59,1,8411,108,114,101,99,59,1,8981,114,59,3,55349,56625,4,4,101,105,107,111,17764,17805,17836,17851,4,2,114,116,17770,17786,101,4,2,52,102,17777,17780,59,1,8756,111,114,101,59,1,8756,97,4,3,59,115,118,17795,17797,17802,1,952,121,109,59,1,977,59,1,977,4,2,99,110,17811,17831,107,4,2,97,115,17818,17826,112,112,114,111,120,59,1,8776,105,109,59,1,8764,115,112,59,1,8201,4,2,97,115,17842,17846,112,59,1,8776,105,109,59,1,8764,114,110,5,254,1,59,17858,1,254,4,3,108,109,110,17868,17873,17901,100,101,59,1,732,101,115,5,215,3,59,98,100,17884,17886,17898,1,215,4,2,59,97,17892,17894,1,8864,114,59,1,10801,59,1,10800,116,59,1,8749,4,3,101,112,115,17913,17917,17953,97,59,1,10536,4,4,59,98,99,102,17927,17929,17934,17939,1,8868,111,116,59,1,9014,105,114,59,1,10993,4,2,59,111,17945,17948,3,55349,56677,114,107,59,1,10970,97,59,1,10537,114,105,109,101,59,1,8244,4,3,97,105,112,17972,17977,18082,100,101,59,1,8482,4,7,97,100,101,109,112,115,116,17993,18051,18056,18059,18066,18072,18076,110,103,108,101,4,5,59,100,108,113,114,18009,18011,18017,18032,18035,1,9653,111,119,110,59,1,9663,101,102,116,4,2,59,101,18026,18028,1,9667,113,59,1,8884,59,1,8796,105,103,104,116,4,2,59,101,18045,18047,1,9657,113,59,1,8885,111,116,59,1,9708,59,1,8796,105,110,117,115,59,1,10810,108,117,115,59,1,10809,98,59,1,10701,105,109,101,59,1,10811,101,122,105,117,109,59,1,9186,4,3,99,104,116,18098,18111,18116,4,2,114,121,18104,18108,59,3,55349,56521,59,1,1094,99,121,59,1,1115,114,111,107,59,1,359,4,2,105,111,18128,18133,120,116,59,1,8812,104,101,97,100,4,2,108,114,18143,18154,101,102,116,97,114,114,111,119,59,1,8606,105,103,104,116,97,114,114,111,119,59,1,8608,4,18,65,72,97,98,99,100,102,103,104,108,109,111,112,114,115,116,117,119,18204,18209,18214,18234,18250,18268,18292,18308,18319,18343,18379,18397,18413,18504,18547,18553,18584,18603,114,114,59,1,8657,97,114,59,1,10595,4,2,99,114,18220,18230,117,116,101,5,250,1,59,18228,1,250,114,59,1,8593,114,4,2,99,101,18241,18245,121,59,1,1118,118,101,59,1,365,4,2,105,121,18256,18265,114,99,5,251,1,59,18263,1,251,59,1,1091,4,3,97,98,104,18276,18281,18287,114,114,59,1,8645,108,97,99,59,1,369,97,114,59,1,10606,4,2,105,114,18298,18304,115,104,116,59,1,10622,59,3,55349,56626,114,97,118,101,5,249,1,59,18317,1,249,4,2,97,98,18325,18338,114,4,2,108,114,18332,18335,59,1,8639,59,1,8638,108,107,59,1,9600,4,2,99,116,18349,18374,4,2,111,114,18355,18369,114,110,4,2,59,101,18363,18365,1,8988,114,59,1,8988,111,112,59,1,8975,114,105,59,1,9720,4,2,97,108,18385,18390,99,114,59,1,363,5,168,1,59,18395,1,168,4,2,103,112,18403,18408,111,110,59,1,371,102,59,3,55349,56678,4,6,97,100,104,108,115,117,18427,18434,18445,18470,18475,18494,114,114,111,119,59,1,8593,111,119,110,97,114,114,111,119,59,1,8597,97,114,112,111,111,110,4,2,108,114,18457,18463,101,102,116,59,1,8639,105,103,104,116,59,1,8638,117,115,59,1,8846,105,4,3,59,104,108,18484,18486,18489,1,965,59,1,978,111,110,59,1,965,112,97,114,114,111,119,115,59,1,8648,4,3,99,105,116,18512,18537,18542,4,2,111,114,18518,18532,114,110,4,2,59,101,18526,18528,1,8989,114,59,1,8989,111,112,59,1,8974,110,103,59,1,367,114,105,59,1,9721,99,114,59,3,55349,56522,4,3,100,105,114,18561,18566,18572,111,116,59,1,8944,108,100,101,59,1,361,105,4,2,59,102,18579,18581,1,9653,59,1,9652,4,2,97,109,18590,18595,114,114,59,1,8648,108,5,252,1,59,18601,1,252,97,110,103,108,101,59,1,10663,4,15,65,66,68,97,99,100,101,102,108,110,111,112,114,115,122,18643,18648,18661,18667,18847,18851,18857,18904,18909,18915,18931,18937,18943,18949,18996,114,114,59,1,8661,97,114,4,2,59,118,18656,18658,1,10984,59,1,10985,97,115,104,59,1,8872,4,2,110,114,18673,18679,103,114,116,59,1,10652,4,7,101,107,110,112,114,115,116,18695,18704,18711,18720,18742,18754,18810,112,115,105,108,111,110,59,1,1013,97,112,112,97,59,1,1008,111,116,104,105,110,103,59,1,8709,4,3,104,105,114,18728,18732,18735,105,59,1,981,59,1,982,111,112,116,111,59,1,8733,4,2,59,104,18748,18750,1,8597,111,59,1,1009,4,2,105,117,18760,18766,103,109,97,59,1,962,4,2,98,112,18772,18791,115,101,116,110,101,113,4,2,59,113,18784,18787,3,8842,65024,59,3,10955,65024,115,101,116,110,101,113,4,2,59,113,18803,18806,3,8843,65024,59,3,10956,65024,4,2,104,114,18816,18822,101,116,97,59,1,977,105,97,110,103,108,101,4,2,108,114,18834,18840,101,102,116,59,1,8882,105,103,104,116,59,1,8883,121,59,1,1074,97,115,104,59,1,8866,4,3,101,108,114,18865,18884,18890,4,3,59,98,101,18873,18875,18880,1,8744,97,114,59,1,8891,113,59,1,8794,108,105,112,59,1,8942,4,2,98,116,18896,18901,97,114,59,1,124,59,1,124,114,59,3,55349,56627,116,114,105,59,1,8882,115,117,4,2,98,112,18923,18927,59,3,8834,8402,59,3,8835,8402,112,102,59,3,55349,56679,114,111,112,59,1,8733,116,114,105,59,1,8883,4,2,99,117,18955,18960,114,59,3,55349,56523,4,2,98,112,18966,18981,110,4,2,69,101,18973,18977,59,3,10955,65024,59,3,8842,65024,110,4,2,69,101,18988,18992,59,3,10956,65024,59,3,8843,65024,105,103,122,97,103,59,1,10650,4,7,99,101,102,111,112,114,115,19020,19026,19061,19066,19072,19075,19089,105,114,99,59,1,373,4,2,100,105,19032,19055,4,2,98,103,19038,19043,97,114,59,1,10847,101,4,2,59,113,19050,19052,1,8743,59,1,8793,101,114,112,59,1,8472,114,59,3,55349,56628,112,102,59,3,55349,56680,59,1,8472,4,2,59,101,19081,19083,1,8768,97,116,104,59,1,8768,99,114,59,3,55349,56524,4,14,99,100,102,104,105,108,109,110,111,114,115,117,118,119,19125,19146,19152,19157,19173,19176,19192,19197,19202,19236,19252,19269,19286,19291,4,3,97,105,117,19133,19137,19142,112,59,1,8898,114,99,59,1,9711,112,59,1,8899,116,114,105,59,1,9661,114,59,3,55349,56629,4,2,65,97,19163,19168,114,114,59,1,10234,114,114,59,1,10231,59,1,958,4,2,65,97,19182,19187,114,114,59,1,10232,114,114,59,1,10229,97,112,59,1,10236,105,115,59,1,8955,4,3,100,112,116,19210,19215,19230,111,116,59,1,10752,4,2,102,108,19221,19225,59,3,55349,56681,117,115,59,1,10753,105,109,101,59,1,10754,4,2,65,97,19242,19247,114,114,59,1,10233,114,114,59,1,10230,4,2,99,113,19258,19263,114,59,3,55349,56525,99,117,112,59,1,10758,4,2,112,116,19275,19281,108,117,115,59,1,10756,114,105,59,1,9651,101,101,59,1,8897,101,100,103,101,59,1,8896,4,8,97,99,101,102,105,111,115,117,19316,19335,19349,19357,19362,19367,19373,19379,99,4,2,117,121,19323,19332,116,101,5,253,1,59,19330,1,253,59,1,1103,4,2,105,121,19341,19346,114,99,59,1,375,59,1,1099,110,5,165,1,59,19355,1,165,114,59,3,55349,56630,99,121,59,1,1111,112,102,59,3,55349,56682,99,114,59,3,55349,56526,4,2,99,109,19385,19389,121,59,1,1102,108,5,255,1,59,19395,1,255,4,10,97,99,100,101,102,104,105,111,115,119,19419,19426,19441,19446,19462,19467,19472,19480,19486,19492,99,117,116,101,59,1,378,4,2,97,121,19432,19438,114,111,110,59,1,382,59,1,1079,111,116,59,1,380,4,2,101,116,19452,19458,116,114,102,59,1,8488,97,59,1,950,114,59,3,55349,56631,99,121,59,1,1078,103,114,97,114,114,59,1,8669,112,102,59,3,55349,56683,99,114,59,3,55349,56527,4,2,106,110,19498,19501,59,1,8205,106,59,1,8204]);const P=s,H={DASH_DASH_STRING:[45,45],DOCTYPE_STRING:[68,79,67,84,89,80,69],CDATA_START_STRING:[91,67,68,65,84,65,91],SCRIPT_STRING:[115,99,114,105,112,116],PUBLIC_STRING:[80,85,66,76,73,67],SYSTEM_STRING:[83,89,83,84,69,77]},D={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},F="DATA_STATE",U="RCDATA_STATE",G="RAWTEXT_STATE",B="SCRIPT_DATA_STATE",K="PLAINTEXT_STATE",b="TAG_OPEN_STATE",x="END_TAG_OPEN_STATE",y="TAG_NAME_STATE",v="RCDATA_LESS_THAN_SIGN_STATE",Y="RCDATA_END_TAG_OPEN_STATE",w="RCDATA_END_TAG_NAME_STATE",Q="RAWTEXT_LESS_THAN_SIGN_STATE",X="RAWTEXT_END_TAG_OPEN_STATE",W="RAWTEXT_END_TAG_NAME_STATE",V="SCRIPT_DATA_LESS_THAN_SIGN_STATE",j="SCRIPT_DATA_END_TAG_OPEN_STATE",z="SCRIPT_DATA_END_TAG_NAME_STATE",q="SCRIPT_DATA_ESCAPE_START_STATE",J="SCRIPT_DATA_ESCAPE_START_DASH_STATE",Z="SCRIPT_DATA_ESCAPED_STATE",$="SCRIPT_DATA_ESCAPED_DASH_STATE",ee="SCRIPT_DATA_ESCAPED_DASH_DASH_STATE",te="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE",ne="SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE",se="SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE",re="SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE",ie="SCRIPT_DATA_DOUBLE_ESCAPED_STATE",oe="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE",ae="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE",Te="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE",Ee="SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE",he="BEFORE_ATTRIBUTE_NAME_STATE",ce="ATTRIBUTE_NAME_STATE",_e="AFTER_ATTRIBUTE_NAME_STATE",le="BEFORE_ATTRIBUTE_VALUE_STATE",me="ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE",pe="ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE",Ae="ATTRIBUTE_VALUE_UNQUOTED_STATE",ue="AFTER_ATTRIBUTE_VALUE_QUOTED_STATE",Ne="SELF_CLOSING_START_TAG_STATE",de="BOGUS_COMMENT_STATE",Ce="MARKUP_DECLARATION_OPEN_STATE",Oe="COMMENT_START_STATE",fe="COMMENT_START_DASH_STATE",Se="COMMENT_STATE",Re="COMMENT_LESS_THAN_SIGN_STATE",Ie="COMMENT_LESS_THAN_SIGN_BANG_STATE",Le="COMMENT_LESS_THAN_SIGN_BANG_DASH_STATE",ke="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH_STATE",Me="COMMENT_END_DASH_STATE",ge="COMMENT_END_STATE",Pe="COMMENT_END_BANG_STATE",He="DOCTYPE_STATE",De="BEFORE_DOCTYPE_NAME_STATE",Fe="DOCTYPE_NAME_STATE",Ue="AFTER_DOCTYPE_NAME_STATE",Ge="AFTER_DOCTYPE_PUBLIC_KEYWORD_STATE",Be="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE",Ke="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE",be="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE",xe="AFTER_DOCTYPE_PUBLIC_IDENTIFIER_STATE",ye="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE",ve="AFTER_DOCTYPE_SYSTEM_KEYWORD_STATE",Ye="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE",we="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE",Qe="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE",Xe="AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE",We="BOGUS_DOCTYPE_STATE",Ve="CDATA_SECTION_STATE",je="CDATA_SECTION_BRACKET_STATE",ze="CDATA_SECTION_END_STATE",qe="CHARACTER_REFERENCE_STATE",Je="NAMED_CHARACTER_REFERENCE_STATE",Ze="AMBIGUOS_AMPERSAND_STATE",$e="NUMERIC_CHARACTER_REFERENCE_STATE",et="HEXADEMICAL_CHARACTER_REFERENCE_START_STATE",tt="DECIMAL_CHARACTER_REFERENCE_START_STATE",nt="HEXADEMICAL_CHARACTER_REFERENCE_STATE",st="DECIMAL_CHARACTER_REFERENCE_STATE",rt="NUMERIC_CHARACTER_REFERENCE_END_STATE";function it(e){return e===P.SPACE||e===P.LINE_FEED||e===P.TABULATION||e===P.FORM_FEED}function ot(e){return e>=P.DIGIT_0&&e<=P.DIGIT_9}function at(e){return e>=P.LATIN_CAPITAL_A&&e<=P.LATIN_CAPITAL_Z}function Tt(e){return e>=P.LATIN_SMALL_A&&e<=P.LATIN_SMALL_Z}function Et(e){return Tt(e)||at(e)}function ht(e){return Et(e)||ot(e)}function ct(e){return e>=P.LATIN_CAPITAL_A&&e<=P.LATIN_CAPITAL_F}function _t(e){return e>=P.LATIN_SMALL_A&&e<=P.LATIN_SMALL_F}function lt(e){return e+32}function mt(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(e>>>10&1023|55296)+String.fromCharCode(56320|1023&e))}function pt(e){return String.fromCharCode(lt(e))}function At(e,t){const n=g[++e];let s=++e,r=s+n-1;for(;s<=r;){const e=s+r>>>1,i=g[e];if(i<t)s=e+1;else {if(!(i>t))return g[e+n];r=e-1;}}return -1}class ut{constructor(){this.preprocessor=new class{constructor(){this.html=null,this.pos=-1,this.lastGapPos=-1,this.lastCharPos=-1,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=65536;}_err(){}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos;}_processSurrogate(e){if(this.pos!==this.lastCharPos){const t=this.html.charCodeAt(this.pos+1);if(function(e){return e>=56320&&e<=57343}(t))return this.pos++,this._addGap(),1024*(e-55296)+9216+t}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,M.EOF;return this._err("surrogate-in-input-stream"),e}dropParsedChunk(){this.pos>this.bufferWaterline&&(this.lastCharPos-=this.pos,this.html=this.html.substring(this.pos),this.pos=0,this.lastGapPos=-1,this.gapStack=[]);}write(e,t){this.html?this.html+=e:this.html=e,this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1,this.lastChunkWritten=t;}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1,this.html.length),this.lastCharPos=this.html.length-1,this.endOfChunkHit=!1;}advance(){if(this.pos++,this.pos>this.lastCharPos)return this.endOfChunkHit=!this.lastChunkWritten,M.EOF;let e=this.html.charCodeAt(this.pos);return this.skipNextNewLine&&e===M.LINE_FEED?(this.skipNextNewLine=!1,this._addGap(),this.advance()):e===M.CARRIAGE_RETURN?(this.skipNextNewLine=!0,M.LINE_FEED):(this.skipNextNewLine=!1,r(e)&&(e=this._processSurrogate(e)),e>31&&e<127||e===M.LINE_FEED||e===M.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){i(e)?this._err("control-character-in-input-stream"):o(e)&&this._err("noncharacter-in-input-stream");}retreat(){this.pos===this.lastGapPos&&(this.lastGapPos=this.gapStack.pop(),this.pos--),this.pos--;}},this.tokenQueue=[],this.allowCDATA=!1,this.state=F,this.returnState="",this.charRefCode=-1,this.tempBuff=[],this.lastStartTagName="",this.consumedAfterSnapshot=-1,this.active=!1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr=null;}_err(){}_errOnNextCodePoint(e){this._consume(),this._err(e),this._unconsume();}getNextToken(){for(;!this.tokenQueue.length&&this.active;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this[this.state](e);}return this.tokenQueue.shift()}write(e,t){this.active=!0,this.preprocessor.write(e,t);}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e);}_ensureHibernation(){if(this.preprocessor.endOfChunkHit){for(;this.consumedAfterSnapshot>0;this.consumedAfterSnapshot--)this.preprocessor.retreat();return this.active=!1,this.tokenQueue.push({type:ut.HIBERNATION_TOKEN}),!0}return !1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_unconsume(){this.consumedAfterSnapshot--,this.preprocessor.retreat();}_reconsumeInState(e){this.state=e,this._unconsume();}_consumeSequenceIfMatch(e,t,n){let s=0,r=!0;const i=e.length;let o,a=0,T=t;for(;a<i;a++){if(a>0&&(T=this._consume(),s++),T===P.EOF){r=!1;break}if(o=e[a],T!==o&&(n||T!==lt(o))){r=!1;break}}if(!r)for(;s--;)this._unconsume();return r}_isTempBufferEqualToScriptString(){if(this.tempBuff.length!==H.SCRIPT_STRING.length)return !1;for(let e=0;e<this.tempBuff.length;e++)if(this.tempBuff[e]!==H.SCRIPT_STRING[e])return !1;return !0}_createStartTagToken(){this.currentToken={type:ut.START_TAG_TOKEN,tagName:"",selfClosing:!1,ackSelfClosing:!1,attrs:[]};}_createEndTagToken(){this.currentToken={type:ut.END_TAG_TOKEN,tagName:"",selfClosing:!1,attrs:[]};}_createCommentToken(){this.currentToken={type:ut.COMMENT_TOKEN,data:""};}_createDoctypeToken(e){this.currentToken={type:ut.DOCTYPE_TOKEN,name:e,forceQuirks:!1,publicId:null,systemId:null};}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t};}_createEOFToken(){this.currentToken={type:ut.EOF_TOKEN};}_createAttr(e){this.currentAttr={name:e,value:""};}_leaveAttrName(e){null===ut.getTokenAttr(this.currentToken,this.currentAttr.name)?this.currentToken.attrs.push(this.currentAttr):this._err("duplicate-attribute"),this.state=e;}_leaveAttrValue(e){this.state=e;}_emitCurrentToken(){this._emitCurrentCharacterToken();const e=this.currentToken;this.currentToken=null,e.type===ut.START_TAG_TOKEN?this.lastStartTagName=e.tagName:e.type===ut.END_TAG_TOKEN&&(e.attrs.length>0&&this._err("end-tag-with-attributes"),e.selfClosing&&this._err("end-tag-with-trailing-solidus")),this.tokenQueue.push(e);}_emitCurrentCharacterToken(){this.currentCharacterToken&&(this.tokenQueue.push(this.currentCharacterToken),this.currentCharacterToken=null);}_emitEOFToken(){this._createEOFToken(),this._emitCurrentToken();}_appendCharToCurrentCharacterToken(e,t){this.currentCharacterToken&&this.currentCharacterToken.type!==e&&this._emitCurrentCharacterToken(),this.currentCharacterToken?this.currentCharacterToken.chars+=t:this._createCharacterToken(e,t);}_emitCodePoint(e){let t=ut.CHARACTER_TOKEN;it(e)?t=ut.WHITESPACE_CHARACTER_TOKEN:e===P.NULL&&(t=ut.NULL_CHARACTER_TOKEN),this._appendCharToCurrentCharacterToken(t,mt(e));}_emitSeveralCodePoints(e){for(let t=0;t<e.length;t++)this._emitCodePoint(e[t]);}_emitChars(e){this._appendCharToCurrentCharacterToken(ut.CHARACTER_TOKEN,e);}_matchNamedCharacterReference(e){let t=null,n=1,s=At(0,e);for(this.tempBuff.push(e);s>-1;){const e=g[s],r=e<7;r&&1&e&&(t=2&e?[g[++s],g[++s]]:[g[++s]],n=0);const i=this._consume();if(this.tempBuff.push(i),n++,i===P.EOF)break;s=r?4&e?At(s,i):-1:i===e?++s:-1;}for(;n--;)this.tempBuff.pop(),this._unconsume();return t}_isCharacterReferenceInAttribute(){return this.returnState===me||this.returnState===pe||this.returnState===Ae}_isCharacterReferenceAttributeQuirk(e){if(!e&&this._isCharacterReferenceInAttribute()){const e=this._consume();return this._unconsume(),e===P.EQUALS_SIGN||ht(e)}return !1}_flushCodePointsConsumedAsCharacterReference(){if(this._isCharacterReferenceInAttribute())for(let e=0;e<this.tempBuff.length;e++)this.currentAttr.value+=mt(this.tempBuff[e]);else this._emitSeveralCodePoints(this.tempBuff);this.tempBuff=[];}[F](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=b:e===P.AMPERSAND?(this.returnState=F,this.state=qe):e===P.NULL?(this._err(a),this._emitCodePoint(e)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[U](e){this.preprocessor.dropParsedChunk(),e===P.AMPERSAND?(this.returnState=U,this.state=qe):e===P.LESS_THAN_SIGN?this.state=v:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[G](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=Q:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[B](e){this.preprocessor.dropParsedChunk(),e===P.LESS_THAN_SIGN?this.state=V:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[K](e){this.preprocessor.dropParsedChunk(),e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?this._emitEOFToken():this._emitCodePoint(e);}[b](e){e===P.EXCLAMATION_MARK?this.state=Ce:e===P.SOLIDUS?this.state=x:Et(e)?(this._createStartTagToken(),this._reconsumeInState(y)):e===P.QUESTION_MARK?(this._err("unexpected-question-mark-instead-of-tag-name"),this._createCommentToken(),this._reconsumeInState(de)):e===P.EOF?(this._err(h),this._emitChars("<"),this._emitEOFToken()):(this._err(T),this._emitChars("<"),this._reconsumeInState(F));}[x](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(y)):e===P.GREATER_THAN_SIGN?(this._err("missing-end-tag-name"),this.state=F):e===P.EOF?(this._err(h),this._emitChars("</"),this._emitEOFToken()):(this._err(T),this._createCommentToken(),this._reconsumeInState(de));}[y](e){it(e)?this.state=he:e===P.SOLIDUS?this.state=Ne:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):at(e)?this.currentToken.tagName+=pt(e):e===P.NULL?(this._err(a),this.currentToken.tagName+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentToken.tagName+=mt(e);}[v](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=Y):(this._emitChars("<"),this._reconsumeInState(U));}[Y](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(w)):(this._emitChars("</"),this._reconsumeInState(U));}[w](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this.state=F,void this._emitCurrentToken()}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(U);}}[Q](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=X):(this._emitChars("<"),this._reconsumeInState(G));}[X](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(W)):(this._emitChars("</"),this._reconsumeInState(G));}[W](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(G);}}[V](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=j):e===P.EXCLAMATION_MARK?(this.state=q,this._emitChars("<!")):(this._emitChars("<"),this._reconsumeInState(B));}[j](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(z)):(this._emitChars("</"),this._reconsumeInState(B));}[z](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(B);}}[q](e){e===P.HYPHEN_MINUS?(this.state=J,this._emitChars("-")):this._reconsumeInState(B);}[J](e){e===P.HYPHEN_MINUS?(this.state=ee,this._emitChars("-")):this._reconsumeInState(B);}[Z](e){e===P.HYPHEN_MINUS?(this.state=$,this._emitChars("-")):e===P.LESS_THAN_SIGN?this.state=te:e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):this._emitCodePoint(e);}[$](e){e===P.HYPHEN_MINUS?(this.state=ee,this._emitChars("-")):e===P.LESS_THAN_SIGN?this.state=te:e===P.NULL?(this._err(a),this.state=Z,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=Z,this._emitCodePoint(e));}[ee](e){e===P.HYPHEN_MINUS?this._emitChars("-"):e===P.LESS_THAN_SIGN?this.state=te:e===P.GREATER_THAN_SIGN?(this.state=B,this._emitChars(">")):e===P.NULL?(this._err(a),this.state=Z,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=Z,this._emitCodePoint(e));}[te](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=ne):Et(e)?(this.tempBuff=[],this._emitChars("<"),this._reconsumeInState(re)):(this._emitChars("<"),this._reconsumeInState(Z));}[ne](e){Et(e)?(this._createEndTagToken(),this._reconsumeInState(se)):(this._emitChars("</"),this._reconsumeInState(Z));}[se](e){if(at(e))this.currentToken.tagName+=pt(e),this.tempBuff.push(e);else if(Tt(e))this.currentToken.tagName+=mt(e),this.tempBuff.push(e);else {if(this.lastStartTagName===this.currentToken.tagName){if(it(e))return void(this.state=he);if(e===P.SOLIDUS)return void(this.state=Ne);if(e===P.GREATER_THAN_SIGN)return this._emitCurrentToken(),void(this.state=F)}this._emitChars("</"),this._emitSeveralCodePoints(this.tempBuff),this._reconsumeInState(Z);}}[re](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?ie:Z,this._emitCodePoint(e)):at(e)?(this.tempBuff.push(lt(e)),this._emitCodePoint(e)):Tt(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(Z);}[ie](e){e===P.HYPHEN_MINUS?(this.state=oe,this._emitChars("-")):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.NULL?(this._err(a),this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):this._emitCodePoint(e);}[oe](e){e===P.HYPHEN_MINUS?(this.state=ae,this._emitChars("-")):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.NULL?(this._err(a),this.state=ie,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=ie,this._emitCodePoint(e));}[ae](e){e===P.HYPHEN_MINUS?this._emitChars("-"):e===P.LESS_THAN_SIGN?(this.state=Te,this._emitChars("<")):e===P.GREATER_THAN_SIGN?(this.state=B,this._emitChars(">")):e===P.NULL?(this._err(a),this.state=ie,this._emitChars(n)):e===P.EOF?(this._err(O),this._emitEOFToken()):(this.state=ie,this._emitCodePoint(e));}[Te](e){e===P.SOLIDUS?(this.tempBuff=[],this.state=Ee,this._emitChars("/")):this._reconsumeInState(ie);}[Ee](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN?(this.state=this._isTempBufferEqualToScriptString()?Z:ie,this._emitCodePoint(e)):at(e)?(this.tempBuff.push(lt(e)),this._emitCodePoint(e)):Tt(e)?(this.tempBuff.push(e),this._emitCodePoint(e)):this._reconsumeInState(ie);}[he](e){it(e)||(e===P.SOLIDUS||e===P.GREATER_THAN_SIGN||e===P.EOF?this._reconsumeInState(_e):e===P.EQUALS_SIGN?(this._err("unexpected-equals-sign-before-attribute-name"),this._createAttr("="),this.state=ce):(this._createAttr(""),this._reconsumeInState(ce)));}[ce](e){it(e)||e===P.SOLIDUS||e===P.GREATER_THAN_SIGN||e===P.EOF?(this._leaveAttrName(_e),this._unconsume()):e===P.EQUALS_SIGN?this._leaveAttrName(le):at(e)?this.currentAttr.name+=pt(e):e===P.QUOTATION_MARK||e===P.APOSTROPHE||e===P.LESS_THAN_SIGN?(this._err("unexpected-character-in-attribute-name"),this.currentAttr.name+=mt(e)):e===P.NULL?(this._err(a),this.currentAttr.name+=n):this.currentAttr.name+=mt(e);}[_e](e){it(e)||(e===P.SOLIDUS?this.state=Ne:e===P.EQUALS_SIGN?this.state=le:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._createAttr(""),this._reconsumeInState(ce)));}[le](e){it(e)||(e===P.QUOTATION_MARK?this.state=me:e===P.APOSTROPHE?this.state=pe:e===P.GREATER_THAN_SIGN?(this._err("missing-attribute-value"),this.state=F,this._emitCurrentToken()):this._reconsumeInState(Ae));}[me](e){e===P.QUOTATION_MARK?this.state=ue:e===P.AMPERSAND?(this.returnState=me,this.state=qe):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[pe](e){e===P.APOSTROPHE?this.state=ue:e===P.AMPERSAND?(this.returnState=pe,this.state=qe):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[Ae](e){it(e)?this._leaveAttrValue(he):e===P.AMPERSAND?(this.returnState=Ae,this.state=qe):e===P.GREATER_THAN_SIGN?(this._leaveAttrValue(F),this._emitCurrentToken()):e===P.NULL?(this._err(a),this.currentAttr.value+=n):e===P.QUOTATION_MARK||e===P.APOSTROPHE||e===P.LESS_THAN_SIGN||e===P.EQUALS_SIGN||e===P.GRAVE_ACCENT?(this._err("unexpected-character-in-unquoted-attribute-value"),this.currentAttr.value+=mt(e)):e===P.EOF?(this._err(c),this._emitEOFToken()):this.currentAttr.value+=mt(e);}[ue](e){it(e)?this._leaveAttrValue(he):e===P.SOLIDUS?this._leaveAttrValue(Ne):e===P.GREATER_THAN_SIGN?(this._leaveAttrValue(F),this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._err("missing-whitespace-between-attributes"),this._reconsumeInState(he));}[Ne](e){e===P.GREATER_THAN_SIGN?(this.currentToken.selfClosing=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(c),this._emitEOFToken()):(this._err("unexpected-solidus-in-tag"),this._reconsumeInState(he));}[de](e){e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._emitCurrentToken(),this._emitEOFToken()):e===P.NULL?(this._err(a),this.currentToken.data+=n):this.currentToken.data+=mt(e);}[Ce](e){this._consumeSequenceIfMatch(H.DASH_DASH_STRING,e,!0)?(this._createCommentToken(),this.state=Oe):this._consumeSequenceIfMatch(H.DOCTYPE_STRING,e,!1)?this.state=He:this._consumeSequenceIfMatch(H.CDATA_START_STRING,e,!0)?this.allowCDATA?this.state=Ve:(this._err("cdata-in-html-content"),this._createCommentToken(),this.currentToken.data="[CDATA[",this.state=de):this._ensureHibernation()||(this._err("incorrectly-opened-comment"),this._createCommentToken(),this._reconsumeInState(de));}[Oe](e){e===P.HYPHEN_MINUS?this.state=fe:e===P.GREATER_THAN_SIGN?(this._err(S),this.state=F,this._emitCurrentToken()):this._reconsumeInState(Se);}[fe](e){e===P.HYPHEN_MINUS?this.state=ge:e===P.GREATER_THAN_SIGN?(this._err(S),this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(Se));}[Se](e){e===P.HYPHEN_MINUS?this.state=Me:e===P.LESS_THAN_SIGN?(this.currentToken.data+="<",this.state=Re):e===P.NULL?(this._err(a),this.currentToken.data+=n):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.data+=mt(e);}[Re](e){e===P.EXCLAMATION_MARK?(this.currentToken.data+="!",this.state=Ie):e===P.LESS_THAN_SIGN?this.currentToken.data+="!":this._reconsumeInState(Se);}[Ie](e){e===P.HYPHEN_MINUS?this.state=Le:this._reconsumeInState(Se);}[Le](e){e===P.HYPHEN_MINUS?this.state=ke:this._reconsumeInState(Me);}[ke](e){e!==P.GREATER_THAN_SIGN&&e!==P.EOF&&this._err("nested-comment"),this._reconsumeInState(ge);}[Me](e){e===P.HYPHEN_MINUS?this.state=ge:e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="-",this._reconsumeInState(Se));}[ge](e){e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EXCLAMATION_MARK?this.state=Pe:e===P.HYPHEN_MINUS?this.currentToken.data+="-":e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--",this._reconsumeInState(Se));}[Pe](e){e===P.HYPHEN_MINUS?(this.currentToken.data+="--!",this.state=Me):e===P.GREATER_THAN_SIGN?(this._err("incorrectly-closed-comment"),this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(R),this._emitCurrentToken(),this._emitEOFToken()):(this.currentToken.data+="--!",this._reconsumeInState(Se));}[He](e){it(e)?this.state=De:e===P.GREATER_THAN_SIGN?this._reconsumeInState(De):e===P.EOF?(this._err(f),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err("missing-whitespace-before-doctype-name"),this._reconsumeInState(De));}[De](e){it(e)||(at(e)?(this._createDoctypeToken(pt(e)),this.state=Fe):e===P.NULL?(this._err(a),this._createDoctypeToken(n),this.state=Fe):e===P.GREATER_THAN_SIGN?(this._err("missing-doctype-name"),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this._createDoctypeToken(null),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._createDoctypeToken(mt(e)),this.state=Fe));}[Fe](e){it(e)?this.state=Ue:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):at(e)?this.currentToken.name+=pt(e):e===P.NULL?(this._err(a),this.currentToken.name+=n):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.name+=mt(e);}[Ue](e){it(e)||(e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this._consumeSequenceIfMatch(H.PUBLIC_STRING,e,!1)?this.state=Ge:this._consumeSequenceIfMatch(H.SYSTEM_STRING,e,!1)?this.state=ve:this._ensureHibernation()||(this._err("invalid-character-sequence-after-doctype-name"),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[Ge](e){it(e)?this.state=Be:e===P.QUOTATION_MARK?(this._err(_),this.currentToken.publicId="",this.state=Ke):e===P.APOSTROPHE?(this._err(_),this.currentToken.publicId="",this.state=be):e===P.GREATER_THAN_SIGN?(this._err(u),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(p),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[Be](e){it(e)||(e===P.QUOTATION_MARK?(this.currentToken.publicId="",this.state=Ke):e===P.APOSTROPHE?(this.currentToken.publicId="",this.state=be):e===P.GREATER_THAN_SIGN?(this._err(u),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(p),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[Ke](e){e===P.QUOTATION_MARK?this.state=xe:e===P.NULL?(this._err(a),this.currentToken.publicId+=n):e===P.GREATER_THAN_SIGN?(this._err(d),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=mt(e);}[be](e){e===P.APOSTROPHE?this.state=xe:e===P.NULL?(this._err(a),this.currentToken.publicId+=n):e===P.GREATER_THAN_SIGN?(this._err(d),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.publicId+=mt(e);}[xe](e){it(e)?this.state=ye:e===P.GREATER_THAN_SIGN?(this.state=F,this._emitCurrentToken()):e===P.QUOTATION_MARK?(this._err(l),this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this._err(l),this.currentToken.systemId="",this.state=Qe):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[ye](e){it(e)||(e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.QUOTATION_MARK?(this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this.currentToken.systemId="",this.state=Qe):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[ve](e){it(e)?this.state=Ye:e===P.QUOTATION_MARK?(this._err(m),this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this._err(m),this.currentToken.systemId="",this.state=Qe):e===P.GREATER_THAN_SIGN?(this._err(N),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We));}[Ye](e){it(e)||(e===P.QUOTATION_MARK?(this.currentToken.systemId="",this.state=we):e===P.APOSTROPHE?(this.currentToken.systemId="",this.state=Qe):e===P.GREATER_THAN_SIGN?(this._err(N),this.currentToken.forceQuirks=!0,this.state=F,this._emitCurrentToken()):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err(A),this.currentToken.forceQuirks=!0,this._reconsumeInState(We)));}[we](e){e===P.QUOTATION_MARK?this.state=Xe:e===P.NULL?(this._err(a),this.currentToken.systemId+=n):e===P.GREATER_THAN_SIGN?(this._err(C),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=mt(e);}[Qe](e){e===P.APOSTROPHE?this.state=Xe:e===P.NULL?(this._err(a),this.currentToken.systemId+=n):e===P.GREATER_THAN_SIGN?(this._err(C),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):this.currentToken.systemId+=mt(e);}[Xe](e){it(e)||(e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.EOF?(this._err(f),this.currentToken.forceQuirks=!0,this._emitCurrentToken(),this._emitEOFToken()):(this._err("unexpected-character-after-doctype-system-identifier"),this._reconsumeInState(We)));}[We](e){e===P.GREATER_THAN_SIGN?(this._emitCurrentToken(),this.state=F):e===P.NULL?this._err(a):e===P.EOF&&(this._emitCurrentToken(),this._emitEOFToken());}[Ve](e){e===P.RIGHT_SQUARE_BRACKET?this.state=je:e===P.EOF?(this._err("eof-in-cdata"),this._emitEOFToken()):this._emitCodePoint(e);}[je](e){e===P.RIGHT_SQUARE_BRACKET?this.state=ze:(this._emitChars("]"),this._reconsumeInState(Ve));}[ze](e){e===P.GREATER_THAN_SIGN?this.state=F:e===P.RIGHT_SQUARE_BRACKET?this._emitChars("]"):(this._emitChars("]]"),this._reconsumeInState(Ve));}[qe](e){this.tempBuff=[P.AMPERSAND],e===P.NUMBER_SIGN?(this.tempBuff.push(e),this.state=$e):ht(e)?this._reconsumeInState(Je):(this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState));}[Je](e){const t=this._matchNamedCharacterReference(e);if(this._ensureHibernation())this.tempBuff=[P.AMPERSAND];else if(t){const e=this.tempBuff[this.tempBuff.length-1]===P.SEMICOLON;this._isCharacterReferenceAttributeQuirk(e)||(e||this._errOnNextCodePoint(E),this.tempBuff=t),this._flushCodePointsConsumedAsCharacterReference(),this.state=this.returnState;}else this._flushCodePointsConsumedAsCharacterReference(),this.state=Ze;}[Ze](e){ht(e)?this._isCharacterReferenceInAttribute()?this.currentAttr.value+=mt(e):this._emitCodePoint(e):(e===P.SEMICOLON&&this._err("unknown-named-character-reference"),this._reconsumeInState(this.returnState));}[$e](e){this.charRefCode=0,e===P.LATIN_SMALL_X||e===P.LATIN_CAPITAL_X?(this.tempBuff.push(e),this.state=et):this._reconsumeInState(tt);}[et](e){!function(e){return ot(e)||ct(e)||_t(e)}(e)?(this._err(I),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState)):this._reconsumeInState(nt);}[tt](e){ot(e)?this._reconsumeInState(st):(this._err(I),this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState));}[nt](e){ct(e)?this.charRefCode=16*this.charRefCode+e-55:_t(e)?this.charRefCode=16*this.charRefCode+e-87:ot(e)?this.charRefCode=16*this.charRefCode+e-48:e===P.SEMICOLON?this.state=rt:(this._err(E),this._reconsumeInState(rt));}[st](e){ot(e)?this.charRefCode=10*this.charRefCode+e-48:e===P.SEMICOLON?this.state=rt:(this._err(E),this._reconsumeInState(rt));}[rt](){if(this.charRefCode===P.NULL)this._err("null-character-reference"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(this.charRefCode>1114111)this._err("character-reference-outside-unicode-range"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(r(this.charRefCode))this._err("surrogate-character-reference"),this.charRefCode=P.REPLACEMENT_CHARACTER;else if(o(this.charRefCode))this._err("noncharacter-character-reference");else if(i(this.charRefCode)||this.charRefCode===P.CARRIAGE_RETURN){this._err("control-character-reference");const e=D[this.charRefCode];e&&(this.charRefCode=e);}this.tempBuff=[this.charRefCode],this._flushCodePointsConsumedAsCharacterReference(),this._reconsumeInState(this.returnState);}}ut.CHARACTER_TOKEN="CHARACTER_TOKEN",ut.NULL_CHARACTER_TOKEN="NULL_CHARACTER_TOKEN",ut.WHITESPACE_CHARACTER_TOKEN="WHITESPACE_CHARACTER_TOKEN",ut.START_TAG_TOKEN="START_TAG_TOKEN",ut.END_TAG_TOKEN="END_TAG_TOKEN",ut.COMMENT_TOKEN="COMMENT_TOKEN",ut.DOCTYPE_TOKEN="DOCTYPE_TOKEN",ut.EOF_TOKEN="EOF_TOKEN",ut.HIBERNATION_TOKEN="HIBERNATION_TOKEN",ut.MODE={DATA:F,RCDATA:U,RAWTEXT:G,SCRIPT_DATA:B,PLAINTEXT:K},ut.getTokenAttr=function(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null};var Nt=ut;function dt(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&n.path)}},n.exports),n.exports}var Ct=dt((function(e,t){const n=t.NAMESPACES={HTML:"http://www.w3.org/1999/xhtml",MATHML:"http://www.w3.org/1998/Math/MathML",SVG:"http://www.w3.org/2000/svg",XLINK:"http://www.w3.org/1999/xlink",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"};t.ATTRS={TYPE:"type",ACTION:"action",ENCODING:"encoding",PROMPT:"prompt",NAME:"name",COLOR:"color",FACE:"face",SIZE:"size"},t.DOCUMENT_MODE={NO_QUIRKS:"no-quirks",QUIRKS:"quirks",LIMITED_QUIRKS:"limited-quirks"};const s=t.TAG_NAMES={A:"a",ADDRESS:"address",ANNOTATION_XML:"annotation-xml",APPLET:"applet",AREA:"area",ARTICLE:"article",ASIDE:"aside",B:"b",BASE:"base",BASEFONT:"basefont",BGSOUND:"bgsound",BIG:"big",BLOCKQUOTE:"blockquote",BODY:"body",BR:"br",BUTTON:"button",CAPTION:"caption",CENTER:"center",CODE:"code",COL:"col",COLGROUP:"colgroup",DD:"dd",DESC:"desc",DETAILS:"details",DIALOG:"dialog",DIR:"dir",DIV:"div",DL:"dl",DT:"dt",EM:"em",EMBED:"embed",FIELDSET:"fieldset",FIGCAPTION:"figcaption",FIGURE:"figure",FONT:"font",FOOTER:"footer",FOREIGN_OBJECT:"foreignObject",FORM:"form",FRAME:"frame",FRAMESET:"frameset",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6",HEAD:"head",HEADER:"header",HGROUP:"hgroup",HR:"hr",HTML:"html",I:"i",IMG:"img",IMAGE:"image",INPUT:"input",IFRAME:"iframe",KEYGEN:"keygen",LABEL:"label",LI:"li",LINK:"link",LISTING:"listing",MAIN:"main",MALIGNMARK:"malignmark",MARQUEE:"marquee",MATH:"math",MENU:"menu",META:"meta",MGLYPH:"mglyph",MI:"mi",MO:"mo",MN:"mn",MS:"ms",MTEXT:"mtext",NAV:"nav",NOBR:"nobr",NOFRAMES:"noframes",NOEMBED:"noembed",NOSCRIPT:"noscript",OBJECT:"object",OL:"ol",OPTGROUP:"optgroup",OPTION:"option",P:"p",PARAM:"param",PLAINTEXT:"plaintext",PRE:"pre",RB:"rb",RP:"rp",RT:"rt",RTC:"rtc",RUBY:"ruby",S:"s",SCRIPT:"script",SECTION:"section",SELECT:"select",SOURCE:"source",SMALL:"small",SPAN:"span",STRIKE:"strike",STRONG:"strong",STYLE:"style",SUB:"sub",SUMMARY:"summary",SUP:"sup",TABLE:"table",TBODY:"tbody",TEMPLATE:"template",TEXTAREA:"textarea",TFOOT:"tfoot",TD:"td",TH:"th",THEAD:"thead",TITLE:"title",TR:"tr",TRACK:"track",TT:"tt",U:"u",UL:"ul",SVG:"svg",VAR:"var",WBR:"wbr",XMP:"xmp"};t.SPECIAL_ELEMENTS={[n.HTML]:{[s.ADDRESS]:!0,[s.APPLET]:!0,[s.AREA]:!0,[s.ARTICLE]:!0,[s.ASIDE]:!0,[s.BASE]:!0,[s.BASEFONT]:!0,[s.BGSOUND]:!0,[s.BLOCKQUOTE]:!0,[s.BODY]:!0,[s.BR]:!0,[s.BUTTON]:!0,[s.CAPTION]:!0,[s.CENTER]:!0,[s.COL]:!0,[s.COLGROUP]:!0,[s.DD]:!0,[s.DETAILS]:!0,[s.DIR]:!0,[s.DIV]:!0,[s.DL]:!0,[s.DT]:!0,[s.EMBED]:!0,[s.FIELDSET]:!0,[s.FIGCAPTION]:!0,[s.FIGURE]:!0,[s.FOOTER]:!0,[s.FORM]:!0,[s.FRAME]:!0,[s.FRAMESET]:!0,[s.H1]:!0,[s.H2]:!0,[s.H3]:!0,[s.H4]:!0,[s.H5]:!0,[s.H6]:!0,[s.HEAD]:!0,[s.HEADER]:!0,[s.HGROUP]:!0,[s.HR]:!0,[s.HTML]:!0,[s.IFRAME]:!0,[s.IMG]:!0,[s.INPUT]:!0,[s.LI]:!0,[s.LINK]:!0,[s.LISTING]:!0,[s.MAIN]:!0,[s.MARQUEE]:!0,[s.MENU]:!0,[s.META]:!0,[s.NAV]:!0,[s.NOEMBED]:!0,[s.NOFRAMES]:!0,[s.NOSCRIPT]:!0,[s.OBJECT]:!0,[s.OL]:!0,[s.P]:!0,[s.PARAM]:!0,[s.PLAINTEXT]:!0,[s.PRE]:!0,[s.SCRIPT]:!0,[s.SECTION]:!0,[s.SELECT]:!0,[s.SOURCE]:!0,[s.STYLE]:!0,[s.SUMMARY]:!0,[s.TABLE]:!0,[s.TBODY]:!0,[s.TD]:!0,[s.TEMPLATE]:!0,[s.TEXTAREA]:!0,[s.TFOOT]:!0,[s.TH]:!0,[s.THEAD]:!0,[s.TITLE]:!0,[s.TR]:!0,[s.TRACK]:!0,[s.UL]:!0,[s.WBR]:!0,[s.XMP]:!0},[n.MATHML]:{[s.MI]:!0,[s.MO]:!0,[s.MN]:!0,[s.MS]:!0,[s.MTEXT]:!0,[s.ANNOTATION_XML]:!0},[n.SVG]:{[s.TITLE]:!0,[s.FOREIGN_OBJECT]:!0,[s.DESC]:!0}};}));const Ot=Ct.TAG_NAMES,ft=Ct.NAMESPACES;function St(e){switch(e.length){case 1:return e===Ot.P;case 2:return e===Ot.RB||e===Ot.RP||e===Ot.RT||e===Ot.DD||e===Ot.DT||e===Ot.LI;case 3:return e===Ot.RTC;case 6:return e===Ot.OPTION;case 8:return e===Ot.OPTGROUP}return !1}function Rt(e){switch(e.length){case 1:return e===Ot.P;case 2:return e===Ot.RB||e===Ot.RP||e===Ot.RT||e===Ot.DD||e===Ot.DT||e===Ot.LI||e===Ot.TD||e===Ot.TH||e===Ot.TR;case 3:return e===Ot.RTC;case 5:return e===Ot.TBODY||e===Ot.TFOOT||e===Ot.THEAD;case 6:return e===Ot.OPTION;case 7:return e===Ot.CAPTION;case 8:return e===Ot.OPTGROUP||e===Ot.COLGROUP}return !1}function It(e,t){switch(e.length){case 2:if(e===Ot.TD||e===Ot.TH)return t===ft.HTML;if(e===Ot.MI||e===Ot.MO||e===Ot.MN||e===Ot.MS)return t===ft.MATHML;break;case 4:if(e===Ot.HTML)return t===ft.HTML;if(e===Ot.DESC)return t===ft.SVG;break;case 5:if(e===Ot.TABLE)return t===ft.HTML;if(e===Ot.MTEXT)return t===ft.MATHML;if(e===Ot.TITLE)return t===ft.SVG;break;case 6:return (e===Ot.APPLET||e===Ot.OBJECT)&&t===ft.HTML;case 7:return (e===Ot.CAPTION||e===Ot.MARQUEE)&&t===ft.HTML;case 8:return e===Ot.TEMPLATE&&t===ft.HTML;case 13:return e===Ot.FOREIGN_OBJECT&&t===ft.SVG;case 14:return e===Ot.ANNOTATION_XML&&t===ft.MATHML}return !1}class Lt{constructor(e){this.length=0,this.entries=[],this.treeAdapter=e,this.bookmark=null;}_getNoahArkConditionCandidates(e){const t=[];if(this.length>=3){const n=this.treeAdapter.getAttrList(e).length,s=this.treeAdapter.getTagName(e),r=this.treeAdapter.getNamespaceURI(e);for(let e=this.length-1;e>=0;e--){const i=this.entries[e];if(i.type===Lt.MARKER_ENTRY)break;const o=i.element,a=this.treeAdapter.getAttrList(o);this.treeAdapter.getTagName(o)===s&&this.treeAdapter.getNamespaceURI(o)===r&&a.length===n&&t.push({idx:e,attrs:a});}}return t.length<3?[]:t}_ensureNoahArkCondition(e){const t=this._getNoahArkConditionCandidates(e);let n=t.length;if(n){const s=this.treeAdapter.getAttrList(e),r=s.length,i=Object.create(null);for(let e=0;e<r;e++){const t=s[e];i[t.name]=t.value;}for(let e=0;e<r;e++)for(let s=0;s<n;s++){const r=t[s].attrs[e];if(i[r.name]!==r.value&&(t.splice(s,1),n--),t.length<3)return}for(let e=n-1;e>=2;e--)this.entries.splice(t[e].idx,1),this.length--;}}insertMarker(){this.entries.push({type:Lt.MARKER_ENTRY}),this.length++;}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.push({type:Lt.ELEMENT_ENTRY,element:e,token:t}),this.length++;}insertElementAfterBookmark(e,t){let n=this.length-1;for(;n>=0&&this.entries[n]!==this.bookmark;n--);this.entries.splice(n+1,0,{type:Lt.ELEMENT_ENTRY,element:e,token:t}),this.length++;}removeEntry(e){for(let t=this.length-1;t>=0;t--)if(this.entries[t]===e){this.entries.splice(t,1),this.length--;break}}clearToLastMarker(){for(;this.length;){const e=this.entries.pop();if(this.length--,e.type===Lt.MARKER_ENTRY)break}}getElementEntryInScopeWithTagName(e){for(let t=this.length-1;t>=0;t--){const n=this.entries[t];if(n.type===Lt.MARKER_ENTRY)return null;if(this.treeAdapter.getTagName(n.element)===e)return n}return null}getElementEntry(e){for(let t=this.length-1;t>=0;t--){const n=this.entries[t];if(n.type===Lt.ELEMENT_ENTRY&&n.element===e)return n}return null}}Lt.MARKER_ENTRY="MARKER_ENTRY",Lt.ELEMENT_ENTRY="ELEMENT_ENTRY";var kt=Lt;class Mt{constructor(e){const t={},n=this._getOverriddenMethods(this,t);for(const s of Object.keys(n))"function"==typeof n[s]&&(t[s]=e[s],e[s]=n[s]);}_getOverriddenMethods(){throw new Error("Not implemented")}}Mt.install=function(e,t,n){e.__mixins||(e.__mixins=[]);for(let n=0;n<e.__mixins.length;n++)if(e.__mixins[n].constructor===t)return e.__mixins[n];const s=new t(e,n);return e.__mixins.push(s),s};var gt=Mt,Pt=class extends gt{constructor(e){super(e),this.preprocessor=e,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.offset=0,this.col=0,this.line=1;}_getOverriddenMethods(e,t){return {advance(){const n=this.pos+1,s=this.html[n];return e.isEol&&(e.isEol=!1,e.line++,e.lineStartPos=n),("\n"===s||"\r"===s&&"\n"!==this.html[n+1])&&(e.isEol=!0),e.col=n-e.lineStartPos+1,e.offset=e.droppedBufferSize+n,t.advance.call(this)},retreat(){t.retreat.call(this),e.isEol=!1,e.col=this.pos-e.lineStartPos+1;},dropParsedChunk(){const n=this.pos;t.dropParsedChunk.call(this);const s=n-this.pos;e.lineStartPos-=s,e.droppedBufferSize+=s,e.offset=e.droppedBufferSize+this.pos;}}}},Ht=class extends gt{constructor(e){super(e),this.tokenizer=e,this.posTracker=gt.install(e.preprocessor,Pt),this.currentAttrLocation=null,this.ctLoc=null;}_getCurrentLocation(){return {startLine:this.posTracker.line,startCol:this.posTracker.col,startOffset:this.posTracker.offset,endLine:-1,endCol:-1,endOffset:-1}}_attachCurrentAttrLocationInfo(){this.currentAttrLocation.endLine=this.posTracker.line,this.currentAttrLocation.endCol=this.posTracker.col,this.currentAttrLocation.endOffset=this.posTracker.offset;const e=this.tokenizer.currentToken,t=this.tokenizer.currentAttr;e.location.attrs||(e.location.attrs=Object.create(null)),e.location.attrs[t.name]=this.currentAttrLocation;}_getOverriddenMethods(e,t){const n={_createStartTagToken(){t._createStartTagToken.call(this),this.currentToken.location=e.ctLoc;},_createEndTagToken(){t._createEndTagToken.call(this),this.currentToken.location=e.ctLoc;},_createCommentToken(){t._createCommentToken.call(this),this.currentToken.location=e.ctLoc;},_createDoctypeToken(n){t._createDoctypeToken.call(this,n),this.currentToken.location=e.ctLoc;},_createCharacterToken(n,s){t._createCharacterToken.call(this,n,s),this.currentCharacterToken.location=e.ctLoc;},_createEOFToken(){t._createEOFToken.call(this),this.currentToken.location=e._getCurrentLocation();},_createAttr(n){t._createAttr.call(this,n),e.currentAttrLocation=e._getCurrentLocation();},_leaveAttrName(n){t._leaveAttrName.call(this,n),e._attachCurrentAttrLocationInfo();},_leaveAttrValue(n){t._leaveAttrValue.call(this,n),e._attachCurrentAttrLocationInfo();},_emitCurrentToken(){const n=this.currentToken.location;this.currentCharacterToken&&(this.currentCharacterToken.location.endLine=n.startLine,this.currentCharacterToken.location.endCol=n.startCol,this.currentCharacterToken.location.endOffset=n.startOffset),this.currentToken.type===Nt.EOF_TOKEN?(n.endLine=n.startLine,n.endCol=n.startCol,n.endOffset=n.startOffset):(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col+1,n.endOffset=e.posTracker.offset+1),t._emitCurrentToken.call(this);},_emitCurrentCharacterToken(){const n=this.currentCharacterToken&&this.currentCharacterToken.location;n&&-1===n.endOffset&&(n.endLine=e.posTracker.line,n.endCol=e.posTracker.col,n.endOffset=e.posTracker.offset),t._emitCurrentCharacterToken.call(this);}};return Object.keys(Nt.MODE).forEach((s=>{const r=Nt.MODE[s];n[r]=function(n){e.ctLoc=e._getCurrentLocation(),t[r].call(this,n);};})),n}},Dt=class extends gt{constructor(e,t){super(e),this.onItemPop=t.onItemPop;}_getOverriddenMethods(e,t){return {pop(){e.onItemPop(this.current),t.pop.call(this);},popAllUpToHtmlElement(){for(let t=this.stackTop;t>0;t--)e.onItemPop(this.items[t]);t.popAllUpToHtmlElement.call(this);},remove(n){e.onItemPop(this.current),t.remove.call(this,n);}}}};const Ft=Ct.TAG_NAMES;var Ut=class extends gt{constructor(e){super(e),this.parser=e,this.treeAdapter=this.parser.treeAdapter,this.posTracker=null,this.lastStartTagToken=null,this.lastFosterParentingLocation=null,this.currentToken=null;}_setStartLocation(e){let t=null;this.lastStartTagToken&&(t=Object.assign({},this.lastStartTagToken.location),t.startTag=this.lastStartTagToken.location),this.treeAdapter.setNodeSourceCodeLocation(e,t);}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){const n=t.location,s=this.treeAdapter.getTagName(e),r={};t.type===Nt.END_TAG_TOKEN&&s===t.tagName?(r.endTag=Object.assign({},n),r.endLine=n.endLine,r.endCol=n.endCol,r.endOffset=n.endOffset):(r.endLine=n.startLine,r.endCol=n.startCol,r.endOffset=n.startOffset),this.treeAdapter.updateNodeSourceCodeLocation(e,r);}}_getOverriddenMethods(e,t){return {_bootstrap(n,s){t._bootstrap.call(this,n,s),e.lastStartTagToken=null,e.lastFosterParentingLocation=null,e.currentToken=null;const r=gt.install(this.tokenizer,Ht);e.posTracker=r.posTracker,gt.install(this.openElements,Dt,{onItemPop:function(t){e._setEndLocation(t,e.currentToken);}});},_runParsingLoop(n){t._runParsingLoop.call(this,n);for(let t=this.openElements.stackTop;t>=0;t--)e._setEndLocation(this.openElements.items[t],e.currentToken);},_processTokenInForeignContent(n){e.currentToken=n,t._processTokenInForeignContent.call(this,n);},_processToken(n){if(e.currentToken=n,t._processToken.call(this,n),n.type===Nt.END_TAG_TOKEN&&(n.tagName===Ft.HTML||n.tagName===Ft.BODY&&this.openElements.hasInScope(Ft.BODY)))for(let t=this.openElements.stackTop;t>=0;t--){const s=this.openElements.items[t];if(this.treeAdapter.getTagName(s)===n.tagName){e._setEndLocation(s,n);break}}},_setDocumentType(e){t._setDocumentType.call(this,e);const n=this.treeAdapter.getChildNodes(this.document),s=n.length;for(let t=0;t<s;t++){const s=n[t];if(this.treeAdapter.isDocumentTypeNode(s)){this.treeAdapter.setNodeSourceCodeLocation(s,e.location);break}}},_attachElementToTree(n){e._setStartLocation(n),e.lastStartTagToken=null,t._attachElementToTree.call(this,n);},_appendElement(n,s){e.lastStartTagToken=n,t._appendElement.call(this,n,s);},_insertElement(n,s){e.lastStartTagToken=n,t._insertElement.call(this,n,s);},_insertTemplate(n){e.lastStartTagToken=n,t._insertTemplate.call(this,n);const s=this.treeAdapter.getTemplateContent(this.openElements.current);this.treeAdapter.setNodeSourceCodeLocation(s,null);},_insertFakeRootElement(){t._insertFakeRootElement.call(this),this.treeAdapter.setNodeSourceCodeLocation(this.openElements.current,null);},_appendCommentNode(e,n){t._appendCommentNode.call(this,e,n);const s=this.treeAdapter.getChildNodes(n),r=s[s.length-1];this.treeAdapter.setNodeSourceCodeLocation(r,e.location);},_findFosterParentingLocation(){return e.lastFosterParentingLocation=t._findFosterParentingLocation.call(this),e.lastFosterParentingLocation},_insertCharacters(n){t._insertCharacters.call(this,n);const s=this._shouldFosterParentOnInsertion(),r=s&&e.lastFosterParentingLocation.parent||this.openElements.currentTmplContent||this.openElements.current,i=this.treeAdapter.getChildNodes(r),o=s&&e.lastFosterParentingLocation.beforeElement?i.indexOf(e.lastFosterParentingLocation.beforeElement)-1:i.length-1,a=i[o];if(this.treeAdapter.getNodeSourceCodeLocation(a)){const{endLine:e,endCol:t,endOffset:s}=n.location;this.treeAdapter.updateNodeSourceCodeLocation(a,{endLine:e,endCol:t,endOffset:s});}else this.treeAdapter.setNodeSourceCodeLocation(a,n.location);}}}},Gt=class extends gt{constructor(e,t){super(e),this.posTracker=null,this.onParseError=t.onParseError;}_setErrorLocation(e){e.startLine=e.endLine=this.posTracker.line,e.startCol=e.endCol=this.posTracker.col,e.startOffset=e.endOffset=this.posTracker.offset;}_reportError(e){const t={code:e,startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1};this._setErrorLocation(t),this.onParseError(t);}_getOverriddenMethods(e){return {_err(t){e._reportError(t);}}}},Bt=class extends Gt{constructor(e,t){super(e,t),this.posTracker=gt.install(e,Pt),this.lastErrOffset=-1;}_reportError(e){this.lastErrOffset!==this.posTracker.offset&&(this.lastErrOffset=this.posTracker.offset,super._reportError(e));}},Kt=class extends Gt{constructor(e,t){super(e,t);const n=gt.install(e.preprocessor,Bt,t);this.posTracker=n.posTracker;}},bt=class extends Gt{constructor(e,t){super(e,t),this.opts=t,this.ctLoc=null,this.locBeforeToken=!1;}_setErrorLocation(e){this.ctLoc&&(e.startLine=this.ctLoc.startLine,e.startCol=this.ctLoc.startCol,e.startOffset=this.ctLoc.startOffset,e.endLine=this.locBeforeToken?this.ctLoc.startLine:this.ctLoc.endLine,e.endCol=this.locBeforeToken?this.ctLoc.startCol:this.ctLoc.endCol,e.endOffset=this.locBeforeToken?this.ctLoc.startOffset:this.ctLoc.endOffset);}_getOverriddenMethods(e,t){return {_bootstrap(n,s){t._bootstrap.call(this,n,s),gt.install(this.tokenizer,Kt,e.opts),gt.install(this.tokenizer,Ht);},_processInputToken(n){e.ctLoc=n.location,t._processInputToken.call(this,n);},_err(t,n){e.locBeforeToken=n&&n.beforeToken,e._reportError(t);}}}},xt=dt((function(e,t){const{DOCUMENT_MODE:n}=Ct;t.createDocument=function(){return {nodeName:"#document",mode:n.NO_QUIRKS,childNodes:[]}},t.createDocumentFragment=function(){return {nodeName:"#document-fragment",childNodes:[]}},t.createElement=function(e,t,n){return {nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},t.createCommentNode=function(e){return {nodeName:"#comment",data:e,parentNode:null}};const s=function(e){return {nodeName:"#text",value:e,parentNode:null}},r=t.appendChild=function(e,t){e.childNodes.push(t),t.parentNode=e;},i=t.insertBefore=function(e,t,n){const s=e.childNodes.indexOf(n);e.childNodes.splice(s,0,t),t.parentNode=e;};t.setTemplateContent=function(e,t){e.content=t;},t.getTemplateContent=function(e){return e.content},t.setDocumentType=function(e,t,n,s){let i=null;for(let t=0;t<e.childNodes.length;t++)if("#documentType"===e.childNodes[t].nodeName){i=e.childNodes[t];break}i?(i.name=t,i.publicId=n,i.systemId=s):r(e,{nodeName:"#documentType",name:t,publicId:n,systemId:s});},t.setDocumentMode=function(e,t){e.mode=t;},t.getDocumentMode=function(e){return e.mode},t.detachNode=function(e){if(e.parentNode){const t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null;}},t.insertText=function(e,t){if(e.childNodes.length){const n=e.childNodes[e.childNodes.length-1];if("#text"===n.nodeName)return void(n.value+=t)}r(e,s(t));},t.insertTextBefore=function(e,t,n){const r=e.childNodes[e.childNodes.indexOf(n)-1];r&&"#text"===r.nodeName?r.value+=t:i(e,s(t),n);},t.adoptAttributes=function(e,t){const n=[];for(let t=0;t<e.attrs.length;t++)n.push(e.attrs[t].name);for(let s=0;s<t.length;s++)-1===n.indexOf(t[s].name)&&e.attrs.push(t[s]);},t.getFirstChild=function(e){return e.childNodes[0]},t.getChildNodes=function(e){return e.childNodes},t.getParentNode=function(e){return e.parentNode},t.getAttrList=function(e){return e.attrs},t.getTagName=function(e){return e.tagName},t.getNamespaceURI=function(e){return e.namespaceURI},t.getTextNodeContent=function(e){return e.value},t.getCommentNodeContent=function(e){return e.data},t.getDocumentTypeNodeName=function(e){return e.name},t.getDocumentTypeNodePublicId=function(e){return e.publicId},t.getDocumentTypeNodeSystemId=function(e){return e.systemId},t.isTextNode=function(e){return "#text"===e.nodeName},t.isCommentNode=function(e){return "#comment"===e.nodeName},t.isDocumentTypeNode=function(e){return "#documentType"===e.nodeName},t.isElementNode=function(e){return !!e.tagName},t.setNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=t;},t.getNodeSourceCodeLocation=function(e){return e.sourceCodeLocation},t.updateNodeSourceCodeLocation=function(e,t){e.sourceCodeLocation=Object.assign(e.sourceCodeLocation,t);};}));const{DOCUMENT_MODE:yt}=Ct,vt="html",Yt=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],wt=Yt.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]),Qt=["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"],Xt=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],Wt=Xt.concat(["-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"]);function Vt(e,t){for(let n=0;n<t.length;n++)if(0===e.indexOf(t[n]))return !0;return !1}var jt=dt((function(e,t){const n=Ct.TAG_NAMES,s=Ct.NAMESPACES,r=Ct.ATTRS,i={attributename:"attributeName",attributetype:"attributeType",basefrequency:"baseFrequency",baseprofile:"baseProfile",calcmode:"calcMode",clippathunits:"clipPathUnits",diffuseconstant:"diffuseConstant",edgemode:"edgeMode",filterunits:"filterUnits",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",limitingconeangle:"limitingConeAngle",markerheight:"markerHeight",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textlength:"textLength",viewbox:"viewBox",viewtarget:"viewTarget",xchannelselector:"xChannelSelector",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan"},o={"xlink:actuate":{prefix:"xlink",name:"actuate",namespace:s.XLINK},"xlink:arcrole":{prefix:"xlink",name:"arcrole",namespace:s.XLINK},"xlink:href":{prefix:"xlink",name:"href",namespace:s.XLINK},"xlink:role":{prefix:"xlink",name:"role",namespace:s.XLINK},"xlink:show":{prefix:"xlink",name:"show",namespace:s.XLINK},"xlink:title":{prefix:"xlink",name:"title",namespace:s.XLINK},"xlink:type":{prefix:"xlink",name:"type",namespace:s.XLINK},"xml:base":{prefix:"xml",name:"base",namespace:s.XML},"xml:lang":{prefix:"xml",name:"lang",namespace:s.XML},"xml:space":{prefix:"xml",name:"space",namespace:s.XML},xmlns:{prefix:"",name:"xmlns",namespace:s.XMLNS},"xmlns:xlink":{prefix:"xmlns",name:"xlink",namespace:s.XMLNS}},a=t.SVG_TAG_NAMES_ADJUSTMENT_MAP={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient",textpath:"textPath"},T={[n.B]:!0,[n.BIG]:!0,[n.BLOCKQUOTE]:!0,[n.BODY]:!0,[n.BR]:!0,[n.CENTER]:!0,[n.CODE]:!0,[n.DD]:!0,[n.DIV]:!0,[n.DL]:!0,[n.DT]:!0,[n.EM]:!0,[n.EMBED]:!0,[n.H1]:!0,[n.H2]:!0,[n.H3]:!0,[n.H4]:!0,[n.H5]:!0,[n.H6]:!0,[n.HEAD]:!0,[n.HR]:!0,[n.I]:!0,[n.IMG]:!0,[n.LI]:!0,[n.LISTING]:!0,[n.MENU]:!0,[n.META]:!0,[n.NOBR]:!0,[n.OL]:!0,[n.P]:!0,[n.PRE]:!0,[n.RUBY]:!0,[n.S]:!0,[n.SMALL]:!0,[n.SPAN]:!0,[n.STRONG]:!0,[n.STRIKE]:!0,[n.SUB]:!0,[n.SUP]:!0,[n.TABLE]:!0,[n.TT]:!0,[n.U]:!0,[n.UL]:!0,[n.VAR]:!0};t.causesExit=function(e){const t=e.tagName;return !(t!==n.FONT||null===Nt.getTokenAttr(e,r.COLOR)&&null===Nt.getTokenAttr(e,r.SIZE)&&null===Nt.getTokenAttr(e,r.FACE))||T[t]},t.adjustTokenMathMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++)if("definitionurl"===e.attrs[t].name){e.attrs[t].name="definitionURL";break}},t.adjustTokenSVGAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=i[e.attrs[t].name];n&&(e.attrs[t].name=n);}},t.adjustTokenXMLAttrs=function(e){for(let t=0;t<e.attrs.length;t++){const n=o[e.attrs[t].name];n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace);}},t.adjustTokenSVGTagName=function(e){const t=a[e.tagName];t&&(e.tagName=t);},t.isIntegrationPoint=function(e,t,i,o){return !(o&&o!==s.HTML||!function(e,t,i){if(t===s.MATHML&&e===n.ANNOTATION_XML)for(let e=0;e<i.length;e++)if(i[e].name===r.ENCODING){const t=i[e].value.toLowerCase();return "text/html"===t||"application/xhtml+xml"===t}return t===s.SVG&&(e===n.FOREIGN_OBJECT||e===n.DESC||e===n.TITLE)}(e,t,i))||!(o&&o!==s.MATHML||!function(e,t){return t===s.MATHML&&(e===n.MI||e===n.MO||e===n.MN||e===n.MS||e===n.MTEXT)}(e,t))};}));const zt=Ct.TAG_NAMES,qt=Ct.NAMESPACES,Jt=Ct.ATTRS,Zt={scriptingEnabled:!0,sourceCodeLocationInfo:!1,onParseError:null,treeAdapter:xt},$t="hidden",en="INITIAL_MODE",tn="BEFORE_HTML_MODE",nn="BEFORE_HEAD_MODE",sn="IN_HEAD_MODE",rn="IN_HEAD_NO_SCRIPT_MODE",on="AFTER_HEAD_MODE",an="IN_BODY_MODE",Tn="TEXT_MODE",En="IN_TABLE_MODE",hn="IN_TABLE_TEXT_MODE",cn="IN_CAPTION_MODE",_n="IN_COLUMN_GROUP_MODE",ln="IN_TABLE_BODY_MODE",mn="IN_ROW_MODE",pn="IN_CELL_MODE",An="IN_SELECT_MODE",un="IN_SELECT_IN_TABLE_MODE",Nn="IN_TEMPLATE_MODE",dn="AFTER_BODY_MODE",Cn="IN_FRAMESET_MODE",On="AFTER_FRAMESET_MODE",fn="AFTER_AFTER_BODY_MODE",Sn="AFTER_AFTER_FRAMESET_MODE",Rn={[zt.TR]:mn,[zt.TBODY]:ln,[zt.THEAD]:ln,[zt.TFOOT]:ln,[zt.CAPTION]:cn,[zt.COLGROUP]:_n,[zt.TABLE]:En,[zt.BODY]:an,[zt.FRAMESET]:Cn},In={[zt.CAPTION]:En,[zt.COLGROUP]:En,[zt.TBODY]:En,[zt.TFOOT]:En,[zt.THEAD]:En,[zt.COL]:_n,[zt.TR]:ln,[zt.TD]:mn,[zt.TH]:mn},Ln={[en]:{[Nt.CHARACTER_TOKEN]:vn,[Nt.NULL_CHARACTER_TOKEN]:vn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:function(e,t){e._setDocumentType(t);const n=t.forceQuirks?Ct.DOCUMENT_MODE.QUIRKS:function(e){if(e.name!==vt)return yt.QUIRKS;const t=e.systemId;if(t&&"http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"===t.toLowerCase())return yt.QUIRKS;let n=e.publicId;if(null!==n){if(n=n.toLowerCase(),Qt.indexOf(n)>-1)return yt.QUIRKS;let e=null===t?wt:Yt;if(Vt(n,e))return yt.QUIRKS;if(e=null===t?Xt:Wt,Vt(n,e))return yt.LIMITED_QUIRKS}return yt.NO_QUIRKS}(t);(function(e){return e.name===vt&&null===e.publicId&&(null===e.systemId||"about:legacy-compat"===e.systemId)})(t)||e._err("non-conforming-doctype"),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=tn;},[Nt.START_TAG_TOKEN]:vn,[Nt.END_TAG_TOKEN]:vn,[Nt.EOF_TOKEN]:vn},[tn]:{[Nt.CHARACTER_TOKEN]:Yn,[Nt.NULL_CHARACTER_TOKEN]:Yn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?(e._insertElement(t,qt.HTML),e.insertionMode=nn):Yn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n!==zt.HTML&&n!==zt.HEAD&&n!==zt.BODY&&n!==zt.BR||Yn(e,t);},[Nt.EOF_TOKEN]:Yn},[nn]:{[Nt.CHARACTER_TOKEN]:wn,[Nt.NULL_CHARACTER_TOKEN]:wn,[Nt.WHITESPACE_CHARACTER_TOKEN]:Gn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.HEAD?(e._insertElement(t,qt.HTML),e.headElement=e.openElements.current,e.insertionMode=sn):wn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HEAD||n===zt.BODY||n===zt.HTML||n===zt.BR?wn(e,t):e._err(L);},[Nt.EOF_TOKEN]:wn},[sn]:{[Nt.CHARACTER_TOKEN]:Wn,[Nt.NULL_CHARACTER_TOKEN]:Wn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:Qn,[Nt.END_TAG_TOKEN]:Xn,[Nt.EOF_TOKEN]:Wn},[rn]:{[Nt.CHARACTER_TOKEN]:Vn,[Nt.NULL_CHARACTER_TOKEN]:Vn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BASEFONT||n===zt.BGSOUND||n===zt.HEAD||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.STYLE?Qn(e,t):n===zt.NOSCRIPT?e._err("nested-noscript-in-head"):Vn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.NOSCRIPT?(e.openElements.pop(),e.insertionMode=sn):n===zt.BR?Vn(e,t):e._err(L);},[Nt.EOF_TOKEN]:Vn},[on]:{[Nt.CHARACTER_TOKEN]:jn,[Nt.NULL_CHARACTER_TOKEN]:jn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Bn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BODY?(e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode=an):n===zt.FRAMESET?(e._insertElement(t,qt.HTML),e.insertionMode=Cn):n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.SCRIPT||n===zt.STYLE||n===zt.TEMPLATE||n===zt.TITLE?(e._err("abandoned-head-element-child"),e.openElements.push(e.headElement),Qn(e,t),e.openElements.remove(e.headElement)):n===zt.HEAD?e._err(k):jn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.BODY||n===zt.HTML||n===zt.BR?jn(e,t):n===zt.TEMPLATE?Xn(e,t):e._err(L);},[Nt.EOF_TOKEN]:jn},[an]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:as,[Nt.END_TAG_TOKEN]:cs,[Nt.EOF_TOKEN]:_s},[Tn]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:xn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Gn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:Gn,[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.SCRIPT&&(e.pendingScript=e.openElements.current),e.openElements.pop(),e.insertionMode=e.originalInsertionMode;},[Nt.EOF_TOKEN]:function(e,t){e._err("eof-in-element-that-can-contain-only-text"),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e._processToken(t);}},[En]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:ms,[Nt.END_TAG_TOKEN]:ps,[Nt.EOF_TOKEN]:_s},[hn]:{[Nt.CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0;},[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:function(e,t){e.pendingCharacterTokens.push(t);},[Nt.COMMENT_TOKEN]:us,[Nt.DOCTYPE_TOKEN]:us,[Nt.START_TAG_TOKEN]:us,[Nt.END_TAG_TOKEN]:us,[Nt.EOF_TOKEN]:us},[cn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TD||n===zt.TFOOT||n===zt.TH||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(zt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=En,e._processToken(t)):as(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE?e.openElements.hasInTableScope(zt.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=En,n===zt.TABLE&&e._processToken(t)):n!==zt.BODY&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&n!==zt.TBODY&&n!==zt.TD&&n!==zt.TFOOT&&n!==zt.TH&&n!==zt.THEAD&&n!==zt.TR&&cs(e,t);},[Nt.EOF_TOKEN]:_s},[_n]:{[Nt.CHARACTER_TOKEN]:Ns,[Nt.NULL_CHARACTER_TOKEN]:Ns,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.COL?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.TEMPLATE?Qn(e,t):Ns(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.COLGROUP?e.openElements.currentTagName===zt.COLGROUP&&(e.openElements.pop(),e.insertionMode=En):n===zt.TEMPLATE?Xn(e,t):n!==zt.COL&&Ns(e,t);},[Nt.EOF_TOKEN]:_s},[ln]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TR?(e.openElements.clearBackToTableBodyContext(),e._insertElement(t,qt.HTML),e.insertionMode=mn):n===zt.TH||n===zt.TD?(e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(zt.TR),e.insertionMode=mn,e._processToken(t)):n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En,e._processToken(t)):ms(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En):n===zt.TABLE?e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=En,e._processToken(t)):(n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP||n!==zt.HTML&&n!==zt.TD&&n!==zt.TH&&n!==zt.TR)&&ps(e,t);},[Nt.EOF_TOKEN]:_s},[mn]:{[Nt.CHARACTER_TOKEN]:ls,[Nt.NULL_CHARACTER_TOKEN]:ls,[Nt.WHITESPACE_CHARACTER_TOKEN]:ls,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TH||n===zt.TD?(e.openElements.clearBackToTableRowContext(),e._insertElement(t,qt.HTML),e.insertionMode=pn,e.activeFormattingElements.insertMarker()):n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):ms(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TR?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln):n===zt.TABLE?e.openElements.hasInTableScope(zt.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?(e.openElements.hasInTableScope(n)||e.openElements.hasInTableScope(zt.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=ln,e._processToken(t)):(n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP||n!==zt.HTML&&n!==zt.TD&&n!==zt.TH)&&ps(e,t);},[Nt.EOF_TOKEN]:_s},[pn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.COL||n===zt.COLGROUP||n===zt.TBODY||n===zt.TD||n===zt.TFOOT||n===zt.TH||n===zt.THEAD||n===zt.TR?(e.openElements.hasInTableScope(zt.TD)||e.openElements.hasInTableScope(zt.TH))&&(e._closeTableCell(),e._processToken(t)):as(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.TD||n===zt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=mn):n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?e.openElements.hasInTableScope(n)&&(e._closeTableCell(),e._processToken(t)):n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&cs(e,t);},[Nt.EOF_TOKEN]:_s},[An]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:ds,[Nt.END_TAG_TOKEN]:Cs,[Nt.EOF_TOKEN]:_s},[un]:{[Nt.CHARACTER_TOKEN]:xn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR||n===zt.TD||n===zt.TH?(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),e._processToken(t)):ds(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.CAPTION||n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR||n===zt.TD||n===zt.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),e._processToken(t)):Cs(e,t);},[Nt.EOF_TOKEN]:_s},[Nn]:{[Nt.CHARACTER_TOKEN]:qn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;if(n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META||n===zt.NOFRAMES||n===zt.SCRIPT||n===zt.STYLE||n===zt.TEMPLATE||n===zt.TITLE)Qn(e,t);else {const s=In[n]||an;e._popTmplInsertionMode(),e._pushTmplInsertionMode(s),e.insertionMode=s,e._processToken(t);}},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.TEMPLATE&&Xn(e,t);},[Nt.EOF_TOKEN]:Os},[dn]:{[Nt.CHARACTER_TOKEN]:fs,[Nt.NULL_CHARACTER_TOKEN]:fs,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:function(e,t){e._appendCommentNode(t,e.openElements.items[0]);},[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?as(e,t):fs(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?e.fragmentContext||(e.insertionMode=fn):fs(e,t);},[Nt.EOF_TOKEN]:yn},[Cn]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.FRAMESET?e._insertElement(t,qt.HTML):n===zt.FRAME?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName!==zt.FRAMESET||e.openElements.isRootHtmlElementCurrent()||(e.openElements.pop(),e.fragmentContext||e.openElements.currentTagName===zt.FRAMESET||(e.insertionMode=On));},[Nt.EOF_TOKEN]:yn},[On]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:xn,[Nt.COMMENT_TOKEN]:Kn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML&&(e.insertionMode=Sn);},[Nt.EOF_TOKEN]:yn},[fn]:{[Nt.CHARACTER_TOKEN]:Ss,[Nt.NULL_CHARACTER_TOKEN]:Ss,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:bn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){t.tagName===zt.HTML?as(e,t):Ss(e,t);},[Nt.END_TAG_TOKEN]:Ss,[Nt.EOF_TOKEN]:yn},[Sn]:{[Nt.CHARACTER_TOKEN]:Gn,[Nt.NULL_CHARACTER_TOKEN]:Gn,[Nt.WHITESPACE_CHARACTER_TOKEN]:zn,[Nt.COMMENT_TOKEN]:bn,[Nt.DOCTYPE_TOKEN]:Gn,[Nt.START_TAG_TOKEN]:function(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.NOFRAMES&&Qn(e,t);},[Nt.END_TAG_TOKEN]:Gn,[Nt.EOF_TOKEN]:yn}};var kn=class{constructor(e){this.options=function(e,t){return [e,t=t||Object.create(null)].reduce(((e,t)=>(Object.keys(t).forEach((n=>{e[n]=t[n];})),e)),Object.create(null))}(Zt,e),this.treeAdapter=this.options.treeAdapter,this.pendingScript=null,this.options.sourceCodeLocationInfo&>.install(this,Ut),this.options.onParseError&>.install(this,bt,{onParseError:this.options.onParseError});}parse(e){const t=this.treeAdapter.createDocument();return this._bootstrap(t,null),this.tokenizer.write(e,!0),this._runParsingLoop(null),t}parseFragment(e,t){t||(t=this.treeAdapter.createElement(zt.TEMPLATE,qt.HTML,[]));const n=this.treeAdapter.createElement("documentmock",qt.HTML,[]);this._bootstrap(n,t),this.treeAdapter.getTagName(t)===zt.TEMPLATE&&this._pushTmplInsertionMode(Nn),this._initTokenizerForFragmentParsing(),this._insertFakeRootElement(),this._resetInsertionMode(),this._findFormInFragmentContext(),this.tokenizer.write(e,!0),this._runParsingLoop(null);const s=this.treeAdapter.getFirstChild(n),r=this.treeAdapter.createDocumentFragment();return this._adoptNodes(s,r),r}_bootstrap(e,t){this.tokenizer=new Nt(this.options),this.stopped=!1,this.insertionMode=en,this.originalInsertionMode="",this.document=e,this.fragmentContext=t,this.headElement=null,this.formElement=null,this.openElements=new class{constructor(e,t){this.stackTop=-1,this.items=[],this.current=e,this.currentTagName=null,this.currentTmplContent=null,this.tmplCount=0,this.treeAdapter=t;}_indexOf(e){let t=-1;for(let n=this.stackTop;n>=0;n--)if(this.items[n]===e){t=n;break}return t}_isInTemplate(){return this.currentTagName===Ot.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ft.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagName=this.current&&this.treeAdapter.getTagName(this.current),this.currentTmplContent=this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):null;}push(e){this.items[++this.stackTop]=e,this._updateCurrentElement(),this._isInTemplate()&&this.tmplCount++;}pop(){this.stackTop--,this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this._updateCurrentElement();}replace(e,t){const n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&this._updateCurrentElement();}insertAfter(e,t){const n=this._indexOf(e)+1;this.items.splice(n,0,t),n===++this.stackTop&&this._updateCurrentElement();}popUntilTagNamePopped(e){for(;this.stackTop>-1;){const t=this.currentTagName,n=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),t===e&&n===ft.HTML)break}}popUntilElementPopped(e){for(;this.stackTop>-1;){const t=this.current;if(this.pop(),t===e)break}}popUntilNumberedHeaderPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===Ot.H1||e===Ot.H2||e===Ot.H3||e===Ot.H4||e===Ot.H5||e===Ot.H6&&t===ft.HTML)break}}popUntilTableCellPopped(){for(;this.stackTop>-1;){const e=this.currentTagName,t=this.treeAdapter.getNamespaceURI(this.current);if(this.pop(),e===Ot.TD||e===Ot.TH&&t===ft.HTML)break}}popAllUpToHtmlElement(){this.stackTop=0,this._updateCurrentElement();}clearBackToTableContext(){for(;this.currentTagName!==Ot.TABLE&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}clearBackToTableBodyContext(){for(;this.currentTagName!==Ot.TBODY&&this.currentTagName!==Ot.TFOOT&&this.currentTagName!==Ot.THEAD&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}clearBackToTableRowContext(){for(;this.currentTagName!==Ot.TR&&this.currentTagName!==Ot.TEMPLATE&&this.currentTagName!==Ot.HTML||this.treeAdapter.getNamespaceURI(this.current)!==ft.HTML;)this.pop();}remove(e){for(let t=this.stackTop;t>=0;t--)if(this.items[t]===e){this.items.splice(t,1),this.stackTop--,this._updateCurrentElement();break}}tryPeekProperlyNestedBodyElement(){const e=this.items[1];return e&&this.treeAdapter.getTagName(e)===Ot.BODY?e:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e);return --t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return 0===this.stackTop&&this.currentTagName===Ot.HTML}hasInScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if(It(n,s))return !1}return !0}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]),n=this.treeAdapter.getNamespaceURI(this.items[e]);if((t===Ot.H1||t===Ot.H2||t===Ot.H3||t===Ot.H4||t===Ot.H5||t===Ot.H6)&&n===ft.HTML)return !0;if(It(t,n))return !1}return !0}hasInListItemScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if((n===Ot.UL||n===Ot.OL)&&s===ft.HTML||It(n,s))return !1}return !0}hasInButtonScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]),s=this.treeAdapter.getNamespaceURI(this.items[t]);if(n===e&&s===ft.HTML)return !0;if(n===Ot.BUTTON&&s===ft.HTML||It(n,s))return !1}return !0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===ft.HTML){if(n===e)return !0;if(n===Ot.TABLE||n===Ot.TEMPLATE||n===Ot.HTML)return !1}}return !0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--){const t=this.treeAdapter.getTagName(this.items[e]);if(this.treeAdapter.getNamespaceURI(this.items[e])===ft.HTML){if(t===Ot.TBODY||t===Ot.THEAD||t===Ot.TFOOT)return !0;if(t===Ot.TABLE||t===Ot.HTML)return !1}}return !0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--){const n=this.treeAdapter.getTagName(this.items[t]);if(this.treeAdapter.getNamespaceURI(this.items[t])===ft.HTML){if(n===e)return !0;if(n!==Ot.OPTION&&n!==Ot.OPTGROUP)return !1}}return !0}generateImpliedEndTags(){for(;St(this.currentTagName);)this.pop();}generateImpliedEndTagsThoroughly(){for(;Rt(this.currentTagName);)this.pop();}generateImpliedEndTagsWithExclusion(e){for(;St(this.currentTagName)&&this.currentTagName!==e;)this.pop();}}(this.document,this.treeAdapter),this.activeFormattingElements=new kt(this.treeAdapter),this.tmplInsertionModeStack=[],this.tmplInsertionModeStackTop=-1,this.currentTmplInsertionMode=null,this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1;}_err(){}_runParsingLoop(e){for(;!this.stopped;){this._setupTokenizerCDATAMode();const t=this.tokenizer.getNextToken();if(t.type===Nt.HIBERNATION_TOKEN)break;if(this.skipNextNewLine&&(this.skipNextNewLine=!1,t.type===Nt.WHITESPACE_CHARACTER_TOKEN&&"\n"===t.chars[0])){if(1===t.chars.length)continue;t.chars=t.chars.substr(1);}if(this._processInputToken(t),e&&this.pendingScript)break}}runParsingLoopForCurrentChunk(e,t){if(this._runParsingLoop(t),t&&this.pendingScript){const e=this.pendingScript;return this.pendingScript=null,void t(e)}e&&e();}_setupTokenizerCDATAMode(){const e=this._getAdjustedCurrentElement();this.tokenizer.allowCDATA=e&&e!==this.document&&this.treeAdapter.getNamespaceURI(e)!==qt.HTML&&!this._isIntegrationPoint(e);}_switchToTextParsing(e,t){this._insertElement(e,qt.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Tn;}switchToPlaintextParsing(){this.insertionMode=Tn,this.originalInsertionMode=an,this.tokenizer.state=Nt.MODE.PLAINTEXT;}_getAdjustedCurrentElement(){return 0===this.openElements.stackTop&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;do{if(this.treeAdapter.getTagName(e)===zt.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e);}while(e)}_initTokenizerForFragmentParsing(){if(this.treeAdapter.getNamespaceURI(this.fragmentContext)===qt.HTML){const e=this.treeAdapter.getTagName(this.fragmentContext);e===zt.TITLE||e===zt.TEXTAREA?this.tokenizer.state=Nt.MODE.RCDATA:e===zt.STYLE||e===zt.XMP||e===zt.IFRAME||e===zt.NOEMBED||e===zt.NOFRAMES||e===zt.NOSCRIPT?this.tokenizer.state=Nt.MODE.RAWTEXT:e===zt.SCRIPT?this.tokenizer.state=Nt.MODE.SCRIPT_DATA:e===zt.PLAINTEXT&&(this.tokenizer.state=Nt.MODE.PLAINTEXT);}}_setDocumentType(e){const t=e.name||"",n=e.publicId||"",s=e.systemId||"";this.treeAdapter.setDocumentType(this.document,t,n,s);}_attachElementToTree(e){if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else {const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.appendChild(t,e);}}_appendElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n);}_insertElement(e,t){const n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n),this.openElements.push(n);}_insertFakeElement(e){const t=this.treeAdapter.createElement(e,qt.HTML,[]);this._attachElementToTree(t),this.openElements.push(t);}_insertTemplate(e){const t=this.treeAdapter.createElement(e.tagName,qt.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t),this.openElements.push(t);}_insertFakeRootElement(){const e=this.treeAdapter.createElement(zt.HTML,qt.HTML,[]);this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e);}_appendCommentNode(e,t){const n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n);}_insertCharacters(e){if(this._shouldFosterParentOnInsertion())this._fosterParentText(e.chars);else {const t=this.openElements.currentTmplContent||this.openElements.current;this.treeAdapter.insertText(t,e.chars);}}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n);}_shouldProcessTokenInForeignContent(e){const t=this._getAdjustedCurrentElement();if(!t||t===this.document)return !1;const n=this.treeAdapter.getNamespaceURI(t);if(n===qt.HTML)return !1;if(this.treeAdapter.getTagName(t)===zt.ANNOTATION_XML&&n===qt.MATHML&&e.type===Nt.START_TAG_TOKEN&&e.tagName===zt.SVG)return !1;const s=e.type===Nt.CHARACTER_TOKEN||e.type===Nt.NULL_CHARACTER_TOKEN||e.type===Nt.WHITESPACE_CHARACTER_TOKEN;return !((e.type===Nt.START_TAG_TOKEN&&e.tagName!==zt.MGLYPH&&e.tagName!==zt.MALIGNMARK||s)&&this._isIntegrationPoint(t,qt.MATHML)||(e.type===Nt.START_TAG_TOKEN||s)&&this._isIntegrationPoint(t,qt.HTML)||e.type===Nt.EOF_TOKEN)}_processToken(e){Ln[this.insertionMode][e.type](this,e);}_processTokenInBodyMode(e){Ln.IN_BODY_MODE[e.type](this,e);}_processTokenInForeignContent(e){e.type===Nt.CHARACTER_TOKEN?function(e,t){e._insertCharacters(t),e.framesetOk=!1;}(this,e):e.type===Nt.NULL_CHARACTER_TOKEN?function(e,t){t.chars=n,e._insertCharacters(t);}(this,e):e.type===Nt.WHITESPACE_CHARACTER_TOKEN?xn(this,e):e.type===Nt.COMMENT_TOKEN?Kn(this,e):e.type===Nt.START_TAG_TOKEN?function(e,t){if(jt.causesExit(t)&&!e.fragmentContext){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==qt.HTML&&!e._isIntegrationPoint(e.openElements.current);)e.openElements.pop();e._processToken(t);}else {const n=e._getAdjustedCurrentElement(),s=e.treeAdapter.getNamespaceURI(n);s===qt.MATHML?jt.adjustTokenMathMLAttrs(t):s===qt.SVG&&(jt.adjustTokenSVGTagName(t),jt.adjustTokenSVGAttrs(t)),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,s):e._insertElement(t,s),t.ackSelfClosing=!0;}}(this,e):e.type===Nt.END_TAG_TOKEN&&function(e,t){for(let n=e.openElements.stackTop;n>0;n--){const s=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(s)===qt.HTML){e._processToken(t);break}if(e.treeAdapter.getTagName(s).toLowerCase()===t.tagName){e.openElements.popUntilElementPopped(s);break}}}(this,e);}_processInputToken(e){this._shouldProcessTokenInForeignContent(e)?this._processTokenInForeignContent(e):this._processToken(e),e.type===Nt.START_TAG_TOKEN&&e.selfClosing&&!e.ackSelfClosing&&this._err("non-void-html-element-start-tag-with-trailing-solidus");}_isIntegrationPoint(e,t){const n=this.treeAdapter.getTagName(e),s=this.treeAdapter.getNamespaceURI(e),r=this.treeAdapter.getAttrList(e);return jt.isIntegrationPoint(n,s,r,t)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.length;if(e){let t=e,n=null;do{if(t--,n=this.activeFormattingElements.entries[t],n.type===kt.MARKER_ENTRY||this.openElements.contains(n.element)){t++;break}}while(t>0);for(let s=t;s<e;s++)n=this.activeFormattingElements.entries[s],this._insertElement(n.token,this.treeAdapter.getNamespaceURI(n.element)),n.element=this.openElements.current;}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=mn;}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(zt.P),this.openElements.popUntilTagNamePopped(zt.P);}_resetInsertionMode(){for(let e=this.openElements.stackTop,t=!1;e>=0;e--){let n=this.openElements.items[e];0===e&&(t=!0,this.fragmentContext&&(n=this.fragmentContext));const s=this.treeAdapter.getTagName(n),r=Rn[s];if(r){this.insertionMode=r;break}if(!(t||s!==zt.TD&&s!==zt.TH)){this.insertionMode=pn;break}if(!t&&s===zt.HEAD){this.insertionMode=sn;break}if(s===zt.SELECT){this._resetInsertionModeForSelect(e);break}if(s===zt.TEMPLATE){this.insertionMode=this.currentTmplInsertionMode;break}if(s===zt.HTML){this.insertionMode=this.headElement?on:nn;break}if(t){this.insertionMode=an;break}}}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){const e=this.openElements.items[t],n=this.treeAdapter.getTagName(e);if(n===zt.TEMPLATE)break;if(n===zt.TABLE)return void(this.insertionMode=un)}this.insertionMode=An;}_pushTmplInsertionMode(e){this.tmplInsertionModeStack.push(e),this.tmplInsertionModeStackTop++,this.currentTmplInsertionMode=e;}_popTmplInsertionMode(){this.tmplInsertionModeStack.pop(),this.tmplInsertionModeStackTop--,this.currentTmplInsertionMode=this.tmplInsertionModeStack[this.tmplInsertionModeStackTop];}_isElementCausesFosterParenting(e){const t=this.treeAdapter.getTagName(e);return t===zt.TABLE||t===zt.TBODY||t===zt.TFOOT||t===zt.THEAD||t===zt.TR}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this._isElementCausesFosterParenting(this.openElements.current)}_findFosterParentingLocation(){const e={parent:null,beforeElement:null};for(let t=this.openElements.stackTop;t>=0;t--){const n=this.openElements.items[t],s=this.treeAdapter.getTagName(n),r=this.treeAdapter.getNamespaceURI(n);if(s===zt.TEMPLATE&&r===qt.HTML){e.parent=this.treeAdapter.getTemplateContent(n);break}if(s===zt.TABLE){e.parent=this.treeAdapter.getParentNode(n),e.parent?e.beforeElement=n:e.parent=this.openElements.items[t-1];break}}return e.parent||(e.parent=this.openElements.items[0]),e}_fosterParentElement(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e);}_fosterParentText(e){const t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertTextBefore(t.parent,e,t.beforeElement):this.treeAdapter.insertText(t.parent,e);}_isSpecialElement(e){const t=this.treeAdapter.getTagName(e),n=this.treeAdapter.getNamespaceURI(e);return Ct.SPECIAL_ELEMENTS[n][t]}};function Mn(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagName)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):hs(e,t),n}function gn(e,t){let n=null;for(let s=e.openElements.stackTop;s>=0;s--){const r=e.openElements.items[s];if(r===t.element)break;e._isSpecialElement(r)&&(n=r);}return n||(e.openElements.popUntilElementPopped(t.element),e.activeFormattingElements.removeEntry(t)),n}function Pn(e,t,n){let s=t,r=e.openElements.getCommonAncestor(t);for(let i=0,o=r;o!==n;i++,o=r){r=e.openElements.getCommonAncestor(o);const n=e.activeFormattingElements.getElementEntry(o),a=n&&i>=3;!n||a?(a&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=Hn(e,n),s===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(s),e.treeAdapter.appendChild(o,s),s=o);}return s}function Hn(e,t){const n=e.treeAdapter.getNamespaceURI(t.element),s=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,s),t.element=s,s}function Dn(e,t,n){if(e._isElementCausesFosterParenting(t))e._fosterParentElement(n);else {const s=e.treeAdapter.getTagName(t),r=e.treeAdapter.getNamespaceURI(t);s===zt.TEMPLATE&&r===qt.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n);}}function Fn(e,t,n){const s=e.treeAdapter.getNamespaceURI(n.element),r=n.token,i=e.treeAdapter.createElement(r.tagName,s,r.attrs);e._adoptNodes(t,i),e.treeAdapter.appendChild(t,i),e.activeFormattingElements.insertElementAfterBookmark(i,n.token),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,i);}function Un(e,t){let n;for(let s=0;s<8&&(n=Mn(e,t),n);s++){const t=gn(e,n);if(!t)break;e.activeFormattingElements.bookmark=n;const s=Pn(e,t,n.element),r=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(s),Dn(e,r,s),Fn(e,t,n);}}function Gn(){}function Bn(e){e._err("misplaced-doctype");}function Kn(e,t){e._appendCommentNode(t,e.openElements.currentTmplContent||e.openElements.current);}function bn(e,t){e._appendCommentNode(t,e.document);}function xn(e,t){e._insertCharacters(t);}function yn(e){e.stopped=!0;}function vn(e,t){e._err("missing-doctype",{beforeToken:!0}),e.treeAdapter.setDocumentMode(e.document,Ct.DOCUMENT_MODE.QUIRKS),e.insertionMode=tn,e._processToken(t);}function Yn(e,t){e._insertFakeRootElement(),e.insertionMode=nn,e._processToken(t);}function wn(e,t){e._insertFakeElement(zt.HEAD),e.headElement=e.openElements.current,e.insertionMode=sn,e._processToken(t);}function Qn(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.BASE||n===zt.BASEFONT||n===zt.BGSOUND||n===zt.LINK||n===zt.META?(e._appendElement(t,qt.HTML),t.ackSelfClosing=!0):n===zt.TITLE?e._switchToTextParsing(t,Nt.MODE.RCDATA):n===zt.NOSCRIPT?e.options.scriptingEnabled?e._switchToTextParsing(t,Nt.MODE.RAWTEXT):(e._insertElement(t,qt.HTML),e.insertionMode=rn):n===zt.NOFRAMES||n===zt.STYLE?e._switchToTextParsing(t,Nt.MODE.RAWTEXT):n===zt.SCRIPT?e._switchToTextParsing(t,Nt.MODE.SCRIPT_DATA):n===zt.TEMPLATE?(e._insertTemplate(t,qt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Nn,e._pushTmplInsertionMode(Nn)):n===zt.HEAD?e._err(k):Wn(e,t);}function Xn(e,t){const n=t.tagName;n===zt.HEAD?(e.openElements.pop(),e.insertionMode=on):n===zt.BODY||n===zt.BR||n===zt.HTML?Wn(e,t):n===zt.TEMPLATE&&e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagName!==zt.TEMPLATE&&e._err("closing-of-element-with-open-child-elements"),e.openElements.popUntilTagNamePopped(zt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode()):e._err(L);}function Wn(e,t){e.openElements.pop(),e.insertionMode=on,e._processToken(t);}function Vn(e,t){const n=t.type===Nt.EOF_TOKEN?"open-elements-left-after-eof":"disallowed-content-in-noscript-in-head";e._err(n),e.openElements.pop(),e.insertionMode=sn,e._processToken(t);}function jn(e,t){e._insertFakeElement(zt.BODY),e.insertionMode=an,e._processToken(t);}function zn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t);}function qn(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1;}function Jn(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}function Zn(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.skipNextNewLine=!0,e.framesetOk=!1;}function $n(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}function es(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1;}function ts(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,qt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}function ns(e,t){e._appendElement(t,qt.HTML),t.ackSelfClosing=!0;}function ss(e,t){e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}function rs(e,t){e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML);}function is(e,t){e.openElements.hasInScope(zt.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,qt.HTML);}function os(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML);}function as(e,t){const n=t.tagName;switch(n.length){case 1:n===zt.I||n===zt.S||n===zt.B||n===zt.U?$n(e,t):n===zt.P?Jn(e,t):n===zt.A?function(e,t){const n=e.activeFormattingElements.getElementEntryInScopeWithTagName(zt.A);n&&(Un(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t):os(e,t);break;case 2:n===zt.DL||n===zt.OL||n===zt.UL?Jn(e,t):n===zt.H1||n===zt.H2||n===zt.H3||n===zt.H4||n===zt.H5||n===zt.H6?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement();const n=e.openElements.currentTagName;n!==zt.H1&&n!==zt.H2&&n!==zt.H3&&n!==zt.H4&&n!==zt.H5&&n!==zt.H6||e.openElements.pop(),e._insertElement(t,qt.HTML);}(e,t):n===zt.LI||n===zt.DD||n===zt.DT?function(e,t){e.framesetOk=!1;const n=t.tagName;for(let t=e.openElements.stackTop;t>=0;t--){const s=e.openElements.items[t],r=e.treeAdapter.getTagName(s);let i=null;if(n===zt.LI&&r===zt.LI?i=zt.LI:n!==zt.DD&&n!==zt.DT||r!==zt.DD&&r!==zt.DT||(i=r),i){e.openElements.generateImpliedEndTagsWithExclusion(i),e.openElements.popUntilTagNamePopped(i);break}if(r!==zt.ADDRESS&&r!==zt.DIV&&r!==zt.P&&e._isSpecialElement(s))break}e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}(e,t):n===zt.EM||n===zt.TT?$n(e,t):n===zt.BR?ts(e,t):n===zt.HR?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._appendElement(t,qt.HTML),e.framesetOk=!1,t.ackSelfClosing=!0;}(e,t):n===zt.RB?is(e,t):n===zt.RT||n===zt.RP?function(e,t){e.openElements.hasInScope(zt.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(zt.RTC),e._insertElement(t,qt.HTML);}(e,t):n!==zt.TH&&n!==zt.TD&&n!==zt.TR&&os(e,t);break;case 3:n===zt.DIV||n===zt.DIR||n===zt.NAV?Jn(e,t):n===zt.PRE?Zn(e,t):n===zt.BIG?$n(e,t):n===zt.IMG||n===zt.WBR?ts(e,t):n===zt.XMP?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}(e,t):n===zt.SVG?function(e,t){e._reconstructActiveFormattingElements(),jt.adjustTokenSVGAttrs(t),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,qt.SVG):e._insertElement(t,qt.SVG),t.ackSelfClosing=!0;}(e,t):n===zt.RTC?is(e,t):n!==zt.COL&&os(e,t);break;case 4:n===zt.HTML?function(e,t){0===e.openElements.tmplCount&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs);}(e,t):n===zt.BASE||n===zt.LINK||n===zt.META?Qn(e,t):n===zt.BODY?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();n&&0===e.openElements.tmplCount&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs));}(e,t):n===zt.MAIN||n===zt.MENU?Jn(e,t):n===zt.FORM?function(e,t){const n=e.openElements.tmplCount>0;e.formElement&&!n||(e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),n||(e.formElement=e.openElements.current));}(e,t):n===zt.CODE||n===zt.FONT?$n(e,t):n===zt.NOBR?function(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(zt.NOBR)&&(Un(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,qt.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t);}(e,t):n===zt.AREA?ts(e,t):n===zt.MATH?function(e,t){e._reconstructActiveFormattingElements(),jt.adjustTokenMathMLAttrs(t),jt.adjustTokenXMLAttrs(t),t.selfClosing?e._appendElement(t,qt.MATHML):e._insertElement(t,qt.MATHML),t.ackSelfClosing=!0;}(e,t):n===zt.MENU?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML);}(e,t):n!==zt.HEAD&&os(e,t);break;case 5:n===zt.STYLE||n===zt.TITLE?Qn(e,t):n===zt.ASIDE?Jn(e,t):n===zt.SMALL?$n(e,t):n===zt.TABLE?function(e,t){e.treeAdapter.getDocumentMode(e.document)!==Ct.DOCUMENT_MODE.QUIRKS&&e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode=En;}(e,t):n===zt.EMBED?ts(e,t):n===zt.INPUT?function(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,qt.HTML);const n=Nt.getTokenAttr(t,Jt.TYPE);n&&n.toLowerCase()===$t||(e.framesetOk=!1),t.ackSelfClosing=!0;}(e,t):n===zt.PARAM||n===zt.TRACK?ns(e,t):n===zt.IMAGE?function(e,t){t.tagName=zt.IMG,ts(e,t);}(e,t):n!==zt.FRAME&&n!==zt.TBODY&&n!==zt.TFOOT&&n!==zt.THEAD&&os(e,t);break;case 6:n===zt.SCRIPT?Qn(e,t):n===zt.CENTER||n===zt.FIGURE||n===zt.FOOTER||n===zt.HEADER||n===zt.HGROUP||n===zt.DIALOG?Jn(e,t):n===zt.BUTTON?function(e,t){e.openElements.hasInScope(zt.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(zt.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.framesetOk=!1;}(e,t):n===zt.STRIKE||n===zt.STRONG?$n(e,t):n===zt.APPLET||n===zt.OBJECT?es(e,t):n===zt.KEYGEN?ts(e,t):n===zt.SOURCE?ns(e,t):n===zt.IFRAME?function(e,t){e.framesetOk=!1,e._switchToTextParsing(t,Nt.MODE.RAWTEXT);}(e,t):n===zt.SELECT?function(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,qt.HTML),e.framesetOk=!1,e.insertionMode===En||e.insertionMode===cn||e.insertionMode===ln||e.insertionMode===mn||e.insertionMode===pn?e.insertionMode=un:e.insertionMode=An;}(e,t):n===zt.OPTION?rs(e,t):os(e,t);break;case 7:n===zt.BGSOUND?Qn(e,t):n===zt.DETAILS||n===zt.ADDRESS||n===zt.ARTICLE||n===zt.SECTION||n===zt.SUMMARY?Jn(e,t):n===zt.LISTING?Zn(e,t):n===zt.MARQUEE?es(e,t):n===zt.NOEMBED?ss(e,t):n!==zt.CAPTION&&os(e,t);break;case 8:n===zt.BASEFONT?Qn(e,t):n===zt.FRAMESET?function(e,t){const n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,qt.HTML),e.insertionMode=Cn);}(e,t):n===zt.FIELDSET?Jn(e,t):n===zt.TEXTAREA?function(e,t){e._insertElement(t,qt.HTML),e.skipNextNewLine=!0,e.tokenizer.state=Nt.MODE.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Tn;}(e,t):n===zt.TEMPLATE?Qn(e,t):n===zt.NOSCRIPT?e.options.scriptingEnabled?ss(e,t):os(e,t):n===zt.OPTGROUP?rs(e,t):n!==zt.COLGROUP&&os(e,t);break;case 9:n===zt.PLAINTEXT?function(e,t){e.openElements.hasInButtonScope(zt.P)&&e._closePElement(),e._insertElement(t,qt.HTML),e.tokenizer.state=Nt.MODE.PLAINTEXT;}(e,t):os(e,t);break;case 10:n===zt.BLOCKQUOTE||n===zt.FIGCAPTION?Jn(e,t):os(e,t);break;default:os(e,t);}}function Ts(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n));}function Es(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker());}function hs(e,t){const n=t.tagName;for(let t=e.openElements.stackTop;t>0;t--){const s=e.openElements.items[t];if(e.treeAdapter.getTagName(s)===n){e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilElementPopped(s);break}if(e._isSpecialElement(s))break}}function cs(e,t){const n=t.tagName;switch(n.length){case 1:n===zt.A||n===zt.B||n===zt.I||n===zt.S||n===zt.U?Un(e,t):n===zt.P?function(e){e.openElements.hasInButtonScope(zt.P)||e._insertFakeElement(zt.P),e._closePElement();}(e):hs(e,t);break;case 2:n===zt.DL||n===zt.UL||n===zt.OL?Ts(e,t):n===zt.LI?function(e){e.openElements.hasInListItemScope(zt.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(zt.LI),e.openElements.popUntilTagNamePopped(zt.LI));}(e):n===zt.DD||n===zt.DT?function(e,t){const n=t.tagName;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n));}(e,t):n===zt.H1||n===zt.H2||n===zt.H3||n===zt.H4||n===zt.H5||n===zt.H6?function(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped());}(e):n===zt.BR?function(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(zt.BR),e.openElements.pop(),e.framesetOk=!1;}(e):n===zt.EM||n===zt.TT?Un(e,t):hs(e,t);break;case 3:n===zt.BIG?Un(e,t):n===zt.DIR||n===zt.DIV||n===zt.NAV||n===zt.PRE?Ts(e,t):hs(e,t);break;case 4:n===zt.BODY?function(e){e.openElements.hasInScope(zt.BODY)&&(e.insertionMode=dn);}(e):n===zt.HTML?function(e,t){e.openElements.hasInScope(zt.BODY)&&(e.insertionMode=dn,e._processToken(t));}(e,t):n===zt.FORM?function(e){const t=e.openElements.tmplCount>0,n=e.formElement;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(zt.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(zt.FORM):e.openElements.remove(n));}(e):n===zt.CODE||n===zt.FONT||n===zt.NOBR?Un(e,t):n===zt.MAIN||n===zt.MENU?Ts(e,t):hs(e,t);break;case 5:n===zt.ASIDE?Ts(e,t):n===zt.SMALL?Un(e,t):hs(e,t);break;case 6:n===zt.CENTER||n===zt.FIGURE||n===zt.FOOTER||n===zt.HEADER||n===zt.HGROUP||n===zt.DIALOG?Ts(e,t):n===zt.APPLET||n===zt.OBJECT?Es(e,t):n===zt.STRIKE||n===zt.STRONG?Un(e,t):hs(e,t);break;case 7:n===zt.ADDRESS||n===zt.ARTICLE||n===zt.DETAILS||n===zt.SECTION||n===zt.SUMMARY||n===zt.LISTING?Ts(e,t):n===zt.MARQUEE?Es(e,t):hs(e,t);break;case 8:n===zt.FIELDSET?Ts(e,t):n===zt.TEMPLATE?Xn(e,t):hs(e,t);break;case 10:n===zt.BLOCKQUOTE||n===zt.FIGCAPTION?Ts(e,t):hs(e,t);break;default:hs(e,t);}}function _s(e,t){e.tmplInsertionModeStackTop>-1?Os(e,t):e.stopped=!0;}function ls(e,t){const n=e.openElements.currentTagName;n===zt.TABLE||n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD||n===zt.TR?(e.pendingCharacterTokens=[],e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=hn,e._processToken(t)):As(e,t);}function ms(e,t){const n=t.tagName;switch(n.length){case 2:n===zt.TD||n===zt.TH||n===zt.TR?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(zt.TBODY),e.insertionMode=ln,e._processToken(t);}(e,t):As(e,t);break;case 3:n===zt.COL?function(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(zt.COLGROUP),e.insertionMode=_n,e._processToken(t);}(e,t):As(e,t);break;case 4:n===zt.FORM?function(e,t){e.formElement||0!==e.openElements.tmplCount||(e._insertElement(t,qt.HTML),e.formElement=e.openElements.current,e.openElements.pop());}(e,t):As(e,t);break;case 5:n===zt.TABLE?function(e,t){e.openElements.hasInTableScope(zt.TABLE)&&(e.openElements.popUntilTagNamePopped(zt.TABLE),e._resetInsertionMode(),e._processToken(t));}(e,t):n===zt.STYLE?Qn(e,t):n===zt.TBODY||n===zt.TFOOT||n===zt.THEAD?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,qt.HTML),e.insertionMode=ln;}(e,t):n===zt.INPUT?function(e,t){const n=Nt.getTokenAttr(t,Jt.TYPE);n&&n.toLowerCase()===$t?e._appendElement(t,qt.HTML):As(e,t),t.ackSelfClosing=!0;}(e,t):As(e,t);break;case 6:n===zt.SCRIPT?Qn(e,t):As(e,t);break;case 7:n===zt.CAPTION?function(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,qt.HTML),e.insertionMode=cn;}(e,t):As(e,t);break;case 8:n===zt.COLGROUP?function(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,qt.HTML),e.insertionMode=_n;}(e,t):n===zt.TEMPLATE?Qn(e,t):As(e,t);break;default:As(e,t);}}function ps(e,t){const n=t.tagName;n===zt.TABLE?e.openElements.hasInTableScope(zt.TABLE)&&(e.openElements.popUntilTagNamePopped(zt.TABLE),e._resetInsertionMode()):n===zt.TEMPLATE?Xn(e,t):n!==zt.BODY&&n!==zt.CAPTION&&n!==zt.COL&&n!==zt.COLGROUP&&n!==zt.HTML&&n!==zt.TBODY&&n!==zt.TD&&n!==zt.TFOOT&&n!==zt.TH&&n!==zt.THEAD&&n!==zt.TR&&As(e,t);}function As(e,t){const n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,e._processTokenInBodyMode(t),e.fosterParentingEnabled=n;}function us(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)As(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t);}function Ns(e,t){e.openElements.currentTagName===zt.COLGROUP&&(e.openElements.pop(),e.insertionMode=En,e._processToken(t));}function ds(e,t){const n=t.tagName;n===zt.HTML?as(e,t):n===zt.OPTION?(e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e._insertElement(t,qt.HTML)):n===zt.OPTGROUP?(e.openElements.currentTagName===zt.OPTION&&e.openElements.pop(),e.openElements.currentTagName===zt.OPTGROUP&&e.openElements.pop(),e._insertElement(t,qt.HTML)):n===zt.INPUT||n===zt.KEYGEN||n===zt.TEXTAREA||n===zt.SELECT?e.openElements.hasInSelectScope(zt.SELECT)&&(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode(),n!==zt.SELECT&&e._processToken(t)):n!==zt.SCRIPT&&n!==zt.TEMPLATE||Qn(e,t);}function Cs(e,t){const n=t.tagName;if(n===zt.OPTGROUP){const t=e.openElements.items[e.openElements.stackTop-1],n=t&&e.treeAdapter.getTagName(t);e.openElements.currentTagName===zt.OPTION&&n===zt.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagName===zt.OPTGROUP&&e.openElements.pop();}else n===zt.OPTION?e.openElements.currentTagName===zt.OPTION&&e.openElements.pop():n===zt.SELECT&&e.openElements.hasInSelectScope(zt.SELECT)?(e.openElements.popUntilTagNamePopped(zt.SELECT),e._resetInsertionMode()):n===zt.TEMPLATE&&Xn(e,t);}function Os(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(zt.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e._popTmplInsertionMode(),e._resetInsertionMode(),e._processToken(t)):e.stopped=!0;}function fs(e,t){e.insertionMode=an,e._processToken(t);}function Ss(e,t){e.insertionMode=an,e._processToken(t);}return Ct.TAG_NAMES,Ct.NAMESPACES,e.parse=function(e,t){return new kn(t).parse(e)},e.parseFragment=function(e,t,n){return "string"==typeof e&&(n=t,t=e,e=null),new kn(n).parseFragment(t,e)},Object.defineProperty(e,"__esModule",{value:!0}),e}({});const parse=e.parse;const parseFragment=e.parseFragment;
|
1229 |
|
1230 | const docParser = new WeakMap();
|
1231 | function parseDocumentUtil(ownerDocument, html) {
|
1232 | const doc = parse(html.trim(), getParser(ownerDocument));
|
1233 | doc.documentElement = doc.firstElementChild;
|
1234 | doc.head = doc.documentElement.firstElementChild;
|
1235 | doc.body = doc.head.nextElementSibling;
|
1236 | return doc;
|
1237 | }
|
1238 | function parseFragmentUtil(ownerDocument, html) {
|
1239 | if (typeof html === 'string') {
|
1240 | html = html.trim();
|
1241 | }
|
1242 | else {
|
1243 | html = '';
|
1244 | }
|
1245 | const frag = parseFragment(html, getParser(ownerDocument));
|
1246 | return frag;
|
1247 | }
|
1248 | function getParser(ownerDocument) {
|
1249 | let parseOptions = docParser.get(ownerDocument);
|
1250 | if (parseOptions != null) {
|
1251 | return parseOptions;
|
1252 | }
|
1253 | const treeAdapter = {
|
1254 | createDocument() {
|
1255 | const doc = ownerDocument.createElement("#document" );
|
1256 | doc['x-mode'] = 'no-quirks';
|
1257 | return doc;
|
1258 | },
|
1259 | setNodeSourceCodeLocation(node, location) {
|
1260 | node.sourceCodeLocation = location;
|
1261 | },
|
1262 | getNodeSourceCodeLocation(node) {
|
1263 | return node.sourceCodeLocation;
|
1264 | },
|
1265 | createDocumentFragment() {
|
1266 | return ownerDocument.createDocumentFragment();
|
1267 | },
|
1268 | createElement(tagName, namespaceURI, attrs) {
|
1269 | const elm = ownerDocument.createElementNS(namespaceURI, tagName);
|
1270 | for (let i = 0; i < attrs.length; i++) {
|
1271 | const attr = attrs[i];
|
1272 | if (attr.namespace == null || attr.namespace === 'http://www.w3.org/1999/xhtml') {
|
1273 | elm.setAttribute(attr.name, attr.value);
|
1274 | }
|
1275 | else {
|
1276 | elm.setAttributeNS(attr.namespace, attr.name, attr.value);
|
1277 | }
|
1278 | }
|
1279 | return elm;
|
1280 | },
|
1281 | createCommentNode(data) {
|
1282 | return ownerDocument.createComment(data);
|
1283 | },
|
1284 | appendChild(parentNode, newNode) {
|
1285 | parentNode.appendChild(newNode);
|
1286 | },
|
1287 | insertBefore(parentNode, newNode, referenceNode) {
|
1288 | parentNode.insertBefore(newNode, referenceNode);
|
1289 | },
|
1290 | setTemplateContent(templateElement, contentElement) {
|
1291 | templateElement.content = contentElement;
|
1292 | },
|
1293 | getTemplateContent(templateElement) {
|
1294 | return templateElement.content;
|
1295 | },
|
1296 | setDocumentType(doc, name, publicId, systemId) {
|
1297 | let doctypeNode = doc.childNodes.find(n => n.nodeType === 10 );
|
1298 | if (doctypeNode == null) {
|
1299 | doctypeNode = ownerDocument.createDocumentTypeNode();
|
1300 | doc.insertBefore(doctypeNode, doc.firstChild);
|
1301 | }
|
1302 | doctypeNode.nodeValue = '!DOCTYPE';
|
1303 | doctypeNode['x-name'] = name;
|
1304 | doctypeNode['x-publicId'] = publicId;
|
1305 | doctypeNode['x-systemId'] = systemId;
|
1306 | },
|
1307 | setDocumentMode(doc, mode) {
|
1308 | doc['x-mode'] = mode;
|
1309 | },
|
1310 | getDocumentMode(doc) {
|
1311 | return doc['x-mode'];
|
1312 | },
|
1313 | detachNode(node) {
|
1314 | node.remove();
|
1315 | },
|
1316 | insertText(parentNode, text) {
|
1317 | const lastChild = parentNode.lastChild;
|
1318 | if (lastChild != null && lastChild.nodeType === 3 ) {
|
1319 | lastChild.nodeValue += text;
|
1320 | }
|
1321 | else {
|
1322 | parentNode.appendChild(ownerDocument.createTextNode(text));
|
1323 | }
|
1324 | },
|
1325 | insertTextBefore(parentNode, text, referenceNode) {
|
1326 | const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
|
1327 | if (prevNode != null && prevNode.nodeType === 3 ) {
|
1328 | prevNode.nodeValue += text;
|
1329 | }
|
1330 | else {
|
1331 | parentNode.insertBefore(ownerDocument.createTextNode(text), referenceNode);
|
1332 | }
|
1333 | },
|
1334 | adoptAttributes(recipient, attrs) {
|
1335 | for (let i = 0; i < attrs.length; i++) {
|
1336 | const attr = attrs[i];
|
1337 | if (recipient.hasAttributeNS(attr.namespace, attr.name) === false) {
|
1338 | recipient.setAttributeNS(attr.namespace, attr.name, attr.value);
|
1339 | }
|
1340 | }
|
1341 | },
|
1342 | getFirstChild(node) {
|
1343 | return node.childNodes[0];
|
1344 | },
|
1345 | getChildNodes(node) {
|
1346 | return node.childNodes;
|
1347 | },
|
1348 | getParentNode(node) {
|
1349 | return node.parentNode;
|
1350 | },
|
1351 | getAttrList(element) {
|
1352 | const attrs = element.attributes.__items.map(attr => {
|
1353 | return {
|
1354 | name: attr.name,
|
1355 | value: attr.value,
|
1356 | namespace: attr.namespaceURI,
|
1357 | prefix: null,
|
1358 | };
|
1359 | });
|
1360 | return attrs;
|
1361 | },
|
1362 | getTagName(element) {
|
1363 | if (element.namespaceURI === 'http://www.w3.org/1999/xhtml') {
|
1364 | return element.nodeName.toLowerCase();
|
1365 | }
|
1366 | else {
|
1367 | return element.nodeName;
|
1368 | }
|
1369 | },
|
1370 | getNamespaceURI(element) {
|
1371 | return element.namespaceURI;
|
1372 | },
|
1373 | getTextNodeContent(textNode) {
|
1374 | return textNode.nodeValue;
|
1375 | },
|
1376 | getCommentNodeContent(commentNode) {
|
1377 | return commentNode.nodeValue;
|
1378 | },
|
1379 | getDocumentTypeNodeName(doctypeNode) {
|
1380 | return doctypeNode['x-name'];
|
1381 | },
|
1382 | getDocumentTypeNodePublicId(doctypeNode) {
|
1383 | return doctypeNode['x-publicId'];
|
1384 | },
|
1385 | getDocumentTypeNodeSystemId(doctypeNode) {
|
1386 | return doctypeNode['x-systemId'];
|
1387 | },
|
1388 | isTextNode(node) {
|
1389 | return node.nodeType === 3 ;
|
1390 | },
|
1391 | isCommentNode(node) {
|
1392 | return node.nodeType === 8 ;
|
1393 | },
|
1394 | isDocumentTypeNode(node) {
|
1395 | return node.nodeType === 10 ;
|
1396 | },
|
1397 | isElementNode(node) {
|
1398 | return node.nodeType === 1 ;
|
1399 | },
|
1400 | };
|
1401 | parseOptions = {
|
1402 | treeAdapter: treeAdapter,
|
1403 | };
|
1404 | docParser.set(ownerDocument, parseOptions);
|
1405 | return parseOptions;
|
1406 | }
|
1407 |
|
1408 | class MockNode {
|
1409 | constructor(ownerDocument, nodeType, nodeName, nodeValue) {
|
1410 | this.ownerDocument = ownerDocument;
|
1411 | this.nodeType = nodeType;
|
1412 | this.nodeName = nodeName;
|
1413 | this._nodeValue = nodeValue;
|
1414 | this.parentNode = null;
|
1415 | this.childNodes = [];
|
1416 | }
|
1417 | appendChild(newNode) {
|
1418 | if (newNode.nodeType === 11 ) {
|
1419 | const nodes = newNode.childNodes.slice();
|
1420 | for (const child of nodes) {
|
1421 | this.appendChild(child);
|
1422 | }
|
1423 | }
|
1424 | else {
|
1425 | newNode.remove();
|
1426 | newNode.parentNode = this;
|
1427 | this.childNodes.push(newNode);
|
1428 | connectNode(this.ownerDocument, newNode);
|
1429 | }
|
1430 | return newNode;
|
1431 | }
|
1432 | append(...items) {
|
1433 | items.forEach(item => {
|
1434 | const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
|
1435 | this.appendChild(isNode ? item : this.ownerDocument.createTextNode(String(item)));
|
1436 | });
|
1437 | }
|
1438 | prepend(...items) {
|
1439 | const firstChild = this.firstChild;
|
1440 | items.forEach(item => {
|
1441 | const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
|
1442 | this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
|
1443 | });
|
1444 | }
|
1445 | cloneNode(deep) {
|
1446 | throw new Error(`invalid node type to clone: ${this.nodeType}, deep: ${deep}`);
|
1447 | }
|
1448 | compareDocumentPosition(_other) {
|
1449 |
|
1450 |
|
1451 | return -1;
|
1452 | }
|
1453 | get firstChild() {
|
1454 | return this.childNodes[0] || null;
|
1455 | }
|
1456 | insertBefore(newNode, referenceNode) {
|
1457 | if (newNode.nodeType === 11 ) {
|
1458 | for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
|
1459 | insertBefore(this, newNode.childNodes[i], referenceNode);
|
1460 | }
|
1461 | }
|
1462 | else {
|
1463 | insertBefore(this, newNode, referenceNode);
|
1464 | }
|
1465 | return newNode;
|
1466 | }
|
1467 | get isConnected() {
|
1468 | let node = this;
|
1469 | while (node != null) {
|
1470 | if (node.nodeType === 9 ) {
|
1471 | return true;
|
1472 | }
|
1473 | node = node.parentNode;
|
1474 | if (node != null && node.nodeType === 11 ) {
|
1475 | node = node.host;
|
1476 | }
|
1477 | }
|
1478 | return false;
|
1479 | }
|
1480 | isSameNode(node) {
|
1481 | return this === node;
|
1482 | }
|
1483 | get lastChild() {
|
1484 | return this.childNodes[this.childNodes.length - 1] || null;
|
1485 | }
|
1486 | get nextSibling() {
|
1487 | if (this.parentNode != null) {
|
1488 | const index = this.parentNode.childNodes.indexOf(this) + 1;
|
1489 | return this.parentNode.childNodes[index] || null;
|
1490 | }
|
1491 | return null;
|
1492 | }
|
1493 | get nodeValue() {
|
1494 | return this._nodeValue;
|
1495 | }
|
1496 | set nodeValue(value) {
|
1497 | this._nodeValue = value;
|
1498 | }
|
1499 | get parentElement() {
|
1500 | return this.parentNode || null;
|
1501 | }
|
1502 | set parentElement(value) {
|
1503 | this.parentNode = value;
|
1504 | }
|
1505 | get previousSibling() {
|
1506 | if (this.parentNode != null) {
|
1507 | const index = this.parentNode.childNodes.indexOf(this) - 1;
|
1508 | return this.parentNode.childNodes[index] || null;
|
1509 | }
|
1510 | return null;
|
1511 | }
|
1512 | contains(otherNode) {
|
1513 | return this.childNodes.includes(otherNode);
|
1514 | }
|
1515 | removeChild(childNode) {
|
1516 | const index = this.childNodes.indexOf(childNode);
|
1517 | if (index > -1) {
|
1518 | this.childNodes.splice(index, 1);
|
1519 | if (this.nodeType === 1 ) {
|
1520 | const wasConnected = this.isConnected;
|
1521 | childNode.parentNode = null;
|
1522 | if (wasConnected === true) {
|
1523 | disconnectNode(childNode);
|
1524 | }
|
1525 | }
|
1526 | else {
|
1527 | childNode.parentNode = null;
|
1528 | }
|
1529 | }
|
1530 | else {
|
1531 | throw new Error(`node not found within childNodes during removeChild`);
|
1532 | }
|
1533 | return childNode;
|
1534 | }
|
1535 | remove() {
|
1536 | if (this.parentNode != null) {
|
1537 | this.parentNode.removeChild(this);
|
1538 | }
|
1539 | }
|
1540 | replaceChild(newChild, oldChild) {
|
1541 | if (oldChild.parentNode === this) {
|
1542 | this.insertBefore(newChild, oldChild);
|
1543 | oldChild.remove();
|
1544 | return newChild;
|
1545 | }
|
1546 | return null;
|
1547 | }
|
1548 | get textContent() {
|
1549 | return this._nodeValue;
|
1550 | }
|
1551 | set textContent(value) {
|
1552 | this._nodeValue = String(value);
|
1553 | }
|
1554 | }
|
1555 | MockNode.ELEMENT_NODE = 1;
|
1556 | MockNode.TEXT_NODE = 3;
|
1557 | MockNode.PROCESSING_INSTRUCTION_NODE = 7;
|
1558 | MockNode.COMMENT_NODE = 8;
|
1559 | MockNode.DOCUMENT_NODE = 9;
|
1560 | MockNode.DOCUMENT_TYPE_NODE = 10;
|
1561 | MockNode.DOCUMENT_FRAGMENT_NODE = 11;
|
1562 | class MockNodeList {
|
1563 | constructor(ownerDocument, childNodes, length) {
|
1564 | this.ownerDocument = ownerDocument;
|
1565 | this.childNodes = childNodes;
|
1566 | this.length = length;
|
1567 | }
|
1568 | }
|
1569 | class MockElement extends MockNode {
|
1570 | constructor(ownerDocument, nodeName) {
|
1571 | super(ownerDocument, 1 , typeof nodeName === 'string' ? nodeName : null, null);
|
1572 | this.namespaceURI = null;
|
1573 | }
|
1574 | addEventListener(type, handler) {
|
1575 | addEventListener(this, type, handler);
|
1576 | }
|
1577 | attachShadow(_opts) {
|
1578 | const shadowRoot = this.ownerDocument.createDocumentFragment();
|
1579 | this.shadowRoot = shadowRoot;
|
1580 | return shadowRoot;
|
1581 | }
|
1582 | get shadowRoot() {
|
1583 | return this.__shadowRoot || null;
|
1584 | }
|
1585 | set shadowRoot(shadowRoot) {
|
1586 | if (shadowRoot != null) {
|
1587 | shadowRoot.host = this;
|
1588 | this.__shadowRoot = shadowRoot;
|
1589 | }
|
1590 | else {
|
1591 | delete this.__shadowRoot;
|
1592 | }
|
1593 | }
|
1594 | get attributes() {
|
1595 | if (this.__attributeMap == null) {
|
1596 | this.__attributeMap = createAttributeProxy(false);
|
1597 | }
|
1598 | return this.__attributeMap;
|
1599 | }
|
1600 | set attributes(attrs) {
|
1601 | this.__attributeMap = attrs;
|
1602 | }
|
1603 | get children() {
|
1604 | return this.childNodes.filter(n => n.nodeType === 1 );
|
1605 | }
|
1606 | get childElementCount() {
|
1607 | return this.childNodes.filter(n => n.nodeType === 1 ).length;
|
1608 | }
|
1609 | get className() {
|
1610 | return this.getAttributeNS(null, 'class') || '';
|
1611 | }
|
1612 | set className(value) {
|
1613 | this.setAttributeNS(null, 'class', value);
|
1614 | }
|
1615 | get classList() {
|
1616 | return new MockClassList(this);
|
1617 | }
|
1618 | click() {
|
1619 | dispatchEvent(this, new MockEvent('click', { bubbles: true, cancelable: true, composed: true }));
|
1620 | }
|
1621 | cloneNode(_deep) {
|
1622 |
|
1623 | return null;
|
1624 | }
|
1625 | closest(selector) {
|
1626 | let elm = this;
|
1627 | while (elm != null) {
|
1628 | if (elm.matches(selector)) {
|
1629 | return elm;
|
1630 | }
|
1631 | elm = elm.parentNode;
|
1632 | }
|
1633 | return null;
|
1634 | }
|
1635 | get dataset() {
|
1636 | return dataset(this);
|
1637 | }
|
1638 | get dir() {
|
1639 | return this.getAttributeNS(null, 'dir') || '';
|
1640 | }
|
1641 | set dir(value) {
|
1642 | this.setAttributeNS(null, 'dir', value);
|
1643 | }
|
1644 | dispatchEvent(ev) {
|
1645 | return dispatchEvent(this, ev);
|
1646 | }
|
1647 | get firstElementChild() {
|
1648 | return this.children[0] || null;
|
1649 | }
|
1650 | getAttribute(attrName) {
|
1651 | if (attrName === 'style') {
|
1652 | if (this.__style != null && this.__style.length > 0) {
|
1653 | return this.style.cssText;
|
1654 | }
|
1655 | return null;
|
1656 | }
|
1657 | const attr = this.attributes.getNamedItem(attrName);
|
1658 | if (attr != null) {
|
1659 | return attr.value;
|
1660 | }
|
1661 | return null;
|
1662 | }
|
1663 | getAttributeNS(namespaceURI, attrName) {
|
1664 | const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
|
1665 | if (attr != null) {
|
1666 | return attr.value;
|
1667 | }
|
1668 | return null;
|
1669 | }
|
1670 | getBoundingClientRect() {
|
1671 | return { bottom: 0, height: 0, left: 0, right: 0, top: 0, width: 0, x: 0, y: 0 };
|
1672 | }
|
1673 | getRootNode(opts) {
|
1674 | const isComposed = opts != null && opts.composed === true;
|
1675 | let node = this;
|
1676 | while (node.parentNode != null) {
|
1677 | node = node.parentNode;
|
1678 | if (isComposed === true && node.parentNode == null && node.host != null) {
|
1679 | node = node.host;
|
1680 | }
|
1681 | }
|
1682 | return node;
|
1683 | }
|
1684 | get draggable() {
|
1685 | return this.getAttributeNS(null, 'draggable') === 'true';
|
1686 | }
|
1687 | set draggable(value) {
|
1688 | this.setAttributeNS(null, 'draggable', value);
|
1689 | }
|
1690 | hasChildNodes() {
|
1691 | return this.childNodes.length > 0;
|
1692 | }
|
1693 | get id() {
|
1694 | return this.getAttributeNS(null, 'id') || '';
|
1695 | }
|
1696 | set id(value) {
|
1697 | this.setAttributeNS(null, 'id', value);
|
1698 | }
|
1699 | get innerHTML() {
|
1700 | if (this.childNodes.length === 0) {
|
1701 | return '';
|
1702 | }
|
1703 | return serializeNodeToHtml(this, {
|
1704 | newLines: false,
|
1705 | indentSpaces: 0,
|
1706 | });
|
1707 | }
|
1708 | set innerHTML(html) {
|
1709 | if (NON_ESCAPABLE_CONTENT.has(this.nodeName) === true) {
|
1710 | setTextContent(this, html);
|
1711 | }
|
1712 | else {
|
1713 | for (let i = this.childNodes.length - 1; i >= 0; i--) {
|
1714 | this.removeChild(this.childNodes[i]);
|
1715 | }
|
1716 | if (typeof html === 'string') {
|
1717 | const frag = parseFragmentUtil(this.ownerDocument, html);
|
1718 | while (frag.childNodes.length > 0) {
|
1719 | this.appendChild(frag.childNodes[0]);
|
1720 | }
|
1721 | }
|
1722 | }
|
1723 | }
|
1724 | get innerText() {
|
1725 | const text = [];
|
1726 | getTextContent(this.childNodes, text);
|
1727 | return text.join('');
|
1728 | }
|
1729 | set innerText(value) {
|
1730 | setTextContent(this, value);
|
1731 | }
|
1732 | insertAdjacentElement(position, elm) {
|
1733 | if (position === 'beforebegin') {
|
1734 | insertBefore(this.parentNode, elm, this);
|
1735 | }
|
1736 | else if (position === 'afterbegin') {
|
1737 | this.prepend(elm);
|
1738 | }
|
1739 | else if (position === 'beforeend') {
|
1740 | this.appendChild(elm);
|
1741 | }
|
1742 | else if (position === 'afterend') {
|
1743 | insertBefore(this.parentNode, elm, this.nextSibling);
|
1744 | }
|
1745 | return elm;
|
1746 | }
|
1747 | insertAdjacentHTML(position, html) {
|
1748 | const frag = parseFragmentUtil(this.ownerDocument, html);
|
1749 | if (position === 'beforebegin') {
|
1750 | while (frag.childNodes.length > 0) {
|
1751 | insertBefore(this.parentNode, frag.childNodes[0], this);
|
1752 | }
|
1753 | }
|
1754 | else if (position === 'afterbegin') {
|
1755 | while (frag.childNodes.length > 0) {
|
1756 | this.prepend(frag.childNodes[frag.childNodes.length - 1]);
|
1757 | }
|
1758 | }
|
1759 | else if (position === 'beforeend') {
|
1760 | while (frag.childNodes.length > 0) {
|
1761 | this.appendChild(frag.childNodes[0]);
|
1762 | }
|
1763 | }
|
1764 | else if (position === 'afterend') {
|
1765 | while (frag.childNodes.length > 0) {
|
1766 | insertBefore(this.parentNode, frag.childNodes[frag.childNodes.length - 1], this.nextSibling);
|
1767 | }
|
1768 | }
|
1769 | }
|
1770 | insertAdjacentText(position, text) {
|
1771 | const elm = this.ownerDocument.createTextNode(text);
|
1772 | if (position === 'beforebegin') {
|
1773 | insertBefore(this.parentNode, elm, this);
|
1774 | }
|
1775 | else if (position === 'afterbegin') {
|
1776 | this.prepend(elm);
|
1777 | }
|
1778 | else if (position === 'beforeend') {
|
1779 | this.appendChild(elm);
|
1780 | }
|
1781 | else if (position === 'afterend') {
|
1782 | insertBefore(this.parentNode, elm, this.nextSibling);
|
1783 | }
|
1784 | }
|
1785 | hasAttribute(attrName) {
|
1786 | if (attrName === 'style') {
|
1787 | return this.__style != null && this.__style.length > 0;
|
1788 | }
|
1789 | return this.getAttribute(attrName) !== null;
|
1790 | }
|
1791 | hasAttributeNS(namespaceURI, name) {
|
1792 | return this.getAttributeNS(namespaceURI, name) !== null;
|
1793 | }
|
1794 | get hidden() {
|
1795 | return this.hasAttributeNS(null, 'hidden');
|
1796 | }
|
1797 | set hidden(isHidden) {
|
1798 | if (isHidden === true) {
|
1799 | this.setAttributeNS(null, 'hidden', '');
|
1800 | }
|
1801 | else {
|
1802 | this.removeAttributeNS(null, 'hidden');
|
1803 | }
|
1804 | }
|
1805 | get lang() {
|
1806 | return this.getAttributeNS(null, 'lang') || '';
|
1807 | }
|
1808 | set lang(value) {
|
1809 | this.setAttributeNS(null, 'lang', value);
|
1810 | }
|
1811 | get lastElementChild() {
|
1812 | const children = this.children;
|
1813 | return children[children.length - 1] || null;
|
1814 | }
|
1815 | matches(selector) {
|
1816 | return matches(selector, this);
|
1817 | }
|
1818 | get nextElementSibling() {
|
1819 | const parentElement = this.parentElement;
|
1820 | if (parentElement != null &&
|
1821 | (parentElement.nodeType === 1 || parentElement.nodeType === 11 || parentElement.nodeType === 9 )) {
|
1822 | const children = parentElement.children;
|
1823 | const index = children.indexOf(this) + 1;
|
1824 | return parentElement.children[index] || null;
|
1825 | }
|
1826 | return null;
|
1827 | }
|
1828 | get outerHTML() {
|
1829 | return serializeNodeToHtml(this, {
|
1830 | newLines: false,
|
1831 | outerHtml: true,
|
1832 | indentSpaces: 0,
|
1833 | });
|
1834 | }
|
1835 | get previousElementSibling() {
|
1836 | const parentElement = this.parentElement;
|
1837 | if (parentElement != null &&
|
1838 | (parentElement.nodeType === 1 || parentElement.nodeType === 11 || parentElement.nodeType === 9 )) {
|
1839 | const children = parentElement.children;
|
1840 | const index = children.indexOf(this) - 1;
|
1841 | return parentElement.children[index] || null;
|
1842 | }
|
1843 | return null;
|
1844 | }
|
1845 | getElementsByClassName(classNames) {
|
1846 | const classes = classNames
|
1847 | .trim()
|
1848 | .split(' ')
|
1849 | .filter(c => c.length > 0);
|
1850 | const results = [];
|
1851 | getElementsByClassName(this, classes, results);
|
1852 | return results;
|
1853 | }
|
1854 | getElementsByTagName(tagName) {
|
1855 | const results = [];
|
1856 | getElementsByTagName(this, tagName.toLowerCase(), results);
|
1857 | return results;
|
1858 | }
|
1859 | querySelector(selector) {
|
1860 | return selectOne(selector, this);
|
1861 | }
|
1862 | querySelectorAll(selector) {
|
1863 | return selectAll(selector, this);
|
1864 | }
|
1865 | removeAttribute(attrName) {
|
1866 | if (attrName === 'style') {
|
1867 | delete this.__style;
|
1868 | }
|
1869 | else {
|
1870 | const attr = this.attributes.getNamedItem(attrName);
|
1871 | if (attr != null) {
|
1872 | this.attributes.removeNamedItemNS(attr);
|
1873 | if (checkAttributeChanged(this) === true) {
|
1874 | attributeChanged(this, attrName, attr.value, null);
|
1875 | }
|
1876 | }
|
1877 | }
|
1878 | }
|
1879 | removeAttributeNS(namespaceURI, attrName) {
|
1880 | const attr = this.attributes.getNamedItemNS(namespaceURI, attrName);
|
1881 | if (attr != null) {
|
1882 | this.attributes.removeNamedItemNS(attr);
|
1883 | if (checkAttributeChanged(this) === true) {
|
1884 | attributeChanged(this, attrName, attr.value, null);
|
1885 | }
|
1886 | }
|
1887 | }
|
1888 | removeEventListener(type, handler) {
|
1889 | removeEventListener(this, type, handler);
|
1890 | }
|
1891 | setAttribute(attrName, value) {
|
1892 | if (attrName === 'style') {
|
1893 | this.style = value;
|
1894 | }
|
1895 | else {
|
1896 | const attributes = this.attributes;
|
1897 | let attr = attributes.getNamedItem(attrName);
|
1898 | const checkAttrChanged = checkAttributeChanged(this);
|
1899 | if (attr != null) {
|
1900 | if (checkAttrChanged === true) {
|
1901 | const oldValue = attr.value;
|
1902 | attr.value = value;
|
1903 | if (oldValue !== attr.value) {
|
1904 | attributeChanged(this, attr.name, oldValue, attr.value);
|
1905 | }
|
1906 | }
|
1907 | else {
|
1908 | attr.value = value;
|
1909 | }
|
1910 | }
|
1911 | else {
|
1912 | if (attributes.caseInsensitive) {
|
1913 | attrName = attrName.toLowerCase();
|
1914 | }
|
1915 | attr = new MockAttr(attrName, value);
|
1916 | attributes.__items.push(attr);
|
1917 | if (checkAttrChanged === true) {
|
1918 | attributeChanged(this, attrName, null, attr.value);
|
1919 | }
|
1920 | }
|
1921 | }
|
1922 | }
|
1923 | setAttributeNS(namespaceURI, attrName, value) {
|
1924 | const attributes = this.attributes;
|
1925 | let attr = attributes.getNamedItemNS(namespaceURI, attrName);
|
1926 | const checkAttrChanged = checkAttributeChanged(this);
|
1927 | if (attr != null) {
|
1928 | if (checkAttrChanged === true) {
|
1929 | const oldValue = attr.value;
|
1930 | attr.value = value;
|
1931 | if (oldValue !== attr.value) {
|
1932 | attributeChanged(this, attr.name, oldValue, attr.value);
|
1933 | }
|
1934 | }
|
1935 | else {
|
1936 | attr.value = value;
|
1937 | }
|
1938 | }
|
1939 | else {
|
1940 | attr = new MockAttr(attrName, value, namespaceURI);
|
1941 | attributes.__items.push(attr);
|
1942 | if (checkAttrChanged === true) {
|
1943 | attributeChanged(this, attrName, null, attr.value);
|
1944 | }
|
1945 | }
|
1946 | }
|
1947 | get style() {
|
1948 | if (this.__style == null) {
|
1949 | this.__style = createCSSStyleDeclaration();
|
1950 | }
|
1951 | return this.__style;
|
1952 | }
|
1953 | set style(val) {
|
1954 | if (typeof val === 'string') {
|
1955 | if (this.__style == null) {
|
1956 | this.__style = createCSSStyleDeclaration();
|
1957 | }
|
1958 | this.__style.cssText = val;
|
1959 | }
|
1960 | else {
|
1961 | this.__style = val;
|
1962 | }
|
1963 | }
|
1964 | get tabIndex() {
|
1965 | return parseInt(this.getAttributeNS(null, 'tabindex') || '-1', 10);
|
1966 | }
|
1967 | set tabIndex(value) {
|
1968 | this.setAttributeNS(null, 'tabindex', value);
|
1969 | }
|
1970 | get tagName() {
|
1971 | return this.nodeName;
|
1972 | }
|
1973 | set tagName(value) {
|
1974 | this.nodeName = value;
|
1975 | }
|
1976 | get textContent() {
|
1977 | const text = [];
|
1978 | getTextContent(this.childNodes, text);
|
1979 | return text.join('');
|
1980 | }
|
1981 | set textContent(value) {
|
1982 | setTextContent(this, value);
|
1983 | }
|
1984 | get title() {
|
1985 | return this.getAttributeNS(null, 'title') || '';
|
1986 | }
|
1987 | set title(value) {
|
1988 | this.setAttributeNS(null, 'title', value);
|
1989 | }
|
1990 | onanimationstart() {
|
1991 |
|
1992 | }
|
1993 | onanimationend() {
|
1994 |
|
1995 | }
|
1996 | onanimationiteration() {
|
1997 |
|
1998 | }
|
1999 | onabort() {
|
2000 |
|
2001 | }
|
2002 | onauxclick() {
|
2003 |
|
2004 | }
|
2005 | onbeforecopy() {
|
2006 |
|
2007 | }
|
2008 | onbeforecut() {
|
2009 |
|
2010 | }
|
2011 | onbeforepaste() {
|
2012 |
|
2013 | }
|
2014 | onblur() {
|
2015 |
|
2016 | }
|
2017 | oncancel() {
|
2018 |
|
2019 | }
|
2020 | oncanplay() {
|
2021 |
|
2022 | }
|
2023 | oncanplaythrough() {
|
2024 |
|
2025 | }
|
2026 | onchange() {
|
2027 |
|
2028 | }
|
2029 | onclick() {
|
2030 |
|
2031 | }
|
2032 | onclose() {
|
2033 |
|
2034 | }
|
2035 | oncontextmenu() {
|
2036 |
|
2037 | }
|
2038 | oncopy() {
|
2039 |
|
2040 | }
|
2041 | oncuechange() {
|
2042 |
|
2043 | }
|
2044 | oncut() {
|
2045 |
|
2046 | }
|
2047 | ondblclick() {
|
2048 |
|
2049 | }
|
2050 | ondrag() {
|
2051 |
|
2052 | }
|
2053 | ondragend() {
|
2054 |
|
2055 | }
|
2056 | ondragenter() {
|
2057 |
|
2058 | }
|
2059 | ondragleave() {
|
2060 |
|
2061 | }
|
2062 | ondragover() {
|
2063 |
|
2064 | }
|
2065 | ondragstart() {
|
2066 |
|
2067 | }
|
2068 | ondrop() {
|
2069 |
|
2070 | }
|
2071 | ondurationchange() {
|
2072 |
|
2073 | }
|
2074 | onemptied() {
|
2075 |
|
2076 | }
|
2077 | onended() {
|
2078 |
|
2079 | }
|
2080 | onerror() {
|
2081 |
|
2082 | }
|
2083 | onfocus() {
|
2084 |
|
2085 | }
|
2086 | onfocusin() {
|
2087 |
|
2088 | }
|
2089 | onfocusout() {
|
2090 |
|
2091 | }
|
2092 | onformdata() {
|
2093 |
|
2094 | }
|
2095 | onfullscreenchange() {
|
2096 |
|
2097 | }
|
2098 | onfullscreenerror() {
|
2099 |
|
2100 | }
|
2101 | ongotpointercapture() {
|
2102 |
|
2103 | }
|
2104 | oninput() {
|
2105 |
|
2106 | }
|
2107 | oninvalid() {
|
2108 |
|
2109 | }
|
2110 | onkeydown() {
|
2111 |
|
2112 | }
|
2113 | onkeypress() {
|
2114 |
|
2115 | }
|
2116 | onkeyup() {
|
2117 |
|
2118 | }
|
2119 | onload() {
|
2120 |
|
2121 | }
|
2122 | onloadeddata() {
|
2123 |
|
2124 | }
|
2125 | onloadedmetadata() {
|
2126 |
|
2127 | }
|
2128 | onloadstart() {
|
2129 |
|
2130 | }
|
2131 | onlostpointercapture() {
|
2132 |
|
2133 | }
|
2134 | onmousedown() {
|
2135 |
|
2136 | }
|
2137 | onmouseenter() {
|
2138 |
|
2139 | }
|
2140 | onmouseleave() {
|
2141 |
|
2142 | }
|
2143 | onmousemove() {
|
2144 |
|
2145 | }
|
2146 | onmouseout() {
|
2147 |
|
2148 | }
|
2149 | onmouseover() {
|
2150 |
|
2151 | }
|
2152 | onmouseup() {
|
2153 |
|
2154 | }
|
2155 | onmousewheel() {
|
2156 |
|
2157 | }
|
2158 | onpaste() {
|
2159 |
|
2160 | }
|
2161 | onpause() {
|
2162 |
|
2163 | }
|
2164 | onplay() {
|
2165 |
|
2166 | }
|
2167 | onplaying() {
|
2168 |
|
2169 | }
|
2170 | onpointercancel() {
|
2171 |
|
2172 | }
|
2173 | onpointerdown() {
|
2174 |
|
2175 | }
|
2176 | onpointerenter() {
|
2177 |
|
2178 | }
|
2179 | onpointerleave() {
|
2180 |
|
2181 | }
|
2182 | onpointermove() {
|
2183 |
|
2184 | }
|
2185 | onpointerout() {
|
2186 |
|
2187 | }
|
2188 | onpointerover() {
|
2189 |
|
2190 | }
|
2191 | onpointerup() {
|
2192 |
|
2193 | }
|
2194 | onprogress() {
|
2195 |
|
2196 | }
|
2197 | onratechange() {
|
2198 |
|
2199 | }
|
2200 | onreset() {
|
2201 |
|
2202 | }
|
2203 | onresize() {
|
2204 |
|
2205 | }
|
2206 | onscroll() {
|
2207 |
|
2208 | }
|
2209 | onsearch() {
|
2210 |
|
2211 | }
|
2212 | onseeked() {
|
2213 |
|
2214 | }
|
2215 | onseeking() {
|
2216 |
|
2217 | }
|
2218 | onselect() {
|
2219 |
|
2220 | }
|
2221 | onselectstart() {
|
2222 |
|
2223 | }
|
2224 | onstalled() {
|
2225 |
|
2226 | }
|
2227 | onsubmit() {
|
2228 |
|
2229 | }
|
2230 | onsuspend() {
|
2231 |
|
2232 | }
|
2233 | ontimeupdate() {
|
2234 |
|
2235 | }
|
2236 | ontoggle() {
|
2237 |
|
2238 | }
|
2239 | onvolumechange() {
|
2240 |
|
2241 | }
|
2242 | onwaiting() {
|
2243 |
|
2244 | }
|
2245 | onwebkitfullscreenchange() {
|
2246 |
|
2247 | }
|
2248 | onwebkitfullscreenerror() {
|
2249 |
|
2250 | }
|
2251 | onwheel() {
|
2252 |
|
2253 | }
|
2254 | toString(opts) {
|
2255 | return serializeNodeToHtml(this, opts);
|
2256 | }
|
2257 | }
|
2258 | function getElementsByClassName(elm, classNames, foundElms) {
|
2259 | const children = elm.children;
|
2260 | for (let i = 0, ii = children.length; i < ii; i++) {
|
2261 | const childElm = children[i];
|
2262 | for (let j = 0, jj = classNames.length; j < jj; j++) {
|
2263 | if (childElm.classList.contains(classNames[j])) {
|
2264 | foundElms.push(childElm);
|
2265 | }
|
2266 | }
|
2267 | getElementsByClassName(childElm, classNames, foundElms);
|
2268 | }
|
2269 | }
|
2270 | function getElementsByTagName(elm, tagName, foundElms) {
|
2271 | const children = elm.children;
|
2272 | for (let i = 0, ii = children.length; i < ii; i++) {
|
2273 | const childElm = children[i];
|
2274 | if (tagName === '*' || childElm.nodeName.toLowerCase() === tagName) {
|
2275 | foundElms.push(childElm);
|
2276 | }
|
2277 | getElementsByTagName(childElm, tagName, foundElms);
|
2278 | }
|
2279 | }
|
2280 | function resetElement(elm) {
|
2281 | resetEventListeners(elm);
|
2282 | delete elm.__attributeMap;
|
2283 | delete elm.__shadowRoot;
|
2284 | delete elm.__style;
|
2285 | }
|
2286 | function insertBefore(parentNode, newNode, referenceNode) {
|
2287 | if (newNode !== referenceNode) {
|
2288 | newNode.remove();
|
2289 | newNode.parentNode = parentNode;
|
2290 | newNode.ownerDocument = parentNode.ownerDocument;
|
2291 | if (referenceNode != null) {
|
2292 | const index = parentNode.childNodes.indexOf(referenceNode);
|
2293 | if (index > -1) {
|
2294 | parentNode.childNodes.splice(index, 0, newNode);
|
2295 | }
|
2296 | else {
|
2297 | throw new Error(`referenceNode not found in parentNode.childNodes`);
|
2298 | }
|
2299 | }
|
2300 | else {
|
2301 | parentNode.childNodes.push(newNode);
|
2302 | }
|
2303 | connectNode(parentNode.ownerDocument, newNode);
|
2304 | }
|
2305 | return newNode;
|
2306 | }
|
2307 | class MockHTMLElement extends MockElement {
|
2308 | constructor(ownerDocument, nodeName) {
|
2309 | super(ownerDocument, typeof nodeName === 'string' ? nodeName.toUpperCase() : null);
|
2310 | this.namespaceURI = 'http://www.w3.org/1999/xhtml';
|
2311 | }
|
2312 | get tagName() {
|
2313 | return this.nodeName;
|
2314 | }
|
2315 | set tagName(value) {
|
2316 | this.nodeName = value;
|
2317 | }
|
2318 | get attributes() {
|
2319 | if (this.__attributeMap == null) {
|
2320 | this.__attributeMap = createAttributeProxy(true);
|
2321 | }
|
2322 | return this.__attributeMap;
|
2323 | }
|
2324 | set attributes(attrs) {
|
2325 | this.__attributeMap = attrs;
|
2326 | }
|
2327 | }
|
2328 | class MockTextNode extends MockNode {
|
2329 | constructor(ownerDocument, text) {
|
2330 | super(ownerDocument, 3 , "#text" , text);
|
2331 | }
|
2332 | cloneNode(_deep) {
|
2333 | return new MockTextNode(null, this.nodeValue);
|
2334 | }
|
2335 | get textContent() {
|
2336 | return this.nodeValue;
|
2337 | }
|
2338 | set textContent(text) {
|
2339 | this.nodeValue = text;
|
2340 | }
|
2341 | get data() {
|
2342 | return this.nodeValue;
|
2343 | }
|
2344 | set data(text) {
|
2345 | this.nodeValue = text;
|
2346 | }
|
2347 | get wholeText() {
|
2348 | if (this.parentNode != null) {
|
2349 | const text = [];
|
2350 | for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
|
2351 | const childNode = this.parentNode.childNodes[i];
|
2352 | if (childNode.nodeType === 3 ) {
|
2353 | text.push(childNode.nodeValue);
|
2354 | }
|
2355 | }
|
2356 | return text.join('');
|
2357 | }
|
2358 | return this.nodeValue;
|
2359 | }
|
2360 | }
|
2361 | function getTextContent(childNodes, text) {
|
2362 | for (let i = 0, ii = childNodes.length; i < ii; i++) {
|
2363 | const childNode = childNodes[i];
|
2364 | if (childNode.nodeType === 3 ) {
|
2365 | text.push(childNode.nodeValue);
|
2366 | }
|
2367 | else if (childNode.nodeType === 1 ) {
|
2368 | getTextContent(childNode.childNodes, text);
|
2369 | }
|
2370 | }
|
2371 | }
|
2372 | function setTextContent(elm, text) {
|
2373 | for (let i = elm.childNodes.length - 1; i >= 0; i--) {
|
2374 | elm.removeChild(elm.childNodes[i]);
|
2375 | }
|
2376 | const textNode = new MockTextNode(elm.ownerDocument, text);
|
2377 | elm.appendChild(textNode);
|
2378 | }
|
2379 |
|
2380 | class MockComment extends MockNode {
|
2381 | constructor(ownerDocument, data) {
|
2382 | super(ownerDocument, 8 , "#comment" , data);
|
2383 | }
|
2384 | cloneNode(_deep) {
|
2385 | return new MockComment(null, this.nodeValue);
|
2386 | }
|
2387 | get textContent() {
|
2388 | return this.nodeValue;
|
2389 | }
|
2390 | set textContent(text) {
|
2391 | this.nodeValue = text;
|
2392 | }
|
2393 | }
|
2394 |
|
2395 | class MockDocumentFragment extends MockHTMLElement {
|
2396 | constructor(ownerDocument) {
|
2397 | super(ownerDocument, null);
|
2398 | this.nodeName = "#document-fragment" ;
|
2399 | this.nodeType = 11 ;
|
2400 | }
|
2401 | getElementById(id) {
|
2402 | return getElementById(this, id);
|
2403 | }
|
2404 | cloneNode(deep) {
|
2405 | const cloned = new MockDocumentFragment(null);
|
2406 | if (deep) {
|
2407 | for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
|
2408 | const childNode = this.childNodes[i];
|
2409 | if (childNode.nodeType === 1 || childNode.nodeType === 3 || childNode.nodeType === 8 ) {
|
2410 | const clonedChildNode = this.childNodes[i].cloneNode(true);
|
2411 | cloned.appendChild(clonedChildNode);
|
2412 | }
|
2413 | }
|
2414 | }
|
2415 | return cloned;
|
2416 | }
|
2417 | }
|
2418 |
|
2419 | class MockDocumentTypeNode extends MockHTMLElement {
|
2420 | constructor(ownerDocument) {
|
2421 | super(ownerDocument, '!DOCTYPE');
|
2422 | this.nodeType = 10 ;
|
2423 | this.setAttribute('html', '');
|
2424 | }
|
2425 | }
|
2426 |
|
2427 | class MockCSSRule {
|
2428 | constructor(parentStyleSheet) {
|
2429 | this.parentStyleSheet = parentStyleSheet;
|
2430 | this.cssText = '';
|
2431 | this.type = 0;
|
2432 | }
|
2433 | }
|
2434 | class MockCSSStyleSheet {
|
2435 | constructor(ownerNode) {
|
2436 | this.type = 'text/css';
|
2437 | this.parentStyleSheet = null;
|
2438 | this.cssRules = [];
|
2439 | this.ownerNode = ownerNode;
|
2440 | }
|
2441 | get rules() {
|
2442 | return this.cssRules;
|
2443 | }
|
2444 | set rules(rules) {
|
2445 | this.cssRules = rules;
|
2446 | }
|
2447 | deleteRule(index) {
|
2448 | if (index >= 0 && index < this.cssRules.length) {
|
2449 | this.cssRules.splice(index, 1);
|
2450 | updateStyleTextNode(this.ownerNode);
|
2451 | }
|
2452 | }
|
2453 | insertRule(rule, index = 0) {
|
2454 | if (typeof index !== 'number') {
|
2455 | index = 0;
|
2456 | }
|
2457 | if (index < 0) {
|
2458 | index = 0;
|
2459 | }
|
2460 | if (index > this.cssRules.length) {
|
2461 | index = this.cssRules.length;
|
2462 | }
|
2463 | const cssRule = new MockCSSRule(this);
|
2464 | cssRule.cssText = rule;
|
2465 | this.cssRules.splice(index, 0, cssRule);
|
2466 | updateStyleTextNode(this.ownerNode);
|
2467 | return index;
|
2468 | }
|
2469 | }
|
2470 | function getStyleElementText(styleElm) {
|
2471 | const output = [];
|
2472 | for (let i = 0; i < styleElm.childNodes.length; i++) {
|
2473 | output.push(styleElm.childNodes[i].nodeValue);
|
2474 | }
|
2475 | return output.join('');
|
2476 | }
|
2477 | function setStyleElementText(styleElm, text) {
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 | const sheet = styleElm.sheet;
|
2483 | sheet.cssRules.length = 0;
|
2484 | sheet.insertRule(text);
|
2485 | updateStyleTextNode(styleElm);
|
2486 | }
|
2487 | function updateStyleTextNode(styleElm) {
|
2488 | const childNodeLen = styleElm.childNodes.length;
|
2489 | if (childNodeLen > 1) {
|
2490 | for (let i = childNodeLen - 1; i >= 1; i--) {
|
2491 | styleElm.removeChild(styleElm.childNodes[i]);
|
2492 | }
|
2493 | }
|
2494 | else if (childNodeLen < 1) {
|
2495 | styleElm.appendChild(styleElm.ownerDocument.createTextNode(''));
|
2496 | }
|
2497 | const textNode = styleElm.childNodes[0];
|
2498 | textNode.nodeValue = styleElm.sheet.cssRules.map(r => r.cssText).join('\n');
|
2499 | }
|
2500 |
|
2501 | function createElement(ownerDocument, tagName) {
|
2502 | if (typeof tagName !== 'string' || tagName === '' || !/^[a-z0-9-_:]+$/i.test(tagName)) {
|
2503 | throw new Error(`The tag name provided (${tagName}) is not a valid name.`);
|
2504 | }
|
2505 | tagName = tagName.toLowerCase();
|
2506 | switch (tagName) {
|
2507 | case 'a':
|
2508 | return new MockAnchorElement(ownerDocument);
|
2509 | case 'base':
|
2510 | return new MockBaseElement(ownerDocument);
|
2511 | case 'button':
|
2512 | return new MockButtonElement(ownerDocument);
|
2513 | case 'canvas':
|
2514 | return new MockCanvasElement(ownerDocument);
|
2515 | case 'form':
|
2516 | return new MockFormElement(ownerDocument);
|
2517 | case 'img':
|
2518 | return new MockImageElement(ownerDocument);
|
2519 | case 'input':
|
2520 | return new MockInputElement(ownerDocument);
|
2521 | case 'link':
|
2522 | return new MockLinkElement(ownerDocument);
|
2523 | case 'meta':
|
2524 | return new MockMetaElement(ownerDocument);
|
2525 | case 'script':
|
2526 | return new MockScriptElement(ownerDocument);
|
2527 | case 'style':
|
2528 | return new MockStyleElement(ownerDocument);
|
2529 | case 'template':
|
2530 | return new MockTemplateElement(ownerDocument);
|
2531 | case 'title':
|
2532 | return new MockTitleElement(ownerDocument);
|
2533 | }
|
2534 | if (ownerDocument != null && tagName.includes('-')) {
|
2535 | const win = ownerDocument.defaultView;
|
2536 | if (win != null && win.customElements != null) {
|
2537 | return createCustomElement(win.customElements, ownerDocument, tagName);
|
2538 | }
|
2539 | }
|
2540 | return new MockHTMLElement(ownerDocument, tagName);
|
2541 | }
|
2542 | function createElementNS(ownerDocument, namespaceURI, tagName) {
|
2543 | if (namespaceURI === 'http://www.w3.org/1999/xhtml') {
|
2544 | return createElement(ownerDocument, tagName);
|
2545 | }
|
2546 | else if (namespaceURI === 'http://www.w3.org/2000/svg') {
|
2547 | return new MockSVGElement(ownerDocument, tagName);
|
2548 | }
|
2549 | else {
|
2550 | return new MockElement(ownerDocument, tagName);
|
2551 | }
|
2552 | }
|
2553 | class MockAnchorElement extends MockHTMLElement {
|
2554 | constructor(ownerDocument) {
|
2555 | super(ownerDocument, 'a');
|
2556 | }
|
2557 | get href() {
|
2558 | return fullUrl(this, 'href');
|
2559 | }
|
2560 | set href(value) {
|
2561 | this.setAttribute('href', value);
|
2562 | }
|
2563 | }
|
2564 | class MockButtonElement extends MockHTMLElement {
|
2565 | constructor(ownerDocument) {
|
2566 | super(ownerDocument, 'button');
|
2567 | }
|
2568 | }
|
2569 | patchPropAttributes(MockButtonElement.prototype, {
|
2570 | type: String,
|
2571 | }, {
|
2572 | type: 'submit',
|
2573 | });
|
2574 | class MockImageElement extends MockHTMLElement {
|
2575 | constructor(ownerDocument) {
|
2576 | super(ownerDocument, 'img');
|
2577 | }
|
2578 | get draggable() {
|
2579 | return this.getAttributeNS(null, 'draggable') !== 'false';
|
2580 | }
|
2581 | set draggable(value) {
|
2582 | this.setAttributeNS(null, 'draggable', value);
|
2583 | }
|
2584 | get src() {
|
2585 | return fullUrl(this, 'src');
|
2586 | }
|
2587 | set src(value) {
|
2588 | this.setAttribute('src', value);
|
2589 | }
|
2590 | }
|
2591 | patchPropAttributes(MockImageElement.prototype, {
|
2592 | height: Number,
|
2593 | width: Number,
|
2594 | });
|
2595 | class MockInputElement extends MockHTMLElement {
|
2596 | constructor(ownerDocument) {
|
2597 | super(ownerDocument, 'input');
|
2598 | }
|
2599 | get list() {
|
2600 | const listId = this.getAttribute('list');
|
2601 | if (listId) {
|
2602 | return this.ownerDocument.getElementById(listId);
|
2603 | }
|
2604 | return null;
|
2605 | }
|
2606 | }
|
2607 | patchPropAttributes(MockInputElement.prototype, {
|
2608 | accept: String,
|
2609 | autocomplete: String,
|
2610 | autofocus: Boolean,
|
2611 | capture: String,
|
2612 | checked: Boolean,
|
2613 | disabled: Boolean,
|
2614 | form: String,
|
2615 | formaction: String,
|
2616 | formenctype: String,
|
2617 | formmethod: String,
|
2618 | formnovalidate: String,
|
2619 | formtarget: String,
|
2620 | height: Number,
|
2621 | inputmode: String,
|
2622 | max: String,
|
2623 | maxLength: Number,
|
2624 | min: String,
|
2625 | minLength: Number,
|
2626 | multiple: Boolean,
|
2627 | name: String,
|
2628 | pattern: String,
|
2629 | placeholder: String,
|
2630 | required: Boolean,
|
2631 | readOnly: Boolean,
|
2632 | size: Number,
|
2633 | spellCheck: Boolean,
|
2634 | src: String,
|
2635 | step: String,
|
2636 | type: String,
|
2637 | value: String,
|
2638 | width: Number,
|
2639 | }, {
|
2640 | type: 'text',
|
2641 | });
|
2642 | class MockFormElement extends MockHTMLElement {
|
2643 | constructor(ownerDocument) {
|
2644 | super(ownerDocument, 'form');
|
2645 | }
|
2646 | }
|
2647 | patchPropAttributes(MockFormElement.prototype, {
|
2648 | name: String,
|
2649 | });
|
2650 | class MockLinkElement extends MockHTMLElement {
|
2651 | constructor(ownerDocument) {
|
2652 | super(ownerDocument, 'link');
|
2653 | }
|
2654 | get href() {
|
2655 | return fullUrl(this, 'href');
|
2656 | }
|
2657 | set href(value) {
|
2658 | this.setAttribute('href', value);
|
2659 | }
|
2660 | }
|
2661 | patchPropAttributes(MockLinkElement.prototype, {
|
2662 | crossorigin: String,
|
2663 | media: String,
|
2664 | rel: String,
|
2665 | type: String,
|
2666 | });
|
2667 | class MockMetaElement extends MockHTMLElement {
|
2668 | constructor(ownerDocument) {
|
2669 | super(ownerDocument, 'meta');
|
2670 | }
|
2671 | }
|
2672 | patchPropAttributes(MockMetaElement.prototype, {
|
2673 | charset: String,
|
2674 | content: String,
|
2675 | name: String,
|
2676 | });
|
2677 | class MockScriptElement extends MockHTMLElement {
|
2678 | constructor(ownerDocument) {
|
2679 | super(ownerDocument, 'script');
|
2680 | }
|
2681 | get src() {
|
2682 | return fullUrl(this, 'src');
|
2683 | }
|
2684 | set src(value) {
|
2685 | this.setAttribute('src', value);
|
2686 | }
|
2687 | }
|
2688 | patchPropAttributes(MockScriptElement.prototype, {
|
2689 | type: String,
|
2690 | });
|
2691 | class MockStyleElement extends MockHTMLElement {
|
2692 | constructor(ownerDocument) {
|
2693 | super(ownerDocument, 'style');
|
2694 | this.sheet = new MockCSSStyleSheet(this);
|
2695 | }
|
2696 | get innerHTML() {
|
2697 | return getStyleElementText(this);
|
2698 | }
|
2699 | set innerHTML(value) {
|
2700 | setStyleElementText(this, value);
|
2701 | }
|
2702 | get innerText() {
|
2703 | return getStyleElementText(this);
|
2704 | }
|
2705 | set innerText(value) {
|
2706 | setStyleElementText(this, value);
|
2707 | }
|
2708 | get textContent() {
|
2709 | return getStyleElementText(this);
|
2710 | }
|
2711 | set textContent(value) {
|
2712 | setStyleElementText(this, value);
|
2713 | }
|
2714 | }
|
2715 | class MockSVGElement extends MockElement {
|
2716 |
|
2717 | get ownerSVGElement() {
|
2718 | return null;
|
2719 | }
|
2720 | get viewportElement() {
|
2721 | return null;
|
2722 | }
|
2723 | focus() {
|
2724 |
|
2725 | }
|
2726 | onunload() {
|
2727 |
|
2728 | }
|
2729 |
|
2730 | get pathLength() {
|
2731 | return 0;
|
2732 | }
|
2733 | isPointInFill(_pt) {
|
2734 | return false;
|
2735 | }
|
2736 | isPointInStroke(_pt) {
|
2737 | return false;
|
2738 | }
|
2739 | getTotalLength() {
|
2740 | return 0;
|
2741 | }
|
2742 | }
|
2743 | class MockBaseElement extends MockHTMLElement {
|
2744 | constructor(ownerDocument) {
|
2745 | super(ownerDocument, 'base');
|
2746 | }
|
2747 | get href() {
|
2748 | return fullUrl(this, 'href');
|
2749 | }
|
2750 | set href(value) {
|
2751 | this.setAttribute('href', value);
|
2752 | }
|
2753 | }
|
2754 | class MockTemplateElement extends MockHTMLElement {
|
2755 | constructor(ownerDocument) {
|
2756 | super(ownerDocument, 'template');
|
2757 | this.content = new MockDocumentFragment(ownerDocument);
|
2758 | }
|
2759 | get innerHTML() {
|
2760 | return this.content.innerHTML;
|
2761 | }
|
2762 | set innerHTML(html) {
|
2763 | this.content.innerHTML = html;
|
2764 | }
|
2765 | cloneNode(deep) {
|
2766 | const cloned = new MockTemplateElement(null);
|
2767 | cloned.attributes = cloneAttributes(this.attributes);
|
2768 | const styleCssText = this.getAttribute('style');
|
2769 | if (styleCssText != null && styleCssText.length > 0) {
|
2770 | cloned.setAttribute('style', styleCssText);
|
2771 | }
|
2772 | cloned.content = this.content.cloneNode(deep);
|
2773 | if (deep) {
|
2774 | for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
|
2775 | const clonedChildNode = this.childNodes[i].cloneNode(true);
|
2776 | cloned.appendChild(clonedChildNode);
|
2777 | }
|
2778 | }
|
2779 | return cloned;
|
2780 | }
|
2781 | }
|
2782 | class MockTitleElement extends MockHTMLElement {
|
2783 | constructor(ownerDocument) {
|
2784 | super(ownerDocument, 'title');
|
2785 | }
|
2786 | get text() {
|
2787 | return this.textContent;
|
2788 | }
|
2789 | set text(value) {
|
2790 | this.textContent = value;
|
2791 | }
|
2792 | }
|
2793 | class MockCanvasElement extends MockHTMLElement {
|
2794 | constructor(ownerDocument) {
|
2795 | super(ownerDocument, 'canvas');
|
2796 | }
|
2797 | getContext() {
|
2798 | return {
|
2799 | fillRect() {
|
2800 | return;
|
2801 | },
|
2802 | clearRect() { },
|
2803 | getImageData: function (_, __, w, h) {
|
2804 | return {
|
2805 | data: new Array(w * h * 4),
|
2806 | };
|
2807 | },
|
2808 | putImageData() { },
|
2809 | createImageData: function () {
|
2810 | return [];
|
2811 | },
|
2812 | setTransform() { },
|
2813 | drawImage() { },
|
2814 | save() { },
|
2815 | fillText() { },
|
2816 | restore() { },
|
2817 | beginPath() { },
|
2818 | moveTo() { },
|
2819 | lineTo() { },
|
2820 | closePath() { },
|
2821 | stroke() { },
|
2822 | translate() { },
|
2823 | scale() { },
|
2824 | rotate() { },
|
2825 | arc() { },
|
2826 | fill() { },
|
2827 | measureText() {
|
2828 | return { width: 0 };
|
2829 | },
|
2830 | transform() { },
|
2831 | rect() { },
|
2832 | clip() { },
|
2833 | };
|
2834 | }
|
2835 | }
|
2836 | function fullUrl(elm, attrName) {
|
2837 | const val = elm.getAttribute(attrName) || '';
|
2838 | if (elm.ownerDocument != null) {
|
2839 | const win = elm.ownerDocument.defaultView;
|
2840 | if (win != null) {
|
2841 | const loc = win.location;
|
2842 | if (loc != null) {
|
2843 | try {
|
2844 | const url = new URL(val, loc.href);
|
2845 | return url.href;
|
2846 | }
|
2847 | catch (e) { }
|
2848 | }
|
2849 | }
|
2850 | }
|
2851 | return val.replace(/\'|\"/g, '').trim();
|
2852 | }
|
2853 | function patchPropAttributes(prototype, attrs, defaults = {}) {
|
2854 | Object.keys(attrs).forEach(propName => {
|
2855 | const attr = attrs[propName];
|
2856 | const defaultValue = defaults[propName];
|
2857 | if (attr === Boolean) {
|
2858 | Object.defineProperty(prototype, propName, {
|
2859 | get() {
|
2860 | return this.hasAttribute(propName);
|
2861 | },
|
2862 | set(value) {
|
2863 | if (value) {
|
2864 | this.setAttribute(propName, '');
|
2865 | }
|
2866 | else {
|
2867 | this.removeAttribute(propName);
|
2868 | }
|
2869 | },
|
2870 | });
|
2871 | }
|
2872 | else if (attr === Number) {
|
2873 | Object.defineProperty(prototype, propName, {
|
2874 | get() {
|
2875 | const value = this.getAttribute(propName);
|
2876 | return value ? parseInt(value, 10) : defaultValue === undefined ? 0 : defaultValue;
|
2877 | },
|
2878 | set(value) {
|
2879 | this.setAttribute(propName, value);
|
2880 | },
|
2881 | });
|
2882 | }
|
2883 | else {
|
2884 | Object.defineProperty(prototype, propName, {
|
2885 | get() {
|
2886 | return this.hasAttribute(propName) ? this.getAttribute(propName) : defaultValue || '';
|
2887 | },
|
2888 | set(value) {
|
2889 | this.setAttribute(propName, value);
|
2890 | },
|
2891 | });
|
2892 | }
|
2893 | });
|
2894 | }
|
2895 | MockElement.prototype.cloneNode = function (deep) {
|
2896 |
|
2897 |
|
2898 |
|
2899 | const cloned = createElement(this.ownerDocument, this.nodeName);
|
2900 | cloned.attributes = cloneAttributes(this.attributes);
|
2901 | const styleCssText = this.getAttribute('style');
|
2902 | if (styleCssText != null && styleCssText.length > 0) {
|
2903 | cloned.setAttribute('style', styleCssText);
|
2904 | }
|
2905 | if (deep) {
|
2906 | for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
|
2907 | const clonedChildNode = this.childNodes[i].cloneNode(true);
|
2908 | cloned.appendChild(clonedChildNode);
|
2909 | }
|
2910 | }
|
2911 | return cloned;
|
2912 | };
|
2913 |
|
2914 | let sharedDocument;
|
2915 | function parseHtmlToDocument(html, ownerDocument = null) {
|
2916 | if (ownerDocument == null) {
|
2917 | if (sharedDocument == null) {
|
2918 | sharedDocument = new MockDocument();
|
2919 | }
|
2920 | ownerDocument = sharedDocument;
|
2921 | }
|
2922 | return parseDocumentUtil(ownerDocument, html);
|
2923 | }
|
2924 | function parseHtmlToFragment(html, ownerDocument = null) {
|
2925 | if (ownerDocument == null) {
|
2926 | if (sharedDocument == null) {
|
2927 | sharedDocument = new MockDocument();
|
2928 | }
|
2929 | ownerDocument = sharedDocument;
|
2930 | }
|
2931 | return parseFragmentUtil(ownerDocument, html);
|
2932 | }
|
2933 |
|
2934 | class MockHeaders {
|
2935 | constructor(init) {
|
2936 | this._values = [];
|
2937 | if (typeof init === 'object') {
|
2938 | if (typeof init[Symbol.iterator] === 'function') {
|
2939 | const kvs = [];
|
2940 | for (const kv of init) {
|
2941 | if (typeof kv[Symbol.iterator] === 'function') {
|
2942 | kvs.push([...kv]);
|
2943 | }
|
2944 | }
|
2945 | for (const kv of kvs) {
|
2946 | this.append(kv[0], kv[1]);
|
2947 | }
|
2948 | }
|
2949 | else {
|
2950 | for (const key in init) {
|
2951 | this.append(key, init[key]);
|
2952 | }
|
2953 | }
|
2954 | }
|
2955 | }
|
2956 | append(key, value) {
|
2957 | this._values.push([key, value + '']);
|
2958 | }
|
2959 | delete(key) {
|
2960 | key = key.toLowerCase();
|
2961 | for (let i = this._values.length - 1; i >= 0; i--) {
|
2962 | if (this._values[i][0].toLowerCase() === key) {
|
2963 | this._values.splice(i, 1);
|
2964 | }
|
2965 | }
|
2966 | }
|
2967 | entries() {
|
2968 | const entries = [];
|
2969 | for (const kv of this.keys()) {
|
2970 | entries.push([kv, this.get(kv)]);
|
2971 | }
|
2972 | let index = -1;
|
2973 | return {
|
2974 | next() {
|
2975 | index++;
|
2976 | return {
|
2977 | value: entries[index],
|
2978 | done: !entries[index],
|
2979 | };
|
2980 | },
|
2981 | [Symbol.iterator]() {
|
2982 | return this;
|
2983 | },
|
2984 | };
|
2985 | }
|
2986 | forEach(cb) {
|
2987 | for (const kv of this.entries()) {
|
2988 | cb(kv[1], kv[0]);
|
2989 | }
|
2990 | }
|
2991 | get(key) {
|
2992 | const rtn = [];
|
2993 | key = key.toLowerCase();
|
2994 | for (const kv of this._values) {
|
2995 | if (kv[0].toLowerCase() === key) {
|
2996 | rtn.push(kv[1]);
|
2997 | }
|
2998 | }
|
2999 | return rtn.length > 0 ? rtn.join(', ') : null;
|
3000 | }
|
3001 | has(key) {
|
3002 | key = key.toLowerCase();
|
3003 | for (const kv of this._values) {
|
3004 | if (kv[0].toLowerCase() === key) {
|
3005 | return true;
|
3006 | }
|
3007 | }
|
3008 | return false;
|
3009 | }
|
3010 | keys() {
|
3011 | const keys = [];
|
3012 | for (const kv of this._values) {
|
3013 | const key = kv[0].toLowerCase();
|
3014 | if (!keys.includes(key)) {
|
3015 | keys.push(key);
|
3016 | }
|
3017 | }
|
3018 | let index = -1;
|
3019 | return {
|
3020 | next() {
|
3021 | index++;
|
3022 | return {
|
3023 | value: keys[index],
|
3024 | done: !keys[index],
|
3025 | };
|
3026 | },
|
3027 | [Symbol.iterator]() {
|
3028 | return this;
|
3029 | },
|
3030 | };
|
3031 | }
|
3032 | set(key, value) {
|
3033 | for (const kv of this._values) {
|
3034 | if (kv[0].toLowerCase() === key.toLowerCase()) {
|
3035 | kv[1] = value + '';
|
3036 | return;
|
3037 | }
|
3038 | }
|
3039 | this.append(key, value);
|
3040 | }
|
3041 | values() {
|
3042 | const values = this._values;
|
3043 | let index = -1;
|
3044 | return {
|
3045 | next() {
|
3046 | index++;
|
3047 | const done = !values[index];
|
3048 | return {
|
3049 | value: done ? undefined : values[index][1],
|
3050 | done,
|
3051 | };
|
3052 | },
|
3053 | [Symbol.iterator]() {
|
3054 | return this;
|
3055 | },
|
3056 | };
|
3057 | }
|
3058 | [Symbol.iterator]() {
|
3059 | return this.entries();
|
3060 | }
|
3061 | }
|
3062 |
|
3063 | class MockRequest {
|
3064 | constructor(input, init = {}) {
|
3065 | this._method = 'GET';
|
3066 | this._url = '/';
|
3067 | this.bodyUsed = false;
|
3068 | this.cache = 'default';
|
3069 | this.credentials = 'same-origin';
|
3070 | this.integrity = '';
|
3071 | this.keepalive = false;
|
3072 | this.mode = 'cors';
|
3073 | this.redirect = 'follow';
|
3074 | this.referrer = 'about:client';
|
3075 | this.referrerPolicy = '';
|
3076 | if (typeof input === 'string') {
|
3077 | this.url = input;
|
3078 | }
|
3079 | else if (input) {
|
3080 | Object.assign(this, input);
|
3081 | this.headers = new MockHeaders(input.headers);
|
3082 | }
|
3083 | Object.assign(this, init);
|
3084 | if (init.headers) {
|
3085 | this.headers = new MockHeaders(init.headers);
|
3086 | }
|
3087 | if (!this.headers) {
|
3088 | this.headers = new MockHeaders();
|
3089 | }
|
3090 | }
|
3091 | get url() {
|
3092 | if (typeof this._url === 'string') {
|
3093 | return new URL(this._url, location.href).href;
|
3094 | }
|
3095 | return new URL('/', location.href).href;
|
3096 | }
|
3097 | set url(value) {
|
3098 | this._url = value;
|
3099 | }
|
3100 | get method() {
|
3101 | if (typeof this._method === 'string') {
|
3102 | return this._method.toUpperCase();
|
3103 | }
|
3104 | return 'GET';
|
3105 | }
|
3106 | set method(value) {
|
3107 | this._method = value;
|
3108 | }
|
3109 | clone() {
|
3110 | const clone = { ...this };
|
3111 | clone.headers = new MockHeaders(this.headers);
|
3112 | return new MockRequest(clone);
|
3113 | }
|
3114 | }
|
3115 | class MockResponse {
|
3116 | constructor(body, init = {}) {
|
3117 | this.ok = true;
|
3118 | this.status = 200;
|
3119 | this.statusText = '';
|
3120 | this.type = 'default';
|
3121 | this.url = '';
|
3122 | this._body = body;
|
3123 | if (init) {
|
3124 | Object.assign(this, init);
|
3125 | }
|
3126 | this.headers = new MockHeaders(init.headers);
|
3127 | }
|
3128 | async json() {
|
3129 | return JSON.parse(this._body);
|
3130 | }
|
3131 | async text() {
|
3132 | return this._body;
|
3133 | }
|
3134 | clone() {
|
3135 | const initClone = { ...this };
|
3136 | initClone.headers = new MockHeaders(this.headers);
|
3137 | return new MockResponse(this._body, initClone);
|
3138 | }
|
3139 | }
|
3140 |
|
3141 | function setupGlobal(gbl) {
|
3142 | if (gbl.window == null) {
|
3143 | const win = (gbl.window = new MockWindow());
|
3144 | WINDOW_FUNCTIONS.forEach(fnName => {
|
3145 | if (!(fnName in gbl)) {
|
3146 | gbl[fnName] = win[fnName].bind(win);
|
3147 | }
|
3148 | });
|
3149 | WINDOW_PROPS.forEach(propName => {
|
3150 | if (!(propName in gbl)) {
|
3151 | Object.defineProperty(gbl, propName, {
|
3152 | get() {
|
3153 | return win[propName];
|
3154 | },
|
3155 | set(val) {
|
3156 | win[propName] = val;
|
3157 | },
|
3158 | configurable: true,
|
3159 | enumerable: true,
|
3160 | });
|
3161 | }
|
3162 | });
|
3163 | GLOBAL_CONSTRUCTORS.forEach(([cstrName]) => {
|
3164 | gbl[cstrName] = win[cstrName];
|
3165 | });
|
3166 | }
|
3167 | return gbl.window;
|
3168 | }
|
3169 | function teardownGlobal(gbl) {
|
3170 | const win = gbl.window;
|
3171 | if (win && typeof win.close === 'function') {
|
3172 | win.close();
|
3173 | }
|
3174 | }
|
3175 | function patchWindow(winToBePatched) {
|
3176 | const mockWin = new MockWindow(false);
|
3177 | WINDOW_FUNCTIONS.forEach(fnName => {
|
3178 | if (typeof winToBePatched[fnName] !== 'function') {
|
3179 | winToBePatched[fnName] = mockWin[fnName].bind(mockWin);
|
3180 | }
|
3181 | });
|
3182 | WINDOW_PROPS.forEach(propName => {
|
3183 | if (winToBePatched === undefined) {
|
3184 | Object.defineProperty(winToBePatched, propName, {
|
3185 | get() {
|
3186 | return mockWin[propName];
|
3187 | },
|
3188 | set(val) {
|
3189 | mockWin[propName] = val;
|
3190 | },
|
3191 | configurable: true,
|
3192 | enumerable: true,
|
3193 | });
|
3194 | }
|
3195 | });
|
3196 | }
|
3197 | function addGlobalsToWindowPrototype(mockWinPrototype) {
|
3198 | GLOBAL_CONSTRUCTORS.forEach(([cstrName, Cstr]) => {
|
3199 | Object.defineProperty(mockWinPrototype, cstrName, {
|
3200 | get() {
|
3201 | return this['__' + cstrName] || Cstr;
|
3202 | },
|
3203 | set(cstr) {
|
3204 | this['__' + cstrName] = cstr;
|
3205 | },
|
3206 | configurable: true,
|
3207 | enumerable: true,
|
3208 | });
|
3209 | });
|
3210 | }
|
3211 | const WINDOW_FUNCTIONS = [
|
3212 | 'addEventListener',
|
3213 | 'alert',
|
3214 | 'blur',
|
3215 | 'cancelAnimationFrame',
|
3216 | 'cancelIdleCallback',
|
3217 | 'clearInterval',
|
3218 | 'clearTimeout',
|
3219 | 'close',
|
3220 | 'confirm',
|
3221 | 'dispatchEvent',
|
3222 | 'focus',
|
3223 | 'getComputedStyle',
|
3224 | 'matchMedia',
|
3225 | 'open',
|
3226 | 'prompt',
|
3227 | 'removeEventListener',
|
3228 | 'requestAnimationFrame',
|
3229 | 'requestIdleCallback',
|
3230 | 'URL',
|
3231 | ];
|
3232 | const WINDOW_PROPS = [
|
3233 | 'customElements',
|
3234 | 'devicePixelRatio',
|
3235 | 'document',
|
3236 | 'history',
|
3237 | 'innerHeight',
|
3238 | 'innerWidth',
|
3239 | 'localStorage',
|
3240 | 'location',
|
3241 | 'navigator',
|
3242 | 'pageXOffset',
|
3243 | 'pageYOffset',
|
3244 | 'performance',
|
3245 | 'screenLeft',
|
3246 | 'screenTop',
|
3247 | 'screenX',
|
3248 | 'screenY',
|
3249 | 'scrollX',
|
3250 | 'scrollY',
|
3251 | 'sessionStorage',
|
3252 | 'CSS',
|
3253 | 'CustomEvent',
|
3254 | 'Event',
|
3255 | 'Element',
|
3256 | 'HTMLElement',
|
3257 | 'Node',
|
3258 | 'NodeList',
|
3259 | 'KeyboardEvent',
|
3260 | 'MouseEvent',
|
3261 | ];
|
3262 | const GLOBAL_CONSTRUCTORS = [
|
3263 | ['CustomEvent', MockCustomEvent],
|
3264 | ['Event', MockEvent],
|
3265 | ['Headers', MockHeaders],
|
3266 | ['KeyboardEvent', MockKeyboardEvent],
|
3267 | ['MouseEvent', MockMouseEvent],
|
3268 | ['Request', MockRequest],
|
3269 | ['Response', MockResponse],
|
3270 | ['HTMLAnchorElement', MockAnchorElement],
|
3271 | ['HTMLBaseElement', MockBaseElement],
|
3272 | ['HTMLButtonElement', MockButtonElement],
|
3273 | ['HTMLCanvasElement', MockCanvasElement],
|
3274 | ['HTMLFormElement', MockFormElement],
|
3275 | ['HTMLImageElement', MockImageElement],
|
3276 | ['HTMLInputElement', MockInputElement],
|
3277 | ['HTMLLinkElement', MockLinkElement],
|
3278 | ['HTMLMetaElement', MockMetaElement],
|
3279 | ['HTMLScriptElement', MockScriptElement],
|
3280 | ['HTMLStyleElement', MockStyleElement],
|
3281 | ['HTMLTemplateElement', MockTemplateElement],
|
3282 | ['HTMLTitleElement', MockTitleElement],
|
3283 | ];
|
3284 |
|
3285 | const consoleNoop = () => {
|
3286 |
|
3287 | };
|
3288 | function createConsole() {
|
3289 | return {
|
3290 | debug: consoleNoop,
|
3291 | error: consoleNoop,
|
3292 | info: consoleNoop,
|
3293 | log: consoleNoop,
|
3294 | warn: consoleNoop,
|
3295 | dir: consoleNoop,
|
3296 | dirxml: consoleNoop,
|
3297 | table: consoleNoop,
|
3298 | trace: consoleNoop,
|
3299 | group: consoleNoop,
|
3300 | groupCollapsed: consoleNoop,
|
3301 | groupEnd: consoleNoop,
|
3302 | clear: consoleNoop,
|
3303 | count: consoleNoop,
|
3304 | countReset: consoleNoop,
|
3305 | assert: consoleNoop,
|
3306 | profile: consoleNoop,
|
3307 | profileEnd: consoleNoop,
|
3308 | time: consoleNoop,
|
3309 | timeLog: consoleNoop,
|
3310 | timeEnd: consoleNoop,
|
3311 | timeStamp: consoleNoop,
|
3312 | context: consoleNoop,
|
3313 | memory: consoleNoop,
|
3314 | };
|
3315 | }
|
3316 |
|
3317 | class MockHistory {
|
3318 | constructor() {
|
3319 | this.items = [];
|
3320 | }
|
3321 | get length() {
|
3322 | return this.items.length;
|
3323 | }
|
3324 | back() {
|
3325 | this.go(-1);
|
3326 | }
|
3327 | forward() {
|
3328 | this.go(1);
|
3329 | }
|
3330 | go(_value) {
|
3331 |
|
3332 | }
|
3333 | pushState(_state, _title, _url) {
|
3334 |
|
3335 | }
|
3336 | replaceState(_state, _title, _url) {
|
3337 |
|
3338 | }
|
3339 | }
|
3340 |
|
3341 | class MockIntersectionObserver {
|
3342 | constructor() {
|
3343 |
|
3344 | }
|
3345 | disconnect() {
|
3346 |
|
3347 | }
|
3348 | observe() {
|
3349 |
|
3350 | }
|
3351 | takeRecords() {
|
3352 | return [];
|
3353 | }
|
3354 | unobserve() {
|
3355 |
|
3356 | }
|
3357 | }
|
3358 |
|
3359 | class MockLocation {
|
3360 | constructor() {
|
3361 | this.ancestorOrigins = null;
|
3362 | this.protocol = '';
|
3363 | this.host = '';
|
3364 | this.hostname = '';
|
3365 | this.port = '';
|
3366 | this.pathname = '';
|
3367 | this.search = '';
|
3368 | this.hash = '';
|
3369 | this.username = '';
|
3370 | this.password = '';
|
3371 | this.origin = '';
|
3372 | this._href = '';
|
3373 | }
|
3374 | get href() {
|
3375 | return this._href;
|
3376 | }
|
3377 | set href(value) {
|
3378 | const url = new URL(value, 'http://mockdoc.stenciljs.com');
|
3379 | this._href = url.href;
|
3380 | this.protocol = url.protocol;
|
3381 | this.host = url.host;
|
3382 | this.hostname = url.hostname;
|
3383 | this.port = url.port;
|
3384 | this.pathname = url.pathname;
|
3385 | this.search = url.search;
|
3386 | this.hash = url.hash;
|
3387 | this.username = url.username;
|
3388 | this.password = url.password;
|
3389 | this.origin = url.origin;
|
3390 | }
|
3391 | assign(_url) {
|
3392 |
|
3393 | }
|
3394 | reload(_forcedReload) {
|
3395 |
|
3396 | }
|
3397 | replace(_url) {
|
3398 |
|
3399 | }
|
3400 | toString() {
|
3401 | return this.href;
|
3402 | }
|
3403 | }
|
3404 |
|
3405 | class MockNavigator {
|
3406 | constructor() {
|
3407 | this.appCodeName = 'MockNavigator';
|
3408 | this.appName = 'MockNavigator';
|
3409 | this.appVersion = 'MockNavigator';
|
3410 | this.platform = 'MockNavigator';
|
3411 | this.userAgent = 'MockNavigator';
|
3412 | }
|
3413 | }
|
3414 |
|
3415 |
|
3416 |
|
3417 |
|
3418 | class MockPerformance {
|
3419 | constructor() {
|
3420 | this.timeOrigin = Date.now();
|
3421 | }
|
3422 | addEventListener() {
|
3423 |
|
3424 | }
|
3425 | clearMarks() {
|
3426 |
|
3427 | }
|
3428 | clearMeasures() {
|
3429 |
|
3430 | }
|
3431 | clearResourceTimings() {
|
3432 |
|
3433 | }
|
3434 | dispatchEvent() {
|
3435 | return true;
|
3436 | }
|
3437 | getEntries() {
|
3438 | return [];
|
3439 | }
|
3440 | getEntriesByName() {
|
3441 | return [];
|
3442 | }
|
3443 | getEntriesByType() {
|
3444 | return [];
|
3445 | }
|
3446 | mark() {
|
3447 |
|
3448 | }
|
3449 | measure() {
|
3450 |
|
3451 | }
|
3452 | get navigation() {
|
3453 | return {};
|
3454 | }
|
3455 | now() {
|
3456 | return Date.now() - this.timeOrigin;
|
3457 | }
|
3458 | get onresourcetimingbufferfull() {
|
3459 | return null;
|
3460 | }
|
3461 | removeEventListener() {
|
3462 |
|
3463 | }
|
3464 | setResourceTimingBufferSize() {
|
3465 |
|
3466 | }
|
3467 | get timing() {
|
3468 | return {};
|
3469 | }
|
3470 | toJSON() {
|
3471 |
|
3472 | }
|
3473 | }
|
3474 | function resetPerformance(perf) {
|
3475 | if (perf != null) {
|
3476 | try {
|
3477 | perf.timeOrigin = Date.now();
|
3478 | }
|
3479 | catch (e) { }
|
3480 | }
|
3481 | }
|
3482 |
|
3483 | class MockStorage {
|
3484 | constructor() {
|
3485 | this.items = new Map();
|
3486 | }
|
3487 | key(_value) {
|
3488 |
|
3489 | }
|
3490 | getItem(key) {
|
3491 | key = String(key);
|
3492 | if (this.items.has(key)) {
|
3493 | return this.items.get(key);
|
3494 | }
|
3495 | return null;
|
3496 | }
|
3497 | setItem(key, value) {
|
3498 | if (value == null) {
|
3499 | value = 'null';
|
3500 | }
|
3501 | this.items.set(String(key), String(value));
|
3502 | }
|
3503 | removeItem(key) {
|
3504 | this.items.delete(String(key));
|
3505 | }
|
3506 | clear() {
|
3507 | this.items.clear();
|
3508 | }
|
3509 | }
|
3510 |
|
3511 | const nativeClearInterval = clearInterval;
|
3512 | const nativeClearTimeout = clearTimeout;
|
3513 | const nativeSetInterval = setInterval;
|
3514 | const nativeSetTimeout = setTimeout;
|
3515 | const nativeURL = URL;
|
3516 | class MockWindow {
|
3517 | constructor(html = null) {
|
3518 | if (html !== false) {
|
3519 | this.document = new MockDocument(html, this);
|
3520 | }
|
3521 | else {
|
3522 | this.document = null;
|
3523 | }
|
3524 | this.performance = new MockPerformance();
|
3525 | this.customElements = new MockCustomElementRegistry(this);
|
3526 | this.console = createConsole();
|
3527 | resetWindowDefaults(this);
|
3528 | resetWindowDimensions(this);
|
3529 | }
|
3530 | addEventListener(type, handler) {
|
3531 | addEventListener(this, type, handler);
|
3532 | }
|
3533 | alert(msg) {
|
3534 | if (this.console) {
|
3535 | this.console.debug(msg);
|
3536 | }
|
3537 | else {
|
3538 | console.debug(msg);
|
3539 | }
|
3540 | }
|
3541 | blur() {
|
3542 |
|
3543 | }
|
3544 | cancelAnimationFrame(id) {
|
3545 | this.__clearTimeout(id);
|
3546 | }
|
3547 | cancelIdleCallback(id) {
|
3548 | this.__clearTimeout(id);
|
3549 | }
|
3550 | get CharacterData() {
|
3551 | if (this.__charDataCstr == null) {
|
3552 | const ownerDocument = this.document;
|
3553 | this.__charDataCstr = class extends MockNode {
|
3554 | constructor() {
|
3555 | super(ownerDocument, 0, 'test', '');
|
3556 | throw new Error('Illegal constructor: cannot construct CharacterData');
|
3557 | }
|
3558 | };
|
3559 | }
|
3560 | return this.__charDataCstr;
|
3561 | }
|
3562 | set CharacterData(charDataCstr) {
|
3563 | this.__charDataCstr = charDataCstr;
|
3564 | }
|
3565 | clearInterval(id) {
|
3566 | this.__clearInterval(id);
|
3567 | }
|
3568 | clearTimeout(id) {
|
3569 | this.__clearTimeout(id);
|
3570 | }
|
3571 | close() {
|
3572 | resetWindow(this);
|
3573 | }
|
3574 | confirm() {
|
3575 | return false;
|
3576 | }
|
3577 | get CSS() {
|
3578 | return {
|
3579 | supports: () => true,
|
3580 | };
|
3581 | }
|
3582 | get Document() {
|
3583 | if (this.__docCstr == null) {
|
3584 | const win = this;
|
3585 | this.__docCstr = class extends MockDocument {
|
3586 | constructor() {
|
3587 | super(false, win);
|
3588 | throw new Error('Illegal constructor: cannot construct Document');
|
3589 | }
|
3590 | };
|
3591 | }
|
3592 | return this.__docCstr;
|
3593 | }
|
3594 | set Document(docCstr) {
|
3595 | this.__docCstr = docCstr;
|
3596 | }
|
3597 | get DocumentFragment() {
|
3598 | if (this.__docFragCstr == null) {
|
3599 | const ownerDocument = this.document;
|
3600 | this.__docFragCstr = class extends MockDocumentFragment {
|
3601 | constructor() {
|
3602 | super(ownerDocument);
|
3603 | throw new Error('Illegal constructor: cannot construct DocumentFragment');
|
3604 | }
|
3605 | };
|
3606 | }
|
3607 | return this.__docFragCstr;
|
3608 | }
|
3609 | set DocumentFragment(docFragCstr) {
|
3610 | this.__docFragCstr = docFragCstr;
|
3611 | }
|
3612 | get DocumentType() {
|
3613 | if (this.__docTypeCstr == null) {
|
3614 | const ownerDocument = this.document;
|
3615 | this.__docTypeCstr = class extends MockNode {
|
3616 | constructor() {
|
3617 | super(ownerDocument, 0, 'test', '');
|
3618 | throw new Error('Illegal constructor: cannot construct DocumentType');
|
3619 | }
|
3620 | };
|
3621 | }
|
3622 | return this.__docTypeCstr;
|
3623 | }
|
3624 | set DocumentType(docTypeCstr) {
|
3625 | this.__docTypeCstr = docTypeCstr;
|
3626 | }
|
3627 | get DOMTokenList() {
|
3628 | if (this.__domTokenListCstr == null) {
|
3629 | this.__domTokenListCstr = class MockDOMTokenList {
|
3630 | };
|
3631 | }
|
3632 | return this.__domTokenListCstr;
|
3633 | }
|
3634 | set DOMTokenList(domTokenListCstr) {
|
3635 | this.__domTokenListCstr = domTokenListCstr;
|
3636 | }
|
3637 | dispatchEvent(ev) {
|
3638 | return dispatchEvent(this, ev);
|
3639 | }
|
3640 | get Element() {
|
3641 | if (this.__elementCstr == null) {
|
3642 | const ownerDocument = this.document;
|
3643 | this.__elementCstr = class extends MockElement {
|
3644 | constructor() {
|
3645 | super(ownerDocument, '');
|
3646 | throw new Error('Illegal constructor: cannot construct Element');
|
3647 | }
|
3648 | };
|
3649 | }
|
3650 | return this.__elementCstr;
|
3651 | }
|
3652 | fetch(input, init) {
|
3653 | if (typeof fetch === 'function') {
|
3654 | return fetch(input, init);
|
3655 | }
|
3656 | throw new Error(`fetch() not implemented`);
|
3657 | }
|
3658 | focus() {
|
3659 |
|
3660 | }
|
3661 | getComputedStyle(_) {
|
3662 | return {
|
3663 | cssText: '',
|
3664 | length: 0,
|
3665 | parentRule: null,
|
3666 | getPropertyPriority() {
|
3667 | return null;
|
3668 | },
|
3669 | getPropertyValue() {
|
3670 | return '';
|
3671 | },
|
3672 | item() {
|
3673 | return null;
|
3674 | },
|
3675 | removeProperty() {
|
3676 | return null;
|
3677 | },
|
3678 | setProperty() {
|
3679 | return null;
|
3680 | },
|
3681 | };
|
3682 | }
|
3683 | get globalThis() {
|
3684 | return this;
|
3685 | }
|
3686 | get history() {
|
3687 | if (this.__history == null) {
|
3688 | this.__history = new MockHistory();
|
3689 | }
|
3690 | return this.__history;
|
3691 | }
|
3692 | set history(hsty) {
|
3693 | this.__history = hsty;
|
3694 | }
|
3695 | get JSON() {
|
3696 | return JSON;
|
3697 | }
|
3698 | get HTMLElement() {
|
3699 | if (this.__htmlElementCstr == null) {
|
3700 | const ownerDocument = this.document;
|
3701 | this.__htmlElementCstr = class extends MockHTMLElement {
|
3702 | constructor() {
|
3703 | super(ownerDocument, '');
|
3704 | const observedAttributes = this.constructor.observedAttributes;
|
3705 | if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === 'function') {
|
3706 | observedAttributes.forEach(attrName => {
|
3707 | const attrValue = this.getAttribute(attrName);
|
3708 | if (attrValue != null) {
|
3709 | this.attributeChangedCallback(attrName, null, attrValue);
|
3710 | }
|
3711 | });
|
3712 | }
|
3713 | }
|
3714 | };
|
3715 | }
|
3716 | return this.__htmlElementCstr;
|
3717 | }
|
3718 | set HTMLElement(htmlElementCstr) {
|
3719 | this.__htmlElementCstr = htmlElementCstr;
|
3720 | }
|
3721 | get IntersectionObserver() {
|
3722 | return MockIntersectionObserver;
|
3723 | }
|
3724 | get localStorage() {
|
3725 | if (this.__localStorage == null) {
|
3726 | this.__localStorage = new MockStorage();
|
3727 | }
|
3728 | return this.__localStorage;
|
3729 | }
|
3730 | set localStorage(locStorage) {
|
3731 | this.__localStorage = locStorage;
|
3732 | }
|
3733 | get location() {
|
3734 | if (this.__location == null) {
|
3735 | this.__location = new MockLocation();
|
3736 | }
|
3737 | return this.__location;
|
3738 | }
|
3739 | set location(val) {
|
3740 | if (typeof val === 'string') {
|
3741 | if (this.__location == null) {
|
3742 | this.__location = new MockLocation();
|
3743 | }
|
3744 | this.__location.href = val;
|
3745 | }
|
3746 | else {
|
3747 | this.__location = val;
|
3748 | }
|
3749 | }
|
3750 | matchMedia() {
|
3751 | return {
|
3752 | matches: false,
|
3753 | };
|
3754 | }
|
3755 | get Node() {
|
3756 | if (this.__nodeCstr == null) {
|
3757 | const ownerDocument = this.document;
|
3758 | this.__nodeCstr = class extends MockNode {
|
3759 | constructor() {
|
3760 | super(ownerDocument, 0, 'test', '');
|
3761 | throw new Error('Illegal constructor: cannot construct Node');
|
3762 | }
|
3763 | };
|
3764 | }
|
3765 | return this.__nodeCstr;
|
3766 | }
|
3767 | get NodeList() {
|
3768 | if (this.__nodeListCstr == null) {
|
3769 | const ownerDocument = this.document;
|
3770 | this.__nodeListCstr = class extends MockNodeList {
|
3771 | constructor() {
|
3772 | super(ownerDocument, [], 0);
|
3773 | throw new Error('Illegal constructor: cannot construct NodeList');
|
3774 | }
|
3775 | };
|
3776 | }
|
3777 | return this.__nodeListCstr;
|
3778 | }
|
3779 | get navigator() {
|
3780 | if (this.__navigator == null) {
|
3781 | this.__navigator = new MockNavigator();
|
3782 | }
|
3783 | return this.__navigator;
|
3784 | }
|
3785 | set navigator(nav) {
|
3786 | this.__navigator = nav;
|
3787 | }
|
3788 | get parent() {
|
3789 | return null;
|
3790 | }
|
3791 | prompt() {
|
3792 | return '';
|
3793 | }
|
3794 | open() {
|
3795 | return null;
|
3796 | }
|
3797 | get origin() {
|
3798 | return this.location.origin;
|
3799 | }
|
3800 | removeEventListener(type, handler) {
|
3801 | removeEventListener(this, type, handler);
|
3802 | }
|
3803 | requestAnimationFrame(callback) {
|
3804 | return this.setTimeout(() => {
|
3805 | callback(Date.now());
|
3806 | }, 0);
|
3807 | }
|
3808 | requestIdleCallback(callback) {
|
3809 | return this.setTimeout(() => {
|
3810 | callback({
|
3811 | didTimeout: false,
|
3812 | timeRemaining: () => 0,
|
3813 | });
|
3814 | }, 0);
|
3815 | }
|
3816 | scroll(_x, _y) {
|
3817 |
|
3818 | }
|
3819 | scrollBy(_x, _y) {
|
3820 |
|
3821 | }
|
3822 | scrollTo(_x, _y) {
|
3823 |
|
3824 | }
|
3825 | get self() {
|
3826 | return this;
|
3827 | }
|
3828 | get sessionStorage() {
|
3829 | if (this.__sessionStorage == null) {
|
3830 | this.__sessionStorage = new MockStorage();
|
3831 | }
|
3832 | return this.__sessionStorage;
|
3833 | }
|
3834 | set sessionStorage(locStorage) {
|
3835 | this.__sessionStorage = locStorage;
|
3836 | }
|
3837 | setInterval(callback, ms, ...args) {
|
3838 | if (this.__timeouts == null) {
|
3839 | this.__timeouts = new Set();
|
3840 | }
|
3841 | ms = Math.min(ms, this.__maxTimeout);
|
3842 | if (this.__allowInterval) {
|
3843 | const intervalId = this.__setInterval(() => {
|
3844 | if (this.__timeouts) {
|
3845 | this.__timeouts.delete(intervalId);
|
3846 | try {
|
3847 | callback(...args);
|
3848 | }
|
3849 | catch (e) {
|
3850 | if (this.console) {
|
3851 | this.console.error(e);
|
3852 | }
|
3853 | else {
|
3854 | console.error(e);
|
3855 | }
|
3856 | }
|
3857 | }
|
3858 | }, ms);
|
3859 | if (this.__timeouts) {
|
3860 | this.__timeouts.add(intervalId);
|
3861 | }
|
3862 | return intervalId;
|
3863 | }
|
3864 | const timeoutId = this.__setTimeout(() => {
|
3865 | if (this.__timeouts) {
|
3866 | this.__timeouts.delete(timeoutId);
|
3867 | try {
|
3868 | callback(...args);
|
3869 | }
|
3870 | catch (e) {
|
3871 | if (this.console) {
|
3872 | this.console.error(e);
|
3873 | }
|
3874 | else {
|
3875 | console.error(e);
|
3876 | }
|
3877 | }
|
3878 | }
|
3879 | }, ms);
|
3880 | if (this.__timeouts) {
|
3881 | this.__timeouts.add(timeoutId);
|
3882 | }
|
3883 | return timeoutId;
|
3884 | }
|
3885 | setTimeout(callback, ms, ...args) {
|
3886 | if (this.__timeouts == null) {
|
3887 | this.__timeouts = new Set();
|
3888 | }
|
3889 | ms = Math.min(ms, this.__maxTimeout);
|
3890 | const timeoutId = this.__setTimeout(() => {
|
3891 | if (this.__timeouts) {
|
3892 | this.__timeouts.delete(timeoutId);
|
3893 | try {
|
3894 | callback(...args);
|
3895 | }
|
3896 | catch (e) {
|
3897 | if (this.console) {
|
3898 | this.console.error(e);
|
3899 | }
|
3900 | else {
|
3901 | console.error(e);
|
3902 | }
|
3903 | }
|
3904 | }
|
3905 | }, ms);
|
3906 | if (this.__timeouts) {
|
3907 | this.__timeouts.add(timeoutId);
|
3908 | }
|
3909 | return timeoutId;
|
3910 | }
|
3911 | get top() {
|
3912 | return this;
|
3913 | }
|
3914 | get window() {
|
3915 | return this;
|
3916 | }
|
3917 | onanimationstart() {
|
3918 |
|
3919 | }
|
3920 | onanimationend() {
|
3921 |
|
3922 | }
|
3923 | onanimationiteration() {
|
3924 |
|
3925 | }
|
3926 | onabort() {
|
3927 |
|
3928 | }
|
3929 | onauxclick() {
|
3930 |
|
3931 | }
|
3932 | onbeforecopy() {
|
3933 |
|
3934 | }
|
3935 | onbeforecut() {
|
3936 |
|
3937 | }
|
3938 | onbeforepaste() {
|
3939 |
|
3940 | }
|
3941 | onblur() {
|
3942 |
|
3943 | }
|
3944 | oncancel() {
|
3945 |
|
3946 | }
|
3947 | oncanplay() {
|
3948 |
|
3949 | }
|
3950 | oncanplaythrough() {
|
3951 |
|
3952 | }
|
3953 | onchange() {
|
3954 |
|
3955 | }
|
3956 | onclick() {
|
3957 |
|
3958 | }
|
3959 | onclose() {
|
3960 |
|
3961 | }
|
3962 | oncontextmenu() {
|
3963 |
|
3964 | }
|
3965 | oncopy() {
|
3966 |
|
3967 | }
|
3968 | oncuechange() {
|
3969 |
|
3970 | }
|
3971 | oncut() {
|
3972 |
|
3973 | }
|
3974 | ondblclick() {
|
3975 |
|
3976 | }
|
3977 | ondrag() {
|
3978 |
|
3979 | }
|
3980 | ondragend() {
|
3981 |
|
3982 | }
|
3983 | ondragenter() {
|
3984 |
|
3985 | }
|
3986 | ondragleave() {
|
3987 |
|
3988 | }
|
3989 | ondragover() {
|
3990 |
|
3991 | }
|
3992 | ondragstart() {
|
3993 |
|
3994 | }
|
3995 | ondrop() {
|
3996 |
|
3997 | }
|
3998 | ondurationchange() {
|
3999 |
|
4000 | }
|
4001 | onemptied() {
|
4002 |
|
4003 | }
|
4004 | onended() {
|
4005 |
|
4006 | }
|
4007 | onerror() {
|
4008 |
|
4009 | }
|
4010 | onfocus() {
|
4011 |
|
4012 | }
|
4013 | onfocusin() {
|
4014 |
|
4015 | }
|
4016 | onfocusout() {
|
4017 |
|
4018 | }
|
4019 | onformdata() {
|
4020 |
|
4021 | }
|
4022 | onfullscreenchange() {
|
4023 |
|
4024 | }
|
4025 | onfullscreenerror() {
|
4026 |
|
4027 | }
|
4028 | ongotpointercapture() {
|
4029 |
|
4030 | }
|
4031 | oninput() {
|
4032 |
|
4033 | }
|
4034 | oninvalid() {
|
4035 |
|
4036 | }
|
4037 | onkeydown() {
|
4038 |
|
4039 | }
|
4040 | onkeypress() {
|
4041 |
|
4042 | }
|
4043 | onkeyup() {
|
4044 |
|
4045 | }
|
4046 | onload() {
|
4047 |
|
4048 | }
|
4049 | onloadeddata() {
|
4050 |
|
4051 | }
|
4052 | onloadedmetadata() {
|
4053 |
|
4054 | }
|
4055 | onloadstart() {
|
4056 |
|
4057 | }
|
4058 | onlostpointercapture() {
|
4059 |
|
4060 | }
|
4061 | onmousedown() {
|
4062 |
|
4063 | }
|
4064 | onmouseenter() {
|
4065 |
|
4066 | }
|
4067 | onmouseleave() {
|
4068 |
|
4069 | }
|
4070 | onmousemove() {
|
4071 |
|
4072 | }
|
4073 | onmouseout() {
|
4074 |
|
4075 | }
|
4076 | onmouseover() {
|
4077 |
|
4078 | }
|
4079 | onmouseup() {
|
4080 |
|
4081 | }
|
4082 | onmousewheel() {
|
4083 |
|
4084 | }
|
4085 | onpaste() {
|
4086 |
|
4087 | }
|
4088 | onpause() {
|
4089 |
|
4090 | }
|
4091 | onplay() {
|
4092 |
|
4093 | }
|
4094 | onplaying() {
|
4095 |
|
4096 | }
|
4097 | onpointercancel() {
|
4098 |
|
4099 | }
|
4100 | onpointerdown() {
|
4101 |
|
4102 | }
|
4103 | onpointerenter() {
|
4104 |
|
4105 | }
|
4106 | onpointerleave() {
|
4107 |
|
4108 | }
|
4109 | onpointermove() {
|
4110 |
|
4111 | }
|
4112 | onpointerout() {
|
4113 |
|
4114 | }
|
4115 | onpointerover() {
|
4116 |
|
4117 | }
|
4118 | onpointerup() {
|
4119 |
|
4120 | }
|
4121 | onprogress() {
|
4122 |
|
4123 | }
|
4124 | onratechange() {
|
4125 |
|
4126 | }
|
4127 | onreset() {
|
4128 |
|
4129 | }
|
4130 | onresize() {
|
4131 |
|
4132 | }
|
4133 | onscroll() {
|
4134 |
|
4135 | }
|
4136 | onsearch() {
|
4137 |
|
4138 | }
|
4139 | onseeked() {
|
4140 |
|
4141 | }
|
4142 | onseeking() {
|
4143 |
|
4144 | }
|
4145 | onselect() {
|
4146 |
|
4147 | }
|
4148 | onselectstart() {
|
4149 |
|
4150 | }
|
4151 | onstalled() {
|
4152 |
|
4153 | }
|
4154 | onsubmit() {
|
4155 |
|
4156 | }
|
4157 | onsuspend() {
|
4158 |
|
4159 | }
|
4160 | ontimeupdate() {
|
4161 |
|
4162 | }
|
4163 | ontoggle() {
|
4164 |
|
4165 | }
|
4166 | onvolumechange() {
|
4167 |
|
4168 | }
|
4169 | onwaiting() {
|
4170 |
|
4171 | }
|
4172 | onwebkitfullscreenchange() {
|
4173 |
|
4174 | }
|
4175 | onwebkitfullscreenerror() {
|
4176 |
|
4177 | }
|
4178 | onwheel() {
|
4179 |
|
4180 | }
|
4181 | }
|
4182 | addGlobalsToWindowPrototype(MockWindow.prototype);
|
4183 | function resetWindowDefaults(win) {
|
4184 | win.__clearInterval = nativeClearInterval;
|
4185 | win.__clearTimeout = nativeClearTimeout;
|
4186 | win.__setInterval = nativeSetInterval;
|
4187 | win.__setTimeout = nativeSetTimeout;
|
4188 | win.__maxTimeout = 30000;
|
4189 | win.__allowInterval = true;
|
4190 | win.URL = nativeURL;
|
4191 | }
|
4192 | function cloneWindow(srcWin, opts = {}) {
|
4193 | if (srcWin == null) {
|
4194 | return null;
|
4195 | }
|
4196 | const clonedWin = new MockWindow(false);
|
4197 | if (!opts.customElementProxy) {
|
4198 | srcWin.customElements = null;
|
4199 | }
|
4200 | if (srcWin.document != null) {
|
4201 | const clonedDoc = new MockDocument(false, clonedWin);
|
4202 | clonedWin.document = clonedDoc;
|
4203 | clonedDoc.documentElement = srcWin.document.documentElement.cloneNode(true);
|
4204 | }
|
4205 | else {
|
4206 | clonedWin.document = new MockDocument(null, clonedWin);
|
4207 | }
|
4208 | return clonedWin;
|
4209 | }
|
4210 | function cloneDocument(srcDoc) {
|
4211 | if (srcDoc == null) {
|
4212 | return null;
|
4213 | }
|
4214 | const dstWin = cloneWindow(srcDoc.defaultView);
|
4215 | return dstWin.document;
|
4216 | }
|
4217 |
|
4218 |
|
4219 |
|
4220 |
|
4221 | function constrainTimeouts(win) {
|
4222 | win.__allowInterval = false;
|
4223 | win.__maxTimeout = 0;
|
4224 | }
|
4225 | function resetWindow(win) {
|
4226 | if (win != null) {
|
4227 | if (win.__timeouts) {
|
4228 | win.__timeouts.forEach(timeoutId => {
|
4229 | nativeClearInterval(timeoutId);
|
4230 | nativeClearTimeout(timeoutId);
|
4231 | });
|
4232 | win.__timeouts.clear();
|
4233 | }
|
4234 | if (win.customElements && win.customElements.clear) {
|
4235 | win.customElements.clear();
|
4236 | }
|
4237 | resetDocument(win.document);
|
4238 | resetPerformance(win.performance);
|
4239 | for (const key in win) {
|
4240 | if (win.hasOwnProperty(key) && key !== 'document' && key !== 'performance' && key !== 'customElements') {
|
4241 | delete win[key];
|
4242 | }
|
4243 | }
|
4244 | resetWindowDefaults(win);
|
4245 | resetWindowDimensions(win);
|
4246 | resetEventListeners(win);
|
4247 | if (win.document != null) {
|
4248 | try {
|
4249 | win.document.defaultView = win;
|
4250 | }
|
4251 | catch (e) { }
|
4252 | }
|
4253 |
|
4254 | win.fetch = null;
|
4255 | win.Headers = null;
|
4256 | win.Request = null;
|
4257 | win.Response = null;
|
4258 | win.FetchError = null;
|
4259 | }
|
4260 | }
|
4261 | function resetWindowDimensions(win) {
|
4262 | try {
|
4263 | win.devicePixelRatio = 1;
|
4264 | win.innerHeight = 768;
|
4265 | win.innerWidth = 1366;
|
4266 | win.pageXOffset = 0;
|
4267 | win.pageYOffset = 0;
|
4268 | win.screenLeft = 0;
|
4269 | win.screenTop = 0;
|
4270 | win.screenX = 0;
|
4271 | win.screenY = 0;
|
4272 | win.scrollX = 0;
|
4273 | win.scrollY = 0;
|
4274 | win.screen = {
|
4275 | availHeight: win.innerHeight,
|
4276 | availLeft: 0,
|
4277 | availTop: 0,
|
4278 | availWidth: win.innerWidth,
|
4279 | colorDepth: 24,
|
4280 | height: win.innerHeight,
|
4281 | keepAwake: false,
|
4282 | orientation: {
|
4283 | angle: 0,
|
4284 | type: 'portrait-primary',
|
4285 | },
|
4286 | pixelDepth: 24,
|
4287 | width: win.innerWidth,
|
4288 | };
|
4289 | }
|
4290 | catch (e) { }
|
4291 | }
|
4292 |
|
4293 | class MockDocument extends MockHTMLElement {
|
4294 | constructor(html = null, win = null) {
|
4295 | super(null, null);
|
4296 | this.nodeName = "#document" ;
|
4297 | this.nodeType = 9 ;
|
4298 | this.defaultView = win;
|
4299 | this.cookie = '';
|
4300 | this.referrer = '';
|
4301 | this.appendChild(this.createDocumentTypeNode());
|
4302 | if (typeof html === 'string') {
|
4303 | const parsedDoc = parseDocumentUtil(this, html);
|
4304 | const documentElement = parsedDoc.children.find(elm => elm.nodeName === 'HTML');
|
4305 | if (documentElement != null) {
|
4306 | this.appendChild(documentElement);
|
4307 | setOwnerDocument(documentElement, this);
|
4308 | }
|
4309 | }
|
4310 | else if (html !== false) {
|
4311 | const documentElement = new MockHTMLElement(this, 'html');
|
4312 | this.appendChild(documentElement);
|
4313 | documentElement.appendChild(new MockHTMLElement(this, 'head'));
|
4314 | documentElement.appendChild(new MockHTMLElement(this, 'body'));
|
4315 | }
|
4316 | }
|
4317 | get dir() {
|
4318 | return this.documentElement.dir;
|
4319 | }
|
4320 | set dir(value) {
|
4321 | this.documentElement.dir = value;
|
4322 | }
|
4323 | get location() {
|
4324 | if (this.defaultView != null) {
|
4325 | return this.defaultView.location;
|
4326 | }
|
4327 | return null;
|
4328 | }
|
4329 | set location(val) {
|
4330 | if (this.defaultView != null) {
|
4331 | this.defaultView.location = val;
|
4332 | }
|
4333 | }
|
4334 | get baseURI() {
|
4335 | const baseNode = this.head.childNodes.find(node => node.nodeName === 'BASE');
|
4336 | if (baseNode) {
|
4337 | return baseNode.href;
|
4338 | }
|
4339 | return this.URL;
|
4340 | }
|
4341 | get URL() {
|
4342 | return this.location.href;
|
4343 | }
|
4344 | get styleSheets() {
|
4345 | return this.querySelectorAll('style');
|
4346 | }
|
4347 | get scripts() {
|
4348 | return this.querySelectorAll('script');
|
4349 | }
|
4350 | get forms() {
|
4351 | return this.querySelectorAll('form');
|
4352 | }
|
4353 | get images() {
|
4354 | return this.querySelectorAll('img');
|
4355 | }
|
4356 | get scrollingElement() {
|
4357 | return this.documentElement;
|
4358 | }
|
4359 | get documentElement() {
|
4360 | for (let i = this.childNodes.length - 1; i >= 0; i--) {
|
4361 | if (this.childNodes[i].nodeName === 'HTML') {
|
4362 | return this.childNodes[i];
|
4363 | }
|
4364 | }
|
4365 | const documentElement = new MockHTMLElement(this, 'html');
|
4366 | this.appendChild(documentElement);
|
4367 | return documentElement;
|
4368 | }
|
4369 | set documentElement(documentElement) {
|
4370 | for (let i = this.childNodes.length - 1; i >= 0; i--) {
|
4371 | if (this.childNodes[i].nodeType !== 10 ) {
|
4372 | this.childNodes[i].remove();
|
4373 | }
|
4374 | }
|
4375 | if (documentElement != null) {
|
4376 | this.appendChild(documentElement);
|
4377 | setOwnerDocument(documentElement, this);
|
4378 | }
|
4379 | }
|
4380 | get head() {
|
4381 | const documentElement = this.documentElement;
|
4382 | for (let i = 0; i < documentElement.childNodes.length; i++) {
|
4383 | if (documentElement.childNodes[i].nodeName === 'HEAD') {
|
4384 | return documentElement.childNodes[i];
|
4385 | }
|
4386 | }
|
4387 | const head = new MockHTMLElement(this, 'head');
|
4388 | documentElement.insertBefore(head, documentElement.firstChild);
|
4389 | return head;
|
4390 | }
|
4391 | set head(head) {
|
4392 | const documentElement = this.documentElement;
|
4393 | for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
|
4394 | if (documentElement.childNodes[i].nodeName === 'HEAD') {
|
4395 | documentElement.childNodes[i].remove();
|
4396 | }
|
4397 | }
|
4398 | if (head != null) {
|
4399 | documentElement.insertBefore(head, documentElement.firstChild);
|
4400 | setOwnerDocument(head, this);
|
4401 | }
|
4402 | }
|
4403 | get body() {
|
4404 | const documentElement = this.documentElement;
|
4405 | for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
|
4406 | if (documentElement.childNodes[i].nodeName === 'BODY') {
|
4407 | return documentElement.childNodes[i];
|
4408 | }
|
4409 | }
|
4410 | const body = new MockHTMLElement(this, 'body');
|
4411 | documentElement.appendChild(body);
|
4412 | return body;
|
4413 | }
|
4414 | set body(body) {
|
4415 | const documentElement = this.documentElement;
|
4416 | for (let i = documentElement.childNodes.length - 1; i >= 0; i--) {
|
4417 | if (documentElement.childNodes[i].nodeName === 'BODY') {
|
4418 | documentElement.childNodes[i].remove();
|
4419 | }
|
4420 | }
|
4421 | if (body != null) {
|
4422 | documentElement.appendChild(body);
|
4423 | setOwnerDocument(body, this);
|
4424 | }
|
4425 | }
|
4426 | appendChild(newNode) {
|
4427 | newNode.remove();
|
4428 | newNode.parentNode = this;
|
4429 | this.childNodes.push(newNode);
|
4430 | return newNode;
|
4431 | }
|
4432 | createComment(data) {
|
4433 | return new MockComment(this, data);
|
4434 | }
|
4435 | createAttribute(attrName) {
|
4436 | return new MockAttr(attrName.toLowerCase(), '');
|
4437 | }
|
4438 | createAttributeNS(namespaceURI, attrName) {
|
4439 | return new MockAttr(attrName, '', namespaceURI);
|
4440 | }
|
4441 | createElement(tagName) {
|
4442 | if (tagName === "#document" ) {
|
4443 | const doc = new MockDocument(false);
|
4444 | doc.nodeName = tagName;
|
4445 | doc.parentNode = null;
|
4446 | return doc;
|
4447 | }
|
4448 | return createElement(this, tagName);
|
4449 | }
|
4450 | createElementNS(namespaceURI, tagName) {
|
4451 | const elmNs = createElementNS(this, namespaceURI, tagName);
|
4452 | elmNs.namespaceURI = namespaceURI;
|
4453 | return elmNs;
|
4454 | }
|
4455 | createTextNode(text) {
|
4456 | return new MockTextNode(this, text);
|
4457 | }
|
4458 | createDocumentFragment() {
|
4459 | return new MockDocumentFragment(this);
|
4460 | }
|
4461 | createDocumentTypeNode() {
|
4462 | return new MockDocumentTypeNode(this);
|
4463 | }
|
4464 | getElementById(id) {
|
4465 | return getElementById(this, id);
|
4466 | }
|
4467 | getElementsByName(elmName) {
|
4468 | return getElementsByName(this, elmName.toLowerCase());
|
4469 | }
|
4470 | get title() {
|
4471 | const title = this.head.childNodes.find(elm => elm.nodeName === 'TITLE');
|
4472 | if (title != null && typeof title.textContent === 'string') {
|
4473 | return title.textContent.trim();
|
4474 | }
|
4475 | return '';
|
4476 | }
|
4477 | set title(value) {
|
4478 | const head = this.head;
|
4479 | let title = head.childNodes.find(elm => elm.nodeName === 'TITLE');
|
4480 | if (title == null) {
|
4481 | title = this.createElement('title');
|
4482 | head.appendChild(title);
|
4483 | }
|
4484 | title.textContent = value;
|
4485 | }
|
4486 | }
|
4487 | function createDocument(html = null) {
|
4488 | return new MockWindow(html).document;
|
4489 | }
|
4490 | function createFragment(html) {
|
4491 | return parseHtmlToFragment(html, null);
|
4492 | }
|
4493 | function resetDocument(doc) {
|
4494 | if (doc != null) {
|
4495 | resetEventListeners(doc);
|
4496 | const documentElement = doc.documentElement;
|
4497 | if (documentElement != null) {
|
4498 | resetElement(documentElement);
|
4499 | for (let i = 0, ii = documentElement.childNodes.length; i < ii; i++) {
|
4500 | const childNode = documentElement.childNodes[i];
|
4501 | resetElement(childNode);
|
4502 | childNode.childNodes.length = 0;
|
4503 | }
|
4504 | }
|
4505 | for (const key in doc) {
|
4506 | if (doc.hasOwnProperty(key) && !DOC_KEY_KEEPERS.has(key)) {
|
4507 | delete doc[key];
|
4508 | }
|
4509 | }
|
4510 | try {
|
4511 | doc.nodeName = "#document" ;
|
4512 | }
|
4513 | catch (e) { }
|
4514 | try {
|
4515 | doc.nodeType = 9 ;
|
4516 | }
|
4517 | catch (e) { }
|
4518 | try {
|
4519 | doc.cookie = '';
|
4520 | }
|
4521 | catch (e) { }
|
4522 | try {
|
4523 | doc.referrer = '';
|
4524 | }
|
4525 | catch (e) { }
|
4526 | }
|
4527 | }
|
4528 | const DOC_KEY_KEEPERS = new Set([
|
4529 | 'nodeName',
|
4530 | 'nodeType',
|
4531 | 'nodeValue',
|
4532 | 'ownerDocument',
|
4533 | 'parentNode',
|
4534 | 'childNodes',
|
4535 | '_shadowRoot',
|
4536 | ]);
|
4537 | function getElementById(elm, id) {
|
4538 | const children = elm.children;
|
4539 | for (let i = 0, ii = children.length; i < ii; i++) {
|
4540 | const childElm = children[i];
|
4541 | if (childElm.id === id) {
|
4542 | return childElm;
|
4543 | }
|
4544 | const childElmFound = getElementById(childElm, id);
|
4545 | if (childElmFound != null) {
|
4546 | return childElmFound;
|
4547 | }
|
4548 | }
|
4549 | return null;
|
4550 | }
|
4551 | function getElementsByName(elm, elmName, foundElms = []) {
|
4552 | const children = elm.children;
|
4553 | for (let i = 0, ii = children.length; i < ii; i++) {
|
4554 | const childElm = children[i];
|
4555 | if (childElm.name && childElm.name.toLowerCase() === elmName) {
|
4556 | foundElms.push(childElm);
|
4557 | }
|
4558 | getElementsByName(childElm, elmName, foundElms);
|
4559 | }
|
4560 | return foundElms;
|
4561 | }
|
4562 | function setOwnerDocument(elm, ownerDocument) {
|
4563 | for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
|
4564 | elm.childNodes[i].ownerDocument = ownerDocument;
|
4565 | if (elm.childNodes[i].nodeType === 1 ) {
|
4566 | setOwnerDocument(elm.childNodes[i], ownerDocument);
|
4567 | }
|
4568 | }
|
4569 | }
|
4570 |
|
4571 | function hydrateFactory($stencilWindow, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve) {
|
4572 | var globalThis = $stencilWindow;
|
4573 | var self = $stencilWindow;
|
4574 | var top = $stencilWindow;
|
4575 | var parent = $stencilWindow;
|
4576 |
|
4577 | var addEventListener = $stencilWindow.addEventListener.bind($stencilWindow);
|
4578 | var alert = $stencilWindow.alert.bind($stencilWindow);
|
4579 | var blur = $stencilWindow.blur.bind($stencilWindow);
|
4580 | var cancelAnimationFrame = $stencilWindow.cancelAnimationFrame.bind($stencilWindow);
|
4581 | var cancelIdleCallback = $stencilWindow.cancelIdleCallback.bind($stencilWindow);
|
4582 | var clearInterval = $stencilWindow.clearInterval.bind($stencilWindow);
|
4583 | var clearTimeout = $stencilWindow.clearTimeout.bind($stencilWindow);
|
4584 | var close = () => {};
|
4585 | var confirm = $stencilWindow.confirm.bind($stencilWindow);
|
4586 | var dispatchEvent = $stencilWindow.dispatchEvent.bind($stencilWindow);
|
4587 | var focus = $stencilWindow.focus.bind($stencilWindow);
|
4588 | var getComputedStyle = $stencilWindow.getComputedStyle.bind($stencilWindow);
|
4589 | var matchMedia = $stencilWindow.matchMedia.bind($stencilWindow);
|
4590 | var open = $stencilWindow.open.bind($stencilWindow);
|
4591 | var prompt = $stencilWindow.prompt.bind($stencilWindow);
|
4592 | var removeEventListener = $stencilWindow.removeEventListener.bind($stencilWindow);
|
4593 | var requestAnimationFrame = $stencilWindow.requestAnimationFrame.bind($stencilWindow);
|
4594 | var requestIdleCallback = $stencilWindow.requestIdleCallback.bind($stencilWindow);
|
4595 | var setInterval = $stencilWindow.setInterval.bind($stencilWindow);
|
4596 | var setTimeout = $stencilWindow.setTimeout.bind($stencilWindow);
|
4597 |
|
4598 | var CharacterData = $stencilWindow.CharacterData;
|
4599 | var CSS = $stencilWindow.CSS;
|
4600 | var CustomEvent = $stencilWindow.CustomEvent;
|
4601 | var Document = $stencilWindow.Document;
|
4602 | var DocumentFragment = $stencilWindow.DocumentFragment;
|
4603 | var DocumentType = $stencilWindow.DocumentType;
|
4604 | var DOMTokenList = $stencilWindow.DOMTokenList;
|
4605 | var Element = $stencilWindow.Element;
|
4606 | var Event = $stencilWindow.Event;
|
4607 | var HTMLAnchorElement = $stencilWindow.HTMLAnchorElement;
|
4608 | var HTMLBaseElement = $stencilWindow.HTMLBaseElement;
|
4609 | var HTMLButtonElement = $stencilWindow.HTMLButtonElement;
|
4610 | var HTMLCanvasElement = $stencilWindow.HTMLCanvasElement;
|
4611 | var HTMLElement = $stencilWindow.HTMLElement;
|
4612 | var HTMLFormElement = $stencilWindow.HTMLFormElement;
|
4613 | var HTMLImageElement = $stencilWindow.HTMLImageElement;
|
4614 | var HTMLInputElement = $stencilWindow.HTMLInputElement;
|
4615 | var HTMLLinkElement = $stencilWindow.HTMLLinkElement;
|
4616 | var HTMLMetaElement = $stencilWindow.HTMLMetaElement;
|
4617 | var HTMLScriptElement = $stencilWindow.HTMLScriptElement;
|
4618 | var HTMLStyleElement = $stencilWindow.HTMLStyleElement;
|
4619 | var HTMLTemplateElement = $stencilWindow.HTMLTemplateElement;
|
4620 | var HTMLTitleElement = $stencilWindow.HTMLTitleElement;
|
4621 | var IntersectionObserver = $stencilWindow.IntersectionObserver;
|
4622 | var KeyboardEvent = $stencilWindow.KeyboardEvent;
|
4623 | var MouseEvent = $stencilWindow.MouseEvent;
|
4624 | var Node = $stencilWindow.Node;
|
4625 | var NodeList = $stencilWindow.NodeList;
|
4626 | var URL = $stencilWindow.URL;
|
4627 |
|
4628 | var console = $stencilWindow.console;
|
4629 | var customElements = $stencilWindow.customElements;
|
4630 | var history = $stencilWindow.history;
|
4631 | var localStorage = $stencilWindow.localStorage;
|
4632 | var location = $stencilWindow.location;
|
4633 | var navigator = $stencilWindow.navigator;
|
4634 | var performance = $stencilWindow.performance;
|
4635 | var sessionStorage = $stencilWindow.sessionStorage;
|
4636 |
|
4637 | var devicePixelRatio = $stencilWindow.devicePixelRatio;
|
4638 | var innerHeight = $stencilWindow.innerHeight;
|
4639 | var innerWidth = $stencilWindow.innerWidth;
|
4640 | var origin = $stencilWindow.origin;
|
4641 | var pageXOffset = $stencilWindow.pageXOffset;
|
4642 | var pageYOffset = $stencilWindow.pageYOffset;
|
4643 | var screen = $stencilWindow.screen;
|
4644 | var screenLeft = $stencilWindow.screenLeft;
|
4645 | var screenTop = $stencilWindow.screenTop;
|
4646 | var screenX = $stencilWindow.screenX;
|
4647 | var screenY = $stencilWindow.screenY;
|
4648 | var scrollX = $stencilWindow.scrollX;
|
4649 | var scrollY = $stencilWindow.scrollY;
|
4650 | var exports = {};
|
4651 |
|
4652 | var fetch, FetchError, Headers, Request, Response;
|
4653 |
|
4654 | if (typeof $stencilWindow.fetch === 'function') {
|
4655 | fetch = $stencilWindow.fetch;
|
4656 | } else {
|
4657 | fetch = $stencilWindow.fetch = function() { throw new Error('fetch() is not implemented'); };
|
4658 | }
|
4659 |
|
4660 | if (typeof $stencilWindow.FetchError === 'function') {
|
4661 | FetchError = $stencilWindow.FetchError;
|
4662 | } else {
|
4663 | FetchError = $stencilWindow.FetchError = class FetchError { constructor() { throw new Error('FetchError is not implemented'); } };
|
4664 | }
|
4665 |
|
4666 | if (typeof $stencilWindow.Headers === 'function') {
|
4667 | Headers = $stencilWindow.Headers;
|
4668 | } else {
|
4669 | Headers = $stencilWindow.Headers = class Headers { constructor() { throw new Error('Headers is not implemented'); } };
|
4670 | }
|
4671 |
|
4672 | if (typeof $stencilWindow.Request === 'function') {
|
4673 | Request = $stencilWindow.Request;
|
4674 | } else {
|
4675 | Request = $stencilWindow.Request = class Request { constructor() { throw new Error('Request is not implemented'); } };
|
4676 | }
|
4677 |
|
4678 | if (typeof $stencilWindow.Response === 'function') {
|
4679 | Response = $stencilWindow.Response;
|
4680 | } else {
|
4681 | Response = $stencilWindow.Response = class Response { constructor() { throw new Error('Response is not implemented'); } };
|
4682 | }
|
4683 |
|
4684 | function hydrateAppClosure($stencilWindow) {
|
4685 | const window = $stencilWindow;
|
4686 | const document = $stencilWindow.document;
|
4687 |
|
4688 |
|
4689 |
|
4690 | const NAMESPACE = 'ionic';
|
4691 | const BUILD = { allRenderFn: false, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: false, cssAnnotations: true, cssVarShim: false, devTools: false, disconnectedCallback: true, dynamicImportShim: false, element: false, event: true, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: true, hostListenerTargetParent: false, hostListenerTargetWindow: true, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: true, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, safari10: false, scoped: true, scriptDataOpts: false, shadowDelegatesFocus: true, shadowDom: true, shadowDomShim: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
|
4692 |
|
4693 | const getPlatforms = (win) => setupPlatforms(win);
|
4694 | const isPlatform = (winOrPlatform, platform) => {
|
4695 | if (typeof winOrPlatform === 'string') {
|
4696 | platform = winOrPlatform;
|
4697 | winOrPlatform = undefined;
|
4698 | }
|
4699 | return getPlatforms(winOrPlatform).includes(platform);
|
4700 | };
|
4701 | const setupPlatforms = (win = window) => {
|
4702 | if (typeof win === 'undefined') {
|
4703 | return [];
|
4704 | }
|
4705 | win.Ionic = win.Ionic || {};
|
4706 | let platforms = win.Ionic.platforms;
|
4707 | if (platforms == null) {
|
4708 | platforms = win.Ionic.platforms = detectPlatforms(win);
|
4709 | platforms.forEach(p => win.document.documentElement.classList.add(`plt-${p}`));
|
4710 | }
|
4711 | return platforms;
|
4712 | };
|
4713 | const detectPlatforms = (win) => Object.keys(PLATFORMS_MAP).filter(p => PLATFORMS_MAP[p](win));
|
4714 | const isMobileWeb = (win) => isMobile(win) && !isHybrid(win);
|
4715 | const isIpad = (win) => {
|
4716 |
|
4717 | if (testUserAgent(win, /iPad/i)) {
|
4718 | return true;
|
4719 | }
|
4720 |
|
4721 | if (testUserAgent(win, /Macintosh/i) && isMobile(win)) {
|
4722 | return true;
|
4723 | }
|
4724 | return false;
|
4725 | };
|
4726 | const isIphone = (win) => testUserAgent(win, /iPhone/i);
|
4727 | const isIOS = (win) => testUserAgent(win, /iPhone|iPod/i) || isIpad(win);
|
4728 | const isAndroid = (win) => testUserAgent(win, /android|sink/i);
|
4729 | const isAndroidTablet = (win) => {
|
4730 | return isAndroid(win) && !testUserAgent(win, /mobile/i);
|
4731 | };
|
4732 | const isPhablet = (win) => {
|
4733 | const width = win.innerWidth;
|
4734 | const height = win.innerHeight;
|
4735 | const smallest = Math.min(width, height);
|
4736 | const largest = Math.max(width, height);
|
4737 | return (smallest > 390 && smallest < 520) &&
|
4738 | (largest > 620 && largest < 800);
|
4739 | };
|
4740 | const isTablet = (win) => {
|
4741 | const width = win.innerWidth;
|
4742 | const height = win.innerHeight;
|
4743 | const smallest = Math.min(width, height);
|
4744 | const largest = Math.max(width, height);
|
4745 | return (isIpad(win) ||
|
4746 | isAndroidTablet(win) ||
|
4747 | ((smallest > 460 && smallest < 820) &&
|
4748 | (largest > 780 && largest < 1400)));
|
4749 | };
|
4750 | const isMobile = (win) => matchMedia(win, '(any-pointer:coarse)');
|
4751 | const isDesktop = (win) => !isMobile(win);
|
4752 | const isHybrid = (win) => isCordova(win) || isCapacitorNative(win);
|
4753 | const isCordova = (win) => !!(win['cordova'] || win['phonegap'] || win['PhoneGap']);
|
4754 | const isCapacitorNative = (win) => {
|
4755 | const capacitor = win['Capacitor'];
|
4756 | return !!(capacitor && capacitor.isNative);
|
4757 | };
|
4758 | const isElectron = (win) => testUserAgent(win, /electron/i);
|
4759 | const isPWA = (win) => !!(win.matchMedia('(display-mode: standalone)').matches || win.navigator.standalone);
|
4760 | const testUserAgent = (win, expr) => expr.test(win.navigator.userAgent);
|
4761 | const matchMedia = (win, query) => win.matchMedia(query).matches;
|
4762 | const PLATFORMS_MAP = {
|
4763 | 'ipad': isIpad,
|
4764 | 'iphone': isIphone,
|
4765 | 'ios': isIOS,
|
4766 | 'android': isAndroid,
|
4767 | 'phablet': isPhablet,
|
4768 | 'tablet': isTablet,
|
4769 | 'cordova': isCordova,
|
4770 | 'capacitor': isCapacitorNative,
|
4771 | 'electron': isElectron,
|
4772 | 'pwa': isPWA,
|
4773 | 'mobile': isMobile,
|
4774 | 'mobileweb': isMobileWeb,
|
4775 | 'desktop': isDesktop,
|
4776 | 'hybrid': isHybrid
|
4777 | };
|
4778 |
|
4779 | class Config {
|
4780 | constructor() {
|
4781 | this.m = new Map();
|
4782 | }
|
4783 | reset(configObj) {
|
4784 | this.m = new Map(Object.entries(configObj));
|
4785 | }
|
4786 | get(key, fallback) {
|
4787 | const value = this.m.get(key);
|
4788 | return value !== undefined ? value : fallback;
|
4789 | }
|
4790 | getBoolean(key, fallback = false) {
|
4791 | const val = this.m.get(key);
|
4792 | if (val === undefined) {
|
4793 | return fallback;
|
4794 | }
|
4795 | if (typeof val === 'string') {
|
4796 | return val === 'true';
|
4797 | }
|
4798 | return !!val;
|
4799 | }
|
4800 | getNumber(key, fallback) {
|
4801 | const val = parseFloat(this.m.get(key));
|
4802 | return isNaN(val) ? (fallback !== undefined ? fallback : NaN) : val;
|
4803 | }
|
4804 | set(key, value) {
|
4805 | this.m.set(key, value);
|
4806 | }
|
4807 | }
|
4808 | const config = new Config();
|
4809 | const configFromSession = (win) => {
|
4810 | try {
|
4811 | const configStr = win.sessionStorage.getItem(IONIC_SESSION_KEY);
|
4812 | return configStr !== null ? JSON.parse(configStr) : {};
|
4813 | }
|
4814 | catch (e) {
|
4815 | return {};
|
4816 | }
|
4817 | };
|
4818 | const saveConfig = (win, c) => {
|
4819 | try {
|
4820 | win.sessionStorage.setItem(IONIC_SESSION_KEY, JSON.stringify(c));
|
4821 | }
|
4822 | catch (e) {
|
4823 | return;
|
4824 | }
|
4825 | };
|
4826 | const configFromURL = (win) => {
|
4827 | const configObj = {};
|
4828 | win.location.search
|
4829 | .slice(1)
|
4830 | .split('&')
|
4831 | .map(entry => entry.split('='))
|
4832 | .map(([key, value]) => [decodeURIComponent(key), decodeURIComponent(value)])
|
4833 | .filter(([key]) => startsWith(key, IONIC_PREFIX))
|
4834 | .map(([key, value]) => [key.slice(IONIC_PREFIX.length), value])
|
4835 | .forEach(([key, value]) => {
|
4836 | configObj[key] = value;
|
4837 | });
|
4838 | return configObj;
|
4839 | };
|
4840 | const startsWith = (input, search) => {
|
4841 | return input.substr(0, search.length) === search;
|
4842 | };
|
4843 | const IONIC_PREFIX = 'ionic:';
|
4844 | const IONIC_SESSION_KEY = 'ionic-persist-config';
|
4845 |
|
4846 | let defaultMode;
|
4847 | const getIonMode$1 = (ref) => {
|
4848 | return (ref && getMode(ref)) || defaultMode;
|
4849 | };
|
4850 | const initialize = (userConfig = {}) => {
|
4851 | if (typeof window === 'undefined') {
|
4852 | return;
|
4853 | }
|
4854 | const doc = window.document;
|
4855 | const win = window;
|
4856 | const Ionic = win.Ionic = win.Ionic || {};
|
4857 |
|
4858 | setupPlatforms(win);
|
4859 |
|
4860 |
|
4861 | const configObj = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, configFromSession(win)), { persistConfig: false }), Ionic.config), configFromURL(win)), userConfig);
|
4862 | config.reset(configObj);
|
4863 | if (config.getBoolean('persistConfig')) {
|
4864 | saveConfig(win, configObj);
|
4865 | }
|
4866 |
|
4867 |
|
4868 |
|
4869 | Ionic.config = config;
|
4870 | Ionic.mode = defaultMode = config.get('mode', (doc.documentElement.getAttribute('mode')) || (isPlatform(win, 'ios') ? 'ios' : 'md'));
|
4871 | config.set('mode', defaultMode);
|
4872 | doc.documentElement.setAttribute('mode', defaultMode);
|
4873 | doc.documentElement.classList.add(defaultMode);
|
4874 | if (config.getBoolean('_testing')) {
|
4875 | config.set('animated', false);
|
4876 | }
|
4877 | const isIonicElement = (elm) => elm.tagName && elm.tagName.startsWith('ION-');
|
4878 | const isAllowedIonicModeValue = (elmMode) => ['ios', 'md'].includes(elmMode);
|
4879 | setMode((elm) => {
|
4880 | while (elm) {
|
4881 | const elmMode = elm.mode || elm.getAttribute('mode');
|
4882 | if (elmMode) {
|
4883 | if (isAllowedIonicModeValue(elmMode)) {
|
4884 | return elmMode;
|
4885 | }
|
4886 | else if (isIonicElement(elm)) {
|
4887 | console.warn('Invalid ionic mode: "' + elmMode + '", expected: "ios" or "md"');
|
4888 | }
|
4889 | }
|
4890 | elm = elm.parentElement;
|
4891 | }
|
4892 | return defaultMode;
|
4893 | });
|
4894 | };
|
4895 |
|
4896 | const globalScripts = initialize;
|
4897 |
|
4898 | function componentOnReady$1() {
|
4899 | return getHostRef(this).$onReadyPromise$;
|
4900 | }
|
4901 |
|
4902 | function forceUpdate() {}
|
4903 |
|
4904 | function hydrateApp(e, t, o, n, s) {
|
4905 | function l() {
|
4906 | if (global.clearTimeout(p), i.clear(), r.clear(), !h) {
|
4907 | h = !0;
|
4908 | try {
|
4909 | t.clientHydrateAnnotations && insertVdomAnnotations(e.document, t.staticComponents),
|
4910 | e.dispatchEvent(new e.Event("DOMContentLoaded")), e.document.createElement = c,
|
4911 | e.document.createElementNS = $;
|
4912 | } catch (e) {
|
4913 | renderCatchError(t, o, e);
|
4914 | }
|
4915 | }
|
4916 | n(e, t, o, s);
|
4917 | }
|
4918 | function a(e) {
|
4919 | renderCatchError(t, o, e), l();
|
4920 | }
|
4921 | const r = new Set, i = new Set, d = new Set, c = e.document.createElement, $ = e.document.createElementNS, m = Promise.resolve();
|
4922 | let p, h = !1;
|
4923 | try {
|
4924 | function u() {
|
4925 | return g(this);
|
4926 | }
|
4927 | function f(e) {
|
4928 | if (isValidComponent(e, t) && !getHostRef(e)) {
|
4929 | const t = loadModule({
|
4930 | $tagName$: e.nodeName.toLowerCase(),
|
4931 | $flags$: null
|
4932 | });
|
4933 | null != t && null != t.cmpMeta && (i.add(e), e.connectedCallback = u, registerHost(e, t.cmpMeta),
|
4934 | function o(e, t) {
|
4935 | if ("function" != typeof e.componentOnReady && (e.componentOnReady = componentOnReady$1),
|
4936 | "function" != typeof e.forceUpdate && (e.forceUpdate = forceUpdate), 1 & t.$flags$ && (e.shadowRoot = e),
|
4937 | null != t.$members$) {
|
4938 | const o = getHostRef(e);
|
4939 | Object.entries(t.$members$).forEach((([n, s]) => {
|
4940 | const l = s[0];
|
4941 | if (31 & l) {
|
4942 | const a = s[1] || n, r = e.getAttribute(a);
|
4943 | if (null != r) {
|
4944 | const e = parsePropertyValue(r, l);
|
4945 | o.$instanceValues$.set(n, e);
|
4946 | }
|
4947 | const i = e[n];
|
4948 | void 0 !== i && (o.$instanceValues$.set(n, i), delete e[n]), Object.defineProperty(e, n, {
|
4949 | get() {
|
4950 | return getValue(this, n);
|
4951 | },
|
4952 | set(e) {
|
4953 | setValue(this, n, e, t);
|
4954 | },
|
4955 | configurable: !0,
|
4956 | enumerable: !0
|
4957 | });
|
4958 | } else 64 & l && Object.defineProperty(e, n, {
|
4959 | value() {
|
4960 | const e = getHostRef(this), t = arguments;
|
4961 | return e.$onInstancePromise$.then((() => e.$lazyInstance$[n].apply(e.$lazyInstance$, t))).catch(consoleError);
|
4962 | }
|
4963 | });
|
4964 | }));
|
4965 | }
|
4966 | }(e, t.cmpMeta));
|
4967 | }
|
4968 | }
|
4969 | function g(n) {
|
4970 | return i.delete(n), isValidComponent(n, t) && o.hydratedCount < t.maxHydrateCount && !r.has(n) && shouldHydrate(n) ? (r.add(n),
|
4971 | async function s(e, t, o, n, l) {
|
4972 | o = o.toLowerCase();
|
4973 | const a = loadModule({
|
4974 | $tagName$: o,
|
4975 | $flags$: null
|
4976 | });
|
4977 | if (null != a && null != a.cmpMeta) {
|
4978 | l.add(n);
|
4979 | try {
|
4980 | connectedCallback(n), await n.componentOnReady(), t.hydratedCount++;
|
4981 | const e = getHostRef(n), s = e.$modeName$ ? e.$modeName$ : "$";
|
4982 | t.components.some((e => e.tag === o && e.mode === s)) || t.components.push({
|
4983 | tag: o,
|
4984 | mode: s,
|
4985 | count: 0,
|
4986 | depth: -1
|
4987 | });
|
4988 | } catch (t) {
|
4989 | e.console.error(t);
|
4990 | }
|
4991 | l.delete(n);
|
4992 | }
|
4993 | }(e, o, n.nodeName, n, d)) : m;
|
4994 | }
|
4995 | e.document.createElement = function t(o) {
|
4996 | const n = c.call(e.document, o);
|
4997 | return f(n), n;
|
4998 | }, e.document.createElementNS = function t(o, n) {
|
4999 | const s = $.call(e.document, o, n);
|
5000 | return f(s), s;
|
5001 | }, p = global.setTimeout((function L() {
|
5002 | a(`Hydrate exceeded timeout${function e(t) {
|
5003 | return Array.from(t).map(waitingOnElementMsg);
|
5004 | }(d)}`);
|
5005 | }), t.timeout), plt.$resourcesUrl$ = new URL(t.resourcesUrl || "./", doc$1.baseURI).href,
|
5006 | globalScripts(), function e(t) {
|
5007 | if (null != t && 1 === t.nodeType) {
|
5008 | f(t);
|
5009 | const o = t.children;
|
5010 | for (let t = 0, n = o.length; t < n; t++) e(o[t]);
|
5011 | }
|
5012 | }(e.document.body), function e() {
|
5013 | const t = Array.from(i).filter((e => e.parentElement));
|
5014 | return t.length > 0 ? Promise.all(t.map(g)).then(e) : m;
|
5015 | }().then(l).catch(a);
|
5016 | } catch (e) {
|
5017 | a(e);
|
5018 | }
|
5019 | }
|
5020 |
|
5021 | function isValidComponent(e, t) {
|
5022 | if (null != e && 1 === e.nodeType) {
|
5023 | const o = e.nodeName;
|
5024 | if ("string" == typeof o && o.includes("-")) return !t.excludeComponents.includes(o.toLowerCase());
|
5025 | }
|
5026 | return !1;
|
5027 | }
|
5028 |
|
5029 | function shouldHydrate(e) {
|
5030 | if (9 === e.nodeType) return !0;
|
5031 | if (NO_HYDRATE_TAGS.has(e.nodeName)) return !1;
|
5032 | if (e.hasAttribute("no-prerender")) return !1;
|
5033 | const t = e.parentNode;
|
5034 | return null == t || shouldHydrate(t);
|
5035 | }
|
5036 |
|
5037 | function renderCatchError(e, t, o) {
|
5038 | const n = {
|
5039 | level: "error",
|
5040 | type: "build",
|
5041 | header: "Hydrate Error",
|
5042 | messageText: "",
|
5043 | relFilePath: null,
|
5044 | absFilePath: null,
|
5045 | lines: []
|
5046 | };
|
5047 | if (e.url) try {
|
5048 | const t = new URL(e.url);
|
5049 | "/" !== t.pathname && (n.header += ": " + t.pathname);
|
5050 | } catch (e) {}
|
5051 | null != o && (null != o.stack ? n.messageText = o.stack.toString() : null != o.message ? n.messageText = o.message.toString() : n.messageText = o.toString()),
|
5052 | t.diagnostics.push(n);
|
5053 | }
|
5054 |
|
5055 | function printTag(e) {
|
5056 | let t = `<${e.nodeName.toLowerCase()}`;
|
5057 | if (Array.isArray(e.attributes)) for (let o = 0; o < e.attributes.length; o++) {
|
5058 | const n = e.attributes[o];
|
5059 | t += ` ${n.name}`, "" !== n.value && (t += `="${n.value}"`);
|
5060 | }
|
5061 | return t += ">", t;
|
5062 | }
|
5063 |
|
5064 | function waitingOnElementMsg(e) {
|
5065 | let t = "";
|
5066 | if (e) {
|
5067 | const o = [];
|
5068 | t = " - waiting on:";
|
5069 | let n = e;
|
5070 | for (;n && 9 !== n.nodeType && "BODY" !== n.nodeName; ) o.unshift(printTag(n)),
|
5071 | n = n.parentElement;
|
5072 | let s = "";
|
5073 | for (const e of o) s += " ", t += `\n${s}${e}`;
|
5074 | }
|
5075 | return t;
|
5076 | }
|
5077 |
|
5078 | const addHostEventListeners = (e, t, o, n) => {
|
5079 | o && (o.map((([o, n, s]) => {
|
5080 | const l = getHostListenerTarget(e, o) , a = hostListenerProxy(t, s), r = hostListenerOpts(o);
|
5081 | plt.ael(l, n, a, r), (t.$rmListeners$ = t.$rmListeners$ || []).push((() => plt.rel(l, n, a, r)));
|
5082 | })));
|
5083 | }, hostListenerProxy = (e, t) => o => {
|
5084 | try {
|
5085 | 256 & e.$flags$ ? e.$lazyInstance$[t](o) : (e.$queuedListeners$ = e.$queuedListeners$ || []).push([ t, o ]) ;
|
5086 | } catch (e) {
|
5087 | consoleError(e);
|
5088 | }
|
5089 | }, getHostListenerTarget = (e, t) => 4 & t ? doc$1 : 8 & t ? win$2 : 16 & t ? doc$1.body : e, hostListenerOpts = e => 0 != (2 & e), XLINK_NS = "http://www.w3.org/1999/xlink";
|
5090 |
|
5091 | const createTime = (e, t = "") => {
|
5092 | return () => {};
|
5093 | }, rootAppliedStyles = new WeakMap, registerStyle = (e, t, o) => {
|
5094 | let n = styles$1.get(e);
|
5095 | n = t, styles$1.set(e, n);
|
5096 | }, addStyle = (e, t, o, n) => {
|
5097 | let s = getScopeId(t, o), l = styles$1.get(s);
|
5098 | if (e = 11 === e.nodeType ? e : doc$1, l) if ("string" == typeof l) {
|
5099 | e = e.head || e;
|
5100 | let o, a = rootAppliedStyles.get(e);
|
5101 | if (a || rootAppliedStyles.set(e, a = new Set), !a.has(s)) {
|
5102 | if (e.host && (o = e.querySelector(`[sty-id="${s}"]`))) o.innerHTML = l; else {
|
5103 | o = doc$1.createElement("style"), o.innerHTML = l;
|
5104 | o.setAttribute("sty-id", s),
|
5105 | e.insertBefore(o, e.querySelector("link"));
|
5106 | }
|
5107 | a && a.add(s);
|
5108 | }
|
5109 | }
|
5110 | return s;
|
5111 | }, attachStyles = e => {
|
5112 | const t = e.$cmpMeta$, o = e.$hostElement$, n = t.$flags$, s = createTime("attachStyles", t.$tagName$), l = addStyle(o.getRootNode(), t, e.$modeName$);
|
5113 | 10 & n && (o["s-sc"] = l,
|
5114 | o.classList.add(l + "-h"), 2 & n && o.classList.add(l + "-s")),
|
5115 | s();
|
5116 | }, getScopeId = (e, t) => "sc-" + (t && 32 & e.$flags$ ? e.$tagName$ + "-" + t : e.$tagName$), computeMode = e => modeResolutionChain.map((t => t(e))).find((e => !!e)), setMode = e => modeResolutionChain.push(e), getMode = e => getHostRef(e).$modeName$, EMPTY_OBJ = {}, isComplexType = e => "object" == (e = typeof e) || "function" === e, isPromise = e => !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then, h = (e, t, ...o) => {
|
5117 | let n = null, s = null, l = null, a = !1, r = !1, i = [];
|
5118 | const d = t => {
|
5119 | for (let o = 0; o < t.length; o++) n = t[o], Array.isArray(n) ? d(n) : null != n && "boolean" != typeof n && ((a = "function" != typeof e && !isComplexType(n)) ? n = String(n) : BUILD.isDev ,
|
5120 | a && r ? i[i.length - 1].$text$ += n : i.push(a ? newVNode(null, n) : n), r = a);
|
5121 | };
|
5122 | if (d(o), t && (t.key && (s = t.key),
|
5123 | t.name && (l = t.name), BUILD.vdomClass)) {
|
5124 | const e = t.className || t.class;
|
5125 | e && (t.class = "object" != typeof e ? e : Object.keys(e).filter((t => e[t])).join(" "));
|
5126 | }
|
5127 | if ("function" == typeof e) return e(null === t ? {} : t, i, vdomFnUtils);
|
5128 | const c = newVNode(e, null);
|
5129 | return c.$attrs$ = t, i.length > 0 && (c.$children$ = i), (c.$key$ = s),
|
5130 | (c.$name$ = l), c;
|
5131 | }, newVNode = (e, t) => {
|
5132 | const o = {
|
5133 | $flags$: 0,
|
5134 | $tag$: e,
|
5135 | $text$: t,
|
5136 | $elm$: null,
|
5137 | $children$: null
|
5138 | };
|
5139 | return (o.$attrs$ = null), (o.$key$ = null),
|
5140 | (o.$name$ = null), o;
|
5141 | }, Host = {}, isHost = e => e && e.$tag$ === Host, vdomFnUtils = {
|
5142 | forEach: (e, t) => e.map(convertToPublic).forEach(t),
|
5143 | map: (e, t) => e.map(convertToPublic).map(t).map(convertToPrivate)
|
5144 | }, convertToPublic = e => ({
|
5145 | vattrs: e.$attrs$,
|
5146 | vchildren: e.$children$,
|
5147 | vkey: e.$key$,
|
5148 | vname: e.$name$,
|
5149 | vtag: e.$tag$,
|
5150 | vtext: e.$text$
|
5151 | }), convertToPrivate = e => {
|
5152 | if ("function" == typeof e.vtag) {
|
5153 | const t = {
|
5154 | ...e.vattrs
|
5155 | };
|
5156 | return e.vkey && (t.key = e.vkey), e.vname && (t.name = e.vname), h(e.vtag, t, ...e.vchildren || []);
|
5157 | }
|
5158 | const t = newVNode(e.vtag, e.vtext);
|
5159 | return t.$attrs$ = e.vattrs, t.$children$ = e.vchildren, t.$key$ = e.vkey, t.$name$ = e.vname,
|
5160 | t;
|
5161 | }, setAccessor = (e, t, o, n, s, l) => {
|
5162 | if (o !== n) {
|
5163 | let a = isMemberInElement(e, t), r = t.toLowerCase();
|
5164 | if ("class" === t) {
|
5165 | const t = e.classList, s = parseClassList(o), l = parseClassList(n);
|
5166 | t.remove(...s.filter((e => e && !l.includes(e)))), t.add(...l.filter((e => e && !s.includes(e))));
|
5167 | } else if ("style" === t) {
|
5168 | for (const t in o) n && null != n[t] || (e.style[t] = "");
|
5169 | for (const t in n) o && n[t] === o[t] || (e.style[t] = n[t]);
|
5170 | } else if ("key" === t) ; else if ("ref" === t) n && n(e); else if ((a ) || "o" !== t[0] || "n" !== t[1]) {
|
5171 | {
|
5172 | const i = isComplexType(n);
|
5173 | if ((a || i && null !== n) && !s) try {
|
5174 | if (e.tagName.includes("-")) e[t] = n; else {
|
5175 | let s = null == n ? "" : n;
|
5176 | "list" === t ? a = !1 : null != o && e[t] == s || (e[t] = s);
|
5177 | }
|
5178 | } catch (e) {}
|
5179 | let d = !1;
|
5180 | r !== (r = r.replace(/^xlink\:?/, "")) && (t = r, d = !0), null == n || !1 === n ? !1 === n && "" !== e.getAttribute(t) || (d ? e.removeAttributeNS(XLINK_NS, t) : e.removeAttribute(t)) : (!a || 4 & l || s) && !i && (n = !0 === n ? "" : n,
|
5181 | d ? e.setAttributeNS(XLINK_NS, t, n) : e.setAttribute(t, n));
|
5182 | }
|
5183 | } else t = "-" === t[2] ? t.slice(3) : isMemberInElement(win$2, r) ? r.slice(2) : r[2] + t.slice(3),
|
5184 | o && plt.rel(e, t, o, !1), n && plt.ael(e, t, n, !1);
|
5185 | }
|
5186 | }, parseClassListRegex = /\s/, parseClassList = e => e ? e.split(parseClassListRegex) : [], updateElement = (e, t, o, n) => {
|
5187 | const s = 11 === t.$elm$.nodeType && t.$elm$.host ? t.$elm$.host : t.$elm$, l = e && e.$attrs$ || EMPTY_OBJ, a = t.$attrs$ || EMPTY_OBJ;
|
5188 | for (n in l) n in a || setAccessor(s, n, l[n], void 0, o, t.$flags$);
|
5189 | for (n in a) setAccessor(s, n, l[n], a[n], o, t.$flags$);
|
5190 | };
|
5191 |
|
5192 | let scopeId, contentRef, hostTagName, useNativeShadowDom = !1, checkSlotFallbackVisibility = !1, checkSlotRelocate = !1, isSvgMode = !1;
|
5193 |
|
5194 | const createElm = (e, t, o, n) => {
|
5195 | let s, l, a, r = t.$children$[o], i = 0;
|
5196 | if (!useNativeShadowDom && (checkSlotRelocate = !0, "slot" === r.$tag$ && (scopeId && n.classList.add(scopeId + "-s"),
|
5197 | r.$flags$ |= r.$children$ ? 2 : 1)), null !== r.$text$) s = r.$elm$ = doc$1.createTextNode(r.$text$); else if (1 & r.$flags$) s = r.$elm$ = slotReferenceDebugNode(r) ; else {
|
5198 | if (!isSvgMode && (isSvgMode = "svg" === r.$tag$), s = r.$elm$ = doc$1.createElementNS(isSvgMode ? "http://www.w3.org/2000/svg" : "http://www.w3.org/1999/xhtml", 2 & r.$flags$ ? "slot-fb" : r.$tag$) ,
|
5199 | isSvgMode && "foreignObject" === r.$tag$ && (isSvgMode = !1), updateElement(null, r, isSvgMode),
|
5200 | null != scopeId && s["s-si"] !== scopeId && s.classList.add(s["s-si"] = scopeId),
|
5201 | r.$children$) for (i = 0; i < r.$children$.length; ++i) l = createElm(e, r, i, s),
|
5202 | l && s.appendChild(l);
|
5203 | ("svg" === r.$tag$ ? isSvgMode = !1 : "foreignObject" === s.tagName && (isSvgMode = !0));
|
5204 | }
|
5205 | return (s["s-hn"] = hostTagName, 3 & r.$flags$ && (s["s-sr"] = !0,
|
5206 | s["s-cr"] = contentRef, s["s-sn"] = r.$name$ || "", a = e && e.$children$ && e.$children$[o],
|
5207 | a && a.$tag$ === r.$tag$ && e.$elm$ && putBackInOriginalLocation(e.$elm$, !1))),
|
5208 | s;
|
5209 | }, putBackInOriginalLocation = (e, t) => {
|
5210 | plt.$flags$ |= 1;
|
5211 | const o = e.childNodes;
|
5212 | for (let e = o.length - 1; e >= 0; e--) {
|
5213 | const n = o[e];
|
5214 | n["s-hn"] !== hostTagName && n["s-ol"] && (parentReferenceNode(n).insertBefore(n, referenceNode(n)),
|
5215 | n["s-ol"].remove(), n["s-ol"] = void 0, checkSlotRelocate = !0), t && putBackInOriginalLocation(n, t);
|
5216 | }
|
5217 | plt.$flags$ &= -2;
|
5218 | }, addVnodes = (e, t, o, n, s, l) => {
|
5219 | let a, r = e["s-cr"] && e["s-cr"].parentNode || e;
|
5220 | for (r.shadowRoot && r.tagName === hostTagName && (r = r.shadowRoot); s <= l; ++s) n[s] && (a = createElm(null, o, s, e),
|
5221 | a && (n[s].$elm$ = a, r.insertBefore(a, referenceNode(t) )));
|
5222 | }, removeVnodes = (e, t, o, n, s) => {
|
5223 | for (;t <= o; ++t) (n = e[t]) && (s = n.$elm$, callNodeRefs(n), (checkSlotFallbackVisibility = !0,
|
5224 | s["s-ol"] ? s["s-ol"].remove() : putBackInOriginalLocation(s, !0)), s.remove());
|
5225 | }, isSameVnode = (e, t) => e.$tag$ === t.$tag$ && ("slot" === e.$tag$ ? e.$name$ === t.$name$ : e.$key$ === t.$key$), referenceNode = e => e && e["s-ol"] || e, parentReferenceNode = e => (e["s-ol"] ? e["s-ol"] : e).parentNode, patch = (e, t) => {
|
5226 | const o = t.$elm$ = e.$elm$, n = e.$children$, s = t.$children$, l = t.$tag$, a = t.$text$;
|
5227 | let r;
|
5228 | null !== a ? (r = o["s-cr"]) ? r.parentNode.textContent = a : e.$text$ !== a && (o.data = a) : ((isSvgMode = "svg" === l || "foreignObject" !== l && isSvgMode),
|
5229 | ("slot" === l || updateElement(e, t, isSvgMode)),
|
5230 | null !== n && null !== s ? ((e, t, o, n) => {
|
5231 | let s, l, a = 0, r = 0, i = 0, d = 0, c = t.length - 1, $ = t[0], m = t[c], p = n.length - 1, h = n[0], u = n[p];
|
5232 | for (;a <= c && r <= p; ) if (null == $) $ = t[++a]; else if (null == m) m = t[--c]; else if (null == h) h = n[++r]; else if (null == u) u = n[--p]; else if (isSameVnode($, h)) patch($, h),
|
5233 | $ = t[++a], h = n[++r]; else if (isSameVnode(m, u)) patch(m, u), m = t[--c], u = n[--p]; else if (isSameVnode($, u)) "slot" !== $.$tag$ && "slot" !== u.$tag$ || putBackInOriginalLocation($.$elm$.parentNode, !1),
|
5234 | patch($, u), e.insertBefore($.$elm$, m.$elm$.nextSibling), $ = t[++a], u = n[--p]; else if (isSameVnode(m, h)) "slot" !== $.$tag$ && "slot" !== u.$tag$ || putBackInOriginalLocation(m.$elm$.parentNode, !1),
|
5235 | patch(m, h), e.insertBefore(m.$elm$, $.$elm$), m = t[--c], h = n[++r]; else {
|
5236 | if (i = -1, BUILD.vdomKey) for (d = a; d <= c; ++d) if (t[d] && null !== t[d].$key$ && t[d].$key$ === h.$key$) {
|
5237 | i = d;
|
5238 | break;
|
5239 | }
|
5240 | i >= 0 ? (l = t[i], l.$tag$ !== h.$tag$ ? s = createElm(t && t[r], o, i, e) : (patch(l, h),
|
5241 | t[i] = void 0, s = l.$elm$), h = n[++r]) : (s = createElm(t && t[r], o, r, e), h = n[++r]),
|
5242 | s && (parentReferenceNode($.$elm$).insertBefore(s, referenceNode($.$elm$)) );
|
5243 | }
|
5244 | a > c ? addVnodes(e, null == n[p + 1] ? null : n[p + 1].$elm$, o, n, r, p) : r > p && removeVnodes(t, a, c);
|
5245 | })(o, n, t, s) : null !== s ? (null !== e.$text$ && (o.textContent = ""),
|
5246 | addVnodes(o, null, t, s, 0, s.length - 1)) : null !== n && removeVnodes(n, 0, n.length - 1),
|
5247 | isSvgMode && "svg" === l && (isSvgMode = !1));
|
5248 | }, updateFallbackSlotVisibility = e => {
|
5249 | let t, o, n, s, l, a, r = e.childNodes;
|
5250 | for (o = 0, n = r.length; o < n; o++) if (t = r[o], 1 === t.nodeType) {
|
5251 | if (t["s-sr"]) for (l = t["s-sn"], t.hidden = !1, s = 0; s < n; s++) if (a = r[s].nodeType,
|
5252 | r[s]["s-hn"] !== t["s-hn"] || "" !== l) {
|
5253 | if (1 === a && l === r[s].getAttribute("slot")) {
|
5254 | t.hidden = !0;
|
5255 | break;
|
5256 | }
|
5257 | } else if (1 === a || 3 === a && "" !== r[s].textContent.trim()) {
|
5258 | t.hidden = !0;
|
5259 | break;
|
5260 | }
|
5261 | updateFallbackSlotVisibility(t);
|
5262 | }
|
5263 | }, relocateNodes = [], relocateSlotContent = e => {
|
5264 | let t, o, n, s, l, a, r = 0, i = e.childNodes, d = i.length;
|
5265 | for (;r < d; r++) {
|
5266 | if (t = i[r], t["s-sr"] && (o = t["s-cr"]) && o.parentNode) for (n = o.parentNode.childNodes,
|
5267 | s = t["s-sn"], a = n.length - 1; a >= 0; a--) o = n[a], o["s-cn"] || o["s-nr"] || o["s-hn"] === t["s-hn"] || (isNodeLocatedInSlot(o, s) ? (l = relocateNodes.find((e => e.$nodeToRelocate$ === o)),
|
5268 | checkSlotFallbackVisibility = !0, o["s-sn"] = o["s-sn"] || s, l ? l.$slotRefNode$ = t : relocateNodes.push({
|
5269 | $slotRefNode$: t,
|
5270 | $nodeToRelocate$: o
|
5271 | }), o["s-sr"] && relocateNodes.map((e => {
|
5272 | isNodeLocatedInSlot(e.$nodeToRelocate$, o["s-sn"]) && (l = relocateNodes.find((e => e.$nodeToRelocate$ === o)),
|
5273 | l && !e.$slotRefNode$ && (e.$slotRefNode$ = l.$slotRefNode$));
|
5274 | }))) : relocateNodes.some((e => e.$nodeToRelocate$ === o)) || relocateNodes.push({
|
5275 | $nodeToRelocate$: o
|
5276 | }));
|
5277 | 1 === t.nodeType && relocateSlotContent(t);
|
5278 | }
|
5279 | }, isNodeLocatedInSlot = (e, t) => 1 === e.nodeType ? null === e.getAttribute("slot") && "" === t || e.getAttribute("slot") === t : e["s-sn"] === t || "" === t, callNodeRefs = e => {
|
5280 | (e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(callNodeRefs));
|
5281 | }, renderVdom = (e, t) => {
|
5282 | const o = e.$hostElement$, n = e.$cmpMeta$, s = e.$vnode$ || newVNode(null, null), l = isHost(t) ? t : h(null, null, t);
|
5283 | if (hostTagName = o.tagName, BUILD.isDev ) ;
|
5284 | if (n.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, n.$attrsToReflect$.map((([e, t]) => l.$attrs$[t] = o[e]))),
|
5285 | l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = s.$elm$ = o.shadowRoot || o,
|
5286 | (scopeId = o["s-sc"]), (contentRef = o["s-cr"],
|
5287 | useNativeShadowDom = supportsShadow, checkSlotFallbackVisibility = !1), patch(s, l),
|
5288 | BUILD.slotRelocation) {
|
5289 | if (plt.$flags$ |= 1, checkSlotRelocate) {
|
5290 | let e, t, o, n, s, a;
|
5291 | relocateSlotContent(l.$elm$);
|
5292 | let r = 0;
|
5293 | for (;r < relocateNodes.length; r++) e = relocateNodes[r], t = e.$nodeToRelocate$,
|
5294 | t["s-ol"] || (o = originalLocationDebugNode(t) ,
|
5295 | o["s-nr"] = t, t.parentNode.insertBefore(t["s-ol"] = o, t));
|
5296 | for (r = 0; r < relocateNodes.length; r++) if (e = relocateNodes[r], t = e.$nodeToRelocate$,
|
5297 | e.$slotRefNode$) {
|
5298 | for (n = e.$slotRefNode$.parentNode, s = e.$slotRefNode$.nextSibling, o = t["s-ol"]; o = o.previousSibling; ) if (a = o["s-nr"],
|
5299 | a && a["s-sn"] === t["s-sn"] && n === a.parentNode && (a = a.nextSibling, !a || !a["s-nr"])) {
|
5300 | s = a;
|
5301 | break;
|
5302 | }
|
5303 | (!s && n !== t.parentNode || t.nextSibling !== s) && t !== s && (!t["s-hn"] && t["s-ol"] && (t["s-hn"] = t["s-ol"].parentNode.nodeName),
|
5304 | n.insertBefore(t, s));
|
5305 | } else 1 === t.nodeType && (t.hidden = !0);
|
5306 | }
|
5307 | checkSlotFallbackVisibility && updateFallbackSlotVisibility(l.$elm$), plt.$flags$ &= -2,
|
5308 | relocateNodes.length = 0;
|
5309 | }
|
5310 | }, slotReferenceDebugNode = e => doc$1.createComment(`<slot${e.$name$ ? ' name="' + e.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`), originalLocationDebugNode = e => doc$1.createComment("org-location for " + (e.localName ? `<${e.localName}> (host=${e["s-hn"]})` : `[${e.textContent}]`)), getElement = e => getHostRef(e).$hostElement$ , createEvent = (e, t, o) => {
|
5311 | const n = getElement(e);
|
5312 | return {
|
5313 | emit: e => (emitEvent(n, t, {
|
5314 | bubbles: !!(4 & o),
|
5315 | composed: !!(2 & o),
|
5316 | cancelable: !!(1 & o),
|
5317 | detail: e
|
5318 | }))
|
5319 | };
|
5320 | }, emitEvent = (e, t, o) => {
|
5321 | const n = plt.ce(t, o);
|
5322 | return e.dispatchEvent(n), n;
|
5323 | }, attachToAncestor = (e, t) => {
|
5324 | t && !e.$onRenderResolve$ && t["s-p"] && t["s-p"].push(new Promise((t => e.$onRenderResolve$ = t)));
|
5325 | }, scheduleUpdate = (e, t) => {
|
5326 | if ((e.$flags$ |= 16), 4 & e.$flags$) return void (e.$flags$ |= 512);
|
5327 | attachToAncestor(e, e.$ancestorComponent$);
|
5328 | const o = () => dispatchHooks(e, t);
|
5329 | return writeTask(o) ;
|
5330 | }, dispatchHooks = (e, t) => {
|
5331 | const n = createTime("scheduleUpdate", e.$cmpMeta$.$tagName$), s = e.$lazyInstance$ ;
|
5332 | let l;
|
5333 | return t ? ((e.$flags$ |= 256, e.$queuedListeners$ && (e.$queuedListeners$.map((([e, t]) => safeCall$1(s, e, t))),
|
5334 | e.$queuedListeners$ = null)), (l = safeCall$1(s, "componentWillLoad"))) : (BUILD.cmpWillUpdate ), (l = then(l, (() => safeCall$1(s, "componentWillRender")))),
|
5335 | n(), then(l, (() => updateComponent(e, s, t)));
|
5336 | }, updateComponent = async (e, t, o) => {
|
5337 | const n = e.$hostElement$, s = createTime("update", e.$cmpMeta$.$tagName$), l = n["s-rc"];
|
5338 | o && attachStyles(e);
|
5339 | const a = createTime("render", e.$cmpMeta$.$tagName$);
|
5340 | if (await callRender(e, t) ,
|
5341 | BUILD.hydrateServerSide) try {
|
5342 | serverSideConnected(n), o && (1 & e.$cmpMeta$.$flags$ ? n["s-en"] = "" : 2 & e.$cmpMeta$.$flags$ && (n["s-en"] = "c"));
|
5343 | } catch (e) {
|
5344 | consoleError(e, n);
|
5345 | }
|
5346 | if (l && (l.map((e => e())), n["s-rc"] = void 0), a(), s(),
|
5347 | BUILD.asyncLoading) {
|
5348 | const t = n["s-p"], o = () => postUpdateComponent(e);
|
5349 | 0 === t.length ? o() : (Promise.all(t).then(o), e.$flags$ |= 4, t.length = 0);
|
5350 | }
|
5351 | };
|
5352 |
|
5353 | const callRender = (e, t, o) => {
|
5354 | try {
|
5355 | if (t = (t.render) && t.render(), (e.$flags$ &= -17),
|
5356 | (e.$flags$ |= 2), BUILD.hasRenderFn ) {
|
5357 | return Promise.resolve(t).then((t => renderVdom(e, t)));
|
5358 | }
|
5359 | } catch (t) {
|
5360 | consoleError(t, e.$hostElement$);
|
5361 | }
|
5362 | return null;
|
5363 | }, postUpdateComponent = e => {
|
5364 | const t = e.$cmpMeta$.$tagName$, o = e.$hostElement$, n = createTime("postUpdate", t), s = e.$lazyInstance$ , l = e.$ancestorComponent$;
|
5365 | 64 & e.$flags$ ? ((safeCall$1(s, "componentDidUpdate"),
|
5366 | BUILD.isDev ), n()) : (e.$flags$ |= 64, addHydratedFlag(o),
|
5367 | (safeCall$1(s, "componentDidLoad"),
|
5368 | BUILD.isDev ), n(), (e.$onReadyResolve$(o), l || appDidLoad())), e.$onInstanceResolve$(o), (e.$onRenderResolve$ && (e.$onRenderResolve$(),
|
5369 | e.$onRenderResolve$ = void 0), 512 & e.$flags$ && nextTick((() => scheduleUpdate(e, !1))),
|
5370 | e.$flags$ &= -517);
|
5371 | }, forceUpdate$1 = e => {
|
5372 | {
|
5373 | const t = getHostRef(e), o = t.$hostElement$.isConnected;
|
5374 | return o && 2 == (18 & t.$flags$) && scheduleUpdate(t, !1), o;
|
5375 | }
|
5376 | }, appDidLoad = e => {
|
5377 | addHydratedFlag(doc$1.documentElement), nextTick((() => emitEvent(win$2, "appload", {
|
5378 | detail: {
|
5379 | namespace: NAMESPACE
|
5380 | }
|
5381 | }))), BUILD.profile ;
|
5382 | }, safeCall$1 = (e, t, o) => {
|
5383 | if (e && e[t]) try {
|
5384 | return e[t](o);
|
5385 | } catch (e) {
|
5386 | consoleError(e);
|
5387 | }
|
5388 | }, then = (e, t) => e && e.then ? e.then(t) : t(), addHydratedFlag = e => e.classList.add("hydrated") , serverSideConnected = e => {
|
5389 | const t = e.children;
|
5390 | if (null != t) for (let e = 0, o = t.length; e < o; e++) {
|
5391 | const o = t[e];
|
5392 | "function" == typeof o.connectedCallback && o.connectedCallback(), serverSideConnected(o);
|
5393 | }
|
5394 | }, clientHydrate = (e, t, o, n, s, l, a) => {
|
5395 | let r, i, d, c;
|
5396 | if (1 === l.nodeType) {
|
5397 | for (r = l.getAttribute("c-id"), r && (i = r.split("."), i[0] !== a && "0" !== i[0] || (d = {
|
5398 | $flags$: 0,
|
5399 | $hostId$: i[0],
|
5400 | $nodeId$: i[1],
|
5401 | $depth$: i[2],
|
5402 | $index$: i[3],
|
5403 | $tag$: l.tagName.toLowerCase(),
|
5404 | $elm$: l,
|
5405 | $attrs$: null,
|
5406 | $children$: null,
|
5407 | $key$: null,
|
5408 | $name$: null,
|
5409 | $text$: null
|
5410 | }, t.push(d), l.removeAttribute("c-id"), e.$children$ || (e.$children$ = []), e.$children$[d.$index$] = d,
|
5411 | e = d, n && "0" === d.$depth$ && (n[d.$index$] = d.$elm$))), c = l.childNodes.length - 1; c >= 0; c--) clientHydrate(e, t, o, n, s, l.childNodes[c], a);
|
5412 | if (l.shadowRoot) for (c = l.shadowRoot.childNodes.length - 1; c >= 0; c--) clientHydrate(e, t, o, n, s, l.shadowRoot.childNodes[c], a);
|
5413 | } else if (8 === l.nodeType) i = l.nodeValue.split("."), i[1] !== a && "0" !== i[1] || (r = i[0],
|
5414 | d = {
|
5415 | $flags$: 0,
|
5416 | $hostId$: i[1],
|
5417 | $nodeId$: i[2],
|
5418 | $depth$: i[3],
|
5419 | $index$: i[4],
|
5420 | $elm$: l,
|
5421 | $attrs$: null,
|
5422 | $children$: null,
|
5423 | $key$: null,
|
5424 | $name$: null,
|
5425 | $tag$: null,
|
5426 | $text$: null
|
5427 | }, "t" === r ? (d.$elm$ = l.nextSibling, d.$elm$ && 3 === d.$elm$.nodeType && (d.$text$ = d.$elm$.textContent,
|
5428 | t.push(d), l.remove(), e.$children$ || (e.$children$ = []), e.$children$[d.$index$] = d,
|
5429 | n && "0" === d.$depth$ && (n[d.$index$] = d.$elm$))) : d.$hostId$ === a && ("s" === r ? (d.$tag$ = "slot",
|
5430 | i[5] ? l["s-sn"] = d.$name$ = i[5] : l["s-sn"] = "", l["s-sr"] = !0, n && (d.$elm$ = doc$1.createElement(d.$tag$),
|
5431 | d.$name$ && d.$elm$.setAttribute("name", d.$name$), l.parentNode.insertBefore(d.$elm$, l),
|
5432 | l.remove(), "0" === d.$depth$ && (n[d.$index$] = d.$elm$)), o.push(d), e.$children$ || (e.$children$ = []),
|
5433 | e.$children$[d.$index$] = d) : "r" === r && (n ? l.remove() : (s["s-cr"] = l,
|
5434 | l["s-cn"] = !0)))); else if (e && "style" === e.$tag$) {
|
5435 | const t = newVNode(null, l.textContent);
|
5436 | t.$elm$ = l, t.$index$ = "0", e.$children$ = [ t ];
|
5437 | }
|
5438 | }, initializeDocumentHydrate = (e, t) => {
|
5439 | if (1 === e.nodeType) {
|
5440 | let o = 0;
|
5441 | for (;o < e.childNodes.length; o++) initializeDocumentHydrate(e.childNodes[o], t);
|
5442 | if (e.shadowRoot) for (o = 0; o < e.shadowRoot.childNodes.length; o++) initializeDocumentHydrate(e.shadowRoot.childNodes[o], t);
|
5443 | } else if (8 === e.nodeType) {
|
5444 | const o = e.nodeValue.split(".");
|
5445 | "o" === o[0] && (t.set(o[1] + "." + o[2], e), e.nodeValue = "", e["s-en"] = o[3]);
|
5446 | }
|
5447 | }, parsePropertyValue = (e, t) => null == e || isComplexType(e) ? e : 4 & t ? "false" !== e && ("" === e || !!e) : 2 & t ? parseFloat(e) : 1 & t ? String(e) : e, getValue = (e, t) => getHostRef(e).$instanceValues$.get(t), setValue = (e, t, o, n) => {
|
5448 | const s = getHostRef(e), l = s.$hostElement$ , a = s.$instanceValues$.get(t), r = s.$flags$, i = s.$lazyInstance$ ;
|
5449 | if (o = parsePropertyValue(o, n.$members$[t][0]), !(8 & r && void 0 !== a || o === a) && (s.$instanceValues$.set(t, o),
|
5450 | i)) {
|
5451 | if (n.$watchers$ && 128 & r) {
|
5452 | const e = n.$watchers$[t];
|
5453 | e && e.map((e => {
|
5454 | try {
|
5455 | i[e](o, a, t);
|
5456 | } catch (e) {
|
5457 | consoleError(e, l);
|
5458 | }
|
5459 | }));
|
5460 | }
|
5461 | if (2 == (18 & r)) {
|
5462 | scheduleUpdate(s, !1);
|
5463 | }
|
5464 | }
|
5465 | }, proxyComponent = (e, t, o) => {
|
5466 | if (t.$members$) {
|
5467 | e.watchers && (t.$watchers$ = e.watchers);
|
5468 | const n = Object.entries(t.$members$), s = e.prototype;
|
5469 | if (n.map((([e, [n]]) => {
|
5470 | (31 & n || (2 & o) && 32 & n) ? Object.defineProperty(s, e, {
|
5471 | get() {
|
5472 | return getValue(this, e);
|
5473 | },
|
5474 | set(s) {
|
5475 | setValue(this, e, s, t);
|
5476 | },
|
5477 | configurable: !0,
|
5478 | enumerable: !0
|
5479 | }) : 1 & o && 64 & n && Object.defineProperty(s, e, {
|
5480 | value(...t) {
|
5481 | const o = getHostRef(this);
|
5482 | return o.$onInstancePromise$.then((() => o.$lazyInstance$[e](...t)));
|
5483 | }
|
5484 | });
|
5485 | })), (1 & o)) {
|
5486 | const o = new Map;
|
5487 | s.attributeChangedCallback = function(e, t, n) {
|
5488 | plt.jmp((() => {
|
5489 | const t = o.get(e);
|
5490 | this[t] = (null !== n || "boolean" != typeof this[t]) && n;
|
5491 | }));
|
5492 | }, e.observedAttributes = n.filter((([e, t]) => 15 & t[0])).map((([e, n]) => {
|
5493 | const s = n[1] || e;
|
5494 | return o.set(s, e), 512 & n[0] && t.$attrsToReflect$.push([ e, s ]),
|
5495 | s;
|
5496 | }));
|
5497 | }
|
5498 | }
|
5499 | return e;
|
5500 | }, initializeComponent = async (e, t, o, n, s) => {
|
5501 | if (0 == (32 & t.$flags$)) {
|
5502 | {
|
5503 | if (t.$flags$ |= 32, (s = loadModule(o)).then) {
|
5504 | const e = (() => {});
|
5505 | s = await s, e();
|
5506 | }
|
5507 | !s.isProxied && ((o.$watchers$ = s.watchers),
|
5508 | proxyComponent(s, o, 2), s.isProxied = !0);
|
5509 | const e = createTime("createInstance", o.$tagName$);
|
5510 | (t.$flags$ |= 8);
|
5511 | try {
|
5512 | new s(t);
|
5513 | } catch (e) {
|
5514 | consoleError(e);
|
5515 | }
|
5516 | (t.$flags$ &= -9), (t.$flags$ |= 128), e(),
|
5517 | fireConnectedCallback(t.$lazyInstance$);
|
5518 | }
|
5519 | if (s.style) {
|
5520 | let n = s.style;
|
5521 | "string" != typeof n && (n = n[t.$modeName$ = computeMode(e)], t.$modeName$ && e.setAttribute("s-mode", t.$modeName$));
|
5522 | const l = getScopeId(o, t.$modeName$);
|
5523 | if (!styles$1.has(l)) {
|
5524 | const e = createTime("registerStyles", o.$tagName$);
|
5525 | registerStyle(l, n), e();
|
5526 | }
|
5527 | }
|
5528 | }
|
5529 | const r = t.$ancestorComponent$, i = () => scheduleUpdate(t, !0);
|
5530 | r && r["s-rc"] ? r["s-rc"].push(i) : i();
|
5531 | }, fireConnectedCallback = e => {
|
5532 | safeCall$1(e, "connectedCallback");
|
5533 | }, connectedCallback = e => {
|
5534 | if (0 == (1 & plt.$flags$)) {
|
5535 | const t = getHostRef(e), o = t.$cmpMeta$, n = createTime("connectedCallback", o.$tagName$);
|
5536 | if (1 & t.$flags$) addHostEventListeners(e, t, o.$listeners$), fireConnectedCallback(t.$lazyInstance$); else {
|
5537 | let n;
|
5538 | if (t.$flags$ |= 1, (n = e.getAttribute("s-id"), n)) {
|
5539 | ((e, t, o, n) => {
|
5540 | const s = createTime("hydrateClient", t), l = e.shadowRoot, a = [], r = l ? [] : null, i = n.$vnode$ = newVNode(t, null);
|
5541 | plt.$orgLocNodes$ || initializeDocumentHydrate(doc$1.body, plt.$orgLocNodes$ = new Map),
|
5542 | e["s-id"] = o, e.removeAttribute("s-id"), clientHydrate(i, a, [], r, e, e, o), a.map((e => {
|
5543 | const o = e.$hostId$ + "." + e.$nodeId$, n = plt.$orgLocNodes$.get(o), s = e.$elm$;
|
5544 | n && supportsShadow && "" === n["s-en"] && n.parentNode.insertBefore(s, n.nextSibling),
|
5545 | l || (s["s-hn"] = t, n && (s["s-ol"] = n, s["s-ol"]["s-nr"] = s)), plt.$orgLocNodes$.delete(o);
|
5546 | })), l && r.map((e => {
|
5547 | e && l.appendChild(e);
|
5548 | })), s();
|
5549 | })(e, o.$tagName$, n, t);
|
5550 | }
|
5551 | if (!n && (BUILD.hydrateServerSide ) && setContentReference(e),
|
5552 | BUILD.asyncLoading) {
|
5553 | let o = e;
|
5554 | for (;o = o.parentNode || o.host; ) if (1 === o.nodeType && o.hasAttribute("s-id") && o["s-p"] || o["s-p"]) {
|
5555 | attachToAncestor(t, t.$ancestorComponent$ = o);
|
5556 | break;
|
5557 | }
|
5558 | }
|
5559 | initializeComponent(e, t, o);
|
5560 | }
|
5561 | n();
|
5562 | }
|
5563 | }, setContentReference = e => {
|
5564 | const t = e["s-cr"] = doc$1.createComment("");
|
5565 | t["s-cn"] = !0, e.insertBefore(t, e.firstChild);
|
5566 | }, insertVdomAnnotations = (e, t) => {
|
5567 | if (null != e) {
|
5568 | const o = {
|
5569 | hostIds: 0,
|
5570 | rootLevelIds: 0,
|
5571 | staticComponents: new Set(t)
|
5572 | }, n = [];
|
5573 | parseVNodeAnnotations(e, e.body, o, n), n.forEach((t => {
|
5574 | if (null != t) {
|
5575 | const n = t["s-nr"];
|
5576 | let s = n["s-host-id"], l = n["s-node-id"], a = `${s}.${l}`;
|
5577 | if (null == s) if (s = 0, o.rootLevelIds++, l = o.rootLevelIds, a = `${s}.${l}`,
|
5578 | 1 === n.nodeType) n.setAttribute("c-id", a); else if (3 === n.nodeType) {
|
5579 | if (0 === s && "" === n.nodeValue.trim()) return void t.remove();
|
5580 | const o = e.createComment(a);
|
5581 | o.nodeValue = `t.${a}`, n.parentNode.insertBefore(o, n);
|
5582 | }
|
5583 | let r = `o.${a}`;
|
5584 | const i = t.parentElement;
|
5585 | i && ("" === i["s-en"] ? r += "." : "c" === i["s-en"] && (r += ".c")), t.nodeValue = r;
|
5586 | }
|
5587 | }));
|
5588 | }
|
5589 | }, parseVNodeAnnotations = (e, t, o, n) => {
|
5590 | null != t && (null != t["s-nr"] && n.push(t), 1 === t.nodeType && t.childNodes.forEach((t => {
|
5591 | const s = getHostRef(t);
|
5592 | if (null != s && !o.staticComponents.has(t.nodeName.toLowerCase())) {
|
5593 | const n = {
|
5594 | nodeIds: 0
|
5595 | };
|
5596 | insertVNodeAnnotations(e, t, s.$vnode$, o, n);
|
5597 | }
|
5598 | parseVNodeAnnotations(e, t, o, n);
|
5599 | })));
|
5600 | }, insertVNodeAnnotations = (e, t, o, n, s) => {
|
5601 | if (null != o) {
|
5602 | const l = ++n.hostIds;
|
5603 | if (t.setAttribute("s-id", l), null != t["s-cr"] && (t["s-cr"].nodeValue = `r.${l}`),
|
5604 | null != o.$children$) {
|
5605 | const t = 0;
|
5606 | o.$children$.forEach(((o, n) => {
|
5607 | insertChildVNodeAnnotations(e, o, s, l, t, n);
|
5608 | }));
|
5609 | }
|
5610 | if (t && o && o.$elm$ && !t.hasAttribute("c-id")) {
|
5611 | const e = t.parentElement;
|
5612 | if (e && e.childNodes) {
|
5613 | const n = Array.from(e.childNodes), s = n.find((e => 8 === e.nodeType && e["s-sr"]));
|
5614 | if (s) {
|
5615 | const e = n.indexOf(t) - 1;
|
5616 | o.$elm$.setAttribute("c-id", `${s["s-host-id"]}.${s["s-node-id"]}.0.${e}`);
|
5617 | }
|
5618 | }
|
5619 | }
|
5620 | }
|
5621 | }, insertChildVNodeAnnotations = (e, t, o, n, s, l) => {
|
5622 | const a = t.$elm$;
|
5623 | if (null == a) return;
|
5624 | const r = o.nodeIds++, i = `${n}.${r}.${s}.${l}`;
|
5625 | if (a["s-host-id"] = n, a["s-node-id"] = r, 1 === a.nodeType) a.setAttribute("c-id", i); else if (3 === a.nodeType) {
|
5626 | const t = a.parentNode, o = t.nodeName;
|
5627 | if ("STYLE" !== o && "SCRIPT" !== o) {
|
5628 | const o = `t.${i}`, n = e.createComment(o);
|
5629 | t.insertBefore(n, a);
|
5630 | }
|
5631 | } else if (8 === a.nodeType && a["s-sr"]) {
|
5632 | const e = `s.${i}.${a["s-sn"] || ""}`;
|
5633 | a.nodeValue = e;
|
5634 | }
|
5635 | if (null != t.$children$) {
|
5636 | const l = s + 1;
|
5637 | t.$children$.forEach(((t, s) => {
|
5638 | insertChildVNodeAnnotations(e, t, o, n, l, s);
|
5639 | }));
|
5640 | }
|
5641 | }, NO_HYDRATE_TAGS = new Set([ "CODE", "HEAD", "IFRAME", "INPUT", "OBJECT", "OUTPUT", "NOSCRIPT", "PRE", "SCRIPT", "SELECT", "STYLE", "TEMPLATE", "TEXTAREA" ]), hAsync = (e, t, ...o) => {
|
5642 | if (Array.isArray(o) && o.length > 0) {
|
5643 | const n = o.flat(1 / 0);
|
5644 | return n.some(isPromise) ? Promise.all(n).then((o => h(e, t, ...o))).catch((o => h(e, t))) : h(e, t, ...o);
|
5645 | }
|
5646 | return h(e, t);
|
5647 | };
|
5648 |
|
5649 | const cmpModules = new Map, getModule = e => {
|
5650 | if ("string" == typeof e) {
|
5651 | e = e.toLowerCase();
|
5652 | const t = cmpModules.get(e);
|
5653 | if (null != t) return t[e];
|
5654 | }
|
5655 | return null;
|
5656 | }, loadModule = (e, t, o) => getModule(e.$tagName$), isMemberInElement = (e, t) => {
|
5657 | if (null != e) {
|
5658 | if (t in e) return !0;
|
5659 | const o = getModule(e.nodeName);
|
5660 | if (null != o) {
|
5661 | const e = o;
|
5662 | if (null != e && null != e.cmpMeta && null != e.cmpMeta.$members$) return t in e.cmpMeta.$members$;
|
5663 | }
|
5664 | }
|
5665 | return !1;
|
5666 | }, registerComponents = e => {
|
5667 | for (const t of e) {
|
5668 | const e = t.cmpMeta.$tagName$;
|
5669 | cmpModules.set(e, {
|
5670 | [e]: t
|
5671 | });
|
5672 | }
|
5673 | }, win$2 = window, doc$1 = win$2.document, readTask = e => {
|
5674 | process.nextTick((() => {
|
5675 | try {
|
5676 | e();
|
5677 | } catch (e) {
|
5678 | consoleError(e);
|
5679 | }
|
5680 | }));
|
5681 | }, writeTask = e => {
|
5682 | process.nextTick((() => {
|
5683 | try {
|
5684 | e();
|
5685 | } catch (e) {
|
5686 | consoleError(e);
|
5687 | }
|
5688 | }));
|
5689 | }, resolved = Promise.resolve(), nextTick = e => resolved.then(e), defaultConsoleError = e => {
|
5690 | null != e && console.error(e.stack || e.message || e);
|
5691 | }, consoleError = (e, t) => (defaultConsoleError)(e, t), plt = {
|
5692 | $flags$: 0,
|
5693 | $resourcesUrl$: "",
|
5694 | jmp: e => e(),
|
5695 | raf: e => requestAnimationFrame(e),
|
5696 | ael: (e, t, o, n) => e.addEventListener(t, o, n),
|
5697 | rel: (e, t, o, n) => e.removeEventListener(t, o, n),
|
5698 | ce: (e, t) => new win$2.CustomEvent(e, t)
|
5699 | }, supportsShadow = !1, hostRefs = new WeakMap, getHostRef = e => hostRefs.get(e), registerInstance = (e, t) => hostRefs.set(t.$lazyInstance$ = e, t), registerHost = (e, t) => {
|
5700 | const o = {
|
5701 | $flags$: 0,
|
5702 | $cmpMeta$: t,
|
5703 | $hostElement$: e,
|
5704 | $instanceValues$: new Map,
|
5705 | $renderCount$: 0
|
5706 | };
|
5707 | return o.$onInstancePromise$ = new Promise((e => o.$onInstanceResolve$ = e)), o.$onReadyPromise$ = new Promise((e => o.$onReadyResolve$ = e)),
|
5708 | e["s-p"] = [], e["s-rc"] = [], addHostEventListeners(e, o, t.$listeners$), hostRefs.set(e, o);
|
5709 | }, Build = {
|
5710 | isDev: !1,
|
5711 | isBrowser: !1,
|
5712 | isServer: !0,
|
5713 | isTesting: !1
|
5714 | }, styles$1 = new Map, modeResolutionChain = [];
|
5715 |
|
5716 | const HapticEngine = {
|
5717 | getEngine() {
|
5718 | const win = window;
|
5719 | return (win.TapticEngine) || (win.Capacitor && win.Capacitor.isPluginAvailable('Haptics') && win.Capacitor.Plugins.Haptics);
|
5720 | },
|
5721 | available() {
|
5722 | return !!this.getEngine();
|
5723 | },
|
5724 | isCordova() {
|
5725 | return !!window.TapticEngine;
|
5726 | },
|
5727 | isCapacitor() {
|
5728 | const win = window;
|
5729 | return !!win.Capacitor;
|
5730 | },
|
5731 | impact(options) {
|
5732 | const engine = this.getEngine();
|
5733 | if (!engine) {
|
5734 | return;
|
5735 | }
|
5736 | const style = this.isCapacitor() ? options.style.toUpperCase() : options.style;
|
5737 | engine.impact({ style });
|
5738 | },
|
5739 | notification(options) {
|
5740 | const engine = this.getEngine();
|
5741 | if (!engine) {
|
5742 | return;
|
5743 | }
|
5744 | const style = this.isCapacitor() ? options.style.toUpperCase() : options.style;
|
5745 | engine.notification({ style });
|
5746 | },
|
5747 | selection() {
|
5748 | this.impact({ style: 'light' });
|
5749 | },
|
5750 | selectionStart() {
|
5751 | const engine = this.getEngine();
|
5752 | if (!engine) {
|
5753 | return;
|
5754 | }
|
5755 | if (this.isCapacitor()) {
|
5756 | engine.selectionStart();
|
5757 | }
|
5758 | else {
|
5759 | engine.gestureSelectionStart();
|
5760 | }
|
5761 | },
|
5762 | selectionChanged() {
|
5763 | const engine = this.getEngine();
|
5764 | if (!engine) {
|
5765 | return;
|
5766 | }
|
5767 | if (this.isCapacitor()) {
|
5768 | engine.selectionChanged();
|
5769 | }
|
5770 | else {
|
5771 | engine.gestureSelectionChanged();
|
5772 | }
|
5773 | },
|
5774 | selectionEnd() {
|
5775 | const engine = this.getEngine();
|
5776 | if (!engine) {
|
5777 | return;
|
5778 | }
|
5779 | if (this.isCapacitor()) {
|
5780 | engine.selectionEnd();
|
5781 | }
|
5782 | else {
|
5783 | engine.gestureSelectionEnd();
|
5784 | }
|
5785 | }
|
5786 | };
|
5787 |
|
5788 |
|
5789 |
|
5790 |
|
5791 | const hapticSelection = () => {
|
5792 | HapticEngine.selection();
|
5793 | };
|
5794 |
|
5795 |
|
5796 |
|
5797 | const hapticSelectionStart = () => {
|
5798 | HapticEngine.selectionStart();
|
5799 | };
|
5800 |
|
5801 |
|
5802 |
|
5803 | const hapticSelectionChanged = () => {
|
5804 | HapticEngine.selectionChanged();
|
5805 | };
|
5806 |
|
5807 |
|
5808 |
|
5809 |
|
5810 | const hapticSelectionEnd = () => {
|
5811 | HapticEngine.selectionEnd();
|
5812 | };
|
5813 |
|
5814 |
|
5815 |
|
5816 |
|
5817 | const hapticImpact = (options) => {
|
5818 | HapticEngine.impact(options);
|
5819 | };
|
5820 |
|
5821 | class GestureController {
|
5822 | constructor() {
|
5823 | this.gestureId = 0;
|
5824 | this.requestedStart = new Map();
|
5825 | this.disabledGestures = new Map();
|
5826 | this.disabledScroll = new Set();
|
5827 | }
|
5828 | |
5829 |
|
5830 |
|
5831 | createGesture(config) {
|
5832 | return new GestureDelegate(this, this.newID(), config.name, config.priority || 0, !!config.disableScroll);
|
5833 | }
|
5834 | |
5835 |
|
5836 |
|
5837 | createBlocker(opts = {}) {
|
5838 | return new BlockerDelegate(this, this.newID(), opts.disable, !!opts.disableScroll);
|
5839 | }
|
5840 | start(gestureName, id, priority) {
|
5841 | if (!this.canStart(gestureName)) {
|
5842 | this.requestedStart.delete(id);
|
5843 | return false;
|
5844 | }
|
5845 | this.requestedStart.set(id, priority);
|
5846 | return true;
|
5847 | }
|
5848 | capture(gestureName, id, priority) {
|
5849 | if (!this.start(gestureName, id, priority)) {
|
5850 | return false;
|
5851 | }
|
5852 | const requestedStart = this.requestedStart;
|
5853 | let maxPriority = -10000;
|
5854 | requestedStart.forEach(value => {
|
5855 | maxPriority = Math.max(maxPriority, value);
|
5856 | });
|
5857 | if (maxPriority === priority) {
|
5858 | this.capturedId = id;
|
5859 | requestedStart.clear();
|
5860 | const event = new CustomEvent('ionGestureCaptured', { detail: { gestureName } });
|
5861 | document.dispatchEvent(event);
|
5862 | return true;
|
5863 | }
|
5864 | requestedStart.delete(id);
|
5865 | return false;
|
5866 | }
|
5867 | release(id) {
|
5868 | this.requestedStart.delete(id);
|
5869 | if (this.capturedId === id) {
|
5870 | this.capturedId = undefined;
|
5871 | }
|
5872 | }
|
5873 | disableGesture(gestureName, id) {
|
5874 | let set = this.disabledGestures.get(gestureName);
|
5875 | if (set === undefined) {
|
5876 | set = new Set();
|
5877 | this.disabledGestures.set(gestureName, set);
|
5878 | }
|
5879 | set.add(id);
|
5880 | }
|
5881 | enableGesture(gestureName, id) {
|
5882 | const set = this.disabledGestures.get(gestureName);
|
5883 | if (set !== undefined) {
|
5884 | set.delete(id);
|
5885 | }
|
5886 | }
|
5887 | disableScroll(id) {
|
5888 | this.disabledScroll.add(id);
|
5889 | if (this.disabledScroll.size === 1) {
|
5890 | document.body.classList.add(BACKDROP_NO_SCROLL);
|
5891 | }
|
5892 | }
|
5893 | enableScroll(id) {
|
5894 | this.disabledScroll.delete(id);
|
5895 | if (this.disabledScroll.size === 0) {
|
5896 | document.body.classList.remove(BACKDROP_NO_SCROLL);
|
5897 | }
|
5898 | }
|
5899 | canStart(gestureName) {
|
5900 | if (this.capturedId !== undefined) {
|
5901 |
|
5902 | return false;
|
5903 | }
|
5904 | if (this.isDisabled(gestureName)) {
|
5905 | return false;
|
5906 | }
|
5907 | return true;
|
5908 | }
|
5909 | isCaptured() {
|
5910 | return this.capturedId !== undefined;
|
5911 | }
|
5912 | isScrollDisabled() {
|
5913 | return this.disabledScroll.size > 0;
|
5914 | }
|
5915 | isDisabled(gestureName) {
|
5916 | const disabled = this.disabledGestures.get(gestureName);
|
5917 | if (disabled && disabled.size > 0) {
|
5918 | return true;
|
5919 | }
|
5920 | return false;
|
5921 | }
|
5922 | newID() {
|
5923 | this.gestureId++;
|
5924 | return this.gestureId;
|
5925 | }
|
5926 | }
|
5927 | class GestureDelegate {
|
5928 | constructor(ctrl, id, name, priority, disableScroll) {
|
5929 | this.id = id;
|
5930 | this.name = name;
|
5931 | this.disableScroll = disableScroll;
|
5932 | this.priority = priority * 1000000 + id;
|
5933 | this.ctrl = ctrl;
|
5934 | }
|
5935 | canStart() {
|
5936 | if (!this.ctrl) {
|
5937 | return false;
|
5938 | }
|
5939 | return this.ctrl.canStart(this.name);
|
5940 | }
|
5941 | start() {
|
5942 | if (!this.ctrl) {
|
5943 | return false;
|
5944 | }
|
5945 | return this.ctrl.start(this.name, this.id, this.priority);
|
5946 | }
|
5947 | capture() {
|
5948 | if (!this.ctrl) {
|
5949 | return false;
|
5950 | }
|
5951 | const captured = this.ctrl.capture(this.name, this.id, this.priority);
|
5952 | if (captured && this.disableScroll) {
|
5953 | this.ctrl.disableScroll(this.id);
|
5954 | }
|
5955 | return captured;
|
5956 | }
|
5957 | release() {
|
5958 | if (this.ctrl) {
|
5959 | this.ctrl.release(this.id);
|
5960 | if (this.disableScroll) {
|
5961 | this.ctrl.enableScroll(this.id);
|
5962 | }
|
5963 | }
|
5964 | }
|
5965 | destroy() {
|
5966 | this.release();
|
5967 | this.ctrl = undefined;
|
5968 | }
|
5969 | }
|
5970 | class BlockerDelegate {
|
5971 | constructor(ctrl, id, disable, disableScroll) {
|
5972 | this.id = id;
|
5973 | this.disable = disable;
|
5974 | this.disableScroll = disableScroll;
|
5975 | this.ctrl = ctrl;
|
5976 | }
|
5977 | block() {
|
5978 | if (!this.ctrl) {
|
5979 | return;
|
5980 | }
|
5981 | if (this.disable) {
|
5982 | for (const gesture of this.disable) {
|
5983 | this.ctrl.disableGesture(gesture, this.id);
|
5984 | }
|
5985 | }
|
5986 | if (this.disableScroll) {
|
5987 | this.ctrl.disableScroll(this.id);
|
5988 | }
|
5989 | }
|
5990 | unblock() {
|
5991 | if (!this.ctrl) {
|
5992 | return;
|
5993 | }
|
5994 | if (this.disable) {
|
5995 | for (const gesture of this.disable) {
|
5996 | this.ctrl.enableGesture(gesture, this.id);
|
5997 | }
|
5998 | }
|
5999 | if (this.disableScroll) {
|
6000 | this.ctrl.enableScroll(this.id);
|
6001 | }
|
6002 | }
|
6003 | destroy() {
|
6004 | this.unblock();
|
6005 | this.ctrl = undefined;
|
6006 | }
|
6007 | }
|
6008 | const BACKDROP_NO_SCROLL = 'backdrop-no-scroll';
|
6009 | const GESTURE_CONTROLLER = new GestureController();
|
6010 |
|
6011 | const addEventListener$1 = (el, eventName, callback, opts) => {
|
6012 |
|
6013 |
|
6014 | const listenerOpts = supportsPassive(el) ? {
|
6015 | 'capture': !!opts.capture,
|
6016 | 'passive': !!opts.passive,
|
6017 | } : !!opts.capture;
|
6018 | let add;
|
6019 | let remove;
|
6020 | if (el['__zone_symbol__addEventListener']) {
|
6021 | add = '__zone_symbol__addEventListener';
|
6022 | remove = '__zone_symbol__removeEventListener';
|
6023 | }
|
6024 | else {
|
6025 | add = 'addEventListener';
|
6026 | remove = 'removeEventListener';
|
6027 | }
|
6028 | el[add](eventName, callback, listenerOpts);
|
6029 | return () => {
|
6030 | el[remove](eventName, callback, listenerOpts);
|
6031 | };
|
6032 | };
|
6033 | const supportsPassive = (node) => {
|
6034 | if (_sPassive === undefined) {
|
6035 | try {
|
6036 | const opts = Object.defineProperty({}, 'passive', {
|
6037 | get: () => {
|
6038 | _sPassive = true;
|
6039 | }
|
6040 | });
|
6041 | node.addEventListener('optsTest', () => { return; }, opts);
|
6042 | }
|
6043 | catch (e) {
|
6044 | _sPassive = false;
|
6045 | }
|
6046 | }
|
6047 | return !!_sPassive;
|
6048 | };
|
6049 | let _sPassive;
|
6050 |
|
6051 | const MOUSE_WAIT = 2000;
|
6052 | const createPointerEvents = (el, pointerDown, pointerMove, pointerUp, options) => {
|
6053 | let rmTouchStart;
|
6054 | let rmTouchMove;
|
6055 | let rmTouchEnd;
|
6056 | let rmTouchCancel;
|
6057 | let rmMouseStart;
|
6058 | let rmMouseMove;
|
6059 | let rmMouseUp;
|
6060 | let lastTouchEvent = 0;
|
6061 | const handleTouchStart = (ev) => {
|
6062 | lastTouchEvent = Date.now() + MOUSE_WAIT;
|
6063 | if (!pointerDown(ev)) {
|
6064 | return;
|
6065 | }
|
6066 | if (!rmTouchMove && pointerMove) {
|
6067 | rmTouchMove = addEventListener$1(el, 'touchmove', pointerMove, options);
|
6068 | }
|
6069 | |
6070 |
|
6071 |
|
6072 |
|
6073 |
|
6074 |
|
6075 |
|
6076 |
|
6077 |
|
6078 | if (!rmTouchEnd) {
|
6079 | rmTouchEnd = addEventListener$1(ev.target, 'touchend', handleTouchEnd, options);
|
6080 | }
|
6081 | if (!rmTouchCancel) {
|
6082 | rmTouchCancel = addEventListener$1(ev.target, 'touchcancel', handleTouchEnd, options);
|
6083 | }
|
6084 | };
|
6085 | const handleMouseDown = (ev) => {
|
6086 | if (lastTouchEvent > Date.now()) {
|
6087 | return;
|
6088 | }
|
6089 | if (!pointerDown(ev)) {
|
6090 | return;
|
6091 | }
|
6092 | if (!rmMouseMove && pointerMove) {
|
6093 | rmMouseMove = addEventListener$1(getDocument(el), 'mousemove', pointerMove, options);
|
6094 | }
|
6095 | if (!rmMouseUp) {
|
6096 | rmMouseUp = addEventListener$1(getDocument(el), 'mouseup', handleMouseUp, options);
|
6097 | }
|
6098 | };
|
6099 | const handleTouchEnd = (ev) => {
|
6100 | stopTouch();
|
6101 | if (pointerUp) {
|
6102 | pointerUp(ev);
|
6103 | }
|
6104 | };
|
6105 | const handleMouseUp = (ev) => {
|
6106 | stopMouse();
|
6107 | if (pointerUp) {
|
6108 | pointerUp(ev);
|
6109 | }
|
6110 | };
|
6111 | const stopTouch = () => {
|
6112 | if (rmTouchMove) {
|
6113 | rmTouchMove();
|
6114 | }
|
6115 | if (rmTouchEnd) {
|
6116 | rmTouchEnd();
|
6117 | }
|
6118 | if (rmTouchCancel) {
|
6119 | rmTouchCancel();
|
6120 | }
|
6121 | rmTouchMove = rmTouchEnd = rmTouchCancel = undefined;
|
6122 | };
|
6123 | const stopMouse = () => {
|
6124 | if (rmMouseMove) {
|
6125 | rmMouseMove();
|
6126 | }
|
6127 | if (rmMouseUp) {
|
6128 | rmMouseUp();
|
6129 | }
|
6130 | rmMouseMove = rmMouseUp = undefined;
|
6131 | };
|
6132 | const stop = () => {
|
6133 | stopTouch();
|
6134 | stopMouse();
|
6135 | };
|
6136 | const enable = (isEnabled = true) => {
|
6137 | if (!isEnabled) {
|
6138 | if (rmTouchStart) {
|
6139 | rmTouchStart();
|
6140 | }
|
6141 | if (rmMouseStart) {
|
6142 | rmMouseStart();
|
6143 | }
|
6144 | rmTouchStart = rmMouseStart = undefined;
|
6145 | stop();
|
6146 | }
|
6147 | else {
|
6148 | if (!rmTouchStart) {
|
6149 | rmTouchStart = addEventListener$1(el, 'touchstart', handleTouchStart, options);
|
6150 | }
|
6151 | if (!rmMouseStart) {
|
6152 | rmMouseStart = addEventListener$1(el, 'mousedown', handleMouseDown, options);
|
6153 | }
|
6154 | }
|
6155 | };
|
6156 | const destroy = () => {
|
6157 | enable(false);
|
6158 | pointerUp = pointerMove = pointerDown = undefined;
|
6159 | };
|
6160 | return {
|
6161 | enable,
|
6162 | stop,
|
6163 | destroy
|
6164 | };
|
6165 | };
|
6166 | const getDocument = (node) => {
|
6167 | return node instanceof Document ? node : node.ownerDocument;
|
6168 | };
|
6169 |
|
6170 | const createPanRecognizer = (direction, thresh, maxAngle) => {
|
6171 | const radians = maxAngle * (Math.PI / 180);
|
6172 | const isDirX = direction === 'x';
|
6173 | const maxCosine = Math.cos(radians);
|
6174 | const threshold = thresh * thresh;
|
6175 | let startX = 0;
|
6176 | let startY = 0;
|
6177 | let dirty = false;
|
6178 | let isPan = 0;
|
6179 | return {
|
6180 | start(x, y) {
|
6181 | startX = x;
|
6182 | startY = y;
|
6183 | isPan = 0;
|
6184 | dirty = true;
|
6185 | },
|
6186 | detect(x, y) {
|
6187 | if (!dirty) {
|
6188 | return false;
|
6189 | }
|
6190 | const deltaX = (x - startX);
|
6191 | const deltaY = (y - startY);
|
6192 | const distance = deltaX * deltaX + deltaY * deltaY;
|
6193 | if (distance < threshold) {
|
6194 | return false;
|
6195 | }
|
6196 | const hypotenuse = Math.sqrt(distance);
|
6197 | const cosine = (isDirX ? deltaX : deltaY) / hypotenuse;
|
6198 | if (cosine > maxCosine) {
|
6199 | isPan = 1;
|
6200 | }
|
6201 | else if (cosine < -maxCosine) {
|
6202 | isPan = -1;
|
6203 | }
|
6204 | else {
|
6205 | isPan = 0;
|
6206 | }
|
6207 | dirty = false;
|
6208 | return true;
|
6209 | },
|
6210 | isGesture() {
|
6211 | return isPan !== 0;
|
6212 | },
|
6213 | getDirection() {
|
6214 | return isPan;
|
6215 | }
|
6216 | };
|
6217 | };
|
6218 |
|
6219 | const createGesture = (config) => {
|
6220 | let hasCapturedPan = false;
|
6221 | let hasStartedPan = false;
|
6222 | let hasFiredStart = true;
|
6223 | let isMoveQueued = false;
|
6224 | const finalConfig = Object.assign({ disableScroll: false, direction: 'x', gesturePriority: 0, passive: true, maxAngle: 40, threshold: 10 }, config);
|
6225 | const canStart = finalConfig.canStart;
|
6226 | const onWillStart = finalConfig.onWillStart;
|
6227 | const onStart = finalConfig.onStart;
|
6228 | const onEnd = finalConfig.onEnd;
|
6229 | const notCaptured = finalConfig.notCaptured;
|
6230 | const onMove = finalConfig.onMove;
|
6231 | const threshold = finalConfig.threshold;
|
6232 | const passive = finalConfig.passive;
|
6233 | const blurOnStart = finalConfig.blurOnStart;
|
6234 | const detail = {
|
6235 | type: 'pan',
|
6236 | startX: 0,
|
6237 | startY: 0,
|
6238 | startTime: 0,
|
6239 | currentX: 0,
|
6240 | currentY: 0,
|
6241 | velocityX: 0,
|
6242 | velocityY: 0,
|
6243 | deltaX: 0,
|
6244 | deltaY: 0,
|
6245 | currentTime: 0,
|
6246 | event: undefined,
|
6247 | data: undefined
|
6248 | };
|
6249 | const pan = createPanRecognizer(finalConfig.direction, finalConfig.threshold, finalConfig.maxAngle);
|
6250 | const gesture = GESTURE_CONTROLLER.createGesture({
|
6251 | name: config.gestureName,
|
6252 | priority: config.gesturePriority,
|
6253 | disableScroll: config.disableScroll
|
6254 | });
|
6255 | const pointerDown = (ev) => {
|
6256 | const timeStamp = now(ev);
|
6257 | if (hasStartedPan || !hasFiredStart) {
|
6258 | return false;
|
6259 | }
|
6260 | updateDetail(ev, detail);
|
6261 | detail.startX = detail.currentX;
|
6262 | detail.startY = detail.currentY;
|
6263 | detail.startTime = detail.currentTime = timeStamp;
|
6264 | detail.velocityX = detail.velocityY = detail.deltaX = detail.deltaY = 0;
|
6265 | detail.event = ev;
|
6266 |
|
6267 | if (canStart && canStart(detail) === false) {
|
6268 | return false;
|
6269 | }
|
6270 |
|
6271 | gesture.release();
|
6272 |
|
6273 | if (!gesture.start()) {
|
6274 | return false;
|
6275 | }
|
6276 | hasStartedPan = true;
|
6277 | if (threshold === 0) {
|
6278 | return tryToCapturePan();
|
6279 | }
|
6280 | pan.start(detail.startX, detail.startY);
|
6281 | return true;
|
6282 | };
|
6283 | const pointerMove = (ev) => {
|
6284 |
|
6285 |
|
6286 | if (hasCapturedPan) {
|
6287 | if (!isMoveQueued && hasFiredStart) {
|
6288 | isMoveQueued = true;
|
6289 | calcGestureData(detail, ev);
|
6290 | requestAnimationFrame(fireOnMove);
|
6291 | }
|
6292 | return;
|
6293 | }
|
6294 |
|
6295 | calcGestureData(detail, ev);
|
6296 | if (pan.detect(detail.currentX, detail.currentY)) {
|
6297 | if (!pan.isGesture() || !tryToCapturePan()) {
|
6298 | abortGesture();
|
6299 | }
|
6300 | }
|
6301 | };
|
6302 | const fireOnMove = () => {
|
6303 |
|
6304 |
|
6305 | if (!hasCapturedPan) {
|
6306 | return;
|
6307 | }
|
6308 | isMoveQueued = false;
|
6309 | if (onMove) {
|
6310 | onMove(detail);
|
6311 | }
|
6312 | };
|
6313 | const tryToCapturePan = () => {
|
6314 | if (gesture && !gesture.capture()) {
|
6315 | return false;
|
6316 | }
|
6317 | hasCapturedPan = true;
|
6318 | hasFiredStart = false;
|
6319 |
|
6320 |
|
6321 |
|
6322 |
|
6323 |
|
6324 |
|
6325 | detail.startX = detail.currentX;
|
6326 | detail.startY = detail.currentY;
|
6327 | detail.startTime = detail.currentTime;
|
6328 | if (onWillStart) {
|
6329 | onWillStart(detail).then(fireOnStart);
|
6330 | }
|
6331 | else {
|
6332 | fireOnStart();
|
6333 | }
|
6334 | return true;
|
6335 | };
|
6336 | const blurActiveElement = () => {
|
6337 |
|
6338 | if (typeof document !== 'undefined') {
|
6339 | const activeElement = document.activeElement;
|
6340 | if (activeElement !== null && activeElement.blur) {
|
6341 | activeElement.blur();
|
6342 | }
|
6343 | }
|
6344 | };
|
6345 | const fireOnStart = () => {
|
6346 | if (blurOnStart) {
|
6347 | blurActiveElement();
|
6348 | }
|
6349 | if (onStart) {
|
6350 | onStart(detail);
|
6351 | }
|
6352 | hasFiredStart = true;
|
6353 | };
|
6354 | const reset = () => {
|
6355 | hasCapturedPan = false;
|
6356 | hasStartedPan = false;
|
6357 | isMoveQueued = false;
|
6358 | hasFiredStart = true;
|
6359 | gesture.release();
|
6360 | };
|
6361 |
|
6362 | const pointerUp = (ev) => {
|
6363 | const tmpHasCaptured = hasCapturedPan;
|
6364 | const tmpHasFiredStart = hasFiredStart;
|
6365 | reset();
|
6366 | if (!tmpHasFiredStart) {
|
6367 | return;
|
6368 | }
|
6369 | calcGestureData(detail, ev);
|
6370 |
|
6371 | if (tmpHasCaptured) {
|
6372 | if (onEnd) {
|
6373 | onEnd(detail);
|
6374 | }
|
6375 | return;
|
6376 | }
|
6377 |
|
6378 | if (notCaptured) {
|
6379 | notCaptured(detail);
|
6380 | }
|
6381 | };
|
6382 | const pointerEvents = createPointerEvents(finalConfig.el, pointerDown, pointerMove, pointerUp, {
|
6383 | capture: false,
|
6384 | passive
|
6385 | });
|
6386 | const abortGesture = () => {
|
6387 | reset();
|
6388 | pointerEvents.stop();
|
6389 | if (notCaptured) {
|
6390 | notCaptured(detail);
|
6391 | }
|
6392 | };
|
6393 | return {
|
6394 | enable(enable = true) {
|
6395 | if (!enable) {
|
6396 | if (hasCapturedPan) {
|
6397 | pointerUp(undefined);
|
6398 | }
|
6399 | reset();
|
6400 | }
|
6401 | pointerEvents.enable(enable);
|
6402 | },
|
6403 | destroy() {
|
6404 | gesture.destroy();
|
6405 | pointerEvents.destroy();
|
6406 | }
|
6407 | };
|
6408 | };
|
6409 | const calcGestureData = (detail, ev) => {
|
6410 | if (!ev) {
|
6411 | return;
|
6412 | }
|
6413 | const prevX = detail.currentX;
|
6414 | const prevY = detail.currentY;
|
6415 | const prevT = detail.currentTime;
|
6416 | updateDetail(ev, detail);
|
6417 | const currentX = detail.currentX;
|
6418 | const currentY = detail.currentY;
|
6419 | const timestamp = detail.currentTime = now(ev);
|
6420 | const timeDelta = timestamp - prevT;
|
6421 | if (timeDelta > 0 && timeDelta < 100) {
|
6422 | const velocityX = (currentX - prevX) / timeDelta;
|
6423 | const velocityY = (currentY - prevY) / timeDelta;
|
6424 | detail.velocityX = velocityX * 0.7 + detail.velocityX * 0.3;
|
6425 | detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3;
|
6426 | }
|
6427 | detail.deltaX = currentX - detail.startX;
|
6428 | detail.deltaY = currentY - detail.startY;
|
6429 | detail.event = ev;
|
6430 | };
|
6431 | const updateDetail = (ev, detail) => {
|
6432 |
|
6433 |
|
6434 | let x = 0;
|
6435 | let y = 0;
|
6436 | if (ev) {
|
6437 | const changedTouches = ev.changedTouches;
|
6438 | if (changedTouches && changedTouches.length > 0) {
|
6439 | const touch = changedTouches[0];
|
6440 | x = touch.clientX;
|
6441 | y = touch.clientY;
|
6442 | }
|
6443 | else if (ev.pageX !== undefined) {
|
6444 | x = ev.pageX;
|
6445 | y = ev.pageY;
|
6446 | }
|
6447 | }
|
6448 | detail.currentX = x;
|
6449 | detail.currentY = y;
|
6450 | };
|
6451 | const now = (ev) => {
|
6452 | return ev.timeStamp || Date.now();
|
6453 | };
|
6454 |
|
6455 | var index$1 = Object.freeze({
|
6456 | __proto__: null,
|
6457 | createGesture: createGesture,
|
6458 | GESTURE_CONTROLLER: GESTURE_CONTROLLER
|
6459 | });
|
6460 |
|
6461 | const createButtonActiveGesture = (el, isButton) => {
|
6462 | let currentTouchedButton;
|
6463 | let initialTouchedButton;
|
6464 | const activateButtonAtPoint = (x, y, hapticFeedbackFn) => {
|
6465 | if (typeof document === 'undefined') {
|
6466 | return;
|
6467 | }
|
6468 | const target = document.elementFromPoint(x, y);
|
6469 | if (!target || !isButton(target)) {
|
6470 | clearActiveButton();
|
6471 | return;
|
6472 | }
|
6473 | if (target !== currentTouchedButton) {
|
6474 | clearActiveButton();
|
6475 | setActiveButton(target, hapticFeedbackFn);
|
6476 | }
|
6477 | };
|
6478 | const setActiveButton = (button, hapticFeedbackFn) => {
|
6479 | currentTouchedButton = button;
|
6480 | if (!initialTouchedButton) {
|
6481 | initialTouchedButton = currentTouchedButton;
|
6482 | }
|
6483 | const buttonToModify = currentTouchedButton;
|
6484 | writeTask(() => buttonToModify.classList.add('ion-activated'));
|
6485 | hapticFeedbackFn();
|
6486 | };
|
6487 | const clearActiveButton = (dispatchClick = false) => {
|
6488 | if (!currentTouchedButton) {
|
6489 | return;
|
6490 | }
|
6491 | const buttonToModify = currentTouchedButton;
|
6492 | writeTask(() => buttonToModify.classList.remove('ion-activated'));
|
6493 | |
6494 |
|
6495 |
|
6496 |
|
6497 |
|
6498 |
|
6499 |
|
6500 |
|
6501 | if (dispatchClick && initialTouchedButton !== currentTouchedButton) {
|
6502 | currentTouchedButton.click();
|
6503 | }
|
6504 | currentTouchedButton = undefined;
|
6505 | };
|
6506 | return createGesture({
|
6507 | el,
|
6508 | gestureName: 'buttonActiveDrag',
|
6509 | threshold: 0,
|
6510 | onStart: ev => activateButtonAtPoint(ev.currentX, ev.currentY, hapticSelectionStart),
|
6511 | onMove: ev => activateButtonAtPoint(ev.currentX, ev.currentY, hapticSelectionChanged),
|
6512 | onEnd: () => {
|
6513 | clearActiveButton(true);
|
6514 | hapticSelectionEnd();
|
6515 | initialTouchedButton = undefined;
|
6516 | }
|
6517 | });
|
6518 | };
|
6519 |
|
6520 |
|
6521 |
|
6522 |
|
6523 |
|
6524 |
|
6525 |
|
6526 |
|
6527 |
|
6528 |
|
6529 |
|
6530 | const OVERLAY_BACK_BUTTON_PRIORITY = 100;
|
6531 | const MENU_BACK_BUTTON_PRIORITY = 99;
|
6532 |
|
6533 |
|
6534 |
|
6535 |
|
6536 |
|
6537 |
|
6538 |
|
6539 |
|
6540 |
|
6541 |
|
6542 |
|
6543 |
|
6544 |
|
6545 | const componentOnReady = (el, callback) => {
|
6546 | if (el.componentOnReady) {
|
6547 | el.componentOnReady().then((resolvedEl) => callback(resolvedEl));
|
6548 | }
|
6549 | else {
|
6550 | raf(() => callback(el));
|
6551 | }
|
6552 | };
|
6553 |
|
6554 |
|
6555 |
|
6556 |
|
6557 |
|
6558 |
|
6559 |
|
6560 |
|
6561 |
|
6562 |
|
6563 | const inheritAttributes = (el, attributes = []) => {
|
6564 | const attributeObject = {};
|
6565 | attributes.forEach(attr => {
|
6566 | if (el.hasAttribute(attr)) {
|
6567 | const value = el.getAttribute(attr);
|
6568 | if (value !== null) {
|
6569 | attributeObject[attr] = el.getAttribute(attr);
|
6570 | }
|
6571 | el.removeAttribute(attr);
|
6572 | }
|
6573 | });
|
6574 | return attributeObject;
|
6575 | };
|
6576 | const addEventListener = (el, eventName, callback, opts) => {
|
6577 | if (typeof window !== 'undefined') {
|
6578 | const win = window;
|
6579 | const config = win && win.Ionic && win.Ionic.config;
|
6580 | if (config) {
|
6581 | const ael = config.get('_ael');
|
6582 | if (ael) {
|
6583 | return ael(el, eventName, callback, opts);
|
6584 | }
|
6585 | else if (config._ael) {
|
6586 | return config._ael(el, eventName, callback, opts);
|
6587 | }
|
6588 | }
|
6589 | }
|
6590 | return el.addEventListener(eventName, callback, opts);
|
6591 | };
|
6592 | const removeEventListener = (el, eventName, callback, opts) => {
|
6593 | if (typeof window !== 'undefined') {
|
6594 | const win = window;
|
6595 | const config = win && win.Ionic && win.Ionic.config;
|
6596 | if (config) {
|
6597 | const rel = config.get('_rel');
|
6598 | if (rel) {
|
6599 | return rel(el, eventName, callback, opts);
|
6600 | }
|
6601 | else if (config._rel) {
|
6602 | return config._rel(el, eventName, callback, opts);
|
6603 | }
|
6604 | }
|
6605 | }
|
6606 | return el.removeEventListener(eventName, callback, opts);
|
6607 | };
|
6608 |
|
6609 |
|
6610 |
|
6611 |
|
6612 |
|
6613 |
|
6614 |
|
6615 |
|
6616 |
|
6617 | const getElementRoot = (el, fallback = el) => {
|
6618 | return el.shadowRoot || fallback;
|
6619 | };
|
6620 |
|
6621 |
|
6622 |
|
6623 |
|
6624 | const raf = (h) => {
|
6625 | if (typeof __zone_symbol__requestAnimationFrame === 'function') {
|
6626 | return __zone_symbol__requestAnimationFrame(h);
|
6627 | }
|
6628 | if (typeof requestAnimationFrame === 'function') {
|
6629 | return requestAnimationFrame(h);
|
6630 | }
|
6631 | return setTimeout(h);
|
6632 | };
|
6633 | const hasShadowDom = (el) => {
|
6634 | return !!el.shadowRoot && !!el.attachShadow;
|
6635 | };
|
6636 | const findItemLabel = (componentEl) => {
|
6637 | const itemEl = componentEl.closest('ion-item');
|
6638 | if (itemEl) {
|
6639 | return itemEl.querySelector('ion-label');
|
6640 | }
|
6641 | return null;
|
6642 | };
|
6643 |
|
6644 |
|
6645 |
|
6646 |
|
6647 |
|
6648 |
|
6649 |
|
6650 |
|
6651 |
|
6652 |
|
6653 |
|
6654 |
|
6655 |
|
6656 | const getAriaLabel = (componentEl, inputId) => {
|
6657 | let labelText;
|
6658 |
|
6659 |
|
6660 | const labelledBy = componentEl.getAttribute('aria-labelledby');
|
6661 |
|
6662 |
|
6663 | const componentId = componentEl.id;
|
6664 | let labelId = labelledBy !== null && labelledBy.trim() !== ''
|
6665 | ? labelledBy
|
6666 | : inputId + '-lbl';
|
6667 | let label = labelledBy !== null && labelledBy.trim() !== ''
|
6668 | ? document.getElementById(labelledBy)
|
6669 | : findItemLabel(componentEl);
|
6670 | if (label) {
|
6671 | if (labelledBy === null) {
|
6672 | label.id = labelId;
|
6673 | }
|
6674 | labelText = label.textContent;
|
6675 | label.setAttribute('aria-hidden', 'true');
|
6676 |
|
6677 |
|
6678 | }
|
6679 | else if (componentId.trim() !== '') {
|
6680 | label = document.querySelector(`label[for="${componentId}"]`);
|
6681 | if (label) {
|
6682 | if (label.id !== '') {
|
6683 | labelId = label.id;
|
6684 | }
|
6685 | else {
|
6686 | label.id = labelId = `${componentId}-lbl`;
|
6687 | }
|
6688 | labelText = label.textContent;
|
6689 | }
|
6690 | }
|
6691 | return { label, labelId, labelText };
|
6692 | };
|
6693 |
|
6694 |
|
6695 |
|
6696 |
|
6697 |
|
6698 |
|
6699 |
|
6700 |
|
6701 |
|
6702 |
|
6703 |
|
6704 |
|
6705 | const renderHiddenInput = (always, container, name, value, disabled) => {
|
6706 | if (always || hasShadowDom(container)) {
|
6707 | let input = container.querySelector('input.aux-input');
|
6708 | if (!input) {
|
6709 | input = container.ownerDocument.createElement('input');
|
6710 | input.type = 'hidden';
|
6711 | input.classList.add('aux-input');
|
6712 | container.appendChild(input);
|
6713 | }
|
6714 | input.disabled = disabled;
|
6715 | input.name = name;
|
6716 | input.value = value || '';
|
6717 | }
|
6718 | };
|
6719 | const clamp = (min, n, max) => {
|
6720 | return Math.max(min, Math.min(n, max));
|
6721 | };
|
6722 | const assert = (actual, reason) => {
|
6723 | if (!actual) {
|
6724 | const message = 'ASSERT: ' + reason;
|
6725 | console.error(message);
|
6726 | debugger;
|
6727 | throw new Error(message);
|
6728 | }
|
6729 | };
|
6730 | const pointerCoord = (ev) => {
|
6731 |
|
6732 |
|
6733 | if (ev) {
|
6734 | const changedTouches = ev.changedTouches;
|
6735 | if (changedTouches && changedTouches.length > 0) {
|
6736 | const touch = changedTouches[0];
|
6737 | return { x: touch.clientX, y: touch.clientY };
|
6738 | }
|
6739 | if (ev.pageX !== undefined) {
|
6740 | return { x: ev.pageX, y: ev.pageY };
|
6741 | }
|
6742 | }
|
6743 | return { x: 0, y: 0 };
|
6744 | };
|
6745 |
|
6746 |
|
6747 |
|
6748 |
|
6749 |
|
6750 |
|
6751 |
|
6752 | const isEndSide = (side) => {
|
6753 | const isRTL = document.dir === 'rtl';
|
6754 | switch (side) {
|
6755 | case 'start': return isRTL;
|
6756 | case 'end': return !isRTL;
|
6757 | default:
|
6758 | throw new Error(`"${side}" is not a valid value for [side]. Use "start" or "end" instead.`);
|
6759 | }
|
6760 | };
|
6761 | const debounceEvent = (event, wait) => {
|
6762 | const original = event._original || event;
|
6763 | return {
|
6764 | _original: event,
|
6765 | emit: debounce(original.emit.bind(original), wait)
|
6766 | };
|
6767 | };
|
6768 | const debounce = (func, wait = 0) => {
|
6769 | let timer;
|
6770 | return (...args) => {
|
6771 | clearTimeout(timer);
|
6772 | timer = setTimeout(func, wait, ...args);
|
6773 | };
|
6774 | };
|
6775 |
|
6776 | let lastId = 0;
|
6777 | const activeAnimations = new WeakMap();
|
6778 | const createController = (tagName) => {
|
6779 | return {
|
6780 | create(options) {
|
6781 | return createOverlay(tagName, options);
|
6782 | },
|
6783 | dismiss(data, role, id) {
|
6784 | return dismissOverlay(document, data, role, tagName, id);
|
6785 | },
|
6786 | async getTop() {
|
6787 | return getOverlay(document, tagName);
|
6788 | }
|
6789 | };
|
6790 | };
|
6791 | const alertController = createController('ion-alert');
|
6792 | const actionSheetController = createController('ion-action-sheet');
|
6793 | const pickerController = createController('ion-picker');
|
6794 | const popoverController = createController('ion-popover');
|
6795 | const prepareOverlay = (el) => {
|
6796 |
|
6797 | if (typeof document !== 'undefined') {
|
6798 | connectListeners(document);
|
6799 | }
|
6800 | const overlayIndex = lastId++;
|
6801 | el.overlayIndex = overlayIndex;
|
6802 | if (!el.hasAttribute('id')) {
|
6803 | el.id = `ion-overlay-${overlayIndex}`;
|
6804 | }
|
6805 | };
|
6806 | const createOverlay = (tagName, opts) => {
|
6807 |
|
6808 | if (typeof customElements !== 'undefined') {
|
6809 | return customElements.whenDefined(tagName).then(() => {
|
6810 | const element = document.createElement(tagName);
|
6811 | element.classList.add('overlay-hidden');
|
6812 |
|
6813 |
|
6814 | Object.assign(element, opts);
|
6815 |
|
6816 | getAppRoot(document).appendChild(element);
|
6817 | return new Promise(resolve => componentOnReady(element, resolve));
|
6818 | });
|
6819 | }
|
6820 | return Promise.resolve();
|
6821 | };
|
6822 | const focusableQueryString = '[tabindex]:not([tabindex^="-"]), input:not([type=hidden]):not([tabindex^="-"]), textarea:not([tabindex^="-"]), button:not([tabindex^="-"]), select:not([tabindex^="-"]), .ion-focusable:not([tabindex^="-"])';
|
6823 | const innerFocusableQueryString = 'input:not([type=hidden]), textarea, button, select';
|
6824 | const focusFirstDescendant = (ref, overlay) => {
|
6825 | let firstInput = ref.querySelector(focusableQueryString);
|
6826 | const shadowRoot = firstInput && firstInput.shadowRoot;
|
6827 | if (shadowRoot) {
|
6828 |
|
6829 | firstInput = shadowRoot.querySelector(innerFocusableQueryString) || firstInput;
|
6830 | }
|
6831 | if (firstInput) {
|
6832 | firstInput.focus();
|
6833 | }
|
6834 | else {
|
6835 |
|
6836 | overlay.focus();
|
6837 | }
|
6838 | };
|
6839 | const focusLastDescendant = (ref, overlay) => {
|
6840 | const inputs = Array.from(ref.querySelectorAll(focusableQueryString));
|
6841 | let lastInput = inputs.length > 0 ? inputs[inputs.length - 1] : null;
|
6842 | const shadowRoot = lastInput && lastInput.shadowRoot;
|
6843 | if (shadowRoot) {
|
6844 |
|
6845 | lastInput = shadowRoot.querySelector(innerFocusableQueryString) || lastInput;
|
6846 | }
|
6847 | if (lastInput) {
|
6848 | lastInput.focus();
|
6849 | }
|
6850 | else {
|
6851 |
|
6852 | overlay.focus();
|
6853 | }
|
6854 | };
|
6855 |
|
6856 |
|
6857 |
|
6858 |
|
6859 |
|
6860 |
|
6861 |
|
6862 | const trapKeyboardFocus = (ev, doc) => {
|
6863 | const lastOverlay = getOverlay(doc);
|
6864 | const target = ev.target;
|
6865 |
|
6866 | if (!lastOverlay || !target) {
|
6867 | return;
|
6868 | }
|
6869 | |
6870 |
|
6871 |
|
6872 |
|
6873 |
|
6874 |
|
6875 | if (lastOverlay === target) {
|
6876 | lastOverlay.lastFocus = undefined;
|
6877 | |
6878 |
|
6879 |
|
6880 |
|
6881 |
|
6882 |
|
6883 |
|
6884 |
|
6885 | }
|
6886 | else {
|
6887 | |
6888 |
|
6889 |
|
6890 |
|
6891 | const overlayRoot = getElementRoot(lastOverlay);
|
6892 | if (!overlayRoot.contains(target)) {
|
6893 | return;
|
6894 | }
|
6895 | const overlayWrapper = overlayRoot.querySelector('.ion-overlay-wrapper');
|
6896 | if (!overlayWrapper) {
|
6897 | return;
|
6898 | }
|
6899 | |
6900 |
|
6901 |
|
6902 |
|
6903 | if (overlayWrapper.contains(target)) {
|
6904 | lastOverlay.lastFocus = target;
|
6905 | }
|
6906 | else {
|
6907 | |
6908 |
|
6909 |
|
6910 |
|
6911 |
|
6912 | |
6913 |
|
6914 |
|
6915 |
|
6916 |
|
6917 |
|
6918 |
|
6919 | const lastFocus = lastOverlay.lastFocus;
|
6920 |
|
6921 | focusFirstDescendant(overlayWrapper, lastOverlay);
|
6922 | |
6923 |
|
6924 |
|
6925 |
|
6926 |
|
6927 |
|
6928 |
|
6929 |
|
6930 |
|
6931 | if (lastFocus === doc.activeElement) {
|
6932 | focusLastDescendant(overlayWrapper, lastOverlay);
|
6933 | }
|
6934 | lastOverlay.lastFocus = doc.activeElement;
|
6935 | }
|
6936 | }
|
6937 | };
|
6938 | const connectListeners = (doc) => {
|
6939 | if (lastId === 0) {
|
6940 | lastId = 1;
|
6941 | doc.addEventListener('focus', ev => trapKeyboardFocus(ev, doc), true);
|
6942 |
|
6943 | doc.addEventListener('ionBackButton', ev => {
|
6944 | const lastOverlay = getOverlay(doc);
|
6945 | if (lastOverlay && lastOverlay.backdropDismiss) {
|
6946 | ev.detail.register(OVERLAY_BACK_BUTTON_PRIORITY, () => {
|
6947 | return lastOverlay.dismiss(undefined, BACKDROP);
|
6948 | });
|
6949 | }
|
6950 | });
|
6951 |
|
6952 | doc.addEventListener('keyup', ev => {
|
6953 | if (ev.key === 'Escape') {
|
6954 | const lastOverlay = getOverlay(doc);
|
6955 | if (lastOverlay && lastOverlay.backdropDismiss) {
|
6956 | lastOverlay.dismiss(undefined, BACKDROP);
|
6957 | }
|
6958 | }
|
6959 | });
|
6960 | }
|
6961 | };
|
6962 | const dismissOverlay = (doc, data, role, overlayTag, id) => {
|
6963 | const overlay = getOverlay(doc, overlayTag, id);
|
6964 | if (!overlay) {
|
6965 | return Promise.reject('overlay does not exist');
|
6966 | }
|
6967 | return overlay.dismiss(data, role);
|
6968 | };
|
6969 | const getOverlays = (doc, selector) => {
|
6970 | if (selector === undefined) {
|
6971 | selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker,ion-popover,ion-toast';
|
6972 | }
|
6973 | return Array.from(doc.querySelectorAll(selector))
|
6974 | .filter(c => c.overlayIndex > 0);
|
6975 | };
|
6976 | const getOverlay = (doc, overlayTag, id) => {
|
6977 | const overlays = getOverlays(doc, overlayTag);
|
6978 | return (id === undefined)
|
6979 | ? overlays[overlays.length - 1]
|
6980 | : overlays.find(o => o.id === id);
|
6981 | };
|
6982 |
|
6983 |
|
6984 |
|
6985 |
|
6986 |
|
6987 |
|
6988 |
|
6989 |
|
6990 |
|
6991 |
|
6992 |
|
6993 |
|
6994 |
|
6995 |
|
6996 |
|
6997 |
|
6998 |
|
6999 |
|
7000 |
|
7001 |
|
7002 |
|
7003 |
|
7004 | const setRootAriaHidden = (hidden = false) => {
|
7005 | const root = getAppRoot(document);
|
7006 | const viewContainer = root.querySelector('ion-router-outlet, ion-nav, #ion-view-container-root');
|
7007 | if (!viewContainer) {
|
7008 | return;
|
7009 | }
|
7010 | if (hidden) {
|
7011 | viewContainer.setAttribute('aria-hidden', 'true');
|
7012 | }
|
7013 | else {
|
7014 | viewContainer.removeAttribute('aria-hidden');
|
7015 | }
|
7016 | };
|
7017 | const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {
|
7018 | if (overlay.presented) {
|
7019 | return;
|
7020 | }
|
7021 | setRootAriaHidden(true);
|
7022 | overlay.presented = true;
|
7023 | overlay.willPresent.emit();
|
7024 | const mode = getIonMode$1(overlay);
|
7025 |
|
7026 | const animationBuilder = (overlay.enterAnimation)
|
7027 | ? overlay.enterAnimation
|
7028 | : config.get(name, mode === 'ios' ? iosEnterAnimation : mdEnterAnimation);
|
7029 | const completed = await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
7030 | if (completed) {
|
7031 | overlay.didPresent.emit();
|
7032 | }
|
7033 | |
7034 |
|
7035 |
|
7036 |
|
7037 |
|
7038 |
|
7039 |
|
7040 |
|
7041 | if (overlay.el.tagName !== 'ION-TOAST') {
|
7042 | focusPreviousElementOnDismiss(overlay.el);
|
7043 | }
|
7044 | if (overlay.keyboardClose) {
|
7045 | overlay.el.focus();
|
7046 | }
|
7047 | };
|
7048 |
|
7049 |
|
7050 |
|
7051 |
|
7052 |
|
7053 |
|
7054 |
|
7055 |
|
7056 |
|
7057 |
|
7058 | const focusPreviousElementOnDismiss = async (overlayEl) => {
|
7059 | let previousElement = document.activeElement;
|
7060 | if (!previousElement) {
|
7061 | return;
|
7062 | }
|
7063 | const shadowRoot = previousElement && previousElement.shadowRoot;
|
7064 | if (shadowRoot) {
|
7065 |
|
7066 | previousElement = shadowRoot.querySelector(innerFocusableQueryString) || previousElement;
|
7067 | }
|
7068 | await overlayEl.onDidDismiss();
|
7069 | previousElement.focus();
|
7070 | };
|
7071 | const dismiss = async (overlay, data, role, name, iosLeaveAnimation, mdLeaveAnimation, opts) => {
|
7072 | if (!overlay.presented) {
|
7073 | return false;
|
7074 | }
|
7075 | setRootAriaHidden(false);
|
7076 | overlay.presented = false;
|
7077 | try {
|
7078 |
|
7079 | overlay.el.style.setProperty('pointer-events', 'none');
|
7080 | overlay.willDismiss.emit({ data, role });
|
7081 | const mode = getIonMode$1(overlay);
|
7082 | const animationBuilder = (overlay.leaveAnimation)
|
7083 | ? overlay.leaveAnimation
|
7084 | : config.get(name, mode === 'ios' ? iosLeaveAnimation : mdLeaveAnimation);
|
7085 |
|
7086 | if (role !== 'gesture') {
|
7087 | await overlayAnimation(overlay, animationBuilder, overlay.el, opts);
|
7088 | }
|
7089 | overlay.didDismiss.emit({ data, role });
|
7090 | activeAnimations.delete(overlay);
|
7091 | }
|
7092 | catch (err) {
|
7093 | console.error(err);
|
7094 | }
|
7095 | overlay.el.remove();
|
7096 | return true;
|
7097 | };
|
7098 | const getAppRoot = (doc) => {
|
7099 | return doc.querySelector('ion-app') || doc.body;
|
7100 | };
|
7101 | const overlayAnimation = async (overlay, animationBuilder, baseEl, opts) => {
|
7102 |
|
7103 | baseEl.classList.remove('overlay-hidden');
|
7104 | const aniRoot = baseEl.shadowRoot || overlay.el;
|
7105 | const animation = animationBuilder(aniRoot, opts);
|
7106 | if (!overlay.animated || !config.getBoolean('animated', true)) {
|
7107 | animation.duration(0);
|
7108 | }
|
7109 | if (overlay.keyboardClose) {
|
7110 | animation.beforeAddWrite(() => {
|
7111 | const activeElement = baseEl.ownerDocument.activeElement;
|
7112 | if (activeElement && activeElement.matches('input, ion-input, ion-textarea')) {
|
7113 | activeElement.blur();
|
7114 | }
|
7115 | });
|
7116 | }
|
7117 | const activeAni = activeAnimations.get(overlay) || [];
|
7118 | activeAnimations.set(overlay, [...activeAni, animation]);
|
7119 | await animation.play();
|
7120 | return true;
|
7121 | };
|
7122 | const eventMethod = (element, eventName) => {
|
7123 | let resolve;
|
7124 | const promise = new Promise(r => resolve = r);
|
7125 | onceEvent(element, eventName, (event) => {
|
7126 | resolve(event.detail);
|
7127 | });
|
7128 | return promise;
|
7129 | };
|
7130 | const onceEvent = (element, eventName, callback) => {
|
7131 | const handler = (ev) => {
|
7132 | removeEventListener(element, eventName, handler);
|
7133 | callback(ev);
|
7134 | };
|
7135 | addEventListener(element, eventName, handler);
|
7136 | };
|
7137 | const isCancel = (role) => {
|
7138 | return role === 'cancel' || role === BACKDROP;
|
7139 | };
|
7140 | const defaultGate = (h) => h();
|
7141 | const safeCall = (handler, arg) => {
|
7142 | if (typeof handler === 'function') {
|
7143 | const jmp = config.get('_zoneGate', defaultGate);
|
7144 | return jmp(() => {
|
7145 | try {
|
7146 | return handler(arg);
|
7147 | }
|
7148 | catch (e) {
|
7149 | console.error(e);
|
7150 | }
|
7151 | });
|
7152 | }
|
7153 | return undefined;
|
7154 | };
|
7155 | const BACKDROP = 'backdrop';
|
7156 |
|
7157 | const hostContext = (selector, el) => {
|
7158 | return el.closest(selector) !== null;
|
7159 | };
|
7160 |
|
7161 |
|
7162 |
|
7163 | const createColorClasses$1 = (color, cssClassMap) => {
|
7164 | return (typeof color === 'string' && color.length > 0) ? Object.assign({ 'ion-color': true, [`ion-color-${color}`]: true }, cssClassMap) : cssClassMap;
|
7165 | };
|
7166 | const getClassList = (classes) => {
|
7167 | if (classes !== undefined) {
|
7168 | const array = Array.isArray(classes) ? classes : classes.split(' ');
|
7169 | return array
|
7170 | .filter(c => c != null)
|
7171 | .map(c => c.trim())
|
7172 | .filter(c => c !== '');
|
7173 | }
|
7174 | return [];
|
7175 | };
|
7176 | const getClassMap = (classes) => {
|
7177 | const map = {};
|
7178 | getClassList(classes).forEach(c => map[c] = true);
|
7179 | return map;
|
7180 | };
|
7181 | const SCHEME = /^[a-z][a-z0-9+\-.]*:/;
|
7182 | const openURL = async (url, ev, direction, animation) => {
|
7183 | if (url != null && url[0] !== '#' && !SCHEME.test(url)) {
|
7184 | const router = document.querySelector('ion-router');
|
7185 | if (router) {
|
7186 | if (ev != null) {
|
7187 | ev.preventDefault();
|
7188 | }
|
7189 | return router.push(url, direction, animation);
|
7190 | }
|
7191 | }
|
7192 | return false;
|
7193 | };
|
7194 |
|
7195 | let animationPrefix;
|
7196 |
|
7197 |
|
7198 |
|
7199 |
|
7200 | const processKeyframes = (keyframes) => {
|
7201 | keyframes.forEach(keyframe => {
|
7202 | for (const key in keyframe) {
|
7203 | if (keyframe.hasOwnProperty(key)) {
|
7204 | const value = keyframe[key];
|
7205 | if (key === 'easing') {
|
7206 | const newKey = 'animation-timing-function';
|
7207 | keyframe[newKey] = value;
|
7208 | delete keyframe[key];
|
7209 | }
|
7210 | else {
|
7211 | const newKey = convertCamelCaseToHypen(key);
|
7212 | if (newKey !== key) {
|
7213 | keyframe[newKey] = value;
|
7214 | delete keyframe[key];
|
7215 | }
|
7216 | }
|
7217 | }
|
7218 | }
|
7219 | });
|
7220 | return keyframes;
|
7221 | };
|
7222 | const convertCamelCaseToHypen = (str) => {
|
7223 | return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
7224 | };
|
7225 | const getAnimationPrefix = (el) => {
|
7226 | if (animationPrefix === undefined) {
|
7227 | const supportsUnprefixed = el.style.animationName !== undefined;
|
7228 | const supportsWebkitPrefix = el.style.webkitAnimationName !== undefined;
|
7229 | animationPrefix = (!supportsUnprefixed && supportsWebkitPrefix) ? '-webkit-' : '';
|
7230 | }
|
7231 | return animationPrefix;
|
7232 | };
|
7233 | const setStyleProperty = (element, propertyName, value) => {
|
7234 | const prefix = propertyName.startsWith('animation') ? getAnimationPrefix(element) : '';
|
7235 | element.style.setProperty(prefix + propertyName, value);
|
7236 | };
|
7237 | const removeStyleProperty = (element, propertyName) => {
|
7238 | const prefix = propertyName.startsWith('animation') ? getAnimationPrefix(element) : '';
|
7239 | element.style.removeProperty(prefix + propertyName);
|
7240 | };
|
7241 | const animationEnd = (el, callback) => {
|
7242 | let unRegTrans;
|
7243 | const opts = { passive: true };
|
7244 | const unregister = () => {
|
7245 | if (unRegTrans) {
|
7246 | unRegTrans();
|
7247 | }
|
7248 | };
|
7249 | const onTransitionEnd = (ev) => {
|
7250 | if (el === ev.target) {
|
7251 | unregister();
|
7252 | callback(ev);
|
7253 | }
|
7254 | };
|
7255 | if (el) {
|
7256 | el.addEventListener('webkitAnimationEnd', onTransitionEnd, opts);
|
7257 | el.addEventListener('animationend', onTransitionEnd, opts);
|
7258 | unRegTrans = () => {
|
7259 | el.removeEventListener('webkitAnimationEnd', onTransitionEnd, opts);
|
7260 | el.removeEventListener('animationend', onTransitionEnd, opts);
|
7261 | };
|
7262 | }
|
7263 | return unregister;
|
7264 | };
|
7265 | const generateKeyframeRules = (keyframes = []) => {
|
7266 | return keyframes.map(keyframe => {
|
7267 | const offset = keyframe.offset;
|
7268 | const frameString = [];
|
7269 | for (const property in keyframe) {
|
7270 | if (keyframe.hasOwnProperty(property) && property !== 'offset') {
|
7271 | frameString.push(`${property}: ${keyframe[property]};`);
|
7272 | }
|
7273 | }
|
7274 | return `${offset * 100}% { ${frameString.join(' ')} }`;
|
7275 | }).join(' ');
|
7276 | };
|
7277 | const keyframeIds = [];
|
7278 | const generateKeyframeName = (keyframeRules) => {
|
7279 | let index = keyframeIds.indexOf(keyframeRules);
|
7280 | if (index < 0) {
|
7281 | index = (keyframeIds.push(keyframeRules) - 1);
|
7282 | }
|
7283 | return `ion-animation-${index}`;
|
7284 | };
|
7285 | const getStyleContainer = (element) => {
|
7286 | const rootNode = element.getRootNode();
|
7287 | return (rootNode.head || rootNode);
|
7288 | };
|
7289 | const createKeyframeStylesheet = (keyframeName, keyframeRules, element) => {
|
7290 | const styleContainer = getStyleContainer(element);
|
7291 | const keyframePrefix = getAnimationPrefix(element);
|
7292 | const existingStylesheet = styleContainer.querySelector('#' + keyframeName);
|
7293 | if (existingStylesheet) {
|
7294 | return existingStylesheet;
|
7295 | }
|
7296 | const stylesheet = (element.ownerDocument || document).createElement('style');
|
7297 | stylesheet.id = keyframeName;
|
7298 | stylesheet.textContent = `@${keyframePrefix}keyframes ${keyframeName} { ${keyframeRules} } @${keyframePrefix}keyframes ${keyframeName}-alt { ${keyframeRules} }`;
|
7299 | styleContainer.appendChild(stylesheet);
|
7300 | return stylesheet;
|
7301 | };
|
7302 | const addClassToArray = (classes = [], className) => {
|
7303 | if (className !== undefined) {
|
7304 | const classNameToAppend = (Array.isArray(className)) ? className : [className];
|
7305 | return [...classes, ...classNameToAppend];
|
7306 | }
|
7307 | return classes;
|
7308 | };
|
7309 |
|
7310 | const createAnimation = (animationId) => {
|
7311 | let _delay;
|
7312 | let _duration;
|
7313 | let _easing;
|
7314 | let _iterations;
|
7315 | let _fill;
|
7316 | let _direction;
|
7317 | let _keyframes = [];
|
7318 | let beforeAddClasses = [];
|
7319 | let beforeRemoveClasses = [];
|
7320 | let initialized = false;
|
7321 | let parentAnimation;
|
7322 | let beforeStylesValue = {};
|
7323 | let afterAddClasses = [];
|
7324 | let afterRemoveClasses = [];
|
7325 | let afterStylesValue = {};
|
7326 | let numAnimationsRunning = 0;
|
7327 | let shouldForceLinearEasing = false;
|
7328 | let shouldForceSyncPlayback = false;
|
7329 | let cssAnimationsTimerFallback;
|
7330 | let forceDirectionValue;
|
7331 | let forceDurationValue;
|
7332 | let forceDelayValue;
|
7333 | let willComplete = true;
|
7334 | let finished = false;
|
7335 | let shouldCalculateNumAnimations = true;
|
7336 | let keyframeName;
|
7337 | let ani;
|
7338 | const id = animationId;
|
7339 | const onFinishCallbacks = [];
|
7340 | const onFinishOneTimeCallbacks = [];
|
7341 | const elements = [];
|
7342 | const childAnimations = [];
|
7343 | const stylesheets = [];
|
7344 | const _beforeAddReadFunctions = [];
|
7345 | const _beforeAddWriteFunctions = [];
|
7346 | const _afterAddReadFunctions = [];
|
7347 | const _afterAddWriteFunctions = [];
|
7348 | const webAnimations = [];
|
7349 | const supportsAnimationEffect = (typeof AnimationEffect === 'function' || typeof window.AnimationEffect === 'function');
|
7350 | const supportsWebAnimations = (typeof Element === 'function') && (typeof Element.prototype.animate === 'function') && supportsAnimationEffect;
|
7351 | const ANIMATION_END_FALLBACK_PADDING_MS = 100;
|
7352 | const getWebAnimations = () => {
|
7353 | return webAnimations;
|
7354 | };
|
7355 | const destroy = (clearStyleSheets) => {
|
7356 | childAnimations.forEach(childAnimation => {
|
7357 | childAnimation.destroy(clearStyleSheets);
|
7358 | });
|
7359 | cleanUp(clearStyleSheets);
|
7360 | elements.length = 0;
|
7361 | childAnimations.length = 0;
|
7362 | _keyframes.length = 0;
|
7363 | clearOnFinish();
|
7364 | initialized = false;
|
7365 | shouldCalculateNumAnimations = true;
|
7366 | return ani;
|
7367 | };
|
7368 | |
7369 |
|
7370 |
|
7371 |
|
7372 |
|
7373 |
|
7374 | const cleanUp = (clearStyleSheets) => {
|
7375 | cleanUpElements();
|
7376 | if (clearStyleSheets) {
|
7377 | cleanUpStyleSheets();
|
7378 | }
|
7379 | };
|
7380 | const resetFlags = () => {
|
7381 | shouldForceLinearEasing = false;
|
7382 | shouldForceSyncPlayback = false;
|
7383 | shouldCalculateNumAnimations = true;
|
7384 | forceDirectionValue = undefined;
|
7385 | forceDurationValue = undefined;
|
7386 | forceDelayValue = undefined;
|
7387 | numAnimationsRunning = 0;
|
7388 | finished = false;
|
7389 | willComplete = true;
|
7390 | };
|
7391 | const onFinish = (callback, opts) => {
|
7392 | const callbacks = (opts && opts.oneTimeCallback) ? onFinishOneTimeCallbacks : onFinishCallbacks;
|
7393 | callbacks.push({ c: callback, o: opts });
|
7394 | return ani;
|
7395 | };
|
7396 | const clearOnFinish = () => {
|
7397 | onFinishCallbacks.length = 0;
|
7398 | onFinishOneTimeCallbacks.length = 0;
|
7399 | return ani;
|
7400 | };
|
7401 | |
7402 |
|
7403 |
|
7404 |
|
7405 |
|
7406 | const cleanUpElements = () => {
|
7407 | if (supportsWebAnimations) {
|
7408 | webAnimations.forEach(animation => {
|
7409 | animation.cancel();
|
7410 | });
|
7411 | webAnimations.length = 0;
|
7412 | }
|
7413 | else {
|
7414 | const elementsArray = elements.slice();
|
7415 | raf(() => {
|
7416 | elementsArray.forEach(element => {
|
7417 | removeStyleProperty(element, 'animation-name');
|
7418 | removeStyleProperty(element, 'animation-duration');
|
7419 | removeStyleProperty(element, 'animation-timing-function');
|
7420 | removeStyleProperty(element, 'animation-iteration-count');
|
7421 | removeStyleProperty(element, 'animation-delay');
|
7422 | removeStyleProperty(element, 'animation-play-state');
|
7423 | removeStyleProperty(element, 'animation-fill-mode');
|
7424 | removeStyleProperty(element, 'animation-direction');
|
7425 | });
|
7426 | });
|
7427 | }
|
7428 | };
|
7429 | |
7430 |
|
7431 |
|
7432 |
|
7433 | const cleanUpStyleSheets = () => {
|
7434 | stylesheets.forEach(stylesheet => {
|
7435 | |
7436 |
|
7437 |
|
7438 |
|
7439 |
|
7440 | if (stylesheet && stylesheet.parentNode) {
|
7441 | stylesheet.parentNode.removeChild(stylesheet);
|
7442 | }
|
7443 | });
|
7444 | stylesheets.length = 0;
|
7445 | };
|
7446 | const beforeAddRead = (readFn) => {
|
7447 | _beforeAddReadFunctions.push(readFn);
|
7448 | return ani;
|
7449 | };
|
7450 | const beforeAddWrite = (writeFn) => {
|
7451 | _beforeAddWriteFunctions.push(writeFn);
|
7452 | return ani;
|
7453 | };
|
7454 | const afterAddRead = (readFn) => {
|
7455 | _afterAddReadFunctions.push(readFn);
|
7456 | return ani;
|
7457 | };
|
7458 | const afterAddWrite = (writeFn) => {
|
7459 | _afterAddWriteFunctions.push(writeFn);
|
7460 | return ani;
|
7461 | };
|
7462 | const beforeAddClass = (className) => {
|
7463 | beforeAddClasses = addClassToArray(beforeAddClasses, className);
|
7464 | return ani;
|
7465 | };
|
7466 | const beforeRemoveClass = (className) => {
|
7467 | beforeRemoveClasses = addClassToArray(beforeRemoveClasses, className);
|
7468 | return ani;
|
7469 | };
|
7470 | |
7471 |
|
7472 |
|
7473 |
|
7474 | const beforeStyles = (styles = {}) => {
|
7475 | beforeStylesValue = styles;
|
7476 | return ani;
|
7477 | };
|
7478 | |
7479 |
|
7480 |
|
7481 |
|
7482 | const beforeClearStyles = (propertyNames = []) => {
|
7483 | for (const property of propertyNames) {
|
7484 | beforeStylesValue[property] = '';
|
7485 | }
|
7486 | return ani;
|
7487 | };
|
7488 | const afterAddClass = (className) => {
|
7489 | afterAddClasses = addClassToArray(afterAddClasses, className);
|
7490 | return ani;
|
7491 | };
|
7492 | const afterRemoveClass = (className) => {
|
7493 | afterRemoveClasses = addClassToArray(afterRemoveClasses, className);
|
7494 | return ani;
|
7495 | };
|
7496 | const afterStyles = (styles = {}) => {
|
7497 | afterStylesValue = styles;
|
7498 | return ani;
|
7499 | };
|
7500 | const afterClearStyles = (propertyNames = []) => {
|
7501 | for (const property of propertyNames) {
|
7502 | afterStylesValue[property] = '';
|
7503 | }
|
7504 | return ani;
|
7505 | };
|
7506 | const getFill = () => {
|
7507 | if (_fill !== undefined) {
|
7508 | return _fill;
|
7509 | }
|
7510 | if (parentAnimation) {
|
7511 | return parentAnimation.getFill();
|
7512 | }
|
7513 | return 'both';
|
7514 | };
|
7515 | const getDirection = () => {
|
7516 | if (forceDirectionValue !== undefined) {
|
7517 | return forceDirectionValue;
|
7518 | }
|
7519 | if (_direction !== undefined) {
|
7520 | return _direction;
|
7521 | }
|
7522 | if (parentAnimation) {
|
7523 | return parentAnimation.getDirection();
|
7524 | }
|
7525 | return 'normal';
|
7526 | };
|
7527 | const getEasing = () => {
|
7528 | if (shouldForceLinearEasing) {
|
7529 | return 'linear';
|
7530 | }
|
7531 | if (_easing !== undefined) {
|
7532 | return _easing;
|
7533 | }
|
7534 | if (parentAnimation) {
|
7535 | return parentAnimation.getEasing();
|
7536 | }
|
7537 | return 'linear';
|
7538 | };
|
7539 | const getDuration = () => {
|
7540 | if (shouldForceSyncPlayback) {
|
7541 | return 0;
|
7542 | }
|
7543 | if (forceDurationValue !== undefined) {
|
7544 | return forceDurationValue;
|
7545 | }
|
7546 | if (_duration !== undefined) {
|
7547 | return _duration;
|
7548 | }
|
7549 | if (parentAnimation) {
|
7550 | return parentAnimation.getDuration();
|
7551 | }
|
7552 | return 0;
|
7553 | };
|
7554 | const getIterations = () => {
|
7555 | if (_iterations !== undefined) {
|
7556 | return _iterations;
|
7557 | }
|
7558 | if (parentAnimation) {
|
7559 | return parentAnimation.getIterations();
|
7560 | }
|
7561 | return 1;
|
7562 | };
|
7563 | const getDelay = () => {
|
7564 | if (forceDelayValue !== undefined) {
|
7565 | return forceDelayValue;
|
7566 | }
|
7567 | if (_delay !== undefined) {
|
7568 | return _delay;
|
7569 | }
|
7570 | if (parentAnimation) {
|
7571 | return parentAnimation.getDelay();
|
7572 | }
|
7573 | return 0;
|
7574 | };
|
7575 | const getKeyframes = () => {
|
7576 | return _keyframes;
|
7577 | };
|
7578 | const direction = (animationDirection) => {
|
7579 | _direction = animationDirection;
|
7580 | update(true);
|
7581 | return ani;
|
7582 | };
|
7583 | const fill = (animationFill) => {
|
7584 | _fill = animationFill;
|
7585 | update(true);
|
7586 | return ani;
|
7587 | };
|
7588 | const delay = (animationDelay) => {
|
7589 | _delay = animationDelay;
|
7590 | update(true);
|
7591 | return ani;
|
7592 | };
|
7593 | const easing = (animationEasing) => {
|
7594 | _easing = animationEasing;
|
7595 | update(true);
|
7596 | return ani;
|
7597 | };
|
7598 | const duration = (animationDuration) => {
|
7599 | |
7600 |
|
7601 |
|
7602 |
|
7603 |
|
7604 | if (!supportsWebAnimations && animationDuration === 0) {
|
7605 | animationDuration = 1;
|
7606 | }
|
7607 | _duration = animationDuration;
|
7608 | update(true);
|
7609 | return ani;
|
7610 | };
|
7611 | const iterations = (animationIterations) => {
|
7612 | _iterations = animationIterations;
|
7613 | update(true);
|
7614 | return ani;
|
7615 | };
|
7616 | const parent = (animation) => {
|
7617 | parentAnimation = animation;
|
7618 | return ani;
|
7619 | };
|
7620 | const addElement = (el) => {
|
7621 | if (el != null) {
|
7622 | if (el.nodeType === 1) {
|
7623 | elements.push(el);
|
7624 | }
|
7625 | else if (el.length >= 0) {
|
7626 | for (let i = 0; i < el.length; i++) {
|
7627 | elements.push(el[i]);
|
7628 | }
|
7629 | }
|
7630 | else {
|
7631 | console.error('Invalid addElement value');
|
7632 | }
|
7633 | }
|
7634 | return ani;
|
7635 | };
|
7636 | const addAnimation = (animationToAdd) => {
|
7637 | if (animationToAdd != null) {
|
7638 | if (Array.isArray(animationToAdd)) {
|
7639 | for (const animation of animationToAdd) {
|
7640 | animation.parent(ani);
|
7641 | childAnimations.push(animation);
|
7642 | }
|
7643 | }
|
7644 | else {
|
7645 | animationToAdd.parent(ani);
|
7646 | childAnimations.push(animationToAdd);
|
7647 | }
|
7648 | }
|
7649 | return ani;
|
7650 | };
|
7651 | const keyframes = (keyframeValues) => {
|
7652 | _keyframes = keyframeValues;
|
7653 | return ani;
|
7654 | };
|
7655 | |
7656 |
|
7657 |
|
7658 | const beforeAnimation = () => {
|
7659 |
|
7660 | _beforeAddReadFunctions.forEach(callback => callback());
|
7661 |
|
7662 | _beforeAddWriteFunctions.forEach(callback => callback());
|
7663 |
|
7664 | const addClasses = beforeAddClasses;
|
7665 | const removeClasses = beforeRemoveClasses;
|
7666 | const styles = beforeStylesValue;
|
7667 | elements.forEach(el => {
|
7668 | const elementClassList = el.classList;
|
7669 | addClasses.forEach(c => elementClassList.add(c));
|
7670 | removeClasses.forEach(c => elementClassList.remove(c));
|
7671 | for (const property in styles) {
|
7672 | if (styles.hasOwnProperty(property)) {
|
7673 | setStyleProperty(el, property, styles[property]);
|
7674 | }
|
7675 | }
|
7676 | });
|
7677 | };
|
7678 | |
7679 |
|
7680 |
|
7681 | const afterAnimation = () => {
|
7682 | clearCSSAnimationsTimeout();
|
7683 |
|
7684 | _afterAddReadFunctions.forEach(callback => callback());
|
7685 |
|
7686 | _afterAddWriteFunctions.forEach(callback => callback());
|
7687 |
|
7688 | const currentStep = willComplete ? 1 : 0;
|
7689 | const addClasses = afterAddClasses;
|
7690 | const removeClasses = afterRemoveClasses;
|
7691 | const styles = afterStylesValue;
|
7692 | elements.forEach(el => {
|
7693 | const elementClassList = el.classList;
|
7694 | addClasses.forEach(c => elementClassList.add(c));
|
7695 | removeClasses.forEach(c => elementClassList.remove(c));
|
7696 | for (const property in styles) {
|
7697 | if (styles.hasOwnProperty(property)) {
|
7698 | setStyleProperty(el, property, styles[property]);
|
7699 | }
|
7700 | }
|
7701 | });
|
7702 | onFinishCallbacks.forEach(onFinishCallback => {
|
7703 | return onFinishCallback.c(currentStep, ani);
|
7704 | });
|
7705 | onFinishOneTimeCallbacks.forEach(onFinishCallback => {
|
7706 | return onFinishCallback.c(currentStep, ani);
|
7707 | });
|
7708 | onFinishOneTimeCallbacks.length = 0;
|
7709 | shouldCalculateNumAnimations = true;
|
7710 | if (willComplete) {
|
7711 | finished = true;
|
7712 | }
|
7713 | willComplete = true;
|
7714 | };
|
7715 | const animationFinish = () => {
|
7716 | if (numAnimationsRunning === 0) {
|
7717 | return;
|
7718 | }
|
7719 | numAnimationsRunning--;
|
7720 | if (numAnimationsRunning === 0) {
|
7721 | afterAnimation();
|
7722 | if (parentAnimation) {
|
7723 | parentAnimation.animationFinish();
|
7724 | }
|
7725 | }
|
7726 | };
|
7727 | const initializeCSSAnimation = (toggleAnimationName = true) => {
|
7728 | cleanUpStyleSheets();
|
7729 | const processedKeyframes = processKeyframes(_keyframes);
|
7730 | elements.forEach(element => {
|
7731 | if (processedKeyframes.length > 0) {
|
7732 | const keyframeRules = generateKeyframeRules(processedKeyframes);
|
7733 | keyframeName = (animationId !== undefined) ? animationId : generateKeyframeName(keyframeRules);
|
7734 | const stylesheet = createKeyframeStylesheet(keyframeName, keyframeRules, element);
|
7735 | stylesheets.push(stylesheet);
|
7736 | setStyleProperty(element, 'animation-duration', `${getDuration()}ms`);
|
7737 | setStyleProperty(element, 'animation-timing-function', getEasing());
|
7738 | setStyleProperty(element, 'animation-delay', `${getDelay()}ms`);
|
7739 | setStyleProperty(element, 'animation-fill-mode', getFill());
|
7740 | setStyleProperty(element, 'animation-direction', getDirection());
|
7741 | const iterationsCount = (getIterations() === Infinity)
|
7742 | ? 'infinite'
|
7743 | : getIterations().toString();
|
7744 | setStyleProperty(element, 'animation-iteration-count', iterationsCount);
|
7745 | setStyleProperty(element, 'animation-play-state', 'paused');
|
7746 | if (toggleAnimationName) {
|
7747 | setStyleProperty(element, 'animation-name', `${stylesheet.id}-alt`);
|
7748 | }
|
7749 | raf(() => {
|
7750 | setStyleProperty(element, 'animation-name', stylesheet.id || null);
|
7751 | });
|
7752 | }
|
7753 | });
|
7754 | };
|
7755 | const initializeWebAnimation = () => {
|
7756 | elements.forEach(element => {
|
7757 | const animation = element.animate(_keyframes, {
|
7758 | id,
|
7759 | delay: getDelay(),
|
7760 | duration: getDuration(),
|
7761 | easing: getEasing(),
|
7762 | iterations: getIterations(),
|
7763 | fill: getFill(),
|
7764 | direction: getDirection()
|
7765 | });
|
7766 | animation.pause();
|
7767 | webAnimations.push(animation);
|
7768 | });
|
7769 | if (webAnimations.length > 0) {
|
7770 | webAnimations[0].onfinish = () => {
|
7771 | animationFinish();
|
7772 | };
|
7773 | }
|
7774 | };
|
7775 | const initializeAnimation = (toggleAnimationName = true) => {
|
7776 | beforeAnimation();
|
7777 | if (_keyframes.length > 0) {
|
7778 | if (supportsWebAnimations) {
|
7779 | initializeWebAnimation();
|
7780 | }
|
7781 | else {
|
7782 | initializeCSSAnimation(toggleAnimationName);
|
7783 | }
|
7784 | }
|
7785 | initialized = true;
|
7786 | };
|
7787 | const setAnimationStep = (step) => {
|
7788 | step = Math.min(Math.max(step, 0), 0.9999);
|
7789 | if (supportsWebAnimations) {
|
7790 | webAnimations.forEach(animation => {
|
7791 | animation.currentTime = animation.effect.getComputedTiming().delay + (getDuration() * step);
|
7792 | animation.pause();
|
7793 | });
|
7794 | }
|
7795 | else {
|
7796 | const animationDuration = `-${getDuration() * step}ms`;
|
7797 | elements.forEach(element => {
|
7798 | if (_keyframes.length > 0) {
|
7799 | setStyleProperty(element, 'animation-delay', animationDuration);
|
7800 | setStyleProperty(element, 'animation-play-state', 'paused');
|
7801 | }
|
7802 | });
|
7803 | }
|
7804 | };
|
7805 | const updateWebAnimation = (step) => {
|
7806 | webAnimations.forEach(animation => {
|
7807 | animation.effect.updateTiming({
|
7808 | delay: getDelay(),
|
7809 | duration: getDuration(),
|
7810 | easing: getEasing(),
|
7811 | iterations: getIterations(),
|
7812 | fill: getFill(),
|
7813 | direction: getDirection()
|
7814 | });
|
7815 | });
|
7816 | if (step !== undefined) {
|
7817 | setAnimationStep(step);
|
7818 | }
|
7819 | };
|
7820 | const updateCSSAnimation = (toggleAnimationName = true, step) => {
|
7821 | raf(() => {
|
7822 | elements.forEach(element => {
|
7823 | setStyleProperty(element, 'animation-name', keyframeName || null);
|
7824 | setStyleProperty(element, 'animation-duration', `${getDuration()}ms`);
|
7825 | setStyleProperty(element, 'animation-timing-function', getEasing());
|
7826 | setStyleProperty(element, 'animation-delay', (step !== undefined) ? `-${step * getDuration()}ms` : `${getDelay()}ms`);
|
7827 | setStyleProperty(element, 'animation-fill-mode', getFill() || null);
|
7828 | setStyleProperty(element, 'animation-direction', getDirection() || null);
|
7829 | const iterationsCount = (getIterations() === Infinity)
|
7830 | ? 'infinite'
|
7831 | : getIterations().toString();
|
7832 | setStyleProperty(element, 'animation-iteration-count', iterationsCount);
|
7833 | if (toggleAnimationName) {
|
7834 | setStyleProperty(element, 'animation-name', `${keyframeName}-alt`);
|
7835 | }
|
7836 | raf(() => {
|
7837 | setStyleProperty(element, 'animation-name', keyframeName || null);
|
7838 | });
|
7839 | });
|
7840 | });
|
7841 | };
|
7842 | const update = (deep = false, toggleAnimationName = true, step) => {
|
7843 | if (deep) {
|
7844 | childAnimations.forEach(animation => {
|
7845 | animation.update(deep, toggleAnimationName, step);
|
7846 | });
|
7847 | }
|
7848 | if (supportsWebAnimations) {
|
7849 | updateWebAnimation(step);
|
7850 | }
|
7851 | else {
|
7852 | updateCSSAnimation(toggleAnimationName, step);
|
7853 | }
|
7854 | return ani;
|
7855 | };
|
7856 | const progressStart = (forceLinearEasing = false, step) => {
|
7857 | childAnimations.forEach(animation => {
|
7858 | animation.progressStart(forceLinearEasing, step);
|
7859 | });
|
7860 | pauseAnimation();
|
7861 | shouldForceLinearEasing = forceLinearEasing;
|
7862 | if (!initialized) {
|
7863 | initializeAnimation();
|
7864 | }
|
7865 | else {
|
7866 | update(false, true, step);
|
7867 | }
|
7868 | return ani;
|
7869 | };
|
7870 | const progressStep = (step) => {
|
7871 | childAnimations.forEach(animation => {
|
7872 | animation.progressStep(step);
|
7873 | });
|
7874 | setAnimationStep(step);
|
7875 | return ani;
|
7876 | };
|
7877 | const progressEnd = (playTo, step, dur) => {
|
7878 | shouldForceLinearEasing = false;
|
7879 | childAnimations.forEach(animation => {
|
7880 | animation.progressEnd(playTo, step, dur);
|
7881 | });
|
7882 | if (dur !== undefined) {
|
7883 | forceDurationValue = dur;
|
7884 | }
|
7885 | finished = false;
|
7886 |
|
7887 | willComplete = true;
|
7888 | if (playTo === 0) {
|
7889 | forceDirectionValue = (getDirection() === 'reverse') ? 'normal' : 'reverse';
|
7890 | if (forceDirectionValue === 'reverse') {
|
7891 | willComplete = false;
|
7892 | }
|
7893 | if (supportsWebAnimations) {
|
7894 | update();
|
7895 | setAnimationStep(1 - step);
|
7896 | }
|
7897 | else {
|
7898 | forceDelayValue = ((1 - step) * getDuration()) * -1;
|
7899 | update(false, false);
|
7900 | }
|
7901 | }
|
7902 | else if (playTo === 1) {
|
7903 | if (supportsWebAnimations) {
|
7904 | update();
|
7905 | setAnimationStep(step);
|
7906 | }
|
7907 | else {
|
7908 | forceDelayValue = (step * getDuration()) * -1;
|
7909 | update(false, false);
|
7910 | }
|
7911 | }
|
7912 | if (playTo !== undefined) {
|
7913 | onFinish(() => {
|
7914 | forceDurationValue = undefined;
|
7915 | forceDirectionValue = undefined;
|
7916 | forceDelayValue = undefined;
|
7917 | }, {
|
7918 | oneTimeCallback: true
|
7919 | });
|
7920 | if (!parentAnimation) {
|
7921 | play();
|
7922 | }
|
7923 | }
|
7924 | return ani;
|
7925 | };
|
7926 | const pauseAnimation = () => {
|
7927 | if (initialized) {
|
7928 | if (supportsWebAnimations) {
|
7929 | webAnimations.forEach(animation => {
|
7930 | animation.pause();
|
7931 | });
|
7932 | }
|
7933 | else {
|
7934 | elements.forEach(element => {
|
7935 | setStyleProperty(element, 'animation-play-state', 'paused');
|
7936 | });
|
7937 | }
|
7938 | }
|
7939 | };
|
7940 | const pause = () => {
|
7941 | childAnimations.forEach(animation => {
|
7942 | animation.pause();
|
7943 | });
|
7944 | pauseAnimation();
|
7945 | return ani;
|
7946 | };
|
7947 | const onAnimationEndFallback = () => {
|
7948 | cssAnimationsTimerFallback = undefined;
|
7949 | animationFinish();
|
7950 | };
|
7951 | const clearCSSAnimationsTimeout = () => {
|
7952 | if (cssAnimationsTimerFallback) {
|
7953 | clearTimeout(cssAnimationsTimerFallback);
|
7954 | }
|
7955 | };
|
7956 | const playCSSAnimations = () => {
|
7957 | clearCSSAnimationsTimeout();
|
7958 | raf(() => {
|
7959 | elements.forEach(element => {
|
7960 | if (_keyframes.length > 0) {
|
7961 | setStyleProperty(element, 'animation-play-state', 'running');
|
7962 | }
|
7963 | });
|
7964 | });
|
7965 | if (_keyframes.length === 0 || elements.length === 0) {
|
7966 | animationFinish();
|
7967 | }
|
7968 | else {
|
7969 | |
7970 |
|
7971 |
|
7972 |
|
7973 |
|
7974 |
|
7975 |
|
7976 |
|
7977 | const animationDelay = getDelay() || 0;
|
7978 | const animationDuration = getDuration() || 0;
|
7979 | const animationIterations = getIterations() || 1;
|
7980 |
|
7981 | if (isFinite(animationIterations)) {
|
7982 | cssAnimationsTimerFallback = setTimeout(onAnimationEndFallback, animationDelay + (animationDuration * animationIterations) + ANIMATION_END_FALLBACK_PADDING_MS);
|
7983 | }
|
7984 | animationEnd(elements[0], () => {
|
7985 | clearCSSAnimationsTimeout();
|
7986 | |
7987 |
|
7988 |
|
7989 |
|
7990 |
|
7991 |
|
7992 |
|
7993 |
|
7994 |
|
7995 |
|
7996 |
|
7997 | raf(() => {
|
7998 | clearCSSAnimationPlayState();
|
7999 | raf(animationFinish);
|
8000 | });
|
8001 | });
|
8002 | }
|
8003 | };
|
8004 | const clearCSSAnimationPlayState = () => {
|
8005 | elements.forEach(element => {
|
8006 | removeStyleProperty(element, 'animation-duration');
|
8007 | removeStyleProperty(element, 'animation-delay');
|
8008 | removeStyleProperty(element, 'animation-play-state');
|
8009 | });
|
8010 | };
|
8011 | const playWebAnimations = () => {
|
8012 | webAnimations.forEach(animation => {
|
8013 | animation.play();
|
8014 | });
|
8015 | if (_keyframes.length === 0 || elements.length === 0) {
|
8016 | animationFinish();
|
8017 | }
|
8018 | };
|
8019 | const resetAnimation = () => {
|
8020 | if (supportsWebAnimations) {
|
8021 | setAnimationStep(0);
|
8022 | updateWebAnimation();
|
8023 | }
|
8024 | else {
|
8025 | updateCSSAnimation();
|
8026 | }
|
8027 | };
|
8028 | const play = (opts) => {
|
8029 | return new Promise(resolve => {
|
8030 | if (opts && opts.sync) {
|
8031 | shouldForceSyncPlayback = true;
|
8032 | onFinish(() => shouldForceSyncPlayback = false, { oneTimeCallback: true });
|
8033 | }
|
8034 | if (!initialized) {
|
8035 | initializeAnimation();
|
8036 | }
|
8037 | if (finished) {
|
8038 | resetAnimation();
|
8039 | finished = false;
|
8040 | }
|
8041 | if (shouldCalculateNumAnimations) {
|
8042 | numAnimationsRunning = childAnimations.length + 1;
|
8043 | shouldCalculateNumAnimations = false;
|
8044 | }
|
8045 | onFinish(() => resolve(), { oneTimeCallback: true });
|
8046 | childAnimations.forEach(animation => {
|
8047 | animation.play();
|
8048 | });
|
8049 | if (supportsWebAnimations) {
|
8050 | playWebAnimations();
|
8051 | }
|
8052 | else {
|
8053 | playCSSAnimations();
|
8054 | }
|
8055 | });
|
8056 | };
|
8057 | const stop = () => {
|
8058 | childAnimations.forEach(animation => {
|
8059 | animation.stop();
|
8060 | });
|
8061 | if (initialized) {
|
8062 | cleanUpElements();
|
8063 | initialized = false;
|
8064 | }
|
8065 | resetFlags();
|
8066 | };
|
8067 | const from = (property, value) => {
|
8068 | const firstFrame = _keyframes[0];
|
8069 | if (firstFrame !== undefined && (firstFrame.offset === undefined || firstFrame.offset === 0)) {
|
8070 | firstFrame[property] = value;
|
8071 | }
|
8072 | else {
|
8073 | _keyframes = [
|
8074 | { offset: 0, [property]: value },
|
8075 | ..._keyframes
|
8076 | ];
|
8077 | }
|
8078 | return ani;
|
8079 | };
|
8080 | const to = (property, value) => {
|
8081 | const lastFrame = _keyframes[_keyframes.length - 1];
|
8082 | if (lastFrame !== undefined && (lastFrame.offset === undefined || lastFrame.offset === 1)) {
|
8083 | lastFrame[property] = value;
|
8084 | }
|
8085 | else {
|
8086 | _keyframes = [
|
8087 | ..._keyframes,
|
8088 | { offset: 1, [property]: value }
|
8089 | ];
|
8090 | }
|
8091 | return ani;
|
8092 | };
|
8093 | const fromTo = (property, fromValue, toValue) => {
|
8094 | return from(property, fromValue).to(property, toValue);
|
8095 | };
|
8096 | return ani = {
|
8097 | parentAnimation,
|
8098 | elements,
|
8099 | childAnimations,
|
8100 | id,
|
8101 | animationFinish,
|
8102 | from,
|
8103 | to,
|
8104 | fromTo,
|
8105 | parent,
|
8106 | play,
|
8107 | pause,
|
8108 | stop,
|
8109 | destroy,
|
8110 | keyframes,
|
8111 | addAnimation,
|
8112 | addElement,
|
8113 | update,
|
8114 | fill,
|
8115 | direction,
|
8116 | iterations,
|
8117 | duration,
|
8118 | easing,
|
8119 | delay,
|
8120 | getWebAnimations,
|
8121 | getKeyframes,
|
8122 | getFill,
|
8123 | getDirection,
|
8124 | getDelay,
|
8125 | getIterations,
|
8126 | getEasing,
|
8127 | getDuration,
|
8128 | afterAddRead,
|
8129 | afterAddWrite,
|
8130 | afterClearStyles,
|
8131 | afterStyles,
|
8132 | afterRemoveClass,
|
8133 | afterAddClass,
|
8134 | beforeAddRead,
|
8135 | beforeAddWrite,
|
8136 | beforeClearStyles,
|
8137 | beforeStyles,
|
8138 | beforeRemoveClass,
|
8139 | beforeAddClass,
|
8140 | onFinish,
|
8141 | progressStart,
|
8142 | progressStep,
|
8143 | progressEnd
|
8144 | };
|
8145 | };
|
8146 |
|
8147 |
|
8148 |
|
8149 |
|
8150 | const iosEnterAnimation$6 = (baseEl) => {
|
8151 | const baseAnimation = createAnimation();
|
8152 | const backdropAnimation = createAnimation();
|
8153 | const wrapperAnimation = createAnimation();
|
8154 | backdropAnimation
|
8155 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8156 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
8157 | .beforeStyles({
|
8158 | 'pointer-events': 'none'
|
8159 | })
|
8160 | .afterClearStyles(['pointer-events']);
|
8161 | wrapperAnimation
|
8162 | .addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
8163 | .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
8164 | return baseAnimation
|
8165 | .addElement(baseEl)
|
8166 | .easing('cubic-bezier(.36,.66,.04,1)')
|
8167 | .duration(400)
|
8168 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8169 | };
|
8170 |
|
8171 |
|
8172 |
|
8173 |
|
8174 | const iosLeaveAnimation$6 = (baseEl) => {
|
8175 | const baseAnimation = createAnimation();
|
8176 | const backdropAnimation = createAnimation();
|
8177 | const wrapperAnimation = createAnimation();
|
8178 | backdropAnimation
|
8179 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8180 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
8181 | wrapperAnimation
|
8182 | .addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
8183 | .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
8184 | return baseAnimation
|
8185 | .addElement(baseEl)
|
8186 | .easing('cubic-bezier(.36,.66,.04,1)')
|
8187 | .duration(450)
|
8188 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8189 | };
|
8190 |
|
8191 |
|
8192 |
|
8193 |
|
8194 | const mdEnterAnimation$5 = (baseEl) => {
|
8195 | const baseAnimation = createAnimation();
|
8196 | const backdropAnimation = createAnimation();
|
8197 | const wrapperAnimation = createAnimation();
|
8198 | backdropAnimation
|
8199 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8200 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
8201 | .beforeStyles({
|
8202 | 'pointer-events': 'none'
|
8203 | })
|
8204 | .afterClearStyles(['pointer-events']);
|
8205 | wrapperAnimation
|
8206 | .addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
8207 | .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
8208 | return baseAnimation
|
8209 | .addElement(baseEl)
|
8210 | .easing('cubic-bezier(.36,.66,.04,1)')
|
8211 | .duration(400)
|
8212 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8213 | };
|
8214 |
|
8215 |
|
8216 |
|
8217 |
|
8218 | const mdLeaveAnimation$5 = (baseEl) => {
|
8219 | const baseAnimation = createAnimation();
|
8220 | const backdropAnimation = createAnimation();
|
8221 | const wrapperAnimation = createAnimation();
|
8222 | backdropAnimation
|
8223 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8224 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
8225 | wrapperAnimation
|
8226 | .addElement(baseEl.querySelector('.action-sheet-wrapper'))
|
8227 | .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
8228 | return baseAnimation
|
8229 | .addElement(baseEl)
|
8230 | .easing('cubic-bezier(.36,.66,.04,1)')
|
8231 | .duration(450)
|
8232 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8233 | };
|
8234 |
|
8235 | const actionSheetIosCss = ".sc-ion-action-sheet-ios-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-ios-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-ios{left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-button.sc-ion-action-sheet-ios{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-ios{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-ios::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-ios{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.action-sheet-selected.sc-ion-action-sheet-ios{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-ios:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-ios:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--backdrop-opacity:var(--ion-backdrop-opacity, 0.4);--button-background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent;--button-background-activated:var(--ion-text-color, #000);--button-background-activated-opacity:.08;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-background-selected:var(--ion-color-step-150, var(--ion-background-color, #fff));--button-background-selected-opacity:1;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-400, #999999);text-align:center}.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:auto;margin-right:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:var(--ion-safe-area-bottom, 0)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-container.sc-ion-action-sheet-ios{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-container.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.action-sheet-group.sc-ion-action-sheet-ios{border-radius:13px;margin-bottom:8px}.action-sheet-group.sc-ion-action-sheet-ios:first-child{margin-top:10px}.action-sheet-group.sc-ion-action-sheet-ios:last-child{margin-bottom:10px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-group.sc-ion-action-sheet-ios{background-color:transparent;-webkit-backdrop-filter:saturate(280%) blur(20px);backdrop-filter:saturate(280%) blur(20px)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-title.sc-ion-action-sheet-ios,.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.sc-ion-action-sheet-ios{background-color:transparent;background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8))), -webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4)), color-stop(50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4)), color-stop(50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background-image:linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%), linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4) 50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 50%);background-repeat:no-repeat;background-position:top, bottom;background-size:100% calc(100% - 1px), 100% 1px;-webkit-backdrop-filter:saturate(120%);backdrop-filter:saturate(120%)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.ion-activated.sc-ion-action-sheet-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.7);background-image:none}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-cancel.sc-ion-action-sheet-ios{background:var(--button-background-selected)}}.action-sheet-title.sc-ion-action-sheet-ios{background:-webkit-gradient(linear, left bottom, left top, from(rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)), color-stop(50%, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08)), color-stop(50%, transparent)) bottom/100% 1px no-repeat transparent;background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent}.action-sheet-title.sc-ion-action-sheet-ios{padding-left:10px;padding-right:10px;padding-top:14px;padding-bottom:13px;color:var(--color, var(--ion-color-step-400, #999999));font-size:13px;font-weight:400;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.action-sheet-title.action-sheet-has-sub-title.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-sub-title.sc-ion-action-sheet-ios{padding-left:0;padding-right:0;padding-top:6px;padding-bottom:0;font-size:13px;font-weight:400}.action-sheet-button.sc-ion-action-sheet-ios{padding-left:18px;padding-right:18px;padding-top:18px;padding-bottom:18px;height:56px;font-size:20px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:18px;padding-inline-start:18px;-webkit-padding-end:18px;padding-inline-end:18px}}.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:0.3em;font-size:28px;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.action-sheet-button.sc-ion-action-sheet-ios:last-child{background-image:none}.action-sheet-selected.sc-ion-action-sheet-ios{font-weight:bold}.action-sheet-cancel.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-cancel.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-destructive.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-activated.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-focused.sc-ion-action-sheet-ios{color:var(--ion-color-danger, #eb445a)}@media (any-hover: hover){.action-sheet-destructive.sc-ion-action-sheet-ios:hover{color:var(--ion-color-danger, #eb445a)}}";
|
8236 |
|
8237 | const actionSheetMdCss = ".sc-ion-action-sheet-md-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-md-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-md{left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-button.sc-ion-action-sheet-md{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;-ms-flex-pack:end;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-md{-ms-flex-negative:2;flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-md::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-md{-ms-flex-negative:0;flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.action-sheet-selected.sc-ion-action-sheet-md{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-md::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-md:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-md:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);--button-background:transparent;--button-background-selected:currentColor;--button-background-selected-opacity:0;--button-background-activated:transparent;--button-background-activated-opacity:0;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-color:var(--ion-color-step-850, #262626);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}.action-sheet-title.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:20px;padding-bottom:17px;min-height:60px;color:var(--color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54));font-size:16px;text-align:start}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-sub-title.sc-ion-action-sheet-md{padding-left:0;padding-right:0;padding-top:16px;padding-bottom:0;font-size:14px}.action-sheet-group.sc-ion-action-sheet-md:first-child{padding-top:0}.action-sheet-group.sc-ion-action-sheet-md:last-child{padding-bottom:0}.action-sheet-button.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;position:relative;height:52px;font-size:16px;text-align:start;contain:strict;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-icon.sc-ion-action-sheet-md{padding-bottom:4px;margin-left:0;margin-right:32px;margin-top:0;margin-bottom:0;color:var(--color);font-size:24px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.action-sheet-icon.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:32px;margin-inline-end:32px}}.action-sheet-button-inner.sc-ion-action-sheet-md{-ms-flex-pack:start;justify-content:flex-start}.action-sheet-selected.sc-ion-action-sheet-md{font-weight:bold}";
|
8238 |
|
8239 |
|
8240 |
|
8241 |
|
8242 | class ActionSheet {
|
8243 | constructor(hostRef) {
|
8244 | registerInstance(this, hostRef);
|
8245 | this.didPresent = createEvent(this, "ionActionSheetDidPresent", 7);
|
8246 | this.willPresent = createEvent(this, "ionActionSheetWillPresent", 7);
|
8247 | this.willDismiss = createEvent(this, "ionActionSheetWillDismiss", 7);
|
8248 | this.didDismiss = createEvent(this, "ionActionSheetDidDismiss", 7);
|
8249 | this.presented = false;
|
8250 | |
8251 |
|
8252 |
|
8253 | this.keyboardClose = true;
|
8254 | |
8255 |
|
8256 |
|
8257 | this.buttons = [];
|
8258 | |
8259 |
|
8260 |
|
8261 | this.backdropDismiss = true;
|
8262 | |
8263 |
|
8264 |
|
8265 |
|
8266 |
|
8267 | this.translucent = false;
|
8268 | |
8269 |
|
8270 |
|
8271 | this.animated = true;
|
8272 | this.onBackdropTap = () => {
|
8273 | this.dismiss(undefined, BACKDROP);
|
8274 | };
|
8275 | this.dispatchCancelHandler = (ev) => {
|
8276 | const role = ev.detail.role;
|
8277 | if (isCancel(role)) {
|
8278 | const cancelButton = this.getButtons().find(b => b.role === 'cancel');
|
8279 | this.callButtonHandler(cancelButton);
|
8280 | }
|
8281 | };
|
8282 | }
|
8283 | |
8284 |
|
8285 |
|
8286 | present() {
|
8287 | return present(this, 'actionSheetEnter', iosEnterAnimation$6, mdEnterAnimation$5);
|
8288 | }
|
8289 | connectedCallback() {
|
8290 | prepareOverlay(this.el);
|
8291 | }
|
8292 | |
8293 |
|
8294 |
|
8295 |
|
8296 |
|
8297 |
|
8298 |
|
8299 |
|
8300 |
|
8301 | dismiss(data, role) {
|
8302 | return dismiss(this, data, role, 'actionSheetLeave', iosLeaveAnimation$6, mdLeaveAnimation$5);
|
8303 | }
|
8304 | |
8305 |
|
8306 |
|
8307 | onDidDismiss() {
|
8308 | return eventMethod(this.el, 'ionActionSheetDidDismiss');
|
8309 | }
|
8310 | |
8311 |
|
8312 |
|
8313 |
|
8314 | onWillDismiss() {
|
8315 | return eventMethod(this.el, 'ionActionSheetWillDismiss');
|
8316 | }
|
8317 | async buttonClick(button) {
|
8318 | const role = button.role;
|
8319 | if (isCancel(role)) {
|
8320 | return this.dismiss(undefined, role);
|
8321 | }
|
8322 | const shouldDismiss = await this.callButtonHandler(button);
|
8323 | if (shouldDismiss) {
|
8324 | return this.dismiss(undefined, button.role);
|
8325 | }
|
8326 | return Promise.resolve();
|
8327 | }
|
8328 | async callButtonHandler(button) {
|
8329 | if (button) {
|
8330 |
|
8331 |
|
8332 | const rtn = await safeCall(button.handler);
|
8333 | if (rtn === false) {
|
8334 |
|
8335 | return false;
|
8336 | }
|
8337 | }
|
8338 | return true;
|
8339 | }
|
8340 | getButtons() {
|
8341 | return this.buttons.map(b => {
|
8342 | return (typeof b === 'string')
|
8343 | ? { text: b }
|
8344 | : b;
|
8345 | });
|
8346 | }
|
8347 | disconnectedCallback() {
|
8348 | if (this.gesture) {
|
8349 | this.gesture.destroy();
|
8350 | this.gesture = undefined;
|
8351 | }
|
8352 | }
|
8353 | componentDidLoad() {
|
8354 | |
8355 |
|
8356 |
|
8357 |
|
8358 |
|
8359 |
|
8360 | const { groupEl, wrapperEl } = this;
|
8361 | if (this.gesture || getIonMode$1(this) === 'md' || !wrapperEl || !groupEl) {
|
8362 | return;
|
8363 | }
|
8364 | readTask(() => {
|
8365 | const isScrollable = groupEl.scrollHeight > groupEl.clientHeight;
|
8366 | if (!isScrollable) {
|
8367 | this.gesture = createButtonActiveGesture(wrapperEl, (refEl) => refEl.classList.contains('action-sheet-button'));
|
8368 | this.gesture.enable(true);
|
8369 | }
|
8370 | });
|
8371 | }
|
8372 | render() {
|
8373 | const mode = getIonMode$1(this);
|
8374 | const allButtons = this.getButtons();
|
8375 | const cancelButton = allButtons.find(b => b.role === 'cancel');
|
8376 | const buttons = allButtons.filter(b => b.role !== 'cancel');
|
8377 | return (hAsync(Host, { role: "dialog", "aria-modal": "true", tabindex: "-1", style: {
|
8378 | zIndex: `${20000 + this.overlayIndex}`,
|
8379 | }, class: Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'action-sheet-translucent': this.translucent }), onIonActionSheetWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { tappable: this.backdropDismiss }), hAsync("div", { tabindex: "0" }), hAsync("div", { class: "action-sheet-wrapper ion-overlay-wrapper", role: "dialog", ref: el => this.wrapperEl = el }, hAsync("div", { class: "action-sheet-container" }, hAsync("div", { class: "action-sheet-group", ref: el => this.groupEl = el }, this.header !== undefined &&
|
8380 | hAsync("div", { class: {
|
8381 | 'action-sheet-title': true,
|
8382 | 'action-sheet-has-sub-title': this.subHeader !== undefined
|
8383 | } }, this.header, this.subHeader && hAsync("div", { class: "action-sheet-sub-title" }, this.subHeader)), buttons.map(b => hAsync("button", { type: "button", class: buttonClass$3(b), onClick: () => this.buttonClick(b) }, hAsync("span", { class: "action-sheet-button-inner" }, b.icon && hAsync("ion-icon", { icon: b.icon, lazy: false, class: "action-sheet-icon" }), b.text), mode === 'md' && hAsync("ion-ripple-effect", null)))), cancelButton &&
|
8384 | hAsync("div", { class: "action-sheet-group action-sheet-group-cancel" }, hAsync("button", { type: "button", class: buttonClass$3(cancelButton), onClick: () => this.buttonClick(cancelButton) }, hAsync("span", { class: "action-sheet-button-inner" }, cancelButton.icon &&
|
8385 | hAsync("ion-icon", { icon: cancelButton.icon, lazy: false, class: "action-sheet-icon" }), cancelButton.text), mode === 'md' && hAsync("ion-ripple-effect", null))))), hAsync("div", { tabindex: "0" })));
|
8386 | }
|
8387 | get el() { return getElement(this); }
|
8388 | static get style() { return {
|
8389 | ios: actionSheetIosCss,
|
8390 | md: actionSheetMdCss
|
8391 | }; }
|
8392 | static get cmpMeta() { return {
|
8393 | "$flags$": 34,
|
8394 | "$tagName$": "ion-action-sheet",
|
8395 | "$members$": {
|
8396 | "overlayIndex": [2, "overlay-index"],
|
8397 | "keyboardClose": [4, "keyboard-close"],
|
8398 | "enterAnimation": [16],
|
8399 | "leaveAnimation": [16],
|
8400 | "buttons": [16],
|
8401 | "cssClass": [1, "css-class"],
|
8402 | "backdropDismiss": [4, "backdrop-dismiss"],
|
8403 | "header": [1],
|
8404 | "subHeader": [1, "sub-header"],
|
8405 | "translucent": [4],
|
8406 | "animated": [4],
|
8407 | "present": [64],
|
8408 | "dismiss": [64],
|
8409 | "onDidDismiss": [64],
|
8410 | "onWillDismiss": [64]
|
8411 | },
|
8412 | "$listeners$": undefined,
|
8413 | "$lazyBundleId$": "-",
|
8414 | "$attrsToReflect$": []
|
8415 | }; }
|
8416 | }
|
8417 | const buttonClass$3 = (button) => {
|
8418 | return Object.assign({ 'action-sheet-button': true, 'ion-activatable': true, 'ion-focusable': true, [`action-sheet-${button.role}`]: button.role !== undefined }, getClassMap(button.cssClass));
|
8419 | };
|
8420 |
|
8421 |
|
8422 |
|
8423 |
|
8424 |
|
8425 | const sanitizeDOMString = (untrustedString) => {
|
8426 | try {
|
8427 | if (untrustedString instanceof IonicSafeString) {
|
8428 | return untrustedString.value;
|
8429 | }
|
8430 | if (!isSanitizerEnabled() || typeof untrustedString !== 'string' || untrustedString === '') {
|
8431 | return untrustedString;
|
8432 | }
|
8433 | |
8434 |
|
8435 |
|
8436 |
|
8437 |
|
8438 | const documentFragment = document.createDocumentFragment();
|
8439 | const workingDiv = document.createElement('div');
|
8440 | documentFragment.appendChild(workingDiv);
|
8441 | workingDiv.innerHTML = untrustedString;
|
8442 | |
8443 |
|
8444 |
|
8445 |
|
8446 | blockedTags.forEach(blockedTag => {
|
8447 | const getElementsToRemove = documentFragment.querySelectorAll(blockedTag);
|
8448 | for (let elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {
|
8449 | const element = getElementsToRemove[elementIndex];
|
8450 | if (element.parentNode) {
|
8451 | element.parentNode.removeChild(element);
|
8452 | }
|
8453 | else {
|
8454 | documentFragment.removeChild(element);
|
8455 | }
|
8456 | |
8457 |
|
8458 |
|
8459 |
|
8460 |
|
8461 | const childElements = getElementChildren(element);
|
8462 |
|
8463 | for (let childIndex = 0; childIndex < childElements.length; childIndex++) {
|
8464 | sanitizeElement(childElements[childIndex]);
|
8465 | }
|
8466 | }
|
8467 | });
|
8468 | |
8469 |
|
8470 |
|
8471 |
|
8472 |
|
8473 | const dfChildren = getElementChildren(documentFragment);
|
8474 |
|
8475 | for (let childIndex = 0; childIndex < dfChildren.length; childIndex++) {
|
8476 | sanitizeElement(dfChildren[childIndex]);
|
8477 | }
|
8478 |
|
8479 | const fragmentDiv = document.createElement('div');
|
8480 | fragmentDiv.appendChild(documentFragment);
|
8481 |
|
8482 | const getInnerDiv = fragmentDiv.querySelector('div');
|
8483 | return (getInnerDiv !== null) ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;
|
8484 | }
|
8485 | catch (err) {
|
8486 | console.error(err);
|
8487 | return '';
|
8488 | }
|
8489 | };
|
8490 |
|
8491 |
|
8492 |
|
8493 |
|
8494 |
|
8495 | const sanitizeElement = (element) => {
|
8496 |
|
8497 | if (element.nodeType && element.nodeType !== 1) {
|
8498 | return;
|
8499 | }
|
8500 | for (let i = element.attributes.length - 1; i >= 0; i--) {
|
8501 | const attribute = element.attributes.item(i);
|
8502 | const attributeName = attribute.name;
|
8503 |
|
8504 | if (!allowedAttributes.includes(attributeName.toLowerCase())) {
|
8505 | element.removeAttribute(attributeName);
|
8506 | continue;
|
8507 | }
|
8508 |
|
8509 |
|
8510 | const attributeValue = attribute.value;
|
8511 |
|
8512 | if (attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) {
|
8513 | element.removeAttribute(attributeName);
|
8514 | }
|
8515 | }
|
8516 | |
8517 |
|
8518 |
|
8519 | const childElements = getElementChildren(element);
|
8520 |
|
8521 | for (let i = 0; i < childElements.length; i++) {
|
8522 | sanitizeElement(childElements[i]);
|
8523 | }
|
8524 | };
|
8525 |
|
8526 |
|
8527 |
|
8528 |
|
8529 | const getElementChildren = (el) => {
|
8530 | return (el.children != null) ? el.children : el.childNodes;
|
8531 | };
|
8532 | const isSanitizerEnabled = () => {
|
8533 | const win = window;
|
8534 | const config = win && win.Ionic && win.Ionic.config;
|
8535 | if (config) {
|
8536 | if (config.get) {
|
8537 | return config.get('sanitizerEnabled', true);
|
8538 | }
|
8539 | else {
|
8540 | return config.sanitizerEnabled === true || config.sanitizerEnabled === undefined;
|
8541 | }
|
8542 | }
|
8543 | return true;
|
8544 | };
|
8545 | const allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];
|
8546 | const blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];
|
8547 | class IonicSafeString {
|
8548 | constructor(value) {
|
8549 | this.value = value;
|
8550 | }
|
8551 | }
|
8552 |
|
8553 |
|
8554 |
|
8555 |
|
8556 | const iosEnterAnimation$5 = (baseEl) => {
|
8557 | const baseAnimation = createAnimation();
|
8558 | const backdropAnimation = createAnimation();
|
8559 | const wrapperAnimation = createAnimation();
|
8560 | backdropAnimation
|
8561 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8562 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
8563 | .beforeStyles({
|
8564 | 'pointer-events': 'none'
|
8565 | })
|
8566 | .afterClearStyles(['pointer-events']);
|
8567 | wrapperAnimation
|
8568 | .addElement(baseEl.querySelector('.alert-wrapper'))
|
8569 | .keyframes([
|
8570 | { offset: 0, opacity: '0.01', transform: 'scale(1.1)' },
|
8571 | { offset: 1, opacity: '1', transform: 'scale(1)' }
|
8572 | ]);
|
8573 | return baseAnimation
|
8574 | .addElement(baseEl)
|
8575 | .easing('ease-in-out')
|
8576 | .duration(200)
|
8577 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8578 | };
|
8579 |
|
8580 |
|
8581 |
|
8582 |
|
8583 | const iosLeaveAnimation$5 = (baseEl) => {
|
8584 | const baseAnimation = createAnimation();
|
8585 | const backdropAnimation = createAnimation();
|
8586 | const wrapperAnimation = createAnimation();
|
8587 | backdropAnimation
|
8588 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8589 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
8590 | wrapperAnimation
|
8591 | .addElement(baseEl.querySelector('.alert-wrapper'))
|
8592 | .keyframes([
|
8593 | { offset: 0, opacity: 0.99, transform: 'scale(1)' },
|
8594 | { offset: 1, opacity: 0, transform: 'scale(0.9)' }
|
8595 | ]);
|
8596 | return baseAnimation
|
8597 | .addElement(baseEl)
|
8598 | .easing('ease-in-out')
|
8599 | .duration(200)
|
8600 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8601 | };
|
8602 |
|
8603 |
|
8604 |
|
8605 |
|
8606 | const mdEnterAnimation$4 = (baseEl) => {
|
8607 | const baseAnimation = createAnimation();
|
8608 | const backdropAnimation = createAnimation();
|
8609 | const wrapperAnimation = createAnimation();
|
8610 | backdropAnimation
|
8611 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8612 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
8613 | .beforeStyles({
|
8614 | 'pointer-events': 'none'
|
8615 | })
|
8616 | .afterClearStyles(['pointer-events']);
|
8617 | wrapperAnimation
|
8618 | .addElement(baseEl.querySelector('.alert-wrapper'))
|
8619 | .keyframes([
|
8620 | { offset: 0, opacity: '0.01', transform: 'scale(0.9)' },
|
8621 | { offset: 1, opacity: '1', transform: 'scale(1)' }
|
8622 | ]);
|
8623 | return baseAnimation
|
8624 | .addElement(baseEl)
|
8625 | .easing('ease-in-out')
|
8626 | .duration(150)
|
8627 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8628 | };
|
8629 |
|
8630 |
|
8631 |
|
8632 |
|
8633 | const mdLeaveAnimation$4 = (baseEl) => {
|
8634 | const baseAnimation = createAnimation();
|
8635 | const backdropAnimation = createAnimation();
|
8636 | const wrapperAnimation = createAnimation();
|
8637 | backdropAnimation
|
8638 | .addElement(baseEl.querySelector('ion-backdrop'))
|
8639 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
8640 | wrapperAnimation
|
8641 | .addElement(baseEl.querySelector('.alert-wrapper'))
|
8642 | .fromTo('opacity', 0.99, 0);
|
8643 | return baseAnimation
|
8644 | .addElement(baseEl)
|
8645 | .easing('ease-in-out')
|
8646 | .duration(150)
|
8647 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
8648 | };
|
8649 |
|
8650 | const alertIosCss = ".sc-ion-alert-ios-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-ios-h{display:none}.alert-top.sc-ion-alert-ios-h{padding-top:50px;-ms-flex-align:start;align-items:flex-start}.alert-wrapper.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-ios{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-message.sc-ion-alert-ios::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-ios{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.alert-button-group.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-ios{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-ios,.alert-tappable.ion-focused.sc-ion-alert-ios{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-ios,.alert-checkbox-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios,.alert-radio-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;-webkit-appearance:none;-moz-appearance:none;appearance:none;contain:strict}.alert-button.sc-ion-alert-ios,.alert-checkbox.sc-ion-alert-ios,.alert-input.sc-ion-alert-ios,.alert-radio.sc-ion-alert-ios{outline:none}.alert-radio-icon.sc-ion-alert-ios,.alert-checkbox-icon.sc-ion-alert-ios,.alert-checkbox-inner.sc-ion-alert-ios{-webkit-box-sizing:border-box;box-sizing:border-box}textarea.alert-input.sc-ion-alert-ios{min-height:37px;resize:none}.sc-ion-alert-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--max-width:270px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);font-size:14px}.alert-wrapper.sc-ion-alert-ios{border-radius:13px;-webkit-box-shadow:none;box-shadow:none;overflow:hidden}.alert-button.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{pointer-events:none}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.alert-translucent.sc-ion-alert-ios-h .alert-wrapper.sc-ion-alert-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.alert-head.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:7px;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-title.sc-ion-alert-ios{margin-top:8px;color:var(--ion-text-color, #000);font-size:17px;font-weight:600}.alert-sub-title.sc-ion-alert-ios{color:var(--ion-color-step-600, #666666);font-size:14px}.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:21px;color:var(--ion-text-color, #000);font-size:13px;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-message.sc-ion-alert-ios{max-height:240px}.alert-message.sc-ion-alert-ios:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:12px}.alert-input.sc-ion-alert-ios{border-radius:4px;margin-top:10px;padding-left:6px;padding-right:6px;padding-top:6px;padding-bottom:6px;border:0.55px solid var(--ion-color-step-250, #bfbfbf);background-color:var(--ion-background-color, #fff);-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-input.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:6px;padding-inline-start:6px;-webkit-padding-end:6px;padding-inline-end:6px}}.alert-input.sc-ion-alert-ios::-webkit-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-moz-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios:-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-clear{display:none}.alert-radio-group.sc-ion-alert-ios,.alert-checkbox-group.sc-ion-alert-ios{-ms-scroll-chaining:none;overscroll-behavior:contain;max-height:240px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);overflow-y:auto;-webkit-overflow-scrolling:touch}.alert-tappable.sc-ion-alert-ios{height:44px}.alert-radio-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;-ms-flex-order:0;order:0;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}[aria-checked=true].sc-ion-alert-ios .alert-radio-label.sc-ion-alert-ios{color:var(--ion-color-primary, #3880ff)}.alert-radio-icon.sc-ion-alert-ios{position:relative;-ms-flex-order:1;order:1;min-width:30px}[aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:7px;top:-7px;position:absolute;width:6px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:unset;right:unset;right:7px}.alert-checkbox-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}.alert-checkbox-icon.sc-ion-alert-ios{border-radius:50%;margin-left:16px;margin-right:6px;margin-top:10px;margin-bottom:10px;position:relative;width:24px;height:24px;border-width:1px;border-style:solid;border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));background-color:var(--ion-item-background, var(--ion-background-color, #fff));contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-checkbox-icon.sc-ion-alert-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:6px;margin-inline-end:6px}}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-icon.sc-ion-alert-ios{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:9px;top:4px;position:absolute;width:5px;height:12px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:1px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-background-color, #fff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:unset;right:unset;right:9px}.alert-button-group.sc-ion-alert-ios{margin-right:-0.55px;-ms-flex-wrap:wrap;flex-wrap:wrap}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-ios{margin-right:unset;-webkit-margin-end:-0.55px;margin-inline-end:-0.55px}}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:0;-ms-flex:1 1 auto;flex:1 1 auto;min-width:50%;height:44px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);background-color:transparent;color:var(--ion-color-primary, #3880ff);font-size:17px;overflow:hidden}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:first-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child{border-right:0}.alert-button.sc-ion-alert-ios:last-child{border-right:0;font-weight:bold}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:last-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child{border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}.alert-button.ion-activated.sc-ion-alert-ios{background-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1)}.alert-button-role-destructive.sc-ion-alert-ios,.alert-button-role-destructive.ion-activated.sc-ion-alert-ios,.alert-button-role-destructive.ion-focused.sc-ion-alert-ios{color:var(--ion-color-danger, #eb445a)}";
|
8651 |
|
8652 | const alertMdCss = ".sc-ion-alert-md-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-md-h{display:none}.alert-top.sc-ion-alert-md-h{padding-top:50px;-ms-flex-align:start;align-items:flex-start}.alert-wrapper.sc-ion-alert-md{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-md{-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-md::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-md::-webkit-scrollbar,.alert-message.sc-ion-alert-md::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-md{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}.alert-button-group.sc-ion-alert-md{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-md{-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.alert-button.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-md,.alert-tappable.ion-focused.sc-ion-alert-md{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-md{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-md,.alert-checkbox-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md,.alert-radio-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;-webkit-appearance:none;-moz-appearance:none;appearance:none;contain:strict}.alert-button.sc-ion-alert-md,.alert-checkbox.sc-ion-alert-md,.alert-input.sc-ion-alert-md,.alert-radio.sc-ion-alert-md{outline:none}.alert-radio-icon.sc-ion-alert-md,.alert-checkbox-icon.sc-ion-alert-md,.alert-checkbox-inner.sc-ion-alert-md{-webkit-box-sizing:border-box;box-sizing:border-box}textarea.alert-input.sc-ion-alert-md{min-height:37px;resize:none}.sc-ion-alert-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--max-width:280px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);font-size:14px}.alert-wrapper.sc-ion-alert-md{border-radius:4px;-webkit-box-shadow:0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12);box-shadow:0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12)}.alert-head.sc-ion-alert-md{padding-left:23px;padding-right:23px;padding-top:20px;padding-bottom:15px;text-align:start}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:23px;padding-inline-start:23px;-webkit-padding-end:23px;padding-inline-end:23px}}.alert-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:20px;font-weight:500}.alert-sub-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:16px}.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:24px;padding-right:24px;padding-top:20px;padding-bottom:20px;color:var(--ion-color-step-550, #737373)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px}}.alert-message.sc-ion-alert-md{max-height:240px;font-size:16px}.alert-message.sc-ion-alert-md:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-head.sc-ion-alert-md+.alert-message.sc-ion-alert-md{padding-top:0}.alert-input.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);color:var(--ion-text-color, #000)}.alert-input.sc-ion-alert-md::-webkit-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-moz-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md:-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-ms-input-placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-ms-clear{display:none}.alert-input.sc-ion-alert-md:focus{margin-bottom:4px;border-bottom:2px solid var(--ion-color-primary, #3880ff)}.alert-radio-group.sc-ion-alert-md,.alert-checkbox-group.sc-ion-alert-md{position:relative;max-height:240px;border-top:1px solid var(--ion-color-step-150, #d9d9d9);border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);overflow:auto}.alert-tappable.sc-ion-alert-md{position:relative;height:48px;overflow:hidden}.alert-radio-label.sc-ion-alert-md{padding-left:52px;padding-right:26px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:52px;padding-inline-start:52px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-radio-icon.sc-ion-alert-md{left:26px;top:0;border-radius:50%;display:block;position:relative;width:20px;height:20px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373)}[dir=rtl].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}.alert-radio-inner.sc-ion-alert-md{left:3px;top:3px;border-radius:50%;position:absolute;width:10px;height:10px;-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0);-webkit-transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}[aria-checked=true].sc-ion-alert-md .alert-radio-label.sc-ion-alert-md{color:var(--ion-color-step-850, #262626)}[aria-checked=true].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}.alert-checkbox-label.sc-ion-alert-md{padding-left:53px;padding-right:26px;padding-top:13px;padding-bottom:13px;-ms-flex:1;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:53px;padding-inline-start:53px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-checkbox-icon.sc-ion-alert-md{left:26px;top:0;border-radius:2px;position:relative;width:16px;height:16px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373);contain:strict}[dir=rtl].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}[aria-checked=true].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:3px;top:0;position:absolute;width:6px;height:10px;-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary-contrast, #fff)}[dir=rtl].sc-ion-alert-md [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}.alert-button-group.sc-ion-alert-md{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-wrap:wrap-reverse;flex-wrap:wrap-reverse;-ms-flex-pack:end;justify-content:flex-end}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.alert-button.sc-ion-alert-md{border-radius:2px;margin-left:0;margin-right:8px;margin-top:0;margin-bottom:0;padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;color:var(--ion-color-primary, #3880ff);font-weight:500;text-align:end;text-transform:uppercase;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.alert-button-inner.sc-ion-alert-md{-ms-flex-pack:end;justify-content:flex-end}";
|
8653 |
|
8654 |
|
8655 |
|
8656 |
|
8657 | class Alert {
|
8658 | constructor(hostRef) {
|
8659 | registerInstance(this, hostRef);
|
8660 | this.didPresent = createEvent(this, "ionAlertDidPresent", 7);
|
8661 | this.willPresent = createEvent(this, "ionAlertWillPresent", 7);
|
8662 | this.willDismiss = createEvent(this, "ionAlertWillDismiss", 7);
|
8663 | this.didDismiss = createEvent(this, "ionAlertDidDismiss", 7);
|
8664 | this.processedInputs = [];
|
8665 | this.processedButtons = [];
|
8666 | this.presented = false;
|
8667 | |
8668 |
|
8669 |
|
8670 | this.keyboardClose = true;
|
8671 | |
8672 |
|
8673 |
|
8674 | this.buttons = [];
|
8675 | |
8676 |
|
8677 |
|
8678 | this.inputs = [];
|
8679 | |
8680 |
|
8681 |
|
8682 | this.backdropDismiss = true;
|
8683 | |
8684 |
|
8685 |
|
8686 |
|
8687 |
|
8688 | this.translucent = false;
|
8689 | |
8690 |
|
8691 |
|
8692 | this.animated = true;
|
8693 | this.onBackdropTap = () => {
|
8694 | this.dismiss(undefined, BACKDROP);
|
8695 | };
|
8696 | this.dispatchCancelHandler = (ev) => {
|
8697 | const role = ev.detail.role;
|
8698 | if (isCancel(role)) {
|
8699 | const cancelButton = this.processedButtons.find(b => b.role === 'cancel');
|
8700 | this.callButtonHandler(cancelButton);
|
8701 | }
|
8702 | };
|
8703 | }
|
8704 | onKeydown(ev) {
|
8705 | const inputTypes = new Set(this.processedInputs.map(i => i.type));
|
8706 |
|
8707 |
|
8708 | if (!inputTypes.has('radio')
|
8709 | || (ev.target && !this.el.contains(ev.target))
|
8710 | || ev.target.classList.contains('alert-button')) {
|
8711 | return;
|
8712 | }
|
8713 |
|
8714 |
|
8715 | const query = this.el.querySelectorAll('.alert-radio');
|
8716 | const radios = Array.from(query).filter(radio => !radio.disabled);
|
8717 |
|
8718 |
|
8719 | const index = radios.findIndex(radio => radio.id === ev.target.id);
|
8720 |
|
8721 |
|
8722 | let nextEl;
|
8723 |
|
8724 |
|
8725 | if (['ArrowDown', 'ArrowRight'].includes(ev.code)) {
|
8726 | nextEl = (index === radios.length - 1)
|
8727 | ? radios[0]
|
8728 | : radios[index + 1];
|
8729 | }
|
8730 |
|
8731 |
|
8732 | if (['ArrowUp', 'ArrowLeft'].includes(ev.code)) {
|
8733 | nextEl = (index === 0)
|
8734 | ? radios[radios.length - 1]
|
8735 | : radios[index - 1];
|
8736 | }
|
8737 | if (nextEl && radios.includes(nextEl)) {
|
8738 | const nextProcessed = this.processedInputs.find(input => input.id === (nextEl === null || nextEl === void 0 ? void 0 : nextEl.id));
|
8739 | if (nextProcessed) {
|
8740 | this.rbClick(nextProcessed);
|
8741 | nextEl.focus();
|
8742 | }
|
8743 | }
|
8744 | }
|
8745 | buttonsChanged() {
|
8746 | const buttons = this.buttons;
|
8747 | this.processedButtons = buttons.map(btn => {
|
8748 | return (typeof btn === 'string')
|
8749 | ? { text: btn, role: btn.toLowerCase() === 'cancel' ? 'cancel' : undefined }
|
8750 | : btn;
|
8751 | });
|
8752 | }
|
8753 | inputsChanged() {
|
8754 | const inputs = this.inputs;
|
8755 |
|
8756 |
|
8757 |
|
8758 |
|
8759 | const first = inputs.find(input => !input.disabled);
|
8760 | const checked = inputs.find(input => input.checked && !input.disabled);
|
8761 | const focusable = checked || first;
|
8762 |
|
8763 |
|
8764 | const inputTypes = new Set(inputs.map(i => i.type));
|
8765 | if (inputTypes.has('checkbox') && inputTypes.has('radio')) {
|
8766 | console.warn(`Alert cannot mix input types: ${(Array.from(inputTypes.values()).join('/'))}. Please see alert docs for more info.`);
|
8767 | }
|
8768 | this.inputType = inputTypes.values().next().value;
|
8769 | this.processedInputs = inputs.map((i, index) => ({
|
8770 | type: i.type || 'text',
|
8771 | name: i.name || `${index}`,
|
8772 | placeholder: i.placeholder || '',
|
8773 | value: i.value,
|
8774 | label: i.label,
|
8775 | checked: !!i.checked,
|
8776 | disabled: !!i.disabled,
|
8777 | id: i.id || `alert-input-${this.overlayIndex}-${index}`,
|
8778 | handler: i.handler,
|
8779 | min: i.min,
|
8780 | max: i.max,
|
8781 | cssClass: i.cssClass || '',
|
8782 | attributes: i.attributes || {},
|
8783 | tabindex: (i.type === 'radio' && i !== focusable) ? -1 : 0
|
8784 | }));
|
8785 | }
|
8786 | connectedCallback() {
|
8787 | prepareOverlay(this.el);
|
8788 | }
|
8789 | componentWillLoad() {
|
8790 | this.inputsChanged();
|
8791 | this.buttonsChanged();
|
8792 | }
|
8793 | disconnectedCallback() {
|
8794 | if (this.gesture) {
|
8795 | this.gesture.destroy();
|
8796 | this.gesture = undefined;
|
8797 | }
|
8798 | }
|
8799 | componentDidLoad() {
|
8800 | |
8801 |
|
8802 |
|
8803 |
|
8804 |
|
8805 |
|
8806 | if (this.gesture || getIonMode$1(this) === 'md' || !this.wrapperEl) {
|
8807 | return;
|
8808 | }
|
8809 | this.gesture = createButtonActiveGesture(this.wrapperEl, (refEl) => refEl.classList.contains('alert-button'));
|
8810 | this.gesture.enable(true);
|
8811 | }
|
8812 | |
8813 |
|
8814 |
|
8815 | present() {
|
8816 | return present(this, 'alertEnter', iosEnterAnimation$5, mdEnterAnimation$4);
|
8817 | }
|
8818 | |
8819 |
|
8820 |
|
8821 |
|
8822 |
|
8823 |
|
8824 |
|
8825 |
|
8826 |
|
8827 | dismiss(data, role) {
|
8828 | return dismiss(this, data, role, 'alertLeave', iosLeaveAnimation$5, mdLeaveAnimation$4);
|
8829 | }
|
8830 | |
8831 |
|
8832 |
|
8833 | onDidDismiss() {
|
8834 | return eventMethod(this.el, 'ionAlertDidDismiss');
|
8835 | }
|
8836 | |
8837 |
|
8838 |
|
8839 | onWillDismiss() {
|
8840 | return eventMethod(this.el, 'ionAlertWillDismiss');
|
8841 | }
|
8842 | rbClick(selectedInput) {
|
8843 | for (const input of this.processedInputs) {
|
8844 | input.checked = input === selectedInput;
|
8845 | input.tabindex = input === selectedInput ? 0 : -1;
|
8846 | }
|
8847 | this.activeId = selectedInput.id;
|
8848 | safeCall(selectedInput.handler, selectedInput);
|
8849 | forceUpdate$1(this);
|
8850 | }
|
8851 | cbClick(selectedInput) {
|
8852 | selectedInput.checked = !selectedInput.checked;
|
8853 | safeCall(selectedInput.handler, selectedInput);
|
8854 | forceUpdate$1(this);
|
8855 | }
|
8856 | buttonClick(button) {
|
8857 | const role = button.role;
|
8858 | const values = this.getValues();
|
8859 | if (isCancel(role)) {
|
8860 | return this.dismiss({ values }, role);
|
8861 | }
|
8862 | const returnData = this.callButtonHandler(button, values);
|
8863 | if (returnData !== false) {
|
8864 | return this.dismiss(Object.assign({ values }, returnData), button.role);
|
8865 | }
|
8866 | return Promise.resolve(false);
|
8867 | }
|
8868 | callButtonHandler(button, data) {
|
8869 | if (button && button.handler) {
|
8870 |
|
8871 |
|
8872 | const returnData = safeCall(button.handler, data);
|
8873 | if (returnData === false) {
|
8874 |
|
8875 | return false;
|
8876 | }
|
8877 | if (typeof returnData === 'object') {
|
8878 | return returnData;
|
8879 | }
|
8880 | }
|
8881 | return {};
|
8882 | }
|
8883 | getValues() {
|
8884 | if (this.processedInputs.length === 0) {
|
8885 |
|
8886 | return undefined;
|
8887 | }
|
8888 | if (this.inputType === 'radio') {
|
8889 |
|
8890 |
|
8891 | const checkedInput = this.processedInputs.find(i => !!i.checked);
|
8892 | return checkedInput ? checkedInput.value : undefined;
|
8893 | }
|
8894 | if (this.inputType === 'checkbox') {
|
8895 |
|
8896 |
|
8897 | return this.processedInputs.filter(i => i.checked).map(i => i.value);
|
8898 | }
|
8899 |
|
8900 |
|
8901 | const values = {};
|
8902 | this.processedInputs.forEach(i => {
|
8903 | values[i.name] = i.value || '';
|
8904 | });
|
8905 | return values;
|
8906 | }
|
8907 | renderAlertInputs() {
|
8908 | switch (this.inputType) {
|
8909 | case 'checkbox': return this.renderCheckbox();
|
8910 | case 'radio': return this.renderRadio();
|
8911 | default: return this.renderInput();
|
8912 | }
|
8913 | }
|
8914 | renderCheckbox() {
|
8915 | const inputs = this.processedInputs;
|
8916 | const mode = getIonMode$1(this);
|
8917 | if (inputs.length === 0) {
|
8918 | return null;
|
8919 | }
|
8920 | return (hAsync("div", { class: "alert-checkbox-group" }, inputs.map(i => (hAsync("button", { type: "button", onClick: () => this.cbClick(i), "aria-checked": `${i.checked}`, id: i.id, disabled: i.disabled, tabIndex: i.tabindex, role: "checkbox", class: Object.assign(Object.assign({}, getClassMap(i.cssClass)), { 'alert-tappable': true, 'alert-checkbox': true, 'alert-checkbox-button': true, 'ion-focusable': true, 'alert-checkbox-button-disabled': i.disabled || false }) }, hAsync("div", { class: "alert-button-inner" }, hAsync("div", { class: "alert-checkbox-icon" }, hAsync("div", { class: "alert-checkbox-inner" })), hAsync("div", { class: "alert-checkbox-label" }, i.label)), mode === 'md' && hAsync("ion-ripple-effect", null))))));
|
8921 | }
|
8922 | renderRadio() {
|
8923 | const inputs = this.processedInputs;
|
8924 | if (inputs.length === 0) {
|
8925 | return null;
|
8926 | }
|
8927 | return (hAsync("div", { class: "alert-radio-group", role: "radiogroup", "aria-activedescendant": this.activeId }, inputs.map(i => (hAsync("button", { type: "button", onClick: () => this.rbClick(i), "aria-checked": `${i.checked}`, disabled: i.disabled, id: i.id, tabIndex: i.tabindex, class: Object.assign(Object.assign({}, getClassMap(i.cssClass)), { 'alert-radio-button': true, 'alert-tappable': true, 'alert-radio': true, 'ion-focusable': true, 'alert-radio-button-disabled': i.disabled || false }), role: "radio" }, hAsync("div", { class: "alert-button-inner" }, hAsync("div", { class: "alert-radio-icon" }, hAsync("div", { class: "alert-radio-inner" })), hAsync("div", { class: "alert-radio-label" }, i.label)))))));
|
8928 | }
|
8929 | renderInput() {
|
8930 | const inputs = this.processedInputs;
|
8931 | if (inputs.length === 0) {
|
8932 | return null;
|
8933 | }
|
8934 | return (hAsync("div", { class: "alert-input-group" }, inputs.map(i => {
|
8935 | var _a, _b, _c, _d;
|
8936 | if (i.type === 'textarea') {
|
8937 | return (hAsync("div", { class: "alert-input-wrapper" }, hAsync("textarea", Object.assign({ placeholder: i.placeholder, value: i.value, id: i.id, tabIndex: i.tabindex }, i.attributes, { disabled: (_b = (_a = i.attributes) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : i.disabled, class: inputClass(i), onInput: e => {
|
8938 | var _a;
|
8939 | i.value = e.target.value;
|
8940 | if ((_a = i.attributes) === null || _a === void 0 ? void 0 : _a.onInput) {
|
8941 | i.attributes.onInput(e);
|
8942 | }
|
8943 | } }))));
|
8944 | }
|
8945 | else {
|
8946 | return (hAsync("div", { class: "alert-input-wrapper" }, hAsync("input", Object.assign({ placeholder: i.placeholder, type: i.type, min: i.min, max: i.max, value: i.value, id: i.id, tabIndex: i.tabindex }, i.attributes, { disabled: (_d = (_c = i.attributes) === null || _c === void 0 ? void 0 : _c.disabled) !== null && _d !== void 0 ? _d : i.disabled, class: inputClass(i), onInput: e => {
|
8947 | var _a;
|
8948 | i.value = e.target.value;
|
8949 | if ((_a = i.attributes) === null || _a === void 0 ? void 0 : _a.onInput) {
|
8950 | i.attributes.onInput(e);
|
8951 | }
|
8952 | } }))));
|
8953 | }
|
8954 | })));
|
8955 | }
|
8956 | renderAlertButtons() {
|
8957 | const buttons = this.processedButtons;
|
8958 | const mode = getIonMode$1(this);
|
8959 | const alertButtonGroupClass = {
|
8960 | 'alert-button-group': true,
|
8961 | 'alert-button-group-vertical': buttons.length > 2
|
8962 | };
|
8963 | return (hAsync("div", { class: alertButtonGroupClass }, buttons.map(button => hAsync("button", { type: "button", class: buttonClass$2(button), tabIndex: 0, onClick: () => this.buttonClick(button) }, hAsync("span", { class: "alert-button-inner" }, button.text), mode === 'md' && hAsync("ion-ripple-effect", null)))));
|
8964 | }
|
8965 | render() {
|
8966 | const { overlayIndex, header, subHeader } = this;
|
8967 | const mode = getIonMode$1(this);
|
8968 | const hdrId = `alert-${overlayIndex}-hdr`;
|
8969 | const subHdrId = `alert-${overlayIndex}-sub-hdr`;
|
8970 | const msgId = `alert-${overlayIndex}-msg`;
|
8971 | return (hAsync(Host, { role: "dialog", "aria-modal": "true", tabindex: "-1", style: {
|
8972 | zIndex: `${20000 + overlayIndex}`,
|
8973 | }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'alert-translucent': this.translucent }), onIonAlertWillDismiss: this.dispatchCancelHandler, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { tappable: this.backdropDismiss }), hAsync("div", { tabindex: "0" }), hAsync("div", { class: "alert-wrapper ion-overlay-wrapper", ref: el => this.wrapperEl = el }, hAsync("div", { class: "alert-head" }, header && hAsync("h2", { id: hdrId, class: "alert-title" }, header), subHeader && hAsync("h2", { id: subHdrId, class: "alert-sub-title" }, subHeader)), hAsync("div", { id: msgId, class: "alert-message", innerHTML: sanitizeDOMString(this.message) }), this.renderAlertInputs(), this.renderAlertButtons()), hAsync("div", { tabindex: "0" })));
|
8974 | }
|
8975 | get el() { return getElement(this); }
|
8976 | static get watchers() { return {
|
8977 | "buttons": ["buttonsChanged"],
|
8978 | "inputs": ["inputsChanged"]
|
8979 | }; }
|
8980 | static get style() { return {
|
8981 | ios: alertIosCss,
|
8982 | md: alertMdCss
|
8983 | }; }
|
8984 | static get cmpMeta() { return {
|
8985 | "$flags$": 34,
|
8986 | "$tagName$": "ion-alert",
|
8987 | "$members$": {
|
8988 | "overlayIndex": [2, "overlay-index"],
|
8989 | "keyboardClose": [4, "keyboard-close"],
|
8990 | "enterAnimation": [16],
|
8991 | "leaveAnimation": [16],
|
8992 | "cssClass": [1, "css-class"],
|
8993 | "header": [1],
|
8994 | "subHeader": [1, "sub-header"],
|
8995 | "message": [1],
|
8996 | "buttons": [16],
|
8997 | "inputs": [1040],
|
8998 | "backdropDismiss": [4, "backdrop-dismiss"],
|
8999 | "translucent": [4],
|
9000 | "animated": [4],
|
9001 | "present": [64],
|
9002 | "dismiss": [64],
|
9003 | "onDidDismiss": [64],
|
9004 | "onWillDismiss": [64]
|
9005 | },
|
9006 | "$listeners$": [[4, "keydown", "onKeydown"]],
|
9007 | "$lazyBundleId$": "-",
|
9008 | "$attrsToReflect$": []
|
9009 | }; }
|
9010 | }
|
9011 | const inputClass = (input) => {
|
9012 | var _a, _b, _c;
|
9013 | return Object.assign(Object.assign({ 'alert-input': true, 'alert-input-disabled': ((_b = (_a = input.attributes) === null || _a === void 0 ? void 0 : _a.disabled) !== null && _b !== void 0 ? _b : input.disabled) || false }, getClassMap(input.cssClass)), getClassMap(input.attributes ? (_c = input.attributes.class) === null || _c === void 0 ? void 0 : _c.toString() : ''));
|
9014 | };
|
9015 | const buttonClass$2 = (button) => {
|
9016 | return Object.assign({ 'alert-button': true, 'ion-focusable': true, 'ion-activatable': true, [`alert-button-role-${button.role}`]: button.role !== undefined }, getClassMap(button.cssClass));
|
9017 | };
|
9018 |
|
9019 | const appCss = "html.plt-mobile ion-app{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}html.plt-mobile ion-app [contenteditable]{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}ion-app.force-statusbar-padding{--ion-safe-area-top:20px}";
|
9020 |
|
9021 | class App {
|
9022 | constructor(hostRef) {
|
9023 | registerInstance(this, hostRef);
|
9024 | }
|
9025 | componentDidLoad() {
|
9026 | }
|
9027 | render() {
|
9028 | const mode = getIonMode$1(this);
|
9029 | return (hAsync(Host, { class: {
|
9030 | [mode]: true,
|
9031 | 'ion-page': true,
|
9032 | 'force-statusbar-padding': config.getBoolean('_forceStatusbarPadding'),
|
9033 | } }));
|
9034 | }
|
9035 | get el() { return getElement(this); }
|
9036 | static get style() { return appCss; }
|
9037 | static get cmpMeta() { return {
|
9038 | "$flags$": 0,
|
9039 | "$tagName$": "ion-app",
|
9040 | "$members$": undefined,
|
9041 | "$listeners$": undefined,
|
9042 | "$lazyBundleId$": "-",
|
9043 | "$attrsToReflect$": []
|
9044 | }; }
|
9045 | }
|
9046 |
|
9047 | const avatarIosCss = "/*!@:host*/.sc-ion-avatar-ios-h{border-radius:var(--border-radius);display:block}/*!@::slotted(ion-img),\n::slotted(img)*/.sc-ion-avatar-ios-s>ion-img,.sc-ion-avatar-ios-s>img{border-radius:var(--border-radius);width:100%;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden}/*!@:host*/.sc-ion-avatar-ios-h{--border-radius:50%;width:48px;height:48px}";
|
9048 |
|
9049 | const avatarMdCss = "/*!@:host*/.sc-ion-avatar-md-h{border-radius:var(--border-radius);display:block}/*!@::slotted(ion-img),\n::slotted(img)*/.sc-ion-avatar-md-s>ion-img,.sc-ion-avatar-md-s>img{border-radius:var(--border-radius);width:100%;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden}/*!@:host*/.sc-ion-avatar-md-h{--border-radius:50%;width:64px;height:64px}";
|
9050 |
|
9051 | class Avatar {
|
9052 | constructor(hostRef) {
|
9053 | registerInstance(this, hostRef);
|
9054 | }
|
9055 | render() {
|
9056 | return (hAsync(Host, { class: getIonMode$1(this) }, hAsync("slot", null)));
|
9057 | }
|
9058 | static get style() { return {
|
9059 | ios: avatarIosCss,
|
9060 | md: avatarMdCss
|
9061 | }; }
|
9062 | static get cmpMeta() { return {
|
9063 | "$flags$": 41,
|
9064 | "$tagName$": "ion-avatar",
|
9065 | "$members$": undefined,
|
9066 | "$listeners$": undefined,
|
9067 | "$lazyBundleId$": "-",
|
9068 | "$attrsToReflect$": []
|
9069 | }; }
|
9070 | }
|
9071 |
|
9072 | const backButtonIosCss = "/*!@:host*/.sc-ion-back-button-ios-h{--background:transparent;--color-focused:currentColor;--color-hover:currentColor;--icon-margin-top:0;--icon-margin-bottom:0;--icon-padding-top:0;--icon-padding-end:0;--icon-padding-bottom:0;--icon-padding-start:0;--margin-top:0;--margin-end:0;--margin-bottom:0;--margin-start:0;--min-width:auto;--min-height:auto;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--opacity:1;--ripple-color:currentColor;--transition:background-color, opacity 100ms linear;display:none;min-width:var(--min-width);min-height:var(--min-height);color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-font-kerning:none;font-kerning:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-back-button-ios{color:var(--ripple-color)}/*!@:host(.ion-color) .button-native*/.ion-color.sc-ion-back-button-ios-h .button-native.sc-ion-back-button-ios{color:var(--ion-color-base)}/*!@:host(.show-back-button)*/.show-back-button.sc-ion-back-button-ios-h{display:block}/*!@:host(.back-button-disabled)*/.back-button-disabled.sc-ion-back-button-ios-h{cursor:default;opacity:0.5;pointer-events:none}/*!@.button-native*/.button-native.sc-ion-back-button-ios{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;min-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;opacity:var(--opacity);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-back-button-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-back-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-inner*/.button-inner.sc-ion-back-button-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@ion-icon*/ion-icon.sc-ion-back-button-ios{padding-left:var(--icon-padding-start);padding-right:var(--icon-padding-end);padding-top:var(--icon-padding-top);padding-bottom:var(--icon-padding-bottom);margin-left:var(--icon-margin-start);margin-right:var(--icon-margin-end);margin-top:var(--icon-margin-top);margin-bottom:var(--icon-margin-bottom);display:inherit;font-size:var(--icon-font-size);font-weight:var(--icon-font-weight);pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@ion-icon*/ion-icon.sc-ion-back-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--icon-padding-start);padding-inline-start:var(--icon-padding-start);-webkit-padding-end:var(--icon-padding-end);padding-inline-end:var(--icon-padding-end)}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@ion-icon*/ion-icon.sc-ion-back-button-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--icon-margin-start);margin-inline-start:var(--icon-margin-start);-webkit-margin-end:var(--icon-margin-end);margin-inline-end:var(--icon-margin-end)}}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-back-button-ios-h .button-native.sc-ion-back-button-ios{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-back-button-ios-h .button-native.sc-ion-back-button-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@.button-native::after*/.button-native.sc-ion-back-button-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-back-button-ios-h:hover .button-native.sc-ion-back-button-ios{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-back-button-ios-h:hover .button-native.sc-ion-back-button-ios::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}/*!@:host(.ion-color.ion-focused) .button-native*/.ion-color.ion-focused.sc-ion-back-button-ios-h .button-native.sc-ion-back-button-ios{color:var(--ion-color-base)}@media (any-hover: hover){/*!@:host(.ion-color:hover) .button-native*/.ion-color.sc-ion-back-button-ios-h:hover .button-native.sc-ion-back-button-ios{color:var(--ion-color-base)}}/*!@:host(.in-toolbar:not(.in-toolbar-color))*/.in-toolbar.sc-ion-back-button-ios-h:not(.in-toolbar-color){color:var(--ion-toolbar-color, var(--color))}/*!@:host*/.sc-ion-back-button-ios-h{--background-hover:transparent;--background-hover-opacity:1;--background-focused:currentColor;--background-focused-opacity:.1;--border-radius:4px;--color:var(--ion-color-primary, #3880ff);--icon-margin-end:-5px;--icon-margin-start:-4px;--icon-font-size:1.85em;--min-height:32px;font-size:17px}/*!@.button-native*/.button-native.sc-ion-back-button-ios{-webkit-transform:translateZ(0);transform:translateZ(0);overflow:visible;z-index:99}/*!@:host(.ion-activated) .button-native*/.ion-activated.sc-ion-back-button-ios-h .button-native.sc-ion-back-button-ios{opacity:0.4}@media (any-hover: hover){/*!@:host(:hover)*/.sc-ion-back-button-ios-h:hover{opacity:0.6}}/*!@:host(.ion-color.ion-focused) .button-native::after*/.ion-color.ion-focused.sc-ion-back-button-ios-h .button-native.sc-ion-back-button-ios::after{background:var(--ion-color-base)}";
|
9073 |
|
9074 | const backButtonMdCss = "/*!@:host*/.sc-ion-back-button-md-h{--background:transparent;--color-focused:currentColor;--color-hover:currentColor;--icon-margin-top:0;--icon-margin-bottom:0;--icon-padding-top:0;--icon-padding-end:0;--icon-padding-bottom:0;--icon-padding-start:0;--margin-top:0;--margin-end:0;--margin-bottom:0;--margin-start:0;--min-width:auto;--min-height:auto;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--opacity:1;--ripple-color:currentColor;--transition:background-color, opacity 100ms linear;display:none;min-width:var(--min-width);min-height:var(--min-height);color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-font-kerning:none;font-kerning:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-back-button-md{color:var(--ripple-color)}/*!@:host(.ion-color) .button-native*/.ion-color.sc-ion-back-button-md-h .button-native.sc-ion-back-button-md{color:var(--ion-color-base)}/*!@:host(.show-back-button)*/.show-back-button.sc-ion-back-button-md-h{display:block}/*!@:host(.back-button-disabled)*/.back-button-disabled.sc-ion-back-button-md-h{cursor:default;opacity:0.5;pointer-events:none}/*!@.button-native*/.button-native.sc-ion-back-button-md{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;min-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;opacity:var(--opacity);overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-back-button-md{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-back-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-inner*/.button-inner.sc-ion-back-button-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@ion-icon*/ion-icon.sc-ion-back-button-md{padding-left:var(--icon-padding-start);padding-right:var(--icon-padding-end);padding-top:var(--icon-padding-top);padding-bottom:var(--icon-padding-bottom);margin-left:var(--icon-margin-start);margin-right:var(--icon-margin-end);margin-top:var(--icon-margin-top);margin-bottom:var(--icon-margin-bottom);display:inherit;font-size:var(--icon-font-size);font-weight:var(--icon-font-weight);pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@ion-icon*/ion-icon.sc-ion-back-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--icon-padding-start);padding-inline-start:var(--icon-padding-start);-webkit-padding-end:var(--icon-padding-end);padding-inline-end:var(--icon-padding-end)}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@ion-icon*/ion-icon.sc-ion-back-button-md{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--icon-margin-start);margin-inline-start:var(--icon-margin-start);-webkit-margin-end:var(--icon-margin-end);margin-inline-end:var(--icon-margin-end)}}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-back-button-md-h .button-native.sc-ion-back-button-md{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-back-button-md-h .button-native.sc-ion-back-button-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@.button-native::after*/.button-native.sc-ion-back-button-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-back-button-md-h:hover .button-native.sc-ion-back-button-md{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-back-button-md-h:hover .button-native.sc-ion-back-button-md::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}/*!@:host(.ion-color.ion-focused) .button-native*/.ion-color.ion-focused.sc-ion-back-button-md-h .button-native.sc-ion-back-button-md{color:var(--ion-color-base)}@media (any-hover: hover){/*!@:host(.ion-color:hover) .button-native*/.ion-color.sc-ion-back-button-md-h:hover .button-native.sc-ion-back-button-md{color:var(--ion-color-base)}}/*!@:host(.in-toolbar:not(.in-toolbar-color))*/.in-toolbar.sc-ion-back-button-md-h:not(.in-toolbar-color){color:var(--ion-toolbar-color, var(--color))}/*!@:host*/.sc-ion-back-button-md-h{--border-radius:4px;--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:0.04;--color:currentColor;--icon-margin-end:0;--icon-margin-start:0;--icon-font-size:24px;--icon-font-weight:normal;--min-height:32px;--min-width:44px;--padding-start:12px;--padding-end:12px;font-size:14px;font-weight:500;text-transform:uppercase}/*!@:host(.back-button-has-icon-only)*/.back-button-has-icon-only.sc-ion-back-button-md-h{--border-radius:50%;min-width:48px;height:48px}/*!@.button-native*/.button-native.sc-ion-back-button-md{-webkit-box-shadow:none;box-shadow:none}/*!@.button-text*/.button-text.sc-ion-back-button-md{padding-left:4px;padding-right:4px;padding-top:0;padding-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-text*/.button-text.sc-ion-back-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}/*!@ion-icon*/ion-icon.sc-ion-back-button-md{line-height:0.67;text-align:start}@media (any-hover: hover){/*!@:host(.ion-color:hover) .button-native::after*/.ion-color.sc-ion-back-button-md-h:hover .button-native.sc-ion-back-button-md::after{background:var(--ion-color-base)}}/*!@:host(.ion-color.ion-focused) .button-native::after*/.ion-color.ion-focused.sc-ion-back-button-md-h .button-native.sc-ion-back-button-md::after{background:var(--ion-color-base)}";
|
9075 |
|
9076 |
|
9077 |
|
9078 |
|
9079 |
|
9080 |
|
9081 |
|
9082 |
|
9083 | class BackButton {
|
9084 | constructor(hostRef) {
|
9085 | registerInstance(this, hostRef);
|
9086 | |
9087 |
|
9088 |
|
9089 | this.disabled = false;
|
9090 | |
9091 |
|
9092 |
|
9093 | this.type = 'button';
|
9094 | this.onClick = async (ev) => {
|
9095 | const nav = this.el.closest('ion-nav');
|
9096 | ev.preventDefault();
|
9097 | if (nav && await nav.canGoBack()) {
|
9098 | return nav.pop({ animationBuilder: this.routerAnimation, skipIfBusy: true });
|
9099 | }
|
9100 | return openURL(this.defaultHref, ev, 'back', this.routerAnimation);
|
9101 | };
|
9102 | }
|
9103 | componentWillLoad() {
|
9104 | if (this.defaultHref === undefined) {
|
9105 | this.defaultHref = config.get('backButtonDefaultHref');
|
9106 | }
|
9107 | }
|
9108 | get backButtonIcon() {
|
9109 | const icon = this.icon;
|
9110 | if (icon != null) {
|
9111 |
|
9112 | return icon;
|
9113 | }
|
9114 | if (getIonMode$1(this) === 'ios') {
|
9115 |
|
9116 | return config.get('backButtonIcon', 'chevron-back');
|
9117 | }
|
9118 |
|
9119 | return config.get('backButtonIcon', 'arrow-back-sharp');
|
9120 | }
|
9121 | get backButtonText() {
|
9122 | const defaultBackButtonText = getIonMode$1(this) === 'ios' ? 'Back' : null;
|
9123 | return this.text != null ? this.text : config.get('backButtonText', defaultBackButtonText);
|
9124 | }
|
9125 | get hasIconOnly() {
|
9126 | return this.backButtonIcon && !this.backButtonText;
|
9127 | }
|
9128 | get rippleType() {
|
9129 |
|
9130 |
|
9131 | if (this.hasIconOnly) {
|
9132 | return 'unbounded';
|
9133 | }
|
9134 | return 'bounded';
|
9135 | }
|
9136 | render() {
|
9137 | const { color, defaultHref, disabled, type, hasIconOnly, backButtonIcon, backButtonText } = this;
|
9138 | const showBackButton = defaultHref !== undefined;
|
9139 | const mode = getIonMode$1(this);
|
9140 | return (hAsync(Host, { onClick: this.onClick, class: createColorClasses$1(color, {
|
9141 | [mode]: true,
|
9142 | 'button': true,
|
9143 | 'back-button-disabled': disabled,
|
9144 | 'back-button-has-icon-only': hasIconOnly,
|
9145 | 'in-toolbar': hostContext('ion-toolbar', this.el),
|
9146 | 'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
9147 | 'ion-activatable': true,
|
9148 | 'ion-focusable': true,
|
9149 | 'show-back-button': showBackButton
|
9150 | }) }, hAsync("button", { type: type, disabled: disabled, class: "button-native", part: "native", "aria-label": backButtonText || 'back' }, hAsync("span", { class: "button-inner" }, backButtonIcon && hAsync("ion-icon", { part: "icon", icon: backButtonIcon, "aria-hidden": "true", lazy: false }), backButtonText && hAsync("span", { part: "text", "aria-hidden": "true", class: "button-text" }, backButtonText)), mode === 'md' && hAsync("ion-ripple-effect", { type: this.rippleType }))));
|
9151 | }
|
9152 | get el() { return getElement(this); }
|
9153 | static get style() { return {
|
9154 | ios: backButtonIosCss,
|
9155 | md: backButtonMdCss
|
9156 | }; }
|
9157 | static get cmpMeta() { return {
|
9158 | "$flags$": 41,
|
9159 | "$tagName$": "ion-back-button",
|
9160 | "$members$": {
|
9161 | "color": [513],
|
9162 | "defaultHref": [1025, "default-href"],
|
9163 | "disabled": [516],
|
9164 | "icon": [1],
|
9165 | "text": [1],
|
9166 | "type": [1],
|
9167 | "routerAnimation": [16]
|
9168 | },
|
9169 | "$listeners$": undefined,
|
9170 | "$lazyBundleId$": "-",
|
9171 | "$attrsToReflect$": [["color", "color"], ["disabled", "disabled"]]
|
9172 | }; }
|
9173 | }
|
9174 |
|
9175 | const backdropIosCss = "/*!@:host*/.sc-ion-backdrop-ios-h{left:0;right:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none;z-index:2}/*!@:host(.backdrop-hide)*/.backdrop-hide.sc-ion-backdrop-ios-h{background:transparent}/*!@:host(.backdrop-no-tappable)*/.backdrop-no-tappable.sc-ion-backdrop-ios-h{cursor:auto}/*!@:host*/.sc-ion-backdrop-ios-h{background-color:var(--ion-backdrop-color, #000)}";
|
9176 |
|
9177 | const backdropMdCss = "/*!@:host*/.sc-ion-backdrop-md-h{left:0;right:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none;z-index:2}/*!@:host(.backdrop-hide)*/.backdrop-hide.sc-ion-backdrop-md-h{background:transparent}/*!@:host(.backdrop-no-tappable)*/.backdrop-no-tappable.sc-ion-backdrop-md-h{cursor:auto}/*!@:host*/.sc-ion-backdrop-md-h{background-color:var(--ion-backdrop-color, #000)}";
|
9178 |
|
9179 | class Backdrop {
|
9180 | constructor(hostRef) {
|
9181 | registerInstance(this, hostRef);
|
9182 | this.ionBackdropTap = createEvent(this, "ionBackdropTap", 7);
|
9183 | this.blocker = GESTURE_CONTROLLER.createBlocker({
|
9184 | disableScroll: true
|
9185 | });
|
9186 | |
9187 |
|
9188 |
|
9189 | this.visible = true;
|
9190 | |
9191 |
|
9192 |
|
9193 | this.tappable = true;
|
9194 | |
9195 |
|
9196 |
|
9197 | this.stopPropagation = true;
|
9198 | }
|
9199 | connectedCallback() {
|
9200 | if (this.stopPropagation) {
|
9201 | this.blocker.block();
|
9202 | }
|
9203 | }
|
9204 | disconnectedCallback() {
|
9205 | this.blocker.unblock();
|
9206 | }
|
9207 | onMouseDown(ev) {
|
9208 | this.emitTap(ev);
|
9209 | }
|
9210 | emitTap(ev) {
|
9211 | if (this.stopPropagation) {
|
9212 | ev.preventDefault();
|
9213 | ev.stopPropagation();
|
9214 | }
|
9215 | if (this.tappable) {
|
9216 | this.ionBackdropTap.emit();
|
9217 | }
|
9218 | }
|
9219 | render() {
|
9220 | const mode = getIonMode$1(this);
|
9221 | return (hAsync(Host, { tabindex: "-1", "aria-hidden": "true", class: {
|
9222 | [mode]: true,
|
9223 | 'backdrop-hide': !this.visible,
|
9224 | 'backdrop-no-tappable': !this.tappable,
|
9225 | } }));
|
9226 | }
|
9227 | static get style() { return {
|
9228 | ios: backdropIosCss,
|
9229 | md: backdropMdCss
|
9230 | }; }
|
9231 | static get cmpMeta() { return {
|
9232 | "$flags$": 41,
|
9233 | "$tagName$": "ion-backdrop",
|
9234 | "$members$": {
|
9235 | "visible": [4],
|
9236 | "tappable": [4],
|
9237 | "stopPropagation": [4, "stop-propagation"]
|
9238 | },
|
9239 | "$listeners$": [[2, "click", "onMouseDown"]],
|
9240 | "$lazyBundleId$": "-",
|
9241 | "$attrsToReflect$": []
|
9242 | }; }
|
9243 | }
|
9244 |
|
9245 | const badgeIosCss = "/*!@:host*/.sc-ion-badge-ios-h{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-badge-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.ion-color)*/.ion-color.sc-ion-badge-ios-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(:empty)*/.sc-ion-badge-ios-h:empty{display:none}/*!@:host*/.sc-ion-badge-ios-h{border-radius:10px}";
|
9246 |
|
9247 | const badgeMdCss = "/*!@:host*/.sc-ion-badge-md-h{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);--padding-top:3px;--padding-end:8px;--padding-bottom:3px;--padding-start:8px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:inline-block;min-width:10px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:13px;font-weight:bold;line-height:1;text-align:center;white-space:nowrap;contain:content;vertical-align:baseline}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-badge-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.ion-color)*/.ion-color.sc-ion-badge-md-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(:empty)*/.sc-ion-badge-md-h:empty{display:none}/*!@:host*/.sc-ion-badge-md-h{--padding-top:3px;--padding-end:4px;--padding-bottom:4px;--padding-start:4px;border-radius:4px}";
|
9248 |
|
9249 |
|
9250 |
|
9251 |
|
9252 | class Badge {
|
9253 | constructor(hostRef) {
|
9254 | registerInstance(this, hostRef);
|
9255 | }
|
9256 | render() {
|
9257 | const mode = getIonMode$1(this);
|
9258 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
9259 | [mode]: true,
|
9260 | }) }, hAsync("slot", null)));
|
9261 | }
|
9262 | static get style() { return {
|
9263 | ios: badgeIosCss,
|
9264 | md: badgeMdCss
|
9265 | }; }
|
9266 | static get cmpMeta() { return {
|
9267 | "$flags$": 41,
|
9268 | "$tagName$": "ion-badge",
|
9269 | "$members$": {
|
9270 | "color": [513]
|
9271 | },
|
9272 | "$listeners$": undefined,
|
9273 | "$lazyBundleId$": "-",
|
9274 | "$attrsToReflect$": [["color", "color"]]
|
9275 | }; }
|
9276 | }
|
9277 |
|
9278 | const buttonIosCss = "/*!@:host*/.sc-ion-button-ios-h{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;-webkit-font-kerning:none;font-kerning:none}/*!@:host(.button-disabled)*/.button-disabled.sc-ion-button-ios-h{cursor:default;opacity:0.5;pointer-events:none}/*!@:host(.button-solid)*/.button-solid.sc-ion-button-ios-h{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}/*!@:host(.button-outline)*/.button-outline.sc-ion-button-ios-h{--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}/*!@:host(.button-clear)*/.button-clear.sc-ion-button-ios-h{--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}/*!@:host(.button-block)*/.button-block.sc-ion-button-ios-h{display:block}/*!@:host(.button-block) .button-native*/.button-block.sc-ion-button-ios-h .button-native.sc-ion-button-ios{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}/*!@:host(.button-block) .button-native::after*/.button-block.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{clear:both}/*!@:host(.button-full)*/.button-full.sc-ion-button-ios-h{display:block}/*!@:host(.button-full) .button-native*/.button-full.sc-ion-button-ios-h .button-native.sc-ion-button-ios{margin-left:0;margin-right:0;display:block;width:100%;contain:content}/*!@:host(.button-full:not(.button-round)) .button-native*/.button-full.sc-ion-button-ios-h:not(.button-round) .button-native.sc-ion-button-ios{border-radius:0;border-right-width:0;border-left-width:0}/*!@.button-native*/.button-native.sc-ion-button-ios{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-native::-moz-focus-inner*/.button-native.sc-ion-button-ios::-moz-focus-inner{border:0}/*!@.button-inner*/.button-inner.sc-ion-button-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@::slotted(ion-icon)*/.sc-ion-button-ios-s>ion-icon{font-size:1.4em;pointer-events:none}/*!@::slotted(ion-icon[slot=start])*/.sc-ion-button-ios-s>ion-icon[slot=start]{margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=start])*/.sc-ion-button-ios-s>ion-icon[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}/*!@::slotted(ion-icon[slot=end])*/.sc-ion-button-ios-s>ion-icon[slot=end]{margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=end])*/.sc-ion-button-ios-s>ion-icon[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}/*!@::slotted(ion-icon[slot=icon-only])*/.sc-ion-button-ios-s>ion-icon[slot=icon-only]{font-size:1.8em}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-button-ios{color:var(--ripple-color)}/*!@.button-native::after*/.button-native.sc-ion-button-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-button-ios-h{color:var(--color-activated)}/*!@:host(.ion-activated) .button-native::after*/.ion-activated.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}/*!@:host(.ion-focused)*/.ion-focused.sc-ion-button-ios-h{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){/*!@:host(:hover)*/.sc-ion-button-ios-h:hover{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-button-ios-h:hover .button-native.sc-ion-button-ios::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}/*!@:host(.button-solid.ion-color) .button-native*/.button-solid.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.button-outline.ion-color) .button-native*/.button-outline.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}/*!@:host(.button-clear.ion-color) .button-native*/.button-clear.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios{background:transparent;color:var(--ion-color-base)}/*!@:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native*/.in-toolbar.sc-ion-button-ios-h:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-ios{color:var(--ion-toolbar-color, var(--color))}/*!@:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native*/.button-outline.in-toolbar.sc-ion-button-ios-h:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-ios{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}/*!@:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native*/.button-solid.in-toolbar.sc-ion-button-ios-h:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-ios{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}/*!@:host*/.sc-ion-button-ios-h{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color, opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-0.03em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-button-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}/*!@:host(.button-solid)*/.button-solid.sc-ion-button-ios-h{--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1}/*!@:host(.button-outline)*/.button-outline.sc-ion-button-ios-h{--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary, #3880ff);--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;--color-activated:var(--ion-color-primary-contrast, #fff)}/*!@:host(.button-clear)*/.button-clear.sc-ion-button-ios-h{--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:transparent;--background-focused-opacity:.1;font-size:17px;font-weight:normal;letter-spacing:0}/*!@:host(.button-large)*/.button-large.sc-ion-button-ios-h{--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}/*!@:host(.button-small)*/.button-small.sc-ion-button-ios-h{--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}/*!@:host(.button-round)*/.button-round.sc-ion-button-ios-h{--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}/*!@:host(.button-strong)*/.button-strong.sc-ion-button-ios-h{font-weight:600}/*!@:host(.button-clear.ion-activated)*/.button-clear.ion-activated.sc-ion-button-ios-h{opacity:0.4}/*!@:host(.button-outline.ion-activated.ion-color) .button-native*/.button-outline.ion-activated.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios{color:var(--ion-color-contrast)}/*!@:host(.button-outline.ion-activated.ion-color) .button-native::after*/.button-outline.ion-activated.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{background:var(--ion-color-base)}/*!@:host(.button-solid.ion-color.ion-activated) .button-native::after*/.button-solid.ion-color.ion-activated.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{background:var(--ion-color-shade)}/*!@:host(.button-outline.ion-focused.ion-color) .button-native,\n:host(.button-clear.ion-focused.ion-color) .button-native*/.button-outline.ion-focused.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios,.button-clear.ion-focused.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios{color:var(--ion-color-base)}/*!@:host(.button-outline.ion-focused.ion-color) .button-native::after,\n:host(.button-clear.ion-focused.ion-color) .button-native::after*/.button-outline.ion-focused.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after,.button-clear.ion-focused.ion-color.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{background:var(--ion-color-base)}/*!@:host(.button-solid.ion-color.ion-focused) .button-native::after*/.button-solid.ion-color.ion-focused.sc-ion-button-ios-h .button-native.sc-ion-button-ios::after{background:var(--ion-color-shade)}@media (any-hover: hover){/*!@:host(.button-clear:hover),\n:host(.button-outline:hover)*/.button-clear.sc-ion-button-ios-h:hover,.button-outline.sc-ion-button-ios-h:hover{opacity:0.6}/*!@:host(.button-clear.ion-color:hover) .button-native,\n:host(.button-outline.ion-color:hover) .button-native*/.button-clear.ion-color.sc-ion-button-ios-h:hover .button-native.sc-ion-button-ios,.button-outline.ion-color.sc-ion-button-ios-h:hover .button-native.sc-ion-button-ios{color:var(--ion-color-base)}/*!@:host(.button-clear.ion-color:hover) .button-native::after,\n:host(.button-outline.ion-color:hover) .button-native::after*/.button-clear.ion-color.sc-ion-button-ios-h:hover .button-native.sc-ion-button-ios::after,.button-outline.ion-color.sc-ion-button-ios-h:hover .button-native.sc-ion-button-ios::after{background:transparent}/*!@:host(.button-solid.ion-color:hover) .button-native::after*/.button-solid.ion-color.sc-ion-button-ios-h:hover .button-native.sc-ion-button-ios::after{background:var(--ion-color-tint)}/*!@:host(:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native::after*/.sc-ion-button-ios-h:hover.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-ios::after{background:#fff;opacity:0.1}}";
|
9279 |
|
9280 | const buttonMdCss = "/*!@:host*/.sc-ion-button-md-h{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;-webkit-font-kerning:none;font-kerning:none}/*!@:host(.button-disabled)*/.button-disabled.sc-ion-button-md-h{cursor:default;opacity:0.5;pointer-events:none}/*!@:host(.button-solid)*/.button-solid.sc-ion-button-md-h{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff)}/*!@:host(.button-outline)*/.button-outline.sc-ion-button-md-h{--border-color:var(--ion-color-primary, #3880ff);--background:transparent;--color:var(--ion-color-primary, #3880ff)}/*!@:host(.button-clear)*/.button-clear.sc-ion-button-md-h{--border-width:0;--background:transparent;--color:var(--ion-color-primary, #3880ff)}/*!@:host(.button-block)*/.button-block.sc-ion-button-md-h{display:block}/*!@:host(.button-block) .button-native*/.button-block.sc-ion-button-md-h .button-native.sc-ion-button-md{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}/*!@:host(.button-block) .button-native::after*/.button-block.sc-ion-button-md-h .button-native.sc-ion-button-md::after{clear:both}/*!@:host(.button-full)*/.button-full.sc-ion-button-md-h{display:block}/*!@:host(.button-full) .button-native*/.button-full.sc-ion-button-md-h .button-native.sc-ion-button-md{margin-left:0;margin-right:0;display:block;width:100%;contain:content}/*!@:host(.button-full:not(.button-round)) .button-native*/.button-full.sc-ion-button-md-h:not(.button-round) .button-native.sc-ion-button-md{border-radius:0;border-right-width:0;border-left-width:0}/*!@.button-native*/.button-native.sc-ion-button-md{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-native::-moz-focus-inner*/.button-native.sc-ion-button-md::-moz-focus-inner{border:0}/*!@.button-inner*/.button-inner.sc-ion-button-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@::slotted(ion-icon)*/.sc-ion-button-md-s>ion-icon{font-size:1.4em;pointer-events:none}/*!@::slotted(ion-icon[slot=start])*/.sc-ion-button-md-s>ion-icon[slot=start]{margin-left:-0.3em;margin-right:0.3em;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=start])*/.sc-ion-button-md-s>ion-icon[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:-0.3em;margin-inline-start:-0.3em;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}/*!@::slotted(ion-icon[slot=end])*/.sc-ion-button-md-s>ion-icon[slot=end]{margin-left:0.3em;margin-right:-0.2em;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=end])*/.sc-ion-button-md-s>ion-icon[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:0.3em;margin-inline-start:0.3em;-webkit-margin-end:-0.2em;margin-inline-end:-0.2em}}/*!@::slotted(ion-icon[slot=icon-only])*/.sc-ion-button-md-s>ion-icon[slot=icon-only]{font-size:1.8em}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-button-md{color:var(--ripple-color)}/*!@.button-native::after*/.button-native.sc-ion-button-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-button-md-h{color:var(--color-activated)}/*!@:host(.ion-activated) .button-native::after*/.ion-activated.sc-ion-button-md-h .button-native.sc-ion-button-md::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}/*!@:host(.ion-focused)*/.ion-focused.sc-ion-button-md-h{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-button-md-h .button-native.sc-ion-button-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){/*!@:host(:hover)*/.sc-ion-button-md-h:hover{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-button-md-h:hover .button-native.sc-ion-button-md::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}/*!@:host(.button-solid.ion-color) .button-native*/.button-solid.ion-color.sc-ion-button-md-h .button-native.sc-ion-button-md{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.button-outline.ion-color) .button-native*/.button-outline.ion-color.sc-ion-button-md-h .button-native.sc-ion-button-md{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}/*!@:host(.button-clear.ion-color) .button-native*/.button-clear.ion-color.sc-ion-button-md-h .button-native.sc-ion-button-md{background:transparent;color:var(--ion-color-base)}/*!@:host(.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native*/.in-toolbar.sc-ion-button-md-h:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-md{color:var(--ion-toolbar-color, var(--color))}/*!@:host(.button-outline.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native*/.button-outline.in-toolbar.sc-ion-button-md-h:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-md{border-color:var(--ion-toolbar-color, var(--color, var(--border-color)))}/*!@:host(.button-solid.in-toolbar:not(.ion-color):not(.in-toolbar-color)) .button-native*/.button-solid.in-toolbar.sc-ion-button-md-h:not(.ion-color):not(.in-toolbar-color) .button-native.sc-ion-button-md{background:var(--ion-toolbar-color, var(--background));color:var(--ion-toolbar-background, var(--color))}/*!@:host*/.sc-ion-button-md-h{--border-radius:4px;--padding-top:0;--padding-bottom:0;--padding-start:1.1em;--padding-end:1.1em;--transition:box-shadow 280ms cubic-bezier(.4, 0, .2, 1),\n background-color 15ms linear,\n color 15ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:36px;font-size:14px;font-weight:500;letter-spacing:0.06em;text-transform:uppercase}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-button-md-h{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}/*!@:host(.button-solid)*/.button-solid.sc-ion-button-md-h{--background-activated:transparent;--background-hover:var(--ion-color-primary-contrast, #fff);--background-focused:var(--ion-color-primary-contrast, #fff);--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}/*!@:host(.button-solid.ion-activated)*/.button-solid.ion-activated.sc-ion-button-md-h{--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12)}/*!@:host(.button-outline)*/.button-outline.sc-ion-button-md-h{--border-width:2px;--border-style:solid;--box-shadow:none;--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}/*!@:host(.button-outline.ion-activated.ion-color) .button-native*/.button-outline.ion-activated.ion-color.sc-ion-button-md-h .button-native.sc-ion-button-md{background:transparent}/*!@:host(.button-clear)*/.button-clear.sc-ion-button-md-h{--background-activated:transparent;--background-focused:var(--ion-color-primary, #3880ff);--background-hover:var(--ion-color-primary, #3880ff);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04}/*!@:host(.button-round)*/.button-round.sc-ion-button-md-h{--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}/*!@:host(.button-large)*/.button-large.sc-ion-button-md-h{--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}/*!@:host(.button-small)*/.button-small.sc-ion-button-md-h{--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}/*!@:host(.button-strong)*/.button-strong.sc-ion-button-md-h{font-weight:bold}/*!@::slotted(ion-icon[slot=icon-only])*/.sc-ion-button-md-s>ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}/*!@:host(.button-solid.ion-color.ion-focused) .button-native::after*/.button-solid.ion-color.ion-focused.sc-ion-button-md-h .button-native.sc-ion-button-md::after{background:var(--ion-color-contrast)}/*!@:host(.button-clear.ion-color.ion-focused) .button-native::after,\n:host(.button-outline.ion-color.ion-focused) .button-native::after*/.button-clear.ion-color.ion-focused.sc-ion-button-md-h .button-native.sc-ion-button-md::after,.button-outline.ion-color.ion-focused.sc-ion-button-md-h .button-native.sc-ion-button-md::after{background:var(--ion-color-base)}@media (any-hover: hover){/*!@:host(.button-solid.ion-color:hover) .button-native::after*/.button-solid.ion-color.sc-ion-button-md-h:hover .button-native.sc-ion-button-md::after{background:var(--ion-color-contrast)}/*!@:host(.button-clear.ion-color:hover) .button-native::after,\n:host(.button-outline.ion-color:hover) .button-native::after*/.button-clear.ion-color.sc-ion-button-md-h:hover .button-native.sc-ion-button-md::after,.button-outline.ion-color.sc-ion-button-md-h:hover .button-native.sc-ion-button-md::after{background:var(--ion-color-base)}}";
|
9281 |
|
9282 |
|
9283 |
|
9284 |
|
9285 |
|
9286 |
|
9287 |
|
9288 |
|
9289 |
|
9290 |
|
9291 |
|
9292 | class Button {
|
9293 | constructor(hostRef) {
|
9294 | registerInstance(this, hostRef);
|
9295 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
9296 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
9297 | this.inItem = false;
|
9298 | this.inListHeader = false;
|
9299 | this.inToolbar = false;
|
9300 | this.inheritedAttributes = {};
|
9301 | |
9302 |
|
9303 |
|
9304 | this.buttonType = 'button';
|
9305 | |
9306 |
|
9307 |
|
9308 | this.disabled = false;
|
9309 | |
9310 |
|
9311 |
|
9312 |
|
9313 | this.routerDirection = 'forward';
|
9314 | |
9315 |
|
9316 |
|
9317 | this.strong = false;
|
9318 | |
9319 |
|
9320 |
|
9321 | this.type = 'button';
|
9322 | this.handleClick = (ev) => {
|
9323 | if (this.type === 'button') {
|
9324 | openURL(this.href, ev, this.routerDirection, this.routerAnimation);
|
9325 | }
|
9326 | else if (hasShadowDom(this.el)) {
|
9327 |
|
9328 |
|
9329 |
|
9330 | const form = this.el.closest('form');
|
9331 | if (form) {
|
9332 | ev.preventDefault();
|
9333 | const fakeButton = document.createElement('button');
|
9334 | fakeButton.type = this.type;
|
9335 | fakeButton.style.display = 'none';
|
9336 | form.appendChild(fakeButton);
|
9337 | fakeButton.click();
|
9338 | fakeButton.remove();
|
9339 | }
|
9340 | }
|
9341 | };
|
9342 | this.onFocus = () => {
|
9343 | this.ionFocus.emit();
|
9344 | };
|
9345 | this.onBlur = () => {
|
9346 | this.ionBlur.emit();
|
9347 | };
|
9348 | }
|
9349 | componentWillLoad() {
|
9350 | this.inToolbar = !!this.el.closest('ion-buttons');
|
9351 | this.inListHeader = !!this.el.closest('ion-list-header');
|
9352 | this.inItem = !!this.el.closest('ion-item') || !!this.el.closest('ion-item-divider');
|
9353 | this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
9354 | }
|
9355 | get hasIconOnly() {
|
9356 | return !!this.el.querySelector('[slot="icon-only"]');
|
9357 | }
|
9358 | get rippleType() {
|
9359 | const hasClearFill = this.fill === undefined || this.fill === 'clear';
|
9360 |
|
9361 |
|
9362 | if (hasClearFill && this.hasIconOnly && this.inToolbar) {
|
9363 | return 'unbounded';
|
9364 | }
|
9365 | return 'bounded';
|
9366 | }
|
9367 | render() {
|
9368 | const mode = getIonMode$1(this);
|
9369 | const { buttonType, type, disabled, rel, target, size, href, color, expand, hasIconOnly, shape, strong, inheritedAttributes } = this;
|
9370 | const finalSize = size === undefined && this.inItem ? 'small' : size;
|
9371 | const TagType = href === undefined ? 'button' : 'a';
|
9372 | const attrs = (TagType === 'button')
|
9373 | ? { type }
|
9374 | : {
|
9375 | download: this.download,
|
9376 | href,
|
9377 | rel,
|
9378 | target
|
9379 | };
|
9380 | let fill = this.fill;
|
9381 | if (fill === undefined) {
|
9382 | fill = this.inToolbar || this.inListHeader ? 'clear' : 'solid';
|
9383 | }
|
9384 | return (hAsync(Host, { onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: createColorClasses$1(color, {
|
9385 | [mode]: true,
|
9386 | [buttonType]: true,
|
9387 | [`${buttonType}-${expand}`]: expand !== undefined,
|
9388 | [`${buttonType}-${finalSize}`]: finalSize !== undefined,
|
9389 | [`${buttonType}-${shape}`]: shape !== undefined,
|
9390 | [`${buttonType}-${fill}`]: true,
|
9391 | [`${buttonType}-strong`]: strong,
|
9392 | 'in-toolbar': hostContext('ion-toolbar', this.el),
|
9393 | 'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
9394 | 'button-has-icon-only': hasIconOnly,
|
9395 | 'button-disabled': disabled,
|
9396 | 'ion-activatable': true,
|
9397 | 'ion-focusable': true,
|
9398 | }) }, hAsync(TagType, Object.assign({}, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }, inheritedAttributes), hAsync("span", { class: "button-inner" }, hAsync("slot", { name: "icon-only" }), hAsync("slot", { name: "start" }), hAsync("slot", null), hAsync("slot", { name: "end" })), mode === 'md' && hAsync("ion-ripple-effect", { type: this.rippleType }))));
|
9399 | }
|
9400 | get el() { return getElement(this); }
|
9401 | static get style() { return {
|
9402 | ios: buttonIosCss,
|
9403 | md: buttonMdCss
|
9404 | }; }
|
9405 | static get cmpMeta() { return {
|
9406 | "$flags$": 41,
|
9407 | "$tagName$": "ion-button",
|
9408 | "$members$": {
|
9409 | "color": [513],
|
9410 | "buttonType": [1025, "button-type"],
|
9411 | "disabled": [516],
|
9412 | "expand": [513],
|
9413 | "fill": [1537],
|
9414 | "routerDirection": [1, "router-direction"],
|
9415 | "routerAnimation": [16],
|
9416 | "download": [1],
|
9417 | "href": [1],
|
9418 | "rel": [1],
|
9419 | "shape": [513],
|
9420 | "size": [513],
|
9421 | "strong": [4],
|
9422 | "target": [1],
|
9423 | "type": [1]
|
9424 | },
|
9425 | "$listeners$": undefined,
|
9426 | "$lazyBundleId$": "-",
|
9427 | "$attrsToReflect$": [["color", "color"], ["disabled", "disabled"], ["expand", "expand"], ["fill", "fill"], ["shape", "shape"], ["size", "size"]]
|
9428 | }; }
|
9429 | }
|
9430 |
|
9431 | const buttonsIosCss = ".sc-ion-buttons-ios-h{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:99}.sc-ion-buttons-ios-s ion-button{--padding-top:0;--padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-buttons-ios-s ion-button{--padding-start:5px;--padding-end:5px;margin-left:2px;margin-right:2px;height:32px;font-size:17px;font-weight:400}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-ios-s ion-button{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}.sc-ion-buttons-ios-s ion-button:not(.button-round){--border-radius:4px}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button{--color:initial;--border-color:initial;--background-focused:var(--ion-color-contrast)}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button-solid,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button-solid{--background:var(--ion-color-contrast);--background-focused:#000;--background-focused-opacity:.12;--background-activated:#000;--background-activated-opacity:.12;--background-hover:var(--ion-color-base);--background-hover-opacity:0.45;--color:var(--ion-color-base);--color-focused:var(--ion-color-base)}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button-clear,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button-clear{--color-activated:var(--ion-color-contrast);--color-focused:var(--ion-color-contrast)}.sc-ion-buttons-ios-h.ion-color.sc-ion-buttons-ios-s .button-outline,.ion-color .sc-ion-buttons-ios-h.sc-ion-buttons-ios-s .button-outline{--color-activated:var(--ion-color-base);--color-focused:var(--ion-color-contrast)}.sc-ion-buttons-ios-s .button-clear,.sc-ion-buttons-ios-s .button-outline{--background-activated:transparent;--background-focused:currentColor;--background-hover:transparent}.sc-ion-buttons-ios-s .button-solid:not(.ion-color){--background-focused:#000;--background-focused-opacity:.12;--background-activated:#000;--background-activated-opacity:.12}.sc-ion-buttons-ios-s ion-icon[slot=start]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-right:0.3em;font-size:24px;line-height:0.67}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-ios-s ion-icon[slot=start]{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.sc-ion-buttons-ios-s ion-icon[slot=end]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-left:0.4em;font-size:24px;line-height:0.67}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-ios-s ion-icon[slot=end]{margin-left:unset;-webkit-margin-start:0.4em;margin-inline-start:0.4em}}.sc-ion-buttons-ios-s ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;font-size:28px;line-height:0.67}";
|
9432 |
|
9433 | const buttonsMdCss = ".sc-ion-buttons-md-h{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);z-index:99}.sc-ion-buttons-md-s ion-button{--padding-top:0;--padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.sc-ion-buttons-md-s ion-button{--padding-top:0;--padding-bottom:0;--padding-start:8px;--padding-end:8px;--box-shadow:none;margin-left:2px;margin-right:2px;height:32px;font-size:14px;font-weight:500}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-md-s ion-button{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}.sc-ion-buttons-md-s ion-button:not(.button-round){--border-radius:2px}.sc-ion-buttons-md-h.ion-color.sc-ion-buttons-md-s .button,.ion-color .sc-ion-buttons-md-h.sc-ion-buttons-md-s .button{--color:initial;--color-focused:var(--ion-color-contrast);--color-hover:var(--ion-color-contrast);--background-activated:transparent;--background-focused:var(--ion-color-contrast);--background-hover:var(--ion-color-contrast)}.sc-ion-buttons-md-h.ion-color.sc-ion-buttons-md-s .button-solid,.ion-color .sc-ion-buttons-md-h.sc-ion-buttons-md-s .button-solid{--background:var(--ion-color-contrast);--background-activated:transparent;--background-focused:var(--ion-color-shade);--background-hover:var(--ion-color-base);--color:var(--ion-color-base);--color-focused:var(--ion-color-base);--color-hover:var(--ion-color-base)}.sc-ion-buttons-md-h.ion-color.sc-ion-buttons-md-s .button-outline,.ion-color .sc-ion-buttons-md-h.sc-ion-buttons-md-s .button-outline{--border-color:var(--ion-color-contrast)}.sc-ion-buttons-md-s .button-has-icon-only.button-clear{--padding-top:12px;--padding-end:12px;--padding-bottom:12px;--padding-start:12px;--border-radius:50%;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:48px;height:48px}.sc-ion-buttons-md-s .button{--background-hover:currentColor}.sc-ion-buttons-md-s .button-solid{--color:var(--ion-toolbar-background, var(--ion-background-color, #fff));--background:var(--ion-toolbar-color, var(--ion-text-color, #424242));--background-activated:transparent;--background-focused:currentColor}.sc-ion-buttons-md-s .button-outline{--color:initial;--background:transparent;--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--border-color:currentColor}.sc-ion-buttons-md-s .button-clear{--color:initial;--background:transparent;--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor}.sc-ion-buttons-md-s ion-icon[slot=start]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-right:0.3em;font-size:1.4em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-md-s ion-icon[slot=start]{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.sc-ion-buttons-md-s ion-icon[slot=end]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;margin-left:0.4em;font-size:1.4em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-buttons-md-s ion-icon[slot=end]{margin-left:unset;-webkit-margin-start:0.4em;margin-inline-start:0.4em}}.sc-ion-buttons-md-s ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;font-size:1.8em}";
|
9434 |
|
9435 | class Buttons {
|
9436 | constructor(hostRef) {
|
9437 | registerInstance(this, hostRef);
|
9438 | |
9439 |
|
9440 |
|
9441 |
|
9442 |
|
9443 |
|
9444 |
|
9445 |
|
9446 |
|
9447 |
|
9448 |
|
9449 |
|
9450 | this.collapse = false;
|
9451 | }
|
9452 | render() {
|
9453 | const mode = getIonMode$1(this);
|
9454 | return (hAsync(Host, { class: {
|
9455 | [mode]: true,
|
9456 | ['buttons-collapse']: this.collapse
|
9457 | } }));
|
9458 | }
|
9459 | static get style() { return {
|
9460 | ios: buttonsIosCss,
|
9461 | md: buttonsMdCss
|
9462 | }; }
|
9463 | static get cmpMeta() { return {
|
9464 | "$flags$": 34,
|
9465 | "$tagName$": "ion-buttons",
|
9466 | "$members$": {
|
9467 | "collapse": [4]
|
9468 | },
|
9469 | "$listeners$": undefined,
|
9470 | "$lazyBundleId$": "-",
|
9471 | "$attrsToReflect$": []
|
9472 | }; }
|
9473 | }
|
9474 |
|
9475 | const cardIosCss = "/*!@:host*/.sc-ion-card-ios-h{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-ios-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.card-disabled)*/.card-disabled.sc-ion-card-ios-h{cursor:default;opacity:0.3;pointer-events:none}/*!@.card-native*/.card-native.sc-ion-card-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}/*!@.card-native::-moz-focus-inner*/.card-native.sc-ion-card-ios::-moz-focus-inner{border:0}/*!@button, a*/button.sc-ion-card-ios,a.sc-ion-card-ios{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-card-ios{color:var(--ripple-color)}/*!@:host*/.sc-ion-card-ios-h{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-600, #666666)));margin-left:16px;margin-right:16px;margin-top:24px;margin-bottom:24px;border-radius:8px;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:-webkit-transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);transition:-webkit-transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);transition:transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);transition:transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1), -webkit-transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);font-size:14px;-webkit-box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-card-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-card-ios-h{-webkit-transform:scale3d(0.97, 0.97, 1);transform:scale3d(0.97, 0.97, 1)}";
|
9476 |
|
9477 | const cardMdCss = "/*!@:host*/.sc-ion-card-md-h{--ion-safe-area-left:0px;--ion-safe-area-right:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-md-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.card-disabled)*/.card-disabled.sc-ion-card-md-h{cursor:default;opacity:0.3;pointer-events:none}/*!@.card-native*/.card-native.sc-ion-card-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;min-height:var(--min-height);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:inherit}/*!@.card-native::-moz-focus-inner*/.card-native.sc-ion-card-md::-moz-focus-inner{border:0}/*!@button, a*/button.sc-ion-card-md,a.sc-ion-card-md{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-card-md{color:var(--ripple-color)}/*!@:host*/.sc-ion-card-md-h{--background:var(--ion-card-background, var(--ion-item-background, var(--ion-background-color, #fff)));--color:var(--ion-card-color, var(--ion-item-color, var(--ion-color-step-550, #737373)));margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px;border-radius:4px;font-size:14px;-webkit-box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-card-md-h{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}";
|
9478 |
|
9479 |
|
9480 |
|
9481 |
|
9482 |
|
9483 |
|
9484 | class Card {
|
9485 | constructor(hostRef) {
|
9486 | registerInstance(this, hostRef);
|
9487 | |
9488 |
|
9489 |
|
9490 | this.button = false;
|
9491 | |
9492 |
|
9493 |
|
9494 | this.type = 'button';
|
9495 | |
9496 |
|
9497 |
|
9498 | this.disabled = false;
|
9499 | |
9500 |
|
9501 |
|
9502 |
|
9503 | this.routerDirection = 'forward';
|
9504 | }
|
9505 | isClickable() {
|
9506 | return (this.href !== undefined || this.button);
|
9507 | }
|
9508 | renderCard(mode) {
|
9509 | const clickable = this.isClickable();
|
9510 | if (!clickable) {
|
9511 | return [
|
9512 | hAsync("slot", null)
|
9513 | ];
|
9514 | }
|
9515 | const { href, routerAnimation, routerDirection } = this;
|
9516 | const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div';
|
9517 | const attrs = (TagType === 'button')
|
9518 | ? { type: this.type }
|
9519 | : {
|
9520 | download: this.download,
|
9521 | href: this.href,
|
9522 | rel: this.rel,
|
9523 | target: this.target
|
9524 | };
|
9525 | return (hAsync(TagType, Object.assign({}, attrs, { class: "card-native", part: "native", disabled: this.disabled, onClick: (ev) => openURL(href, ev, routerDirection, routerAnimation) }), hAsync("slot", null), clickable && mode === 'md' && hAsync("ion-ripple-effect", null)));
|
9526 | }
|
9527 | render() {
|
9528 | const mode = getIonMode$1(this);
|
9529 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
9530 | [mode]: true,
|
9531 | 'card-disabled': this.disabled,
|
9532 | 'ion-activatable': this.isClickable()
|
9533 | }) }, this.renderCard(mode)));
|
9534 | }
|
9535 | static get style() { return {
|
9536 | ios: cardIosCss,
|
9537 | md: cardMdCss
|
9538 | }; }
|
9539 | static get cmpMeta() { return {
|
9540 | "$flags$": 41,
|
9541 | "$tagName$": "ion-card",
|
9542 | "$members$": {
|
9543 | "color": [513],
|
9544 | "button": [4],
|
9545 | "type": [1],
|
9546 | "disabled": [4],
|
9547 | "download": [1],
|
9548 | "href": [1],
|
9549 | "rel": [1],
|
9550 | "routerDirection": [1, "router-direction"],
|
9551 | "routerAnimation": [16],
|
9552 | "target": [1]
|
9553 | },
|
9554 | "$listeners$": undefined,
|
9555 | "$lazyBundleId$": "-",
|
9556 | "$attrsToReflect$": [["color", "color"]]
|
9557 | }; }
|
9558 | }
|
9559 |
|
9560 | const cardContentIosCss = "ion-card-content{display:block;position:relative}.card-content-ios{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:20px;font-size:16px;line-height:1.4}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.card-content-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}.card-content-ios h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-ios h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-ios h3,.card-content-ios h4,.card-content-ios h5,.card-content-ios h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-ios p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px}ion-card-header+.card-content-ios{padding-top:0}";
|
9561 |
|
9562 | const cardContentMdCss = "ion-card-content{display:block;position:relative}.card-content-md{padding-left:16px;padding-right:16px;padding-top:13px;padding-bottom:13px;font-size:14px;line-height:1.5}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.card-content-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.card-content-md h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.card-content-md h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.card-content-md h3,.card-content-md h4,.card-content-md h5,.card-content-md h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal}.card-content-md p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:1.5}ion-card-header+.card-content-md{padding-top:0}";
|
9563 |
|
9564 |
|
9565 |
|
9566 |
|
9567 | class CardContent {
|
9568 | constructor(hostRef) {
|
9569 | registerInstance(this, hostRef);
|
9570 | }
|
9571 | render() {
|
9572 | const mode = getIonMode$1(this);
|
9573 | return (hAsync(Host, { class: {
|
9574 | [mode]: true,
|
9575 |
|
9576 | [`card-content-${mode}`]: true
|
9577 | } }));
|
9578 | }
|
9579 | static get style() { return {
|
9580 | ios: cardContentIosCss,
|
9581 | md: cardContentMdCss
|
9582 | }; }
|
9583 | static get cmpMeta() { return {
|
9584 | "$flags$": 32,
|
9585 | "$tagName$": "ion-card-content",
|
9586 | "$members$": undefined,
|
9587 | "$listeners$": undefined,
|
9588 | "$lazyBundleId$": "-",
|
9589 | "$attrsToReflect$": []
|
9590 | }; }
|
9591 | }
|
9592 |
|
9593 | const cardHeaderIosCss = "/*!@:host*/.sc-ion-card-header-ios-h{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-header-ios-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host*/.sc-ion-card-header-ios-h{padding-left:20px;padding-right:20px;padding-top:20px;padding-bottom:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-card-header-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.card-header-translucent)*/.card-header-translucent.sc-ion-card-header-ios-h{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);-webkit-backdrop-filter:saturate(180%) blur(30px);backdrop-filter:saturate(180%) blur(30px)}}";
|
9594 |
|
9595 | const cardHeaderMdCss = "/*!@:host*/.sc-ion-card-header-md-h{--background:transparent;--color:inherit;display:block;position:relative;background:var(--background);color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-header-md-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host*/.sc-ion-card-header-md-h{padding-left:16px;padding-right:16px;padding-top:16px;padding-bottom:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-card-header-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}/*!@::slotted(ion-card-title:not(:first-child)),\n::slotted(ion-card-subtitle:not(:first-child))*/.sc-ion-card-header-md-s>ion-card-title:not(:first-child),.sc-ion-card-header-md-s>ion-card-subtitle:not(:first-child){margin-top:8px}";
|
9596 |
|
9597 |
|
9598 |
|
9599 |
|
9600 | class CardHeader {
|
9601 | constructor(hostRef) {
|
9602 | registerInstance(this, hostRef);
|
9603 | |
9604 |
|
9605 |
|
9606 |
|
9607 |
|
9608 | this.translucent = false;
|
9609 | }
|
9610 | render() {
|
9611 | const mode = getIonMode$1(this);
|
9612 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
9613 | 'card-header-translucent': this.translucent,
|
9614 | 'ion-inherit-color': true,
|
9615 | [mode]: true
|
9616 | }) }, hAsync("slot", null)));
|
9617 | }
|
9618 | static get style() { return {
|
9619 | ios: cardHeaderIosCss,
|
9620 | md: cardHeaderMdCss
|
9621 | }; }
|
9622 | static get cmpMeta() { return {
|
9623 | "$flags$": 41,
|
9624 | "$tagName$": "ion-card-header",
|
9625 | "$members$": {
|
9626 | "color": [513],
|
9627 | "translucent": [4]
|
9628 | },
|
9629 | "$listeners$": undefined,
|
9630 | "$lazyBundleId$": "-",
|
9631 | "$attrsToReflect$": [["color", "color"]]
|
9632 | }; }
|
9633 | }
|
9634 |
|
9635 | const cardSubtitleIosCss = "/*!@:host*/.sc-ion-card-subtitle-ios-h{display:block;position:relative;color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-subtitle-ios-h{color:var(--ion-color-base)}/*!@:host*/.sc-ion-card-subtitle-ios-h{--color:var(--ion-color-step-600, #666666);margin-left:0;margin-right:0;margin-top:0;margin-bottom:4px;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:12px;font-weight:700;letter-spacing:0.4px;text-transform:uppercase}";
|
9636 |
|
9637 | const cardSubtitleMdCss = "/*!@:host*/.sc-ion-card-subtitle-md-h{display:block;position:relative;color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-subtitle-md-h{color:var(--ion-color-base)}/*!@:host*/.sc-ion-card-subtitle-md-h{--color:var(--ion-color-step-550, #737373);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:14px;font-weight:500}";
|
9638 |
|
9639 |
|
9640 |
|
9641 |
|
9642 | class CardSubtitle {
|
9643 | constructor(hostRef) {
|
9644 | registerInstance(this, hostRef);
|
9645 | }
|
9646 | render() {
|
9647 | const mode = getIonMode$1(this);
|
9648 | return (hAsync(Host, { role: "heading", "aria-level": "3", class: createColorClasses$1(this.color, {
|
9649 | 'ion-inherit-color': true,
|
9650 | [mode]: true
|
9651 | }) }, hAsync("slot", null)));
|
9652 | }
|
9653 | static get style() { return {
|
9654 | ios: cardSubtitleIosCss,
|
9655 | md: cardSubtitleMdCss
|
9656 | }; }
|
9657 | static get cmpMeta() { return {
|
9658 | "$flags$": 41,
|
9659 | "$tagName$": "ion-card-subtitle",
|
9660 | "$members$": {
|
9661 | "color": [513]
|
9662 | },
|
9663 | "$listeners$": undefined,
|
9664 | "$lazyBundleId$": "-",
|
9665 | "$attrsToReflect$": [["color", "color"]]
|
9666 | }; }
|
9667 | }
|
9668 |
|
9669 | const cardTitleIosCss = "/*!@:host*/.sc-ion-card-title-ios-h{display:block;position:relative;color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-title-ios-h{color:var(--ion-color-base)}/*!@:host*/.sc-ion-card-title-ios-h{--color:var(--ion-text-color, #000);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:28px;font-weight:700;line-height:1.2}";
|
9670 |
|
9671 | const cardTitleMdCss = "/*!@:host*/.sc-ion-card-title-md-h{display:block;position:relative;color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-card-title-md-h{color:var(--ion-color-base)}/*!@:host*/.sc-ion-card-title-md-h{--color:var(--ion-color-step-850, #262626);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;line-height:1.2}";
|
9672 |
|
9673 |
|
9674 |
|
9675 |
|
9676 | class CardTitle {
|
9677 | constructor(hostRef) {
|
9678 | registerInstance(this, hostRef);
|
9679 | }
|
9680 | render() {
|
9681 | const mode = getIonMode$1(this);
|
9682 | return (hAsync(Host, { role: "heading", "aria-level": "2", class: createColorClasses$1(this.color, {
|
9683 | 'ion-inherit-color': true,
|
9684 | [mode]: true
|
9685 | }) }, hAsync("slot", null)));
|
9686 | }
|
9687 | static get style() { return {
|
9688 | ios: cardTitleIosCss,
|
9689 | md: cardTitleMdCss
|
9690 | }; }
|
9691 | static get cmpMeta() { return {
|
9692 | "$flags$": 41,
|
9693 | "$tagName$": "ion-card-title",
|
9694 | "$members$": {
|
9695 | "color": [513]
|
9696 | },
|
9697 | "$listeners$": undefined,
|
9698 | "$lazyBundleId$": "-",
|
9699 | "$attrsToReflect$": [["color", "color"]]
|
9700 | }; }
|
9701 | }
|
9702 |
|
9703 | const checkboxIosCss = "/*!@:host*/.sc-ion-checkbox-ios-h{--background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.ion-color)*/.ion-color.sc-ion-checkbox-ios-h{--background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}/*!@label*/label.sc-ion-checkbox-ios{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-checkbox-ios label.sc-ion-checkbox-ios,[dir=rtl].sc-ion-checkbox-ios-h label.sc-ion-checkbox-ios,[dir=rtl] .sc-ion-checkbox-ios-h label.sc-ion-checkbox-ios{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-checkbox-ios::-moz-focus-inner{border:0}/*!@input*/input.sc-ion-checkbox-ios{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@.checkbox-icon*/.checkbox-icon.sc-ion-checkbox-ios{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-sizing:border-box;box-sizing:border-box}/*!@.checkbox-icon path*/.checkbox-icon.sc-ion-checkbox-ios path.sc-ion-checkbox-ios{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}/*!@:host(.checkbox-checked) .checkbox-icon,\n:host(.checkbox-indeterminate) .checkbox-icon*/.checkbox-checked.sc-ion-checkbox-ios-h .checkbox-icon.sc-ion-checkbox-ios,.checkbox-indeterminate.sc-ion-checkbox-ios-h .checkbox-icon.sc-ion-checkbox-ios{border-color:var(--border-color-checked);background:var(--background-checked)}/*!@:host(.checkbox-checked) .checkbox-icon path,\n:host(.checkbox-indeterminate) .checkbox-icon path*/.checkbox-checked.sc-ion-checkbox-ios-h .checkbox-icon.sc-ion-checkbox-ios path.sc-ion-checkbox-ios,.checkbox-indeterminate.sc-ion-checkbox-ios-h .checkbox-icon.sc-ion-checkbox-ios path.sc-ion-checkbox-ios{opacity:1}/*!@:host(.checkbox-disabled)*/.checkbox-disabled.sc-ion-checkbox-ios-h{pointer-events:none}/*!@:host*/.sc-ion-checkbox-ios-h{--border-radius:50%;--border-width:1px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.23);--background:var(--ion-item-background, var(--ion-background-color, #fff));--size:26px;width:var(--size);height:var(--size)}/*!@:host(.checkbox-disabled)*/.checkbox-disabled.sc-ion-checkbox-ios-h{opacity:0.3}/*!@:host(.in-item)*/.in-item.sc-ion-checkbox-ios-h{margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:9px;display:block;position:static}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item)*/.in-item.sc-ion-checkbox-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-checkbox-ios-h{margin-left:2px;margin-right:20px;margin-top:8px;margin-bottom:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-checkbox-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:20px;margin-inline-end:20px}}";
|
9704 |
|
9705 | const checkboxMdCss = "/*!@:host*/.sc-ion-checkbox-md-h{--background-checked:var(--ion-color-primary, #3880ff);--border-color-checked:var(--ion-color-primary, #3880ff);--checkmark-color:var(--ion-color-primary-contrast, #fff);--checkmark-width:1;--transition:none;display:inline-block;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.ion-color)*/.ion-color.sc-ion-checkbox-md-h{--background-checked:var(--ion-color-base);--border-color-checked:var(--ion-color-base);--checkmark-color:var(--ion-color-contrast)}/*!@label*/label.sc-ion-checkbox-md{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-checkbox-md label.sc-ion-checkbox-md,[dir=rtl].sc-ion-checkbox-md-h label.sc-ion-checkbox-md,[dir=rtl] .sc-ion-checkbox-md-h label.sc-ion-checkbox-md{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-checkbox-md::-moz-focus-inner{border:0}/*!@input*/input.sc-ion-checkbox-md{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@.checkbox-icon*/.checkbox-icon.sc-ion-checkbox-md{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-sizing:border-box;box-sizing:border-box}/*!@.checkbox-icon path*/.checkbox-icon.sc-ion-checkbox-md path.sc-ion-checkbox-md{fill:none;stroke:var(--checkmark-color);stroke-width:var(--checkmark-width);opacity:0}/*!@:host(.checkbox-checked) .checkbox-icon,\n:host(.checkbox-indeterminate) .checkbox-icon*/.checkbox-checked.sc-ion-checkbox-md-h .checkbox-icon.sc-ion-checkbox-md,.checkbox-indeterminate.sc-ion-checkbox-md-h .checkbox-icon.sc-ion-checkbox-md{border-color:var(--border-color-checked);background:var(--background-checked)}/*!@:host(.checkbox-checked) .checkbox-icon path,\n:host(.checkbox-indeterminate) .checkbox-icon path*/.checkbox-checked.sc-ion-checkbox-md-h .checkbox-icon.sc-ion-checkbox-md path.sc-ion-checkbox-md,.checkbox-indeterminate.sc-ion-checkbox-md-h .checkbox-icon.sc-ion-checkbox-md path.sc-ion-checkbox-md{opacity:1}/*!@:host(.checkbox-disabled)*/.checkbox-disabled.sc-ion-checkbox-md-h{pointer-events:none}/*!@:host*/.sc-ion-checkbox-md-h{--border-radius:calc(var(--size) * .125);--border-width:2px;--border-style:solid;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.51);--checkmark-width:3;--background:var(--ion-item-background, var(--ion-background-color, #fff));--transition:background 180ms cubic-bezier(0.4, 0, 0.2, 1);--size:18px;width:var(--size);height:var(--size)}/*!@.checkbox-icon path*/.checkbox-icon.sc-ion-checkbox-md path.sc-ion-checkbox-md{stroke-dasharray:30;stroke-dashoffset:30}/*!@:host(.checkbox-checked) .checkbox-icon path,\n:host(.checkbox-indeterminate) .checkbox-icon path*/.checkbox-checked.sc-ion-checkbox-md-h .checkbox-icon.sc-ion-checkbox-md path.sc-ion-checkbox-md,.checkbox-indeterminate.sc-ion-checkbox-md-h .checkbox-icon.sc-ion-checkbox-md path.sc-ion-checkbox-md{stroke-dashoffset:0;-webkit-transition:stroke-dashoffset 90ms linear 90ms;transition:stroke-dashoffset 90ms linear 90ms}/*!@:host(.checkbox-disabled)*/.checkbox-disabled.sc-ion-checkbox-md-h{opacity:0.3}/*!@:host(.in-item)*/.in-item.sc-ion-checkbox-md-h{margin-left:0;margin-right:0;margin-top:18px;margin-bottom:18px;display:block;position:static}/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-checkbox-md-h{margin-left:4px;margin-right:36px;margin-top:18px;margin-bottom:18px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-checkbox-md-h{margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px}}";
|
9706 |
|
9707 |
|
9708 |
|
9709 |
|
9710 |
|
9711 |
|
9712 |
|
9713 | class Checkbox {
|
9714 | constructor(hostRef) {
|
9715 | registerInstance(this, hostRef);
|
9716 | this.ionChange = createEvent(this, "ionChange", 7);
|
9717 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
9718 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
9719 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
9720 | this.inputId = `ion-cb-${checkboxIds++}`;
|
9721 | |
9722 |
|
9723 |
|
9724 | this.name = this.inputId;
|
9725 | |
9726 |
|
9727 |
|
9728 | this.checked = false;
|
9729 | |
9730 |
|
9731 |
|
9732 | this.indeterminate = false;
|
9733 | |
9734 |
|
9735 |
|
9736 | this.disabled = false;
|
9737 | |
9738 |
|
9739 |
|
9740 |
|
9741 |
|
9742 |
|
9743 |
|
9744 | this.value = 'on';
|
9745 | this.onClick = (ev) => {
|
9746 | ev.preventDefault();
|
9747 | this.setFocus();
|
9748 | this.checked = !this.checked;
|
9749 | this.indeterminate = false;
|
9750 | };
|
9751 | this.onFocus = () => {
|
9752 | this.ionFocus.emit();
|
9753 | };
|
9754 | this.onBlur = () => {
|
9755 | this.ionBlur.emit();
|
9756 | };
|
9757 | }
|
9758 | componentWillLoad() {
|
9759 | this.emitStyle();
|
9760 | }
|
9761 | checkedChanged(isChecked) {
|
9762 | this.ionChange.emit({
|
9763 | checked: isChecked,
|
9764 | value: this.value
|
9765 | });
|
9766 | this.emitStyle();
|
9767 | }
|
9768 | disabledChanged() {
|
9769 | this.emitStyle();
|
9770 | }
|
9771 | emitStyle() {
|
9772 | this.ionStyle.emit({
|
9773 | 'checkbox-checked': this.checked,
|
9774 | 'interactive-disabled': this.disabled,
|
9775 | });
|
9776 | }
|
9777 | setFocus() {
|
9778 | if (this.focusEl) {
|
9779 | this.focusEl.focus();
|
9780 | }
|
9781 | }
|
9782 | render() {
|
9783 | const { color, checked, disabled, el, indeterminate, inputId, name, value } = this;
|
9784 | const mode = getIonMode$1(this);
|
9785 | const { label, labelId, labelText } = getAriaLabel(el, inputId);
|
9786 | renderHiddenInput(true, el, name, (checked ? value : ''), disabled);
|
9787 | let path = indeterminate
|
9788 | ? hAsync("path", { d: "M6 12L18 12", part: "mark" })
|
9789 | : hAsync("path", { d: "M5.9,12.5l3.8,3.8l8.8-8.8", part: "mark" });
|
9790 | if (mode === 'md') {
|
9791 | path = indeterminate
|
9792 | ? hAsync("path", { d: "M2 12H22", part: "mark" })
|
9793 | : hAsync("path", { d: "M1.73,12.91 8.1,19.28 22.79,4.59", part: "mark" });
|
9794 | }
|
9795 | return (hAsync(Host, { onClick: this.onClick, "aria-labelledby": label ? labelId : null, "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, role: "checkbox", class: createColorClasses$1(color, {
|
9796 | [mode]: true,
|
9797 | 'in-item': hostContext('ion-item', el),
|
9798 | 'checkbox-checked': checked,
|
9799 | 'checkbox-disabled': disabled,
|
9800 | 'checkbox-indeterminate': indeterminate,
|
9801 | 'interactive': true
|
9802 | }) }, hAsync("svg", { class: "checkbox-icon", viewBox: "0 0 24 24", part: "container" }, path), hAsync("label", { htmlFor: inputId }, labelText), hAsync("input", { type: "checkbox", "aria-checked": `${checked}`, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: focusEl => this.focusEl = focusEl })));
|
9803 | }
|
9804 | get el() { return getElement(this); }
|
9805 | static get watchers() { return {
|
9806 | "checked": ["checkedChanged"],
|
9807 | "disabled": ["disabledChanged"]
|
9808 | }; }
|
9809 | static get style() { return {
|
9810 | ios: checkboxIosCss,
|
9811 | md: checkboxMdCss
|
9812 | }; }
|
9813 | static get cmpMeta() { return {
|
9814 | "$flags$": 41,
|
9815 | "$tagName$": "ion-checkbox",
|
9816 | "$members$": {
|
9817 | "color": [513],
|
9818 | "name": [1],
|
9819 | "checked": [1028],
|
9820 | "indeterminate": [1028],
|
9821 | "disabled": [4],
|
9822 | "value": [1]
|
9823 | },
|
9824 | "$listeners$": undefined,
|
9825 | "$lazyBundleId$": "-",
|
9826 | "$attrsToReflect$": [["color", "color"]]
|
9827 | }; }
|
9828 | }
|
9829 | let checkboxIds = 0;
|
9830 |
|
9831 | const chipIosCss = "/*!@:host*/.sc-ion-chip-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.87);border-radius:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:4px;margin-right:4px;margin-top:4px;margin-bottom:4px;padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px;display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;height:32px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:14px;line-height:1;cursor:pointer;overflow:hidden;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-chip-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:4px;margin-inline-end:4px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-chip-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}/*!@:host(.chip-disabled)*/.chip-disabled.sc-ion-chip-ios-h{cursor:default;opacity:0.4;pointer-events:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-chip-ios-h{background:rgba(var(--ion-color-base-rgb), 0.08);color:var(--ion-color-shade)}/*!@:host(.ion-color:focus)*/.ion-color.sc-ion-chip-ios-h:focus{background:rgba(var(--ion-color-base-rgb), 0.12)}/*!@:host(.ion-color.ion-activated)*/.ion-color.ion-activated.sc-ion-chip-ios-h{background:rgba(var(--ion-color-base-rgb), 0.16)}/*!@:host(.chip-outline)*/.chip-outline.sc-ion-chip-ios-h{border-width:1px;border-style:solid}/*!@:host(.chip-outline)*/.chip-outline.sc-ion-chip-ios-h{border-color:rgba(0, 0, 0, 0.32);background:transparent}/*!@:host(.chip-outline.ion-color)*/.chip-outline.ion-color.sc-ion-chip-ios-h{border-color:rgba(var(--ion-color-base-rgb), 0.32)}/*!@:host(.chip-outline:not(.ion-color):focus)*/.chip-outline.sc-ion-chip-ios-h:not(.ion-color):focus{background:rgba(0, 0, 0, 0.04)}/*!@:host(.chip-outline.ion-activated:not(.ion-color))*/.chip-outline.ion-activated.sc-ion-chip-ios-h:not(.ion-color){background:rgba(0, 0, 0, 0.08)}/*!@::slotted(ion-icon)*/.sc-ion-chip-ios-s>ion-icon{font-size:20px}/*!@:host(:not(.ion-color)) ::slotted(ion-icon)*/.sc-ion-chip-ios-h:not(.ion-color) .sc-ion-chip-ios-s>ion-icon{color:rgba(0, 0, 0, 0.54)}/*!@::slotted(ion-icon:first-child)*/.sc-ion-chip-ios-s>ion-icon:first-child{margin-left:-4px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon:first-child)*/.sc-ion-chip-ios-s>ion-icon:first-child{margin-left:unset;margin-right:unset;-webkit-margin-start:-4px;margin-inline-start:-4px;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@::slotted(ion-icon:last-child)*/.sc-ion-chip-ios-s>ion-icon:last-child{margin-left:8px;margin-right:-4px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon:last-child)*/.sc-ion-chip-ios-s>ion-icon:last-child{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-4px;margin-inline-end:-4px}}/*!@::slotted(ion-avatar)*/.sc-ion-chip-ios-s>ion-avatar{width:24px;height:24px}/*!@::slotted(ion-avatar:first-child)*/.sc-ion-chip-ios-s>ion-avatar:first-child{margin-left:-8px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar:first-child)*/.sc-ion-chip-ios-s>ion-avatar:first-child{margin-left:unset;margin-right:unset;-webkit-margin-start:-8px;margin-inline-start:-8px;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@::slotted(ion-avatar:last-child)*/.sc-ion-chip-ios-s>ion-avatar:last-child{margin-left:8px;margin-right:-8px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar:last-child)*/.sc-ion-chip-ios-s>ion-avatar:last-child{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-8px;margin-inline-end:-8px}}/*!@:host(:focus)*/.sc-ion-chip-ios-h:focus{outline:none}/*!@:host(:focus)*/.sc-ion-chip-ios-h:focus{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-chip-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}@media (any-hover: hover){/*!@:host(:hover)*/.sc-ion-chip-ios-h:hover{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}/*!@:host(.ion-color:hover)*/.ion-color.sc-ion-chip-ios-h:hover{background:rgba(var(--ion-color-base-rgb), 0.12)}/*!@:host(.chip-outline:not(.ion-color):hover)*/.chip-outline.sc-ion-chip-ios-h:not(.ion-color):hover{background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}}";
|
9832 |
|
9833 | const chipMdCss = "/*!@:host*/.sc-ion-chip-md-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.87);border-radius:16px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:4px;margin-right:4px;margin-top:4px;margin-bottom:4px;padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px;display:-ms-inline-flexbox;display:inline-flex;position:relative;-ms-flex-align:center;align-items:center;height:32px;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);font-size:14px;line-height:1;cursor:pointer;overflow:hidden;vertical-align:middle;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-chip-md-h{margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:4px;margin-inline-end:4px}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-chip-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}/*!@:host(.chip-disabled)*/.chip-disabled.sc-ion-chip-md-h{cursor:default;opacity:0.4;pointer-events:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-chip-md-h{background:rgba(var(--ion-color-base-rgb), 0.08);color:var(--ion-color-shade)}/*!@:host(.ion-color:focus)*/.ion-color.sc-ion-chip-md-h:focus{background:rgba(var(--ion-color-base-rgb), 0.12)}/*!@:host(.ion-color.ion-activated)*/.ion-color.ion-activated.sc-ion-chip-md-h{background:rgba(var(--ion-color-base-rgb), 0.16)}/*!@:host(.chip-outline)*/.chip-outline.sc-ion-chip-md-h{border-width:1px;border-style:solid}/*!@:host(.chip-outline)*/.chip-outline.sc-ion-chip-md-h{border-color:rgba(0, 0, 0, 0.32);background:transparent}/*!@:host(.chip-outline.ion-color)*/.chip-outline.ion-color.sc-ion-chip-md-h{border-color:rgba(var(--ion-color-base-rgb), 0.32)}/*!@:host(.chip-outline:not(.ion-color):focus)*/.chip-outline.sc-ion-chip-md-h:not(.ion-color):focus{background:rgba(0, 0, 0, 0.04)}/*!@:host(.chip-outline.ion-activated:not(.ion-color))*/.chip-outline.ion-activated.sc-ion-chip-md-h:not(.ion-color){background:rgba(0, 0, 0, 0.08)}/*!@::slotted(ion-icon)*/.sc-ion-chip-md-s>ion-icon{font-size:20px}/*!@:host(:not(.ion-color)) ::slotted(ion-icon)*/.sc-ion-chip-md-h:not(.ion-color) .sc-ion-chip-md-s>ion-icon{color:rgba(0, 0, 0, 0.54)}/*!@::slotted(ion-icon:first-child)*/.sc-ion-chip-md-s>ion-icon:first-child{margin-left:-4px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon:first-child)*/.sc-ion-chip-md-s>ion-icon:first-child{margin-left:unset;margin-right:unset;-webkit-margin-start:-4px;margin-inline-start:-4px;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@::slotted(ion-icon:last-child)*/.sc-ion-chip-md-s>ion-icon:last-child{margin-left:8px;margin-right:-4px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon:last-child)*/.sc-ion-chip-md-s>ion-icon:last-child{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-4px;margin-inline-end:-4px}}/*!@::slotted(ion-avatar)*/.sc-ion-chip-md-s>ion-avatar{width:24px;height:24px}/*!@::slotted(ion-avatar:first-child)*/.sc-ion-chip-md-s>ion-avatar:first-child{margin-left:-8px;margin-right:8px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar:first-child)*/.sc-ion-chip-md-s>ion-avatar:first-child{margin-left:unset;margin-right:unset;-webkit-margin-start:-8px;margin-inline-start:-8px;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@::slotted(ion-avatar:last-child)*/.sc-ion-chip-md-s>ion-avatar:last-child{margin-left:8px;margin-right:-8px;margin-top:-4px;margin-bottom:-4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar:last-child)*/.sc-ion-chip-md-s>ion-avatar:last-child{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:-8px;margin-inline-end:-8px}}/*!@:host(:focus)*/.sc-ion-chip-md-h:focus{outline:none}/*!@:host(:focus)*/.sc-ion-chip-md-h:focus{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-chip-md-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}@media (any-hover: hover){/*!@:host(:hover)*/.sc-ion-chip-md-h:hover{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.16)}/*!@:host(.ion-color:hover)*/.ion-color.sc-ion-chip-md-h:hover{background:rgba(var(--ion-color-base-rgb), 0.12)}/*!@:host(.chip-outline:not(.ion-color):hover)*/.chip-outline.sc-ion-chip-md-h:not(.ion-color):hover{background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.04)}}";
|
9834 |
|
9835 |
|
9836 |
|
9837 |
|
9838 | class Chip {
|
9839 | constructor(hostRef) {
|
9840 | registerInstance(this, hostRef);
|
9841 | |
9842 |
|
9843 |
|
9844 | this.outline = false;
|
9845 | |
9846 |
|
9847 |
|
9848 | this.disabled = false;
|
9849 | }
|
9850 | render() {
|
9851 | const mode = getIonMode$1(this);
|
9852 | return (hAsync(Host, { "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
9853 | [mode]: true,
|
9854 | 'chip-outline': this.outline,
|
9855 | 'chip-disabled': this.disabled,
|
9856 | 'ion-activatable': true,
|
9857 | }) }, hAsync("slot", null), mode === 'md' && hAsync("ion-ripple-effect", null)));
|
9858 | }
|
9859 | static get style() { return {
|
9860 | ios: chipIosCss,
|
9861 | md: chipMdCss
|
9862 | }; }
|
9863 | static get cmpMeta() { return {
|
9864 | "$flags$": 41,
|
9865 | "$tagName$": "ion-chip",
|
9866 | "$members$": {
|
9867 | "color": [513],
|
9868 | "outline": [4],
|
9869 | "disabled": [4]
|
9870 | },
|
9871 | "$listeners$": undefined,
|
9872 | "$lazyBundleId$": "-",
|
9873 | "$attrsToReflect$": [["color", "color"]]
|
9874 | }; }
|
9875 | }
|
9876 |
|
9877 | const SIZE_TO_MEDIA = {
|
9878 | 'xs': '(min-width: 0px)',
|
9879 | 'sm': '(min-width: 576px)',
|
9880 | 'md': '(min-width: 768px)',
|
9881 | 'lg': '(min-width: 992px)',
|
9882 | 'xl': '(min-width: 1200px)',
|
9883 | };
|
9884 |
|
9885 |
|
9886 |
|
9887 | const matchBreakpoint = (breakpoint) => {
|
9888 | if (breakpoint === undefined || breakpoint === '') {
|
9889 | return true;
|
9890 | }
|
9891 | if (window.matchMedia) {
|
9892 | const mediaQuery = SIZE_TO_MEDIA[breakpoint];
|
9893 | return window.matchMedia(mediaQuery).matches;
|
9894 | }
|
9895 | return false;
|
9896 | };
|
9897 |
|
9898 | const colCss = "/*!@:host*/.sc-ion-col-h{padding-left:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;width:100%;max-width:100%;min-height:1px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-col-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xs, var(--ion-grid-column-padding, 5px))}}@media (min-width: 576px){/*!@:host*/.sc-ion-col-h{padding-left:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-col (margin-inline-start.sc-ion-col: 0).sc-ion-col or.sc-ion-col (-webkit-margin-start.sc-ion-col: 0).sc-ion-col{.sc-ion-col-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-sm, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 768px){/*!@:host*/.sc-ion-col-h{padding-left:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-col (margin-inline-start.sc-ion-col: 0).sc-ion-col or.sc-ion-col (-webkit-margin-start.sc-ion-col: 0).sc-ion-col{.sc-ion-col-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-md, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 992px){/*!@:host*/.sc-ion-col-h{padding-left:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-col (margin-inline-start.sc-ion-col: 0).sc-ion-col or.sc-ion-col (-webkit-margin-start.sc-ion-col: 0).sc-ion-col{.sc-ion-col-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-lg, var(--ion-grid-column-padding, 5px))}}}@media (min-width: 1200px){/*!@:host*/.sc-ion-col-h{padding-left:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-right:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-top:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-bottom:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-col (margin-inline-start.sc-ion-col: 0).sc-ion-col or.sc-ion-col (-webkit-margin-start.sc-ion-col: 0).sc-ion-col{.sc-ion-col-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-start:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));-webkit-padding-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px));padding-inline-end:var(--ion-grid-column-padding-xl, var(--ion-grid-column-padding, 5px))}}}";
|
9899 |
|
9900 | const win$1 = window;
|
9901 | const SUPPORTS_VARS = !!(win$1.CSS && win$1.CSS.supports && win$1.CSS.supports('--a: 0'));
|
9902 | const BREAKPOINTS = ['', 'xs', 'sm', 'md', 'lg', 'xl'];
|
9903 | class Col {
|
9904 | constructor(hostRef) {
|
9905 | registerInstance(this, hostRef);
|
9906 | }
|
9907 | onResize() {
|
9908 | forceUpdate$1(this);
|
9909 | }
|
9910 |
|
9911 |
|
9912 | getColumns(property) {
|
9913 | let matched;
|
9914 | for (const breakpoint of BREAKPOINTS) {
|
9915 | const matches = matchBreakpoint(breakpoint);
|
9916 |
|
9917 |
|
9918 | const columns = this[property + breakpoint.charAt(0).toUpperCase() + breakpoint.slice(1)];
|
9919 | if (matches && columns !== undefined) {
|
9920 | matched = columns;
|
9921 | }
|
9922 | }
|
9923 |
|
9924 |
|
9925 | return matched;
|
9926 | }
|
9927 | calculateSize() {
|
9928 | const columns = this.getColumns('size');
|
9929 |
|
9930 |
|
9931 |
|
9932 |
|
9933 | if (!columns || columns === '') {
|
9934 | return;
|
9935 | }
|
9936 |
|
9937 | const colSize = (columns === 'auto')
|
9938 | ? 'auto'
|
9939 |
|
9940 | : SUPPORTS_VARS ? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`
|
9941 |
|
9942 |
|
9943 | : ((columns / 12) * 100) + '%';
|
9944 | return {
|
9945 | 'flex': `0 0 ${colSize}`,
|
9946 | 'width': `${colSize}`,
|
9947 | 'max-width': `${colSize}`
|
9948 | };
|
9949 | }
|
9950 |
|
9951 | calculatePosition(property, modifier) {
|
9952 | const columns = this.getColumns(property);
|
9953 | if (!columns) {
|
9954 | return;
|
9955 | }
|
9956 |
|
9957 |
|
9958 | const amount = SUPPORTS_VARS
|
9959 |
|
9960 | ? `calc(calc(${columns} / var(--ion-grid-columns, 12)) * 100%)`
|
9961 |
|
9962 |
|
9963 | : (columns > 0 && columns < 12) ? (columns / 12 * 100) + '%' : 'auto';
|
9964 | return {
|
9965 | [modifier]: amount
|
9966 | };
|
9967 | }
|
9968 | calculateOffset(isRTL) {
|
9969 | return this.calculatePosition('offset', isRTL ? 'margin-right' : 'margin-left');
|
9970 | }
|
9971 | calculatePull(isRTL) {
|
9972 | return this.calculatePosition('pull', isRTL ? 'left' : 'right');
|
9973 | }
|
9974 | calculatePush(isRTL) {
|
9975 | return this.calculatePosition('push', isRTL ? 'right' : 'left');
|
9976 | }
|
9977 | render() {
|
9978 | const isRTL = document.dir === 'rtl';
|
9979 | const mode = getIonMode$1(this);
|
9980 | return (hAsync(Host, { class: {
|
9981 | [mode]: true
|
9982 | }, style: Object.assign(Object.assign(Object.assign(Object.assign({}, this.calculateOffset(isRTL)), this.calculatePull(isRTL)), this.calculatePush(isRTL)), this.calculateSize()) }, hAsync("slot", null)));
|
9983 | }
|
9984 | static get style() { return colCss; }
|
9985 | static get cmpMeta() { return {
|
9986 | "$flags$": 9,
|
9987 | "$tagName$": "ion-col",
|
9988 | "$members$": {
|
9989 | "offset": [1],
|
9990 | "offsetXs": [1, "offset-xs"],
|
9991 | "offsetSm": [1, "offset-sm"],
|
9992 | "offsetMd": [1, "offset-md"],
|
9993 | "offsetLg": [1, "offset-lg"],
|
9994 | "offsetXl": [1, "offset-xl"],
|
9995 | "pull": [1],
|
9996 | "pullXs": [1, "pull-xs"],
|
9997 | "pullSm": [1, "pull-sm"],
|
9998 | "pullMd": [1, "pull-md"],
|
9999 | "pullLg": [1, "pull-lg"],
|
10000 | "pullXl": [1, "pull-xl"],
|
10001 | "push": [1],
|
10002 | "pushXs": [1, "push-xs"],
|
10003 | "pushSm": [1, "push-sm"],
|
10004 | "pushMd": [1, "push-md"],
|
10005 | "pushLg": [1, "push-lg"],
|
10006 | "pushXl": [1, "push-xl"],
|
10007 | "size": [1],
|
10008 | "sizeXs": [1, "size-xs"],
|
10009 | "sizeSm": [1, "size-sm"],
|
10010 | "sizeMd": [1, "size-md"],
|
10011 | "sizeLg": [1, "size-lg"],
|
10012 | "sizeXl": [1, "size-xl"]
|
10013 | },
|
10014 | "$listeners$": [[9, "resize", "onResize"]],
|
10015 | "$lazyBundleId$": "-",
|
10016 | "$attrsToReflect$": []
|
10017 | }; }
|
10018 | }
|
10019 |
|
10020 | const contentCss = "/*!@:host*/.sc-ion-content-h{--background:var(--ion-background-color, #fff);--color:var(--ion-text-color, #000);--padding-top:0px;--padding-bottom:0px;--padding-start:0px;--padding-end:0px;--keyboard-offset:0px;--offset-top:0px;--offset-bottom:0px;--overflow:auto;display:block;position:relative;-ms-flex:1;flex:1;width:100%;height:100%;margin:0 !important;padding:0 !important;font-family:var(--ion-font-family, inherit);contain:size style}/*!@:host(.ion-color) .inner-scroll*/.ion-color.sc-ion-content-h .inner-scroll.sc-ion-content{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.outer-content)*/.outer-content.sc-ion-content-h{--background:var(--ion-color-step-50, #f2f2f2)}/*!@#background-content*/#background-content.sc-ion-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);position:absolute;background:var(--background)}/*!@.inner-scroll*/.inner-scroll.sc-ion-content{left:0px;right:0px;top:calc(var(--offset-top) * -1);bottom:calc(var(--offset-bottom) * -1);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:calc(var(--padding-top) + var(--offset-top));padding-bottom:calc(var(--padding-bottom) + var(--keyboard-offset) + var(--offset-bottom));position:absolute;color:var(--color);-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.inner-scroll*/.inner-scroll.sc-ion-content{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.scroll-y,\n.scroll-x*/.scroll-y.sc-ion-content,.scroll-x.sc-ion-content{-webkit-overflow-scrolling:touch;z-index:0;will-change:scroll-position}/*!@.scroll-y*/.scroll-y.sc-ion-content{-ms-touch-action:pan-y;touch-action:pan-y;overflow-y:var(--overflow);overscroll-behavior-y:contain}/*!@.scroll-x*/.scroll-x.sc-ion-content{-ms-touch-action:pan-x;touch-action:pan-x;overflow-x:var(--overflow);overscroll-behavior-x:contain}/*!@.scroll-x.scroll-y*/.scroll-x.scroll-y.sc-ion-content{-ms-touch-action:auto;touch-action:auto}/*!@.overscroll::before,\n.overscroll::after*/.overscroll.sc-ion-content::before,.overscroll.sc-ion-content::after{position:absolute;width:1px;height:1px;content:\"\"}/*!@.overscroll::before*/.overscroll.sc-ion-content::before{bottom:-1px}/*!@.overscroll::after*/.overscroll.sc-ion-content::after{top:-1px}/*!@:host(.content-sizing)*/.content-sizing.sc-ion-content-h{contain:none}/*!@:host(.content-sizing) .inner-scroll*/.content-sizing.sc-ion-content-h .inner-scroll.sc-ion-content{position:relative}/*!@.transition-effect*/.transition-effect.sc-ion-content{display:none;position:absolute;left:-100%;width:100%;height:100vh;opacity:0;pointer-events:none}/*!@.transition-cover*/.transition-cover.sc-ion-content{position:absolute;right:0;width:100%;height:100%;background:black;opacity:0.1}/*!@.transition-shadow*/.transition-shadow.sc-ion-content{display:block;position:absolute;right:0;width:10px;height:100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAgCAYAAAAIXrg4AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKE1hY2ludG9zaCkiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6MTE3MDgzRkQ5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6MTE3MDgzRkU5QTkyMTFFOUEwNzQ5MkJFREE1NUY2MjQiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDoxMTcwODNGQjlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDoxMTcwODNGQzlBOTIxMUU5QTA3NDkyQkVEQTU1RjYyNCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmePEuQAAABNSURBVHjaYvz//z8DIxAwMDAwATGMhmFmPDQuOSZks0AMmoJBaQHjkPfB0Lfg/2gQjVow+HPy/yHvg9GiYjQfjMbBqAWjFgy/4hogwADYqwdzxy5BuwAAAABJRU5ErkJggg==);background-repeat:repeat-y;background-size:10px 16px}/*!@::slotted([slot=fixed])*/.sc-ion-content-s>[slot=fixed]{position:absolute}";
|
10021 |
|
10022 |
|
10023 |
|
10024 |
|
10025 |
|
10026 |
|
10027 |
|
10028 |
|
10029 | class Content {
|
10030 | constructor(hostRef) {
|
10031 | registerInstance(this, hostRef);
|
10032 | this.ionScrollStart = createEvent(this, "ionScrollStart", 7);
|
10033 | this.ionScroll = createEvent(this, "ionScroll", 7);
|
10034 | this.ionScrollEnd = createEvent(this, "ionScrollEnd", 7);
|
10035 | this.isScrolling = false;
|
10036 | this.lastScroll = 0;
|
10037 | this.queued = false;
|
10038 | this.cTop = -1;
|
10039 | this.cBottom = -1;
|
10040 | this.isMainContent = true;
|
10041 |
|
10042 |
|
10043 |
|
10044 | this.detail = {
|
10045 | scrollTop: 0,
|
10046 | scrollLeft: 0,
|
10047 | type: 'scroll',
|
10048 | event: undefined,
|
10049 | startX: 0,
|
10050 | startY: 0,
|
10051 | startTime: 0,
|
10052 | currentX: 0,
|
10053 | currentY: 0,
|
10054 | velocityX: 0,
|
10055 | velocityY: 0,
|
10056 | deltaX: 0,
|
10057 | deltaY: 0,
|
10058 | currentTime: 0,
|
10059 | data: undefined,
|
10060 | isScrolling: true,
|
10061 | };
|
10062 | |
10063 |
|
10064 |
|
10065 |
|
10066 |
|
10067 | this.fullscreen = false;
|
10068 | |
10069 |
|
10070 |
|
10071 | this.scrollX = false;
|
10072 | |
10073 |
|
10074 |
|
10075 | this.scrollY = true;
|
10076 | |
10077 |
|
10078 |
|
10079 |
|
10080 | this.scrollEvents = false;
|
10081 | }
|
10082 | connectedCallback() {
|
10083 | this.isMainContent = this.el.closest('ion-menu, ion-popover, ion-modal') === null;
|
10084 | }
|
10085 | disconnectedCallback() {
|
10086 | this.onScrollEnd();
|
10087 | }
|
10088 | onAppLoad() {
|
10089 | this.resize();
|
10090 | }
|
10091 | onClick(ev) {
|
10092 | if (this.isScrolling) {
|
10093 | ev.preventDefault();
|
10094 | ev.stopPropagation();
|
10095 | }
|
10096 | }
|
10097 | shouldForceOverscroll() {
|
10098 | const { forceOverscroll } = this;
|
10099 | const mode = getIonMode$1(this);
|
10100 | return forceOverscroll === undefined
|
10101 | ? mode === 'ios' && isPlatform('ios')
|
10102 | : forceOverscroll;
|
10103 | }
|
10104 | resize() {
|
10105 | if (this.fullscreen) {
|
10106 | readTask(() => this.readDimensions());
|
10107 | }
|
10108 | else if (this.cTop !== 0 || this.cBottom !== 0) {
|
10109 | this.cTop = this.cBottom = 0;
|
10110 | forceUpdate$1(this);
|
10111 | }
|
10112 | }
|
10113 | readDimensions() {
|
10114 | const page = getPageElement(this.el);
|
10115 | const top = Math.max(this.el.offsetTop, 0);
|
10116 | const bottom = Math.max(page.offsetHeight - top - this.el.offsetHeight, 0);
|
10117 | const dirty = top !== this.cTop || bottom !== this.cBottom;
|
10118 | if (dirty) {
|
10119 | this.cTop = top;
|
10120 | this.cBottom = bottom;
|
10121 | forceUpdate$1(this);
|
10122 | }
|
10123 | }
|
10124 | onScroll(ev) {
|
10125 | const timeStamp = Date.now();
|
10126 | const shouldStart = !this.isScrolling;
|
10127 | this.lastScroll = timeStamp;
|
10128 | if (shouldStart) {
|
10129 | this.onScrollStart();
|
10130 | }
|
10131 | if (!this.queued && this.scrollEvents) {
|
10132 | this.queued = true;
|
10133 | readTask(ts => {
|
10134 | this.queued = false;
|
10135 | this.detail.event = ev;
|
10136 | updateScrollDetail(this.detail, this.scrollEl, ts, shouldStart);
|
10137 | this.ionScroll.emit(this.detail);
|
10138 | });
|
10139 | }
|
10140 | }
|
10141 | |
10142 |
|
10143 |
|
10144 |
|
10145 |
|
10146 |
|
10147 |
|
10148 |
|
10149 | getScrollElement() {
|
10150 | return Promise.resolve(this.scrollEl);
|
10151 | }
|
10152 | |
10153 |
|
10154 |
|
10155 |
|
10156 |
|
10157 | scrollToTop(duration = 0) {
|
10158 | return this.scrollToPoint(undefined, 0, duration);
|
10159 | }
|
10160 | |
10161 |
|
10162 |
|
10163 |
|
10164 |
|
10165 | scrollToBottom(duration = 0) {
|
10166 | const y = this.scrollEl.scrollHeight - this.scrollEl.clientHeight;
|
10167 | return this.scrollToPoint(undefined, y, duration);
|
10168 | }
|
10169 | |
10170 |
|
10171 |
|
10172 |
|
10173 |
|
10174 |
|
10175 |
|
10176 | scrollByPoint(x, y, duration) {
|
10177 | return this.scrollToPoint(x + this.scrollEl.scrollLeft, y + this.scrollEl.scrollTop, duration);
|
10178 | }
|
10179 | |
10180 |
|
10181 |
|
10182 |
|
10183 |
|
10184 |
|
10185 |
|
10186 | async scrollToPoint(x, y, duration = 0) {
|
10187 | const el = this.scrollEl;
|
10188 | if (duration < 32) {
|
10189 | if (y != null) {
|
10190 | el.scrollTop = y;
|
10191 | }
|
10192 | if (x != null) {
|
10193 | el.scrollLeft = x;
|
10194 | }
|
10195 | return;
|
10196 | }
|
10197 | let resolve;
|
10198 | let startTime = 0;
|
10199 | const promise = new Promise(r => resolve = r);
|
10200 | const fromY = el.scrollTop;
|
10201 | const fromX = el.scrollLeft;
|
10202 | const deltaY = y != null ? y - fromY : 0;
|
10203 | const deltaX = x != null ? x - fromX : 0;
|
10204 |
|
10205 | const step = (timeStamp) => {
|
10206 | const linearTime = Math.min(1, ((timeStamp - startTime) / duration)) - 1;
|
10207 | const easedT = Math.pow(linearTime, 3) + 1;
|
10208 | if (deltaY !== 0) {
|
10209 | el.scrollTop = Math.floor((easedT * deltaY) + fromY);
|
10210 | }
|
10211 | if (deltaX !== 0) {
|
10212 | el.scrollLeft = Math.floor((easedT * deltaX) + fromX);
|
10213 | }
|
10214 | if (easedT < 1) {
|
10215 |
|
10216 |
|
10217 |
|
10218 | requestAnimationFrame(step);
|
10219 | }
|
10220 | else {
|
10221 | resolve();
|
10222 | }
|
10223 | };
|
10224 |
|
10225 | requestAnimationFrame(ts => {
|
10226 | startTime = ts;
|
10227 | step(ts);
|
10228 | });
|
10229 | return promise;
|
10230 | }
|
10231 | onScrollStart() {
|
10232 | this.isScrolling = true;
|
10233 | this.ionScrollStart.emit({
|
10234 | isScrolling: true
|
10235 | });
|
10236 | if (this.watchDog) {
|
10237 | clearInterval(this.watchDog);
|
10238 | }
|
10239 |
|
10240 | this.watchDog = setInterval(() => {
|
10241 | if (this.lastScroll < Date.now() - 120) {
|
10242 | this.onScrollEnd();
|
10243 | }
|
10244 | }, 100);
|
10245 | }
|
10246 | onScrollEnd() {
|
10247 | clearInterval(this.watchDog);
|
10248 | this.watchDog = null;
|
10249 | if (this.isScrolling) {
|
10250 | this.isScrolling = false;
|
10251 | this.ionScrollEnd.emit({
|
10252 | isScrolling: false
|
10253 | });
|
10254 | }
|
10255 | }
|
10256 | render() {
|
10257 | const { isMainContent, scrollX, scrollY } = this;
|
10258 | const mode = getIonMode$1(this);
|
10259 | const forceOverscroll = this.shouldForceOverscroll();
|
10260 | const TagType = isMainContent ? 'main' : 'div';
|
10261 | const transitionShadow = (mode === 'ios' && config.getBoolean('experimentalTransitionShadow', true));
|
10262 | this.resize();
|
10263 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
10264 | [mode]: true,
|
10265 | 'content-sizing': hostContext('ion-popover', this.el),
|
10266 | 'overscroll': forceOverscroll,
|
10267 | }), style: {
|
10268 | '--offset-top': `${this.cTop}px`,
|
10269 | '--offset-bottom': `${this.cBottom}px`,
|
10270 | } }, hAsync("div", { id: "background-content", part: "background" }), hAsync(TagType, { class: {
|
10271 | 'inner-scroll': true,
|
10272 | 'scroll-x': scrollX,
|
10273 | 'scroll-y': scrollY,
|
10274 | 'overscroll': (scrollX || scrollY) && forceOverscroll
|
10275 | }, ref: (el) => this.scrollEl = el, onScroll: (this.scrollEvents) ? (ev) => this.onScroll(ev) : undefined, part: "scroll" }, hAsync("slot", null)), transitionShadow ? (hAsync("div", { class: "transition-effect" }, hAsync("div", { class: "transition-cover" }), hAsync("div", { class: "transition-shadow" }))) : null, hAsync("slot", { name: "fixed" })));
|
10276 | }
|
10277 | get el() { return getElement(this); }
|
10278 | static get style() { return contentCss; }
|
10279 | static get cmpMeta() { return {
|
10280 | "$flags$": 9,
|
10281 | "$tagName$": "ion-content",
|
10282 | "$members$": {
|
10283 | "color": [513],
|
10284 | "fullscreen": [4],
|
10285 | "forceOverscroll": [1028, "force-overscroll"],
|
10286 | "scrollX": [4, "scroll-x"],
|
10287 | "scrollY": [4, "scroll-y"],
|
10288 | "scrollEvents": [4, "scroll-events"],
|
10289 | "getScrollElement": [64],
|
10290 | "scrollToTop": [64],
|
10291 | "scrollToBottom": [64],
|
10292 | "scrollByPoint": [64],
|
10293 | "scrollToPoint": [64]
|
10294 | },
|
10295 | "$listeners$": [[8, "appload", "onAppLoad"], [2, "click", "onClick"]],
|
10296 | "$lazyBundleId$": "-",
|
10297 | "$attrsToReflect$": [["color", "color"]]
|
10298 | }; }
|
10299 | }
|
10300 | const getParentElement = (el) => {
|
10301 | if (el.parentElement) {
|
10302 |
|
10303 | return el.parentElement;
|
10304 | }
|
10305 | if (el.parentNode && el.parentNode.host) {
|
10306 |
|
10307 | return el.parentNode.host;
|
10308 | }
|
10309 | return null;
|
10310 | };
|
10311 | const getPageElement = (el) => {
|
10312 | const tabs = el.closest('ion-tabs');
|
10313 | if (tabs) {
|
10314 | return tabs;
|
10315 | }
|
10316 | const page = el.closest('ion-app,ion-page,.ion-page,page-inner');
|
10317 | if (page) {
|
10318 | return page;
|
10319 | }
|
10320 | return getParentElement(el);
|
10321 | };
|
10322 |
|
10323 | const updateScrollDetail = (detail, el, timestamp, shouldStart) => {
|
10324 | const prevX = detail.currentX;
|
10325 | const prevY = detail.currentY;
|
10326 | const prevT = detail.currentTime;
|
10327 | const currentX = el.scrollLeft;
|
10328 | const currentY = el.scrollTop;
|
10329 | const timeDelta = timestamp - prevT;
|
10330 | if (shouldStart) {
|
10331 |
|
10332 | detail.startTime = timestamp;
|
10333 | detail.startX = currentX;
|
10334 | detail.startY = currentY;
|
10335 | detail.velocityX = detail.velocityY = 0;
|
10336 | }
|
10337 | detail.currentTime = timestamp;
|
10338 | detail.currentX = detail.scrollLeft = currentX;
|
10339 | detail.currentY = detail.scrollTop = currentY;
|
10340 | detail.deltaX = currentX - detail.startX;
|
10341 | detail.deltaY = currentY - detail.startY;
|
10342 | if (timeDelta > 0 && timeDelta < 100) {
|
10343 | const velocityX = (currentX - prevX) / timeDelta;
|
10344 | const velocityY = (currentY - prevY) / timeDelta;
|
10345 | detail.velocityX = velocityX * 0.7 + detail.velocityX * 0.3;
|
10346 | detail.velocityY = velocityY * 0.7 + detail.velocityY * 0.3;
|
10347 | }
|
10348 | };
|
10349 |
|
10350 |
|
10351 |
|
10352 |
|
10353 |
|
10354 |
|
10355 | const getDateValue = (date, format) => {
|
10356 | const getValue = getValueFromFormat(date, format);
|
10357 | if (getValue !== undefined) {
|
10358 | if (format === FORMAT_A || format === FORMAT_a) {
|
10359 | date.ampm = getValue;
|
10360 | }
|
10361 | return getValue;
|
10362 | }
|
10363 | const defaultDate = parseDate(new Date().toISOString());
|
10364 | return getValueFromFormat(defaultDate, format);
|
10365 | };
|
10366 | const renderDatetime = (template, value, locale) => {
|
10367 | if (value === undefined) {
|
10368 | return undefined;
|
10369 | }
|
10370 | const tokens = [];
|
10371 | let hasText = false;
|
10372 | FORMAT_KEYS.forEach((format, index) => {
|
10373 | if (template.indexOf(format.f) > -1) {
|
10374 | const token = '{' + index + '}';
|
10375 | const text = renderTextFormat(format.f, value[format.k], value, locale);
|
10376 | if (!hasText && text !== undefined && value[format.k] != null) {
|
10377 | hasText = true;
|
10378 | }
|
10379 | tokens.push(token, text || '');
|
10380 | template = template.replace(format.f, token);
|
10381 | }
|
10382 | });
|
10383 | if (!hasText) {
|
10384 | return undefined;
|
10385 | }
|
10386 | for (let i = 0; i < tokens.length; i += 2) {
|
10387 | template = template.replace(tokens[i], tokens[i + 1]);
|
10388 | }
|
10389 | return template;
|
10390 | };
|
10391 | const renderTextFormat = (format, value, date, locale) => {
|
10392 | if ((format === FORMAT_DDDD || format === FORMAT_DDD)) {
|
10393 | try {
|
10394 | value = (new Date(date.year, date.month - 1, date.day)).getDay();
|
10395 | if (format === FORMAT_DDDD) {
|
10396 | return (locale.dayNames ? locale.dayNames : DAY_NAMES)[value];
|
10397 | }
|
10398 | return (locale.dayShortNames ? locale.dayShortNames : DAY_SHORT_NAMES)[value];
|
10399 | }
|
10400 | catch (e) {
|
10401 |
|
10402 | }
|
10403 | return undefined;
|
10404 | }
|
10405 | if (format === FORMAT_A) {
|
10406 | return date !== undefined && date.hour !== undefined
|
10407 | ? (date.hour < 12 ? 'AM' : 'PM')
|
10408 | : value ? value.toUpperCase() : '';
|
10409 | }
|
10410 | if (format === FORMAT_a) {
|
10411 | return date !== undefined && date.hour !== undefined
|
10412 | ? (date.hour < 12 ? 'am' : 'pm')
|
10413 | : value || '';
|
10414 | }
|
10415 | if (value == null) {
|
10416 | return '';
|
10417 | }
|
10418 | if (format === FORMAT_YY || format === FORMAT_MM ||
|
10419 | format === FORMAT_DD || format === FORMAT_HH ||
|
10420 | format === FORMAT_mm || format === FORMAT_ss) {
|
10421 | return twoDigit(value);
|
10422 | }
|
10423 | if (format === FORMAT_YYYY) {
|
10424 | return fourDigit(value);
|
10425 | }
|
10426 | if (format === FORMAT_MMMM) {
|
10427 | return (locale.monthNames ? locale.monthNames : MONTH_NAMES)[value - 1];
|
10428 | }
|
10429 | if (format === FORMAT_MMM) {
|
10430 | return (locale.monthShortNames ? locale.monthShortNames : MONTH_SHORT_NAMES)[value - 1];
|
10431 | }
|
10432 | if (format === FORMAT_hh || format === FORMAT_h) {
|
10433 | if (value === 0) {
|
10434 | return '12';
|
10435 | }
|
10436 | if (value > 12) {
|
10437 | value -= 12;
|
10438 | }
|
10439 | if (format === FORMAT_hh && value < 10) {
|
10440 | return ('0' + value);
|
10441 | }
|
10442 | }
|
10443 | return value.toString();
|
10444 | };
|
10445 | const dateValueRange = (format, min, max) => {
|
10446 | const opts = [];
|
10447 | if (format === FORMAT_YYYY || format === FORMAT_YY) {
|
10448 |
|
10449 | if (max.year === undefined || min.year === undefined) {
|
10450 | throw new Error('min and max year is undefined');
|
10451 | }
|
10452 | for (let i = max.year; i >= min.year; i--) {
|
10453 | opts.push(i);
|
10454 | }
|
10455 | }
|
10456 | else if (format === FORMAT_MMMM || format === FORMAT_MMM ||
|
10457 | format === FORMAT_MM || format === FORMAT_M ||
|
10458 | format === FORMAT_hh || format === FORMAT_h) {
|
10459 |
|
10460 | for (let i = 1; i < 13; i++) {
|
10461 | opts.push(i);
|
10462 | }
|
10463 | }
|
10464 | else if (format === FORMAT_DDDD || format === FORMAT_DDD ||
|
10465 | format === FORMAT_DD || format === FORMAT_D) {
|
10466 |
|
10467 | for (let i = 1; i < 32; i++) {
|
10468 | opts.push(i);
|
10469 | }
|
10470 | }
|
10471 | else if (format === FORMAT_HH || format === FORMAT_H) {
|
10472 |
|
10473 | for (let i = 0; i < 24; i++) {
|
10474 | opts.push(i);
|
10475 | }
|
10476 | }
|
10477 | else if (format === FORMAT_mm || format === FORMAT_m) {
|
10478 |
|
10479 | for (let i = 0; i < 60; i++) {
|
10480 | opts.push(i);
|
10481 | }
|
10482 | }
|
10483 | else if (format === FORMAT_ss || format === FORMAT_s) {
|
10484 |
|
10485 | for (let i = 0; i < 60; i++) {
|
10486 | opts.push(i);
|
10487 | }
|
10488 | }
|
10489 | else if (format === FORMAT_A || format === FORMAT_a) {
|
10490 |
|
10491 | opts.push('am', 'pm');
|
10492 | }
|
10493 | return opts;
|
10494 | };
|
10495 | const dateSortValue = (year, month, day, hour = 0, minute = 0) => {
|
10496 | return parseInt(`1${fourDigit(year)}${twoDigit(month)}${twoDigit(day)}${twoDigit(hour)}${twoDigit(minute)}`, 10);
|
10497 | };
|
10498 | const dateDataSortValue = (data) => {
|
10499 | return dateSortValue(data.year, data.month, data.day, data.hour, data.minute);
|
10500 | };
|
10501 | const daysInMonth = (month, year) => {
|
10502 | return (month === 4 || month === 6 || month === 9 || month === 11) ? 30 : (month === 2) ? isLeapYear(year) ? 29 : 28 : 31;
|
10503 | };
|
10504 | const isLeapYear = (year) => {
|
10505 | return (year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0);
|
10506 | };
|
10507 | const ISO_8601_REGEXP = /^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
|
10508 | const TIME_REGEXP = /^((\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2})(?::(\d{2}))?)?)?$/;
|
10509 | const parseDate = (val) => {
|
10510 |
|
10511 |
|
10512 | let parse = null;
|
10513 | if (val != null && val !== '') {
|
10514 |
|
10515 | parse = TIME_REGEXP.exec(val);
|
10516 | if (parse) {
|
10517 |
|
10518 | parse.unshift(undefined, undefined);
|
10519 | parse[2] = parse[3] = undefined;
|
10520 | }
|
10521 | else {
|
10522 |
|
10523 | parse = ISO_8601_REGEXP.exec(val);
|
10524 | }
|
10525 | }
|
10526 | if (parse === null) {
|
10527 |
|
10528 | return undefined;
|
10529 | }
|
10530 |
|
10531 | for (let i = 1; i < 8; i++) {
|
10532 | parse[i] = parse[i] !== undefined ? parseInt(parse[i], 10) : undefined;
|
10533 | }
|
10534 | let tzOffset = 0;
|
10535 | if (parse[9] && parse[10]) {
|
10536 |
|
10537 | tzOffset = parseInt(parse[10], 10) * 60;
|
10538 | if (parse[11]) {
|
10539 |
|
10540 | tzOffset += parseInt(parse[11], 10);
|
10541 | }
|
10542 | if (parse[9] === '-') {
|
10543 |
|
10544 | tzOffset *= -1;
|
10545 | }
|
10546 | }
|
10547 | return {
|
10548 | year: parse[1],
|
10549 | month: parse[2],
|
10550 | day: parse[3],
|
10551 | hour: parse[4],
|
10552 | minute: parse[5],
|
10553 | second: parse[6],
|
10554 | millisecond: parse[7],
|
10555 | tzOffset,
|
10556 | };
|
10557 | };
|
10558 |
|
10559 |
|
10560 |
|
10561 |
|
10562 |
|
10563 |
|
10564 |
|
10565 | const getDateTime = (dateString = '', timeZone = '') => {
|
10566 | |
10567 |
|
10568 |
|
10569 |
|
10570 |
|
10571 |
|
10572 |
|
10573 | if (dateString === undefined || dateString === null) {
|
10574 | dateString = '';
|
10575 | }
|
10576 | |
10577 |
|
10578 |
|
10579 |
|
10580 |
|
10581 |
|
10582 | if (dateString.length === 10 ||
|
10583 | dateString.length === 7 ||
|
10584 | dateString.length === 4) {
|
10585 | dateString += ' ';
|
10586 | }
|
10587 | const date = (typeof dateString === 'string' && dateString.length > 0) ? new Date(dateString) : new Date();
|
10588 | const localDateTime = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
|
10589 | if (timeZone && timeZone.length > 0) {
|
10590 | return new Date(date.getTime() - getTimezoneOffset(localDateTime, timeZone));
|
10591 | }
|
10592 | return localDateTime;
|
10593 | };
|
10594 | const getTimezoneOffset = (localDate, timeZone) => {
|
10595 | const utcDateTime = new Date(localDate.toLocaleString('en-US', { timeZone: 'utc' }));
|
10596 | const tzDateTime = new Date(localDate.toLocaleString('en-US', { timeZone }));
|
10597 | return utcDateTime.getTime() - tzDateTime.getTime();
|
10598 | };
|
10599 | const updateDate = (existingData, newData, displayTimezone) => {
|
10600 | if (!newData || typeof newData === 'string') {
|
10601 | const dateTime = getDateTime(newData, displayTimezone);
|
10602 | if (!Number.isNaN(dateTime.getTime())) {
|
10603 | newData = dateTime.toISOString();
|
10604 | }
|
10605 | }
|
10606 | if (newData && newData !== '') {
|
10607 | if (typeof newData === 'string') {
|
10608 |
|
10609 |
|
10610 | newData = parseDate(newData);
|
10611 | if (newData) {
|
10612 |
|
10613 | Object.assign(existingData, newData);
|
10614 | return true;
|
10615 | }
|
10616 | }
|
10617 | else if ((newData.year || newData.hour || newData.month || newData.day || newData.minute || newData.second)) {
|
10618 |
|
10619 |
|
10620 | if (newData.ampm !== undefined && newData.hour !== undefined) {
|
10621 |
|
10622 |
|
10623 |
|
10624 |
|
10625 |
|
10626 |
|
10627 | newData.hour.value = (newData.ampm.value === 'pm')
|
10628 | ? (newData.hour.value === 12 ? 12 : newData.hour.value + 12)
|
10629 | : (newData.hour.value === 12 ? 0 : newData.hour.value);
|
10630 | }
|
10631 |
|
10632 |
|
10633 | for (const key of Object.keys(newData)) {
|
10634 | existingData[key] = newData[key].value;
|
10635 | }
|
10636 | return true;
|
10637 | }
|
10638 | else if (newData.ampm) {
|
10639 |
|
10640 |
|
10641 |
|
10642 | newData.hour = {
|
10643 | value: newData.hour
|
10644 | ? newData.hour.value
|
10645 | : (newData.ampm.value === 'pm'
|
10646 | ? (existingData.hour < 12 ? existingData.hour + 12 : existingData.hour)
|
10647 | : (existingData.hour >= 12 ? existingData.hour - 12 : existingData.hour))
|
10648 | };
|
10649 | existingData['hour'] = newData['hour'].value;
|
10650 | existingData['ampm'] = newData['ampm'].value;
|
10651 | return true;
|
10652 | }
|
10653 |
|
10654 | console.warn(`Error parsing date: "${newData}". Please provide a valid ISO 8601 datetime format: https://www.w3.org/TR/NOTE-datetime`);
|
10655 | }
|
10656 | else {
|
10657 |
|
10658 | for (const k in existingData) {
|
10659 | if (existingData.hasOwnProperty(k)) {
|
10660 | delete existingData[k];
|
10661 | }
|
10662 | }
|
10663 | }
|
10664 | return false;
|
10665 | };
|
10666 | const parseTemplate = (template) => {
|
10667 | const formats = [];
|
10668 | template = template.replace(/[^\w\s]/gi, ' ');
|
10669 | FORMAT_KEYS.forEach(format => {
|
10670 | if (format.f.length > 1 && template.indexOf(format.f) > -1 && template.indexOf(format.f + format.f.charAt(0)) < 0) {
|
10671 | template = template.replace(format.f, ' ' + format.f + ' ');
|
10672 | }
|
10673 | });
|
10674 | const words = template.split(' ').filter(w => w.length > 0);
|
10675 | words.forEach((word, i) => {
|
10676 | FORMAT_KEYS.forEach(format => {
|
10677 | if (word === format.f) {
|
10678 | if (word === FORMAT_A || word === FORMAT_a) {
|
10679 |
|
10680 | if ((formats.indexOf(FORMAT_h) < 0 && formats.indexOf(FORMAT_hh) < 0) ||
|
10681 | VALID_AMPM_PREFIX.indexOf(words[i - 1]) === -1) {
|
10682 |
|
10683 |
|
10684 |
|
10685 | return;
|
10686 | }
|
10687 | }
|
10688 | formats.push(word);
|
10689 | }
|
10690 | });
|
10691 | });
|
10692 | return formats;
|
10693 | };
|
10694 | const getValueFromFormat = (date, format) => {
|
10695 | if (format === FORMAT_A || format === FORMAT_a) {
|
10696 | return (date.hour < 12 ? 'am' : 'pm');
|
10697 | }
|
10698 | if (format === FORMAT_hh || format === FORMAT_h) {
|
10699 | return (date.hour > 12 ? date.hour - 12 : (date.hour === 0 ? 12 : date.hour));
|
10700 | }
|
10701 | return date[convertFormatToKey(format)];
|
10702 | };
|
10703 | const convertFormatToKey = (format) => {
|
10704 | for (const k in FORMAT_KEYS) {
|
10705 | if (FORMAT_KEYS[k].f === format) {
|
10706 | return FORMAT_KEYS[k].k;
|
10707 | }
|
10708 | }
|
10709 | return undefined;
|
10710 | };
|
10711 | const convertDataToISO = (data) => {
|
10712 |
|
10713 | let rtn = '';
|
10714 | if (data.year !== undefined) {
|
10715 |
|
10716 | rtn = fourDigit(data.year);
|
10717 | if (data.month !== undefined) {
|
10718 |
|
10719 | rtn += '-' + twoDigit(data.month);
|
10720 | if (data.day !== undefined) {
|
10721 |
|
10722 | rtn += '-' + twoDigit(data.day);
|
10723 | if (data.hour !== undefined) {
|
10724 |
|
10725 | rtn += `T${twoDigit(data.hour)}:${twoDigit(data.minute)}:${twoDigit(data.second)}`;
|
10726 | if (data.millisecond > 0) {
|
10727 |
|
10728 | rtn += '.' + threeDigit(data.millisecond);
|
10729 | }
|
10730 | if (data.tzOffset === undefined) {
|
10731 |
|
10732 | rtn += 'Z';
|
10733 | }
|
10734 | else {
|
10735 |
|
10736 | rtn += (data.tzOffset > 0 ? '+' : '-') + twoDigit(Math.floor(Math.abs(data.tzOffset / 60))) + ':' + twoDigit(data.tzOffset % 60);
|
10737 | }
|
10738 | }
|
10739 | }
|
10740 | }
|
10741 | }
|
10742 | else if (data.hour !== undefined) {
|
10743 |
|
10744 | rtn = twoDigit(data.hour) + ':' + twoDigit(data.minute);
|
10745 | if (data.second !== undefined) {
|
10746 |
|
10747 | rtn += ':' + twoDigit(data.second);
|
10748 | if (data.millisecond !== undefined) {
|
10749 |
|
10750 | rtn += '.' + threeDigit(data.millisecond);
|
10751 | }
|
10752 | }
|
10753 | }
|
10754 | return rtn;
|
10755 | };
|
10756 |
|
10757 |
|
10758 |
|
10759 |
|
10760 | const convertToArrayOfStrings = (input, type) => {
|
10761 | if (input == null) {
|
10762 | return undefined;
|
10763 | }
|
10764 | if (typeof input === 'string') {
|
10765 |
|
10766 |
|
10767 | input = input.replace(/\[|\]/g, '').split(',');
|
10768 | }
|
10769 | let values;
|
10770 | if (Array.isArray(input)) {
|
10771 |
|
10772 | values = input.map(val => val.toString().trim());
|
10773 | }
|
10774 | if (values === undefined || values.length === 0) {
|
10775 | console.warn(`Invalid "${type}Names". Must be an array of strings, or a comma separated string.`);
|
10776 | }
|
10777 | return values;
|
10778 | };
|
10779 |
|
10780 |
|
10781 |
|
10782 |
|
10783 | const convertToArrayOfNumbers = (input, type) => {
|
10784 | if (typeof input === 'string') {
|
10785 |
|
10786 |
|
10787 | input = input.replace(/\[|\]|\s/g, '').split(',');
|
10788 | }
|
10789 | let values;
|
10790 | if (Array.isArray(input)) {
|
10791 |
|
10792 | values = input
|
10793 | .map((num) => parseInt(num, 10))
|
10794 | .filter(isFinite);
|
10795 | }
|
10796 | else {
|
10797 | values = [input];
|
10798 | }
|
10799 | if (values.length === 0) {
|
10800 | console.warn(`Invalid "${type}Values". Must be an array of numbers, or a comma separated string of numbers.`);
|
10801 | }
|
10802 | return values;
|
10803 | };
|
10804 | const twoDigit = (val) => {
|
10805 | return ('0' + (val !== undefined ? Math.abs(val) : '0')).slice(-2);
|
10806 | };
|
10807 | const threeDigit = (val) => {
|
10808 | return ('00' + (val !== undefined ? Math.abs(val) : '0')).slice(-3);
|
10809 | };
|
10810 | const fourDigit = (val) => {
|
10811 | return ('000' + (val !== undefined ? Math.abs(val) : '0')).slice(-4);
|
10812 | };
|
10813 | const FORMAT_YYYY = 'YYYY';
|
10814 | const FORMAT_YY = 'YY';
|
10815 | const FORMAT_MMMM = 'MMMM';
|
10816 | const FORMAT_MMM = 'MMM';
|
10817 | const FORMAT_MM = 'MM';
|
10818 | const FORMAT_M = 'M';
|
10819 | const FORMAT_DDDD = 'DDDD';
|
10820 | const FORMAT_DDD = 'DDD';
|
10821 | const FORMAT_DD = 'DD';
|
10822 | const FORMAT_D = 'D';
|
10823 | const FORMAT_HH = 'HH';
|
10824 | const FORMAT_H = 'H';
|
10825 | const FORMAT_hh = 'hh';
|
10826 | const FORMAT_h = 'h';
|
10827 | const FORMAT_mm = 'mm';
|
10828 | const FORMAT_m = 'm';
|
10829 | const FORMAT_ss = 'ss';
|
10830 | const FORMAT_s = 's';
|
10831 | const FORMAT_A = 'A';
|
10832 | const FORMAT_a = 'a';
|
10833 | const FORMAT_KEYS = [
|
10834 | { f: FORMAT_YYYY, k: 'year' },
|
10835 | { f: FORMAT_MMMM, k: 'month' },
|
10836 | { f: FORMAT_DDDD, k: 'day' },
|
10837 | { f: FORMAT_MMM, k: 'month' },
|
10838 | { f: FORMAT_DDD, k: 'day' },
|
10839 | { f: FORMAT_YY, k: 'year' },
|
10840 | { f: FORMAT_MM, k: 'month' },
|
10841 | { f: FORMAT_DD, k: 'day' },
|
10842 | { f: FORMAT_HH, k: 'hour' },
|
10843 | { f: FORMAT_hh, k: 'hour' },
|
10844 | { f: FORMAT_mm, k: 'minute' },
|
10845 | { f: FORMAT_ss, k: 'second' },
|
10846 | { f: FORMAT_M, k: 'month' },
|
10847 | { f: FORMAT_D, k: 'day' },
|
10848 | { f: FORMAT_H, k: 'hour' },
|
10849 | { f: FORMAT_h, k: 'hour' },
|
10850 | { f: FORMAT_m, k: 'minute' },
|
10851 | { f: FORMAT_s, k: 'second' },
|
10852 | { f: FORMAT_A, k: 'ampm' },
|
10853 | { f: FORMAT_a, k: 'ampm' },
|
10854 | ];
|
10855 | const DAY_NAMES = [
|
10856 | 'Sunday',
|
10857 | 'Monday',
|
10858 | 'Tuesday',
|
10859 | 'Wednesday',
|
10860 | 'Thursday',
|
10861 | 'Friday',
|
10862 | 'Saturday',
|
10863 | ];
|
10864 | const DAY_SHORT_NAMES = [
|
10865 | 'Sun',
|
10866 | 'Mon',
|
10867 | 'Tue',
|
10868 | 'Wed',
|
10869 | 'Thu',
|
10870 | 'Fri',
|
10871 | 'Sat',
|
10872 | ];
|
10873 | const MONTH_NAMES = [
|
10874 | 'January',
|
10875 | 'February',
|
10876 | 'March',
|
10877 | 'April',
|
10878 | 'May',
|
10879 | 'June',
|
10880 | 'July',
|
10881 | 'August',
|
10882 | 'September',
|
10883 | 'October',
|
10884 | 'November',
|
10885 | 'December',
|
10886 | ];
|
10887 | const MONTH_SHORT_NAMES = [
|
10888 | 'Jan',
|
10889 | 'Feb',
|
10890 | 'Mar',
|
10891 | 'Apr',
|
10892 | 'May',
|
10893 | 'Jun',
|
10894 | 'Jul',
|
10895 | 'Aug',
|
10896 | 'Sep',
|
10897 | 'Oct',
|
10898 | 'Nov',
|
10899 | 'Dec',
|
10900 | ];
|
10901 | const VALID_AMPM_PREFIX = [
|
10902 | FORMAT_hh, FORMAT_h, FORMAT_mm, FORMAT_m, FORMAT_ss, FORMAT_s
|
10903 | ];
|
10904 |
|
10905 | const datetimeIosCss = "/*!@:host*/.sc-ion-datetime-ios-h{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;min-width:16px;min-height:1.2em;font-family:var(--ion-font-family, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-datetime-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-ios-h{position:static}/*!@:host(.datetime-placeholder)*/.datetime-placeholder.sc-ion-datetime-ios-h{color:var(--placeholder-color)}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-ios-h{opacity:0.3;pointer-events:none}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-ios-h{pointer-events:none}/*!@button*/button.sc-ion-datetime-ios{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}/*!@[dir=rtl] button, :host-context([dir=rtl]) button*/[dir=rtl].sc-ion-datetime-ios button.sc-ion-datetime-ios,[dir=rtl].sc-ion-datetime-ios-h button.sc-ion-datetime-ios,[dir=rtl] .sc-ion-datetime-ios-h button.sc-ion-datetime-ios{left:unset;right:unset;right:0}/*!@button::-moz-focus-inner*/button.sc-ion-datetime-ios::-moz-focus-inner{border:0}/*!@.datetime-text*/.datetime-text.sc-ion-datetime-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-ms-flex:1;flex:1;min-height:inherit;direction:ltr;overflow:inherit}/*!@[dir=rtl] .datetime-text, :host-context([dir=rtl]) .datetime-text*/[dir=rtl].sc-ion-datetime-ios .datetime-text.sc-ion-datetime-ios,[dir=rtl].sc-ion-datetime-ios-h .datetime-text.sc-ion-datetime-ios,[dir=rtl] .sc-ion-datetime-ios-h .datetime-text.sc-ion-datetime-ios{direction:rtl}/*!@:host*/.sc-ion-datetime-ios-h{--placeholder-color:var(--ion-color-step-400, #999999);--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:20px}";
|
10906 |
|
10907 | const datetimeMdCss = "/*!@:host*/.sc-ion-datetime-md-h{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;min-width:16px;min-height:1.2em;font-family:var(--ion-font-family, inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-datetime-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.in-item)*/.in-item.sc-ion-datetime-md-h{position:static}/*!@:host(.datetime-placeholder)*/.datetime-placeholder.sc-ion-datetime-md-h{color:var(--placeholder-color)}/*!@:host(.datetime-disabled)*/.datetime-disabled.sc-ion-datetime-md-h{opacity:0.3;pointer-events:none}/*!@:host(.datetime-readonly)*/.datetime-readonly.sc-ion-datetime-md-h{pointer-events:none}/*!@button*/button.sc-ion-datetime-md{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none}/*!@[dir=rtl] button, :host-context([dir=rtl]) button*/[dir=rtl].sc-ion-datetime-md button.sc-ion-datetime-md,[dir=rtl].sc-ion-datetime-md-h button.sc-ion-datetime-md,[dir=rtl] .sc-ion-datetime-md-h button.sc-ion-datetime-md{left:unset;right:unset;right:0}/*!@button::-moz-focus-inner*/button.sc-ion-datetime-md::-moz-focus-inner{border:0}/*!@.datetime-text*/.datetime-text.sc-ion-datetime-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-ms-flex:1;flex:1;min-height:inherit;direction:ltr;overflow:inherit}/*!@[dir=rtl] .datetime-text, :host-context([dir=rtl]) .datetime-text*/[dir=rtl].sc-ion-datetime-md .datetime-text.sc-ion-datetime-md,[dir=rtl].sc-ion-datetime-md-h .datetime-text.sc-ion-datetime-md,[dir=rtl] .sc-ion-datetime-md-h .datetime-text.sc-ion-datetime-md{direction:rtl}/*!@:host*/.sc-ion-datetime-md-h{--placeholder-color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:16px}";
|
10908 |
|
10909 |
|
10910 |
|
10911 |
|
10912 |
|
10913 |
|
10914 |
|
10915 | class Datetime {
|
10916 | constructor(hostRef) {
|
10917 | registerInstance(this, hostRef);
|
10918 | this.ionCancel = createEvent(this, "ionCancel", 7);
|
10919 | this.ionChange = createEvent(this, "ionChange", 7);
|
10920 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
10921 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
10922 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
10923 | this.inputId = `ion-dt-${datetimeIds++}`;
|
10924 | this.locale = {};
|
10925 | this.datetimeMin = {};
|
10926 | this.datetimeMax = {};
|
10927 | this.datetimeValue = {};
|
10928 | this.isExpanded = false;
|
10929 | |
10930 |
|
10931 |
|
10932 | this.name = this.inputId;
|
10933 | |
10934 |
|
10935 |
|
10936 | this.disabled = false;
|
10937 | |
10938 |
|
10939 |
|
10940 | this.readonly = false;
|
10941 | |
10942 |
|
10943 |
|
10944 |
|
10945 |
|
10946 |
|
10947 |
|
10948 | this.displayFormat = 'MMM D, YYYY';
|
10949 | |
10950 |
|
10951 |
|
10952 | this.cancelText = 'Cancel';
|
10953 | |
10954 |
|
10955 |
|
10956 | this.doneText = 'Done';
|
10957 | this.onClick = () => {
|
10958 | this.setFocus();
|
10959 | this.open();
|
10960 | };
|
10961 | this.onFocus = () => {
|
10962 | this.ionFocus.emit();
|
10963 | };
|
10964 | this.onBlur = () => {
|
10965 | this.ionBlur.emit();
|
10966 | };
|
10967 | }
|
10968 | disabledChanged() {
|
10969 | this.emitStyle();
|
10970 | }
|
10971 | |
10972 |
|
10973 |
|
10974 | valueChanged() {
|
10975 | this.updateDatetimeValue(this.value);
|
10976 | this.emitStyle();
|
10977 | this.ionChange.emit({
|
10978 | value: this.value
|
10979 | });
|
10980 | }
|
10981 | componentWillLoad() {
|
10982 |
|
10983 |
|
10984 |
|
10985 | this.locale = {
|
10986 |
|
10987 | monthNames: convertToArrayOfStrings(this.monthNames, 'monthNames'),
|
10988 | monthShortNames: convertToArrayOfStrings(this.monthShortNames, 'monthShortNames'),
|
10989 | dayNames: convertToArrayOfStrings(this.dayNames, 'dayNames'),
|
10990 | dayShortNames: convertToArrayOfStrings(this.dayShortNames, 'dayShortNames')
|
10991 | };
|
10992 | this.updateDatetimeValue(this.value);
|
10993 | this.emitStyle();
|
10994 | }
|
10995 | |
10996 |
|
10997 |
|
10998 | async open() {
|
10999 | if (this.disabled || this.isExpanded) {
|
11000 | return;
|
11001 | }
|
11002 | const pickerOptions = this.generatePickerOptions();
|
11003 | const picker = await pickerController.create(pickerOptions);
|
11004 | this.isExpanded = true;
|
11005 | picker.onDidDismiss().then(() => {
|
11006 | this.isExpanded = false;
|
11007 | this.setFocus();
|
11008 | });
|
11009 | addEventListener(picker, 'ionPickerColChange', async (event) => {
|
11010 | const data = event.detail;
|
11011 | const colSelectedIndex = data.selectedIndex;
|
11012 | const colOptions = data.options;
|
11013 | const changeData = {};
|
11014 | changeData[data.name] = {
|
11015 | value: colOptions[colSelectedIndex].value
|
11016 | };
|
11017 | if (data.name !== 'ampm' && this.datetimeValue.ampm !== undefined) {
|
11018 | changeData['ampm'] = {
|
11019 | value: this.datetimeValue.ampm
|
11020 | };
|
11021 | }
|
11022 | this.updateDatetimeValue(changeData);
|
11023 | picker.columns = this.generateColumns();
|
11024 | });
|
11025 | await picker.present();
|
11026 | }
|
11027 | emitStyle() {
|
11028 | this.ionStyle.emit({
|
11029 | 'interactive': true,
|
11030 | 'datetime': true,
|
11031 | 'has-placeholder': this.placeholder != null,
|
11032 | 'has-value': this.hasValue(),
|
11033 | 'interactive-disabled': this.disabled,
|
11034 | });
|
11035 | }
|
11036 | updateDatetimeValue(value) {
|
11037 | updateDate(this.datetimeValue, value, this.displayTimezone);
|
11038 | }
|
11039 | generatePickerOptions() {
|
11040 | const mode = getIonMode$1(this);
|
11041 | this.locale = {
|
11042 | monthNames: convertToArrayOfStrings(this.monthNames, 'monthNames'),
|
11043 | monthShortNames: convertToArrayOfStrings(this.monthShortNames, 'monthShortNames'),
|
11044 | dayNames: convertToArrayOfStrings(this.dayNames, 'dayNames'),
|
11045 | dayShortNames: convertToArrayOfStrings(this.dayShortNames, 'dayShortNames')
|
11046 | };
|
11047 | const pickerOptions = Object.assign(Object.assign({ mode }, this.pickerOptions), { columns: this.generateColumns() });
|
11048 |
|
11049 |
|
11050 | const buttons = pickerOptions.buttons;
|
11051 | if (!buttons || buttons.length === 0) {
|
11052 | pickerOptions.buttons = [
|
11053 | {
|
11054 | text: this.cancelText,
|
11055 | role: 'cancel',
|
11056 | handler: () => {
|
11057 | this.updateDatetimeValue(this.value);
|
11058 | this.ionCancel.emit();
|
11059 | }
|
11060 | },
|
11061 | {
|
11062 | text: this.doneText,
|
11063 | handler: (data) => {
|
11064 | this.updateDatetimeValue(data);
|
11065 | |
11066 |
|
11067 |
|
11068 |
|
11069 |
|
11070 |
|
11071 |
|
11072 |
|
11073 |
|
11074 | const date = new Date(convertDataToISO(this.datetimeValue));
|
11075 |
|
11076 | this.datetimeValue.tzOffset = (this.displayTimezone !== undefined && this.displayTimezone.length > 0)
|
11077 | ? ((getTimezoneOffset(date, this.displayTimezone)) / 1000 / 60) * -1
|
11078 | : date.getTimezoneOffset() * -1;
|
11079 | this.value = convertDataToISO(this.datetimeValue);
|
11080 | }
|
11081 | }
|
11082 | ];
|
11083 | }
|
11084 | return pickerOptions;
|
11085 | }
|
11086 | generateColumns() {
|
11087 |
|
11088 |
|
11089 | let template = this.pickerFormat || this.displayFormat || DEFAULT_FORMAT;
|
11090 | if (template.length === 0) {
|
11091 | return [];
|
11092 | }
|
11093 |
|
11094 | this.calcMinMax();
|
11095 |
|
11096 |
|
11097 | template = template.replace('DDDD', '{~}').replace('DDD', '{~}');
|
11098 | if (template.indexOf('D') === -1) {
|
11099 |
|
11100 |
|
11101 | template = template.replace('{~}', 'D');
|
11102 | }
|
11103 |
|
11104 | template = template.replace(/{~}/g, '');
|
11105 |
|
11106 | const columns = parseTemplate(template).map((format) => {
|
11107 |
|
11108 |
|
11109 | const key = convertFormatToKey(format);
|
11110 | let values;
|
11111 |
|
11112 |
|
11113 | const self = this;
|
11114 | values = self[key + 'Values']
|
11115 | ? convertToArrayOfNumbers(self[key + 'Values'], key)
|
11116 | : dateValueRange(format, this.datetimeMin, this.datetimeMax);
|
11117 | const colOptions = values.map(val => {
|
11118 | return {
|
11119 | value: val,
|
11120 | text: renderTextFormat(format, val, undefined, this.locale),
|
11121 | };
|
11122 | });
|
11123 |
|
11124 |
|
11125 | const optValue = getDateValue(this.datetimeValue, format);
|
11126 | const selectedIndex = colOptions.findIndex(opt => opt.value === optValue);
|
11127 | return {
|
11128 | name: key,
|
11129 | selectedIndex: selectedIndex >= 0 ? selectedIndex : 0,
|
11130 | options: colOptions
|
11131 | };
|
11132 | });
|
11133 |
|
11134 | const min = this.datetimeMin;
|
11135 | const max = this.datetimeMax;
|
11136 | ['month', 'day', 'hour', 'minute']
|
11137 | .filter(name => !columns.find(column => column.name === name))
|
11138 | .forEach(name => {
|
11139 | min[name] = 0;
|
11140 | max[name] = 0;
|
11141 | });
|
11142 | return this.validateColumns(divyColumns(columns));
|
11143 | }
|
11144 | validateColumns(columns) {
|
11145 | const today = new Date();
|
11146 | const minCompareVal = dateDataSortValue(this.datetimeMin);
|
11147 | const maxCompareVal = dateDataSortValue(this.datetimeMax);
|
11148 | const yearCol = columns.find(c => c.name === 'year');
|
11149 | let selectedYear = today.getFullYear();
|
11150 | if (yearCol) {
|
11151 |
|
11152 | if (!yearCol.options.find(col => col.value === today.getFullYear())) {
|
11153 | selectedYear = yearCol.options[0].value;
|
11154 | }
|
11155 | const selectedIndex = yearCol.selectedIndex;
|
11156 | if (selectedIndex !== undefined) {
|
11157 | const yearOpt = yearCol.options[selectedIndex];
|
11158 | if (yearOpt) {
|
11159 |
|
11160 | selectedYear = yearOpt.value;
|
11161 | }
|
11162 | }
|
11163 | }
|
11164 | const selectedMonth = this.validateColumn(columns, 'month', 1, minCompareVal, maxCompareVal, [selectedYear, 0, 0, 0, 0], [selectedYear, 12, 31, 23, 59]);
|
11165 | const numDaysInMonth = daysInMonth(selectedMonth, selectedYear);
|
11166 | const selectedDay = this.validateColumn(columns, 'day', 2, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, 0, 0, 0], [selectedYear, selectedMonth, numDaysInMonth, 23, 59]);
|
11167 | const selectedHour = this.validateColumn(columns, 'hour', 3, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, selectedDay, 0, 0], [selectedYear, selectedMonth, selectedDay, 23, 59]);
|
11168 | this.validateColumn(columns, 'minute', 4, minCompareVal, maxCompareVal, [selectedYear, selectedMonth, selectedDay, selectedHour, 0], [selectedYear, selectedMonth, selectedDay, selectedHour, 59]);
|
11169 | return columns;
|
11170 | }
|
11171 | calcMinMax() {
|
11172 | const todaysYear = new Date().getFullYear();
|
11173 | if (this.yearValues !== undefined) {
|
11174 | const years = convertToArrayOfNumbers(this.yearValues, 'year');
|
11175 | if (this.min === undefined) {
|
11176 | this.min = Math.min(...years).toString();
|
11177 | }
|
11178 | if (this.max === undefined) {
|
11179 | this.max = Math.max(...years).toString();
|
11180 | }
|
11181 | }
|
11182 | else {
|
11183 | if (this.min === undefined) {
|
11184 | this.min = (todaysYear - 100).toString();
|
11185 | }
|
11186 | if (this.max === undefined) {
|
11187 | this.max = todaysYear.toString();
|
11188 | }
|
11189 | }
|
11190 | const min = this.datetimeMin = parseDate(this.min);
|
11191 | const max = this.datetimeMax = parseDate(this.max);
|
11192 | min.year = min.year || todaysYear;
|
11193 | max.year = max.year || todaysYear;
|
11194 | min.month = min.month || 1;
|
11195 | max.month = max.month || 12;
|
11196 | min.day = min.day || 1;
|
11197 | max.day = max.day || 31;
|
11198 | min.hour = min.hour || 0;
|
11199 | max.hour = max.hour === undefined ? 23 : max.hour;
|
11200 | min.minute = min.minute || 0;
|
11201 | max.minute = max.minute === undefined ? 59 : max.minute;
|
11202 | min.second = min.second || 0;
|
11203 | max.second = max.second === undefined ? 59 : max.second;
|
11204 |
|
11205 | if (min.year > max.year) {
|
11206 | console.error('min.year > max.year');
|
11207 | min.year = max.year - 100;
|
11208 | }
|
11209 | if (min.year === max.year) {
|
11210 | if (min.month > max.month) {
|
11211 | console.error('min.month > max.month');
|
11212 | min.month = 1;
|
11213 | }
|
11214 | else if (min.month === max.month && min.day > max.day) {
|
11215 | console.error('min.day > max.day');
|
11216 | min.day = 1;
|
11217 | }
|
11218 | }
|
11219 | }
|
11220 | validateColumn(columns, name, index, min, max, lowerBounds, upperBounds) {
|
11221 | const column = columns.find(c => c.name === name);
|
11222 | if (!column) {
|
11223 | return 0;
|
11224 | }
|
11225 | const lb = lowerBounds.slice();
|
11226 | const ub = upperBounds.slice();
|
11227 | const options = column.options;
|
11228 | let indexMin = options.length - 1;
|
11229 | let indexMax = 0;
|
11230 | for (let i = 0; i < options.length; i++) {
|
11231 | const opts = options[i];
|
11232 | const value = opts.value;
|
11233 | lb[index] = opts.value;
|
11234 | ub[index] = opts.value;
|
11235 | const disabled = opts.disabled = (value < lowerBounds[index] ||
|
11236 | value > upperBounds[index] ||
|
11237 | dateSortValue(ub[0], ub[1], ub[2], ub[3], ub[4]) < min ||
|
11238 | dateSortValue(lb[0], lb[1], lb[2], lb[3], lb[4]) > max);
|
11239 | if (!disabled) {
|
11240 | indexMin = Math.min(indexMin, i);
|
11241 | indexMax = Math.max(indexMax, i);
|
11242 | }
|
11243 | }
|
11244 | const selectedIndex = column.selectedIndex = clamp(indexMin, column.selectedIndex, indexMax);
|
11245 | const opt = column.options[selectedIndex];
|
11246 | if (opt) {
|
11247 | return opt.value;
|
11248 | }
|
11249 | return 0;
|
11250 | }
|
11251 | get text() {
|
11252 |
|
11253 | const template = this.displayFormat || this.pickerFormat || DEFAULT_FORMAT;
|
11254 | if (this.value === undefined ||
|
11255 | this.value === null ||
|
11256 | this.value.length === 0) {
|
11257 | return;
|
11258 | }
|
11259 | return renderDatetime(template, this.datetimeValue, this.locale);
|
11260 | }
|
11261 | hasValue() {
|
11262 | return this.text !== undefined;
|
11263 | }
|
11264 | setFocus() {
|
11265 | if (this.buttonEl) {
|
11266 | this.buttonEl.focus();
|
11267 | }
|
11268 | }
|
11269 | render() {
|
11270 | const { inputId, text, disabled, readonly, isExpanded, el, placeholder } = this;
|
11271 | const mode = getIonMode$1(this);
|
11272 | const labelId = inputId + '-lbl';
|
11273 | const label = findItemLabel(el);
|
11274 | const addPlaceholderClass = (text === undefined && placeholder != null) ? true : false;
|
11275 |
|
11276 |
|
11277 | const datetimeText = text === undefined
|
11278 | ? (placeholder != null ? placeholder : '')
|
11279 | : text;
|
11280 | const datetimeTextPart = text === undefined
|
11281 | ? (placeholder != null ? 'placeholder' : undefined)
|
11282 | : 'text';
|
11283 | if (label) {
|
11284 | label.id = labelId;
|
11285 | }
|
11286 | renderHiddenInput(true, el, this.name, this.value, this.disabled);
|
11287 | return (hAsync(Host, { onClick: this.onClick, "aria-disabled": disabled ? 'true' : null, "aria-expanded": `${isExpanded}`, "aria-haspopup": "true", "aria-labelledby": label ? labelId : null, class: {
|
11288 | [mode]: true,
|
11289 | 'datetime-disabled': disabled,
|
11290 | 'datetime-readonly': readonly,
|
11291 | 'datetime-placeholder': addPlaceholderClass,
|
11292 | 'in-item': hostContext('ion-item', el)
|
11293 | } }, hAsync("div", { class: "datetime-text", part: datetimeTextPart }, datetimeText), hAsync("button", { type: "button", onFocus: this.onFocus, onBlur: this.onBlur, disabled: this.disabled, ref: btnEl => this.buttonEl = btnEl })));
|
11294 | }
|
11295 | get el() { return getElement(this); }
|
11296 | static get watchers() { return {
|
11297 | "disabled": ["disabledChanged"],
|
11298 | "value": ["valueChanged"]
|
11299 | }; }
|
11300 | static get style() { return {
|
11301 | ios: datetimeIosCss,
|
11302 | md: datetimeMdCss
|
11303 | }; }
|
11304 | static get cmpMeta() { return {
|
11305 | "$flags$": 41,
|
11306 | "$tagName$": "ion-datetime",
|
11307 | "$members$": {
|
11308 | "name": [1],
|
11309 | "disabled": [4],
|
11310 | "readonly": [4],
|
11311 | "min": [1025],
|
11312 | "max": [1025],
|
11313 | "displayFormat": [1, "display-format"],
|
11314 | "displayTimezone": [1, "display-timezone"],
|
11315 | "pickerFormat": [1, "picker-format"],
|
11316 | "cancelText": [1, "cancel-text"],
|
11317 | "doneText": [1, "done-text"],
|
11318 | "yearValues": [8, "year-values"],
|
11319 | "monthValues": [8, "month-values"],
|
11320 | "dayValues": [8, "day-values"],
|
11321 | "hourValues": [8, "hour-values"],
|
11322 | "minuteValues": [8, "minute-values"],
|
11323 | "monthNames": [1, "month-names"],
|
11324 | "monthShortNames": [1, "month-short-names"],
|
11325 | "dayNames": [1, "day-names"],
|
11326 | "dayShortNames": [1, "day-short-names"],
|
11327 | "pickerOptions": [16],
|
11328 | "placeholder": [1],
|
11329 | "value": [1025],
|
11330 | "isExpanded": [32],
|
11331 | "open": [64]
|
11332 | },
|
11333 | "$listeners$": undefined,
|
11334 | "$lazyBundleId$": "-",
|
11335 | "$attrsToReflect$": []
|
11336 | }; }
|
11337 | }
|
11338 | const divyColumns = (columns) => {
|
11339 | const columnsWidth = [];
|
11340 | let col;
|
11341 | let width;
|
11342 | for (let i = 0; i < columns.length; i++) {
|
11343 | col = columns[i];
|
11344 | columnsWidth.push(0);
|
11345 | for (const option of col.options) {
|
11346 | width = option.text.length;
|
11347 | if (width > columnsWidth[i]) {
|
11348 | columnsWidth[i] = width;
|
11349 | }
|
11350 | }
|
11351 | }
|
11352 | if (columnsWidth.length === 2) {
|
11353 | width = Math.max(columnsWidth[0], columnsWidth[1]);
|
11354 | columns[0].align = 'right';
|
11355 | columns[1].align = 'left';
|
11356 | columns[0].optionsWidth = columns[1].optionsWidth = `${width * 17}px`;
|
11357 | }
|
11358 | else if (columnsWidth.length === 3) {
|
11359 | width = Math.max(columnsWidth[0], columnsWidth[2]);
|
11360 | columns[0].align = 'right';
|
11361 | columns[1].columnWidth = `${columnsWidth[1] * 17}px`;
|
11362 | columns[0].optionsWidth = columns[2].optionsWidth = `${width * 17}px`;
|
11363 | columns[2].align = 'left';
|
11364 | }
|
11365 | return columns;
|
11366 | };
|
11367 | const DEFAULT_FORMAT = 'MMM D, YYYY';
|
11368 | let datetimeIds = 0;
|
11369 |
|
11370 | const fabCss = "/*!@:host*/.sc-ion-fab-h{position:absolute;z-index:999}/*!@:host(.fab-horizontal-center)*/.fab-horizontal-center.sc-ion-fab-h{left:50%;margin-left:-28px}/*!@:host-context([dir=rtl]):host(.fab-horizontal-center), :host-context([dir=rtl]).fab-horizontal-center*/[dir=rtl].sc-ion-fab-h -no-combinator.fab-horizontal-center.sc-ion-fab-h,[dir=rtl] .sc-ion-fab-h -no-combinator.fab-horizontal-center.sc-ion-fab-h,[dir=rtl].fab-horizontal-center.sc-ion-fab-h,[dir=rtl] .fab-horizontal-center.sc-ion-fab-h{left:unset;right:unset;right:50%}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.fab-horizontal-center)*/.fab-horizontal-center.sc-ion-fab-h{margin-left:unset;-webkit-margin-start:-28px;margin-inline-start:-28px}}/*!@:host(.fab-horizontal-start)*/.fab-horizontal-start.sc-ion-fab-h{left:calc(10px + var(--ion-safe-area-left, 0px))}/*!@:host-context([dir=rtl]):host(.fab-horizontal-start), :host-context([dir=rtl]).fab-horizontal-start*/[dir=rtl].sc-ion-fab-h -no-combinator.fab-horizontal-start.sc-ion-fab-h,[dir=rtl] .sc-ion-fab-h -no-combinator.fab-horizontal-start.sc-ion-fab-h,[dir=rtl].fab-horizontal-start.sc-ion-fab-h,[dir=rtl] .fab-horizontal-start.sc-ion-fab-h{left:unset;right:unset;right:calc(10px + var(--ion-safe-area-left, 0px))}/*!@:host(.fab-horizontal-end)*/.fab-horizontal-end.sc-ion-fab-h{right:calc(10px + var(--ion-safe-area-right, 0px))}/*!@:host-context([dir=rtl]):host(.fab-horizontal-end), :host-context([dir=rtl]).fab-horizontal-end*/[dir=rtl].sc-ion-fab-h -no-combinator.fab-horizontal-end.sc-ion-fab-h,[dir=rtl] .sc-ion-fab-h -no-combinator.fab-horizontal-end.sc-ion-fab-h,[dir=rtl].fab-horizontal-end.sc-ion-fab-h,[dir=rtl] .fab-horizontal-end.sc-ion-fab-h{left:unset;right:unset;left:calc(10px + var(--ion-safe-area-right, 0px))}/*!@:host(.fab-vertical-top)*/.fab-vertical-top.sc-ion-fab-h{top:10px}/*!@:host(.fab-vertical-top.fab-edge)*/.fab-vertical-top.fab-edge.sc-ion-fab-h{top:-28px}/*!@:host(.fab-vertical-bottom)*/.fab-vertical-bottom.sc-ion-fab-h{bottom:10px}/*!@:host(.fab-vertical-bottom.fab-edge)*/.fab-vertical-bottom.fab-edge.sc-ion-fab-h{bottom:-28px}/*!@:host(.fab-vertical-center)*/.fab-vertical-center.sc-ion-fab-h{margin-top:-28px;top:50%}";
|
11371 |
|
11372 | class Fab {
|
11373 | constructor(hostRef) {
|
11374 | registerInstance(this, hostRef);
|
11375 | |
11376 |
|
11377 |
|
11378 |
|
11379 |
|
11380 | this.edge = false;
|
11381 | |
11382 |
|
11383 |
|
11384 |
|
11385 | this.activated = false;
|
11386 | this.onClick = () => {
|
11387 | const hasList = !!this.el.querySelector('ion-fab-list');
|
11388 | const getButton = this.getFab();
|
11389 | const isButtonDisabled = getButton && getButton.disabled;
|
11390 | if (hasList && !isButtonDisabled) {
|
11391 | this.activated = !this.activated;
|
11392 | }
|
11393 | };
|
11394 | }
|
11395 | activatedChanged() {
|
11396 | const activated = this.activated;
|
11397 | const fab = this.getFab();
|
11398 | if (fab) {
|
11399 | fab.activated = activated;
|
11400 | }
|
11401 | Array.from(this.el.querySelectorAll('ion-fab-list')).forEach(list => {
|
11402 | list.activated = activated;
|
11403 | });
|
11404 | }
|
11405 | componentDidLoad() {
|
11406 | if (this.activated) {
|
11407 | this.activatedChanged();
|
11408 | }
|
11409 | }
|
11410 | |
11411 |
|
11412 |
|
11413 | async close() {
|
11414 | this.activated = false;
|
11415 | }
|
11416 | getFab() {
|
11417 | return this.el.querySelector('ion-fab-button');
|
11418 | }
|
11419 | render() {
|
11420 | const { horizontal, vertical, edge } = this;
|
11421 | const mode = getIonMode$1(this);
|
11422 | return (hAsync(Host, { onClick: this.onClick, class: {
|
11423 | [mode]: true,
|
11424 | [`fab-horizontal-${horizontal}`]: horizontal !== undefined,
|
11425 | [`fab-vertical-${vertical}`]: vertical !== undefined,
|
11426 | 'fab-edge': edge
|
11427 | } }, hAsync("slot", null)));
|
11428 | }
|
11429 | get el() { return getElement(this); }
|
11430 | static get watchers() { return {
|
11431 | "activated": ["activatedChanged"]
|
11432 | }; }
|
11433 | static get style() { return fabCss; }
|
11434 | static get cmpMeta() { return {
|
11435 | "$flags$": 9,
|
11436 | "$tagName$": "ion-fab",
|
11437 | "$members$": {
|
11438 | "horizontal": [1],
|
11439 | "vertical": [1],
|
11440 | "edge": [4],
|
11441 | "activated": [1028],
|
11442 | "close": [64]
|
11443 | },
|
11444 | "$listeners$": undefined,
|
11445 | "$lazyBundleId$": "-",
|
11446 | "$attrsToReflect$": []
|
11447 | }; }
|
11448 | }
|
11449 |
|
11450 | const fabButtonIosCss = "/*!@:host*/.sc-ion-fab-button-ios-h{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}/*!@.button-native*/.button-native.sc-ion-fab-button-ios{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-fab-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@::slotted(ion-icon)*/.sc-ion-fab-button-ios-s>ion-icon{line-height:1}/*!@.button-native::after*/.button-native.sc-ion-fab-button-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@.button-inner*/.button-inner.sc-ion-fab-button-ios{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;z-index:1}/*!@:host(.fab-button-disabled)*/.fab-button-disabled.sc-ion-fab-button-ios-h{cursor:default;opacity:0.5;pointer-events:none}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-fab-button-ios-h:hover .button-native.sc-ion-fab-button-ios{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-fab-button-ios-h:hover .button-native.sc-ion-fab-button-ios::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@:host(.ion-activated) .button-native*/.ion-activated.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{color:var(--color-activated)}/*!@:host(.ion-activated) .button-native::after*/.ion-activated.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}/*!@::slotted(ion-icon)*/.sc-ion-fab-button-ios-s>ion-icon{line-height:1}/*!@:host(.fab-button-small)*/.fab-button-small.sc-ion-fab-button-ios-h{margin-left:8px;margin-right:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.fab-button-small)*/.fab-button-small.sc-ion-fab-button-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@.close-icon*/.close-icon.sc-ion-fab-button-ios{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;font-size:var(--close-icon-font-size);opacity:0;z-index:1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.close-icon*/.close-icon.sc-ion-fab-button-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}/*!@:host(.fab-button-close-active) .close-icon*/.fab-button-close-active.sc-ion-fab-button-ios-h .close-icon.sc-ion-fab-button-ios{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}/*!@:host(.fab-button-close-active) .button-inner*/.fab-button-close-active.sc-ion-fab-button-ios-h .button-inner.sc-ion-fab-button-ios{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-fab-button-ios{color:var(--ripple-color)}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.fab-button-translucent) .button-native*/.fab-button-translucent.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}/*!@:host(.ion-color) .button-native*/.ion-color.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host*/.sc-ion-fab-button-ios-h{--background:var(--ion-color-primary, #3880ff);--background-activated:var(--ion-color-primary-shade, #3171e0);--background-focused:var(--ion-color-primary-shade, #3171e0);--background-hover:var(--ion-color-primary-tint, #4c8dff);--background-activated-opacity:1;--background-focused-opacity:1;--background-hover-opacity:1;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transition:0.2s transform cubic-bezier(0.25, 1.11, 0.78, 1.59);--close-icon-font-size:28px}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-fab-button-ios-h{--box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);--transform:scale(1.1);--transition:0.2s transform ease-out}/*!@::slotted(ion-icon)*/.sc-ion-fab-button-ios-s>ion-icon{font-size:28px}/*!@:host(.fab-button-in-list)*/.fab-button-in-list.sc-ion-fab-button-ios-h{--background:var(--ion-color-light, #f4f5f8);--background-activated:var(--ion-color-light-shade, #d7d8da);--background-focused:var(--background-activated);--background-hover:var(--ion-color-light-tint, #f5f6f9);--color:var(--ion-color-light-contrast, #000);--color-activated:var(--ion-color-light-contrast, #000);--color-focused:var(--color-activated);--transition:transform 200ms ease 10ms, opacity 200ms ease 10ms}/*!@:host(.fab-button-in-list) ::slotted(ion-icon)*/.sc-ion-fab-button-ios-h.fab-button-in-list .sc-ion-fab-button-ios-s>ion-icon{font-size:18px}/*!@:host(.ion-color.ion-focused) .button-native::after*/.ion-color.ion-focused.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios::after{background:var(--ion-color-shade)}/*!@:host(.ion-color.ion-focused) .button-native,\n:host(.ion-color.ion-activated) .button-native*/.ion-color.ion-focused.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios,.ion-color.ion-activated.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-focused) .button-native::after,\n:host(.ion-color.ion-activated) .button-native::after*/.ion-color.ion-focused.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios::after,.ion-color.ion-activated.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios::after{background:var(--ion-color-shade)}@media (any-hover: hover){/*!@:host(.ion-color:hover) .button-native*/.ion-color.sc-ion-fab-button-ios-h:hover .button-native.sc-ion-fab-button-ios{color:var(--ion-color-contrast)}/*!@:host(.ion-color:hover) .button-native::after*/.ion-color.sc-ion-fab-button-ios-h:hover .button-native.sc-ion-fab-button-ios::after{background:var(--ion-color-tint)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.fab-button-translucent)*/.fab-button-translucent.sc-ion-fab-button-ios-h{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.9);--background-hover:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.8);--background-focused:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.82);--backdrop-filter:saturate(180%) blur(20px)}/*!@:host(.fab-button-translucent-in-list)*/.fab-button-translucent-in-list.sc-ion-fab-button-ios-h{--background:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.9);--background-hover:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.8);--background-focused:rgba(var(--ion-color-light-rgb, 244, 245, 248), 0.82)}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@@media (any-hover: hover)*/@media .sc-ion-fab-button-ios (any-hover.sc-ion-fab-button-ios: hover).sc-ion-fab-button-ios{.sc-ion-fab-button-ios-h.fab-button-translucent.ion-color:hover .button-native{background:rgba(var(--ion-color-base-rgb), 0.8)}}/*!@:host(.ion-color.fab-button-translucent) .button-native*/.ion-color.fab-button-translucent.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{background:rgba(var(--ion-color-base-rgb), 0.9)}/*!@:host(.ion-color.ion-focused.fab-button-translucent) .button-native,\n:host(.ion-color.ion-activated.fab-button-translucent) .button-native*/.ion-color.ion-focused.fab-button-translucent.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios,.ion-color.ion-activated.fab-button-translucent.sc-ion-fab-button-ios-h .button-native.sc-ion-fab-button-ios{background:var(--ion-color-base)}}";
|
11451 |
|
11452 | const fabButtonMdCss = "/*!@:host*/.sc-ion-fab-button-md-h{--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--background-hover:var(--ion-color-primary-contrast, #fff);--background-hover-opacity:.08;--transition:background-color, opacity 100ms linear;--ripple-color:currentColor;--border-radius:50%;--border-width:0;--border-style:none;--border-color:initial;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:56px;height:56px;font-size:14px;text-align:center;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}/*!@.button-native*/.button-native.sc-ion-fab-button-md{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transform:var(--transform);transform:var(--transform);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);background-clip:padding-box;color:var(--color);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:strict;cursor:pointer;overflow:hidden;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-fab-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@::slotted(ion-icon)*/.sc-ion-fab-button-md-s>ion-icon{line-height:1}/*!@.button-native::after*/.button-native.sc-ion-fab-button-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@.button-inner*/.button-inner.sc-ion-fab-button-md{left:0;right:0;top:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;z-index:1}/*!@:host(.fab-button-disabled)*/.fab-button-disabled.sc-ion-fab-button-md-h{cursor:default;opacity:0.5;pointer-events:none}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-fab-button-md-h:hover .button-native.sc-ion-fab-button-md{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-fab-button-md-h:hover .button-native.sc-ion-fab-button-md::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@:host(.ion-activated) .button-native*/.ion-activated.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md{color:var(--color-activated)}/*!@:host(.ion-activated) .button-native::after*/.ion-activated.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}/*!@::slotted(ion-icon)*/.sc-ion-fab-button-md-s>ion-icon{line-height:1}/*!@:host(.fab-button-small)*/.fab-button-small.sc-ion-fab-button-md-h{margin-left:8px;margin-right:8px;margin-top:8px;margin-bottom:8px;width:40px;height:40px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.fab-button-small)*/.fab-button-small.sc-ion-fab-button-md-h{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@.close-icon*/.close-icon.sc-ion-fab-button-md{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;left:0;right:0;top:0;position:absolute;height:100%;-webkit-transform:scale(0.4) rotateZ(-45deg);transform:scale(0.4) rotateZ(-45deg);-webkit-transition:all ease-in-out 300ms;transition:all ease-in-out 300ms;-webkit-transition-property:opacity, -webkit-transform;transition-property:opacity, -webkit-transform;transition-property:transform, opacity;transition-property:transform, opacity, -webkit-transform;font-size:var(--close-icon-font-size);opacity:0;z-index:1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.close-icon*/.close-icon.sc-ion-fab-button-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}/*!@:host(.fab-button-close-active) .close-icon*/.fab-button-close-active.sc-ion-fab-button-md-h .close-icon.sc-ion-fab-button-md{-webkit-transform:scale(1) rotateZ(0deg);transform:scale(1) rotateZ(0deg);opacity:1}/*!@:host(.fab-button-close-active) .button-inner*/.fab-button-close-active.sc-ion-fab-button-md-h .button-inner.sc-ion-fab-button-md{-webkit-transform:scale(0.4) rotateZ(45deg);transform:scale(0.4) rotateZ(45deg);opacity:0}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-fab-button-md{color:var(--ripple-color)}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.fab-button-translucent) .button-native*/.fab-button-translucent.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md{-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}}/*!@:host(.ion-color) .button-native*/.ion-color.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host*/.sc-ion-fab-button-md-h{--background:var(--ion-color-primary, #3880ff);--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.24;--background-hover-opacity:.08;--color:var(--ion-color-primary-contrast, #fff);--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--transition:box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), background-color 280ms cubic-bezier(0.4, 0, 0.2, 1), color 280ms cubic-bezier(0.4, 0, 0.2, 1), opacity 15ms linear 30ms, transform 270ms cubic-bezier(0, 0, 0.2, 1) 0ms;--close-icon-font-size:24px}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-fab-button-md-h{--box-shadow:0 7px 8px -4px rgba(0, 0, 0, 0.2), 0 12px 17px 2px rgba(0, 0, 0, 0.14), 0 5px 22px 4px rgba(0, 0, 0, 0.12)}/*!@::slotted(ion-icon)*/.sc-ion-fab-button-md-s>ion-icon{font-size:24px}/*!@:host(.fab-button-in-list)*/.fab-button-in-list.sc-ion-fab-button-md-h{--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-activated:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);--color-focused:var(--color-activated);--background:var(--ion-color-light, #f4f5f8);--background-activated:transparent;--background-focused:var(--ion-color-light-shade, #d7d8da);--background-hover:var(--ion-color-light-tint, #f5f6f9)}/*!@:host(.fab-button-in-list) ::slotted(ion-icon)*/.sc-ion-fab-button-md-h.fab-button-in-list .sc-ion-fab-button-md-s>ion-icon{font-size:18px}/*!@:host(.ion-color.ion-focused) .button-native*/.ion-color.ion-focused.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-focused) .button-native::after*/.ion-color.ion-focused.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md::after{background:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-activated) .button-native*/.ion-color.ion-activated.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-activated) .button-native::after*/.ion-color.ion-activated.sc-ion-fab-button-md-h .button-native.sc-ion-fab-button-md::after{background:transparent}@media (any-hover: hover){/*!@:host(.ion-color:hover) .button-native*/.ion-color.sc-ion-fab-button-md-h:hover .button-native.sc-ion-fab-button-md{color:var(--ion-color-contrast)}/*!@:host(.ion-color:hover) .button-native::after*/.ion-color.sc-ion-fab-button-md-h:hover .button-native.sc-ion-fab-button-md::after{background:var(--ion-color-contrast)}}";
|
11453 |
|
11454 |
|
11455 |
|
11456 |
|
11457 |
|
11458 |
|
11459 |
|
11460 | class FabButton {
|
11461 | constructor(hostRef) {
|
11462 | registerInstance(this, hostRef);
|
11463 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
11464 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
11465 | |
11466 |
|
11467 |
|
11468 | this.activated = false;
|
11469 | |
11470 |
|
11471 |
|
11472 | this.disabled = false;
|
11473 | |
11474 |
|
11475 |
|
11476 |
|
11477 | this.routerDirection = 'forward';
|
11478 | |
11479 |
|
11480 |
|
11481 | this.show = false;
|
11482 | |
11483 |
|
11484 |
|
11485 |
|
11486 |
|
11487 | this.translucent = false;
|
11488 | |
11489 |
|
11490 |
|
11491 | this.type = 'button';
|
11492 | |
11493 |
|
11494 |
|
11495 |
|
11496 |
|
11497 | this.closeIcon = 'close';
|
11498 | this.onFocus = () => {
|
11499 | this.ionFocus.emit();
|
11500 | };
|
11501 | this.onBlur = () => {
|
11502 | this.ionBlur.emit();
|
11503 | };
|
11504 | }
|
11505 | render() {
|
11506 | const { el, disabled, color, href, activated, show, translucent, size } = this;
|
11507 | const inList = hostContext('ion-fab-list', el);
|
11508 | const mode = getIonMode$1(this);
|
11509 | const TagType = href === undefined ? 'button' : 'a';
|
11510 | const attrs = (TagType === 'button')
|
11511 | ? { type: this.type }
|
11512 | : {
|
11513 | download: this.download,
|
11514 | href,
|
11515 | rel: this.rel,
|
11516 | target: this.target
|
11517 | };
|
11518 | return (hAsync(Host, { "aria-disabled": disabled ? 'true' : null, class: createColorClasses$1(color, {
|
11519 | [mode]: true,
|
11520 | 'fab-button-in-list': inList,
|
11521 | 'fab-button-translucent-in-list': inList && translucent,
|
11522 | 'fab-button-close-active': activated,
|
11523 | 'fab-button-show': show,
|
11524 | 'fab-button-disabled': disabled,
|
11525 | 'fab-button-translucent': translucent,
|
11526 | 'ion-activatable': true,
|
11527 | 'ion-focusable': true,
|
11528 | [`fab-button-${size}`]: size !== undefined,
|
11529 | }) }, hAsync(TagType, Object.assign({}, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur, onClick: (ev) => openURL(href, ev, this.routerDirection, this.routerAnimation) }), hAsync("ion-icon", { icon: this.closeIcon, part: "close-icon", class: "close-icon", lazy: false }), hAsync("span", { class: "button-inner" }, hAsync("slot", null)), mode === 'md' && hAsync("ion-ripple-effect", null))));
|
11530 | }
|
11531 | get el() { return getElement(this); }
|
11532 | static get style() { return {
|
11533 | ios: fabButtonIosCss,
|
11534 | md: fabButtonMdCss
|
11535 | }; }
|
11536 | static get cmpMeta() { return {
|
11537 | "$flags$": 41,
|
11538 | "$tagName$": "ion-fab-button",
|
11539 | "$members$": {
|
11540 | "color": [513],
|
11541 | "activated": [4],
|
11542 | "disabled": [4],
|
11543 | "download": [1],
|
11544 | "href": [1],
|
11545 | "rel": [1],
|
11546 | "routerDirection": [1, "router-direction"],
|
11547 | "routerAnimation": [16],
|
11548 | "target": [1],
|
11549 | "show": [4],
|
11550 | "translucent": [4],
|
11551 | "type": [1],
|
11552 | "size": [1],
|
11553 | "closeIcon": [1, "close-icon"]
|
11554 | },
|
11555 | "$listeners$": undefined,
|
11556 | "$lazyBundleId$": "-",
|
11557 | "$attrsToReflect$": [["color", "color"]]
|
11558 | }; }
|
11559 | }
|
11560 |
|
11561 | const fabListCss = "/*!@:host*/.sc-ion-fab-list-h{margin-left:0;margin-right:0;margin-top:66px;margin-bottom:66px;display:none;position:absolute;top:0;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;min-width:56px;min-height:56px}/*!@:host(.fab-list-active)*/.fab-list-active.sc-ion-fab-list-h{display:-ms-flexbox;display:flex}/*!@::slotted(.fab-button-in-list)*/.sc-ion-fab-list-s>.fab-button-in-list{margin-left:0;margin-right:0;margin-top:8px;margin-bottom:8px;width:40px;height:40px;-webkit-transform:scale(0);transform:scale(0);opacity:0;visibility:hidden}/*!@:host(.fab-list-side-top) ::slotted(.fab-button-in-list),\n:host(.fab-list-side-bottom) ::slotted(.fab-button-in-list)*/.sc-ion-fab-list-h.fab-list-side-top .sc-ion-fab-list-s>.fab-button-in-list,.sc-ion-fab-list-h.fab-list-side-bottom .sc-ion-fab-list-s>.fab-button-in-list{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px}/*!@:host(.fab-list-side-start) ::slotted(.fab-button-in-list),\n:host(.fab-list-side-end) ::slotted(.fab-button-in-list)*/.sc-ion-fab-list-h.fab-list-side-start .sc-ion-fab-list-s>.fab-button-in-list,.sc-ion-fab-list-h.fab-list-side-end .sc-ion-fab-list-s>.fab-button-in-list{margin-left:5px;margin-right:5px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.fab-list-side-start) ::slotted(.fab-button-in-list),\n:host(.fab-list-side-end) ::slotted(.fab-button-in-list)*/.sc-ion-fab-list-h.fab-list-side-start .sc-ion-fab-list-s>.fab-button-in-list,.sc-ion-fab-list-h.fab-list-side-end .sc-ion-fab-list-s>.fab-button-in-list{margin-left:unset;margin-right:unset;-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:5px;margin-inline-end:5px}}/*!@::slotted(.fab-button-in-list.fab-button-show)*/.sc-ion-fab-list-s>.fab-button-in-list.fab-button-show{-webkit-transform:scale(1);transform:scale(1);opacity:1;visibility:visible}/*!@:host(.fab-list-side-top)*/.fab-list-side-top.sc-ion-fab-list-h{top:auto;bottom:0;-ms-flex-direction:column-reverse;flex-direction:column-reverse}/*!@:host(.fab-list-side-start)*/.fab-list-side-start.sc-ion-fab-list-h{margin-left:66px;margin-right:66px;margin-top:0;margin-bottom:0;right:0;-ms-flex-direction:row-reverse;flex-direction:row-reverse}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.fab-list-side-start)*/.fab-list-side-start.sc-ion-fab-list-h{margin-left:unset;margin-right:unset;-webkit-margin-start:66px;margin-inline-start:66px;-webkit-margin-end:66px;margin-inline-end:66px}}/*!@:host-context([dir=rtl]):host(.fab-list-side-start), :host-context([dir=rtl]).fab-list-side-start*/[dir=rtl].sc-ion-fab-list-h -no-combinator.fab-list-side-start.sc-ion-fab-list-h,[dir=rtl] .sc-ion-fab-list-h -no-combinator.fab-list-side-start.sc-ion-fab-list-h,[dir=rtl].fab-list-side-start.sc-ion-fab-list-h,[dir=rtl] .fab-list-side-start.sc-ion-fab-list-h{left:unset;right:unset;left:0}/*!@:host(.fab-list-side-end)*/.fab-list-side-end.sc-ion-fab-list-h{margin-left:66px;margin-right:66px;margin-top:0;margin-bottom:0;left:0;-ms-flex-direction:row;flex-direction:row}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.fab-list-side-end)*/.fab-list-side-end.sc-ion-fab-list-h{margin-left:unset;margin-right:unset;-webkit-margin-start:66px;margin-inline-start:66px;-webkit-margin-end:66px;margin-inline-end:66px}}/*!@:host-context([dir=rtl]):host(.fab-list-side-end), :host-context([dir=rtl]).fab-list-side-end*/[dir=rtl].sc-ion-fab-list-h -no-combinator.fab-list-side-end.sc-ion-fab-list-h,[dir=rtl] .sc-ion-fab-list-h -no-combinator.fab-list-side-end.sc-ion-fab-list-h,[dir=rtl].fab-list-side-end.sc-ion-fab-list-h,[dir=rtl] .fab-list-side-end.sc-ion-fab-list-h{left:unset;right:unset;right:0}";
|
11562 |
|
11563 | class FabList {
|
11564 | constructor(hostRef) {
|
11565 | registerInstance(this, hostRef);
|
11566 | |
11567 |
|
11568 |
|
11569 | this.activated = false;
|
11570 | |
11571 |
|
11572 |
|
11573 | this.side = 'bottom';
|
11574 | }
|
11575 | activatedChanged(activated) {
|
11576 | const fabs = Array.from(this.el.querySelectorAll('ion-fab-button'));
|
11577 |
|
11578 | const timeout = activated ? 30 : 0;
|
11579 | fabs.forEach((fab, i) => {
|
11580 | setTimeout(() => fab.show = activated, i * timeout);
|
11581 | });
|
11582 | }
|
11583 | render() {
|
11584 | const mode = getIonMode$1(this);
|
11585 | return (hAsync(Host, { class: {
|
11586 | [mode]: true,
|
11587 | 'fab-list-active': this.activated,
|
11588 | [`fab-list-side-${this.side}`]: true
|
11589 | } }, hAsync("slot", null)));
|
11590 | }
|
11591 | get el() { return getElement(this); }
|
11592 | static get watchers() { return {
|
11593 | "activated": ["activatedChanged"]
|
11594 | }; }
|
11595 | static get style() { return fabListCss; }
|
11596 | static get cmpMeta() { return {
|
11597 | "$flags$": 9,
|
11598 | "$tagName$": "ion-fab-list",
|
11599 | "$members$": {
|
11600 | "activated": [4],
|
11601 | "side": [1]
|
11602 | },
|
11603 | "$listeners$": undefined,
|
11604 | "$lazyBundleId$": "-",
|
11605 | "$attrsToReflect$": []
|
11606 | }; }
|
11607 | }
|
11608 |
|
11609 | const footerIosCss = "ion-footer{display:block;position:relative;-ms-flex-order:1;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-ios ion-toolbar:first-of-type{--border-width:0.55px 0 0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.footer-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.footer-translucent-ios ion-toolbar{--opacity:.8}}.footer-ios.ion-no-border ion-toolbar:first-of-type{--border-width:0}";
|
11610 |
|
11611 | const footerMdCss = "ion-footer{display:block;position:relative;-ms-flex-order:1;order:1;width:100%;z-index:10}ion-footer ion-toolbar:last-of-type{padding-bottom:var(--ion-safe-area-bottom, 0)}.footer-md::before{left:0;top:-2px;bottom:auto;background-position:left 0 top 0;position:absolute;width:100%;height:2px;background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==\");background-repeat:repeat-x;content:\"\"}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{left:unset;right:unset;right:0}[dir=rtl] .footer-md::before,:host-context([dir=rtl]) .footer-md::before{background-position:right 0 top 0}.footer-md.ion-no-border::before{display:none}";
|
11612 |
|
11613 |
|
11614 |
|
11615 |
|
11616 | class Footer {
|
11617 | constructor(hostRef) {
|
11618 | registerInstance(this, hostRef);
|
11619 | |
11620 |
|
11621 |
|
11622 |
|
11623 |
|
11624 |
|
11625 |
|
11626 |
|
11627 | this.translucent = false;
|
11628 | }
|
11629 | render() {
|
11630 | const mode = getIonMode$1(this);
|
11631 | const translucent = this.translucent;
|
11632 | return (hAsync(Host, { role: "contentinfo", class: {
|
11633 | [mode]: true,
|
11634 |
|
11635 | [`footer-${mode}`]: true,
|
11636 | [`footer-translucent`]: translucent,
|
11637 | [`footer-translucent-${mode}`]: translucent,
|
11638 | } }, mode === 'ios' && translucent &&
|
11639 | hAsync("div", { class: "footer-background" }), hAsync("slot", null)));
|
11640 | }
|
11641 | static get style() { return {
|
11642 | ios: footerIosCss,
|
11643 | md: footerMdCss
|
11644 | }; }
|
11645 | static get cmpMeta() { return {
|
11646 | "$flags$": 36,
|
11647 | "$tagName$": "ion-footer",
|
11648 | "$members$": {
|
11649 | "translucent": [4]
|
11650 | },
|
11651 | "$listeners$": undefined,
|
11652 | "$lazyBundleId$": "-",
|
11653 | "$attrsToReflect$": []
|
11654 | }; }
|
11655 | }
|
11656 |
|
11657 | const gridCss = "/*!@:host*/.sc-ion-grid-h{padding-left:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));margin-left:auto;margin-right:auto;display:block;-ms-flex:1;flex:1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-grid-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xs, var(--ion-grid-padding, 5px))}}@media (min-width: 576px){/*!@:host*/.sc-ion-grid-h{padding-left:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-grid (margin-inline-start.sc-ion-grid: 0).sc-ion-grid or.sc-ion-grid (-webkit-margin-start.sc-ion-grid: 0).sc-ion-grid{.sc-ion-grid-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-sm, var(--ion-grid-padding, 5px))}}}@media (min-width: 768px){/*!@:host*/.sc-ion-grid-h{padding-left:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-grid (margin-inline-start.sc-ion-grid: 0).sc-ion-grid or.sc-ion-grid (-webkit-margin-start.sc-ion-grid: 0).sc-ion-grid{.sc-ion-grid-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-md, var(--ion-grid-padding, 5px))}}}@media (min-width: 992px){/*!@:host*/.sc-ion-grid-h{padding-left:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-grid (margin-inline-start.sc-ion-grid: 0).sc-ion-grid or.sc-ion-grid (-webkit-margin-start.sc-ion-grid: 0).sc-ion-grid{.sc-ion-grid-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-lg, var(--ion-grid-padding, 5px))}}}@media (min-width: 1200px){/*!@:host*/.sc-ion-grid-h{padding-left:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-right:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-top:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-bottom:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}/*!@@supports (margin-inline-start: 0) or (-webkit-margin-start: 0)*/@supports .sc-ion-grid (margin-inline-start.sc-ion-grid: 0).sc-ion-grid or.sc-ion-grid (-webkit-margin-start.sc-ion-grid: 0).sc-ion-grid{.sc-ion-grid-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-start:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));-webkit-padding-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px));padding-inline-end:var(--ion-grid-padding-xl, var(--ion-grid-padding, 5px))}}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-grid-h{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}/*!@:host(.grid-fixed)*/.grid-fixed.sc-ion-grid-h{width:var(--ion-grid-width-xs, var(--ion-grid-width, 100%));max-width:100%}@media (min-width: 576px){/*!@:host(.grid-fixed)*/.grid-fixed.sc-ion-grid-h{width:var(--ion-grid-width-sm, var(--ion-grid-width, 540px))}}@media (min-width: 768px){/*!@:host(.grid-fixed)*/.grid-fixed.sc-ion-grid-h{width:var(--ion-grid-width-md, var(--ion-grid-width, 720px))}}@media (min-width: 992px){/*!@:host(.grid-fixed)*/.grid-fixed.sc-ion-grid-h{width:var(--ion-grid-width-lg, var(--ion-grid-width, 960px))}}@media (min-width: 1200px){/*!@:host(.grid-fixed)*/.grid-fixed.sc-ion-grid-h{width:var(--ion-grid-width-xl, var(--ion-grid-width, 1140px))}}/*!@:host(.ion-no-padding)*/.ion-no-padding.sc-ion-grid-h{--ion-grid-column-padding:0;--ion-grid-column-padding-xs:0;--ion-grid-column-padding-sm:0;--ion-grid-column-padding-md:0;--ion-grid-column-padding-lg:0;--ion-grid-column-padding-xl:0}";
|
11658 |
|
11659 | class Grid {
|
11660 | constructor(hostRef) {
|
11661 | registerInstance(this, hostRef);
|
11662 | |
11663 |
|
11664 |
|
11665 | this.fixed = false;
|
11666 | }
|
11667 | render() {
|
11668 | const mode = getIonMode$1(this);
|
11669 | return (hAsync(Host, { class: {
|
11670 | [mode]: true,
|
11671 | 'grid-fixed': this.fixed
|
11672 | } }, hAsync("slot", null)));
|
11673 | }
|
11674 | static get style() { return gridCss; }
|
11675 | static get cmpMeta() { return {
|
11676 | "$flags$": 9,
|
11677 | "$tagName$": "ion-grid",
|
11678 | "$members$": {
|
11679 | "fixed": [4]
|
11680 | },
|
11681 | "$listeners$": undefined,
|
11682 | "$lazyBundleId$": "-",
|
11683 | "$attrsToReflect$": []
|
11684 | }; }
|
11685 | }
|
11686 |
|
11687 | const TRANSITION = 'all 0.2s ease-in-out';
|
11688 | const cloneElement = (tagName) => {
|
11689 | const getCachedEl = document.querySelector(`${tagName}.ion-cloned-element`);
|
11690 | if (getCachedEl !== null) {
|
11691 | return getCachedEl;
|
11692 | }
|
11693 | const clonedEl = document.createElement(tagName);
|
11694 | clonedEl.classList.add('ion-cloned-element');
|
11695 | clonedEl.style.setProperty('display', 'none');
|
11696 | document.body.appendChild(clonedEl);
|
11697 | return clonedEl;
|
11698 | };
|
11699 | const createHeaderIndex = (headerEl) => {
|
11700 | if (!headerEl) {
|
11701 | return;
|
11702 | }
|
11703 | const toolbars = headerEl.querySelectorAll('ion-toolbar');
|
11704 | return {
|
11705 | el: headerEl,
|
11706 | toolbars: Array.from(toolbars).map((toolbar) => {
|
11707 | const ionTitleEl = toolbar.querySelector('ion-title');
|
11708 | return {
|
11709 | el: toolbar,
|
11710 | background: toolbar.shadowRoot.querySelector('.toolbar-background'),
|
11711 | ionTitleEl,
|
11712 | innerTitleEl: (ionTitleEl) ? ionTitleEl.shadowRoot.querySelector('.toolbar-title') : null,
|
11713 | ionButtonsEl: Array.from(toolbar.querySelectorAll('ion-buttons')) || []
|
11714 | };
|
11715 | }) || []
|
11716 | };
|
11717 | };
|
11718 | const handleContentScroll = (scrollEl, scrollHeaderIndex, contentEl) => {
|
11719 | readTask(() => {
|
11720 | const scrollTop = scrollEl.scrollTop;
|
11721 | const scale = clamp(1, 1 + (-scrollTop / 500), 1.1);
|
11722 |
|
11723 | const nativeRefresher = contentEl.querySelector('ion-refresher.refresher-native');
|
11724 | if (nativeRefresher === null) {
|
11725 | writeTask(() => {
|
11726 | scaleLargeTitles(scrollHeaderIndex.toolbars, scale);
|
11727 | });
|
11728 | }
|
11729 | });
|
11730 | };
|
11731 | const setToolbarBackgroundOpacity = (toolbar, opacity) => {
|
11732 | if (opacity === undefined) {
|
11733 | toolbar.background.style.removeProperty('--opacity');
|
11734 | }
|
11735 | else {
|
11736 | toolbar.background.style.setProperty('--opacity', opacity.toString());
|
11737 | }
|
11738 | };
|
11739 | const handleToolbarBorderIntersection = (ev, mainHeaderIndex, scrollTop) => {
|
11740 | if (!ev[0].isIntersecting) {
|
11741 | return;
|
11742 | }
|
11743 | |
11744 |
|
11745 |
|
11746 |
|
11747 |
|
11748 |
|
11749 |
|
11750 |
|
11751 |
|
11752 |
|
11753 |
|
11754 | const scale = (ev[0].intersectionRatio > 0.9 || scrollTop <= 0) ? 0 : ((1 - ev[0].intersectionRatio) * 100) / 75;
|
11755 | mainHeaderIndex.toolbars.forEach(toolbar => {
|
11756 | setToolbarBackgroundOpacity(toolbar, (scale === 1) ? undefined : scale);
|
11757 | });
|
11758 | };
|
11759 |
|
11760 |
|
11761 |
|
11762 |
|
11763 |
|
11764 | const handleToolbarIntersection = (ev, mainHeaderIndex, scrollHeaderIndex, scrollEl) => {
|
11765 | writeTask(() => {
|
11766 | const scrollTop = scrollEl.scrollTop;
|
11767 | handleToolbarBorderIntersection(ev, mainHeaderIndex, scrollTop);
|
11768 | const event = ev[0];
|
11769 | const intersection = event.intersectionRect;
|
11770 | const intersectionArea = intersection.width * intersection.height;
|
11771 | const rootArea = event.rootBounds.width * event.rootBounds.height;
|
11772 | const isPageHidden = intersectionArea === 0 && rootArea === 0;
|
11773 | const leftDiff = Math.abs(intersection.left - event.boundingClientRect.left);
|
11774 | const rightDiff = Math.abs(intersection.right - event.boundingClientRect.right);
|
11775 | const isPageTransitioning = intersectionArea > 0 && (leftDiff >= 5 || rightDiff >= 5);
|
11776 | if (isPageHidden || isPageTransitioning) {
|
11777 | return;
|
11778 | }
|
11779 | if (event.isIntersecting) {
|
11780 | setHeaderActive(mainHeaderIndex, false);
|
11781 | setHeaderActive(scrollHeaderIndex);
|
11782 | }
|
11783 | else {
|
11784 | |
11785 |
|
11786 |
|
11787 |
|
11788 |
|
11789 |
|
11790 |
|
11791 |
|
11792 | const hasValidIntersection = (intersection.x === 0 && intersection.y === 0) || (intersection.width !== 0 && intersection.height !== 0);
|
11793 | if (hasValidIntersection && scrollTop > 0) {
|
11794 | setHeaderActive(mainHeaderIndex);
|
11795 | setHeaderActive(scrollHeaderIndex, false);
|
11796 | setToolbarBackgroundOpacity(mainHeaderIndex.toolbars[0]);
|
11797 | }
|
11798 | }
|
11799 | });
|
11800 | };
|
11801 | const setHeaderActive = (headerIndex, active = true) => {
|
11802 | if (active) {
|
11803 | headerIndex.el.classList.remove('header-collapse-condense-inactive');
|
11804 | }
|
11805 | else {
|
11806 | headerIndex.el.classList.add('header-collapse-condense-inactive');
|
11807 | }
|
11808 | };
|
11809 | const scaleLargeTitles = (toolbars = [], scale = 1, transition = false) => {
|
11810 | toolbars.forEach(toolbar => {
|
11811 | const ionTitle = toolbar.ionTitleEl;
|
11812 | const titleDiv = toolbar.innerTitleEl;
|
11813 | if (!ionTitle || ionTitle.size !== 'large') {
|
11814 | return;
|
11815 | }
|
11816 | titleDiv.style.transition = (transition) ? TRANSITION : '';
|
11817 | titleDiv.style.transform = `scale3d(${scale}, ${scale}, 1)`;
|
11818 | });
|
11819 | };
|
11820 |
|
11821 | const headerIosCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:-webkit-sticky;position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:7px;z-index:1}.header-collapse-condense ion-toolbar{--background:var(--ion-background-color, #fff);z-index:0}.header-collapse-condense ion-toolbar ion-searchbar{height:48px;padding-top:0px;padding-bottom:13px}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}";
|
11822 |
|
11823 | const headerMdCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md::after{left:0;bottom:-5px;background-position:left 0 top -2px;position:absolute;width:100%;height:5px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAHBAMAAADzDtBxAAAAD1BMVEUAAAAAAAAAAAAAAAAAAABPDueNAAAABXRSTlMUCS0gBIh/TXEAAAAaSURBVAjXYxCEAgY4UIICBmMogMsgFLtAAQCNSwXZKOdPxgAAAABJRU5ErkJggg==);background-repeat:repeat-x;content:\"\"}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{left:unset;right:unset;right:0}[dir=rtl] .header-md::after,:host-context([dir=rtl]) .header-md::after{background-position:right 0 top -2px}.header-collapse-condense{display:none}.header-md.ion-no-border::after{display:none}";
|
11824 |
|
11825 |
|
11826 |
|
11827 |
|
11828 | class Header {
|
11829 | constructor(hostRef) {
|
11830 | registerInstance(this, hostRef);
|
11831 | this.collapsibleHeaderInitialized = false;
|
11832 | |
11833 |
|
11834 |
|
11835 |
|
11836 |
|
11837 |
|
11838 |
|
11839 |
|
11840 | this.translucent = false;
|
11841 | }
|
11842 | async componentDidLoad() {
|
11843 | await this.checkCollapsibleHeader();
|
11844 | }
|
11845 | async componentDidUpdate() {
|
11846 | await this.checkCollapsibleHeader();
|
11847 | }
|
11848 | disconnectedCallback() {
|
11849 | this.destroyCollapsibleHeader();
|
11850 | }
|
11851 | async checkCollapsibleHeader() {
|
11852 |
|
11853 | const hasCollapse = this.collapse === 'condense';
|
11854 | const canCollapse = (hasCollapse && getIonMode$1(this) === 'ios') ? hasCollapse : false;
|
11855 | if (!canCollapse && this.collapsibleHeaderInitialized) {
|
11856 | this.destroyCollapsibleHeader();
|
11857 | }
|
11858 | else if (canCollapse && !this.collapsibleHeaderInitialized) {
|
11859 | const pageEl = this.el.closest('ion-app,ion-page,.ion-page,page-inner');
|
11860 | const contentEl = (pageEl) ? pageEl.querySelector('ion-content') : null;
|
11861 |
|
11862 | writeTask(() => {
|
11863 | const title = cloneElement('ion-title');
|
11864 | title.size = 'large';
|
11865 | cloneElement('ion-back-button');
|
11866 | });
|
11867 | await this.setupCollapsibleHeader(contentEl, pageEl);
|
11868 | }
|
11869 | }
|
11870 | destroyCollapsibleHeader() {
|
11871 | if (this.intersectionObserver) {
|
11872 | this.intersectionObserver.disconnect();
|
11873 | this.intersectionObserver = undefined;
|
11874 | }
|
11875 | if (this.scrollEl && this.contentScrollCallback) {
|
11876 | this.scrollEl.removeEventListener('scroll', this.contentScrollCallback);
|
11877 | this.contentScrollCallback = undefined;
|
11878 | }
|
11879 | if (this.collapsibleMainHeader) {
|
11880 | this.collapsibleMainHeader.classList.remove('header-collapse-main');
|
11881 | this.collapsibleMainHeader = undefined;
|
11882 | }
|
11883 | }
|
11884 | async setupCollapsibleHeader(contentEl, pageEl) {
|
11885 | if (!contentEl || !pageEl) {
|
11886 | console.error('ion-header requires a content to collapse, make sure there is an ion-content.');
|
11887 | return;
|
11888 | }
|
11889 | if (typeof IntersectionObserver === 'undefined') {
|
11890 | return;
|
11891 | }
|
11892 | this.scrollEl = await contentEl.getScrollElement();
|
11893 | const headers = pageEl.querySelectorAll('ion-header');
|
11894 | this.collapsibleMainHeader = Array.from(headers).find((header) => header.collapse !== 'condense');
|
11895 | if (!this.collapsibleMainHeader) {
|
11896 | return;
|
11897 | }
|
11898 | const mainHeaderIndex = createHeaderIndex(this.collapsibleMainHeader);
|
11899 | const scrollHeaderIndex = createHeaderIndex(this.el);
|
11900 | if (!mainHeaderIndex || !scrollHeaderIndex) {
|
11901 | return;
|
11902 | }
|
11903 | setHeaderActive(mainHeaderIndex, false);
|
11904 | mainHeaderIndex.toolbars.forEach(toolbar => {
|
11905 | setToolbarBackgroundOpacity(toolbar, 0);
|
11906 | });
|
11907 | |
11908 |
|
11909 |
|
11910 |
|
11911 |
|
11912 |
|
11913 | const toolbarIntersection = (ev) => { handleToolbarIntersection(ev, mainHeaderIndex, scrollHeaderIndex, this.scrollEl); };
|
11914 | this.intersectionObserver = new IntersectionObserver(toolbarIntersection, { root: contentEl, threshold: [0.25, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1] });
|
11915 | this.intersectionObserver.observe(scrollHeaderIndex.toolbars[scrollHeaderIndex.toolbars.length - 1].el);
|
11916 | |
11917 |
|
11918 |
|
11919 |
|
11920 |
|
11921 | this.contentScrollCallback = () => { handleContentScroll(this.scrollEl, scrollHeaderIndex, contentEl); };
|
11922 | this.scrollEl.addEventListener('scroll', this.contentScrollCallback);
|
11923 | writeTask(() => {
|
11924 | if (this.collapsibleMainHeader !== undefined) {
|
11925 | this.collapsibleMainHeader.classList.add('header-collapse-main');
|
11926 | }
|
11927 | });
|
11928 | this.collapsibleHeaderInitialized = true;
|
11929 | }
|
11930 | render() {
|
11931 | const { translucent } = this;
|
11932 | const mode = getIonMode$1(this);
|
11933 | const collapse = this.collapse || 'none';
|
11934 | return (hAsync(Host, { role: "banner", class: {
|
11935 | [mode]: true,
|
11936 |
|
11937 | [`header-${mode}`]: true,
|
11938 | [`header-translucent`]: this.translucent,
|
11939 | [`header-collapse-${collapse}`]: true,
|
11940 | [`header-translucent-${mode}`]: this.translucent,
|
11941 | } }, mode === 'ios' && translucent &&
|
11942 | hAsync("div", { class: "header-background" }), hAsync("slot", null)));
|
11943 | }
|
11944 | get el() { return getElement(this); }
|
11945 | static get style() { return {
|
11946 | ios: headerIosCss,
|
11947 | md: headerMdCss
|
11948 | }; }
|
11949 | static get cmpMeta() { return {
|
11950 | "$flags$": 36,
|
11951 | "$tagName$": "ion-header",
|
11952 | "$members$": {
|
11953 | "collapse": [1],
|
11954 | "translucent": [4]
|
11955 | },
|
11956 | "$listeners$": undefined,
|
11957 | "$lazyBundleId$": "-",
|
11958 | "$attrsToReflect$": []
|
11959 | }; }
|
11960 | }
|
11961 |
|
11962 | const getName = (iconName, icon, mode, ios, md) => {
|
11963 |
|
11964 | mode = (mode && toLower(mode)) === 'ios' ? 'ios' : 'md';
|
11965 |
|
11966 |
|
11967 | if (ios && mode === 'ios') {
|
11968 | iconName = toLower(ios);
|
11969 | }
|
11970 | else if (md && mode === 'md') {
|
11971 | iconName = toLower(md);
|
11972 | }
|
11973 | else {
|
11974 | if (!iconName && icon && !isSrc(icon)) {
|
11975 | iconName = icon;
|
11976 | }
|
11977 | if (isStr(iconName)) {
|
11978 | iconName = toLower(iconName);
|
11979 | }
|
11980 | }
|
11981 | if (!isStr(iconName) || iconName.trim() === '') {
|
11982 | return null;
|
11983 | }
|
11984 |
|
11985 | const invalidChars = iconName.replace(/[a-z]|-|\d/gi, '');
|
11986 | if (invalidChars !== '') {
|
11987 | return null;
|
11988 | }
|
11989 | return iconName;
|
11990 | };
|
11991 | const isSrc = (str) => str.length > 0 && /(\/|\.)/.test(str);
|
11992 | const isStr = (val) => typeof val === 'string';
|
11993 | const toLower = (val) => val.toLowerCase();
|
11994 |
|
11995 | const iconCss = "/*!@:host*/.sc-ion-icon-h{display:inline-block;width:1em;height:1em;contain:strict;fill:currentColor;-webkit-box-sizing:content-box !important;box-sizing:content-box !important}/*!@:host .ionicon*/.sc-ion-icon-h .ionicon.sc-ion-icon{stroke:currentColor}/*!@.ionicon-fill-none*/.ionicon-fill-none.sc-ion-icon{fill:none}/*!@.ionicon-stroke-width*/.ionicon-stroke-width.sc-ion-icon{stroke-width:32px;stroke-width:var(--ionicon-stroke-width, 32px)}/*!@.icon-inner,\n.ionicon,\nsvg*/.icon-inner.sc-ion-icon,.ionicon.sc-ion-icon,svg.sc-ion-icon{display:block;height:100%;width:100%}/*!@:host(.flip-rtl) .icon-inner*/.flip-rtl.sc-ion-icon-h .icon-inner.sc-ion-icon{-webkit-transform:scaleX(-1);transform:scaleX(-1)}/*!@:host(.icon-small)*/.icon-small.sc-ion-icon-h{font-size:18px !important}/*!@:host(.icon-large)*/.icon-large.sc-ion-icon-h{font-size:32px !important}/*!@:host(.ion-color)*/.ion-color.sc-ion-icon-h{color:var(--ion-color-base) !important}/*!@:host(.ion-color-primary)*/.ion-color-primary.sc-ion-icon-h{--ion-color-base:var(--ion-color-primary, #3880ff)}/*!@:host(.ion-color-secondary)*/.ion-color-secondary.sc-ion-icon-h{--ion-color-base:var(--ion-color-secondary, #0cd1e8)}/*!@:host(.ion-color-tertiary)*/.ion-color-tertiary.sc-ion-icon-h{--ion-color-base:var(--ion-color-tertiary, #f4a942)}/*!@:host(.ion-color-success)*/.ion-color-success.sc-ion-icon-h{--ion-color-base:var(--ion-color-success, #10dc60)}/*!@:host(.ion-color-warning)*/.ion-color-warning.sc-ion-icon-h{--ion-color-base:var(--ion-color-warning, #ffce00)}/*!@:host(.ion-color-danger)*/.ion-color-danger.sc-ion-icon-h{--ion-color-base:var(--ion-color-danger, #f14141)}/*!@:host(.ion-color-light)*/.ion-color-light.sc-ion-icon-h{--ion-color-base:var(--ion-color-light, #f4f5f8)}/*!@:host(.ion-color-medium)*/.ion-color-medium.sc-ion-icon-h{--ion-color-base:var(--ion-color-medium, #989aa2)}/*!@:host(.ion-color-dark)*/.ion-color-dark.sc-ion-icon-h{--ion-color-base:var(--ion-color-dark, #222428)}";
|
11996 |
|
11997 | class Icon {
|
11998 | constructor(hostRef) {
|
11999 | registerInstance(this, hostRef);
|
12000 | this.iconName = null;
|
12001 | this.isVisible = false;
|
12002 | |
12003 |
|
12004 |
|
12005 | this.mode = getIonMode();
|
12006 | |
12007 |
|
12008 |
|
12009 |
|
12010 | this.lazy = false;
|
12011 | |
12012 |
|
12013 |
|
12014 |
|
12015 |
|
12016 |
|
12017 | this.sanitize = true;
|
12018 | }
|
12019 | connectedCallback() {
|
12020 |
|
12021 |
|
12022 |
|
12023 | this.waitUntilVisible(this.el, '50px', () => {
|
12024 | this.isVisible = true;
|
12025 | this.loadIcon();
|
12026 | });
|
12027 | }
|
12028 | disconnectedCallback() {
|
12029 | if (this.io) {
|
12030 | this.io.disconnect();
|
12031 | this.io = undefined;
|
12032 | }
|
12033 | }
|
12034 | waitUntilVisible(el, rootMargin, cb) {
|
12035 | {
|
12036 |
|
12037 |
|
12038 | cb();
|
12039 | }
|
12040 | }
|
12041 | loadIcon() {
|
12042 | const label = this.iconName = getName(this.name, this.icon, this.mode, this.ios, this.md);
|
12043 | if (!this.ariaLabel && this.ariaHidden !== 'true') {
|
12044 |
|
12045 |
|
12046 | if (label) {
|
12047 | this.ariaLabel = label.replace(/\-/g, ' ');
|
12048 | }
|
12049 | }
|
12050 | }
|
12051 | render() {
|
12052 | const { iconName } = this;
|
12053 | const mode = this.mode || 'md';
|
12054 | const flipRtl = this.flipRtl ||
|
12055 | (iconName &&
|
12056 | (iconName.indexOf('arrow') > -1 || iconName.indexOf('chevron') > -1) &&
|
12057 | this.flipRtl !== false);
|
12058 | return (hAsync(Host, { role: "img", class: Object.assign(Object.assign({ [mode]: true }, createColorClasses(this.color)), { [`icon-${this.size}`]: !!this.size, 'flip-rtl': !!flipRtl && this.el.ownerDocument.dir === 'rtl' }) }, (hAsync("div", { class: "icon-inner" }))));
|
12059 | }
|
12060 | static get assetsDirs() { return ["svg"]; }
|
12061 | get el() { return getElement(this); }
|
12062 | static get watchers() { return {
|
12063 | "name": ["loadIcon"],
|
12064 | "src": ["loadIcon"],
|
12065 | "icon": ["loadIcon"]
|
12066 | }; }
|
12067 | static get style() { return iconCss; }
|
12068 | static get cmpMeta() { return {
|
12069 | "$flags$": 9,
|
12070 | "$tagName$": "ion-icon",
|
12071 | "$members$": {
|
12072 | "mode": [1025],
|
12073 | "color": [1],
|
12074 | "ariaLabel": [1537, "aria-label"],
|
12075 | "ariaHidden": [513, "aria-hidden"],
|
12076 | "ios": [1],
|
12077 | "md": [1],
|
12078 | "flipRtl": [4, "flip-rtl"],
|
12079 | "name": [513],
|
12080 | "src": [1],
|
12081 | "icon": [8],
|
12082 | "size": [1],
|
12083 | "lazy": [4],
|
12084 | "sanitize": [4],
|
12085 | "svgContent": [32],
|
12086 | "isVisible": [32]
|
12087 | },
|
12088 | "$listeners$": undefined,
|
12089 | "$lazyBundleId$": "-",
|
12090 | "$attrsToReflect$": [["ariaLabel", "aria-label"], ["ariaHidden", "aria-hidden"], ["name", "name"]]
|
12091 | }; }
|
12092 | }
|
12093 | const getIonMode = () => 'md';
|
12094 | const createColorClasses = (color) => {
|
12095 | return color
|
12096 | ? {
|
12097 | 'ion-color': true,
|
12098 | [`ion-color-${color}`]: true,
|
12099 | }
|
12100 | : null;
|
12101 | };
|
12102 |
|
12103 | const imgCss = "/*!@:host*/.sc-ion-img-h{display:block;-o-object-fit:contain;object-fit:contain}/*!@img*/img.sc-ion-img{display:block;width:100%;height:100%;-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit}";
|
12104 |
|
12105 |
|
12106 |
|
12107 |
|
12108 | class Img {
|
12109 | constructor(hostRef) {
|
12110 | registerInstance(this, hostRef);
|
12111 | this.ionImgWillLoad = createEvent(this, "ionImgWillLoad", 7);
|
12112 | this.ionImgDidLoad = createEvent(this, "ionImgDidLoad", 7);
|
12113 | this.ionError = createEvent(this, "ionError", 7);
|
12114 | this.onLoad = () => {
|
12115 | this.ionImgDidLoad.emit();
|
12116 | };
|
12117 | this.onError = () => {
|
12118 | this.ionError.emit();
|
12119 | };
|
12120 | }
|
12121 | srcChanged() {
|
12122 | this.addIO();
|
12123 | }
|
12124 | componentDidLoad() {
|
12125 | this.addIO();
|
12126 | }
|
12127 | addIO() {
|
12128 | if (this.src === undefined) {
|
12129 | return;
|
12130 | }
|
12131 | if (typeof window !== 'undefined' &&
|
12132 | 'IntersectionObserver' in window &&
|
12133 | 'IntersectionObserverEntry' in window &&
|
12134 | 'isIntersecting' in window.IntersectionObserverEntry.prototype) {
|
12135 | this.removeIO();
|
12136 | this.io = new IntersectionObserver(data => {
|
12137 | |
12138 |
|
12139 |
|
12140 |
|
12141 |
|
12142 | if (data[data.length - 1].isIntersecting) {
|
12143 | this.load();
|
12144 | this.removeIO();
|
12145 | }
|
12146 | });
|
12147 | this.io.observe(this.el);
|
12148 | }
|
12149 | else {
|
12150 |
|
12151 | setTimeout(() => this.load(), 200);
|
12152 | }
|
12153 | }
|
12154 | load() {
|
12155 | this.loadError = this.onError;
|
12156 | this.loadSrc = this.src;
|
12157 | this.ionImgWillLoad.emit();
|
12158 | }
|
12159 | removeIO() {
|
12160 | if (this.io) {
|
12161 | this.io.disconnect();
|
12162 | this.io = undefined;
|
12163 | }
|
12164 | }
|
12165 | render() {
|
12166 | return (hAsync(Host, { class: getIonMode$1(this) }, hAsync("img", { decoding: "async", src: this.loadSrc, alt: this.alt, onLoad: this.onLoad, onError: this.loadError, part: "image" })));
|
12167 | }
|
12168 | get el() { return getElement(this); }
|
12169 | static get watchers() { return {
|
12170 | "src": ["srcChanged"]
|
12171 | }; }
|
12172 | static get style() { return imgCss; }
|
12173 | static get cmpMeta() { return {
|
12174 | "$flags$": 9,
|
12175 | "$tagName$": "ion-img",
|
12176 | "$members$": {
|
12177 | "alt": [1],
|
12178 | "src": [1],
|
12179 | "loadSrc": [32],
|
12180 | "loadError": [32]
|
12181 | },
|
12182 | "$listeners$": undefined,
|
12183 | "$lazyBundleId$": "-",
|
12184 | "$attrsToReflect$": []
|
12185 | }; }
|
12186 | }
|
12187 |
|
12188 | const infiniteScrollCss = "ion-infinite-scroll{display:none;width:100%}.infinite-scroll-enabled{display:block}";
|
12189 |
|
12190 | class InfiniteScroll {
|
12191 | constructor(hostRef) {
|
12192 | registerInstance(this, hostRef);
|
12193 | this.ionInfinite = createEvent(this, "ionInfinite", 7);
|
12194 | this.thrPx = 0;
|
12195 | this.thrPc = 0;
|
12196 | this.didFire = false;
|
12197 | this.isBusy = false;
|
12198 | this.isLoading = false;
|
12199 | |
12200 |
|
12201 |
|
12202 |
|
12203 |
|
12204 |
|
12205 |
|
12206 |
|
12207 |
|
12208 | this.threshold = '15%';
|
12209 | |
12210 |
|
12211 |
|
12212 |
|
12213 |
|
12214 |
|
12215 |
|
12216 |
|
12217 |
|
12218 | this.disabled = false;
|
12219 | |
12220 |
|
12221 |
|
12222 |
|
12223 | this.position = 'bottom';
|
12224 | this.onScroll = () => {
|
12225 | const scrollEl = this.scrollEl;
|
12226 | if (!scrollEl || !this.canStart()) {
|
12227 | return 1;
|
12228 | }
|
12229 | const infiniteHeight = this.el.offsetHeight;
|
12230 | if (infiniteHeight === 0) {
|
12231 |
|
12232 | return 2;
|
12233 | }
|
12234 | const scrollTop = scrollEl.scrollTop;
|
12235 | const scrollHeight = scrollEl.scrollHeight;
|
12236 | const height = scrollEl.offsetHeight;
|
12237 | const threshold = this.thrPc !== 0 ? (height * this.thrPc) : this.thrPx;
|
12238 | const distanceFromInfinite = (this.position === 'bottom')
|
12239 | ? scrollHeight - infiniteHeight - scrollTop - threshold - height
|
12240 | : scrollTop - infiniteHeight - threshold;
|
12241 | if (distanceFromInfinite < 0) {
|
12242 | if (!this.didFire) {
|
12243 | this.isLoading = true;
|
12244 | this.didFire = true;
|
12245 | this.ionInfinite.emit();
|
12246 | return 3;
|
12247 | }
|
12248 | }
|
12249 | else {
|
12250 | this.didFire = false;
|
12251 | }
|
12252 | return 4;
|
12253 | };
|
12254 | }
|
12255 | thresholdChanged() {
|
12256 | const val = this.threshold;
|
12257 | if (val.lastIndexOf('%') > -1) {
|
12258 | this.thrPx = 0;
|
12259 | this.thrPc = (parseFloat(val) / 100);
|
12260 | }
|
12261 | else {
|
12262 | this.thrPx = parseFloat(val);
|
12263 | this.thrPc = 0;
|
12264 | }
|
12265 | }
|
12266 | disabledChanged() {
|
12267 | const disabled = this.disabled;
|
12268 | if (disabled) {
|
12269 | this.isLoading = false;
|
12270 | this.isBusy = false;
|
12271 | }
|
12272 | this.enableScrollEvents(!disabled);
|
12273 | }
|
12274 | async connectedCallback() {
|
12275 | const contentEl = this.el.closest('ion-content');
|
12276 | if (!contentEl) {
|
12277 | console.error('<ion-infinite-scroll> must be used inside an <ion-content>');
|
12278 | return;
|
12279 | }
|
12280 | this.scrollEl = await contentEl.getScrollElement();
|
12281 | this.thresholdChanged();
|
12282 | this.disabledChanged();
|
12283 | if (this.position === 'top') {
|
12284 | writeTask(() => {
|
12285 | if (this.scrollEl) {
|
12286 | this.scrollEl.scrollTop = this.scrollEl.scrollHeight - this.scrollEl.clientHeight;
|
12287 | }
|
12288 | });
|
12289 | }
|
12290 | }
|
12291 | disconnectedCallback() {
|
12292 | this.enableScrollEvents(false);
|
12293 | this.scrollEl = undefined;
|
12294 | }
|
12295 | |
12296 |
|
12297 |
|
12298 |
|
12299 |
|
12300 |
|
12301 |
|
12302 |
|
12303 |
|
12304 |
|
12305 | async complete() {
|
12306 | const scrollEl = this.scrollEl;
|
12307 | if (!this.isLoading || !scrollEl) {
|
12308 | return;
|
12309 | }
|
12310 | this.isLoading = false;
|
12311 | if (this.position === 'top') {
|
12312 | |
12313 |
|
12314 |
|
12315 |
|
12316 |
|
12317 |
|
12318 |
|
12319 |
|
12320 |
|
12321 |
|
12322 |
|
12323 |
|
12324 |
|
12325 |
|
12326 |
|
12327 |
|
12328 |
|
12329 |
|
12330 |
|
12331 | this.isBusy = true;
|
12332 |
|
12333 |
|
12334 | const prev = scrollEl.scrollHeight - scrollEl.scrollTop;
|
12335 |
|
12336 | requestAnimationFrame(() => {
|
12337 | readTask(() => {
|
12338 |
|
12339 | const scrollHeight = scrollEl.scrollHeight;
|
12340 |
|
12341 | const newScrollTop = scrollHeight - prev;
|
12342 |
|
12343 | requestAnimationFrame(() => {
|
12344 | writeTask(() => {
|
12345 | scrollEl.scrollTop = newScrollTop;
|
12346 | this.isBusy = false;
|
12347 | });
|
12348 | });
|
12349 | });
|
12350 | });
|
12351 | }
|
12352 | }
|
12353 | canStart() {
|
12354 | return (!this.disabled &&
|
12355 | !this.isBusy &&
|
12356 | !!this.scrollEl &&
|
12357 | !this.isLoading);
|
12358 | }
|
12359 | enableScrollEvents(shouldListen) {
|
12360 | if (this.scrollEl) {
|
12361 | if (shouldListen) {
|
12362 | this.scrollEl.addEventListener('scroll', this.onScroll);
|
12363 | }
|
12364 | else {
|
12365 | this.scrollEl.removeEventListener('scroll', this.onScroll);
|
12366 | }
|
12367 | }
|
12368 | }
|
12369 | render() {
|
12370 | const mode = getIonMode$1(this);
|
12371 | const disabled = this.disabled;
|
12372 | return (hAsync(Host, { class: {
|
12373 | [mode]: true,
|
12374 | 'infinite-scroll-loading': this.isLoading,
|
12375 | 'infinite-scroll-enabled': !disabled
|
12376 | } }));
|
12377 | }
|
12378 | get el() { return getElement(this); }
|
12379 | static get watchers() { return {
|
12380 | "threshold": ["thresholdChanged"],
|
12381 | "disabled": ["disabledChanged"]
|
12382 | }; }
|
12383 | static get style() { return infiniteScrollCss; }
|
12384 | static get cmpMeta() { return {
|
12385 | "$flags$": 0,
|
12386 | "$tagName$": "ion-infinite-scroll",
|
12387 | "$members$": {
|
12388 | "threshold": [1],
|
12389 | "disabled": [4],
|
12390 | "position": [1],
|
12391 | "isLoading": [32],
|
12392 | "complete": [64]
|
12393 | },
|
12394 | "$listeners$": undefined,
|
12395 | "$lazyBundleId$": "-",
|
12396 | "$attrsToReflect$": []
|
12397 | }; }
|
12398 | }
|
12399 |
|
12400 | const infiniteScrollContentIosCss = "ion-infinite-scroll-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:84px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-loading{margin-left:0;margin-right:0;margin-top:0;margin-bottom:32px;display:none;width:100%}.infinite-loading-text{margin-left:32px;margin-right:32px;margin-top:4px;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.infinite-loading-text{margin-left:unset;margin-right:unset;-webkit-margin-start:32px;margin-inline-start:32px;-webkit-margin-end:32px;margin-inline-end:32px}}.infinite-scroll-loading ion-infinite-scroll-content>.infinite-loading{display:block}.infinite-scroll-content-ios .infinite-loading-text{color:var(--ion-color-step-600, #666666)}.infinite-scroll-content-ios .infinite-loading-spinner .spinner-lines-ios line,.infinite-scroll-content-ios .infinite-loading-spinner .spinner-lines-small-ios line,.infinite-scroll-content-ios .infinite-loading-spinner .spinner-crescent circle{stroke:var(--ion-color-step-600, #666666)}.infinite-scroll-content-ios .infinite-loading-spinner .spinner-bubbles circle,.infinite-scroll-content-ios .infinite-loading-spinner .spinner-circles circle,.infinite-scroll-content-ios .infinite-loading-spinner .spinner-dots circle{fill:var(--ion-color-step-600, #666666)}";
|
12401 |
|
12402 | const infiniteScrollContentMdCss = "ion-infinite-scroll-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:84px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-loading{margin-left:0;margin-right:0;margin-top:0;margin-bottom:32px;display:none;width:100%}.infinite-loading-text{margin-left:32px;margin-right:32px;margin-top:4px;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.infinite-loading-text{margin-left:unset;margin-right:unset;-webkit-margin-start:32px;margin-inline-start:32px;-webkit-margin-end:32px;margin-inline-end:32px}}.infinite-scroll-loading ion-infinite-scroll-content>.infinite-loading{display:block}.infinite-scroll-content-md .infinite-loading-text{color:var(--ion-color-step-600, #666666)}.infinite-scroll-content-md .infinite-loading-spinner .spinner-lines-md line,.infinite-scroll-content-md .infinite-loading-spinner .spinner-lines-small-md line,.infinite-scroll-content-md .infinite-loading-spinner .spinner-crescent circle{stroke:var(--ion-color-step-600, #666666)}.infinite-scroll-content-md .infinite-loading-spinner .spinner-bubbles circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-circles circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-dots circle{fill:var(--ion-color-step-600, #666666)}";
|
12403 |
|
12404 | class InfiniteScrollContent {
|
12405 | constructor(hostRef) {
|
12406 | registerInstance(this, hostRef);
|
12407 | }
|
12408 | componentDidLoad() {
|
12409 | if (this.loadingSpinner === undefined) {
|
12410 | const mode = getIonMode$1(this);
|
12411 | this.loadingSpinner = config.get('infiniteLoadingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));
|
12412 | }
|
12413 | }
|
12414 | render() {
|
12415 | const mode = getIonMode$1(this);
|
12416 | return (hAsync(Host, { class: {
|
12417 | [mode]: true,
|
12418 |
|
12419 | [`infinite-scroll-content-${mode}`]: true
|
12420 | } }, hAsync("div", { class: "infinite-loading" }, this.loadingSpinner && (hAsync("div", { class: "infinite-loading-spinner" }, hAsync("ion-spinner", { name: this.loadingSpinner }))), this.loadingText && (hAsync("div", { class: "infinite-loading-text", innerHTML: sanitizeDOMString(this.loadingText) })))));
|
12421 | }
|
12422 | static get style() { return {
|
12423 | ios: infiniteScrollContentIosCss,
|
12424 | md: infiniteScrollContentMdCss
|
12425 | }; }
|
12426 | static get cmpMeta() { return {
|
12427 | "$flags$": 32,
|
12428 | "$tagName$": "ion-infinite-scroll-content",
|
12429 | "$members$": {
|
12430 | "loadingSpinner": [1025, "loading-spinner"],
|
12431 | "loadingText": [1, "loading-text"]
|
12432 | },
|
12433 | "$listeners$": undefined,
|
12434 | "$lazyBundleId$": "-",
|
12435 | "$attrsToReflect$": []
|
12436 | }; }
|
12437 | }
|
12438 |
|
12439 | const inputIosCss = ".sc-ion-input-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--background:transparent;--color:initial;display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;width:100%;padding:0 !important;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);z-index:2}ion-item.sc-ion-input-ios-h:not(.item-label),ion-item:not(.item-label) .sc-ion-input-ios-h{--padding-start:0}.ion-color.sc-ion-input-ios-h{color:var(--ion-color-base)}.native-input.sc-ion-input-ios{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:inline-block;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.native-input.sc-ion-input-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-input.sc-ion-input-ios::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-ios::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-ios:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-ios::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-ios:-webkit-autofill{background-color:transparent}.native-input.sc-ion-input-ios:invalid{-webkit-box-shadow:none;box-shadow:none}.native-input.sc-ion-input-ios::-ms-clear{display:none}.native-input[disabled].sc-ion-input-ios{opacity:0.4}.cloned-input.sc-ion-input-ios{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-input-ios .cloned-input.sc-ion-input-ios,[dir=rtl].sc-ion-input-ios-h .cloned-input.sc-ion-input-ios,[dir=rtl] .sc-ion-input-ios-h .cloned-input.sc-ion-input-ios{left:unset;right:unset;right:0}.input-clear-icon.sc-ion-input-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;background-position:center;border:0;outline:none;background-color:transparent;background-repeat:no-repeat;visibility:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input-clear-icon.sc-ion-input-ios:focus{opacity:0.5}.has-value.sc-ion-input-ios-h .input-clear-icon.sc-ion-input-ios{visibility:visible}.has-focus.sc-ion-input-ios-h{pointer-events:none}.has-focus.sc-ion-input-ios-h input.sc-ion-input-ios,.has-focus.sc-ion-input-ios-h a.sc-ion-input-ios,.has-focus.sc-ion-input-ios-h button.sc-ion-input-ios{pointer-events:auto}.item-label-floating.item-has-placeholder.sc-ion-input-ios-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-input-ios-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-input-ios-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-input-ios-h{-webkit-transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-input-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:0;font-size:inherit}.item-label-stacked.sc-ion-input-ios-h,.item-label-stacked .sc-ion-input-ios-h,.item-label-floating.sc-ion-input-ios-h,.item-label-floating .sc-ion-input-ios-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}.input-clear-icon.sc-ion-input-ios{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'><path%20fill='var(--ion-color-step-600,%20%23666666)'%20d='M403.1,108.9c-81.2-81.2-212.9-81.2-294.2,0s-81.2,212.9,0,294.2c81.2,81.2,212.9,81.2,294.2,0S484.3,190.1,403.1,108.9z%20M352,340.2L340.2,352l-84.4-84.2l-84,83.8L160,339.8l84-83.8l-84-83.8l11.8-11.8l84,83.8l84.4-84.2l11.8,11.8L267.6,256L352,340.2z'/></svg>\");width:30px;height:30px;background-size:18px}";
|
12440 |
|
12441 | const inputMdCss = ".sc-ion-input-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--background:transparent;--color:initial;display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;width:100%;padding:0 !important;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);z-index:2}ion-item.sc-ion-input-md-h:not(.item-label),ion-item:not(.item-label) .sc-ion-input-md-h{--padding-start:0}.ion-color.sc-ion-input-md-h{color:var(--ion-color-base)}.native-input.sc-ion-input-md{border-radius:var(--border-radius);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:inline-block;-ms-flex:1;flex:1;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.native-input.sc-ion-input-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-input.sc-ion-input-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-input.sc-ion-input-md:-webkit-autofill{background-color:transparent}.native-input.sc-ion-input-md:invalid{-webkit-box-shadow:none;box-shadow:none}.native-input.sc-ion-input-md::-ms-clear{display:none}.native-input[disabled].sc-ion-input-md{opacity:0.4}.cloned-input.sc-ion-input-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-input-md .cloned-input.sc-ion-input-md,[dir=rtl].sc-ion-input-md-h .cloned-input.sc-ion-input-md,[dir=rtl] .sc-ion-input-md-h .cloned-input.sc-ion-input-md{left:unset;right:unset;right:0}.input-clear-icon.sc-ion-input-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;background-position:center;border:0;outline:none;background-color:transparent;background-repeat:no-repeat;visibility:hidden;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input-clear-icon.sc-ion-input-md:focus{opacity:0.5}.has-value.sc-ion-input-md-h .input-clear-icon.sc-ion-input-md{visibility:visible}.has-focus.sc-ion-input-md-h{pointer-events:none}.has-focus.sc-ion-input-md-h input.sc-ion-input-md,.has-focus.sc-ion-input-md-h a.sc-ion-input-md,.has-focus.sc-ion-input-md-h button.sc-ion-input-md{pointer-events:auto}.item-label-floating.item-has-placeholder.sc-ion-input-md-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-input-md-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-input-md-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-input-md-h{-webkit-transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-input-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:10px;--padding-start:8px;font-size:inherit}.item-label-stacked.sc-ion-input-md-h,.item-label-stacked .sc-ion-input-md-h,.item-label-floating.sc-ion-input-md-h,.item-label-floating .sc-ion-input-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}.input-clear-icon.sc-ion-input-md{background-image:url(\"data:image/svg+xml;charset=utf-8,<svg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20512%20512'><polygon%20fill='var(--ion-color-step-600,%20%23666666)'%20points='405,136.798%20375.202,107%20256,226.202%20136.798,107%20107,136.798%20226.202,256%20107,375.202%20136.798,405%20256,285.798%20375.202,405%20405,375.202%20285.798,256'/></svg>\");width:30px;height:30px;background-size:22px}";
|
12442 |
|
12443 |
|
12444 |
|
12445 |
|
12446 | class Input {
|
12447 | constructor(hostRef) {
|
12448 | registerInstance(this, hostRef);
|
12449 | this.ionInput = createEvent(this, "ionInput", 7);
|
12450 | this.ionChange = createEvent(this, "ionChange", 7);
|
12451 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
12452 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
12453 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
12454 | this.inputId = `ion-input-${inputIds++}`;
|
12455 | this.didBlurAfterEdit = false;
|
12456 | this.inheritedAttributes = {};
|
12457 | |
12458 |
|
12459 |
|
12460 |
|
12461 |
|
12462 |
|
12463 |
|
12464 |
|
12465 | this.fireFocusEvents = true;
|
12466 | this.hasFocus = false;
|
12467 | |
12468 |
|
12469 |
|
12470 |
|
12471 | this.autocapitalize = 'off';
|
12472 | |
12473 |
|
12474 |
|
12475 | this.autocomplete = 'off';
|
12476 | |
12477 |
|
12478 |
|
12479 | this.autocorrect = 'off';
|
12480 | |
12481 |
|
12482 |
|
12483 | this.autofocus = false;
|
12484 | |
12485 |
|
12486 |
|
12487 | this.clearInput = false;
|
12488 | |
12489 |
|
12490 |
|
12491 | this.debounce = 0;
|
12492 | |
12493 |
|
12494 |
|
12495 | this.disabled = false;
|
12496 | |
12497 |
|
12498 |
|
12499 | this.name = this.inputId;
|
12500 | |
12501 |
|
12502 |
|
12503 | this.readonly = false;
|
12504 | |
12505 |
|
12506 |
|
12507 | this.required = false;
|
12508 | |
12509 |
|
12510 |
|
12511 | this.spellcheck = false;
|
12512 | |
12513 |
|
12514 |
|
12515 | this.type = 'text';
|
12516 | |
12517 |
|
12518 |
|
12519 | this.value = '';
|
12520 | this.onInput = (ev) => {
|
12521 | const input = ev.target;
|
12522 | if (input) {
|
12523 | this.value = input.value || '';
|
12524 | }
|
12525 | this.ionInput.emit(ev);
|
12526 | };
|
12527 | this.onBlur = (ev) => {
|
12528 | this.hasFocus = false;
|
12529 | this.focusChanged();
|
12530 | this.emitStyle();
|
12531 | if (this.fireFocusEvents) {
|
12532 | this.ionBlur.emit(ev);
|
12533 | }
|
12534 | };
|
12535 | this.onFocus = (ev) => {
|
12536 | this.hasFocus = true;
|
12537 | this.focusChanged();
|
12538 | this.emitStyle();
|
12539 | if (this.fireFocusEvents) {
|
12540 | this.ionFocus.emit(ev);
|
12541 | }
|
12542 | };
|
12543 | this.onKeydown = (ev) => {
|
12544 | if (this.shouldClearOnEdit()) {
|
12545 |
|
12546 |
|
12547 | if (this.didBlurAfterEdit && this.hasValue() && ev.key !== 'Enter') {
|
12548 |
|
12549 | this.clearTextInput();
|
12550 | }
|
12551 |
|
12552 | this.didBlurAfterEdit = false;
|
12553 | }
|
12554 | };
|
12555 | this.clearTextOnEnter = (ev) => {
|
12556 | if (ev.key === 'Enter') {
|
12557 | this.clearTextInput(ev);
|
12558 | }
|
12559 | };
|
12560 | this.clearTextInput = (ev) => {
|
12561 | if (this.clearInput && !this.readonly && !this.disabled && ev) {
|
12562 | ev.preventDefault();
|
12563 | ev.stopPropagation();
|
12564 |
|
12565 | this.setFocus();
|
12566 | }
|
12567 | this.value = '';
|
12568 | |
12569 |
|
12570 |
|
12571 |
|
12572 |
|
12573 | if (this.nativeInput) {
|
12574 | this.nativeInput.value = '';
|
12575 | }
|
12576 | };
|
12577 | }
|
12578 | debounceChanged() {
|
12579 | this.ionChange = debounceEvent(this.ionChange, this.debounce);
|
12580 | }
|
12581 | disabledChanged() {
|
12582 | this.emitStyle();
|
12583 | }
|
12584 | |
12585 |
|
12586 |
|
12587 | placeholderChanged() {
|
12588 | this.emitStyle();
|
12589 | }
|
12590 | |
12591 |
|
12592 |
|
12593 | valueChanged() {
|
12594 | this.emitStyle();
|
12595 | this.ionChange.emit({ value: this.value == null ? this.value : this.value.toString() });
|
12596 | }
|
12597 | componentWillLoad() {
|
12598 | this.inheritedAttributes = inheritAttributes(this.el, ['aria-label', 'tabindex', 'title']);
|
12599 | }
|
12600 | connectedCallback() {
|
12601 | this.emitStyle();
|
12602 | this.debounceChanged();
|
12603 | }
|
12604 | disconnectedCallback() {
|
12605 | }
|
12606 | |
12607 |
|
12608 |
|
12609 |
|
12610 | async setFocus() {
|
12611 | if (this.nativeInput) {
|
12612 | this.nativeInput.focus();
|
12613 | }
|
12614 | }
|
12615 | |
12616 |
|
12617 |
|
12618 |
|
12619 |
|
12620 | async setBlur() {
|
12621 | if (this.nativeInput) {
|
12622 | this.nativeInput.blur();
|
12623 | }
|
12624 | }
|
12625 | |
12626 |
|
12627 |
|
12628 | getInputElement() {
|
12629 | return Promise.resolve(this.nativeInput);
|
12630 | }
|
12631 | shouldClearOnEdit() {
|
12632 | const { type, clearOnEdit } = this;
|
12633 | return (clearOnEdit === undefined)
|
12634 | ? type === 'password'
|
12635 | : clearOnEdit;
|
12636 | }
|
12637 | getValue() {
|
12638 | return typeof this.value === 'number' ? this.value.toString() :
|
12639 | (this.value || '').toString();
|
12640 | }
|
12641 | emitStyle() {
|
12642 | this.ionStyle.emit({
|
12643 | 'interactive': true,
|
12644 | 'input': true,
|
12645 | 'has-placeholder': this.placeholder != null,
|
12646 | 'has-value': this.hasValue(),
|
12647 | 'has-focus': this.hasFocus,
|
12648 | 'interactive-disabled': this.disabled,
|
12649 | });
|
12650 | }
|
12651 | focusChanged() {
|
12652 |
|
12653 | if (!this.hasFocus && this.shouldClearOnEdit() && this.hasValue()) {
|
12654 | this.didBlurAfterEdit = true;
|
12655 | }
|
12656 | }
|
12657 | hasValue() {
|
12658 | return this.getValue().length > 0;
|
12659 | }
|
12660 | render() {
|
12661 | const mode = getIonMode$1(this);
|
12662 | const value = this.getValue();
|
12663 | const labelId = this.inputId + '-lbl';
|
12664 | const label = findItemLabel(this.el);
|
12665 | if (label) {
|
12666 | label.id = labelId;
|
12667 | }
|
12668 | return (hAsync(Host, { "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
12669 | [mode]: true,
|
12670 | 'has-value': this.hasValue(),
|
12671 | 'has-focus': this.hasFocus
|
12672 | }) }, hAsync("input", Object.assign({ class: "native-input", ref: input => this.nativeInput = input, "aria-labelledby": label ? labelId : null, disabled: this.disabled, accept: this.accept, autoCapitalize: this.autocapitalize, autoComplete: this.autocomplete, autoCorrect: this.autocorrect, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, step: this.step, size: this.size, type: this.type, value: value, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeydown }, this.inheritedAttributes)), (this.clearInput && !this.readonly && !this.disabled) && hAsync("button", { "aria-label": "reset", type: "button", class: "input-clear-icon", onTouchStart: this.clearTextInput, onMouseDown: this.clearTextInput, onKeyDown: this.clearTextOnEnter })));
|
12673 | }
|
12674 | get el() { return getElement(this); }
|
12675 | static get watchers() { return {
|
12676 | "debounce": ["debounceChanged"],
|
12677 | "disabled": ["disabledChanged"],
|
12678 | "placeholder": ["placeholderChanged"],
|
12679 | "value": ["valueChanged"]
|
12680 | }; }
|
12681 | static get style() { return {
|
12682 | ios: inputIosCss,
|
12683 | md: inputMdCss
|
12684 | }; }
|
12685 | static get cmpMeta() { return {
|
12686 | "$flags$": 34,
|
12687 | "$tagName$": "ion-input",
|
12688 | "$members$": {
|
12689 | "fireFocusEvents": [4, "fire-focus-events"],
|
12690 | "color": [513],
|
12691 | "accept": [1],
|
12692 | "autocapitalize": [1],
|
12693 | "autocomplete": [1],
|
12694 | "autocorrect": [1],
|
12695 | "autofocus": [4],
|
12696 | "clearInput": [4, "clear-input"],
|
12697 | "clearOnEdit": [4, "clear-on-edit"],
|
12698 | "debounce": [2],
|
12699 | "disabled": [4],
|
12700 | "enterkeyhint": [1],
|
12701 | "inputmode": [1],
|
12702 | "max": [1],
|
12703 | "maxlength": [2],
|
12704 | "min": [1],
|
12705 | "minlength": [2],
|
12706 | "multiple": [4],
|
12707 | "name": [1],
|
12708 | "pattern": [1],
|
12709 | "placeholder": [1],
|
12710 | "readonly": [4],
|
12711 | "required": [4],
|
12712 | "spellcheck": [4],
|
12713 | "step": [1],
|
12714 | "size": [2],
|
12715 | "type": [1],
|
12716 | "value": [1032],
|
12717 | "hasFocus": [32],
|
12718 | "setFocus": [64],
|
12719 | "setBlur": [64],
|
12720 | "getInputElement": [64]
|
12721 | },
|
12722 | "$listeners$": undefined,
|
12723 | "$lazyBundleId$": "-",
|
12724 | "$attrsToReflect$": [["color", "color"]]
|
12725 | }; }
|
12726 | }
|
12727 | let inputIds = 0;
|
12728 |
|
12729 | const itemIosCss = "/*!@:host*/.sc-ion-item-ios-h{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@:host(.ion-color) .item-native*/.ion-color.sc-ion-item-ios-h .item-native.sc-ion-item-ios{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.ion-color) .item-native,\n:host(.ion-color) .item-inner*/.ion-color.sc-ion-item-ios-h .item-native.sc-ion-item-ios,.ion-color.sc-ion-item-ios-h .item-inner.sc-ion-item-ios{border-color:var(--ion-color-shade)}/*!@:host(.ion-activated) .item-native*/.ion-activated.sc-ion-item-ios-h .item-native.sc-ion-item-ios{color:var(--color-activated)}/*!@:host(.ion-activated) .item-native::after*/.ion-activated.sc-ion-item-ios-h .item-native.sc-ion-item-ios::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}/*!@:host(.ion-color.ion-activated) .item-native*/.ion-color.ion-activated.sc-ion-item-ios-h .item-native.sc-ion-item-ios{color:var(--ion-color-contrast)}/*!@:host(.ion-focused) .item-native*/.ion-focused.sc-ion-item-ios-h .item-native.sc-ion-item-ios{color:var(--color-focused)}/*!@:host(.ion-focused) .item-native::after*/.ion-focused.sc-ion-item-ios-h .item-native.sc-ion-item-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@:host(.ion-color.ion-focused) .item-native*/.ion-color.ion-focused.sc-ion-item-ios-h .item-native.sc-ion-item-ios{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-focused) .item-native::after*/.ion-color.ion-focused.sc-ion-item-ios-h .item-native.sc-ion-item-ios::after{background:var(--ion-color-contrast)}@media (any-hover: hover){/*!@:host(.ion-activatable:hover) .item-native*/.ion-activatable.sc-ion-item-ios-h:hover .item-native.sc-ion-item-ios{color:var(--color-hover)}/*!@:host(.ion-activatable:hover) .item-native::after*/.ion-activatable.sc-ion-item-ios-h:hover .item-native.sc-ion-item-ios::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}/*!@:host(.ion-color.ion-activatable:hover) .item-native*/.ion-color.ion-activatable.sc-ion-item-ios-h:hover .item-native.sc-ion-item-ios{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-activatable:hover) .item-native::after*/.ion-color.ion-activatable.sc-ion-item-ios-h:hover .item-native.sc-ion-item-ios::after{background:var(--ion-color-contrast)}}/*!@:host(.item-interactive-disabled:not(.item-multiple-inputs))*/.item-interactive-disabled.sc-ion-item-ios-h:not(.item-multiple-inputs){cursor:default;pointer-events:none}/*!@:host(.item-disabled)*/.item-disabled.sc-ion-item-ios-h{cursor:default;opacity:0.3;pointer-events:none}/*!@.item-native*/.item-native.sc-ion-item-ios{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-native*/.item-native.sc-ion-item-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.item-native::-moz-focus-inner*/.item-native.sc-ion-item-ios::-moz-focus-inner{border:0}/*!@.item-native::after*/.item-native.sc-ion-item-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:var(--transition);transition:var(--transition);z-index:-1}/*!@button, a*/button.sc-ion-item-ios,a.sc-ion-item-ios{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}/*!@.item-inner*/.item-inner.sc-ion-item-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);-webkit-box-shadow:var(--inner-box-shadow);box-shadow:var(--inner-box-shadow);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-inner*/.item-inner.sc-ion-item-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}/*!@.item-detail-icon*/.item-detail-icon.sc-ion-item-ios{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}/*!@::slotted(ion-icon)*/.sc-ion-item-ios-s>ion-icon{font-size:1.6em}/*!@::slotted(ion-button)*/.sc-ion-item-ios-s>ion-button{--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}/*!@::slotted(ion-label:not([slot=end]))*/.sc-ion-item-ios-s>ion-label:not([slot=end]){-ms-flex:1;flex:1}/*!@:host(.item-input)*/.item-input.sc-ion-item-ios-h{-ms-flex-align:center;align-items:center}/*!@.input-wrapper*/.input-wrapper.sc-ion-item-ios{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;text-overflow:ellipsis;overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@:host(.item-label-stacked),\n:host(.item-label-floating)*/.item-label-stacked.sc-ion-item-ios-h,.item-label-floating.sc-ion-item-ios-h{-ms-flex-align:start;align-items:start}/*!@:host(.item-label-stacked) .input-wrapper,\n:host(.item-label-floating) .input-wrapper*/.item-label-stacked.sc-ion-item-ios-h .input-wrapper.sc-ion-item-ios,.item-label-floating.sc-ion-item-ios-h .input-wrapper.sc-ion-item-ios{-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column}/*!@.item-highlight,\n.item-inner-highlight*/.item-highlight.sc-ion-item-ios,.item-inner-highlight.sc-ion-item-ios{left:0;right:0;bottom:0;position:absolute;background:var(--highlight-background);z-index:1}/*!@.item-highlight*/.item-highlight.sc-ion-item-ios{height:var(--full-highlight-height)}/*!@.item-inner-highlight*/.item-inner-highlight.sc-ion-item-ios{height:var(--inset-highlight-height)}/*!@:host(.item-interactive.item-has-focus),\n:host(.item-interactive.ion-touched.ion-invalid)*/.item-interactive.item-has-focus.sc-ion-item-ios-h,.item-interactive.ion-touched.ion-invalid.sc-ion-item-ios-h{--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}/*!@:host(.item-interactive.item-has-focus)*/.item-interactive.item-has-focus.sc-ion-item-ios-h{--highlight-background:var(--highlight-color-focused)}/*!@:host(.item-interactive.ion-valid)*/.item-interactive.ion-valid.sc-ion-item-ios-h{--highlight-background:var(--highlight-color-valid)}/*!@:host(.item-interactive.ion-invalid)*/.item-interactive.ion-invalid.sc-ion-item-ios-h{--highlight-background:var(--highlight-color-invalid)}/*!@:host(:not(.item-label)) ::slotted(ion-select)*/.sc-ion-item-ios-h:not(.item-label) .sc-ion-item-ios-s>ion-select{--padding-start:0;max-width:none}/*!@:host(.item-label-stacked) ::slotted(ion-select),\n:host(.item-label-floating) ::slotted(ion-select)*/.sc-ion-item-ios-h.item-label-stacked .sc-ion-item-ios-s>ion-select,.sc-ion-item-ios-h.item-label-floating .sc-ion-item-ios-s>ion-select{--padding-top:8px;--padding-bottom:8px;--padding-start:0;-ms-flex-item-align:stretch;align-self:stretch;width:100%;max-width:100%}/*!@:host(:not(.item-label)) ::slotted(ion-datetime)*/.sc-ion-item-ios-h:not(.item-label) .sc-ion-item-ios-s>ion-datetime{--padding-start:0}/*!@:host(.item-label-stacked) ::slotted(ion-datetime),\n:host(.item-label-floating) ::slotted(ion-datetime)*/.sc-ion-item-ios-h.item-label-stacked .sc-ion-item-ios-s>ion-datetime,.sc-ion-item-ios-h.item-label-floating .sc-ion-item-ios-s>ion-datetime{--padding-start:0;width:100%}/*!@:host(.item-multiple-inputs) ::slotted(ion-checkbox),\n:host(.item-multiple-inputs) ::slotted(ion-datetime),\n:host(.item-multiple-inputs) ::slotted(ion-radio),\n:host(.item-multiple-inputs) ::slotted(ion-select)*/.sc-ion-item-ios-h.item-multiple-inputs .sc-ion-item-ios-s>ion-checkbox,.sc-ion-item-ios-h.item-multiple-inputs .sc-ion-item-ios-s>ion-datetime,.sc-ion-item-ios-h.item-multiple-inputs .sc-ion-item-ios-s>ion-radio,.sc-ion-item-ios-h.item-multiple-inputs .sc-ion-item-ios-s>ion-select{position:relative}/*!@:host(.item-textarea)*/.item-textarea.sc-ion-item-ios-h{-ms-flex-align:stretch;align-items:stretch}/*!@::slotted(ion-reorder[slot])*/.sc-ion-item-ios-s>ion-reorder[slot]{margin-top:0;margin-bottom:0}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-item-ios{color:var(--ripple-color)}/*!@:host*/.sc-ion-item-ios-h{--min-height:44px;--transition:background-color 200ms linear, opacity 200ms linear;--padding-start:20px;--inner-padding-end:10px;--inner-border-width:0px 0px 0.55px 0px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:#000;--background-focused:#000;--background-hover:currentColor;--background-activated-opacity:.12;--background-focused-opacity:.15;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--color:var(--ion-item-color, var(--ion-text-color, #000));--highlight-height:0;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:17px}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-item-ios-h{--transition:none}/*!@:host(.ion-color.ion-focused) .item-native::after*/.ion-color.ion-focused.sc-ion-item-ios-h .item-native.sc-ion-item-ios::after{background:#000;opacity:0.15}/*!@:host(.ion-color.ion-activated) .item-native::after*/.ion-color.ion-activated.sc-ion-item-ios-h .item-native.sc-ion-item-ios::after{background:#000;opacity:0.12}/*!@:host(.item-interactive)*/.item-interactive.sc-ion-item-ios-h{--show-full-highlight:0;--show-inset-highlight:1}/*!@:host(.item-lines-full)*/.item-lines-full.sc-ion-item-ios-h{--border-width:0px 0px 0.55px 0px;--show-full-highlight:1;--show-inset-highlight:0}/*!@:host(.item-lines-inset)*/.item-lines-inset.sc-ion-item-ios-h{--inner-border-width:0px 0px 0.55px 0px;--show-full-highlight:0;--show-inset-highlight:1}/*!@:host(.item-lines-inset),\n:host(.item-lines-none)*/.item-lines-inset.sc-ion-item-ios-h,.item-lines-none.sc-ion-item-ios-h{--border-width:0px;--show-full-highlight:0}/*!@:host(.item-lines-full),\n:host(.item-lines-none)*/.item-lines-full.sc-ion-item-ios-h,.item-lines-none.sc-ion-item-ios-h{--inner-border-width:0px;--show-inset-highlight:0}/*!@::slotted([slot=start])*/.sc-ion-item-ios-s>[slot=start]{margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-item-ios-s>[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}/*!@::slotted([slot=end])*/.sc-ion-item-ios-s>[slot=end]{margin-left:10px;margin-right:10px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-item-ios-s>[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}/*!@::slotted(ion-icon[slot=start]),\n::slotted(ion-icon[slot=end])*/.sc-ion-item-ios-s>ion-icon[slot=start],.sc-ion-item-ios-s>ion-icon[slot=end]{margin-top:7px;margin-bottom:7px}/*!@::slotted(ion-toggle[slot=start]),\n::slotted(ion-toggle[slot=end])*/.sc-ion-item-ios-s>ion-toggle[slot=start],.sc-ion-item-ios-s>ion-toggle[slot=end]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}/*!@:host(.item-label-stacked) ::slotted([slot=end]),\n:host(.item-label-floating) ::slotted([slot=end])*/.sc-ion-item-ios-h.item-label-stacked .sc-ion-item-ios-s>[slot=end],.sc-ion-item-ios-h.item-label-floating .sc-ion-item-ios-s>[slot=end]{margin-top:7px;margin-bottom:7px}/*!@::slotted(.button-small)*/.sc-ion-item-ios-s>.button-small{--padding-top:0px;--padding-bottom:0px;--padding-start:.5em;--padding-end:.5em;height:24px;font-size:13px}/*!@::slotted(ion-avatar)*/.sc-ion-item-ios-s>ion-avatar{width:36px;height:36px}/*!@::slotted(ion-thumbnail)*/.sc-ion-item-ios-s>ion-thumbnail{width:56px;height:56px}/*!@::slotted(ion-avatar[slot=end]),\n::slotted(ion-thumbnail[slot=end])*/.sc-ion-item-ios-s>ion-avatar[slot=end],.sc-ion-item-ios-s>ion-thumbnail[slot=end]{margin-left:10px;margin-right:10px;margin-top:10px;margin-bottom:10px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar[slot=end]),\n::slotted(ion-thumbnail[slot=end])*/.sc-ion-item-ios-s>ion-avatar[slot=end],.sc-ion-item-ios-s>ion-thumbnail[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}/*!@:host(.item-radio) ::slotted(ion-label),\n:host(.item-toggle) ::slotted(ion-label)*/.sc-ion-item-ios-h.item-radio .sc-ion-item-ios-s>ion-label,.sc-ion-item-ios-h.item-toggle .sc-ion-item-ios-s>ion-label{margin-left:0px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.item-radio) ::slotted(ion-label),\n:host(.item-toggle) ::slotted(ion-label)*/.sc-ion-item-ios-h.item-radio .sc-ion-item-ios-s>ion-label,.sc-ion-item-ios-h.item-toggle .sc-ion-item-ios-s>ion-label{margin-left:unset;-webkit-margin-start:0px;margin-inline-start:0px}}/*!@::slotted(ion-label)*/.sc-ion-item-ios-s>ion-label{margin-left:0;margin-right:8px;margin-top:10px;margin-bottom:10px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-label)*/.sc-ion-item-ios-s>ion-label{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@:host(.item-label-floating),\n:host(.item-label-stacked)*/.item-label-floating.sc-ion-item-ios-h,.item-label-stacked.sc-ion-item-ios-h{--min-height:68px}/*!@:host(.item-label-stacked) ::slotted(ion-select),\n:host(.item-label-floating) ::slotted(ion-select)*/.sc-ion-item-ios-h.item-label-stacked .sc-ion-item-ios-s>ion-select,.sc-ion-item-ios-h.item-label-floating .sc-ion-item-ios-s>ion-select{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}/*!@:host(.item-label-fixed) ::slotted(ion-select),\n:host(.item-label-fixed) ::slotted(ion-datetime)*/.sc-ion-item-ios-h.item-label-fixed .sc-ion-item-ios-s>ion-select,.sc-ion-item-ios-h.item-label-fixed .sc-ion-item-ios-s>ion-datetime{--padding-start:0}";
|
12730 |
|
12731 | const itemMdCss = "/*!@:host*/.sc-ion-item-md-h{--border-radius:0px;--border-width:0px;--border-style:solid;--padding-top:0px;--padding-bottom:0px;--padding-end:0px;--padding-start:0px;--inner-border-width:0px;--inner-padding-top:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;--inner-padding-end:0px;--inner-box-shadow:none;--show-full-highlight:0;--show-inset-highlight:0;--detail-icon-color:initial;--detail-icon-font-size:20px;--detail-icon-opacity:0.25;--color-activated:var(--color);--color-focused:var(--color);--color-hover:var(--color);--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:block;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);text-align:initial;text-decoration:none;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@:host(.ion-color) .item-native*/.ion-color.sc-ion-item-md-h .item-native.sc-ion-item-md{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.ion-color) .item-native,\n:host(.ion-color) .item-inner*/.ion-color.sc-ion-item-md-h .item-native.sc-ion-item-md,.ion-color.sc-ion-item-md-h .item-inner.sc-ion-item-md{border-color:var(--ion-color-shade)}/*!@:host(.ion-activated) .item-native*/.ion-activated.sc-ion-item-md-h .item-native.sc-ion-item-md{color:var(--color-activated)}/*!@:host(.ion-activated) .item-native::after*/.ion-activated.sc-ion-item-md-h .item-native.sc-ion-item-md::after{background:var(--background-activated);opacity:var(--background-activated-opacity)}/*!@:host(.ion-color.ion-activated) .item-native*/.ion-color.ion-activated.sc-ion-item-md-h .item-native.sc-ion-item-md{color:var(--ion-color-contrast)}/*!@:host(.ion-focused) .item-native*/.ion-focused.sc-ion-item-md-h .item-native.sc-ion-item-md{color:var(--color-focused)}/*!@:host(.ion-focused) .item-native::after*/.ion-focused.sc-ion-item-md-h .item-native.sc-ion-item-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@:host(.ion-color.ion-focused) .item-native*/.ion-color.ion-focused.sc-ion-item-md-h .item-native.sc-ion-item-md{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-focused) .item-native::after*/.ion-color.ion-focused.sc-ion-item-md-h .item-native.sc-ion-item-md::after{background:var(--ion-color-contrast)}@media (any-hover: hover){/*!@:host(.ion-activatable:hover) .item-native*/.ion-activatable.sc-ion-item-md-h:hover .item-native.sc-ion-item-md{color:var(--color-hover)}/*!@:host(.ion-activatable:hover) .item-native::after*/.ion-activatable.sc-ion-item-md-h:hover .item-native.sc-ion-item-md::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}/*!@:host(.ion-color.ion-activatable:hover) .item-native*/.ion-color.ion-activatable.sc-ion-item-md-h:hover .item-native.sc-ion-item-md{color:var(--ion-color-contrast)}/*!@:host(.ion-color.ion-activatable:hover) .item-native::after*/.ion-color.ion-activatable.sc-ion-item-md-h:hover .item-native.sc-ion-item-md::after{background:var(--ion-color-contrast)}}/*!@:host(.item-interactive-disabled:not(.item-multiple-inputs))*/.item-interactive-disabled.sc-ion-item-md-h:not(.item-multiple-inputs){cursor:default;pointer-events:none}/*!@:host(.item-disabled)*/.item-disabled.sc-ion-item-md-h{cursor:default;opacity:0.3;pointer-events:none}/*!@.item-native*/.item-native.sc-ion-item-md{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;min-height:var(--min-height);-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box;z-index:1}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-native*/.item-native.sc-ion-item-md{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.item-native::-moz-focus-inner*/.item-native.sc-ion-item-md::-moz-focus-inner{border:0}/*!@.item-native::after*/.item-native.sc-ion-item-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:var(--transition);transition:var(--transition);z-index:-1}/*!@button, a*/button.sc-ion-item-md,a.sc-ion-item-md{cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-drag:none}/*!@.item-inner*/.item-inner.sc-ion-item-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);-webkit-box-shadow:var(--inner-box-shadow);box-shadow:var(--inner-box-shadow);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-inner*/.item-inner.sc-ion-item-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}/*!@.item-detail-icon*/.item-detail-icon.sc-ion-item-md{color:var(--detail-icon-color);font-size:var(--detail-icon-font-size);opacity:var(--detail-icon-opacity)}/*!@::slotted(ion-icon)*/.sc-ion-item-md-s>ion-icon{font-size:1.6em}/*!@::slotted(ion-button)*/.sc-ion-item-md-s>ion-button{--margin-top:0;--margin-bottom:0;--margin-start:0;--margin-end:0;z-index:1}/*!@::slotted(ion-label:not([slot=end]))*/.sc-ion-item-md-s>ion-label:not([slot=end]){-ms-flex:1;flex:1}/*!@:host(.item-input)*/.item-input.sc-ion-item-md-h{-ms-flex-align:center;align-items:center}/*!@.input-wrapper*/.input-wrapper.sc-ion-item-md{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;text-overflow:ellipsis;overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@:host(.item-label-stacked),\n:host(.item-label-floating)*/.item-label-stacked.sc-ion-item-md-h,.item-label-floating.sc-ion-item-md-h{-ms-flex-align:start;align-items:start}/*!@:host(.item-label-stacked) .input-wrapper,\n:host(.item-label-floating) .input-wrapper*/.item-label-stacked.sc-ion-item-md-h .input-wrapper.sc-ion-item-md,.item-label-floating.sc-ion-item-md-h .input-wrapper.sc-ion-item-md{-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column}/*!@.item-highlight,\n.item-inner-highlight*/.item-highlight.sc-ion-item-md,.item-inner-highlight.sc-ion-item-md{left:0;right:0;bottom:0;position:absolute;background:var(--highlight-background);z-index:1}/*!@.item-highlight*/.item-highlight.sc-ion-item-md{height:var(--full-highlight-height)}/*!@.item-inner-highlight*/.item-inner-highlight.sc-ion-item-md{height:var(--inset-highlight-height)}/*!@:host(.item-interactive.item-has-focus),\n:host(.item-interactive.ion-touched.ion-invalid)*/.item-interactive.item-has-focus.sc-ion-item-md-h,.item-interactive.ion-touched.ion-invalid.sc-ion-item-md-h{--full-highlight-height:calc(var(--highlight-height) * var(--show-full-highlight));--inset-highlight-height:calc(var(--highlight-height) * var(--show-inset-highlight))}/*!@:host(.item-interactive.item-has-focus)*/.item-interactive.item-has-focus.sc-ion-item-md-h{--highlight-background:var(--highlight-color-focused)}/*!@:host(.item-interactive.ion-valid)*/.item-interactive.ion-valid.sc-ion-item-md-h{--highlight-background:var(--highlight-color-valid)}/*!@:host(.item-interactive.ion-invalid)*/.item-interactive.ion-invalid.sc-ion-item-md-h{--highlight-background:var(--highlight-color-invalid)}/*!@:host(:not(.item-label)) ::slotted(ion-select)*/.sc-ion-item-md-h:not(.item-label) .sc-ion-item-md-s>ion-select{--padding-start:0;max-width:none}/*!@:host(.item-label-stacked) ::slotted(ion-select),\n:host(.item-label-floating) ::slotted(ion-select)*/.sc-ion-item-md-h.item-label-stacked .sc-ion-item-md-s>ion-select,.sc-ion-item-md-h.item-label-floating .sc-ion-item-md-s>ion-select{--padding-top:8px;--padding-bottom:8px;--padding-start:0;-ms-flex-item-align:stretch;align-self:stretch;width:100%;max-width:100%}/*!@:host(:not(.item-label)) ::slotted(ion-datetime)*/.sc-ion-item-md-h:not(.item-label) .sc-ion-item-md-s>ion-datetime{--padding-start:0}/*!@:host(.item-label-stacked) ::slotted(ion-datetime),\n:host(.item-label-floating) ::slotted(ion-datetime)*/.sc-ion-item-md-h.item-label-stacked .sc-ion-item-md-s>ion-datetime,.sc-ion-item-md-h.item-label-floating .sc-ion-item-md-s>ion-datetime{--padding-start:0;width:100%}/*!@:host(.item-multiple-inputs) ::slotted(ion-checkbox),\n:host(.item-multiple-inputs) ::slotted(ion-datetime),\n:host(.item-multiple-inputs) ::slotted(ion-radio),\n:host(.item-multiple-inputs) ::slotted(ion-select)*/.sc-ion-item-md-h.item-multiple-inputs .sc-ion-item-md-s>ion-checkbox,.sc-ion-item-md-h.item-multiple-inputs .sc-ion-item-md-s>ion-datetime,.sc-ion-item-md-h.item-multiple-inputs .sc-ion-item-md-s>ion-radio,.sc-ion-item-md-h.item-multiple-inputs .sc-ion-item-md-s>ion-select{position:relative}/*!@:host(.item-textarea)*/.item-textarea.sc-ion-item-md-h{-ms-flex-align:stretch;align-items:stretch}/*!@::slotted(ion-reorder[slot])*/.sc-ion-item-md-s>ion-reorder[slot]{margin-top:0;margin-bottom:0}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-item-md{color:var(--ripple-color)}/*!@:host*/.sc-ion-item-md-h{--min-height:48px;--background:var(--ion-item-background, var(--ion-background-color, #fff));--background-activated:transparent;--background-focused:currentColor;--background-hover:currentColor;--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--color:var(--ion-item-color, var(--ion-text-color, #000));--transition:opacity 15ms linear, background-color 15ms linear;--padding-start:16px;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--inner-padding-end:16px;--inner-border-width:0 0 1px 0;--highlight-height:2px;--highlight-color-focused:var(--ion-color-primary, #3880ff);--highlight-color-valid:var(--ion-color-success, #2dd36f);--highlight-color-invalid:var(--ion-color-danger, #eb445a);font-size:16px;font-weight:normal;text-transform:none}/*!@:host(.ion-color.ion-activated) .item-native::after*/.ion-color.ion-activated.sc-ion-item-md-h .item-native.sc-ion-item-md::after{background:transparent}/*!@:host(.item-interactive)*/.item-interactive.sc-ion-item-md-h{--border-width:0 0 1px 0;--inner-border-width:0;--show-full-highlight:1;--show-inset-highlight:0}/*!@:host(.item-lines-full)*/.item-lines-full.sc-ion-item-md-h{--border-width:0 0 1px 0;--show-full-highlight:1;--show-inset-highlight:0}/*!@:host(.item-lines-inset)*/.item-lines-inset.sc-ion-item-md-h{--inner-border-width:0 0 1px 0;--show-full-highlight:0;--show-inset-highlight:1}/*!@:host(.item-lines-inset),\n:host(.item-lines-none)*/.item-lines-inset.sc-ion-item-md-h,.item-lines-none.sc-ion-item-md-h{--border-width:0;--show-full-highlight:0}/*!@:host(.item-lines-full),\n:host(.item-lines-none)*/.item-lines-full.sc-ion-item-md-h,.item-lines-none.sc-ion-item-md-h{--inner-border-width:0;--show-inset-highlight:0}/*!@:host(.item-multi-line) ::slotted([slot=start]),\n:host(.item-multi-line) ::slotted([slot=end])*/.sc-ion-item-md-h.item-multi-line .sc-ion-item-md-s>[slot=start],.sc-ion-item-md-h.item-multi-line .sc-ion-item-md-s>[slot=end]{margin-top:16px;margin-bottom:16px;-ms-flex-item-align:start;align-self:flex-start}/*!@::slotted([slot=start])*/.sc-ion-item-md-s>[slot=start]{margin-right:32px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-item-md-s>[slot=start]{margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}/*!@::slotted([slot=end])*/.sc-ion-item-md-s>[slot=end]{margin-left:32px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-item-md-s>[slot=end]{margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}/*!@::slotted(ion-icon)*/.sc-ion-item-md-s>ion-icon{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}/*!@:host(.ion-color) ::slotted(ion-icon)*/.sc-ion-item-md-h.ion-color .sc-ion-item-md-s>ion-icon{color:var(--ion-color-contrast)}/*!@::slotted(ion-icon[slot])*/.sc-ion-item-md-s>ion-icon[slot]{margin-top:12px;margin-bottom:12px}/*!@::slotted(ion-icon[slot=start])*/.sc-ion-item-md-s>ion-icon[slot=start]{margin-right:32px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=start])*/.sc-ion-item-md-s>ion-icon[slot=start]{margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}/*!@::slotted(ion-icon[slot=end])*/.sc-ion-item-md-s>ion-icon[slot=end]{margin-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=end])*/.sc-ion-item-md-s>ion-icon[slot=end]{margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}/*!@::slotted(ion-toggle[slot=start]),\n::slotted(ion-toggle[slot=end])*/.sc-ion-item-md-s>ion-toggle[slot=start],.sc-ion-item-md-s>ion-toggle[slot=end]{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}/*!@::slotted(ion-note)*/.sc-ion-item-md-s>ion-note{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-ms-flex-item-align:start;align-self:flex-start;font-size:11px}/*!@::slotted(ion-note[slot])*/.sc-ion-item-md-s>ion-note[slot]{padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}/*!@::slotted(ion-note[slot=start])*/.sc-ion-item-md-s>ion-note[slot=start]{padding-right:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-note[slot=start])*/.sc-ion-item-md-s>ion-note[slot=start]{padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}/*!@::slotted(ion-note[slot=end])*/.sc-ion-item-md-s>ion-note[slot=end]{padding-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-note[slot=end])*/.sc-ion-item-md-s>ion-note[slot=end]{padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}/*!@::slotted(ion-avatar)*/.sc-ion-item-md-s>ion-avatar{width:40px;height:40px}/*!@::slotted(ion-thumbnail)*/.sc-ion-item-md-s>ion-thumbnail{width:56px;height:56px}/*!@::slotted(ion-avatar),\n::slotted(ion-thumbnail)*/.sc-ion-item-md-s>ion-avatar,.sc-ion-item-md-s>ion-thumbnail{margin-top:8px;margin-bottom:8px}/*!@::slotted(ion-avatar[slot=start]),\n::slotted(ion-thumbnail[slot=start])*/.sc-ion-item-md-s>ion-avatar[slot=start],.sc-ion-item-md-s>ion-thumbnail[slot=start]{margin-right:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar[slot=start]),\n::slotted(ion-thumbnail[slot=start])*/.sc-ion-item-md-s>ion-avatar[slot=start],.sc-ion-item-md-s>ion-thumbnail[slot=start]{margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}/*!@::slotted(ion-avatar[slot=end]),\n::slotted(ion-thumbnail[slot=end])*/.sc-ion-item-md-s>ion-avatar[slot=end],.sc-ion-item-md-s>ion-thumbnail[slot=end]{margin-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar[slot=end]),\n::slotted(ion-thumbnail[slot=end])*/.sc-ion-item-md-s>ion-avatar[slot=end],.sc-ion-item-md-s>ion-thumbnail[slot=end]{margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}/*!@::slotted(ion-label)*/.sc-ion-item-md-s>ion-label{margin-left:0;margin-right:0;margin-top:11px;margin-bottom:10px}/*!@:host(.item-label-stacked) ::slotted([slot=end]),\n:host(.item-label-floating) ::slotted([slot=end])*/.sc-ion-item-md-h.item-label-stacked .sc-ion-item-md-s>[slot=end],.sc-ion-item-md-h.item-label-floating .sc-ion-item-md-s>[slot=end]{margin-top:7px;margin-bottom:7px}/*!@:host(.item-label-fixed) ::slotted(ion-select),\n:host(.item-label-fixed) ::slotted(ion-datetime)*/.sc-ion-item-md-h.item-label-fixed .sc-ion-item-md-s>ion-select,.sc-ion-item-md-h.item-label-fixed .sc-ion-item-md-s>ion-datetime{--padding-start:8px}/*!@:host(.item-toggle) ::slotted(ion-label),\n:host(.item-radio) ::slotted(ion-label)*/.sc-ion-item-md-h.item-toggle .sc-ion-item-md-s>ion-label,.sc-ion-item-md-h.item-radio .sc-ion-item-md-s>ion-label{margin-left:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.item-toggle) ::slotted(ion-label),\n:host(.item-radio) ::slotted(ion-label)*/.sc-ion-item-md-h.item-toggle .sc-ion-item-md-s>ion-label,.sc-ion-item-md-h.item-radio .sc-ion-item-md-s>ion-label{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}/*!@::slotted(.button-small)*/.sc-ion-item-md-s>.button-small{--padding-top:0;--padding-bottom:0;--padding-start:.6em;--padding-end:.6em;height:25px;font-size:12px}/*!@:host(.item-label-floating),\n:host(.item-label-stacked)*/.item-label-floating.sc-ion-item-md-h,.item-label-stacked.sc-ion-item-md-h{--min-height:55px}/*!@:host(.item-label-stacked) ::slotted(ion-select),\n:host(.item-label-floating) ::slotted(ion-select)*/.sc-ion-item-md-h.item-label-stacked .sc-ion-item-md-s>ion-select,.sc-ion-item-md-h.item-label-floating .sc-ion-item-md-s>ion-select{--padding-top:8px;--padding-bottom:8px;--padding-start:0}/*!@:host(.item-has-focus:not(.ion-color)) ::slotted(.label-stacked),\n:host(.item-has-focus:not(.ion-color)) ::slotted(.label-floating)*/.sc-ion-item-md-h.item-has-focus:not(.ion-color) .sc-ion-item-md-s>.label-stacked,.sc-ion-item-md-h.item-has-focus:not(.ion-color) .sc-ion-item-md-s>.label-floating{color:var(--ion-color-primary, #3880ff)}/*!@:host(.ion-color)*/.ion-color.sc-ion-item-md-h{--highlight-color-focused:var(--ion-color-contrast)}/*!@:host(.item-label-color)*/.item-label-color.sc-ion-item-md-h{--highlight-color-focused:var(--ion-color-base)}";
|
12732 |
|
12733 |
|
12734 |
|
12735 |
|
12736 |
|
12737 |
|
12738 |
|
12739 |
|
12740 |
|
12741 |
|
12742 |
|
12743 | class Item {
|
12744 | constructor(hostRef) {
|
12745 | registerInstance(this, hostRef);
|
12746 | this.labelColorStyles = {};
|
12747 | this.itemStyles = new Map();
|
12748 | this.multipleInputs = false;
|
12749 | |
12750 |
|
12751 |
|
12752 | this.button = false;
|
12753 | |
12754 |
|
12755 |
|
12756 | this.detailIcon = 'chevron-forward';
|
12757 | |
12758 |
|
12759 |
|
12760 | this.disabled = false;
|
12761 | |
12762 |
|
12763 |
|
12764 |
|
12765 | this.routerDirection = 'forward';
|
12766 | |
12767 |
|
12768 |
|
12769 | this.type = 'button';
|
12770 | }
|
12771 | labelColorChanged(ev) {
|
12772 | const { color } = this;
|
12773 |
|
12774 |
|
12775 |
|
12776 | if (color === undefined) {
|
12777 | this.labelColorStyles = ev.detail;
|
12778 | }
|
12779 | }
|
12780 | itemStyle(ev) {
|
12781 | ev.stopPropagation();
|
12782 | const tagName = ev.target.tagName;
|
12783 | const updatedStyles = ev.detail;
|
12784 | const newStyles = {};
|
12785 | const childStyles = this.itemStyles.get(tagName) || {};
|
12786 | let hasStyleChange = false;
|
12787 | Object.keys(updatedStyles).forEach(key => {
|
12788 | if (updatedStyles[key]) {
|
12789 | const itemKey = `item-${key}`;
|
12790 | if (!childStyles[itemKey]) {
|
12791 | hasStyleChange = true;
|
12792 | }
|
12793 | newStyles[itemKey] = true;
|
12794 | }
|
12795 | });
|
12796 | if (!hasStyleChange && Object.keys(newStyles).length !== Object.keys(childStyles).length) {
|
12797 | hasStyleChange = true;
|
12798 | }
|
12799 | if (hasStyleChange) {
|
12800 | this.itemStyles.set(tagName, newStyles);
|
12801 | forceUpdate$1(this);
|
12802 | }
|
12803 | }
|
12804 | componentDidUpdate() {
|
12805 |
|
12806 |
|
12807 |
|
12808 | const input = this.getFirstInput();
|
12809 | if (input && !this.clickListener) {
|
12810 | this.clickListener = (ev) => this.delegateFocus(ev, input);
|
12811 | this.el.addEventListener('click', this.clickListener);
|
12812 | }
|
12813 | }
|
12814 | disconnectedCallback() {
|
12815 | const input = this.getFirstInput();
|
12816 | if (input && this.clickListener) {
|
12817 | this.el.removeEventListener('click', this.clickListener);
|
12818 | this.clickListener = undefined;
|
12819 | }
|
12820 | }
|
12821 | componentDidLoad() {
|
12822 | raf(() => this.setMultipleInputs());
|
12823 | }
|
12824 |
|
12825 |
|
12826 |
|
12827 | setMultipleInputs() {
|
12828 |
|
12829 | const covers = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
|
12830 |
|
12831 |
|
12832 |
|
12833 | const inputs = this.el.querySelectorAll('ion-input, ion-range, ion-searchbar, ion-segment, ion-textarea, ion-toggle');
|
12834 |
|
12835 | const clickables = this.el.querySelectorAll('ion-anchor, ion-button, a, button');
|
12836 |
|
12837 |
|
12838 | this.multipleInputs = covers.length + inputs.length > 1
|
12839 | || covers.length + clickables.length > 1
|
12840 | || covers.length > 0 && this.isClickable();
|
12841 | }
|
12842 |
|
12843 |
|
12844 |
|
12845 |
|
12846 | hasCover() {
|
12847 | const inputs = this.el.querySelectorAll('ion-checkbox, ion-datetime, ion-select, ion-radio');
|
12848 | return inputs.length === 1 && !this.multipleInputs;
|
12849 | }
|
12850 |
|
12851 |
|
12852 | isClickable() {
|
12853 | return (this.href !== undefined || this.button);
|
12854 | }
|
12855 | canActivate() {
|
12856 | return (this.isClickable() || this.hasCover());
|
12857 | }
|
12858 | getFirstInput() {
|
12859 | const inputs = this.el.querySelectorAll('ion-input, ion-textarea');
|
12860 | return inputs[0];
|
12861 | }
|
12862 |
|
12863 |
|
12864 |
|
12865 |
|
12866 | delegateFocus(ev, input) {
|
12867 | const clickedItem = ev.target.tagName === 'ION-ITEM';
|
12868 | let firstActive = false;
|
12869 |
|
12870 |
|
12871 |
|
12872 | if (document.activeElement) {
|
12873 | firstActive = input.querySelector('input, textarea') === document.activeElement;
|
12874 | }
|
12875 |
|
12876 |
|
12877 | if (clickedItem && firstActive) {
|
12878 | input.fireFocusEvents = false;
|
12879 | input.setBlur();
|
12880 | input.setFocus();
|
12881 | raf(() => {
|
12882 | input.fireFocusEvents = true;
|
12883 | });
|
12884 | }
|
12885 | }
|
12886 | render() {
|
12887 | const { detail, detailIcon, download, labelColorStyles, lines, disabled, href, rel, target, routerAnimation, routerDirection } = this;
|
12888 | const childStyles = {};
|
12889 | const mode = getIonMode$1(this);
|
12890 | const clickable = this.isClickable();
|
12891 | const canActivate = this.canActivate();
|
12892 | const TagType = clickable ? (href === undefined ? 'button' : 'a') : 'div';
|
12893 | const attrs = (TagType === 'button')
|
12894 | ? { type: this.type }
|
12895 | : {
|
12896 | download,
|
12897 | href,
|
12898 | rel,
|
12899 | target
|
12900 | };
|
12901 |
|
12902 |
|
12903 | const clickFn = clickable ? {
|
12904 | onClick: (ev) => { openURL(href, ev, routerDirection, routerAnimation); }
|
12905 | } : {};
|
12906 | const showDetail = detail !== undefined ? detail : mode === 'ios' && clickable;
|
12907 | this.itemStyles.forEach(value => {
|
12908 | Object.assign(childStyles, value);
|
12909 | });
|
12910 | const ariaDisabled = (disabled || childStyles['item-interactive-disabled']) ? 'true' : null;
|
12911 | return (hAsync(Host, { "aria-disabled": ariaDisabled, class: Object.assign(Object.assign(Object.assign({}, childStyles), labelColorStyles), createColorClasses$1(this.color, {
|
12912 | 'item': true,
|
12913 | [mode]: true,
|
12914 | [`item-lines-${lines}`]: lines !== undefined,
|
12915 | 'item-disabled': disabled,
|
12916 | 'in-list': hostContext('ion-list', this.el),
|
12917 | 'item-multiple-inputs': this.multipleInputs,
|
12918 | 'ion-activatable': canActivate,
|
12919 | 'ion-focusable': true,
|
12920 | })) }, hAsync(TagType, Object.assign({}, attrs, { class: "item-native", part: "native", disabled: disabled }, clickFn), hAsync("slot", { name: "start" }), hAsync("div", { class: "item-inner" }, hAsync("div", { class: "input-wrapper" }, hAsync("slot", null)), hAsync("slot", { name: "end" }), showDetail && hAsync("ion-icon", { icon: detailIcon, lazy: false, class: "item-detail-icon", part: "detail-icon", "aria-hidden": "true" }), hAsync("div", { class: "item-inner-highlight" })), canActivate && mode === 'md' && hAsync("ion-ripple-effect", null)), hAsync("div", { class: "item-highlight" })));
|
12921 | }
|
12922 | static get delegatesFocus() { return true; }
|
12923 | get el() { return getElement(this); }
|
12924 | static get style() { return {
|
12925 | ios: itemIosCss,
|
12926 | md: itemMdCss
|
12927 | }; }
|
12928 | static get cmpMeta() { return {
|
12929 | "$flags$": 57,
|
12930 | "$tagName$": "ion-item",
|
12931 | "$members$": {
|
12932 | "color": [513],
|
12933 | "button": [4],
|
12934 | "detail": [4],
|
12935 | "detailIcon": [1, "detail-icon"],
|
12936 | "disabled": [4],
|
12937 | "download": [1],
|
12938 | "href": [1],
|
12939 | "rel": [1],
|
12940 | "lines": [1],
|
12941 | "routerAnimation": [16],
|
12942 | "routerDirection": [1, "router-direction"],
|
12943 | "target": [1],
|
12944 | "type": [1],
|
12945 | "multipleInputs": [32]
|
12946 | },
|
12947 | "$listeners$": [[0, "ionColor", "labelColorChanged"], [0, "ionStyle", "itemStyle"]],
|
12948 | "$lazyBundleId$": "-",
|
12949 | "$attrsToReflect$": [["color", "color"]]
|
12950 | }; }
|
12951 | }
|
12952 |
|
12953 | const itemDividerIosCss = "/*!@:host*/.sc-ion-item-divider-ios-h{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-item-divider-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.ion-color)*/.ion-color.sc-ion-item-divider-ios-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.item-divider-sticky)*/.item-divider-sticky.sc-ion-item-divider-ios-h{position:-webkit-sticky;position:sticky;top:0}/*!@.item-divider-inner*/.item-divider-inner.sc-ion-item-divider-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-divider-inner*/.item-divider-inner.sc-ion-item-divider-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}/*!@.item-divider-wrapper*/.item-divider-wrapper.sc-ion-item-divider-ios{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;text-overflow:ellipsis;overflow:hidden}/*!@:host*/.sc-ion-item-divider-ios-h{--background:var(--ion-color-step-100, #e6e6e6);--color:var(--ion-color-step-850, #262626);--padding-start:20px;--inner-padding-end:10px;border-radius:0;position:relative;min-height:28px;font-size:17px;font-weight:600}/*!@:host([slot=start])*/[slot=start].sc-ion-item-divider-ios-h{margin-left:0;margin-right:20px;margin-top:2px;margin-bottom:2px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host([slot=start])*/[slot=start].sc-ion-item-divider-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:20px;margin-inline-end:20px}}/*!@:host([slot=end])*/[slot=end].sc-ion-item-divider-ios-h{margin-left:10px;margin-right:10px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host([slot=end])*/[slot=end].sc-ion-item-divider-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}/*!@::slotted(ion-icon[slot=start]),\n::slotted(ion-icon[slot=end])*/.sc-ion-item-divider-ios-s>ion-icon[slot=start],.sc-ion-item-divider-ios-s>ion-icon[slot=end]{margin-top:7px;margin-bottom:7px}/*!@::slotted(h1)*/.sc-ion-item-divider-ios-s>h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}/*!@::slotted(h2)*/.sc-ion-item-divider-ios-s>h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}/*!@::slotted(h3),\n::slotted(h4),\n::slotted(h5),\n::slotted(h6)*/.sc-ion-item-divider-ios-s>h3,.sc-ion-item-divider-ios-s>h4,.sc-ion-item-divider-ios-s>h5,.sc-ion-item-divider-ios-s>h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}/*!@::slotted(p)*/.sc-ion-item-divider-ios-s>p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}/*!@::slotted(h2:last-child) ::slotted(h3:last-child),\n::slotted(h4:last-child),\n::slotted(h5:last-child),\n::slotted(h6:last-child),\n::slotted(p:last-child)*/.sc-ion-item-divider-ios-s>h2:last-child -shadowcssslotted(h3:last-child),.sc-ion-item-divider-ios-s>h4:last-child,.sc-ion-item-divider-ios-s>h5:last-child,.sc-ion-item-divider-ios-s>h6:last-child,.sc-ion-item-divider-ios-s>p:last-child{margin-bottom:0}";
|
12954 |
|
12955 | const itemDividerMdCss = "/*!@:host*/.sc-ion-item-divider-md-h{--padding-top:0px;--padding-end:0px;--padding-bottom:0px;--padding-start:0px;--inner-padding-top:0px;--inner-padding-end:0px;--inner-padding-bottom:0px;--inner-padding-start:0px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:100;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-item-divider-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));padding-inline-start:calc(var(--padding-start) + var(--ion-safe-area-left, 0px));-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.ion-color)*/.ion-color.sc-ion-item-divider-md-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@:host(.item-divider-sticky)*/.item-divider-sticky.sc-ion-item-divider-md-h{position:-webkit-sticky;position:sticky;top:0}/*!@.item-divider-inner*/.item-divider-inner.sc-ion-item-divider-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--inner-padding-start);padding-right:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-top:var(--inner-padding-top);padding-bottom:var(--inner-padding-bottom);display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border:0;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-divider-inner*/.item-divider-inner.sc-ion-item-divider-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--inner-padding-start);padding-inline-start:var(--inner-padding-start);-webkit-padding-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end));padding-inline-end:calc(var(--ion-safe-area-right, 0px) + var(--inner-padding-end))}}/*!@.item-divider-wrapper*/.item-divider-wrapper.sc-ion-item-divider-md{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;text-overflow:ellipsis;overflow:hidden}/*!@:host*/.sc-ion-item-divider-md-h{--background:var(--ion-background-color, #fff);--color:var(--ion-color-step-400, #999999);--padding-start:16px;--inner-padding-end:0;min-height:30px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));font-size:14px}/*!@::slotted([slot=start])*/.sc-ion-item-divider-md-s>[slot=start]{margin-right:32px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-item-divider-md-s>[slot=start]{margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}/*!@::slotted([slot=end])*/.sc-ion-item-divider-md-s>[slot=end]{margin-left:32px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-item-divider-md-s>[slot=end]{margin-left:unset;-webkit-margin-start:32px;margin-inline-start:32px}}/*!@::slotted(ion-label)*/.sc-ion-item-divider-md-s>ion-label{margin-left:0;margin-right:0;margin-top:13px;margin-bottom:10px}/*!@::slotted(ion-icon)*/.sc-ion-item-divider-md-s>ion-icon{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54);font-size:24px}/*!@:host(.ion-color) ::slotted(ion-icon)*/.sc-ion-item-divider-md-h.ion-color .sc-ion-item-divider-md-s>ion-icon{color:var(--ion-color-contrast)}/*!@::slotted(ion-icon[slot])*/.sc-ion-item-divider-md-s>ion-icon[slot]{margin-top:12px;margin-bottom:12px}/*!@::slotted(ion-icon[slot=start])*/.sc-ion-item-divider-md-s>ion-icon[slot=start]{margin-right:32px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=start])*/.sc-ion-item-divider-md-s>ion-icon[slot=start]{margin-right:unset;-webkit-margin-end:32px;margin-inline-end:32px}}/*!@::slotted(ion-icon[slot=end])*/.sc-ion-item-divider-md-s>ion-icon[slot=end]{margin-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-icon[slot=end])*/.sc-ion-item-divider-md-s>ion-icon[slot=end]{margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}/*!@::slotted(ion-note)*/.sc-ion-item-divider-md-s>ion-note{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-ms-flex-item-align:start;align-self:flex-start;font-size:11px}/*!@::slotted(ion-note[slot])*/.sc-ion-item-divider-md-s>ion-note[slot]{padding-left:0;padding-right:0;padding-top:18px;padding-bottom:10px}/*!@::slotted(ion-note[slot=start])*/.sc-ion-item-divider-md-s>ion-note[slot=start]{padding-right:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-note[slot=start])*/.sc-ion-item-divider-md-s>ion-note[slot=start]{padding-right:unset;-webkit-padding-end:16px;padding-inline-end:16px}}/*!@::slotted(ion-note[slot=end])*/.sc-ion-item-divider-md-s>ion-note[slot=end]{padding-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-note[slot=end])*/.sc-ion-item-divider-md-s>ion-note[slot=end]{padding-left:unset;-webkit-padding-start:16px;padding-inline-start:16px}}/*!@::slotted(ion-avatar)*/.sc-ion-item-divider-md-s>ion-avatar{width:40px;height:40px}/*!@::slotted(ion-thumbnail)*/.sc-ion-item-divider-md-s>ion-thumbnail{width:56px;height:56px}/*!@::slotted(ion-avatar),\n::slotted(ion-thumbnail)*/.sc-ion-item-divider-md-s>ion-avatar,.sc-ion-item-divider-md-s>ion-thumbnail{margin-top:8px;margin-bottom:8px}/*!@::slotted(ion-avatar[slot=start]),\n::slotted(ion-thumbnail[slot=start])*/.sc-ion-item-divider-md-s>ion-avatar[slot=start],.sc-ion-item-divider-md-s>ion-thumbnail[slot=start]{margin-right:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar[slot=start]),\n::slotted(ion-thumbnail[slot=start])*/.sc-ion-item-divider-md-s>ion-avatar[slot=start],.sc-ion-item-divider-md-s>ion-thumbnail[slot=start]{margin-right:unset;-webkit-margin-end:16px;margin-inline-end:16px}}/*!@::slotted(ion-avatar[slot=end]),\n::slotted(ion-thumbnail[slot=end])*/.sc-ion-item-divider-md-s>ion-avatar[slot=end],.sc-ion-item-divider-md-s>ion-thumbnail[slot=end]{margin-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-avatar[slot=end]),\n::slotted(ion-thumbnail[slot=end])*/.sc-ion-item-divider-md-s>ion-avatar[slot=end],.sc-ion-item-divider-md-s>ion-thumbnail[slot=end]{margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}/*!@::slotted(h1)*/.sc-ion-item-divider-md-s>h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}/*!@::slotted(h2)*/.sc-ion-item-divider-md-s>h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}/*!@::slotted(h3, h4, h5, h6)*/.sc-ion-item-divider-md-s>h3,h4.sc-ion-item-divider-md,h5.sc-ion-item-divider-md,h6.sc-ion-item-divider-md{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}/*!@::slotted(p)*/.sc-ion-item-divider-md-s>p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;color:var(--ion-color-step-600, #666666);font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}";
|
12956 |
|
12957 |
|
12958 |
|
12959 |
|
12960 |
|
12961 |
|
12962 |
|
12963 |
|
12964 | class ItemDivider {
|
12965 | constructor(hostRef) {
|
12966 | registerInstance(this, hostRef);
|
12967 | |
12968 |
|
12969 |
|
12970 |
|
12971 |
|
12972 |
|
12973 |
|
12974 | this.sticky = false;
|
12975 | }
|
12976 | render() {
|
12977 | const mode = getIonMode$1(this);
|
12978 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
12979 | [mode]: true,
|
12980 | 'item-divider-sticky': this.sticky,
|
12981 | 'item': true,
|
12982 | }) }, hAsync("slot", { name: "start" }), hAsync("div", { class: "item-divider-inner" }, hAsync("div", { class: "item-divider-wrapper" }, hAsync("slot", null)), hAsync("slot", { name: "end" }))));
|
12983 | }
|
12984 | get el() { return getElement(this); }
|
12985 | static get style() { return {
|
12986 | ios: itemDividerIosCss,
|
12987 | md: itemDividerMdCss
|
12988 | }; }
|
12989 | static get cmpMeta() { return {
|
12990 | "$flags$": 41,
|
12991 | "$tagName$": "ion-item-divider",
|
12992 | "$members$": {
|
12993 | "color": [513],
|
12994 | "sticky": [4]
|
12995 | },
|
12996 | "$listeners$": undefined,
|
12997 | "$lazyBundleId$": "-",
|
12998 | "$attrsToReflect$": [["color", "color"]]
|
12999 | }; }
|
13000 | }
|
13001 |
|
13002 | const itemGroupIosCss = "ion-item-group{display:block}";
|
13003 |
|
13004 | const itemGroupMdCss = "ion-item-group{display:block}";
|
13005 |
|
13006 | class ItemGroup {
|
13007 | constructor(hostRef) {
|
13008 | registerInstance(this, hostRef);
|
13009 | }
|
13010 | render() {
|
13011 | const mode = getIonMode$1(this);
|
13012 | return (hAsync(Host, { role: "group", class: {
|
13013 | [mode]: true,
|
13014 |
|
13015 | [`item-group-${mode}`]: true,
|
13016 | 'item': true
|
13017 | } }));
|
13018 | }
|
13019 | static get style() { return {
|
13020 | ios: itemGroupIosCss,
|
13021 | md: itemGroupMdCss
|
13022 | }; }
|
13023 | static get cmpMeta() { return {
|
13024 | "$flags$": 32,
|
13025 | "$tagName$": "ion-item-group",
|
13026 | "$members$": undefined,
|
13027 | "$listeners$": undefined,
|
13028 | "$lazyBundleId$": "-",
|
13029 | "$attrsToReflect$": []
|
13030 | }; }
|
13031 | }
|
13032 |
|
13033 | const itemOptionIosCss = "/*!@:host*/.sc-ion-item-option-ios-h{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit)}/*!@:host(.in-list.item-options-end:last-child)*/.in-list.item-options-end.sc-ion-item-option-ios-h:last-child{padding-right:calc(.7em + var(--ion-safe-area-right))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-list.item-options-end:last-child)*/.in-list.item-options-end.sc-ion-item-option-ios-h:last-child{padding-right:unset;-webkit-padding-end:calc(.7em + var(--ion-safe-area-right));padding-inline-end:calc(.7em + var(--ion-safe-area-right))}}/*!@:host(.in-list.item-options-start:first-child)*/.in-list.item-options-start.sc-ion-item-option-ios-h:first-child{padding-left:calc(.7em + var(--ion-safe-area-left))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-list.item-options-start:first-child)*/.in-list.item-options-start.sc-ion-item-option-ios-h:first-child{padding-left:unset;-webkit-padding-start:calc(.7em + var(--ion-safe-area-left));padding-inline-start:calc(.7em + var(--ion-safe-area-left))}}/*!@:host(.ion-color)*/.ion-color.sc-ion-item-option-ios-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@.button-native*/.button-native.sc-ion-item-option-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0.7em;padding-right:0.7em;padding-top:0;padding-bottom:0;display:inline-block;position:relative;width:100%;height:100%;border:0;outline:none;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-item-option-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:0.7em;padding-inline-start:0.7em;-webkit-padding-end:0.7em;padding-inline-end:0.7em}}/*!@.button-inner*/.button-inner.sc-ion-item-option-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:column nowrap;flex-flow:column nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}/*!@.horizontal-wrapper*/.horizontal-wrapper.sc-ion-item-option-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%}/*!@::slotted(*)*/.sc-ion-item-option-ios-s>*{-ms-flex-negative:0;flex-shrink:0}/*!@::slotted([slot=start])*/.sc-ion-item-option-ios-s>[slot=start]{margin-left:0;margin-right:5px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-item-option-ios-s>[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:5px;margin-inline-end:5px}}/*!@::slotted([slot=end])*/.sc-ion-item-option-ios-s>[slot=end]{margin-left:5px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-item-option-ios-s>[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:0;margin-inline-end:0}}/*!@::slotted([slot=icon-only])*/.sc-ion-item-option-ios-s>[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:10px;margin-right:10px;margin-top:0;margin-bottom:0;min-width:0.9em;font-size:1.8em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=icon-only])*/.sc-ion-item-option-ios-s>[slot=icon-only]{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}/*!@:host(.item-option-expandable)*/.item-option-expandable.sc-ion-item-option-ios-h{-ms-flex-negative:0;flex-shrink:0;-webkit-transition-duration:0;transition-duration:0;-webkit-transition-property:none;transition-property:none;-webkit-transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1);transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1)}/*!@:host(.item-option-disabled)*/.item-option-disabled.sc-ion-item-option-ios-h{pointer-events:none}/*!@:host(.item-option-disabled) .button-native*/.item-option-disabled.sc-ion-item-option-ios-h .button-native.sc-ion-item-option-ios{cursor:default;opacity:0.5;pointer-events:none}/*!@:host*/.sc-ion-item-option-ios-h{font-size:16px}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-item-option-ios-h{background:var(--ion-color-primary-shade, #3171e0)}/*!@:host(.ion-color.ion-activated)*/.ion-color.ion-activated.sc-ion-item-option-ios-h{background:var(--ion-color-shade)}";
|
13034 |
|
13035 | const itemOptionMdCss = "/*!@:host*/.sc-ion-item-option-md-h{--background:var(--ion-color-primary, #3880ff);--color:var(--ion-color-primary-contrast, #fff);background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit)}/*!@:host(.in-list.item-options-end:last-child)*/.in-list.item-options-end.sc-ion-item-option-md-h:last-child{padding-right:calc(.7em + var(--ion-safe-area-right))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-list.item-options-end:last-child)*/.in-list.item-options-end.sc-ion-item-option-md-h:last-child{padding-right:unset;-webkit-padding-end:calc(.7em + var(--ion-safe-area-right));padding-inline-end:calc(.7em + var(--ion-safe-area-right))}}/*!@:host(.in-list.item-options-start:first-child)*/.in-list.item-options-start.sc-ion-item-option-md-h:first-child{padding-left:calc(.7em + var(--ion-safe-area-left))}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-list.item-options-start:first-child)*/.in-list.item-options-start.sc-ion-item-option-md-h:first-child{padding-left:unset;-webkit-padding-start:calc(.7em + var(--ion-safe-area-left));padding-inline-start:calc(.7em + var(--ion-safe-area-left))}}/*!@:host(.ion-color)*/.ion-color.sc-ion-item-option-md-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@.button-native*/.button-native.sc-ion-item-option-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;padding-left:0.7em;padding-right:0.7em;padding-top:0;padding-bottom:0;display:inline-block;position:relative;width:100%;height:100%;border:0;outline:none;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-item-option-md{padding-left:unset;padding-right:unset;-webkit-padding-start:0.7em;padding-inline-start:0.7em;-webkit-padding-end:0.7em;padding-inline-end:0.7em}}/*!@.button-inner*/.button-inner.sc-ion-item-option-md{display:-ms-flexbox;display:flex;-ms-flex-flow:column nowrap;flex-flow:column nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}/*!@.horizontal-wrapper*/.horizontal-wrapper.sc-ion-item-option-md{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%}/*!@::slotted(*)*/.sc-ion-item-option-md-s>*{-ms-flex-negative:0;flex-shrink:0}/*!@::slotted([slot=start])*/.sc-ion-item-option-md-s>[slot=start]{margin-left:0;margin-right:5px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-item-option-md-s>[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:5px;margin-inline-end:5px}}/*!@::slotted([slot=end])*/.sc-ion-item-option-md-s>[slot=end]{margin-left:5px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-item-option-md-s>[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:5px;margin-inline-start:5px;-webkit-margin-end:0;margin-inline-end:0}}/*!@::slotted([slot=icon-only])*/.sc-ion-item-option-md-s>[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:10px;margin-right:10px;margin-top:0;margin-bottom:0;min-width:0.9em;font-size:1.8em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=icon-only])*/.sc-ion-item-option-md-s>[slot=icon-only]{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:10px;margin-inline-end:10px}}/*!@:host(.item-option-expandable)*/.item-option-expandable.sc-ion-item-option-md-h{-ms-flex-negative:0;flex-shrink:0;-webkit-transition-duration:0;transition-duration:0;-webkit-transition-property:none;transition-property:none;-webkit-transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1);transition-timing-function:cubic-bezier(0.65, 0.05, 0.36, 1)}/*!@:host(.item-option-disabled)*/.item-option-disabled.sc-ion-item-option-md-h{pointer-events:none}/*!@:host(.item-option-disabled) .button-native*/.item-option-disabled.sc-ion-item-option-md-h .button-native.sc-ion-item-option-md{cursor:default;opacity:0.5;pointer-events:none}/*!@:host*/.sc-ion-item-option-md-h{font-size:14px;font-weight:500;text-transform:uppercase}";
|
13036 |
|
13037 |
|
13038 |
|
13039 |
|
13040 |
|
13041 |
|
13042 |
|
13043 |
|
13044 |
|
13045 |
|
13046 |
|
13047 |
|
13048 |
|
13049 | class ItemOption {
|
13050 | constructor(hostRef) {
|
13051 | registerInstance(this, hostRef);
|
13052 | |
13053 |
|
13054 |
|
13055 | this.disabled = false;
|
13056 | |
13057 |
|
13058 |
|
13059 | this.expandable = false;
|
13060 | |
13061 |
|
13062 |
|
13063 | this.type = 'button';
|
13064 | this.onClick = (ev) => {
|
13065 | const el = ev.target.closest('ion-item-option');
|
13066 | if (el) {
|
13067 | ev.preventDefault();
|
13068 | }
|
13069 | };
|
13070 | }
|
13071 | render() {
|
13072 | const { disabled, expandable, href } = this;
|
13073 | const TagType = href === undefined ? 'button' : 'a';
|
13074 | const mode = getIonMode$1(this);
|
13075 | const attrs = (TagType === 'button')
|
13076 | ? { type: this.type }
|
13077 | : {
|
13078 | download: this.download,
|
13079 | href: this.href,
|
13080 | target: this.target
|
13081 | };
|
13082 | return (hAsync(Host, { onClick: this.onClick, class: createColorClasses$1(this.color, {
|
13083 | [mode]: true,
|
13084 | 'item-option-disabled': disabled,
|
13085 | 'item-option-expandable': expandable,
|
13086 | 'ion-activatable': true
|
13087 | }) }, hAsync(TagType, Object.assign({}, attrs, { class: "button-native", part: "native", disabled: disabled }), hAsync("span", { class: "button-inner" }, hAsync("slot", { name: "top" }), hAsync("div", { class: "horizontal-wrapper" }, hAsync("slot", { name: "start" }), hAsync("slot", { name: "icon-only" }), hAsync("slot", null), hAsync("slot", { name: "end" })), hAsync("slot", { name: "bottom" })), mode === 'md' && hAsync("ion-ripple-effect", null))));
|
13088 | }
|
13089 | get el() { return getElement(this); }
|
13090 | static get style() { return {
|
13091 | ios: itemOptionIosCss,
|
13092 | md: itemOptionMdCss
|
13093 | }; }
|
13094 | static get cmpMeta() { return {
|
13095 | "$flags$": 41,
|
13096 | "$tagName$": "ion-item-option",
|
13097 | "$members$": {
|
13098 | "color": [513],
|
13099 | "disabled": [4],
|
13100 | "download": [1],
|
13101 | "expandable": [4],
|
13102 | "href": [1],
|
13103 | "rel": [1],
|
13104 | "target": [1],
|
13105 | "type": [1]
|
13106 | },
|
13107 | "$listeners$": undefined,
|
13108 | "$lazyBundleId$": "-",
|
13109 | "$attrsToReflect$": [["color", "color"]]
|
13110 | }; }
|
13111 | }
|
13112 |
|
13113 | const itemOptionsIosCss = "ion-item-options{top:0;right:0;-ms-flex-pack:end;justify-content:flex-end;display:none;position:absolute;height:100%;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}[dir=rtl] ion-item-options,:host-context([dir=rtl]) ion-item-options{-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] ion-item-options:not(.item-options-end),:host-context([dir=rtl]) ion-item-options:not(.item-options-end){right:auto;left:0;-ms-flex-pack:end;justify-content:flex-end}.item-options-start{right:auto;left:0;-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] .item-options-start,:host-context([dir=rtl]) .item-options-start{-ms-flex-pack:end;justify-content:flex-end}.item-options-start ion-item-option:first-child{padding-right:var(--ion-safe-area-left)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-start ion-item-option:first-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-left);padding-inline-end:var(--ion-safe-area-left)}}.item-options-end ion-item-option:last-child{padding-right:var(--ion-safe-area-right)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-end ion-item-option:last-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}[dir=rtl] .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end),:host-context([dir=rtl]) .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end){width:100%;visibility:visible}.item-sliding-active-slide ion-item-options{display:-ms-flexbox;display:flex;visibility:hidden}.item-sliding-active-slide.item-sliding-active-options-start .item-options-start,.item-sliding-active-slide.item-sliding-active-options-end ion-item-options:not(.item-options-start){width:100%;visibility:visible}.item-options-ios{border-bottom-width:0;border-bottom-style:solid;border-bottom-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)))}.item-options-ios.item-options-end{border-bottom-width:0.55px}.list-ios-lines-none .item-options-ios{border-bottom-width:0}.list-ios-lines-full .item-options-ios,.list-ios-lines-inset .item-options-ios.item-options-end{border-bottom-width:0.55px}";
|
13114 |
|
13115 | const itemOptionsMdCss = "ion-item-options{top:0;right:0;-ms-flex-pack:end;justify-content:flex-end;display:none;position:absolute;height:100%;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1}[dir=rtl] ion-item-options,:host-context([dir=rtl]) ion-item-options{-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] ion-item-options:not(.item-options-end),:host-context([dir=rtl]) ion-item-options:not(.item-options-end){right:auto;left:0;-ms-flex-pack:end;justify-content:flex-end}.item-options-start{right:auto;left:0;-ms-flex-pack:start;justify-content:flex-start}[dir=rtl] .item-options-start,:host-context([dir=rtl]) .item-options-start{-ms-flex-pack:end;justify-content:flex-end}.item-options-start ion-item-option:first-child{padding-right:var(--ion-safe-area-left)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-start ion-item-option:first-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-left);padding-inline-end:var(--ion-safe-area-left)}}.item-options-end ion-item-option:last-child{padding-right:var(--ion-safe-area-right)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.item-options-end ion-item-option:last-child{padding-right:unset;-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}[dir=rtl] .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end),:host-context([dir=rtl]) .item-sliding-active-slide.item-sliding-active-options-start ion-item-options:not(.item-options-end){width:100%;visibility:visible}.item-sliding-active-slide ion-item-options{display:-ms-flexbox;display:flex;visibility:hidden}.item-sliding-active-slide.item-sliding-active-options-start .item-options-start,.item-sliding-active-slide.item-sliding-active-options-end ion-item-options:not(.item-options-start){width:100%;visibility:visible}.item-options-md{border-bottom-width:0;border-bottom-style:solid;border-bottom-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))))}.list-md-lines-none .item-options-md{border-bottom-width:0}.list-md-lines-full .item-options-md,.list-md-lines-inset .item-options-md.item-options-end{border-bottom-width:1px}";
|
13116 |
|
13117 | class ItemOptions {
|
13118 | constructor(hostRef) {
|
13119 | registerInstance(this, hostRef);
|
13120 | this.ionSwipe = createEvent(this, "ionSwipe", 7);
|
13121 | |
13122 |
|
13123 |
|
13124 |
|
13125 | this.side = 'end';
|
13126 | }
|
13127 |
|
13128 | async fireSwipeEvent() {
|
13129 | this.ionSwipe.emit({
|
13130 | side: this.side
|
13131 | });
|
13132 | }
|
13133 | render() {
|
13134 | const mode = getIonMode$1(this);
|
13135 | const isEnd = isEndSide(this.side);
|
13136 | return (hAsync(Host, { class: {
|
13137 | [mode]: true,
|
13138 |
|
13139 | [`item-options-${mode}`]: true,
|
13140 | 'item-options-start': !isEnd,
|
13141 | 'item-options-end': isEnd
|
13142 | } }));
|
13143 | }
|
13144 | get el() { return getElement(this); }
|
13145 | static get style() { return {
|
13146 | ios: itemOptionsIosCss,
|
13147 | md: itemOptionsMdCss
|
13148 | }; }
|
13149 | static get cmpMeta() { return {
|
13150 | "$flags$": 32,
|
13151 | "$tagName$": "ion-item-options",
|
13152 | "$members$": {
|
13153 | "side": [1],
|
13154 | "fireSwipeEvent": [64]
|
13155 | },
|
13156 | "$listeners$": undefined,
|
13157 | "$lazyBundleId$": "-",
|
13158 | "$attrsToReflect$": []
|
13159 | }; }
|
13160 | }
|
13161 |
|
13162 | const itemSlidingCss = "ion-item-sliding{display:block;position:relative;width:100%;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-item-sliding .item{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.item-sliding-active-slide .item{position:relative;-webkit-transition:-webkit-transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);transition:-webkit-transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);transition:transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);transition:transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1), -webkit-transform 500ms cubic-bezier(0.36, 0.66, 0.04, 1);opacity:1;z-index:2;pointer-events:none;will-change:transform}.item-sliding-active-swipe-end .item-options-end .item-option-expandable{padding-left:100%;-ms-flex-order:1;order:1;-webkit-transition-duration:0.6s;transition-duration:0.6s;-webkit-transition-property:padding-left;transition-property:padding-left}[dir=rtl] .item-sliding-active-swipe-end .item-options-end .item-option-expandable,:host-context([dir=rtl]) .item-sliding-active-swipe-end .item-options-end .item-option-expandable{-ms-flex-order:-1;order:-1}.item-sliding-active-swipe-start .item-options-start .item-option-expandable{padding-right:100%;-ms-flex-order:-1;order:-1;-webkit-transition-duration:0.6s;transition-duration:0.6s;-webkit-transition-property:padding-right;transition-property:padding-right}[dir=rtl] .item-sliding-active-swipe-start .item-options-start .item-option-expandable,:host-context([dir=rtl]) .item-sliding-active-swipe-start .item-options-start .item-option-expandable{-ms-flex-order:1;order:1}";
|
13163 |
|
13164 | const SWIPE_MARGIN = 30;
|
13165 | const ELASTIC_FACTOR = 0.55;
|
13166 | let openSlidingItem;
|
13167 | class ItemSliding {
|
13168 | constructor(hostRef) {
|
13169 | registerInstance(this, hostRef);
|
13170 | this.ionDrag = createEvent(this, "ionDrag", 7);
|
13171 | this.item = null;
|
13172 | this.openAmount = 0;
|
13173 | this.initialOpenAmount = 0;
|
13174 | this.optsWidthRightSide = 0;
|
13175 | this.optsWidthLeftSide = 0;
|
13176 | this.sides = 0 ;
|
13177 | this.optsDirty = true;
|
13178 | this.closestContent = null;
|
13179 | this.initialContentScrollY = true;
|
13180 | this.state = 2 ;
|
13181 | |
13182 |
|
13183 |
|
13184 | this.disabled = false;
|
13185 | }
|
13186 | disabledChanged() {
|
13187 | if (this.gesture) {
|
13188 | this.gesture.enable(!this.disabled);
|
13189 | }
|
13190 | }
|
13191 | async connectedCallback() {
|
13192 | this.item = this.el.querySelector('ion-item');
|
13193 | this.closestContent = this.el.closest('ion-content');
|
13194 | await this.updateOptions();
|
13195 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
13196 | el: this.el,
|
13197 | gestureName: 'item-swipe',
|
13198 | gesturePriority: 100,
|
13199 | threshold: 5,
|
13200 | canStart: ev => this.canStart(ev),
|
13201 | onStart: () => this.onStart(),
|
13202 | onMove: ev => this.onMove(ev),
|
13203 | onEnd: ev => this.onEnd(ev),
|
13204 | });
|
13205 | this.disabledChanged();
|
13206 | }
|
13207 | disconnectedCallback() {
|
13208 | if (this.gesture) {
|
13209 | this.gesture.destroy();
|
13210 | this.gesture = undefined;
|
13211 | }
|
13212 | this.item = null;
|
13213 | this.leftOptions = this.rightOptions = undefined;
|
13214 | if (openSlidingItem === this.el) {
|
13215 | openSlidingItem = undefined;
|
13216 | }
|
13217 | }
|
13218 | |
13219 |
|
13220 |
|
13221 | getOpenAmount() {
|
13222 | return Promise.resolve(this.openAmount);
|
13223 | }
|
13224 | |
13225 |
|
13226 |
|
13227 |
|
13228 |
|
13229 |
|
13230 |
|
13231 | getSlidingRatio() {
|
13232 | return Promise.resolve(this.getSlidingRatioSync());
|
13233 | }
|
13234 | |
13235 |
|
13236 |
|
13237 |
|
13238 |
|
13239 | async open(side) {
|
13240 | if (this.item === null) {
|
13241 | return;
|
13242 | }
|
13243 | const optionsToOpen = this.getOptions(side);
|
13244 | if (!optionsToOpen) {
|
13245 | return;
|
13246 | }
|
13247 | |
13248 |
|
13249 |
|
13250 |
|
13251 | if (side === undefined) {
|
13252 | side = (optionsToOpen === this.leftOptions) ? 'start' : 'end';
|
13253 | }
|
13254 |
|
13255 | side = isEndSide(side) ? 'end' : 'start';
|
13256 | const isStartOpen = this.openAmount < 0;
|
13257 | const isEndOpen = this.openAmount > 0;
|
13258 | |
13259 |
|
13260 |
|
13261 |
|
13262 | if (isStartOpen && optionsToOpen === this.leftOptions) {
|
13263 | return;
|
13264 | }
|
13265 | if (isEndOpen && optionsToOpen === this.rightOptions) {
|
13266 | return;
|
13267 | }
|
13268 | this.closeOpened();
|
13269 | this.state = 4 ;
|
13270 | requestAnimationFrame(() => {
|
13271 | this.calculateOptsWidth();
|
13272 | const width = (side === 'end') ? this.optsWidthRightSide : -this.optsWidthLeftSide;
|
13273 | openSlidingItem = this.el;
|
13274 | this.setOpenAmount(width, false);
|
13275 | this.state = (side === 'end') ? 8 : 16 ;
|
13276 | });
|
13277 | }
|
13278 | |
13279 |
|
13280 |
|
13281 | async close() {
|
13282 | this.setOpenAmount(0, true);
|
13283 | }
|
13284 | |
13285 |
|
13286 |
|
13287 | async closeOpened() {
|
13288 | if (openSlidingItem !== undefined) {
|
13289 | openSlidingItem.close();
|
13290 | openSlidingItem = undefined;
|
13291 | return true;
|
13292 | }
|
13293 | return false;
|
13294 | }
|
13295 | |
13296 |
|
13297 |
|
13298 |
|
13299 |
|
13300 |
|
13301 | getOptions(side) {
|
13302 | if (side === undefined) {
|
13303 | return this.leftOptions || this.rightOptions;
|
13304 | }
|
13305 | else if (side === 'start') {
|
13306 | return this.leftOptions;
|
13307 | }
|
13308 | else {
|
13309 | return this.rightOptions;
|
13310 | }
|
13311 | }
|
13312 | async updateOptions() {
|
13313 | const options = this.el.querySelectorAll('ion-item-options');
|
13314 | let sides = 0;
|
13315 |
|
13316 | this.leftOptions = this.rightOptions = undefined;
|
13317 | for (let i = 0; i < options.length; i++) {
|
13318 | const item = options.item(i);
|
13319 | |
13320 |
|
13321 |
|
13322 |
|
13323 |
|
13324 | const option = (item.componentOnReady !== undefined) ? await item.componentOnReady() : item;
|
13325 | const side = isEndSide(option.side) ? 'end' : 'start';
|
13326 | if (side === 'start') {
|
13327 | this.leftOptions = option;
|
13328 | sides |= 1 ;
|
13329 | }
|
13330 | else {
|
13331 | this.rightOptions = option;
|
13332 | sides |= 2 ;
|
13333 | }
|
13334 | }
|
13335 | this.optsDirty = true;
|
13336 | this.sides = sides;
|
13337 | }
|
13338 | canStart(gesture) {
|
13339 | |
13340 |
|
13341 |
|
13342 |
|
13343 |
|
13344 | const rtl = document.dir === 'rtl';
|
13345 | const atEdge = (rtl) ? (window.innerWidth - gesture.startX) < 15 : gesture.startX < 15;
|
13346 | if (atEdge) {
|
13347 | return false;
|
13348 | }
|
13349 | const selected = openSlidingItem;
|
13350 | if (selected && selected !== this.el) {
|
13351 | this.closeOpened();
|
13352 | }
|
13353 | return !!(this.rightOptions || this.leftOptions);
|
13354 | }
|
13355 | disableContentScrollY() {
|
13356 | if (this.closestContent === null) {
|
13357 | return;
|
13358 | }
|
13359 | this.initialContentScrollY = this.closestContent.scrollY;
|
13360 | this.closestContent.scrollY = false;
|
13361 | }
|
13362 | restoreContentScrollY() {
|
13363 | if (this.closestContent === null) {
|
13364 | return;
|
13365 | }
|
13366 | this.closestContent.scrollY = this.initialContentScrollY;
|
13367 | }
|
13368 | onStart() {
|
13369 |
|
13370 | this.disableContentScrollY();
|
13371 | openSlidingItem = this.el;
|
13372 | if (this.tmr !== undefined) {
|
13373 | clearTimeout(this.tmr);
|
13374 | this.tmr = undefined;
|
13375 | }
|
13376 | if (this.openAmount === 0) {
|
13377 | this.optsDirty = true;
|
13378 | this.state = 4 ;
|
13379 | }
|
13380 | this.initialOpenAmount = this.openAmount;
|
13381 | if (this.item) {
|
13382 | this.item.style.transition = 'none';
|
13383 | }
|
13384 | }
|
13385 | onMove(gesture) {
|
13386 | if (this.optsDirty) {
|
13387 | this.calculateOptsWidth();
|
13388 | }
|
13389 | let openAmount = this.initialOpenAmount - gesture.deltaX;
|
13390 | switch (this.sides) {
|
13391 | case 2 :
|
13392 | openAmount = Math.max(0, openAmount);
|
13393 | break;
|
13394 | case 1 :
|
13395 | openAmount = Math.min(0, openAmount);
|
13396 | break;
|
13397 | case 3 : break;
|
13398 | case 0 : return;
|
13399 | default:
|
13400 | console.warn('invalid ItemSideFlags value', this.sides);
|
13401 | break;
|
13402 | }
|
13403 | let optsWidth;
|
13404 | if (openAmount > this.optsWidthRightSide) {
|
13405 | optsWidth = this.optsWidthRightSide;
|
13406 | openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
13407 | }
|
13408 | else if (openAmount < -this.optsWidthLeftSide) {
|
13409 | optsWidth = -this.optsWidthLeftSide;
|
13410 | openAmount = optsWidth + (openAmount - optsWidth) * ELASTIC_FACTOR;
|
13411 | }
|
13412 | this.setOpenAmount(openAmount, false);
|
13413 | }
|
13414 | onEnd(gesture) {
|
13415 |
|
13416 | this.restoreContentScrollY();
|
13417 | const velocity = gesture.velocityX;
|
13418 | let restingPoint = (this.openAmount > 0)
|
13419 | ? this.optsWidthRightSide
|
13420 | : -this.optsWidthLeftSide;
|
13421 |
|
13422 |
|
13423 | const isResetDirection = (this.openAmount > 0) === !(velocity < 0);
|
13424 | const isMovingFast = Math.abs(velocity) > 0.3;
|
13425 | const isOnCloseZone = Math.abs(this.openAmount) < Math.abs(restingPoint / 2);
|
13426 | if (swipeShouldReset(isResetDirection, isMovingFast, isOnCloseZone)) {
|
13427 | restingPoint = 0;
|
13428 | }
|
13429 | const state = this.state;
|
13430 | this.setOpenAmount(restingPoint, true);
|
13431 | if ((state & 32 ) !== 0 && this.rightOptions) {
|
13432 | this.rightOptions.fireSwipeEvent();
|
13433 | }
|
13434 | else if ((state & 64 ) !== 0 && this.leftOptions) {
|
13435 | this.leftOptions.fireSwipeEvent();
|
13436 | }
|
13437 | }
|
13438 | calculateOptsWidth() {
|
13439 | this.optsWidthRightSide = 0;
|
13440 | if (this.rightOptions) {
|
13441 | this.rightOptions.style.display = 'flex';
|
13442 | this.optsWidthRightSide = this.rightOptions.offsetWidth;
|
13443 | this.rightOptions.style.display = '';
|
13444 | }
|
13445 | this.optsWidthLeftSide = 0;
|
13446 | if (this.leftOptions) {
|
13447 | this.leftOptions.style.display = 'flex';
|
13448 | this.optsWidthLeftSide = this.leftOptions.offsetWidth;
|
13449 | this.leftOptions.style.display = '';
|
13450 | }
|
13451 | this.optsDirty = false;
|
13452 | }
|
13453 | setOpenAmount(openAmount, isFinal) {
|
13454 | if (this.tmr !== undefined) {
|
13455 | clearTimeout(this.tmr);
|
13456 | this.tmr = undefined;
|
13457 | }
|
13458 | if (!this.item) {
|
13459 | return;
|
13460 | }
|
13461 | const style = this.item.style;
|
13462 | this.openAmount = openAmount;
|
13463 | if (isFinal) {
|
13464 | style.transition = '';
|
13465 | }
|
13466 | if (openAmount > 0) {
|
13467 | this.state = (openAmount >= (this.optsWidthRightSide + SWIPE_MARGIN))
|
13468 | ? 8 | 32
|
13469 | : 8 ;
|
13470 | }
|
13471 | else if (openAmount < 0) {
|
13472 | this.state = (openAmount <= (-this.optsWidthLeftSide - SWIPE_MARGIN))
|
13473 | ? 16 | 64
|
13474 | : 16 ;
|
13475 | }
|
13476 | else {
|
13477 | this.tmr = setTimeout(() => {
|
13478 | this.state = 2 ;
|
13479 | this.tmr = undefined;
|
13480 | }, 600);
|
13481 | openSlidingItem = undefined;
|
13482 | style.transform = '';
|
13483 | return;
|
13484 | }
|
13485 | style.transform = `translate3d(${-openAmount}px,0,0)`;
|
13486 | this.ionDrag.emit({
|
13487 | amount: openAmount,
|
13488 | ratio: this.getSlidingRatioSync()
|
13489 | });
|
13490 | }
|
13491 | getSlidingRatioSync() {
|
13492 | if (this.openAmount > 0) {
|
13493 | return this.openAmount / this.optsWidthRightSide;
|
13494 | }
|
13495 | else if (this.openAmount < 0) {
|
13496 | return this.openAmount / this.optsWidthLeftSide;
|
13497 | }
|
13498 | else {
|
13499 | return 0;
|
13500 | }
|
13501 | }
|
13502 | render() {
|
13503 | const mode = getIonMode$1(this);
|
13504 | return (hAsync(Host, { class: {
|
13505 | [mode]: true,
|
13506 | 'item-sliding-active-slide': (this.state !== 2 ),
|
13507 | 'item-sliding-active-options-end': (this.state & 8 ) !== 0,
|
13508 | 'item-sliding-active-options-start': (this.state & 16 ) !== 0,
|
13509 | 'item-sliding-active-swipe-end': (this.state & 32 ) !== 0,
|
13510 | 'item-sliding-active-swipe-start': (this.state & 64 ) !== 0
|
13511 | } }));
|
13512 | }
|
13513 | get el() { return getElement(this); }
|
13514 | static get watchers() { return {
|
13515 | "disabled": ["disabledChanged"]
|
13516 | }; }
|
13517 | static get style() { return itemSlidingCss; }
|
13518 | static get cmpMeta() { return {
|
13519 | "$flags$": 0,
|
13520 | "$tagName$": "ion-item-sliding",
|
13521 | "$members$": {
|
13522 | "disabled": [4],
|
13523 | "state": [32],
|
13524 | "getOpenAmount": [64],
|
13525 | "getSlidingRatio": [64],
|
13526 | "open": [64],
|
13527 | "close": [64],
|
13528 | "closeOpened": [64]
|
13529 | },
|
13530 | "$listeners$": undefined,
|
13531 | "$lazyBundleId$": "-",
|
13532 | "$attrsToReflect$": []
|
13533 | }; }
|
13534 | }
|
13535 | const swipeShouldReset = (isResetDirection, isMovingFast, isOnResetZone) => {
|
13536 |
|
13537 |
|
13538 |
|
13539 |
|
13540 |
|
13541 |
|
13542 |
|
13543 |
|
13544 |
|
13545 |
|
13546 |
|
13547 |
|
13548 |
|
13549 |
|
13550 | return (!isMovingFast && isOnResetZone) || (isResetDirection && isMovingFast);
|
13551 | };
|
13552 |
|
13553 | const labelIosCss = ".item.sc-ion-label-ios-h,.item .sc-ion-label-ios-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-label-ios-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{white-space:normal}.item-interactive-disabled.sc-ion-label-ios-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-ios-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-ios-h,.item-input .sc-ion-label-ios-h{-ms-flex:initial;flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-ios-h,.item-textarea .sc-ion-label-ios-h{-ms-flex-item-align:baseline;align-self:baseline}.label-fixed.sc-ion-label-ios-h{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-ios-h,.label-floating.sc-ion-label-ios-h{margin-bottom:0;-ms-flex-item-align:stretch;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-ios-h{-webkit-transition:none;transition:none}.sc-ion-label-ios-s h1,.sc-ion-label-ios-s h2,.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-ios-h,[text-wrap].sc-ion-label-ios-h{font-size:14px;line-height:1.5}.label-stacked.sc-ion-label-ios-h{margin-bottom:4px;font-size:14px}.label-floating.sc-ion-label-ios-h{margin-bottom:0;-webkit-transform:translate3d(0, 29px, 0);transform:translate3d(0, 29px, 0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:-webkit-transform 150ms ease-in-out;transition:-webkit-transform 150ms ease-in-out;transition:transform 150ms ease-in-out;transition:transform 150ms ease-in-out, -webkit-transform 150ms ease-in-out}[dir=rtl].sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl] .sc-ion-label-ios-h -no-combinator.label-floating.sc-ion-label-ios-h,[dir=rtl].label-floating.sc-ion-label-ios-h,[dir=rtl] .label-floating.sc-ion-label-ios-h{-webkit-transform-origin:right top;transform-origin:right top}.item-textarea.label-floating.sc-ion-label-ios-h,.item-textarea .label-floating.sc-ion-label-ios-h{-webkit-transform:translate3d(0, 28px, 0);transform:translate3d(0, 28px, 0)}.item-has-focus.label-floating.sc-ion-label-ios-h,.item-has-focus .label-floating.sc-ion-label-ios-h,.item-has-placeholder.sc-ion-label-ios-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-ios-h,.item-has-value.label-floating.sc-ion-label-ios-h,.item-has-value .label-floating.sc-ion-label-ios-h{-webkit-transform:translate3d(0, 0, 0) scale(0.82);transform:translate3d(0, 0, 0) scale(0.82)}.sc-ion-label-ios-s h1{margin-left:0;margin-right:0;margin-top:3px;margin-bottom:2px;font-size:22px;font-weight:normal}.sc-ion-label-ios-s h2{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:17px;font-weight:normal}.sc-ion-label-ios-s h3,.sc-ion-label-ios-s h4,.sc-ion-label-ios-s h5,.sc-ion-label-ios-s h6{margin-left:0;margin-right:0;margin-top:0;margin-bottom:3px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-ios-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:normal;text-overflow:inherit;overflow:inherit}.sc-ion-label-ios-s>p{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.4)}.sc-ion-label-ios-h.ion-color.sc-ion-label-ios-s>p,.ion-color .sc-ion-label-ios-h.sc-ion-label-ios-s>p{color:inherit}.sc-ion-label-ios-s h2:last-child,.sc-ion-label-ios-s h3:last-child,.sc-ion-label-ios-s h4:last-child,.sc-ion-label-ios-s h5:last-child,.sc-ion-label-ios-s h6:last-child,.sc-ion-label-ios-s p:last-child{margin-bottom:0}";
|
13554 |
|
13555 | const labelMdCss = ".item.sc-ion-label-md-h,.item .sc-ion-label-md-h{--color:initial;display:block;color:var(--color);font-family:var(--ion-font-family, inherit);font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-label-md-h{color:var(--ion-color-base)}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{white-space:normal}.item-interactive-disabled.sc-ion-label-md-h:not(.item-multiple-inputs),.item-interactive-disabled:not(.item-multiple-inputs) .sc-ion-label-md-h{cursor:default;opacity:0.3;pointer-events:none}.item-input.sc-ion-label-md-h,.item-input .sc-ion-label-md-h{-ms-flex:initial;flex:initial;max-width:200px;pointer-events:none}.item-textarea.sc-ion-label-md-h,.item-textarea .sc-ion-label-md-h{-ms-flex-item-align:baseline;align-self:baseline}.label-fixed.sc-ion-label-md-h{-ms-flex:0 0 100px;flex:0 0 100px;width:100px;min-width:100px;max-width:200px}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-bottom:0;-ms-flex-item-align:stretch;align-self:stretch;width:auto;max-width:100%}.label-no-animate.label-floating.sc-ion-label-md-h{-webkit-transition:none;transition:none}.sc-ion-label-md-s h1,.sc-ion-label-md-s h2,.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{text-overflow:inherit;overflow:inherit}.ion-text-wrap.sc-ion-label-md-h,[text-wrap].sc-ion-label-md-h{line-height:1.5}.label-stacked.sc-ion-label-md-h{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75);-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl].sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h,[dir=rtl] .sc-ion-label-md-h -no-combinator.label-stacked.sc-ion-label-md-h,[dir=rtl].label-stacked.sc-ion-label-md-h,[dir=rtl] .label-stacked.sc-ion-label-md-h{-webkit-transform-origin:right top;transform-origin:right top}.label-floating.sc-ion-label-md-h{-webkit-transform:translateY(96%);transform:translateY(96%);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1);transition:color 150ms cubic-bezier(0.4, 0, 0.2, 1), transform 150ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}[dir=rtl].sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h,[dir=rtl] .sc-ion-label-md-h -no-combinator.label-floating.sc-ion-label-md-h,[dir=rtl].label-floating.sc-ion-label-md-h,[dir=rtl] .label-floating.sc-ion-label-md-h{-webkit-transform-origin:right top;transform-origin:right top}.item-textarea.label-floating.sc-ion-label-md-h,.item-textarea .label-floating.sc-ion-label-md-h{-webkit-transform:translateY(185%);transform:translateY(185%)}.label-stacked.sc-ion-label-md-h,.label-floating.sc-ion-label-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}.item-has-focus.label-floating.sc-ion-label-md-h,.item-has-focus .label-floating.sc-ion-label-md-h,.item-has-placeholder.sc-ion-label-md-h:not(.item-input).label-floating,.item-has-placeholder:not(.item-input) .label-floating.sc-ion-label-md-h,.item-has-value.label-floating.sc-ion-label-md-h,.item-has-value .label-floating.sc-ion-label-md-h{-webkit-transform:translateY(50%) scale(0.75);transform:translateY(50%) scale(0.75)}.item-has-focus.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-primary, #3880ff)}.item-has-focus.ion-color.label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-stacked.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color.label-floating.sc-ion-label-md-h:not(.ion-color),.item-has-focus.ion-color .label-floating.sc-ion-label-md-h:not(.ion-color){color:var(--ion-color-contrast)}.sc-ion-label-md-s h1{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:24px;font-weight:normal}.sc-ion-label-md-s h2{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:16px;font-weight:normal}.sc-ion-label-md-s h3,.sc-ion-label-md-s h4,.sc-ion-label-md-s h5,.sc-ion-label-md-s h6{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:14px;font-weight:normal;line-height:normal}.sc-ion-label-md-s p{margin-left:0;margin-right:0;margin-top:0;margin-bottom:2px;font-size:14px;line-height:20px;text-overflow:inherit;overflow:inherit}.sc-ion-label-md-s>p{color:var(--ion-color-step-600, #666666)}.sc-ion-label-md-h.ion-color.sc-ion-label-md-s>p,.ion-color .sc-ion-label-md-h.sc-ion-label-md-s>p{color:inherit}";
|
13556 |
|
13557 |
|
13558 |
|
13559 |
|
13560 | class Label {
|
13561 | constructor(hostRef) {
|
13562 | registerInstance(this, hostRef);
|
13563 | this.ionColor = createEvent(this, "ionColor", 7);
|
13564 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
13565 | this.inRange = false;
|
13566 | this.noAnimate = false;
|
13567 | }
|
13568 | componentWillLoad() {
|
13569 | this.inRange = !!this.el.closest('ion-range');
|
13570 | this.noAnimate = (this.position === 'floating');
|
13571 | this.emitStyle();
|
13572 | this.emitColor();
|
13573 | }
|
13574 | componentDidLoad() {
|
13575 | if (this.noAnimate) {
|
13576 | setTimeout(() => {
|
13577 | this.noAnimate = false;
|
13578 | }, 1000);
|
13579 | }
|
13580 | }
|
13581 | colorChanged() {
|
13582 | this.emitColor();
|
13583 | }
|
13584 | positionChanged() {
|
13585 | this.emitStyle();
|
13586 | }
|
13587 | emitColor() {
|
13588 | const { color } = this;
|
13589 | this.ionColor.emit({
|
13590 | 'item-label-color': color !== undefined,
|
13591 | [`ion-color-${color}`]: color !== undefined
|
13592 | });
|
13593 | }
|
13594 | emitStyle() {
|
13595 | const { inRange, position } = this;
|
13596 |
|
13597 |
|
13598 |
|
13599 | if (!inRange) {
|
13600 | this.ionStyle.emit({
|
13601 | 'label': true,
|
13602 | [`label-${position}`]: position !== undefined
|
13603 | });
|
13604 | }
|
13605 | }
|
13606 | render() {
|
13607 | const position = this.position;
|
13608 | const mode = getIonMode$1(this);
|
13609 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
13610 | [mode]: true,
|
13611 | [`label-${position}`]: position !== undefined,
|
13612 | [`label-no-animate`]: (this.noAnimate)
|
13613 | }) }));
|
13614 | }
|
13615 | get el() { return getElement(this); }
|
13616 | static get watchers() { return {
|
13617 | "color": ["colorChanged"],
|
13618 | "position": ["positionChanged"]
|
13619 | }; }
|
13620 | static get style() { return {
|
13621 | ios: labelIosCss,
|
13622 | md: labelMdCss
|
13623 | }; }
|
13624 | static get cmpMeta() { return {
|
13625 | "$flags$": 34,
|
13626 | "$tagName$": "ion-label",
|
13627 | "$members$": {
|
13628 | "color": [513],
|
13629 | "position": [1],
|
13630 | "noAnimate": [32]
|
13631 | },
|
13632 | "$listeners$": undefined,
|
13633 | "$lazyBundleId$": "-",
|
13634 | "$attrsToReflect$": [["color", "color"]]
|
13635 | }; }
|
13636 | }
|
13637 |
|
13638 | const listIosCss = "ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{-webkit-transform:translateZ(0);transform:translateZ(0);overflow:hidden}.list-ios{background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-ios.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.list-ios.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-ios.list-inset ion-item{--border-width:0 0 1px 0;--inner-border-width:0}.list-ios.list-inset ion-item:last-child{--border-width:0;--inner-border-width:0}.list-ios.list-inset+ion-list.list-inset{margin-top:0}.list-ios-lines-none .item{--border-width:0;--inner-border-width:0}.list-ios-lines-full .item,.list-ios .item-lines-full{--border-width:0 0 0.55px 0}.list-ios-lines-full .item{--inner-border-width:0}.list-ios-lines-inset .item,.list-ios .item-lines-inset{--inner-border-width:0 0 0.55px 0}.list-ios .item-lines-inset{--border-width:0}.list-ios .item-lines-full{--inner-border-width:0}.list-ios .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
13639 |
|
13640 | const listMdCss = "ion-list{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:block;contain:content;list-style-type:none}ion-list.list-inset{-webkit-transform:translateZ(0);transform:translateZ(0);overflow:hidden}.list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;background:var(--ion-item-background, var(--ion-background-color, #fff))}.list-md>.input:last-child::after{left:0}[dir=rtl] .list-md>.input:last-child::after,:host-context([dir=rtl]) .list-md>.input:last-child::after{left:unset;right:unset;right:0}.list-md.list-inset{margin-left:16px;margin-right:16px;margin-top:16px;margin-bottom:16px;border-radius:2px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.list-md.list-inset{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:16px;margin-inline-end:16px}}.list-md.list-inset ion-item:first-child{--border-radius:2px 2px 0 0;--border-width:0 0 1px 0}.list-md.list-inset ion-item:last-child{--border-radius:0 0 2px, 2px;--border-width:0}.list-md.list-inset .item-interactive{--padding-start:0;--padding-end:0}.list-md.list-inset+ion-list.list-inset{margin-top:0}.list-md-lines-none .item{--border-width:0;--inner-border-width:0}.list-md-lines-full .item,.list-md .item-lines-full{--border-width:0 0 1px 0}.list-md-lines-full .item{--inner-border-width:0}.list-md-lines-inset .item,.list-md .item-lines-inset{--inner-border-width:0 0 1px 0}.list-md .item-lines-inset{--border-width:0}.list-md .item-lines-full{--inner-border-width:0}.list-md .item-lines-none{--border-width:0;--inner-border-width:0}ion-card .list-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
13641 |
|
13642 |
|
13643 |
|
13644 |
|
13645 | class List {
|
13646 | constructor(hostRef) {
|
13647 | registerInstance(this, hostRef);
|
13648 | |
13649 |
|
13650 |
|
13651 | this.inset = false;
|
13652 | }
|
13653 | |
13654 |
|
13655 |
|
13656 |
|
13657 |
|
13658 |
|
13659 | async closeSlidingItems() {
|
13660 | const item = this.el.querySelector('ion-item-sliding');
|
13661 | if (item && item.closeOpened) {
|
13662 | return item.closeOpened();
|
13663 | }
|
13664 | return false;
|
13665 | }
|
13666 | render() {
|
13667 | const mode = getIonMode$1(this);
|
13668 | const { lines, inset } = this;
|
13669 | return (hAsync(Host, { class: {
|
13670 | [mode]: true,
|
13671 |
|
13672 | [`list-${mode}`]: true,
|
13673 | 'list-inset': inset,
|
13674 | [`list-lines-${lines}`]: lines !== undefined,
|
13675 | [`list-${mode}-lines-${lines}`]: lines !== undefined
|
13676 | } }));
|
13677 | }
|
13678 | get el() { return getElement(this); }
|
13679 | static get style() { return {
|
13680 | ios: listIosCss,
|
13681 | md: listMdCss
|
13682 | }; }
|
13683 | static get cmpMeta() { return {
|
13684 | "$flags$": 32,
|
13685 | "$tagName$": "ion-list",
|
13686 | "$members$": {
|
13687 | "lines": [1],
|
13688 | "inset": [4],
|
13689 | "closeSlidingItems": [64]
|
13690 | },
|
13691 | "$listeners$": undefined,
|
13692 | "$lazyBundleId$": "-",
|
13693 | "$attrsToReflect$": []
|
13694 | }; }
|
13695 | }
|
13696 |
|
13697 | const listHeaderIosCss = "/*!@:host*/.sc-ion-list-header-ios-h{--border-style:solid;--border-width:0;--inner-border-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:40px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);color:var(--color);overflow:hidden}/*!@:host(.ion-color)*/.ion-color.sc-ion-list-header-ios-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@.list-header-inner*/.list-header-inner.sc-ion-list-header-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@::slotted(ion-label)*/.sc-ion-list-header-ios-s>ion-label{-ms-flex:1 1 auto;flex:1 1 auto}/*!@:host(.list-header-lines-inset),\n:host(.list-header-lines-none)*/.list-header-lines-inset.sc-ion-list-header-ios-h,.list-header-lines-none.sc-ion-list-header-ios-h{--border-width:0}/*!@:host(.list-header-lines-full),\n:host(.list-header-lines-none)*/.list-header-lines-full.sc-ion-list-header-ios-h,.list-header-lines-none.sc-ion-list-header-ios-h{--inner-border-width:0}/*!@:host*/.sc-ion-list-header-ios-h{--background:transparent;--color:var(--ion-color-step-850, #262626);--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));padding-left:calc(var(--ion-safe-area-left, 0px) + 20px);position:relative;-ms-flex-align:end;align-items:flex-end;font-size:22px;font-weight:700;letter-spacing:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-list-header-ios-h{padding-left:unset;-webkit-padding-start:calc(var(--ion-safe-area-left, 0px) + 20px);padding-inline-start:calc(var(--ion-safe-area-left, 0px) + 20px)}}/*!@::slotted(ion-button),\n::slotted(ion-label)*/.sc-ion-list-header-ios-s>ion-button,.sc-ion-list-header-ios-s>ion-label{margin-top:29px;margin-bottom:6px}/*!@::slotted(ion-button)*/.sc-ion-list-header-ios-s>ion-button{margin-left:3px;margin-right:3px;height:1.4em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-button)*/.sc-ion-list-header-ios-s>ion-button{margin-left:unset;margin-right:unset;-webkit-margin-start:3px;margin-inline-start:3px;-webkit-margin-end:3px;margin-inline-end:3px}}/*!@:host(.list-header-lines-full)*/.list-header-lines-full.sc-ion-list-header-ios-h{--border-width:0 0 0.55px 0}/*!@:host(.list-header-lines-inset)*/.list-header-lines-inset.sc-ion-list-header-ios-h{--inner-border-width:0 0 0.55px 0}";
|
13698 |
|
13699 | const listHeaderMdCss = "/*!@:host*/.sc-ion-list-header-md-h{--border-style:solid;--border-width:0;--inner-border-width:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:40px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);color:var(--color);overflow:hidden}/*!@:host(.ion-color)*/.ion-color.sc-ion-list-header-md-h{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@.list-header-inner*/.list-header-inner.sc-ion-list-header-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-item-align:stretch;align-self:stretch;min-height:inherit;border-width:var(--inner-border-width);border-style:var(--border-style);border-color:var(--border-color);overflow:inherit;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@::slotted(ion-label)*/.sc-ion-list-header-md-s>ion-label{-ms-flex:1 1 auto;flex:1 1 auto}/*!@:host(.list-header-lines-inset),\n:host(.list-header-lines-none)*/.list-header-lines-inset.sc-ion-list-header-md-h,.list-header-lines-none.sc-ion-list-header-md-h{--border-width:0}/*!@:host(.list-header-lines-full),\n:host(.list-header-lines-none)*/.list-header-lines-full.sc-ion-list-header-md-h,.list-header-lines-none.sc-ion-list-header-md-h{--inner-border-width:0}/*!@:host*/.sc-ion-list-header-md-h{--background:transparent;--color:var(--ion-text-color, #000);--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));padding-left:calc(var(--ion-safe-area-left, 0) + 16px);min-height:45px;font-size:14px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-list-header-md-h{padding-left:unset;-webkit-padding-start:calc(var(--ion-safe-area-left, 0) + 16px);padding-inline-start:calc(var(--ion-safe-area-left, 0) + 16px)}}/*!@:host(.list-header-lines-full)*/.list-header-lines-full.sc-ion-list-header-md-h{--border-width:0 0 1px 0}/*!@:host(.list-header-lines-inset)*/.list-header-lines-inset.sc-ion-list-header-md-h{--inner-border-width:0 0 1px 0}";
|
13700 |
|
13701 |
|
13702 |
|
13703 |
|
13704 | class ListHeader {
|
13705 | constructor(hostRef) {
|
13706 | registerInstance(this, hostRef);
|
13707 | }
|
13708 | render() {
|
13709 | const { lines } = this;
|
13710 | const mode = getIonMode$1(this);
|
13711 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
13712 | [mode]: true,
|
13713 | [`list-header-lines-${lines}`]: lines !== undefined,
|
13714 | }) }, hAsync("div", { class: "list-header-inner" }, hAsync("slot", null))));
|
13715 | }
|
13716 | static get style() { return {
|
13717 | ios: listHeaderIosCss,
|
13718 | md: listHeaderMdCss
|
13719 | }; }
|
13720 | static get cmpMeta() { return {
|
13721 | "$flags$": 41,
|
13722 | "$tagName$": "ion-list-header",
|
13723 | "$members$": {
|
13724 | "color": [513],
|
13725 | "lines": [1]
|
13726 | },
|
13727 | "$listeners$": undefined,
|
13728 | "$lazyBundleId$": "-",
|
13729 | "$attrsToReflect$": [["color", "color"]]
|
13730 | }; }
|
13731 | }
|
13732 |
|
13733 |
|
13734 |
|
13735 |
|
13736 | const iosEnterAnimation$4 = (baseEl) => {
|
13737 | const baseAnimation = createAnimation();
|
13738 | const backdropAnimation = createAnimation();
|
13739 | const wrapperAnimation = createAnimation();
|
13740 | backdropAnimation
|
13741 | .addElement(baseEl.querySelector('ion-backdrop'))
|
13742 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
13743 | .beforeStyles({
|
13744 | 'pointer-events': 'none'
|
13745 | })
|
13746 | .afterClearStyles(['pointer-events']);
|
13747 | wrapperAnimation
|
13748 | .addElement(baseEl.querySelector('.loading-wrapper'))
|
13749 | .keyframes([
|
13750 | { offset: 0, opacity: 0.01, transform: 'scale(1.1)' },
|
13751 | { offset: 1, opacity: 1, transform: 'scale(1)' }
|
13752 | ]);
|
13753 | return baseAnimation
|
13754 | .addElement(baseEl)
|
13755 | .easing('ease-in-out')
|
13756 | .duration(200)
|
13757 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
13758 | };
|
13759 |
|
13760 |
|
13761 |
|
13762 |
|
13763 | const iosLeaveAnimation$4 = (baseEl) => {
|
13764 | const baseAnimation = createAnimation();
|
13765 | const backdropAnimation = createAnimation();
|
13766 | const wrapperAnimation = createAnimation();
|
13767 | backdropAnimation
|
13768 | .addElement(baseEl.querySelector('ion-backdrop'))
|
13769 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
13770 | wrapperAnimation
|
13771 | .addElement(baseEl.querySelector('.loading-wrapper'))
|
13772 | .keyframes([
|
13773 | { offset: 0, opacity: 0.99, transform: 'scale(1)' },
|
13774 | { offset: 1, opacity: 0, transform: 'scale(0.9)' }
|
13775 | ]);
|
13776 | return baseAnimation
|
13777 | .addElement(baseEl)
|
13778 | .easing('ease-in-out')
|
13779 | .duration(200)
|
13780 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
13781 | };
|
13782 |
|
13783 |
|
13784 |
|
13785 |
|
13786 | const mdEnterAnimation$3 = (baseEl) => {
|
13787 | const baseAnimation = createAnimation();
|
13788 | const backdropAnimation = createAnimation();
|
13789 | const wrapperAnimation = createAnimation();
|
13790 | backdropAnimation
|
13791 | .addElement(baseEl.querySelector('ion-backdrop'))
|
13792 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
13793 | .beforeStyles({
|
13794 | 'pointer-events': 'none'
|
13795 | })
|
13796 | .afterClearStyles(['pointer-events']);
|
13797 | wrapperAnimation
|
13798 | .addElement(baseEl.querySelector('.loading-wrapper'))
|
13799 | .keyframes([
|
13800 | { offset: 0, opacity: 0.01, transform: 'scale(1.1)' },
|
13801 | { offset: 1, opacity: 1, transform: 'scale(1)' }
|
13802 | ]);
|
13803 | return baseAnimation
|
13804 | .addElement(baseEl)
|
13805 | .easing('ease-in-out')
|
13806 | .duration(200)
|
13807 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
13808 | };
|
13809 |
|
13810 |
|
13811 |
|
13812 |
|
13813 | const mdLeaveAnimation$3 = (baseEl) => {
|
13814 | const baseAnimation = createAnimation();
|
13815 | const backdropAnimation = createAnimation();
|
13816 | const wrapperAnimation = createAnimation();
|
13817 | backdropAnimation
|
13818 | .addElement(baseEl.querySelector('ion-backdrop'))
|
13819 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
13820 | wrapperAnimation
|
13821 | .addElement(baseEl.querySelector('.loading-wrapper'))
|
13822 | .keyframes([
|
13823 | { offset: 0, opacity: 0.99, transform: 'scale(1)' },
|
13824 | { offset: 1, opacity: 0, transform: 'scale(0.9)' }
|
13825 | ]);
|
13826 | return baseAnimation
|
13827 | .addElement(baseEl)
|
13828 | .easing('ease-in-out')
|
13829 | .duration(200)
|
13830 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
13831 | };
|
13832 |
|
13833 | const loadingIosCss = ".sc-ion-loading-ios-h{--min-width:auto;--width:auto;--min-height:auto;--height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-loading-ios-h{display:none}.loading-wrapper.sc-ion-loading-ios{display:-ms-flexbox;display:flex;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);opacity:0;z-index:10}.spinner-lines.sc-ion-loading-ios,.spinner-lines-small.sc-ion-loading-ios,.spinner-bubbles.sc-ion-loading-ios,.spinner-circles.sc-ion-loading-ios,.spinner-crescent.sc-ion-loading-ios,.spinner-dots.sc-ion-loading-ios{color:var(--spinner-color)}.sc-ion-loading-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--max-width:270px;--max-height:90%;--spinner-color:var(--ion-color-step-600, #666666);--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);color:var(--ion-text-color, #000);font-size:14px}.loading-wrapper.sc-ion-loading-ios{border-radius:8px;padding-left:34px;padding-right:34px;padding-top:24px;padding-bottom:24px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.loading-wrapper.sc-ion-loading-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:34px;padding-inline-start:34px;-webkit-padding-end:34px;padding-inline-end:34px}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.loading-translucent.sc-ion-loading-ios-h .loading-wrapper.sc-ion-loading-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}.loading-content.sc-ion-loading-ios{font-weight:bold}.loading-spinner.sc-ion-loading-ios+.loading-content.sc-ion-loading-ios{margin-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.loading-spinner.sc-ion-loading-ios+.loading-content.sc-ion-loading-ios{margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}";
|
13834 |
|
13835 | const loadingMdCss = ".sc-ion-loading-md-h{--min-width:auto;--width:auto;--min-height:auto;--height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-loading-md-h{display:none}.loading-wrapper.sc-ion-loading-md{display:-ms-flexbox;display:flex;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);opacity:0;z-index:10}.spinner-lines.sc-ion-loading-md,.spinner-lines-small.sc-ion-loading-md,.spinner-bubbles.sc-ion-loading-md,.spinner-circles.sc-ion-loading-md,.spinner-crescent.sc-ion-loading-md,.spinner-dots.sc-ion-loading-md{color:var(--spinner-color)}.sc-ion-loading-md-h{--background:var(--ion-color-step-50, #f2f2f2);--max-width:280px;--max-height:90%;--spinner-color:var(--ion-color-primary, #3880ff);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);color:var(--ion-color-step-850, #262626);font-size:14px}.loading-wrapper.sc-ion-loading-md{border-radius:2px;padding-left:24px;padding-right:24px;padding-top:24px;padding-bottom:24px;-webkit-box-shadow:0 16px 20px rgba(0, 0, 0, 0.4);box-shadow:0 16px 20px rgba(0, 0, 0, 0.4)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.loading-wrapper.sc-ion-loading-md{padding-left:unset;padding-right:unset;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px}}.loading-spinner.sc-ion-loading-md+.loading-content.sc-ion-loading-md{margin-left:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.loading-spinner.sc-ion-loading-md+.loading-content.sc-ion-loading-md{margin-left:unset;-webkit-margin-start:16px;margin-inline-start:16px}}";
|
13836 |
|
13837 |
|
13838 |
|
13839 |
|
13840 | class Loading {
|
13841 | constructor(hostRef) {
|
13842 | registerInstance(this, hostRef);
|
13843 | this.didPresent = createEvent(this, "ionLoadingDidPresent", 7);
|
13844 | this.willPresent = createEvent(this, "ionLoadingWillPresent", 7);
|
13845 | this.willDismiss = createEvent(this, "ionLoadingWillDismiss", 7);
|
13846 | this.didDismiss = createEvent(this, "ionLoadingDidDismiss", 7);
|
13847 | this.presented = false;
|
13848 | |
13849 |
|
13850 |
|
13851 | this.keyboardClose = true;
|
13852 | |
13853 |
|
13854 |
|
13855 | this.duration = 0;
|
13856 | |
13857 |
|
13858 |
|
13859 | this.backdropDismiss = false;
|
13860 | |
13861 |
|
13862 |
|
13863 | this.showBackdrop = true;
|
13864 | |
13865 |
|
13866 |
|
13867 |
|
13868 |
|
13869 | this.translucent = false;
|
13870 | |
13871 |
|
13872 |
|
13873 | this.animated = true;
|
13874 | this.onBackdropTap = () => {
|
13875 | this.dismiss(undefined, BACKDROP);
|
13876 | };
|
13877 | }
|
13878 | connectedCallback() {
|
13879 | prepareOverlay(this.el);
|
13880 | }
|
13881 | componentWillLoad() {
|
13882 | if (this.spinner === undefined) {
|
13883 | const mode = getIonMode$1(this);
|
13884 | this.spinner = config.get('loadingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));
|
13885 | }
|
13886 | }
|
13887 | |
13888 |
|
13889 |
|
13890 | async present() {
|
13891 | await present(this, 'loadingEnter', iosEnterAnimation$4, mdEnterAnimation$3, undefined);
|
13892 | if (this.duration > 0) {
|
13893 | this.durationTimeout = setTimeout(() => this.dismiss(), this.duration + 10);
|
13894 | }
|
13895 | }
|
13896 | |
13897 |
|
13898 |
|
13899 |
|
13900 |
|
13901 |
|
13902 |
|
13903 |
|
13904 |
|
13905 | dismiss(data, role) {
|
13906 | if (this.durationTimeout) {
|
13907 | clearTimeout(this.durationTimeout);
|
13908 | }
|
13909 | return dismiss(this, data, role, 'loadingLeave', iosLeaveAnimation$4, mdLeaveAnimation$3);
|
13910 | }
|
13911 | |
13912 |
|
13913 |
|
13914 | onDidDismiss() {
|
13915 | return eventMethod(this.el, 'ionLoadingDidDismiss');
|
13916 | }
|
13917 | |
13918 |
|
13919 |
|
13920 | onWillDismiss() {
|
13921 | return eventMethod(this.el, 'ionLoadingWillDismiss');
|
13922 | }
|
13923 | render() {
|
13924 | const { message, spinner } = this;
|
13925 | const mode = getIonMode$1(this);
|
13926 | return (hAsync(Host, { onIonBackdropTap: this.onBackdropTap, tabindex: "-1", style: {
|
13927 | zIndex: `${40000 + this.overlayIndex}`
|
13928 | }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'loading-translucent': this.translucent }) }, hAsync("ion-backdrop", { visible: this.showBackdrop, tappable: this.backdropDismiss }), hAsync("div", { tabindex: "0" }), hAsync("div", { class: "loading-wrapper ion-overlay-wrapper", role: "dialog" }, spinner && (hAsync("div", { class: "loading-spinner" }, hAsync("ion-spinner", { name: spinner, "aria-hidden": "true" }))), message && hAsync("div", { class: "loading-content", innerHTML: sanitizeDOMString(message) })), hAsync("div", { tabindex: "0" })));
|
13929 | }
|
13930 | get el() { return getElement(this); }
|
13931 | static get style() { return {
|
13932 | ios: loadingIosCss,
|
13933 | md: loadingMdCss
|
13934 | }; }
|
13935 | static get cmpMeta() { return {
|
13936 | "$flags$": 34,
|
13937 | "$tagName$": "ion-loading",
|
13938 | "$members$": {
|
13939 | "overlayIndex": [2, "overlay-index"],
|
13940 | "keyboardClose": [4, "keyboard-close"],
|
13941 | "enterAnimation": [16],
|
13942 | "leaveAnimation": [16],
|
13943 | "message": [1],
|
13944 | "cssClass": [1, "css-class"],
|
13945 | "duration": [2],
|
13946 | "backdropDismiss": [4, "backdrop-dismiss"],
|
13947 | "showBackdrop": [4, "show-backdrop"],
|
13948 | "spinner": [1025],
|
13949 | "translucent": [4],
|
13950 | "animated": [4],
|
13951 | "present": [64],
|
13952 | "dismiss": [64],
|
13953 | "onDidDismiss": [64],
|
13954 | "onWillDismiss": [64]
|
13955 | },
|
13956 | "$listeners$": undefined,
|
13957 | "$lazyBundleId$": "-",
|
13958 | "$attrsToReflect$": []
|
13959 | }; }
|
13960 | }
|
13961 |
|
13962 |
|
13963 |
|
13964 |
|
13965 |
|
13966 |
|
13967 |
|
13968 |
|
13969 |
|
13970 |
|
13971 |
|
13972 |
|
13973 |
|
13974 |
|
13975 |
|
13976 |
|
13977 |
|
13978 |
|
13979 |
|
13980 |
|
13981 | const getTimeGivenProgression = (p0, p1, p2, p3, progression) => {
|
13982 | return solveCubicBezier(p0[1], p1[1], p2[1], p3[1], progression).map(tValue => {
|
13983 | return solveCubicParametricEquation(p0[0], p1[0], p2[0], p3[0], tValue);
|
13984 | });
|
13985 | };
|
13986 |
|
13987 |
|
13988 |
|
13989 | const solveCubicParametricEquation = (p0, p1, p2, p3, t) => {
|
13990 | const partA = (3 * p1) * Math.pow(t - 1, 2);
|
13991 | const partB = (-3 * p2 * t) + (3 * p2) + (p3 * t);
|
13992 | const partC = p0 * Math.pow(t - 1, 3);
|
13993 | return t * (partA + (t * partB)) - partC;
|
13994 | };
|
13995 |
|
13996 |
|
13997 |
|
13998 | const solveCubicBezier = (p0, p1, p2, p3, refPoint) => {
|
13999 | p0 -= refPoint;
|
14000 | p1 -= refPoint;
|
14001 | p2 -= refPoint;
|
14002 | p3 -= refPoint;
|
14003 | const roots = solveCubicEquation(p3 - 3 * p2 + 3 * p1 - p0, 3 * p2 - 6 * p1 + 3 * p0, 3 * p1 - 3 * p0, p0);
|
14004 | return roots.filter(root => root >= 0 && root <= 1);
|
14005 | };
|
14006 | const solveQuadraticEquation = (a, b, c) => {
|
14007 | const discriminant = b * b - 4 * a * c;
|
14008 | if (discriminant < 0) {
|
14009 | return [];
|
14010 | }
|
14011 | else {
|
14012 | return [
|
14013 | (-b + Math.sqrt(discriminant)) / (2 * a),
|
14014 | (-b - Math.sqrt(discriminant)) / (2 * a)
|
14015 | ];
|
14016 | }
|
14017 | };
|
14018 | const solveCubicEquation = (a, b, c, d) => {
|
14019 | if (a === 0) {
|
14020 | return solveQuadraticEquation(b, c, d);
|
14021 | }
|
14022 | b /= a;
|
14023 | c /= a;
|
14024 | d /= a;
|
14025 | const p = (3 * c - b * b) / 3;
|
14026 | const q = (2 * b * b * b - 9 * b * c + 27 * d) / 27;
|
14027 | if (p === 0) {
|
14028 | return [Math.pow(-q, 1 / 3)];
|
14029 | }
|
14030 | else if (q === 0) {
|
14031 | return [Math.sqrt(-p), -Math.sqrt(-p)];
|
14032 | }
|
14033 | const discriminant = Math.pow(q / 2, 2) + Math.pow(p / 3, 3);
|
14034 | if (discriminant === 0) {
|
14035 | return [Math.pow(q / 2, 1 / 2) - b / 3];
|
14036 | }
|
14037 | else if (discriminant > 0) {
|
14038 | return [Math.pow(-(q / 2) + Math.sqrt(discriminant), 1 / 3) - Math.pow((q / 2) + Math.sqrt(discriminant), 1 / 3) - b / 3];
|
14039 | }
|
14040 | const r = Math.sqrt(Math.pow(-(p / 3), 3));
|
14041 | const phi = Math.acos(-(q / (2 * Math.sqrt(Math.pow(-(p / 3), 3)))));
|
14042 | const s = 2 * Math.pow(r, 1 / 3);
|
14043 | return [
|
14044 | s * Math.cos(phi / 3) - b / 3,
|
14045 | s * Math.cos((phi + 2 * Math.PI) / 3) - b / 3,
|
14046 | s * Math.cos((phi + 4 * Math.PI) / 3) - b / 3
|
14047 | ];
|
14048 | };
|
14049 |
|
14050 |
|
14051 |
|
14052 |
|
14053 |
|
14054 |
|
14055 |
|
14056 | const baseAnimation = (isIos) => {
|
14057 |
|
14058 |
|
14059 | |
14060 |
|
14061 |
|
14062 |
|
14063 |
|
14064 | return createAnimation().duration(isIos ? 400 : 300);
|
14065 | };
|
14066 |
|
14067 |
|
14068 |
|
14069 |
|
14070 |
|
14071 |
|
14072 | const menuOverlayAnimation = (menu) => {
|
14073 | let closedX;
|
14074 | let openedX;
|
14075 | const width = menu.width + 8;
|
14076 | const menuAnimation = createAnimation();
|
14077 | const backdropAnimation = createAnimation();
|
14078 | if (menu.isEndSide) {
|
14079 |
|
14080 | closedX = width + 'px';
|
14081 | openedX = '0px';
|
14082 | }
|
14083 | else {
|
14084 |
|
14085 | closedX = -width + 'px';
|
14086 | openedX = '0px';
|
14087 | }
|
14088 | menuAnimation
|
14089 | .addElement(menu.menuInnerEl)
|
14090 | .fromTo('transform', `translateX(${closedX})`, `translateX(${openedX})`);
|
14091 | const mode = getIonMode$1(menu);
|
14092 | const isIos = mode === 'ios';
|
14093 | const opacity = isIos ? 0.2 : 0.25;
|
14094 | backdropAnimation
|
14095 | .addElement(menu.backdropEl)
|
14096 | .fromTo('opacity', 0.01, opacity);
|
14097 | return baseAnimation(isIos).addAnimation([menuAnimation, backdropAnimation]);
|
14098 | };
|
14099 |
|
14100 |
|
14101 |
|
14102 |
|
14103 |
|
14104 |
|
14105 | const menuPushAnimation = (menu) => {
|
14106 | let contentOpenedX;
|
14107 | let menuClosedX;
|
14108 | const mode = getIonMode$1(menu);
|
14109 | const width = menu.width;
|
14110 | if (menu.isEndSide) {
|
14111 | contentOpenedX = -width + 'px';
|
14112 | menuClosedX = width + 'px';
|
14113 | }
|
14114 | else {
|
14115 | contentOpenedX = width + 'px';
|
14116 | menuClosedX = -width + 'px';
|
14117 | }
|
14118 | const menuAnimation = createAnimation()
|
14119 | .addElement(menu.menuInnerEl)
|
14120 | .fromTo('transform', `translateX(${menuClosedX})`, 'translateX(0px)');
|
14121 | const contentAnimation = createAnimation()
|
14122 | .addElement(menu.contentEl)
|
14123 | .fromTo('transform', 'translateX(0px)', `translateX(${contentOpenedX})`);
|
14124 | const backdropAnimation = createAnimation()
|
14125 | .addElement(menu.backdropEl)
|
14126 | .fromTo('opacity', 0.01, 0.32);
|
14127 | return baseAnimation(mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]);
|
14128 | };
|
14129 |
|
14130 |
|
14131 |
|
14132 |
|
14133 |
|
14134 |
|
14135 | const menuRevealAnimation = (menu) => {
|
14136 | const mode = getIonMode$1(menu);
|
14137 | const openedX = (menu.width * (menu.isEndSide ? -1 : 1)) + 'px';
|
14138 | const contentOpen = createAnimation()
|
14139 | .addElement(menu.contentEl)
|
14140 | .fromTo('transform', 'translateX(0px)', `translateX(${openedX})`);
|
14141 | return baseAnimation(mode === 'ios').addAnimation(contentOpen);
|
14142 | };
|
14143 |
|
14144 | const createMenuController = () => {
|
14145 | const menuAnimations = new Map();
|
14146 | const menus = [];
|
14147 | const open = async (menu) => {
|
14148 | const menuEl = await get(menu);
|
14149 | if (menuEl) {
|
14150 | return menuEl.open();
|
14151 | }
|
14152 | return false;
|
14153 | };
|
14154 | const close = async (menu) => {
|
14155 | const menuEl = await (menu !== undefined ? get(menu) : getOpen());
|
14156 | if (menuEl !== undefined) {
|
14157 | return menuEl.close();
|
14158 | }
|
14159 | return false;
|
14160 | };
|
14161 | const toggle = async (menu) => {
|
14162 | const menuEl = await get(menu);
|
14163 | if (menuEl) {
|
14164 | return menuEl.toggle();
|
14165 | }
|
14166 | return false;
|
14167 | };
|
14168 | const enable = async (shouldEnable, menu) => {
|
14169 | const menuEl = await get(menu);
|
14170 | if (menuEl) {
|
14171 | menuEl.disabled = !shouldEnable;
|
14172 | }
|
14173 | return menuEl;
|
14174 | };
|
14175 | const swipeGesture = async (shouldEnable, menu) => {
|
14176 | const menuEl = await get(menu);
|
14177 | if (menuEl) {
|
14178 | menuEl.swipeGesture = shouldEnable;
|
14179 | }
|
14180 | return menuEl;
|
14181 | };
|
14182 | const isOpen = async (menu) => {
|
14183 | if (menu != null) {
|
14184 | const menuEl = await get(menu);
|
14185 | return (menuEl !== undefined && menuEl.isOpen());
|
14186 | }
|
14187 | else {
|
14188 | const menuEl = await getOpen();
|
14189 | return menuEl !== undefined;
|
14190 | }
|
14191 | };
|
14192 | const isEnabled = async (menu) => {
|
14193 | const menuEl = await get(menu);
|
14194 | if (menuEl) {
|
14195 | return !menuEl.disabled;
|
14196 | }
|
14197 | return false;
|
14198 | };
|
14199 | const get = async (menu) => {
|
14200 | await waitUntilReady();
|
14201 | if (menu === 'start' || menu === 'end') {
|
14202 |
|
14203 |
|
14204 | const menuRef = find(m => m.side === menu && !m.disabled);
|
14205 | if (menuRef) {
|
14206 | return menuRef;
|
14207 | }
|
14208 |
|
14209 |
|
14210 | return find(m => m.side === menu);
|
14211 | }
|
14212 | else if (menu != null) {
|
14213 |
|
14214 |
|
14215 | return find(m => m.menuId === menu);
|
14216 | }
|
14217 |
|
14218 | const menuEl = find(m => !m.disabled);
|
14219 | if (menuEl) {
|
14220 | return menuEl;
|
14221 | }
|
14222 |
|
14223 | return menus.length > 0 ? menus[0].el : undefined;
|
14224 | };
|
14225 | |
14226 |
|
14227 |
|
14228 | const getOpen = async () => {
|
14229 | await waitUntilReady();
|
14230 | return _getOpenSync();
|
14231 | };
|
14232 | |
14233 |
|
14234 |
|
14235 | const getMenus = async () => {
|
14236 | await waitUntilReady();
|
14237 | return getMenusSync();
|
14238 | };
|
14239 | |
14240 |
|
14241 |
|
14242 |
|
14243 | const isAnimating = async () => {
|
14244 | await waitUntilReady();
|
14245 | return isAnimatingSync();
|
14246 | };
|
14247 | const registerAnimation = (name, animation) => {
|
14248 | menuAnimations.set(name, animation);
|
14249 | };
|
14250 | const _register = (menu) => {
|
14251 | if (menus.indexOf(menu) < 0) {
|
14252 | if (!menu.disabled) {
|
14253 | _setActiveMenu(menu);
|
14254 | }
|
14255 | menus.push(menu);
|
14256 | }
|
14257 | };
|
14258 | const _unregister = (menu) => {
|
14259 | const index = menus.indexOf(menu);
|
14260 | if (index > -1) {
|
14261 | menus.splice(index, 1);
|
14262 | }
|
14263 | };
|
14264 | const _setActiveMenu = (menu) => {
|
14265 |
|
14266 |
|
14267 |
|
14268 | const side = menu.side;
|
14269 | menus
|
14270 | .filter(m => m.side === side && m !== menu)
|
14271 | .forEach(m => m.disabled = true);
|
14272 | };
|
14273 | const _setOpen = async (menu, shouldOpen, animated) => {
|
14274 | if (isAnimatingSync()) {
|
14275 | return false;
|
14276 | }
|
14277 | if (shouldOpen) {
|
14278 | const openedMenu = await getOpen();
|
14279 | if (openedMenu && menu.el !== openedMenu) {
|
14280 | await openedMenu.setOpen(false, false);
|
14281 | }
|
14282 | }
|
14283 | return menu._setOpen(shouldOpen, animated);
|
14284 | };
|
14285 | const _createAnimation = (type, menuCmp) => {
|
14286 | const animationBuilder = menuAnimations.get(type);
|
14287 | if (!animationBuilder) {
|
14288 | throw new Error('animation not registered');
|
14289 | }
|
14290 | const animation = animationBuilder(menuCmp);
|
14291 | return animation;
|
14292 | };
|
14293 | const _getOpenSync = () => {
|
14294 | return find(m => m._isOpen);
|
14295 | };
|
14296 | const getMenusSync = () => {
|
14297 | return menus.map(menu => menu.el);
|
14298 | };
|
14299 | const isAnimatingSync = () => {
|
14300 | return menus.some(menu => menu.isAnimating);
|
14301 | };
|
14302 | const find = (predicate) => {
|
14303 | const instance = menus.find(predicate);
|
14304 | if (instance !== undefined) {
|
14305 | return instance.el;
|
14306 | }
|
14307 | return undefined;
|
14308 | };
|
14309 | const waitUntilReady = () => {
|
14310 | return Promise.all(Array.from(document.querySelectorAll('ion-menu'))
|
14311 | .map(menu => new Promise(resolve => componentOnReady(menu, resolve))));
|
14312 | };
|
14313 | registerAnimation('reveal', menuRevealAnimation);
|
14314 | registerAnimation('push', menuPushAnimation);
|
14315 | registerAnimation('overlay', menuOverlayAnimation);
|
14316 |
|
14317 | if (typeof document !== 'undefined') {
|
14318 | document.addEventListener('ionBackButton', (ev) => {
|
14319 | const openMenu = _getOpenSync();
|
14320 | if (openMenu) {
|
14321 | ev.detail.register(MENU_BACK_BUTTON_PRIORITY, () => {
|
14322 | return openMenu.close();
|
14323 | });
|
14324 | }
|
14325 | });
|
14326 | }
|
14327 | return {
|
14328 | registerAnimation,
|
14329 | get,
|
14330 | getMenus,
|
14331 | getOpen,
|
14332 | isEnabled,
|
14333 | swipeGesture,
|
14334 | isAnimating,
|
14335 | isOpen,
|
14336 | enable,
|
14337 | toggle,
|
14338 | close,
|
14339 | open,
|
14340 | _getOpenSync,
|
14341 | _createAnimation,
|
14342 | _register,
|
14343 | _unregister,
|
14344 | _setOpen,
|
14345 | _setActiveMenu,
|
14346 | };
|
14347 | };
|
14348 | const menuController = /*@__PURE__*/ createMenuController();
|
14349 |
|
14350 | const menuIosCss = "/*!@:host*/.sc-ion-menu-ios-h{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}/*!@:host(.show-menu)*/.show-menu.sc-ion-menu-ios-h{display:block}/*!@.menu-inner*/.menu-inner.sc-ion-menu-ios{left:0;right:auto;top:0;bottom:0;-webkit-transform:translate3d(-9999px, 0, 0);transform:translate3d(-9999px, 0, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}/*!@[dir=rtl] .menu-inner, :host-context([dir=rtl]) .menu-inner*/[dir=rtl].sc-ion-menu-ios .menu-inner.sc-ion-menu-ios,[dir=rtl].sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios,[dir=rtl] .sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios{left:unset;right:unset;left:auto;right:0}/*!@[dir=rtl] .menu-inner, :host-context([dir=rtl]) .menu-inner*/[dir=rtl].sc-ion-menu-ios .menu-inner.sc-ion-menu-ios,[dir=rtl].sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios,[dir=rtl] .sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios{-webkit-transform:translate3d(calc(-1 * -9999px), 0, 0);transform:translate3d(calc(-1 * -9999px), 0, 0)}/*!@:host(.menu-side-start) .menu-inner*/.menu-side-start.sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios{--ion-safe-area-right:0px;right:auto;left:0}/*!@:host(.menu-side-end) .menu-inner*/.menu-side-end.sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios{--ion-safe-area-left:0px;right:0;left:auto}/*!@ion-backdrop*/ion-backdrop.sc-ion-menu-ios{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){/*!@.menu-inner*/.menu-inner.sc-ion-menu-ios{--width:264px}}/*!@:host(.menu-type-reveal)*/.menu-type-reveal.sc-ion-menu-ios-h{z-index:0}/*!@:host(.menu-type-reveal.show-menu) .menu-inner*/.menu-type-reveal.show-menu.sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}/*!@:host(.menu-type-overlay)*/.menu-type-overlay.sc-ion-menu-ios-h{z-index:1000}/*!@:host(.menu-type-overlay) .show-backdrop*/.menu-type-overlay.sc-ion-menu-ios-h .show-backdrop.sc-ion-menu-ios{display:block;cursor:pointer}/*!@:host(.menu-pane-visible)*/.menu-pane-visible.sc-ion-menu-ios-h{width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}/*!@:host(.menu-pane-visible) .menu-inner*/.menu-pane-visible.sc-ion-menu-ios-h .menu-inner.sc-ion-menu-ios{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}/*!@:host(.menu-pane-visible) ion-backdrop*/.menu-pane-visible.sc-ion-menu-ios-h ion-backdrop.sc-ion-menu-ios{display:hidden !important}/*!@:host(.menu-type-push)*/.menu-type-push.sc-ion-menu-ios-h{z-index:1000}/*!@:host(.menu-type-push) .show-backdrop*/.menu-type-push.sc-ion-menu-ios-h .show-backdrop.sc-ion-menu-ios{display:block}";
|
14351 |
|
14352 | const menuMdCss = "/*!@:host*/.sc-ion-menu-md-h{--width:304px;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--background:var(--ion-background-color, #fff);left:0;right:0;top:0;bottom:0;display:none;position:absolute;contain:strict}/*!@:host(.show-menu)*/.show-menu.sc-ion-menu-md-h{display:block}/*!@.menu-inner*/.menu-inner.sc-ion-menu-md{left:0;right:auto;top:0;bottom:0;-webkit-transform:translate3d(-9999px, 0, 0);transform:translate3d(-9999px, 0, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:strict}/*!@[dir=rtl] .menu-inner, :host-context([dir=rtl]) .menu-inner*/[dir=rtl].sc-ion-menu-md .menu-inner.sc-ion-menu-md,[dir=rtl].sc-ion-menu-md-h .menu-inner.sc-ion-menu-md,[dir=rtl] .sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{left:unset;right:unset;left:auto;right:0}/*!@[dir=rtl] .menu-inner, :host-context([dir=rtl]) .menu-inner*/[dir=rtl].sc-ion-menu-md .menu-inner.sc-ion-menu-md,[dir=rtl].sc-ion-menu-md-h .menu-inner.sc-ion-menu-md,[dir=rtl] .sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{-webkit-transform:translate3d(calc(-1 * -9999px), 0, 0);transform:translate3d(calc(-1 * -9999px), 0, 0)}/*!@:host(.menu-side-start) .menu-inner*/.menu-side-start.sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{--ion-safe-area-right:0px;right:auto;left:0}/*!@:host(.menu-side-end) .menu-inner*/.menu-side-end.sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{--ion-safe-area-left:0px;right:0;left:auto}/*!@ion-backdrop*/ion-backdrop.sc-ion-menu-md{display:none;opacity:0.01;z-index:-1}@media (max-width: 340px){/*!@.menu-inner*/.menu-inner.sc-ion-menu-md{--width:264px}}/*!@:host(.menu-type-reveal)*/.menu-type-reveal.sc-ion-menu-md-h{z-index:0}/*!@:host(.menu-type-reveal.show-menu) .menu-inner*/.menu-type-reveal.show-menu.sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}/*!@:host(.menu-type-overlay)*/.menu-type-overlay.sc-ion-menu-md-h{z-index:1000}/*!@:host(.menu-type-overlay) .show-backdrop*/.menu-type-overlay.sc-ion-menu-md-h .show-backdrop.sc-ion-menu-md{display:block;cursor:pointer}/*!@:host(.menu-pane-visible)*/.menu-pane-visible.sc-ion-menu-md-h{width:var(--width);min-width:var(--min-width);max-width:var(--max-width)}/*!@:host(.menu-pane-visible) .menu-inner*/.menu-pane-visible.sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{left:0;right:0;width:auto;-webkit-transform:none !important;transform:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}/*!@:host(.menu-pane-visible) ion-backdrop*/.menu-pane-visible.sc-ion-menu-md-h ion-backdrop.sc-ion-menu-md{display:hidden !important}/*!@:host(.menu-type-overlay) .menu-inner*/.menu-type-overlay.sc-ion-menu-md-h .menu-inner.sc-ion-menu-md{-webkit-box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18);box-shadow:4px 0px 16px rgba(0, 0, 0, 0.18)}";
|
14353 |
|
14354 | const iosEasing = 'cubic-bezier(0.32,0.72,0,1)';
|
14355 | const mdEasing = 'cubic-bezier(0.0,0.0,0.2,1)';
|
14356 | const iosEasingReverse = 'cubic-bezier(1, 0, 0.68, 0.28)';
|
14357 | const mdEasingReverse = 'cubic-bezier(0.4, 0, 0.6, 1)';
|
14358 |
|
14359 |
|
14360 |
|
14361 |
|
14362 | class Menu {
|
14363 | constructor(hostRef) {
|
14364 | registerInstance(this, hostRef);
|
14365 | this.ionWillOpen = createEvent(this, "ionWillOpen", 7);
|
14366 | this.ionWillClose = createEvent(this, "ionWillClose", 7);
|
14367 | this.ionDidOpen = createEvent(this, "ionDidOpen", 7);
|
14368 | this.ionDidClose = createEvent(this, "ionDidClose", 7);
|
14369 | this.ionMenuChange = createEvent(this, "ionMenuChange", 7);
|
14370 | this.lastOnEnd = 0;
|
14371 | this.blocker = GESTURE_CONTROLLER.createBlocker({ disableScroll: true });
|
14372 | this.isAnimating = false;
|
14373 | this._isOpen = false;
|
14374 | this.isPaneVisible = false;
|
14375 | this.isEndSide = false;
|
14376 | |
14377 |
|
14378 |
|
14379 | this.disabled = false;
|
14380 | |
14381 |
|
14382 |
|
14383 | this.side = 'start';
|
14384 | |
14385 |
|
14386 |
|
14387 | this.swipeGesture = true;
|
14388 | |
14389 |
|
14390 |
|
14391 |
|
14392 | this.maxEdgeStart = 50;
|
14393 | }
|
14394 | typeChanged(type, oldType) {
|
14395 | const contentEl = this.contentEl;
|
14396 | if (contentEl) {
|
14397 | if (oldType !== undefined) {
|
14398 | contentEl.classList.remove(`menu-content-${oldType}`);
|
14399 | }
|
14400 | contentEl.classList.add(`menu-content-${type}`);
|
14401 | contentEl.removeAttribute('style');
|
14402 | }
|
14403 | if (this.menuInnerEl) {
|
14404 |
|
14405 | this.menuInnerEl.removeAttribute('style');
|
14406 | }
|
14407 | this.animation = undefined;
|
14408 | }
|
14409 | disabledChanged() {
|
14410 | this.updateState();
|
14411 | this.ionMenuChange.emit({
|
14412 | disabled: this.disabled,
|
14413 | open: this._isOpen
|
14414 | });
|
14415 | }
|
14416 | sideChanged() {
|
14417 | this.isEndSide = isEndSide(this.side);
|
14418 | }
|
14419 | swipeGestureChanged() {
|
14420 | this.updateState();
|
14421 | }
|
14422 | async connectedCallback() {
|
14423 | if (this.type === undefined) {
|
14424 | this.type = config.get('menuType', 'overlay');
|
14425 | }
|
14426 | {
|
14427 | this.disabled = true;
|
14428 | return;
|
14429 | }
|
14430 | }
|
14431 | async componentDidLoad() {
|
14432 | this.ionMenuChange.emit({ disabled: this.disabled, open: this._isOpen });
|
14433 | this.updateState();
|
14434 | }
|
14435 | disconnectedCallback() {
|
14436 | this.blocker.destroy();
|
14437 | menuController._unregister(this);
|
14438 | if (this.animation) {
|
14439 | this.animation.destroy();
|
14440 | }
|
14441 | if (this.gesture) {
|
14442 | this.gesture.destroy();
|
14443 | this.gesture = undefined;
|
14444 | }
|
14445 | this.animation = undefined;
|
14446 | this.contentEl = this.backdropEl = this.menuInnerEl = undefined;
|
14447 | }
|
14448 | onSplitPaneChanged(ev) {
|
14449 | this.isPaneVisible = ev.detail.isPane(this.el);
|
14450 | this.updateState();
|
14451 | }
|
14452 | onBackdropClick(ev) {
|
14453 | if (this._isOpen && this.lastOnEnd < ev.timeStamp - 100) {
|
14454 | const shouldClose = (ev.composedPath)
|
14455 | ? !ev.composedPath().includes(this.menuInnerEl)
|
14456 | : false;
|
14457 | if (shouldClose) {
|
14458 | ev.preventDefault();
|
14459 | ev.stopPropagation();
|
14460 | this.close();
|
14461 | }
|
14462 | }
|
14463 | }
|
14464 | |
14465 |
|
14466 |
|
14467 | isOpen() {
|
14468 | return Promise.resolve(this._isOpen);
|
14469 | }
|
14470 | |
14471 |
|
14472 |
|
14473 |
|
14474 |
|
14475 |
|
14476 | isActive() {
|
14477 | return Promise.resolve(this._isActive());
|
14478 | }
|
14479 | |
14480 |
|
14481 |
|
14482 |
|
14483 | open(animated = true) {
|
14484 | return this.setOpen(true, animated);
|
14485 | }
|
14486 | |
14487 |
|
14488 |
|
14489 |
|
14490 | close(animated = true) {
|
14491 | return this.setOpen(false, animated);
|
14492 | }
|
14493 | |
14494 |
|
14495 |
|
14496 |
|
14497 | toggle(animated = true) {
|
14498 | return this.setOpen(!this._isOpen, animated);
|
14499 | }
|
14500 | |
14501 |
|
14502 |
|
14503 |
|
14504 | setOpen(shouldOpen, animated = true) {
|
14505 | return menuController._setOpen(this, shouldOpen, animated);
|
14506 | }
|
14507 | async _setOpen(shouldOpen, animated = true) {
|
14508 |
|
14509 | if (!this._isActive() || this.isAnimating || shouldOpen === this._isOpen) {
|
14510 | return false;
|
14511 | }
|
14512 | this.beforeAnimation(shouldOpen);
|
14513 | await this.loadAnimation();
|
14514 | await this.startAnimation(shouldOpen, animated);
|
14515 | this.afterAnimation(shouldOpen);
|
14516 | return true;
|
14517 | }
|
14518 | async loadAnimation() {
|
14519 |
|
14520 |
|
14521 | const width = this.menuInnerEl.offsetWidth;
|
14522 | if (width === this.width && this.animation !== undefined) {
|
14523 | return;
|
14524 | }
|
14525 | this.width = width;
|
14526 |
|
14527 | if (this.animation) {
|
14528 | this.animation.destroy();
|
14529 | this.animation = undefined;
|
14530 | }
|
14531 |
|
14532 | this.animation = await menuController._createAnimation(this.type, this);
|
14533 | if (!config.getBoolean('animated', true)) {
|
14534 | this.animation.duration(0);
|
14535 | }
|
14536 | this.animation.fill('both');
|
14537 | }
|
14538 | async startAnimation(shouldOpen, animated) {
|
14539 | const isReversed = !shouldOpen;
|
14540 | const mode = getIonMode$1(this);
|
14541 | const easing = mode === 'ios' ? iosEasing : mdEasing;
|
14542 | const easingReverse = mode === 'ios' ? iosEasingReverse : mdEasingReverse;
|
14543 | const ani = this.animation
|
14544 | .direction((isReversed) ? 'reverse' : 'normal')
|
14545 | .easing((isReversed) ? easingReverse : easing)
|
14546 | .onFinish(() => {
|
14547 | if (ani.getDirection() === 'reverse') {
|
14548 | ani.direction('normal');
|
14549 | }
|
14550 | });
|
14551 | if (animated) {
|
14552 | await ani.play();
|
14553 | }
|
14554 | else {
|
14555 | ani.play({ sync: true });
|
14556 | }
|
14557 | }
|
14558 | _isActive() {
|
14559 | return !this.disabled && !this.isPaneVisible;
|
14560 | }
|
14561 | canSwipe() {
|
14562 | return this.swipeGesture && !this.isAnimating && this._isActive();
|
14563 | }
|
14564 | canStart(detail) {
|
14565 |
|
14566 | const isModalPresented = !!document.querySelector('ion-modal.show-modal');
|
14567 | if (isModalPresented || !this.canSwipe()) {
|
14568 | return false;
|
14569 | }
|
14570 | if (this._isOpen) {
|
14571 | return true;
|
14572 |
|
14573 | }
|
14574 | else if (menuController._getOpenSync()) {
|
14575 | return false;
|
14576 | }
|
14577 | return checkEdgeSide(window, detail.currentX, this.isEndSide, this.maxEdgeStart);
|
14578 | }
|
14579 | onWillStart() {
|
14580 | this.beforeAnimation(!this._isOpen);
|
14581 | return this.loadAnimation();
|
14582 | }
|
14583 | onStart() {
|
14584 | if (!this.isAnimating || !this.animation) {
|
14585 | assert(false, 'isAnimating has to be true');
|
14586 | return;
|
14587 | }
|
14588 |
|
14589 | this.animation.progressStart(true, (this._isOpen) ? 1 : 0);
|
14590 | }
|
14591 | onMove(detail) {
|
14592 | if (!this.isAnimating || !this.animation) {
|
14593 | assert(false, 'isAnimating has to be true');
|
14594 | return;
|
14595 | }
|
14596 | const delta = computeDelta(detail.deltaX, this._isOpen, this.isEndSide);
|
14597 | const stepValue = delta / this.width;
|
14598 | this.animation.progressStep((this._isOpen) ? 1 - stepValue : stepValue);
|
14599 | }
|
14600 | onEnd(detail) {
|
14601 | if (!this.isAnimating || !this.animation) {
|
14602 | assert(false, 'isAnimating has to be true');
|
14603 | return;
|
14604 | }
|
14605 | const isOpen = this._isOpen;
|
14606 | const isEndSide = this.isEndSide;
|
14607 | const delta = computeDelta(detail.deltaX, isOpen, isEndSide);
|
14608 | const width = this.width;
|
14609 | const stepValue = delta / width;
|
14610 | const velocity = detail.velocityX;
|
14611 | const z = width / 2.0;
|
14612 | const shouldCompleteRight = velocity >= 0 && (velocity > 0.2 || detail.deltaX > z);
|
14613 | const shouldCompleteLeft = velocity <= 0 && (velocity < -0.2 || detail.deltaX < -z);
|
14614 | const shouldComplete = isOpen
|
14615 | ? isEndSide ? shouldCompleteRight : shouldCompleteLeft
|
14616 | : isEndSide ? shouldCompleteLeft : shouldCompleteRight;
|
14617 | let shouldOpen = !isOpen && shouldComplete;
|
14618 | if (isOpen && !shouldComplete) {
|
14619 | shouldOpen = true;
|
14620 | }
|
14621 | this.lastOnEnd = detail.currentTime;
|
14622 |
|
14623 | let newStepValue = (shouldComplete) ? 0.001 : -0.001;
|
14624 | |
14625 |
|
14626 |
|
14627 |
|
14628 |
|
14629 |
|
14630 | const adjustedStepValue = (stepValue < 0) ? 0.01 : stepValue;
|
14631 | |
14632 |
|
14633 |
|
14634 |
|
14635 |
|
14636 |
|
14637 |
|
14638 |
|
14639 | newStepValue += getTimeGivenProgression([0, 0], [0.4, 0], [0.6, 1], [1, 1], clamp(0, adjustedStepValue, 0.9999))[0] || 0;
|
14640 | const playTo = (this._isOpen) ? !shouldComplete : shouldComplete;
|
14641 | this.animation
|
14642 | .easing('cubic-bezier(0.4, 0.0, 0.6, 1)')
|
14643 | .onFinish(() => this.afterAnimation(shouldOpen), { oneTimeCallback: true })
|
14644 | .progressEnd((playTo) ? 1 : 0, (this._isOpen) ? 1 - newStepValue : newStepValue, 300);
|
14645 | }
|
14646 | beforeAnimation(shouldOpen) {
|
14647 | assert(!this.isAnimating, '_before() should not be called while animating');
|
14648 |
|
14649 |
|
14650 | this.el.classList.add(SHOW_MENU);
|
14651 | if (this.backdropEl) {
|
14652 | this.backdropEl.classList.add(SHOW_BACKDROP);
|
14653 | }
|
14654 | this.blocker.block();
|
14655 | this.isAnimating = true;
|
14656 | if (shouldOpen) {
|
14657 | this.ionWillOpen.emit();
|
14658 | }
|
14659 | else {
|
14660 | this.ionWillClose.emit();
|
14661 | }
|
14662 | }
|
14663 | afterAnimation(isOpen) {
|
14664 | assert(this.isAnimating, '_before() should be called while animating');
|
14665 |
|
14666 |
|
14667 |
|
14668 |
|
14669 | this._isOpen = isOpen;
|
14670 | this.isAnimating = false;
|
14671 | if (!this._isOpen) {
|
14672 | this.blocker.unblock();
|
14673 | }
|
14674 | if (isOpen) {
|
14675 |
|
14676 | if (this.contentEl) {
|
14677 | this.contentEl.classList.add(MENU_CONTENT_OPEN);
|
14678 | }
|
14679 |
|
14680 | this.ionDidOpen.emit();
|
14681 | }
|
14682 | else {
|
14683 |
|
14684 | this.el.classList.remove(SHOW_MENU);
|
14685 | if (this.contentEl) {
|
14686 | this.contentEl.classList.remove(MENU_CONTENT_OPEN);
|
14687 | }
|
14688 | if (this.backdropEl) {
|
14689 | this.backdropEl.classList.remove(SHOW_BACKDROP);
|
14690 | }
|
14691 | if (this.animation) {
|
14692 | this.animation.stop();
|
14693 | }
|
14694 |
|
14695 | this.ionDidClose.emit();
|
14696 | }
|
14697 | }
|
14698 | updateState() {
|
14699 | const isActive = this._isActive();
|
14700 | if (this.gesture) {
|
14701 | this.gesture.enable(isActive && this.swipeGesture);
|
14702 | }
|
14703 |
|
14704 | if (!isActive && this._isOpen) {
|
14705 |
|
14706 | this.forceClosing();
|
14707 | }
|
14708 | if (!this.disabled) {
|
14709 | menuController._setActiveMenu(this);
|
14710 | }
|
14711 | assert(!this.isAnimating, 'can not be animating');
|
14712 | }
|
14713 | forceClosing() {
|
14714 | assert(this._isOpen, 'menu cannot be closed');
|
14715 | this.isAnimating = true;
|
14716 | const ani = this.animation.direction('reverse');
|
14717 | ani.play({ sync: true });
|
14718 | this.afterAnimation(false);
|
14719 | }
|
14720 | render() {
|
14721 | const { isEndSide, type, disabled, isPaneVisible } = this;
|
14722 | const mode = getIonMode$1(this);
|
14723 | return (hAsync(Host, { role: "navigation", class: {
|
14724 | [mode]: true,
|
14725 | [`menu-type-${type}`]: true,
|
14726 | 'menu-enabled': !disabled,
|
14727 | 'menu-side-end': isEndSide,
|
14728 | 'menu-side-start': !isEndSide,
|
14729 | 'menu-pane-visible': isPaneVisible
|
14730 | } }, hAsync("div", { class: "menu-inner", part: "container", ref: el => this.menuInnerEl = el }, hAsync("slot", null)), hAsync("ion-backdrop", { ref: el => this.backdropEl = el, class: "menu-backdrop", tappable: false, stopPropagation: false, part: "backdrop" })));
|
14731 | }
|
14732 | get el() { return getElement(this); }
|
14733 | static get watchers() { return {
|
14734 | "type": ["typeChanged"],
|
14735 | "disabled": ["disabledChanged"],
|
14736 | "side": ["sideChanged"],
|
14737 | "swipeGesture": ["swipeGestureChanged"]
|
14738 | }; }
|
14739 | static get style() { return {
|
14740 | ios: menuIosCss,
|
14741 | md: menuMdCss
|
14742 | }; }
|
14743 | static get cmpMeta() { return {
|
14744 | "$flags$": 41,
|
14745 | "$tagName$": "ion-menu",
|
14746 | "$members$": {
|
14747 | "contentId": [513, "content-id"],
|
14748 | "menuId": [513, "menu-id"],
|
14749 | "type": [1025],
|
14750 | "disabled": [1028],
|
14751 | "side": [513],
|
14752 | "swipeGesture": [4, "swipe-gesture"],
|
14753 | "maxEdgeStart": [2, "max-edge-start"],
|
14754 | "isPaneVisible": [32],
|
14755 | "isEndSide": [32],
|
14756 | "isOpen": [64],
|
14757 | "isActive": [64],
|
14758 | "open": [64],
|
14759 | "close": [64],
|
14760 | "toggle": [64],
|
14761 | "setOpen": [64]
|
14762 | },
|
14763 | "$listeners$": [[16, "ionSplitPaneVisible", "onSplitPaneChanged"], [2, "click", "onBackdropClick"]],
|
14764 | "$lazyBundleId$": "-",
|
14765 | "$attrsToReflect$": [["contentId", "content-id"], ["menuId", "menu-id"], ["side", "side"]]
|
14766 | }; }
|
14767 | }
|
14768 | const computeDelta = (deltaX, isOpen, isEndSide) => {
|
14769 | return Math.max(0, isOpen !== isEndSide ? -deltaX : deltaX);
|
14770 | };
|
14771 | const checkEdgeSide = (win, posX, isEndSide, maxEdgeStart) => {
|
14772 | if (isEndSide) {
|
14773 | return posX >= win.innerWidth - maxEdgeStart;
|
14774 | }
|
14775 | else {
|
14776 | return posX <= maxEdgeStart;
|
14777 | }
|
14778 | };
|
14779 | const SHOW_MENU = 'show-menu';
|
14780 | const SHOW_BACKDROP = 'show-backdrop';
|
14781 | const MENU_CONTENT_OPEN = 'menu-content-open';
|
14782 |
|
14783 |
|
14784 | const updateVisibility = async (menu) => {
|
14785 | const menuEl = await menuController.get(menu);
|
14786 | return !!(menuEl && await menuEl.isActive());
|
14787 | };
|
14788 |
|
14789 | const menuButtonIosCss = "/*!@:host*/.sc-ion-menu-button-ios-h{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}/*!@.button-native*/.button-native.sc-ion-menu-button-ios{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-menu-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-inner*/.button-inner.sc-ion-menu-button-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@ion-icon*/ion-icon.sc-ion-menu-button-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}/*!@:host(.menu-button-hidden)*/.menu-button-hidden.sc-ion-menu-button-ios-h{display:none}/*!@:host(.menu-button-disabled)*/.menu-button-disabled.sc-ion-menu-button-ios-h{cursor:default;opacity:0.5;pointer-events:none}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-menu-button-ios-h .button-native.sc-ion-menu-button-ios{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-menu-button-ios-h .button-native.sc-ion-menu-button-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@.button-native::after*/.button-native.sc-ion-menu-button-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-menu-button-ios-h:hover .button-native.sc-ion-menu-button-ios{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-menu-button-ios-h:hover .button-native.sc-ion-menu-button-ios::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}/*!@:host(.ion-color) .button-native*/.ion-color.sc-ion-menu-button-ios-h .button-native.sc-ion-menu-button-ios{color:var(--ion-color-base)}/*!@:host(.in-toolbar:not(.in-toolbar-color))*/.in-toolbar.sc-ion-menu-button-ios-h:not(.in-toolbar-color){color:var(--ion-toolbar-color, var(--color))}/*!@:host*/.sc-ion-menu-button-ios-h{--background-focused:currentColor;--background-focused-opacity:.1;--border-radius:4px;--color:var(--ion-color-primary, #3880ff);--padding-start:5px;--padding-end:5px;height:32px;font-size:31px}/*!@:host(.ion-activated)*/.ion-activated.sc-ion-menu-button-ios-h{opacity:0.4}@media (any-hover: hover){/*!@:host(:hover)*/.sc-ion-menu-button-ios-h:hover{opacity:0.6}}";
|
14790 |
|
14791 | const menuButtonMdCss = "/*!@:host*/.sc-ion-menu-button-md-h{--background:transparent;--color-focused:currentColor;--border-radius:initial;--padding-top:0;--padding-bottom:0;color:var(--color);text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:none;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none}/*!@.button-native*/.button-native.sc-ion-menu-button-md{border-radius:var(--border-radius);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;border:0;outline:none;background:var(--background);line-height:1;cursor:pointer;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-menu-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-inner*/.button-inner.sc-ion-menu-button-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@ion-icon*/ion-icon.sc-ion-menu-button-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;pointer-events:none}/*!@:host(.menu-button-hidden)*/.menu-button-hidden.sc-ion-menu-button-md-h{display:none}/*!@:host(.menu-button-disabled)*/.menu-button-disabled.sc-ion-menu-button-md-h{cursor:default;opacity:0.5;pointer-events:none}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-menu-button-md-h .button-native.sc-ion-menu-button-md{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-menu-button-md-h .button-native.sc-ion-menu-button-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@.button-native::after*/.button-native.sc-ion-menu-button-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-menu-button-md-h:hover .button-native.sc-ion-menu-button-md{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-menu-button-md-h:hover .button-native.sc-ion-menu-button-md::after{background:var(--background-hover);opacity:var(--background-hover-opacity, 0)}}/*!@:host(.ion-color) .button-native*/.ion-color.sc-ion-menu-button-md-h .button-native.sc-ion-menu-button-md{color:var(--ion-color-base)}/*!@:host(.in-toolbar:not(.in-toolbar-color))*/.in-toolbar.sc-ion-menu-button-md-h:not(.in-toolbar-color){color:var(--ion-toolbar-color, var(--color))}/*!@:host*/.sc-ion-menu-button-md-h{--background-focused:currentColor;--background-focused-opacity:.12;--background-hover:currentColor;--background-hover-opacity:.04;--border-radius:50%;--color:initial;--padding-start:8px;--padding-end:8px;width:48px;height:48px;font-size:24px}/*!@:host(.ion-color.ion-focused)::after*/.ion-color.ion-focused.sc-ion-menu-button-md-h::after{background:var(--ion-color-base)}@media (any-hover: hover){/*!@:host(.ion-color:hover) .button-native::after*/.ion-color.sc-ion-menu-button-md-h:hover .button-native.sc-ion-menu-button-md::after{background:var(--ion-color-base)}}";
|
14792 |
|
14793 |
|
14794 |
|
14795 |
|
14796 |
|
14797 |
|
14798 |
|
14799 | class MenuButton {
|
14800 | constructor(hostRef) {
|
14801 | registerInstance(this, hostRef);
|
14802 | this.inheritedAttributes = {};
|
14803 | this.visible = false;
|
14804 | |
14805 |
|
14806 |
|
14807 | this.disabled = false;
|
14808 | |
14809 |
|
14810 |
|
14811 | this.autoHide = true;
|
14812 | |
14813 |
|
14814 |
|
14815 | this.type = 'button';
|
14816 | this.onClick = async () => {
|
14817 | return menuController.toggle(this.menu);
|
14818 | };
|
14819 | }
|
14820 | componentWillLoad() {
|
14821 | this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
14822 | }
|
14823 | componentDidLoad() {
|
14824 | this.visibilityChanged();
|
14825 | }
|
14826 | async visibilityChanged() {
|
14827 | this.visible = await updateVisibility(this.menu);
|
14828 | }
|
14829 | render() {
|
14830 | const { color, disabled, inheritedAttributes } = this;
|
14831 | const mode = getIonMode$1(this);
|
14832 | const menuIcon = config.get('menuIcon', mode === 'ios' ? 'menu-outline' : 'menu-sharp');
|
14833 | const hidden = this.autoHide && !this.visible;
|
14834 | const attrs = {
|
14835 | type: this.type
|
14836 | };
|
14837 | const ariaLabel = inheritedAttributes['aria-label'] || 'menu';
|
14838 | return (hAsync(Host, { onClick: this.onClick, "aria-disabled": disabled ? 'true' : null, "aria-hidden": hidden ? 'true' : null, class: createColorClasses$1(color, {
|
14839 | [mode]: true,
|
14840 | 'button': true,
|
14841 | 'menu-button-hidden': hidden,
|
14842 | 'menu-button-disabled': disabled,
|
14843 | 'in-toolbar': hostContext('ion-toolbar', this.el),
|
14844 | 'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
14845 | 'ion-activatable': true,
|
14846 | 'ion-focusable': true
|
14847 | }) }, hAsync("button", Object.assign({}, attrs, { disabled: disabled, class: "button-native", part: "native", "aria-label": ariaLabel }), hAsync("span", { class: "button-inner" }, hAsync("slot", null, hAsync("ion-icon", { part: "icon", icon: menuIcon, mode: mode, lazy: false, "aria-hidden": "true" }))), mode === 'md' && hAsync("ion-ripple-effect", { type: "unbounded" }))));
|
14848 | }
|
14849 | get el() { return getElement(this); }
|
14850 | static get style() { return {
|
14851 | ios: menuButtonIosCss,
|
14852 | md: menuButtonMdCss
|
14853 | }; }
|
14854 | static get cmpMeta() { return {
|
14855 | "$flags$": 41,
|
14856 | "$tagName$": "ion-menu-button",
|
14857 | "$members$": {
|
14858 | "color": [513],
|
14859 | "disabled": [4],
|
14860 | "menu": [1],
|
14861 | "autoHide": [4, "auto-hide"],
|
14862 | "type": [1],
|
14863 | "visible": [32]
|
14864 | },
|
14865 | "$listeners$": [[16, "ionMenuChange", "visibilityChanged"], [16, "ionSplitPaneVisible", "visibilityChanged"]],
|
14866 | "$lazyBundleId$": "-",
|
14867 | "$attrsToReflect$": [["color", "color"]]
|
14868 | }; }
|
14869 | }
|
14870 |
|
14871 | const menuToggleCss = "/*!@:host(.menu-toggle-hidden)*/.menu-toggle-hidden.sc-ion-menu-toggle-h{display:none}";
|
14872 |
|
14873 | class MenuToggle {
|
14874 | constructor(hostRef) {
|
14875 | registerInstance(this, hostRef);
|
14876 | this.visible = false;
|
14877 | |
14878 |
|
14879 |
|
14880 |
|
14881 |
|
14882 |
|
14883 | this.autoHide = true;
|
14884 | this.onClick = () => {
|
14885 | return menuController.toggle(this.menu);
|
14886 | };
|
14887 | }
|
14888 | connectedCallback() {
|
14889 | this.visibilityChanged();
|
14890 | }
|
14891 | async visibilityChanged() {
|
14892 | this.visible = await updateVisibility(this.menu);
|
14893 | }
|
14894 | render() {
|
14895 | const mode = getIonMode$1(this);
|
14896 | const hidden = this.autoHide && !this.visible;
|
14897 | return (hAsync(Host, { onClick: this.onClick, "aria-hidden": hidden ? 'true' : null, class: {
|
14898 | [mode]: true,
|
14899 | 'menu-toggle-hidden': hidden,
|
14900 | } }, hAsync("slot", null)));
|
14901 | }
|
14902 | static get style() { return menuToggleCss; }
|
14903 | static get cmpMeta() { return {
|
14904 | "$flags$": 9,
|
14905 | "$tagName$": "ion-menu-toggle",
|
14906 | "$members$": {
|
14907 | "menu": [1],
|
14908 | "autoHide": [4, "auto-hide"],
|
14909 | "visible": [32]
|
14910 | },
|
14911 | "$listeners$": [[16, "ionMenuChange", "visibilityChanged"], [16, "ionSplitPaneVisible", "visibilityChanged"]],
|
14912 | "$lazyBundleId$": "-",
|
14913 | "$attrsToReflect$": []
|
14914 | }; }
|
14915 | }
|
14916 |
|
14917 | const attachComponent = async (delegate, container, component, cssClasses, componentProps) => {
|
14918 | if (delegate) {
|
14919 | return delegate.attachViewToDom(container, component, componentProps, cssClasses);
|
14920 | }
|
14921 | if (typeof component !== 'string' && !(component instanceof HTMLElement)) {
|
14922 | throw new Error('framework delegate is missing');
|
14923 | }
|
14924 | const el = (typeof component === 'string')
|
14925 | ? container.ownerDocument && container.ownerDocument.createElement(component)
|
14926 | : component;
|
14927 | if (cssClasses) {
|
14928 | cssClasses.forEach(c => el.classList.add(c));
|
14929 | }
|
14930 | if (componentProps) {
|
14931 | Object.assign(el, componentProps);
|
14932 | }
|
14933 | container.appendChild(el);
|
14934 | await new Promise(resolve => componentOnReady(el, resolve));
|
14935 | return el;
|
14936 | };
|
14937 | const detachComponent = (delegate, element) => {
|
14938 | if (element) {
|
14939 | if (delegate) {
|
14940 | const container = element.parentElement;
|
14941 | return delegate.removeViewFromDom(container, element);
|
14942 | }
|
14943 | element.remove();
|
14944 | }
|
14945 | return Promise.resolve();
|
14946 | };
|
14947 |
|
14948 | const LIFECYCLE_WILL_ENTER = 'ionViewWillEnter';
|
14949 | const LIFECYCLE_DID_ENTER = 'ionViewDidEnter';
|
14950 | const LIFECYCLE_WILL_LEAVE = 'ionViewWillLeave';
|
14951 | const LIFECYCLE_DID_LEAVE = 'ionViewDidLeave';
|
14952 | const LIFECYCLE_WILL_UNLOAD = 'ionViewWillUnload';
|
14953 |
|
14954 | const iosTransitionAnimation$1 = () => Promise.resolve().then(function () { return ios_transition; });
|
14955 | const mdTransitionAnimation$1 = () => Promise.resolve().then(function () { return md_transition; });
|
14956 | const transition$2 = (opts) => {
|
14957 | return new Promise((resolve, reject) => {
|
14958 | writeTask(() => {
|
14959 | beforeTransition(opts);
|
14960 | runTransition(opts).then(result => {
|
14961 | if (result.animation) {
|
14962 | result.animation.destroy();
|
14963 | }
|
14964 | afterTransition(opts);
|
14965 | resolve(result);
|
14966 | }, error => {
|
14967 | afterTransition(opts);
|
14968 | reject(error);
|
14969 | });
|
14970 | });
|
14971 | });
|
14972 | };
|
14973 | const beforeTransition = (opts) => {
|
14974 | const enteringEl = opts.enteringEl;
|
14975 | const leavingEl = opts.leavingEl;
|
14976 | setZIndex(enteringEl, leavingEl, opts.direction);
|
14977 | if (opts.showGoBack) {
|
14978 | enteringEl.classList.add('can-go-back');
|
14979 | }
|
14980 | else {
|
14981 | enteringEl.classList.remove('can-go-back');
|
14982 | }
|
14983 | setPageHidden(enteringEl, false);
|
14984 | |
14985 |
|
14986 |
|
14987 |
|
14988 |
|
14989 |
|
14990 | enteringEl.style.setProperty('pointer-events', 'none');
|
14991 | if (leavingEl) {
|
14992 | setPageHidden(leavingEl, false);
|
14993 | leavingEl.style.setProperty('pointer-events', 'none');
|
14994 | }
|
14995 | };
|
14996 | const runTransition = async (opts) => {
|
14997 | const animationBuilder = await getAnimationBuilder(opts);
|
14998 | const ani = (animationBuilder && Build.isBrowser)
|
14999 | ? animation(animationBuilder, opts)
|
15000 | : noAnimation(opts);
|
15001 | return ani;
|
15002 | };
|
15003 | const afterTransition = (opts) => {
|
15004 | const enteringEl = opts.enteringEl;
|
15005 | const leavingEl = opts.leavingEl;
|
15006 | enteringEl.classList.remove('ion-page-invisible');
|
15007 | enteringEl.style.removeProperty('pointer-events');
|
15008 | if (leavingEl !== undefined) {
|
15009 | leavingEl.classList.remove('ion-page-invisible');
|
15010 | leavingEl.style.removeProperty('pointer-events');
|
15011 | }
|
15012 | };
|
15013 | const getAnimationBuilder = async (opts) => {
|
15014 | if (!opts.leavingEl || !opts.animated || opts.duration === 0) {
|
15015 | return undefined;
|
15016 | }
|
15017 | if (opts.animationBuilder) {
|
15018 | return opts.animationBuilder;
|
15019 | }
|
15020 | const getAnimation = (opts.mode === 'ios')
|
15021 | ? (await iosTransitionAnimation$1()).iosTransitionAnimation
|
15022 | : (await mdTransitionAnimation$1()).mdTransitionAnimation;
|
15023 | return getAnimation;
|
15024 | };
|
15025 | const animation = async (animationBuilder, opts) => {
|
15026 | await waitForReady(opts, true);
|
15027 | const trans = animationBuilder(opts.baseEl, opts);
|
15028 | fireWillEvents(opts.enteringEl, opts.leavingEl);
|
15029 | const didComplete = await playTransition(trans, opts);
|
15030 | if (opts.progressCallback) {
|
15031 | opts.progressCallback(undefined);
|
15032 | }
|
15033 | if (didComplete) {
|
15034 | fireDidEvents(opts.enteringEl, opts.leavingEl);
|
15035 | }
|
15036 | return {
|
15037 | hasCompleted: didComplete,
|
15038 | animation: trans
|
15039 | };
|
15040 | };
|
15041 | const noAnimation = async (opts) => {
|
15042 | const enteringEl = opts.enteringEl;
|
15043 | const leavingEl = opts.leavingEl;
|
15044 | await waitForReady(opts, false);
|
15045 | fireWillEvents(enteringEl, leavingEl);
|
15046 | fireDidEvents(enteringEl, leavingEl);
|
15047 | return {
|
15048 | hasCompleted: true
|
15049 | };
|
15050 | };
|
15051 | const waitForReady = async (opts, defaultDeep) => {
|
15052 | const deep = opts.deepWait !== undefined ? opts.deepWait : defaultDeep;
|
15053 | const promises = deep ? [
|
15054 | deepReady(opts.enteringEl),
|
15055 | deepReady(opts.leavingEl),
|
15056 | ] : [
|
15057 | shallowReady(opts.enteringEl),
|
15058 | shallowReady(opts.leavingEl),
|
15059 | ];
|
15060 | await Promise.all(promises);
|
15061 | await notifyViewReady(opts.viewIsReady, opts.enteringEl);
|
15062 | };
|
15063 | const notifyViewReady = async (viewIsReady, enteringEl) => {
|
15064 | if (viewIsReady) {
|
15065 | await viewIsReady(enteringEl);
|
15066 | }
|
15067 | };
|
15068 | const playTransition = (trans, opts) => {
|
15069 | const progressCallback = opts.progressCallback;
|
15070 | const promise = new Promise(resolve => {
|
15071 | trans.onFinish((currentStep) => resolve(currentStep === 1));
|
15072 | });
|
15073 |
|
15074 | if (progressCallback) {
|
15075 |
|
15076 |
|
15077 | trans.progressStart(true);
|
15078 | progressCallback(trans);
|
15079 | }
|
15080 | else {
|
15081 |
|
15082 |
|
15083 |
|
15084 | trans.play();
|
15085 | }
|
15086 |
|
15087 | return promise;
|
15088 | };
|
15089 | const fireWillEvents = (enteringEl, leavingEl) => {
|
15090 | lifecycle(leavingEl, LIFECYCLE_WILL_LEAVE);
|
15091 | lifecycle(enteringEl, LIFECYCLE_WILL_ENTER);
|
15092 | };
|
15093 | const fireDidEvents = (enteringEl, leavingEl) => {
|
15094 | lifecycle(enteringEl, LIFECYCLE_DID_ENTER);
|
15095 | lifecycle(leavingEl, LIFECYCLE_DID_LEAVE);
|
15096 | };
|
15097 | const lifecycle = (el, eventName) => {
|
15098 | if (el) {
|
15099 | const ev = new CustomEvent(eventName, {
|
15100 | bubbles: false,
|
15101 | cancelable: false,
|
15102 | });
|
15103 | el.dispatchEvent(ev);
|
15104 | }
|
15105 | };
|
15106 | const shallowReady = (el) => {
|
15107 | if (el) {
|
15108 | return new Promise(resolve => componentOnReady(el, resolve));
|
15109 | }
|
15110 | return Promise.resolve();
|
15111 | };
|
15112 | const deepReady = async (el) => {
|
15113 | const element = el;
|
15114 | if (element) {
|
15115 | if (element.componentOnReady != null) {
|
15116 | const stencilEl = await element.componentOnReady();
|
15117 | if (stencilEl != null) {
|
15118 | return;
|
15119 | }
|
15120 | }
|
15121 | await Promise.all(Array.from(element.children).map(deepReady));
|
15122 | }
|
15123 | };
|
15124 | const setPageHidden = (el, hidden) => {
|
15125 | if (hidden) {
|
15126 | el.setAttribute('aria-hidden', 'true');
|
15127 | el.classList.add('ion-page-hidden');
|
15128 | }
|
15129 | else {
|
15130 | el.hidden = false;
|
15131 | el.removeAttribute('aria-hidden');
|
15132 | el.classList.remove('ion-page-hidden');
|
15133 | }
|
15134 | };
|
15135 | const setZIndex = (enteringEl, leavingEl, direction) => {
|
15136 | if (enteringEl !== undefined) {
|
15137 | enteringEl.style.zIndex = (direction === 'back')
|
15138 | ? '99'
|
15139 | : '101';
|
15140 | }
|
15141 | if (leavingEl !== undefined) {
|
15142 | leavingEl.style.zIndex = '100';
|
15143 | }
|
15144 | };
|
15145 | const getIonPageElement = (element) => {
|
15146 | if (element.classList.contains('ion-page')) {
|
15147 | return element;
|
15148 | }
|
15149 | const ionPage = element.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs');
|
15150 | if (ionPage) {
|
15151 | return ionPage;
|
15152 | }
|
15153 |
|
15154 | return element;
|
15155 | };
|
15156 |
|
15157 |
|
15158 | const SwipeToCloseDefaults = {
|
15159 | MIN_PRESENTING_SCALE: 0.93,
|
15160 | };
|
15161 | const createSwipeToCloseGesture = (el, animation, onDismiss) => {
|
15162 | const height = el.offsetHeight;
|
15163 | let isOpen = false;
|
15164 | const canStart = (detail) => {
|
15165 | const target = detail.event.target;
|
15166 | if (target === null ||
|
15167 | !target.closest) {
|
15168 | return true;
|
15169 | }
|
15170 | const contentOrFooter = target.closest('ion-content, ion-footer');
|
15171 | if (contentOrFooter === null) {
|
15172 | return true;
|
15173 | }
|
15174 |
|
15175 |
|
15176 |
|
15177 | return false;
|
15178 | };
|
15179 | const onStart = () => {
|
15180 | animation.progressStart(true, (isOpen) ? 1 : 0);
|
15181 | };
|
15182 | const onMove = (detail) => {
|
15183 | const step = clamp(0.0001, detail.deltaY / height, 0.9999);
|
15184 | animation.progressStep(step);
|
15185 | };
|
15186 | const onEnd = (detail) => {
|
15187 | const velocity = detail.velocityY;
|
15188 | const step = clamp(0.0001, detail.deltaY / height, 0.9999);
|
15189 | const threshold = (detail.deltaY + velocity * 1000) / height;
|
15190 | const shouldComplete = threshold >= 0.5;
|
15191 | let newStepValue = (shouldComplete) ? -0.001 : 0.001;
|
15192 | if (!shouldComplete) {
|
15193 | animation.easing('cubic-bezier(1, 0, 0.68, 0.28)');
|
15194 | newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], step)[0];
|
15195 | }
|
15196 | else {
|
15197 | animation.easing('cubic-bezier(0.32, 0.72, 0, 1)');
|
15198 | newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], step)[0];
|
15199 | }
|
15200 | const duration = (shouldComplete) ? computeDuration(step * height, velocity) : computeDuration((1 - step) * height, velocity);
|
15201 | isOpen = shouldComplete;
|
15202 | gesture.enable(false);
|
15203 | animation
|
15204 | .onFinish(() => {
|
15205 | if (!shouldComplete) {
|
15206 | gesture.enable(true);
|
15207 | }
|
15208 | })
|
15209 | .progressEnd((shouldComplete) ? 1 : 0, newStepValue, duration);
|
15210 | if (shouldComplete) {
|
15211 | onDismiss();
|
15212 | }
|
15213 | };
|
15214 | const gesture = createGesture({
|
15215 | el,
|
15216 | gestureName: 'modalSwipeToClose',
|
15217 | gesturePriority: 40,
|
15218 | direction: 'y',
|
15219 | threshold: 10,
|
15220 | canStart,
|
15221 | onStart,
|
15222 | onMove,
|
15223 | onEnd
|
15224 | });
|
15225 | return gesture;
|
15226 | };
|
15227 | const computeDuration = (remaining, velocity) => {
|
15228 | return clamp(400, remaining / Math.abs(velocity * 1.1), 500);
|
15229 | };
|
15230 |
|
15231 |
|
15232 |
|
15233 |
|
15234 | const iosEnterAnimation$3 = (baseEl, presentingEl) => {
|
15235 | const backdropAnimation = createAnimation()
|
15236 | .addElement(baseEl.querySelector('ion-backdrop'))
|
15237 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
15238 | .beforeStyles({
|
15239 | 'pointer-events': 'none'
|
15240 | })
|
15241 | .afterClearStyles(['pointer-events']);
|
15242 | const wrapperAnimation = createAnimation()
|
15243 | .addElement(baseEl.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
15244 | .beforeStyles({ 'opacity': 1 })
|
15245 | .fromTo('transform', 'translateY(100vh)', 'translateY(0vh)');
|
15246 | const baseAnimation = createAnimation()
|
15247 | .addElement(baseEl)
|
15248 | .easing('cubic-bezier(0.32,0.72,0,1)')
|
15249 | .duration(500)
|
15250 | .addAnimation(wrapperAnimation);
|
15251 | if (presentingEl) {
|
15252 | const isMobile = window.innerWidth < 768;
|
15253 | const hasCardModal = (presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined);
|
15254 | const presentingAnimation = createAnimation()
|
15255 | .beforeStyles({
|
15256 | 'transform': 'translateY(0)',
|
15257 | 'transform-origin': 'top center',
|
15258 | 'overflow': 'hidden'
|
15259 | });
|
15260 | const bodyEl = document.body;
|
15261 | if (isMobile) {
|
15262 | |
15263 |
|
15264 |
|
15265 |
|
15266 |
|
15267 | const transformOffset = (!CSS.supports('width', 'max(0px, 1px)')) ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
15268 | const modalTransform = hasCardModal ? '-10px' : transformOffset;
|
15269 | const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
15270 | const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
|
15271 | presentingAnimation
|
15272 | .afterStyles({
|
15273 | 'transform': finalTransform
|
15274 | })
|
15275 | .beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))
|
15276 | .addElement(presentingEl)
|
15277 | .keyframes([
|
15278 | { offset: 0, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },
|
15279 | { offset: 1, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' }
|
15280 | ]);
|
15281 | baseAnimation.addAnimation(presentingAnimation);
|
15282 | }
|
15283 | else {
|
15284 | baseAnimation.addAnimation(backdropAnimation);
|
15285 | if (!hasCardModal) {
|
15286 | wrapperAnimation.fromTo('opacity', '0', '1');
|
15287 | }
|
15288 | else {
|
15289 | const toPresentingScale = (hasCardModal) ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;
|
15290 | const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
15291 | presentingAnimation
|
15292 | .afterStyles({
|
15293 | 'transform': finalTransform
|
15294 | })
|
15295 | .addElement(presentingEl.querySelector('.modal-wrapper'))
|
15296 | .keyframes([
|
15297 | { offset: 0, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },
|
15298 | { offset: 1, filter: 'contrast(0.85)', transform: finalTransform }
|
15299 | ]);
|
15300 | const shadowAnimation = createAnimation()
|
15301 | .afterStyles({
|
15302 | 'transform': finalTransform
|
15303 | })
|
15304 | .addElement(presentingEl.querySelector('.modal-shadow'))
|
15305 | .keyframes([
|
15306 | { offset: 0, opacity: '1', transform: 'translateY(0) scale(1)' },
|
15307 | { offset: 1, opacity: '0', transform: finalTransform }
|
15308 | ]);
|
15309 | baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
15310 | }
|
15311 | }
|
15312 | }
|
15313 | else {
|
15314 | baseAnimation.addAnimation(backdropAnimation);
|
15315 | }
|
15316 | return baseAnimation;
|
15317 | };
|
15318 |
|
15319 |
|
15320 |
|
15321 |
|
15322 | const iosLeaveAnimation$3 = (baseEl, presentingEl, duration = 500) => {
|
15323 | const backdropAnimation = createAnimation()
|
15324 | .addElement(baseEl.querySelector('ion-backdrop'))
|
15325 | .fromTo('opacity', 'var(--backdrop-opacity)', 0.0);
|
15326 | const wrapperAnimation = createAnimation()
|
15327 | .addElement(baseEl.querySelectorAll('.modal-wrapper, .modal-shadow'))
|
15328 | .beforeStyles({ 'opacity': 1 })
|
15329 | .fromTo('transform', 'translateY(0vh)', 'translateY(100vh)');
|
15330 | const baseAnimation = createAnimation()
|
15331 | .addElement(baseEl)
|
15332 | .easing('cubic-bezier(0.32,0.72,0,1)')
|
15333 | .duration(duration)
|
15334 | .addAnimation(wrapperAnimation);
|
15335 | if (presentingEl) {
|
15336 | const isMobile = window.innerWidth < 768;
|
15337 | const hasCardModal = (presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined);
|
15338 | const presentingAnimation = createAnimation()
|
15339 | .beforeClearStyles(['transform'])
|
15340 | .afterClearStyles(['transform'])
|
15341 | .onFinish(currentStep => {
|
15342 |
|
15343 | if (currentStep !== 1) {
|
15344 | return;
|
15345 | }
|
15346 | presentingEl.style.setProperty('overflow', '');
|
15347 | const numModals = Array.from(bodyEl.querySelectorAll('ion-modal')).filter(m => m.presentingElement !== undefined).length;
|
15348 | if (numModals <= 1) {
|
15349 | bodyEl.style.setProperty('background-color', '');
|
15350 | }
|
15351 | });
|
15352 | const bodyEl = document.body;
|
15353 | if (isMobile) {
|
15354 | const transformOffset = (!CSS.supports('width', 'max(0px, 1px)')) ? '30px' : 'max(30px, var(--ion-safe-area-top))';
|
15355 | const modalTransform = hasCardModal ? '-10px' : transformOffset;
|
15356 | const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
|
15357 | const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
|
15358 | presentingAnimation
|
15359 | .addElement(presentingEl)
|
15360 | .keyframes([
|
15361 | { offset: 0, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },
|
15362 | { offset: 1, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' }
|
15363 | ]);
|
15364 | baseAnimation.addAnimation(presentingAnimation);
|
15365 | }
|
15366 | else {
|
15367 | baseAnimation.addAnimation(backdropAnimation);
|
15368 | if (!hasCardModal) {
|
15369 | wrapperAnimation.fromTo('opacity', '1', '0');
|
15370 | }
|
15371 | else {
|
15372 | const toPresentingScale = (hasCardModal) ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;
|
15373 | const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;
|
15374 | presentingAnimation
|
15375 | .addElement(presentingEl.querySelector('.modal-wrapper'))
|
15376 | .afterStyles({
|
15377 | 'transform': 'translate3d(0, 0, 0)'
|
15378 | })
|
15379 | .keyframes([
|
15380 | { offset: 0, filter: 'contrast(0.85)', transform: finalTransform },
|
15381 | { offset: 1, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' }
|
15382 | ]);
|
15383 | const shadowAnimation = createAnimation()
|
15384 | .addElement(presentingEl.querySelector('.modal-shadow'))
|
15385 | .afterStyles({
|
15386 | 'transform': 'translateY(0) scale(1)'
|
15387 | })
|
15388 | .keyframes([
|
15389 | { offset: 0, opacity: '0', transform: finalTransform },
|
15390 | { offset: 1, opacity: '1', transform: 'translateY(0) scale(1)' }
|
15391 | ]);
|
15392 | baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
|
15393 | }
|
15394 | }
|
15395 | }
|
15396 | else {
|
15397 | baseAnimation.addAnimation(backdropAnimation);
|
15398 | }
|
15399 | return baseAnimation;
|
15400 | };
|
15401 |
|
15402 |
|
15403 |
|
15404 |
|
15405 | const mdEnterAnimation$2 = (baseEl) => {
|
15406 | const baseAnimation = createAnimation();
|
15407 | const backdropAnimation = createAnimation();
|
15408 | const wrapperAnimation = createAnimation();
|
15409 | backdropAnimation
|
15410 | .addElement(baseEl.querySelector('ion-backdrop'))
|
15411 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
15412 | .beforeStyles({
|
15413 | 'pointer-events': 'none'
|
15414 | })
|
15415 | .afterClearStyles(['pointer-events']);
|
15416 | wrapperAnimation
|
15417 | .addElement(baseEl.querySelector('.modal-wrapper'))
|
15418 | .keyframes([
|
15419 | { offset: 0, opacity: 0.01, transform: 'translateY(40px)' },
|
15420 | { offset: 1, opacity: 1, transform: 'translateY(0px)' }
|
15421 | ]);
|
15422 | return baseAnimation
|
15423 | .addElement(baseEl)
|
15424 | .easing('cubic-bezier(0.36,0.66,0.04,1)')
|
15425 | .duration(280)
|
15426 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
15427 | };
|
15428 |
|
15429 |
|
15430 |
|
15431 |
|
15432 | const mdLeaveAnimation$2 = (baseEl) => {
|
15433 | const baseAnimation = createAnimation();
|
15434 | const backdropAnimation = createAnimation();
|
15435 | const wrapperAnimation = createAnimation();
|
15436 | const wrapperEl = baseEl.querySelector('.modal-wrapper');
|
15437 | backdropAnimation
|
15438 | .addElement(baseEl.querySelector('ion-backdrop'))
|
15439 | .fromTo('opacity', 'var(--backdrop-opacity)', 0.0);
|
15440 | wrapperAnimation
|
15441 | .addElement(wrapperEl)
|
15442 | .keyframes([
|
15443 | { offset: 0, opacity: 0.99, transform: 'translateY(0px)' },
|
15444 | { offset: 1, opacity: 0, transform: 'translateY(40px)' }
|
15445 | ]);
|
15446 | return baseAnimation
|
15447 | .addElement(baseEl)
|
15448 | .easing('cubic-bezier(0.47,0,0.745,0.715)')
|
15449 | .duration(200)
|
15450 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
15451 | };
|
15452 |
|
15453 | const modalIosCss = ".sc-ion-modal-ios-h{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.overlay-hidden.sc-ion-modal-ios-h{display:none}.modal-wrapper.sc-ion-modal-ios,.modal-shadow.sc-ion-modal-ios{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow.sc-ion-modal-ios{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){.sc-ion-modal-ios-h{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){.sc-ion-modal-ios-h{--width:600px;--height:600px}}.sc-ion-modal-ios-h:first-of-type{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}@media only screen and (min-width: 768px) and (min-height: 600px){.sc-ion-modal-ios-h{--border-radius:10px}}.modal-wrapper.sc-ion-modal-ios{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: max(0px, 1px)){.modal-card.sc-ion-modal-ios-h{--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: max(0px, 1px)){.modal-card.sc-ion-modal-ios-h{--height:calc(100% - 40px)}}.modal-card.sc-ion-modal-ios-h .modal-wrapper.sc-ion-modal-ios{border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:0;border-bottom-left-radius:0}[dir=rtl].sc-ion-modal-ios-h -no-combinator.modal-card.sc-ion-modal-ios-h .modal-wrapper.sc-ion-modal-ios,[dir=rtl] .sc-ion-modal-ios-h -no-combinator.modal-card.sc-ion-modal-ios-h .modal-wrapper.sc-ion-modal-ios,[dir=rtl].modal-card.sc-ion-modal-ios-h .modal-wrapper.sc-ion-modal-ios,[dir=rtl] .modal-card.sc-ion-modal-ios-h .modal-wrapper.sc-ion-modal-ios{border-top-left-radius:10px;border-top-right-radius:10px;border-bottom-right-radius:0;border-bottom-left-radius:0}.modal-card.sc-ion-modal-ios-h{--backdrop-opacity:0;--width:100%;-ms-flex-align:end;align-items:flex-end}.modal-card.sc-ion-modal-ios-h .modal-shadow.sc-ion-modal-ios{display:none}.modal-card.sc-ion-modal-ios-h ion-backdrop.sc-ion-modal-ios{pointer-events:none}}@media screen and (min-width: 768px){.modal-card.sc-ion-modal-ios-h{--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px}.modal-card.sc-ion-modal-ios-h{--backdrop-opacity:0;-webkit-transition:all 0.5s ease-in-out;transition:all 0.5s ease-in-out}.modal-card.sc-ion-modal-ios-h:first-of-type{--backdrop-opacity:0.18}.modal-card.sc-ion-modal-ios-h .modal-shadow.sc-ion-modal-ios{-webkit-box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1)}}";
|
15454 |
|
15455 | const modalMdCss = ".sc-ion-modal-md-h{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;contain:strict}.overlay-hidden.sc-ion-modal-md-h{display:none}.modal-wrapper.sc-ion-modal-md,.modal-shadow.sc-ion-modal-md{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow.sc-ion-modal-md{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){.sc-ion-modal-md-h{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){.sc-ion-modal-md-h{--width:600px;--height:600px}}.sc-ion-modal-md-h:first-of-type{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){.sc-ion-modal-md-h{--border-radius:2px}.sc-ion-modal-md-h:first-of-type{--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper.sc-ion-modal-md{-webkit-transform:translate3d(0, 40px, 0);transform:translate3d(0, 40px, 0);opacity:0.01}";
|
15456 |
|
15457 |
|
15458 |
|
15459 |
|
15460 | class Modal {
|
15461 | constructor(hostRef) {
|
15462 | registerInstance(this, hostRef);
|
15463 | this.didPresent = createEvent(this, "ionModalDidPresent", 7);
|
15464 | this.willPresent = createEvent(this, "ionModalWillPresent", 7);
|
15465 | this.willDismiss = createEvent(this, "ionModalWillDismiss", 7);
|
15466 | this.didDismiss = createEvent(this, "ionModalDidDismiss", 7);
|
15467 |
|
15468 | this.gestureAnimationDismissing = false;
|
15469 | this.presented = false;
|
15470 | |
15471 |
|
15472 |
|
15473 | this.keyboardClose = true;
|
15474 | |
15475 |
|
15476 |
|
15477 | this.backdropDismiss = true;
|
15478 | |
15479 |
|
15480 |
|
15481 | this.showBackdrop = true;
|
15482 | |
15483 |
|
15484 |
|
15485 | this.animated = true;
|
15486 | |
15487 |
|
15488 |
|
15489 | this.swipeToClose = false;
|
15490 | this.onBackdropTap = () => {
|
15491 | this.dismiss(undefined, BACKDROP);
|
15492 | };
|
15493 | this.onDismiss = (ev) => {
|
15494 | ev.stopPropagation();
|
15495 | ev.preventDefault();
|
15496 | this.dismiss();
|
15497 | };
|
15498 | this.onLifecycle = (modalEvent) => {
|
15499 | const el = this.usersElement;
|
15500 | const name = LIFECYCLE_MAP$1[modalEvent.type];
|
15501 | if (el && name) {
|
15502 | const ev = new CustomEvent(name, {
|
15503 | bubbles: false,
|
15504 | cancelable: false,
|
15505 | detail: modalEvent.detail
|
15506 | });
|
15507 | el.dispatchEvent(ev);
|
15508 | }
|
15509 | };
|
15510 | }
|
15511 | swipeToCloseChanged(enable) {
|
15512 | if (this.gesture) {
|
15513 | this.gesture.enable(enable);
|
15514 | }
|
15515 | else if (enable) {
|
15516 | this.initSwipeToClose();
|
15517 | }
|
15518 | }
|
15519 | connectedCallback() {
|
15520 | prepareOverlay(this.el);
|
15521 | }
|
15522 | |
15523 |
|
15524 |
|
15525 | async present() {
|
15526 | if (this.presented) {
|
15527 | return;
|
15528 | }
|
15529 | const container = this.el.querySelector(`.modal-wrapper`);
|
15530 | if (!container) {
|
15531 | throw new Error('container is undefined');
|
15532 | }
|
15533 | const componentProps = Object.assign(Object.assign({}, this.componentProps), { modal: this.el });
|
15534 | this.usersElement = await attachComponent(this.delegate, container, this.component, ['ion-page'], componentProps);
|
15535 | await deepReady(this.usersElement);
|
15536 | writeTask(() => this.el.classList.add('show-modal'));
|
15537 | await present(this, 'modalEnter', iosEnterAnimation$3, mdEnterAnimation$2, this.presentingElement);
|
15538 | if (this.swipeToClose) {
|
15539 | this.initSwipeToClose();
|
15540 | }
|
15541 | }
|
15542 | initSwipeToClose() {
|
15543 | if (getIonMode$1(this) !== 'ios') {
|
15544 | return;
|
15545 | }
|
15546 |
|
15547 |
|
15548 |
|
15549 | const animationBuilder = this.leaveAnimation || config.get('modalLeave', iosLeaveAnimation$3);
|
15550 | const ani = this.animation = animationBuilder(this.el, this.presentingElement);
|
15551 | this.gesture = createSwipeToCloseGesture(this.el, ani, () => {
|
15552 | |
15553 |
|
15554 |
|
15555 |
|
15556 |
|
15557 |
|
15558 |
|
15559 |
|
15560 |
|
15561 |
|
15562 | this.gestureAnimationDismissing = true;
|
15563 | this.animation.onFinish(async () => {
|
15564 | await this.dismiss(undefined, 'gesture');
|
15565 | this.gestureAnimationDismissing = false;
|
15566 | });
|
15567 | });
|
15568 | this.gesture.enable(true);
|
15569 | }
|
15570 | |
15571 |
|
15572 |
|
15573 |
|
15574 |
|
15575 |
|
15576 | async dismiss(data, role) {
|
15577 | if (this.gestureAnimationDismissing && role !== 'gesture') {
|
15578 | return false;
|
15579 | }
|
15580 | const enteringAnimation = activeAnimations.get(this) || [];
|
15581 | const dismissed = await dismiss(this, data, role, 'modalLeave', iosLeaveAnimation$3, mdLeaveAnimation$2, this.presentingElement);
|
15582 | if (dismissed) {
|
15583 | await detachComponent(this.delegate, this.usersElement);
|
15584 | if (this.animation) {
|
15585 | this.animation.destroy();
|
15586 | }
|
15587 | enteringAnimation.forEach(ani => ani.destroy());
|
15588 | }
|
15589 | this.animation = undefined;
|
15590 | return dismissed;
|
15591 | }
|
15592 | |
15593 |
|
15594 |
|
15595 | onDidDismiss() {
|
15596 | return eventMethod(this.el, 'ionModalDidDismiss');
|
15597 | }
|
15598 | |
15599 |
|
15600 |
|
15601 | onWillDismiss() {
|
15602 | return eventMethod(this.el, 'ionModalWillDismiss');
|
15603 | }
|
15604 | render() {
|
15605 | const mode = getIonMode$1(this);
|
15606 | return (hAsync(Host, { "no-router": true, "aria-modal": "true", tabindex: "-1", class: Object.assign({ [mode]: true, [`modal-card`]: this.presentingElement !== undefined && mode === 'ios' }, getClassMap(this.cssClass)), style: {
|
15607 | zIndex: `${20000 + this.overlayIndex}`,
|
15608 | }, onIonBackdropTap: this.onBackdropTap, onIonDismiss: this.onDismiss, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }, hAsync("ion-backdrop", { visible: this.showBackdrop, tappable: this.backdropDismiss }), mode === 'ios' && hAsync("div", { class: "modal-shadow" }), hAsync("div", { tabindex: "0" }), hAsync("div", { role: "dialog", class: "modal-wrapper ion-overlay-wrapper" }), hAsync("div", { tabindex: "0" })));
|
15609 | }
|
15610 | get el() { return getElement(this); }
|
15611 | static get watchers() { return {
|
15612 | "swipeToClose": ["swipeToCloseChanged"]
|
15613 | }; }
|
15614 | static get style() { return {
|
15615 | ios: modalIosCss,
|
15616 | md: modalMdCss
|
15617 | }; }
|
15618 | static get cmpMeta() { return {
|
15619 | "$flags$": 34,
|
15620 | "$tagName$": "ion-modal",
|
15621 | "$members$": {
|
15622 | "overlayIndex": [2, "overlay-index"],
|
15623 | "delegate": [16],
|
15624 | "keyboardClose": [4, "keyboard-close"],
|
15625 | "enterAnimation": [16],
|
15626 | "leaveAnimation": [16],
|
15627 | "component": [1],
|
15628 | "componentProps": [16],
|
15629 | "cssClass": [1, "css-class"],
|
15630 | "backdropDismiss": [4, "backdrop-dismiss"],
|
15631 | "showBackdrop": [4, "show-backdrop"],
|
15632 | "animated": [4],
|
15633 | "swipeToClose": [4, "swipe-to-close"],
|
15634 | "presentingElement": [16],
|
15635 | "present": [64],
|
15636 | "dismiss": [64],
|
15637 | "onDidDismiss": [64],
|
15638 | "onWillDismiss": [64]
|
15639 | },
|
15640 | "$listeners$": undefined,
|
15641 | "$lazyBundleId$": "-",
|
15642 | "$attrsToReflect$": []
|
15643 | }; }
|
15644 | }
|
15645 | const LIFECYCLE_MAP$1 = {
|
15646 | 'ionModalDidPresent': 'ionViewDidEnter',
|
15647 | 'ionModalWillPresent': 'ionViewWillEnter',
|
15648 | 'ionModalWillDismiss': 'ionViewWillLeave',
|
15649 | 'ionModalDidDismiss': 'ionViewDidLeave',
|
15650 | };
|
15651 |
|
15652 | const VIEW_STATE_NEW = 1;
|
15653 | const VIEW_STATE_ATTACHED = 2;
|
15654 | const VIEW_STATE_DESTROYED = 3;
|
15655 | class ViewController {
|
15656 | constructor(component, params) {
|
15657 | this.component = component;
|
15658 | this.params = params;
|
15659 | this.state = VIEW_STATE_NEW;
|
15660 | }
|
15661 | async init(container) {
|
15662 | this.state = VIEW_STATE_ATTACHED;
|
15663 | if (!this.element) {
|
15664 | const component = this.component;
|
15665 | this.element = await attachComponent(this.delegate, container, component, ['ion-page', 'ion-page-invisible'], this.params);
|
15666 | }
|
15667 | }
|
15668 | |
15669 |
|
15670 |
|
15671 | _destroy() {
|
15672 | assert(this.state !== VIEW_STATE_DESTROYED, 'view state must be ATTACHED');
|
15673 | const element = this.element;
|
15674 | if (element) {
|
15675 | if (this.delegate) {
|
15676 | this.delegate.removeViewFromDom(element.parentElement, element);
|
15677 | }
|
15678 | else {
|
15679 | element.remove();
|
15680 | }
|
15681 | }
|
15682 | this.nav = undefined;
|
15683 | this.state = VIEW_STATE_DESTROYED;
|
15684 | }
|
15685 | }
|
15686 | const matches = (view, id, params) => {
|
15687 | if (!view) {
|
15688 | return false;
|
15689 | }
|
15690 | if (view.component !== id) {
|
15691 | return false;
|
15692 | }
|
15693 | const currentParams = view.params;
|
15694 | if (currentParams === params) {
|
15695 | return true;
|
15696 | }
|
15697 | if (!currentParams && !params) {
|
15698 | return true;
|
15699 | }
|
15700 | if (!currentParams || !params) {
|
15701 | return false;
|
15702 | }
|
15703 | const keysA = Object.keys(currentParams);
|
15704 | const keysB = Object.keys(params);
|
15705 | if (keysA.length !== keysB.length) {
|
15706 | return false;
|
15707 | }
|
15708 |
|
15709 | for (const key of keysA) {
|
15710 | if (currentParams[key] !== params[key]) {
|
15711 | return false;
|
15712 | }
|
15713 | }
|
15714 | return true;
|
15715 | };
|
15716 | const convertToView = (page, params) => {
|
15717 | if (!page) {
|
15718 | return null;
|
15719 | }
|
15720 | if (page instanceof ViewController) {
|
15721 | return page;
|
15722 | }
|
15723 | return new ViewController(page, params);
|
15724 | };
|
15725 | const convertToViews = (pages) => {
|
15726 | return pages.map(page => {
|
15727 | if (page instanceof ViewController) {
|
15728 | return page;
|
15729 | }
|
15730 | if ('component' in page) {
|
15731 | |
15732 |
|
15733 |
|
15734 |
|
15735 |
|
15736 |
|
15737 |
|
15738 | return convertToView(page.component, (page.componentProps === null) ? undefined : page.componentProps);
|
15739 | }
|
15740 | return convertToView(page, undefined);
|
15741 | }).filter(v => v !== null);
|
15742 | };
|
15743 |
|
15744 | const navCss = "/*!@:host*/.sc-ion-nav-h{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}";
|
15745 |
|
15746 | class Nav {
|
15747 | constructor(hostRef) {
|
15748 | registerInstance(this, hostRef);
|
15749 | this.ionNavWillLoad = createEvent(this, "ionNavWillLoad", 7);
|
15750 | this.ionNavWillChange = createEvent(this, "ionNavWillChange", 3);
|
15751 | this.ionNavDidChange = createEvent(this, "ionNavDidChange", 3);
|
15752 | this.transInstr = [];
|
15753 | this.animationEnabled = true;
|
15754 | this.useRouter = false;
|
15755 | this.isTransitioning = false;
|
15756 | this.destroyed = false;
|
15757 | this.views = [];
|
15758 | |
15759 |
|
15760 |
|
15761 | this.animated = true;
|
15762 | }
|
15763 | swipeGestureChanged() {
|
15764 | if (this.gesture) {
|
15765 | this.gesture.enable(this.swipeGesture === true);
|
15766 | }
|
15767 | }
|
15768 | rootChanged() {
|
15769 | if (this.root !== undefined) {
|
15770 | if (!this.useRouter) {
|
15771 | this.setRoot(this.root, this.rootParams);
|
15772 | }
|
15773 | }
|
15774 | }
|
15775 | componentWillLoad() {
|
15776 | this.useRouter =
|
15777 | !!document.querySelector('ion-router') &&
|
15778 | !this.el.closest('[no-router]');
|
15779 | if (this.swipeGesture === undefined) {
|
15780 | const mode = getIonMode$1(this);
|
15781 | this.swipeGesture = config.getBoolean('swipeBackEnabled', mode === 'ios');
|
15782 | }
|
15783 | this.ionNavWillLoad.emit();
|
15784 | }
|
15785 | async componentDidLoad() {
|
15786 | this.rootChanged();
|
15787 | this.gesture = (await Promise.resolve().then(function () { return swipeBack; })).createSwipeBackGesture(this.el, this.canStart.bind(this), this.onStart.bind(this), this.onMove.bind(this), this.onEnd.bind(this));
|
15788 | this.swipeGestureChanged();
|
15789 | }
|
15790 | disconnectedCallback() {
|
15791 | for (const view of this.views) {
|
15792 | lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);
|
15793 | view._destroy();
|
15794 | }
|
15795 | if (this.gesture) {
|
15796 | this.gesture.destroy();
|
15797 | this.gesture = undefined;
|
15798 | }
|
15799 |
|
15800 | this.transInstr.length = this.views.length = 0;
|
15801 | this.destroyed = true;
|
15802 | }
|
15803 | |
15804 |
|
15805 |
|
15806 |
|
15807 |
|
15808 |
|
15809 |
|
15810 |
|
15811 |
|
15812 |
|
15813 | push(component, componentProps, opts, done) {
|
15814 | return this.queueTrns({
|
15815 | insertStart: -1,
|
15816 | insertViews: [{ component, componentProps }],
|
15817 | opts
|
15818 | }, done);
|
15819 | }
|
15820 | |
15821 |
|
15822 |
|
15823 |
|
15824 |
|
15825 |
|
15826 |
|
15827 |
|
15828 |
|
15829 |
|
15830 | insert(insertIndex, component, componentProps, opts, done) {
|
15831 | return this.queueTrns({
|
15832 | insertStart: insertIndex,
|
15833 | insertViews: [{ component, componentProps }],
|
15834 | opts
|
15835 | }, done);
|
15836 | }
|
15837 | |
15838 |
|
15839 |
|
15840 |
|
15841 |
|
15842 |
|
15843 |
|
15844 |
|
15845 |
|
15846 |
|
15847 | insertPages(insertIndex, insertComponents, opts, done) {
|
15848 | return this.queueTrns({
|
15849 | insertStart: insertIndex,
|
15850 | insertViews: insertComponents,
|
15851 | opts
|
15852 | }, done);
|
15853 | }
|
15854 | |
15855 |
|
15856 |
|
15857 |
|
15858 |
|
15859 |
|
15860 |
|
15861 | pop(opts, done) {
|
15862 | return this.queueTrns({
|
15863 | removeStart: -1,
|
15864 | removeCount: 1,
|
15865 | opts
|
15866 | }, done);
|
15867 | }
|
15868 | |
15869 |
|
15870 |
|
15871 |
|
15872 |
|
15873 |
|
15874 |
|
15875 | popTo(indexOrViewCtrl, opts, done) {
|
15876 | const tiConfig = {
|
15877 | removeStart: -1,
|
15878 | removeCount: -1,
|
15879 | opts
|
15880 | };
|
15881 | if (typeof indexOrViewCtrl === 'object' && indexOrViewCtrl.component) {
|
15882 | tiConfig.removeView = indexOrViewCtrl;
|
15883 | tiConfig.removeStart = 1;
|
15884 | }
|
15885 | else if (typeof indexOrViewCtrl === 'number') {
|
15886 | tiConfig.removeStart = indexOrViewCtrl + 1;
|
15887 | }
|
15888 | return this.queueTrns(tiConfig, done);
|
15889 | }
|
15890 | |
15891 |
|
15892 |
|
15893 |
|
15894 |
|
15895 |
|
15896 | popToRoot(opts, done) {
|
15897 | return this.queueTrns({
|
15898 | removeStart: 1,
|
15899 | removeCount: -1,
|
15900 | opts
|
15901 | }, done);
|
15902 | }
|
15903 | |
15904 |
|
15905 |
|
15906 |
|
15907 |
|
15908 |
|
15909 |
|
15910 |
|
15911 | removeIndex(startIndex, removeCount = 1, opts, done) {
|
15912 | return this.queueTrns({
|
15913 | removeStart: startIndex,
|
15914 | removeCount,
|
15915 | opts
|
15916 | }, done);
|
15917 | }
|
15918 | |
15919 |
|
15920 |
|
15921 |
|
15922 |
|
15923 |
|
15924 |
|
15925 |
|
15926 | setRoot(component, componentProps, opts, done) {
|
15927 | return this.setPages([{ component, componentProps }], opts, done);
|
15928 | }
|
15929 | |
15930 |
|
15931 |
|
15932 |
|
15933 |
|
15934 |
|
15935 |
|
15936 |
|
15937 |
|
15938 |
|
15939 | setPages(views, opts, done) {
|
15940 | if (opts == null) {
|
15941 | opts = {};
|
15942 | }
|
15943 |
|
15944 | if (opts.animated !== true) {
|
15945 | opts.animated = false;
|
15946 | }
|
15947 | return this.queueTrns({
|
15948 | insertStart: 0,
|
15949 | insertViews: views,
|
15950 | removeStart: 0,
|
15951 | removeCount: -1,
|
15952 | opts
|
15953 | }, done);
|
15954 | }
|
15955 |
|
15956 | setRouteId(id, params, direction, animation) {
|
15957 | const active = this.getActiveSync();
|
15958 | if (matches(active, id, params)) {
|
15959 | return Promise.resolve({
|
15960 | changed: false,
|
15961 | element: active.element
|
15962 | });
|
15963 | }
|
15964 | let resolve;
|
15965 | const promise = new Promise(r => (resolve = r));
|
15966 | let finish;
|
15967 | const commonOpts = {
|
15968 | updateURL: false,
|
15969 | viewIsReady: enteringEl => {
|
15970 | let mark;
|
15971 | const p = new Promise(r => (mark = r));
|
15972 | resolve({
|
15973 | changed: true,
|
15974 | element: enteringEl,
|
15975 | markVisible: async () => {
|
15976 | mark();
|
15977 | await finish;
|
15978 | }
|
15979 | });
|
15980 | return p;
|
15981 | }
|
15982 | };
|
15983 | if (direction === 'root') {
|
15984 | finish = this.setRoot(id, params, commonOpts);
|
15985 | }
|
15986 | else {
|
15987 | const viewController = this.views.find(v => matches(v, id, params));
|
15988 | if (viewController) {
|
15989 | finish = this.popTo(viewController, Object.assign(Object.assign({}, commonOpts), { direction: 'back', animationBuilder: animation }));
|
15990 | }
|
15991 | else if (direction === 'forward') {
|
15992 | finish = this.push(id, params, Object.assign(Object.assign({}, commonOpts), { animationBuilder: animation }));
|
15993 | }
|
15994 | else if (direction === 'back') {
|
15995 | finish = this.setRoot(id, params, Object.assign(Object.assign({}, commonOpts), { direction: 'back', animated: true, animationBuilder: animation }));
|
15996 | }
|
15997 | }
|
15998 | return promise;
|
15999 | }
|
16000 |
|
16001 | async getRouteId() {
|
16002 | const active = this.getActiveSync();
|
16003 | return active
|
16004 | ? {
|
16005 | id: active.element.tagName,
|
16006 | params: active.params,
|
16007 | element: active.element
|
16008 | }
|
16009 | : undefined;
|
16010 | }
|
16011 | |
16012 |
|
16013 |
|
16014 | getActive() {
|
16015 | return Promise.resolve(this.getActiveSync());
|
16016 | }
|
16017 | |
16018 |
|
16019 |
|
16020 |
|
16021 |
|
16022 | getByIndex(index) {
|
16023 | return Promise.resolve(this.views[index]);
|
16024 | }
|
16025 | |
16026 |
|
16027 |
|
16028 |
|
16029 |
|
16030 | canGoBack(view) {
|
16031 | return Promise.resolve(this.canGoBackSync(view));
|
16032 | }
|
16033 | |
16034 |
|
16035 |
|
16036 |
|
16037 |
|
16038 | getPrevious(view) {
|
16039 | return Promise.resolve(this.getPreviousSync(view));
|
16040 | }
|
16041 | getLength() {
|
16042 | return this.views.length;
|
16043 | }
|
16044 | getActiveSync() {
|
16045 | return this.views[this.views.length - 1];
|
16046 | }
|
16047 | canGoBackSync(view = this.getActiveSync()) {
|
16048 | return !!(view && this.getPreviousSync(view));
|
16049 | }
|
16050 | getPreviousSync(view = this.getActiveSync()) {
|
16051 | if (!view) {
|
16052 | return undefined;
|
16053 | }
|
16054 | const views = this.views;
|
16055 | const index = views.indexOf(view);
|
16056 | return index > 0 ? views[index - 1] : undefined;
|
16057 | }
|
16058 |
|
16059 |
|
16060 |
|
16061 |
|
16062 |
|
16063 |
|
16064 |
|
16065 |
|
16066 |
|
16067 |
|
16068 | async queueTrns(ti, done) {
|
16069 | if (this.isTransitioning && ti.opts != null && ti.opts.skipIfBusy) {
|
16070 | return Promise.resolve(false);
|
16071 | }
|
16072 | const promise = new Promise((resolve, reject) => {
|
16073 | ti.resolve = resolve;
|
16074 | ti.reject = reject;
|
16075 | });
|
16076 | ti.done = done;
|
16077 | |
16078 |
|
16079 |
|
16080 |
|
16081 |
|
16082 |
|
16083 | if (ti.opts && ti.opts.updateURL !== false && this.useRouter) {
|
16084 | const router = document.querySelector('ion-router');
|
16085 | if (router) {
|
16086 | const canTransition = await router.canTransition();
|
16087 | if (canTransition === false) {
|
16088 | return Promise.resolve(false);
|
16089 | }
|
16090 | else if (typeof canTransition === 'string') {
|
16091 | router.push(canTransition, ti.opts.direction || 'back');
|
16092 | return Promise.resolve(false);
|
16093 | }
|
16094 | }
|
16095 | }
|
16096 |
|
16097 | if (ti.insertViews && ti.insertViews.length === 0) {
|
16098 | ti.insertViews = undefined;
|
16099 | }
|
16100 |
|
16101 | this.transInstr.push(ti);
|
16102 |
|
16103 |
|
16104 | this.nextTrns();
|
16105 | return promise;
|
16106 | }
|
16107 | success(result, ti) {
|
16108 | if (this.destroyed) {
|
16109 | this.fireError('nav controller was destroyed', ti);
|
16110 | return;
|
16111 | }
|
16112 | if (ti.done) {
|
16113 | ti.done(result.hasCompleted, result.requiresTransition, result.enteringView, result.leavingView, result.direction);
|
16114 | }
|
16115 | ti.resolve(result.hasCompleted);
|
16116 | if (ti.opts.updateURL !== false && this.useRouter) {
|
16117 | const router = document.querySelector('ion-router');
|
16118 | if (router) {
|
16119 | const direction = result.direction === 'back' ? 'back' : 'forward';
|
16120 | router.navChanged(direction);
|
16121 | }
|
16122 | }
|
16123 | }
|
16124 | failed(rejectReason, ti) {
|
16125 | if (this.destroyed) {
|
16126 | this.fireError('nav controller was destroyed', ti);
|
16127 | return;
|
16128 | }
|
16129 | this.transInstr.length = 0;
|
16130 | this.fireError(rejectReason, ti);
|
16131 | }
|
16132 | fireError(rejectReason, ti) {
|
16133 | if (ti.done) {
|
16134 | ti.done(false, false, rejectReason);
|
16135 | }
|
16136 | if (ti.reject && !this.destroyed) {
|
16137 | ti.reject(rejectReason);
|
16138 | }
|
16139 | else {
|
16140 | ti.resolve(false);
|
16141 | }
|
16142 | }
|
16143 | nextTrns() {
|
16144 |
|
16145 |
|
16146 | if (this.isTransitioning) {
|
16147 | return false;
|
16148 | }
|
16149 |
|
16150 |
|
16151 | const ti = this.transInstr.shift();
|
16152 | if (!ti) {
|
16153 | return false;
|
16154 | }
|
16155 | this.runTransition(ti);
|
16156 | return true;
|
16157 | }
|
16158 | async runTransition(ti) {
|
16159 | try {
|
16160 |
|
16161 | this.ionNavWillChange.emit();
|
16162 | this.isTransitioning = true;
|
16163 | this.prepareTI(ti);
|
16164 | const leavingView = this.getActiveSync();
|
16165 | const enteringView = this.getEnteringView(ti, leavingView);
|
16166 | if (!leavingView && !enteringView) {
|
16167 | throw new Error('no views in the stack to be removed');
|
16168 | }
|
16169 | if (enteringView && enteringView.state === VIEW_STATE_NEW) {
|
16170 | await enteringView.init(this.el);
|
16171 | }
|
16172 | this.postViewInit(enteringView, leavingView, ti);
|
16173 |
|
16174 | const requiresTransition = (ti.enteringRequiresTransition || ti.leavingRequiresTransition) &&
|
16175 | enteringView !== leavingView;
|
16176 | if (requiresTransition && ti.opts && leavingView) {
|
16177 | const isBackDirection = ti.opts.direction === 'back';
|
16178 | |
16179 |
|
16180 |
|
16181 |
|
16182 | if (isBackDirection) {
|
16183 | ti.opts.animationBuilder = ti.opts.animationBuilder || (enteringView && enteringView.animationBuilder);
|
16184 | }
|
16185 | leavingView.animationBuilder = ti.opts.animationBuilder;
|
16186 | }
|
16187 | const result = requiresTransition
|
16188 | ? await this.transition(enteringView, leavingView, ti)
|
16189 | : {
|
16190 |
|
16191 |
|
16192 |
|
16193 |
|
16194 | hasCompleted: true,
|
16195 | requiresTransition: false
|
16196 | };
|
16197 | this.success(result, ti);
|
16198 | this.ionNavDidChange.emit();
|
16199 | }
|
16200 | catch (rejectReason) {
|
16201 | this.failed(rejectReason, ti);
|
16202 | }
|
16203 | this.isTransitioning = false;
|
16204 | this.nextTrns();
|
16205 | }
|
16206 | prepareTI(ti) {
|
16207 | const viewsLength = this.views.length;
|
16208 | ti.opts = ti.opts || {};
|
16209 | if (ti.opts.delegate === undefined) {
|
16210 | ti.opts.delegate = this.delegate;
|
16211 | }
|
16212 | if (ti.removeView !== undefined) {
|
16213 | assert(ti.removeStart !== undefined, 'removeView needs removeStart');
|
16214 | assert(ti.removeCount !== undefined, 'removeView needs removeCount');
|
16215 | const index = this.views.indexOf(ti.removeView);
|
16216 | if (index < 0) {
|
16217 | throw new Error('removeView was not found');
|
16218 | }
|
16219 | ti.removeStart += index;
|
16220 | }
|
16221 | if (ti.removeStart !== undefined) {
|
16222 | if (ti.removeStart < 0) {
|
16223 | ti.removeStart = viewsLength - 1;
|
16224 | }
|
16225 | if (ti.removeCount < 0) {
|
16226 | ti.removeCount = viewsLength - ti.removeStart;
|
16227 | }
|
16228 | ti.leavingRequiresTransition =
|
16229 | ti.removeCount > 0 && ti.removeStart + ti.removeCount === viewsLength;
|
16230 | }
|
16231 | if (ti.insertViews) {
|
16232 |
|
16233 |
|
16234 | if (ti.insertStart < 0 || ti.insertStart > viewsLength) {
|
16235 | ti.insertStart = viewsLength;
|
16236 | }
|
16237 | ti.enteringRequiresTransition = ti.insertStart === viewsLength;
|
16238 | }
|
16239 | const insertViews = ti.insertViews;
|
16240 | if (!insertViews) {
|
16241 | return;
|
16242 | }
|
16243 | assert(insertViews.length > 0, 'length can not be zero');
|
16244 | const viewControllers = convertToViews(insertViews);
|
16245 | if (viewControllers.length === 0) {
|
16246 | throw new Error('invalid views to insert');
|
16247 | }
|
16248 |
|
16249 | for (const view of viewControllers) {
|
16250 | view.delegate = ti.opts.delegate;
|
16251 | const nav = view.nav;
|
16252 | if (nav && nav !== this) {
|
16253 | throw new Error('inserted view was already inserted');
|
16254 | }
|
16255 | if (view.state === VIEW_STATE_DESTROYED) {
|
16256 | throw new Error('inserted view was already destroyed');
|
16257 | }
|
16258 | }
|
16259 | ti.insertViews = viewControllers;
|
16260 | }
|
16261 | getEnteringView(ti, leavingView) {
|
16262 | const insertViews = ti.insertViews;
|
16263 | if (insertViews !== undefined) {
|
16264 |
|
16265 |
|
16266 | return insertViews[insertViews.length - 1];
|
16267 | }
|
16268 | const removeStart = ti.removeStart;
|
16269 | if (removeStart !== undefined) {
|
16270 | const views = this.views;
|
16271 | const removeEnd = removeStart + ti.removeCount;
|
16272 | for (let i = views.length - 1; i >= 0; i--) {
|
16273 | const view = views[i];
|
16274 | if ((i < removeStart || i >= removeEnd) && view !== leavingView) {
|
16275 | return view;
|
16276 | }
|
16277 | }
|
16278 | }
|
16279 | return undefined;
|
16280 | }
|
16281 | postViewInit(enteringView, leavingView, ti) {
|
16282 | assert(leavingView || enteringView, 'Both leavingView and enteringView are null');
|
16283 | assert(ti.resolve, 'resolve must be valid');
|
16284 | assert(ti.reject, 'reject must be valid');
|
16285 | const opts = ti.opts;
|
16286 | const insertViews = ti.insertViews;
|
16287 | const removeStart = ti.removeStart;
|
16288 | const removeCount = ti.removeCount;
|
16289 | let destroyQueue;
|
16290 |
|
16291 | if (removeStart !== undefined && removeCount !== undefined) {
|
16292 | assert(removeStart >= 0, 'removeStart can not be negative');
|
16293 | assert(removeCount >= 0, 'removeCount can not be negative');
|
16294 | destroyQueue = [];
|
16295 | for (let i = 0; i < removeCount; i++) {
|
16296 | const view = this.views[i + removeStart];
|
16297 | if (view && view !== enteringView && view !== leavingView) {
|
16298 | destroyQueue.push(view);
|
16299 | }
|
16300 | }
|
16301 |
|
16302 | opts.direction = opts.direction || 'back';
|
16303 | }
|
16304 | const finalBalance = this.views.length +
|
16305 | (insertViews !== undefined ? insertViews.length : 0) -
|
16306 | (removeCount !== undefined ? removeCount : 0);
|
16307 | assert(finalBalance >= 0, 'final balance can not be negative');
|
16308 | if (finalBalance === 0) {
|
16309 | console.warn(`You can't remove all the pages in the navigation stack. nav.pop() is probably called too many times.`, this, this.el);
|
16310 | throw new Error('navigation stack needs at least one root page');
|
16311 | }
|
16312 |
|
16313 |
|
16314 | if (insertViews) {
|
16315 |
|
16316 | let insertIndex = ti.insertStart;
|
16317 | for (const view of insertViews) {
|
16318 | this.insertViewAt(view, insertIndex);
|
16319 | insertIndex++;
|
16320 | }
|
16321 | if (ti.enteringRequiresTransition) {
|
16322 |
|
16323 | opts.direction = opts.direction || 'forward';
|
16324 | }
|
16325 | }
|
16326 |
|
16327 |
|
16328 |
|
16329 |
|
16330 |
|
16331 | if (destroyQueue && destroyQueue.length > 0) {
|
16332 | for (const view of destroyQueue) {
|
16333 | lifecycle(view.element, LIFECYCLE_WILL_LEAVE);
|
16334 | lifecycle(view.element, LIFECYCLE_DID_LEAVE);
|
16335 | lifecycle(view.element, LIFECYCLE_WILL_UNLOAD);
|
16336 | }
|
16337 |
|
16338 | for (const view of destroyQueue) {
|
16339 | this.destroyView(view);
|
16340 | }
|
16341 | }
|
16342 | }
|
16343 | async transition(enteringView, leavingView, ti) {
|
16344 |
|
16345 |
|
16346 | const opts = ti.opts;
|
16347 | const progressCallback = opts.progressAnimation
|
16348 | ? (ani) => this.sbAni = ani
|
16349 | : undefined;
|
16350 | const mode = getIonMode$1(this);
|
16351 | const enteringEl = enteringView.element;
|
16352 | const leavingEl = leavingView && leavingView.element;
|
16353 | const animationOpts = Object.assign(Object.assign({ mode, showGoBack: this.canGoBackSync(enteringView), baseEl: this.el, progressCallback, animated: this.animated && config.getBoolean('animated', true), enteringEl,
|
16354 | leavingEl }, opts), { animationBuilder: opts.animationBuilder || this.animation || config.get('navAnimation') });
|
16355 | const { hasCompleted } = await transition$2(animationOpts);
|
16356 | return this.transitionFinish(hasCompleted, enteringView, leavingView, opts);
|
16357 | }
|
16358 | transitionFinish(hasCompleted, enteringView, leavingView, opts) {
|
16359 | const cleanupView = hasCompleted ? enteringView : leavingView;
|
16360 | if (cleanupView) {
|
16361 | this.cleanup(cleanupView);
|
16362 | }
|
16363 | return {
|
16364 | hasCompleted,
|
16365 | requiresTransition: true,
|
16366 | enteringView,
|
16367 | leavingView,
|
16368 | direction: opts.direction
|
16369 | };
|
16370 | }
|
16371 | insertViewAt(view, index) {
|
16372 | const views = this.views;
|
16373 | const existingIndex = views.indexOf(view);
|
16374 | if (existingIndex > -1) {
|
16375 |
|
16376 |
|
16377 | assert(view.nav === this, 'view is not part of the nav');
|
16378 | views.splice(index, 0, views.splice(existingIndex, 1)[0]);
|
16379 | }
|
16380 | else {
|
16381 | assert(!view.nav, 'nav is used');
|
16382 |
|
16383 |
|
16384 | view.nav = this;
|
16385 |
|
16386 | views.splice(index, 0, view);
|
16387 | }
|
16388 | }
|
16389 | removeView(view) {
|
16390 | assert(view.state === VIEW_STATE_ATTACHED || view.state === VIEW_STATE_DESTROYED, 'view state should be loaded or destroyed');
|
16391 | const views = this.views;
|
16392 | const index = views.indexOf(view);
|
16393 | assert(index > -1, 'view must be part of the stack');
|
16394 | if (index >= 0) {
|
16395 | views.splice(index, 1);
|
16396 | }
|
16397 | }
|
16398 | destroyView(view) {
|
16399 | view._destroy();
|
16400 | this.removeView(view);
|
16401 | }
|
16402 | |
16403 |
|
16404 |
|
16405 | cleanup(activeView) {
|
16406 |
|
16407 |
|
16408 |
|
16409 | if (this.destroyed) {
|
16410 | return;
|
16411 | }
|
16412 | const views = this.views;
|
16413 | const activeViewIndex = views.indexOf(activeView);
|
16414 | for (let i = views.length - 1; i >= 0; i--) {
|
16415 | const view = views[i];
|
16416 | |
16417 |
|
16418 |
|
16419 |
|
16420 |
|
16421 |
|
16422 |
|
16423 |
|
16424 | const element = view.element;
|
16425 | if (element) {
|
16426 | if (i > activeViewIndex) {
|
16427 |
|
16428 |
|
16429 | lifecycle(element, LIFECYCLE_WILL_UNLOAD);
|
16430 | this.destroyView(view);
|
16431 | }
|
16432 | else if (i < activeViewIndex) {
|
16433 |
|
16434 |
|
16435 | setPageHidden(element, true);
|
16436 | }
|
16437 | }
|
16438 | }
|
16439 | }
|
16440 | canStart() {
|
16441 | return (!!this.swipeGesture &&
|
16442 | !this.isTransitioning &&
|
16443 | this.transInstr.length === 0 &&
|
16444 | this.animationEnabled &&
|
16445 | this.canGoBackSync());
|
16446 | }
|
16447 | onStart() {
|
16448 | this.queueTrns({
|
16449 | removeStart: -1,
|
16450 | removeCount: 1,
|
16451 | opts: {
|
16452 | direction: 'back',
|
16453 | progressAnimation: true
|
16454 | }
|
16455 | }, undefined);
|
16456 | }
|
16457 | onMove(stepValue) {
|
16458 | if (this.sbAni) {
|
16459 | this.sbAni.progressStep(stepValue);
|
16460 | }
|
16461 | }
|
16462 | onEnd(shouldComplete, stepValue, dur) {
|
16463 | if (this.sbAni) {
|
16464 | this.animationEnabled = false;
|
16465 | this.sbAni.onFinish(() => {
|
16466 | this.animationEnabled = true;
|
16467 | }, { oneTimeCallback: true });
|
16468 |
|
16469 | let newStepValue = (shouldComplete) ? -0.001 : 0.001;
|
16470 | |
16471 |
|
16472 |
|
16473 |
|
16474 |
|
16475 |
|
16476 |
|
16477 |
|
16478 | if (!shouldComplete) {
|
16479 | this.sbAni.easing('cubic-bezier(1, 0, 0.68, 0.28)');
|
16480 | newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], stepValue)[0];
|
16481 | }
|
16482 | else {
|
16483 | newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], stepValue)[0];
|
16484 | }
|
16485 | this.sbAni.progressEnd(shouldComplete ? 1 : 0, newStepValue, dur);
|
16486 | }
|
16487 | }
|
16488 | render() {
|
16489 | return (hAsync("slot", null));
|
16490 | }
|
16491 | get el() { return getElement(this); }
|
16492 | static get watchers() { return {
|
16493 | "swipeGesture": ["swipeGestureChanged"],
|
16494 | "root": ["rootChanged"]
|
16495 | }; }
|
16496 | static get style() { return navCss; }
|
16497 | static get cmpMeta() { return {
|
16498 | "$flags$": 9,
|
16499 | "$tagName$": "ion-nav",
|
16500 | "$members$": {
|
16501 | "delegate": [16],
|
16502 | "swipeGesture": [1028, "swipe-gesture"],
|
16503 | "animated": [4],
|
16504 | "animation": [16],
|
16505 | "rootParams": [16],
|
16506 | "root": [1],
|
16507 | "push": [64],
|
16508 | "insert": [64],
|
16509 | "insertPages": [64],
|
16510 | "pop": [64],
|
16511 | "popTo": [64],
|
16512 | "popToRoot": [64],
|
16513 | "removeIndex": [64],
|
16514 | "setRoot": [64],
|
16515 | "setPages": [64],
|
16516 | "setRouteId": [64],
|
16517 | "getRouteId": [64],
|
16518 | "getActive": [64],
|
16519 | "getByIndex": [64],
|
16520 | "canGoBack": [64],
|
16521 | "getPrevious": [64]
|
16522 | },
|
16523 | "$listeners$": undefined,
|
16524 | "$lazyBundleId$": "-",
|
16525 | "$attrsToReflect$": []
|
16526 | }; }
|
16527 | }
|
16528 |
|
16529 | const navLink = (el, routerDirection, component, componentProps, routerAnimation) => {
|
16530 | const nav = el.closest('ion-nav');
|
16531 | if (nav) {
|
16532 | if (routerDirection === 'forward') {
|
16533 | if (component !== undefined) {
|
16534 | return nav.push(component, componentProps, { skipIfBusy: true, animationBuilder: routerAnimation });
|
16535 | }
|
16536 | }
|
16537 | else if (routerDirection === 'root') {
|
16538 | if (component !== undefined) {
|
16539 | return nav.setRoot(component, componentProps, { skipIfBusy: true, animationBuilder: routerAnimation });
|
16540 | }
|
16541 | }
|
16542 | else if (routerDirection === 'back') {
|
16543 | return nav.pop({ skipIfBusy: true, animationBuilder: routerAnimation });
|
16544 | }
|
16545 | }
|
16546 | return Promise.resolve(false);
|
16547 | };
|
16548 |
|
16549 | class NavLink {
|
16550 | constructor(hostRef) {
|
16551 | registerInstance(this, hostRef);
|
16552 | |
16553 |
|
16554 |
|
16555 | this.routerDirection = 'forward';
|
16556 | this.onClick = () => {
|
16557 | return navLink(this.el, this.routerDirection, this.component, this.componentProps, this.routerAnimation);
|
16558 | };
|
16559 | }
|
16560 | render() {
|
16561 | return (hAsync(Host, { onClick: this.onClick }));
|
16562 | }
|
16563 | get el() { return getElement(this); }
|
16564 | static get cmpMeta() { return {
|
16565 | "$flags$": 0,
|
16566 | "$tagName$": "ion-nav-link",
|
16567 | "$members$": {
|
16568 | "component": [1],
|
16569 | "componentProps": [16],
|
16570 | "routerDirection": [1, "router-direction"],
|
16571 | "routerAnimation": [16]
|
16572 | },
|
16573 | "$listeners$": undefined,
|
16574 | "$lazyBundleId$": "-",
|
16575 | "$attrsToReflect$": []
|
16576 | }; }
|
16577 | }
|
16578 |
|
16579 | const noteIosCss = "/*!@:host*/.sc-ion-note-ios-h{color:var(--color);font-family:var(--ion-font-family, inherit);-webkit-box-sizing:border-box;box-sizing:border-box}/*!@:host(.ion-color)*/.ion-color.sc-ion-note-ios-h{color:var(--ion-color-base)}/*!@:host*/.sc-ion-note-ios-h{--color:var(--ion-color-step-350, #a6a6a6)}";
|
16580 |
|
16581 | const noteMdCss = "/*!@:host*/.sc-ion-note-md-h{color:var(--color);font-family:var(--ion-font-family, inherit);-webkit-box-sizing:border-box;box-sizing:border-box}/*!@:host(.ion-color)*/.ion-color.sc-ion-note-md-h{color:var(--ion-color-base)}/*!@:host*/.sc-ion-note-md-h{--color:var(--ion-color-step-600, #666666);font-size:14px}";
|
16582 |
|
16583 |
|
16584 |
|
16585 |
|
16586 | class Note {
|
16587 | constructor(hostRef) {
|
16588 | registerInstance(this, hostRef);
|
16589 | }
|
16590 | render() {
|
16591 | const mode = getIonMode$1(this);
|
16592 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
16593 | [mode]: true,
|
16594 | }) }, hAsync("slot", null)));
|
16595 | }
|
16596 | static get style() { return {
|
16597 | ios: noteIosCss,
|
16598 | md: noteMdCss
|
16599 | }; }
|
16600 | static get cmpMeta() { return {
|
16601 | "$flags$": 41,
|
16602 | "$tagName$": "ion-note",
|
16603 | "$members$": {
|
16604 | "color": [513]
|
16605 | },
|
16606 | "$listeners$": undefined,
|
16607 | "$lazyBundleId$": "-",
|
16608 | "$attrsToReflect$": [["color", "color"]]
|
16609 | }; }
|
16610 | }
|
16611 |
|
16612 |
|
16613 |
|
16614 |
|
16615 | const iosEnterAnimation$2 = (baseEl) => {
|
16616 | const baseAnimation = createAnimation();
|
16617 | const backdropAnimation = createAnimation();
|
16618 | const wrapperAnimation = createAnimation();
|
16619 | backdropAnimation
|
16620 | .addElement(baseEl.querySelector('ion-backdrop'))
|
16621 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
16622 | .beforeStyles({
|
16623 | 'pointer-events': 'none'
|
16624 | })
|
16625 | .afterClearStyles(['pointer-events']);
|
16626 | wrapperAnimation
|
16627 | .addElement(baseEl.querySelector('.picker-wrapper'))
|
16628 | .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
|
16629 | return baseAnimation
|
16630 | .addElement(baseEl)
|
16631 | .easing('cubic-bezier(.36,.66,.04,1)')
|
16632 | .duration(400)
|
16633 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
16634 | };
|
16635 |
|
16636 |
|
16637 |
|
16638 |
|
16639 | const iosLeaveAnimation$2 = (baseEl) => {
|
16640 | const baseAnimation = createAnimation();
|
16641 | const backdropAnimation = createAnimation();
|
16642 | const wrapperAnimation = createAnimation();
|
16643 | backdropAnimation
|
16644 | .addElement(baseEl.querySelector('ion-backdrop'))
|
16645 | .fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
|
16646 | wrapperAnimation
|
16647 | .addElement(baseEl.querySelector('.picker-wrapper'))
|
16648 | .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
|
16649 | return baseAnimation
|
16650 | .addElement(baseEl)
|
16651 | .easing('cubic-bezier(.36,.66,.04,1)')
|
16652 | .duration(400)
|
16653 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
16654 | };
|
16655 |
|
16656 | const pickerIosCss = ".sc-ion-picker-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}[dir=rtl].sc-ion-picker-ios-h,[dir=rtl] .sc-ion-picker-ios-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-ios-h{display:none}.picker-wrapper.sc-ion-picker-ios{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-wrapper.sc-ion-picker-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-ios:active,.picker-button.sc-ion-picker-ios:focus{outline:none}.picker-columns.sc-ion-picker-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-ios,.picker-below-highlight.sc-ion-picker-ios{display:none;pointer-events:none}.sc-ion-picker-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-ios:last-child .picker-button.sc-ion-picker-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1em;padding-right:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-button.sc-ion-picker-ios,.picker-button.ion-activated.sc-ion-picker-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em}}.picker-columns.sc-ion-picker-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-ios{left:0;top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}[dir=rtl].sc-ion-picker-ios .picker-above-highlight.sc-ion-picker-ios,[dir=rtl].sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-above-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-ios{left:0;top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}[dir=rtl].sc-ion-picker-ios .picker-below-highlight.sc-ion-picker-ios,[dir=rtl].sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios,[dir=rtl] .sc-ion-picker-ios-h .picker-below-highlight.sc-ion-picker-ios{left:unset;right:unset;right:0}";
|
16657 |
|
16658 | const pickerMdCss = ".sc-ion-picker-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}[dir=rtl].sc-ion-picker-md-h,[dir=rtl] .sc-ion-picker-md-h{left:unset;right:unset;right:0}.overlay-hidden.sc-ion-picker-md-h{display:none}.picker-wrapper.sc-ion-picker-md{border-radius:var(--border-radius);left:0;right:0;bottom:0;margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-wrapper.sc-ion-picker-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.picker-toolbar.sc-ion-picker-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-md:active,.picker-button.sc-ion-picker-md:focus{outline:none}.picker-columns.sc-ion-picker-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;direction:ltr;overflow:hidden}.picker-above-highlight.sc-ion-picker-md,.picker-below-highlight.sc-ion-picker-md{display:none;pointer-events:none}.sc-ion-picker-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:1.1em;padding-right:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #3880ff);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-button.sc-ion-picker-md,.picker-button.ion-activated.sc-ion-picker-md{padding-left:unset;padding-right:unset;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em}}.picker-columns.sc-ion-picker-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-md{left:0;top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}[dir=rtl].sc-ion-picker-md .picker-above-highlight.sc-ion-picker-md,[dir=rtl].sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-above-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}.picker-below-highlight.sc-ion-picker-md{left:0;top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}[dir=rtl].sc-ion-picker-md .picker-below-highlight.sc-ion-picker-md,[dir=rtl].sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md,[dir=rtl] .sc-ion-picker-md-h .picker-below-highlight.sc-ion-picker-md{left:unset;right:unset;right:0}";
|
16659 |
|
16660 |
|
16661 |
|
16662 |
|
16663 | class Picker {
|
16664 | constructor(hostRef) {
|
16665 | registerInstance(this, hostRef);
|
16666 | this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
|
16667 | this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
|
16668 | this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
|
16669 | this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
|
16670 | this.presented = false;
|
16671 | |
16672 |
|
16673 |
|
16674 | this.keyboardClose = true;
|
16675 | |
16676 |
|
16677 |
|
16678 | this.buttons = [];
|
16679 | |
16680 |
|
16681 |
|
16682 | this.columns = [];
|
16683 | |
16684 |
|
16685 |
|
16686 | this.duration = 0;
|
16687 | |
16688 |
|
16689 |
|
16690 | this.showBackdrop = true;
|
16691 | |
16692 |
|
16693 |
|
16694 | this.backdropDismiss = true;
|
16695 | |
16696 |
|
16697 |
|
16698 | this.animated = true;
|
16699 | this.onBackdropTap = () => {
|
16700 | this.dismiss(undefined, BACKDROP);
|
16701 | };
|
16702 | this.dispatchCancelHandler = (ev) => {
|
16703 | const role = ev.detail.role;
|
16704 | if (isCancel(role)) {
|
16705 | const cancelButton = this.buttons.find(b => b.role === 'cancel');
|
16706 | this.callButtonHandler(cancelButton);
|
16707 | }
|
16708 | };
|
16709 | }
|
16710 | connectedCallback() {
|
16711 | prepareOverlay(this.el);
|
16712 | }
|
16713 | |
16714 |
|
16715 |
|
16716 | async present() {
|
16717 | await present(this, 'pickerEnter', iosEnterAnimation$2, iosEnterAnimation$2, undefined);
|
16718 | if (this.duration > 0) {
|
16719 | this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
|
16720 | }
|
16721 | }
|
16722 | |
16723 |
|
16724 |
|
16725 |
|
16726 |
|
16727 |
|
16728 |
|
16729 |
|
16730 |
|
16731 | dismiss(data, role) {
|
16732 | if (this.durationTimeout) {
|
16733 | clearTimeout(this.durationTimeout);
|
16734 | }
|
16735 | return dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation$2, iosLeaveAnimation$2);
|
16736 | }
|
16737 | |
16738 |
|
16739 |
|
16740 | onDidDismiss() {
|
16741 | return eventMethod(this.el, 'ionPickerDidDismiss');
|
16742 | }
|
16743 | |
16744 |
|
16745 |
|
16746 | onWillDismiss() {
|
16747 | return eventMethod(this.el, 'ionPickerWillDismiss');
|
16748 | }
|
16749 | |
16750 |
|
16751 |
|
16752 |
|
16753 |
|
16754 | getColumn(name) {
|
16755 | return Promise.resolve(this.columns.find(column => column.name === name));
|
16756 | }
|
16757 | async buttonClick(button) {
|
16758 | const role = button.role;
|
16759 | if (isCancel(role)) {
|
16760 | return this.dismiss(undefined, role);
|
16761 | }
|
16762 | const shouldDismiss = await this.callButtonHandler(button);
|
16763 | if (shouldDismiss) {
|
16764 | return this.dismiss(this.getSelected(), button.role);
|
16765 | }
|
16766 | return Promise.resolve();
|
16767 | }
|
16768 | async callButtonHandler(button) {
|
16769 | if (button) {
|
16770 |
|
16771 |
|
16772 | const rtn = await safeCall(button.handler, this.getSelected());
|
16773 | if (rtn === false) {
|
16774 |
|
16775 | return false;
|
16776 | }
|
16777 | }
|
16778 | return true;
|
16779 | }
|
16780 | getSelected() {
|
16781 | const selected = {};
|
16782 | this.columns.forEach((col, index) => {
|
16783 | const selectedColumn = col.selectedIndex !== undefined
|
16784 | ? col.options[col.selectedIndex]
|
16785 | : undefined;
|
16786 | selected[col.name] = {
|
16787 | text: selectedColumn ? selectedColumn.text : undefined,
|
16788 | value: selectedColumn ? selectedColumn.value : undefined,
|
16789 | columnIndex: index
|
16790 | };
|
16791 | });
|
16792 | return selected;
|
16793 | }
|
16794 | render() {
|
16795 | const mode = getIonMode$1(this);
|
16796 | return (hAsync(Host, { "aria-modal": "true", tabindex: "-1", class: Object.assign({ [mode]: true,
|
16797 |
|
16798 | [`picker-${mode}`]: true }, getClassMap(this.cssClass)), style: {
|
16799 | zIndex: `${20000 + this.overlayIndex}`
|
16800 | }, onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }, hAsync("ion-backdrop", { visible: this.showBackdrop, tappable: this.backdropDismiss }), hAsync("div", { tabindex: "0" }), hAsync("div", { class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, hAsync("div", { class: "picker-toolbar" }, this.buttons.map(b => (hAsync("div", { class: buttonWrapperClass(b) }, hAsync("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass$1(b) }, b.text))))), hAsync("div", { class: "picker-columns" }, hAsync("div", { class: "picker-above-highlight" }), this.presented && this.columns.map(c => hAsync("ion-picker-column", { col: c })), hAsync("div", { class: "picker-below-highlight" }))), hAsync("div", { tabindex: "0" })));
|
16801 | }
|
16802 | get el() { return getElement(this); }
|
16803 | static get style() { return {
|
16804 | ios: pickerIosCss,
|
16805 | md: pickerMdCss
|
16806 | }; }
|
16807 | static get cmpMeta() { return {
|
16808 | "$flags$": 34,
|
16809 | "$tagName$": "ion-picker",
|
16810 | "$members$": {
|
16811 | "overlayIndex": [2, "overlay-index"],
|
16812 | "keyboardClose": [4, "keyboard-close"],
|
16813 | "enterAnimation": [16],
|
16814 | "leaveAnimation": [16],
|
16815 | "buttons": [16],
|
16816 | "columns": [16],
|
16817 | "cssClass": [1, "css-class"],
|
16818 | "duration": [2],
|
16819 | "showBackdrop": [4, "show-backdrop"],
|
16820 | "backdropDismiss": [4, "backdrop-dismiss"],
|
16821 | "animated": [4],
|
16822 | "presented": [32],
|
16823 | "present": [64],
|
16824 | "dismiss": [64],
|
16825 | "onDidDismiss": [64],
|
16826 | "onWillDismiss": [64],
|
16827 | "getColumn": [64]
|
16828 | },
|
16829 | "$listeners$": undefined,
|
16830 | "$lazyBundleId$": "-",
|
16831 | "$attrsToReflect$": []
|
16832 | }; }
|
16833 | }
|
16834 | const buttonWrapperClass = (button) => {
|
16835 | return {
|
16836 | [`picker-toolbar-${button.role}`]: button.role !== undefined,
|
16837 | 'picker-toolbar-button': true
|
16838 | };
|
16839 | };
|
16840 | const buttonClass$1 = (button) => {
|
16841 | return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
|
16842 | };
|
16843 |
|
16844 | const pickerColumnIosCss = ".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{padding-left:4px;padding-right:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}";
|
16845 |
|
16846 | const pickerColumnMdCss = ".picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{left:0;top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}[dir=rtl] .picker-opt,:host-context([dir=rtl]) .picker-opt{left:unset;right:unset;right:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.picker-col{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #3880ff)}";
|
16847 |
|
16848 |
|
16849 |
|
16850 |
|
16851 | class PickerColumnCmp {
|
16852 | constructor(hostRef) {
|
16853 | registerInstance(this, hostRef);
|
16854 | this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
|
16855 | this.optHeight = 0;
|
16856 | this.rotateFactor = 0;
|
16857 | this.scaleFactor = 1;
|
16858 | this.velocity = 0;
|
16859 | this.y = 0;
|
16860 | this.noAnimate = true;
|
16861 | }
|
16862 | colChanged() {
|
16863 | this.refresh();
|
16864 | }
|
16865 | async connectedCallback() {
|
16866 | let pickerRotateFactor = 0;
|
16867 | let pickerScaleFactor = 0.81;
|
16868 | const mode = getIonMode$1(this);
|
16869 | if (mode === 'ios') {
|
16870 | pickerRotateFactor = -0.46;
|
16871 | pickerScaleFactor = 1;
|
16872 | }
|
16873 | this.rotateFactor = pickerRotateFactor;
|
16874 | this.scaleFactor = pickerScaleFactor;
|
16875 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
16876 | el: this.el,
|
16877 | gestureName: 'picker-swipe',
|
16878 | gesturePriority: 100,
|
16879 | threshold: 0,
|
16880 | passive: false,
|
16881 | onStart: ev => this.onStart(ev),
|
16882 | onMove: ev => this.onMove(ev),
|
16883 | onEnd: ev => this.onEnd(ev),
|
16884 | });
|
16885 | this.gesture.enable();
|
16886 | this.tmrId = setTimeout(() => {
|
16887 | this.noAnimate = false;
|
16888 | this.refresh(true);
|
16889 | }, 250);
|
16890 | }
|
16891 | componentDidLoad() {
|
16892 | const colEl = this.optsEl;
|
16893 | if (colEl) {
|
16894 |
|
16895 |
|
16896 | this.optHeight = (colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0);
|
16897 | }
|
16898 | this.refresh();
|
16899 | }
|
16900 | disconnectedCallback() {
|
16901 | cancelAnimationFrame(this.rafId);
|
16902 | clearTimeout(this.tmrId);
|
16903 | if (this.gesture) {
|
16904 | this.gesture.destroy();
|
16905 | this.gesture = undefined;
|
16906 | }
|
16907 | }
|
16908 | emitColChange() {
|
16909 | this.ionPickerColChange.emit(this.col);
|
16910 | }
|
16911 | setSelected(selectedIndex, duration) {
|
16912 |
|
16913 |
|
16914 | const y = (selectedIndex > -1) ? -(selectedIndex * this.optHeight) : 0;
|
16915 | this.velocity = 0;
|
16916 |
|
16917 | cancelAnimationFrame(this.rafId);
|
16918 | this.update(y, duration, true);
|
16919 | this.emitColChange();
|
16920 | }
|
16921 | update(y, duration, saveY) {
|
16922 | if (!this.optsEl) {
|
16923 | return;
|
16924 | }
|
16925 |
|
16926 | let translateY = 0;
|
16927 | let translateZ = 0;
|
16928 | const { col, rotateFactor } = this;
|
16929 | const selectedIndex = col.selectedIndex = this.indexForY(-y);
|
16930 | const durationStr = (duration === 0) ? '' : duration + 'ms';
|
16931 | const scaleStr = `scale(${this.scaleFactor})`;
|
16932 | const children = this.optsEl.children;
|
16933 | for (let i = 0; i < children.length; i++) {
|
16934 | const button = children[i];
|
16935 | const opt = col.options[i];
|
16936 | const optOffset = (i * this.optHeight) + y;
|
16937 | let transform = '';
|
16938 | if (rotateFactor !== 0) {
|
16939 | const rotateX = optOffset * rotateFactor;
|
16940 | if (Math.abs(rotateX) <= 90) {
|
16941 | translateY = 0;
|
16942 | translateZ = 90;
|
16943 | transform = `rotateX(${rotateX}deg) `;
|
16944 | }
|
16945 | else {
|
16946 | translateY = -9999;
|
16947 | }
|
16948 | }
|
16949 | else {
|
16950 | translateZ = 0;
|
16951 | translateY = optOffset;
|
16952 | }
|
16953 | const selected = selectedIndex === i;
|
16954 | transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
|
16955 | if (this.scaleFactor !== 1 && !selected) {
|
16956 | transform += scaleStr;
|
16957 | }
|
16958 |
|
16959 | if (this.noAnimate) {
|
16960 | opt.duration = 0;
|
16961 | button.style.transitionDuration = '';
|
16962 | }
|
16963 | else if (duration !== opt.duration) {
|
16964 | opt.duration = duration;
|
16965 | button.style.transitionDuration = durationStr;
|
16966 | }
|
16967 |
|
16968 | if (transform !== opt.transform) {
|
16969 | opt.transform = transform;
|
16970 | button.style.transform = transform;
|
16971 | }
|
16972 |
|
16973 | if (selected !== opt.selected) {
|
16974 | opt.selected = selected;
|
16975 | if (selected) {
|
16976 | button.classList.add(PICKER_OPT_SELECTED);
|
16977 | }
|
16978 | else {
|
16979 | button.classList.remove(PICKER_OPT_SELECTED);
|
16980 | }
|
16981 | }
|
16982 | }
|
16983 | this.col.prevSelected = selectedIndex;
|
16984 | if (saveY) {
|
16985 | this.y = y;
|
16986 | }
|
16987 | if (this.lastIndex !== selectedIndex) {
|
16988 |
|
16989 | hapticSelectionChanged();
|
16990 | this.lastIndex = selectedIndex;
|
16991 | }
|
16992 | }
|
16993 | decelerate() {
|
16994 | if (this.velocity !== 0) {
|
16995 |
|
16996 | this.velocity *= DECELERATION_FRICTION;
|
16997 |
|
16998 | this.velocity = (this.velocity > 0)
|
16999 | ? Math.max(this.velocity, 1)
|
17000 | : Math.min(this.velocity, -1);
|
17001 | let y = this.y + this.velocity;
|
17002 | if (y > this.minY) {
|
17003 |
|
17004 | y = this.minY;
|
17005 | this.velocity = 0;
|
17006 | }
|
17007 | else if (y < this.maxY) {
|
17008 |
|
17009 | y = this.maxY;
|
17010 | this.velocity = 0;
|
17011 | }
|
17012 | this.update(y, 0, true);
|
17013 | const notLockedIn = (Math.round(y) % this.optHeight !== 0) || (Math.abs(this.velocity) > 1);
|
17014 | if (notLockedIn) {
|
17015 |
|
17016 | this.rafId = requestAnimationFrame(() => this.decelerate());
|
17017 | }
|
17018 | else {
|
17019 | this.velocity = 0;
|
17020 | this.emitColChange();
|
17021 | hapticSelectionEnd();
|
17022 | }
|
17023 | }
|
17024 | else if (this.y % this.optHeight !== 0) {
|
17025 |
|
17026 | const currentPos = Math.abs(this.y % this.optHeight);
|
17027 |
|
17028 | this.velocity = (currentPos > (this.optHeight / 2) ? 1 : -1);
|
17029 | this.decelerate();
|
17030 | }
|
17031 | }
|
17032 | indexForY(y) {
|
17033 | return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
|
17034 | }
|
17035 |
|
17036 | onStart(detail) {
|
17037 |
|
17038 |
|
17039 |
|
17040 | if (detail.event.cancelable) {
|
17041 | detail.event.preventDefault();
|
17042 | }
|
17043 | detail.event.stopPropagation();
|
17044 | hapticSelectionStart();
|
17045 |
|
17046 | cancelAnimationFrame(this.rafId);
|
17047 | const options = this.col.options;
|
17048 | let minY = (options.length - 1);
|
17049 | let maxY = 0;
|
17050 | for (let i = 0; i < options.length; i++) {
|
17051 | if (!options[i].disabled) {
|
17052 | minY = Math.min(minY, i);
|
17053 | maxY = Math.max(maxY, i);
|
17054 | }
|
17055 | }
|
17056 | this.minY = -(minY * this.optHeight);
|
17057 | this.maxY = -(maxY * this.optHeight);
|
17058 | }
|
17059 | onMove(detail) {
|
17060 | if (detail.event.cancelable) {
|
17061 | detail.event.preventDefault();
|
17062 | }
|
17063 | detail.event.stopPropagation();
|
17064 |
|
17065 | let y = this.y + detail.deltaY;
|
17066 | if (y > this.minY) {
|
17067 |
|
17068 | y = Math.pow(y, 0.8);
|
17069 | this.bounceFrom = y;
|
17070 | }
|
17071 | else if (y < this.maxY) {
|
17072 |
|
17073 | y += Math.pow(this.maxY - y, 0.9);
|
17074 | this.bounceFrom = y;
|
17075 | }
|
17076 | else {
|
17077 | this.bounceFrom = 0;
|
17078 | }
|
17079 | this.update(y, 0, false);
|
17080 | }
|
17081 | onEnd(detail) {
|
17082 | if (this.bounceFrom > 0) {
|
17083 |
|
17084 | this.update(this.minY, 100, true);
|
17085 | this.emitColChange();
|
17086 | return;
|
17087 | }
|
17088 | else if (this.bounceFrom < 0) {
|
17089 |
|
17090 | this.update(this.maxY, 100, true);
|
17091 | this.emitColChange();
|
17092 | return;
|
17093 | }
|
17094 | this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
|
17095 | if (this.velocity === 0 && detail.deltaY === 0) {
|
17096 | const opt = detail.event.target.closest('.picker-opt');
|
17097 | if (opt && opt.hasAttribute('opt-index')) {
|
17098 | this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
|
17099 | }
|
17100 | }
|
17101 | else {
|
17102 | this.y += detail.deltaY;
|
17103 | if (Math.abs(detail.velocityY) < 0.05) {
|
17104 | const isScrollingUp = detail.deltaY > 0;
|
17105 | const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
|
17106 | if (isScrollingUp && optHeightFraction > 0.5) {
|
17107 | this.velocity = Math.abs(this.velocity) * -1;
|
17108 | }
|
17109 | else if (!isScrollingUp && optHeightFraction <= 0.5) {
|
17110 | this.velocity = Math.abs(this.velocity);
|
17111 | }
|
17112 | }
|
17113 | this.decelerate();
|
17114 | }
|
17115 | }
|
17116 | refresh(forceRefresh) {
|
17117 | let min = this.col.options.length - 1;
|
17118 | let max = 0;
|
17119 | const options = this.col.options;
|
17120 | for (let i = 0; i < options.length; i++) {
|
17121 | if (!options[i].disabled) {
|
17122 | min = Math.min(min, i);
|
17123 | max = Math.max(max, i);
|
17124 | }
|
17125 | }
|
17126 | |
17127 |
|
17128 |
|
17129 |
|
17130 |
|
17131 |
|
17132 |
|
17133 | if (this.velocity !== 0) {
|
17134 | return;
|
17135 | }
|
17136 | const selectedIndex = clamp(min, this.col.selectedIndex || 0, max);
|
17137 | if (this.col.prevSelected !== selectedIndex || forceRefresh) {
|
17138 | const y = (selectedIndex * this.optHeight) * -1;
|
17139 | this.velocity = 0;
|
17140 | this.update(y, TRANSITION_DURATION, true);
|
17141 | }
|
17142 | }
|
17143 | render() {
|
17144 | const col = this.col;
|
17145 | const Button = 'button';
|
17146 | const mode = getIonMode$1(this);
|
17147 | return (hAsync(Host, { class: {
|
17148 | [mode]: true,
|
17149 | 'picker-col': true,
|
17150 | 'picker-opts-left': this.col.align === 'left',
|
17151 | 'picker-opts-right': this.col.align === 'right'
|
17152 | }, style: {
|
17153 | 'max-width': this.col.columnWidth
|
17154 | } }, col.prefix && (hAsync("div", { class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), hAsync("div", { class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: el => this.optsEl = el }, col.options.map((o, index) => hAsync(Button, { type: "button", class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text))), col.suffix && (hAsync("div", { class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
|
17155 | }
|
17156 | get el() { return getElement(this); }
|
17157 | static get watchers() { return {
|
17158 | "col": ["colChanged"]
|
17159 | }; }
|
17160 | static get style() { return {
|
17161 | ios: pickerColumnIosCss,
|
17162 | md: pickerColumnMdCss
|
17163 | }; }
|
17164 | static get cmpMeta() { return {
|
17165 | "$flags$": 32,
|
17166 | "$tagName$": "ion-picker-column",
|
17167 | "$members$": {
|
17168 | "col": [16]
|
17169 | },
|
17170 | "$listeners$": undefined,
|
17171 | "$lazyBundleId$": "-",
|
17172 | "$attrsToReflect$": []
|
17173 | }; }
|
17174 | }
|
17175 | const PICKER_OPT_SELECTED = 'picker-opt-selected';
|
17176 | const DECELERATION_FRICTION = 0.97;
|
17177 | const MAX_PICKER_SPEED = 90;
|
17178 | const TRANSITION_DURATION = 150;
|
17179 |
|
17180 |
|
17181 |
|
17182 |
|
17183 | const iosEnterAnimation$1 = (baseEl, ev) => {
|
17184 | let originY = 'top';
|
17185 | let originX = 'left';
|
17186 | const contentEl = baseEl.querySelector('.popover-content');
|
17187 | const contentDimentions = contentEl.getBoundingClientRect();
|
17188 | const contentWidth = contentDimentions.width;
|
17189 | const contentHeight = contentDimentions.height;
|
17190 | const bodyWidth = baseEl.ownerDocument.defaultView.innerWidth;
|
17191 | const bodyHeight = baseEl.ownerDocument.defaultView.innerHeight;
|
17192 |
|
17193 | const targetDim = ev && ev.target && ev.target.getBoundingClientRect();
|
17194 | const targetTop = targetDim != null && 'top' in targetDim ? targetDim.top : bodyHeight / 2 - contentHeight / 2;
|
17195 | const targetLeft = targetDim != null && 'left' in targetDim ? targetDim.left : bodyWidth / 2;
|
17196 | const targetWidth = (targetDim && targetDim.width) || 0;
|
17197 | const targetHeight = (targetDim && targetDim.height) || 0;
|
17198 | const arrowEl = baseEl.querySelector('.popover-arrow');
|
17199 | const arrowDim = arrowEl.getBoundingClientRect();
|
17200 | const arrowWidth = arrowDim.width;
|
17201 | const arrowHeight = arrowDim.height;
|
17202 | if (targetDim == null) {
|
17203 | arrowEl.style.display = 'none';
|
17204 | }
|
17205 | const arrowCSS = {
|
17206 | top: targetTop + targetHeight,
|
17207 | left: targetLeft + targetWidth / 2 - arrowWidth / 2
|
17208 | };
|
17209 | const popoverCSS = {
|
17210 | top: targetTop + targetHeight + (arrowHeight - 1),
|
17211 | left: targetLeft + targetWidth / 2 - contentWidth / 2
|
17212 | };
|
17213 |
|
17214 |
|
17215 |
|
17216 |
|
17217 | let checkSafeAreaLeft = false;
|
17218 | let checkSafeAreaRight = false;
|
17219 |
|
17220 |
|
17221 |
|
17222 |
|
17223 |
|
17224 | if (popoverCSS.left < POPOVER_IOS_BODY_PADDING + 25) {
|
17225 | checkSafeAreaLeft = true;
|
17226 | popoverCSS.left = POPOVER_IOS_BODY_PADDING;
|
17227 | }
|
17228 | else if (contentWidth + POPOVER_IOS_BODY_PADDING + popoverCSS.left + 25 > bodyWidth) {
|
17229 |
|
17230 |
|
17231 |
|
17232 | checkSafeAreaRight = true;
|
17233 | popoverCSS.left = bodyWidth - contentWidth - POPOVER_IOS_BODY_PADDING;
|
17234 | originX = 'right';
|
17235 | }
|
17236 |
|
17237 | if (targetTop + targetHeight + contentHeight > bodyHeight && targetTop - contentHeight > 0) {
|
17238 | arrowCSS.top = targetTop - (arrowHeight + 1);
|
17239 | popoverCSS.top = targetTop - contentHeight - (arrowHeight - 1);
|
17240 | baseEl.className = baseEl.className + ' popover-bottom';
|
17241 | originY = 'bottom';
|
17242 |
|
17243 | }
|
17244 | else if (targetTop + targetHeight + contentHeight > bodyHeight) {
|
17245 | contentEl.style.bottom = POPOVER_IOS_BODY_PADDING + '%';
|
17246 | }
|
17247 | arrowEl.style.top = arrowCSS.top + 'px';
|
17248 | arrowEl.style.left = arrowCSS.left + 'px';
|
17249 | contentEl.style.top = popoverCSS.top + 'px';
|
17250 | contentEl.style.left = popoverCSS.left + 'px';
|
17251 | if (checkSafeAreaLeft) {
|
17252 | contentEl.style.left = `calc(${popoverCSS.left}px + var(--ion-safe-area-left, 0px))`;
|
17253 | }
|
17254 | if (checkSafeAreaRight) {
|
17255 | contentEl.style.left = `calc(${popoverCSS.left}px - var(--ion-safe-area-right, 0px))`;
|
17256 | }
|
17257 | contentEl.style.transformOrigin = originY + ' ' + originX;
|
17258 | const baseAnimation = createAnimation();
|
17259 | const backdropAnimation = createAnimation();
|
17260 | const wrapperAnimation = createAnimation();
|
17261 | backdropAnimation
|
17262 | .addElement(baseEl.querySelector('ion-backdrop'))
|
17263 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
17264 | .beforeStyles({
|
17265 | 'pointer-events': 'none'
|
17266 | })
|
17267 | .afterClearStyles(['pointer-events']);
|
17268 | wrapperAnimation
|
17269 | .addElement(baseEl.querySelector('.popover-wrapper'))
|
17270 | .fromTo('opacity', 0.01, 1);
|
17271 | return baseAnimation
|
17272 | .addElement(baseEl)
|
17273 | .easing('ease')
|
17274 | .duration(100)
|
17275 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
17276 | };
|
17277 | const POPOVER_IOS_BODY_PADDING = 5;
|
17278 |
|
17279 |
|
17280 |
|
17281 |
|
17282 | const iosLeaveAnimation$1 = (baseEl) => {
|
17283 | const baseAnimation = createAnimation();
|
17284 | const backdropAnimation = createAnimation();
|
17285 | const wrapperAnimation = createAnimation();
|
17286 | backdropAnimation
|
17287 | .addElement(baseEl.querySelector('ion-backdrop'))
|
17288 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
17289 | wrapperAnimation
|
17290 | .addElement(baseEl.querySelector('.popover-wrapper'))
|
17291 | .fromTo('opacity', 0.99, 0);
|
17292 | return baseAnimation
|
17293 | .addElement(baseEl)
|
17294 | .easing('ease')
|
17295 | .duration(500)
|
17296 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
17297 | };
|
17298 |
|
17299 |
|
17300 |
|
17301 |
|
17302 | const mdEnterAnimation$1 = (baseEl, ev) => {
|
17303 | const POPOVER_MD_BODY_PADDING = 12;
|
17304 | const doc = baseEl.ownerDocument;
|
17305 | const isRTL = doc.dir === 'rtl';
|
17306 | let originY = 'top';
|
17307 | let originX = isRTL ? 'right' : 'left';
|
17308 | const contentEl = baseEl.querySelector('.popover-content');
|
17309 | const contentDimentions = contentEl.getBoundingClientRect();
|
17310 | const contentWidth = contentDimentions.width;
|
17311 | const contentHeight = contentDimentions.height;
|
17312 | const bodyWidth = doc.defaultView.innerWidth;
|
17313 | const bodyHeight = doc.defaultView.innerHeight;
|
17314 |
|
17315 | const targetDim = ev && ev.target && ev.target.getBoundingClientRect();
|
17316 |
|
17317 | const targetTop = targetDim != null && 'bottom' in targetDim
|
17318 | ? targetDim.bottom
|
17319 | : bodyHeight / 2 - contentHeight / 2;
|
17320 | const targetLeft = targetDim != null && 'left' in targetDim
|
17321 | ? isRTL
|
17322 | ? targetDim.left - contentWidth + targetDim.width
|
17323 | : targetDim.left
|
17324 | : bodyWidth / 2 - contentWidth / 2;
|
17325 | const targetHeight = (targetDim && targetDim.height) || 0;
|
17326 | const popoverCSS = {
|
17327 | top: targetTop,
|
17328 | left: targetLeft
|
17329 | };
|
17330 |
|
17331 |
|
17332 |
|
17333 | if (popoverCSS.left < POPOVER_MD_BODY_PADDING) {
|
17334 | popoverCSS.left = POPOVER_MD_BODY_PADDING;
|
17335 |
|
17336 |
|
17337 | originX = 'left';
|
17338 | }
|
17339 | else if (contentWidth + POPOVER_MD_BODY_PADDING + popoverCSS.left >
|
17340 | bodyWidth) {
|
17341 | popoverCSS.left = bodyWidth - contentWidth - POPOVER_MD_BODY_PADDING;
|
17342 |
|
17343 |
|
17344 | originX = 'right';
|
17345 | }
|
17346 |
|
17347 |
|
17348 | if (targetTop + targetHeight + contentHeight > bodyHeight &&
|
17349 | targetTop - contentHeight > 0) {
|
17350 | popoverCSS.top = targetTop - contentHeight - targetHeight;
|
17351 | baseEl.className = baseEl.className + ' popover-bottom';
|
17352 | originY = 'bottom';
|
17353 |
|
17354 | }
|
17355 | else if (targetTop + targetHeight + contentHeight > bodyHeight) {
|
17356 | contentEl.style.bottom = POPOVER_MD_BODY_PADDING + 'px';
|
17357 | }
|
17358 | const baseAnimation = createAnimation();
|
17359 | const backdropAnimation = createAnimation();
|
17360 | const wrapperAnimation = createAnimation();
|
17361 | const contentAnimation = createAnimation();
|
17362 | const viewportAnimation = createAnimation();
|
17363 | backdropAnimation
|
17364 | .addElement(baseEl.querySelector('ion-backdrop'))
|
17365 | .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
|
17366 | .beforeStyles({
|
17367 | 'pointer-events': 'none'
|
17368 | })
|
17369 | .afterClearStyles(['pointer-events']);
|
17370 | wrapperAnimation
|
17371 | .addElement(baseEl.querySelector('.popover-wrapper'))
|
17372 | .fromTo('opacity', 0.01, 1);
|
17373 | contentAnimation
|
17374 | .addElement(contentEl)
|
17375 | .beforeStyles({
|
17376 | 'top': `${popoverCSS.top}px`,
|
17377 | 'left': `${popoverCSS.left}px`,
|
17378 | 'transform-origin': `${originY} ${originX}`
|
17379 | })
|
17380 | .fromTo('transform', 'scale(0.001)', 'scale(1)');
|
17381 | viewportAnimation
|
17382 | .addElement(baseEl.querySelector('.popover-viewport'))
|
17383 | .fromTo('opacity', 0.01, 1);
|
17384 | return baseAnimation
|
17385 | .addElement(baseEl)
|
17386 | .easing('cubic-bezier(0.36,0.66,0.04,1)')
|
17387 | .duration(300)
|
17388 | .addAnimation([backdropAnimation, wrapperAnimation, contentAnimation, viewportAnimation]);
|
17389 | };
|
17390 |
|
17391 |
|
17392 |
|
17393 |
|
17394 | const mdLeaveAnimation$1 = (baseEl) => {
|
17395 | const baseAnimation = createAnimation();
|
17396 | const backdropAnimation = createAnimation();
|
17397 | const wrapperAnimation = createAnimation();
|
17398 | backdropAnimation
|
17399 | .addElement(baseEl.querySelector('ion-backdrop'))
|
17400 | .fromTo('opacity', 'var(--backdrop-opacity)', 0);
|
17401 | wrapperAnimation
|
17402 | .addElement(baseEl.querySelector('.popover-wrapper'))
|
17403 | .fromTo('opacity', 0.99, 0);
|
17404 | return baseAnimation
|
17405 | .addElement(baseEl)
|
17406 | .easing('ease')
|
17407 | .duration(500)
|
17408 | .addAnimation([backdropAnimation, wrapperAnimation]);
|
17409 | };
|
17410 |
|
17411 | const popoverIosCss = ".sc-ion-popover-ios-h{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}.overlay-hidden.sc-ion-popover-ios-h{display:none}.popover-wrapper.sc-ion-popover-ios{opacity:0;z-index:10}.popover-content.sc-ion-popover-ios{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport.sc-ion-popover-ios{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px}.sc-ion-popover-ios-h{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}.popover-content.sc-ion-popover-ios{border-radius:10px}.popover-arrow.sc-ion-popover-ios{display:block;position:absolute;width:20px;height:10px;overflow:hidden}.popover-arrow.sc-ion-popover-ios::after{left:3px;top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:\"\";z-index:10}[dir=rtl].sc-ion-popover-ios .popover-arrow.sc-ion-popover-ios::after,[dir=rtl].sc-ion-popover-ios-h .popover-arrow.sc-ion-popover-ios::after,[dir=rtl] .sc-ion-popover-ios-h .popover-arrow.sc-ion-popover-ios::after{left:unset;right:unset;right:3px}.popover-bottom.sc-ion-popover-ios-h .popover-arrow.sc-ion-popover-ios{top:auto;bottom:-10px}.popover-bottom.sc-ion-popover-ios-h .popover-arrow.sc-ion-popover-ios::after{top:-6px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.popover-translucent.sc-ion-popover-ios-h .popover-content.sc-ion-popover-ios,.popover-translucent.sc-ion-popover-ios-h .popover-arrow.sc-ion-popover-ios::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}";
|
17412 |
|
17413 | const popoverMdCss = ".sc-ion-popover-md-h{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}.overlay-hidden.sc-ion-popover-md-h{display:none}.popover-wrapper.sc-ion-popover-md{opacity:0;z-index:10}.popover-content.sc-ion-popover-md{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport.sc-ion-popover-md{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px}.sc-ion-popover-md-h{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content.sc-ion-popover-md{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}[dir=rtl].sc-ion-popover-md .popover-content.sc-ion-popover-md,[dir=rtl].sc-ion-popover-md-h .popover-content.sc-ion-popover-md,[dir=rtl] .sc-ion-popover-md-h .popover-content.sc-ion-popover-md{-webkit-transform-origin:right top;transform-origin:right top}.popover-viewport.sc-ion-popover-md{-webkit-transition-delay:100ms;transition-delay:100ms}";
|
17414 |
|
17415 |
|
17416 |
|
17417 |
|
17418 | class Popover {
|
17419 | constructor(hostRef) {
|
17420 | registerInstance(this, hostRef);
|
17421 | this.didPresent = createEvent(this, "ionPopoverDidPresent", 7);
|
17422 | this.willPresent = createEvent(this, "ionPopoverWillPresent", 7);
|
17423 | this.willDismiss = createEvent(this, "ionPopoverWillDismiss", 7);
|
17424 | this.didDismiss = createEvent(this, "ionPopoverDidDismiss", 7);
|
17425 | this.presented = false;
|
17426 | |
17427 |
|
17428 |
|
17429 | this.keyboardClose = true;
|
17430 | |
17431 |
|
17432 |
|
17433 | this.backdropDismiss = true;
|
17434 | |
17435 |
|
17436 |
|
17437 | this.showBackdrop = true;
|
17438 | |
17439 |
|
17440 |
|
17441 |
|
17442 |
|
17443 | this.translucent = false;
|
17444 | |
17445 |
|
17446 |
|
17447 | this.animated = true;
|
17448 | this.onDismiss = (ev) => {
|
17449 | ev.stopPropagation();
|
17450 | ev.preventDefault();
|
17451 | this.dismiss();
|
17452 | };
|
17453 | this.onBackdropTap = () => {
|
17454 | this.dismiss(undefined, BACKDROP);
|
17455 | };
|
17456 | this.onLifecycle = (modalEvent) => {
|
17457 | const el = this.usersElement;
|
17458 | const name = LIFECYCLE_MAP[modalEvent.type];
|
17459 | if (el && name) {
|
17460 | const event = new CustomEvent(name, {
|
17461 | bubbles: false,
|
17462 | cancelable: false,
|
17463 | detail: modalEvent.detail
|
17464 | });
|
17465 | el.dispatchEvent(event);
|
17466 | }
|
17467 | };
|
17468 | }
|
17469 | connectedCallback() {
|
17470 | prepareOverlay(this.el);
|
17471 | }
|
17472 | |
17473 |
|
17474 |
|
17475 | async present() {
|
17476 | if (this.presented) {
|
17477 | return;
|
17478 | }
|
17479 | const container = this.el.querySelector('.popover-content');
|
17480 | if (!container) {
|
17481 | throw new Error('container is undefined');
|
17482 | }
|
17483 | const data = Object.assign(Object.assign({}, this.componentProps), { popover: this.el });
|
17484 | this.usersElement = await attachComponent(this.delegate, container, this.component, ['popover-viewport', this.el['s-sc']], data);
|
17485 | await deepReady(this.usersElement);
|
17486 | return present(this, 'popoverEnter', iosEnterAnimation$1, mdEnterAnimation$1, this.event);
|
17487 | }
|
17488 | |
17489 |
|
17490 |
|
17491 |
|
17492 |
|
17493 |
|
17494 | async dismiss(data, role) {
|
17495 | const shouldDismiss = await dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation$1, mdLeaveAnimation$1, this.event);
|
17496 | if (shouldDismiss) {
|
17497 | await detachComponent(this.delegate, this.usersElement);
|
17498 | }
|
17499 | return shouldDismiss;
|
17500 | }
|
17501 | |
17502 |
|
17503 |
|
17504 | onDidDismiss() {
|
17505 | return eventMethod(this.el, 'ionPopoverDidDismiss');
|
17506 | }
|
17507 | |
17508 |
|
17509 |
|
17510 | onWillDismiss() {
|
17511 | return eventMethod(this.el, 'ionPopoverWillDismiss');
|
17512 | }
|
17513 | render() {
|
17514 | const mode = getIonMode$1(this);
|
17515 | const { onLifecycle } = this;
|
17516 | return (hAsync(Host, { "aria-modal": "true", "no-router": true, tabindex: "-1", style: {
|
17517 | zIndex: `${20000 + this.overlayIndex}`,
|
17518 | }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonDismiss: this.onDismiss, onIonBackdropTap: this.onBackdropTap }, hAsync("ion-backdrop", { tappable: this.backdropDismiss, visible: this.showBackdrop }), hAsync("div", { tabindex: "0" }), hAsync("div", { class: "popover-wrapper ion-overlay-wrapper" }, hAsync("div", { class: "popover-arrow" }), hAsync("div", { class: "popover-content" })), hAsync("div", { tabindex: "0" })));
|
17519 | }
|
17520 | get el() { return getElement(this); }
|
17521 | static get style() { return {
|
17522 | ios: popoverIosCss,
|
17523 | md: popoverMdCss
|
17524 | }; }
|
17525 | static get cmpMeta() { return {
|
17526 | "$flags$": 34,
|
17527 | "$tagName$": "ion-popover",
|
17528 | "$members$": {
|
17529 | "delegate": [16],
|
17530 | "overlayIndex": [2, "overlay-index"],
|
17531 | "enterAnimation": [16],
|
17532 | "leaveAnimation": [16],
|
17533 | "component": [1],
|
17534 | "componentProps": [16],
|
17535 | "keyboardClose": [4, "keyboard-close"],
|
17536 | "cssClass": [1, "css-class"],
|
17537 | "backdropDismiss": [4, "backdrop-dismiss"],
|
17538 | "event": [8],
|
17539 | "showBackdrop": [4, "show-backdrop"],
|
17540 | "translucent": [4],
|
17541 | "animated": [4],
|
17542 | "present": [64],
|
17543 | "dismiss": [64],
|
17544 | "onDidDismiss": [64],
|
17545 | "onWillDismiss": [64]
|
17546 | },
|
17547 | "$listeners$": undefined,
|
17548 | "$lazyBundleId$": "-",
|
17549 | "$attrsToReflect$": []
|
17550 | }; }
|
17551 | }
|
17552 | const LIFECYCLE_MAP = {
|
17553 | 'ionPopoverDidPresent': 'ionViewDidEnter',
|
17554 | 'ionPopoverWillPresent': 'ionViewWillEnter',
|
17555 | 'ionPopoverWillDismiss': 'ionViewWillLeave',
|
17556 | 'ionPopoverDidDismiss': 'ionViewDidLeave',
|
17557 | };
|
17558 |
|
17559 | const progressBarIosCss = "/*!@:host*/.sc-ion-progress-bar-ios-h{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}/*!@.progress,\n.progress-indeterminate,\n.indeterminate-bar-primary,\n.indeterminate-bar-secondary,\n.progress-buffer-bar*/.progress.sc-ion-progress-bar-ios,.progress-indeterminate.sc-ion-progress-bar-ios,.indeterminate-bar-primary.sc-ion-progress-bar-ios,.indeterminate-bar-secondary.sc-ion-progress-bar-ios,.progress-buffer-bar.sc-ion-progress-bar-ios{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}/*!@.buffer-circles-container,\n.buffer-circles*/.buffer-circles-container.sc-ion-progress-bar-ios,.buffer-circles.sc-ion-progress-bar-ios{left:0;right:0;top:0;bottom:0;position:absolute}/*!@.buffer-circles*/.buffer-circles.sc-ion-progress-bar-ios{right:-10px;left:-10px}/*!@.progress,\n.progress-buffer-bar,\n.buffer-circles-container*/.progress.sc-ion-progress-bar-ios,.progress-buffer-bar.sc-ion-progress-bar-ios,.buffer-circles-container.sc-ion-progress-bar-ios{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:-webkit-transform 150ms linear;transition:-webkit-transform 150ms linear;transition:transform 150ms linear;transition:transform 150ms linear, -webkit-transform 150ms linear}/*!@.progress,\n.progress-indeterminate*/.progress.sc-ion-progress-bar-ios,.progress-indeterminate.sc-ion-progress-bar-ios{background:var(--progress-background);z-index:2}/*!@.progress-buffer-bar*/.progress-buffer-bar.sc-ion-progress-bar-ios{background:var(--buffer-background);z-index:1}/*!@.buffer-circles-container*/.buffer-circles-container.sc-ion-progress-bar-ios{overflow:hidden}/*!@.indeterminate-bar-primary*/.indeterminate-bar-primary.sc-ion-progress-bar-ios{top:0;right:0;bottom:0;left:-145.166611%;-webkit-animation:primary-indeterminate-translate 2s infinite linear;animation:primary-indeterminate-translate 2s infinite linear}/*!@.indeterminate-bar-primary .progress-indeterminate*/.indeterminate-bar-primary.sc-ion-progress-bar-ios .progress-indeterminate.sc-ion-progress-bar-ios{-webkit-animation:primary-indeterminate-scale 2s infinite linear;animation:primary-indeterminate-scale 2s infinite linear;-webkit-animation-play-state:inherit;animation-play-state:inherit}/*!@.indeterminate-bar-secondary*/.indeterminate-bar-secondary.sc-ion-progress-bar-ios{top:0;right:0;bottom:0;left:-54.888891%;-webkit-animation:secondary-indeterminate-translate 2s infinite linear;animation:secondary-indeterminate-translate 2s infinite linear}/*!@.indeterminate-bar-secondary .progress-indeterminate*/.indeterminate-bar-secondary.sc-ion-progress-bar-ios .progress-indeterminate.sc-ion-progress-bar-ios{-webkit-animation:secondary-indeterminate-scale 2s infinite linear;animation:secondary-indeterminate-scale 2s infinite linear;-webkit-animation-play-state:inherit;animation-play-state:inherit}/*!@.buffer-circles*/.buffer-circles.sc-ion-progress-bar-ios{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;-webkit-animation:buffering 450ms infinite linear;animation:buffering 450ms infinite linear}/*!@:host(.progress-bar-reversed)*/.progress-bar-reversed.sc-ion-progress-bar-ios-h{-webkit-transform:scaleX(-1);transform:scaleX(-1)}/*!@:host(.progress-paused) .indeterminate-bar-secondary,\n:host(.progress-paused) .indeterminate-bar-primary,\n:host(.progress-paused) .buffer-circles*/.progress-paused.sc-ion-progress-bar-ios-h .indeterminate-bar-secondary.sc-ion-progress-bar-ios,.progress-paused.sc-ion-progress-bar-ios-h .indeterminate-bar-primary.sc-ion-progress-bar-ios,.progress-paused.sc-ion-progress-bar-ios-h .buffer-circles.sc-ion-progress-bar-ios{-webkit-animation-play-state:paused;animation-play-state:paused}/*!@:host(.ion-color) .progress-buffer-bar*/.ion-color.sc-ion-progress-bar-ios-h .progress-buffer-bar.sc-ion-progress-bar-ios{background:rgba(var(--ion-color-base-rgb), 0.3)}/*!@:host(.ion-color) .buffer-circles*/.ion-color.sc-ion-progress-bar-ios-h .buffer-circles.sc-ion-progress-bar-ios{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}/*!@:host(.ion-color) .progress,\n:host(.ion-color) .progress-indeterminate*/.ion-color.sc-ion-progress-bar-ios-h .progress.sc-ion-progress-bar-ios,.ion-color.sc-ion-progress-bar-ios-h .progress-indeterminate.sc-ion-progress-bar-ios{background:var(--ion-color-base)}@-webkit-keyframes primary-indeterminate-translate{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);-webkit-transform:translateX(83.67142%);transform:translateX(83.67142%)}100%{-webkit-transform:translateX(200.611057%);transform:translateX(200.611057%)}}@keyframes primary-indeterminate-translate{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);-webkit-transform:translateX(83.67142%);transform:translateX(83.67142%)}100%{-webkit-transform:translateX(200.611057%);transform:translateX(200.611057%)}}@-webkit-keyframes primary-indeterminate-scale{0%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}36.65%{-webkit-animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}69.15%{-webkit-animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);-webkit-transform:scaleX(0.661479);transform:scaleX(0.661479)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@keyframes primary-indeterminate-scale{0%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}36.65%{-webkit-animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}69.15%{-webkit-animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);-webkit-transform:scaleX(0.661479);transform:scaleX(0.661479)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@-webkit-keyframes secondary-indeterminate-translate{0%{-webkit-animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);-webkit-transform:translateX(37.651913%);transform:translateX(37.651913%)}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);-webkit-transform:translateX(84.386165%);transform:translateX(84.386165%)}100%{-webkit-transform:translateX(160.277782%);transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-translate{0%{-webkit-animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);-webkit-transform:translateX(37.651913%);transform:translateX(37.651913%)}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);-webkit-transform:translateX(84.386165%);transform:translateX(84.386165%)}100%{-webkit-transform:translateX(160.277782%);transform:translateX(160.277782%)}}@-webkit-keyframes secondary-indeterminate-scale{0%{-webkit-animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}19.15%{-webkit-animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);-webkit-transform:scaleX(0.457104);transform:scaleX(0.457104)}44.15%{-webkit-animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);-webkit-transform:scaleX(0.72796);transform:scaleX(0.72796)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@keyframes secondary-indeterminate-scale{0%{-webkit-animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}19.15%{-webkit-animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);-webkit-transform:scaleX(0.457104);transform:scaleX(0.457104)}44.15%{-webkit-animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);-webkit-transform:scaleX(0.72796);transform:scaleX(0.72796)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@-webkit-keyframes buffering{to{-webkit-transform:translateX(-10px);transform:translateX(-10px)}}@keyframes buffering{to{-webkit-transform:translateX(-10px);transform:translateX(-10px)}}/*!@:host*/.sc-ion-progress-bar-ios-h{height:3px}";
|
17560 |
|
17561 | const progressBarMdCss = "/*!@:host*/.sc-ion-progress-bar-md-h{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.3);--progress-background:var(--ion-color-primary, #3880ff);--buffer-background:var(--background);display:block;position:relative;width:100%;contain:strict;direction:ltr;overflow:hidden}/*!@.progress,\n.progress-indeterminate,\n.indeterminate-bar-primary,\n.indeterminate-bar-secondary,\n.progress-buffer-bar*/.progress.sc-ion-progress-bar-md,.progress-indeterminate.sc-ion-progress-bar-md,.indeterminate-bar-primary.sc-ion-progress-bar-md,.indeterminate-bar-secondary.sc-ion-progress-bar-md,.progress-buffer-bar.sc-ion-progress-bar-md{left:0;right:0;top:0;bottom:0;position:absolute;width:100%;height:100%}/*!@.buffer-circles-container,\n.buffer-circles*/.buffer-circles-container.sc-ion-progress-bar-md,.buffer-circles.sc-ion-progress-bar-md{left:0;right:0;top:0;bottom:0;position:absolute}/*!@.buffer-circles*/.buffer-circles.sc-ion-progress-bar-md{right:-10px;left:-10px}/*!@.progress,\n.progress-buffer-bar,\n.buffer-circles-container*/.progress.sc-ion-progress-bar-md,.progress-buffer-bar.sc-ion-progress-bar-md,.buffer-circles-container.sc-ion-progress-bar-md{-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:-webkit-transform 150ms linear;transition:-webkit-transform 150ms linear;transition:transform 150ms linear;transition:transform 150ms linear, -webkit-transform 150ms linear}/*!@.progress,\n.progress-indeterminate*/.progress.sc-ion-progress-bar-md,.progress-indeterminate.sc-ion-progress-bar-md{background:var(--progress-background);z-index:2}/*!@.progress-buffer-bar*/.progress-buffer-bar.sc-ion-progress-bar-md{background:var(--buffer-background);z-index:1}/*!@.buffer-circles-container*/.buffer-circles-container.sc-ion-progress-bar-md{overflow:hidden}/*!@.indeterminate-bar-primary*/.indeterminate-bar-primary.sc-ion-progress-bar-md{top:0;right:0;bottom:0;left:-145.166611%;-webkit-animation:primary-indeterminate-translate 2s infinite linear;animation:primary-indeterminate-translate 2s infinite linear}/*!@.indeterminate-bar-primary .progress-indeterminate*/.indeterminate-bar-primary.sc-ion-progress-bar-md .progress-indeterminate.sc-ion-progress-bar-md{-webkit-animation:primary-indeterminate-scale 2s infinite linear;animation:primary-indeterminate-scale 2s infinite linear;-webkit-animation-play-state:inherit;animation-play-state:inherit}/*!@.indeterminate-bar-secondary*/.indeterminate-bar-secondary.sc-ion-progress-bar-md{top:0;right:0;bottom:0;left:-54.888891%;-webkit-animation:secondary-indeterminate-translate 2s infinite linear;animation:secondary-indeterminate-translate 2s infinite linear}/*!@.indeterminate-bar-secondary .progress-indeterminate*/.indeterminate-bar-secondary.sc-ion-progress-bar-md .progress-indeterminate.sc-ion-progress-bar-md{-webkit-animation:secondary-indeterminate-scale 2s infinite linear;animation:secondary-indeterminate-scale 2s infinite linear;-webkit-animation-play-state:inherit;animation-play-state:inherit}/*!@.buffer-circles*/.buffer-circles.sc-ion-progress-bar-md{background-image:radial-gradient(ellipse at center, var(--buffer-background) 0%, var(--buffer-background) 30%, transparent 30%);background-repeat:repeat-x;background-position:5px center;background-size:10px 10px;z-index:0;-webkit-animation:buffering 450ms infinite linear;animation:buffering 450ms infinite linear}/*!@:host(.progress-bar-reversed)*/.progress-bar-reversed.sc-ion-progress-bar-md-h{-webkit-transform:scaleX(-1);transform:scaleX(-1)}/*!@:host(.progress-paused) .indeterminate-bar-secondary,\n:host(.progress-paused) .indeterminate-bar-primary,\n:host(.progress-paused) .buffer-circles*/.progress-paused.sc-ion-progress-bar-md-h .indeterminate-bar-secondary.sc-ion-progress-bar-md,.progress-paused.sc-ion-progress-bar-md-h .indeterminate-bar-primary.sc-ion-progress-bar-md,.progress-paused.sc-ion-progress-bar-md-h .buffer-circles.sc-ion-progress-bar-md{-webkit-animation-play-state:paused;animation-play-state:paused}/*!@:host(.ion-color) .progress-buffer-bar*/.ion-color.sc-ion-progress-bar-md-h .progress-buffer-bar.sc-ion-progress-bar-md{background:rgba(var(--ion-color-base-rgb), 0.3)}/*!@:host(.ion-color) .buffer-circles*/.ion-color.sc-ion-progress-bar-md-h .buffer-circles.sc-ion-progress-bar-md{background-image:radial-gradient(ellipse at center, rgba(var(--ion-color-base-rgb), 0.3) 0%, rgba(var(--ion-color-base-rgb), 0.3) 30%, transparent 30%)}/*!@:host(.ion-color) .progress,\n:host(.ion-color) .progress-indeterminate*/.ion-color.sc-ion-progress-bar-md-h .progress.sc-ion-progress-bar-md,.ion-color.sc-ion-progress-bar-md-h .progress-indeterminate.sc-ion-progress-bar-md{background:var(--ion-color-base)}@-webkit-keyframes primary-indeterminate-translate{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);-webkit-transform:translateX(83.67142%);transform:translateX(83.67142%)}100%{-webkit-transform:translateX(200.611057%);transform:translateX(200.611057%)}}@keyframes primary-indeterminate-translate{0%{-webkit-transform:translateX(0);transform:translateX(0)}20%{-webkit-animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);-webkit-transform:translateX(0);transform:translateX(0)}59.15%{-webkit-animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);-webkit-transform:translateX(83.67142%);transform:translateX(83.67142%)}100%{-webkit-transform:translateX(200.611057%);transform:translateX(200.611057%)}}@-webkit-keyframes primary-indeterminate-scale{0%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}36.65%{-webkit-animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}69.15%{-webkit-animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);-webkit-transform:scaleX(0.661479);transform:scaleX(0.661479)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@keyframes primary-indeterminate-scale{0%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}36.65%{-webkit-animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}69.15%{-webkit-animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);-webkit-transform:scaleX(0.661479);transform:scaleX(0.661479)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@-webkit-keyframes secondary-indeterminate-translate{0%{-webkit-animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);-webkit-transform:translateX(37.651913%);transform:translateX(37.651913%)}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);-webkit-transform:translateX(84.386165%);transform:translateX(84.386165%)}100%{-webkit-transform:translateX(160.277782%);transform:translateX(160.277782%)}}@keyframes secondary-indeterminate-translate{0%{-webkit-animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);-webkit-transform:translateX(0);transform:translateX(0)}25%{-webkit-animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);-webkit-transform:translateX(37.651913%);transform:translateX(37.651913%)}48.35%{-webkit-animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);-webkit-transform:translateX(84.386165%);transform:translateX(84.386165%)}100%{-webkit-transform:translateX(160.277782%);transform:translateX(160.277782%)}}@-webkit-keyframes secondary-indeterminate-scale{0%{-webkit-animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}19.15%{-webkit-animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);-webkit-transform:scaleX(0.457104);transform:scaleX(0.457104)}44.15%{-webkit-animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);-webkit-transform:scaleX(0.72796);transform:scaleX(0.72796)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@keyframes secondary-indeterminate-scale{0%{-webkit-animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}19.15%{-webkit-animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.004315);-webkit-transform:scaleX(0.457104);transform:scaleX(0.457104)}44.15%{-webkit-animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);-webkit-transform:scaleX(0.72796);transform:scaleX(0.72796)}100%{-webkit-transform:scaleX(0.08);transform:scaleX(0.08)}}@-webkit-keyframes buffering{to{-webkit-transform:translateX(-10px);transform:translateX(-10px)}}@keyframes buffering{to{-webkit-transform:translateX(-10px);transform:translateX(-10px)}}/*!@:host*/.sc-ion-progress-bar-md-h{height:4px}";
|
17562 |
|
17563 |
|
17564 |
|
17565 |
|
17566 |
|
17567 |
|
17568 |
|
17569 |
|
17570 |
|
17571 | class ProgressBar {
|
17572 | constructor(hostRef) {
|
17573 | registerInstance(this, hostRef);
|
17574 | |
17575 |
|
17576 |
|
17577 |
|
17578 | this.type = 'determinate';
|
17579 | |
17580 |
|
17581 |
|
17582 | this.reversed = false;
|
17583 | |
17584 |
|
17585 |
|
17586 |
|
17587 |
|
17588 | this.value = 0;
|
17589 | |
17590 |
|
17591 |
|
17592 |
|
17593 | this.buffer = 1;
|
17594 | }
|
17595 | render() {
|
17596 | const { color, type, reversed, value, buffer } = this;
|
17597 | const paused = config.getBoolean('_testing');
|
17598 | const mode = getIonMode$1(this);
|
17599 | return (hAsync(Host, { role: "progressbar", "aria-valuenow": type === 'determinate' ? value : null, "aria-valuemin": "0", "aria-valuemax": "1", class: createColorClasses$1(color, {
|
17600 | [mode]: true,
|
17601 | [`progress-bar-${type}`]: true,
|
17602 | 'progress-paused': paused,
|
17603 | 'progress-bar-reversed': document.dir === 'rtl' ? !reversed : reversed
|
17604 | }) }, type === 'indeterminate'
|
17605 | ? renderIndeterminate()
|
17606 | : renderProgress(value, buffer)));
|
17607 | }
|
17608 | static get style() { return {
|
17609 | ios: progressBarIosCss,
|
17610 | md: progressBarMdCss
|
17611 | }; }
|
17612 | static get cmpMeta() { return {
|
17613 | "$flags$": 41,
|
17614 | "$tagName$": "ion-progress-bar",
|
17615 | "$members$": {
|
17616 | "type": [1],
|
17617 | "reversed": [4],
|
17618 | "value": [2],
|
17619 | "buffer": [2],
|
17620 | "color": [513]
|
17621 | },
|
17622 | "$listeners$": undefined,
|
17623 | "$lazyBundleId$": "-",
|
17624 | "$attrsToReflect$": [["color", "color"]]
|
17625 | }; }
|
17626 | }
|
17627 | const renderIndeterminate = () => {
|
17628 | return (hAsync("div", { part: "track", class: "progress-buffer-bar" }, hAsync("div", { class: "indeterminate-bar-primary" }, hAsync("span", { part: "progress", class: "progress-indeterminate" })), hAsync("div", { class: "indeterminate-bar-secondary" }, hAsync("span", { part: "progress", class: "progress-indeterminate" }))));
|
17629 | };
|
17630 | const renderProgress = (value, buffer) => {
|
17631 | const finalValue = clamp(0, value, 1);
|
17632 | const finalBuffer = clamp(0, buffer, 1);
|
17633 | return [
|
17634 | hAsync("div", { part: "progress", class: "progress", style: { transform: `scaleX(${finalValue})` } }),
|
17635 | |
17636 |
|
17637 |
|
17638 |
|
17639 |
|
17640 |
|
17641 |
|
17642 | hAsync("div", { class: { 'buffer-circles-container': true, 'ion-hide': finalBuffer === 1 }, style: { transform: `translateX(${finalBuffer * 100}%)` } }, hAsync("div", { class: "buffer-circles-container", style: { transform: `translateX(-${finalBuffer * 100}%)` } }, hAsync("div", { part: "stream", class: "buffer-circles" }))),
|
17643 | hAsync("div", { part: "track", class: "progress-buffer-bar", style: { transform: `scaleX(${finalBuffer})` } }),
|
17644 | ];
|
17645 | };
|
17646 |
|
17647 | const radioIosCss = "/*!@:host*/.sc-ion-radio-ios-h{--inner-border-radius:50%;display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.radio-disabled)*/.radio-disabled.sc-ion-radio-ios-h{pointer-events:none}/*!@.radio-icon*/.radio-icon.sc-ion-radio-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}/*!@.radio-icon,\n.radio-inner*/.radio-icon.sc-ion-radio-ios,.radio-inner.sc-ion-radio-ios{-webkit-box-sizing:border-box;box-sizing:border-box}/*!@label*/label.sc-ion-radio-ios{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-radio-ios label.sc-ion-radio-ios,[dir=rtl].sc-ion-radio-ios-h label.sc-ion-radio-ios,[dir=rtl] .sc-ion-radio-ios-h label.sc-ion-radio-ios{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-radio-ios::-moz-focus-inner{border:0}/*!@input*/input.sc-ion-radio-ios{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@:host(:focus)*/.sc-ion-radio-ios-h:focus{outline:none}/*!@:host*/.sc-ion-radio-ios-h{--color-checked:var(--ion-color-primary, #3880ff);width:15px;height:24px}/*!@:host(.ion-color.radio-checked) .radio-inner*/.ion-color.radio-checked.sc-ion-radio-ios-h .radio-inner.sc-ion-radio-ios{border-color:var(--ion-color-base)}/*!@.item-radio.item-ios ion-label*/.item-radio.item-ios.sc-ion-radio-ios ion-label.sc-ion-radio-ios{margin-left:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.item-radio.item-ios ion-label*/.item-radio.item-ios.sc-ion-radio-ios ion-label.sc-ion-radio-ios{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}/*!@.radio-inner*/.radio-inner.sc-ion-radio-ios{width:33%;height:50%}/*!@:host(.radio-checked) .radio-inner*/.radio-checked.sc-ion-radio-ios-h .radio-inner.sc-ion-radio-ios{-webkit-transform:rotate(45deg);transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--color-checked)}/*!@:host(.radio-disabled)*/.radio-disabled.sc-ion-radio-ios-h{opacity:0.3}/*!@:host(.ion-focused) .radio-icon::after*/.ion-focused.sc-ion-radio-ios-h .radio-icon.sc-ion-radio-ios::after{border-radius:var(--inner-border-radius);left:-9px;top:-8px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #4c8dff);content:\"\";opacity:0.2}/*!@:host-context([dir=rtl]):host(.ion-focused) .radio-icon::after, :host-context([dir=rtl]).ion-focused .radio-icon::after*/[dir=rtl].sc-ion-radio-ios-h -no-combinator.ion-focused.sc-ion-radio-ios-h .radio-icon.sc-ion-radio-ios::after,[dir=rtl] .sc-ion-radio-ios-h -no-combinator.ion-focused.sc-ion-radio-ios-h .radio-icon.sc-ion-radio-ios::after,[dir=rtl].ion-focused.sc-ion-radio-ios-h .radio-icon.sc-ion-radio-ios::after,[dir=rtl] .ion-focused.sc-ion-radio-ios-h .radio-icon.sc-ion-radio-ios::after{left:unset;right:unset;right:-9px}/*!@:host(.in-item)*/.in-item.sc-ion-radio-ios-h{margin-left:10px;margin-right:11px;margin-top:8px;margin-bottom:8px;display:block;position:static}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item)*/.in-item.sc-ion-radio-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:10px;margin-inline-start:10px;-webkit-margin-end:11px;margin-inline-end:11px}}/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-radio-ios-h{margin-left:3px;margin-right:21px;margin-top:8px;margin-bottom:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-radio-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:3px;margin-inline-start:3px;-webkit-margin-end:21px;margin-inline-end:21px}}";
|
17648 |
|
17649 | const radioMdCss = "/*!@:host*/.sc-ion-radio-md-h{--inner-border-radius:50%;display:inline-block;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.radio-disabled)*/.radio-disabled.sc-ion-radio-md-h{pointer-events:none}/*!@.radio-icon*/.radio-icon.sc-ion-radio-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;contain:layout size style}/*!@.radio-icon,\n.radio-inner*/.radio-icon.sc-ion-radio-md,.radio-inner.sc-ion-radio-md{-webkit-box-sizing:border-box;box-sizing:border-box}/*!@label*/label.sc-ion-radio-md{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-radio-md label.sc-ion-radio-md,[dir=rtl].sc-ion-radio-md-h label.sc-ion-radio-md,[dir=rtl] .sc-ion-radio-md-h label.sc-ion-radio-md{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-radio-md::-moz-focus-inner{border:0}/*!@input*/input.sc-ion-radio-md{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@:host(:focus)*/.sc-ion-radio-md-h:focus{outline:none}/*!@:host*/.sc-ion-radio-md-h{--color:var(--ion-color-step-400, #999999);--color-checked:var(--ion-color-primary, #3880ff);--border-width:2px;--border-style:solid;--border-radius:50%;width:20px;height:20px}/*!@:host(.ion-color) .radio-inner*/.ion-color.sc-ion-radio-md-h .radio-inner.sc-ion-radio-md{background:var(--ion-color-base)}/*!@:host(.ion-color.radio-checked) .radio-icon*/.ion-color.radio-checked.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md{border-color:var(--ion-color-base)}/*!@.radio-icon*/.radio-icon.sc-ion-radio-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:var(--border-radius);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--color)}/*!@.radio-inner*/.radio-inner.sc-ion-radio-md{border-radius:var(--inner-border-radius);width:calc(50% + var(--border-width));height:calc(50% + var(--border-width));-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0);-webkit-transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1), -webkit-transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background:var(--color-checked)}/*!@:host(.radio-checked) .radio-icon*/.radio-checked.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md{border-color:var(--color-checked)}/*!@:host(.radio-checked) .radio-inner*/.radio-checked.sc-ion-radio-md-h .radio-inner.sc-ion-radio-md{-webkit-transform:scale3d(1, 1, 1);transform:scale3d(1, 1, 1)}/*!@:host(.radio-disabled)*/.radio-disabled.sc-ion-radio-md-h{opacity:0.3}/*!@:host(.ion-focused) .radio-icon::after*/.ion-focused.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md::after{border-radius:var(--inner-border-radius);left:-12px;top:-12px;display:block;position:absolute;width:36px;height:36px;background:var(--ion-color-primary-tint, #4c8dff);content:\"\";opacity:0.2}/*!@:host-context([dir=rtl]):host(.ion-focused) .radio-icon::after, :host-context([dir=rtl]).ion-focused .radio-icon::after*/[dir=rtl].sc-ion-radio-md-h -no-combinator.ion-focused.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md::after,[dir=rtl] .sc-ion-radio-md-h -no-combinator.ion-focused.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md::after,[dir=rtl].ion-focused.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md::after,[dir=rtl] .ion-focused.sc-ion-radio-md-h .radio-icon.sc-ion-radio-md::after{left:unset;right:unset;right:-12px}/*!@:host(.in-item)*/.in-item.sc-ion-radio-md-h{margin-left:0;margin-right:0;margin-top:9px;margin-bottom:9px;display:block;position:static}/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-radio-md-h{margin-left:4px;margin-right:36px;margin-top:11px;margin-bottom:10px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-radio-md-h{margin-left:unset;margin-right:unset;-webkit-margin-start:4px;margin-inline-start:4px;-webkit-margin-end:36px;margin-inline-end:36px}}";
|
17650 |
|
17651 |
|
17652 |
|
17653 |
|
17654 |
|
17655 |
|
17656 |
|
17657 | class Radio {
|
17658 | constructor(hostRef) {
|
17659 | registerInstance(this, hostRef);
|
17660 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
17661 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
17662 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
17663 | this.inputId = `ion-rb-${radioButtonIds++}`;
|
17664 | this.radioGroup = null;
|
17665 | |
17666 |
|
17667 |
|
17668 | this.checked = false;
|
17669 | |
17670 |
|
17671 |
|
17672 |
|
17673 | this.buttonTabindex = -1;
|
17674 | |
17675 |
|
17676 |
|
17677 | this.name = this.inputId;
|
17678 | |
17679 |
|
17680 |
|
17681 | this.disabled = false;
|
17682 | this.updateState = () => {
|
17683 | if (this.radioGroup) {
|
17684 | this.checked = this.radioGroup.value === this.value;
|
17685 | }
|
17686 | };
|
17687 | this.onFocus = () => {
|
17688 | this.ionFocus.emit();
|
17689 | };
|
17690 | this.onBlur = () => {
|
17691 | this.ionBlur.emit();
|
17692 | };
|
17693 | }
|
17694 |
|
17695 | async setFocus(ev) {
|
17696 | ev.stopPropagation();
|
17697 | ev.preventDefault();
|
17698 | this.el.focus();
|
17699 | }
|
17700 |
|
17701 | async setButtonTabindex(value) {
|
17702 | this.buttonTabindex = value;
|
17703 | }
|
17704 | connectedCallback() {
|
17705 | if (this.value === undefined) {
|
17706 | this.value = this.inputId;
|
17707 | }
|
17708 | const radioGroup = this.radioGroup = this.el.closest('ion-radio-group');
|
17709 | if (radioGroup) {
|
17710 | this.updateState();
|
17711 | addEventListener(radioGroup, 'ionChange', this.updateState);
|
17712 | }
|
17713 | }
|
17714 | disconnectedCallback() {
|
17715 | const radioGroup = this.radioGroup;
|
17716 | if (radioGroup) {
|
17717 | removeEventListener(radioGroup, 'ionChange', this.updateState);
|
17718 | this.radioGroup = null;
|
17719 | }
|
17720 | }
|
17721 | componentWillLoad() {
|
17722 | this.emitStyle();
|
17723 | }
|
17724 | emitStyle() {
|
17725 | this.ionStyle.emit({
|
17726 | 'radio-checked': this.checked,
|
17727 | 'interactive-disabled': this.disabled,
|
17728 | });
|
17729 | }
|
17730 | render() {
|
17731 | const { inputId, disabled, checked, color, el, buttonTabindex } = this;
|
17732 | const mode = getIonMode$1(this);
|
17733 | const { label, labelId, labelText } = getAriaLabel(el, inputId);
|
17734 | return (hAsync(Host, { "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, "aria-labelledby": label ? labelId : null, role: "radio", tabindex: buttonTabindex, onFocus: this.onFocus, onBlur: this.onBlur, class: createColorClasses$1(color, {
|
17735 | [mode]: true,
|
17736 | 'in-item': hostContext('ion-item', el),
|
17737 | 'interactive': true,
|
17738 | 'radio-checked': checked,
|
17739 | 'radio-disabled': disabled,
|
17740 | }) }, hAsync("div", { class: "radio-icon", part: "container" }, hAsync("div", { class: "radio-inner", part: "mark" }), hAsync("div", { class: "radio-ripple" })), hAsync("label", { htmlFor: inputId }, labelText), hAsync("input", { type: "radio", checked: checked, disabled: disabled, tabindex: "-1", id: inputId })));
|
17741 | }
|
17742 | get el() { return getElement(this); }
|
17743 | static get watchers() { return {
|
17744 | "color": ["emitStyle"],
|
17745 | "checked": ["emitStyle"],
|
17746 | "disabled": ["emitStyle"]
|
17747 | }; }
|
17748 | static get style() { return {
|
17749 | ios: radioIosCss,
|
17750 | md: radioMdCss
|
17751 | }; }
|
17752 | static get cmpMeta() { return {
|
17753 | "$flags$": 41,
|
17754 | "$tagName$": "ion-radio",
|
17755 | "$members$": {
|
17756 | "color": [513],
|
17757 | "name": [1],
|
17758 | "disabled": [4],
|
17759 | "value": [8],
|
17760 | "checked": [32],
|
17761 | "buttonTabindex": [32],
|
17762 | "setFocus": [64],
|
17763 | "setButtonTabindex": [64]
|
17764 | },
|
17765 | "$listeners$": undefined,
|
17766 | "$lazyBundleId$": "-",
|
17767 | "$attrsToReflect$": [["color", "color"]]
|
17768 | }; }
|
17769 | }
|
17770 | let radioButtonIds = 0;
|
17771 |
|
17772 | class RadioGroup {
|
17773 | constructor(hostRef) {
|
17774 | registerInstance(this, hostRef);
|
17775 | this.ionChange = createEvent(this, "ionChange", 7);
|
17776 | this.inputId = `ion-rg-${radioGroupIds++}`;
|
17777 | this.labelId = `${this.inputId}-lbl`;
|
17778 | |
17779 |
|
17780 |
|
17781 | this.allowEmptySelection = false;
|
17782 | |
17783 |
|
17784 |
|
17785 | this.name = this.inputId;
|
17786 | this.setRadioTabindex = (value) => {
|
17787 | const radios = this.getRadios();
|
17788 |
|
17789 | const first = radios.find(radio => !radio.disabled);
|
17790 | const checked = radios.find(radio => (radio.value === value && !radio.disabled));
|
17791 | if (!first && !checked) {
|
17792 | return;
|
17793 | }
|
17794 |
|
17795 |
|
17796 | const focusable = checked || first;
|
17797 | for (const radio of radios) {
|
17798 | const tabindex = radio === focusable ? 0 : -1;
|
17799 | radio.setButtonTabindex(tabindex);
|
17800 | }
|
17801 | };
|
17802 | this.onClick = (ev) => {
|
17803 | ev.preventDefault();
|
17804 | const selectedRadio = ev.target && ev.target.closest('ion-radio');
|
17805 | if (selectedRadio) {
|
17806 | const currentValue = this.value;
|
17807 | const newValue = selectedRadio.value;
|
17808 | if (newValue !== currentValue) {
|
17809 | this.value = newValue;
|
17810 | }
|
17811 | else if (this.allowEmptySelection) {
|
17812 | this.value = undefined;
|
17813 | }
|
17814 | }
|
17815 | };
|
17816 | }
|
17817 | valueChanged(value) {
|
17818 | this.setRadioTabindex(value);
|
17819 | this.ionChange.emit({ value });
|
17820 | }
|
17821 | componentDidLoad() {
|
17822 | this.setRadioTabindex(this.value);
|
17823 | }
|
17824 | async connectedCallback() {
|
17825 |
|
17826 |
|
17827 | const header = this.el.querySelector('ion-list-header') || this.el.querySelector('ion-item-divider');
|
17828 | if (header) {
|
17829 | const label = this.label = header.querySelector('ion-label');
|
17830 | if (label) {
|
17831 | this.labelId = label.id = this.name + '-lbl';
|
17832 | }
|
17833 | }
|
17834 | }
|
17835 | getRadios() {
|
17836 | return Array.from(this.el.querySelectorAll('ion-radio'));
|
17837 | }
|
17838 | onKeydown(ev) {
|
17839 | const inSelectPopover = !!this.el.closest('ion-select-popover');
|
17840 | if (ev.target && !this.el.contains(ev.target)) {
|
17841 | return;
|
17842 | }
|
17843 |
|
17844 |
|
17845 | const radios = this.getRadios().filter(radio => !radio.disabled);
|
17846 |
|
17847 | if (ev.target && radios.includes(ev.target)) {
|
17848 | const index = radios.findIndex(radio => radio === ev.target);
|
17849 | const current = radios[index];
|
17850 | let next;
|
17851 |
|
17852 |
|
17853 | if (['ArrowDown', 'ArrowRight'].includes(ev.code)) {
|
17854 | next = (index === radios.length - 1)
|
17855 | ? radios[0]
|
17856 | : radios[index + 1];
|
17857 | }
|
17858 |
|
17859 |
|
17860 | if (['ArrowUp', 'ArrowLeft'].includes(ev.code)) {
|
17861 | next = (index === 0)
|
17862 | ? radios[radios.length - 1]
|
17863 | : radios[index - 1];
|
17864 | }
|
17865 | if (next && radios.includes(next)) {
|
17866 | next.setFocus(ev);
|
17867 | if (!inSelectPopover) {
|
17868 | this.value = next.value;
|
17869 | }
|
17870 | }
|
17871 |
|
17872 |
|
17873 | if (['Space'].includes(ev.code)) {
|
17874 | this.value = (this.allowEmptySelection && this.value !== undefined)
|
17875 | ? undefined
|
17876 | : current.value;
|
17877 |
|
17878 |
|
17879 | ev.preventDefault();
|
17880 | }
|
17881 | }
|
17882 | }
|
17883 | render() {
|
17884 | const { label, labelId } = this;
|
17885 | const mode = getIonMode$1(this);
|
17886 | return (hAsync(Host, { role: "radiogroup", "aria-labelledby": label ? labelId : null, onClick: this.onClick, class: mode }));
|
17887 | }
|
17888 | get el() { return getElement(this); }
|
17889 | static get watchers() { return {
|
17890 | "value": ["valueChanged"]
|
17891 | }; }
|
17892 | static get cmpMeta() { return {
|
17893 | "$flags$": 0,
|
17894 | "$tagName$": "ion-radio-group",
|
17895 | "$members$": {
|
17896 | "allowEmptySelection": [4, "allow-empty-selection"],
|
17897 | "name": [1],
|
17898 | "value": [1032]
|
17899 | },
|
17900 | "$listeners$": [[4, "keydown", "onKeydown"]],
|
17901 | "$lazyBundleId$": "-",
|
17902 | "$attrsToReflect$": []
|
17903 | }; }
|
17904 | }
|
17905 | let radioGroupIds = 0;
|
17906 |
|
17907 | const rangeIosCss = "/*!@:host*/.sc-ion-range-ios-h{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.range-disabled)*/.range-disabled.sc-ion-range-ios-h{pointer-events:none}/*!@::slotted(ion-label)*/.sc-ion-range-ios-s>ion-label{-ms-flex:initial;flex:initial}/*!@::slotted(ion-icon[slot])*/.sc-ion-range-ios-s>ion-icon[slot]{font-size:24px}/*!@.range-slider*/.range-slider.sc-ion-range-ios{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}/*!@:host(.range-pressed) .range-slider*/.range-pressed.sc-ion-range-ios-h .range-slider.sc-ion-range-ios{cursor:-webkit-grabbing;cursor:grabbing}/*!@.range-pin*/.range-pin.sc-ion-range-ios{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@.range-knob-handle*/.range-knob-handle.sc-ion-range-ios{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}/*!@[dir=rtl] .range-knob-handle, :host-context([dir=rtl]) .range-knob-handle*/[dir=rtl].sc-ion-range-ios .range-knob-handle.sc-ion-range-ios,[dir=rtl].sc-ion-range-ios-h .range-knob-handle.sc-ion-range-ios,[dir=rtl] .sc-ion-range-ios-h .range-knob-handle.sc-ion-range-ios{left:unset;right:unset;right:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.range-knob-handle*/.range-knob-handle.sc-ion-range-ios{margin-left:unset;-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2)}}/*!@[dir=rtl] .range-knob-handle, :host-context([dir=rtl]) .range-knob-handle*/[dir=rtl].sc-ion-range-ios .range-knob-handle.sc-ion-range-ios,[dir=rtl].sc-ion-range-ios-h .range-knob-handle.sc-ion-range-ios,[dir=rtl] .sc-ion-range-ios-h .range-knob-handle.sc-ion-range-ios{left:unset}/*!@.range-knob-handle:active, .range-knob-handle:focus*/.range-knob-handle.sc-ion-range-ios:active,.range-knob-handle.sc-ion-range-ios:focus{outline:none}/*!@.range-bar*/.range-bar.sc-ion-range-ios{border-radius:var(--bar-border-radius);left:0;top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}/*!@[dir=rtl] .range-bar, :host-context([dir=rtl]) .range-bar*/[dir=rtl].sc-ion-range-ios .range-bar.sc-ion-range-ios,[dir=rtl].sc-ion-range-ios-h .range-bar.sc-ion-range-ios,[dir=rtl] .sc-ion-range-ios-h .range-bar.sc-ion-range-ios{left:unset;right:unset;right:0}/*!@[dir=rtl] .range-bar, :host-context([dir=rtl]) .range-bar*/[dir=rtl].sc-ion-range-ios .range-bar.sc-ion-range-ios,[dir=rtl].sc-ion-range-ios-h .range-bar.sc-ion-range-ios,[dir=rtl] .sc-ion-range-ios-h .range-bar.sc-ion-range-ios{left:unset}/*!@.range-knob*/.range-knob.sc-ion-range-ios{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}/*!@[dir=rtl] .range-knob, :host-context([dir=rtl]) .range-knob*/[dir=rtl].sc-ion-range-ios .range-knob.sc-ion-range-ios,[dir=rtl].sc-ion-range-ios-h .range-knob.sc-ion-range-ios,[dir=rtl] .sc-ion-range-ios-h .range-knob.sc-ion-range-ios{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}/*!@[dir=rtl] .range-knob, :host-context([dir=rtl]) .range-knob*/[dir=rtl].sc-ion-range-ios .range-knob.sc-ion-range-ios,[dir=rtl].sc-ion-range-ios-h .range-knob.sc-ion-range-ios,[dir=rtl] .sc-ion-range-ios-h .range-knob.sc-ion-range-ios{left:unset}/*!@:host(.range-pressed) .range-bar-active*/.range-pressed.sc-ion-range-ios-h .range-bar-active.sc-ion-range-ios{will-change:left, right}/*!@:host(.in-item)*/.in-item.sc-ion-range-ios-h{width:100%}/*!@:host(.in-item) ::slotted(ion-label)*/.sc-ion-range-ios-h.in-item .sc-ion-range-ios-s>ion-label{-ms-flex-item-align:center;align-self:center}/*!@:host*/.sc-ion-range-ios-h{--knob-border-radius:50%;--knob-background:#ffffff;--knob-box-shadow:0 3px 1px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.13), 0 0 0 1px rgba(0, 0, 0, 0.02);--knob-size:28px;--bar-height:2px;--bar-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:0;--height:42px;padding-left:16px;padding-right:16px;padding-top:8px;padding-bottom:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-range-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}/*!@:host(.ion-color) .range-bar-active,\n:host(.ion-color) .range-tick-active*/.ion-color.sc-ion-range-ios-h .range-bar-active.sc-ion-range-ios,.ion-color.sc-ion-range-ios-h .range-tick-active.sc-ion-range-ios{background:var(--ion-color-base)}/*!@::slotted([slot=start])*/.sc-ion-range-ios-s>[slot=start]{margin-left:0;margin-right:16px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-range-ios-s>[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:16px;margin-inline-end:16px}}/*!@::slotted([slot=end])*/.sc-ion-range-ios-s>[slot=end]{margin-left:16px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-range-ios-s>[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:0;margin-inline-end:0}}/*!@:host(.range-has-pin)*/.range-has-pin.sc-ion-range-ios-h{padding-top:20px}/*!@.range-bar-active*/.range-bar-active.sc-ion-range-ios{bottom:0;width:auto;background:var(--bar-background-active)}/*!@.range-tick*/.range-tick.sc-ion-range-ios{margin-left:-1px;border-radius:0;position:absolute;top:18px;width:2px;height:8px;background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1);pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.range-tick*/.range-tick.sc-ion-range-ios{margin-left:unset;-webkit-margin-start:-1px;margin-inline-start:-1px}}/*!@.range-tick-active*/.range-tick-active.sc-ion-range-ios{background:var(--bar-background-active)}/*!@.range-pin*/.range-pin.sc-ion-range-ios{-webkit-transform:translate3d(0, 28px, 0) scale(0.01);transform:translate3d(0, 28px, 0) scale(0.01);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;display:inline-block;position:relative;top:-20px;min-width:28px;-webkit-transition:-webkit-transform 120ms ease;transition:-webkit-transform 120ms ease;transition:transform 120ms ease;transition:transform 120ms ease, -webkit-transform 120ms ease;background:transparent;color:var(--ion-text-color, #000);font-size:12px;text-align:center}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.range-pin*/.range-pin.sc-ion-range-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}/*!@.range-knob-pressed .range-pin*/.range-knob-pressed.sc-ion-range-ios .range-pin.sc-ion-range-ios{-webkit-transform:translate3d(0, 0, 0) scale(1);transform:translate3d(0, 0, 0) scale(1)}/*!@:host(.range-disabled)*/.range-disabled.sc-ion-range-ios-h{opacity:0.5}";
|
17908 |
|
17909 | const rangeMdCss = "/*!@:host*/.sc-ion-range-md-h{--knob-handle-size:calc(var(--knob-size) * 2);display:-ms-flexbox;display:flex;position:relative;-ms-flex:3;flex:3;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.range-disabled)*/.range-disabled.sc-ion-range-md-h{pointer-events:none}/*!@::slotted(ion-label)*/.sc-ion-range-md-s>ion-label{-ms-flex:initial;flex:initial}/*!@::slotted(ion-icon[slot])*/.sc-ion-range-md-s>ion-icon[slot]{font-size:24px}/*!@.range-slider*/.range-slider.sc-ion-range-md{position:relative;-ms-flex:1;flex:1;width:100%;height:var(--height);contain:size layout style;cursor:-webkit-grab;cursor:grab;-ms-touch-action:pan-y;touch-action:pan-y}/*!@:host(.range-pressed) .range-slider*/.range-pressed.sc-ion-range-md-h .range-slider.sc-ion-range-md{cursor:-webkit-grabbing;cursor:grabbing}/*!@.range-pin*/.range-pin.sc-ion-range-md{position:absolute;background:var(--ion-color-base);color:var(--ion-color-contrast);text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@.range-knob-handle*/.range-knob-handle.sc-ion-range-md{left:0;top:calc((var(--height) - var(--knob-handle-size)) / 2);margin-left:calc(0px - var(--knob-handle-size) / 2);position:absolute;width:var(--knob-handle-size);height:var(--knob-handle-size);text-align:center}/*!@[dir=rtl] .range-knob-handle, :host-context([dir=rtl]) .range-knob-handle*/[dir=rtl].sc-ion-range-md .range-knob-handle.sc-ion-range-md,[dir=rtl].sc-ion-range-md-h .range-knob-handle.sc-ion-range-md,[dir=rtl] .sc-ion-range-md-h .range-knob-handle.sc-ion-range-md{left:unset;right:unset;right:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.range-knob-handle*/.range-knob-handle.sc-ion-range-md{margin-left:unset;-webkit-margin-start:calc(0px - var(--knob-handle-size) / 2);margin-inline-start:calc(0px - var(--knob-handle-size) / 2)}}/*!@[dir=rtl] .range-knob-handle, :host-context([dir=rtl]) .range-knob-handle*/[dir=rtl].sc-ion-range-md .range-knob-handle.sc-ion-range-md,[dir=rtl].sc-ion-range-md-h .range-knob-handle.sc-ion-range-md,[dir=rtl] .sc-ion-range-md-h .range-knob-handle.sc-ion-range-md{left:unset}/*!@.range-knob-handle:active, .range-knob-handle:focus*/.range-knob-handle.sc-ion-range-md:active,.range-knob-handle.sc-ion-range-md:focus{outline:none}/*!@.range-bar*/.range-bar.sc-ion-range-md{border-radius:var(--bar-border-radius);left:0;top:calc((var(--height) - var(--bar-height)) / 2);position:absolute;width:100%;height:var(--bar-height);background:var(--bar-background);pointer-events:none}/*!@[dir=rtl] .range-bar, :host-context([dir=rtl]) .range-bar*/[dir=rtl].sc-ion-range-md .range-bar.sc-ion-range-md,[dir=rtl].sc-ion-range-md-h .range-bar.sc-ion-range-md,[dir=rtl] .sc-ion-range-md-h .range-bar.sc-ion-range-md{left:unset;right:unset;right:0}/*!@[dir=rtl] .range-bar, :host-context([dir=rtl]) .range-bar*/[dir=rtl].sc-ion-range-md .range-bar.sc-ion-range-md,[dir=rtl].sc-ion-range-md-h .range-bar.sc-ion-range-md,[dir=rtl] .sc-ion-range-md-h .range-bar.sc-ion-range-md{left:unset}/*!@.range-knob*/.range-knob.sc-ion-range-md{border-radius:var(--knob-border-radius);left:calc(50% - var(--knob-size) / 2);top:calc(50% - var(--knob-size) / 2);position:absolute;width:var(--knob-size);height:var(--knob-size);background:var(--knob-background);-webkit-box-shadow:var(--knob-box-shadow);box-shadow:var(--knob-box-shadow);z-index:2;pointer-events:none}/*!@[dir=rtl] .range-knob, :host-context([dir=rtl]) .range-knob*/[dir=rtl].sc-ion-range-md .range-knob.sc-ion-range-md,[dir=rtl].sc-ion-range-md-h .range-knob.sc-ion-range-md,[dir=rtl] .sc-ion-range-md-h .range-knob.sc-ion-range-md{left:unset;right:unset;right:calc(50% - var(--knob-size) / 2)}/*!@[dir=rtl] .range-knob, :host-context([dir=rtl]) .range-knob*/[dir=rtl].sc-ion-range-md .range-knob.sc-ion-range-md,[dir=rtl].sc-ion-range-md-h .range-knob.sc-ion-range-md,[dir=rtl] .sc-ion-range-md-h .range-knob.sc-ion-range-md{left:unset}/*!@:host(.range-pressed) .range-bar-active*/.range-pressed.sc-ion-range-md-h .range-bar-active.sc-ion-range-md{will-change:left, right}/*!@:host(.in-item)*/.in-item.sc-ion-range-md-h{width:100%}/*!@:host(.in-item) ::slotted(ion-label)*/.sc-ion-range-md-h.in-item .sc-ion-range-md-s>ion-label{-ms-flex-item-align:center;align-self:center}/*!@:host*/.sc-ion-range-md-h{--knob-border-radius:50%;--knob-background:var(--bar-background-active);--knob-box-shadow:none;--knob-size:18px;--bar-height:2px;--bar-background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.26);--bar-background-active:var(--ion-color-primary, #3880ff);--bar-border-radius:0;--height:42px;--pin-background:var(--ion-color-primary, #3880ff);--pin-color:var(--ion-color-primary-contrast, #fff);padding-left:14px;padding-right:14px;padding-top:8px;padding-bottom:8px;font-size:12px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-range-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:14px;padding-inline-start:14px;-webkit-padding-end:14px;padding-inline-end:14px}}/*!@:host(.ion-color) .range-bar*/.ion-color.sc-ion-range-md-h .range-bar.sc-ion-range-md{background:rgba(var(--ion-color-base-rgb), 0.26)}/*!@:host(.ion-color) .range-bar-active,\n:host(.ion-color) .range-knob,\n:host(.ion-color) .range-pin,\n:host(.ion-color) .range-pin::before,\n:host(.ion-color) .range-tick*/.ion-color.sc-ion-range-md-h .range-bar-active.sc-ion-range-md,.ion-color.sc-ion-range-md-h .range-knob.sc-ion-range-md,.ion-color.sc-ion-range-md-h .range-pin.sc-ion-range-md,.ion-color.sc-ion-range-md-h .range-pin.sc-ion-range-md::before,.ion-color.sc-ion-range-md-h .range-tick.sc-ion-range-md{background:var(--ion-color-base);color:var(--ion-color-contrast)}/*!@::slotted([slot=start])*/.sc-ion-range-md-s>[slot=start]{margin-left:0;margin-right:14px;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=start])*/.sc-ion-range-md-s>[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:14px;margin-inline-end:14px}}/*!@::slotted([slot=end])*/.sc-ion-range-md-s>[slot=end]{margin-left:14px;margin-right:0;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted([slot=end])*/.sc-ion-range-md-s>[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:14px;margin-inline-start:14px;-webkit-margin-end:0;margin-inline-end:0}}/*!@:host(.range-has-pin)*/.range-has-pin.sc-ion-range-md-h{padding-top:28px}/*!@.range-bar-active*/.range-bar-active.sc-ion-range-md{bottom:0;width:auto;background:var(--bar-background-active)}/*!@.range-knob*/.range-knob.sc-ion-range-md{-webkit-transform:scale(0.67);transform:scale(0.67);-webkit-transition-duration:120ms;transition-duration:120ms;-webkit-transition-property:background-color, border, -webkit-transform;transition-property:background-color, border, -webkit-transform;transition-property:transform, background-color, border;transition-property:transform, background-color, border, -webkit-transform;-webkit-transition-timing-function:ease;transition-timing-function:ease;z-index:2}/*!@.range-tick*/.range-tick.sc-ion-range-md{position:absolute;top:calc((var(--height) - var(--bar-height)) / 2);width:var(--bar-height);height:var(--bar-height);background:var(--bar-background-active);z-index:1;pointer-events:none}/*!@.range-tick-active*/.range-tick-active.sc-ion-range-md{background:transparent}/*!@.range-pin*/.range-pin.sc-ion-range-md{padding-left:0;padding-right:0;padding-top:8px;padding-bottom:8px;border-radius:50%;-webkit-transform:translate3d(0, 0, 0) scale(0.01);transform:translate3d(0, 0, 0) scale(0.01);display:inline-block;position:relative;min-width:28px;height:28px;-webkit-transition:background 120ms ease, -webkit-transform 120ms ease;transition:background 120ms ease, -webkit-transform 120ms ease;transition:transform 120ms ease, background 120ms ease;transition:transform 120ms ease, background 120ms ease, -webkit-transform 120ms ease;background:var(--pin-background);color:var(--pin-color);text-align:center}/*!@.range-pin::before*/.range-pin.sc-ion-range-md::before{left:50%;top:3px;margin-left:-13px;border-radius:50% 50% 50% 0;position:absolute;width:26px;height:26px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transition:background 120ms ease;transition:background 120ms ease;background:var(--pin-background);content:\"\";z-index:-1}/*!@[dir=rtl] .range-pin::before, :host-context([dir=rtl]) .range-pin::before*/[dir=rtl].sc-ion-range-md .range-pin.sc-ion-range-md::before,[dir=rtl].sc-ion-range-md-h .range-pin.sc-ion-range-md::before,[dir=rtl] .sc-ion-range-md-h .range-pin.sc-ion-range-md::before{left:unset;right:unset;right:50%}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.range-pin::before*/.range-pin.sc-ion-range-md::before{margin-left:unset;-webkit-margin-start:-13px;margin-inline-start:-13px}}/*!@[dir=rtl] .range-pin::before, :host-context([dir=rtl]) .range-pin::before*/[dir=rtl].sc-ion-range-md .range-pin.sc-ion-range-md::before,[dir=rtl].sc-ion-range-md-h .range-pin.sc-ion-range-md::before,[dir=rtl] .sc-ion-range-md-h .range-pin.sc-ion-range-md::before{left:unset}/*!@.range-knob-pressed .range-pin*/.range-knob-pressed.sc-ion-range-md .range-pin.sc-ion-range-md{-webkit-transform:translate3d(0, -24px, 0) scale(1);transform:translate3d(0, -24px, 0) scale(1)}/*!@:host(:not(.range-has-pin)) .range-knob-pressed .range-knob*/.sc-ion-range-md-h:not(.range-has-pin) .range-knob-pressed.sc-ion-range-md .range-knob.sc-ion-range-md{-webkit-transform:scale(1);transform:scale(1)}/*!@:host(.range-disabled) .range-bar-active,\n:host(.range-disabled) .range-bar,\n:host(.range-disabled) .range-tick*/.range-disabled.sc-ion-range-md-h .range-bar-active.sc-ion-range-md,.range-disabled.sc-ion-range-md-h .range-bar.sc-ion-range-md,.range-disabled.sc-ion-range-md-h .range-tick.sc-ion-range-md{background-color:var(--ion-color-step-250, #bfbfbf)}/*!@:host(.range-disabled) .range-knob*/.range-disabled.sc-ion-range-md-h .range-knob.sc-ion-range-md{-webkit-transform:scale(0.55);transform:scale(0.55);outline:5px solid #fff;background-color:var(--ion-color-step-250, #bfbfbf)}";
|
17910 |
|
17911 |
|
17912 |
|
17913 |
|
17914 |
|
17915 |
|
17916 |
|
17917 |
|
17918 |
|
17919 |
|
17920 |
|
17921 |
|
17922 |
|
17923 |
|
17924 | class Range {
|
17925 | constructor(hostRef) {
|
17926 | registerInstance(this, hostRef);
|
17927 | this.ionChange = createEvent(this, "ionChange", 7);
|
17928 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
17929 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
17930 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
17931 | this.didLoad = false;
|
17932 | this.noUpdate = false;
|
17933 | this.hasFocus = false;
|
17934 | this.inheritedAttributes = {};
|
17935 | this.ratioA = 0;
|
17936 | this.ratioB = 0;
|
17937 | |
17938 |
|
17939 |
|
17940 |
|
17941 |
|
17942 | this.debounce = 0;
|
17943 |
|
17944 | |
17945 |
|
17946 |
|
17947 | this.name = '';
|
17948 | |
17949 |
|
17950 |
|
17951 | this.dualKnobs = false;
|
17952 | |
17953 |
|
17954 |
|
17955 | this.min = 0;
|
17956 | |
17957 |
|
17958 |
|
17959 | this.max = 100;
|
17960 | |
17961 |
|
17962 |
|
17963 |
|
17964 | this.pin = false;
|
17965 | |
17966 |
|
17967 |
|
17968 |
|
17969 | this.snaps = false;
|
17970 | |
17971 |
|
17972 |
|
17973 | this.step = 1;
|
17974 | |
17975 |
|
17976 |
|
17977 |
|
17978 | this.ticks = true;
|
17979 | |
17980 |
|
17981 |
|
17982 | this.disabled = false;
|
17983 | |
17984 |
|
17985 |
|
17986 | this.value = 0;
|
17987 | this.clampBounds = (value) => {
|
17988 | return clamp(this.min, value, this.max);
|
17989 | };
|
17990 | this.ensureValueInBounds = (value) => {
|
17991 | if (this.dualKnobs) {
|
17992 | return {
|
17993 | lower: this.clampBounds(value.lower),
|
17994 | upper: this.clampBounds(value.upper)
|
17995 | };
|
17996 | }
|
17997 | else {
|
17998 | return this.clampBounds(value);
|
17999 | }
|
18000 | };
|
18001 | this.setupGesture = async () => {
|
18002 | const rangeSlider = this.rangeSlider;
|
18003 | if (rangeSlider) {
|
18004 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
18005 | el: rangeSlider,
|
18006 | gestureName: 'range',
|
18007 | gesturePriority: 100,
|
18008 | threshold: 0,
|
18009 | onStart: ev => this.onStart(ev),
|
18010 | onMove: ev => this.onMove(ev),
|
18011 | onEnd: ev => this.onEnd(ev),
|
18012 | });
|
18013 | this.gesture.enable(!this.disabled);
|
18014 | }
|
18015 | };
|
18016 | this.handleKeyboard = (knob, isIncrease) => {
|
18017 | let step = this.step;
|
18018 | step = step > 0 ? step : 1;
|
18019 | step = step / (this.max - this.min);
|
18020 | if (!isIncrease) {
|
18021 | step *= -1;
|
18022 | }
|
18023 | if (knob === 'A') {
|
18024 | this.ratioA = clamp(0, this.ratioA + step, 1);
|
18025 | }
|
18026 | else {
|
18027 | this.ratioB = clamp(0, this.ratioB + step, 1);
|
18028 | }
|
18029 | this.updateValue();
|
18030 | };
|
18031 | this.onBlur = () => {
|
18032 | if (this.hasFocus) {
|
18033 | this.hasFocus = false;
|
18034 | this.ionBlur.emit();
|
18035 | this.emitStyle();
|
18036 | }
|
18037 | };
|
18038 | this.onFocus = () => {
|
18039 | if (!this.hasFocus) {
|
18040 | this.hasFocus = true;
|
18041 | this.ionFocus.emit();
|
18042 | this.emitStyle();
|
18043 | }
|
18044 | };
|
18045 | }
|
18046 | debounceChanged() {
|
18047 | this.ionChange = debounceEvent(this.ionChange, this.debounce);
|
18048 | }
|
18049 | minChanged() {
|
18050 | if (!this.noUpdate) {
|
18051 | this.updateRatio();
|
18052 | }
|
18053 | }
|
18054 | maxChanged() {
|
18055 | if (!this.noUpdate) {
|
18056 | this.updateRatio();
|
18057 | }
|
18058 | }
|
18059 | disabledChanged() {
|
18060 | if (this.gesture) {
|
18061 | this.gesture.enable(!this.disabled);
|
18062 | }
|
18063 | this.emitStyle();
|
18064 | }
|
18065 | valueChanged(value) {
|
18066 | if (!this.noUpdate) {
|
18067 | this.updateRatio();
|
18068 | }
|
18069 | value = this.ensureValueInBounds(value);
|
18070 | this.ionChange.emit({ value });
|
18071 | }
|
18072 | componentWillLoad() {
|
18073 | |
18074 |
|
18075 |
|
18076 |
|
18077 | this.rangeId = (this.el.hasAttribute('id')) ? this.el.getAttribute('id') : `ion-r-${rangeIds++}`;
|
18078 | this.inheritedAttributes = inheritAttributes(this.el, ['aria-label']);
|
18079 | }
|
18080 | componentDidLoad() {
|
18081 | this.setupGesture();
|
18082 | this.didLoad = true;
|
18083 | }
|
18084 | connectedCallback() {
|
18085 | this.updateRatio();
|
18086 | this.debounceChanged();
|
18087 | this.disabledChanged();
|
18088 | |
18089 |
|
18090 |
|
18091 |
|
18092 |
|
18093 |
|
18094 | if (this.didLoad) {
|
18095 | this.setupGesture();
|
18096 | }
|
18097 | }
|
18098 | disconnectedCallback() {
|
18099 | if (this.gesture) {
|
18100 | this.gesture.destroy();
|
18101 | this.gesture = undefined;
|
18102 | }
|
18103 | }
|
18104 | getValue() {
|
18105 | const value = this.value || 0;
|
18106 | if (this.dualKnobs) {
|
18107 | if (typeof value === 'object') {
|
18108 | return value;
|
18109 | }
|
18110 | return {
|
18111 | lower: 0,
|
18112 | upper: value
|
18113 | };
|
18114 | }
|
18115 | else {
|
18116 | if (typeof value === 'object') {
|
18117 | return value.upper;
|
18118 | }
|
18119 | return value;
|
18120 | }
|
18121 | }
|
18122 | emitStyle() {
|
18123 | this.ionStyle.emit({
|
18124 | 'interactive': true,
|
18125 | 'interactive-disabled': this.disabled
|
18126 | });
|
18127 | }
|
18128 | onStart(detail) {
|
18129 | const rect = this.rect = this.rangeSlider.getBoundingClientRect();
|
18130 | const currentX = detail.currentX;
|
18131 |
|
18132 | let ratio = clamp(0, (currentX - rect.left) / rect.width, 1);
|
18133 | if (document.dir === 'rtl') {
|
18134 | ratio = 1 - ratio;
|
18135 | }
|
18136 | this.pressedKnob =
|
18137 | !this.dualKnobs ||
|
18138 | Math.abs(this.ratioA - ratio) < Math.abs(this.ratioB - ratio)
|
18139 | ? 'A'
|
18140 | : 'B';
|
18141 | this.setFocus(this.pressedKnob);
|
18142 |
|
18143 | this.update(currentX);
|
18144 | }
|
18145 | onMove(detail) {
|
18146 | this.update(detail.currentX);
|
18147 | }
|
18148 | onEnd(detail) {
|
18149 | this.update(detail.currentX);
|
18150 | this.pressedKnob = undefined;
|
18151 | }
|
18152 | update(currentX) {
|
18153 |
|
18154 |
|
18155 | const rect = this.rect;
|
18156 | let ratio = clamp(0, (currentX - rect.left) / rect.width, 1);
|
18157 | if (document.dir === 'rtl') {
|
18158 | ratio = 1 - ratio;
|
18159 | }
|
18160 | if (this.snaps) {
|
18161 |
|
18162 | ratio = valueToRatio(ratioToValue(ratio, this.min, this.max, this.step), this.min, this.max);
|
18163 | }
|
18164 |
|
18165 | if (this.pressedKnob === 'A') {
|
18166 | this.ratioA = ratio;
|
18167 | }
|
18168 | else {
|
18169 | this.ratioB = ratio;
|
18170 | }
|
18171 |
|
18172 | this.updateValue();
|
18173 | }
|
18174 | get valA() {
|
18175 | return ratioToValue(this.ratioA, this.min, this.max, this.step);
|
18176 | }
|
18177 | get valB() {
|
18178 | return ratioToValue(this.ratioB, this.min, this.max, this.step);
|
18179 | }
|
18180 | get ratioLower() {
|
18181 | if (this.dualKnobs) {
|
18182 | return Math.min(this.ratioA, this.ratioB);
|
18183 | }
|
18184 | return 0;
|
18185 | }
|
18186 | get ratioUpper() {
|
18187 | if (this.dualKnobs) {
|
18188 | return Math.max(this.ratioA, this.ratioB);
|
18189 | }
|
18190 | return this.ratioA;
|
18191 | }
|
18192 | updateRatio() {
|
18193 | const value = this.getValue();
|
18194 | const { min, max } = this;
|
18195 | if (this.dualKnobs) {
|
18196 | this.ratioA = valueToRatio(value.lower, min, max);
|
18197 | this.ratioB = valueToRatio(value.upper, min, max);
|
18198 | }
|
18199 | else {
|
18200 | this.ratioA = valueToRatio(value, min, max);
|
18201 | }
|
18202 | }
|
18203 | updateValue() {
|
18204 | this.noUpdate = true;
|
18205 | const { valA, valB } = this;
|
18206 | this.value = !this.dualKnobs
|
18207 | ? valA
|
18208 | : {
|
18209 | lower: Math.min(valA, valB),
|
18210 | upper: Math.max(valA, valB)
|
18211 | };
|
18212 | this.noUpdate = false;
|
18213 | }
|
18214 | setFocus(knob) {
|
18215 | if (this.el.shadowRoot) {
|
18216 | const knobEl = this.el.shadowRoot.querySelector(knob === 'A' ? '.range-knob-a' : '.range-knob-b');
|
18217 | if (knobEl) {
|
18218 | knobEl.focus();
|
18219 | }
|
18220 | }
|
18221 | }
|
18222 | render() {
|
18223 | const { min, max, step, el, handleKeyboard, pressedKnob, disabled, pin, ratioLower, ratioUpper, inheritedAttributes, rangeId } = this;
|
18224 | |
18225 |
|
18226 |
|
18227 |
|
18228 |
|
18229 | let { labelText } = getAriaLabel(el, rangeId);
|
18230 | if (labelText === undefined || labelText === null) {
|
18231 | labelText = inheritedAttributes['aria-label'];
|
18232 | }
|
18233 | const mode = getIonMode$1(this);
|
18234 | const barStart = `${ratioLower * 100}%`;
|
18235 | const barEnd = `${100 - ratioUpper * 100}%`;
|
18236 | const doc = document;
|
18237 | const isRTL = doc.dir === 'rtl';
|
18238 | const start = isRTL ? 'right' : 'left';
|
18239 | const end = isRTL ? 'left' : 'right';
|
18240 | const tickStyle = (tick) => {
|
18241 | return {
|
18242 | [start]: tick[start]
|
18243 | };
|
18244 | };
|
18245 | const barStyle = {
|
18246 | [start]: barStart,
|
18247 | [end]: barEnd
|
18248 | };
|
18249 | const ticks = [];
|
18250 | if (this.snaps && this.ticks) {
|
18251 | for (let value = min; value <= max; value += step) {
|
18252 | const ratio = valueToRatio(value, min, max);
|
18253 | const tick = {
|
18254 | ratio,
|
18255 | active: ratio >= ratioLower && ratio <= ratioUpper,
|
18256 | };
|
18257 | tick[start] = `${ratio * 100}%`;
|
18258 | ticks.push(tick);
|
18259 | }
|
18260 | }
|
18261 | renderHiddenInput(true, el, this.name, JSON.stringify(this.getValue()), disabled);
|
18262 | return (hAsync(Host, { onFocusin: this.onFocus, onFocusout: this.onBlur, id: rangeId, class: createColorClasses$1(this.color, {
|
18263 | [mode]: true,
|
18264 | 'in-item': hostContext('ion-item', el),
|
18265 | 'range-disabled': disabled,
|
18266 | 'range-pressed': pressedKnob !== undefined,
|
18267 | 'range-has-pin': pin
|
18268 | }) }, hAsync("slot", { name: "start" }), hAsync("div", { class: "range-slider", ref: rangeEl => this.rangeSlider = rangeEl }, ticks.map(tick => (hAsync("div", { style: tickStyle(tick), role: "presentation", class: {
|
18269 | 'range-tick': true,
|
18270 | 'range-tick-active': tick.active
|
18271 | }, part: tick.active ? 'tick-active' : 'tick' }))), hAsync("div", { class: "range-bar", role: "presentation", part: "bar" }), hAsync("div", { class: "range-bar range-bar-active", role: "presentation", style: barStyle, part: "bar-active" }), renderKnob(isRTL, {
|
18272 | knob: 'A',
|
18273 | pressed: pressedKnob === 'A',
|
18274 | value: this.valA,
|
18275 | ratio: this.ratioA,
|
18276 | pin,
|
18277 | disabled,
|
18278 | handleKeyboard,
|
18279 | min,
|
18280 | max,
|
18281 | labelText
|
18282 | }), this.dualKnobs && renderKnob(isRTL, {
|
18283 | knob: 'B',
|
18284 | pressed: pressedKnob === 'B',
|
18285 | value: this.valB,
|
18286 | ratio: this.ratioB,
|
18287 | pin,
|
18288 | disabled,
|
18289 | handleKeyboard,
|
18290 | min,
|
18291 | max,
|
18292 | labelText
|
18293 | })), hAsync("slot", { name: "end" })));
|
18294 | }
|
18295 | get el() { return getElement(this); }
|
18296 | static get watchers() { return {
|
18297 | "debounce": ["debounceChanged"],
|
18298 | "min": ["minChanged"],
|
18299 | "max": ["maxChanged"],
|
18300 | "disabled": ["disabledChanged"],
|
18301 | "value": ["valueChanged"]
|
18302 | }; }
|
18303 | static get style() { return {
|
18304 | ios: rangeIosCss,
|
18305 | md: rangeMdCss
|
18306 | }; }
|
18307 | static get cmpMeta() { return {
|
18308 | "$flags$": 41,
|
18309 | "$tagName$": "ion-range",
|
18310 | "$members$": {
|
18311 | "color": [513],
|
18312 | "debounce": [2],
|
18313 | "name": [1],
|
18314 | "dualKnobs": [4, "dual-knobs"],
|
18315 | "min": [2],
|
18316 | "max": [2],
|
18317 | "pin": [4],
|
18318 | "snaps": [4],
|
18319 | "step": [2],
|
18320 | "ticks": [4],
|
18321 | "disabled": [4],
|
18322 | "value": [1026],
|
18323 | "ratioA": [32],
|
18324 | "ratioB": [32],
|
18325 | "pressedKnob": [32]
|
18326 | },
|
18327 | "$listeners$": undefined,
|
18328 | "$lazyBundleId$": "-",
|
18329 | "$attrsToReflect$": [["color", "color"]]
|
18330 | }; }
|
18331 | }
|
18332 | const renderKnob = (isRTL, { knob, value, ratio, min, max, disabled, pressed, pin, handleKeyboard, labelText }) => {
|
18333 | const start = isRTL ? 'right' : 'left';
|
18334 | const knobStyle = () => {
|
18335 | const style = {};
|
18336 | style[start] = `${ratio * 100}%`;
|
18337 | return style;
|
18338 | };
|
18339 | return (hAsync("div", { onKeyDown: (ev) => {
|
18340 | const key = ev.key;
|
18341 | if (key === 'ArrowLeft' || key === 'ArrowDown') {
|
18342 | handleKeyboard(knob, false);
|
18343 | ev.preventDefault();
|
18344 | ev.stopPropagation();
|
18345 | }
|
18346 | else if (key === 'ArrowRight' || key === 'ArrowUp') {
|
18347 | handleKeyboard(knob, true);
|
18348 | ev.preventDefault();
|
18349 | ev.stopPropagation();
|
18350 | }
|
18351 | }, class: {
|
18352 | 'range-knob-handle': true,
|
18353 | 'range-knob-a': knob === 'A',
|
18354 | 'range-knob-b': knob === 'B',
|
18355 | 'range-knob-pressed': pressed,
|
18356 | 'range-knob-min': value === min,
|
18357 | 'range-knob-max': value === max
|
18358 | }, style: knobStyle(), role: "slider", tabindex: disabled ? -1 : 0, "aria-label": labelText, "aria-valuemin": min, "aria-valuemax": max, "aria-disabled": disabled ? 'true' : null, "aria-valuenow": value }, pin && hAsync("div", { class: "range-pin", role: "presentation", part: "pin" }, Math.round(value)), hAsync("div", { class: "range-knob", role: "presentation", part: "knob" })));
|
18359 | };
|
18360 | const ratioToValue = (ratio, min, max, step) => {
|
18361 | let value = (max - min) * ratio;
|
18362 | if (step > 0) {
|
18363 | value = Math.round(value / step) * step + min;
|
18364 | }
|
18365 | return clamp(min, value, max);
|
18366 | };
|
18367 | const valueToRatio = (value, min, max) => {
|
18368 | return clamp(0, (value - min) / (max - min), 1);
|
18369 | };
|
18370 | let rangeIds = 0;
|
18371 |
|
18372 | const getRefresherAnimationType = (contentEl) => {
|
18373 | const previousSibling = contentEl.previousElementSibling;
|
18374 | const hasHeader = previousSibling !== null && previousSibling.tagName === 'ION-HEADER';
|
18375 | return hasHeader ? 'translate' : 'scale';
|
18376 | };
|
18377 | const createPullingAnimation = (type, pullingSpinner, refresherEl) => {
|
18378 | return type === 'scale' ? createScaleAnimation(pullingSpinner, refresherEl) : createTranslateAnimation(pullingSpinner, refresherEl);
|
18379 | };
|
18380 | const createBaseAnimation = (pullingRefresherIcon) => {
|
18381 | const spinner = pullingRefresherIcon.querySelector('ion-spinner');
|
18382 | const circle = spinner.shadowRoot.querySelector('circle');
|
18383 | const spinnerArrowContainer = pullingRefresherIcon.querySelector('.spinner-arrow-container');
|
18384 | const arrowContainer = pullingRefresherIcon.querySelector('.arrow-container');
|
18385 | const arrow = (arrowContainer) ? arrowContainer.querySelector('ion-icon') : null;
|
18386 | const baseAnimation = createAnimation()
|
18387 | .duration(1000)
|
18388 | .easing('ease-out');
|
18389 | const spinnerArrowContainerAnimation = createAnimation()
|
18390 | .addElement(spinnerArrowContainer)
|
18391 | .keyframes([
|
18392 | { offset: 0, opacity: '0.3' },
|
18393 | { offset: 0.45, opacity: '0.3' },
|
18394 | { offset: 0.55, opacity: '1' },
|
18395 | { offset: 1, opacity: '1' }
|
18396 | ]);
|
18397 | const circleInnerAnimation = createAnimation()
|
18398 | .addElement(circle)
|
18399 | .keyframes([
|
18400 | { offset: 0, strokeDasharray: '1px, 200px' },
|
18401 | { offset: 0.20, strokeDasharray: '1px, 200px' },
|
18402 | { offset: 0.55, strokeDasharray: '100px, 200px' },
|
18403 | { offset: 1, strokeDasharray: '100px, 200px' }
|
18404 | ]);
|
18405 | const circleOuterAnimation = createAnimation()
|
18406 | .addElement(spinner)
|
18407 | .keyframes([
|
18408 | { offset: 0, transform: 'rotate(-90deg)' },
|
18409 | { offset: 1, transform: 'rotate(210deg)' }
|
18410 | ]);
|
18411 | |
18412 |
|
18413 |
|
18414 |
|
18415 |
|
18416 | if (arrowContainer && arrow) {
|
18417 | const arrowContainerAnimation = createAnimation()
|
18418 | .addElement(arrowContainer)
|
18419 | .keyframes([
|
18420 | { offset: 0, transform: 'rotate(0deg)' },
|
18421 | { offset: 0.30, transform: 'rotate(0deg)' },
|
18422 | { offset: 0.55, transform: 'rotate(280deg)' },
|
18423 | { offset: 1, transform: 'rotate(400deg)' }
|
18424 | ]);
|
18425 | const arrowAnimation = createAnimation()
|
18426 | .addElement(arrow)
|
18427 | .keyframes([
|
18428 | { offset: 0, transform: 'translateX(2px) scale(0)' },
|
18429 | { offset: 0.30, transform: 'translateX(2px) scale(0)' },
|
18430 | { offset: 0.55, transform: 'translateX(-1.5px) scale(1)' },
|
18431 | { offset: 1, transform: 'translateX(-1.5px) scale(1)' }
|
18432 | ]);
|
18433 | baseAnimation.addAnimation([arrowContainerAnimation, arrowAnimation]);
|
18434 | }
|
18435 | return baseAnimation.addAnimation([spinnerArrowContainerAnimation, circleInnerAnimation, circleOuterAnimation]);
|
18436 | };
|
18437 | const createScaleAnimation = (pullingRefresherIcon, refresherEl) => {
|
18438 | |
18439 |
|
18440 |
|
18441 |
|
18442 |
|
18443 |
|
18444 |
|
18445 |
|
18446 |
|
18447 | const height = refresherEl.clientHeight;
|
18448 | const spinnerAnimation = createAnimation()
|
18449 | .addElement(pullingRefresherIcon)
|
18450 | .keyframes([
|
18451 | { offset: 0, transform: `scale(0) translateY(-${height}px)` },
|
18452 | { offset: 1, transform: 'scale(1) translateY(100px)' }
|
18453 | ]);
|
18454 | return createBaseAnimation(pullingRefresherIcon).addAnimation([spinnerAnimation]);
|
18455 | };
|
18456 | const createTranslateAnimation = (pullingRefresherIcon, refresherEl) => {
|
18457 | |
18458 |
|
18459 |
|
18460 |
|
18461 |
|
18462 |
|
18463 |
|
18464 |
|
18465 |
|
18466 | const height = refresherEl.clientHeight;
|
18467 | const spinnerAnimation = createAnimation()
|
18468 | .addElement(pullingRefresherIcon)
|
18469 | .keyframes([
|
18470 | { offset: 0, transform: `translateY(-${height}px)` },
|
18471 | { offset: 1, transform: 'translateY(100px)' }
|
18472 | ]);
|
18473 | return createBaseAnimation(pullingRefresherIcon).addAnimation([spinnerAnimation]);
|
18474 | };
|
18475 | const createSnapBackAnimation = (pullingRefresherIcon) => {
|
18476 | return createAnimation()
|
18477 | .duration(125)
|
18478 | .addElement(pullingRefresherIcon)
|
18479 | .fromTo('transform', 'translateY(var(--ion-pulling-refresher-translate, 100px))', 'translateY(0px)');
|
18480 | };
|
18481 |
|
18482 |
|
18483 | const setSpinnerOpacity = (spinner, opacity) => {
|
18484 | spinner.style.setProperty('opacity', opacity.toString());
|
18485 | };
|
18486 | const handleScrollWhilePulling = (spinner, ticks, opacity, currentTickToShow) => {
|
18487 | writeTask(() => {
|
18488 | setSpinnerOpacity(spinner, opacity);
|
18489 | ticks.forEach((el, i) => el.style.setProperty('opacity', (i <= currentTickToShow) ? '0.99' : '0'));
|
18490 | });
|
18491 | };
|
18492 | const handleScrollWhileRefreshing = (spinner, lastVelocityY) => {
|
18493 | writeTask(() => {
|
18494 |
|
18495 | spinner.style.setProperty('--refreshing-rotation-duration', (lastVelocityY >= 1.0) ? '0.5s' : '2s');
|
18496 | spinner.style.setProperty('opacity', '1');
|
18497 | });
|
18498 | };
|
18499 | const translateElement = (el, value) => {
|
18500 | if (!el) {
|
18501 | return Promise.resolve();
|
18502 | }
|
18503 | const trans = transitionEndAsync(el, 200);
|
18504 | writeTask(() => {
|
18505 | el.style.setProperty('transition', '0.2s all ease-out');
|
18506 | if (value === undefined) {
|
18507 | el.style.removeProperty('transform');
|
18508 | }
|
18509 | else {
|
18510 | el.style.setProperty('transform', `translate3d(0px, ${value}, 0px)`);
|
18511 | }
|
18512 | });
|
18513 | return trans;
|
18514 | };
|
18515 |
|
18516 |
|
18517 | const shouldUseNativeRefresher = async (referenceEl, mode) => {
|
18518 | const refresherContent = referenceEl.querySelector('ion-refresher-content');
|
18519 | if (!refresherContent) {
|
18520 | return Promise.resolve(false);
|
18521 | }
|
18522 | await new Promise(resolve => componentOnReady(refresherContent, resolve));
|
18523 | const pullingSpinner = referenceEl.querySelector('ion-refresher-content .refresher-pulling ion-spinner');
|
18524 | const refreshingSpinner = referenceEl.querySelector('ion-refresher-content .refresher-refreshing ion-spinner');
|
18525 | return (pullingSpinner !== null &&
|
18526 | refreshingSpinner !== null &&
|
18527 | ((mode === 'ios' && isPlatform('mobile') && referenceEl.style.webkitOverflowScrolling !== undefined) ||
|
18528 | mode === 'md'));
|
18529 | };
|
18530 | const transitionEndAsync = (el, expectedDuration = 0) => {
|
18531 | return new Promise(resolve => {
|
18532 | transitionEnd$2(el, expectedDuration, resolve);
|
18533 | });
|
18534 | };
|
18535 | const transitionEnd$2 = (el, expectedDuration = 0, callback) => {
|
18536 | let unRegTrans;
|
18537 | let animationTimeout;
|
18538 | const opts = { passive: true };
|
18539 | const ANIMATION_FALLBACK_TIMEOUT = 500;
|
18540 | const unregister = () => {
|
18541 | if (unRegTrans) {
|
18542 | unRegTrans();
|
18543 | }
|
18544 | };
|
18545 | const onTransitionEnd = (ev) => {
|
18546 | if (ev === undefined || el === ev.target) {
|
18547 | unregister();
|
18548 | callback(ev);
|
18549 | }
|
18550 | };
|
18551 | if (el) {
|
18552 | el.addEventListener('webkitTransitionEnd', onTransitionEnd, opts);
|
18553 | el.addEventListener('transitionend', onTransitionEnd, opts);
|
18554 | animationTimeout = setTimeout(onTransitionEnd, expectedDuration + ANIMATION_FALLBACK_TIMEOUT);
|
18555 | unRegTrans = () => {
|
18556 | if (animationTimeout) {
|
18557 | clearTimeout(animationTimeout);
|
18558 | animationTimeout = undefined;
|
18559 | }
|
18560 | el.removeEventListener('webkitTransitionEnd', onTransitionEnd, opts);
|
18561 | el.removeEventListener('transitionend', onTransitionEnd, opts);
|
18562 | };
|
18563 | }
|
18564 | return unregister;
|
18565 | };
|
18566 |
|
18567 | const refresherIosCss = "ion-refresher{left:0;top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}[dir=rtl] ion-refresher,:host-context([dir=rtl]) ion-refresher{left:unset;right:unset;right:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}[dir=rtl] .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-ios .refresher-pulling-icon,.refresher-ios .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-ios .refresher-pulling-text,.refresher-ios .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-lines-ios line,.refresher-ios .refresher-refreshing .spinner-lines-small-ios line,.refresher-ios .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-ios .refresher-refreshing .spinner-bubbles circle,.refresher-ios .refresher-refreshing .spinner-circles circle,.refresher-ios .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native ion-spinner{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.refresher-native .refresher-refreshing ion-spinner{--refreshing-rotation-duration:2s;display:none;-webkit-animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards;animation:var(--refreshing-rotation-duration) ease-out refresher-rotate forwards}.refresher-native .refresher-refreshing{display:none;-webkit-animation:250ms linear refresher-pop forwards;animation:250ms linear refresher-pop forwards}.refresher-native.refresher-refreshing .refresher-pulling ion-spinner,.refresher-native.refresher-completing .refresher-pulling ion-spinner{display:none}.refresher-native.refresher-refreshing .refresher-refreshing ion-spinner,.refresher-native.refresher-completing .refresher-refreshing ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-pulling ion-spinner{display:block}.refresher-native.refresher-pulling .refresher-refreshing ion-spinner{display:none}@-webkit-keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes refresher-pop{0%{-webkit-transform:scale(1);transform:scale(1);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in}50%{-webkit-transform:scale(1.2);transform:scale(1.2);-webkit-animation-timing-function:ease-out;animation-timing-function:ease-out}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}@keyframes refresher-rotate{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(180deg);transform:rotate(180deg)}}";
|
18568 |
|
18569 | const refresherMdCss = "ion-refresher{left:0;top:0;display:none;position:absolute;width:100%;height:60px;pointer-events:none;z-index:-1}[dir=rtl] ion-refresher,:host-context([dir=rtl]) ion-refresher{left:unset;right:unset;right:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:200ms;transition:200ms;font-size:30px;text-align:center}[dir=rtl] .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon,:host-context([dir=rtl]) .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}ion-refresher-content .arrow-container{display:none}.refresher-pulling ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-native .refresher-pulling-text,.refresher-native .refresher-refreshing-text{display:none}.refresher-md .refresher-pulling-icon,.refresher-md .refresher-refreshing-icon{color:var(--ion-text-color, #000)}.refresher-md .refresher-pulling-text,.refresher-md .refresher-refreshing-text{color:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-lines-md line,.refresher-md .refresher-refreshing .spinner-lines-small-md line,.refresher-md .refresher-refreshing .spinner-crescent circle{stroke:var(--ion-text-color, #000)}.refresher-md .refresher-refreshing .spinner-bubbles circle,.refresher-md .refresher-refreshing .spinner-circles circle,.refresher-md .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color, #000)}ion-refresher.refresher-native{display:block;z-index:1}ion-refresher.refresher-native ion-spinner{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;width:24px;height:24px;color:var(--ion-color-primary, #3880ff)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native ion-spinner{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}ion-refresher.refresher-native .spinner-arrow-container{display:inherit}ion-refresher.refresher-native .arrow-container{display:block;position:absolute;width:24px;height:24px}ion-refresher.refresher-native .arrow-container ion-icon{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;left:0;right:0;bottom:-4px;position:absolute;color:var(--ion-color-primary, #3880ff);font-size:12px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native .arrow-container ion-icon{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}ion-refresher.refresher-native.refresher-pulling ion-refresher-content .refresher-pulling,ion-refresher.refresher-native.refresher-ready ion-refresher-content .refresher-pulling{display:-ms-flexbox;display:flex}ion-refresher.refresher-native.refresher-refreshing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-completing ion-refresher-content .refresher-refreshing,ion-refresher.refresher-native.refresher-cancelling ion-refresher-content .refresher-refreshing{display:-ms-flexbox;display:flex}ion-refresher.refresher-native .refresher-pulling-icon{-webkit-transform:translateY(calc(-100% - 10px));transform:translateY(calc(-100% - 10px))}ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;border-radius:100%;padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;display:-ms-flexbox;display:flex;border:1px solid var(--ion-color-step-200, #ececec);background:var(--ion-color-step-250, #ffffff);-webkit-box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1);box-shadow:0px 1px 6px rgba(0, 0, 0, 0.1)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-refresher.refresher-native .refresher-pulling-icon,ion-refresher.refresher-native .refresher-refreshing-icon{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}";
|
18570 |
|
18571 | class Refresher {
|
18572 | constructor(hostRef) {
|
18573 | registerInstance(this, hostRef);
|
18574 | this.ionRefresh = createEvent(this, "ionRefresh", 7);
|
18575 | this.ionPull = createEvent(this, "ionPull", 7);
|
18576 | this.ionStart = createEvent(this, "ionStart", 7);
|
18577 | this.appliedStyles = false;
|
18578 | this.didStart = false;
|
18579 | this.progress = 0;
|
18580 | this.pointerDown = false;
|
18581 | this.needsCompletion = false;
|
18582 | this.didRefresh = false;
|
18583 | this.lastVelocityY = 0;
|
18584 | this.animations = [];
|
18585 | this.nativeRefresher = false;
|
18586 | |
18587 |
|
18588 |
|
18589 |
|
18590 |
|
18591 |
|
18592 |
|
18593 |
|
18594 |
|
18595 |
|
18596 | this.state = 1 ;
|
18597 | |
18598 |
|
18599 |
|
18600 |
|
18601 |
|
18602 |
|
18603 | this.pullMin = 60;
|
18604 | |
18605 |
|
18606 |
|
18607 |
|
18608 |
|
18609 |
|
18610 |
|
18611 | this.pullMax = this.pullMin + 60;
|
18612 | |
18613 |
|
18614 |
|
18615 |
|
18616 |
|
18617 | this.closeDuration = '280ms';
|
18618 | |
18619 |
|
18620 |
|
18621 |
|
18622 |
|
18623 | this.snapbackDuration = '280ms';
|
18624 | |
18625 |
|
18626 |
|
18627 |
|
18628 |
|
18629 |
|
18630 |
|
18631 |
|
18632 |
|
18633 |
|
18634 |
|
18635 |
|
18636 |
|
18637 |
|
18638 | this.pullFactor = 1;
|
18639 | |
18640 |
|
18641 |
|
18642 | this.disabled = false;
|
18643 | }
|
18644 | disabledChanged() {
|
18645 | if (this.gesture) {
|
18646 | this.gesture.enable(!this.disabled);
|
18647 | }
|
18648 | }
|
18649 | async checkNativeRefresher() {
|
18650 | const useNativeRefresher = await shouldUseNativeRefresher(this.el, getIonMode$1(this));
|
18651 | if (useNativeRefresher && !this.nativeRefresher) {
|
18652 | const contentEl = this.el.closest('ion-content');
|
18653 | this.setupNativeRefresher(contentEl);
|
18654 | }
|
18655 | else if (!useNativeRefresher) {
|
18656 | this.destroyNativeRefresher();
|
18657 | }
|
18658 | }
|
18659 | destroyNativeRefresher() {
|
18660 | if (this.scrollEl && this.scrollListenerCallback) {
|
18661 | this.scrollEl.removeEventListener('scroll', this.scrollListenerCallback);
|
18662 | this.scrollListenerCallback = undefined;
|
18663 | }
|
18664 | this.nativeRefresher = false;
|
18665 | }
|
18666 | async resetNativeRefresher(el, state) {
|
18667 | this.state = state;
|
18668 | if (getIonMode$1(this) === 'ios') {
|
18669 | await translateElement(el, undefined);
|
18670 | }
|
18671 | else {
|
18672 | await transitionEndAsync(this.el.querySelector('.refresher-refreshing-icon'), 200);
|
18673 | }
|
18674 | this.didRefresh = false;
|
18675 | this.needsCompletion = false;
|
18676 | this.pointerDown = false;
|
18677 | this.animations.forEach(ani => ani.destroy());
|
18678 | this.animations = [];
|
18679 | this.progress = 0;
|
18680 | this.state = 1 ;
|
18681 | }
|
18682 | async setupiOSNativeRefresher(pullingSpinner, refreshingSpinner) {
|
18683 | this.elementToTransform = this.scrollEl;
|
18684 | const ticks = pullingSpinner.shadowRoot.querySelectorAll('svg');
|
18685 | let MAX_PULL = this.scrollEl.clientHeight * 0.16;
|
18686 | const NUM_TICKS = ticks.length;
|
18687 | writeTask(() => ticks.forEach(el => el.style.setProperty('animation', 'none')));
|
18688 | this.scrollListenerCallback = () => {
|
18689 |
|
18690 | if (!this.pointerDown && this.state === 1 ) {
|
18691 | return;
|
18692 | }
|
18693 | readTask(() => {
|
18694 |
|
18695 | const scrollTop = this.scrollEl.scrollTop;
|
18696 | const refresherHeight = this.el.clientHeight;
|
18697 | if (scrollTop > 0) {
|
18698 | |
18699 |
|
18700 |
|
18701 |
|
18702 | if (this.state === 8 ) {
|
18703 | const ratio = clamp(0, scrollTop / (refresherHeight * 0.5), 1);
|
18704 | writeTask(() => setSpinnerOpacity(refreshingSpinner, 1 - ratio));
|
18705 | return;
|
18706 | }
|
18707 | writeTask(() => setSpinnerOpacity(pullingSpinner, 0));
|
18708 | return;
|
18709 | }
|
18710 | if (this.pointerDown) {
|
18711 | if (!this.didStart) {
|
18712 | this.didStart = true;
|
18713 | this.ionStart.emit();
|
18714 | }
|
18715 |
|
18716 | if (this.pointerDown) {
|
18717 | this.ionPull.emit();
|
18718 | }
|
18719 | }
|
18720 |
|
18721 | const opacity = clamp(0, Math.abs(scrollTop) / refresherHeight, 0.99);
|
18722 | const pullAmount = this.progress = clamp(0, (Math.abs(scrollTop) - 30) / MAX_PULL, 1);
|
18723 | const currentTickToShow = clamp(0, Math.floor(pullAmount * NUM_TICKS), NUM_TICKS - 1);
|
18724 | const shouldShowRefreshingSpinner = this.state === 8 || currentTickToShow === NUM_TICKS - 1;
|
18725 | if (shouldShowRefreshingSpinner) {
|
18726 | if (this.pointerDown) {
|
18727 | handleScrollWhileRefreshing(refreshingSpinner, this.lastVelocityY);
|
18728 | }
|
18729 | if (!this.didRefresh) {
|
18730 | this.beginRefresh();
|
18731 | this.didRefresh = true;
|
18732 | hapticImpact({ style: 'light' });
|
18733 | |
18734 |
|
18735 |
|
18736 |
|
18737 | if (!this.pointerDown) {
|
18738 | translateElement(this.elementToTransform, `${refresherHeight}px`);
|
18739 | }
|
18740 | }
|
18741 | }
|
18742 | else {
|
18743 | this.state = 2 ;
|
18744 | handleScrollWhilePulling(pullingSpinner, ticks, opacity, currentTickToShow);
|
18745 | }
|
18746 | });
|
18747 | };
|
18748 | this.scrollEl.addEventListener('scroll', this.scrollListenerCallback);
|
18749 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
18750 | el: this.scrollEl,
|
18751 | gestureName: 'refresher',
|
18752 | gesturePriority: 31,
|
18753 | direction: 'y',
|
18754 | threshold: 5,
|
18755 | onStart: () => {
|
18756 | this.pointerDown = true;
|
18757 | if (!this.didRefresh) {
|
18758 | translateElement(this.elementToTransform, '0px');
|
18759 | }
|
18760 | |
18761 |
|
18762 |
|
18763 |
|
18764 |
|
18765 |
|
18766 |
|
18767 |
|
18768 | if (MAX_PULL === 0) {
|
18769 | MAX_PULL = this.scrollEl.clientHeight * 0.16;
|
18770 | }
|
18771 | },
|
18772 | onMove: ev => {
|
18773 | this.lastVelocityY = ev.velocityY;
|
18774 | },
|
18775 | onEnd: () => {
|
18776 | this.pointerDown = false;
|
18777 | this.didStart = false;
|
18778 | if (this.needsCompletion) {
|
18779 | this.resetNativeRefresher(this.elementToTransform, 32 );
|
18780 | this.needsCompletion = false;
|
18781 | }
|
18782 | else if (this.didRefresh) {
|
18783 | readTask(() => translateElement(this.elementToTransform, `${this.el.clientHeight}px`));
|
18784 | }
|
18785 | },
|
18786 | });
|
18787 | this.disabledChanged();
|
18788 | }
|
18789 | async setupMDNativeRefresher(contentEl, pullingSpinner, refreshingSpinner) {
|
18790 | const circle = getElementRoot(pullingSpinner).querySelector('circle');
|
18791 | const pullingRefresherIcon = this.el.querySelector('ion-refresher-content .refresher-pulling-icon');
|
18792 | const refreshingCircle = getElementRoot(refreshingSpinner).querySelector('circle');
|
18793 | if (circle !== null && refreshingCircle !== null) {
|
18794 | writeTask(() => {
|
18795 | circle.style.setProperty('animation', 'none');
|
18796 |
|
18797 | refreshingSpinner.style.setProperty('animation-delay', '-655ms');
|
18798 | refreshingCircle.style.setProperty('animation-delay', '-655ms');
|
18799 | });
|
18800 | }
|
18801 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
18802 | el: this.scrollEl,
|
18803 | gestureName: 'refresher',
|
18804 | gesturePriority: 31,
|
18805 | direction: 'y',
|
18806 | threshold: 5,
|
18807 | canStart: () => this.state !== 8 && this.state !== 32 && this.scrollEl.scrollTop === 0,
|
18808 | onStart: (ev) => {
|
18809 | ev.data = { animation: undefined, didStart: false, cancelled: false };
|
18810 | },
|
18811 | onMove: (ev) => {
|
18812 | if ((ev.velocityY < 0 && this.progress === 0 && !ev.data.didStart) || ev.data.cancelled) {
|
18813 | ev.data.cancelled = true;
|
18814 | return;
|
18815 | }
|
18816 | if (!ev.data.didStart) {
|
18817 | ev.data.didStart = true;
|
18818 | this.state = 2 ;
|
18819 | writeTask(() => this.scrollEl.style.setProperty('--overflow', 'hidden'));
|
18820 | const animationType = getRefresherAnimationType(contentEl);
|
18821 | const animation = createPullingAnimation(animationType, pullingRefresherIcon, this.el);
|
18822 | ev.data.animation = animation;
|
18823 | animation.progressStart(false, 0);
|
18824 | this.ionStart.emit();
|
18825 | this.animations.push(animation);
|
18826 | return;
|
18827 | }
|
18828 |
|
18829 | this.progress = clamp(0, (ev.deltaY / 180) * 0.5, 1);
|
18830 | ev.data.animation.progressStep(this.progress);
|
18831 | this.ionPull.emit();
|
18832 | },
|
18833 | onEnd: (ev) => {
|
18834 | if (!ev.data.didStart) {
|
18835 | return;
|
18836 | }
|
18837 | writeTask(() => this.scrollEl.style.removeProperty('--overflow'));
|
18838 | if (this.progress <= 0.4) {
|
18839 | this.gesture.enable(false);
|
18840 | ev.data.animation
|
18841 | .progressEnd(0, this.progress, 500)
|
18842 | .onFinish(() => {
|
18843 | this.animations.forEach(ani => ani.destroy());
|
18844 | this.animations = [];
|
18845 | this.gesture.enable(true);
|
18846 | this.state = 1 ;
|
18847 | });
|
18848 | return;
|
18849 | }
|
18850 | const progress = getTimeGivenProgression([0, 0], [0, 0], [1, 1], [1, 1], this.progress)[0];
|
18851 | const snapBackAnimation = createSnapBackAnimation(pullingRefresherIcon);
|
18852 | this.animations.push(snapBackAnimation);
|
18853 | writeTask(async () => {
|
18854 | pullingRefresherIcon.style.setProperty('--ion-pulling-refresher-translate', `${(progress * 100)}px`);
|
18855 | ev.data.animation.progressEnd();
|
18856 | await snapBackAnimation.play();
|
18857 | this.beginRefresh();
|
18858 | ev.data.animation.destroy();
|
18859 | });
|
18860 | }
|
18861 | });
|
18862 | this.disabledChanged();
|
18863 | }
|
18864 | async setupNativeRefresher(contentEl) {
|
18865 | if (this.scrollListenerCallback || !contentEl || this.nativeRefresher || !this.scrollEl) {
|
18866 | return;
|
18867 | }
|
18868 | |
18869 |
|
18870 |
|
18871 |
|
18872 |
|
18873 |
|
18874 |
|
18875 | this.setCss(0, '', false, '');
|
18876 | this.nativeRefresher = true;
|
18877 | const pullingSpinner = this.el.querySelector('ion-refresher-content .refresher-pulling ion-spinner');
|
18878 | const refreshingSpinner = this.el.querySelector('ion-refresher-content .refresher-refreshing ion-spinner');
|
18879 | if (getIonMode$1(this) === 'ios') {
|
18880 | this.setupiOSNativeRefresher(pullingSpinner, refreshingSpinner);
|
18881 | }
|
18882 | else {
|
18883 | this.setupMDNativeRefresher(contentEl, pullingSpinner, refreshingSpinner);
|
18884 | }
|
18885 | }
|
18886 | componentDidUpdate() {
|
18887 | this.checkNativeRefresher();
|
18888 | }
|
18889 | async connectedCallback() {
|
18890 | if (this.el.getAttribute('slot') !== 'fixed') {
|
18891 | console.error('Make sure you use: <ion-refresher slot="fixed">');
|
18892 | return;
|
18893 | }
|
18894 | const contentEl = this.el.closest('ion-content');
|
18895 | if (!contentEl) {
|
18896 | console.error('<ion-refresher> must be used inside an <ion-content>');
|
18897 | return;
|
18898 | }
|
18899 | await new Promise(resolve => componentOnReady(contentEl, resolve));
|
18900 | this.scrollEl = await contentEl.getScrollElement();
|
18901 | this.backgroundContentEl = getElementRoot(contentEl).querySelector('#background-content');
|
18902 | if (await shouldUseNativeRefresher(this.el, getIonMode$1(this))) {
|
18903 | this.setupNativeRefresher(contentEl);
|
18904 | }
|
18905 | else {
|
18906 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
18907 | el: contentEl,
|
18908 | gestureName: 'refresher',
|
18909 | gesturePriority: 31,
|
18910 | direction: 'y',
|
18911 | threshold: 20,
|
18912 | passive: false,
|
18913 | canStart: () => this.canStart(),
|
18914 | onStart: () => this.onStart(),
|
18915 | onMove: ev => this.onMove(ev),
|
18916 | onEnd: () => this.onEnd(),
|
18917 | });
|
18918 | this.disabledChanged();
|
18919 | }
|
18920 | }
|
18921 | disconnectedCallback() {
|
18922 | this.destroyNativeRefresher();
|
18923 | this.scrollEl = undefined;
|
18924 | if (this.gesture) {
|
18925 | this.gesture.destroy();
|
18926 | this.gesture = undefined;
|
18927 | }
|
18928 | }
|
18929 | |
18930 |
|
18931 |
|
18932 |
|
18933 |
|
18934 |
|
18935 |
|
18936 |
|
18937 |
|
18938 | async complete() {
|
18939 | if (this.nativeRefresher) {
|
18940 | this.needsCompletion = true;
|
18941 |
|
18942 | if (!this.pointerDown) {
|
18943 | raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, 32 )));
|
18944 | }
|
18945 | }
|
18946 | else {
|
18947 | this.close(32 , '120ms');
|
18948 | }
|
18949 | }
|
18950 | |
18951 |
|
18952 |
|
18953 | async cancel() {
|
18954 | if (this.nativeRefresher) {
|
18955 |
|
18956 | if (!this.pointerDown) {
|
18957 | raf(() => raf(() => this.resetNativeRefresher(this.elementToTransform, 16 )));
|
18958 | }
|
18959 | }
|
18960 | else {
|
18961 | this.close(16 , '');
|
18962 | }
|
18963 | }
|
18964 | |
18965 |
|
18966 |
|
18967 |
|
18968 |
|
18969 |
|
18970 |
|
18971 |
|
18972 |
|
18973 | getProgress() {
|
18974 | return Promise.resolve(this.progress);
|
18975 | }
|
18976 | canStart() {
|
18977 | if (!this.scrollEl) {
|
18978 | return false;
|
18979 | }
|
18980 | if (this.state !== 1 ) {
|
18981 | return false;
|
18982 | }
|
18983 |
|
18984 |
|
18985 | if (this.scrollEl.scrollTop > 0) {
|
18986 | return false;
|
18987 | }
|
18988 | return true;
|
18989 | }
|
18990 | onStart() {
|
18991 | this.progress = 0;
|
18992 | this.state = 1 ;
|
18993 | }
|
18994 | onMove(detail) {
|
18995 | if (!this.scrollEl) {
|
18996 | return;
|
18997 | }
|
18998 |
|
18999 |
|
19000 |
|
19001 |
|
19002 | const ev = detail.event;
|
19003 | if (ev.touches && ev.touches.length > 1) {
|
19004 | return;
|
19005 | }
|
19006 |
|
19007 |
|
19008 |
|
19009 | if ((this.state & 56 ) !== 0) {
|
19010 | return;
|
19011 | }
|
19012 | const pullFactor = (Number.isNaN(this.pullFactor) || this.pullFactor < 0) ? 1 : this.pullFactor;
|
19013 | const deltaY = detail.deltaY * pullFactor;
|
19014 |
|
19015 |
|
19016 | if (deltaY <= 0) {
|
19017 |
|
19018 |
|
19019 | this.progress = 0;
|
19020 | this.state = 1 ;
|
19021 | if (this.appliedStyles) {
|
19022 |
|
19023 | this.setCss(0, '', false, '');
|
19024 | return;
|
19025 | }
|
19026 | return;
|
19027 | }
|
19028 | if (this.state === 1 ) {
|
19029 |
|
19030 |
|
19031 | const scrollHostScrollTop = this.scrollEl.scrollTop;
|
19032 |
|
19033 |
|
19034 | if (scrollHostScrollTop > 0) {
|
19035 | this.progress = 0;
|
19036 | return;
|
19037 | }
|
19038 |
|
19039 | this.state = 2 ;
|
19040 | }
|
19041 |
|
19042 | if (ev.cancelable) {
|
19043 | ev.preventDefault();
|
19044 | }
|
19045 |
|
19046 |
|
19047 | this.setCss(deltaY, '0ms', true, '');
|
19048 | if (deltaY === 0) {
|
19049 |
|
19050 | this.progress = 0;
|
19051 | return;
|
19052 | }
|
19053 | const pullMin = this.pullMin;
|
19054 |
|
19055 | this.progress = deltaY / pullMin;
|
19056 |
|
19057 | if (!this.didStart) {
|
19058 | this.didStart = true;
|
19059 | this.ionStart.emit();
|
19060 | }
|
19061 |
|
19062 | this.ionPull.emit();
|
19063 |
|
19064 | if (deltaY < pullMin) {
|
19065 |
|
19066 | this.state = 2 ;
|
19067 | return;
|
19068 | }
|
19069 | if (deltaY > this.pullMax) {
|
19070 |
|
19071 | this.beginRefresh();
|
19072 | return;
|
19073 | }
|
19074 |
|
19075 |
|
19076 |
|
19077 | this.state = 4 ;
|
19078 | return;
|
19079 | }
|
19080 | onEnd() {
|
19081 |
|
19082 | if (this.state === 4 ) {
|
19083 |
|
19084 | this.beginRefresh();
|
19085 | }
|
19086 | else if (this.state === 2 ) {
|
19087 |
|
19088 |
|
19089 |
|
19090 |
|
19091 | this.cancel();
|
19092 | }
|
19093 | }
|
19094 | beginRefresh() {
|
19095 |
|
19096 |
|
19097 | this.state = 8 ;
|
19098 |
|
19099 | this.setCss(this.pullMin, this.snapbackDuration, true, '');
|
19100 |
|
19101 |
|
19102 | this.ionRefresh.emit({
|
19103 | complete: this.complete.bind(this)
|
19104 | });
|
19105 | }
|
19106 | close(state, delay) {
|
19107 |
|
19108 | setTimeout(() => {
|
19109 | this.state = 1 ;
|
19110 | this.progress = 0;
|
19111 | this.didStart = false;
|
19112 | this.setCss(0, '0ms', false, '');
|
19113 | }, 600);
|
19114 |
|
19115 |
|
19116 | this.state = state;
|
19117 | this.setCss(0, this.closeDuration, true, delay);
|
19118 |
|
19119 | }
|
19120 | setCss(y, duration, overflowVisible, delay) {
|
19121 | if (this.nativeRefresher) {
|
19122 | return;
|
19123 | }
|
19124 | this.appliedStyles = (y > 0);
|
19125 | writeTask(() => {
|
19126 | if (this.scrollEl && this.backgroundContentEl) {
|
19127 | const scrollStyle = this.scrollEl.style;
|
19128 | const backgroundStyle = this.backgroundContentEl.style;
|
19129 | scrollStyle.transform = backgroundStyle.transform = ((y > 0) ? `translateY(${y}px) translateZ(0px)` : '');
|
19130 | scrollStyle.transitionDuration = backgroundStyle.transitionDuration = duration;
|
19131 | scrollStyle.transitionDelay = backgroundStyle.transitionDelay = delay;
|
19132 | scrollStyle.overflow = (overflowVisible ? 'hidden' : '');
|
19133 | }
|
19134 | });
|
19135 | }
|
19136 | render() {
|
19137 | const mode = getIonMode$1(this);
|
19138 | return (hAsync(Host, { slot: "fixed", class: {
|
19139 | [mode]: true,
|
19140 |
|
19141 | [`refresher-${mode}`]: true,
|
19142 | 'refresher-native': this.nativeRefresher,
|
19143 | 'refresher-active': this.state !== 1 ,
|
19144 | 'refresher-pulling': this.state === 2 ,
|
19145 | 'refresher-ready': this.state === 4 ,
|
19146 | 'refresher-refreshing': this.state === 8 ,
|
19147 | 'refresher-cancelling': this.state === 16 ,
|
19148 | 'refresher-completing': this.state === 32 ,
|
19149 | } }));
|
19150 | }
|
19151 | get el() { return getElement(this); }
|
19152 | static get watchers() { return {
|
19153 | "disabled": ["disabledChanged"]
|
19154 | }; }
|
19155 | static get style() { return {
|
19156 | ios: refresherIosCss,
|
19157 | md: refresherMdCss
|
19158 | }; }
|
19159 | static get cmpMeta() { return {
|
19160 | "$flags$": 32,
|
19161 | "$tagName$": "ion-refresher",
|
19162 | "$members$": {
|
19163 | "pullMin": [2, "pull-min"],
|
19164 | "pullMax": [2, "pull-max"],
|
19165 | "closeDuration": [1, "close-duration"],
|
19166 | "snapbackDuration": [1, "snapback-duration"],
|
19167 | "pullFactor": [2, "pull-factor"],
|
19168 | "disabled": [4],
|
19169 | "nativeRefresher": [32],
|
19170 | "state": [32],
|
19171 | "complete": [64],
|
19172 | "cancel": [64],
|
19173 | "getProgress": [64]
|
19174 | },
|
19175 | "$listeners$": undefined,
|
19176 | "$lazyBundleId$": "-",
|
19177 | "$attrsToReflect$": []
|
19178 | }; }
|
19179 | }
|
19180 |
|
19181 | const spinners = {
|
19182 | 'bubbles': {
|
19183 | dur: 1000,
|
19184 | circles: 9,
|
19185 | fn: (dur, index, total) => {
|
19186 | const animationDelay = `${(dur * index / total) - dur}ms`;
|
19187 | const angle = 2 * Math.PI * index / total;
|
19188 | return {
|
19189 | r: 5,
|
19190 | style: {
|
19191 | 'top': `${9 * Math.sin(angle)}px`,
|
19192 | 'left': `${9 * Math.cos(angle)}px`,
|
19193 | 'animation-delay': animationDelay,
|
19194 | }
|
19195 | };
|
19196 | }
|
19197 | },
|
19198 | 'circles': {
|
19199 | dur: 1000,
|
19200 | circles: 8,
|
19201 | fn: (dur, index, total) => {
|
19202 | const step = index / total;
|
19203 | const animationDelay = `${(dur * step) - dur}ms`;
|
19204 | const angle = 2 * Math.PI * step;
|
19205 | return {
|
19206 | r: 5,
|
19207 | style: {
|
19208 | 'top': `${9 * Math.sin(angle)}px`,
|
19209 | 'left': `${9 * Math.cos(angle)}px`,
|
19210 | 'animation-delay': animationDelay,
|
19211 | }
|
19212 | };
|
19213 | }
|
19214 | },
|
19215 | 'circular': {
|
19216 | dur: 1400,
|
19217 | elmDuration: true,
|
19218 | circles: 1,
|
19219 | fn: () => {
|
19220 | return {
|
19221 | r: 20,
|
19222 | cx: 48,
|
19223 | cy: 48,
|
19224 | fill: 'none',
|
19225 | viewBox: '24 24 48 48',
|
19226 | transform: 'translate(0,0)',
|
19227 | style: {}
|
19228 | };
|
19229 | }
|
19230 | },
|
19231 | 'crescent': {
|
19232 | dur: 750,
|
19233 | circles: 1,
|
19234 | fn: () => {
|
19235 | return {
|
19236 | r: 26,
|
19237 | style: {}
|
19238 | };
|
19239 | }
|
19240 | },
|
19241 | 'dots': {
|
19242 | dur: 750,
|
19243 | circles: 3,
|
19244 | fn: (_, index) => {
|
19245 | const animationDelay = -(110 * index) + 'ms';
|
19246 | return {
|
19247 | r: 6,
|
19248 | style: {
|
19249 | 'left': `${9 - (9 * index)}px`,
|
19250 | 'animation-delay': animationDelay,
|
19251 | }
|
19252 | };
|
19253 | }
|
19254 | },
|
19255 | 'lines': {
|
19256 | dur: 1000,
|
19257 | lines: 12,
|
19258 | fn: (dur, index, total) => {
|
19259 | const transform = `rotate(${30 * index + (index < 6 ? 180 : -180)}deg)`;
|
19260 | const animationDelay = `${(dur * index / total) - dur}ms`;
|
19261 | return {
|
19262 | y1: 17,
|
19263 | y2: 29,
|
19264 | style: {
|
19265 | 'transform': transform,
|
19266 | 'animation-delay': animationDelay,
|
19267 | }
|
19268 | };
|
19269 | }
|
19270 | },
|
19271 | 'lines-small': {
|
19272 | dur: 1000,
|
19273 | lines: 12,
|
19274 | fn: (dur, index, total) => {
|
19275 | const transform = `rotate(${30 * index + (index < 6 ? 180 : -180)}deg)`;
|
19276 | const animationDelay = `${(dur * index / total) - dur}ms`;
|
19277 | return {
|
19278 | y1: 12,
|
19279 | y2: 20,
|
19280 | style: {
|
19281 | 'transform': transform,
|
19282 | 'animation-delay': animationDelay,
|
19283 | }
|
19284 | };
|
19285 | }
|
19286 | }
|
19287 | };
|
19288 | const SPINNERS = spinners;
|
19289 |
|
19290 | class RefresherContent {
|
19291 | constructor(hostRef) {
|
19292 | registerInstance(this, hostRef);
|
19293 | }
|
19294 | componentWillLoad() {
|
19295 | if (this.pullingIcon === undefined) {
|
19296 | const mode = getIonMode$1(this);
|
19297 | const overflowRefresher = this.el.style.webkitOverflowScrolling !== undefined ? 'lines' : 'arrow-down';
|
19298 | this.pullingIcon = config.get('refreshingIcon', mode === 'ios' && isPlatform('mobile') ? config.get('spinner', overflowRefresher) : 'circular');
|
19299 | }
|
19300 | if (this.refreshingSpinner === undefined) {
|
19301 | const mode = getIonMode$1(this);
|
19302 | this.refreshingSpinner = config.get('refreshingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'circular'));
|
19303 | }
|
19304 | }
|
19305 | render() {
|
19306 | const pullingIcon = this.pullingIcon;
|
19307 | const hasSpinner = pullingIcon != null && SPINNERS[pullingIcon] !== undefined;
|
19308 | const mode = getIonMode$1(this);
|
19309 | return (hAsync(Host, { class: mode }, hAsync("div", { class: "refresher-pulling" }, this.pullingIcon && hasSpinner &&
|
19310 | hAsync("div", { class: "refresher-pulling-icon" }, hAsync("div", { class: "spinner-arrow-container" }, hAsync("ion-spinner", { name: this.pullingIcon, paused: true }), mode === 'md' && this.pullingIcon === 'circular' &&
|
19311 | hAsync("div", { class: "arrow-container" }, hAsync("ion-icon", { name: "caret-back-sharp" })))), this.pullingIcon && !hasSpinner &&
|
19312 | hAsync("div", { class: "refresher-pulling-icon" }, hAsync("ion-icon", { icon: this.pullingIcon, lazy: false })), this.pullingText &&
|
19313 | hAsync("div", { class: "refresher-pulling-text", innerHTML: sanitizeDOMString(this.pullingText) })), hAsync("div", { class: "refresher-refreshing" }, this.refreshingSpinner &&
|
19314 | hAsync("div", { class: "refresher-refreshing-icon" }, hAsync("ion-spinner", { name: this.refreshingSpinner })), this.refreshingText &&
|
19315 | hAsync("div", { class: "refresher-refreshing-text", innerHTML: sanitizeDOMString(this.refreshingText) }))));
|
19316 | }
|
19317 | get el() { return getElement(this); }
|
19318 | static get cmpMeta() { return {
|
19319 | "$flags$": 0,
|
19320 | "$tagName$": "ion-refresher-content",
|
19321 | "$members$": {
|
19322 | "pullingIcon": [1025, "pulling-icon"],
|
19323 | "pullingText": [1, "pulling-text"],
|
19324 | "refreshingSpinner": [1025, "refreshing-spinner"],
|
19325 | "refreshingText": [1, "refreshing-text"]
|
19326 | },
|
19327 | "$listeners$": undefined,
|
19328 | "$lazyBundleId$": "-",
|
19329 | "$attrsToReflect$": []
|
19330 | }; }
|
19331 | }
|
19332 |
|
19333 | const reorderIosCss = "/*!@:host([slot])*/[slot].sc-ion-reorder-ios-h{display:none;line-height:0;z-index:100}/*!@.reorder-icon*/.reorder-icon.sc-ion-reorder-ios{display:block;font-size:22px}/*!@.reorder-icon*/.reorder-icon.sc-ion-reorder-ios{font-size:34px;opacity:0.4}";
|
19334 |
|
19335 | const reorderMdCss = "/*!@:host([slot])*/[slot].sc-ion-reorder-md-h{display:none;line-height:0;z-index:100}/*!@.reorder-icon*/.reorder-icon.sc-ion-reorder-md{display:block;font-size:22px}/*!@.reorder-icon*/.reorder-icon.sc-ion-reorder-md{font-size:31px;opacity:0.3}";
|
19336 |
|
19337 |
|
19338 |
|
19339 |
|
19340 | class Reorder {
|
19341 | constructor(hostRef) {
|
19342 | registerInstance(this, hostRef);
|
19343 | }
|
19344 | onClick(ev) {
|
19345 | const reorderGroup = this.el.closest('ion-reorder-group');
|
19346 | ev.preventDefault();
|
19347 |
|
19348 |
|
19349 | if (!reorderGroup || !reorderGroup.disabled) {
|
19350 | ev.stopImmediatePropagation();
|
19351 | }
|
19352 | }
|
19353 | render() {
|
19354 | const mode = getIonMode$1(this);
|
19355 | const reorderIcon = mode === 'ios' ? 'reorder-three-outline' : 'reorder-two-sharp';
|
19356 | return (hAsync(Host, { class: mode }, hAsync("slot", null, hAsync("ion-icon", { name: reorderIcon, lazy: false, class: "reorder-icon", part: "icon" }))));
|
19357 | }
|
19358 | get el() { return getElement(this); }
|
19359 | static get style() { return {
|
19360 | ios: reorderIosCss,
|
19361 | md: reorderMdCss
|
19362 | }; }
|
19363 | static get cmpMeta() { return {
|
19364 | "$flags$": 41,
|
19365 | "$tagName$": "ion-reorder",
|
19366 | "$members$": undefined,
|
19367 | "$listeners$": [[2, "click", "onClick"]],
|
19368 | "$lazyBundleId$": "-",
|
19369 | "$attrsToReflect$": []
|
19370 | }; }
|
19371 | }
|
19372 |
|
19373 | const reorderGroupCss = ".reorder-list-active>*{-webkit-transition:-webkit-transform 300ms;transition:-webkit-transform 300ms;transition:transform 300ms;transition:transform 300ms, -webkit-transform 300ms;will-change:transform}.reorder-enabled{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.reorder-enabled ion-reorder{display:block;cursor:-webkit-grab;cursor:grab;pointer-events:all;-ms-touch-action:none;touch-action:none}.reorder-selected,.reorder-selected ion-reorder{cursor:-webkit-grabbing;cursor:grabbing}.reorder-selected{position:relative;-webkit-transition:none !important;transition:none !important;-webkit-box-shadow:0 0 10px rgba(0, 0, 0, 0.4);box-shadow:0 0 10px rgba(0, 0, 0, 0.4);opacity:0.8;z-index:100}.reorder-visible ion-reorder .reorder-icon{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}";
|
19374 |
|
19375 | class ReorderGroup {
|
19376 | constructor(hostRef) {
|
19377 | registerInstance(this, hostRef);
|
19378 | this.ionItemReorder = createEvent(this, "ionItemReorder", 7);
|
19379 | this.lastToIndex = -1;
|
19380 | this.cachedHeights = [];
|
19381 | this.scrollElTop = 0;
|
19382 | this.scrollElBottom = 0;
|
19383 | this.scrollElInitial = 0;
|
19384 | this.containerTop = 0;
|
19385 | this.containerBottom = 0;
|
19386 | this.state = 0 ;
|
19387 | |
19388 |
|
19389 |
|
19390 | this.disabled = true;
|
19391 | }
|
19392 | disabledChanged() {
|
19393 | if (this.gesture) {
|
19394 | this.gesture.enable(!this.disabled);
|
19395 | }
|
19396 | }
|
19397 | async connectedCallback() {
|
19398 | const contentEl = this.el.closest('ion-content');
|
19399 | if (contentEl) {
|
19400 | this.scrollEl = await contentEl.getScrollElement();
|
19401 | }
|
19402 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
19403 | el: this.el,
|
19404 | gestureName: 'reorder',
|
19405 | gesturePriority: 110,
|
19406 | threshold: 0,
|
19407 | direction: 'y',
|
19408 | passive: false,
|
19409 | canStart: detail => this.canStart(detail),
|
19410 | onStart: ev => this.onStart(ev),
|
19411 | onMove: ev => this.onMove(ev),
|
19412 | onEnd: () => this.onEnd(),
|
19413 | });
|
19414 | this.disabledChanged();
|
19415 | }
|
19416 | disconnectedCallback() {
|
19417 | this.onEnd();
|
19418 | if (this.gesture) {
|
19419 | this.gesture.destroy();
|
19420 | this.gesture = undefined;
|
19421 | }
|
19422 | }
|
19423 | |
19424 |
|
19425 |
|
19426 |
|
19427 |
|
19428 |
|
19429 |
|
19430 |
|
19431 |
|
19432 |
|
19433 |
|
19434 |
|
19435 |
|
19436 | complete(listOrReorder) {
|
19437 | return Promise.resolve(this.completeSync(listOrReorder));
|
19438 | }
|
19439 | canStart(ev) {
|
19440 | if (this.selectedItemEl || this.state !== 0 ) {
|
19441 | return false;
|
19442 | }
|
19443 | const target = ev.event.target;
|
19444 | const reorderEl = target.closest('ion-reorder');
|
19445 | if (!reorderEl) {
|
19446 | return false;
|
19447 | }
|
19448 | const item = findReorderItem(reorderEl, this.el);
|
19449 | if (!item) {
|
19450 | return false;
|
19451 | }
|
19452 | ev.data = item;
|
19453 | return true;
|
19454 | }
|
19455 | onStart(ev) {
|
19456 | ev.event.preventDefault();
|
19457 | const item = this.selectedItemEl = ev.data;
|
19458 | const heights = this.cachedHeights;
|
19459 | heights.length = 0;
|
19460 | const el = this.el;
|
19461 | const children = el.children;
|
19462 | if (!children || children.length === 0) {
|
19463 | return;
|
19464 | }
|
19465 | let sum = 0;
|
19466 | for (let i = 0; i < children.length; i++) {
|
19467 | const child = children[i];
|
19468 | sum += child.offsetHeight;
|
19469 | heights.push(sum);
|
19470 | child.$ionIndex = i;
|
19471 | }
|
19472 | const box = el.getBoundingClientRect();
|
19473 | this.containerTop = box.top;
|
19474 | this.containerBottom = box.bottom;
|
19475 | if (this.scrollEl) {
|
19476 | const scrollBox = this.scrollEl.getBoundingClientRect();
|
19477 | this.scrollElInitial = this.scrollEl.scrollTop;
|
19478 | this.scrollElTop = scrollBox.top + AUTO_SCROLL_MARGIN;
|
19479 | this.scrollElBottom = scrollBox.bottom - AUTO_SCROLL_MARGIN;
|
19480 | }
|
19481 | else {
|
19482 | this.scrollElInitial = 0;
|
19483 | this.scrollElTop = 0;
|
19484 | this.scrollElBottom = 0;
|
19485 | }
|
19486 | this.lastToIndex = indexForItem(item);
|
19487 | this.selectedItemHeight = item.offsetHeight;
|
19488 | this.state = 1 ;
|
19489 | item.classList.add(ITEM_REORDER_SELECTED);
|
19490 | hapticSelectionStart();
|
19491 | }
|
19492 | onMove(ev) {
|
19493 | const selectedItem = this.selectedItemEl;
|
19494 | if (!selectedItem) {
|
19495 | return;
|
19496 | }
|
19497 |
|
19498 | const scroll = this.autoscroll(ev.currentY);
|
19499 |
|
19500 | const top = this.containerTop - scroll;
|
19501 | const bottom = this.containerBottom - scroll;
|
19502 | const currentY = Math.max(top, Math.min(ev.currentY, bottom));
|
19503 | const deltaY = scroll + currentY - ev.startY;
|
19504 | const normalizedY = currentY - top;
|
19505 | const toIndex = this.itemIndexForTop(normalizedY);
|
19506 | if (toIndex !== this.lastToIndex) {
|
19507 | const fromIndex = indexForItem(selectedItem);
|
19508 | this.lastToIndex = toIndex;
|
19509 | hapticSelectionChanged();
|
19510 | this.reorderMove(fromIndex, toIndex);
|
19511 | }
|
19512 |
|
19513 | selectedItem.style.transform = `translateY(${deltaY}px)`;
|
19514 | }
|
19515 | onEnd() {
|
19516 | const selectedItemEl = this.selectedItemEl;
|
19517 | this.state = 2 ;
|
19518 | if (!selectedItemEl) {
|
19519 | this.state = 0 ;
|
19520 | return;
|
19521 | }
|
19522 | const toIndex = this.lastToIndex;
|
19523 | const fromIndex = indexForItem(selectedItemEl);
|
19524 | if (toIndex === fromIndex) {
|
19525 | this.completeSync();
|
19526 | }
|
19527 | else {
|
19528 | this.ionItemReorder.emit({
|
19529 | from: fromIndex,
|
19530 | to: toIndex,
|
19531 | complete: this.completeSync.bind(this)
|
19532 | });
|
19533 | }
|
19534 | hapticSelectionEnd();
|
19535 | }
|
19536 | completeSync(listOrReorder) {
|
19537 | const selectedItemEl = this.selectedItemEl;
|
19538 | if (selectedItemEl && this.state === 2 ) {
|
19539 | const children = this.el.children;
|
19540 | const len = children.length;
|
19541 | const toIndex = this.lastToIndex;
|
19542 | const fromIndex = indexForItem(selectedItemEl);
|
19543 | if (toIndex !== fromIndex && (listOrReorder === undefined || listOrReorder === true)) {
|
19544 | const ref = (fromIndex < toIndex)
|
19545 | ? children[toIndex + 1]
|
19546 | : children[toIndex];
|
19547 | this.el.insertBefore(selectedItemEl, ref);
|
19548 | }
|
19549 | if (Array.isArray(listOrReorder)) {
|
19550 | listOrReorder = reorderArray(listOrReorder, fromIndex, toIndex);
|
19551 | }
|
19552 | for (let i = 0; i < len; i++) {
|
19553 | children[i].style['transform'] = '';
|
19554 | }
|
19555 | selectedItemEl.style.transition = '';
|
19556 | selectedItemEl.classList.remove(ITEM_REORDER_SELECTED);
|
19557 | this.selectedItemEl = undefined;
|
19558 | this.state = 0 ;
|
19559 | }
|
19560 | return listOrReorder;
|
19561 | }
|
19562 | itemIndexForTop(deltaY) {
|
19563 | const heights = this.cachedHeights;
|
19564 |
|
19565 |
|
19566 |
|
19567 | for (let i = 0; i < heights.length; i++) {
|
19568 | if (heights[i] > deltaY) {
|
19569 | return i;
|
19570 | }
|
19571 | }
|
19572 | return heights.length - 1;
|
19573 | }
|
19574 |
|
19575 | reorderMove(fromIndex, toIndex) {
|
19576 | const itemHeight = this.selectedItemHeight;
|
19577 | const children = this.el.children;
|
19578 | for (let i = 0; i < children.length; i++) {
|
19579 | const style = children[i].style;
|
19580 | let value = '';
|
19581 | if (i > fromIndex && i <= toIndex) {
|
19582 | value = `translateY(${-itemHeight}px)`;
|
19583 | }
|
19584 | else if (i < fromIndex && i >= toIndex) {
|
19585 | value = `translateY(${itemHeight}px)`;
|
19586 | }
|
19587 | style['transform'] = value;
|
19588 | }
|
19589 | }
|
19590 | autoscroll(posY) {
|
19591 | if (!this.scrollEl) {
|
19592 | return 0;
|
19593 | }
|
19594 | let amount = 0;
|
19595 | if (posY < this.scrollElTop) {
|
19596 | amount = -SCROLL_JUMP;
|
19597 | }
|
19598 | else if (posY > this.scrollElBottom) {
|
19599 | amount = SCROLL_JUMP;
|
19600 | }
|
19601 | if (amount !== 0) {
|
19602 | this.scrollEl.scrollBy(0, amount);
|
19603 | }
|
19604 | return this.scrollEl.scrollTop - this.scrollElInitial;
|
19605 | }
|
19606 | render() {
|
19607 | const mode = getIonMode$1(this);
|
19608 | return (hAsync(Host, { class: {
|
19609 | [mode]: true,
|
19610 | 'reorder-enabled': !this.disabled,
|
19611 | 'reorder-list-active': this.state !== 0 ,
|
19612 | } }));
|
19613 | }
|
19614 | get el() { return getElement(this); }
|
19615 | static get watchers() { return {
|
19616 | "disabled": ["disabledChanged"]
|
19617 | }; }
|
19618 | static get style() { return reorderGroupCss; }
|
19619 | static get cmpMeta() { return {
|
19620 | "$flags$": 0,
|
19621 | "$tagName$": "ion-reorder-group",
|
19622 | "$members$": {
|
19623 | "disabled": [4],
|
19624 | "state": [32],
|
19625 | "complete": [64]
|
19626 | },
|
19627 | "$listeners$": undefined,
|
19628 | "$lazyBundleId$": "-",
|
19629 | "$attrsToReflect$": []
|
19630 | }; }
|
19631 | }
|
19632 | const indexForItem = (element) => {
|
19633 | return element['$ionIndex'];
|
19634 | };
|
19635 | const findReorderItem = (node, container) => {
|
19636 | let parent;
|
19637 | while (node) {
|
19638 | parent = node.parentElement;
|
19639 | if (parent === container) {
|
19640 | return node;
|
19641 | }
|
19642 | node = parent;
|
19643 | }
|
19644 | return undefined;
|
19645 | };
|
19646 | const AUTO_SCROLL_MARGIN = 60;
|
19647 | const SCROLL_JUMP = 10;
|
19648 | const ITEM_REORDER_SELECTED = 'reorder-selected';
|
19649 | const reorderArray = (array, from, to) => {
|
19650 | const element = array[from];
|
19651 | array.splice(from, 1);
|
19652 | array.splice(to, 0, element);
|
19653 | return array.slice();
|
19654 | };
|
19655 |
|
19656 | const rippleEffectCss = "/*!@:host*/.sc-ion-ripple-effect-h{left:0;right:0;top:0;bottom:0;position:absolute;contain:strict;pointer-events:none}/*!@:host(.unbounded)*/.unbounded.sc-ion-ripple-effect-h{contain:layout size style}/*!@.ripple-effect*/.ripple-effect.sc-ion-ripple-effect{border-radius:50%;position:absolute;background-color:currentColor;color:inherit;contain:strict;opacity:0;-webkit-animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;animation:225ms rippleAnimation forwards, 75ms fadeInAnimation forwards;will-change:transform, opacity;pointer-events:none}/*!@.fade-out*/.fade-out.sc-ion-ripple-effect{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1));-webkit-animation:150ms fadeOutAnimation forwards;animation:150ms fadeOutAnimation forwards}@-webkit-keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@keyframes rippleAnimation{from{-webkit-animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1);-webkit-transform:scale(1);transform:scale(1)}to{-webkit-transform:translate(var(--translate-end)) scale(var(--final-scale, 1));transform:translate(var(--translate-end)) scale(var(--final-scale, 1))}}@-webkit-keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@keyframes fadeInAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:0.16}}@-webkit-keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}@keyframes fadeOutAnimation{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0.16}to{opacity:0}}";
|
19657 |
|
19658 | class RippleEffect {
|
19659 | constructor(hostRef) {
|
19660 | registerInstance(this, hostRef);
|
19661 | |
19662 |
|
19663 |
|
19664 |
|
19665 |
|
19666 |
|
19667 |
|
19668 |
|
19669 |
|
19670 | this.type = 'bounded';
|
19671 | }
|
19672 | |
19673 |
|
19674 |
|
19675 |
|
19676 |
|
19677 |
|
19678 | async addRipple(x, y) {
|
19679 | return new Promise(resolve => {
|
19680 | readTask(() => {
|
19681 | const rect = this.el.getBoundingClientRect();
|
19682 | const width = rect.width;
|
19683 | const height = rect.height;
|
19684 | const hypotenuse = Math.sqrt(width * width + height * height);
|
19685 | const maxDim = Math.max(height, width);
|
19686 | const maxRadius = this.unbounded ? maxDim : hypotenuse + PADDING;
|
19687 | const initialSize = Math.floor(maxDim * INITIAL_ORIGIN_SCALE);
|
19688 | const finalScale = maxRadius / initialSize;
|
19689 | let posX = x - rect.left;
|
19690 | let posY = y - rect.top;
|
19691 | if (this.unbounded) {
|
19692 | posX = width * 0.5;
|
19693 | posY = height * 0.5;
|
19694 | }
|
19695 | const styleX = posX - initialSize * 0.5;
|
19696 | const styleY = posY - initialSize * 0.5;
|
19697 | const moveX = width * 0.5 - posX;
|
19698 | const moveY = height * 0.5 - posY;
|
19699 | writeTask(() => {
|
19700 | const div = document.createElement('div');
|
19701 | div.classList.add('ripple-effect');
|
19702 | const style = div.style;
|
19703 | style.top = styleY + 'px';
|
19704 | style.left = styleX + 'px';
|
19705 | style.width = style.height = initialSize + 'px';
|
19706 | style.setProperty('--final-scale', `${finalScale}`);
|
19707 | style.setProperty('--translate-end', `${moveX}px, ${moveY}px`);
|
19708 | const container = this.el.shadowRoot || this.el;
|
19709 | container.appendChild(div);
|
19710 | setTimeout(() => {
|
19711 | resolve(() => {
|
19712 | removeRipple(div);
|
19713 | });
|
19714 | }, 225 + 100);
|
19715 | });
|
19716 | });
|
19717 | });
|
19718 | }
|
19719 | get unbounded() {
|
19720 | return this.type === 'unbounded';
|
19721 | }
|
19722 | render() {
|
19723 | const mode = getIonMode$1(this);
|
19724 | return (hAsync(Host, { role: "presentation", class: {
|
19725 | [mode]: true,
|
19726 | 'unbounded': this.unbounded
|
19727 | } }));
|
19728 | }
|
19729 | get el() { return getElement(this); }
|
19730 | static get style() { return rippleEffectCss; }
|
19731 | static get cmpMeta() { return {
|
19732 | "$flags$": 9,
|
19733 | "$tagName$": "ion-ripple-effect",
|
19734 | "$members$": {
|
19735 | "type": [1],
|
19736 | "addRipple": [64]
|
19737 | },
|
19738 | "$listeners$": undefined,
|
19739 | "$lazyBundleId$": "-",
|
19740 | "$attrsToReflect$": []
|
19741 | }; }
|
19742 | }
|
19743 | const removeRipple = (ripple) => {
|
19744 | ripple.classList.add('fade-out');
|
19745 | setTimeout(() => {
|
19746 | ripple.remove();
|
19747 | }, 200);
|
19748 | };
|
19749 | const PADDING = 10;
|
19750 | const INITIAL_ORIGIN_SCALE = 0.5;
|
19751 |
|
19752 | class Route {
|
19753 | constructor(hostRef) {
|
19754 | registerInstance(this, hostRef);
|
19755 | this.ionRouteDataChanged = createEvent(this, "ionRouteDataChanged", 7);
|
19756 | |
19757 |
|
19758 |
|
19759 |
|
19760 |
|
19761 |
|
19762 | this.url = '';
|
19763 | }
|
19764 | onUpdate(newValue) {
|
19765 | this.ionRouteDataChanged.emit(newValue);
|
19766 | }
|
19767 | onComponentProps(newValue, oldValue) {
|
19768 | if (newValue === oldValue) {
|
19769 | return;
|
19770 | }
|
19771 | const keys1 = newValue ? Object.keys(newValue) : [];
|
19772 | const keys2 = oldValue ? Object.keys(oldValue) : [];
|
19773 | if (keys1.length !== keys2.length) {
|
19774 | this.onUpdate(newValue);
|
19775 | return;
|
19776 | }
|
19777 | for (const key of keys1) {
|
19778 | if (newValue[key] !== oldValue[key]) {
|
19779 | this.onUpdate(newValue);
|
19780 | return;
|
19781 | }
|
19782 | }
|
19783 | }
|
19784 | connectedCallback() {
|
19785 | this.ionRouteDataChanged.emit();
|
19786 | }
|
19787 | static get watchers() { return {
|
19788 | "url": ["onUpdate"],
|
19789 | "component": ["onUpdate"],
|
19790 | "componentProps": ["onComponentProps"]
|
19791 | }; }
|
19792 | static get cmpMeta() { return {
|
19793 | "$flags$": 0,
|
19794 | "$tagName$": "ion-route",
|
19795 | "$members$": {
|
19796 | "url": [1],
|
19797 | "component": [1],
|
19798 | "componentProps": [16],
|
19799 | "beforeLeave": [16],
|
19800 | "beforeEnter": [16]
|
19801 | },
|
19802 | "$listeners$": undefined,
|
19803 | "$lazyBundleId$": "-",
|
19804 | "$attrsToReflect$": []
|
19805 | }; }
|
19806 | }
|
19807 |
|
19808 | class RouteRedirect {
|
19809 | constructor(hostRef) {
|
19810 | registerInstance(this, hostRef);
|
19811 | this.ionRouteRedirectChanged = createEvent(this, "ionRouteRedirectChanged", 7);
|
19812 | }
|
19813 | propDidChange() {
|
19814 | this.ionRouteRedirectChanged.emit();
|
19815 | }
|
19816 | connectedCallback() {
|
19817 | this.ionRouteRedirectChanged.emit();
|
19818 | }
|
19819 | static get watchers() { return {
|
19820 | "from": ["propDidChange"],
|
19821 | "to": ["propDidChange"]
|
19822 | }; }
|
19823 | static get cmpMeta() { return {
|
19824 | "$flags$": 0,
|
19825 | "$tagName$": "ion-route-redirect",
|
19826 | "$members$": {
|
19827 | "from": [1],
|
19828 | "to": [1]
|
19829 | },
|
19830 | "$listeners$": undefined,
|
19831 | "$lazyBundleId$": "-",
|
19832 | "$attrsToReflect$": []
|
19833 | }; }
|
19834 | }
|
19835 |
|
19836 | const ROUTER_INTENT_NONE = 'root';
|
19837 | const ROUTER_INTENT_FORWARD = 'forward';
|
19838 | const ROUTER_INTENT_BACK = 'back';
|
19839 |
|
19840 |
|
19841 | const generatePath = (segments) => {
|
19842 | const path = segments
|
19843 | .filter(s => s.length > 0)
|
19844 | .join('/');
|
19845 | return '/' + path;
|
19846 | };
|
19847 | const generateUrl = (segments, useHash, queryString) => {
|
19848 | let url = generatePath(segments);
|
19849 | if (useHash) {
|
19850 | url = '#' + url;
|
19851 | }
|
19852 | if (queryString !== undefined) {
|
19853 | url += '?' + queryString;
|
19854 | }
|
19855 | return url;
|
19856 | };
|
19857 | const writePath = (history, root, useHash, path, direction, state, queryString) => {
|
19858 | const url = generateUrl([...parsePath(root).segments, ...path], useHash, queryString);
|
19859 | if (direction === ROUTER_INTENT_FORWARD) {
|
19860 | history.pushState(state, '', url);
|
19861 | }
|
19862 | else {
|
19863 | history.replaceState(state, '', url);
|
19864 | }
|
19865 | };
|
19866 | const chainToPath = (chain) => {
|
19867 | const path = [];
|
19868 | for (const route of chain) {
|
19869 | for (const segment of route.path) {
|
19870 | if (segment[0] === ':') {
|
19871 | const param = route.params && route.params[segment.slice(1)];
|
19872 | if (!param) {
|
19873 | return null;
|
19874 | }
|
19875 | path.push(param);
|
19876 | }
|
19877 | else if (segment !== '') {
|
19878 | path.push(segment);
|
19879 | }
|
19880 | }
|
19881 | }
|
19882 | return path;
|
19883 | };
|
19884 |
|
19885 |
|
19886 |
|
19887 |
|
19888 |
|
19889 | const removePrefix = (prefix, path) => {
|
19890 | if (prefix.length > path.length) {
|
19891 | return null;
|
19892 | }
|
19893 | if (prefix.length <= 1 && prefix[0] === '') {
|
19894 | return path;
|
19895 | }
|
19896 | for (let i = 0; i < prefix.length; i++) {
|
19897 | if (prefix[i] !== path[i]) {
|
19898 | return null;
|
19899 | }
|
19900 | }
|
19901 | if (path.length === prefix.length) {
|
19902 | return [''];
|
19903 | }
|
19904 | return path.slice(prefix.length);
|
19905 | };
|
19906 | const readPath = (loc, root, useHash) => {
|
19907 | const prefix = parsePath(root).segments;
|
19908 | const pathname = useHash ? loc.hash.slice(1) : loc.pathname;
|
19909 | const path = parsePath(pathname).segments;
|
19910 | return removePrefix(prefix, path);
|
19911 | };
|
19912 |
|
19913 |
|
19914 |
|
19915 | const parsePath = (path) => {
|
19916 | let segments = [''];
|
19917 | let queryString;
|
19918 | if (path != null) {
|
19919 | const qsStart = path.indexOf('?');
|
19920 | if (qsStart > -1) {
|
19921 | queryString = path.substr(qsStart + 1);
|
19922 | path = path.substr(0, qsStart);
|
19923 | }
|
19924 | segments = path.split('/')
|
19925 | .map(s => s.trim())
|
19926 | .filter(s => s.length > 0);
|
19927 | if (segments.length === 0) {
|
19928 | segments = [''];
|
19929 | }
|
19930 | }
|
19931 | return { segments, queryString };
|
19932 | };
|
19933 |
|
19934 | const printRoutes = (routes) => {
|
19935 | console.group(`[ion-core] ROUTES[${routes.length}]`);
|
19936 | for (const chain of routes) {
|
19937 | const path = [];
|
19938 | chain.forEach(r => path.push(...r.path));
|
19939 | const ids = chain.map(r => r.id);
|
19940 | console.debug(`%c ${generatePath(path)}`, 'font-weight: bold; padding-left: 20px', '=>\t', `(${ids.join(', ')})`);
|
19941 | }
|
19942 | console.groupEnd();
|
19943 | };
|
19944 | const printRedirects = (redirects) => {
|
19945 | console.group(`[ion-core] REDIRECTS[${redirects.length}]`);
|
19946 | for (const redirect of redirects) {
|
19947 | if (redirect.to) {
|
19948 | console.debug('FROM: ', `$c ${generatePath(redirect.from)}`, 'font-weight: bold', ' TO: ', `$c ${generatePath(redirect.to.segments)}`, 'font-weight: bold');
|
19949 | }
|
19950 | }
|
19951 | console.groupEnd();
|
19952 | };
|
19953 |
|
19954 | const writeNavState = async (root, chain, direction, index, changed = false, animation) => {
|
19955 | try {
|
19956 |
|
19957 | const outlet = searchNavNode(root);
|
19958 |
|
19959 | if (index >= chain.length || !outlet) {
|
19960 | return changed;
|
19961 | }
|
19962 | await new Promise(resolve => componentOnReady(outlet, resolve));
|
19963 | const route = chain[index];
|
19964 | const result = await outlet.setRouteId(route.id, route.params, direction, animation);
|
19965 |
|
19966 |
|
19967 | if (result.changed) {
|
19968 | direction = ROUTER_INTENT_NONE;
|
19969 | changed = true;
|
19970 | }
|
19971 |
|
19972 | changed = await writeNavState(result.element, chain, direction, index + 1, changed, animation);
|
19973 |
|
19974 |
|
19975 | if (result.markVisible) {
|
19976 | await result.markVisible();
|
19977 | }
|
19978 | return changed;
|
19979 | }
|
19980 | catch (e) {
|
19981 | console.error(e);
|
19982 | return false;
|
19983 | }
|
19984 | };
|
19985 | const readNavState = async (root) => {
|
19986 | const ids = [];
|
19987 | let outlet;
|
19988 | let node = root;
|
19989 |
|
19990 | while (true) {
|
19991 | outlet = searchNavNode(node);
|
19992 | if (outlet) {
|
19993 | const id = await outlet.getRouteId();
|
19994 | if (id) {
|
19995 | node = id.element;
|
19996 | id.element = undefined;
|
19997 | ids.push(id);
|
19998 | }
|
19999 | else {
|
20000 | break;
|
20001 | }
|
20002 | }
|
20003 | else {
|
20004 | break;
|
20005 | }
|
20006 | }
|
20007 | return { ids, outlet };
|
20008 | };
|
20009 | const waitUntilNavNode = () => {
|
20010 | if (searchNavNode(document.body)) {
|
20011 | return Promise.resolve();
|
20012 | }
|
20013 | return new Promise(resolve => {
|
20014 | window.addEventListener('ionNavWillLoad', resolve, { once: true });
|
20015 | });
|
20016 | };
|
20017 | const QUERY$1 = ':not([no-router]) ion-nav, :not([no-router]) ion-tabs, :not([no-router]) ion-router-outlet';
|
20018 | const searchNavNode = (root) => {
|
20019 | if (!root) {
|
20020 | return undefined;
|
20021 | }
|
20022 | if (root.matches(QUERY$1)) {
|
20023 | return root;
|
20024 | }
|
20025 | const outlet = root.querySelector(QUERY$1);
|
20026 | return outlet !== null && outlet !== void 0 ? outlet : undefined;
|
20027 | };
|
20028 |
|
20029 |
|
20030 |
|
20031 |
|
20032 |
|
20033 |
|
20034 | const matchesRedirect = (path, redirect) => {
|
20035 | const { from, to } = redirect;
|
20036 | if (to === undefined) {
|
20037 | return false;
|
20038 | }
|
20039 | if (from.length > path.length) {
|
20040 | return false;
|
20041 | }
|
20042 | for (let i = 0; i < from.length; i++) {
|
20043 | const expected = from[i];
|
20044 | if (expected === '*') {
|
20045 | return true;
|
20046 | }
|
20047 | if (expected !== path[i]) {
|
20048 | return false;
|
20049 | }
|
20050 | }
|
20051 | return from.length === path.length;
|
20052 | };
|
20053 |
|
20054 | const findRouteRedirect = (path, redirects) => {
|
20055 | return redirects.find(redirect => matchesRedirect(path, redirect));
|
20056 | };
|
20057 | const matchesIDs = (ids, chain) => {
|
20058 | const len = Math.min(ids.length, chain.length);
|
20059 | let i = 0;
|
20060 | for (; i < len; i++) {
|
20061 | if (ids[i].toLowerCase() !== chain[i].id) {
|
20062 | break;
|
20063 | }
|
20064 | }
|
20065 | return i;
|
20066 | };
|
20067 | const matchesPath = (inputPath, chain) => {
|
20068 | const segments = new RouterSegments(inputPath);
|
20069 | let matchesDefault = false;
|
20070 | let allparams;
|
20071 | for (let i = 0; i < chain.length; i++) {
|
20072 | const path = chain[i].path;
|
20073 | if (path[0] === '') {
|
20074 | matchesDefault = true;
|
20075 | }
|
20076 | else {
|
20077 | for (const segment of path) {
|
20078 | const data = segments.next();
|
20079 |
|
20080 | if (segment[0] === ':') {
|
20081 | if (data === '') {
|
20082 | return null;
|
20083 | }
|
20084 | allparams = allparams || [];
|
20085 | const params = allparams[i] || (allparams[i] = {});
|
20086 | params[segment.slice(1)] = data;
|
20087 | }
|
20088 | else if (data !== segment) {
|
20089 | return null;
|
20090 | }
|
20091 | }
|
20092 | matchesDefault = false;
|
20093 | }
|
20094 | }
|
20095 | const matches = (matchesDefault)
|
20096 | ? matchesDefault === (segments.next() === '')
|
20097 | : true;
|
20098 | if (!matches) {
|
20099 | return null;
|
20100 | }
|
20101 | if (allparams) {
|
20102 | return chain.map((route, i) => ({
|
20103 | id: route.id,
|
20104 | path: route.path,
|
20105 | params: mergeParams(route.params, allparams[i]),
|
20106 | beforeEnter: route.beforeEnter,
|
20107 | beforeLeave: route.beforeLeave
|
20108 | }));
|
20109 | }
|
20110 | return chain;
|
20111 | };
|
20112 |
|
20113 |
|
20114 | const mergeParams = (a, b) => {
|
20115 | return a || b ? Object.assign(Object.assign({}, a), b) : undefined;
|
20116 | };
|
20117 | const routerIDsToChain = (ids, chains) => {
|
20118 | let match = null;
|
20119 | let maxMatches = 0;
|
20120 | const plainIDs = ids.map(i => i.id);
|
20121 | for (const chain of chains) {
|
20122 | const score = matchesIDs(plainIDs, chain);
|
20123 | if (score > maxMatches) {
|
20124 | match = chain;
|
20125 | maxMatches = score;
|
20126 | }
|
20127 | }
|
20128 | if (match) {
|
20129 | return match.map((route, i) => ({
|
20130 | id: route.id,
|
20131 | path: route.path,
|
20132 | params: mergeParams(route.params, ids[i] && ids[i].params)
|
20133 | }));
|
20134 | }
|
20135 | return null;
|
20136 | };
|
20137 | const routerPathToChain = (path, chains) => {
|
20138 | let match = null;
|
20139 | let matches = 0;
|
20140 | for (const chain of chains) {
|
20141 | const matchedChain = matchesPath(path, chain);
|
20142 | if (matchedChain !== null) {
|
20143 | const score = computePriority(matchedChain);
|
20144 | if (score > matches) {
|
20145 | matches = score;
|
20146 | match = matchedChain;
|
20147 | }
|
20148 | }
|
20149 | }
|
20150 | return match;
|
20151 | };
|
20152 | const computePriority = (chain) => {
|
20153 | let score = 1;
|
20154 | let level = 1;
|
20155 | for (const route of chain) {
|
20156 | for (const path of route.path) {
|
20157 | if (path[0] === ':') {
|
20158 | score += Math.pow(1, level);
|
20159 | }
|
20160 | else if (path !== '') {
|
20161 | score += Math.pow(2, level);
|
20162 | }
|
20163 | level++;
|
20164 | }
|
20165 | }
|
20166 | return score;
|
20167 | };
|
20168 | class RouterSegments {
|
20169 | constructor(path) {
|
20170 | this.path = path.slice();
|
20171 | }
|
20172 | next() {
|
20173 | if (this.path.length > 0) {
|
20174 | return this.path.shift();
|
20175 | }
|
20176 | return '';
|
20177 | }
|
20178 | }
|
20179 |
|
20180 | const readProp = (el, prop) => {
|
20181 | if (prop in el) {
|
20182 | return el[prop];
|
20183 | }
|
20184 | if (el.hasAttribute(prop)) {
|
20185 | return el.getAttribute(prop);
|
20186 | }
|
20187 | return null;
|
20188 | };
|
20189 | const readRedirects = (root) => {
|
20190 | return Array.from(root.children)
|
20191 | .filter(el => el.tagName === 'ION-ROUTE-REDIRECT')
|
20192 | .map(el => {
|
20193 | const to = readProp(el, 'to');
|
20194 | return {
|
20195 | from: parsePath(readProp(el, 'from')).segments,
|
20196 | to: to == null ? undefined : parsePath(to),
|
20197 | };
|
20198 | });
|
20199 | };
|
20200 | const readRoutes = (root) => {
|
20201 | return flattenRouterTree(readRouteNodes(root));
|
20202 | };
|
20203 | const readRouteNodes = (node) => {
|
20204 | return Array.from(node.children)
|
20205 | .filter(el => el.tagName === 'ION-ROUTE' && el.component)
|
20206 | .map(el => {
|
20207 | const component = readProp(el, 'component');
|
20208 | return {
|
20209 | path: parsePath(readProp(el, 'url')).segments,
|
20210 | id: component.toLowerCase(),
|
20211 | params: el.componentProps,
|
20212 | beforeLeave: el.beforeLeave,
|
20213 | beforeEnter: el.beforeEnter,
|
20214 | children: readRouteNodes(el)
|
20215 | };
|
20216 | });
|
20217 | };
|
20218 | const flattenRouterTree = (nodes) => {
|
20219 | const chains = [];
|
20220 | for (const node of nodes) {
|
20221 | flattenNode([], chains, node);
|
20222 | }
|
20223 | return chains;
|
20224 | };
|
20225 | const flattenNode = (chain, chains, node) => {
|
20226 | chain = chain.slice();
|
20227 | chain.push({
|
20228 | id: node.id,
|
20229 | path: node.path,
|
20230 | params: node.params,
|
20231 | beforeLeave: node.beforeLeave,
|
20232 | beforeEnter: node.beforeEnter
|
20233 | });
|
20234 | if (node.children.length === 0) {
|
20235 | chains.push(chain);
|
20236 | return;
|
20237 | }
|
20238 | for (const child of node.children) {
|
20239 | flattenNode(chain, chains, child);
|
20240 | }
|
20241 | };
|
20242 |
|
20243 | class Router {
|
20244 | constructor(hostRef) {
|
20245 | registerInstance(this, hostRef);
|
20246 | this.ionRouteWillChange = createEvent(this, "ionRouteWillChange", 7);
|
20247 | this.ionRouteDidChange = createEvent(this, "ionRouteDidChange", 7);
|
20248 | this.previousPath = null;
|
20249 | this.busy = false;
|
20250 | this.state = 0;
|
20251 | this.lastState = 0;
|
20252 | |
20253 |
|
20254 |
|
20255 |
|
20256 |
|
20257 | this.root = '/';
|
20258 | |
20259 |
|
20260 |
|
20261 |
|
20262 |
|
20263 |
|
20264 |
|
20265 |
|
20266 |
|
20267 |
|
20268 |
|
20269 |
|
20270 |
|
20271 |
|
20272 | this.useHash = true;
|
20273 | }
|
20274 | async componentWillLoad() {
|
20275 | await waitUntilNavNode();
|
20276 | const canProceed = await this.runGuards(this.getPath());
|
20277 | if (canProceed !== true) {
|
20278 | if (typeof canProceed === 'object') {
|
20279 | const { redirect } = canProceed;
|
20280 | const path = parsePath(redirect);
|
20281 | this.setPath(path.segments, ROUTER_INTENT_NONE, path.queryString);
|
20282 | await this.writeNavStateRoot(path.segments, ROUTER_INTENT_NONE);
|
20283 | }
|
20284 | }
|
20285 | else {
|
20286 | await this.onRoutesChanged();
|
20287 | }
|
20288 | }
|
20289 | componentDidLoad() {
|
20290 | window.addEventListener('ionRouteRedirectChanged', debounce(this.onRedirectChanged.bind(this), 10));
|
20291 | window.addEventListener('ionRouteDataChanged', debounce(this.onRoutesChanged.bind(this), 100));
|
20292 | }
|
20293 | async onPopState() {
|
20294 | const direction = this.historyDirection();
|
20295 | let segments = this.getPath();
|
20296 | const canProceed = await this.runGuards(segments);
|
20297 | if (canProceed !== true) {
|
20298 | if (typeof canProceed === 'object') {
|
20299 | segments = parsePath(canProceed.redirect).segments;
|
20300 | }
|
20301 | else {
|
20302 | return false;
|
20303 | }
|
20304 | }
|
20305 | return this.writeNavStateRoot(segments, direction);
|
20306 | }
|
20307 | onBackButton(ev) {
|
20308 | ev.detail.register(0, processNextHandler => {
|
20309 | this.back();
|
20310 | processNextHandler();
|
20311 | });
|
20312 | }
|
20313 |
|
20314 | async canTransition() {
|
20315 | const canProceed = await this.runGuards();
|
20316 | if (canProceed !== true) {
|
20317 | if (typeof canProceed === 'object') {
|
20318 | return canProceed.redirect;
|
20319 | }
|
20320 | else {
|
20321 | return false;
|
20322 | }
|
20323 | }
|
20324 | return true;
|
20325 | }
|
20326 | |
20327 |
|
20328 |
|
20329 |
|
20330 |
|
20331 |
|
20332 | async push(url, direction = 'forward', animation) {
|
20333 | if (url.startsWith('.')) {
|
20334 | url = (new URL(url, window.location.href)).pathname;
|
20335 | }
|
20336 | let parsedPath = parsePath(url);
|
20337 | const canProceed = await this.runGuards(parsedPath.segments);
|
20338 | if (canProceed !== true) {
|
20339 | if (typeof canProceed === 'object') {
|
20340 | parsedPath = parsePath(canProceed.redirect);
|
20341 | }
|
20342 | else {
|
20343 | return false;
|
20344 | }
|
20345 | }
|
20346 | this.setPath(parsedPath.segments, direction, parsedPath.queryString);
|
20347 | return this.writeNavStateRoot(parsedPath.segments, direction, animation);
|
20348 | }
|
20349 | |
20350 |
|
20351 |
|
20352 | back() {
|
20353 | window.history.back();
|
20354 | return Promise.resolve(this.waitPromise);
|
20355 | }
|
20356 |
|
20357 | async printDebug() {
|
20358 | printRoutes(readRoutes(this.el));
|
20359 | printRedirects(readRedirects(this.el));
|
20360 | }
|
20361 |
|
20362 | async navChanged(direction) {
|
20363 | if (this.busy) {
|
20364 | console.warn('[ion-router] router is busy, navChanged was cancelled');
|
20365 | return false;
|
20366 | }
|
20367 | const { ids, outlet } = await readNavState(window.document.body);
|
20368 | const routes = readRoutes(this.el);
|
20369 | const chain = routerIDsToChain(ids, routes);
|
20370 | if (!chain) {
|
20371 | console.warn('[ion-router] no matching URL for ', ids.map(i => i.id));
|
20372 | return false;
|
20373 | }
|
20374 | const path = chainToPath(chain);
|
20375 | if (!path) {
|
20376 | console.warn('[ion-router] router could not match path because some required param is missing');
|
20377 | return false;
|
20378 | }
|
20379 | this.setPath(path, direction);
|
20380 | await this.safeWriteNavState(outlet, chain, ROUTER_INTENT_NONE, path, null, ids.length);
|
20381 | return true;
|
20382 | }
|
20383 |
|
20384 | onRedirectChanged() {
|
20385 | const path = this.getPath();
|
20386 | if (path && findRouteRedirect(path, readRedirects(this.el))) {
|
20387 | this.writeNavStateRoot(path, ROUTER_INTENT_NONE);
|
20388 | }
|
20389 | }
|
20390 |
|
20391 | onRoutesChanged() {
|
20392 | return this.writeNavStateRoot(this.getPath(), ROUTER_INTENT_NONE);
|
20393 | }
|
20394 | historyDirection() {
|
20395 | var _a;
|
20396 | const win = window;
|
20397 | if (win.history.state === null) {
|
20398 | this.state++;
|
20399 | win.history.replaceState(this.state, win.document.title, (_a = win.document.location) === null || _a === void 0 ? void 0 : _a.href);
|
20400 | }
|
20401 | const state = win.history.state;
|
20402 | const lastState = this.lastState;
|
20403 | this.lastState = state;
|
20404 | if (state > lastState || (state >= lastState && lastState > 0)) {
|
20405 | return ROUTER_INTENT_FORWARD;
|
20406 | }
|
20407 | if (state < lastState) {
|
20408 | return ROUTER_INTENT_BACK;
|
20409 | }
|
20410 | return ROUTER_INTENT_NONE;
|
20411 | }
|
20412 | async writeNavStateRoot(path, direction, animation) {
|
20413 | if (!path) {
|
20414 | console.error('[ion-router] URL is not part of the routing set');
|
20415 | return false;
|
20416 | }
|
20417 |
|
20418 | const redirects = readRedirects(this.el);
|
20419 | const redirect = findRouteRedirect(path, redirects);
|
20420 | let redirectFrom = null;
|
20421 | if (redirect) {
|
20422 | const { segments, queryString } = redirect.to;
|
20423 | this.setPath(segments, direction, queryString);
|
20424 | redirectFrom = redirect.from;
|
20425 | path = segments;
|
20426 | }
|
20427 |
|
20428 | const routes = readRoutes(this.el);
|
20429 | const chain = routerPathToChain(path, routes);
|
20430 | if (!chain) {
|
20431 | console.error('[ion-router] the path does not match any route');
|
20432 | return false;
|
20433 | }
|
20434 |
|
20435 | return this.safeWriteNavState(document.body, chain, direction, path, redirectFrom, 0, animation);
|
20436 | }
|
20437 | async safeWriteNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {
|
20438 | const unlock = await this.lock();
|
20439 | let changed = false;
|
20440 | try {
|
20441 | changed = await this.writeNavState(node, chain, direction, path, redirectFrom, index, animation);
|
20442 | }
|
20443 | catch (e) {
|
20444 | console.error(e);
|
20445 | }
|
20446 | unlock();
|
20447 | return changed;
|
20448 | }
|
20449 | async lock() {
|
20450 | const p = this.waitPromise;
|
20451 | let resolve;
|
20452 | this.waitPromise = new Promise(r => resolve = r);
|
20453 | if (p !== undefined) {
|
20454 | await p;
|
20455 | }
|
20456 | return resolve;
|
20457 | }
|
20458 |
|
20459 |
|
20460 |
|
20461 |
|
20462 | async runGuards(to = this.getPath(), from) {
|
20463 | if (from === undefined) {
|
20464 | from = parsePath(this.previousPath).segments;
|
20465 | }
|
20466 | if (!to || !from) {
|
20467 | return true;
|
20468 | }
|
20469 | const routes = readRoutes(this.el);
|
20470 | const fromChain = routerPathToChain(from, routes);
|
20471 | const beforeLeaveHook = fromChain && fromChain[fromChain.length - 1].beforeLeave;
|
20472 | const canLeave = beforeLeaveHook ? await beforeLeaveHook() : true;
|
20473 | if (canLeave === false || typeof canLeave === 'object') {
|
20474 | return canLeave;
|
20475 | }
|
20476 | const toChain = routerPathToChain(to, routes);
|
20477 | const beforeEnterHook = toChain && toChain[toChain.length - 1].beforeEnter;
|
20478 | return beforeEnterHook ? beforeEnterHook() : true;
|
20479 | }
|
20480 | async writeNavState(node, chain, direction, path, redirectFrom, index = 0, animation) {
|
20481 | if (this.busy) {
|
20482 | console.warn('[ion-router] router is busy, transition was cancelled');
|
20483 | return false;
|
20484 | }
|
20485 | this.busy = true;
|
20486 |
|
20487 | const routeEvent = this.routeChangeEvent(path, redirectFrom);
|
20488 | if (routeEvent) {
|
20489 | this.ionRouteWillChange.emit(routeEvent);
|
20490 | }
|
20491 | const changed = await writeNavState(node, chain, direction, index, false, animation);
|
20492 | this.busy = false;
|
20493 |
|
20494 | if (routeEvent) {
|
20495 | this.ionRouteDidChange.emit(routeEvent);
|
20496 | }
|
20497 | return changed;
|
20498 | }
|
20499 | setPath(path, direction, queryString) {
|
20500 | this.state++;
|
20501 | writePath(window.history, this.root, this.useHash, path, direction, this.state, queryString);
|
20502 | }
|
20503 | getPath() {
|
20504 | return readPath(window.location, this.root, this.useHash);
|
20505 | }
|
20506 | routeChangeEvent(path, redirectFromPath) {
|
20507 | const from = this.previousPath;
|
20508 | const to = generatePath(path);
|
20509 | this.previousPath = to;
|
20510 | if (to === from) {
|
20511 | return null;
|
20512 | }
|
20513 | const redirectedFrom = redirectFromPath ? generatePath(redirectFromPath) : null;
|
20514 | return {
|
20515 | from,
|
20516 | redirectedFrom,
|
20517 | to,
|
20518 | };
|
20519 | }
|
20520 | get el() { return getElement(this); }
|
20521 | static get cmpMeta() { return {
|
20522 | "$flags$": 0,
|
20523 | "$tagName$": "ion-router",
|
20524 | "$members$": {
|
20525 | "root": [1],
|
20526 | "useHash": [4, "use-hash"],
|
20527 | "canTransition": [64],
|
20528 | "push": [64],
|
20529 | "back": [64],
|
20530 | "printDebug": [64],
|
20531 | "navChanged": [64]
|
20532 | },
|
20533 | "$listeners$": [[8, "popstate", "onPopState"], [4, "ionBackButton", "onBackButton"]],
|
20534 | "$lazyBundleId$": "-",
|
20535 | "$attrsToReflect$": []
|
20536 | }; }
|
20537 | }
|
20538 |
|
20539 | const routerLinkCss = "/*!@:host*/.sc-ion-router-link-h{--background:transparent;--color:var(--ion-color-primary, #3880ff);background:var(--background);color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-router-link-h{color:var(--ion-color-base)}/*!@a*/a.sc-ion-router-link{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit}";
|
20540 |
|
20541 | class RouterLink {
|
20542 | constructor(hostRef) {
|
20543 | registerInstance(this, hostRef);
|
20544 | |
20545 |
|
20546 |
|
20547 |
|
20548 | this.routerDirection = 'forward';
|
20549 | this.onClick = (ev) => {
|
20550 | openURL(this.href, ev, this.routerDirection, this.routerAnimation);
|
20551 | };
|
20552 | }
|
20553 | render() {
|
20554 | const mode = getIonMode$1(this);
|
20555 | const attrs = {
|
20556 | href: this.href,
|
20557 | rel: this.rel,
|
20558 | target: this.target
|
20559 | };
|
20560 | return (hAsync(Host, { onClick: this.onClick, class: createColorClasses$1(this.color, {
|
20561 | [mode]: true,
|
20562 | 'ion-activatable': true
|
20563 | }) }, hAsync("a", Object.assign({}, attrs), hAsync("slot", null))));
|
20564 | }
|
20565 | static get style() { return routerLinkCss; }
|
20566 | static get cmpMeta() { return {
|
20567 | "$flags$": 9,
|
20568 | "$tagName$": "ion-router-link",
|
20569 | "$members$": {
|
20570 | "color": [513],
|
20571 | "href": [1],
|
20572 | "rel": [1],
|
20573 | "routerDirection": [1, "router-direction"],
|
20574 | "routerAnimation": [16],
|
20575 | "target": [1]
|
20576 | },
|
20577 | "$listeners$": undefined,
|
20578 | "$lazyBundleId$": "-",
|
20579 | "$attrsToReflect$": [["color", "color"]]
|
20580 | }; }
|
20581 | }
|
20582 |
|
20583 | const routeOutletCss = "/*!@:host*/.sc-ion-router-outlet-h{left:0;right:0;top:0;bottom:0;position:absolute;contain:layout size style;overflow:hidden;z-index:0}";
|
20584 |
|
20585 | class RouterOutlet {
|
20586 | constructor(hostRef) {
|
20587 | registerInstance(this, hostRef);
|
20588 | this.ionNavWillLoad = createEvent(this, "ionNavWillLoad", 7);
|
20589 | this.ionNavWillChange = createEvent(this, "ionNavWillChange", 3);
|
20590 | this.ionNavDidChange = createEvent(this, "ionNavDidChange", 3);
|
20591 | this.gestureOrAnimationInProgress = false;
|
20592 | |
20593 |
|
20594 |
|
20595 | this.mode = getIonMode$1(this);
|
20596 | |
20597 |
|
20598 |
|
20599 | this.animated = true;
|
20600 | }
|
20601 | swipeHandlerChanged() {
|
20602 | if (this.gesture) {
|
20603 | this.gesture.enable(this.swipeHandler !== undefined);
|
20604 | }
|
20605 | }
|
20606 | async connectedCallback() {
|
20607 | const onStart = () => {
|
20608 | this.gestureOrAnimationInProgress = true;
|
20609 | if (this.swipeHandler) {
|
20610 | this.swipeHandler.onStart();
|
20611 | }
|
20612 | };
|
20613 | this.gesture = (await Promise.resolve().then(function () { return swipeBack; })).createSwipeBackGesture(this.el, () => !this.gestureOrAnimationInProgress && !!this.swipeHandler && this.swipeHandler.canStart(), () => onStart(), step => this.ani && this.ani.progressStep(step), (shouldComplete, step, dur) => {
|
20614 | if (this.ani) {
|
20615 | this.ani.onFinish(() => {
|
20616 | this.gestureOrAnimationInProgress = false;
|
20617 | if (this.swipeHandler) {
|
20618 | this.swipeHandler.onEnd(shouldComplete);
|
20619 | }
|
20620 | }, { oneTimeCallback: true });
|
20621 |
|
20622 | let newStepValue = (shouldComplete) ? -0.001 : 0.001;
|
20623 | |
20624 |
|
20625 |
|
20626 |
|
20627 |
|
20628 |
|
20629 |
|
20630 |
|
20631 | if (!shouldComplete) {
|
20632 | this.ani.easing('cubic-bezier(1, 0, 0.68, 0.28)');
|
20633 | newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], step)[0];
|
20634 | }
|
20635 | else {
|
20636 | newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], step)[0];
|
20637 | }
|
20638 | this.ani.progressEnd(shouldComplete ? 1 : 0, newStepValue, dur);
|
20639 | }
|
20640 | else {
|
20641 | this.gestureOrAnimationInProgress = false;
|
20642 | }
|
20643 | });
|
20644 | this.swipeHandlerChanged();
|
20645 | }
|
20646 | componentWillLoad() {
|
20647 | this.ionNavWillLoad.emit();
|
20648 | }
|
20649 | disconnectedCallback() {
|
20650 | if (this.gesture) {
|
20651 | this.gesture.destroy();
|
20652 | this.gesture = undefined;
|
20653 | }
|
20654 | }
|
20655 |
|
20656 | async commit(enteringEl, leavingEl, opts) {
|
20657 | const unlock = await this.lock();
|
20658 | let changed = false;
|
20659 | try {
|
20660 | changed = await this.transition(enteringEl, leavingEl, opts);
|
20661 | }
|
20662 | catch (e) {
|
20663 | console.error(e);
|
20664 | }
|
20665 | unlock();
|
20666 | return changed;
|
20667 | }
|
20668 |
|
20669 | async setRouteId(id, params, direction, animation) {
|
20670 | const changed = await this.setRoot(id, params, {
|
20671 | duration: direction === 'root' ? 0 : undefined,
|
20672 | direction: direction === 'back' ? 'back' : 'forward',
|
20673 | animationBuilder: animation
|
20674 | });
|
20675 | return {
|
20676 | changed,
|
20677 | element: this.activeEl
|
20678 | };
|
20679 | }
|
20680 |
|
20681 | async getRouteId() {
|
20682 | const active = this.activeEl;
|
20683 | return active ? {
|
20684 | id: active.tagName,
|
20685 | element: active,
|
20686 | } : undefined;
|
20687 | }
|
20688 | async setRoot(component, params, opts) {
|
20689 | if (this.activeComponent === component) {
|
20690 | return false;
|
20691 | }
|
20692 |
|
20693 | const leavingEl = this.activeEl;
|
20694 | const enteringEl = await attachComponent(this.delegate, this.el, component, ['ion-page', 'ion-page-invisible'], params);
|
20695 | this.activeComponent = component;
|
20696 | this.activeEl = enteringEl;
|
20697 |
|
20698 | await this.commit(enteringEl, leavingEl, opts);
|
20699 | await detachComponent(this.delegate, leavingEl);
|
20700 | return true;
|
20701 | }
|
20702 | async transition(enteringEl, leavingEl, opts = {}) {
|
20703 | if (leavingEl === enteringEl) {
|
20704 | return false;
|
20705 | }
|
20706 |
|
20707 | this.ionNavWillChange.emit();
|
20708 | const { el, mode } = this;
|
20709 | const animated = this.animated && config.getBoolean('animated', true);
|
20710 | const animationBuilder = opts.animationBuilder || this.animation || config.get('navAnimation');
|
20711 | await transition$2(Object.assign(Object.assign({ mode,
|
20712 | animated,
|
20713 | enteringEl,
|
20714 | leavingEl, baseEl: el, progressCallback: (opts.progressAnimation
|
20715 | ? ani => {
|
20716 | |
20717 |
|
20718 |
|
20719 |
|
20720 |
|
20721 |
|
20722 |
|
20723 | if (ani !== undefined && !this.gestureOrAnimationInProgress) {
|
20724 | this.gestureOrAnimationInProgress = true;
|
20725 | ani.onFinish(() => {
|
20726 | this.gestureOrAnimationInProgress = false;
|
20727 | if (this.swipeHandler) {
|
20728 | this.swipeHandler.onEnd(false);
|
20729 | }
|
20730 | }, { oneTimeCallback: true });
|
20731 | |
20732 |
|
20733 |
|
20734 |
|
20735 |
|
20736 |
|
20737 | ani.progressEnd(0, 0, 0);
|
20738 | }
|
20739 | else {
|
20740 | this.ani = ani;
|
20741 | }
|
20742 | }
|
20743 | : undefined) }, opts), { animationBuilder }));
|
20744 |
|
20745 | this.ionNavDidChange.emit();
|
20746 | return true;
|
20747 | }
|
20748 | async lock() {
|
20749 | const p = this.waitPromise;
|
20750 | let resolve;
|
20751 | this.waitPromise = new Promise(r => resolve = r);
|
20752 | if (p !== undefined) {
|
20753 | await p;
|
20754 | }
|
20755 | return resolve;
|
20756 | }
|
20757 | render() {
|
20758 | return (hAsync("slot", null));
|
20759 | }
|
20760 | get el() { return getElement(this); }
|
20761 | static get watchers() { return {
|
20762 | "swipeHandler": ["swipeHandlerChanged"]
|
20763 | }; }
|
20764 | static get style() { return routeOutletCss; }
|
20765 | static get cmpMeta() { return {
|
20766 | "$flags$": 9,
|
20767 | "$tagName$": "ion-router-outlet",
|
20768 | "$members$": {
|
20769 | "mode": [1025],
|
20770 | "delegate": [16],
|
20771 | "animated": [4],
|
20772 | "animation": [16],
|
20773 | "swipeHandler": [16],
|
20774 | "commit": [64],
|
20775 | "setRouteId": [64],
|
20776 | "getRouteId": [64]
|
20777 | },
|
20778 | "$listeners$": undefined,
|
20779 | "$lazyBundleId$": "-",
|
20780 | "$attrsToReflect$": []
|
20781 | }; }
|
20782 | }
|
20783 |
|
20784 | const rowCss = "/*!@:host*/.sc-ion-row-h{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}";
|
20785 |
|
20786 | class Row {
|
20787 | constructor(hostRef) {
|
20788 | registerInstance(this, hostRef);
|
20789 | }
|
20790 | render() {
|
20791 | return (hAsync(Host, { class: getIonMode$1(this) }, hAsync("slot", null)));
|
20792 | }
|
20793 | static get style() { return rowCss; }
|
20794 | static get cmpMeta() { return {
|
20795 | "$flags$": 9,
|
20796 | "$tagName$": "ion-row",
|
20797 | "$members$": undefined,
|
20798 | "$listeners$": undefined,
|
20799 | "$lazyBundleId$": "-",
|
20800 | "$attrsToReflect$": []
|
20801 | }; }
|
20802 | }
|
20803 |
|
20804 | const searchbarIosCss = ".sc-ion-searchbar-ios-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-searchbar-ios-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:inherit}.searchbar-search-icon.sc-ion-searchbar-ios{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-ios{display:block;position:relative;-ms-flex-negative:1;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-ios{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-input.sc-ion-searchbar-ios::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-ios::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-ios::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-ios>div.sc-ion-searchbar-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{display:block}.searchbar-disabled.sc-ion-searchbar-ios-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.07);--border-radius:10px;--box-shadow:none;--cancel-button-color:var(--ion-color-primary, #3880ff);--clear-button-color:var(--ion-color-step-600, #666666);--color:var(--ion-text-color, #000);--icon-color:var(--ion-color-step-600, #666666);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;height:60px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-searchbar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}.searchbar-input-container.sc-ion-searchbar-ios{height:36px}.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:calc(50% - 60px);left:5px;top:0;position:absolute;width:22px;height:100%;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:calc(50% - 60px);margin-inline-start:calc(50% - 60px)}}[dir=rtl].sc-ion-searchbar-ios .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{left:unset;right:unset;right:5px}.searchbar-input.sc-ion-searchbar-ios{padding-left:28px;padding-right:28px;padding-top:0;padding-bottom:0;height:100%;font-size:17px;font-weight:400;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:28px;padding-inline-start:28px;-webkit-padding-end:28px;padding-inline-end:28px}}.searchbar-clear-button.sc-ion-searchbar-ios{right:0;top:0;background-position:center;position:absolute;width:30px;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-ios .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl].sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios,[dir=rtl] .sc-ion-searchbar-ios-h .searchbar-clear-button.sc-ion-searchbar-ios{left:unset;right:unset;left:0}.searchbar-clear-icon.sc-ion-searchbar-ios{width:18px;height:100%}.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:8px;padding-right:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0;background-color:transparent;font-size:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-cancel-button.sc-ion-searchbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:0;padding-inline-end:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{margin-left:unset;-webkit-margin-start:0;margin-inline-start:0}}.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:30px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-left-aligned.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{padding-left:unset;-webkit-padding-start:30px;padding-inline-start:30px}}.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{display:block}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios{-webkit-transition:all 300ms ease;transition:all 300ms ease}.searchbar-animated.searchbar-has-focus.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios,.searchbar-animated.searchbar-should-show-cancel.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{opacity:1;pointer-events:auto}.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:-100%;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:all 300ms ease;transition:all 300ms ease;opacity:0;pointer-events:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-animated.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{margin-right:unset;-webkit-margin-end:-100%;margin-inline-end:-100%}}.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-input.sc-ion-searchbar-ios,.searchbar-no-animate.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{-webkit-transition-duration:0ms;transition-duration:0ms}.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios{color:var(--ion-color-base)}@media (any-hover: hover){.ion-color.sc-ion-searchbar-ios-h .searchbar-cancel-button.sc-ion-searchbar-ios:hover{color:var(--ion-color-tint)}}ion-toolbar.sc-ion-searchbar-ios-h,ion-toolbar .sc-ion-searchbar-ios-h{padding-top:1px;padding-bottom:15px;height:52px}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color),ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color){color:inherit}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-cancel-button.sc-ion-searchbar-ios{color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h .searchbar-search-icon.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-input.sc-ion-searchbar-ios{background:rgba(var(--ion-color-contrast-rgb), 0.07);color:currentColor}ion-toolbar.ion-color.sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios,ion-toolbar.ion-color .sc-ion-searchbar-ios-h:not(.ion-color) .searchbar-clear-button.sc-ion-searchbar-ios{color:currentColor;opacity:0.5}";
|
20805 |
|
20806 | const searchbarMdCss = ".sc-ion-searchbar-md-h{--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-searchbar-md-h{color:var(--ion-color-contrast)}.ion-color.sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background:var(--ion-color-base)}.ion-color.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.ion-color.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{color:inherit}.searchbar-search-icon.sc-ion-searchbar-md{color:var(--icon-color);pointer-events:none}.searchbar-input-container.sc-ion-searchbar-md{display:block;position:relative;-ms-flex-negative:1;flex-shrink:1;width:100%}.searchbar-input.sc-ion-searchbar-md{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;border-radius:var(--border-radius);display:block;width:100%;border:0;outline:none;background:var(--background);font-family:inherit;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-input.sc-ion-searchbar-md::-webkit-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-moz-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md:-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-ms-input-placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::placeholder{color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.searchbar-input.sc-ion-searchbar-md::-webkit-search-cancel-button,.searchbar-input.sc-ion-searchbar-md::-ms-clear{display:none}.searchbar-cancel-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:none;height:100%;border:0;outline:none;color:var(--cancel-button-color);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-cancel-button.sc-ion-searchbar-md>div.sc-ion-searchbar-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.searchbar-clear-button.sc-ion-searchbar-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:none;min-height:0;outline:none;color:var(--clear-button-color);-webkit-appearance:none;-moz-appearance:none;appearance:none}.searchbar-has-value.searchbar-should-show-clear.sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{display:block}.searchbar-disabled.sc-ion-searchbar-md-h{cursor:default;opacity:0.4;pointer-events:none}.sc-ion-searchbar-md-h{--background:var(--ion-background-color, #fff);--border-radius:2px;--box-shadow:0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--cancel-button-color:var(--ion-color-step-900, #1a1a1a);--clear-button-color:initial;--color:var(--ion-color-step-850, #262626);--icon-color:var(--ion-color-step-600, #666666);padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;background:inherit}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.searchbar-search-icon.sc-ion-searchbar-md{left:16px;top:11px;width:21px;height:21px}[dir=rtl].sc-ion-searchbar-md .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{left:unset;right:unset;right:16px}.searchbar-cancel-button.sc-ion-searchbar-md{left:5px;top:0;background-color:transparent;font-size:1.6em}[dir=rtl].sc-ion-searchbar-md .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{left:unset;right:unset;right:5px}.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-cancel-button.sc-ion-searchbar-md{position:absolute}.searchbar-search-icon.ion-activated.sc-ion-searchbar-md,.searchbar-cancel-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-input.sc-ion-searchbar-md{padding-left:55px;padding-right:55px;padding-top:6px;padding-bottom:6px;background-position:left 8px center;height:auto;font-size:16px;font-weight:400;line-height:30px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.searchbar-input.sc-ion-searchbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:55px;padding-inline-start:55px;-webkit-padding-end:55px;padding-inline-end:55px}}[dir=rtl].sc-ion-searchbar-md .searchbar-input.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-input.sc-ion-searchbar-md{background-position:right 8px center}.searchbar-clear-button.sc-ion-searchbar-md{right:13px;top:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;position:absolute;height:100%;border:0;background-color:transparent}[dir=rtl].sc-ion-searchbar-md .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl].sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md,[dir=rtl] .sc-ion-searchbar-md-h .searchbar-clear-button.sc-ion-searchbar-md{left:unset;right:unset;left:13px}.searchbar-clear-button.ion-activated.sc-ion-searchbar-md{background-color:transparent}.searchbar-clear-icon.sc-ion-searchbar-md{width:22px;height:100%}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-search-icon.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md{display:block}.searchbar-has-focus.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md,.searchbar-should-show-cancel.sc-ion-searchbar-md-h .searchbar-cancel-button.sc-ion-searchbar-md+.searchbar-search-icon.sc-ion-searchbar-md{display:none}ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:7px;padding-right:7px;padding-top:3px;padding-bottom:3px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){ion-toolbar.sc-ion-searchbar-md-h,ion-toolbar .sc-ion-searchbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:7px;padding-inline-start:7px;-webkit-padding-end:7px;padding-inline-end:7px}}";
|
20807 |
|
20808 |
|
20809 |
|
20810 |
|
20811 | class Searchbar {
|
20812 | constructor(hostRef) {
|
20813 | registerInstance(this, hostRef);
|
20814 | this.ionInput = createEvent(this, "ionInput", 7);
|
20815 | this.ionChange = createEvent(this, "ionChange", 7);
|
20816 | this.ionCancel = createEvent(this, "ionCancel", 7);
|
20817 | this.ionClear = createEvent(this, "ionClear", 7);
|
20818 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
20819 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
20820 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
20821 | this.isCancelVisible = false;
|
20822 | this.shouldAlignLeft = true;
|
20823 | this.focused = false;
|
20824 | this.noAnimate = true;
|
20825 | |
20826 |
|
20827 |
|
20828 | this.animated = false;
|
20829 | |
20830 |
|
20831 |
|
20832 | this.autocomplete = 'off';
|
20833 | |
20834 |
|
20835 |
|
20836 | this.autocorrect = 'off';
|
20837 | |
20838 |
|
20839 |
|
20840 |
|
20841 | this.cancelButtonIcon = config.get('backButtonIcon', 'arrow-back-sharp');
|
20842 | |
20843 |
|
20844 |
|
20845 | this.cancelButtonText = 'Cancel';
|
20846 | |
20847 |
|
20848 |
|
20849 | this.debounce = 250;
|
20850 | |
20851 |
|
20852 |
|
20853 | this.disabled = false;
|
20854 | |
20855 |
|
20856 |
|
20857 |
|
20858 |
|
20859 |
|
20860 |
|
20861 |
|
20862 |
|
20863 | this.placeholder = 'Search';
|
20864 | |
20865 |
|
20866 |
|
20867 |
|
20868 |
|
20869 |
|
20870 |
|
20871 | this.showCancelButton = 'never';
|
20872 | |
20873 |
|
20874 |
|
20875 |
|
20876 |
|
20877 |
|
20878 |
|
20879 |
|
20880 | this.showClearButton = 'focus';
|
20881 | |
20882 |
|
20883 |
|
20884 | this.spellcheck = false;
|
20885 | |
20886 |
|
20887 |
|
20888 | this.type = 'search';
|
20889 | |
20890 |
|
20891 |
|
20892 | this.value = '';
|
20893 | |
20894 |
|
20895 |
|
20896 | this.onClearInput = (ev, shouldFocus) => {
|
20897 | this.ionClear.emit();
|
20898 | if (ev) {
|
20899 | ev.preventDefault();
|
20900 | ev.stopPropagation();
|
20901 | }
|
20902 |
|
20903 |
|
20904 | setTimeout(() => {
|
20905 | const value = this.getValue();
|
20906 | if (value !== '') {
|
20907 | this.value = '';
|
20908 | this.ionInput.emit();
|
20909 | |
20910 |
|
20911 |
|
20912 |
|
20913 |
|
20914 |
|
20915 | if (shouldFocus && !this.focused) {
|
20916 | this.setFocus();
|
20917 | }
|
20918 | }
|
20919 | }, 16 * 4);
|
20920 | };
|
20921 | |
20922 |
|
20923 |
|
20924 |
|
20925 |
|
20926 | this.onCancelSearchbar = (ev) => {
|
20927 | if (ev) {
|
20928 | ev.preventDefault();
|
20929 | ev.stopPropagation();
|
20930 | }
|
20931 | this.ionCancel.emit();
|
20932 | this.onClearInput();
|
20933 | if (this.nativeInput) {
|
20934 | this.nativeInput.blur();
|
20935 | }
|
20936 | };
|
20937 | |
20938 |
|
20939 |
|
20940 | this.onInput = (ev) => {
|
20941 | const input = ev.target;
|
20942 | if (input) {
|
20943 | this.value = input.value;
|
20944 | }
|
20945 | this.ionInput.emit(ev);
|
20946 | };
|
20947 | |
20948 |
|
20949 |
|
20950 |
|
20951 | this.onBlur = () => {
|
20952 | this.focused = false;
|
20953 | this.ionBlur.emit();
|
20954 | this.positionElements();
|
20955 | };
|
20956 | |
20957 |
|
20958 |
|
20959 | this.onFocus = () => {
|
20960 | this.focused = true;
|
20961 | this.ionFocus.emit();
|
20962 | this.positionElements();
|
20963 | };
|
20964 | }
|
20965 | debounceChanged() {
|
20966 | this.ionChange = debounceEvent(this.ionChange, this.debounce);
|
20967 | }
|
20968 | valueChanged() {
|
20969 | const inputEl = this.nativeInput;
|
20970 | const value = this.getValue();
|
20971 | if (inputEl && inputEl.value !== value) {
|
20972 | inputEl.value = value;
|
20973 | }
|
20974 | this.ionChange.emit({ value });
|
20975 | }
|
20976 | showCancelButtonChanged() {
|
20977 | requestAnimationFrame(() => {
|
20978 | this.positionElements();
|
20979 | forceUpdate$1(this);
|
20980 | });
|
20981 | }
|
20982 | connectedCallback() {
|
20983 | this.emitStyle();
|
20984 | }
|
20985 | componentDidLoad() {
|
20986 | this.positionElements();
|
20987 | this.debounceChanged();
|
20988 | setTimeout(() => {
|
20989 | this.noAnimate = false;
|
20990 | }, 300);
|
20991 | }
|
20992 | emitStyle() {
|
20993 | this.ionStyle.emit({
|
20994 | 'searchbar': true
|
20995 | });
|
20996 | }
|
20997 | |
20998 |
|
20999 |
|
21000 |
|
21001 | async setFocus() {
|
21002 | if (this.nativeInput) {
|
21003 | this.nativeInput.focus();
|
21004 | }
|
21005 | }
|
21006 | |
21007 |
|
21008 |
|
21009 | getInputElement() {
|
21010 | return Promise.resolve(this.nativeInput);
|
21011 | }
|
21012 | |
21013 |
|
21014 |
|
21015 |
|
21016 | positionElements() {
|
21017 | const value = this.getValue();
|
21018 | const prevAlignLeft = this.shouldAlignLeft;
|
21019 | const mode = getIonMode$1(this);
|
21020 | const shouldAlignLeft = (!this.animated || value.trim() !== '' || !!this.focused);
|
21021 | this.shouldAlignLeft = shouldAlignLeft;
|
21022 | if (mode !== 'ios') {
|
21023 | return;
|
21024 | }
|
21025 | if (prevAlignLeft !== shouldAlignLeft) {
|
21026 | this.positionPlaceholder();
|
21027 | }
|
21028 | if (this.animated) {
|
21029 | this.positionCancelButton();
|
21030 | }
|
21031 | }
|
21032 | |
21033 |
|
21034 |
|
21035 | positionPlaceholder() {
|
21036 | const inputEl = this.nativeInput;
|
21037 | if (!inputEl) {
|
21038 | return;
|
21039 | }
|
21040 | const isRTL = document.dir === 'rtl';
|
21041 | const iconEl = (this.el.shadowRoot || this.el).querySelector('.searchbar-search-icon');
|
21042 | if (this.shouldAlignLeft) {
|
21043 | inputEl.removeAttribute('style');
|
21044 | iconEl.removeAttribute('style');
|
21045 | }
|
21046 | else {
|
21047 |
|
21048 | const doc = document;
|
21049 | const tempSpan = doc.createElement('span');
|
21050 | tempSpan.innerText = this.placeholder || '';
|
21051 | doc.body.appendChild(tempSpan);
|
21052 |
|
21053 | raf(() => {
|
21054 | const textWidth = tempSpan.offsetWidth;
|
21055 | tempSpan.remove();
|
21056 |
|
21057 | const inputLeft = 'calc(50% - ' + (textWidth / 2) + 'px)';
|
21058 |
|
21059 | const iconLeft = 'calc(50% - ' + ((textWidth / 2) + 30) + 'px)';
|
21060 |
|
21061 | if (isRTL) {
|
21062 | inputEl.style.paddingRight = inputLeft;
|
21063 | iconEl.style.marginRight = iconLeft;
|
21064 | }
|
21065 | else {
|
21066 | inputEl.style.paddingLeft = inputLeft;
|
21067 | iconEl.style.marginLeft = iconLeft;
|
21068 | }
|
21069 | });
|
21070 | }
|
21071 | }
|
21072 | |
21073 |
|
21074 |
|
21075 | positionCancelButton() {
|
21076 | const isRTL = document.dir === 'rtl';
|
21077 | const cancelButton = (this.el.shadowRoot || this.el).querySelector('.searchbar-cancel-button');
|
21078 | const shouldShowCancel = this.shouldShowCancelButton();
|
21079 | if (cancelButton && shouldShowCancel !== this.isCancelVisible) {
|
21080 | const cancelStyle = cancelButton.style;
|
21081 | this.isCancelVisible = shouldShowCancel;
|
21082 | if (shouldShowCancel) {
|
21083 | if (isRTL) {
|
21084 | cancelStyle.marginLeft = '0';
|
21085 | }
|
21086 | else {
|
21087 | cancelStyle.marginRight = '0';
|
21088 | }
|
21089 | }
|
21090 | else {
|
21091 | const offset = cancelButton.offsetWidth;
|
21092 | if (offset > 0) {
|
21093 | if (isRTL) {
|
21094 | cancelStyle.marginLeft = -offset + 'px';
|
21095 | }
|
21096 | else {
|
21097 | cancelStyle.marginRight = -offset + 'px';
|
21098 | }
|
21099 | }
|
21100 | }
|
21101 | }
|
21102 | }
|
21103 | getValue() {
|
21104 | return this.value || '';
|
21105 | }
|
21106 | hasValue() {
|
21107 | return this.getValue() !== '';
|
21108 | }
|
21109 | |
21110 |
|
21111 |
|
21112 |
|
21113 |
|
21114 |
|
21115 | shouldShowCancelButton() {
|
21116 | if ((this.showCancelButton === 'never') || (this.showCancelButton === 'focus' && !this.focused)) {
|
21117 | return false;
|
21118 | }
|
21119 | return true;
|
21120 | }
|
21121 | |
21122 |
|
21123 |
|
21124 |
|
21125 |
|
21126 |
|
21127 | shouldShowClearButton() {
|
21128 | if ((this.showClearButton === 'never') || (this.showClearButton === 'focus' && !this.focused)) {
|
21129 | return false;
|
21130 | }
|
21131 | return true;
|
21132 | }
|
21133 | render() {
|
21134 | const { cancelButtonText } = this;
|
21135 | const animated = this.animated && config.getBoolean('animated', true);
|
21136 | const mode = getIonMode$1(this);
|
21137 | const clearIcon = this.clearIcon || (mode === 'ios' ? 'close-circle' : 'close-sharp');
|
21138 | const searchIcon = this.searchIcon || (mode === 'ios' ? 'search-outline' : 'search-sharp');
|
21139 | const shouldShowCancelButton = this.shouldShowCancelButton();
|
21140 | const cancelButton = (this.showCancelButton !== 'never') && (hAsync("button", { "aria-label": cancelButtonText, "aria-hidden": shouldShowCancelButton ? undefined : 'true', type: "button", tabIndex: mode === 'ios' && !shouldShowCancelButton ? -1 : undefined, onMouseDown: this.onCancelSearchbar, onTouchStart: this.onCancelSearchbar, class: "searchbar-cancel-button" }, hAsync("div", { "aria-hidden": "true" }, mode === 'md'
|
21141 | ? hAsync("ion-icon", { "aria-hidden": "true", mode: mode, icon: this.cancelButtonIcon, lazy: false })
|
21142 | : cancelButtonText)));
|
21143 | return (hAsync(Host, { role: "search", "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
21144 | [mode]: true,
|
21145 | 'searchbar-animated': animated,
|
21146 | 'searchbar-disabled': this.disabled,
|
21147 | 'searchbar-no-animate': animated && this.noAnimate,
|
21148 | 'searchbar-has-value': this.hasValue(),
|
21149 | 'searchbar-left-aligned': this.shouldAlignLeft,
|
21150 | 'searchbar-has-focus': this.focused,
|
21151 | 'searchbar-should-show-clear': this.shouldShowClearButton(),
|
21152 | 'searchbar-should-show-cancel': this.shouldShowCancelButton()
|
21153 | }) }, hAsync("div", { class: "searchbar-input-container" }, hAsync("input", { "aria-label": "search text", disabled: this.disabled, ref: el => this.nativeInput = el, class: "searchbar-input", inputMode: this.inputmode, enterKeyHint: this.enterkeyhint, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, placeholder: this.placeholder, type: this.type, value: this.getValue(), autoComplete: this.autocomplete, autoCorrect: this.autocorrect, spellcheck: this.spellcheck }), mode === 'md' && cancelButton, hAsync("ion-icon", { "aria-hidden": "true", mode: mode, icon: searchIcon, lazy: false, class: "searchbar-search-icon" }), hAsync("button", { "aria-label": "reset", type: "button", "no-blur": true, class: "searchbar-clear-button", onMouseDown: ev => this.onClearInput(ev, true), onTouchStart: ev => this.onClearInput(ev, true) }, hAsync("ion-icon", { "aria-hidden": "true", mode: mode, icon: clearIcon, lazy: false, class: "searchbar-clear-icon" }))), mode === 'ios' && cancelButton));
|
21154 | }
|
21155 | get el() { return getElement(this); }
|
21156 | static get watchers() { return {
|
21157 | "debounce": ["debounceChanged"],
|
21158 | "value": ["valueChanged"],
|
21159 | "showCancelButton": ["showCancelButtonChanged"]
|
21160 | }; }
|
21161 | static get style() { return {
|
21162 | ios: searchbarIosCss,
|
21163 | md: searchbarMdCss
|
21164 | }; }
|
21165 | static get cmpMeta() { return {
|
21166 | "$flags$": 34,
|
21167 | "$tagName$": "ion-searchbar",
|
21168 | "$members$": {
|
21169 | "color": [513],
|
21170 | "animated": [4],
|
21171 | "autocomplete": [1],
|
21172 | "autocorrect": [1],
|
21173 | "cancelButtonIcon": [1, "cancel-button-icon"],
|
21174 | "cancelButtonText": [1, "cancel-button-text"],
|
21175 | "clearIcon": [1, "clear-icon"],
|
21176 | "debounce": [2],
|
21177 | "disabled": [4],
|
21178 | "inputmode": [1],
|
21179 | "enterkeyhint": [1],
|
21180 | "placeholder": [1],
|
21181 | "searchIcon": [1, "search-icon"],
|
21182 | "showCancelButton": [1, "show-cancel-button"],
|
21183 | "showClearButton": [1, "show-clear-button"],
|
21184 | "spellcheck": [4],
|
21185 | "type": [1],
|
21186 | "value": [1025],
|
21187 | "focused": [32],
|
21188 | "noAnimate": [32],
|
21189 | "setFocus": [64],
|
21190 | "getInputElement": [64]
|
21191 | },
|
21192 | "$listeners$": undefined,
|
21193 | "$lazyBundleId$": "-",
|
21194 | "$attrsToReflect$": [["color", "color"]]
|
21195 | }; }
|
21196 | }
|
21197 |
|
21198 | const segmentIosCss = "/*!@:host*/.sc-ion-segment-ios-h{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}/*!@:host(.segment-scrollable)*/.segment-scrollable.sc-ion-segment-ios-h{-ms-flex-pack:start;justify-content:start;width:auto;overflow-x:auto}/*!@:host(.segment-scrollable::-webkit-scrollbar)*/.segment-scrollable.sc-ion-segment-ios-h::-webkit-scrollbar{display:none}/*!@:host*/.sc-ion-segment-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.065);border-radius:8px;overflow:hidden;z-index:0}/*!@:host(.ion-color)*/.ion-color.sc-ion-segment-ios-h{background:rgba(var(--ion-color-base-rgb), 0.065)}/*!@:host(.in-toolbar)*/.in-toolbar.sc-ion-segment-ios-h{margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;width:auto}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-toolbar)*/.in-toolbar.sc-ion-segment-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}/*!@:host(.in-toolbar:not(.ion-color))*/.in-toolbar.sc-ion-segment-ios-h:not(.ion-color){background:var(--ion-toolbar-segment-background, var(--background))}/*!@:host(.in-toolbar-color:not(.ion-color))*/.in-toolbar-color.sc-ion-segment-ios-h:not(.ion-color){background:rgba(var(--ion-color-contrast-rgb), 0.11)}";
|
21199 |
|
21200 | const segmentMdCss = "/*!@:host*/.sc-ion-segment-md-h{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:stretch;align-items:stretch;-ms-flex-pack:center;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}/*!@:host(.segment-scrollable)*/.segment-scrollable.sc-ion-segment-md-h{-ms-flex-pack:start;justify-content:start;width:auto;overflow-x:auto}/*!@:host(.segment-scrollable::-webkit-scrollbar)*/.segment-scrollable.sc-ion-segment-md-h::-webkit-scrollbar{display:none}/*!@:host*/.sc-ion-segment-md-h{--background:transparent}/*!@:host(.segment-scrollable) ::slotted(ion-segment-button)*/.sc-ion-segment-md-h.segment-scrollable .sc-ion-segment-md-s>ion-segment-button{min-width:auto}";
|
21201 |
|
21202 |
|
21203 |
|
21204 |
|
21205 | class Segment {
|
21206 | constructor(hostRef) {
|
21207 | registerInstance(this, hostRef);
|
21208 | this.ionChange = createEvent(this, "ionChange", 7);
|
21209 | this.ionSelect = createEvent(this, "ionSelect", 7);
|
21210 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
21211 | this.didInit = false;
|
21212 | this.activated = false;
|
21213 | |
21214 |
|
21215 |
|
21216 | this.disabled = false;
|
21217 | |
21218 |
|
21219 |
|
21220 |
|
21221 |
|
21222 | this.scrollable = false;
|
21223 | |
21224 |
|
21225 |
|
21226 | this.swipeGesture = true;
|
21227 | this.onClick = (ev) => {
|
21228 | const current = ev.target;
|
21229 | const previous = this.checked;
|
21230 |
|
21231 |
|
21232 |
|
21233 |
|
21234 | if (current.tagName === 'ION-SEGMENT') {
|
21235 | return;
|
21236 | }
|
21237 | this.value = current.value;
|
21238 | if (this.scrollable || !this.swipeGesture) {
|
21239 | if (previous) {
|
21240 | this.checkButton(previous, current);
|
21241 | }
|
21242 | else {
|
21243 | this.setCheckedClasses();
|
21244 | }
|
21245 | }
|
21246 | this.checked = current;
|
21247 | };
|
21248 | }
|
21249 | colorChanged(value, oldValue) {
|
21250 | |
21251 |
|
21252 |
|
21253 |
|
21254 |
|
21255 |
|
21256 | if ((oldValue === undefined && value !== undefined) ||
|
21257 | (oldValue !== undefined && value === undefined)) {
|
21258 | this.emitStyle();
|
21259 | }
|
21260 | }
|
21261 | swipeGestureChanged() {
|
21262 | this.gestureChanged();
|
21263 | }
|
21264 | valueChanged(value, oldValue) {
|
21265 | this.ionSelect.emit({ value });
|
21266 | if (oldValue !== '' || this.didInit) {
|
21267 | if (!this.activated) {
|
21268 | this.ionChange.emit({ value });
|
21269 | }
|
21270 | else {
|
21271 | this.valueAfterGesture = value;
|
21272 | }
|
21273 | }
|
21274 | }
|
21275 | disabledChanged() {
|
21276 | this.gestureChanged();
|
21277 | const buttons = this.getButtons();
|
21278 | for (const button of buttons) {
|
21279 | button.disabled = this.disabled;
|
21280 | }
|
21281 | }
|
21282 | gestureChanged() {
|
21283 | if (this.gesture) {
|
21284 | this.gesture.enable(!this.scrollable && !this.disabled && this.swipeGesture);
|
21285 | }
|
21286 | }
|
21287 | connectedCallback() {
|
21288 | this.emitStyle();
|
21289 | }
|
21290 | componentWillLoad() {
|
21291 | this.emitStyle();
|
21292 | }
|
21293 | async componentDidLoad() {
|
21294 | this.setCheckedClasses();
|
21295 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
21296 | el: this.el,
|
21297 | gestureName: 'segment',
|
21298 | gesturePriority: 100,
|
21299 | threshold: 0,
|
21300 | passive: false,
|
21301 | onStart: ev => this.onStart(ev),
|
21302 | onMove: ev => this.onMove(ev),
|
21303 | onEnd: ev => this.onEnd(ev),
|
21304 | });
|
21305 | this.gestureChanged();
|
21306 | if (this.disabled) {
|
21307 | this.disabledChanged();
|
21308 | }
|
21309 | this.didInit = true;
|
21310 | }
|
21311 | onStart(detail) {
|
21312 | this.activate(detail);
|
21313 | }
|
21314 | onMove(detail) {
|
21315 | this.setNextIndex(detail);
|
21316 | }
|
21317 | onEnd(detail) {
|
21318 | this.setActivated(false);
|
21319 | const checkedValidButton = this.setNextIndex(detail, true);
|
21320 | detail.event.stopImmediatePropagation();
|
21321 | if (checkedValidButton) {
|
21322 | this.addRipple(detail);
|
21323 | }
|
21324 | const value = this.valueAfterGesture;
|
21325 | if (value !== undefined) {
|
21326 | this.ionChange.emit({ value });
|
21327 | this.valueAfterGesture = undefined;
|
21328 | }
|
21329 | }
|
21330 | getButtons() {
|
21331 | return Array.from(this.el.querySelectorAll('ion-segment-button'));
|
21332 | }
|
21333 | |
21334 |
|
21335 |
|
21336 |
|
21337 |
|
21338 | addRipple(detail) {
|
21339 | const useRippleEffect = config.getBoolean('animated', true) && config.getBoolean('rippleEffect', true);
|
21340 | if (!useRippleEffect) {
|
21341 | return;
|
21342 | }
|
21343 | const buttons = this.getButtons();
|
21344 | const checked = buttons.find(button => button.value === this.value);
|
21345 | const root = checked.shadowRoot || checked;
|
21346 | const ripple = root.querySelector('ion-ripple-effect');
|
21347 | if (!ripple) {
|
21348 | return;
|
21349 | }
|
21350 | const { x, y } = pointerCoord(detail.event);
|
21351 | ripple.addRipple(x, y).then(remove => remove());
|
21352 | }
|
21353 | |
21354 |
|
21355 |
|
21356 |
|
21357 | setActivated(activated) {
|
21358 | const buttons = this.getButtons();
|
21359 | buttons.forEach(button => {
|
21360 | if (activated) {
|
21361 | button.classList.add('segment-button-activated');
|
21362 | }
|
21363 | else {
|
21364 | button.classList.remove('segment-button-activated');
|
21365 | }
|
21366 | });
|
21367 | this.activated = activated;
|
21368 | }
|
21369 | activate(detail) {
|
21370 | const clicked = detail.event.target;
|
21371 | const buttons = this.getButtons();
|
21372 | const checked = buttons.find(button => button.value === this.value);
|
21373 |
|
21374 |
|
21375 | if (clicked.tagName !== 'ION-SEGMENT-BUTTON') {
|
21376 | return;
|
21377 | }
|
21378 |
|
21379 | if (!checked) {
|
21380 | this.value = clicked.value;
|
21381 | this.setCheckedClasses();
|
21382 | }
|
21383 |
|
21384 |
|
21385 | if (this.value === clicked.value) {
|
21386 | this.setActivated(true);
|
21387 | }
|
21388 | }
|
21389 | getIndicator(button) {
|
21390 | const root = button.shadowRoot || button;
|
21391 | return root.querySelector('.segment-button-indicator');
|
21392 | }
|
21393 | checkButton(previous, current) {
|
21394 | const previousIndicator = this.getIndicator(previous);
|
21395 | const currentIndicator = this.getIndicator(current);
|
21396 | if (previousIndicator === null || currentIndicator === null) {
|
21397 | return;
|
21398 | }
|
21399 | const previousClientRect = previousIndicator.getBoundingClientRect();
|
21400 | const currentClientRect = currentIndicator.getBoundingClientRect();
|
21401 | const widthDelta = previousClientRect.width / currentClientRect.width;
|
21402 | const xPosition = previousClientRect.left - currentClientRect.left;
|
21403 |
|
21404 |
|
21405 | const transform = `translate3d(${xPosition}px, 0, 0) scaleX(${widthDelta})`;
|
21406 | writeTask(() => {
|
21407 |
|
21408 | currentIndicator.classList.remove('segment-button-indicator-animated');
|
21409 | currentIndicator.style.setProperty('transform', transform);
|
21410 |
|
21411 | currentIndicator.getBoundingClientRect();
|
21412 |
|
21413 | currentIndicator.classList.add('segment-button-indicator-animated');
|
21414 |
|
21415 | currentIndicator.style.setProperty('transform', '');
|
21416 | });
|
21417 | this.value = current.value;
|
21418 | this.setCheckedClasses();
|
21419 | }
|
21420 | setCheckedClasses() {
|
21421 | const buttons = this.getButtons();
|
21422 | const index = buttons.findIndex(button => button.value === this.value);
|
21423 | const next = index + 1;
|
21424 |
|
21425 | this.checked = buttons.find(button => button.value === this.value);
|
21426 | for (const button of buttons) {
|
21427 | button.classList.remove('segment-button-after-checked');
|
21428 | }
|
21429 | if (next < buttons.length) {
|
21430 | buttons[next].classList.add('segment-button-after-checked');
|
21431 | }
|
21432 | }
|
21433 | setNextIndex(detail, isEnd = false) {
|
21434 | const isRTL = document.dir === 'rtl';
|
21435 | const activated = this.activated;
|
21436 | const buttons = this.getButtons();
|
21437 | const index = buttons.findIndex(button => button.value === this.value);
|
21438 | const previous = buttons[index];
|
21439 | let current;
|
21440 | let nextIndex;
|
21441 | if (index === -1) {
|
21442 | return;
|
21443 | }
|
21444 |
|
21445 |
|
21446 | const rect = previous.getBoundingClientRect();
|
21447 | const left = rect.left;
|
21448 | const width = rect.width;
|
21449 |
|
21450 |
|
21451 |
|
21452 | const currentX = detail.currentX;
|
21453 | const previousY = rect.top + (rect.height / 2);
|
21454 | const nextEl = document.elementFromPoint(currentX, previousY);
|
21455 | const decreaseIndex = isRTL ? currentX > (left + width) : currentX < left;
|
21456 | const increaseIndex = isRTL ? currentX < left : currentX > (left + width);
|
21457 |
|
21458 |
|
21459 |
|
21460 | if (activated && !isEnd) {
|
21461 |
|
21462 | if (decreaseIndex) {
|
21463 | const newIndex = index - 1;
|
21464 | if (newIndex >= 0) {
|
21465 | nextIndex = newIndex;
|
21466 | }
|
21467 |
|
21468 | }
|
21469 | else if (increaseIndex) {
|
21470 | if (activated && !isEnd) {
|
21471 | const newIndex = index + 1;
|
21472 | if (newIndex < buttons.length) {
|
21473 | nextIndex = newIndex;
|
21474 | }
|
21475 | }
|
21476 | }
|
21477 | if (nextIndex !== undefined && !buttons[nextIndex].disabled) {
|
21478 | current = buttons[nextIndex];
|
21479 | }
|
21480 | }
|
21481 |
|
21482 |
|
21483 | if (!activated && isEnd) {
|
21484 | current = nextEl;
|
21485 | }
|
21486 |
|
21487 | if (current != null) {
|
21488 | |
21489 |
|
21490 |
|
21491 |
|
21492 |
|
21493 | if (current.tagName === 'ION-SEGMENT') {
|
21494 | return false;
|
21495 | }
|
21496 | if (previous !== current) {
|
21497 | this.checkButton(previous, current);
|
21498 | }
|
21499 | }
|
21500 | return true;
|
21501 | }
|
21502 | emitStyle() {
|
21503 | this.ionStyle.emit({
|
21504 | 'segment': true
|
21505 | });
|
21506 | }
|
21507 | render() {
|
21508 | const mode = getIonMode$1(this);
|
21509 | return (hAsync(Host, { role: "tablist", onClick: this.onClick, class: createColorClasses$1(this.color, {
|
21510 | [mode]: true,
|
21511 | 'in-toolbar': hostContext('ion-toolbar', this.el),
|
21512 | 'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
21513 | 'segment-activated': this.activated,
|
21514 | 'segment-disabled': this.disabled,
|
21515 | 'segment-scrollable': this.scrollable
|
21516 | }) }, hAsync("slot", null)));
|
21517 | }
|
21518 | get el() { return getElement(this); }
|
21519 | static get watchers() { return {
|
21520 | "color": ["colorChanged"],
|
21521 | "swipeGesture": ["swipeGestureChanged"],
|
21522 | "value": ["valueChanged"],
|
21523 | "disabled": ["disabledChanged"]
|
21524 | }; }
|
21525 | static get style() { return {
|
21526 | ios: segmentIosCss,
|
21527 | md: segmentMdCss
|
21528 | }; }
|
21529 | static get cmpMeta() { return {
|
21530 | "$flags$": 41,
|
21531 | "$tagName$": "ion-segment",
|
21532 | "$members$": {
|
21533 | "color": [513],
|
21534 | "disabled": [4],
|
21535 | "scrollable": [4],
|
21536 | "swipeGesture": [4, "swipe-gesture"],
|
21537 | "value": [1025],
|
21538 | "activated": [32]
|
21539 | },
|
21540 | "$listeners$": undefined,
|
21541 | "$lazyBundleId$": "-",
|
21542 | "$attrsToReflect$": [["color", "color"]]
|
21543 | }; }
|
21544 | }
|
21545 |
|
21546 | const segmentButtonIosCss = "/*!@:host*/.sc-ion-segment-button-ios-h{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none;cursor:pointer}/*!@.button-native*/.button-native.sc-ion-segment-button-ios{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-segment-button-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-segment-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-native::after*/.button-native.sc-ion-segment-button-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@.button-inner*/.button-inner.sc-ion-segment-button-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@:host(.segment-button-checked)*/.segment-button-checked.sc-ion-segment-button-ios-h{background:var(--background-checked);color:var(--color-checked)}/*!@:host(.segment-button-disabled)*/.segment-button-disabled.sc-ion-segment-button-ios-h{cursor:default;pointer-events:none}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@:host(:focus)*/.sc-ion-segment-button-ios-h:focus{outline:none}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}/*!@:host(.segment-button-checked:hover) .button-native*/.segment-button-checked.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios{color:var(--color-checked)}}/*!@::slotted(ion-icon)*/.sc-ion-segment-button-ios-s>ion-icon{-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:-1;order:-1;pointer-events:none}/*!@::slotted(ion-label)*/.sc-ion-segment-button-ios-s>ion-label{display:block;-ms-flex-item-align:center;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}/*!@:host(.segment-button-layout-icon-top) .button-native*/.segment-button-layout-icon-top.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios{-ms-flex-direction:column;flex-direction:column}/*!@:host(.segment-button-layout-icon-start) .button-native*/.segment-button-layout-icon-start.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios{-ms-flex-direction:row;flex-direction:row}/*!@:host(.segment-button-layout-icon-end) .button-native*/.segment-button-layout-icon-end.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios{-ms-flex-direction:row-reverse;flex-direction:row-reverse}/*!@:host(.segment-button-layout-icon-bottom) .button-native*/.segment-button-layout-icon-bottom.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios{-ms-flex-direction:column-reverse;flex-direction:column-reverse}/*!@:host(.segment-button-layout-icon-hide) ::slotted(ion-icon)*/.sc-ion-segment-button-ios-h.segment-button-layout-icon-hide .sc-ion-segment-button-ios-s>ion-icon{display:none}/*!@:host(.segment-button-layout-label-hide) ::slotted(ion-label)*/.sc-ion-segment-button-ios-h.segment-button-layout-label-hide .sc-ion-segment-button-ios-s>ion-label{display:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-segment-button-ios{color:var(--ripple-color, var(--color-checked))}/*!@.segment-button-indicator*/.segment-button-indicator.sc-ion-segment-button-ios{-webkit-transform-origin:left;transform-origin:left;position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-ios{width:100%;height:var(--indicator-height);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-box-shadow:var(--indicator-box-shadow);box-shadow:var(--indicator-box-shadow);pointer-events:none}/*!@.segment-button-indicator-animated*/.segment-button-indicator-animated.sc-ion-segment-button-ios{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}/*!@:host(.segment-button-checked) .segment-button-indicator*/.segment-button-checked.sc-ion-segment-button-ios-h .segment-button-indicator.sc-ion-segment-button-ios{opacity:1}@media (prefers-reduced-motion: reduce){/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-ios{-webkit-transform:none;transform:none}/*!@.segment-button-indicator-animated*/.segment-button-indicator-animated.sc-ion-segment-button-ios{-webkit-transition:none;transition:none}}/*!@:host*/.sc-ion-segment-button-ios-h{--background:none;--background-checked:none;--background-hover:none;--background-hover-opacity:0;--background-focused:none;--background-focused-opacity:0;--border-radius:7px;--border-width:1px;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--border-style:solid;--indicator-box-shadow:0 0 5px rgba(0, 0, 0, 0.16);--indicator-color:var(--ion-color-step-350, var(--ion-background-color, #fff));--indicator-height:100%;--indicator-transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--transition:100ms all linear;--padding-top:0;--padding-end:13px;--padding-bottom:0;--padding-start:13px;margin-top:2px;margin-bottom:2px;position:relative;-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-direction:row;flex-direction:row;min-width:70px;min-height:28px;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);font-size:13px;font-weight:450;line-height:37px}/*!@:host::before*/.sc-ion-segment-button-ios-h::before{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;-webkit-transition:160ms opacity ease-in-out;transition:160ms opacity ease-in-out;-webkit-transition-delay:100ms;transition-delay:100ms;border-left:var(--border-width) var(--border-style) var(--border-color);content:\"\";opacity:1;will-change:opacity}/*!@:host(:first-of-type)::before*/.sc-ion-segment-button-ios-h:first-of-type::before{border-left-color:transparent}/*!@:host(.segment-button-disabled)*/.segment-button-disabled.sc-ion-segment-button-ios-h{opacity:0.3}/*!@::slotted(ion-icon)*/.sc-ion-segment-button-ios-s>ion-icon{font-size:24px}/*!@:host(.segment-button-layout-icon-start) ::slotted(ion-label)*/.sc-ion-segment-button-ios-h.segment-button-layout-icon-start .sc-ion-segment-button-ios-s>ion-label{margin-left:2px;margin-right:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.segment-button-layout-icon-start) ::slotted(ion-label)*/.sc-ion-segment-button-ios-h.segment-button-layout-icon-start .sc-ion-segment-button-ios-s>ion-label{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:0;margin-inline-end:0}}/*!@:host(.segment-button-layout-icon-end) ::slotted(ion-label)*/.sc-ion-segment-button-ios-h.segment-button-layout-icon-end .sc-ion-segment-button-ios-s>ion-label{margin-left:0;margin-right:2px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.segment-button-layout-icon-end) ::slotted(ion-label)*/.sc-ion-segment-button-ios-h.segment-button-layout-icon-end .sc-ion-segment-button-ios-s>ion-label{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:2px;margin-inline-end:2px}}/*!@.segment-button-indicator*/.segment-button-indicator.sc-ion-segment-button-ios{padding-left:2px;padding-right:2px;left:0;right:0;top:0;bottom:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.segment-button-indicator*/.segment-button-indicator.sc-ion-segment-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px}}/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-ios{border-radius:var(--border-radius);background:var(--indicator-color)}/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-ios{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}/*!@:host(.segment-button-checked)::before,\n:host(.segment-button-after-checked)::before*/.segment-button-checked.sc-ion-segment-button-ios-h::before,.segment-button-after-checked.sc-ion-segment-button-ios-h::before{opacity:0}/*!@:host(.segment-button-checked)*/.segment-button-checked.sc-ion-segment-button-ios-h{z-index:-1}/*!@:host(.segment-button-activated)*/.segment-button-activated.sc-ion-segment-button-ios-h{--indicator-transform:scale(0.95)}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-segment-button-ios-h .button-native.sc-ion-segment-button-ios{opacity:0.7}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios{opacity:0.5}/*!@:host(.segment-button-checked:hover) .button-native*/.segment-button-checked.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios{opacity:1}}/*!@:host(.in-segment-color)*/.in-segment-color.sc-ion-segment-button-ios-h{background:none;color:var(--ion-text-color, #000)}/*!@:host(.in-segment-color) .segment-button-indicator-background*/.in-segment-color.sc-ion-segment-button-ios-h .segment-button-indicator-background.sc-ion-segment-button-ios{background:var(--ion-color-step-350, var(--ion-background-color, #fff))}@media (any-hover: hover){/*!@:host(.in-segment-color:hover) .button-native,\n:host(.in-segment-color.segment-button-checked:hover) .button-native*/.in-segment-color.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios,.in-segment-color.segment-button-checked.sc-ion-segment-button-ios-h:hover .button-native.sc-ion-segment-button-ios{color:var(--ion-text-color, #000)}}/*!@:host(.in-toolbar:not(.in-segment-color))*/.in-toolbar.sc-ion-segment-button-ios-h:not(.in-segment-color){--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, var(--ion-toolbar-color), initial);--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-toolbar-color), initial);--indicator-color:var(--ion-toolbar-segment-indicator-color, var(--ion-color-step-350, var(--ion-background-color, #fff)))}/*!@:host(.in-toolbar-color) .segment-button-indicator-background*/.in-toolbar-color.sc-ion-segment-button-ios-h .segment-button-indicator-background.sc-ion-segment-button-ios{background:#fff}/*!@:host(.in-toolbar-color:not(.in-segment-color)) .button-native*/.in-toolbar-color.sc-ion-segment-button-ios-h:not(.in-segment-color) .button-native.sc-ion-segment-button-ios{color:var(--ion-color-contrast)}/*!@:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native*/.in-toolbar-color.segment-button-checked.sc-ion-segment-button-ios-h:not(.in-segment-color) .button-native.sc-ion-segment-button-ios{color:var(--ion-color-base)}@media (any-hover: hover){/*!@:host(.in-toolbar-color:not(.in-segment-color):hover) .button-native*/.in-toolbar-color.sc-ion-segment-button-ios-h:not(.in-segment-color):hover .button-native.sc-ion-segment-button-ios{color:var(--ion-color-contrast)}/*!@:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native*/.in-toolbar-color.segment-button-checked.sc-ion-segment-button-ios-h:not(.in-segment-color):hover .button-native.sc-ion-segment-button-ios{color:var(--ion-color-base)}}";
|
21547 |
|
21548 | const segmentButtonMdCss = "/*!@:host*/.sc-ion-segment-button-md-h{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:-ms-flexbox;display:flex;position:relative;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-direction:column;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;-webkit-font-kerning:none;font-kerning:none;cursor:pointer}/*!@.button-native*/.button-native.sc-ion-segment-button-md{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-positive:1;flex-grow:1;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;-webkit-transition:var(--transition);transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-segment-button-md{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-segment-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-native::after*/.button-native.sc-ion-segment-button-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@.button-inner*/.button-inner.sc-ion-segment-button-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;z-index:1}/*!@:host(.segment-button-checked)*/.segment-button-checked.sc-ion-segment-button-md-h{background:var(--background-checked);color:var(--color-checked)}/*!@:host(.segment-button-disabled)*/.segment-button-disabled.sc-ion-segment-button-md-h{cursor:default;pointer-events:none}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}/*!@:host(:focus)*/.sc-ion-segment-button-md-h:focus{outline:none}@media (any-hover: hover){/*!@:host(:hover) .button-native*/.sc-ion-segment-button-md-h:hover .button-native.sc-ion-segment-button-md{color:var(--color-hover)}/*!@:host(:hover) .button-native::after*/.sc-ion-segment-button-md-h:hover .button-native.sc-ion-segment-button-md::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}/*!@:host(.segment-button-checked:hover) .button-native*/.segment-button-checked.sc-ion-segment-button-md-h:hover .button-native.sc-ion-segment-button-md{color:var(--color-checked)}}/*!@::slotted(ion-icon)*/.sc-ion-segment-button-md-s>ion-icon{-ms-flex-negative:0;flex-shrink:0;-ms-flex-order:-1;order:-1;pointer-events:none}/*!@::slotted(ion-label)*/.sc-ion-segment-button-md-s>ion-label{display:block;-ms-flex-item-align:center;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}/*!@:host(.segment-button-layout-icon-top) .button-native*/.segment-button-layout-icon-top.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md{-ms-flex-direction:column;flex-direction:column}/*!@:host(.segment-button-layout-icon-start) .button-native*/.segment-button-layout-icon-start.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md{-ms-flex-direction:row;flex-direction:row}/*!@:host(.segment-button-layout-icon-end) .button-native*/.segment-button-layout-icon-end.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md{-ms-flex-direction:row-reverse;flex-direction:row-reverse}/*!@:host(.segment-button-layout-icon-bottom) .button-native*/.segment-button-layout-icon-bottom.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md{-ms-flex-direction:column-reverse;flex-direction:column-reverse}/*!@:host(.segment-button-layout-icon-hide) ::slotted(ion-icon)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-hide .sc-ion-segment-button-md-s>ion-icon{display:none}/*!@:host(.segment-button-layout-label-hide) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-layout-label-hide .sc-ion-segment-button-md-s>ion-label{display:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-segment-button-md{color:var(--ripple-color, var(--color-checked))}/*!@.segment-button-indicator*/.segment-button-indicator.sc-ion-segment-button-md{-webkit-transform-origin:left;transform-origin:left;position:absolute;opacity:0;-webkit-box-sizing:border-box;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-md{width:100%;height:var(--indicator-height);-webkit-transform:var(--indicator-transform);transform:var(--indicator-transform);-webkit-box-shadow:var(--indicator-box-shadow);box-shadow:var(--indicator-box-shadow);pointer-events:none}/*!@.segment-button-indicator-animated*/.segment-button-indicator-animated.sc-ion-segment-button-md{-webkit-transition:var(--indicator-transition);transition:var(--indicator-transition)}/*!@:host(.segment-button-checked) .segment-button-indicator*/.segment-button-checked.sc-ion-segment-button-md-h .segment-button-indicator.sc-ion-segment-button-md{opacity:1}@media (prefers-reduced-motion: reduce){/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-md{-webkit-transform:none;transform:none}/*!@.segment-button-indicator-animated*/.segment-button-indicator-animated.sc-ion-segment-button-md{-webkit-transition:none;transition:none}}/*!@:host*/.sc-ion-segment-button-md-h{--background:none;--background-checked:none;--background-hover:var(--color-checked);--background-focused:var(--color-checked);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #3880ff);--indicator-box-shadow:none;--indicator-color:var(--color-checked);--indicator-height:2px;--indicator-transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--padding-top:0;--padding-end:16px;--padding-bottom:0;--padding-start:16px;--transition:color 0.15s linear 0s, opacity 0.15s linear 0s;min-width:90px;max-width:360px;min-height:48px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);font-size:14px;font-weight:500;letter-spacing:0.06em;line-height:40px;text-transform:uppercase}/*!@:host(.segment-button-disabled)*/.segment-button-disabled.sc-ion-segment-button-md-h{opacity:0.3}/*!@:host(.in-segment-color)*/.in-segment-color.sc-ion-segment-button-md-h{background:none;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}/*!@:host(.in-segment-color) ion-ripple-effect*/.in-segment-color.sc-ion-segment-button-md-h ion-ripple-effect.sc-ion-segment-button-md{color:var(--ion-color-base)}/*!@:host(.in-segment-color) .segment-button-indicator-background*/.in-segment-color.sc-ion-segment-button-md-h .segment-button-indicator-background.sc-ion-segment-button-md{background:var(--ion-color-base)}/*!@:host(.in-segment-color.segment-button-checked) .button-native*/.in-segment-color.segment-button-checked.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md{color:var(--ion-color-base)}/*!@:host(.in-segment-color.ion-focused) .button-native::after*/.in-segment-color.ion-focused.sc-ion-segment-button-md-h .button-native.sc-ion-segment-button-md::after{background:var(--ion-color-base)}@media (any-hover: hover){/*!@:host(.in-segment-color:hover) .button-native*/.in-segment-color.sc-ion-segment-button-md-h:hover .button-native.sc-ion-segment-button-md{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}/*!@:host(.in-segment-color:hover) .button-native::after*/.in-segment-color.sc-ion-segment-button-md-h:hover .button-native.sc-ion-segment-button-md::after{background:var(--ion-color-base)}/*!@:host(.in-segment-color.segment-button-checked:hover) .button-native*/.in-segment-color.segment-button-checked.sc-ion-segment-button-md-h:hover .button-native.sc-ion-segment-button-md{color:var(--ion-color-base)}}/*!@:host(.in-toolbar:not(.in-segment-color))*/.in-toolbar.sc-ion-segment-button-md-h:not(.in-segment-color){--background:var(--ion-toolbar-segment-background, none);--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6));--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-color-primary, #3880ff));--indicator-color:var(--ion-toolbar-segment-color-checked, var(--color-checked))}/*!@:host(.in-toolbar-color:not(.in-segment-color)) .button-native*/.in-toolbar-color.sc-ion-segment-button-md-h:not(.in-segment-color) .button-native.sc-ion-segment-button-md{color:rgba(var(--ion-color-contrast-rgb), 0.6)}/*!@:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native*/.in-toolbar-color.segment-button-checked.sc-ion-segment-button-md-h:not(.in-segment-color) .button-native.sc-ion-segment-button-md{color:var(--ion-color-contrast)}@media (any-hover: hover){/*!@:host(.in-toolbar-color:not(.in-segment-color)) .button-native::after*/.in-toolbar-color.sc-ion-segment-button-md-h:not(.in-segment-color) .button-native.sc-ion-segment-button-md::after{background:var(--ion-color-contrast)}}/*!@::slotted(ion-icon)*/.sc-ion-segment-button-md-s>ion-icon{margin-top:12px;margin-bottom:12px;font-size:24px}/*!@::slotted(ion-label)*/.sc-ion-segment-button-md-s>ion-label{margin-top:12px;margin-bottom:12px}/*!@:host(.segment-button-layout-icon-top) ::slotted(ion-label),\n:host(.segment-button-layout-icon-bottom) ::slotted(ion-icon)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-top .sc-ion-segment-button-md-s>ion-label,.sc-ion-segment-button-md-h.segment-button-layout-icon-bottom .sc-ion-segment-button-md-s>ion-icon{margin-top:0}/*!@:host(.segment-button-layout-icon-top) ::slotted(ion-icon),\n:host(.segment-button-layout-icon-bottom) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-top .sc-ion-segment-button-md-s>ion-icon,.sc-ion-segment-button-md-h.segment-button-layout-icon-bottom .sc-ion-segment-button-md-s>ion-label{margin-bottom:0}/*!@:host(.segment-button-layout-icon-start) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-start .sc-ion-segment-button-md-s>ion-label{margin-left:8px;margin-right:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.segment-button-layout-icon-start) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-start .sc-ion-segment-button-md-s>ion-label{margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:0;margin-inline-end:0}}/*!@:host(.segment-button-layout-icon-end) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-end .sc-ion-segment-button-md-s>ion-label{margin-left:0;margin-right:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.segment-button-layout-icon-end) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-layout-icon-end .sc-ion-segment-button-md-s>ion-label{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@:host(.segment-button-has-icon-only) ::slotted(ion-icon)*/.sc-ion-segment-button-md-h.segment-button-has-icon-only .sc-ion-segment-button-md-s>ion-icon{margin-top:12px;margin-bottom:12px}/*!@:host(.segment-button-has-label-only) ::slotted(ion-label)*/.sc-ion-segment-button-md-h.segment-button-has-label-only .sc-ion-segment-button-md-s>ion-label{margin-top:12px;margin-bottom:12px}/*!@.segment-button-indicator*/.segment-button-indicator.sc-ion-segment-button-md{left:0;right:0;bottom:0}/*!@.segment-button-indicator-background*/.segment-button-indicator-background.sc-ion-segment-button-md{background:var(--indicator-color)}/*!@:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background*/.in-toolbar.sc-ion-segment-button-md-h:not(.in-segment-color) .segment-button-indicator-background.sc-ion-segment-button-md{background:var(--ion-toolbar-segment-indicator-color, var(--indicator-color))}/*!@:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background*/.in-toolbar-color.sc-ion-segment-button-md-h:not(.in-segment-color) .segment-button-indicator-background.sc-ion-segment-button-md{background:var(--ion-color-contrast)}";
|
21549 |
|
21550 | let ids = 0;
|
21551 |
|
21552 |
|
21553 |
|
21554 |
|
21555 |
|
21556 |
|
21557 |
|
21558 | class SegmentButton {
|
21559 | constructor(hostRef) {
|
21560 | registerInstance(this, hostRef);
|
21561 | this.segmentEl = null;
|
21562 | this.checked = false;
|
21563 | |
21564 |
|
21565 |
|
21566 | this.disabled = false;
|
21567 | |
21568 |
|
21569 |
|
21570 | this.layout = 'icon-top';
|
21571 | |
21572 |
|
21573 |
|
21574 | this.type = 'button';
|
21575 | |
21576 |
|
21577 |
|
21578 | this.value = 'ion-sb-' + (ids++);
|
21579 | this.updateStyle = () => {
|
21580 | forceUpdate$1(this);
|
21581 | };
|
21582 | this.updateState = () => {
|
21583 | if (this.segmentEl) {
|
21584 | this.checked = this.segmentEl.value === this.value;
|
21585 | }
|
21586 | };
|
21587 | }
|
21588 | connectedCallback() {
|
21589 | const segmentEl = this.segmentEl = this.el.closest('ion-segment');
|
21590 | if (segmentEl) {
|
21591 | this.updateState();
|
21592 | addEventListener(segmentEl, 'ionSelect', this.updateState);
|
21593 | addEventListener(segmentEl, 'ionStyle', this.updateStyle);
|
21594 | }
|
21595 | }
|
21596 | disconnectedCallback() {
|
21597 | const segmentEl = this.segmentEl;
|
21598 | if (segmentEl) {
|
21599 | removeEventListener(segmentEl, 'ionSelect', this.updateState);
|
21600 | removeEventListener(segmentEl, 'ionStyle', this.updateStyle);
|
21601 | this.segmentEl = null;
|
21602 | }
|
21603 | }
|
21604 | get hasLabel() {
|
21605 | return !!this.el.querySelector('ion-label');
|
21606 | }
|
21607 | get hasIcon() {
|
21608 | return !!this.el.querySelector('ion-icon');
|
21609 | }
|
21610 | get tabIndex() {
|
21611 | if (this.disabled) {
|
21612 | return -1;
|
21613 | }
|
21614 | const hasTabIndex = this.el.hasAttribute('tabindex');
|
21615 | if (hasTabIndex) {
|
21616 | return this.el.getAttribute('tabindex');
|
21617 | }
|
21618 | return 0;
|
21619 | }
|
21620 | render() {
|
21621 | const { checked, type, disabled, hasIcon, hasLabel, layout, segmentEl, tabIndex } = this;
|
21622 | const mode = getIonMode$1(this);
|
21623 | const hasSegmentColor = () => segmentEl !== null && segmentEl.color !== undefined;
|
21624 | return (hAsync(Host, { role: "tab", "aria-selected": checked ? 'true' : 'false', "aria-disabled": disabled ? 'true' : null, tabIndex: tabIndex, class: {
|
21625 | [mode]: true,
|
21626 | 'in-toolbar': hostContext('ion-toolbar', this.el),
|
21627 | 'in-toolbar-color': hostContext('ion-toolbar[color]', this.el),
|
21628 | 'in-segment': hostContext('ion-segment', this.el),
|
21629 | 'in-segment-color': hasSegmentColor(),
|
21630 | 'segment-button-has-label': hasLabel,
|
21631 | 'segment-button-has-icon': hasIcon,
|
21632 | 'segment-button-has-label-only': hasLabel && !hasIcon,
|
21633 | 'segment-button-has-icon-only': hasIcon && !hasLabel,
|
21634 | 'segment-button-disabled': disabled,
|
21635 | 'segment-button-checked': checked,
|
21636 | [`segment-button-layout-${layout}`]: true,
|
21637 | 'ion-activatable': true,
|
21638 | 'ion-activatable-instant': true,
|
21639 | 'ion-focusable': true,
|
21640 | } }, hAsync("button", { type: type, tabIndex: -1, class: "button-native", part: "native", disabled: disabled }, hAsync("span", { class: "button-inner" }, hAsync("slot", null)), mode === 'md' && hAsync("ion-ripple-effect", null)), hAsync("div", { part: "indicator", class: {
|
21641 | 'segment-button-indicator': true,
|
21642 | 'segment-button-indicator-animated': true
|
21643 | } }, hAsync("div", { part: "indicator-background", class: "segment-button-indicator-background" }))));
|
21644 | }
|
21645 | get el() { return getElement(this); }
|
21646 | static get style() { return {
|
21647 | ios: segmentButtonIosCss,
|
21648 | md: segmentButtonMdCss
|
21649 | }; }
|
21650 | static get cmpMeta() { return {
|
21651 | "$flags$": 41,
|
21652 | "$tagName$": "ion-segment-button",
|
21653 | "$members$": {
|
21654 | "disabled": [4],
|
21655 | "layout": [1],
|
21656 | "type": [1],
|
21657 | "value": [1],
|
21658 | "checked": [32]
|
21659 | },
|
21660 | "$listeners$": undefined,
|
21661 | "$lazyBundleId$": "-",
|
21662 | "$attrsToReflect$": []
|
21663 | }; }
|
21664 | }
|
21665 |
|
21666 | const watchForOptions = (containerEl, tagName, onChange) => {
|
21667 |
|
21668 | if (typeof MutationObserver === 'undefined') {
|
21669 | return;
|
21670 | }
|
21671 | const mutation = new MutationObserver(mutationList => {
|
21672 | onChange(getSelectedOption(mutationList, tagName));
|
21673 | });
|
21674 | mutation.observe(containerEl, {
|
21675 | childList: true,
|
21676 | subtree: true
|
21677 | });
|
21678 | return mutation;
|
21679 | };
|
21680 | const getSelectedOption = (mutationList, tagName) => {
|
21681 | let newOption;
|
21682 | mutationList.forEach(mut => {
|
21683 |
|
21684 | for (let i = 0; i < mut.addedNodes.length; i++) {
|
21685 | newOption = findCheckedOption(mut.addedNodes[i], tagName) || newOption;
|
21686 | }
|
21687 | });
|
21688 | return newOption;
|
21689 | };
|
21690 | const findCheckedOption = (el, tagName) => {
|
21691 | if (el.nodeType !== 1) {
|
21692 | return undefined;
|
21693 | }
|
21694 | const options = (el.tagName === tagName.toUpperCase())
|
21695 | ? [el]
|
21696 | : Array.from(el.querySelectorAll(tagName));
|
21697 | return options.find((o) => o.value === el.value);
|
21698 | };
|
21699 |
|
21700 | const selectIosCss = "/*!@:host*/.sc-ion-select-ios-h{--placeholder-color:currentColor;--placeholder-opacity:0.33;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-select-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.in-item)*/.in-item.sc-ion-select-ios-h{position:static;max-width:45%}/*!@:host(.select-disabled)*/.select-disabled.sc-ion-select-ios-h{opacity:0.4;pointer-events:none}/*!@:host(.ion-focused) button*/.ion-focused.sc-ion-select-ios-h button.sc-ion-select-ios{border:2px solid #5e9ed6}/*!@.select-placeholder*/.select-placeholder.sc-ion-select-ios{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}/*!@label*/label.sc-ion-select-ios{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-select-ios label.sc-ion-select-ios,[dir=rtl].sc-ion-select-ios-h label.sc-ion-select-ios,[dir=rtl] .sc-ion-select-ios-h label.sc-ion-select-ios{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-select-ios::-moz-focus-inner{border:0}/*!@button*/button.sc-ion-select-ios{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@.select-icon*/.select-icon.sc-ion-select-ios{position:relative;opacity:0.33}/*!@.select-text*/.select-text.sc-ion-select-ios{-ms-flex:1;flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@.select-icon-inner*/.select-icon-inner.sc-ion-select-ios{left:5px;top:50%;margin-top:-2px;position:absolute;width:0;height:0;border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent;color:currentColor;pointer-events:none}/*!@[dir=rtl] .select-icon-inner, :host-context([dir=rtl]) .select-icon-inner*/[dir=rtl].sc-ion-select-ios .select-icon-inner.sc-ion-select-ios,[dir=rtl].sc-ion-select-ios-h .select-icon-inner.sc-ion-select-ios,[dir=rtl] .sc-ion-select-ios-h .select-icon-inner.sc-ion-select-ios{left:unset;right:unset;right:5px}/*!@:host*/.sc-ion-select-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:20px}/*!@.select-icon*/.select-icon.sc-ion-select-ios{width:12px;height:18px}";
|
21701 |
|
21702 | const selectMdCss = "/*!@:host*/.sc-ion-select-md-h{--placeholder-color:currentColor;--placeholder-opacity:0.33;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:2}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-select-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@:host(.in-item)*/.in-item.sc-ion-select-md-h{position:static;max-width:45%}/*!@:host(.select-disabled)*/.select-disabled.sc-ion-select-md-h{opacity:0.4;pointer-events:none}/*!@:host(.ion-focused) button*/.ion-focused.sc-ion-select-md-h button.sc-ion-select-md{border:2px solid #5e9ed6}/*!@.select-placeholder*/.select-placeholder.sc-ion-select-md{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}/*!@label*/label.sc-ion-select-md{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-select-md label.sc-ion-select-md,[dir=rtl].sc-ion-select-md-h label.sc-ion-select-md,[dir=rtl] .sc-ion-select-md-h label.sc-ion-select-md{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-select-md::-moz-focus-inner{border:0}/*!@button*/button.sc-ion-select-md{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@.select-icon*/.select-icon.sc-ion-select-md{position:relative;opacity:0.33}/*!@.select-text*/.select-text.sc-ion-select-md{-ms-flex:1;flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}/*!@.select-icon-inner*/.select-icon-inner.sc-ion-select-md{left:5px;top:50%;margin-top:-2px;position:absolute;width:0;height:0;border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent;color:currentColor;pointer-events:none}/*!@[dir=rtl] .select-icon-inner, :host-context([dir=rtl]) .select-icon-inner*/[dir=rtl].sc-ion-select-md .select-icon-inner.sc-ion-select-md,[dir=rtl].sc-ion-select-md-h .select-icon-inner.sc-ion-select-md,[dir=rtl] .sc-ion-select-md-h .select-icon-inner.sc-ion-select-md{left:unset;right:unset;right:5px}/*!@:host*/.sc-ion-select-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:10px;--padding-start:16px}/*!@.select-icon*/.select-icon.sc-ion-select-md{width:19px;height:19px}/*!@:host-context(.item-label-floating) .select-icon*/.item-label-floating.sc-ion-select-md-h .select-icon.sc-ion-select-md,.item-label-floating .sc-ion-select-md-h .select-icon.sc-ion-select-md{-webkit-transform:translate3d(0, -9px, 0);transform:translate3d(0, -9px, 0)}";
|
21703 |
|
21704 |
|
21705 |
|
21706 |
|
21707 |
|
21708 |
|
21709 |
|
21710 |
|
21711 | class Select {
|
21712 | constructor(hostRef) {
|
21713 | registerInstance(this, hostRef);
|
21714 | this.ionChange = createEvent(this, "ionChange", 7);
|
21715 | this.ionCancel = createEvent(this, "ionCancel", 7);
|
21716 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
21717 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
21718 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
21719 | this.inputId = `ion-sel-${selectIds++}`;
|
21720 | this.didInit = false;
|
21721 | this.isExpanded = false;
|
21722 | |
21723 |
|
21724 |
|
21725 | this.disabled = false;
|
21726 | |
21727 |
|
21728 |
|
21729 | this.cancelText = 'Cancel';
|
21730 | |
21731 |
|
21732 |
|
21733 | this.okText = 'OK';
|
21734 | |
21735 |
|
21736 |
|
21737 | this.name = this.inputId;
|
21738 | |
21739 |
|
21740 |
|
21741 | this.multiple = false;
|
21742 | |
21743 |
|
21744 |
|
21745 | this.interface = 'alert';
|
21746 | |
21747 |
|
21748 |
|
21749 |
|
21750 |
|
21751 |
|
21752 |
|
21753 |
|
21754 |
|
21755 | this.interfaceOptions = {};
|
21756 | this.onClick = (ev) => {
|
21757 | this.setFocus();
|
21758 | this.open(ev);
|
21759 | };
|
21760 | this.onFocus = () => {
|
21761 | this.ionFocus.emit();
|
21762 | };
|
21763 | this.onBlur = () => {
|
21764 | this.ionBlur.emit();
|
21765 | };
|
21766 | }
|
21767 | disabledChanged() {
|
21768 | this.emitStyle();
|
21769 | }
|
21770 | valueChanged() {
|
21771 | this.emitStyle();
|
21772 | if (this.didInit) {
|
21773 | this.ionChange.emit({
|
21774 | value: this.value,
|
21775 | });
|
21776 | }
|
21777 | }
|
21778 | async connectedCallback() {
|
21779 | this.updateOverlayOptions();
|
21780 | this.emitStyle();
|
21781 | this.mutationO = watchForOptions(this.el, 'ion-select-option', async () => {
|
21782 | this.updateOverlayOptions();
|
21783 | });
|
21784 | }
|
21785 | disconnectedCallback() {
|
21786 | if (this.mutationO) {
|
21787 | this.mutationO.disconnect();
|
21788 | this.mutationO = undefined;
|
21789 | }
|
21790 | }
|
21791 | componentDidLoad() {
|
21792 | this.didInit = true;
|
21793 | }
|
21794 | |
21795 |
|
21796 |
|
21797 |
|
21798 |
|
21799 |
|
21800 | async open(event) {
|
21801 | if (this.disabled || this.isExpanded) {
|
21802 | return undefined;
|
21803 | }
|
21804 | const overlay = this.overlay = await this.createOverlay(event);
|
21805 | this.isExpanded = true;
|
21806 | overlay.onDidDismiss().then(() => {
|
21807 | this.overlay = undefined;
|
21808 | this.isExpanded = false;
|
21809 | this.setFocus();
|
21810 | });
|
21811 | await overlay.present();
|
21812 | return overlay;
|
21813 | }
|
21814 | createOverlay(ev) {
|
21815 | let selectInterface = this.interface;
|
21816 | if ((selectInterface === 'action-sheet' || selectInterface === 'popover') && this.multiple) {
|
21817 | console.warn(`Select interface cannot be "${selectInterface}" with a multi-value select. Using the "alert" interface instead.`);
|
21818 | selectInterface = 'alert';
|
21819 | }
|
21820 | if (selectInterface === 'popover' && !ev) {
|
21821 | console.warn('Select interface cannot be a "popover" without passing an event. Using the "alert" interface instead.');
|
21822 | selectInterface = 'alert';
|
21823 | }
|
21824 | if (selectInterface === 'popover') {
|
21825 | return this.openPopover(ev);
|
21826 | }
|
21827 | if (selectInterface === 'action-sheet') {
|
21828 | return this.openActionSheet();
|
21829 | }
|
21830 | return this.openAlert();
|
21831 | }
|
21832 | updateOverlayOptions() {
|
21833 | const overlay = this.overlay;
|
21834 | if (!overlay) {
|
21835 | return;
|
21836 | }
|
21837 | const childOpts = this.childOpts;
|
21838 | const value = this.value;
|
21839 | switch (this.interface) {
|
21840 | case 'action-sheet':
|
21841 | overlay.buttons = this.createActionSheetButtons(childOpts, value);
|
21842 | break;
|
21843 | case 'popover':
|
21844 | const popover = overlay.querySelector('ion-select-popover');
|
21845 | if (popover) {
|
21846 | popover.options = this.createPopoverOptions(childOpts, value);
|
21847 | }
|
21848 | break;
|
21849 | case 'alert':
|
21850 | const inputType = (this.multiple ? 'checkbox' : 'radio');
|
21851 | overlay.inputs = this.createAlertInputs(childOpts, inputType, value);
|
21852 | break;
|
21853 | }
|
21854 | }
|
21855 | createActionSheetButtons(data, selectValue) {
|
21856 | const actionSheetButtons = data.map(option => {
|
21857 | const value = getOptionValue(option);
|
21858 |
|
21859 | const copyClasses = Array.from(option.classList).filter(cls => cls !== 'hydrated').join(' ');
|
21860 | const optClass = `${OPTION_CLASS} ${copyClasses}`;
|
21861 | return {
|
21862 | role: (isOptionSelected(value, selectValue, this.compareWith) ? 'selected' : ''),
|
21863 | text: option.textContent,
|
21864 | cssClass: optClass,
|
21865 | handler: () => {
|
21866 | this.value = value;
|
21867 | }
|
21868 | };
|
21869 | });
|
21870 |
|
21871 | actionSheetButtons.push({
|
21872 | text: this.cancelText,
|
21873 | role: 'cancel',
|
21874 | handler: () => {
|
21875 | this.ionCancel.emit();
|
21876 | }
|
21877 | });
|
21878 | return actionSheetButtons;
|
21879 | }
|
21880 | createAlertInputs(data, inputType, selectValue) {
|
21881 | const alertInputs = data.map(option => {
|
21882 | const value = getOptionValue(option);
|
21883 |
|
21884 | const copyClasses = Array.from(option.classList).filter(cls => cls !== 'hydrated').join(' ');
|
21885 | const optClass = `${OPTION_CLASS} ${copyClasses}`;
|
21886 | return {
|
21887 | type: inputType,
|
21888 | cssClass: optClass,
|
21889 | label: option.textContent || '',
|
21890 | value,
|
21891 | checked: isOptionSelected(value, selectValue, this.compareWith),
|
21892 | disabled: option.disabled
|
21893 | };
|
21894 | });
|
21895 | return alertInputs;
|
21896 | }
|
21897 | createPopoverOptions(data, selectValue) {
|
21898 | const popoverOptions = data.map(option => {
|
21899 | const value = getOptionValue(option);
|
21900 |
|
21901 | const copyClasses = Array.from(option.classList).filter(cls => cls !== 'hydrated').join(' ');
|
21902 | const optClass = `${OPTION_CLASS} ${copyClasses}`;
|
21903 | return {
|
21904 | text: option.textContent || '',
|
21905 | cssClass: optClass,
|
21906 | value,
|
21907 | checked: isOptionSelected(value, selectValue, this.compareWith),
|
21908 | disabled: option.disabled,
|
21909 | handler: () => {
|
21910 | this.value = value;
|
21911 | this.close();
|
21912 | }
|
21913 | };
|
21914 | });
|
21915 | return popoverOptions;
|
21916 | }
|
21917 | async openPopover(ev) {
|
21918 | const interfaceOptions = this.interfaceOptions;
|
21919 | const mode = getIonMode$1(this);
|
21920 | const value = this.value;
|
21921 | const popoverOpts = Object.assign(Object.assign({ mode }, interfaceOptions), { component: 'ion-select-popover', cssClass: ['select-popover', interfaceOptions.cssClass], event: ev, componentProps: {
|
21922 | header: interfaceOptions.header,
|
21923 | subHeader: interfaceOptions.subHeader,
|
21924 | message: interfaceOptions.message,
|
21925 | value,
|
21926 | options: this.createPopoverOptions(this.childOpts, value)
|
21927 | } });
|
21928 | return popoverController.create(popoverOpts);
|
21929 | }
|
21930 | async openActionSheet() {
|
21931 | const mode = getIonMode$1(this);
|
21932 | const interfaceOptions = this.interfaceOptions;
|
21933 | const actionSheetOpts = Object.assign(Object.assign({ mode }, interfaceOptions), { buttons: this.createActionSheetButtons(this.childOpts, this.value), cssClass: ['select-action-sheet', interfaceOptions.cssClass] });
|
21934 | return actionSheetController.create(actionSheetOpts);
|
21935 | }
|
21936 | async openAlert() {
|
21937 | const label = this.getLabel();
|
21938 | const labelText = (label) ? label.textContent : null;
|
21939 | const interfaceOptions = this.interfaceOptions;
|
21940 | const inputType = (this.multiple ? 'checkbox' : 'radio');
|
21941 | const mode = getIonMode$1(this);
|
21942 | const alertOpts = Object.assign(Object.assign({ mode }, interfaceOptions), { header: interfaceOptions.header ? interfaceOptions.header : labelText, inputs: this.createAlertInputs(this.childOpts, inputType, this.value), buttons: [
|
21943 | {
|
21944 | text: this.cancelText,
|
21945 | role: 'cancel',
|
21946 | handler: () => {
|
21947 | this.ionCancel.emit();
|
21948 | }
|
21949 | },
|
21950 | {
|
21951 | text: this.okText,
|
21952 | handler: (selectedValues) => {
|
21953 | this.value = selectedValues;
|
21954 | }
|
21955 | }
|
21956 | ], cssClass: ['select-alert', interfaceOptions.cssClass,
|
21957 | (this.multiple ? 'multiple-select-alert' : 'single-select-alert')] });
|
21958 | return alertController.create(alertOpts);
|
21959 | }
|
21960 | |
21961 |
|
21962 |
|
21963 | close() {
|
21964 |
|
21965 | if (!this.overlay) {
|
21966 | return Promise.resolve(false);
|
21967 | }
|
21968 | return this.overlay.dismiss();
|
21969 | }
|
21970 | getLabel() {
|
21971 | return findItemLabel(this.el);
|
21972 | }
|
21973 | hasValue() {
|
21974 | return this.getText() !== '';
|
21975 | }
|
21976 | get childOpts() {
|
21977 | return Array.from(this.el.querySelectorAll('ion-select-option'));
|
21978 | }
|
21979 | getText() {
|
21980 | const selectedText = this.selectedText;
|
21981 | if (selectedText != null && selectedText !== '') {
|
21982 | return selectedText;
|
21983 | }
|
21984 | return generateText(this.childOpts, this.value, this.compareWith);
|
21985 | }
|
21986 | setFocus() {
|
21987 | if (this.focusEl) {
|
21988 | this.focusEl.focus();
|
21989 | }
|
21990 | }
|
21991 | emitStyle() {
|
21992 | this.ionStyle.emit({
|
21993 | 'interactive': true,
|
21994 | 'select': true,
|
21995 | 'has-placeholder': this.placeholder != null,
|
21996 | 'has-value': this.hasValue(),
|
21997 | 'interactive-disabled': this.disabled,
|
21998 | 'select-disabled': this.disabled
|
21999 | });
|
22000 | }
|
22001 | render() {
|
22002 | const { disabled, el, inputId, isExpanded, name, placeholder, value } = this;
|
22003 | const mode = getIonMode$1(this);
|
22004 | const { labelText, labelId } = getAriaLabel(el, inputId);
|
22005 | renderHiddenInput(true, el, name, parseValue(value), disabled);
|
22006 | const displayValue = this.getText();
|
22007 | let addPlaceholderClass = false;
|
22008 | let selectText = displayValue;
|
22009 | if (selectText === '' && placeholder != null) {
|
22010 | selectText = placeholder;
|
22011 | addPlaceholderClass = true;
|
22012 | }
|
22013 | const selectTextClasses = {
|
22014 | 'select-text': true,
|
22015 | 'select-placeholder': addPlaceholderClass
|
22016 | };
|
22017 | const textPart = addPlaceholderClass ? 'placeholder' : 'text';
|
22018 |
|
22019 |
|
22020 |
|
22021 |
|
22022 | const displayLabel = labelText !== undefined
|
22023 | ? (selectText !== '' ? `${selectText}, ${labelText}` : labelText)
|
22024 | : selectText;
|
22025 | return (hAsync(Host, { onClick: this.onClick, role: "button", "aria-haspopup": "listbox", "aria-disabled": disabled ? 'true' : null, "aria-label": displayLabel, class: {
|
22026 | [mode]: true,
|
22027 | 'in-item': hostContext('ion-item', el),
|
22028 | 'select-disabled': disabled,
|
22029 | 'select-expanded': isExpanded
|
22030 | } }, hAsync("div", { "aria-hidden": "true", class: selectTextClasses, part: textPart }, selectText), hAsync("div", { class: "select-icon", role: "presentation", part: "icon" }, hAsync("div", { class: "select-icon-inner" })), hAsync("label", { id: labelId }, displayLabel), hAsync("button", { type: "button", disabled: disabled, id: inputId, "aria-labelledby": labelId, "aria-haspopup": "listbox", "aria-expanded": `${isExpanded}`, onFocus: this.onFocus, onBlur: this.onBlur, ref: (focusEl => this.focusEl = focusEl) })));
|
22031 | }
|
22032 | get el() { return getElement(this); }
|
22033 | static get watchers() { return {
|
22034 | "disabled": ["disabledChanged"],
|
22035 | "placeholder": ["disabledChanged"],
|
22036 | "value": ["valueChanged"]
|
22037 | }; }
|
22038 | static get style() { return {
|
22039 | ios: selectIosCss,
|
22040 | md: selectMdCss
|
22041 | }; }
|
22042 | static get cmpMeta() { return {
|
22043 | "$flags$": 41,
|
22044 | "$tagName$": "ion-select",
|
22045 | "$members$": {
|
22046 | "disabled": [4],
|
22047 | "cancelText": [1, "cancel-text"],
|
22048 | "okText": [1, "ok-text"],
|
22049 | "placeholder": [1],
|
22050 | "name": [1],
|
22051 | "selectedText": [1, "selected-text"],
|
22052 | "multiple": [4],
|
22053 | "interface": [1],
|
22054 | "interfaceOptions": [8, "interface-options"],
|
22055 | "compareWith": [1, "compare-with"],
|
22056 | "value": [1032],
|
22057 | "isExpanded": [32],
|
22058 | "open": [64]
|
22059 | },
|
22060 | "$listeners$": undefined,
|
22061 | "$lazyBundleId$": "-",
|
22062 | "$attrsToReflect$": []
|
22063 | }; }
|
22064 | }
|
22065 | const isOptionSelected = (currentValue, compareValue, compareWith) => {
|
22066 | if (currentValue === undefined) {
|
22067 | return false;
|
22068 | }
|
22069 | if (Array.isArray(currentValue)) {
|
22070 | return currentValue.some(val => compareOptions(val, compareValue, compareWith));
|
22071 | }
|
22072 | else {
|
22073 | return compareOptions(currentValue, compareValue, compareWith);
|
22074 | }
|
22075 | };
|
22076 | const getOptionValue = (el) => {
|
22077 | const value = el.value;
|
22078 | return (value === undefined)
|
22079 | ? el.textContent || ''
|
22080 | : value;
|
22081 | };
|
22082 | const parseValue = (value) => {
|
22083 | if (value == null) {
|
22084 | return undefined;
|
22085 | }
|
22086 | if (Array.isArray(value)) {
|
22087 | return value.join(',');
|
22088 | }
|
22089 | return value.toString();
|
22090 | };
|
22091 | const compareOptions = (currentValue, compareValue, compareWith) => {
|
22092 | if (typeof compareWith === 'function') {
|
22093 | return compareWith(currentValue, compareValue);
|
22094 | }
|
22095 | else if (typeof compareWith === 'string') {
|
22096 | return currentValue[compareWith] === compareValue[compareWith];
|
22097 | }
|
22098 | else {
|
22099 | return Array.isArray(compareValue) ? compareValue.includes(currentValue) : currentValue === compareValue;
|
22100 | }
|
22101 | };
|
22102 | const generateText = (opts, value, compareWith) => {
|
22103 | if (value === undefined) {
|
22104 | return '';
|
22105 | }
|
22106 | if (Array.isArray(value)) {
|
22107 | return value
|
22108 | .map(v => textForValue(opts, v, compareWith))
|
22109 | .filter(opt => opt !== null)
|
22110 | .join(', ');
|
22111 | }
|
22112 | else {
|
22113 | return textForValue(opts, value, compareWith) || '';
|
22114 | }
|
22115 | };
|
22116 | const textForValue = (opts, value, compareWith) => {
|
22117 | const selectOpt = opts.find(opt => {
|
22118 | return compareOptions(getOptionValue(opt), value, compareWith);
|
22119 | });
|
22120 | return selectOpt
|
22121 | ? selectOpt.textContent
|
22122 | : null;
|
22123 | };
|
22124 | let selectIds = 0;
|
22125 | const OPTION_CLASS = 'select-interface-option';
|
22126 |
|
22127 | const selectOptionCss = "/*!@:host*/.sc-ion-select-option-h{display:none}";
|
22128 |
|
22129 | class SelectOption {
|
22130 | constructor(hostRef) {
|
22131 | registerInstance(this, hostRef);
|
22132 | this.inputId = `ion-selopt-${selectOptionIds++}`;
|
22133 | |
22134 |
|
22135 |
|
22136 | this.disabled = false;
|
22137 | }
|
22138 | render() {
|
22139 | return (hAsync(Host, { role: "option", id: this.inputId, class: getIonMode$1(this) }));
|
22140 | }
|
22141 | get el() { return getElement(this); }
|
22142 | static get style() { return selectOptionCss; }
|
22143 | static get cmpMeta() { return {
|
22144 | "$flags$": 9,
|
22145 | "$tagName$": "ion-select-option",
|
22146 | "$members$": {
|
22147 | "disabled": [4],
|
22148 | "value": [8]
|
22149 | },
|
22150 | "$listeners$": undefined,
|
22151 | "$lazyBundleId$": "-",
|
22152 | "$attrsToReflect$": []
|
22153 | }; }
|
22154 | }
|
22155 | let selectOptionIds = 0;
|
22156 |
|
22157 | const selectPopoverCss = ".sc-ion-select-popover-h ion-list.sc-ion-select-popover{margin-left:0;margin-right:0;margin-top:-1px;margin-bottom:-1px}.sc-ion-select-popover-h ion-list-header.sc-ion-select-popover,.sc-ion-select-popover-h ion-label.sc-ion-select-popover{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
22158 |
|
22159 |
|
22160 |
|
22161 |
|
22162 | class SelectPopover {
|
22163 | constructor(hostRef) {
|
22164 | registerInstance(this, hostRef);
|
22165 |
|
22166 | this.options = [];
|
22167 | }
|
22168 | onSelect(ev) {
|
22169 | const option = this.options.find(o => o.value === ev.target.value);
|
22170 | if (option) {
|
22171 | safeCall(option.handler);
|
22172 | }
|
22173 | }
|
22174 | render() {
|
22175 | const checkedOption = this.options.find(o => o.checked);
|
22176 | const checkedValue = checkedOption ? checkedOption.value : undefined;
|
22177 | return (hAsync(Host, { class: getIonMode$1(this) }, hAsync("ion-list", null, this.header !== undefined && hAsync("ion-list-header", null, this.header), (this.subHeader !== undefined || this.message !== undefined) &&
|
22178 | hAsync("ion-item", null, hAsync("ion-label", { class: "ion-text-wrap" }, this.subHeader !== undefined && hAsync("h3", null, this.subHeader), this.message !== undefined && hAsync("p", null, this.message))), hAsync("ion-radio-group", { value: checkedValue }, this.options.map(option => hAsync("ion-item", { class: getClassMap(option.cssClass) }, hAsync("ion-label", null, option.text), hAsync("ion-radio", { value: option.value, disabled: option.disabled })))))));
|
22179 | }
|
22180 | static get style() { return selectPopoverCss; }
|
22181 | static get cmpMeta() { return {
|
22182 | "$flags$": 2,
|
22183 | "$tagName$": "ion-select-popover",
|
22184 | "$members$": {
|
22185 | "header": [1],
|
22186 | "subHeader": [1, "sub-header"],
|
22187 | "message": [1],
|
22188 | "options": [16]
|
22189 | },
|
22190 | "$listeners$": [[0, "ionChange", "onSelect"]],
|
22191 | "$lazyBundleId$": "-",
|
22192 | "$attrsToReflect$": []
|
22193 | }; }
|
22194 | }
|
22195 |
|
22196 | const skeletonTextCss = "/*!@:host*/.sc-ion-skeleton-text-h{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;pointer-events:none}/*!@span*/span.sc-ion-skeleton-text{display:inline-block}/*!@:host(.in-media)*/.in-media.sc-ion-skeleton-text-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}/*!@:host(.skeleton-text-animated)*/.skeleton-text-animated.sc-ion-skeleton-text-h{position:relative;background:-webkit-gradient(linear, left top, right top, color-stop(8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065)), color-stop(18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135)), color-stop(33%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065)));background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-name:shimmer;animation-name:shimmer;-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}@keyframes shimmer{0%{background-position:-400px 0}100%{background-position:400px 0}}";
|
22197 |
|
22198 | class SkeletonText {
|
22199 | constructor(hostRef) {
|
22200 | registerInstance(this, hostRef);
|
22201 | |
22202 |
|
22203 |
|
22204 | this.animated = false;
|
22205 | }
|
22206 | render() {
|
22207 | const animated = this.animated && config.getBoolean('animated', true);
|
22208 | const inMedia = hostContext('ion-avatar', this.el) || hostContext('ion-thumbnail', this.el);
|
22209 | const mode = getIonMode$1(this);
|
22210 | return (hAsync(Host, { class: {
|
22211 | [mode]: true,
|
22212 | 'skeleton-text-animated': animated,
|
22213 | 'in-media': inMedia
|
22214 | } }, hAsync("span", null, "\u00A0")));
|
22215 | }
|
22216 | get el() { return getElement(this); }
|
22217 | static get style() { return skeletonTextCss; }
|
22218 | static get cmpMeta() { return {
|
22219 | "$flags$": 9,
|
22220 | "$tagName$": "ion-skeleton-text",
|
22221 | "$members$": {
|
22222 | "animated": [4]
|
22223 | },
|
22224 | "$listeners$": undefined,
|
22225 | "$lazyBundleId$": "-",
|
22226 | "$attrsToReflect$": []
|
22227 | }; }
|
22228 | }
|
22229 |
|
22230 | const slideCss = "ion-slide{display:block;width:100%;height:100%}.slide-zoom{display:block;width:100%;text-align:center}.swiper-slide{display:-ms-flexbox;display:flex;position:relative;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%;font-size:18px;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box}.swiper-slide img{width:auto;max-width:100%;height:auto;max-height:100%}";
|
22231 |
|
22232 | class Slide {
|
22233 | constructor(hostRef) {
|
22234 | registerInstance(this, hostRef);
|
22235 | }
|
22236 | render() {
|
22237 | const mode = getIonMode$1(this);
|
22238 | return (hAsync(Host, { class: {
|
22239 | [mode]: true,
|
22240 | 'swiper-slide': true,
|
22241 | 'swiper-zoom-container': true
|
22242 | } }));
|
22243 | }
|
22244 | static get style() { return slideCss; }
|
22245 | static get cmpMeta() { return {
|
22246 | "$flags$": 0,
|
22247 | "$tagName$": "ion-slide",
|
22248 | "$members$": undefined,
|
22249 | "$listeners$": undefined,
|
22250 | "$lazyBundleId$": "-",
|
22251 | "$attrsToReflect$": []
|
22252 | }; }
|
22253 | }
|
22254 |
|
22255 | const slidesIosCss = ".swiper-container{margin:0 auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-container-no-flexbox .swiper-slide{float:left}.swiper-container-vertical{height:100%}.swiper-container-vertical>.swiper-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;-o-transition-property:transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-container-multirow>.swiper-wrapper{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-slide{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;-o-transition-property:transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-invisible-blank-slide{visibility:hidden}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;-o-transition-property:transform, height;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-container-3d{-webkit-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-wrapper,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-cube-shadow{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-wp8-horizontal,.swiper-container-wp8-horizontal>.swiper-wrapper{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-container-wp8-vertical,.swiper-container-wp8-vertical>.swiper-wrapper{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-button-prev,.swiper-button-next{position:absolute;top:50%;width:27px;height:44px;margin-top:-22px;z-index:10;cursor:pointer;background-size:27px 44px;background-position:center;background-repeat:no-repeat}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\");left:10px;right:auto}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\");right:10px;left:auto}.swiper-button-prev.swiper-button-white,.swiper-container-rtl .swiper-button-next.swiper-button-white{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-next.swiper-button-white,.swiper-container-rtl .swiper-button-prev.swiper-button-white{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-prev.swiper-button-black,.swiper-container-rtl .swiper-button-next.swiper-button-black{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-next.swiper-button-black,.swiper-container-rtl .swiper-button-prev.swiper-button-black{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-lock{display:none}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:300ms opacity;-o-transition:300ms opacity;transition:300ms opacity;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-container-horizontal>.swiper-pagination-bullets{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(0.66);-ms-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(0.66);-ms-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:0.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet-active{opacity:1;background:#007aff}.swiper-container-vertical>.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0px, -50%, 0);transform:translate3d(0px, -50%, 0)}.swiper-container-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:6px 0;display:block}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:8px}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:200ms top, 200ms -webkit-transform;transition:200ms top, 200ms -webkit-transform;-o-transition:200ms transform, 200ms top;transition:200ms transform, 200ms top;transition:200ms transform, 200ms top, 200ms -webkit-transform}.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 4px}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);white-space:nowrap}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms left, 200ms -webkit-transform;transition:200ms left, 200ms -webkit-transform;-o-transition:200ms transform, 200ms left;transition:200ms transform, 200ms left;transition:200ms transform, 200ms left, 200ms -webkit-transform}.swiper-container-horizontal.swiper-container-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms right, 200ms -webkit-transform;transition:200ms right, 200ms -webkit-transform;-o-transition:200ms transform, 200ms right;transition:200ms transform, 200ms right;transition:200ms transform, 200ms right, 200ms -webkit-transform}.swiper-pagination-progressbar{background:rgba(0, 0, 0, 0.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:#007aff;position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top}.swiper-container-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.swiper-container-horizontal>.swiper-pagination-progressbar,.swiper-container-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-container-vertical>.swiper-pagination-progressbar,.swiper-container-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:4px;height:100%;left:0;top:0}.swiper-pagination-white .swiper-pagination-bullet-active{background:#ffffff}.swiper-pagination-progressbar.swiper-pagination-white{background:rgba(255, 255, 255, 0.25)}.swiper-pagination-progressbar.swiper-pagination-white .swiper-pagination-progressbar-fill{background:#ffffff}.swiper-pagination-black .swiper-pagination-bullet-active{background:#000000}.swiper-pagination-progressbar.swiper-pagination-black{background:rgba(0, 0, 0, 0.25)}.swiper-pagination-progressbar.swiper-pagination-black .swiper-pagination-progressbar-fill{background:#000000}.swiper-pagination-lock{display:none}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0, 0, 0, 0.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0, 0, 0, 0.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;text-align:center}.swiper-zoom-container>img,.swiper-zoom-container>svg,.swiper-zoom-container>canvas{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}.swiper-slide-zoomed{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;-ms-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12, end) infinite;animation:swiper-preloader-spin 1s steps(12, end) infinite}.swiper-lazy-preloader:after{display:block;content:\"\";width:100%;height:100%;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\");background-position:50%;background-size:100%;background-repeat:no-repeat}.swiper-lazy-preloader-white:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\")}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-container-fade.swiper-container-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube{overflow:visible}.swiper-container-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;width:100%;height:100%}.swiper-container-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-cube.swiper-container-rtl .swiper-slide{-webkit-transform-origin:100% 0;-ms-transform-origin:100% 0;transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-prev,.swiper-container-cube .swiper-slide-next+.swiper-slide{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-slide-shadow-top,.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;background:#000;opacity:0.6;-webkit-filter:blur(50px);filter:blur(50px);z-index:0}.swiper-container-flip{overflow:visible}.swiper-container-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-container-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-flip .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-flip .swiper-slide-shadow-top,.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-right{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-coverflow .swiper-wrapper{-ms-perspective:1200px}ion-slides{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swiper-pagination-bullet{background:var(--bullet-background)}.swiper-pagination-bullet-active{background:var(--bullet-background-active)}.swiper-pagination-progressbar{background:var(--progress-bar-background)}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--progress-bar-background-active)}.swiper-scrollbar{background:var(--scroll-bar-background)}.swiper-scrollbar-drag{background:var(--scroll-bar-background-active)}.slides-ios{--bullet-background:var(--ion-color-step-200, #cccccc);--bullet-background-active:var(--ion-color-primary, #3880ff);--progress-bar-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.25);--progress-bar-background-active:var(--ion-color-primary-shade, #3171e0);--scroll-bar-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1);--scroll-bar-background-active:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.5)}";
|
22256 |
|
22257 | const slidesMdCss = ".swiper-container{margin:0 auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1}.swiper-container-no-flexbox .swiper-slide{float:left}.swiper-container-vertical{height:100%}.swiper-container-vertical>.swiper-wrapper{-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;-o-transition-property:transform;transition-property:transform;transition-property:transform, -webkit-transform;-webkit-box-sizing:content-box;box-sizing:content-box}.swiper-container-android .swiper-slide,.swiper-wrapper{-webkit-transform:translate3d(0px, 0, 0);transform:translate3d(0px, 0, 0)}.swiper-container-multirow>.swiper-wrapper{-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap}.swiper-container-free-mode>.swiper-wrapper{-webkit-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out;margin:0 auto}.swiper-slide{-webkit-flex-shrink:0;-ms-flex-negative:0;flex-shrink:0;width:100%;height:100%;position:relative;-webkit-transition-property:-webkit-transform;transition-property:-webkit-transform;-o-transition-property:transform;transition-property:transform;transition-property:transform, -webkit-transform}.swiper-invisible-blank-slide{visibility:hidden}.swiper-container-autoheight,.swiper-container-autoheight .swiper-slide{height:auto}.swiper-container-autoheight .swiper-wrapper{-webkit-box-align:start;-webkit-align-items:flex-start;-ms-flex-align:start;align-items:flex-start;-webkit-transition-property:height, -webkit-transform;transition-property:height, -webkit-transform;-o-transition-property:transform, height;transition-property:transform, height;transition-property:transform, height, -webkit-transform}.swiper-container-3d{-webkit-perspective:1200px;perspective:1200px}.swiper-container-3d .swiper-wrapper,.swiper-container-3d .swiper-slide,.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-slide-shadow-bottom,.swiper-container-3d .swiper-cube-shadow{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.swiper-container-3d .swiper-slide-shadow-left,.swiper-container-3d .swiper-slide-shadow-right,.swiper-container-3d .swiper-slide-shadow-top,.swiper-container-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-container-3d .swiper-slide-shadow-left{background-image:-webkit-gradient(linear, right top, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-3d .swiper-slide-shadow-right{background-image:-webkit-gradient(linear, left top, right top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(left, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to right, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-3d .swiper-slide-shadow-top{background-image:-webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-3d .swiper-slide-shadow-bottom{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0)));background-image:-webkit-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:-o-linear-gradient(top, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));background-image:linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0))}.swiper-container-wp8-horizontal,.swiper-container-wp8-horizontal>.swiper-wrapper{-ms-touch-action:pan-y;touch-action:pan-y}.swiper-container-wp8-vertical,.swiper-container-wp8-vertical>.swiper-wrapper{-ms-touch-action:pan-x;touch-action:pan-x}.swiper-button-prev,.swiper-button-next{position:absolute;top:50%;width:27px;height:44px;margin-top:-22px;z-index:10;cursor:pointer;background-size:27px 44px;background-position:center;background-repeat:no-repeat}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:0.35;cursor:auto;pointer-events:none}.swiper-button-prev,.swiper-container-rtl .swiper-button-next{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\");left:10px;right:auto}.swiper-button-next,.swiper-container-rtl .swiper-button-prev{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23007aff'%2F%3E%3C%2Fsvg%3E\");right:10px;left:auto}.swiper-button-prev.swiper-button-white,.swiper-container-rtl .swiper-button-next.swiper-button-white{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-next.swiper-button-white,.swiper-container-rtl .swiper-button-prev.swiper-button-white{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23ffffff'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-prev.swiper-button-black,.swiper-container-rtl .swiper-button-next.swiper-button-black{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M0%2C22L22%2C0l2.1%2C2.1L4.2%2C22l19.9%2C19.9L22%2C44L0%2C22L0%2C22L0%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-next.swiper-button-black,.swiper-container-rtl .swiper-button-prev.swiper-button-black{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2027%2044'%3E%3Cpath%20d%3D'M27%2C22L27%2C22L5%2C44l-2.1-2.1L22.8%2C22L2.9%2C2.1L5%2C0L27%2C22L27%2C22z'%20fill%3D'%23000000'%2F%3E%3C%2Fsvg%3E\")}.swiper-button-lock{display:none}.swiper-pagination{position:absolute;text-align:center;-webkit-transition:300ms opacity;-o-transition:300ms opacity;transition:300ms opacity;-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);z-index:10}.swiper-pagination.swiper-pagination-hidden{opacity:0}.swiper-pagination-fraction,.swiper-pagination-custom,.swiper-container-horizontal>.swiper-pagination-bullets{bottom:10px;left:0;width:100%}.swiper-pagination-bullets-dynamic{overflow:hidden;font-size:0}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33);position:relative}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-main{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev{-webkit-transform:scale(0.66);-ms-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-prev-prev{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next{-webkit-transform:scale(0.66);-ms-transform:scale(0.66);transform:scale(0.66)}.swiper-pagination-bullets-dynamic .swiper-pagination-bullet-active-next-next{-webkit-transform:scale(0.33);-ms-transform:scale(0.33);transform:scale(0.33)}.swiper-pagination-bullet{width:8px;height:8px;display:inline-block;border-radius:100%;background:#000;opacity:0.2}button.swiper-pagination-bullet{border:none;margin:0;padding:0;-webkit-box-shadow:none;box-shadow:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}.swiper-pagination-clickable .swiper-pagination-bullet{cursor:pointer}.swiper-pagination-bullet-active{opacity:1;background:#007aff}.swiper-container-vertical>.swiper-pagination-bullets{right:10px;top:50%;-webkit-transform:translate3d(0px, -50%, 0);transform:translate3d(0px, -50%, 0)}.swiper-container-vertical>.swiper-pagination-bullets .swiper-pagination-bullet{margin:6px 0;display:block}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{top:50%;-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:8px}.swiper-container-vertical>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{display:inline-block;-webkit-transition:200ms top, 200ms -webkit-transform;transition:200ms top, 200ms -webkit-transform;-o-transition:200ms transform, 200ms top;transition:200ms transform, 200ms top;transition:200ms transform, 200ms top, 200ms -webkit-transform}.swiper-container-horizontal>.swiper-pagination-bullets .swiper-pagination-bullet{margin:0 4px}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic{left:50%;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);white-space:nowrap}.swiper-container-horizontal>.swiper-pagination-bullets.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms left, 200ms -webkit-transform;transition:200ms left, 200ms -webkit-transform;-o-transition:200ms transform, 200ms left;transition:200ms transform, 200ms left;transition:200ms transform, 200ms left, 200ms -webkit-transform}.swiper-container-horizontal.swiper-container-rtl>.swiper-pagination-bullets-dynamic .swiper-pagination-bullet{-webkit-transition:200ms right, 200ms -webkit-transform;transition:200ms right, 200ms -webkit-transform;-o-transition:200ms transform, 200ms right;transition:200ms transform, 200ms right;transition:200ms transform, 200ms right, 200ms -webkit-transform}.swiper-pagination-progressbar{background:rgba(0, 0, 0, 0.25);position:absolute}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:#007aff;position:absolute;left:0;top:0;width:100%;height:100%;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);-webkit-transform-origin:left top;-ms-transform-origin:left top;transform-origin:left top}.swiper-container-rtl .swiper-pagination-progressbar .swiper-pagination-progressbar-fill{-webkit-transform-origin:right top;-ms-transform-origin:right top;transform-origin:right top}.swiper-container-horizontal>.swiper-pagination-progressbar,.swiper-container-vertical>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:100%;height:4px;left:0;top:0}.swiper-container-vertical>.swiper-pagination-progressbar,.swiper-container-horizontal>.swiper-pagination-progressbar.swiper-pagination-progressbar-opposite{width:4px;height:100%;left:0;top:0}.swiper-pagination-white .swiper-pagination-bullet-active{background:#ffffff}.swiper-pagination-progressbar.swiper-pagination-white{background:rgba(255, 255, 255, 0.25)}.swiper-pagination-progressbar.swiper-pagination-white .swiper-pagination-progressbar-fill{background:#ffffff}.swiper-pagination-black .swiper-pagination-bullet-active{background:#000000}.swiper-pagination-progressbar.swiper-pagination-black{background:rgba(0, 0, 0, 0.25)}.swiper-pagination-progressbar.swiper-pagination-black .swiper-pagination-progressbar-fill{background:#000000}.swiper-pagination-lock{display:none}.swiper-scrollbar{border-radius:10px;position:relative;-ms-touch-action:none;background:rgba(0, 0, 0, 0.1)}.swiper-container-horizontal>.swiper-scrollbar{position:absolute;left:1%;bottom:3px;z-index:50;height:5px;width:98%}.swiper-container-vertical>.swiper-scrollbar{position:absolute;right:3px;top:1%;z-index:50;width:5px;height:98%}.swiper-scrollbar-drag{height:100%;width:100%;position:relative;background:rgba(0, 0, 0, 0.5);border-radius:10px;left:0;top:0}.swiper-scrollbar-cursor-drag{cursor:move}.swiper-scrollbar-lock{display:none}.swiper-zoom-container{width:100%;height:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center;text-align:center}.swiper-zoom-container>img,.swiper-zoom-container>svg,.swiper-zoom-container>canvas{max-width:100%;max-height:100%;-o-object-fit:contain;object-fit:contain}.swiper-slide-zoomed{cursor:move}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;-webkit-transform-origin:50%;-ms-transform-origin:50%;transform-origin:50%;-webkit-animation:swiper-preloader-spin 1s steps(12, end) infinite;animation:swiper-preloader-spin 1s steps(12, end) infinite}.swiper-lazy-preloader:after{display:block;content:\"\";width:100%;height:100%;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%236c6c6c'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\");background-position:50%;background-size:100%;background-repeat:no-repeat}.swiper-lazy-preloader-white:after{background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg%20viewBox%3D'0%200%20120%20120'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20xmlns%3Axlink%3D'http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink'%3E%3Cdefs%3E%3Cline%20id%3D'l'%20x1%3D'60'%20x2%3D'60'%20y1%3D'7'%20y2%3D'27'%20stroke%3D'%23fff'%20stroke-width%3D'11'%20stroke-linecap%3D'round'%2F%3E%3C%2Fdefs%3E%3Cg%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(30%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(60%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(90%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(120%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.27'%20transform%3D'rotate(150%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.37'%20transform%3D'rotate(180%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.46'%20transform%3D'rotate(210%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.56'%20transform%3D'rotate(240%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.66'%20transform%3D'rotate(270%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.75'%20transform%3D'rotate(300%2060%2C60)'%2F%3E%3Cuse%20xlink%3Ahref%3D'%23l'%20opacity%3D'.85'%20transform%3D'rotate(330%2060%2C60)'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E\")}@-webkit-keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes swiper-preloader-spin{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.swiper-container .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}.swiper-container-fade.swiper-container-free-mode .swiper-slide{-webkit-transition-timing-function:ease-out;-o-transition-timing-function:ease-out;transition-timing-function:ease-out}.swiper-container-fade .swiper-slide{pointer-events:none;-webkit-transition-property:opacity;-o-transition-property:opacity;transition-property:opacity}.swiper-container-fade .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-fade .swiper-slide-active,.swiper-container-fade .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube{overflow:visible}.swiper-container-cube .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1;visibility:hidden;-webkit-transform-origin:0 0;-ms-transform-origin:0 0;transform-origin:0 0;width:100%;height:100%}.swiper-container-cube .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-cube.swiper-container-rtl .swiper-slide{-webkit-transform-origin:100% 0;-ms-transform-origin:100% 0;transform-origin:100% 0}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-cube .swiper-slide-active,.swiper-container-cube .swiper-slide-next,.swiper-container-cube .swiper-slide-prev,.swiper-container-cube .swiper-slide-next+.swiper-slide{pointer-events:auto;visibility:visible}.swiper-container-cube .swiper-slide-shadow-top,.swiper-container-cube .swiper-slide-shadow-bottom,.swiper-container-cube .swiper-slide-shadow-left,.swiper-container-cube .swiper-slide-shadow-right{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-cube .swiper-cube-shadow{position:absolute;left:0;bottom:0px;width:100%;height:100%;background:#000;opacity:0.6;-webkit-filter:blur(50px);filter:blur(50px);z-index:0}.swiper-container-flip{overflow:visible}.swiper-container-flip .swiper-slide{pointer-events:none;-webkit-backface-visibility:hidden;backface-visibility:hidden;z-index:1}.swiper-container-flip .swiper-slide .swiper-slide{pointer-events:none}.swiper-container-flip .swiper-slide-active,.swiper-container-flip .swiper-slide-active .swiper-slide-active{pointer-events:auto}.swiper-container-flip .swiper-slide-shadow-top,.swiper-container-flip .swiper-slide-shadow-bottom,.swiper-container-flip .swiper-slide-shadow-left,.swiper-container-flip .swiper-slide-shadow-right{z-index:0;-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-container-coverflow .swiper-wrapper{-ms-perspective:1200px}ion-slides{display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swiper-pagination-bullet{background:var(--bullet-background)}.swiper-pagination-bullet-active{background:var(--bullet-background-active)}.swiper-pagination-progressbar{background:var(--progress-bar-background)}.swiper-pagination-progressbar .swiper-pagination-progressbar-fill{background:var(--progress-bar-background-active)}.swiper-scrollbar{background:var(--scroll-bar-background)}.swiper-scrollbar-drag{background:var(--scroll-bar-background-active)}.slides-md{--bullet-background:var(--ion-color-step-200, #cccccc);--bullet-background-active:var(--ion-color-primary, #3880ff);--progress-bar-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.25);--progress-bar-background-active:var(--ion-color-primary-shade, #3171e0);--scroll-bar-background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1);--scroll-bar-background-active:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.5)}";
|
22258 |
|
22259 |
|
22260 |
|
22261 |
|
22262 | class Slides {
|
22263 | constructor(hostRef) {
|
22264 | registerInstance(this, hostRef);
|
22265 | this.ionSlidesDidLoad = createEvent(this, "ionSlidesDidLoad", 7);
|
22266 | this.ionSlideTap = createEvent(this, "ionSlideTap", 7);
|
22267 | this.ionSlideDoubleTap = createEvent(this, "ionSlideDoubleTap", 7);
|
22268 | this.ionSlideWillChange = createEvent(this, "ionSlideWillChange", 7);
|
22269 | this.ionSlideDidChange = createEvent(this, "ionSlideDidChange", 7);
|
22270 | this.ionSlideNextStart = createEvent(this, "ionSlideNextStart", 7);
|
22271 | this.ionSlidePrevStart = createEvent(this, "ionSlidePrevStart", 7);
|
22272 | this.ionSlideNextEnd = createEvent(this, "ionSlideNextEnd", 7);
|
22273 | this.ionSlidePrevEnd = createEvent(this, "ionSlidePrevEnd", 7);
|
22274 | this.ionSlideTransitionStart = createEvent(this, "ionSlideTransitionStart", 7);
|
22275 | this.ionSlideTransitionEnd = createEvent(this, "ionSlideTransitionEnd", 7);
|
22276 | this.ionSlideDrag = createEvent(this, "ionSlideDrag", 7);
|
22277 | this.ionSlideReachStart = createEvent(this, "ionSlideReachStart", 7);
|
22278 | this.ionSlideReachEnd = createEvent(this, "ionSlideReachEnd", 7);
|
22279 | this.ionSlideTouchStart = createEvent(this, "ionSlideTouchStart", 7);
|
22280 | this.ionSlideTouchEnd = createEvent(this, "ionSlideTouchEnd", 7);
|
22281 | this.swiperReady = false;
|
22282 | this.swiper = new Promise(resolve => { this.readySwiper = resolve; });
|
22283 | this.didInit = false;
|
22284 | |
22285 |
|
22286 |
|
22287 |
|
22288 | this.options = {};
|
22289 | |
22290 |
|
22291 |
|
22292 | this.pager = false;
|
22293 | |
22294 |
|
22295 |
|
22296 | this.scrollbar = false;
|
22297 | }
|
22298 | async optionsChanged() {
|
22299 | if (this.swiperReady) {
|
22300 | const swiper = await this.getSwiper();
|
22301 | if (swiper === null || swiper === void 0 ? void 0 : swiper.params) {
|
22302 | Object.assign(swiper.params, this.options);
|
22303 | await this.update();
|
22304 | }
|
22305 | }
|
22306 | }
|
22307 | componentWillLoad() {
|
22308 | console.warn(`[Deprecation Warning]: ion-slides has been deprecated and will be removed in Ionic Framework v7.0. We recommend using the framework-specific integrations that Swiper.js provides, allowing for faster bug fixes and an improved developer experience. See https://ionicframework.com/docs/api/slides#migration for more information including migration steps.`);
|
22309 | }
|
22310 | connectedCallback() {
|
22311 |
|
22312 | if (typeof MutationObserver !== 'undefined') {
|
22313 | const mut = this.mutationO = new MutationObserver(() => {
|
22314 | if (this.swiperReady) {
|
22315 | this.update();
|
22316 | }
|
22317 | });
|
22318 | mut.observe(this.el, {
|
22319 | childList: true,
|
22320 | subtree: true
|
22321 | });
|
22322 | componentOnReady(this.el, () => {
|
22323 | if (!this.didInit) {
|
22324 | this.didInit = true;
|
22325 | this.initSwiper();
|
22326 | }
|
22327 | });
|
22328 | }
|
22329 | }
|
22330 | disconnectedCallback() {
|
22331 | if (this.mutationO) {
|
22332 | this.mutationO.disconnect();
|
22333 | this.mutationO = undefined;
|
22334 | }
|
22335 | |
22336 |
|
22337 |
|
22338 |
|
22339 |
|
22340 |
|
22341 |
|
22342 | const swiper = this.syncSwiper;
|
22343 | if (swiper !== undefined) {
|
22344 | swiper.destroy(true, true);
|
22345 | this.swiper = new Promise(resolve => { this.readySwiper = resolve; });
|
22346 | this.swiperReady = false;
|
22347 | this.syncSwiper = undefined;
|
22348 | }
|
22349 | this.didInit = false;
|
22350 | }
|
22351 | |
22352 |
|
22353 |
|
22354 |
|
22355 | async update() {
|
22356 | const [swiper] = await Promise.all([
|
22357 | this.getSwiper(),
|
22358 | waitForSlides(this.el)
|
22359 | ]);
|
22360 | swiper.update();
|
22361 | }
|
22362 | |
22363 |
|
22364 |
|
22365 |
|
22366 |
|
22367 |
|
22368 | async updateAutoHeight(speed) {
|
22369 | const swiper = await this.getSwiper();
|
22370 | swiper.updateAutoHeight(speed);
|
22371 | }
|
22372 | |
22373 |
|
22374 |
|
22375 |
|
22376 |
|
22377 |
|
22378 |
|
22379 | async slideTo(index, speed, runCallbacks) {
|
22380 | const swiper = await this.getSwiper();
|
22381 | swiper.slideTo(index, speed, runCallbacks);
|
22382 | }
|
22383 | |
22384 |
|
22385 |
|
22386 |
|
22387 |
|
22388 |
|
22389 | async slideNext(speed, runCallbacks) {
|
22390 | const swiper = await this.getSwiper();
|
22391 | swiper.slideNext(speed, runCallbacks);
|
22392 | }
|
22393 | |
22394 |
|
22395 |
|
22396 |
|
22397 |
|
22398 |
|
22399 | async slidePrev(speed, runCallbacks) {
|
22400 | const swiper = await this.getSwiper();
|
22401 | swiper.slidePrev(speed, runCallbacks);
|
22402 | }
|
22403 | |
22404 |
|
22405 |
|
22406 | async getActiveIndex() {
|
22407 | const swiper = await this.getSwiper();
|
22408 | return swiper.activeIndex;
|
22409 | }
|
22410 | |
22411 |
|
22412 |
|
22413 | async getPreviousIndex() {
|
22414 | const swiper = await this.getSwiper();
|
22415 | return swiper.previousIndex;
|
22416 | }
|
22417 | |
22418 |
|
22419 |
|
22420 | async length() {
|
22421 | const swiper = await this.getSwiper();
|
22422 | return swiper.slides.length;
|
22423 | }
|
22424 | |
22425 |
|
22426 |
|
22427 | async isEnd() {
|
22428 | const swiper = await this.getSwiper();
|
22429 | return swiper.isEnd;
|
22430 | }
|
22431 | |
22432 |
|
22433 |
|
22434 | async isBeginning() {
|
22435 | const swiper = await this.getSwiper();
|
22436 | return swiper.isBeginning;
|
22437 | }
|
22438 | |
22439 |
|
22440 |
|
22441 | async startAutoplay() {
|
22442 | const swiper = await this.getSwiper();
|
22443 | if (swiper.autoplay) {
|
22444 | swiper.autoplay.start();
|
22445 | }
|
22446 | }
|
22447 | |
22448 |
|
22449 |
|
22450 | async stopAutoplay() {
|
22451 | const swiper = await this.getSwiper();
|
22452 | if (swiper.autoplay) {
|
22453 | swiper.autoplay.stop();
|
22454 | }
|
22455 | }
|
22456 | |
22457 |
|
22458 |
|
22459 |
|
22460 |
|
22461 | async lockSwipeToNext(lock) {
|
22462 | const swiper = await this.getSwiper();
|
22463 | swiper.allowSlideNext = !lock;
|
22464 | }
|
22465 | |
22466 |
|
22467 |
|
22468 |
|
22469 |
|
22470 | async lockSwipeToPrev(lock) {
|
22471 | const swiper = await this.getSwiper();
|
22472 | swiper.allowSlidePrev = !lock;
|
22473 | }
|
22474 | |
22475 |
|
22476 |
|
22477 |
|
22478 |
|
22479 | async lockSwipes(lock) {
|
22480 | const swiper = await this.getSwiper();
|
22481 | swiper.allowSlideNext = !lock;
|
22482 | swiper.allowSlidePrev = !lock;
|
22483 | swiper.allowTouchMove = !lock;
|
22484 | }
|
22485 | |
22486 |
|
22487 |
|
22488 |
|
22489 |
|
22490 | async getSwiper() {
|
22491 | return this.swiper;
|
22492 | }
|
22493 | async initSwiper() {
|
22494 | const finalOptions = this.normalizeOptions();
|
22495 |
|
22496 |
|
22497 | const { Swiper } = await Promise.resolve().then(function () { return swiper_bundle; });
|
22498 | await waitForSlides(this.el);
|
22499 | const swiper = new Swiper(this.el, finalOptions);
|
22500 | this.swiperReady = true;
|
22501 | this.syncSwiper = swiper;
|
22502 | this.readySwiper(swiper);
|
22503 | }
|
22504 | normalizeOptions() {
|
22505 |
|
22506 |
|
22507 | const swiperOptions = {
|
22508 | effect: undefined,
|
22509 | direction: 'horizontal',
|
22510 | initialSlide: 0,
|
22511 | loop: false,
|
22512 | parallax: false,
|
22513 | slidesPerView: 1,
|
22514 | spaceBetween: 0,
|
22515 | speed: 300,
|
22516 | slidesPerColumn: 1,
|
22517 | slidesPerColumnFill: 'column',
|
22518 | slidesPerGroup: 1,
|
22519 | centeredSlides: false,
|
22520 | slidesOffsetBefore: 0,
|
22521 | slidesOffsetAfter: 0,
|
22522 | touchEventsTarget: 'container',
|
22523 | autoplay: false,
|
22524 | freeMode: false,
|
22525 | freeModeMomentum: true,
|
22526 | freeModeMomentumRatio: 1,
|
22527 | freeModeMomentumBounce: true,
|
22528 | freeModeMomentumBounceRatio: 1,
|
22529 | freeModeMomentumVelocityRatio: 1,
|
22530 | freeModeSticky: false,
|
22531 | freeModeMinimumVelocity: 0.02,
|
22532 | autoHeight: false,
|
22533 | setWrapperSize: false,
|
22534 | zoom: {
|
22535 | maxRatio: 3,
|
22536 | minRatio: 1,
|
22537 | toggle: false,
|
22538 | },
|
22539 | touchRatio: 1,
|
22540 | touchAngle: 45,
|
22541 | simulateTouch: true,
|
22542 | touchStartPreventDefault: false,
|
22543 | shortSwipes: true,
|
22544 | longSwipes: true,
|
22545 | longSwipesRatio: 0.5,
|
22546 | longSwipesMs: 300,
|
22547 | followFinger: true,
|
22548 | threshold: 0,
|
22549 | touchMoveStopPropagation: true,
|
22550 | touchReleaseOnEdges: false,
|
22551 | iOSEdgeSwipeDetection: false,
|
22552 | iOSEdgeSwipeThreshold: 20,
|
22553 | resistance: true,
|
22554 | resistanceRatio: 0.85,
|
22555 | watchSlidesProgress: false,
|
22556 | watchSlidesVisibility: false,
|
22557 | preventClicks: true,
|
22558 | preventClicksPropagation: true,
|
22559 | slideToClickedSlide: false,
|
22560 | loopAdditionalSlides: 0,
|
22561 | noSwiping: true,
|
22562 | runCallbacksOnInit: true,
|
22563 | coverflowEffect: {
|
22564 | rotate: 50,
|
22565 | stretch: 0,
|
22566 | depth: 100,
|
22567 | modifier: 1,
|
22568 | slideShadows: true
|
22569 | },
|
22570 | flipEffect: {
|
22571 | slideShadows: true,
|
22572 | limitRotation: true
|
22573 | },
|
22574 | cubeEffect: {
|
22575 | slideShadows: true,
|
22576 | shadow: true,
|
22577 | shadowOffset: 20,
|
22578 | shadowScale: 0.94
|
22579 | },
|
22580 | fadeEffect: {
|
22581 | crossFade: false
|
22582 | },
|
22583 | a11y: {
|
22584 | prevSlideMessage: 'Previous slide',
|
22585 | nextSlideMessage: 'Next slide',
|
22586 | firstSlideMessage: 'This is the first slide',
|
22587 | lastSlideMessage: 'This is the last slide'
|
22588 | }
|
22589 | };
|
22590 | if (this.pager) {
|
22591 | swiperOptions.pagination = {
|
22592 | el: this.paginationEl,
|
22593 | type: 'bullets',
|
22594 | clickable: false,
|
22595 | hideOnClick: false,
|
22596 | };
|
22597 | }
|
22598 | if (this.scrollbar) {
|
22599 | swiperOptions.scrollbar = {
|
22600 | el: this.scrollbarEl,
|
22601 | hide: true,
|
22602 | };
|
22603 | }
|
22604 |
|
22605 |
|
22606 | const eventOptions = {
|
22607 | on: {
|
22608 | init: () => {
|
22609 | setTimeout(() => {
|
22610 | this.ionSlidesDidLoad.emit();
|
22611 | }, 20);
|
22612 | },
|
22613 | slideChangeTransitionStart: this.ionSlideWillChange.emit,
|
22614 | slideChangeTransitionEnd: this.ionSlideDidChange.emit,
|
22615 | slideNextTransitionStart: this.ionSlideNextStart.emit,
|
22616 | slidePrevTransitionStart: this.ionSlidePrevStart.emit,
|
22617 | slideNextTransitionEnd: this.ionSlideNextEnd.emit,
|
22618 | slidePrevTransitionEnd: this.ionSlidePrevEnd.emit,
|
22619 | transitionStart: this.ionSlideTransitionStart.emit,
|
22620 | transitionEnd: this.ionSlideTransitionEnd.emit,
|
22621 | sliderMove: this.ionSlideDrag.emit,
|
22622 | reachBeginning: this.ionSlideReachStart.emit,
|
22623 | reachEnd: this.ionSlideReachEnd.emit,
|
22624 | touchStart: this.ionSlideTouchStart.emit,
|
22625 | touchEnd: this.ionSlideTouchEnd.emit,
|
22626 | tap: this.ionSlideTap.emit,
|
22627 | doubleTap: this.ionSlideDoubleTap.emit
|
22628 | }
|
22629 | };
|
22630 | const customEvents = (!!this.options && !!this.options.on) ? this.options.on : {};
|
22631 |
|
22632 | const mergedEventOptions = { on: Object.assign(Object.assign({}, customEvents), eventOptions.on) };
|
22633 |
|
22634 | return Object.assign(Object.assign(Object.assign({}, swiperOptions), this.options), mergedEventOptions);
|
22635 | }
|
22636 | render() {
|
22637 | const mode = getIonMode$1(this);
|
22638 | return (hAsync(Host, { class: {
|
22639 | [`${mode}`]: true,
|
22640 |
|
22641 | [`slides-${mode}`]: true,
|
22642 | 'swiper-container': true
|
22643 | } }, hAsync("div", { class: "swiper-wrapper" }, hAsync("slot", null)), this.pager && hAsync("div", { class: "swiper-pagination", ref: el => this.paginationEl = el }), this.scrollbar && hAsync("div", { class: "swiper-scrollbar", ref: el => this.scrollbarEl = el })));
|
22644 | }
|
22645 | static get assetsDirs() { return ["swiper"]; }
|
22646 | get el() { return getElement(this); }
|
22647 | static get watchers() { return {
|
22648 | "options": ["optionsChanged"]
|
22649 | }; }
|
22650 | static get style() { return {
|
22651 | ios: slidesIosCss,
|
22652 | md: slidesMdCss
|
22653 | }; }
|
22654 | static get cmpMeta() { return {
|
22655 | "$flags$": 36,
|
22656 | "$tagName$": "ion-slides",
|
22657 | "$members$": {
|
22658 | "options": [8],
|
22659 | "pager": [4],
|
22660 | "scrollbar": [4],
|
22661 | "update": [64],
|
22662 | "updateAutoHeight": [64],
|
22663 | "slideTo": [64],
|
22664 | "slideNext": [64],
|
22665 | "slidePrev": [64],
|
22666 | "getActiveIndex": [64],
|
22667 | "getPreviousIndex": [64],
|
22668 | "length": [64],
|
22669 | "isEnd": [64],
|
22670 | "isBeginning": [64],
|
22671 | "startAutoplay": [64],
|
22672 | "stopAutoplay": [64],
|
22673 | "lockSwipeToNext": [64],
|
22674 | "lockSwipeToPrev": [64],
|
22675 | "lockSwipes": [64],
|
22676 | "getSwiper": [64]
|
22677 | },
|
22678 | "$listeners$": undefined,
|
22679 | "$lazyBundleId$": "-",
|
22680 | "$attrsToReflect$": []
|
22681 | }; }
|
22682 | }
|
22683 | const waitForSlides = (el) => {
|
22684 | return Promise.all(Array.from(el.querySelectorAll('ion-slide')).map(s => new Promise(resolve => componentOnReady(s, resolve))));
|
22685 | };
|
22686 |
|
22687 | const spinnerCss = "/*!@:host*/.sc-ion-spinner-h{display:inline-block;position:relative;width:28px;height:28px;color:var(--color);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-spinner-h{color:var(--ion-color-base)}/*!@svg*/svg.sc-ion-spinner{left:0;top:0;-webkit-transform-origin:center;transform-origin:center;position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0)}/*!@[dir=rtl] svg, :host-context([dir=rtl]) svg*/[dir=rtl].sc-ion-spinner svg.sc-ion-spinner,[dir=rtl].sc-ion-spinner-h svg.sc-ion-spinner,[dir=rtl] .sc-ion-spinner-h svg.sc-ion-spinner{left:unset;right:unset;right:0}/*!@[dir=rtl] svg, :host-context([dir=rtl]) svg*/[dir=rtl].sc-ion-spinner svg.sc-ion-spinner,[dir=rtl].sc-ion-spinner-h svg.sc-ion-spinner,[dir=rtl] .sc-ion-spinner-h svg.sc-ion-spinner{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}/*!@:host(.spinner-lines) line,\n:host(.spinner-lines-small) line*/.spinner-lines.sc-ion-spinner-h line.sc-ion-spinner,.spinner-lines-small.sc-ion-spinner-h line.sc-ion-spinner{stroke-width:4px;stroke-linecap:round;stroke:currentColor}/*!@:host(.spinner-lines) svg,\n:host(.spinner-lines-small) svg*/.spinner-lines.sc-ion-spinner-h svg.sc-ion-spinner,.spinner-lines-small.sc-ion-spinner-h svg.sc-ion-spinner{-webkit-animation:spinner-fade-out 1s linear infinite;animation:spinner-fade-out 1s linear infinite}/*!@:host(.spinner-bubbles) svg*/.spinner-bubbles.sc-ion-spinner-h svg.sc-ion-spinner{-webkit-animation:spinner-scale-out 1s linear infinite;animation:spinner-scale-out 1s linear infinite;fill:currentColor}/*!@:host(.spinner-circles) svg*/.spinner-circles.sc-ion-spinner-h svg.sc-ion-spinner{-webkit-animation:spinner-fade-out 1s linear infinite;animation:spinner-fade-out 1s linear infinite;fill:currentColor}/*!@:host(.spinner-crescent) circle*/.spinner-crescent.sc-ion-spinner-h circle.sc-ion-spinner{fill:transparent;stroke-width:4px;stroke-dasharray:128px;stroke-dashoffset:82px;stroke:currentColor}/*!@:host(.spinner-crescent) svg*/.spinner-crescent.sc-ion-spinner-h svg.sc-ion-spinner{-webkit-animation:spinner-rotate 1s linear infinite;animation:spinner-rotate 1s linear infinite}/*!@:host(.spinner-dots) circle*/.spinner-dots.sc-ion-spinner-h circle.sc-ion-spinner{stroke-width:0;fill:currentColor}/*!@:host(.spinner-dots) svg*/.spinner-dots.sc-ion-spinner-h svg.sc-ion-spinner{-webkit-animation:spinner-dots 1s linear infinite;animation:spinner-dots 1s linear infinite}/*!@:host(.spinner-circular)*/.spinner-circular.sc-ion-spinner-h{-webkit-animation:spinner-circular linear infinite;animation:spinner-circular linear infinite}/*!@:host(.spinner-circular) circle*/.spinner-circular.sc-ion-spinner-h circle.sc-ion-spinner{-webkit-animation:spinner-circular-inner ease-in-out infinite;animation:spinner-circular-inner ease-in-out infinite;stroke:currentColor;stroke-dasharray:80px, 200px;stroke-dashoffset:0px;stroke-width:5.6;fill:none}/*!@:host(.spinner-paused),\n:host(.spinner-paused) svg,\n:host(.spinner-paused) circle*/.spinner-paused.sc-ion-spinner-h,.spinner-paused.sc-ion-spinner-h svg.sc-ion-spinner,.spinner-paused.sc-ion-spinner-h circle.sc-ion-spinner{-webkit-animation-play-state:paused;animation-play-state:paused}@-webkit-keyframes spinner-fade-out{0%{opacity:1}100%{opacity:0}}@keyframes spinner-fade-out{0%{opacity:1}100%{opacity:0}}@-webkit-keyframes spinner-scale-out{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}100%{-webkit-transform:scale(0, 0);transform:scale(0, 0)}}@keyframes spinner-scale-out{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1)}100%{-webkit-transform:scale(0, 0);transform:scale(0, 0)}}@-webkit-keyframes spinner-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-rotate{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes spinner-dots{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1);opacity:0.9}50%{-webkit-transform:scale(0.4, 0.4);transform:scale(0.4, 0.4);opacity:0.3}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1);opacity:0.9}}@keyframes spinner-dots{0%{-webkit-transform:scale(1, 1);transform:scale(1, 1);opacity:0.9}50%{-webkit-transform:scale(0.4, 0.4);transform:scale(0.4, 0.4);opacity:0.3}100%{-webkit-transform:scale(1, 1);transform:scale(1, 1);opacity:0.9}}@-webkit-keyframes spinner-circular{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes spinner-circular{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes spinner-circular-inner{0%{stroke-dasharray:1px, 200px;stroke-dashoffset:0px}50%{stroke-dasharray:100px, 200px;stroke-dashoffset:-15px}100%{stroke-dasharray:100px, 200px;stroke-dashoffset:-125px}}@keyframes spinner-circular-inner{0%{stroke-dasharray:1px, 200px;stroke-dashoffset:0px}50%{stroke-dasharray:100px, 200px;stroke-dashoffset:-15px}100%{stroke-dasharray:100px, 200px;stroke-dashoffset:-125px}}";
|
22688 |
|
22689 | class Spinner {
|
22690 | constructor(hostRef) {
|
22691 | registerInstance(this, hostRef);
|
22692 | |
22693 |
|
22694 |
|
22695 | this.paused = false;
|
22696 | }
|
22697 | getName() {
|
22698 | const spinnerName = this.name || config.get('spinner');
|
22699 | const mode = getIonMode$1(this);
|
22700 | if (spinnerName) {
|
22701 | return spinnerName;
|
22702 | }
|
22703 | return (mode === 'ios') ? 'lines' : 'circular';
|
22704 | }
|
22705 | render() {
|
22706 | const self = this;
|
22707 | const mode = getIonMode$1(self);
|
22708 | const spinnerName = self.getName();
|
22709 | const spinner = SPINNERS[spinnerName] || SPINNERS['lines'];
|
22710 | const duration = (typeof self.duration === 'number' && self.duration > 10 ? self.duration : spinner.dur);
|
22711 | const svgs = [];
|
22712 | if (spinner.circles !== undefined) {
|
22713 | for (let i = 0; i < spinner.circles; i++) {
|
22714 | svgs.push(buildCircle(spinner, duration, i, spinner.circles));
|
22715 | }
|
22716 | }
|
22717 | else if (spinner.lines !== undefined) {
|
22718 | for (let i = 0; i < spinner.lines; i++) {
|
22719 | svgs.push(buildLine(spinner, duration, i, spinner.lines));
|
22720 | }
|
22721 | }
|
22722 | return (hAsync(Host, { class: createColorClasses$1(self.color, {
|
22723 | [mode]: true,
|
22724 | [`spinner-${spinnerName}`]: true,
|
22725 | 'spinner-paused': !!self.paused || config.getBoolean('_testing')
|
22726 | }), role: "progressbar", style: spinner.elmDuration ? { animationDuration: duration + 'ms' } : {} }, svgs));
|
22727 | }
|
22728 | static get style() { return spinnerCss; }
|
22729 | static get cmpMeta() { return {
|
22730 | "$flags$": 9,
|
22731 | "$tagName$": "ion-spinner",
|
22732 | "$members$": {
|
22733 | "color": [513],
|
22734 | "duration": [2],
|
22735 | "name": [1],
|
22736 | "paused": [4]
|
22737 | },
|
22738 | "$listeners$": undefined,
|
22739 | "$lazyBundleId$": "-",
|
22740 | "$attrsToReflect$": [["color", "color"]]
|
22741 | }; }
|
22742 | }
|
22743 | const buildCircle = (spinner, duration, index, total) => {
|
22744 | const data = spinner.fn(duration, index, total);
|
22745 | data.style['animation-duration'] = duration + 'ms';
|
22746 | return (hAsync("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, hAsync("circle", { transform: data.transform || 'translate(32,32)', cx: data.cx, cy: data.cy, r: data.r, style: spinner.elmDuration ? { animationDuration: duration + 'ms' } : {} })));
|
22747 | };
|
22748 | const buildLine = (spinner, duration, index, total) => {
|
22749 | const data = spinner.fn(duration, index, total);
|
22750 | data.style['animation-duration'] = duration + 'ms';
|
22751 | return (hAsync("svg", { viewBox: data.viewBox || '0 0 64 64', style: data.style }, hAsync("line", { transform: "translate(32,32)", y1: data.y1, y2: data.y2 })));
|
22752 | };
|
22753 |
|
22754 | const splitPaneIosCss = "/*!@:host*/.sc-ion-split-pane-ios-h{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}/*!@::slotted(ion-menu.menu-pane-visible)*/.sc-ion-split-pane-ios-s>ion-menu.menu-pane-visible{-ms-flex:0 1 auto;flex:0 1 auto;width:var(--side-width);min-width:var(--side-min-width);max-width:var(--side-max-width)}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side),\n:host(.split-pane-visible) ::slotted(.split-pane-main)*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side,.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-main{left:0;right:0;top:0;bottom:0;position:relative;-webkit-box-shadow:none !important;box-shadow:none !important;z-index:0}/*!@:host(.split-pane-visible) ::slotted(.split-pane-main)*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-main{-ms-flex:1;flex:1}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side:not(ion-menu)),\n:host(.split-pane-visible) ::slotted(ion-menu.split-pane-side.menu-enabled)*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side:not(ion-menu),.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>ion-menu.split-pane-side.menu-enabled{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}/*!@::slotted(.split-pane-side:not(ion-menu))*/.sc-ion-split-pane-ios-s>.split-pane-side:not(ion-menu){display:none}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side)*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side{-ms-flex-order:-1;order:-1}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side[side=end])*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side[side=end]{-ms-flex-order:1;order:1}/*!@:host*/.sc-ion-split-pane-ios-h{--border:0.55px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));--side-min-width:270px;--side-max-width:28%}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side)*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side{border-left:0;border-right:var(--border);border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.split-pane-visible) ::slotted(.split-pane-side)*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side{border-left:unset;border-right:unset;-webkit-border-start:0;border-inline-start:0;-webkit-border-end:var(--border);border-inline-end:var(--border)}}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side[side=end])*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side[side=end]{border-left:var(--border);border-right:0;border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.split-pane-visible) ::slotted(.split-pane-side[side=end])*/.sc-ion-split-pane-ios-h.split-pane-visible .sc-ion-split-pane-ios-s>.split-pane-side[side=end]{border-left:unset;border-right:unset;-webkit-border-start:var(--border);border-inline-start:var(--border);-webkit-border-end:0;border-inline-end:0}}";
|
22755 |
|
22756 | const splitPaneMdCss = "/*!@:host*/.sc-ion-split-pane-md-h{--side-width:100%;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap;contain:strict}/*!@::slotted(ion-menu.menu-pane-visible)*/.sc-ion-split-pane-md-s>ion-menu.menu-pane-visible{-ms-flex:0 1 auto;flex:0 1 auto;width:var(--side-width);min-width:var(--side-min-width);max-width:var(--side-max-width)}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side),\n:host(.split-pane-visible) ::slotted(.split-pane-main)*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side,.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-main{left:0;right:0;top:0;bottom:0;position:relative;-webkit-box-shadow:none !important;box-shadow:none !important;z-index:0}/*!@:host(.split-pane-visible) ::slotted(.split-pane-main)*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-main{-ms-flex:1;flex:1}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side:not(ion-menu)),\n:host(.split-pane-visible) ::slotted(ion-menu.split-pane-side.menu-enabled)*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side:not(ion-menu),.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>ion-menu.split-pane-side.menu-enabled{display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0}/*!@::slotted(.split-pane-side:not(ion-menu))*/.sc-ion-split-pane-md-s>.split-pane-side:not(ion-menu){display:none}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side)*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side{-ms-flex-order:-1;order:-1}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side[side=end])*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side[side=end]{-ms-flex-order:1;order:1}/*!@:host*/.sc-ion-split-pane-md-h{--border:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.13))));--side-min-width:270px;--side-max-width:28%}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side)*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side{border-left:0;border-right:var(--border);border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.split-pane-visible) ::slotted(.split-pane-side)*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side{border-left:unset;border-right:unset;-webkit-border-start:0;border-inline-start:0;-webkit-border-end:var(--border);border-inline-end:var(--border)}}/*!@:host(.split-pane-visible) ::slotted(.split-pane-side[side=end])*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side[side=end]{border-left:var(--border);border-right:0;border-top:0;border-bottom:0;min-width:var(--side-min-width);max-width:var(--side-max-width)}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.split-pane-visible) ::slotted(.split-pane-side[side=end])*/.sc-ion-split-pane-md-h.split-pane-visible .sc-ion-split-pane-md-s>.split-pane-side[side=end]{border-left:unset;border-right:unset;-webkit-border-start:var(--border);border-inline-start:var(--border);-webkit-border-end:0;border-inline-end:0}}";
|
22757 |
|
22758 | const SPLIT_PANE_SIDE = 'split-pane-side';
|
22759 | const QUERY = {
|
22760 | 'xs': '(min-width: 0px)',
|
22761 | 'sm': '(min-width: 576px)',
|
22762 | 'md': '(min-width: 768px)',
|
22763 | 'lg': '(min-width: 992px)',
|
22764 | 'xl': '(min-width: 1200px)',
|
22765 | 'never': ''
|
22766 | };
|
22767 | class SplitPane {
|
22768 | constructor(hostRef) {
|
22769 | registerInstance(this, hostRef);
|
22770 | this.ionSplitPaneVisible = createEvent(this, "ionSplitPaneVisible", 7);
|
22771 | this.visible = false;
|
22772 | |
22773 |
|
22774 |
|
22775 | this.disabled = false;
|
22776 | |
22777 |
|
22778 |
|
22779 |
|
22780 |
|
22781 | this.when = QUERY['lg'];
|
22782 | }
|
22783 | visibleChanged(visible) {
|
22784 | const detail = { visible, isPane: this.isPane.bind(this) };
|
22785 | this.ionSplitPaneVisible.emit(detail);
|
22786 | }
|
22787 | connectedCallback() {
|
22788 | this.styleChildren();
|
22789 | this.updateState();
|
22790 | }
|
22791 | disconnectedCallback() {
|
22792 | if (this.rmL) {
|
22793 | this.rmL();
|
22794 | this.rmL = undefined;
|
22795 | }
|
22796 | }
|
22797 | updateState() {
|
22798 | {
|
22799 | return;
|
22800 | }
|
22801 | }
|
22802 | isPane(element) {
|
22803 | if (!this.visible) {
|
22804 | return false;
|
22805 | }
|
22806 | return element.parentElement === this.el
|
22807 | && element.classList.contains(SPLIT_PANE_SIDE);
|
22808 | }
|
22809 | styleChildren() {
|
22810 | {
|
22811 | return;
|
22812 | }
|
22813 | }
|
22814 | render() {
|
22815 | const mode = getIonMode$1(this);
|
22816 | return (hAsync(Host, { class: {
|
22817 | [mode]: true,
|
22818 |
|
22819 | [`split-pane-${mode}`]: true,
|
22820 | 'split-pane-visible': this.visible
|
22821 | } }, hAsync("slot", null)));
|
22822 | }
|
22823 | get el() { return getElement(this); }
|
22824 | static get watchers() { return {
|
22825 | "visible": ["visibleChanged"],
|
22826 | "disabled": ["updateState"],
|
22827 | "when": ["updateState"]
|
22828 | }; }
|
22829 | static get style() { return {
|
22830 | ios: splitPaneIosCss,
|
22831 | md: splitPaneMdCss
|
22832 | }; }
|
22833 | static get cmpMeta() { return {
|
22834 | "$flags$": 41,
|
22835 | "$tagName$": "ion-split-pane",
|
22836 | "$members$": {
|
22837 | "contentId": [513, "content-id"],
|
22838 | "disabled": [4],
|
22839 | "when": [8],
|
22840 | "visible": [32]
|
22841 | },
|
22842 | "$listeners$": undefined,
|
22843 | "$lazyBundleId$": "-",
|
22844 | "$attrsToReflect$": [["contentId", "content-id"]]
|
22845 | }; }
|
22846 | }
|
22847 |
|
22848 | const tabCss = "/*!@:host(.tab-hidden)*/.tab-hidden.sc-ion-tab-h{display:none !important}";
|
22849 |
|
22850 | class Tab {
|
22851 | constructor(hostRef) {
|
22852 | registerInstance(this, hostRef);
|
22853 | this.loaded = false;
|
22854 |
|
22855 | this.active = false;
|
22856 | }
|
22857 | async componentWillLoad() {
|
22858 | if (this.active) {
|
22859 | await this.setActive();
|
22860 | }
|
22861 | }
|
22862 |
|
22863 | async setActive() {
|
22864 | await this.prepareLazyLoaded();
|
22865 | this.active = true;
|
22866 | }
|
22867 | changeActive(isActive) {
|
22868 | if (isActive) {
|
22869 | this.prepareLazyLoaded();
|
22870 | }
|
22871 | }
|
22872 | prepareLazyLoaded() {
|
22873 | if (!this.loaded && this.component != null) {
|
22874 | this.loaded = true;
|
22875 | try {
|
22876 | return attachComponent(this.delegate, this.el, this.component, ['ion-page']);
|
22877 | }
|
22878 | catch (e) {
|
22879 | console.error(e);
|
22880 | }
|
22881 | }
|
22882 | return Promise.resolve(undefined);
|
22883 | }
|
22884 | render() {
|
22885 | const { tab, active, component } = this;
|
22886 | return (hAsync(Host, { role: "tabpanel", "aria-hidden": !active ? 'true' : null, "aria-labelledby": `tab-button-${tab}`, class: {
|
22887 | 'ion-page': component === undefined,
|
22888 | 'tab-hidden': !active
|
22889 | } }, hAsync("slot", null)));
|
22890 | }
|
22891 | get el() { return getElement(this); }
|
22892 | static get watchers() { return {
|
22893 | "active": ["changeActive"]
|
22894 | }; }
|
22895 | static get style() { return tabCss; }
|
22896 | static get cmpMeta() { return {
|
22897 | "$flags$": 9,
|
22898 | "$tagName$": "ion-tab",
|
22899 | "$members$": {
|
22900 | "active": [1028],
|
22901 | "delegate": [16],
|
22902 | "tab": [1],
|
22903 | "component": [1],
|
22904 | "setActive": [64]
|
22905 | },
|
22906 | "$listeners$": undefined,
|
22907 | "$lazyBundleId$": "-",
|
22908 | "$attrsToReflect$": []
|
22909 | }; }
|
22910 | }
|
22911 |
|
22912 | const tabBarIosCss = "/*!@:host*/.sc-ion-tab-bar-ios-h{padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-bottom:var(--ion-safe-area-bottom, 0);border-top:var(--border);background:var(--background);color:var(--color);text-align:center;contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:10;-webkit-box-sizing:content-box !important;box-sizing:content-box !important}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-tab-bar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}/*!@:host(.ion-color) ::slotted(ion-tab-button)*/.sc-ion-tab-bar-ios-h.ion-color .sc-ion-tab-bar-ios-s>ion-tab-button{--background-focused:var(--ion-color-shade);--color-selected:var(--ion-color-contrast)}/*!@:host(.ion-color) ::slotted(.tab-selected)*/.sc-ion-tab-bar-ios-h.ion-color .sc-ion-tab-bar-ios-s>.tab-selected{color:var(--ion-color-contrast)}/*!@:host(.ion-color),\n:host(.ion-color) ::slotted(ion-tab-button)*/.ion-color.sc-ion-tab-bar-ios-h,.sc-ion-tab-bar-ios-h.ion-color .sc-ion-tab-bar-ios-s>ion-tab-button{color:rgba(var(--ion-color-contrast-rgb), 0.7)}/*!@:host(.ion-color),\n:host(.ion-color) ::slotted(ion-tab-button)*/.ion-color.sc-ion-tab-bar-ios-h,.sc-ion-tab-bar-ios-h.ion-color .sc-ion-tab-bar-ios-s>ion-tab-button{background:var(--ion-color-base)}/*!@:host(.ion-color) ::slotted(ion-tab-button.ion-focused),\n:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused)*/.sc-ion-tab-bar-ios-h.ion-color .sc-ion-tab-bar-ios-s>ion-tab-button.ion-focused,.sc-ion-tab-bar-ios-h.tab-bar-translucent .sc-ion-tab-bar-ios-s>ion-tab-button.ion-focused{background:var(--background-focused)}/*!@:host(.tab-bar-translucent) ::slotted(ion-tab-button)*/.sc-ion-tab-bar-ios-h.tab-bar-translucent .sc-ion-tab-bar-ios-s>ion-tab-button{background:transparent}/*!@:host([slot=top])*/[slot=top].sc-ion-tab-bar-ios-h{padding-bottom:0;border-top:0;border-bottom:var(--border)}/*!@:host(.tab-bar-hidden)*/.tab-bar-hidden.sc-ion-tab-bar-ios-h{display:none !important}/*!@:host*/.sc-ion-tab-bar-ios-h{--background:var(--ion-tab-bar-background, var(--ion-background-color, #fff));--background-focused:var(--ion-tab-bar-background-focused, #e0e0e0);--border:0.55px solid var(--ion-tab-bar-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.2))));--color:var(--ion-tab-bar-color, var(--ion-color-step-400, #999999));--color-selected:var(--ion-tab-bar-color-selected, var(--ion-color-primary, #3880ff));height:50px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.tab-bar-translucent)*/.tab-bar-translucent.sc-ion-tab-bar-ios-h{--background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(210%) blur(20px);backdrop-filter:saturate(210%) blur(20px)}/*!@:host(.ion-color.tab-bar-translucent)*/.ion-color.tab-bar-translucent.sc-ion-tab-bar-ios-h{background:rgba(var(--ion-color-base-rgb), 0.8)}/*!@:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused)*/.sc-ion-tab-bar-ios-h.tab-bar-translucent .sc-ion-tab-bar-ios-s>ion-tab-button.ion-focused{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.6)}}";
|
22913 |
|
22914 | const tabBarMdCss = "/*!@:host*/.sc-ion-tab-bar-md-h{padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-bottom:var(--ion-safe-area-bottom, 0);border-top:var(--border);background:var(--background);color:var(--color);text-align:center;contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:10;-webkit-box-sizing:content-box !important;box-sizing:content-box !important}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-tab-bar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}/*!@:host(.ion-color) ::slotted(ion-tab-button)*/.sc-ion-tab-bar-md-h.ion-color .sc-ion-tab-bar-md-s>ion-tab-button{--background-focused:var(--ion-color-shade);--color-selected:var(--ion-color-contrast)}/*!@:host(.ion-color) ::slotted(.tab-selected)*/.sc-ion-tab-bar-md-h.ion-color .sc-ion-tab-bar-md-s>.tab-selected{color:var(--ion-color-contrast)}/*!@:host(.ion-color),\n:host(.ion-color) ::slotted(ion-tab-button)*/.ion-color.sc-ion-tab-bar-md-h,.sc-ion-tab-bar-md-h.ion-color .sc-ion-tab-bar-md-s>ion-tab-button{color:rgba(var(--ion-color-contrast-rgb), 0.7)}/*!@:host(.ion-color),\n:host(.ion-color) ::slotted(ion-tab-button)*/.ion-color.sc-ion-tab-bar-md-h,.sc-ion-tab-bar-md-h.ion-color .sc-ion-tab-bar-md-s>ion-tab-button{background:var(--ion-color-base)}/*!@:host(.ion-color) ::slotted(ion-tab-button.ion-focused),\n:host(.tab-bar-translucent) ::slotted(ion-tab-button.ion-focused)*/.sc-ion-tab-bar-md-h.ion-color .sc-ion-tab-bar-md-s>ion-tab-button.ion-focused,.sc-ion-tab-bar-md-h.tab-bar-translucent .sc-ion-tab-bar-md-s>ion-tab-button.ion-focused{background:var(--background-focused)}/*!@:host(.tab-bar-translucent) ::slotted(ion-tab-button)*/.sc-ion-tab-bar-md-h.tab-bar-translucent .sc-ion-tab-bar-md-s>ion-tab-button{background:transparent}/*!@:host([slot=top])*/[slot=top].sc-ion-tab-bar-md-h{padding-bottom:0;border-top:0;border-bottom:var(--border)}/*!@:host(.tab-bar-hidden)*/.tab-bar-hidden.sc-ion-tab-bar-md-h{display:none !important}/*!@:host*/.sc-ion-tab-bar-md-h{--background:var(--ion-tab-bar-background, var(--ion-background-color, #fff));--background-focused:var(--ion-tab-bar-background-focused, #e0e0e0);--border:1px solid var(--ion-tab-bar-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.07))));--color:var(--ion-tab-bar-color, var(--ion-color-step-600, #666666));--color-selected:var(--ion-tab-bar-color-selected, var(--ion-color-primary, #3880ff));height:56px}";
|
22915 |
|
22916 |
|
22917 |
|
22918 |
|
22919 | class TabBar {
|
22920 | constructor(hostRef) {
|
22921 | registerInstance(this, hostRef);
|
22922 | this.ionTabBarChanged = createEvent(this, "ionTabBarChanged", 7);
|
22923 | this.keyboardVisible = false;
|
22924 | |
22925 |
|
22926 |
|
22927 |
|
22928 |
|
22929 | this.translucent = false;
|
22930 | }
|
22931 | selectedTabChanged() {
|
22932 | if (this.selectedTab !== undefined) {
|
22933 | this.ionTabBarChanged.emit({
|
22934 | tab: this.selectedTab
|
22935 | });
|
22936 | }
|
22937 | }
|
22938 | componentWillLoad() {
|
22939 | this.selectedTabChanged();
|
22940 | }
|
22941 | connectedCallback() {
|
22942 | if (typeof window !== 'undefined') {
|
22943 | this.keyboardWillShowHandler = () => {
|
22944 | if (this.el.getAttribute('slot') !== 'top') {
|
22945 | this.keyboardVisible = true;
|
22946 | }
|
22947 | };
|
22948 | this.keyboardWillHideHandler = () => {
|
22949 | setTimeout(() => this.keyboardVisible = false, 50);
|
22950 | };
|
22951 | window.addEventListener('keyboardWillShow', this.keyboardWillShowHandler);
|
22952 | window.addEventListener('keyboardWillHide', this.keyboardWillHideHandler);
|
22953 | }
|
22954 | }
|
22955 | disconnectedCallback() {
|
22956 | if (typeof window !== 'undefined') {
|
22957 | window.removeEventListener('keyboardWillShow', this.keyboardWillShowHandler);
|
22958 | window.removeEventListener('keyboardWillHide', this.keyboardWillHideHandler);
|
22959 | this.keyboardWillShowHandler = this.keyboardWillHideHandler = undefined;
|
22960 | }
|
22961 | }
|
22962 | render() {
|
22963 | const { color, translucent, keyboardVisible } = this;
|
22964 | const mode = getIonMode$1(this);
|
22965 | return (hAsync(Host, { role: "tablist", "aria-hidden": keyboardVisible ? 'true' : null, class: createColorClasses$1(color, {
|
22966 | [mode]: true,
|
22967 | 'tab-bar-translucent': translucent,
|
22968 | 'tab-bar-hidden': keyboardVisible,
|
22969 | }) }, hAsync("slot", null)));
|
22970 | }
|
22971 | get el() { return getElement(this); }
|
22972 | static get watchers() { return {
|
22973 | "selectedTab": ["selectedTabChanged"]
|
22974 | }; }
|
22975 | static get style() { return {
|
22976 | ios: tabBarIosCss,
|
22977 | md: tabBarMdCss
|
22978 | }; }
|
22979 | static get cmpMeta() { return {
|
22980 | "$flags$": 41,
|
22981 | "$tagName$": "ion-tab-bar",
|
22982 | "$members$": {
|
22983 | "color": [513],
|
22984 | "selectedTab": [1, "selected-tab"],
|
22985 | "translucent": [4],
|
22986 | "keyboardVisible": [32]
|
22987 | },
|
22988 | "$listeners$": undefined,
|
22989 | "$lazyBundleId$": "-",
|
22990 | "$attrsToReflect$": [["color", "color"]]
|
22991 | }; }
|
22992 | }
|
22993 |
|
22994 | const tabButtonIosCss = "/*!@:host*/.sc-ion-tab-button-ios-h{--ripple-color:var(--color-selected);--background-focused-opacity:1;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;outline:none;background:var(--background);color:var(--color)}/*!@.button-native*/.button-native.sc-ion-tab-button-ios{border-radius:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;height:100%;border:0;outline:none;background:transparent;text-decoration:none;cursor:pointer;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-drag:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-tab-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-native::after*/.button-native.sc-ion-tab-button-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@.button-inner*/.button-inner.sc-ion-tab-button-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;height:100%;z-index:1}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-tab-button-ios-h .button-native.sc-ion-tab-button-ios{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-tab-button-ios-h .button-native.sc-ion-tab-button-ios::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){/*!@a:hover*/a.sc-ion-tab-button-ios:hover{color:var(--color-selected)}}/*!@:host(.tab-selected)*/.tab-selected.sc-ion-tab-button-ios-h{color:var(--color-selected)}/*!@:host(.tab-hidden)*/.tab-hidden.sc-ion-tab-button-ios-h{display:none !important}/*!@:host(.tab-disabled)*/.tab-disabled.sc-ion-tab-button-ios-h{pointer-events:none;opacity:0.4}/*!@::slotted(ion-label),\n::slotted(ion-icon)*/.sc-ion-tab-button-ios-s>ion-label,.sc-ion-tab-button-ios-s>ion-icon{display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@::slotted(ion-label)*/.sc-ion-tab-button-ios-s>ion-label{-ms-flex-order:0;order:0}/*!@::slotted(ion-icon)*/.sc-ion-tab-button-ios-s>ion-icon{-ms-flex-order:-1;order:-1;height:1em}/*!@:host(.tab-has-label-only) ::slotted(ion-label)*/.sc-ion-tab-button-ios-h.tab-has-label-only .sc-ion-tab-button-ios-s>ion-label{white-space:normal}/*!@::slotted(ion-badge)*/.sc-ion-tab-button-ios-s>ion-badge{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1}/*!@:host(.tab-layout-icon-start)*/.tab-layout-icon-start.sc-ion-tab-button-ios-h{-ms-flex-direction:row;flex-direction:row}/*!@:host(.tab-layout-icon-end)*/.tab-layout-icon-end.sc-ion-tab-button-ios-h{-ms-flex-direction:row-reverse;flex-direction:row-reverse}/*!@:host(.tab-layout-icon-bottom)*/.tab-layout-icon-bottom.sc-ion-tab-button-ios-h{-ms-flex-direction:column-reverse;flex-direction:column-reverse}/*!@:host(.tab-layout-icon-hide) ::slotted(ion-icon)*/.sc-ion-tab-button-ios-h.tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-icon{display:none}/*!@:host(.tab-layout-label-hide) ::slotted(ion-label)*/.sc-ion-tab-button-ios-h.tab-layout-label-hide .sc-ion-tab-button-ios-s>ion-label{display:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-tab-button-ios{color:var(--ripple-color)}/*!@:host*/.sc-ion-tab-button-ios-h{--padding-top:0;--padding-end:2px;--padding-bottom:0;--padding-start:2px;max-width:240px;font-size:10px}/*!@::slotted(ion-badge)*/.sc-ion-tab-button-ios-s>ion-badge{padding-left:6px;padding-right:6px;padding-top:1px;padding-bottom:1px;left:calc(50% + 6px);top:4px;height:auto;font-size:12px;line-height:16px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-badge)*/.sc-ion-tab-button-ios-s>ion-badge{padding-left:unset;padding-right:unset;-webkit-padding-start:6px;padding-inline-start:6px;-webkit-padding-end:6px;padding-inline-end:6px}}/*!@[dir=rtl] ::slotted(ion-badge), :host-context([dir=rtl]) ::slotted(ion-badge)*/[dir=rtl] .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl] .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h .sc-ion-tab-button-ios-s>ion-badge{left:unset;right:unset;right:calc(50% + 6px)}/*!@::slotted(ion-icon)*/.sc-ion-tab-button-ios-s>ion-icon{margin-top:2px;margin-bottom:2px;font-size:30px}/*!@::slotted(ion-icon::before)*/.sc-ion-tab-button-ios-s>ion-icon::before{vertical-align:top}/*!@::slotted(ion-label)*/.sc-ion-tab-button-ios-s>ion-label{margin-top:0;margin-bottom:1px;min-height:11px;font-weight:500}/*!@:host(.tab-has-label-only) ::slotted(ion-label)*/.sc-ion-tab-button-ios-h.tab-has-label-only .sc-ion-tab-button-ios-s>ion-label{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;font-size:12px;font-size:14px;line-height:1.1}/*!@:host(.tab-layout-icon-end) ::slotted(ion-label),\n:host(.tab-layout-icon-start) ::slotted(ion-label),\n:host(.tab-layout-icon-hide) ::slotted(ion-label)*/.sc-ion-tab-button-ios-h.tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-label,.sc-ion-tab-button-ios-h.tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-label,.sc-ion-tab-button-ios-h.tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-label{margin-top:2px;margin-bottom:2px;font-size:14px;line-height:1.1}/*!@:host(.tab-layout-icon-end) ::slotted(ion-icon),\n:host(.tab-layout-icon-start) ::slotted(ion-icon)*/.sc-ion-tab-button-ios-h.tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-icon,.sc-ion-tab-button-ios-h.tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-icon{min-width:24px;height:26px;margin-top:2px;margin-bottom:1px;font-size:24px}/*!@:host(.tab-layout-icon-bottom) ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h.tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-badge{left:calc(50% + 12px)}/*!@:host-context([dir=rtl]):host(.tab-layout-icon-bottom) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-bottom ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h[dir=rtl].sc-ion-tab-button-ios-h.tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.sc-ion-tab-button-ios-h.tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-badge{left:unset;right:unset;right:calc(50% + 12px)}/*!@:host(.tab-layout-icon-bottom) ::slotted(ion-icon)*/.sc-ion-tab-button-ios-h.tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-icon{margin-top:0;margin-bottom:1px}/*!@:host(.tab-layout-icon-bottom) ::slotted(ion-label)*/.sc-ion-tab-button-ios-h.tab-layout-icon-bottom .sc-ion-tab-button-ios-s>ion-label{margin-top:4px}/*!@:host(.tab-layout-icon-start) ::slotted(ion-badge),\n:host(.tab-layout-icon-end) ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h.tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h.tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-badge{left:calc(50% + 35px);top:10px}/*!@:host-context([dir=rtl]):host(.tab-layout-icon-start) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-start ::slotted(ion-badge), :host-context([dir=rtl]):host(.tab-layout-icon-end) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-end ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h[dir=rtl].sc-ion-tab-button-ios-h.tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.sc-ion-tab-button-ios-h.tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.tab-layout-icon-start .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].sc-ion-tab-button-ios-h.tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.sc-ion-tab-button-ios-h.tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.tab-layout-icon-end .sc-ion-tab-button-ios-s>ion-badge{left:unset;right:unset;right:calc(50% + 35px)}/*!@:host(.tab-layout-icon-hide) ::slotted(ion-badge),\n:host(.tab-has-label-only) ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h.tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h.tab-has-label-only .sc-ion-tab-button-ios-s>ion-badge{left:calc(50% + 30px);top:10px}/*!@:host-context([dir=rtl]):host(.tab-layout-icon-hide) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-hide ::slotted(ion-badge), :host-context([dir=rtl]):host(.tab-has-label-only) ::slotted(ion-badge), :host-context([dir=rtl]).tab-has-label-only ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h[dir=rtl].sc-ion-tab-button-ios-h.tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.sc-ion-tab-button-ios-h.tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.tab-layout-icon-hide .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].sc-ion-tab-button-ios-h.tab-has-label-only .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.sc-ion-tab-button-ios-h.tab-has-label-only .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h[dir=rtl].tab-has-label-only .sc-ion-tab-button-ios-s>ion-badge,[dir=rtl] .sc-ion-tab-button-ios-h.tab-has-label-only .sc-ion-tab-button-ios-s>ion-badge{left:unset;right:unset;right:calc(50% + 30px)}/*!@:host(.tab-layout-label-hide) ::slotted(ion-badge),\n:host(.tab-has-icon-only) ::slotted(ion-badge)*/.sc-ion-tab-button-ios-h.tab-layout-label-hide .sc-ion-tab-button-ios-s>ion-badge,.sc-ion-tab-button-ios-h.tab-has-icon-only .sc-ion-tab-button-ios-s>ion-badge{top:10px}/*!@:host(.tab-layout-label-hide) ::slotted(ion-icon)*/.sc-ion-tab-button-ios-h.tab-layout-label-hide .sc-ion-tab-button-ios-s>ion-icon{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}";
|
22995 |
|
22996 | const tabButtonMdCss = "/*!@:host*/.sc-ion-tab-button-md-h{--ripple-color:var(--color-selected);--background-focused-opacity:1;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:100%;outline:none;background:var(--background);color:var(--color)}/*!@.button-native*/.button-native.sc-ion-tab-button-md{border-radius:inherit;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:inherit;flex-direction:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;height:100%;border:0;outline:none;background:transparent;text-decoration:none;cursor:pointer;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-user-drag:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.button-native*/.button-native.sc-ion-tab-button-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.button-native::after*/.button-native.sc-ion-tab-button-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}/*!@.button-inner*/.button-inner.sc-ion-tab-button-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-flow:inherit;flex-flow:inherit;-ms-flex-align:inherit;align-items:inherit;-ms-flex-pack:inherit;justify-content:inherit;width:100%;height:100%;z-index:1}/*!@:host(.ion-focused) .button-native*/.ion-focused.sc-ion-tab-button-md-h .button-native.sc-ion-tab-button-md{color:var(--color-focused)}/*!@:host(.ion-focused) .button-native::after*/.ion-focused.sc-ion-tab-button-md-h .button-native.sc-ion-tab-button-md::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){/*!@a:hover*/a.sc-ion-tab-button-md:hover{color:var(--color-selected)}}/*!@:host(.tab-selected)*/.tab-selected.sc-ion-tab-button-md-h{color:var(--color-selected)}/*!@:host(.tab-hidden)*/.tab-hidden.sc-ion-tab-button-md-h{display:none !important}/*!@:host(.tab-disabled)*/.tab-disabled.sc-ion-tab-button-md-h{pointer-events:none;opacity:0.4}/*!@::slotted(ion-label),\n::slotted(ion-icon)*/.sc-ion-tab-button-md-s>ion-label,.sc-ion-tab-button-md-s>ion-icon{display:block;-ms-flex-item-align:center;align-self:center;max-width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box}/*!@::slotted(ion-label)*/.sc-ion-tab-button-md-s>ion-label{-ms-flex-order:0;order:0}/*!@::slotted(ion-icon)*/.sc-ion-tab-button-md-s>ion-icon{-ms-flex-order:-1;order:-1;height:1em}/*!@:host(.tab-has-label-only) ::slotted(ion-label)*/.sc-ion-tab-button-md-h.tab-has-label-only .sc-ion-tab-button-md-s>ion-label{white-space:normal}/*!@::slotted(ion-badge)*/.sc-ion-tab-button-md-s>ion-badge{-webkit-box-sizing:border-box;box-sizing:border-box;position:absolute;z-index:1}/*!@:host(.tab-layout-icon-start)*/.tab-layout-icon-start.sc-ion-tab-button-md-h{-ms-flex-direction:row;flex-direction:row}/*!@:host(.tab-layout-icon-end)*/.tab-layout-icon-end.sc-ion-tab-button-md-h{-ms-flex-direction:row-reverse;flex-direction:row-reverse}/*!@:host(.tab-layout-icon-bottom)*/.tab-layout-icon-bottom.sc-ion-tab-button-md-h{-ms-flex-direction:column-reverse;flex-direction:column-reverse}/*!@:host(.tab-layout-icon-hide) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-icon{display:none}/*!@:host(.tab-layout-label-hide) ::slotted(ion-label)*/.sc-ion-tab-button-md-h.tab-layout-label-hide .sc-ion-tab-button-md-s>ion-label{display:none}/*!@ion-ripple-effect*/ion-ripple-effect.sc-ion-tab-button-md{color:var(--ripple-color)}/*!@:host*/.sc-ion-tab-button-md-h{--padding-top:0;--padding-end:12px;--padding-bottom:0;--padding-start:12px;max-width:168px;font-size:12px;font-weight:normal;letter-spacing:0.03em}/*!@::slotted(ion-label)*/.sc-ion-tab-button-md-s>ion-label{margin-left:0;margin-right:0;margin-top:2px;margin-bottom:2px;text-transform:none}/*!@::slotted(ion-icon)*/.sc-ion-tab-button-md-s>ion-icon{margin-left:0;margin-right:0;margin-top:16px;margin-bottom:16px;-webkit-transform-origin:center center;transform-origin:center center;font-size:22px}/*!@[dir=rtl] ::slotted(ion-icon), :host-context([dir=rtl]) ::slotted(ion-icon)*/[dir=rtl] .sc-ion-tab-button-md-s>ion-icon,.sc-ion-tab-button-md-h[dir=rtl] .sc-ion-tab-button-md-s>ion-icon,[dir=rtl] .sc-ion-tab-button-md-h .sc-ion-tab-button-md-s>ion-icon{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}/*!@::slotted(ion-badge)*/.sc-ion-tab-button-md-s>ion-badge{border-radius:8px;padding-left:2px;padding-right:2px;padding-top:3px;padding-bottom:2px;left:calc(50% + 6px);top:8px;min-width:12px;font-size:8px;font-weight:normal}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(ion-badge)*/.sc-ion-tab-button-md-s>ion-badge{padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px}}/*!@[dir=rtl] ::slotted(ion-badge), :host-context([dir=rtl]) ::slotted(ion-badge)*/[dir=rtl] .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl] .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h .sc-ion-tab-button-md-s>ion-badge{left:unset;right:unset;right:calc(50% + 6px)}/*!@::slotted(ion-badge:empty)*/.sc-ion-tab-button-md-s>ion-badge:empty{display:block;min-width:8px;height:8px}/*!@:host(.tab-layout-icon-top) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-top .sc-ion-tab-button-md-s>ion-icon{margin-top:6px;margin-bottom:2px}/*!@:host(.tab-layout-icon-top) ::slotted(ion-label)*/.sc-ion-tab-button-md-h.tab-layout-icon-top .sc-ion-tab-button-md-s>ion-label{margin-top:0;margin-bottom:6px}/*!@:host(.tab-layout-icon-bottom) ::slotted(ion-badge)*/.sc-ion-tab-button-md-h.tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-badge{left:70%;top:8px}/*!@:host-context([dir=rtl]):host(.tab-layout-icon-bottom) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-bottom ::slotted(ion-badge)*/.sc-ion-tab-button-md-h[dir=rtl].sc-ion-tab-button-md-h.tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.sc-ion-tab-button-md-h.tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-badge{left:unset;right:unset;right:70%}/*!@:host(.tab-layout-icon-bottom) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-icon{margin-top:0;margin-bottom:6px}/*!@:host(.tab-layout-icon-bottom) ::slotted(ion-label)*/.sc-ion-tab-button-md-h.tab-layout-icon-bottom .sc-ion-tab-button-md-s>ion-label{margin-top:6px;margin-bottom:0}/*!@:host(.tab-layout-icon-start) ::slotted(ion-badge),\n:host(.tab-layout-icon-end) ::slotted(ion-badge)*/.sc-ion-tab-button-md-h.tab-layout-icon-start .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h.tab-layout-icon-end .sc-ion-tab-button-md-s>ion-badge{left:80%;top:16px}/*!@:host-context([dir=rtl]):host(.tab-layout-icon-start) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-start ::slotted(ion-badge), :host-context([dir=rtl]):host(.tab-layout-icon-end) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-end ::slotted(ion-badge)*/.sc-ion-tab-button-md-h[dir=rtl].sc-ion-tab-button-md-h.tab-layout-icon-start .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.sc-ion-tab-button-md-h.tab-layout-icon-start .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].tab-layout-icon-start .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.tab-layout-icon-start .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].sc-ion-tab-button-md-h.tab-layout-icon-end .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.sc-ion-tab-button-md-h.tab-layout-icon-end .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].tab-layout-icon-end .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.tab-layout-icon-end .sc-ion-tab-button-md-s>ion-badge{left:unset;right:unset;right:80%}/*!@:host(.tab-layout-icon-start) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-start .sc-ion-tab-button-md-s>ion-icon{margin-right:6px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.tab-layout-icon-start) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-start .sc-ion-tab-button-md-s>ion-icon{margin-right:unset;-webkit-margin-end:6px;margin-inline-end:6px}}/*!@:host(.tab-layout-icon-end) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-end .sc-ion-tab-button-md-s>ion-icon{margin-left:6px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.tab-layout-icon-end) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-icon-end .sc-ion-tab-button-md-s>ion-icon{margin-left:unset;-webkit-margin-start:6px;margin-inline-start:6px}}/*!@:host(.tab-layout-icon-hide) ::slotted(ion-badge),\n:host(.tab-has-label-only) ::slotted(ion-badge)*/.sc-ion-tab-button-md-h.tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h.tab-has-label-only .sc-ion-tab-button-md-s>ion-badge{left:70%;top:16px}/*!@:host-context([dir=rtl]):host(.tab-layout-icon-hide) ::slotted(ion-badge), :host-context([dir=rtl]).tab-layout-icon-hide ::slotted(ion-badge), :host-context([dir=rtl]):host(.tab-has-label-only) ::slotted(ion-badge), :host-context([dir=rtl]).tab-has-label-only ::slotted(ion-badge)*/.sc-ion-tab-button-md-h[dir=rtl].sc-ion-tab-button-md-h.tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.sc-ion-tab-button-md-h.tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].sc-ion-tab-button-md-h.tab-has-label-only .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.sc-ion-tab-button-md-h.tab-has-label-only .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h[dir=rtl].tab-has-label-only .sc-ion-tab-button-md-s>ion-badge,[dir=rtl] .sc-ion-tab-button-md-h.tab-has-label-only .sc-ion-tab-button-md-s>ion-badge{left:unset;right:unset;right:70%}/*!@:host(.tab-layout-icon-hide) ::slotted(ion-label),\n:host(.tab-has-label-only) ::slotted(ion-label)*/.sc-ion-tab-button-md-h.tab-layout-icon-hide .sc-ion-tab-button-md-s>ion-label,.sc-ion-tab-button-md-h.tab-has-label-only .sc-ion-tab-button-md-s>ion-label{margin-top:0;margin-bottom:0}/*!@:host(.tab-layout-label-hide) ::slotted(ion-badge),\n:host(.tab-has-icon-only) ::slotted(ion-badge)*/.sc-ion-tab-button-md-h.tab-layout-label-hide .sc-ion-tab-button-md-s>ion-badge,.sc-ion-tab-button-md-h.tab-has-icon-only .sc-ion-tab-button-md-s>ion-badge{top:16px}/*!@:host(.tab-layout-label-hide) ::slotted(ion-icon),\n:host(.tab-has-icon-only) ::slotted(ion-icon)*/.sc-ion-tab-button-md-h.tab-layout-label-hide .sc-ion-tab-button-md-s>ion-icon,.sc-ion-tab-button-md-h.tab-has-icon-only .sc-ion-tab-button-md-s>ion-icon{margin-top:0;margin-bottom:0;font-size:24px}";
|
22997 |
|
22998 |
|
22999 |
|
23000 |
|
23001 |
|
23002 |
|
23003 | class TabButton {
|
23004 | constructor(hostRef) {
|
23005 | registerInstance(this, hostRef);
|
23006 | this.ionTabButtonClick = createEvent(this, "ionTabButtonClick", 7);
|
23007 | |
23008 |
|
23009 |
|
23010 | this.disabled = false;
|
23011 | |
23012 |
|
23013 |
|
23014 | this.selected = false;
|
23015 | this.onKeyUp = (ev) => {
|
23016 | if (ev.key === 'Enter' || ev.key === ' ') {
|
23017 | this.selectTab(ev);
|
23018 | }
|
23019 | };
|
23020 | this.onClick = (ev) => {
|
23021 | this.selectTab(ev);
|
23022 | };
|
23023 | }
|
23024 | onTabBarChanged(ev) {
|
23025 | const dispatchedFrom = ev.target;
|
23026 | const parent = this.el.parentElement;
|
23027 | if ((ev.composedPath && ev.composedPath().includes(parent)) || (dispatchedFrom && dispatchedFrom.contains(this.el))) {
|
23028 | this.selected = this.tab === ev.detail.tab;
|
23029 | }
|
23030 | }
|
23031 | componentWillLoad() {
|
23032 | if (this.layout === undefined) {
|
23033 | this.layout = config.get('tabButtonLayout', 'icon-top');
|
23034 | }
|
23035 | }
|
23036 | selectTab(ev) {
|
23037 | if (this.tab !== undefined) {
|
23038 | if (!this.disabled) {
|
23039 | this.ionTabButtonClick.emit({
|
23040 | tab: this.tab,
|
23041 | href: this.href,
|
23042 | selected: this.selected
|
23043 | });
|
23044 | }
|
23045 | ev.preventDefault();
|
23046 | }
|
23047 | }
|
23048 | get hasLabel() {
|
23049 | return !!this.el.querySelector('ion-label');
|
23050 | }
|
23051 | get hasIcon() {
|
23052 | return !!this.el.querySelector('ion-icon');
|
23053 | }
|
23054 | get tabIndex() {
|
23055 | if (this.disabled) {
|
23056 | return -1;
|
23057 | }
|
23058 | const hasTabIndex = this.el.hasAttribute('tabindex');
|
23059 | if (hasTabIndex) {
|
23060 | return this.el.getAttribute('tabindex');
|
23061 | }
|
23062 | return 0;
|
23063 | }
|
23064 | render() {
|
23065 | const { disabled, hasIcon, hasLabel, tabIndex, href, rel, target, layout, selected, tab } = this;
|
23066 | const mode = getIonMode$1(this);
|
23067 | const attrs = {
|
23068 | download: this.download,
|
23069 | href,
|
23070 | rel,
|
23071 | target
|
23072 | };
|
23073 | return (hAsync(Host, { onClick: this.onClick, onKeyup: this.onKeyUp, role: "tab", tabindex: tabIndex, "aria-selected": selected ? 'true' : null, id: tab !== undefined ? `tab-button-${tab}` : null, class: {
|
23074 | [mode]: true,
|
23075 | 'tab-selected': selected,
|
23076 | 'tab-disabled': disabled,
|
23077 | 'tab-has-label': hasLabel,
|
23078 | 'tab-has-icon': hasIcon,
|
23079 | 'tab-has-label-only': hasLabel && !hasIcon,
|
23080 | 'tab-has-icon-only': hasIcon && !hasLabel,
|
23081 | [`tab-layout-${layout}`]: true,
|
23082 | 'ion-activatable': true,
|
23083 | 'ion-selectable': true,
|
23084 | 'ion-focusable': true
|
23085 | } }, hAsync("a", Object.assign({}, attrs, { tabIndex: -1, class: "button-native", part: "native" }), hAsync("span", { class: "button-inner" }, hAsync("slot", null)), mode === 'md' && hAsync("ion-ripple-effect", { type: "unbounded" }))));
|
23086 | }
|
23087 | get el() { return getElement(this); }
|
23088 | static get style() { return {
|
23089 | ios: tabButtonIosCss,
|
23090 | md: tabButtonMdCss
|
23091 | }; }
|
23092 | static get cmpMeta() { return {
|
23093 | "$flags$": 41,
|
23094 | "$tagName$": "ion-tab-button",
|
23095 | "$members$": {
|
23096 | "disabled": [4],
|
23097 | "download": [1],
|
23098 | "href": [1],
|
23099 | "rel": [1],
|
23100 | "layout": [1025],
|
23101 | "selected": [1028],
|
23102 | "tab": [1],
|
23103 | "target": [1]
|
23104 | },
|
23105 | "$listeners$": [[8, "ionTabBarChanged", "onTabBarChanged"]],
|
23106 | "$lazyBundleId$": "-",
|
23107 | "$attrsToReflect$": []
|
23108 | }; }
|
23109 | }
|
23110 |
|
23111 | const tabsCss = "/*!@:host*/.sc-ion-tabs-h{left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:100%;height:100%;contain:layout size style;z-index:0}/*!@.tabs-inner*/.tabs-inner.sc-ion-tabs{position:relative;-ms-flex:1;flex:1;contain:layout size style}";
|
23112 |
|
23113 |
|
23114 |
|
23115 |
|
23116 |
|
23117 |
|
23118 | class Tabs {
|
23119 | constructor(hostRef) {
|
23120 | registerInstance(this, hostRef);
|
23121 | this.ionNavWillLoad = createEvent(this, "ionNavWillLoad", 7);
|
23122 | this.ionTabsWillChange = createEvent(this, "ionTabsWillChange", 3);
|
23123 | this.ionTabsDidChange = createEvent(this, "ionTabsDidChange", 3);
|
23124 | this.transitioning = false;
|
23125 |
|
23126 | this.useRouter = false;
|
23127 | this.onTabClicked = (ev) => {
|
23128 | const { href, tab } = ev.detail;
|
23129 | if (this.useRouter && href !== undefined) {
|
23130 | const router = document.querySelector('ion-router');
|
23131 | if (router) {
|
23132 | router.push(href);
|
23133 | }
|
23134 | }
|
23135 | else {
|
23136 | this.select(tab);
|
23137 | }
|
23138 | };
|
23139 | }
|
23140 | async componentWillLoad() {
|
23141 | if (!this.useRouter) {
|
23142 | this.useRouter = !!document.querySelector('ion-router') && !this.el.closest('[no-router]');
|
23143 | }
|
23144 | if (!this.useRouter) {
|
23145 | const tabs = this.tabs;
|
23146 | if (tabs.length > 0) {
|
23147 | await this.select(tabs[0]);
|
23148 | }
|
23149 | }
|
23150 | this.ionNavWillLoad.emit();
|
23151 | }
|
23152 | componentWillRender() {
|
23153 | const tabBar = this.el.querySelector('ion-tab-bar');
|
23154 | if (tabBar) {
|
23155 | const tab = this.selectedTab ? this.selectedTab.tab : undefined;
|
23156 | tabBar.selectedTab = tab;
|
23157 | }
|
23158 | }
|
23159 | |
23160 |
|
23161 |
|
23162 |
|
23163 |
|
23164 | async select(tab) {
|
23165 | const selectedTab = getTab(this.tabs, tab);
|
23166 | if (!this.shouldSwitch(selectedTab)) {
|
23167 | return false;
|
23168 | }
|
23169 | await this.setActive(selectedTab);
|
23170 | await this.notifyRouter();
|
23171 | this.tabSwitch();
|
23172 | return true;
|
23173 | }
|
23174 | |
23175 |
|
23176 |
|
23177 |
|
23178 |
|
23179 | async getTab(tab) {
|
23180 | return getTab(this.tabs, tab);
|
23181 | }
|
23182 | |
23183 |
|
23184 |
|
23185 | getSelected() {
|
23186 | return Promise.resolve(this.selectedTab ? this.selectedTab.tab : undefined);
|
23187 | }
|
23188 |
|
23189 | async setRouteId(id) {
|
23190 | const selectedTab = getTab(this.tabs, id);
|
23191 | if (!this.shouldSwitch(selectedTab)) {
|
23192 | return { changed: false, element: this.selectedTab };
|
23193 | }
|
23194 | await this.setActive(selectedTab);
|
23195 | return {
|
23196 | changed: true,
|
23197 | element: this.selectedTab,
|
23198 | markVisible: () => this.tabSwitch(),
|
23199 | };
|
23200 | }
|
23201 |
|
23202 | async getRouteId() {
|
23203 | const tabId = this.selectedTab && this.selectedTab.tab;
|
23204 | return tabId !== undefined ? { id: tabId, element: this.selectedTab } : undefined;
|
23205 | }
|
23206 | setActive(selectedTab) {
|
23207 | if (this.transitioning) {
|
23208 | return Promise.reject('transitioning already happening');
|
23209 | }
|
23210 | this.transitioning = true;
|
23211 | this.leavingTab = this.selectedTab;
|
23212 | this.selectedTab = selectedTab;
|
23213 | this.ionTabsWillChange.emit({ tab: selectedTab.tab });
|
23214 | selectedTab.active = true;
|
23215 | return Promise.resolve();
|
23216 | }
|
23217 | tabSwitch() {
|
23218 | const selectedTab = this.selectedTab;
|
23219 | const leavingTab = this.leavingTab;
|
23220 | this.leavingTab = undefined;
|
23221 | this.transitioning = false;
|
23222 | if (!selectedTab) {
|
23223 | return;
|
23224 | }
|
23225 | if (leavingTab !== selectedTab) {
|
23226 | if (leavingTab) {
|
23227 | leavingTab.active = false;
|
23228 | }
|
23229 | this.ionTabsDidChange.emit({ tab: selectedTab.tab });
|
23230 | }
|
23231 | }
|
23232 | notifyRouter() {
|
23233 | if (this.useRouter) {
|
23234 | const router = document.querySelector('ion-router');
|
23235 | if (router) {
|
23236 | return router.navChanged('forward');
|
23237 | }
|
23238 | }
|
23239 | return Promise.resolve(false);
|
23240 | }
|
23241 | shouldSwitch(selectedTab) {
|
23242 | const leavingTab = this.selectedTab;
|
23243 | return selectedTab !== undefined && selectedTab !== leavingTab && !this.transitioning;
|
23244 | }
|
23245 | get tabs() {
|
23246 | return Array.from(this.el.querySelectorAll('ion-tab'));
|
23247 | }
|
23248 | render() {
|
23249 | return (hAsync(Host, { onIonTabButtonClick: this.onTabClicked }, hAsync("slot", { name: "top" }), hAsync("div", { class: "tabs-inner" }, hAsync("slot", null)), hAsync("slot", { name: "bottom" })));
|
23250 | }
|
23251 | get el() { return getElement(this); }
|
23252 | static get style() { return tabsCss; }
|
23253 | static get cmpMeta() { return {
|
23254 | "$flags$": 9,
|
23255 | "$tagName$": "ion-tabs",
|
23256 | "$members$": {
|
23257 | "useRouter": [1028, "use-router"],
|
23258 | "selectedTab": [32],
|
23259 | "select": [64],
|
23260 | "getTab": [64],
|
23261 | "getSelected": [64],
|
23262 | "setRouteId": [64],
|
23263 | "getRouteId": [64]
|
23264 | },
|
23265 | "$listeners$": undefined,
|
23266 | "$lazyBundleId$": "-",
|
23267 | "$attrsToReflect$": []
|
23268 | }; }
|
23269 | }
|
23270 | const getTab = (tabs, tab) => {
|
23271 | const tabEl = (typeof tab === 'string')
|
23272 | ? tabs.find(t => t.tab === tab)
|
23273 | : tab;
|
23274 | if (!tabEl) {
|
23275 | console.error(`tab with id: "${tabEl}" does not exist`);
|
23276 | }
|
23277 | return tabEl;
|
23278 | };
|
23279 |
|
23280 | const textCss = "/*!@:host(.ion-color)*/.ion-color.sc-ion-text-h{color:var(--ion-color-base)}";
|
23281 |
|
23282 |
|
23283 |
|
23284 |
|
23285 | class Text {
|
23286 | constructor(hostRef) {
|
23287 | registerInstance(this, hostRef);
|
23288 | }
|
23289 | render() {
|
23290 | const mode = getIonMode$1(this);
|
23291 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
23292 | [mode]: true,
|
23293 | }) }, hAsync("slot", null)));
|
23294 | }
|
23295 | static get style() { return textCss; }
|
23296 | static get cmpMeta() { return {
|
23297 | "$flags$": 9,
|
23298 | "$tagName$": "ion-text",
|
23299 | "$members$": {
|
23300 | "color": [513]
|
23301 | },
|
23302 | "$listeners$": undefined,
|
23303 | "$lazyBundleId$": "-",
|
23304 | "$attrsToReflect$": [["color", "color"]]
|
23305 | }; }
|
23306 | }
|
23307 |
|
23308 | const textareaIosCss = ".sc-ion-textarea-ios-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;-ms-flex:1;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-textarea-ios-h{background:initial}.ion-color.sc-ion-textarea-ios-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-ios-h,ion-item .sc-ion-textarea-ios-h{-ms-flex-item-align:baseline;align-self:baseline}ion-item.sc-ion-textarea-ios-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-ios-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-ios{min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.native-textarea.sc-ion-textarea-ios{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-ios::-webkit-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-ios::-moz-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-ios:-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-ios::-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-ios::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-ios{opacity:0.4}.cloned-input.sc-ion-textarea-ios{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-ios .cloned-input.sc-ion-textarea-ios,[dir=rtl].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios,[dir=rtl] .sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{left:unset;right:unset;right:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-ios-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-ios-h{-webkit-transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-ios-h,.item-label-stacked .sc-ion-textarea-ios-h,.item-label-floating.sc-ion-textarea-ios-h,.item-label-floating .sc-ion-textarea-ios-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}";
|
23309 |
|
23310 | const textareaMdCss = ".sc-ion-textarea-md-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;-ms-flex:1;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;-webkit-box-sizing:border-box;box-sizing:border-box}.ion-color.sc-ion-textarea-md-h{background:initial}.ion-color.sc-ion-textarea-md-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-md-h,ion-item .sc-ion-textarea-md-h{-ms-flex-item-align:baseline;align-self:baseline}ion-item.sc-ion-textarea-md-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-md-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-md{min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.native-textarea.sc-ion-textarea-md{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;-webkit-box-sizing:border-box;box-sizing:border-box;resize:none;-webkit-appearance:none;-moz-appearance:none;appearance:none}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-md::-webkit-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md::-moz-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md:-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md::-ms-input-placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea.sc-ion-textarea-md::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-md{opacity:0.4}.cloned-input.sc-ion-textarea-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-md .cloned-input.sc-ion-textarea-md,[dir=rtl].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md,[dir=rtl] .sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{left:unset;right:unset;right:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-md-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-md-h{-webkit-transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:8px;margin-left:0;margin-right:0;margin-top:8px;margin-bottom:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-md-h,.item-label-stacked .sc-ion-textarea-md-h,.item-label-floating.sc-ion-textarea-md-h,.item-label-floating .sc-ion-textarea-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}";
|
23311 |
|
23312 |
|
23313 |
|
23314 |
|
23315 | class Textarea {
|
23316 | constructor(hostRef) {
|
23317 | registerInstance(this, hostRef);
|
23318 | this.ionChange = createEvent(this, "ionChange", 7);
|
23319 | this.ionInput = createEvent(this, "ionInput", 7);
|
23320 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
23321 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
23322 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
23323 | this.inputId = `ion-textarea-${textareaIds++}`;
|
23324 | this.didBlurAfterEdit = false;
|
23325 | this.inheritedAttributes = {};
|
23326 | |
23327 |
|
23328 |
|
23329 |
|
23330 |
|
23331 |
|
23332 |
|
23333 |
|
23334 | this.fireFocusEvents = true;
|
23335 | this.hasFocus = false;
|
23336 | |
23337 |
|
23338 |
|
23339 | this.autocapitalize = 'none';
|
23340 | |
23341 |
|
23342 |
|
23343 | this.autofocus = false;
|
23344 | |
23345 |
|
23346 |
|
23347 | this.clearOnEdit = false;
|
23348 | |
23349 |
|
23350 |
|
23351 | this.debounce = 0;
|
23352 | |
23353 |
|
23354 |
|
23355 | this.disabled = false;
|
23356 | |
23357 |
|
23358 |
|
23359 | this.name = this.inputId;
|
23360 | |
23361 |
|
23362 |
|
23363 | this.readonly = false;
|
23364 | |
23365 |
|
23366 |
|
23367 | this.required = false;
|
23368 | |
23369 |
|
23370 |
|
23371 | this.spellcheck = false;
|
23372 | |
23373 |
|
23374 |
|
23375 | this.autoGrow = false;
|
23376 | |
23377 |
|
23378 |
|
23379 | this.value = '';
|
23380 | this.onInput = (ev) => {
|
23381 | if (this.nativeInput) {
|
23382 | this.value = this.nativeInput.value;
|
23383 | }
|
23384 | this.emitStyle();
|
23385 | this.ionInput.emit(ev);
|
23386 | };
|
23387 | this.onFocus = (ev) => {
|
23388 | this.hasFocus = true;
|
23389 | this.focusChange();
|
23390 | if (this.fireFocusEvents) {
|
23391 | this.ionFocus.emit(ev);
|
23392 | }
|
23393 | };
|
23394 | this.onBlur = (ev) => {
|
23395 | this.hasFocus = false;
|
23396 | this.focusChange();
|
23397 | if (this.fireFocusEvents) {
|
23398 | this.ionBlur.emit(ev);
|
23399 | }
|
23400 | };
|
23401 | this.onKeyDown = () => {
|
23402 | this.checkClearOnEdit();
|
23403 | };
|
23404 | }
|
23405 | debounceChanged() {
|
23406 | this.ionChange = debounceEvent(this.ionChange, this.debounce);
|
23407 | }
|
23408 | disabledChanged() {
|
23409 | this.emitStyle();
|
23410 | }
|
23411 | |
23412 |
|
23413 |
|
23414 | valueChanged() {
|
23415 | const nativeInput = this.nativeInput;
|
23416 | const value = this.getValue();
|
23417 | if (nativeInput && nativeInput.value !== value) {
|
23418 | nativeInput.value = value;
|
23419 | }
|
23420 | this.runAutoGrow();
|
23421 | this.emitStyle();
|
23422 | this.ionChange.emit({ value });
|
23423 | }
|
23424 | connectedCallback() {
|
23425 | this.emitStyle();
|
23426 | this.debounceChanged();
|
23427 | }
|
23428 | disconnectedCallback() {
|
23429 | }
|
23430 | componentWillLoad() {
|
23431 | this.inheritedAttributes = inheritAttributes(this.el, ['title']);
|
23432 | }
|
23433 | componentDidLoad() {
|
23434 | raf(() => this.runAutoGrow());
|
23435 | }
|
23436 | runAutoGrow() {
|
23437 | const nativeInput = this.nativeInput;
|
23438 | if (nativeInput && this.autoGrow) {
|
23439 | readTask(() => {
|
23440 | nativeInput.style.height = 'auto';
|
23441 | nativeInput.style.height = nativeInput.scrollHeight + 'px';
|
23442 | if (this.textareaWrapper) {
|
23443 | this.textareaWrapper.style.height = nativeInput.scrollHeight + 'px';
|
23444 | }
|
23445 | });
|
23446 | }
|
23447 | }
|
23448 | |
23449 |
|
23450 |
|
23451 |
|
23452 | async setFocus() {
|
23453 | if (this.nativeInput) {
|
23454 | this.nativeInput.focus();
|
23455 | }
|
23456 | }
|
23457 | |
23458 |
|
23459 |
|
23460 |
|
23461 |
|
23462 | async setBlur() {
|
23463 | if (this.nativeInput) {
|
23464 | this.nativeInput.blur();
|
23465 | }
|
23466 | }
|
23467 | |
23468 |
|
23469 |
|
23470 | getInputElement() {
|
23471 | return Promise.resolve(this.nativeInput);
|
23472 | }
|
23473 | emitStyle() {
|
23474 | this.ionStyle.emit({
|
23475 | 'interactive': true,
|
23476 | 'textarea': true,
|
23477 | 'input': true,
|
23478 | 'interactive-disabled': this.disabled,
|
23479 | 'has-placeholder': this.placeholder != null,
|
23480 | 'has-value': this.hasValue(),
|
23481 | 'has-focus': this.hasFocus
|
23482 | });
|
23483 | }
|
23484 | |
23485 |
|
23486 |
|
23487 | checkClearOnEdit() {
|
23488 | if (!this.clearOnEdit) {
|
23489 | return;
|
23490 | }
|
23491 |
|
23492 | if (this.didBlurAfterEdit && this.hasValue()) {
|
23493 |
|
23494 | this.value = '';
|
23495 | }
|
23496 |
|
23497 | this.didBlurAfterEdit = false;
|
23498 | }
|
23499 | focusChange() {
|
23500 |
|
23501 | if (this.clearOnEdit && !this.hasFocus && this.hasValue()) {
|
23502 | this.didBlurAfterEdit = true;
|
23503 | }
|
23504 | this.emitStyle();
|
23505 | }
|
23506 | hasValue() {
|
23507 | return this.getValue() !== '';
|
23508 | }
|
23509 | getValue() {
|
23510 | return this.value || '';
|
23511 | }
|
23512 | render() {
|
23513 | const mode = getIonMode$1(this);
|
23514 | const value = this.getValue();
|
23515 | const labelId = this.inputId + '-lbl';
|
23516 | const label = findItemLabel(this.el);
|
23517 | if (label) {
|
23518 | label.id = labelId;
|
23519 | }
|
23520 | return (hAsync(Host, { "aria-disabled": this.disabled ? 'true' : null, class: createColorClasses$1(this.color, {
|
23521 | [mode]: true,
|
23522 | }) }, hAsync("div", { class: "textarea-wrapper", ref: el => this.textareaWrapper = el }, hAsync("textarea", Object.assign({ class: "native-textarea", "aria-labelledby": label ? labelId : null, ref: el => this.nativeInput = el, autoCapitalize: this.autocapitalize, autoFocus: this.autofocus, enterKeyHint: this.enterkeyhint, inputMode: this.inputmode, disabled: this.disabled, maxLength: this.maxlength, minLength: this.minlength, name: this.name, placeholder: this.placeholder || '', readOnly: this.readonly, required: this.required, spellcheck: this.spellcheck, cols: this.cols, rows: this.rows, wrap: this.wrap, onInput: this.onInput, onBlur: this.onBlur, onFocus: this.onFocus, onKeyDown: this.onKeyDown }, this.inheritedAttributes), value))));
|
23523 | }
|
23524 | get el() { return getElement(this); }
|
23525 | static get watchers() { return {
|
23526 | "debounce": ["debounceChanged"],
|
23527 | "disabled": ["disabledChanged"],
|
23528 | "value": ["valueChanged"]
|
23529 | }; }
|
23530 | static get style() { return {
|
23531 | ios: textareaIosCss,
|
23532 | md: textareaMdCss
|
23533 | }; }
|
23534 | static get cmpMeta() { return {
|
23535 | "$flags$": 34,
|
23536 | "$tagName$": "ion-textarea",
|
23537 | "$members$": {
|
23538 | "fireFocusEvents": [4, "fire-focus-events"],
|
23539 | "color": [513],
|
23540 | "autocapitalize": [1],
|
23541 | "autofocus": [4],
|
23542 | "clearOnEdit": [1028, "clear-on-edit"],
|
23543 | "debounce": [2],
|
23544 | "disabled": [4],
|
23545 | "inputmode": [1],
|
23546 | "enterkeyhint": [1],
|
23547 | "maxlength": [2],
|
23548 | "minlength": [2],
|
23549 | "name": [1],
|
23550 | "placeholder": [1],
|
23551 | "readonly": [4],
|
23552 | "required": [4],
|
23553 | "spellcheck": [4],
|
23554 | "cols": [2],
|
23555 | "rows": [2],
|
23556 | "wrap": [1],
|
23557 | "autoGrow": [4, "auto-grow"],
|
23558 | "value": [1025],
|
23559 | "hasFocus": [32],
|
23560 | "setFocus": [64],
|
23561 | "setBlur": [64],
|
23562 | "getInputElement": [64]
|
23563 | },
|
23564 | "$listeners$": undefined,
|
23565 | "$lazyBundleId$": "-",
|
23566 | "$attrsToReflect$": [["color", "color"]]
|
23567 | }; }
|
23568 | }
|
23569 | let textareaIds = 0;
|
23570 |
|
23571 | const thumbnailCss = "/*!@:host*/.sc-ion-thumbnail-h{--size:48px;--border-radius:0;border-radius:var(--border-radius);display:block;width:var(--size);height:var(--size)}/*!@::slotted(ion-img),\n::slotted(img)*/.sc-ion-thumbnail-s>ion-img,.sc-ion-thumbnail-s>img{border-radius:var(--border-radius);width:100%;height:100%;-o-object-fit:cover;object-fit:cover;overflow:hidden}";
|
23572 |
|
23573 | class Thumbnail {
|
23574 | constructor(hostRef) {
|
23575 | registerInstance(this, hostRef);
|
23576 | }
|
23577 | render() {
|
23578 | return (hAsync(Host, { class: getIonMode$1(this) }, hAsync("slot", null)));
|
23579 | }
|
23580 | static get style() { return thumbnailCss; }
|
23581 | static get cmpMeta() { return {
|
23582 | "$flags$": 9,
|
23583 | "$tagName$": "ion-thumbnail",
|
23584 | "$members$": undefined,
|
23585 | "$listeners$": undefined,
|
23586 | "$lazyBundleId$": "-",
|
23587 | "$attrsToReflect$": []
|
23588 | }; }
|
23589 | }
|
23590 |
|
23591 |
|
23592 |
|
23593 |
|
23594 | const iosEnterAnimation = (baseEl, position) => {
|
23595 | const baseAnimation = createAnimation();
|
23596 | const wrapperAnimation = createAnimation();
|
23597 | const hostEl = baseEl.host || baseEl;
|
23598 | const wrapperEl = baseEl.querySelector('.toast-wrapper');
|
23599 | const bottom = `calc(-10px - var(--ion-safe-area-bottom, 0px))`;
|
23600 | const top = `calc(10px + var(--ion-safe-area-top, 0px))`;
|
23601 | wrapperAnimation.addElement(wrapperEl);
|
23602 | switch (position) {
|
23603 | case 'top':
|
23604 | wrapperAnimation.fromTo('transform', 'translateY(-100%)', `translateY(${top})`);
|
23605 | break;
|
23606 | case 'middle':
|
23607 | const topPosition = Math.floor(hostEl.clientHeight / 2 - wrapperEl.clientHeight / 2);
|
23608 | wrapperEl.style.top = `${topPosition}px`;
|
23609 | wrapperAnimation.fromTo('opacity', 0.01, 1);
|
23610 | break;
|
23611 | default:
|
23612 | wrapperAnimation.fromTo('transform', 'translateY(100%)', `translateY(${bottom})`);
|
23613 | break;
|
23614 | }
|
23615 | return baseAnimation
|
23616 | .addElement(hostEl)
|
23617 | .easing('cubic-bezier(.155,1.105,.295,1.12)')
|
23618 | .duration(400)
|
23619 | .addAnimation(wrapperAnimation);
|
23620 | };
|
23621 |
|
23622 |
|
23623 |
|
23624 |
|
23625 | const iosLeaveAnimation = (baseEl, position) => {
|
23626 | const baseAnimation = createAnimation();
|
23627 | const wrapperAnimation = createAnimation();
|
23628 | const hostEl = baseEl.host || baseEl;
|
23629 | const wrapperEl = baseEl.querySelector('.toast-wrapper');
|
23630 | const bottom = `calc(-10px - var(--ion-safe-area-bottom, 0px))`;
|
23631 | const top = `calc(10px + var(--ion-safe-area-top, 0px))`;
|
23632 | wrapperAnimation.addElement(wrapperEl);
|
23633 | switch (position) {
|
23634 | case 'top':
|
23635 | wrapperAnimation.fromTo('transform', `translateY(${top})`, 'translateY(-100%)');
|
23636 | break;
|
23637 | case 'middle':
|
23638 | wrapperAnimation.fromTo('opacity', 0.99, 0);
|
23639 | break;
|
23640 | default:
|
23641 | wrapperAnimation.fromTo('transform', `translateY(${bottom})`, 'translateY(100%)');
|
23642 | break;
|
23643 | }
|
23644 | return baseAnimation
|
23645 | .addElement(hostEl)
|
23646 | .easing('cubic-bezier(.36,.66,.04,1)')
|
23647 | .duration(300)
|
23648 | .addAnimation(wrapperAnimation);
|
23649 | };
|
23650 |
|
23651 |
|
23652 |
|
23653 |
|
23654 | const mdEnterAnimation = (baseEl, position) => {
|
23655 | const baseAnimation = createAnimation();
|
23656 | const wrapperAnimation = createAnimation();
|
23657 | const hostEl = baseEl.host || baseEl;
|
23658 | const wrapperEl = baseEl.querySelector('.toast-wrapper');
|
23659 | const bottom = `calc(8px + var(--ion-safe-area-bottom, 0px))`;
|
23660 | const top = `calc(8px + var(--ion-safe-area-top, 0px))`;
|
23661 | wrapperAnimation.addElement(wrapperEl);
|
23662 | switch (position) {
|
23663 | case 'top':
|
23664 | wrapperEl.style.top = top;
|
23665 | wrapperAnimation.fromTo('opacity', 0.01, 1);
|
23666 | break;
|
23667 | case 'middle':
|
23668 | const topPosition = Math.floor(hostEl.clientHeight / 2 - wrapperEl.clientHeight / 2);
|
23669 | wrapperEl.style.top = `${topPosition}px`;
|
23670 | wrapperAnimation.fromTo('opacity', 0.01, 1);
|
23671 | break;
|
23672 | default:
|
23673 | wrapperEl.style.bottom = bottom;
|
23674 | wrapperAnimation.fromTo('opacity', 0.01, 1);
|
23675 | break;
|
23676 | }
|
23677 | return baseAnimation
|
23678 | .addElement(hostEl)
|
23679 | .easing('cubic-bezier(.36,.66,.04,1)')
|
23680 | .duration(400)
|
23681 | .addAnimation(wrapperAnimation);
|
23682 | };
|
23683 |
|
23684 |
|
23685 |
|
23686 |
|
23687 | const mdLeaveAnimation = (baseEl) => {
|
23688 | const baseAnimation = createAnimation();
|
23689 | const wrapperAnimation = createAnimation();
|
23690 | const hostEl = baseEl.host || baseEl;
|
23691 | const wrapperEl = baseEl.querySelector('.toast-wrapper');
|
23692 | wrapperAnimation
|
23693 | .addElement(wrapperEl)
|
23694 | .fromTo('opacity', 0.99, 0);
|
23695 | return baseAnimation
|
23696 | .addElement(hostEl)
|
23697 | .easing('cubic-bezier(.36,.66,.04,1)')
|
23698 | .duration(300)
|
23699 | .addAnimation(wrapperAnimation);
|
23700 | };
|
23701 |
|
23702 | const toastIosCss = "/*!@:host*/.sc-ion-toast-ios-h{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:pre-wrap;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-toast-ios-h,[dir=rtl] .sc-ion-toast-ios-h{left:unset;right:unset;right:0}/*!@:host(.overlay-hidden)*/.overlay-hidden.sc-ion-toast-ios-h{display:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-toast-ios-h{--button-color:inherit;color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toast-button-cancel*/.ion-color.sc-ion-toast-ios-h .toast-button-cancel.sc-ion-toast-ios{color:inherit}/*!@:host(.ion-color) .toast-wrapper*/.ion-color.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:var(--ion-color-base)}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{border-radius:var(--border-radius);left:var(--start);right:var(--end);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}/*!@[dir=rtl] .toast-wrapper, :host-context([dir=rtl]) .toast-wrapper*/[dir=rtl].sc-ion-toast-ios .toast-wrapper.sc-ion-toast-ios,[dir=rtl].sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios,[dir=rtl] .sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@.toast-container*/.toast-container.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}/*!@.toast-content*/.toast-content.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}/*!@.toast-message*/.toast-message.sc-ion-toast-ios{-ms-flex:1;flex:1;white-space:var(--white-space)}/*!@.toast-button-group*/.toast-button-group.sc-ion-toast-ios{display:-ms-flexbox;display:flex}/*!@.toast-button*/.toast-button.sc-ion-toast-ios{border:0;outline:none;color:var(--button-color);z-index:0}/*!@.toast-icon*/.toast-icon.sc-ion-toast-ios{font-size:1.4em}/*!@.toast-button-inner*/.toast-button-inner.sc-ion-toast-ios{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-ios:hover{cursor:pointer}}/*!@:host*/.sc-ion-toast-ios-h{--background:var(--ion-color-step-50, #f2f2f2);--border-radius:14px;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-850, #262626);--max-width:700px;--start:10px;--end:10px;font-size:14px}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){/*!@:host(.toast-translucent) .toast-wrapper*/.toast-translucent.sc-ion-toast-ios-h .toast-wrapper.sc-ion-toast-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}/*!@.toast-wrapper.toast-top*/.toast-wrapper.toast-top.sc-ion-toast-ios{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}/*!@.toast-wrapper.toast-middle*/.toast-wrapper.toast-middle.sc-ion-toast-ios{opacity:0.01}/*!@.toast-wrapper.toast-bottom*/.toast-wrapper.toast-bottom.sc-ion-toast-ios{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}/*!@.toast-content*/.toast-content.sc-ion-toast-ios{padding-left:15px;padding-right:15px;padding-top:15px;padding-bottom:15px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-content*/.toast-content.sc-ion-toast-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px}}/*!@.toast-header*/.toast-header.sc-ion-toast-ios{margin-bottom:2px;font-weight:500}/*!@.toast-button*/.toast-button.sc-ion-toast-ios{padding-left:15px;padding-right:15px;padding-top:10px;padding-bottom:10px;height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:17px;font-weight:500;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-button*/.toast-button.sc-ion-toast-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px}}/*!@.toast-button.ion-activated*/.toast-button.ion-activated.sc-ion-toast-ios{opacity:0.4}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-ios:hover{opacity:0.6}}";
|
23703 |
|
23704 | const toastMdCss = "/*!@:host*/.sc-ion-toast-md-h{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:pre-wrap;left:0;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-toast-md-h,[dir=rtl] .sc-ion-toast-md-h{left:unset;right:unset;right:0}/*!@:host(.overlay-hidden)*/.overlay-hidden.sc-ion-toast-md-h{display:none}/*!@:host(.ion-color)*/.ion-color.sc-ion-toast-md-h{--button-color:inherit;color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toast-button-cancel*/.ion-color.sc-ion-toast-md-h .toast-button-cancel.sc-ion-toast-md{color:inherit}/*!@:host(.ion-color) .toast-wrapper*/.ion-color.sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md{background:var(--ion-color-base)}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{border-radius:var(--border-radius);left:var(--start);right:var(--end);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow)}/*!@[dir=rtl] .toast-wrapper, :host-context([dir=rtl]) .toast-wrapper*/[dir=rtl].sc-ion-toast-md .toast-wrapper.sc-ion-toast-md,[dir=rtl].sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md,[dir=rtl] .sc-ion-toast-md-h .toast-wrapper.sc-ion-toast-md{left:unset;right:unset;left:var(--end);right:var(--start)}/*!@.toast-container*/.toast-container.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;pointer-events:auto;height:inherit;min-height:inherit;max-height:inherit;contain:content}/*!@.toast-content*/.toast-content.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}/*!@.toast-message*/.toast-message.sc-ion-toast-md{-ms-flex:1;flex:1;white-space:var(--white-space)}/*!@.toast-button-group*/.toast-button-group.sc-ion-toast-md{display:-ms-flexbox;display:flex}/*!@.toast-button*/.toast-button.sc-ion-toast-md{border:0;outline:none;color:var(--button-color);z-index:0}/*!@.toast-icon*/.toast-icon.sc-ion-toast-md{font-size:1.4em}/*!@.toast-button-inner*/.toast-button-inner.sc-ion-toast-md{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-md:hover{cursor:pointer}}/*!@:host*/.sc-ion-toast-md-h{--background:var(--ion-color-step-800, #333333);--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-50, #f2f2f2);--max-width:700px;--start:8px;--end:8px;font-size:14px}/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{margin-left:auto;margin-right:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-wrapper*/.toast-wrapper.sc-ion-toast-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}/*!@.toast-content*/.toast-content.sc-ion-toast-md{padding-left:16px;padding-right:16px;padding-top:14px;padding-bottom:14px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-content*/.toast-content.sc-ion-toast-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}/*!@.toast-header*/.toast-header.sc-ion-toast-md{margin-bottom:2px;font-weight:500;line-height:20px}/*!@.toast-message*/.toast-message.sc-ion-toast-md{line-height:20px}/*!@.toast-button-group-start*/.toast-button-group-start.sc-ion-toast-md{margin-left:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-button-group-start*/.toast-button-group-start.sc-ion-toast-md{margin-left:unset;-webkit-margin-start:8px;margin-inline-start:8px}}/*!@.toast-button-group-end*/.toast-button-group-end.sc-ion-toast-md{margin-right:8px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-button-group-end*/.toast-button-group-end.sc-ion-toast-md{margin-right:unset;-webkit-margin-end:8px;margin-inline-end:8px}}/*!@.toast-button*/.toast-button.sc-ion-toast-md{padding-left:15px;padding-right:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:14px;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-button*/.toast-button.sc-ion-toast-md{padding-left:unset;padding-right:unset;-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px}}/*!@.toast-button-cancel*/.toast-button-cancel.sc-ion-toast-md{color:var(--ion-color-step-100, #e6e6e6)}/*!@.toast-button-icon-only*/.toast-button-icon-only.sc-ion-toast-md{border-radius:50%;padding-left:9px;padding-right:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toast-button-icon-only*/.toast-button-icon-only.sc-ion-toast-md{padding-left:unset;padding-right:unset;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px}}@media (any-hover: hover){/*!@.toast-button:hover*/.toast-button.sc-ion-toast-md:hover{background-color:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08)}/*!@.toast-button-cancel:hover*/.toast-button-cancel.sc-ion-toast-md:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";
|
23705 |
|
23706 |
|
23707 |
|
23708 |
|
23709 |
|
23710 |
|
23711 |
|
23712 |
|
23713 |
|
23714 | class Toast {
|
23715 | constructor(hostRef) {
|
23716 | registerInstance(this, hostRef);
|
23717 | this.didPresent = createEvent(this, "ionToastDidPresent", 7);
|
23718 | this.willPresent = createEvent(this, "ionToastWillPresent", 7);
|
23719 | this.willDismiss = createEvent(this, "ionToastWillDismiss", 7);
|
23720 | this.didDismiss = createEvent(this, "ionToastDidDismiss", 7);
|
23721 | this.presented = false;
|
23722 | |
23723 |
|
23724 |
|
23725 |
|
23726 | this.duration = 0;
|
23727 | |
23728 |
|
23729 |
|
23730 | this.keyboardClose = false;
|
23731 | |
23732 |
|
23733 |
|
23734 | this.position = 'bottom';
|
23735 | |
23736 |
|
23737 |
|
23738 |
|
23739 |
|
23740 | this.translucent = false;
|
23741 | |
23742 |
|
23743 |
|
23744 | this.animated = true;
|
23745 | this.dispatchCancelHandler = (ev) => {
|
23746 | const role = ev.detail.role;
|
23747 | if (isCancel(role)) {
|
23748 | const cancelButton = this.getButtons().find(b => b.role === 'cancel');
|
23749 | this.callButtonHandler(cancelButton);
|
23750 | }
|
23751 | };
|
23752 | }
|
23753 | connectedCallback() {
|
23754 | prepareOverlay(this.el);
|
23755 | }
|
23756 | |
23757 |
|
23758 |
|
23759 | async present() {
|
23760 | await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, this.position);
|
23761 | if (this.duration > 0) {
|
23762 | this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
|
23763 | }
|
23764 | }
|
23765 | |
23766 |
|
23767 |
|
23768 |
|
23769 |
|
23770 |
|
23771 |
|
23772 |
|
23773 |
|
23774 | dismiss(data, role) {
|
23775 | if (this.durationTimeout) {
|
23776 | clearTimeout(this.durationTimeout);
|
23777 | }
|
23778 | return dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation, this.position);
|
23779 | }
|
23780 | |
23781 |
|
23782 |
|
23783 | onDidDismiss() {
|
23784 | return eventMethod(this.el, 'ionToastDidDismiss');
|
23785 | }
|
23786 | |
23787 |
|
23788 |
|
23789 | onWillDismiss() {
|
23790 | return eventMethod(this.el, 'ionToastWillDismiss');
|
23791 | }
|
23792 | getButtons() {
|
23793 | const buttons = this.buttons
|
23794 | ? this.buttons.map(b => {
|
23795 | return (typeof b === 'string')
|
23796 | ? { text: b }
|
23797 | : b;
|
23798 | })
|
23799 | : [];
|
23800 | return buttons;
|
23801 | }
|
23802 | async buttonClick(button) {
|
23803 | const role = button.role;
|
23804 | if (isCancel(role)) {
|
23805 | return this.dismiss(undefined, role);
|
23806 | }
|
23807 | const shouldDismiss = await this.callButtonHandler(button);
|
23808 | if (shouldDismiss) {
|
23809 | return this.dismiss(undefined, role);
|
23810 | }
|
23811 | return Promise.resolve();
|
23812 | }
|
23813 | async callButtonHandler(button) {
|
23814 | if (button && button.handler) {
|
23815 |
|
23816 |
|
23817 | try {
|
23818 | const rtn = await safeCall(button.handler);
|
23819 | if (rtn === false) {
|
23820 |
|
23821 | return false;
|
23822 | }
|
23823 | }
|
23824 | catch (e) {
|
23825 | console.error(e);
|
23826 | }
|
23827 | }
|
23828 | return true;
|
23829 | }
|
23830 | renderButtons(buttons, side) {
|
23831 | if (buttons.length === 0) {
|
23832 | return;
|
23833 | }
|
23834 | const mode = getIonMode$1(this);
|
23835 | const buttonGroupsClasses = {
|
23836 | 'toast-button-group': true,
|
23837 | [`toast-button-group-${side}`]: true
|
23838 | };
|
23839 | return (hAsync("div", { class: buttonGroupsClasses }, buttons.map(b => hAsync("button", { type: "button", class: buttonClass(b), tabIndex: 0, onClick: () => this.buttonClick(b), part: "button" }, hAsync("div", { class: "toast-button-inner" }, b.icon &&
|
23840 | hAsync("ion-icon", { icon: b.icon, slot: b.text === undefined ? 'icon-only' : undefined, class: "toast-icon" }), b.text), mode === 'md' && hAsync("ion-ripple-effect", { type: b.icon !== undefined && b.text === undefined ? 'unbounded' : 'bounded' })))));
|
23841 | }
|
23842 | render() {
|
23843 | const allButtons = this.getButtons();
|
23844 | const startButtons = allButtons.filter(b => b.side === 'start');
|
23845 | const endButtons = allButtons.filter(b => b.side !== 'start');
|
23846 | const mode = getIonMode$1(this);
|
23847 | const wrapperClass = {
|
23848 | 'toast-wrapper': true,
|
23849 | [`toast-${this.position}`]: true
|
23850 | };
|
23851 | return (hAsync(Host, { style: {
|
23852 | zIndex: `${60000 + this.overlayIndex}`,
|
23853 | }, class: createColorClasses$1(this.color, Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'toast-translucent': this.translucent })), tabindex: "-1", onIonToastWillDismiss: this.dispatchCancelHandler }, hAsync("div", { class: wrapperClass }, hAsync("div", { class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), hAsync("div", { class: "toast-content" }, this.header !== undefined &&
|
23854 | hAsync("div", { class: "toast-header", part: "header" }, this.header), this.message !== undefined &&
|
23855 | hAsync("div", { class: "toast-message", part: "message", innerHTML: sanitizeDOMString(this.message) })), this.renderButtons(endButtons, 'end')))));
|
23856 | }
|
23857 | get el() { return getElement(this); }
|
23858 | static get style() { return {
|
23859 | ios: toastIosCss,
|
23860 | md: toastMdCss
|
23861 | }; }
|
23862 | static get cmpMeta() { return {
|
23863 | "$flags$": 41,
|
23864 | "$tagName$": "ion-toast",
|
23865 | "$members$": {
|
23866 | "overlayIndex": [2, "overlay-index"],
|
23867 | "color": [513],
|
23868 | "enterAnimation": [16],
|
23869 | "leaveAnimation": [16],
|
23870 | "cssClass": [1, "css-class"],
|
23871 | "duration": [2],
|
23872 | "header": [1],
|
23873 | "message": [1],
|
23874 | "keyboardClose": [4, "keyboard-close"],
|
23875 | "position": [1],
|
23876 | "buttons": [16],
|
23877 | "translucent": [4],
|
23878 | "animated": [4],
|
23879 | "present": [64],
|
23880 | "dismiss": [64],
|
23881 | "onDidDismiss": [64],
|
23882 | "onWillDismiss": [64]
|
23883 | },
|
23884 | "$listeners$": undefined,
|
23885 | "$lazyBundleId$": "-",
|
23886 | "$attrsToReflect$": [["color", "color"]]
|
23887 | }; }
|
23888 | }
|
23889 | const buttonClass = (button) => {
|
23890 | return Object.assign({ 'toast-button': true, 'toast-button-icon-only': button.icon !== undefined && button.text === undefined, [`toast-button-${button.role}`]: button.role !== undefined, 'ion-focusable': true, 'ion-activatable': true }, getClassMap(button.cssClass));
|
23891 | };
|
23892 |
|
23893 | const toggleIosCss = "/*!@:host*/.sc-ion-toggle-ios-h{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;outline:none;contain:content;cursor:pointer;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.ion-focused) input*/.ion-focused.sc-ion-toggle-ios-h input.sc-ion-toggle-ios{border:2px solid #5e9ed6}/*!@:host(.toggle-disabled)*/.toggle-disabled.sc-ion-toggle-ios-h{pointer-events:none}/*!@label*/label.sc-ion-toggle-ios{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;pointer-events:none}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-toggle-ios label.sc-ion-toggle-ios,[dir=rtl].sc-ion-toggle-ios-h label.sc-ion-toggle-ios,[dir=rtl] .sc-ion-toggle-ios-h label.sc-ion-toggle-ios{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-toggle-ios::-moz-focus-inner{border:0}/*!@input*/input.sc-ion-toggle-ios{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@.toggle-icon-wrapper*/.toggle-icon-wrapper.sc-ion-toggle-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}/*!@.toggle-icon*/.toggle-icon.sc-ion-toggle-ios{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--background);pointer-events:none;overflow:inherit}/*!@:host(.toggle-checked) .toggle-icon*/.toggle-checked.sc-ion-toggle-ios-h .toggle-icon.sc-ion-toggle-ios{background:var(--background-checked)}/*!@.toggle-inner*/.toggle-inner.sc-ion-toggle-ios{left:var(--handle-spacing);border-radius:var(--handle-border-radius);position:absolute;width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}/*!@[dir=rtl] .toggle-inner, :host-context([dir=rtl]) .toggle-inner*/[dir=rtl].sc-ion-toggle-ios .toggle-inner.sc-ion-toggle-ios,[dir=rtl].sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios,[dir=rtl] .sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios{left:unset;right:unset;right:var(--handle-spacing)}/*!@:host(.toggle-checked) .toggle-icon-wrapper*/.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}/*!@:host-context([dir=rtl]):host(.toggle-checked) .toggle-icon-wrapper, :host-context([dir=rtl]).toggle-checked .toggle-icon-wrapper*/[dir=rtl].sc-ion-toggle-ios-h -no-combinator.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios,[dir=rtl] .sc-ion-toggle-ios-h -no-combinator.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios,[dir=rtl].toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios,[dir=rtl] .toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}/*!@:host(.toggle-checked) .toggle-inner*/.toggle-checked.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);background:var(--handle-background-checked)}/*!@:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner, :host-context([dir=rtl]).toggle-checked .toggle-inner*/[dir=rtl].sc-ion-toggle-ios-h -no-combinator.toggle-checked.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios,[dir=rtl] .sc-ion-toggle-ios-h -no-combinator.toggle-checked.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios,[dir=rtl].toggle-checked.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios,[dir=rtl] .toggle-checked.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}/*!@:host*/.sc-ion-toggle-ios-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.088);--background-checked:var(--ion-color-primary, #3880ff);--border-radius:16px;--handle-background:#ffffff;--handle-background-checked:#ffffff;--handle-border-radius:25.5px;--handle-box-shadow:0 3px 12px rgba(0, 0, 0, 0.16), 0 3px 1px rgba(0, 0, 0, 0.1);--handle-height:calc(32px - (2px * 2));--handle-max-height:calc(100% - (var(--handle-spacing) * 2));--handle-width:calc(32px - (2px * 2));--handle-spacing:2px;--handle-transition:transform 300ms, width 120ms ease-in-out 80ms, left 110ms ease-in-out 80ms, right 110ms ease-in-out 80ms;width:51px;height:32px;contain:strict;overflow:hidden}/*!@:host(.ion-color.toggle-checked) .toggle-icon*/.ion-color.toggle-checked.sc-ion-toggle-ios-h .toggle-icon.sc-ion-toggle-ios{background:var(--ion-color-base)}/*!@.toggle-icon*/.toggle-icon.sc-ion-toggle-ios{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);-webkit-transition:background-color 300ms;transition:background-color 300ms}/*!@.toggle-inner*/.toggle-inner.sc-ion-toggle-ios{will-change:transform}/*!@:host(.toggle-activated) .toggle-icon::before,\n:host(.toggle-checked) .toggle-icon::before*/.toggle-activated.sc-ion-toggle-ios-h .toggle-icon.sc-ion-toggle-ios::before,.toggle-checked.sc-ion-toggle-ios-h .toggle-icon.sc-ion-toggle-ios::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}/*!@:host(.toggle-activated.toggle-checked) .toggle-inner::before*/.toggle-activated.toggle-checked.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios::before{-webkit-transform:scale3d(0, 0, 0);transform:scale3d(0, 0, 0)}/*!@:host(.toggle-activated) .toggle-inner*/.toggle-activated.sc-ion-toggle-ios-h .toggle-inner.sc-ion-toggle-ios{width:calc(var(--handle-width) + 6px)}/*!@:host(.toggle-activated.toggle-checked) .toggle-icon-wrapper*/.toggle-activated.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios{-webkit-transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0);transform:translate3d(calc(100% - var(--handle-width) - 6px), 0, 0)}/*!@:host-context([dir=rtl]):host(.toggle-activated.toggle-checked) .toggle-icon-wrapper, :host-context([dir=rtl]).toggle-activated.toggle-checked .toggle-icon-wrapper*/[dir=rtl].sc-ion-toggle-ios-h -no-combinator.toggle-activated.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios,[dir=rtl] .sc-ion-toggle-ios-h -no-combinator.toggle-activated.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios,[dir=rtl].toggle-activated.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios,[dir=rtl] .toggle-activated.toggle-checked.sc-ion-toggle-ios-h .toggle-icon-wrapper.sc-ion-toggle-ios{-webkit-transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0);transform:translate3d(calc(-100% + var(--handle-width) + 6px), 0, 0)}/*!@:host(.toggle-disabled)*/.toggle-disabled.sc-ion-toggle-ios-h{opacity:0.3}/*!@:host(.in-item[slot])*/.in-item[slot].sc-ion-toggle-ios-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:20px;padding-right:10px;padding-top:6px;padding-bottom:5px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot])*/.in-item[slot].sc-ion-toggle-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:10px;padding-inline-end:10px}}/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-toggle-ios-h{padding-left:0;padding-right:16px;padding-top:6px;padding-bottom:5px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-toggle-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:0;padding-inline-start:0;-webkit-padding-end:16px;padding-inline-end:16px}}";
|
23894 |
|
23895 | const toggleMdCss = "/*!@:host*/.sc-ion-toggle-md-h{-webkit-box-sizing:content-box !important;box-sizing:content-box !important;display:inline-block;position:relative;outline:none;contain:content;cursor:pointer;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:2}/*!@:host(.ion-focused) input*/.ion-focused.sc-ion-toggle-md-h input.sc-ion-toggle-md{border:2px solid #5e9ed6}/*!@:host(.toggle-disabled)*/.toggle-disabled.sc-ion-toggle-md-h{pointer-events:none}/*!@label*/label.sc-ion-toggle-md{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;opacity:0;pointer-events:none}/*!@[dir=rtl] label, :host-context([dir=rtl]) label*/[dir=rtl].sc-ion-toggle-md label.sc-ion-toggle-md,[dir=rtl].sc-ion-toggle-md-h label.sc-ion-toggle-md,[dir=rtl] .sc-ion-toggle-md-h label.sc-ion-toggle-md{left:unset;right:unset;right:0}/*!@label::-moz-focus-inner*/label.sc-ion-toggle-md::-moz-focus-inner{border:0}/*!@input*/input.sc-ion-toggle-md{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}/*!@.toggle-icon-wrapper*/.toggle-icon-wrapper.sc-ion-toggle-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;width:100%;height:100%;-webkit-transition:var(--handle-transition);transition:var(--handle-transition);will-change:transform}/*!@.toggle-icon*/.toggle-icon.sc-ion-toggle-md{border-radius:var(--border-radius);display:block;position:relative;width:100%;height:100%;background:var(--background);pointer-events:none;overflow:inherit}/*!@:host(.toggle-checked) .toggle-icon*/.toggle-checked.sc-ion-toggle-md-h .toggle-icon.sc-ion-toggle-md{background:var(--background-checked)}/*!@.toggle-inner*/.toggle-inner.sc-ion-toggle-md{left:var(--handle-spacing);border-radius:var(--handle-border-radius);position:absolute;width:var(--handle-width);height:var(--handle-height);max-height:var(--handle-max-height);-webkit-transition:var(--handle-transition);transition:var(--handle-transition);background:var(--handle-background);-webkit-box-shadow:var(--handle-box-shadow);box-shadow:var(--handle-box-shadow);contain:strict}/*!@[dir=rtl] .toggle-inner, :host-context([dir=rtl]) .toggle-inner*/[dir=rtl].sc-ion-toggle-md .toggle-inner.sc-ion-toggle-md,[dir=rtl].sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md,[dir=rtl] .sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md{left:unset;right:unset;right:var(--handle-spacing)}/*!@:host(.toggle-checked) .toggle-icon-wrapper*/.toggle-checked.sc-ion-toggle-md-h .toggle-icon-wrapper.sc-ion-toggle-md{-webkit-transform:translate3d(calc(100% - var(--handle-width)), 0, 0);transform:translate3d(calc(100% - var(--handle-width)), 0, 0)}/*!@:host-context([dir=rtl]):host(.toggle-checked) .toggle-icon-wrapper, :host-context([dir=rtl]).toggle-checked .toggle-icon-wrapper*/[dir=rtl].sc-ion-toggle-md-h -no-combinator.toggle-checked.sc-ion-toggle-md-h .toggle-icon-wrapper.sc-ion-toggle-md,[dir=rtl] .sc-ion-toggle-md-h -no-combinator.toggle-checked.sc-ion-toggle-md-h .toggle-icon-wrapper.sc-ion-toggle-md,[dir=rtl].toggle-checked.sc-ion-toggle-md-h .toggle-icon-wrapper.sc-ion-toggle-md,[dir=rtl] .toggle-checked.sc-ion-toggle-md-h .toggle-icon-wrapper.sc-ion-toggle-md{-webkit-transform:translate3d(calc(-100% + var(--handle-width)), 0, 0);transform:translate3d(calc(-100% + var(--handle-width)), 0, 0)}/*!@:host(.toggle-checked) .toggle-inner*/.toggle-checked.sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md{-webkit-transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * -2), 0, 0);background:var(--handle-background-checked)}/*!@:host-context([dir=rtl]):host(.toggle-checked) .toggle-inner, :host-context([dir=rtl]).toggle-checked .toggle-inner*/[dir=rtl].sc-ion-toggle-md-h -no-combinator.toggle-checked.sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md,[dir=rtl] .sc-ion-toggle-md-h -no-combinator.toggle-checked.sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md,[dir=rtl].toggle-checked.sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md,[dir=rtl] .toggle-checked.sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md{-webkit-transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0);transform:translate3d(calc(var(--handle-spacing) * 2), 0, 0)}/*!@:host*/.sc-ion-toggle-md-h{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.39);--background-checked:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.5);--border-radius:14px;--handle-background:#ffffff;--handle-background-checked:var(--ion-color-primary, #3880ff);--handle-border-radius:50%;--handle-box-shadow:0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12);--handle-width:20px;--handle-height:20px;--handle-max-height:calc(100% + 6px);--handle-spacing:0;--handle-transition:transform 160ms cubic-bezier(0.4, 0, 0.2, 1), background-color 160ms cubic-bezier(0.4, 0, 0.2, 1);padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px;width:36px;height:14px;contain:strict}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-toggle-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px}}/*!@:host(.ion-color.toggle-checked) .toggle-icon*/.ion-color.toggle-checked.sc-ion-toggle-md-h .toggle-icon.sc-ion-toggle-md{background:rgba(var(--ion-color-base-rgb), 0.5)}/*!@:host(.ion-color.toggle-checked) .toggle-inner*/.ion-color.toggle-checked.sc-ion-toggle-md-h .toggle-inner.sc-ion-toggle-md{background:var(--ion-color-base)}/*!@.toggle-icon*/.toggle-icon.sc-ion-toggle-md{-webkit-transition:background-color 160ms;transition:background-color 160ms}/*!@.toggle-inner*/.toggle-inner.sc-ion-toggle-md{will-change:background-color, transform}/*!@:host(.toggle-disabled)*/.toggle-disabled.sc-ion-toggle-md-h{opacity:0.3}/*!@:host(.in-item[slot])*/.in-item[slot].sc-ion-toggle-md-h{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:16px;padding-right:0;padding-top:12px;padding-bottom:12px;cursor:pointer}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot])*/.in-item[slot].sc-ion-toggle-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:0;padding-inline-end:0}}/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-toggle-md-h{padding-left:2px;padding-right:18px;padding-top:12px;padding-bottom:12px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.in-item[slot=start])*/.in-item[slot=start].sc-ion-toggle-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:18px;padding-inline-end:18px}}";
|
23896 |
|
23897 |
|
23898 |
|
23899 |
|
23900 |
|
23901 |
|
23902 |
|
23903 | class Toggle {
|
23904 | constructor(hostRef) {
|
23905 | registerInstance(this, hostRef);
|
23906 | this.ionChange = createEvent(this, "ionChange", 7);
|
23907 | this.ionFocus = createEvent(this, "ionFocus", 7);
|
23908 | this.ionBlur = createEvent(this, "ionBlur", 7);
|
23909 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
23910 | this.inputId = `ion-tg-${toggleIds++}`;
|
23911 | this.lastDrag = 0;
|
23912 | this.activated = false;
|
23913 | |
23914 |
|
23915 |
|
23916 | this.name = this.inputId;
|
23917 | |
23918 |
|
23919 |
|
23920 | this.checked = false;
|
23921 | |
23922 |
|
23923 |
|
23924 | this.disabled = false;
|
23925 | |
23926 |
|
23927 |
|
23928 |
|
23929 |
|
23930 |
|
23931 |
|
23932 | this.value = 'on';
|
23933 | this.onClick = (ev) => {
|
23934 | ev.preventDefault();
|
23935 | if (this.lastDrag + 300 < Date.now()) {
|
23936 | this.checked = !this.checked;
|
23937 | }
|
23938 | };
|
23939 | this.onFocus = () => {
|
23940 | this.ionFocus.emit();
|
23941 | };
|
23942 | this.onBlur = () => {
|
23943 | this.ionBlur.emit();
|
23944 | };
|
23945 | }
|
23946 | checkedChanged(isChecked) {
|
23947 | this.ionChange.emit({
|
23948 | checked: isChecked,
|
23949 | value: this.value
|
23950 | });
|
23951 | }
|
23952 | disabledChanged() {
|
23953 | this.emitStyle();
|
23954 | if (this.gesture) {
|
23955 | this.gesture.enable(!this.disabled);
|
23956 | }
|
23957 | }
|
23958 | async connectedCallback() {
|
23959 | this.gesture = (await Promise.resolve().then(function () { return index$1; })).createGesture({
|
23960 | el: this.el,
|
23961 | gestureName: 'toggle',
|
23962 | gesturePriority: 100,
|
23963 | threshold: 5,
|
23964 | passive: false,
|
23965 | onStart: () => this.onStart(),
|
23966 | onMove: ev => this.onMove(ev),
|
23967 | onEnd: ev => this.onEnd(ev),
|
23968 | });
|
23969 | this.disabledChanged();
|
23970 | }
|
23971 | disconnectedCallback() {
|
23972 | if (this.gesture) {
|
23973 | this.gesture.destroy();
|
23974 | this.gesture = undefined;
|
23975 | }
|
23976 | }
|
23977 | componentWillLoad() {
|
23978 | this.emitStyle();
|
23979 | }
|
23980 | emitStyle() {
|
23981 | this.ionStyle.emit({
|
23982 | 'interactive-disabled': this.disabled,
|
23983 | });
|
23984 | }
|
23985 | onStart() {
|
23986 | this.activated = true;
|
23987 |
|
23988 | this.setFocus();
|
23989 | }
|
23990 | onMove(detail) {
|
23991 | if (shouldToggle(document, this.checked, detail.deltaX, -10)) {
|
23992 | this.checked = !this.checked;
|
23993 | hapticSelection();
|
23994 | }
|
23995 | }
|
23996 | onEnd(ev) {
|
23997 | this.activated = false;
|
23998 | this.lastDrag = Date.now();
|
23999 | ev.event.preventDefault();
|
24000 | ev.event.stopImmediatePropagation();
|
24001 | }
|
24002 | getValue() {
|
24003 | return this.value || '';
|
24004 | }
|
24005 | setFocus() {
|
24006 | if (this.focusEl) {
|
24007 | this.focusEl.focus();
|
24008 | }
|
24009 | }
|
24010 | render() {
|
24011 | const { activated, color, checked, disabled, el, inputId, name } = this;
|
24012 | const mode = getIonMode$1(this);
|
24013 | const { label, labelId, labelText } = getAriaLabel(el, inputId);
|
24014 | const value = this.getValue();
|
24015 | renderHiddenInput(true, el, name, (checked ? value : ''), disabled);
|
24016 | return (hAsync(Host, { onClick: this.onClick, "aria-labelledby": label ? labelId : null, "aria-checked": `${checked}`, "aria-hidden": disabled ? 'true' : null, role: "switch", class: createColorClasses$1(color, {
|
24017 | [mode]: true,
|
24018 | 'in-item': hostContext('ion-item', el),
|
24019 | 'toggle-activated': activated,
|
24020 | 'toggle-checked': checked,
|
24021 | 'toggle-disabled': disabled,
|
24022 | 'interactive': true
|
24023 | }) }, hAsync("div", { class: "toggle-icon", part: "track" }, hAsync("div", { class: "toggle-icon-wrapper" }, hAsync("div", { class: "toggle-inner", part: "handle" }))), hAsync("label", { htmlFor: inputId }, labelText), hAsync("input", { type: "checkbox", role: "switch", "aria-checked": `${checked}`, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: focusEl => this.focusEl = focusEl })));
|
24024 | }
|
24025 | get el() { return getElement(this); }
|
24026 | static get watchers() { return {
|
24027 | "checked": ["checkedChanged"],
|
24028 | "disabled": ["disabledChanged"]
|
24029 | }; }
|
24030 | static get style() { return {
|
24031 | ios: toggleIosCss,
|
24032 | md: toggleMdCss
|
24033 | }; }
|
24034 | static get cmpMeta() { return {
|
24035 | "$flags$": 41,
|
24036 | "$tagName$": "ion-toggle",
|
24037 | "$members$": {
|
24038 | "color": [513],
|
24039 | "name": [1],
|
24040 | "checked": [1028],
|
24041 | "disabled": [4],
|
24042 | "value": [1],
|
24043 | "activated": [32]
|
24044 | },
|
24045 | "$listeners$": undefined,
|
24046 | "$lazyBundleId$": "-",
|
24047 | "$attrsToReflect$": [["color", "color"]]
|
24048 | }; }
|
24049 | }
|
24050 | const shouldToggle = (doc, checked, deltaX, margin) => {
|
24051 | const isRTL = doc.dir === 'rtl';
|
24052 | if (checked) {
|
24053 | return (!isRTL && (margin > deltaX)) ||
|
24054 | (isRTL && (-margin < deltaX));
|
24055 | }
|
24056 | else {
|
24057 | return (!isRTL && (-margin < deltaX)) ||
|
24058 | (isRTL && (margin > deltaX));
|
24059 | }
|
24060 | };
|
24061 | let toggleIds = 0;
|
24062 |
|
24063 | const toolbarIosCss = "/*!@:host*/.sc-ion-toolbar-ios-h{--border-width:0;--border-style:solid;--opacity:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-toolbar-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}/*!@:host(.ion-color)*/.ion-color.sc-ion-toolbar-ios-h{color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toolbar-background*/.ion-color.sc-ion-toolbar-ios-h .toolbar-background.sc-ion-toolbar-ios{background:var(--ion-color-base)}/*!@.toolbar-container*/.toolbar-container.sc-ion-toolbar-ios{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toolbar-container*/.toolbar-container.sc-ion-toolbar-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.toolbar-background*/.toolbar-background.sc-ion-toolbar-ios{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:var(--opacity);z-index:-1;pointer-events:none}/*!@::slotted(ion-progress-bar)*/.sc-ion-toolbar-ios-s>ion-progress-bar{left:0;right:0;bottom:0;position:absolute}/*!@:host*/.sc-ion-toolbar-ios-h{--background:var(--ion-toolbar-background, var(--ion-color-step-50, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #000));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, rgba(0, 0, 0, 0.2))));--padding-top:3px;--padding-bottom:3px;--padding-start:4px;--padding-end:4px;--min-height:44px}/*!@.toolbar-content*/.toolbar-content.sc-ion-toolbar-ios{-ms-flex:1;flex:1;-ms-flex-order:4;order:4;min-width:0}/*!@:host(.toolbar-segment) .toolbar-content*/.toolbar-segment.sc-ion-toolbar-ios-h .toolbar-content.sc-ion-toolbar-ios{display:-ms-inline-flexbox;display:inline-flex}/*!@:host(.toolbar-searchbar) .toolbar-container*/.toolbar-searchbar.sc-ion-toolbar-ios-h .toolbar-container.sc-ion-toolbar-ios{padding-top:0;padding-bottom:0}/*!@:host(.toolbar-searchbar) ::slotted(*)*/.sc-ion-toolbar-ios-h.toolbar-searchbar .sc-ion-toolbar-ios-s>*{-ms-flex-item-align:start;align-self:start}/*!@:host(.toolbar-searchbar) ::slotted(ion-chip)*/.sc-ion-toolbar-ios-h.toolbar-searchbar .sc-ion-toolbar-ios-s>ion-chip{margin-top:3px}/*!@:host(.toolbar-searchbar) ::slotted(ion-back-button)*/.sc-ion-toolbar-ios-h.toolbar-searchbar .sc-ion-toolbar-ios-s>ion-back-button{height:38px}/*!@::slotted(ion-buttons)*/.sc-ion-toolbar-ios-s>ion-buttons{min-height:38px}/*!@::slotted([slot=start])*/.sc-ion-toolbar-ios-s>[slot=start]{-ms-flex-order:2;order:2}/*!@::slotted([slot=secondary])*/.sc-ion-toolbar-ios-s>[slot=secondary]{-ms-flex-order:3;order:3}/*!@::slotted([slot=primary])*/.sc-ion-toolbar-ios-s>[slot=primary]{-ms-flex-order:5;order:5;text-align:end}/*!@::slotted([slot=end])*/.sc-ion-toolbar-ios-s>[slot=end]{-ms-flex-order:6;order:6;text-align:end}/*!@:host(.toolbar-title-large) .toolbar-container*/.toolbar-title-large.sc-ion-toolbar-ios-h .toolbar-container.sc-ion-toolbar-ios{-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:start;align-items:flex-start}/*!@:host(.toolbar-title-large) .toolbar-content ion-title*/.toolbar-title-large.sc-ion-toolbar-ios-h .toolbar-content.sc-ion-toolbar-ios ion-title.sc-ion-toolbar-ios{-ms-flex:1;flex:1;-ms-flex-order:8;order:8;min-width:100%}";
|
24064 |
|
24065 | const toolbarMdCss = "/*!@:host*/.sc-ion-toolbar-md-h{--border-width:0;--border-style:solid;--opacity:1;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;padding-left:var(--ion-safe-area-left);padding-right:var(--ion-safe-area-right);display:block;position:relative;width:100%;color:var(--color);font-family:var(--ion-font-family, inherit);contain:content;z-index:10;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-toolbar-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--ion-safe-area-left);padding-inline-start:var(--ion-safe-area-left);-webkit-padding-end:var(--ion-safe-area-right);padding-inline-end:var(--ion-safe-area-right)}}/*!@:host(.ion-color)*/.ion-color.sc-ion-toolbar-md-h{color:var(--ion-color-contrast)}/*!@:host(.ion-color) .toolbar-background*/.ion-color.sc-ion-toolbar-md-h .toolbar-background.sc-ion-toolbar-md{background:var(--ion-color-base)}/*!@.toolbar-container*/.toolbar-container.sc-ion-toolbar-md{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:-ms-flexbox;display:flex;position:relative;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;width:100%;min-height:var(--min-height);contain:content;overflow:hidden;z-index:10;-webkit-box-sizing:border-box;box-sizing:border-box}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@.toolbar-container*/.toolbar-container.sc-ion-toolbar-md{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}/*!@.toolbar-background*/.toolbar-background.sc-ion-toolbar-md{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;opacity:var(--opacity);z-index:-1;pointer-events:none}/*!@::slotted(ion-progress-bar)*/.sc-ion-toolbar-md-s>ion-progress-bar{left:0;right:0;bottom:0;position:absolute}/*!@:host*/.sc-ion-toolbar-md-h{--background:var(--ion-toolbar-background, var(--ion-background-color, #fff));--color:var(--ion-toolbar-color, var(--ion-text-color, #424242));--border-color:var(--ion-toolbar-border-color, var(--ion-border-color, var(--ion-color-step-150, #c1c4cd)));--padding-top:0;--padding-bottom:0;--padding-start:0;--padding-end:0;--min-height:56px}/*!@.toolbar-content*/.toolbar-content.sc-ion-toolbar-md{-ms-flex:1;flex:1;-ms-flex-order:3;order:3;min-width:0;max-width:100%}/*!@::slotted(ion-segment)*/.sc-ion-toolbar-md-s>ion-segment{min-height:var(--min-height)}/*!@::slotted(.buttons-first-slot)*/.sc-ion-toolbar-md-s>.buttons-first-slot{margin-left:4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(.buttons-first-slot)*/.sc-ion-toolbar-md-s>.buttons-first-slot{margin-left:unset;-webkit-margin-start:4px;margin-inline-start:4px}}/*!@::slotted(.buttons-last-slot)*/.sc-ion-toolbar-md-s>.buttons-last-slot{margin-right:4px}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@::slotted(.buttons-last-slot)*/.sc-ion-toolbar-md-s>.buttons-last-slot{margin-right:unset;-webkit-margin-end:4px;margin-inline-end:4px}}/*!@::slotted([slot=start])*/.sc-ion-toolbar-md-s>[slot=start]{-ms-flex-order:2;order:2}/*!@::slotted([slot=secondary])*/.sc-ion-toolbar-md-s>[slot=secondary]{-ms-flex-order:4;order:4}/*!@::slotted([slot=primary])*/.sc-ion-toolbar-md-s>[slot=primary]{-ms-flex-order:5;order:5;text-align:end}/*!@::slotted([slot=end])*/.sc-ion-toolbar-md-s>[slot=end]{-ms-flex-order:6;order:6;text-align:end}";
|
24066 |
|
24067 |
|
24068 |
|
24069 |
|
24070 |
|
24071 |
|
24072 |
|
24073 |
|
24074 |
|
24075 |
|
24076 | class Toolbar {
|
24077 | constructor(hostRef) {
|
24078 | registerInstance(this, hostRef);
|
24079 | this.childrenStyles = new Map();
|
24080 | }
|
24081 | componentWillLoad() {
|
24082 | const buttons = Array.from(this.el.querySelectorAll('ion-buttons'));
|
24083 | const firstButtons = buttons.find(button => {
|
24084 | return button.slot === 'start';
|
24085 | });
|
24086 | if (firstButtons) {
|
24087 | firstButtons.classList.add('buttons-first-slot');
|
24088 | }
|
24089 | const buttonsReversed = buttons.reverse();
|
24090 | const lastButtons = buttonsReversed.find(button => button.slot === 'end') ||
|
24091 | buttonsReversed.find(button => button.slot === 'primary') ||
|
24092 | buttonsReversed.find(button => button.slot === 'secondary');
|
24093 | if (lastButtons) {
|
24094 | lastButtons.classList.add('buttons-last-slot');
|
24095 | }
|
24096 | }
|
24097 | childrenStyle(ev) {
|
24098 | ev.stopPropagation();
|
24099 | const tagName = ev.target.tagName;
|
24100 | const updatedStyles = ev.detail;
|
24101 | const newStyles = {};
|
24102 | const childStyles = this.childrenStyles.get(tagName) || {};
|
24103 | let hasStyleChange = false;
|
24104 | Object.keys(updatedStyles).forEach(key => {
|
24105 | const childKey = `toolbar-${key}`;
|
24106 | const newValue = updatedStyles[key];
|
24107 | if (newValue !== childStyles[childKey]) {
|
24108 | hasStyleChange = true;
|
24109 | }
|
24110 | if (newValue) {
|
24111 | newStyles[childKey] = true;
|
24112 | }
|
24113 | });
|
24114 | if (hasStyleChange) {
|
24115 | this.childrenStyles.set(tagName, newStyles);
|
24116 | forceUpdate$1(this);
|
24117 | }
|
24118 | }
|
24119 | render() {
|
24120 | const mode = getIonMode$1(this);
|
24121 | const childStyles = {};
|
24122 | this.childrenStyles.forEach(value => {
|
24123 | Object.assign(childStyles, value);
|
24124 | });
|
24125 | return (hAsync(Host, { class: Object.assign(Object.assign({}, childStyles), createColorClasses$1(this.color, {
|
24126 | [mode]: true,
|
24127 | 'in-toolbar': hostContext('ion-toolbar', this.el),
|
24128 | })) }, hAsync("div", { class: "toolbar-background" }), hAsync("div", { class: "toolbar-container" }, hAsync("slot", { name: "start" }), hAsync("slot", { name: "secondary" }), hAsync("div", { class: "toolbar-content" }, hAsync("slot", null)), hAsync("slot", { name: "primary" }), hAsync("slot", { name: "end" }))));
|
24129 | }
|
24130 | get el() { return getElement(this); }
|
24131 | static get style() { return {
|
24132 | ios: toolbarIosCss,
|
24133 | md: toolbarMdCss
|
24134 | }; }
|
24135 | static get cmpMeta() { return {
|
24136 | "$flags$": 41,
|
24137 | "$tagName$": "ion-toolbar",
|
24138 | "$members$": {
|
24139 | "color": [513]
|
24140 | },
|
24141 | "$listeners$": [[0, "ionStyle", "childrenStyle"]],
|
24142 | "$lazyBundleId$": "-",
|
24143 | "$attrsToReflect$": [["color", "color"]]
|
24144 | }; }
|
24145 | }
|
24146 |
|
24147 | const titleIosCss = "/*!@:host*/.sc-ion-title-ios-h{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-title-ios-h{color:var(--ion-color-base)}/*!@.toolbar-title*/.toolbar-title.sc-ion-title-ios{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}/*!@:host(.title-small) .toolbar-title*/.title-small.sc-ion-title-ios-h .toolbar-title.sc-ion-title-ios{white-space:normal}/*!@:host*/.sc-ion-title-ios-h{left:0;top:0;padding-left:90px;padding-right:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:17px;font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}/*!@:host-context([dir=rtl])*/[dir=rtl].sc-ion-title-ios-h,[dir=rtl] .sc-ion-title-ios-h{left:unset;right:unset;right:0}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-title-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px}}/*!@:host(.title-small)*/.title-small.sc-ion-title-ios-h{padding-left:9px;padding-right:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:13px;font-weight:normal}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.title-small)*/.title-small.sc-ion-title-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px}}/*!@:host(.title-large)*/.title-large.sc-ion-title-ios-h{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;-webkit-transform-origin:left center;transform-origin:left center;bottom:0;-ms-flex-align:end;align-items:flex-end;min-width:100%;padding-bottom:6px;font-size:34px;font-weight:700;text-align:start}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host(.title-large)*/.title-large.sc-ion-title-ios-h{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}/*!@:host(.title-large.title-rtl)*/.title-large.title-rtl.sc-ion-title-ios-h{-webkit-transform-origin:right center;transform-origin:right center}/*!@:host(.title-large.ion-cloned-element)*/.title-large.ion-cloned-element.sc-ion-title-ios-h{--color:var(--ion-text-color, #000)}/*!@:host(.title-large) .toolbar-title*/.title-large.sc-ion-title-ios-h .toolbar-title.sc-ion-title-ios{-webkit-transform-origin:inherit;transform-origin:inherit}/*!@:host-context([dir=rtl]):host(.title-large) .toolbar-title, :host-context([dir=rtl]).title-large .toolbar-title*/[dir=rtl].sc-ion-title-ios-h -no-combinator.title-large.sc-ion-title-ios-h .toolbar-title.sc-ion-title-ios,[dir=rtl] .sc-ion-title-ios-h -no-combinator.title-large.sc-ion-title-ios-h .toolbar-title.sc-ion-title-ios,[dir=rtl].title-large.sc-ion-title-ios-h .toolbar-title.sc-ion-title-ios,[dir=rtl] .title-large.sc-ion-title-ios-h .toolbar-title.sc-ion-title-ios{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}";
|
24148 |
|
24149 | const titleMdCss = "/*!@:host*/.sc-ion-title-md-h{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}/*!@:host(.ion-color)*/.ion-color.sc-ion-title-md-h{color:var(--ion-color-base)}/*!@.toolbar-title*/.toolbar-title.sc-ion-title-md{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}/*!@:host(.title-small) .toolbar-title*/.title-small.sc-ion-title-md-h .toolbar-title.sc-ion-title-md{white-space:normal}/*!@:host*/.sc-ion-title-md-h{padding-left:20px;padding-right:20px;padding-top:0;padding-bottom:0;font-size:20px;font-weight:500;letter-spacing:0.0125em}@supports ((-webkit-margin-start: 0) or (margin-inline-start: 0)) or (-webkit-margin-start: 0){/*!@:host*/.sc-ion-title-md-h{padding-left:unset;padding-right:unset;-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px}}/*!@:host(.title-small)*/.title-small.sc-ion-title-md-h{width:100%;height:100%;font-size:15px;font-weight:normal}";
|
24150 |
|
24151 | class ToolbarTitle {
|
24152 | constructor(hostRef) {
|
24153 | registerInstance(this, hostRef);
|
24154 | this.ionStyle = createEvent(this, "ionStyle", 7);
|
24155 | }
|
24156 | sizeChanged() {
|
24157 | this.emitStyle();
|
24158 | }
|
24159 | connectedCallback() {
|
24160 | this.emitStyle();
|
24161 | }
|
24162 | emitStyle() {
|
24163 | const size = this.getSize();
|
24164 | this.ionStyle.emit({
|
24165 | [`title-${size}`]: true
|
24166 | });
|
24167 | }
|
24168 | getSize() {
|
24169 | return (this.size !== undefined) ? this.size : 'default';
|
24170 | }
|
24171 | render() {
|
24172 | const mode = getIonMode$1(this);
|
24173 | const size = this.getSize();
|
24174 | return (hAsync(Host, { class: createColorClasses$1(this.color, {
|
24175 | [mode]: true,
|
24176 | [`title-${size}`]: true,
|
24177 | 'title-rtl': document.dir === 'rtl'
|
24178 | }) }, hAsync("div", { class: "toolbar-title" }, hAsync("slot", null))));
|
24179 | }
|
24180 | get el() { return getElement(this); }
|
24181 | static get watchers() { return {
|
24182 | "size": ["sizeChanged"]
|
24183 | }; }
|
24184 | static get style() { return {
|
24185 | ios: titleIosCss,
|
24186 | md: titleMdCss
|
24187 | }; }
|
24188 | static get cmpMeta() { return {
|
24189 | "$flags$": 41,
|
24190 | "$tagName$": "ion-title",
|
24191 | "$members$": {
|
24192 | "color": [513],
|
24193 | "size": [1]
|
24194 | },
|
24195 | "$listeners$": undefined,
|
24196 | "$lazyBundleId$": "-",
|
24197 | "$attrsToReflect$": [["color", "color"]]
|
24198 | }; }
|
24199 | }
|
24200 |
|
24201 | const CELL_TYPE_ITEM = 'item';
|
24202 | const CELL_TYPE_HEADER = 'header';
|
24203 | const CELL_TYPE_FOOTER = 'footer';
|
24204 | const NODE_CHANGE_NONE = 0;
|
24205 | const NODE_CHANGE_POSITION = 1;
|
24206 | const NODE_CHANGE_CELL = 2;
|
24207 |
|
24208 | const MIN_READS = 2;
|
24209 | const updateVDom = (dom, heightIndex, cells, range) => {
|
24210 |
|
24211 | for (const node of dom) {
|
24212 | node.change = NODE_CHANGE_NONE;
|
24213 | node.d = true;
|
24214 | }
|
24215 |
|
24216 | const toMutate = [];
|
24217 | const end = range.offset + range.length;
|
24218 | for (let i = range.offset; i < end; i++) {
|
24219 | const cell = cells[i];
|
24220 | const node = dom.find(n => n.d && n.cell === cell);
|
24221 | if (node) {
|
24222 | const top = heightIndex[i];
|
24223 | if (top !== node.top) {
|
24224 | node.top = top;
|
24225 | node.change = NODE_CHANGE_POSITION;
|
24226 | }
|
24227 | node.d = false;
|
24228 | }
|
24229 | else {
|
24230 | toMutate.push(cell);
|
24231 | }
|
24232 | }
|
24233 |
|
24234 | const pool = dom.filter(n => n.d);
|
24235 | for (const cell of toMutate) {
|
24236 | const node = pool.find(n => n.d && n.cell.type === cell.type);
|
24237 | const index = cell.i;
|
24238 | if (node) {
|
24239 | node.d = false;
|
24240 | node.change = NODE_CHANGE_CELL;
|
24241 | node.cell = cell;
|
24242 | node.top = heightIndex[index];
|
24243 | }
|
24244 | else {
|
24245 | dom.push({
|
24246 | d: false,
|
24247 | cell,
|
24248 | visible: true,
|
24249 | change: NODE_CHANGE_CELL,
|
24250 | top: heightIndex[index],
|
24251 | });
|
24252 | }
|
24253 | }
|
24254 | dom
|
24255 | .filter(n => n.d && n.top !== -9999)
|
24256 | .forEach(n => {
|
24257 | n.change = NODE_CHANGE_POSITION;
|
24258 | n.top = -9999;
|
24259 | });
|
24260 | };
|
24261 | const doRender = (el, nodeRender, dom, updateCellHeight) => {
|
24262 | const children = Array.from(el.children).filter(n => n.tagName !== 'TEMPLATE');
|
24263 | const childrenNu = children.length;
|
24264 | let child;
|
24265 | for (let i = 0; i < dom.length; i++) {
|
24266 | const node = dom[i];
|
24267 | const cell = node.cell;
|
24268 |
|
24269 | if (node.change === NODE_CHANGE_CELL) {
|
24270 | if (i < childrenNu) {
|
24271 | child = children[i];
|
24272 | nodeRender(child, cell, i);
|
24273 | }
|
24274 | else {
|
24275 | const newChild = createNode(el, cell.type);
|
24276 | child = nodeRender(newChild, cell, i) || newChild;
|
24277 | child.classList.add('virtual-item');
|
24278 | el.appendChild(child);
|
24279 | }
|
24280 | child['$ionCell'] = cell;
|
24281 | }
|
24282 | else {
|
24283 | child = children[i];
|
24284 | }
|
24285 |
|
24286 | if (node.change !== NODE_CHANGE_NONE) {
|
24287 | child.style.transform = `translate3d(0,${node.top}px,0)`;
|
24288 | }
|
24289 |
|
24290 | const visible = cell.visible;
|
24291 | if (node.visible !== visible) {
|
24292 | if (visible) {
|
24293 | child.classList.remove('virtual-loading');
|
24294 | }
|
24295 | else {
|
24296 | child.classList.add('virtual-loading');
|
24297 | }
|
24298 | node.visible = visible;
|
24299 | }
|
24300 |
|
24301 | if (cell.reads > 0) {
|
24302 | updateCellHeight(cell, child);
|
24303 | cell.reads--;
|
24304 | }
|
24305 | }
|
24306 | };
|
24307 | const createNode = (el, type) => {
|
24308 | const template = getTemplate(el, type);
|
24309 | if (template && el.ownerDocument) {
|
24310 | return el.ownerDocument.importNode(template.content, true).children[0];
|
24311 | }
|
24312 | return null;
|
24313 | };
|
24314 | const getTemplate = (el, type) => {
|
24315 | switch (type) {
|
24316 | case CELL_TYPE_ITEM: return el.querySelector('template:not([name])');
|
24317 | case CELL_TYPE_HEADER: return el.querySelector('template[name=header]');
|
24318 | case CELL_TYPE_FOOTER: return el.querySelector('template[name=footer]');
|
24319 | }
|
24320 | };
|
24321 | const getViewport = (scrollTop, vierportHeight, margin) => {
|
24322 | return {
|
24323 | top: Math.max(scrollTop - margin, 0),
|
24324 | bottom: scrollTop + vierportHeight + margin
|
24325 | };
|
24326 | };
|
24327 | const getRange = (heightIndex, viewport, buffer) => {
|
24328 | const topPos = viewport.top;
|
24329 | const bottomPos = viewport.bottom;
|
24330 |
|
24331 | let i = 0;
|
24332 | for (; i < heightIndex.length; i++) {
|
24333 | if (heightIndex[i] > topPos) {
|
24334 | break;
|
24335 | }
|
24336 | }
|
24337 | const offset = Math.max(i - buffer - 1, 0);
|
24338 |
|
24339 | for (; i < heightIndex.length; i++) {
|
24340 | if (heightIndex[i] >= bottomPos) {
|
24341 | break;
|
24342 | }
|
24343 | }
|
24344 | const end = Math.min(i + buffer, heightIndex.length);
|
24345 | const length = end - offset;
|
24346 | return { offset, length };
|
24347 | };
|
24348 | const getShouldUpdate = (dirtyIndex, currentRange, range) => {
|
24349 | const end = range.offset + range.length;
|
24350 | return (dirtyIndex <= end ||
|
24351 | currentRange.offset !== range.offset ||
|
24352 | currentRange.length !== range.length);
|
24353 | };
|
24354 | const findCellIndex = (cells, index) => {
|
24355 | const max = cells.length > 0 ? cells[cells.length - 1].index : 0;
|
24356 | if (index === 0) {
|
24357 | return 0;
|
24358 | }
|
24359 | else if (index === max + 1) {
|
24360 | return cells.length;
|
24361 | }
|
24362 | else {
|
24363 | return cells.findIndex(c => c.index === index);
|
24364 | }
|
24365 | };
|
24366 | const inplaceUpdate = (dst, src, offset) => {
|
24367 | if (offset === 0 && src.length >= dst.length) {
|
24368 | return src;
|
24369 | }
|
24370 | for (let i = 0; i < src.length; i++) {
|
24371 | dst[i + offset] = src[i];
|
24372 | }
|
24373 | return dst;
|
24374 | };
|
24375 | const calcCells = (items, itemHeight, headerHeight, footerHeight, headerFn, footerFn, approxHeaderHeight, approxFooterHeight, approxItemHeight, j, offset, len) => {
|
24376 | const cells = [];
|
24377 | const end = len + offset;
|
24378 | for (let i = offset; i < end; i++) {
|
24379 | const item = items[i];
|
24380 | if (headerFn) {
|
24381 | const value = headerFn(item, i, items);
|
24382 | if (value != null) {
|
24383 | cells.push({
|
24384 | i: j++,
|
24385 | type: CELL_TYPE_HEADER,
|
24386 | value,
|
24387 | index: i,
|
24388 | height: headerHeight ? headerHeight(value, i) : approxHeaderHeight,
|
24389 | reads: headerHeight ? 0 : MIN_READS,
|
24390 | visible: !!headerHeight,
|
24391 | });
|
24392 | }
|
24393 | }
|
24394 | cells.push({
|
24395 | i: j++,
|
24396 | type: CELL_TYPE_ITEM,
|
24397 | value: item,
|
24398 | index: i,
|
24399 | height: itemHeight ? itemHeight(item, i) : approxItemHeight,
|
24400 | reads: itemHeight ? 0 : MIN_READS,
|
24401 | visible: !!itemHeight,
|
24402 | });
|
24403 | if (footerFn) {
|
24404 | const value = footerFn(item, i, items);
|
24405 | if (value != null) {
|
24406 | cells.push({
|
24407 | i: j++,
|
24408 | type: CELL_TYPE_FOOTER,
|
24409 | value,
|
24410 | index: i,
|
24411 | height: footerHeight ? footerHeight(value, i) : approxFooterHeight,
|
24412 | reads: footerHeight ? 0 : MIN_READS,
|
24413 | visible: !!footerHeight,
|
24414 | });
|
24415 | }
|
24416 | }
|
24417 | }
|
24418 | return cells;
|
24419 | };
|
24420 | const calcHeightIndex = (buf, cells, index) => {
|
24421 | let acum = buf[index];
|
24422 | for (let i = index; i < buf.length; i++) {
|
24423 | buf[i] = acum;
|
24424 | acum += cells[i].height;
|
24425 | }
|
24426 | return acum;
|
24427 | };
|
24428 | const resizeBuffer = (buf, len) => {
|
24429 | if (!buf) {
|
24430 | return new Uint32Array(len);
|
24431 | }
|
24432 | if (buf.length === len) {
|
24433 | return buf;
|
24434 | }
|
24435 | else if (len > buf.length) {
|
24436 | const newBuf = new Uint32Array(len);
|
24437 | newBuf.set(buf);
|
24438 | return newBuf;
|
24439 | }
|
24440 | else {
|
24441 | return buf.subarray(0, len);
|
24442 | }
|
24443 | };
|
24444 | const positionForIndex = (index, cells, heightIndex) => {
|
24445 | const cell = cells.find(c => c.type === CELL_TYPE_ITEM && c.index === index);
|
24446 | if (cell) {
|
24447 | return heightIndex[cell.i];
|
24448 | }
|
24449 | return -1;
|
24450 | };
|
24451 |
|
24452 | const virtualScrollCss = "ion-virtual-scroll{display:block;position:relative;width:100%;contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}ion-virtual-scroll>.virtual-loading{opacity:0}ion-virtual-scroll>.virtual-item{position:absolute !important;top:0 !important;right:0 !important;left:0 !important;-webkit-transition-duration:0ms;transition-duration:0ms;will-change:transform}";
|
24453 |
|
24454 | class VirtualScroll {
|
24455 | constructor(hostRef) {
|
24456 | registerInstance(this, hostRef);
|
24457 | this.range = { offset: 0, length: 0 };
|
24458 | this.viewportHeight = 0;
|
24459 | this.cells = [];
|
24460 | this.virtualDom = [];
|
24461 | this.isEnabled = false;
|
24462 | this.viewportOffset = 0;
|
24463 | this.currentScrollTop = 0;
|
24464 | this.indexDirty = 0;
|
24465 | this.lastItemLen = 0;
|
24466 | this.totalHeight = 0;
|
24467 | |
24468 |
|
24469 |
|
24470 |
|
24471 |
|
24472 |
|
24473 |
|
24474 |
|
24475 |
|
24476 |
|
24477 |
|
24478 | this.approxItemHeight = 45;
|
24479 | |
24480 |
|
24481 |
|
24482 |
|
24483 |
|
24484 |
|
24485 |
|
24486 |
|
24487 |
|
24488 | this.approxHeaderHeight = 30;
|
24489 | |
24490 |
|
24491 |
|
24492 |
|
24493 |
|
24494 |
|
24495 |
|
24496 |
|
24497 |
|
24498 | this.approxFooterHeight = 30;
|
24499 | this.onScroll = () => {
|
24500 | this.updateVirtualScroll();
|
24501 | };
|
24502 | }
|
24503 | itemsChanged() {
|
24504 | this.calcCells();
|
24505 | this.updateVirtualScroll();
|
24506 | }
|
24507 | componentWillLoad() {
|
24508 | console.warn(`[Deprecation Warning]: ion-virtual-scroll has been deprecated and will be removed in Ionic Framework v7.0. See https://ionicframework.com/docs/angular/virtual-scroll for migration steps.`);
|
24509 | }
|
24510 | async connectedCallback() {
|
24511 | const contentEl = this.el.closest('ion-content');
|
24512 | if (!contentEl) {
|
24513 | console.error('<ion-virtual-scroll> must be used inside an <ion-content>');
|
24514 | return;
|
24515 | }
|
24516 | this.scrollEl = await contentEl.getScrollElement();
|
24517 | this.contentEl = contentEl;
|
24518 | this.calcCells();
|
24519 | this.updateState();
|
24520 | }
|
24521 | componentDidUpdate() {
|
24522 | this.updateState();
|
24523 | }
|
24524 | disconnectedCallback() {
|
24525 | this.scrollEl = undefined;
|
24526 | }
|
24527 | onResize() {
|
24528 | this.calcCells();
|
24529 | this.updateVirtualScroll();
|
24530 | }
|
24531 | |
24532 |
|
24533 |
|
24534 | positionForItem(index) {
|
24535 | return Promise.resolve(positionForIndex(index, this.cells, this.getHeightIndex()));
|
24536 | }
|
24537 | |
24538 |
|
24539 |
|
24540 |
|
24541 |
|
24542 |
|
24543 | async checkRange(offset, len = -1) {
|
24544 |
|
24545 |
|
24546 | if (!this.items) {
|
24547 | return;
|
24548 | }
|
24549 | const length = (len === -1)
|
24550 | ? this.items.length - offset
|
24551 | : len;
|
24552 | const cellIndex = findCellIndex(this.cells, offset);
|
24553 | const cells = calcCells(this.items, this.itemHeight, this.headerHeight, this.footerHeight, this.headerFn, this.footerFn, this.approxHeaderHeight, this.approxFooterHeight, this.approxItemHeight, cellIndex, offset, length);
|
24554 | this.cells = inplaceUpdate(this.cells, cells, cellIndex);
|
24555 | this.lastItemLen = this.items.length;
|
24556 | this.indexDirty = Math.max(offset - 1, 0);
|
24557 | this.scheduleUpdate();
|
24558 | }
|
24559 | |
24560 |
|
24561 |
|
24562 |
|
24563 |
|
24564 |
|
24565 |
|
24566 |
|
24567 |
|
24568 | async checkEnd() {
|
24569 | if (this.items) {
|
24570 | this.checkRange(this.lastItemLen);
|
24571 | }
|
24572 | }
|
24573 | updateVirtualScroll() {
|
24574 |
|
24575 | if (!this.isEnabled || !this.scrollEl) {
|
24576 | return;
|
24577 | }
|
24578 |
|
24579 | if (this.timerUpdate) {
|
24580 | clearTimeout(this.timerUpdate);
|
24581 | this.timerUpdate = undefined;
|
24582 | }
|
24583 |
|
24584 | readTask(this.readVS.bind(this));
|
24585 | writeTask(this.writeVS.bind(this));
|
24586 | }
|
24587 | readVS() {
|
24588 | const { contentEl, scrollEl, el } = this;
|
24589 | let topOffset = 0;
|
24590 | let node = el;
|
24591 | while (node && node !== contentEl) {
|
24592 | topOffset += node.offsetTop;
|
24593 | node = node.offsetParent;
|
24594 | }
|
24595 | this.viewportOffset = topOffset;
|
24596 | if (scrollEl) {
|
24597 | this.viewportHeight = scrollEl.offsetHeight;
|
24598 | this.currentScrollTop = scrollEl.scrollTop;
|
24599 | }
|
24600 | }
|
24601 | writeVS() {
|
24602 | const dirtyIndex = this.indexDirty;
|
24603 |
|
24604 | const scrollTop = this.currentScrollTop - this.viewportOffset;
|
24605 | const viewport = getViewport(scrollTop, this.viewportHeight, 100);
|
24606 |
|
24607 | const heightIndex = this.getHeightIndex();
|
24608 |
|
24609 | const range = getRange(heightIndex, viewport, 2);
|
24610 |
|
24611 | const shouldUpdate = getShouldUpdate(dirtyIndex, this.range, range);
|
24612 | if (!shouldUpdate) {
|
24613 | return;
|
24614 | }
|
24615 | this.range = range;
|
24616 |
|
24617 | updateVDom(this.virtualDom, heightIndex, this.cells, range);
|
24618 |
|
24619 |
|
24620 | if (this.nodeRender) {
|
24621 | doRender(this.el, this.nodeRender, this.virtualDom, this.updateCellHeight.bind(this));
|
24622 | }
|
24623 | else if (this.domRender) {
|
24624 | this.domRender(this.virtualDom);
|
24625 | }
|
24626 | else if (this.renderItem) {
|
24627 | forceUpdate$1(this);
|
24628 | }
|
24629 | }
|
24630 | updateCellHeight(cell, node) {
|
24631 | const update = () => {
|
24632 | if (node['$ionCell'] === cell) {
|
24633 | const style = window.getComputedStyle(node);
|
24634 | const height = node.offsetHeight + parseFloat(style.getPropertyValue('margin-bottom'));
|
24635 | this.setCellHeight(cell, height);
|
24636 | }
|
24637 | };
|
24638 | if (node) {
|
24639 | componentOnReady(node, update);
|
24640 | }
|
24641 | else {
|
24642 | update();
|
24643 | }
|
24644 | }
|
24645 | setCellHeight(cell, height) {
|
24646 | const index = cell.i;
|
24647 |
|
24648 | if (cell !== this.cells[index]) {
|
24649 | return;
|
24650 | }
|
24651 | if (cell.height !== height || cell.visible !== true) {
|
24652 | cell.visible = true;
|
24653 | cell.height = height;
|
24654 | this.indexDirty = Math.min(this.indexDirty, index);
|
24655 | this.scheduleUpdate();
|
24656 | }
|
24657 | }
|
24658 | scheduleUpdate() {
|
24659 | clearTimeout(this.timerUpdate);
|
24660 | this.timerUpdate = setTimeout(() => this.updateVirtualScroll(), 100);
|
24661 | }
|
24662 | updateState() {
|
24663 | const shouldEnable = !!(this.scrollEl &&
|
24664 | this.cells);
|
24665 | if (shouldEnable !== this.isEnabled) {
|
24666 | this.enableScrollEvents(shouldEnable);
|
24667 | if (shouldEnable) {
|
24668 | this.updateVirtualScroll();
|
24669 | }
|
24670 | }
|
24671 | }
|
24672 | calcCells() {
|
24673 | if (!this.items) {
|
24674 | return;
|
24675 | }
|
24676 | this.lastItemLen = this.items.length;
|
24677 | this.cells = calcCells(this.items, this.itemHeight, this.headerHeight, this.footerHeight, this.headerFn, this.footerFn, this.approxHeaderHeight, this.approxFooterHeight, this.approxItemHeight, 0, 0, this.lastItemLen);
|
24678 | this.indexDirty = 0;
|
24679 | }
|
24680 | getHeightIndex() {
|
24681 | if (this.indexDirty !== Infinity) {
|
24682 | this.calcHeightIndex(this.indexDirty);
|
24683 | }
|
24684 | return this.heightIndex;
|
24685 | }
|
24686 | calcHeightIndex(index = 0) {
|
24687 |
|
24688 | this.heightIndex = resizeBuffer(this.heightIndex, this.cells.length);
|
24689 | this.totalHeight = calcHeightIndex(this.heightIndex, this.cells, index);
|
24690 | this.indexDirty = Infinity;
|
24691 | }
|
24692 | enableScrollEvents(shouldListen) {
|
24693 | if (this.rmEvent) {
|
24694 | this.rmEvent();
|
24695 | this.rmEvent = undefined;
|
24696 | }
|
24697 | const scrollEl = this.scrollEl;
|
24698 | if (scrollEl) {
|
24699 | this.isEnabled = shouldListen;
|
24700 | scrollEl.addEventListener('scroll', this.onScroll);
|
24701 | this.rmEvent = () => {
|
24702 | scrollEl.removeEventListener('scroll', this.onScroll);
|
24703 | };
|
24704 | }
|
24705 | }
|
24706 | renderVirtualNode(node) {
|
24707 | const { type, value, index } = node.cell;
|
24708 | switch (type) {
|
24709 | case CELL_TYPE_ITEM: return this.renderItem(value, index);
|
24710 | case CELL_TYPE_HEADER: return this.renderHeader(value, index);
|
24711 | case CELL_TYPE_FOOTER: return this.renderFooter(value, index);
|
24712 | }
|
24713 | }
|
24714 | render() {
|
24715 | return (hAsync(Host, { style: {
|
24716 | height: `${this.totalHeight}px`
|
24717 | } }, this.renderItem && (hAsync(VirtualProxy, { dom: this.virtualDom }, this.virtualDom.map(node => this.renderVirtualNode(node))))));
|
24718 | }
|
24719 | get el() { return getElement(this); }
|
24720 | static get watchers() { return {
|
24721 | "itemHeight": ["itemsChanged"],
|
24722 | "headerHeight": ["itemsChanged"],
|
24723 | "footerHeight": ["itemsChanged"],
|
24724 | "items": ["itemsChanged"]
|
24725 | }; }
|
24726 | static get style() { return virtualScrollCss; }
|
24727 | static get cmpMeta() { return {
|
24728 | "$flags$": 0,
|
24729 | "$tagName$": "ion-virtual-scroll",
|
24730 | "$members$": {
|
24731 | "approxItemHeight": [2, "approx-item-height"],
|
24732 | "approxHeaderHeight": [2, "approx-header-height"],
|
24733 | "approxFooterHeight": [2, "approx-footer-height"],
|
24734 | "headerFn": [16],
|
24735 | "footerFn": [16],
|
24736 | "items": [16],
|
24737 | "itemHeight": [16],
|
24738 | "headerHeight": [16],
|
24739 | "footerHeight": [16],
|
24740 | "renderItem": [16],
|
24741 | "renderHeader": [16],
|
24742 | "renderFooter": [16],
|
24743 | "nodeRender": [16],
|
24744 | "domRender": [16],
|
24745 | "totalHeight": [32],
|
24746 | "positionForItem": [64],
|
24747 | "checkRange": [64],
|
24748 | "checkEnd": [64]
|
24749 | },
|
24750 | "$listeners$": [[9, "resize", "onResize"]],
|
24751 | "$lazyBundleId$": "-",
|
24752 | "$attrsToReflect$": []
|
24753 | }; }
|
24754 | }
|
24755 | const VirtualProxy = ({ dom }, children, utils) => {
|
24756 | return utils.map(children, (child, i) => {
|
24757 | const node = dom[i];
|
24758 | const vattrs = child.vattrs || {};
|
24759 | let classes = vattrs.class || '';
|
24760 | classes += 'virtual-item ';
|
24761 | if (!node.visible) {
|
24762 | classes += 'virtual-loading';
|
24763 | }
|
24764 | return Object.assign(Object.assign({}, child), { vattrs: Object.assign(Object.assign({}, vattrs), { class: classes, style: Object.assign(Object.assign({}, vattrs.style), { transform: `translate3d(0,${node.top}px,0)` }) }) });
|
24765 | });
|
24766 | };
|
24767 |
|
24768 | registerComponents([
|
24769 | ActionSheet,
|
24770 | Alert,
|
24771 | App,
|
24772 | Avatar,
|
24773 | BackButton,
|
24774 | Backdrop,
|
24775 | Badge,
|
24776 | Button,
|
24777 | Buttons,
|
24778 | Card,
|
24779 | CardContent,
|
24780 | CardHeader,
|
24781 | CardSubtitle,
|
24782 | CardTitle,
|
24783 | Checkbox,
|
24784 | Chip,
|
24785 | Col,
|
24786 | Content,
|
24787 | Datetime,
|
24788 | Fab,
|
24789 | FabButton,
|
24790 | FabList,
|
24791 | Footer,
|
24792 | Grid,
|
24793 | Header,
|
24794 | Icon,
|
24795 | Img,
|
24796 | InfiniteScroll,
|
24797 | InfiniteScrollContent,
|
24798 | Input,
|
24799 | Item,
|
24800 | ItemDivider,
|
24801 | ItemGroup,
|
24802 | ItemOption,
|
24803 | ItemOptions,
|
24804 | ItemSliding,
|
24805 | Label,
|
24806 | List,
|
24807 | ListHeader,
|
24808 | Loading,
|
24809 | Menu,
|
24810 | MenuButton,
|
24811 | MenuToggle,
|
24812 | Modal,
|
24813 | Nav,
|
24814 | NavLink,
|
24815 | Note,
|
24816 | Picker,
|
24817 | PickerColumnCmp,
|
24818 | Popover,
|
24819 | ProgressBar,
|
24820 | Radio,
|
24821 | RadioGroup,
|
24822 | Range,
|
24823 | Refresher,
|
24824 | RefresherContent,
|
24825 | Reorder,
|
24826 | ReorderGroup,
|
24827 | RippleEffect,
|
24828 | Route,
|
24829 | RouteRedirect,
|
24830 | Router,
|
24831 | RouterLink,
|
24832 | RouterOutlet,
|
24833 | Row,
|
24834 | Searchbar,
|
24835 | Segment,
|
24836 | SegmentButton,
|
24837 | Select,
|
24838 | SelectOption,
|
24839 | SelectPopover,
|
24840 | SkeletonText,
|
24841 | Slide,
|
24842 | Slides,
|
24843 | Spinner,
|
24844 | SplitPane,
|
24845 | Tab,
|
24846 | TabBar,
|
24847 | TabButton,
|
24848 | Tabs,
|
24849 | Text,
|
24850 | Textarea,
|
24851 | Thumbnail,
|
24852 | Toast,
|
24853 | Toggle,
|
24854 | Toolbar,
|
24855 | ToolbarTitle,
|
24856 | VirtualScroll,
|
24857 | ]);
|
24858 |
|
24859 | const DURATION = 540;
|
24860 | const getClonedElement = (tagName) => {
|
24861 | return document.querySelector(`${tagName}.ion-cloned-element`);
|
24862 | };
|
24863 | const shadow = (el) => {
|
24864 | return el.shadowRoot || el;
|
24865 | };
|
24866 | const getLargeTitle = (refEl) => {
|
24867 | const tabs = (refEl.tagName === 'ION-TABS') ? refEl : refEl.querySelector('ion-tabs');
|
24868 | const query = 'ion-content ion-header:not(.header-collapse-condense-inactive) ion-title.title-large';
|
24869 | if (tabs != null) {
|
24870 | const activeTab = tabs.querySelector('ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)');
|
24871 | return (activeTab != null) ? activeTab.querySelector(query) : null;
|
24872 | }
|
24873 | return refEl.querySelector(query);
|
24874 | };
|
24875 | const getBackButton = (refEl, backDirection) => {
|
24876 | const tabs = (refEl.tagName === 'ION-TABS') ? refEl : refEl.querySelector('ion-tabs');
|
24877 | let buttonsList = [];
|
24878 | if (tabs != null) {
|
24879 | const activeTab = tabs.querySelector('ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)');
|
24880 | if (activeTab != null) {
|
24881 | buttonsList = activeTab.querySelectorAll('ion-buttons');
|
24882 | }
|
24883 | }
|
24884 | else {
|
24885 | buttonsList = refEl.querySelectorAll('ion-buttons');
|
24886 | }
|
24887 | for (const buttons of buttonsList) {
|
24888 | const parentHeader = buttons.closest('ion-header');
|
24889 | const activeHeader = parentHeader && !parentHeader.classList.contains('header-collapse-condense-inactive');
|
24890 | const backButton = buttons.querySelector('ion-back-button');
|
24891 | const buttonsCollapse = buttons.classList.contains('buttons-collapse');
|
24892 | const startSlot = buttons.slot === 'start' || buttons.slot === '';
|
24893 | if (backButton !== null && startSlot && ((buttonsCollapse && activeHeader && backDirection) || !buttonsCollapse)) {
|
24894 | return backButton;
|
24895 | }
|
24896 | }
|
24897 | return null;
|
24898 | };
|
24899 | const createLargeTitleTransition = (rootAnimation, rtl, backDirection, enteringEl, leavingEl) => {
|
24900 | const enteringBackButton = getBackButton(enteringEl, backDirection);
|
24901 | const leavingLargeTitle = getLargeTitle(leavingEl);
|
24902 | const enteringLargeTitle = getLargeTitle(enteringEl);
|
24903 | const leavingBackButton = getBackButton(leavingEl, backDirection);
|
24904 | const shouldAnimationForward = enteringBackButton !== null && leavingLargeTitle !== null && !backDirection;
|
24905 | const shouldAnimationBackward = enteringLargeTitle !== null && leavingBackButton !== null && backDirection;
|
24906 | if (shouldAnimationForward) {
|
24907 | const leavingLargeTitleBox = leavingLargeTitle.getBoundingClientRect();
|
24908 | const enteringBackButtonBox = enteringBackButton.getBoundingClientRect();
|
24909 | animateLargeTitle(rootAnimation, rtl, backDirection, leavingLargeTitle, leavingLargeTitleBox, enteringBackButtonBox);
|
24910 | animateBackButton(rootAnimation, rtl, backDirection, enteringBackButton, leavingLargeTitleBox, enteringBackButtonBox);
|
24911 | }
|
24912 | else if (shouldAnimationBackward) {
|
24913 | const enteringLargeTitleBox = enteringLargeTitle.getBoundingClientRect();
|
24914 | const leavingBackButtonBox = leavingBackButton.getBoundingClientRect();
|
24915 | animateLargeTitle(rootAnimation, rtl, backDirection, enteringLargeTitle, enteringLargeTitleBox, leavingBackButtonBox);
|
24916 | animateBackButton(rootAnimation, rtl, backDirection, leavingBackButton, enteringLargeTitleBox, leavingBackButtonBox);
|
24917 | }
|
24918 | return {
|
24919 | forward: shouldAnimationForward,
|
24920 | backward: shouldAnimationBackward
|
24921 | };
|
24922 | };
|
24923 | const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, largeTitleBox, backButtonBox) => {
|
24924 | const BACK_BUTTON_START_OFFSET = (rtl) ? `calc(100% - ${backButtonBox.right + 4}px)` : `${backButtonBox.left - 4}px`;
|
24925 | const START_TEXT_TRANSLATE = (rtl) ? '7px' : '-7px';
|
24926 | const END_TEXT_TRANSLATE = (rtl) ? '-4px' : '4px';
|
24927 | const ICON_TRANSLATE = (rtl) ? '-4px' : '4px';
|
24928 | const TEXT_ORIGIN_X = (rtl) ? 'right' : 'left';
|
24929 | const ICON_ORIGIN_X = (rtl) ? 'left' : 'right';
|
24930 | const FORWARD_TEXT_KEYFRAMES = [
|
24931 | { offset: 0, opacity: 0, transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)` },
|
24932 | { offset: 1, opacity: 1, transform: `translate3d(${END_TEXT_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` }
|
24933 | ];
|
24934 | const BACKWARD_TEXT_KEYFRAMES = [
|
24935 | { offset: 0, opacity: 1, transform: `translate3d(${END_TEXT_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` },
|
24936 | { offset: 0.6, opacity: 0 },
|
24937 | { offset: 1, opacity: 0, transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)` }
|
24938 | ];
|
24939 | const TEXT_KEYFRAMES = (backDirection) ? BACKWARD_TEXT_KEYFRAMES : FORWARD_TEXT_KEYFRAMES;
|
24940 | const FORWARD_ICON_KEYFRAMES = [
|
24941 | { offset: 0, opacity: 0, transform: `translate3d(${ICON_TRANSLATE}, ${backButtonBox.top - 41}px, 0) scale(0.6)` },
|
24942 | { offset: 1, opacity: 1, transform: `translate3d(${ICON_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` }
|
24943 | ];
|
24944 | const BACKWARD_ICON_KEYFRAMES = [
|
24945 | { offset: 0, opacity: 1, transform: `translate3d(${ICON_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` },
|
24946 | { offset: 0.2, opacity: 0, transform: `translate3d(${ICON_TRANSLATE}, ${backButtonBox.top - 41}px, 0) scale(0.6)` },
|
24947 | { offset: 1, opacity: 0, transform: `translate3d(${ICON_TRANSLATE}, ${backButtonBox.top - 41}px, 0) scale(0.6)` }
|
24948 | ];
|
24949 | const ICON_KEYFRAMES = (backDirection) ? BACKWARD_ICON_KEYFRAMES : FORWARD_ICON_KEYFRAMES;
|
24950 | const enteringBackButtonTextAnimation = createAnimation();
|
24951 | const enteringBackButtonIconAnimation = createAnimation();
|
24952 | const clonedBackButtonEl = getClonedElement('ion-back-button');
|
24953 | const backButtonTextEl = shadow(clonedBackButtonEl).querySelector('.button-text');
|
24954 | const backButtonIconEl = shadow(clonedBackButtonEl).querySelector('ion-icon');
|
24955 | clonedBackButtonEl.text = backButtonEl.text;
|
24956 | clonedBackButtonEl.mode = backButtonEl.mode;
|
24957 | clonedBackButtonEl.icon = backButtonEl.icon;
|
24958 | clonedBackButtonEl.color = backButtonEl.color;
|
24959 | clonedBackButtonEl.disabled = backButtonEl.disabled;
|
24960 | clonedBackButtonEl.style.setProperty('display', 'block');
|
24961 | clonedBackButtonEl.style.setProperty('position', 'fixed');
|
24962 | enteringBackButtonIconAnimation.addElement(backButtonIconEl);
|
24963 | enteringBackButtonTextAnimation.addElement(backButtonTextEl);
|
24964 | enteringBackButtonTextAnimation
|
24965 | .beforeStyles({
|
24966 | 'transform-origin': `${TEXT_ORIGIN_X} center`
|
24967 | })
|
24968 | .beforeAddWrite(() => {
|
24969 | backButtonEl.style.setProperty('display', 'none');
|
24970 | clonedBackButtonEl.style.setProperty(TEXT_ORIGIN_X, BACK_BUTTON_START_OFFSET);
|
24971 | })
|
24972 | .afterAddWrite(() => {
|
24973 | backButtonEl.style.setProperty('display', '');
|
24974 | clonedBackButtonEl.style.setProperty('display', 'none');
|
24975 | clonedBackButtonEl.style.removeProperty(TEXT_ORIGIN_X);
|
24976 | })
|
24977 | .keyframes(TEXT_KEYFRAMES);
|
24978 | enteringBackButtonIconAnimation
|
24979 | .beforeStyles({
|
24980 | 'transform-origin': `${ICON_ORIGIN_X} center`
|
24981 | })
|
24982 | .keyframes(ICON_KEYFRAMES);
|
24983 | rootAnimation.addAnimation([enteringBackButtonTextAnimation, enteringBackButtonIconAnimation]);
|
24984 | };
|
24985 | const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox, backButtonBox) => {
|
24986 | const TITLE_START_OFFSET = (rtl) ? `calc(100% - ${largeTitleBox.right}px)` : `${largeTitleBox.left}px`;
|
24987 | const START_TRANSLATE = (rtl) ? '-18px' : '18px';
|
24988 | const ORIGIN_X = (rtl) ? 'right' : 'left';
|
24989 | const BACKWARDS_KEYFRAMES = [
|
24990 | { offset: 0, opacity: 0, transform: `translate3d(${START_TRANSLATE}, ${backButtonBox.top - 4}px, 0) scale(0.49)` },
|
24991 | { offset: 0.1, opacity: 0 },
|
24992 | { offset: 1, opacity: 1, transform: `translate3d(0, ${largeTitleBox.top - 2}px, 0) scale(1)` }
|
24993 | ];
|
24994 | const FORWARDS_KEYFRAMES = [
|
24995 | { offset: 0, opacity: 0.99, transform: `translate3d(0, ${largeTitleBox.top - 2}px, 0) scale(1)` },
|
24996 | { offset: 0.6, opacity: 0 },
|
24997 | { offset: 1, opacity: 0, transform: `translate3d(${START_TRANSLATE}, ${backButtonBox.top - 4}px, 0) scale(0.5)` }
|
24998 | ];
|
24999 | const KEYFRAMES = (backDirection) ? BACKWARDS_KEYFRAMES : FORWARDS_KEYFRAMES;
|
25000 | const clonedTitleEl = getClonedElement('ion-title');
|
25001 | const clonedLargeTitleAnimation = createAnimation();
|
25002 | clonedTitleEl.innerText = largeTitleEl.innerText;
|
25003 | clonedTitleEl.size = largeTitleEl.size;
|
25004 | clonedTitleEl.color = largeTitleEl.color;
|
25005 | clonedLargeTitleAnimation.addElement(clonedTitleEl);
|
25006 | clonedLargeTitleAnimation
|
25007 | .beforeStyles({
|
25008 | 'transform-origin': `${ORIGIN_X} center`,
|
25009 | 'height': '46px',
|
25010 | 'display': '',
|
25011 | 'position': 'relative',
|
25012 | [ORIGIN_X]: TITLE_START_OFFSET
|
25013 | })
|
25014 | .beforeAddWrite(() => {
|
25015 | largeTitleEl.style.setProperty('display', 'none');
|
25016 | })
|
25017 | .afterAddWrite(() => {
|
25018 | largeTitleEl.style.setProperty('display', '');
|
25019 | clonedTitleEl.style.setProperty('display', 'none');
|
25020 | })
|
25021 | .keyframes(KEYFRAMES);
|
25022 | rootAnimation.addAnimation(clonedLargeTitleAnimation);
|
25023 | };
|
25024 | const iosTransitionAnimation = (navEl, opts) => {
|
25025 | try {
|
25026 | const EASING = 'cubic-bezier(0.32,0.72,0,1)';
|
25027 | const OPACITY = 'opacity';
|
25028 | const TRANSFORM = 'transform';
|
25029 | const CENTER = '0%';
|
25030 | const OFF_OPACITY = 0.8;
|
25031 | const isRTL = navEl.ownerDocument.dir === 'rtl';
|
25032 | const OFF_RIGHT = isRTL ? '-99.5%' : '99.5%';
|
25033 | const OFF_LEFT = isRTL ? '33%' : '-33%';
|
25034 | const enteringEl = opts.enteringEl;
|
25035 | const leavingEl = opts.leavingEl;
|
25036 | const backDirection = (opts.direction === 'back');
|
25037 | const contentEl = enteringEl.querySelector(':scope > ion-content');
|
25038 | const headerEls = enteringEl.querySelectorAll(':scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *');
|
25039 | const enteringToolBarEls = enteringEl.querySelectorAll(':scope > ion-header > ion-toolbar');
|
25040 | const rootAnimation = createAnimation();
|
25041 | const enteringContentAnimation = createAnimation();
|
25042 | rootAnimation
|
25043 | .addElement(enteringEl)
|
25044 | .duration(opts.duration || DURATION)
|
25045 | .easing(opts.easing || EASING)
|
25046 | .fill('both')
|
25047 | .beforeRemoveClass('ion-page-invisible');
|
25048 | if (leavingEl && navEl) {
|
25049 | const navDecorAnimation = createAnimation();
|
25050 | navDecorAnimation.addElement(navEl);
|
25051 | rootAnimation.addAnimation(navDecorAnimation);
|
25052 | }
|
25053 | if (!contentEl && enteringToolBarEls.length === 0 && headerEls.length === 0) {
|
25054 | enteringContentAnimation.addElement(enteringEl.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs'));
|
25055 | }
|
25056 | else {
|
25057 | enteringContentAnimation.addElement(contentEl);
|
25058 | enteringContentAnimation.addElement(headerEls);
|
25059 | }
|
25060 | rootAnimation.addAnimation(enteringContentAnimation);
|
25061 | if (backDirection) {
|
25062 | enteringContentAnimation
|
25063 | .beforeClearStyles([OPACITY])
|
25064 | .fromTo('transform', `translateX(${OFF_LEFT})`, `translateX(${CENTER})`)
|
25065 | .fromTo(OPACITY, OFF_OPACITY, 1);
|
25066 | }
|
25067 | else {
|
25068 |
|
25069 | enteringContentAnimation
|
25070 | .beforeClearStyles([OPACITY])
|
25071 | .fromTo('transform', `translateX(${OFF_RIGHT})`, `translateX(${CENTER})`);
|
25072 | }
|
25073 | if (contentEl) {
|
25074 | const enteringTransitionEffectEl = shadow(contentEl).querySelector('.transition-effect');
|
25075 | if (enteringTransitionEffectEl) {
|
25076 | const enteringTransitionCoverEl = enteringTransitionEffectEl.querySelector('.transition-cover');
|
25077 | const enteringTransitionShadowEl = enteringTransitionEffectEl.querySelector('.transition-shadow');
|
25078 | const enteringTransitionEffect = createAnimation();
|
25079 | const enteringTransitionCover = createAnimation();
|
25080 | const enteringTransitionShadow = createAnimation();
|
25081 | enteringTransitionEffect
|
25082 | .addElement(enteringTransitionEffectEl)
|
25083 | .beforeStyles({ opacity: '1', display: 'block' })
|
25084 | .afterStyles({ opacity: '', display: '' });
|
25085 | enteringTransitionCover
|
25086 | .addElement(enteringTransitionCoverEl)
|
25087 | .beforeClearStyles([OPACITY])
|
25088 | .fromTo(OPACITY, 0, 0.1);
|
25089 | enteringTransitionShadow
|
25090 | .addElement(enteringTransitionShadowEl)
|
25091 | .beforeClearStyles([OPACITY])
|
25092 | .fromTo(OPACITY, 0.03, 0.70);
|
25093 | enteringTransitionEffect.addAnimation([enteringTransitionCover, enteringTransitionShadow]);
|
25094 | enteringContentAnimation.addAnimation([enteringTransitionEffect]);
|
25095 | }
|
25096 | }
|
25097 | const enteringContentHasLargeTitle = enteringEl.querySelector('ion-header.header-collapse-condense');
|
25098 | const { forward, backward } = createLargeTitleTransition(rootAnimation, isRTL, backDirection, enteringEl, leavingEl);
|
25099 | enteringToolBarEls.forEach(enteringToolBarEl => {
|
25100 | const enteringToolBar = createAnimation();
|
25101 | enteringToolBar.addElement(enteringToolBarEl);
|
25102 | rootAnimation.addAnimation(enteringToolBar);
|
25103 | const enteringTitle = createAnimation();
|
25104 | enteringTitle.addElement(enteringToolBarEl.querySelector('ion-title'));
|
25105 | const enteringToolBarButtons = createAnimation();
|
25106 | const buttons = Array.from(enteringToolBarEl.querySelectorAll('ion-buttons,[menuToggle]'));
|
25107 | const parentHeader = enteringToolBarEl.closest('ion-header');
|
25108 | const inactiveHeader = parentHeader && parentHeader.classList.contains('header-collapse-condense-inactive');
|
25109 | let buttonsToAnimate;
|
25110 | if (backDirection) {
|
25111 | buttonsToAnimate = buttons.filter(button => {
|
25112 | const isCollapseButton = button.classList.contains('buttons-collapse');
|
25113 | return (isCollapseButton && !inactiveHeader) || !isCollapseButton;
|
25114 | });
|
25115 | }
|
25116 | else {
|
25117 | buttonsToAnimate = buttons.filter(button => !button.classList.contains('buttons-collapse'));
|
25118 | }
|
25119 | enteringToolBarButtons.addElement(buttonsToAnimate);
|
25120 | const enteringToolBarItems = createAnimation();
|
25121 | enteringToolBarItems.addElement(enteringToolBarEl.querySelectorAll(':scope > *:not(ion-title):not(ion-buttons):not([menuToggle])'));
|
25122 | const enteringToolBarBg = createAnimation();
|
25123 | enteringToolBarBg.addElement(shadow(enteringToolBarEl).querySelector('.toolbar-background'));
|
25124 | const enteringBackButton = createAnimation();
|
25125 | const backButtonEl = enteringToolBarEl.querySelector('ion-back-button');
|
25126 | if (backButtonEl) {
|
25127 | enteringBackButton.addElement(backButtonEl);
|
25128 | }
|
25129 | enteringToolBar.addAnimation([enteringTitle, enteringToolBarButtons, enteringToolBarItems, enteringToolBarBg, enteringBackButton]);
|
25130 | enteringToolBarButtons.fromTo(OPACITY, 0.01, 1);
|
25131 | enteringToolBarItems.fromTo(OPACITY, 0.01, 1);
|
25132 | if (backDirection) {
|
25133 | if (!inactiveHeader) {
|
25134 | enteringTitle
|
25135 | .fromTo('transform', `translateX(${OFF_LEFT})`, `translateX(${CENTER})`)
|
25136 | .fromTo(OPACITY, 0.01, 1);
|
25137 | }
|
25138 | enteringToolBarItems.fromTo('transform', `translateX(${OFF_LEFT})`, `translateX(${CENTER})`);
|
25139 |
|
25140 | enteringBackButton.fromTo(OPACITY, 0.01, 1);
|
25141 | }
|
25142 | else {
|
25143 |
|
25144 | if (!enteringContentHasLargeTitle) {
|
25145 | enteringTitle
|
25146 | .fromTo('transform', `translateX(${OFF_RIGHT})`, `translateX(${CENTER})`)
|
25147 | .fromTo(OPACITY, 0.01, 1);
|
25148 | }
|
25149 | enteringToolBarItems.fromTo('transform', `translateX(${OFF_RIGHT})`, `translateX(${CENTER})`);
|
25150 | enteringToolBarBg.beforeClearStyles([OPACITY, 'transform']);
|
25151 | const translucentHeader = parentHeader === null || parentHeader === void 0 ? void 0 : parentHeader.translucent;
|
25152 | if (!translucentHeader) {
|
25153 | enteringToolBarBg.fromTo(OPACITY, 0.01, 'var(--opacity)');
|
25154 | }
|
25155 | else {
|
25156 | enteringToolBarBg.fromTo('transform', (isRTL ? 'translateX(-100%)' : 'translateX(100%)'), 'translateX(0px)');
|
25157 | }
|
25158 |
|
25159 | if (!forward) {
|
25160 | enteringBackButton.fromTo(OPACITY, 0.01, 1);
|
25161 | }
|
25162 | if (backButtonEl && !forward) {
|
25163 | const enteringBackBtnText = createAnimation();
|
25164 | enteringBackBtnText
|
25165 | .addElement(shadow(backButtonEl).querySelector('.button-text'))
|
25166 | .fromTo(`transform`, (isRTL ? 'translateX(-100px)' : 'translateX(100px)'), 'translateX(0px)');
|
25167 | enteringToolBar.addAnimation(enteringBackBtnText);
|
25168 | }
|
25169 | }
|
25170 | });
|
25171 |
|
25172 | if (leavingEl) {
|
25173 | const leavingContent = createAnimation();
|
25174 | const leavingContentEl = leavingEl.querySelector(':scope > ion-content');
|
25175 | const leavingToolBarEls = leavingEl.querySelectorAll(':scope > ion-header > ion-toolbar');
|
25176 | const leavingHeaderEls = leavingEl.querySelectorAll(':scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *');
|
25177 | if (!leavingContentEl && leavingToolBarEls.length === 0 && leavingHeaderEls.length === 0) {
|
25178 | leavingContent.addElement(leavingEl.querySelector(':scope > .ion-page, :scope > ion-nav, :scope > ion-tabs'));
|
25179 | }
|
25180 | else {
|
25181 | leavingContent.addElement(leavingContentEl);
|
25182 | leavingContent.addElement(leavingHeaderEls);
|
25183 | }
|
25184 | rootAnimation.addAnimation(leavingContent);
|
25185 | if (backDirection) {
|
25186 |
|
25187 | leavingContent
|
25188 | .beforeClearStyles([OPACITY])
|
25189 | .fromTo('transform', `translateX(${CENTER})`, (isRTL ? 'translateX(-100%)' : 'translateX(100%)'));
|
25190 | const leavingPage = getIonPageElement(leavingEl);
|
25191 | rootAnimation.afterAddWrite(() => {
|
25192 | if (rootAnimation.getDirection() === 'normal') {
|
25193 | leavingPage.style.setProperty('display', 'none');
|
25194 | }
|
25195 | });
|
25196 | }
|
25197 | else {
|
25198 |
|
25199 | leavingContent
|
25200 | .fromTo('transform', `translateX(${CENTER})`, `translateX(${OFF_LEFT})`)
|
25201 | .fromTo(OPACITY, 1, OFF_OPACITY);
|
25202 | }
|
25203 | if (leavingContentEl) {
|
25204 | const leavingTransitionEffectEl = shadow(leavingContentEl).querySelector('.transition-effect');
|
25205 | if (leavingTransitionEffectEl) {
|
25206 | const leavingTransitionCoverEl = leavingTransitionEffectEl.querySelector('.transition-cover');
|
25207 | const leavingTransitionShadowEl = leavingTransitionEffectEl.querySelector('.transition-shadow');
|
25208 | const leavingTransitionEffect = createAnimation();
|
25209 | const leavingTransitionCover = createAnimation();
|
25210 | const leavingTransitionShadow = createAnimation();
|
25211 | leavingTransitionEffect
|
25212 | .addElement(leavingTransitionEffectEl)
|
25213 | .beforeStyles({ opacity: '1', display: 'block' })
|
25214 | .afterStyles({ opacity: '', display: '' });
|
25215 | leavingTransitionCover
|
25216 | .addElement(leavingTransitionCoverEl)
|
25217 | .beforeClearStyles([OPACITY])
|
25218 | .fromTo(OPACITY, 0.1, 0);
|
25219 | leavingTransitionShadow
|
25220 | .addElement(leavingTransitionShadowEl)
|
25221 | .beforeClearStyles([OPACITY])
|
25222 | .fromTo(OPACITY, 0.70, 0.03);
|
25223 | leavingTransitionEffect.addAnimation([leavingTransitionCover, leavingTransitionShadow]);
|
25224 | leavingContent.addAnimation([leavingTransitionEffect]);
|
25225 | }
|
25226 | }
|
25227 | leavingToolBarEls.forEach(leavingToolBarEl => {
|
25228 | const leavingToolBar = createAnimation();
|
25229 | leavingToolBar.addElement(leavingToolBarEl);
|
25230 | const leavingTitle = createAnimation();
|
25231 | leavingTitle.addElement(leavingToolBarEl.querySelector('ion-title'));
|
25232 | const leavingToolBarButtons = createAnimation();
|
25233 | const buttons = leavingToolBarEl.querySelectorAll('ion-buttons,[menuToggle]');
|
25234 | const parentHeader = leavingToolBarEl.closest('ion-header');
|
25235 | const inactiveHeader = parentHeader && parentHeader.classList.contains('header-collapse-condense-inactive');
|
25236 | const buttonsToAnimate = Array.from(buttons).filter(button => {
|
25237 | const isCollapseButton = button.classList.contains('buttons-collapse');
|
25238 | return (isCollapseButton && !inactiveHeader) || !isCollapseButton;
|
25239 | });
|
25240 | leavingToolBarButtons.addElement(buttonsToAnimate);
|
25241 | const leavingToolBarItems = createAnimation();
|
25242 | const leavingToolBarItemEls = leavingToolBarEl.querySelectorAll(':scope > *:not(ion-title):not(ion-buttons):not([menuToggle])');
|
25243 | if (leavingToolBarItemEls.length > 0) {
|
25244 | leavingToolBarItems.addElement(leavingToolBarItemEls);
|
25245 | }
|
25246 | const leavingToolBarBg = createAnimation();
|
25247 | leavingToolBarBg.addElement(shadow(leavingToolBarEl).querySelector('.toolbar-background'));
|
25248 | const leavingBackButton = createAnimation();
|
25249 | const backButtonEl = leavingToolBarEl.querySelector('ion-back-button');
|
25250 | if (backButtonEl) {
|
25251 | leavingBackButton.addElement(backButtonEl);
|
25252 | }
|
25253 | leavingToolBar.addAnimation([leavingTitle, leavingToolBarButtons, leavingToolBarItems, leavingBackButton, leavingToolBarBg]);
|
25254 | rootAnimation.addAnimation(leavingToolBar);
|
25255 |
|
25256 | leavingBackButton.fromTo(OPACITY, 0.99, 0);
|
25257 | leavingToolBarButtons.fromTo(OPACITY, 0.99, 0);
|
25258 | leavingToolBarItems.fromTo(OPACITY, 0.99, 0);
|
25259 | if (backDirection) {
|
25260 | if (!inactiveHeader) {
|
25261 |
|
25262 | leavingTitle
|
25263 | .fromTo('transform', `translateX(${CENTER})`, (isRTL ? 'translateX(-100%)' : 'translateX(100%)'))
|
25264 | .fromTo(OPACITY, 0.99, 0);
|
25265 | }
|
25266 | leavingToolBarItems.fromTo('transform', `translateX(${CENTER})`, (isRTL ? 'translateX(-100%)' : 'translateX(100%)'));
|
25267 | leavingToolBarBg.beforeClearStyles([OPACITY, 'transform']);
|
25268 |
|
25269 |
|
25270 | const translucentHeader = parentHeader === null || parentHeader === void 0 ? void 0 : parentHeader.translucent;
|
25271 | if (!translucentHeader) {
|
25272 | leavingToolBarBg.fromTo(OPACITY, 'var(--opacity)', 0);
|
25273 | }
|
25274 | else {
|
25275 | leavingToolBarBg.fromTo('transform', 'translateX(0px)', (isRTL ? 'translateX(-100%)' : 'translateX(100%)'));
|
25276 | }
|
25277 | if (backButtonEl && !backward) {
|
25278 | const leavingBackBtnText = createAnimation();
|
25279 | leavingBackBtnText
|
25280 | .addElement(shadow(backButtonEl).querySelector('.button-text'))
|
25281 | .fromTo('transform', `translateX(${CENTER})`, `translateX(${(isRTL ? -124 : 124) + 'px'})`);
|
25282 | leavingToolBar.addAnimation(leavingBackBtnText);
|
25283 | }
|
25284 | }
|
25285 | else {
|
25286 |
|
25287 | if (!inactiveHeader) {
|
25288 | leavingTitle
|
25289 | .fromTo('transform', `translateX(${CENTER})`, `translateX(${OFF_LEFT})`)
|
25290 | .fromTo(OPACITY, 0.99, 0)
|
25291 | .afterClearStyles([TRANSFORM, OPACITY]);
|
25292 | }
|
25293 | leavingToolBarItems
|
25294 | .fromTo('transform', `translateX(${CENTER})`, `translateX(${OFF_LEFT})`)
|
25295 | .afterClearStyles([TRANSFORM, OPACITY]);
|
25296 | leavingBackButton.afterClearStyles([OPACITY]);
|
25297 | leavingTitle.afterClearStyles([OPACITY]);
|
25298 | leavingToolBarButtons.afterClearStyles([OPACITY]);
|
25299 | }
|
25300 | });
|
25301 | }
|
25302 | return rootAnimation;
|
25303 | }
|
25304 | catch (err) {
|
25305 | throw err;
|
25306 | }
|
25307 | };
|
25308 |
|
25309 | var ios_transition = Object.freeze({
|
25310 | __proto__: null,
|
25311 | shadow: shadow,
|
25312 | iosTransitionAnimation: iosTransitionAnimation
|
25313 | });
|
25314 |
|
25315 | const mdTransitionAnimation = (_, opts) => {
|
25316 | const OFF_BOTTOM = '40px';
|
25317 | const CENTER = '0px';
|
25318 | const backDirection = (opts.direction === 'back');
|
25319 | const enteringEl = opts.enteringEl;
|
25320 | const leavingEl = opts.leavingEl;
|
25321 | const ionPageElement = getIonPageElement(enteringEl);
|
25322 | const enteringToolbarEle = ionPageElement.querySelector('ion-toolbar');
|
25323 | const rootTransition = createAnimation();
|
25324 | rootTransition
|
25325 | .addElement(ionPageElement)
|
25326 | .fill('both')
|
25327 | .beforeRemoveClass('ion-page-invisible');
|
25328 |
|
25329 | if (backDirection) {
|
25330 | rootTransition
|
25331 | .duration(opts.duration || 200)
|
25332 | .easing('cubic-bezier(0.47,0,0.745,0.715)');
|
25333 | }
|
25334 | else {
|
25335 | rootTransition
|
25336 | .duration(opts.duration || 280)
|
25337 | .easing('cubic-bezier(0.36,0.66,0.04,1)')
|
25338 | .fromTo('transform', `translateY(${OFF_BOTTOM})`, `translateY(${CENTER})`)
|
25339 | .fromTo('opacity', 0.01, 1);
|
25340 | }
|
25341 |
|
25342 | if (enteringToolbarEle) {
|
25343 | const enteringToolBar = createAnimation();
|
25344 | enteringToolBar.addElement(enteringToolbarEle);
|
25345 | rootTransition.addAnimation(enteringToolBar);
|
25346 | }
|
25347 |
|
25348 | if (leavingEl && backDirection) {
|
25349 |
|
25350 | rootTransition
|
25351 | .duration(opts.duration || 200)
|
25352 | .easing('cubic-bezier(0.47,0,0.745,0.715)');
|
25353 | const leavingPage = createAnimation();
|
25354 | leavingPage
|
25355 | .addElement(getIonPageElement(leavingEl))
|
25356 | .onFinish(currentStep => {
|
25357 | if (currentStep === 1 && leavingPage.elements.length > 0) {
|
25358 | leavingPage.elements[0].style.setProperty('display', 'none');
|
25359 | }
|
25360 | })
|
25361 | .fromTo('transform', `translateY(${CENTER})`, `translateY(${OFF_BOTTOM})`)
|
25362 | .fromTo('opacity', 1, 0);
|
25363 | rootTransition.addAnimation(leavingPage);
|
25364 | }
|
25365 | return rootTransition;
|
25366 | };
|
25367 |
|
25368 | var md_transition = Object.freeze({
|
25369 | __proto__: null,
|
25370 | mdTransitionAnimation: mdTransitionAnimation
|
25371 | });
|
25372 |
|
25373 | const createSwipeBackGesture = (el, canStartHandler, onStartHandler, onMoveHandler, onEndHandler) => {
|
25374 | const win = el.ownerDocument.defaultView;
|
25375 | const canStart = (detail) => {
|
25376 | return detail.startX <= 50 && canStartHandler();
|
25377 | };
|
25378 | const onMove = (detail) => {
|
25379 |
|
25380 | const delta = detail.deltaX;
|
25381 | const stepValue = delta / win.innerWidth;
|
25382 | onMoveHandler(stepValue);
|
25383 | };
|
25384 | const onEnd = (detail) => {
|
25385 |
|
25386 | const delta = detail.deltaX;
|
25387 | const width = win.innerWidth;
|
25388 | const stepValue = delta / width;
|
25389 | const velocity = detail.velocityX;
|
25390 | const z = width / 2.0;
|
25391 | const shouldComplete = velocity >= 0 && (velocity > 0.2 || detail.deltaX > z);
|
25392 | const missing = shouldComplete ? 1 - stepValue : stepValue;
|
25393 | const missingDistance = missing * width;
|
25394 | let realDur = 0;
|
25395 | if (missingDistance > 5) {
|
25396 | const dur = missingDistance / Math.abs(velocity);
|
25397 | realDur = Math.min(dur, 540);
|
25398 | }
|
25399 | |
25400 |
|
25401 |
|
25402 |
|
25403 |
|
25404 | onEndHandler(shouldComplete, (stepValue <= 0) ? 0.01 : clamp(0, stepValue, 0.9999), realDur);
|
25405 | };
|
25406 | return createGesture({
|
25407 | el,
|
25408 | gestureName: 'goback-swipe',
|
25409 | gesturePriority: 40,
|
25410 | threshold: 10,
|
25411 | canStart,
|
25412 | onStart: onStartHandler,
|
25413 | onMove,
|
25414 | onEnd
|
25415 | });
|
25416 | };
|
25417 |
|
25418 | var swipeBack = Object.freeze({
|
25419 | __proto__: null,
|
25420 | createSwipeBackGesture: createSwipeBackGesture
|
25421 | });
|
25422 |
|
25423 |
|
25424 |
|
25425 |
|
25426 |
|
25427 |
|
25428 |
|
25429 |
|
25430 |
|
25431 |
|
25432 |
|
25433 |
|
25434 |
|
25435 | function isObject(obj) {
|
25436 | return (obj !== null &&
|
25437 | typeof obj === 'object' &&
|
25438 | 'constructor' in obj &&
|
25439 | obj.constructor === Object);
|
25440 | }
|
25441 | function extend(target, src) {
|
25442 | if (target === void 0) { target = {}; }
|
25443 | if (src === void 0) { src = {}; }
|
25444 | Object.keys(src).forEach(function (key) {
|
25445 | if (typeof target[key] === 'undefined')
|
25446 | target[key] = src[key];
|
25447 | else if (isObject(src[key]) &&
|
25448 | isObject(target[key]) &&
|
25449 | Object.keys(src[key]).length > 0) {
|
25450 | extend(target[key], src[key]);
|
25451 | }
|
25452 | });
|
25453 | }
|
25454 |
|
25455 | var doc = typeof document !== 'undefined' ? document : {};
|
25456 | var ssrDocument = {
|
25457 | body: {},
|
25458 | addEventListener: function () { },
|
25459 | removeEventListener: function () { },
|
25460 | activeElement: {
|
25461 | blur: function () { },
|
25462 | nodeName: '',
|
25463 | },
|
25464 | querySelector: function () {
|
25465 | return null;
|
25466 | },
|
25467 | querySelectorAll: function () {
|
25468 | return [];
|
25469 | },
|
25470 | getElementById: function () {
|
25471 | return null;
|
25472 | },
|
25473 | createEvent: function () {
|
25474 | return {
|
25475 | initEvent: function () { },
|
25476 | };
|
25477 | },
|
25478 | createElement: function () {
|
25479 | return {
|
25480 | children: [],
|
25481 | childNodes: [],
|
25482 | style: {},
|
25483 | setAttribute: function () { },
|
25484 | getElementsByTagName: function () {
|
25485 | return [];
|
25486 | },
|
25487 | };
|
25488 | },
|
25489 | createElementNS: function () {
|
25490 | return {};
|
25491 | },
|
25492 | importNode: function () {
|
25493 | return null;
|
25494 | },
|
25495 | location: {
|
25496 | hash: '',
|
25497 | host: '',
|
25498 | hostname: '',
|
25499 | href: '',
|
25500 | origin: '',
|
25501 | pathname: '',
|
25502 | protocol: '',
|
25503 | search: '',
|
25504 | },
|
25505 | };
|
25506 | extend(doc, ssrDocument);
|
25507 |
|
25508 | var win = typeof window !== 'undefined' ? window : {};
|
25509 | var ssrWindow = {
|
25510 | document: ssrDocument,
|
25511 | navigator: {
|
25512 | userAgent: '',
|
25513 | },
|
25514 | location: {
|
25515 | hash: '',
|
25516 | host: '',
|
25517 | hostname: '',
|
25518 | href: '',
|
25519 | origin: '',
|
25520 | pathname: '',
|
25521 | protocol: '',
|
25522 | search: '',
|
25523 | },
|
25524 | history: {
|
25525 | replaceState: function () { },
|
25526 | pushState: function () { },
|
25527 | go: function () { },
|
25528 | back: function () { },
|
25529 | },
|
25530 | CustomEvent: function CustomEvent() {
|
25531 | return this;
|
25532 | },
|
25533 | addEventListener: function () { },
|
25534 | removeEventListener: function () { },
|
25535 | getComputedStyle: function () {
|
25536 | return {
|
25537 | getPropertyValue: function () {
|
25538 | return '';
|
25539 | },
|
25540 | };
|
25541 | },
|
25542 | Image: function () { },
|
25543 | Date: function () { },
|
25544 | screen: {},
|
25545 | setTimeout: function () { },
|
25546 | clearTimeout: function () { },
|
25547 | matchMedia: function () {
|
25548 | return {};
|
25549 | },
|
25550 | };
|
25551 | extend(win, ssrWindow);
|
25552 |
|
25553 |
|
25554 |
|
25555 |
|
25556 |
|
25557 |
|
25558 |
|
25559 |
|
25560 |
|
25561 |
|
25562 |
|
25563 |
|
25564 |
|
25565 |
|
25566 |
|
25567 | class Dom7 {
|
25568 | constructor(arr) {
|
25569 | const self = this;
|
25570 |
|
25571 | for (let i = 0; i < arr.length; i += 1) {
|
25572 | self[i] = arr[i];
|
25573 | }
|
25574 | self.length = arr.length;
|
25575 |
|
25576 | return this;
|
25577 | }
|
25578 | }
|
25579 |
|
25580 | function $(selector, context) {
|
25581 | const arr = [];
|
25582 | let i = 0;
|
25583 | if (selector && !context) {
|
25584 | if (selector instanceof Dom7) {
|
25585 | return selector;
|
25586 | }
|
25587 | }
|
25588 | if (selector) {
|
25589 |
|
25590 | if (typeof selector === 'string') {
|
25591 | let els;
|
25592 | let tempParent;
|
25593 | const html = selector.trim();
|
25594 | if (html.indexOf('<') >= 0 && html.indexOf('>') >= 0) {
|
25595 | let toCreate = 'div';
|
25596 | if (html.indexOf('<li') === 0) toCreate = 'ul';
|
25597 | if (html.indexOf('<tr') === 0) toCreate = 'tbody';
|
25598 | if (html.indexOf('<td') === 0 || html.indexOf('<th') === 0) toCreate = 'tr';
|
25599 | if (html.indexOf('<tbody') === 0) toCreate = 'table';
|
25600 | if (html.indexOf('<option') === 0) toCreate = 'select';
|
25601 | tempParent = doc.createElement(toCreate);
|
25602 | tempParent.innerHTML = html;
|
25603 | for (i = 0; i < tempParent.childNodes.length; i += 1) {
|
25604 | arr.push(tempParent.childNodes[i]);
|
25605 | }
|
25606 | } else {
|
25607 | if (!context && selector[0] === '#' && !selector.match(/[ .<>:~]/)) {
|
25608 |
|
25609 | els = [doc.getElementById(selector.trim().split('#')[1])];
|
25610 | } else {
|
25611 |
|
25612 | els = (context || doc).querySelectorAll(selector.trim());
|
25613 | }
|
25614 | for (i = 0; i < els.length; i += 1) {
|
25615 | if (els[i]) arr.push(els[i]);
|
25616 | }
|
25617 | }
|
25618 | } else if (selector.nodeType || selector === win || selector === doc) {
|
25619 |
|
25620 | arr.push(selector);
|
25621 | } else if (selector.length > 0 && selector[0].nodeType) {
|
25622 |
|
25623 | for (i = 0; i < selector.length; i += 1) {
|
25624 | arr.push(selector[i]);
|
25625 | }
|
25626 | }
|
25627 | }
|
25628 | return new Dom7(arr);
|
25629 | }
|
25630 |
|
25631 | $.fn = Dom7.prototype;
|
25632 | $.Class = Dom7;
|
25633 | $.Dom7 = Dom7;
|
25634 |
|
25635 | function unique(arr) {
|
25636 | const uniqueArray = [];
|
25637 | for (let i = 0; i < arr.length; i += 1) {
|
25638 | if (uniqueArray.indexOf(arr[i]) === -1) uniqueArray.push(arr[i]);
|
25639 | }
|
25640 | return uniqueArray;
|
25641 | }
|
25642 |
|
25643 |
|
25644 | function addClass(className) {
|
25645 | if (typeof className === 'undefined') {
|
25646 | return this;
|
25647 | }
|
25648 | const classes = className.split(' ');
|
25649 | for (let i = 0; i < classes.length; i += 1) {
|
25650 | for (let j = 0; j < this.length; j += 1) {
|
25651 | if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.add(classes[i]);
|
25652 | }
|
25653 | }
|
25654 | return this;
|
25655 | }
|
25656 | function removeClass(className) {
|
25657 | const classes = className.split(' ');
|
25658 | for (let i = 0; i < classes.length; i += 1) {
|
25659 | for (let j = 0; j < this.length; j += 1) {
|
25660 | if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.remove(classes[i]);
|
25661 | }
|
25662 | }
|
25663 | return this;
|
25664 | }
|
25665 | function hasClass(className) {
|
25666 | if (!this[0]) return false;
|
25667 | return this[0].classList.contains(className);
|
25668 | }
|
25669 | function toggleClass(className) {
|
25670 | const classes = className.split(' ');
|
25671 | for (let i = 0; i < classes.length; i += 1) {
|
25672 | for (let j = 0; j < this.length; j += 1) {
|
25673 | if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.toggle(classes[i]);
|
25674 | }
|
25675 | }
|
25676 | return this;
|
25677 | }
|
25678 | function attr(attrs, value) {
|
25679 | if (arguments.length === 1 && typeof attrs === 'string') {
|
25680 |
|
25681 | if (this[0]) return this[0].getAttribute(attrs);
|
25682 | return undefined;
|
25683 | }
|
25684 |
|
25685 |
|
25686 | for (let i = 0; i < this.length; i += 1) {
|
25687 | if (arguments.length === 2) {
|
25688 |
|
25689 | this[i].setAttribute(attrs, value);
|
25690 | } else {
|
25691 |
|
25692 |
|
25693 | for (const attrName in attrs) {
|
25694 | this[i][attrName] = attrs[attrName];
|
25695 | this[i].setAttribute(attrName, attrs[attrName]);
|
25696 | }
|
25697 | }
|
25698 | }
|
25699 | return this;
|
25700 | }
|
25701 |
|
25702 | function removeAttr(attr) {
|
25703 | for (let i = 0; i < this.length; i += 1) {
|
25704 | this[i].removeAttribute(attr);
|
25705 | }
|
25706 | return this;
|
25707 | }
|
25708 | function data(key, value) {
|
25709 | let el;
|
25710 | if (typeof value === 'undefined') {
|
25711 | el = this[0];
|
25712 |
|
25713 | if (el) {
|
25714 | if (el.dom7ElementDataStorage && (key in el.dom7ElementDataStorage)) {
|
25715 | return el.dom7ElementDataStorage[key];
|
25716 | }
|
25717 |
|
25718 | const dataKey = el.getAttribute(`data-${key}`);
|
25719 | if (dataKey) {
|
25720 | return dataKey;
|
25721 | }
|
25722 | return undefined;
|
25723 | }
|
25724 | return undefined;
|
25725 | }
|
25726 |
|
25727 |
|
25728 | for (let i = 0; i < this.length; i += 1) {
|
25729 | el = this[i];
|
25730 | if (!el.dom7ElementDataStorage) el.dom7ElementDataStorage = {};
|
25731 | el.dom7ElementDataStorage[key] = value;
|
25732 | }
|
25733 | return this;
|
25734 | }
|
25735 |
|
25736 |
|
25737 | function transform(transform) {
|
25738 | for (let i = 0; i < this.length; i += 1) {
|
25739 | const elStyle = this[i].style;
|
25740 | elStyle.webkitTransform = transform;
|
25741 | elStyle.transform = transform;
|
25742 | }
|
25743 | return this;
|
25744 | }
|
25745 | function transition(duration) {
|
25746 | if (typeof duration !== 'string') {
|
25747 | duration = `${duration}ms`;
|
25748 | }
|
25749 | for (let i = 0; i < this.length; i += 1) {
|
25750 | const elStyle = this[i].style;
|
25751 | elStyle.webkitTransitionDuration = duration;
|
25752 | elStyle.transitionDuration = duration;
|
25753 | }
|
25754 | return this;
|
25755 | }
|
25756 |
|
25757 | function on(...args) {
|
25758 | let [eventType, targetSelector, listener, capture] = args;
|
25759 | if (typeof args[1] === 'function') {
|
25760 | [eventType, listener, capture] = args;
|
25761 | targetSelector = undefined;
|
25762 | }
|
25763 | if (!capture) capture = false;
|
25764 |
|
25765 | function handleLiveEvent(e) {
|
25766 | const target = e.target;
|
25767 | if (!target) return;
|
25768 | const eventData = e.target.dom7EventData || [];
|
25769 | if (eventData.indexOf(e) < 0) {
|
25770 | eventData.unshift(e);
|
25771 | }
|
25772 | if ($(target).is(targetSelector)) listener.apply(target, eventData);
|
25773 | else {
|
25774 | const parents = $(target).parents();
|
25775 | for (let k = 0; k < parents.length; k += 1) {
|
25776 | if ($(parents[k]).is(targetSelector)) listener.apply(parents[k], eventData);
|
25777 | }
|
25778 | }
|
25779 | }
|
25780 | function handleEvent(e) {
|
25781 | const eventData = e && e.target ? e.target.dom7EventData || [] : [];
|
25782 | if (eventData.indexOf(e) < 0) {
|
25783 | eventData.unshift(e);
|
25784 | }
|
25785 | listener.apply(this, eventData);
|
25786 | }
|
25787 | const events = eventType.split(' ');
|
25788 | let j;
|
25789 | for (let i = 0; i < this.length; i += 1) {
|
25790 | const el = this[i];
|
25791 | if (!targetSelector) {
|
25792 | for (j = 0; j < events.length; j += 1) {
|
25793 | const event = events[j];
|
25794 | if (!el.dom7Listeners) el.dom7Listeners = {};
|
25795 | if (!el.dom7Listeners[event]) el.dom7Listeners[event] = [];
|
25796 | el.dom7Listeners[event].push({
|
25797 | listener,
|
25798 | proxyListener: handleEvent,
|
25799 | });
|
25800 | el.addEventListener(event, handleEvent, capture);
|
25801 | }
|
25802 | } else {
|
25803 |
|
25804 | for (j = 0; j < events.length; j += 1) {
|
25805 | const event = events[j];
|
25806 | if (!el.dom7LiveListeners) el.dom7LiveListeners = {};
|
25807 | if (!el.dom7LiveListeners[event]) el.dom7LiveListeners[event] = [];
|
25808 | el.dom7LiveListeners[event].push({
|
25809 | listener,
|
25810 | proxyListener: handleLiveEvent,
|
25811 | });
|
25812 | el.addEventListener(event, handleLiveEvent, capture);
|
25813 | }
|
25814 | }
|
25815 | }
|
25816 | return this;
|
25817 | }
|
25818 | function off(...args) {
|
25819 | let [eventType, targetSelector, listener, capture] = args;
|
25820 | if (typeof args[1] === 'function') {
|
25821 | [eventType, listener, capture] = args;
|
25822 | targetSelector = undefined;
|
25823 | }
|
25824 | if (!capture) capture = false;
|
25825 |
|
25826 | const events = eventType.split(' ');
|
25827 | for (let i = 0; i < events.length; i += 1) {
|
25828 | const event = events[i];
|
25829 | for (let j = 0; j < this.length; j += 1) {
|
25830 | const el = this[j];
|
25831 | let handlers;
|
25832 | if (!targetSelector && el.dom7Listeners) {
|
25833 | handlers = el.dom7Listeners[event];
|
25834 | } else if (targetSelector && el.dom7LiveListeners) {
|
25835 | handlers = el.dom7LiveListeners[event];
|
25836 | }
|
25837 | if (handlers && handlers.length) {
|
25838 | for (let k = handlers.length - 1; k >= 0; k -= 1) {
|
25839 | const handler = handlers[k];
|
25840 | if (listener && handler.listener === listener) {
|
25841 | el.removeEventListener(event, handler.proxyListener, capture);
|
25842 | handlers.splice(k, 1);
|
25843 | } else if (listener && handler.listener && handler.listener.dom7proxy && handler.listener.dom7proxy === listener) {
|
25844 | el.removeEventListener(event, handler.proxyListener, capture);
|
25845 | handlers.splice(k, 1);
|
25846 | } else if (!listener) {
|
25847 | el.removeEventListener(event, handler.proxyListener, capture);
|
25848 | handlers.splice(k, 1);
|
25849 | }
|
25850 | }
|
25851 | }
|
25852 | }
|
25853 | }
|
25854 | return this;
|
25855 | }
|
25856 | function trigger(...args) {
|
25857 | const events = args[0].split(' ');
|
25858 | const eventData = args[1];
|
25859 | for (let i = 0; i < events.length; i += 1) {
|
25860 | const event = events[i];
|
25861 | for (let j = 0; j < this.length; j += 1) {
|
25862 | const el = this[j];
|
25863 | let evt;
|
25864 | try {
|
25865 | evt = new win.CustomEvent(event, {
|
25866 | detail: eventData,
|
25867 | bubbles: true,
|
25868 | cancelable: true,
|
25869 | });
|
25870 | } catch (e) {
|
25871 | evt = doc.createEvent('Event');
|
25872 | evt.initEvent(event, true, true);
|
25873 | evt.detail = eventData;
|
25874 | }
|
25875 |
|
25876 | el.dom7EventData = args.filter((data, dataIndex) => dataIndex > 0);
|
25877 | el.dispatchEvent(evt);
|
25878 | el.dom7EventData = [];
|
25879 | delete el.dom7EventData;
|
25880 | }
|
25881 | }
|
25882 | return this;
|
25883 | }
|
25884 | function transitionEnd(callback) {
|
25885 | const events = ['webkitTransitionEnd', 'transitionend'];
|
25886 | const dom = this;
|
25887 | let i;
|
25888 | function fireCallBack(e) {
|
25889 |
|
25890 | if (e.target !== this) return;
|
25891 | callback.call(this, e);
|
25892 | for (i = 0; i < events.length; i += 1) {
|
25893 | dom.off(events[i], fireCallBack);
|
25894 | }
|
25895 | }
|
25896 | if (callback) {
|
25897 | for (i = 0; i < events.length; i += 1) {
|
25898 | dom.on(events[i], fireCallBack);
|
25899 | }
|
25900 | }
|
25901 | return this;
|
25902 | }
|
25903 | function outerWidth(includeMargins) {
|
25904 | if (this.length > 0) {
|
25905 | if (includeMargins) {
|
25906 |
|
25907 | const styles = this.styles();
|
25908 | return this[0].offsetWidth + parseFloat(styles.getPropertyValue('margin-right')) + parseFloat(styles.getPropertyValue('margin-left'));
|
25909 | }
|
25910 | return this[0].offsetWidth;
|
25911 | }
|
25912 | return null;
|
25913 | }
|
25914 | function outerHeight(includeMargins) {
|
25915 | if (this.length > 0) {
|
25916 | if (includeMargins) {
|
25917 |
|
25918 | const styles = this.styles();
|
25919 | return this[0].offsetHeight + parseFloat(styles.getPropertyValue('margin-top')) + parseFloat(styles.getPropertyValue('margin-bottom'));
|
25920 | }
|
25921 | return this[0].offsetHeight;
|
25922 | }
|
25923 | return null;
|
25924 | }
|
25925 | function offset() {
|
25926 | if (this.length > 0) {
|
25927 | const el = this[0];
|
25928 | const box = el.getBoundingClientRect();
|
25929 | const body = doc.body;
|
25930 | const clientTop = el.clientTop || body.clientTop || 0;
|
25931 | const clientLeft = el.clientLeft || body.clientLeft || 0;
|
25932 | const scrollTop = el === win ? win.scrollY : el.scrollTop;
|
25933 | const scrollLeft = el === win ? win.scrollX : el.scrollLeft;
|
25934 | return {
|
25935 | top: (box.top + scrollTop) - clientTop,
|
25936 | left: (box.left + scrollLeft) - clientLeft,
|
25937 | };
|
25938 | }
|
25939 |
|
25940 | return null;
|
25941 | }
|
25942 | function styles() {
|
25943 | if (this[0]) return win.getComputedStyle(this[0], null);
|
25944 | return {};
|
25945 | }
|
25946 | function css(props, value) {
|
25947 | let i;
|
25948 | if (arguments.length === 1) {
|
25949 | if (typeof props === 'string') {
|
25950 | if (this[0]) return win.getComputedStyle(this[0], null).getPropertyValue(props);
|
25951 | } else {
|
25952 | for (i = 0; i < this.length; i += 1) {
|
25953 |
|
25954 | for (let prop in props) {
|
25955 | this[i].style[prop] = props[prop];
|
25956 | }
|
25957 | }
|
25958 | return this;
|
25959 | }
|
25960 | }
|
25961 | if (arguments.length === 2 && typeof props === 'string') {
|
25962 | for (i = 0; i < this.length; i += 1) {
|
25963 | this[i].style[props] = value;
|
25964 | }
|
25965 | return this;
|
25966 | }
|
25967 | return this;
|
25968 | }
|
25969 |
|
25970 | function each(callback) {
|
25971 |
|
25972 | if (!callback) return this;
|
25973 |
|
25974 | for (let i = 0; i < this.length; i += 1) {
|
25975 |
|
25976 | if (callback.call(this[i], i, this[i]) === false) {
|
25977 |
|
25978 | return this;
|
25979 | }
|
25980 | }
|
25981 |
|
25982 | return this;
|
25983 | }
|
25984 | function filter(callback) {
|
25985 | const matchedItems = [];
|
25986 | const dom = this;
|
25987 | for (let i = 0; i < dom.length; i += 1) {
|
25988 | if (callback.call(dom[i], i, dom[i])) matchedItems.push(dom[i]);
|
25989 | }
|
25990 | return new Dom7(matchedItems);
|
25991 | }
|
25992 |
|
25993 | function html(html) {
|
25994 | if (typeof html === 'undefined') {
|
25995 | return this[0] ? this[0].innerHTML : undefined;
|
25996 | }
|
25997 |
|
25998 | for (let i = 0; i < this.length; i += 1) {
|
25999 | this[i].innerHTML = html;
|
26000 | }
|
26001 | return this;
|
26002 | }
|
26003 |
|
26004 | function text(text) {
|
26005 | if (typeof text === 'undefined') {
|
26006 | if (this[0]) {
|
26007 | return this[0].textContent.trim();
|
26008 | }
|
26009 | return null;
|
26010 | }
|
26011 |
|
26012 | for (let i = 0; i < this.length; i += 1) {
|
26013 | this[i].textContent = text;
|
26014 | }
|
26015 | return this;
|
26016 | }
|
26017 | function is(selector) {
|
26018 | const el = this[0];
|
26019 | let compareWith;
|
26020 | let i;
|
26021 | if (!el || typeof selector === 'undefined') return false;
|
26022 | if (typeof selector === 'string') {
|
26023 | if (el.matches) return el.matches(selector);
|
26024 | else if (el.webkitMatchesSelector) return el.webkitMatchesSelector(selector);
|
26025 | else if (el.msMatchesSelector) return el.msMatchesSelector(selector);
|
26026 |
|
26027 | compareWith = $(selector);
|
26028 | for (i = 0; i < compareWith.length; i += 1) {
|
26029 | if (compareWith[i] === el) return true;
|
26030 | }
|
26031 | return false;
|
26032 | } else if (selector === doc) return el === doc;
|
26033 | else if (selector === win) return el === win;
|
26034 |
|
26035 | if (selector.nodeType || selector instanceof Dom7) {
|
26036 | compareWith = selector.nodeType ? [selector] : selector;
|
26037 | for (i = 0; i < compareWith.length; i += 1) {
|
26038 | if (compareWith[i] === el) return true;
|
26039 | }
|
26040 | return false;
|
26041 | }
|
26042 | return false;
|
26043 | }
|
26044 | function index() {
|
26045 | let child = this[0];
|
26046 | let i;
|
26047 | if (child) {
|
26048 | i = 0;
|
26049 |
|
26050 | while ((child = child.previousSibling) !== null) {
|
26051 | if (child.nodeType === 1) i += 1;
|
26052 | }
|
26053 | return i;
|
26054 | }
|
26055 | return undefined;
|
26056 | }
|
26057 |
|
26058 | function eq(index) {
|
26059 | if (typeof index === 'undefined') return this;
|
26060 | const length = this.length;
|
26061 | let returnIndex;
|
26062 | if (index > length - 1) {
|
26063 | return new Dom7([]);
|
26064 | }
|
26065 | if (index < 0) {
|
26066 | returnIndex = length + index;
|
26067 | if (returnIndex < 0) return new Dom7([]);
|
26068 | return new Dom7([this[returnIndex]]);
|
26069 | }
|
26070 | return new Dom7([this[index]]);
|
26071 | }
|
26072 | function append(...args) {
|
26073 | let newChild;
|
26074 |
|
26075 | for (let k = 0; k < args.length; k += 1) {
|
26076 | newChild = args[k];
|
26077 | for (let i = 0; i < this.length; i += 1) {
|
26078 | if (typeof newChild === 'string') {
|
26079 | const tempDiv = doc.createElement('div');
|
26080 | tempDiv.innerHTML = newChild;
|
26081 | while (tempDiv.firstChild) {
|
26082 | this[i].appendChild(tempDiv.firstChild);
|
26083 | }
|
26084 | } else if (newChild instanceof Dom7) {
|
26085 | for (let j = 0; j < newChild.length; j += 1) {
|
26086 | this[i].appendChild(newChild[j]);
|
26087 | }
|
26088 | } else {
|
26089 | this[i].appendChild(newChild);
|
26090 | }
|
26091 | }
|
26092 | }
|
26093 |
|
26094 | return this;
|
26095 | }
|
26096 | function prepend(newChild) {
|
26097 | let i;
|
26098 | let j;
|
26099 | for (i = 0; i < this.length; i += 1) {
|
26100 | if (typeof newChild === 'string') {
|
26101 | const tempDiv = doc.createElement('div');
|
26102 | tempDiv.innerHTML = newChild;
|
26103 | for (j = tempDiv.childNodes.length - 1; j >= 0; j -= 1) {
|
26104 | this[i].insertBefore(tempDiv.childNodes[j], this[i].childNodes[0]);
|
26105 | }
|
26106 | } else if (newChild instanceof Dom7) {
|
26107 | for (j = 0; j < newChild.length; j += 1) {
|
26108 | this[i].insertBefore(newChild[j], this[i].childNodes[0]);
|
26109 | }
|
26110 | } else {
|
26111 | this[i].insertBefore(newChild, this[i].childNodes[0]);
|
26112 | }
|
26113 | }
|
26114 | return this;
|
26115 | }
|
26116 | function next(selector) {
|
26117 | if (this.length > 0) {
|
26118 | if (selector) {
|
26119 | if (this[0].nextElementSibling && $(this[0].nextElementSibling).is(selector)) {
|
26120 | return new Dom7([this[0].nextElementSibling]);
|
26121 | }
|
26122 | return new Dom7([]);
|
26123 | }
|
26124 |
|
26125 | if (this[0].nextElementSibling) return new Dom7([this[0].nextElementSibling]);
|
26126 | return new Dom7([]);
|
26127 | }
|
26128 | return new Dom7([]);
|
26129 | }
|
26130 | function nextAll(selector) {
|
26131 | const nextEls = [];
|
26132 | let el = this[0];
|
26133 | if (!el) return new Dom7([]);
|
26134 | while (el.nextElementSibling) {
|
26135 | const next = el.nextElementSibling;
|
26136 | if (selector) {
|
26137 | if ($(next).is(selector)) nextEls.push(next);
|
26138 | } else nextEls.push(next);
|
26139 | el = next;
|
26140 | }
|
26141 | return new Dom7(nextEls);
|
26142 | }
|
26143 | function prev(selector) {
|
26144 | if (this.length > 0) {
|
26145 | const el = this[0];
|
26146 | if (selector) {
|
26147 | if (el.previousElementSibling && $(el.previousElementSibling).is(selector)) {
|
26148 | return new Dom7([el.previousElementSibling]);
|
26149 | }
|
26150 | return new Dom7([]);
|
26151 | }
|
26152 |
|
26153 | if (el.previousElementSibling) return new Dom7([el.previousElementSibling]);
|
26154 | return new Dom7([]);
|
26155 | }
|
26156 | return new Dom7([]);
|
26157 | }
|
26158 | function prevAll(selector) {
|
26159 | const prevEls = [];
|
26160 | let el = this[0];
|
26161 | if (!el) return new Dom7([]);
|
26162 | while (el.previousElementSibling) {
|
26163 | const prev = el.previousElementSibling;
|
26164 | if (selector) {
|
26165 | if ($(prev).is(selector)) prevEls.push(prev);
|
26166 | } else prevEls.push(prev);
|
26167 | el = prev;
|
26168 | }
|
26169 | return new Dom7(prevEls);
|
26170 | }
|
26171 | function parent(selector) {
|
26172 | const parents = [];
|
26173 | for (let i = 0; i < this.length; i += 1) {
|
26174 | if (this[i].parentNode !== null) {
|
26175 | if (selector) {
|
26176 | if ($(this[i].parentNode).is(selector)) parents.push(this[i].parentNode);
|
26177 | } else {
|
26178 | parents.push(this[i].parentNode);
|
26179 | }
|
26180 | }
|
26181 | }
|
26182 | return $(unique(parents));
|
26183 | }
|
26184 | function parents(selector) {
|
26185 | const parents = [];
|
26186 | for (let i = 0; i < this.length; i += 1) {
|
26187 | let parent = this[i].parentNode;
|
26188 | while (parent) {
|
26189 | if (selector) {
|
26190 | if ($(parent).is(selector)) parents.push(parent);
|
26191 | } else {
|
26192 | parents.push(parent);
|
26193 | }
|
26194 | parent = parent.parentNode;
|
26195 | }
|
26196 | }
|
26197 | return $(unique(parents));
|
26198 | }
|
26199 | function closest(selector) {
|
26200 | let closest = this;
|
26201 | if (typeof selector === 'undefined') {
|
26202 | return new Dom7([]);
|
26203 | }
|
26204 | if (!closest.is(selector)) {
|
26205 | closest = closest.parents(selector).eq(0);
|
26206 | }
|
26207 | return closest;
|
26208 | }
|
26209 | function find(selector) {
|
26210 | const foundElements = [];
|
26211 | for (let i = 0; i < this.length; i += 1) {
|
26212 | const found = this[i].querySelectorAll(selector);
|
26213 | for (let j = 0; j < found.length; j += 1) {
|
26214 | foundElements.push(found[j]);
|
26215 | }
|
26216 | }
|
26217 | return new Dom7(foundElements);
|
26218 | }
|
26219 | function children(selector) {
|
26220 | const children = [];
|
26221 | for (let i = 0; i < this.length; i += 1) {
|
26222 | const childNodes = this[i].childNodes;
|
26223 |
|
26224 | for (let j = 0; j < childNodes.length; j += 1) {
|
26225 | if (!selector) {
|
26226 | if (childNodes[j].nodeType === 1) children.push(childNodes[j]);
|
26227 | } else if (childNodes[j].nodeType === 1 && $(childNodes[j]).is(selector)) {
|
26228 | children.push(childNodes[j]);
|
26229 | }
|
26230 | }
|
26231 | }
|
26232 | return new Dom7(unique(children));
|
26233 | }
|
26234 | function remove() {
|
26235 | for (let i = 0; i < this.length; i += 1) {
|
26236 | if (this[i].parentNode) this[i].parentNode.removeChild(this[i]);
|
26237 | }
|
26238 | return this;
|
26239 | }
|
26240 | function add(...args) {
|
26241 | const dom = this;
|
26242 | let i;
|
26243 | let j;
|
26244 | for (i = 0; i < args.length; i += 1) {
|
26245 | const toAdd = $(args[i]);
|
26246 | for (j = 0; j < toAdd.length; j += 1) {
|
26247 | dom[dom.length] = toAdd[j];
|
26248 | dom.length += 1;
|
26249 | }
|
26250 | }
|
26251 | return dom;
|
26252 | }
|
26253 |
|
26254 |
|
26255 |
|
26256 |
|
26257 |
|
26258 |
|
26259 |
|
26260 |
|
26261 |
|
26262 |
|
26263 |
|
26264 |
|
26265 |
|
26266 | const Methods = {
|
26267 | addClass,
|
26268 | removeClass,
|
26269 | hasClass,
|
26270 | toggleClass,
|
26271 | attr,
|
26272 | removeAttr,
|
26273 | data,
|
26274 | transform,
|
26275 | transition: transition,
|
26276 | on,
|
26277 | off,
|
26278 | trigger,
|
26279 | transitionEnd: transitionEnd,
|
26280 | outerWidth,
|
26281 | outerHeight,
|
26282 | offset,
|
26283 | css,
|
26284 | each,
|
26285 | html,
|
26286 | text,
|
26287 | is,
|
26288 | index,
|
26289 | eq,
|
26290 | append,
|
26291 | prepend,
|
26292 | next,
|
26293 | nextAll,
|
26294 | prev,
|
26295 | prevAll,
|
26296 | parent,
|
26297 | parents,
|
26298 | closest,
|
26299 | find,
|
26300 | children,
|
26301 | filter,
|
26302 | remove,
|
26303 | add,
|
26304 | styles,
|
26305 | };
|
26306 |
|
26307 | Object.keys(Methods).forEach((methodName) => {
|
26308 | $.fn[methodName] = $.fn[methodName] || Methods[methodName];
|
26309 | });
|
26310 |
|
26311 | const Utils = {
|
26312 | deleteProps(obj) {
|
26313 | const object = obj;
|
26314 | Object.keys(object).forEach((key) => {
|
26315 | try {
|
26316 | object[key] = null;
|
26317 | } catch (e) {
|
26318 |
|
26319 | }
|
26320 | try {
|
26321 | delete object[key];
|
26322 | } catch (e) {
|
26323 |
|
26324 | }
|
26325 | });
|
26326 | },
|
26327 | nextTick(callback, delay = 0) {
|
26328 | return setTimeout(callback, delay);
|
26329 | },
|
26330 | now() {
|
26331 | return Date.now();
|
26332 | },
|
26333 | getTranslate(el, axis = 'x') {
|
26334 | let matrix;
|
26335 | let curTransform;
|
26336 | let transformMatrix;
|
26337 |
|
26338 | const curStyle = win.getComputedStyle(el, null);
|
26339 |
|
26340 | if (win.WebKitCSSMatrix) {
|
26341 | curTransform = curStyle.transform || curStyle.webkitTransform;
|
26342 | if (curTransform.split(',').length > 6) {
|
26343 | curTransform = curTransform.split(', ').map((a) => a.replace(',', '.')).join(', ');
|
26344 | }
|
26345 |
|
26346 |
|
26347 | transformMatrix = new win.WebKitCSSMatrix(curTransform === 'none' ? '' : curTransform);
|
26348 | } else {
|
26349 | transformMatrix = curStyle.MozTransform || curStyle.OTransform || curStyle.MsTransform || curStyle.msTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
26350 | matrix = transformMatrix.toString().split(',');
|
26351 | }
|
26352 |
|
26353 | if (axis === 'x') {
|
26354 |
|
26355 | if (win.WebKitCSSMatrix) curTransform = transformMatrix.m41;
|
26356 |
|
26357 | else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
|
26358 |
|
26359 | else curTransform = parseFloat(matrix[4]);
|
26360 | }
|
26361 | if (axis === 'y') {
|
26362 |
|
26363 | if (win.WebKitCSSMatrix) curTransform = transformMatrix.m42;
|
26364 |
|
26365 | else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
|
26366 |
|
26367 | else curTransform = parseFloat(matrix[5]);
|
26368 | }
|
26369 | return curTransform || 0;
|
26370 | },
|
26371 | parseUrlQuery(url) {
|
26372 | const query = {};
|
26373 | let urlToParse = url || win.location.href;
|
26374 | let i;
|
26375 | let params;
|
26376 | let param;
|
26377 | let length;
|
26378 | if (typeof urlToParse === 'string' && urlToParse.length) {
|
26379 | urlToParse = urlToParse.indexOf('?') > -1 ? urlToParse.replace(/\S*\?/, '') : '';
|
26380 | params = urlToParse.split('&').filter((paramsPart) => paramsPart !== '');
|
26381 | length = params.length;
|
26382 |
|
26383 | for (i = 0; i < length; i += 1) {
|
26384 | param = params[i].replace(/#\S+/g, '').split('=');
|
26385 | query[decodeURIComponent(param[0])] = typeof param[1] === 'undefined' ? undefined : decodeURIComponent(param[1]) || '';
|
26386 | }
|
26387 | }
|
26388 | return query;
|
26389 | },
|
26390 | isObject(o) {
|
26391 | return typeof o === 'object' && o !== null && o.constructor && o.constructor === Object;
|
26392 | },
|
26393 | extend(...args) {
|
26394 | const to = Object(args[0]);
|
26395 | const noExtend = ['__proto__', 'constructor', 'prototype'];
|
26396 | for (let i = 1; i < args.length; i += 1) {
|
26397 | const nextSource = args[i];
|
26398 | if (nextSource !== undefined && nextSource !== null) {
|
26399 | const keysArray = Object.keys(Object(nextSource)).filter((key) => noExtend.indexOf(key) < 0);
|
26400 | for (let nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex += 1) {
|
26401 | const nextKey = keysArray[nextIndex];
|
26402 | const desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
|
26403 | if (desc !== undefined && desc.enumerable) {
|
26404 | if (Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {
|
26405 | Utils.extend(to[nextKey], nextSource[nextKey]);
|
26406 | } else if (!Utils.isObject(to[nextKey]) && Utils.isObject(nextSource[nextKey])) {
|
26407 | to[nextKey] = {};
|
26408 | Utils.extend(to[nextKey], nextSource[nextKey]);
|
26409 | } else {
|
26410 | to[nextKey] = nextSource[nextKey];
|
26411 | }
|
26412 | }
|
26413 | }
|
26414 | }
|
26415 | }
|
26416 | return to;
|
26417 | },
|
26418 | };
|
26419 |
|
26420 | const Support = (function Support() {
|
26421 | return {
|
26422 | touch: !!(('ontouchstart' in win) || (win.DocumentTouch && doc instanceof win.DocumentTouch)),
|
26423 |
|
26424 | pointerEvents: !!win.PointerEvent && ('maxTouchPoints' in win.navigator) && win.navigator.maxTouchPoints >= 0,
|
26425 |
|
26426 | observer: (function checkObserver() {
|
26427 | return ('MutationObserver' in win || 'WebkitMutationObserver' in win);
|
26428 | }()),
|
26429 |
|
26430 | passiveListener: (function checkPassiveListener() {
|
26431 | let supportsPassive = false;
|
26432 | try {
|
26433 | const opts = Object.defineProperty({}, 'passive', {
|
26434 |
|
26435 | get() {
|
26436 | supportsPassive = true;
|
26437 | },
|
26438 | });
|
26439 | win.addEventListener('testPassiveListener', null, opts);
|
26440 | } catch (e) {
|
26441 |
|
26442 | }
|
26443 | return supportsPassive;
|
26444 | }()),
|
26445 |
|
26446 | gestures: (function checkGestures() {
|
26447 | return 'ongesturestart' in win;
|
26448 | }()),
|
26449 | };
|
26450 | }());
|
26451 |
|
26452 | class SwiperClass {
|
26453 | constructor(params = {}) {
|
26454 | const self = this;
|
26455 | self.params = params;
|
26456 |
|
26457 |
|
26458 | self.eventsListeners = {};
|
26459 |
|
26460 | if (self.params && self.params.on) {
|
26461 | Object.keys(self.params.on).forEach((eventName) => {
|
26462 | self.on(eventName, self.params.on[eventName]);
|
26463 | });
|
26464 | }
|
26465 | }
|
26466 |
|
26467 | on(events, handler, priority) {
|
26468 | const self = this;
|
26469 | if (typeof handler !== 'function') return self;
|
26470 | const method = priority ? 'unshift' : 'push';
|
26471 | events.split(' ').forEach((event) => {
|
26472 | if (!self.eventsListeners[event]) self.eventsListeners[event] = [];
|
26473 | self.eventsListeners[event][method](handler);
|
26474 | });
|
26475 | return self;
|
26476 | }
|
26477 |
|
26478 | once(events, handler, priority) {
|
26479 | const self = this;
|
26480 | if (typeof handler !== 'function') return self;
|
26481 | function onceHandler(...args) {
|
26482 | self.off(events, onceHandler);
|
26483 | if (onceHandler.f7proxy) {
|
26484 | delete onceHandler.f7proxy;
|
26485 | }
|
26486 | handler.apply(self, args);
|
26487 | }
|
26488 | onceHandler.f7proxy = handler;
|
26489 | return self.on(events, onceHandler, priority);
|
26490 | }
|
26491 |
|
26492 | off(events, handler) {
|
26493 | const self = this;
|
26494 | if (!self.eventsListeners) return self;
|
26495 | events.split(' ').forEach((event) => {
|
26496 | if (typeof handler === 'undefined') {
|
26497 | self.eventsListeners[event] = [];
|
26498 | } else if (self.eventsListeners[event] && self.eventsListeners[event].length) {
|
26499 | self.eventsListeners[event].forEach((eventHandler, index) => {
|
26500 | if (eventHandler === handler || (eventHandler.f7proxy && eventHandler.f7proxy === handler)) {
|
26501 | self.eventsListeners[event].splice(index, 1);
|
26502 | }
|
26503 | });
|
26504 | }
|
26505 | });
|
26506 | return self;
|
26507 | }
|
26508 |
|
26509 | emit(...args) {
|
26510 | const self = this;
|
26511 | if (!self.eventsListeners) return self;
|
26512 | let events;
|
26513 | let data;
|
26514 | let context;
|
26515 | if (typeof args[0] === 'string' || Array.isArray(args[0])) {
|
26516 | events = args[0];
|
26517 | data = args.slice(1, args.length);
|
26518 | context = self;
|
26519 | } else {
|
26520 | events = args[0].events;
|
26521 | data = args[0].data;
|
26522 | context = args[0].context || self;
|
26523 | }
|
26524 | const eventsArray = Array.isArray(events) ? events : events.split(' ');
|
26525 | eventsArray.forEach((event) => {
|
26526 | if (self.eventsListeners && self.eventsListeners[event]) {
|
26527 | const handlers = [];
|
26528 | self.eventsListeners[event].forEach((eventHandler) => {
|
26529 | handlers.push(eventHandler);
|
26530 | });
|
26531 | handlers.forEach((eventHandler) => {
|
26532 | eventHandler.apply(context, data);
|
26533 | });
|
26534 | }
|
26535 | });
|
26536 | return self;
|
26537 | }
|
26538 |
|
26539 | useModulesParams(instanceParams) {
|
26540 | const instance = this;
|
26541 | if (!instance.modules) return;
|
26542 | Object.keys(instance.modules).forEach((moduleName) => {
|
26543 | const module = instance.modules[moduleName];
|
26544 |
|
26545 | if (module.params) {
|
26546 | Utils.extend(instanceParams, module.params);
|
26547 | }
|
26548 | });
|
26549 | }
|
26550 |
|
26551 | useModules(modulesParams = {}) {
|
26552 | const instance = this;
|
26553 | if (!instance.modules) return;
|
26554 | Object.keys(instance.modules).forEach((moduleName) => {
|
26555 | const module = instance.modules[moduleName];
|
26556 | const moduleParams = modulesParams[moduleName] || {};
|
26557 |
|
26558 | if (module.instance) {
|
26559 | Object.keys(module.instance).forEach((modulePropName) => {
|
26560 | const moduleProp = module.instance[modulePropName];
|
26561 | if (typeof moduleProp === 'function') {
|
26562 | instance[modulePropName] = moduleProp.bind(instance);
|
26563 | } else {
|
26564 | instance[modulePropName] = moduleProp;
|
26565 | }
|
26566 | });
|
26567 | }
|
26568 |
|
26569 | if (module.on && instance.on) {
|
26570 | Object.keys(module.on).forEach((moduleEventName) => {
|
26571 | instance.on(moduleEventName, module.on[moduleEventName]);
|
26572 | });
|
26573 | }
|
26574 |
|
26575 |
|
26576 | if (module.create) {
|
26577 | module.create.bind(instance)(moduleParams);
|
26578 | }
|
26579 | });
|
26580 | }
|
26581 |
|
26582 | static set components(components) {
|
26583 | const Class = this;
|
26584 | if (!Class.use) return;
|
26585 | Class.use(components);
|
26586 | }
|
26587 |
|
26588 | static installModule(module, ...params) {
|
26589 | const Class = this;
|
26590 | if (!Class.prototype.modules) Class.prototype.modules = {};
|
26591 | const name = module.name || (`${Object.keys(Class.prototype.modules).length}_${Utils.now()}`);
|
26592 | Class.prototype.modules[name] = module;
|
26593 |
|
26594 | if (module.proto) {
|
26595 | Object.keys(module.proto).forEach((key) => {
|
26596 | Class.prototype[key] = module.proto[key];
|
26597 | });
|
26598 | }
|
26599 |
|
26600 | if (module.static) {
|
26601 | Object.keys(module.static).forEach((key) => {
|
26602 | Class[key] = module.static[key];
|
26603 | });
|
26604 | }
|
26605 |
|
26606 | if (module.install) {
|
26607 | module.install.apply(Class, params);
|
26608 | }
|
26609 | return Class;
|
26610 | }
|
26611 |
|
26612 | static use(module, ...params) {
|
26613 | const Class = this;
|
26614 | if (Array.isArray(module)) {
|
26615 | module.forEach((m) => Class.installModule(m));
|
26616 | return Class;
|
26617 | }
|
26618 | return Class.installModule(module, ...params);
|
26619 | }
|
26620 | }
|
26621 |
|
26622 | function updateSize () {
|
26623 | const swiper = this;
|
26624 | let width;
|
26625 | let height;
|
26626 | const $el = swiper.$el;
|
26627 | if (typeof swiper.params.width !== 'undefined') {
|
26628 | width = swiper.params.width;
|
26629 | } else {
|
26630 | width = $el[0].clientWidth;
|
26631 | }
|
26632 | if (typeof swiper.params.height !== 'undefined') {
|
26633 | height = swiper.params.height;
|
26634 | } else {
|
26635 | height = $el[0].clientHeight;
|
26636 | }
|
26637 | if ((width === 0 && swiper.isHorizontal()) || (height === 0 && swiper.isVertical())) {
|
26638 | return;
|
26639 | }
|
26640 |
|
26641 |
|
26642 | width = width - parseInt($el.css('padding-left'), 10) - parseInt($el.css('padding-right'), 10);
|
26643 | height = height - parseInt($el.css('padding-top'), 10) - parseInt($el.css('padding-bottom'), 10);
|
26644 |
|
26645 | Utils.extend(swiper, {
|
26646 | width,
|
26647 | height,
|
26648 | size: swiper.isHorizontal() ? width : height,
|
26649 | });
|
26650 | }
|
26651 |
|
26652 | function updateSlides () {
|
26653 | const swiper = this;
|
26654 | const params = swiper.params;
|
26655 |
|
26656 | const {
|
26657 | $wrapperEl, size: swiperSize, rtlTranslate: rtl, wrongRTL,
|
26658 | } = swiper;
|
26659 | const isVirtual = swiper.virtual && params.virtual.enabled;
|
26660 | const previousSlidesLength = isVirtual ? swiper.virtual.slides.length : swiper.slides.length;
|
26661 | const slides = $wrapperEl.children(`.${swiper.params.slideClass}`);
|
26662 | const slidesLength = isVirtual ? swiper.virtual.slides.length : slides.length;
|
26663 | let snapGrid = [];
|
26664 | const slidesGrid = [];
|
26665 | const slidesSizesGrid = [];
|
26666 |
|
26667 | function slidesForMargin(slideIndex) {
|
26668 | if (!params.cssMode) return true;
|
26669 | if (slideIndex === slides.length - 1) {
|
26670 | return false;
|
26671 | }
|
26672 | return true;
|
26673 | }
|
26674 |
|
26675 | let offsetBefore = params.slidesOffsetBefore;
|
26676 | if (typeof offsetBefore === 'function') {
|
26677 | offsetBefore = params.slidesOffsetBefore.call(swiper);
|
26678 | }
|
26679 |
|
26680 | let offsetAfter = params.slidesOffsetAfter;
|
26681 | if (typeof offsetAfter === 'function') {
|
26682 | offsetAfter = params.slidesOffsetAfter.call(swiper);
|
26683 | }
|
26684 |
|
26685 | const previousSnapGridLength = swiper.snapGrid.length;
|
26686 | const previousSlidesGridLength = swiper.snapGrid.length;
|
26687 |
|
26688 | let spaceBetween = params.spaceBetween;
|
26689 | let slidePosition = -offsetBefore;
|
26690 | let prevSlideSize = 0;
|
26691 | let index = 0;
|
26692 | if (typeof swiperSize === 'undefined') {
|
26693 | return;
|
26694 | }
|
26695 | if (typeof spaceBetween === 'string' && spaceBetween.indexOf('%') >= 0) {
|
26696 | spaceBetween = (parseFloat(spaceBetween.replace('%', '')) / 100) * swiperSize;
|
26697 | }
|
26698 |
|
26699 | swiper.virtualSize = -spaceBetween;
|
26700 |
|
26701 |
|
26702 | if (rtl) slides.css({ marginLeft: '', marginTop: '' });
|
26703 | else slides.css({ marginRight: '', marginBottom: '' });
|
26704 |
|
26705 | let slidesNumberEvenToRows;
|
26706 | if (params.slidesPerColumn > 1) {
|
26707 | if (Math.floor(slidesLength / params.slidesPerColumn) === slidesLength / swiper.params.slidesPerColumn) {
|
26708 | slidesNumberEvenToRows = slidesLength;
|
26709 | } else {
|
26710 | slidesNumberEvenToRows = Math.ceil(slidesLength / params.slidesPerColumn) * params.slidesPerColumn;
|
26711 | }
|
26712 | if (params.slidesPerView !== 'auto' && params.slidesPerColumnFill === 'row') {
|
26713 | slidesNumberEvenToRows = Math.max(slidesNumberEvenToRows, params.slidesPerView * params.slidesPerColumn);
|
26714 | }
|
26715 | }
|
26716 |
|
26717 |
|
26718 | let slideSize;
|
26719 | const slidesPerColumn = params.slidesPerColumn;
|
26720 | const slidesPerRow = slidesNumberEvenToRows / slidesPerColumn;
|
26721 | const numFullColumns = Math.floor(slidesLength / params.slidesPerColumn);
|
26722 | for (let i = 0; i < slidesLength; i += 1) {
|
26723 | slideSize = 0;
|
26724 | const slide = slides.eq(i);
|
26725 | if (params.slidesPerColumn > 1) {
|
26726 |
|
26727 | let newSlideOrderIndex;
|
26728 | let column;
|
26729 | let row;
|
26730 | if (params.slidesPerColumnFill === 'row' && params.slidesPerGroup > 1) {
|
26731 | const groupIndex = Math.floor(i / (params.slidesPerGroup * params.slidesPerColumn));
|
26732 | const slideIndexInGroup = i - params.slidesPerColumn * params.slidesPerGroup * groupIndex;
|
26733 | const columnsInGroup = groupIndex === 0
|
26734 | ? params.slidesPerGroup
|
26735 | : Math.min(Math.ceil((slidesLength - groupIndex * slidesPerColumn * params.slidesPerGroup) / slidesPerColumn), params.slidesPerGroup);
|
26736 | row = Math.floor(slideIndexInGroup / columnsInGroup);
|
26737 | column = (slideIndexInGroup - row * columnsInGroup) + groupIndex * params.slidesPerGroup;
|
26738 |
|
26739 | newSlideOrderIndex = column + ((row * slidesNumberEvenToRows) / slidesPerColumn);
|
26740 | slide
|
26741 | .css({
|
26742 | '-webkit-box-ordinal-group': newSlideOrderIndex,
|
26743 | '-moz-box-ordinal-group': newSlideOrderIndex,
|
26744 | '-ms-flex-order': newSlideOrderIndex,
|
26745 | '-webkit-order': newSlideOrderIndex,
|
26746 | order: newSlideOrderIndex,
|
26747 | });
|
26748 | } else if (params.slidesPerColumnFill === 'column') {
|
26749 | column = Math.floor(i / slidesPerColumn);
|
26750 | row = i - (column * slidesPerColumn);
|
26751 | if (column > numFullColumns || (column === numFullColumns && row === slidesPerColumn - 1)) {
|
26752 | row += 1;
|
26753 | if (row >= slidesPerColumn) {
|
26754 | row = 0;
|
26755 | column += 1;
|
26756 | }
|
26757 | }
|
26758 | } else {
|
26759 | row = Math.floor(i / slidesPerRow);
|
26760 | column = i - (row * slidesPerRow);
|
26761 | }
|
26762 | slide.css(
|
26763 | `margin-${swiper.isHorizontal() ? 'top' : 'left'}`,
|
26764 | (row !== 0 && params.spaceBetween) && (`${params.spaceBetween}px`)
|
26765 | );
|
26766 | }
|
26767 | if (slide.css('display') === 'none') continue;
|
26768 |
|
26769 | if (params.slidesPerView === 'auto') {
|
26770 | const slideStyles = win.getComputedStyle(slide[0], null);
|
26771 | const currentTransform = slide[0].style.transform;
|
26772 | const currentWebKitTransform = slide[0].style.webkitTransform;
|
26773 | if (currentTransform) {
|
26774 | slide[0].style.transform = 'none';
|
26775 | }
|
26776 | if (currentWebKitTransform) {
|
26777 | slide[0].style.webkitTransform = 'none';
|
26778 | }
|
26779 | if (params.roundLengths) {
|
26780 | slideSize = swiper.isHorizontal()
|
26781 | ? slide.outerWidth(true)
|
26782 | : slide.outerHeight(true);
|
26783 | } else {
|
26784 |
|
26785 | if (swiper.isHorizontal()) {
|
26786 | const width = parseFloat(slideStyles.getPropertyValue('width'));
|
26787 | const paddingLeft = parseFloat(slideStyles.getPropertyValue('padding-left'));
|
26788 | const paddingRight = parseFloat(slideStyles.getPropertyValue('padding-right'));
|
26789 | const marginLeft = parseFloat(slideStyles.getPropertyValue('margin-left'));
|
26790 | const marginRight = parseFloat(slideStyles.getPropertyValue('margin-right'));
|
26791 | const boxSizing = slideStyles.getPropertyValue('box-sizing');
|
26792 | if (boxSizing && boxSizing === 'border-box') {
|
26793 | slideSize = width + marginLeft + marginRight;
|
26794 | } else {
|
26795 | slideSize = width + paddingLeft + paddingRight + marginLeft + marginRight;
|
26796 | }
|
26797 | } else {
|
26798 | const height = parseFloat(slideStyles.getPropertyValue('height'));
|
26799 | const paddingTop = parseFloat(slideStyles.getPropertyValue('padding-top'));
|
26800 | const paddingBottom = parseFloat(slideStyles.getPropertyValue('padding-bottom'));
|
26801 | const marginTop = parseFloat(slideStyles.getPropertyValue('margin-top'));
|
26802 | const marginBottom = parseFloat(slideStyles.getPropertyValue('margin-bottom'));
|
26803 | const boxSizing = slideStyles.getPropertyValue('box-sizing');
|
26804 | if (boxSizing && boxSizing === 'border-box') {
|
26805 | slideSize = height + marginTop + marginBottom;
|
26806 | } else {
|
26807 | slideSize = height + paddingTop + paddingBottom + marginTop + marginBottom;
|
26808 | }
|
26809 | }
|
26810 | }
|
26811 | if (currentTransform) {
|
26812 | slide[0].style.transform = currentTransform;
|
26813 | }
|
26814 | if (currentWebKitTransform) {
|
26815 | slide[0].style.webkitTransform = currentWebKitTransform;
|
26816 | }
|
26817 | if (params.roundLengths) slideSize = Math.floor(slideSize);
|
26818 | } else {
|
26819 | slideSize = (swiperSize - ((params.slidesPerView - 1) * spaceBetween)) / params.slidesPerView;
|
26820 | if (params.roundLengths) slideSize = Math.floor(slideSize);
|
26821 |
|
26822 | if (slides[i]) {
|
26823 | if (swiper.isHorizontal()) {
|
26824 | slides[i].style.width = `${slideSize}px`;
|
26825 | } else {
|
26826 | slides[i].style.height = `${slideSize}px`;
|
26827 | }
|
26828 | }
|
26829 | }
|
26830 | if (slides[i]) {
|
26831 | slides[i].swiperSlideSize = slideSize;
|
26832 | }
|
26833 | slidesSizesGrid.push(slideSize);
|
26834 |
|
26835 |
|
26836 | if (params.centeredSlides) {
|
26837 | slidePosition = slidePosition + (slideSize / 2) + (prevSlideSize / 2) + spaceBetween;
|
26838 | if (prevSlideSize === 0 && i !== 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;
|
26839 | if (i === 0) slidePosition = slidePosition - (swiperSize / 2) - spaceBetween;
|
26840 | if (Math.abs(slidePosition) < 1 / 1000) slidePosition = 0;
|
26841 | if (params.roundLengths) slidePosition = Math.floor(slidePosition);
|
26842 | if ((index) % params.slidesPerGroup === 0) snapGrid.push(slidePosition);
|
26843 | slidesGrid.push(slidePosition);
|
26844 | } else {
|
26845 | if (params.roundLengths) slidePosition = Math.floor(slidePosition);
|
26846 | if ((index - Math.min(swiper.params.slidesPerGroupSkip, index)) % swiper.params.slidesPerGroup === 0) snapGrid.push(slidePosition);
|
26847 | slidesGrid.push(slidePosition);
|
26848 | slidePosition = slidePosition + slideSize + spaceBetween;
|
26849 | }
|
26850 |
|
26851 | swiper.virtualSize += slideSize + spaceBetween;
|
26852 |
|
26853 | prevSlideSize = slideSize;
|
26854 |
|
26855 | index += 1;
|
26856 | }
|
26857 | swiper.virtualSize = Math.max(swiper.virtualSize, swiperSize) + offsetAfter;
|
26858 | let newSlidesGrid;
|
26859 |
|
26860 | if (
|
26861 | rtl && wrongRTL && (params.effect === 'slide' || params.effect === 'coverflow')) {
|
26862 | $wrapperEl.css({ width: `${swiper.virtualSize + params.spaceBetween}px` });
|
26863 | }
|
26864 | if (params.setWrapperSize) {
|
26865 | if (swiper.isHorizontal()) $wrapperEl.css({ width: `${swiper.virtualSize + params.spaceBetween}px` });
|
26866 | else $wrapperEl.css({ height: `${swiper.virtualSize + params.spaceBetween}px` });
|
26867 | }
|
26868 |
|
26869 | if (params.slidesPerColumn > 1) {
|
26870 | swiper.virtualSize = (slideSize + params.spaceBetween) * slidesNumberEvenToRows;
|
26871 | swiper.virtualSize = Math.ceil(swiper.virtualSize / params.slidesPerColumn) - params.spaceBetween;
|
26872 | if (swiper.isHorizontal()) $wrapperEl.css({ width: `${swiper.virtualSize + params.spaceBetween}px` });
|
26873 | else $wrapperEl.css({ height: `${swiper.virtualSize + params.spaceBetween}px` });
|
26874 | if (params.centeredSlides) {
|
26875 | newSlidesGrid = [];
|
26876 | for (let i = 0; i < snapGrid.length; i += 1) {
|
26877 | let slidesGridItem = snapGrid[i];
|
26878 | if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
26879 | if (snapGrid[i] < swiper.virtualSize + snapGrid[0]) newSlidesGrid.push(slidesGridItem);
|
26880 | }
|
26881 | snapGrid = newSlidesGrid;
|
26882 | }
|
26883 | }
|
26884 |
|
26885 |
|
26886 | if (!params.centeredSlides) {
|
26887 | newSlidesGrid = [];
|
26888 | for (let i = 0; i < snapGrid.length; i += 1) {
|
26889 | let slidesGridItem = snapGrid[i];
|
26890 | if (params.roundLengths) slidesGridItem = Math.floor(slidesGridItem);
|
26891 | if (snapGrid[i] <= swiper.virtualSize - swiperSize) {
|
26892 | newSlidesGrid.push(slidesGridItem);
|
26893 | }
|
26894 | }
|
26895 | snapGrid = newSlidesGrid;
|
26896 | if (Math.floor(swiper.virtualSize - swiperSize) - Math.floor(snapGrid[snapGrid.length - 1]) > 1) {
|
26897 | snapGrid.push(swiper.virtualSize - swiperSize);
|
26898 | }
|
26899 | }
|
26900 | if (snapGrid.length === 0) snapGrid = [0];
|
26901 |
|
26902 | if (params.spaceBetween !== 0) {
|
26903 | if (swiper.isHorizontal()) {
|
26904 | if (rtl) slides.filter(slidesForMargin).css({ marginLeft: `${spaceBetween}px` });
|
26905 | else slides.filter(slidesForMargin).css({ marginRight: `${spaceBetween}px` });
|
26906 | } else slides.filter(slidesForMargin).css({ marginBottom: `${spaceBetween}px` });
|
26907 | }
|
26908 |
|
26909 | if (params.centeredSlides && params.centeredSlidesBounds) {
|
26910 | let allSlidesSize = 0;
|
26911 | slidesSizesGrid.forEach((slideSizeValue) => {
|
26912 | allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
|
26913 | });
|
26914 | allSlidesSize -= params.spaceBetween;
|
26915 | const maxSnap = allSlidesSize - swiperSize;
|
26916 | snapGrid = snapGrid.map((snap) => {
|
26917 | if (snap < 0) return -offsetBefore;
|
26918 | if (snap > maxSnap) return maxSnap + offsetAfter;
|
26919 | return snap;
|
26920 | });
|
26921 | }
|
26922 |
|
26923 | if (params.centerInsufficientSlides) {
|
26924 | let allSlidesSize = 0;
|
26925 | slidesSizesGrid.forEach((slideSizeValue) => {
|
26926 | allSlidesSize += slideSizeValue + (params.spaceBetween ? params.spaceBetween : 0);
|
26927 | });
|
26928 | allSlidesSize -= params.spaceBetween;
|
26929 | if (allSlidesSize < swiperSize) {
|
26930 | const allSlidesOffset = (swiperSize - allSlidesSize) / 2;
|
26931 | snapGrid.forEach((snap, snapIndex) => {
|
26932 | snapGrid[snapIndex] = snap - allSlidesOffset;
|
26933 | });
|
26934 | slidesGrid.forEach((snap, snapIndex) => {
|
26935 | slidesGrid[snapIndex] = snap + allSlidesOffset;
|
26936 | });
|
26937 | }
|
26938 | }
|
26939 |
|
26940 | Utils.extend(swiper, {
|
26941 | slides,
|
26942 | snapGrid,
|
26943 | slidesGrid,
|
26944 | slidesSizesGrid,
|
26945 | });
|
26946 |
|
26947 | if (slidesLength !== previousSlidesLength) {
|
26948 | swiper.emit('slidesLengthChange');
|
26949 | }
|
26950 | if (snapGrid.length !== previousSnapGridLength) {
|
26951 | if (swiper.params.watchOverflow) swiper.checkOverflow();
|
26952 | swiper.emit('snapGridLengthChange');
|
26953 | }
|
26954 | if (slidesGrid.length !== previousSlidesGridLength) {
|
26955 | swiper.emit('slidesGridLengthChange');
|
26956 | }
|
26957 |
|
26958 | if (params.watchSlidesProgress || params.watchSlidesVisibility) {
|
26959 | swiper.updateSlidesOffset();
|
26960 | }
|
26961 | }
|
26962 |
|
26963 | function updateAutoHeight (speed) {
|
26964 | const swiper = this;
|
26965 | const activeSlides = [];
|
26966 | let newHeight = 0;
|
26967 | let i;
|
26968 | if (typeof speed === 'number') {
|
26969 | swiper.setTransition(speed);
|
26970 | } else if (speed === true) {
|
26971 | swiper.setTransition(swiper.params.speed);
|
26972 | }
|
26973 |
|
26974 | if (swiper.params.slidesPerView !== 'auto' && swiper.params.slidesPerView > 1) {
|
26975 | if (swiper.params.centeredSlides) {
|
26976 | swiper.visibleSlides.each((index, slide) => {
|
26977 | activeSlides.push(slide);
|
26978 | });
|
26979 | } else {
|
26980 | for (i = 0; i < Math.ceil(swiper.params.slidesPerView); i += 1) {
|
26981 | const index = swiper.activeIndex + i;
|
26982 | if (index > swiper.slides.length) break;
|
26983 | activeSlides.push(swiper.slides.eq(index)[0]);
|
26984 | }
|
26985 | }
|
26986 | } else {
|
26987 | activeSlides.push(swiper.slides.eq(swiper.activeIndex)[0]);
|
26988 | }
|
26989 |
|
26990 |
|
26991 | for (i = 0; i < activeSlides.length; i += 1) {
|
26992 | if (typeof activeSlides[i] !== 'undefined') {
|
26993 | const height = activeSlides[i].offsetHeight;
|
26994 | newHeight = height > newHeight ? height : newHeight;
|
26995 | }
|
26996 | }
|
26997 |
|
26998 |
|
26999 | if (newHeight) swiper.$wrapperEl.css('height', `${newHeight}px`);
|
27000 | }
|
27001 |
|
27002 | function updateSlidesOffset () {
|
27003 | const swiper = this;
|
27004 | const slides = swiper.slides;
|
27005 | for (let i = 0; i < slides.length; i += 1) {
|
27006 | slides[i].swiperSlideOffset = swiper.isHorizontal() ? slides[i].offsetLeft : slides[i].offsetTop;
|
27007 | }
|
27008 | }
|
27009 |
|
27010 | function updateSlidesProgress (translate = (this && this.translate) || 0) {
|
27011 | const swiper = this;
|
27012 | const params = swiper.params;
|
27013 |
|
27014 | const { slides, rtlTranslate: rtl } = swiper;
|
27015 |
|
27016 | if (slides.length === 0) return;
|
27017 | if (typeof slides[0].swiperSlideOffset === 'undefined') swiper.updateSlidesOffset();
|
27018 |
|
27019 | let offsetCenter = -translate;
|
27020 | if (rtl) offsetCenter = translate;
|
27021 |
|
27022 |
|
27023 | slides.removeClass(params.slideVisibleClass);
|
27024 |
|
27025 | swiper.visibleSlidesIndexes = [];
|
27026 | swiper.visibleSlides = [];
|
27027 |
|
27028 | for (let i = 0; i < slides.length; i += 1) {
|
27029 | const slide = slides[i];
|
27030 | const slideProgress = (
|
27031 | (offsetCenter + (params.centeredSlides ? swiper.minTranslate() : 0)) - slide.swiperSlideOffset
|
27032 | ) / (slide.swiperSlideSize + params.spaceBetween);
|
27033 | if (params.watchSlidesVisibility || (params.centeredSlides && params.autoHeight)) {
|
27034 | const slideBefore = -(offsetCenter - slide.swiperSlideOffset);
|
27035 | const slideAfter = slideBefore + swiper.slidesSizesGrid[i];
|
27036 | const isVisible = (slideBefore >= 0 && slideBefore < swiper.size - 1)
|
27037 | || (slideAfter > 1 && slideAfter <= swiper.size)
|
27038 | || (slideBefore <= 0 && slideAfter >= swiper.size);
|
27039 | if (isVisible) {
|
27040 | swiper.visibleSlides.push(slide);
|
27041 | swiper.visibleSlidesIndexes.push(i);
|
27042 | slides.eq(i).addClass(params.slideVisibleClass);
|
27043 | }
|
27044 | }
|
27045 | slide.progress = rtl ? -slideProgress : slideProgress;
|
27046 | }
|
27047 | swiper.visibleSlides = $(swiper.visibleSlides);
|
27048 | }
|
27049 |
|
27050 | function updateProgress (translate) {
|
27051 | const swiper = this;
|
27052 | if (typeof translate === 'undefined') {
|
27053 | const multiplier = swiper.rtlTranslate ? -1 : 1;
|
27054 |
|
27055 | translate = (swiper && swiper.translate && (swiper.translate * multiplier)) || 0;
|
27056 | }
|
27057 | const params = swiper.params;
|
27058 | const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
27059 | let { progress, isBeginning, isEnd } = swiper;
|
27060 | const wasBeginning = isBeginning;
|
27061 | const wasEnd = isEnd;
|
27062 | if (translatesDiff === 0) {
|
27063 | progress = 0;
|
27064 | isBeginning = true;
|
27065 | isEnd = true;
|
27066 | } else {
|
27067 | progress = (translate - swiper.minTranslate()) / (translatesDiff);
|
27068 | isBeginning = progress <= 0;
|
27069 | isEnd = progress >= 1;
|
27070 | }
|
27071 | Utils.extend(swiper, {
|
27072 | progress,
|
27073 | isBeginning,
|
27074 | isEnd,
|
27075 | });
|
27076 |
|
27077 | if (params.watchSlidesProgress || params.watchSlidesVisibility || (params.centeredSlides && params.autoHeight)) swiper.updateSlidesProgress(translate);
|
27078 |
|
27079 | if (isBeginning && !wasBeginning) {
|
27080 | swiper.emit('reachBeginning toEdge');
|
27081 | }
|
27082 | if (isEnd && !wasEnd) {
|
27083 | swiper.emit('reachEnd toEdge');
|
27084 | }
|
27085 | if ((wasBeginning && !isBeginning) || (wasEnd && !isEnd)) {
|
27086 | swiper.emit('fromEdge');
|
27087 | }
|
27088 |
|
27089 | swiper.emit('progress', progress);
|
27090 | }
|
27091 |
|
27092 | function updateSlidesClasses () {
|
27093 | const swiper = this;
|
27094 |
|
27095 | const {
|
27096 | slides, params, $wrapperEl, activeIndex, realIndex,
|
27097 | } = swiper;
|
27098 | const isVirtual = swiper.virtual && params.virtual.enabled;
|
27099 |
|
27100 | slides.removeClass(`${params.slideActiveClass} ${params.slideNextClass} ${params.slidePrevClass} ${params.slideDuplicateActiveClass} ${params.slideDuplicateNextClass} ${params.slideDuplicatePrevClass}`);
|
27101 |
|
27102 | let activeSlide;
|
27103 | if (isVirtual) {
|
27104 | activeSlide = swiper.$wrapperEl.find(`.${params.slideClass}[data-swiper-slide-index="${activeIndex}"]`);
|
27105 | } else {
|
27106 | activeSlide = slides.eq(activeIndex);
|
27107 | }
|
27108 |
|
27109 |
|
27110 | activeSlide.addClass(params.slideActiveClass);
|
27111 |
|
27112 | if (params.loop) {
|
27113 |
|
27114 | if (activeSlide.hasClass(params.slideDuplicateClass)) {
|
27115 | $wrapperEl
|
27116 | .children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${realIndex}"]`)
|
27117 | .addClass(params.slideDuplicateActiveClass);
|
27118 | } else {
|
27119 | $wrapperEl
|
27120 | .children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${realIndex}"]`)
|
27121 | .addClass(params.slideDuplicateActiveClass);
|
27122 | }
|
27123 | }
|
27124 |
|
27125 | let nextSlide = activeSlide.nextAll(`.${params.slideClass}`).eq(0).addClass(params.slideNextClass);
|
27126 | if (params.loop && nextSlide.length === 0) {
|
27127 | nextSlide = slides.eq(0);
|
27128 | nextSlide.addClass(params.slideNextClass);
|
27129 | }
|
27130 |
|
27131 | let prevSlide = activeSlide.prevAll(`.${params.slideClass}`).eq(0).addClass(params.slidePrevClass);
|
27132 | if (params.loop && prevSlide.length === 0) {
|
27133 | prevSlide = slides.eq(-1);
|
27134 | prevSlide.addClass(params.slidePrevClass);
|
27135 | }
|
27136 | if (params.loop) {
|
27137 |
|
27138 | if (nextSlide.hasClass(params.slideDuplicateClass)) {
|
27139 | $wrapperEl
|
27140 | .children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`)
|
27141 | .addClass(params.slideDuplicateNextClass);
|
27142 | } else {
|
27143 | $wrapperEl
|
27144 | .children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${nextSlide.attr('data-swiper-slide-index')}"]`)
|
27145 | .addClass(params.slideDuplicateNextClass);
|
27146 | }
|
27147 | if (prevSlide.hasClass(params.slideDuplicateClass)) {
|
27148 | $wrapperEl
|
27149 | .children(`.${params.slideClass}:not(.${params.slideDuplicateClass})[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`)
|
27150 | .addClass(params.slideDuplicatePrevClass);
|
27151 | } else {
|
27152 | $wrapperEl
|
27153 | .children(`.${params.slideClass}.${params.slideDuplicateClass}[data-swiper-slide-index="${prevSlide.attr('data-swiper-slide-index')}"]`)
|
27154 | .addClass(params.slideDuplicatePrevClass);
|
27155 | }
|
27156 | }
|
27157 | }
|
27158 |
|
27159 | function updateActiveIndex (newActiveIndex) {
|
27160 | const swiper = this;
|
27161 | const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
27162 | const {
|
27163 | slidesGrid, snapGrid, params, activeIndex: previousIndex, realIndex: previousRealIndex, snapIndex: previousSnapIndex,
|
27164 | } = swiper;
|
27165 | let activeIndex = newActiveIndex;
|
27166 | let snapIndex;
|
27167 | if (typeof activeIndex === 'undefined') {
|
27168 | for (let i = 0; i < slidesGrid.length; i += 1) {
|
27169 | if (typeof slidesGrid[i + 1] !== 'undefined') {
|
27170 | if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1] - ((slidesGrid[i + 1] - slidesGrid[i]) / 2)) {
|
27171 | activeIndex = i;
|
27172 | } else if (translate >= slidesGrid[i] && translate < slidesGrid[i + 1]) {
|
27173 | activeIndex = i + 1;
|
27174 | }
|
27175 | } else if (translate >= slidesGrid[i]) {
|
27176 | activeIndex = i;
|
27177 | }
|
27178 | }
|
27179 |
|
27180 | if (params.normalizeSlideIndex) {
|
27181 | if (activeIndex < 0 || typeof activeIndex === 'undefined') activeIndex = 0;
|
27182 | }
|
27183 | }
|
27184 | if (snapGrid.indexOf(translate) >= 0) {
|
27185 | snapIndex = snapGrid.indexOf(translate);
|
27186 | } else {
|
27187 | const skip = Math.min(params.slidesPerGroupSkip, activeIndex);
|
27188 | snapIndex = skip + Math.floor((activeIndex - skip) / params.slidesPerGroup);
|
27189 | }
|
27190 | if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
|
27191 | if (activeIndex === previousIndex) {
|
27192 | if (snapIndex !== previousSnapIndex) {
|
27193 | swiper.snapIndex = snapIndex;
|
27194 | swiper.emit('snapIndexChange');
|
27195 | }
|
27196 | return;
|
27197 | }
|
27198 |
|
27199 |
|
27200 | const realIndex = parseInt(swiper.slides.eq(activeIndex).attr('data-swiper-slide-index') || activeIndex, 10);
|
27201 |
|
27202 | Utils.extend(swiper, {
|
27203 | snapIndex,
|
27204 | realIndex,
|
27205 | previousIndex,
|
27206 | activeIndex,
|
27207 | });
|
27208 | swiper.emit('activeIndexChange');
|
27209 | swiper.emit('snapIndexChange');
|
27210 | if (previousRealIndex !== realIndex) {
|
27211 | swiper.emit('realIndexChange');
|
27212 | }
|
27213 | if (swiper.initialized || swiper.params.runCallbacksOnInit) {
|
27214 | swiper.emit('slideChange');
|
27215 | }
|
27216 | }
|
27217 |
|
27218 | function updateClickedSlide (e) {
|
27219 | const swiper = this;
|
27220 | const params = swiper.params;
|
27221 | const slide = $(e.target).closest(`.${params.slideClass}`)[0];
|
27222 | let slideFound = false;
|
27223 | if (slide) {
|
27224 | for (let i = 0; i < swiper.slides.length; i += 1) {
|
27225 | if (swiper.slides[i] === slide) slideFound = true;
|
27226 | }
|
27227 | }
|
27228 |
|
27229 | if (slide && slideFound) {
|
27230 | swiper.clickedSlide = slide;
|
27231 | if (swiper.virtual && swiper.params.virtual.enabled) {
|
27232 | swiper.clickedIndex = parseInt($(slide).attr('data-swiper-slide-index'), 10);
|
27233 | } else {
|
27234 | swiper.clickedIndex = $(slide).index();
|
27235 | }
|
27236 | } else {
|
27237 | swiper.clickedSlide = undefined;
|
27238 | swiper.clickedIndex = undefined;
|
27239 | return;
|
27240 | }
|
27241 | if (params.slideToClickedSlide && swiper.clickedIndex !== undefined && swiper.clickedIndex !== swiper.activeIndex) {
|
27242 | swiper.slideToClickedSlide();
|
27243 | }
|
27244 | }
|
27245 |
|
27246 | var update = {
|
27247 | updateSize,
|
27248 | updateSlides,
|
27249 | updateAutoHeight,
|
27250 | updateSlidesOffset,
|
27251 | updateSlidesProgress,
|
27252 | updateProgress,
|
27253 | updateSlidesClasses,
|
27254 | updateActiveIndex,
|
27255 | updateClickedSlide,
|
27256 | };
|
27257 |
|
27258 | function getTranslate (axis = this.isHorizontal() ? 'x' : 'y') {
|
27259 | const swiper = this;
|
27260 |
|
27261 | const {
|
27262 | params, rtlTranslate: rtl, translate, $wrapperEl,
|
27263 | } = swiper;
|
27264 |
|
27265 | if (params.virtualTranslate) {
|
27266 | return rtl ? -translate : translate;
|
27267 | }
|
27268 | if (params.cssMode) {
|
27269 | return translate;
|
27270 | }
|
27271 |
|
27272 | let currentTranslate = Utils.getTranslate($wrapperEl[0], axis);
|
27273 | if (rtl) currentTranslate = -currentTranslate;
|
27274 |
|
27275 | return currentTranslate || 0;
|
27276 | }
|
27277 |
|
27278 | function setTranslate (translate, byController) {
|
27279 | const swiper = this;
|
27280 | const {
|
27281 | rtlTranslate: rtl, params, $wrapperEl, wrapperEl, progress,
|
27282 | } = swiper;
|
27283 | let x = 0;
|
27284 | let y = 0;
|
27285 | const z = 0;
|
27286 |
|
27287 | if (swiper.isHorizontal()) {
|
27288 | x = rtl ? -translate : translate;
|
27289 | } else {
|
27290 | y = translate;
|
27291 | }
|
27292 |
|
27293 | if (params.roundLengths) {
|
27294 | x = Math.floor(x);
|
27295 | y = Math.floor(y);
|
27296 | }
|
27297 |
|
27298 | if (params.cssMode) {
|
27299 | wrapperEl[swiper.isHorizontal() ? 'scrollLeft' : 'scrollTop'] = swiper.isHorizontal() ? -x : -y;
|
27300 | } else if (!params.virtualTranslate) {
|
27301 | $wrapperEl.transform(`translate3d(${x}px, ${y}px, ${z}px)`);
|
27302 | }
|
27303 | swiper.previousTranslate = swiper.translate;
|
27304 | swiper.translate = swiper.isHorizontal() ? x : y;
|
27305 |
|
27306 |
|
27307 | let newProgress;
|
27308 | const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
27309 | if (translatesDiff === 0) {
|
27310 | newProgress = 0;
|
27311 | } else {
|
27312 | newProgress = (translate - swiper.minTranslate()) / (translatesDiff);
|
27313 | }
|
27314 | if (newProgress !== progress) {
|
27315 | swiper.updateProgress(translate);
|
27316 | }
|
27317 |
|
27318 | swiper.emit('setTranslate', swiper.translate, byController);
|
27319 | }
|
27320 |
|
27321 | function minTranslate () {
|
27322 | return (-this.snapGrid[0]);
|
27323 | }
|
27324 |
|
27325 | function maxTranslate () {
|
27326 | return (-this.snapGrid[this.snapGrid.length - 1]);
|
27327 | }
|
27328 |
|
27329 | function translateTo (translate = 0, speed = this.params.speed, runCallbacks = true, translateBounds = true, internal) {
|
27330 | const swiper = this;
|
27331 |
|
27332 | const {
|
27333 | params,
|
27334 | wrapperEl,
|
27335 | } = swiper;
|
27336 |
|
27337 | if (swiper.animating && params.preventInteractionOnTransition) {
|
27338 | return false;
|
27339 | }
|
27340 |
|
27341 | const minTranslate = swiper.minTranslate();
|
27342 | const maxTranslate = swiper.maxTranslate();
|
27343 | let newTranslate;
|
27344 | if (translateBounds && translate > minTranslate) newTranslate = minTranslate;
|
27345 | else if (translateBounds && translate < maxTranslate) newTranslate = maxTranslate;
|
27346 | else newTranslate = translate;
|
27347 |
|
27348 |
|
27349 | swiper.updateProgress(newTranslate);
|
27350 |
|
27351 | if (params.cssMode) {
|
27352 | const isH = swiper.isHorizontal();
|
27353 | if (speed === 0) {
|
27354 | wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
|
27355 | } else {
|
27356 |
|
27357 | if (wrapperEl.scrollTo) {
|
27358 | wrapperEl.scrollTo({
|
27359 | [isH ? 'left' : 'top']: -newTranslate,
|
27360 | behavior: 'smooth',
|
27361 | });
|
27362 | } else {
|
27363 | wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = -newTranslate;
|
27364 | }
|
27365 | }
|
27366 | return true;
|
27367 | }
|
27368 |
|
27369 | if (speed === 0) {
|
27370 | swiper.setTransition(0);
|
27371 | swiper.setTranslate(newTranslate);
|
27372 | if (runCallbacks) {
|
27373 | swiper.emit('beforeTransitionStart', speed, internal);
|
27374 | swiper.emit('transitionEnd');
|
27375 | }
|
27376 | } else {
|
27377 | swiper.setTransition(speed);
|
27378 | swiper.setTranslate(newTranslate);
|
27379 | if (runCallbacks) {
|
27380 | swiper.emit('beforeTransitionStart', speed, internal);
|
27381 | swiper.emit('transitionStart');
|
27382 | }
|
27383 | if (!swiper.animating) {
|
27384 | swiper.animating = true;
|
27385 | if (!swiper.onTranslateToWrapperTransitionEnd) {
|
27386 | swiper.onTranslateToWrapperTransitionEnd = function transitionEnd(e) {
|
27387 | if (!swiper || swiper.destroyed) return;
|
27388 | if (e.target !== this) return;
|
27389 | swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
27390 | swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
|
27391 | swiper.onTranslateToWrapperTransitionEnd = null;
|
27392 | delete swiper.onTranslateToWrapperTransitionEnd;
|
27393 | if (runCallbacks) {
|
27394 | swiper.emit('transitionEnd');
|
27395 | }
|
27396 | };
|
27397 | }
|
27398 | swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onTranslateToWrapperTransitionEnd);
|
27399 | swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onTranslateToWrapperTransitionEnd);
|
27400 | }
|
27401 | }
|
27402 |
|
27403 | return true;
|
27404 | }
|
27405 |
|
27406 | var translate = {
|
27407 | getTranslate,
|
27408 | setTranslate,
|
27409 | minTranslate,
|
27410 | maxTranslate,
|
27411 | translateTo,
|
27412 | };
|
27413 |
|
27414 | function setTransition (duration, byController) {
|
27415 | const swiper = this;
|
27416 |
|
27417 | if (!swiper.params.cssMode) {
|
27418 | swiper.$wrapperEl.transition(duration);
|
27419 | }
|
27420 |
|
27421 | swiper.emit('setTransition', duration, byController);
|
27422 | }
|
27423 |
|
27424 | function transitionStart (runCallbacks = true, direction) {
|
27425 | const swiper = this;
|
27426 | const { activeIndex, params, previousIndex } = swiper;
|
27427 | if (params.cssMode) return;
|
27428 | if (params.autoHeight) {
|
27429 | swiper.updateAutoHeight();
|
27430 | }
|
27431 |
|
27432 | let dir = direction;
|
27433 | if (!dir) {
|
27434 | if (activeIndex > previousIndex) dir = 'next';
|
27435 | else if (activeIndex < previousIndex) dir = 'prev';
|
27436 | else dir = 'reset';
|
27437 | }
|
27438 |
|
27439 | swiper.emit('transitionStart');
|
27440 |
|
27441 | if (runCallbacks && activeIndex !== previousIndex) {
|
27442 | if (dir === 'reset') {
|
27443 | swiper.emit('slideResetTransitionStart');
|
27444 | return;
|
27445 | }
|
27446 | swiper.emit('slideChangeTransitionStart');
|
27447 | if (dir === 'next') {
|
27448 | swiper.emit('slideNextTransitionStart');
|
27449 | } else {
|
27450 | swiper.emit('slidePrevTransitionStart');
|
27451 | }
|
27452 | }
|
27453 | }
|
27454 |
|
27455 | function transitionEnd$1 (runCallbacks = true, direction) {
|
27456 | const swiper = this;
|
27457 | const { activeIndex, previousIndex, params } = swiper;
|
27458 | swiper.animating = false;
|
27459 | if (params.cssMode) return;
|
27460 | swiper.setTransition(0);
|
27461 |
|
27462 | let dir = direction;
|
27463 | if (!dir) {
|
27464 | if (activeIndex > previousIndex) dir = 'next';
|
27465 | else if (activeIndex < previousIndex) dir = 'prev';
|
27466 | else dir = 'reset';
|
27467 | }
|
27468 |
|
27469 | swiper.emit('transitionEnd');
|
27470 |
|
27471 | if (runCallbacks && activeIndex !== previousIndex) {
|
27472 | if (dir === 'reset') {
|
27473 | swiper.emit('slideResetTransitionEnd');
|
27474 | return;
|
27475 | }
|
27476 | swiper.emit('slideChangeTransitionEnd');
|
27477 | if (dir === 'next') {
|
27478 | swiper.emit('slideNextTransitionEnd');
|
27479 | } else {
|
27480 | swiper.emit('slidePrevTransitionEnd');
|
27481 | }
|
27482 | }
|
27483 | }
|
27484 |
|
27485 | var transition$1 = {
|
27486 | setTransition,
|
27487 | transitionStart,
|
27488 | transitionEnd: transitionEnd$1,
|
27489 | };
|
27490 |
|
27491 | function slideTo (index = 0, speed = this.params.speed, runCallbacks = true, internal) {
|
27492 | const swiper = this;
|
27493 | let slideIndex = index;
|
27494 | if (slideIndex < 0) slideIndex = 0;
|
27495 |
|
27496 | const {
|
27497 | params, snapGrid, slidesGrid, previousIndex, activeIndex, rtlTranslate: rtl, wrapperEl,
|
27498 | } = swiper;
|
27499 | if (swiper.animating && params.preventInteractionOnTransition) {
|
27500 | return false;
|
27501 | }
|
27502 |
|
27503 | const skip = Math.min(swiper.params.slidesPerGroupSkip, slideIndex);
|
27504 | let snapIndex = skip + Math.floor((slideIndex - skip) / swiper.params.slidesPerGroup);
|
27505 | if (snapIndex >= snapGrid.length) snapIndex = snapGrid.length - 1;
|
27506 |
|
27507 | if ((activeIndex || params.initialSlide || 0) === (previousIndex || 0) && runCallbacks) {
|
27508 | swiper.emit('beforeSlideChangeStart');
|
27509 | }
|
27510 |
|
27511 | const translate = -snapGrid[snapIndex];
|
27512 |
|
27513 |
|
27514 | swiper.updateProgress(translate);
|
27515 |
|
27516 |
|
27517 | if (params.normalizeSlideIndex) {
|
27518 | for (let i = 0; i < slidesGrid.length; i += 1) {
|
27519 | if (-Math.floor(translate * 100) >= Math.floor(slidesGrid[i] * 100)) {
|
27520 | slideIndex = i;
|
27521 | }
|
27522 | }
|
27523 | }
|
27524 |
|
27525 | if (swiper.initialized && slideIndex !== activeIndex) {
|
27526 | if (!swiper.allowSlideNext && translate < swiper.translate && translate < swiper.minTranslate()) {
|
27527 | return false;
|
27528 | }
|
27529 | if (!swiper.allowSlidePrev && translate > swiper.translate && translate > swiper.maxTranslate()) {
|
27530 | if ((activeIndex || 0) !== slideIndex) return false;
|
27531 | }
|
27532 | }
|
27533 |
|
27534 | let direction;
|
27535 | if (slideIndex > activeIndex) direction = 'next';
|
27536 | else if (slideIndex < activeIndex) direction = 'prev';
|
27537 | else direction = 'reset';
|
27538 |
|
27539 |
|
27540 |
|
27541 | if ((rtl && -translate === swiper.translate) || (!rtl && translate === swiper.translate)) {
|
27542 | swiper.updateActiveIndex(slideIndex);
|
27543 |
|
27544 | if (params.autoHeight) {
|
27545 | swiper.updateAutoHeight();
|
27546 | }
|
27547 | swiper.updateSlidesClasses();
|
27548 | if (params.effect !== 'slide') {
|
27549 | swiper.setTranslate(translate);
|
27550 | }
|
27551 | if (direction !== 'reset') {
|
27552 | swiper.transitionStart(runCallbacks, direction);
|
27553 | swiper.transitionEnd(runCallbacks, direction);
|
27554 | }
|
27555 | return false;
|
27556 | }
|
27557 | if (params.cssMode) {
|
27558 | const isH = swiper.isHorizontal();
|
27559 | let t = -translate;
|
27560 | if (rtl) {
|
27561 | t = wrapperEl.scrollWidth - wrapperEl.offsetWidth - t;
|
27562 | }
|
27563 | if (speed === 0) {
|
27564 | wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
|
27565 | } else {
|
27566 |
|
27567 | if (wrapperEl.scrollTo) {
|
27568 | wrapperEl.scrollTo({
|
27569 | [isH ? 'left' : 'top']: t,
|
27570 | behavior: 'smooth',
|
27571 | });
|
27572 | } else {
|
27573 | wrapperEl[isH ? 'scrollLeft' : 'scrollTop'] = t;
|
27574 | }
|
27575 | }
|
27576 | return true;
|
27577 | }
|
27578 |
|
27579 | if (speed === 0) {
|
27580 | swiper.setTransition(0);
|
27581 | swiper.setTranslate(translate);
|
27582 | swiper.updateActiveIndex(slideIndex);
|
27583 | swiper.updateSlidesClasses();
|
27584 | swiper.emit('beforeTransitionStart', speed, internal);
|
27585 | swiper.transitionStart(runCallbacks, direction);
|
27586 | swiper.transitionEnd(runCallbacks, direction);
|
27587 | } else {
|
27588 | swiper.setTransition(speed);
|
27589 | swiper.setTranslate(translate);
|
27590 | swiper.updateActiveIndex(slideIndex);
|
27591 | swiper.updateSlidesClasses();
|
27592 | swiper.emit('beforeTransitionStart', speed, internal);
|
27593 | swiper.transitionStart(runCallbacks, direction);
|
27594 | if (!swiper.animating) {
|
27595 | swiper.animating = true;
|
27596 | if (!swiper.onSlideToWrapperTransitionEnd) {
|
27597 | swiper.onSlideToWrapperTransitionEnd = function transitionEnd(e) {
|
27598 | if (!swiper || swiper.destroyed) return;
|
27599 | if (e.target !== this) return;
|
27600 | swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
27601 | swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
|
27602 | swiper.onSlideToWrapperTransitionEnd = null;
|
27603 | delete swiper.onSlideToWrapperTransitionEnd;
|
27604 | swiper.transitionEnd(runCallbacks, direction);
|
27605 | };
|
27606 | }
|
27607 | swiper.$wrapperEl[0].addEventListener('transitionend', swiper.onSlideToWrapperTransitionEnd);
|
27608 | swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.onSlideToWrapperTransitionEnd);
|
27609 | }
|
27610 | }
|
27611 |
|
27612 | return true;
|
27613 | }
|
27614 |
|
27615 | function slideToLoop (index = 0, speed = this.params.speed, runCallbacks = true, internal) {
|
27616 | const swiper = this;
|
27617 | let newIndex = index;
|
27618 | if (swiper.params.loop) {
|
27619 | newIndex += swiper.loopedSlides;
|
27620 | }
|
27621 |
|
27622 | return swiper.slideTo(newIndex, speed, runCallbacks, internal);
|
27623 | }
|
27624 |
|
27625 |
|
27626 | function slideNext (speed = this.params.speed, runCallbacks = true, internal) {
|
27627 | const swiper = this;
|
27628 | const { params, animating } = swiper;
|
27629 | const increment = swiper.activeIndex < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup;
|
27630 | if (params.loop) {
|
27631 | if (animating) return false;
|
27632 | swiper.loopFix();
|
27633 |
|
27634 | swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
27635 | }
|
27636 | return swiper.slideTo(swiper.activeIndex + increment, speed, runCallbacks, internal);
|
27637 | }
|
27638 |
|
27639 |
|
27640 | function slidePrev (speed = this.params.speed, runCallbacks = true, internal) {
|
27641 | const swiper = this;
|
27642 | const {
|
27643 | params, animating, snapGrid, slidesGrid, rtlTranslate,
|
27644 | } = swiper;
|
27645 |
|
27646 | if (params.loop) {
|
27647 | if (animating) return false;
|
27648 | swiper.loopFix();
|
27649 |
|
27650 | swiper._clientLeft = swiper.$wrapperEl[0].clientLeft;
|
27651 | }
|
27652 | const translate = rtlTranslate ? swiper.translate : -swiper.translate;
|
27653 | function normalize(val) {
|
27654 | if (val < 0) return -Math.floor(Math.abs(val));
|
27655 | return Math.floor(val);
|
27656 | }
|
27657 | const normalizedTranslate = normalize(translate);
|
27658 | const normalizedSnapGrid = snapGrid.map((val) => normalize(val));
|
27659 | slidesGrid.map((val) => normalize(val));
|
27660 |
|
27661 | snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate)];
|
27662 | let prevSnap = snapGrid[normalizedSnapGrid.indexOf(normalizedTranslate) - 1];
|
27663 | if (typeof prevSnap === 'undefined' && params.cssMode) {
|
27664 | snapGrid.forEach((snap) => {
|
27665 | if (!prevSnap && normalizedTranslate >= snap) prevSnap = snap;
|
27666 | });
|
27667 | }
|
27668 | let prevIndex;
|
27669 | if (typeof prevSnap !== 'undefined') {
|
27670 | prevIndex = slidesGrid.indexOf(prevSnap);
|
27671 | if (prevIndex < 0) prevIndex = swiper.activeIndex - 1;
|
27672 | }
|
27673 | return swiper.slideTo(prevIndex, speed, runCallbacks, internal);
|
27674 | }
|
27675 |
|
27676 |
|
27677 | function slideReset (speed = this.params.speed, runCallbacks = true, internal) {
|
27678 | const swiper = this;
|
27679 | return swiper.slideTo(swiper.activeIndex, speed, runCallbacks, internal);
|
27680 | }
|
27681 |
|
27682 |
|
27683 | function slideToClosest (speed = this.params.speed, runCallbacks = true, internal, threshold = 0.5) {
|
27684 | const swiper = this;
|
27685 | let index = swiper.activeIndex;
|
27686 | const skip = Math.min(swiper.params.slidesPerGroupSkip, index);
|
27687 | const snapIndex = skip + Math.floor((index - skip) / swiper.params.slidesPerGroup);
|
27688 |
|
27689 | const translate = swiper.rtlTranslate ? swiper.translate : -swiper.translate;
|
27690 |
|
27691 | if (translate >= swiper.snapGrid[snapIndex]) {
|
27692 |
|
27693 |
|
27694 | const currentSnap = swiper.snapGrid[snapIndex];
|
27695 | const nextSnap = swiper.snapGrid[snapIndex + 1];
|
27696 | if ((translate - currentSnap) > (nextSnap - currentSnap) * threshold) {
|
27697 | index += swiper.params.slidesPerGroup;
|
27698 | }
|
27699 | } else {
|
27700 |
|
27701 |
|
27702 | const prevSnap = swiper.snapGrid[snapIndex - 1];
|
27703 | const currentSnap = swiper.snapGrid[snapIndex];
|
27704 | if ((translate - prevSnap) <= (currentSnap - prevSnap) * threshold) {
|
27705 | index -= swiper.params.slidesPerGroup;
|
27706 | }
|
27707 | }
|
27708 | index = Math.max(index, 0);
|
27709 | index = Math.min(index, swiper.slidesGrid.length - 1);
|
27710 |
|
27711 | return swiper.slideTo(index, speed, runCallbacks, internal);
|
27712 | }
|
27713 |
|
27714 | function slideToClickedSlide () {
|
27715 | const swiper = this;
|
27716 | const { params, $wrapperEl } = swiper;
|
27717 |
|
27718 | const slidesPerView = params.slidesPerView === 'auto' ? swiper.slidesPerViewDynamic() : params.slidesPerView;
|
27719 | let slideToIndex = swiper.clickedIndex;
|
27720 | let realIndex;
|
27721 | if (params.loop) {
|
27722 | if (swiper.animating) return;
|
27723 | realIndex = parseInt($(swiper.clickedSlide).attr('data-swiper-slide-index'), 10);
|
27724 | if (params.centeredSlides) {
|
27725 | if (
|
27726 | (slideToIndex < swiper.loopedSlides - (slidesPerView / 2))
|
27727 | || (slideToIndex > (swiper.slides.length - swiper.loopedSlides) + (slidesPerView / 2))
|
27728 | ) {
|
27729 | swiper.loopFix();
|
27730 | slideToIndex = $wrapperEl
|
27731 | .children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`)
|
27732 | .eq(0)
|
27733 | .index();
|
27734 |
|
27735 | Utils.nextTick(() => {
|
27736 | swiper.slideTo(slideToIndex);
|
27737 | });
|
27738 | } else {
|
27739 | swiper.slideTo(slideToIndex);
|
27740 | }
|
27741 | } else if (slideToIndex > swiper.slides.length - slidesPerView) {
|
27742 | swiper.loopFix();
|
27743 | slideToIndex = $wrapperEl
|
27744 | .children(`.${params.slideClass}[data-swiper-slide-index="${realIndex}"]:not(.${params.slideDuplicateClass})`)
|
27745 | .eq(0)
|
27746 | .index();
|
27747 |
|
27748 | Utils.nextTick(() => {
|
27749 | swiper.slideTo(slideToIndex);
|
27750 | });
|
27751 | } else {
|
27752 | swiper.slideTo(slideToIndex);
|
27753 | }
|
27754 | } else {
|
27755 | swiper.slideTo(slideToIndex);
|
27756 | }
|
27757 | }
|
27758 |
|
27759 | var slide = {
|
27760 | slideTo,
|
27761 | slideToLoop,
|
27762 | slideNext,
|
27763 | slidePrev,
|
27764 | slideReset,
|
27765 | slideToClosest,
|
27766 | slideToClickedSlide,
|
27767 | };
|
27768 |
|
27769 | function loopCreate () {
|
27770 | const swiper = this;
|
27771 | const { params, $wrapperEl } = swiper;
|
27772 |
|
27773 | $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass}`).remove();
|
27774 |
|
27775 | let slides = $wrapperEl.children(`.${params.slideClass}`);
|
27776 |
|
27777 | if (params.loopFillGroupWithBlank) {
|
27778 | const blankSlidesNum = params.slidesPerGroup - (slides.length % params.slidesPerGroup);
|
27779 | if (blankSlidesNum !== params.slidesPerGroup) {
|
27780 | for (let i = 0; i < blankSlidesNum; i += 1) {
|
27781 | const blankNode = $(doc.createElement('div')).addClass(`${params.slideClass} ${params.slideBlankClass}`);
|
27782 | $wrapperEl.append(blankNode);
|
27783 | }
|
27784 | slides = $wrapperEl.children(`.${params.slideClass}`);
|
27785 | }
|
27786 | }
|
27787 |
|
27788 | if (params.slidesPerView === 'auto' && !params.loopedSlides) params.loopedSlides = slides.length;
|
27789 |
|
27790 | swiper.loopedSlides = Math.ceil(parseFloat(params.loopedSlides || params.slidesPerView, 10));
|
27791 | swiper.loopedSlides += params.loopAdditionalSlides;
|
27792 | if (swiper.loopedSlides > slides.length) {
|
27793 | swiper.loopedSlides = slides.length;
|
27794 | }
|
27795 |
|
27796 | const prependSlides = [];
|
27797 | const appendSlides = [];
|
27798 | slides.each((index, el) => {
|
27799 | const slide = $(el);
|
27800 | if (index < swiper.loopedSlides) appendSlides.push(el);
|
27801 | if (index < slides.length && index >= slides.length - swiper.loopedSlides) prependSlides.push(el);
|
27802 | slide.attr('data-swiper-slide-index', index);
|
27803 | });
|
27804 | for (let i = 0; i < appendSlides.length; i += 1) {
|
27805 | $wrapperEl.append($(appendSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
|
27806 | }
|
27807 | for (let i = prependSlides.length - 1; i >= 0; i -= 1) {
|
27808 | $wrapperEl.prepend($(prependSlides[i].cloneNode(true)).addClass(params.slideDuplicateClass));
|
27809 | }
|
27810 | }
|
27811 |
|
27812 | function loopFix () {
|
27813 | const swiper = this;
|
27814 |
|
27815 | swiper.emit('beforeLoopFix');
|
27816 |
|
27817 | const {
|
27818 | activeIndex, slides, loopedSlides, allowSlidePrev, allowSlideNext, snapGrid, rtlTranslate: rtl,
|
27819 | } = swiper;
|
27820 | let newIndex;
|
27821 | swiper.allowSlidePrev = true;
|
27822 | swiper.allowSlideNext = true;
|
27823 |
|
27824 | const snapTranslate = -snapGrid[activeIndex];
|
27825 | const diff = snapTranslate - swiper.getTranslate();
|
27826 |
|
27827 |
|
27828 | if (activeIndex < loopedSlides) {
|
27829 | newIndex = (slides.length - (loopedSlides * 3)) + activeIndex;
|
27830 | newIndex += loopedSlides;
|
27831 | const slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
27832 | if (slideChanged && diff !== 0) {
|
27833 | swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
27834 | }
|
27835 | } else if (activeIndex >= slides.length - loopedSlides) {
|
27836 |
|
27837 | newIndex = -slides.length + activeIndex + loopedSlides;
|
27838 | newIndex += loopedSlides;
|
27839 | const slideChanged = swiper.slideTo(newIndex, 0, false, true);
|
27840 | if (slideChanged && diff !== 0) {
|
27841 | swiper.setTranslate((rtl ? -swiper.translate : swiper.translate) - diff);
|
27842 | }
|
27843 | }
|
27844 | swiper.allowSlidePrev = allowSlidePrev;
|
27845 | swiper.allowSlideNext = allowSlideNext;
|
27846 |
|
27847 | swiper.emit('loopFix');
|
27848 | }
|
27849 |
|
27850 | function loopDestroy () {
|
27851 | const swiper = this;
|
27852 | const { $wrapperEl, params, slides } = swiper;
|
27853 | $wrapperEl.children(`.${params.slideClass}.${params.slideDuplicateClass},.${params.slideClass}.${params.slideBlankClass}`).remove();
|
27854 | slides.removeAttr('data-swiper-slide-index');
|
27855 | }
|
27856 |
|
27857 | var loop = {
|
27858 | loopCreate,
|
27859 | loopFix,
|
27860 | loopDestroy,
|
27861 | };
|
27862 |
|
27863 | function setGrabCursor (moving) {
|
27864 | const swiper = this;
|
27865 | if (Support.touch || !swiper.params.simulateTouch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) return;
|
27866 | const el = swiper.el;
|
27867 | el.style.cursor = 'move';
|
27868 | el.style.cursor = moving ? '-webkit-grabbing' : '-webkit-grab';
|
27869 | el.style.cursor = moving ? '-moz-grabbin' : '-moz-grab';
|
27870 | el.style.cursor = moving ? 'grabbing' : 'grab';
|
27871 | }
|
27872 |
|
27873 | function unsetGrabCursor () {
|
27874 | const swiper = this;
|
27875 | if (Support.touch || (swiper.params.watchOverflow && swiper.isLocked) || swiper.params.cssMode) return;
|
27876 | swiper.el.style.cursor = '';
|
27877 | }
|
27878 |
|
27879 | var grabCursor = {
|
27880 | setGrabCursor,
|
27881 | unsetGrabCursor,
|
27882 | };
|
27883 |
|
27884 | function appendSlide (slides) {
|
27885 | const swiper = this;
|
27886 | const { $wrapperEl, params } = swiper;
|
27887 | if (params.loop) {
|
27888 | swiper.loopDestroy();
|
27889 | }
|
27890 | if (typeof slides === 'object' && 'length' in slides) {
|
27891 | for (let i = 0; i < slides.length; i += 1) {
|
27892 | if (slides[i]) $wrapperEl.append(slides[i]);
|
27893 | }
|
27894 | } else {
|
27895 | $wrapperEl.append(slides);
|
27896 | }
|
27897 | if (params.loop) {
|
27898 | swiper.loopCreate();
|
27899 | }
|
27900 | if (!(params.observer && Support.observer)) {
|
27901 | swiper.update();
|
27902 | }
|
27903 | }
|
27904 |
|
27905 | function prependSlide (slides) {
|
27906 | const swiper = this;
|
27907 | const { params, $wrapperEl, activeIndex } = swiper;
|
27908 |
|
27909 | if (params.loop) {
|
27910 | swiper.loopDestroy();
|
27911 | }
|
27912 | let newActiveIndex = activeIndex + 1;
|
27913 | if (typeof slides === 'object' && 'length' in slides) {
|
27914 | for (let i = 0; i < slides.length; i += 1) {
|
27915 | if (slides[i]) $wrapperEl.prepend(slides[i]);
|
27916 | }
|
27917 | newActiveIndex = activeIndex + slides.length;
|
27918 | } else {
|
27919 | $wrapperEl.prepend(slides);
|
27920 | }
|
27921 | if (params.loop) {
|
27922 | swiper.loopCreate();
|
27923 | }
|
27924 | if (!(params.observer && Support.observer)) {
|
27925 | swiper.update();
|
27926 | }
|
27927 | swiper.slideTo(newActiveIndex, 0, false);
|
27928 | }
|
27929 |
|
27930 | function addSlide (index, slides) {
|
27931 | const swiper = this;
|
27932 | const { $wrapperEl, params, activeIndex } = swiper;
|
27933 | let activeIndexBuffer = activeIndex;
|
27934 | if (params.loop) {
|
27935 | activeIndexBuffer -= swiper.loopedSlides;
|
27936 | swiper.loopDestroy();
|
27937 | swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
|
27938 | }
|
27939 | const baseLength = swiper.slides.length;
|
27940 | if (index <= 0) {
|
27941 | swiper.prependSlide(slides);
|
27942 | return;
|
27943 | }
|
27944 | if (index >= baseLength) {
|
27945 | swiper.appendSlide(slides);
|
27946 | return;
|
27947 | }
|
27948 | let newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + 1 : activeIndexBuffer;
|
27949 |
|
27950 | const slidesBuffer = [];
|
27951 | for (let i = baseLength - 1; i >= index; i -= 1) {
|
27952 | const currentSlide = swiper.slides.eq(i);
|
27953 | currentSlide.remove();
|
27954 | slidesBuffer.unshift(currentSlide);
|
27955 | }
|
27956 |
|
27957 | if (typeof slides === 'object' && 'length' in slides) {
|
27958 | for (let i = 0; i < slides.length; i += 1) {
|
27959 | if (slides[i]) $wrapperEl.append(slides[i]);
|
27960 | }
|
27961 | newActiveIndex = activeIndexBuffer > index ? activeIndexBuffer + slides.length : activeIndexBuffer;
|
27962 | } else {
|
27963 | $wrapperEl.append(slides);
|
27964 | }
|
27965 |
|
27966 | for (let i = 0; i < slidesBuffer.length; i += 1) {
|
27967 | $wrapperEl.append(slidesBuffer[i]);
|
27968 | }
|
27969 |
|
27970 | if (params.loop) {
|
27971 | swiper.loopCreate();
|
27972 | }
|
27973 | if (!(params.observer && Support.observer)) {
|
27974 | swiper.update();
|
27975 | }
|
27976 | if (params.loop) {
|
27977 | swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
27978 | } else {
|
27979 | swiper.slideTo(newActiveIndex, 0, false);
|
27980 | }
|
27981 | }
|
27982 |
|
27983 | function removeSlide (slidesIndexes) {
|
27984 | const swiper = this;
|
27985 | const { params, $wrapperEl, activeIndex } = swiper;
|
27986 |
|
27987 | let activeIndexBuffer = activeIndex;
|
27988 | if (params.loop) {
|
27989 | activeIndexBuffer -= swiper.loopedSlides;
|
27990 | swiper.loopDestroy();
|
27991 | swiper.slides = $wrapperEl.children(`.${params.slideClass}`);
|
27992 | }
|
27993 | let newActiveIndex = activeIndexBuffer;
|
27994 | let indexToRemove;
|
27995 |
|
27996 | if (typeof slidesIndexes === 'object' && 'length' in slidesIndexes) {
|
27997 | for (let i = 0; i < slidesIndexes.length; i += 1) {
|
27998 | indexToRemove = slidesIndexes[i];
|
27999 | if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();
|
28000 | if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
|
28001 | }
|
28002 | newActiveIndex = Math.max(newActiveIndex, 0);
|
28003 | } else {
|
28004 | indexToRemove = slidesIndexes;
|
28005 | if (swiper.slides[indexToRemove]) swiper.slides.eq(indexToRemove).remove();
|
28006 | if (indexToRemove < newActiveIndex) newActiveIndex -= 1;
|
28007 | newActiveIndex = Math.max(newActiveIndex, 0);
|
28008 | }
|
28009 |
|
28010 | if (params.loop) {
|
28011 | swiper.loopCreate();
|
28012 | }
|
28013 |
|
28014 | if (!(params.observer && Support.observer)) {
|
28015 | swiper.update();
|
28016 | }
|
28017 | if (params.loop) {
|
28018 | swiper.slideTo(newActiveIndex + swiper.loopedSlides, 0, false);
|
28019 | } else {
|
28020 | swiper.slideTo(newActiveIndex, 0, false);
|
28021 | }
|
28022 | }
|
28023 |
|
28024 | function removeAllSlides () {
|
28025 | const swiper = this;
|
28026 |
|
28027 | const slidesIndexes = [];
|
28028 | for (let i = 0; i < swiper.slides.length; i += 1) {
|
28029 | slidesIndexes.push(i);
|
28030 | }
|
28031 | swiper.removeSlide(slidesIndexes);
|
28032 | }
|
28033 |
|
28034 | var manipulation = {
|
28035 | appendSlide,
|
28036 | prependSlide,
|
28037 | addSlide,
|
28038 | removeSlide,
|
28039 | removeAllSlides,
|
28040 | };
|
28041 |
|
28042 | const Device = (function Device() {
|
28043 | const platform = win.navigator.platform;
|
28044 | const ua = win.navigator.userAgent;
|
28045 |
|
28046 | const device = {
|
28047 | ios: false,
|
28048 | android: false,
|
28049 | androidChrome: false,
|
28050 | desktop: false,
|
28051 | iphone: false,
|
28052 | ipod: false,
|
28053 | ipad: false,
|
28054 | edge: false,
|
28055 | ie: false,
|
28056 | firefox: false,
|
28057 | macos: false,
|
28058 | windows: false,
|
28059 | cordova: !!(win.cordova || win.phonegap),
|
28060 | phonegap: !!(win.cordova || win.phonegap),
|
28061 | electron: false,
|
28062 | };
|
28063 |
|
28064 | const screenWidth = win.screen.width;
|
28065 | const screenHeight = win.screen.height;
|
28066 |
|
28067 | const android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
|
28068 | let ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
28069 | const ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
28070 | const iphone = !ipad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);
|
28071 | const ie = ua.indexOf('MSIE ') >= 0 || ua.indexOf('Trident/') >= 0;
|
28072 | const edge = ua.indexOf('Edge/') >= 0;
|
28073 | const firefox = ua.indexOf('Gecko/') >= 0 && ua.indexOf('Firefox/') >= 0;
|
28074 | const windows = platform === 'Win32';
|
28075 | const electron = ua.toLowerCase().indexOf('electron') >= 0;
|
28076 | let macos = platform === 'MacIntel';
|
28077 |
|
28078 |
|
28079 | if (!ipad
|
28080 | && macos
|
28081 | && Support.touch
|
28082 | && (
|
28083 | (screenWidth === 1024 && screenHeight === 1366)
|
28084 | || (screenWidth === 834 && screenHeight === 1194)
|
28085 | || (screenWidth === 834 && screenHeight === 1112)
|
28086 | || (screenWidth === 768 && screenHeight === 1024)
|
28087 | )
|
28088 | ) {
|
28089 | ipad = ua.match(/(Version)\/([\d.]+)/);
|
28090 | macos = false;
|
28091 | }
|
28092 |
|
28093 | device.ie = ie;
|
28094 | device.edge = edge;
|
28095 | device.firefox = firefox;
|
28096 |
|
28097 |
|
28098 | if (android && !windows) {
|
28099 | device.os = 'android';
|
28100 | device.osVersion = android[2];
|
28101 | device.android = true;
|
28102 | device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0;
|
28103 | }
|
28104 | if (ipad || iphone || ipod) {
|
28105 | device.os = 'ios';
|
28106 | device.ios = true;
|
28107 | }
|
28108 |
|
28109 | if (iphone && !ipod) {
|
28110 | device.osVersion = iphone[2].replace(/_/g, '.');
|
28111 | device.iphone = true;
|
28112 | }
|
28113 | if (ipad) {
|
28114 | device.osVersion = ipad[2].replace(/_/g, '.');
|
28115 | device.ipad = true;
|
28116 | }
|
28117 | if (ipod) {
|
28118 | device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
|
28119 | device.ipod = true;
|
28120 | }
|
28121 |
|
28122 | if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) {
|
28123 | if (device.osVersion.split('.')[0] === '10') {
|
28124 | device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0];
|
28125 | }
|
28126 | }
|
28127 |
|
28128 |
|
28129 | device.webView = !!((iphone || ipad || ipod) && (ua.match(/.*AppleWebKit(?!.*Safari)/i) || win.navigator.standalone))
|
28130 | || (win.matchMedia && win.matchMedia('(display-mode: standalone)').matches);
|
28131 | device.webview = device.webView;
|
28132 | device.standalone = device.webView;
|
28133 |
|
28134 |
|
28135 | device.desktop = !(device.ios || device.android) || electron;
|
28136 | if (device.desktop) {
|
28137 | device.electron = electron;
|
28138 | device.macos = macos;
|
28139 | device.windows = windows;
|
28140 | if (device.macos) {
|
28141 | device.os = 'macos';
|
28142 | }
|
28143 | if (device.windows) {
|
28144 | device.os = 'windows';
|
28145 | }
|
28146 | }
|
28147 |
|
28148 |
|
28149 | device.pixelRatio = win.devicePixelRatio || 1;
|
28150 |
|
28151 |
|
28152 | return device;
|
28153 | }());
|
28154 |
|
28155 | function onTouchStart (event) {
|
28156 | const swiper = this;
|
28157 | const data = swiper.touchEventsData;
|
28158 | const { params, touches } = swiper;
|
28159 |
|
28160 | if (swiper.animating && params.preventInteractionOnTransition) {
|
28161 | return;
|
28162 | }
|
28163 | let e = event;
|
28164 | if (e.originalEvent) e = e.originalEvent;
|
28165 | const $targetEl = $(e.target);
|
28166 |
|
28167 | if (params.touchEventsTarget === 'wrapper') {
|
28168 | if (!$targetEl.closest(swiper.wrapperEl).length) return;
|
28169 | }
|
28170 | data.isTouchEvent = e.type === 'touchstart';
|
28171 | if (!data.isTouchEvent && 'which' in e && e.which === 3) return;
|
28172 | if (!data.isTouchEvent && 'button' in e && e.button > 0) return;
|
28173 | if (data.isTouched && data.isMoved) return;
|
28174 | if (params.noSwiping && $targetEl.closest(params.noSwipingSelector ? params.noSwipingSelector : `.${params.noSwipingClass}`)[0]) {
|
28175 | swiper.allowClick = true;
|
28176 | return;
|
28177 | }
|
28178 | if (params.swipeHandler) {
|
28179 | if (!$targetEl.closest(params.swipeHandler)[0]) return;
|
28180 | }
|
28181 |
|
28182 | touches.currentX = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
28183 | touches.currentY = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
28184 | const startX = touches.currentX;
|
28185 | const startY = touches.currentY;
|
28186 |
|
28187 |
|
28188 |
|
28189 | const edgeSwipeDetection = params.edgeSwipeDetection || params.iOSEdgeSwipeDetection;
|
28190 | const edgeSwipeThreshold = params.edgeSwipeThreshold || params.iOSEdgeSwipeThreshold;
|
28191 | if (
|
28192 | edgeSwipeDetection
|
28193 | && ((startX <= edgeSwipeThreshold)
|
28194 | || (startX >= win.screen.width - edgeSwipeThreshold))
|
28195 | ) {
|
28196 | return;
|
28197 | }
|
28198 |
|
28199 | Utils.extend(data, {
|
28200 | isTouched: true,
|
28201 | isMoved: false,
|
28202 | allowTouchCallbacks: true,
|
28203 | isScrolling: undefined,
|
28204 | startMoving: undefined,
|
28205 | });
|
28206 |
|
28207 | touches.startX = startX;
|
28208 | touches.startY = startY;
|
28209 | data.touchStartTime = Utils.now();
|
28210 | swiper.allowClick = true;
|
28211 | swiper.updateSize();
|
28212 | swiper.swipeDirection = undefined;
|
28213 | if (params.threshold > 0) data.allowThresholdMove = false;
|
28214 | if (e.type !== 'touchstart') {
|
28215 | let preventDefault = true;
|
28216 | if ($targetEl.is(data.formElements)) preventDefault = false;
|
28217 | if (
|
28218 | doc.activeElement
|
28219 | && $(doc.activeElement).is(data.formElements)
|
28220 | && doc.activeElement !== $targetEl[0]
|
28221 | ) {
|
28222 | doc.activeElement.blur();
|
28223 | }
|
28224 |
|
28225 | const shouldPreventDefault = preventDefault && swiper.allowTouchMove && params.touchStartPreventDefault;
|
28226 | if (params.touchStartForcePreventDefault || shouldPreventDefault) {
|
28227 | e.preventDefault();
|
28228 | }
|
28229 | }
|
28230 | swiper.emit('touchStart', e);
|
28231 | }
|
28232 |
|
28233 | function onTouchMove (event) {
|
28234 | const swiper = this;
|
28235 | const data = swiper.touchEventsData;
|
28236 | const { params, touches, rtlTranslate: rtl } = swiper;
|
28237 | let e = event;
|
28238 | if (e.originalEvent) e = e.originalEvent;
|
28239 | if (!data.isTouched) {
|
28240 | if (data.startMoving && data.isScrolling) {
|
28241 | swiper.emit('touchMoveOpposite', e);
|
28242 | }
|
28243 | return;
|
28244 | }
|
28245 | if (data.isTouchEvent && e.type !== 'touchmove') return;
|
28246 | const targetTouch = e.type === 'touchmove' && e.targetTouches && (e.targetTouches[0] || e.changedTouches[0]);
|
28247 | const pageX = e.type === 'touchmove' ? targetTouch.pageX : e.pageX;
|
28248 | const pageY = e.type === 'touchmove' ? targetTouch.pageY : e.pageY;
|
28249 | if (e.preventedByNestedSwiper) {
|
28250 | touches.startX = pageX;
|
28251 | touches.startY = pageY;
|
28252 | return;
|
28253 | }
|
28254 | if (!swiper.allowTouchMove) {
|
28255 |
|
28256 | swiper.allowClick = false;
|
28257 | if (data.isTouched) {
|
28258 | Utils.extend(touches, {
|
28259 | startX: pageX,
|
28260 | startY: pageY,
|
28261 | currentX: pageX,
|
28262 | currentY: pageY,
|
28263 | });
|
28264 | data.touchStartTime = Utils.now();
|
28265 | }
|
28266 | return;
|
28267 | }
|
28268 | if (data.isTouchEvent && params.touchReleaseOnEdges && !params.loop) {
|
28269 | if (swiper.isVertical()) {
|
28270 |
|
28271 | if (
|
28272 | (pageY < touches.startY && swiper.translate <= swiper.maxTranslate())
|
28273 | || (pageY > touches.startY && swiper.translate >= swiper.minTranslate())
|
28274 | ) {
|
28275 | data.isTouched = false;
|
28276 | data.isMoved = false;
|
28277 | return;
|
28278 | }
|
28279 | } else if (
|
28280 | (pageX < touches.startX && swiper.translate <= swiper.maxTranslate())
|
28281 | || (pageX > touches.startX && swiper.translate >= swiper.minTranslate())
|
28282 | ) {
|
28283 | return;
|
28284 | }
|
28285 | }
|
28286 | if (data.isTouchEvent && doc.activeElement) {
|
28287 | if (e.target === doc.activeElement && $(e.target).is(data.formElements)) {
|
28288 | data.isMoved = true;
|
28289 | swiper.allowClick = false;
|
28290 | return;
|
28291 | }
|
28292 | }
|
28293 | if (data.allowTouchCallbacks) {
|
28294 | swiper.emit('touchMove', e);
|
28295 | }
|
28296 | if (e.targetTouches && e.targetTouches.length > 1) return;
|
28297 |
|
28298 | touches.currentX = pageX;
|
28299 | touches.currentY = pageY;
|
28300 |
|
28301 | const diffX = touches.currentX - touches.startX;
|
28302 | const diffY = touches.currentY - touches.startY;
|
28303 | if (swiper.params.threshold && Math.sqrt((diffX ** 2) + (diffY ** 2)) < swiper.params.threshold) return;
|
28304 |
|
28305 | if (typeof data.isScrolling === 'undefined') {
|
28306 | let touchAngle;
|
28307 | if ((swiper.isHorizontal() && touches.currentY === touches.startY) || (swiper.isVertical() && touches.currentX === touches.startX)) {
|
28308 | data.isScrolling = false;
|
28309 | } else {
|
28310 |
|
28311 | if ((diffX * diffX) + (diffY * diffY) >= 25) {
|
28312 | touchAngle = (Math.atan2(Math.abs(diffY), Math.abs(diffX)) * 180) / Math.PI;
|
28313 | data.isScrolling = swiper.isHorizontal() ? touchAngle > params.touchAngle : (90 - touchAngle > params.touchAngle);
|
28314 | }
|
28315 | }
|
28316 | }
|
28317 | if (data.isScrolling) {
|
28318 | swiper.emit('touchMoveOpposite', e);
|
28319 | }
|
28320 | if (typeof data.startMoving === 'undefined') {
|
28321 | if (touches.currentX !== touches.startX || touches.currentY !== touches.startY) {
|
28322 | data.startMoving = true;
|
28323 | }
|
28324 | }
|
28325 | if (data.isScrolling) {
|
28326 | data.isTouched = false;
|
28327 | return;
|
28328 | }
|
28329 | if (!data.startMoving) {
|
28330 | return;
|
28331 | }
|
28332 | swiper.allowClick = false;
|
28333 | if (!params.cssMode && e.cancelable) {
|
28334 | e.preventDefault();
|
28335 | }
|
28336 | if (params.touchMoveStopPropagation && !params.nested) {
|
28337 | e.stopPropagation();
|
28338 | }
|
28339 |
|
28340 | if (!data.isMoved) {
|
28341 | if (params.loop) {
|
28342 | swiper.loopFix();
|
28343 | }
|
28344 | data.startTranslate = swiper.getTranslate();
|
28345 | swiper.setTransition(0);
|
28346 | if (swiper.animating) {
|
28347 | swiper.$wrapperEl.trigger('webkitTransitionEnd transitionend');
|
28348 | }
|
28349 | data.allowMomentumBounce = false;
|
28350 |
|
28351 | if (params.grabCursor && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
28352 | swiper.setGrabCursor(true);
|
28353 | }
|
28354 | swiper.emit('sliderFirstMove', e);
|
28355 | }
|
28356 | swiper.emit('sliderMove', e);
|
28357 | data.isMoved = true;
|
28358 |
|
28359 | let diff = swiper.isHorizontal() ? diffX : diffY;
|
28360 | touches.diff = diff;
|
28361 |
|
28362 | diff *= params.touchRatio;
|
28363 | if (rtl) diff = -diff;
|
28364 |
|
28365 | swiper.swipeDirection = diff > 0 ? 'prev' : 'next';
|
28366 | data.currentTranslate = diff + data.startTranslate;
|
28367 |
|
28368 | let disableParentSwiper = true;
|
28369 | let resistanceRatio = params.resistanceRatio;
|
28370 | if (params.touchReleaseOnEdges) {
|
28371 | resistanceRatio = 0;
|
28372 | }
|
28373 | if ((diff > 0 && data.currentTranslate > swiper.minTranslate())) {
|
28374 | disableParentSwiper = false;
|
28375 | if (params.resistance) data.currentTranslate = (swiper.minTranslate() - 1) + ((-swiper.minTranslate() + data.startTranslate + diff) ** resistanceRatio);
|
28376 | } else if (diff < 0 && data.currentTranslate < swiper.maxTranslate()) {
|
28377 | disableParentSwiper = false;
|
28378 | if (params.resistance) data.currentTranslate = (swiper.maxTranslate() + 1) - ((swiper.maxTranslate() - data.startTranslate - diff) ** resistanceRatio);
|
28379 | }
|
28380 |
|
28381 | if (disableParentSwiper) {
|
28382 | e.preventedByNestedSwiper = true;
|
28383 | }
|
28384 |
|
28385 |
|
28386 | if (!swiper.allowSlideNext && swiper.swipeDirection === 'next' && data.currentTranslate < data.startTranslate) {
|
28387 | data.currentTranslate = data.startTranslate;
|
28388 | }
|
28389 | if (!swiper.allowSlidePrev && swiper.swipeDirection === 'prev' && data.currentTranslate > data.startTranslate) {
|
28390 | data.currentTranslate = data.startTranslate;
|
28391 | }
|
28392 |
|
28393 |
|
28394 |
|
28395 | if (params.threshold > 0) {
|
28396 | if (Math.abs(diff) > params.threshold || data.allowThresholdMove) {
|
28397 | if (!data.allowThresholdMove) {
|
28398 | data.allowThresholdMove = true;
|
28399 | touches.startX = touches.currentX;
|
28400 | touches.startY = touches.currentY;
|
28401 | data.currentTranslate = data.startTranslate;
|
28402 | touches.diff = swiper.isHorizontal() ? touches.currentX - touches.startX : touches.currentY - touches.startY;
|
28403 | return;
|
28404 | }
|
28405 | } else {
|
28406 | data.currentTranslate = data.startTranslate;
|
28407 | return;
|
28408 | }
|
28409 | }
|
28410 |
|
28411 | if (!params.followFinger || params.cssMode) return;
|
28412 |
|
28413 |
|
28414 | if (params.freeMode || params.watchSlidesProgress || params.watchSlidesVisibility) {
|
28415 | swiper.updateActiveIndex();
|
28416 | swiper.updateSlidesClasses();
|
28417 | }
|
28418 | if (params.freeMode) {
|
28419 |
|
28420 | if (data.velocities.length === 0) {
|
28421 | data.velocities.push({
|
28422 | position: touches[swiper.isHorizontal() ? 'startX' : 'startY'],
|
28423 | time: data.touchStartTime,
|
28424 | });
|
28425 | }
|
28426 | data.velocities.push({
|
28427 | position: touches[swiper.isHorizontal() ? 'currentX' : 'currentY'],
|
28428 | time: Utils.now(),
|
28429 | });
|
28430 | }
|
28431 |
|
28432 | swiper.updateProgress(data.currentTranslate);
|
28433 |
|
28434 | swiper.setTranslate(data.currentTranslate);
|
28435 | }
|
28436 |
|
28437 | function onTouchEnd (event) {
|
28438 | const swiper = this;
|
28439 | const data = swiper.touchEventsData;
|
28440 |
|
28441 | const {
|
28442 | params, touches, rtlTranslate: rtl, $wrapperEl, slidesGrid, snapGrid,
|
28443 | } = swiper;
|
28444 | let e = event;
|
28445 | if (e.originalEvent) e = e.originalEvent;
|
28446 | if (data.allowTouchCallbacks) {
|
28447 | swiper.emit('touchEnd', e);
|
28448 | }
|
28449 | data.allowTouchCallbacks = false;
|
28450 | if (!data.isTouched) {
|
28451 | if (data.isMoved && params.grabCursor) {
|
28452 | swiper.setGrabCursor(false);
|
28453 | }
|
28454 | data.isMoved = false;
|
28455 | data.startMoving = false;
|
28456 | return;
|
28457 | }
|
28458 |
|
28459 | if (params.grabCursor && data.isMoved && data.isTouched && (swiper.allowSlideNext === true || swiper.allowSlidePrev === true)) {
|
28460 | swiper.setGrabCursor(false);
|
28461 | }
|
28462 |
|
28463 |
|
28464 | const touchEndTime = Utils.now();
|
28465 | const timeDiff = touchEndTime - data.touchStartTime;
|
28466 |
|
28467 |
|
28468 | if (swiper.allowClick) {
|
28469 | swiper.updateClickedSlide(e);
|
28470 | swiper.emit('tap click', e);
|
28471 | if (timeDiff < 300 && (touchEndTime - data.lastClickTime) < 300) {
|
28472 | swiper.emit('doubleTap doubleClick', e);
|
28473 | }
|
28474 | }
|
28475 |
|
28476 | data.lastClickTime = Utils.now();
|
28477 | Utils.nextTick(() => {
|
28478 | if (!swiper.destroyed) swiper.allowClick = true;
|
28479 | });
|
28480 |
|
28481 | if (!data.isTouched || !data.isMoved || !swiper.swipeDirection || touches.diff === 0 || data.currentTranslate === data.startTranslate) {
|
28482 | data.isTouched = false;
|
28483 | data.isMoved = false;
|
28484 | data.startMoving = false;
|
28485 | return;
|
28486 | }
|
28487 | data.isTouched = false;
|
28488 | data.isMoved = false;
|
28489 | data.startMoving = false;
|
28490 |
|
28491 | let currentPos;
|
28492 | if (params.followFinger) {
|
28493 | currentPos = rtl ? swiper.translate : -swiper.translate;
|
28494 | } else {
|
28495 | currentPos = -data.currentTranslate;
|
28496 | }
|
28497 |
|
28498 | if (params.cssMode) {
|
28499 | return;
|
28500 | }
|
28501 |
|
28502 | if (params.freeMode) {
|
28503 | if (currentPos < -swiper.minTranslate()) {
|
28504 | swiper.slideTo(swiper.activeIndex);
|
28505 | return;
|
28506 | }
|
28507 | if (currentPos > -swiper.maxTranslate()) {
|
28508 | if (swiper.slides.length < snapGrid.length) {
|
28509 | swiper.slideTo(snapGrid.length - 1);
|
28510 | } else {
|
28511 | swiper.slideTo(swiper.slides.length - 1);
|
28512 | }
|
28513 | return;
|
28514 | }
|
28515 |
|
28516 | if (params.freeModeMomentum) {
|
28517 | if (data.velocities.length > 1) {
|
28518 | const lastMoveEvent = data.velocities.pop();
|
28519 | const velocityEvent = data.velocities.pop();
|
28520 |
|
28521 | const distance = lastMoveEvent.position - velocityEvent.position;
|
28522 | const time = lastMoveEvent.time - velocityEvent.time;
|
28523 | swiper.velocity = distance / time;
|
28524 | swiper.velocity /= 2;
|
28525 | if (Math.abs(swiper.velocity) < params.freeModeMinimumVelocity) {
|
28526 | swiper.velocity = 0;
|
28527 | }
|
28528 |
|
28529 |
|
28530 | if (time > 150 || (Utils.now() - lastMoveEvent.time) > 300) {
|
28531 | swiper.velocity = 0;
|
28532 | }
|
28533 | } else {
|
28534 | swiper.velocity = 0;
|
28535 | }
|
28536 | swiper.velocity *= params.freeModeMomentumVelocityRatio;
|
28537 |
|
28538 | data.velocities.length = 0;
|
28539 | let momentumDuration = 1000 * params.freeModeMomentumRatio;
|
28540 | const momentumDistance = swiper.velocity * momentumDuration;
|
28541 |
|
28542 | let newPosition = swiper.translate + momentumDistance;
|
28543 | if (rtl) newPosition = -newPosition;
|
28544 |
|
28545 | let doBounce = false;
|
28546 | let afterBouncePosition;
|
28547 | const bounceAmount = Math.abs(swiper.velocity) * 20 * params.freeModeMomentumBounceRatio;
|
28548 | let needsLoopFix;
|
28549 | if (newPosition < swiper.maxTranslate()) {
|
28550 | if (params.freeModeMomentumBounce) {
|
28551 | if (newPosition + swiper.maxTranslate() < -bounceAmount) {
|
28552 | newPosition = swiper.maxTranslate() - bounceAmount;
|
28553 | }
|
28554 | afterBouncePosition = swiper.maxTranslate();
|
28555 | doBounce = true;
|
28556 | data.allowMomentumBounce = true;
|
28557 | } else {
|
28558 | newPosition = swiper.maxTranslate();
|
28559 | }
|
28560 | if (params.loop && params.centeredSlides) needsLoopFix = true;
|
28561 | } else if (newPosition > swiper.minTranslate()) {
|
28562 | if (params.freeModeMomentumBounce) {
|
28563 | if (newPosition - swiper.minTranslate() > bounceAmount) {
|
28564 | newPosition = swiper.minTranslate() + bounceAmount;
|
28565 | }
|
28566 | afterBouncePosition = swiper.minTranslate();
|
28567 | doBounce = true;
|
28568 | data.allowMomentumBounce = true;
|
28569 | } else {
|
28570 | newPosition = swiper.minTranslate();
|
28571 | }
|
28572 | if (params.loop && params.centeredSlides) needsLoopFix = true;
|
28573 | } else if (params.freeModeSticky) {
|
28574 | let nextSlide;
|
28575 | for (let j = 0; j < snapGrid.length; j += 1) {
|
28576 | if (snapGrid[j] > -newPosition) {
|
28577 | nextSlide = j;
|
28578 | break;
|
28579 | }
|
28580 | }
|
28581 |
|
28582 | if (Math.abs(snapGrid[nextSlide] - newPosition) < Math.abs(snapGrid[nextSlide - 1] - newPosition) || swiper.swipeDirection === 'next') {
|
28583 | newPosition = snapGrid[nextSlide];
|
28584 | } else {
|
28585 | newPosition = snapGrid[nextSlide - 1];
|
28586 | }
|
28587 | newPosition = -newPosition;
|
28588 | }
|
28589 | if (needsLoopFix) {
|
28590 | swiper.once('transitionEnd', () => {
|
28591 | swiper.loopFix();
|
28592 | });
|
28593 | }
|
28594 |
|
28595 | if (swiper.velocity !== 0) {
|
28596 | if (rtl) {
|
28597 | momentumDuration = Math.abs((-newPosition - swiper.translate) / swiper.velocity);
|
28598 | } else {
|
28599 | momentumDuration = Math.abs((newPosition - swiper.translate) / swiper.velocity);
|
28600 | }
|
28601 | if (params.freeModeSticky) {
|
28602 |
|
28603 |
|
28604 |
|
28605 |
|
28606 |
|
28607 |
|
28608 |
|
28609 | const moveDistance = Math.abs((rtl ? -newPosition : newPosition) - swiper.translate);
|
28610 | const currentSlideSize = swiper.slidesSizesGrid[swiper.activeIndex];
|
28611 | if (moveDistance < currentSlideSize) {
|
28612 | momentumDuration = params.speed;
|
28613 | } else if (moveDistance < 2 * currentSlideSize) {
|
28614 | momentumDuration = params.speed * 1.5;
|
28615 | } else {
|
28616 | momentumDuration = params.speed * 2.5;
|
28617 | }
|
28618 | }
|
28619 | } else if (params.freeModeSticky) {
|
28620 | swiper.slideToClosest();
|
28621 | return;
|
28622 | }
|
28623 |
|
28624 | if (params.freeModeMomentumBounce && doBounce) {
|
28625 | swiper.updateProgress(afterBouncePosition);
|
28626 | swiper.setTransition(momentumDuration);
|
28627 | swiper.setTranslate(newPosition);
|
28628 | swiper.transitionStart(true, swiper.swipeDirection);
|
28629 | swiper.animating = true;
|
28630 | $wrapperEl.transitionEnd(() => {
|
28631 | if (!swiper || swiper.destroyed || !data.allowMomentumBounce) return;
|
28632 | swiper.emit('momentumBounce');
|
28633 | swiper.setTransition(params.speed);
|
28634 | setTimeout(() => {
|
28635 | swiper.setTranslate(afterBouncePosition);
|
28636 | $wrapperEl.transitionEnd(() => {
|
28637 | if (!swiper || swiper.destroyed) return;
|
28638 | swiper.transitionEnd();
|
28639 | });
|
28640 | }, 0);
|
28641 | });
|
28642 | } else if (swiper.velocity) {
|
28643 | swiper.updateProgress(newPosition);
|
28644 | swiper.setTransition(momentumDuration);
|
28645 | swiper.setTranslate(newPosition);
|
28646 | swiper.transitionStart(true, swiper.swipeDirection);
|
28647 | if (!swiper.animating) {
|
28648 | swiper.animating = true;
|
28649 | $wrapperEl.transitionEnd(() => {
|
28650 | if (!swiper || swiper.destroyed) return;
|
28651 | swiper.transitionEnd();
|
28652 | });
|
28653 | }
|
28654 | } else {
|
28655 | swiper.updateProgress(newPosition);
|
28656 | }
|
28657 |
|
28658 | swiper.updateActiveIndex();
|
28659 | swiper.updateSlidesClasses();
|
28660 | } else if (params.freeModeSticky) {
|
28661 | swiper.slideToClosest();
|
28662 | return;
|
28663 | }
|
28664 |
|
28665 | if (!params.freeModeMomentum || timeDiff >= params.longSwipesMs) {
|
28666 | swiper.updateProgress();
|
28667 | swiper.updateActiveIndex();
|
28668 | swiper.updateSlidesClasses();
|
28669 | }
|
28670 | return;
|
28671 | }
|
28672 |
|
28673 |
|
28674 | let stopIndex = 0;
|
28675 | let groupSize = swiper.slidesSizesGrid[0];
|
28676 | for (let i = 0; i < slidesGrid.length; i += (i < params.slidesPerGroupSkip ? 1 : params.slidesPerGroup)) {
|
28677 | const increment = (i < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);
|
28678 | if (typeof slidesGrid[i + increment] !== 'undefined') {
|
28679 | if (currentPos >= slidesGrid[i] && currentPos < slidesGrid[i + increment]) {
|
28680 | stopIndex = i;
|
28681 | groupSize = slidesGrid[i + increment] - slidesGrid[i];
|
28682 | }
|
28683 | } else if (currentPos >= slidesGrid[i]) {
|
28684 | stopIndex = i;
|
28685 | groupSize = slidesGrid[slidesGrid.length - 1] - slidesGrid[slidesGrid.length - 2];
|
28686 | }
|
28687 | }
|
28688 |
|
28689 |
|
28690 | const ratio = (currentPos - slidesGrid[stopIndex]) / groupSize;
|
28691 | const increment = (stopIndex < params.slidesPerGroupSkip - 1 ? 1 : params.slidesPerGroup);
|
28692 |
|
28693 | if (timeDiff > params.longSwipesMs) {
|
28694 |
|
28695 | if (!params.longSwipes) {
|
28696 | swiper.slideTo(swiper.activeIndex);
|
28697 | return;
|
28698 | }
|
28699 | if (swiper.swipeDirection === 'next') {
|
28700 | if (ratio >= params.longSwipesRatio) swiper.slideTo(stopIndex + increment);
|
28701 | else swiper.slideTo(stopIndex);
|
28702 | }
|
28703 | if (swiper.swipeDirection === 'prev') {
|
28704 | if (ratio > (1 - params.longSwipesRatio)) swiper.slideTo(stopIndex + increment);
|
28705 | else swiper.slideTo(stopIndex);
|
28706 | }
|
28707 | } else {
|
28708 |
|
28709 | if (!params.shortSwipes) {
|
28710 | swiper.slideTo(swiper.activeIndex);
|
28711 | return;
|
28712 | }
|
28713 | const isNavButtonTarget = swiper.navigation && (e.target === swiper.navigation.nextEl || e.target === swiper.navigation.prevEl);
|
28714 | if (!isNavButtonTarget) {
|
28715 | if (swiper.swipeDirection === 'next') {
|
28716 | swiper.slideTo(stopIndex + increment);
|
28717 | }
|
28718 | if (swiper.swipeDirection === 'prev') {
|
28719 | swiper.slideTo(stopIndex);
|
28720 | }
|
28721 | } else if (e.target === swiper.navigation.nextEl) {
|
28722 | swiper.slideTo(stopIndex + increment);
|
28723 | } else {
|
28724 | swiper.slideTo(stopIndex);
|
28725 | }
|
28726 | }
|
28727 | }
|
28728 |
|
28729 | function onResize () {
|
28730 | const swiper = this;
|
28731 |
|
28732 | const { params, el } = swiper;
|
28733 |
|
28734 | if (el && el.offsetWidth === 0) return;
|
28735 |
|
28736 |
|
28737 | if (params.breakpoints) {
|
28738 | swiper.setBreakpoint();
|
28739 | }
|
28740 |
|
28741 |
|
28742 | const { allowSlideNext, allowSlidePrev, snapGrid } = swiper;
|
28743 |
|
28744 |
|
28745 | swiper.allowSlideNext = true;
|
28746 | swiper.allowSlidePrev = true;
|
28747 |
|
28748 | swiper.updateSize();
|
28749 | swiper.updateSlides();
|
28750 |
|
28751 | swiper.updateSlidesClasses();
|
28752 | if ((params.slidesPerView === 'auto' || params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
|
28753 | swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
28754 | } else {
|
28755 | swiper.slideTo(swiper.activeIndex, 0, false, true);
|
28756 | }
|
28757 |
|
28758 | if (swiper.autoplay && swiper.autoplay.running && swiper.autoplay.paused) {
|
28759 | swiper.autoplay.run();
|
28760 | }
|
28761 |
|
28762 | swiper.allowSlidePrev = allowSlidePrev;
|
28763 | swiper.allowSlideNext = allowSlideNext;
|
28764 |
|
28765 | if (swiper.params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
28766 | swiper.checkOverflow();
|
28767 | }
|
28768 | }
|
28769 |
|
28770 | function onClick (e) {
|
28771 | const swiper = this;
|
28772 | if (!swiper.allowClick) {
|
28773 | if (swiper.params.preventClicks) e.preventDefault();
|
28774 | if (swiper.params.preventClicksPropagation && swiper.animating) {
|
28775 | e.stopPropagation();
|
28776 | e.stopImmediatePropagation();
|
28777 | }
|
28778 | }
|
28779 | }
|
28780 |
|
28781 | function onScroll () {
|
28782 | const swiper = this;
|
28783 | const { wrapperEl, rtlTranslate } = swiper;
|
28784 | swiper.previousTranslate = swiper.translate;
|
28785 | if (swiper.isHorizontal()) {
|
28786 | if (rtlTranslate) {
|
28787 | swiper.translate = ((wrapperEl.scrollWidth - wrapperEl.offsetWidth) - wrapperEl.scrollLeft);
|
28788 | } else {
|
28789 | swiper.translate = -wrapperEl.scrollLeft;
|
28790 | }
|
28791 | } else {
|
28792 | swiper.translate = -wrapperEl.scrollTop;
|
28793 | }
|
28794 |
|
28795 | if (swiper.translate === -0) swiper.translate = 0;
|
28796 |
|
28797 | swiper.updateActiveIndex();
|
28798 | swiper.updateSlidesClasses();
|
28799 |
|
28800 | let newProgress;
|
28801 | const translatesDiff = swiper.maxTranslate() - swiper.minTranslate();
|
28802 | if (translatesDiff === 0) {
|
28803 | newProgress = 0;
|
28804 | } else {
|
28805 | newProgress = (swiper.translate - swiper.minTranslate()) / (translatesDiff);
|
28806 | }
|
28807 | if (newProgress !== swiper.progress) {
|
28808 | swiper.updateProgress(rtlTranslate ? -swiper.translate : swiper.translate);
|
28809 | }
|
28810 |
|
28811 | swiper.emit('setTranslate', swiper.translate, false);
|
28812 | }
|
28813 |
|
28814 | let dummyEventAttached = false;
|
28815 | function dummyEventListener() {}
|
28816 |
|
28817 | function attachEvents() {
|
28818 | const swiper = this;
|
28819 | const {
|
28820 | params, touchEvents, el, wrapperEl,
|
28821 | } = swiper;
|
28822 |
|
28823 | swiper.onTouchStart = onTouchStart.bind(swiper);
|
28824 | swiper.onTouchMove = onTouchMove.bind(swiper);
|
28825 | swiper.onTouchEnd = onTouchEnd.bind(swiper);
|
28826 | if (params.cssMode) {
|
28827 | swiper.onScroll = onScroll.bind(swiper);
|
28828 | }
|
28829 |
|
28830 | swiper.onClick = onClick.bind(swiper);
|
28831 |
|
28832 | const capture = !!params.nested;
|
28833 |
|
28834 |
|
28835 | if (!Support.touch && Support.pointerEvents) {
|
28836 | el.addEventListener(touchEvents.start, swiper.onTouchStart, false);
|
28837 | doc.addEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
28838 | doc.addEventListener(touchEvents.end, swiper.onTouchEnd, false);
|
28839 | } else {
|
28840 | if (Support.touch) {
|
28841 | const passiveListener = touchEvents.start === 'touchstart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
28842 | el.addEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
|
28843 | el.addEventListener(touchEvents.move, swiper.onTouchMove, Support.passiveListener ? { passive: false, capture } : capture);
|
28844 | el.addEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
|
28845 | if (touchEvents.cancel) {
|
28846 | el.addEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
28847 | }
|
28848 | if (!dummyEventAttached) {
|
28849 | doc.addEventListener('touchstart', dummyEventListener);
|
28850 | dummyEventAttached = true;
|
28851 | }
|
28852 | }
|
28853 | if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {
|
28854 | el.addEventListener('mousedown', swiper.onTouchStart, false);
|
28855 | doc.addEventListener('mousemove', swiper.onTouchMove, capture);
|
28856 | doc.addEventListener('mouseup', swiper.onTouchEnd, false);
|
28857 | }
|
28858 | }
|
28859 |
|
28860 | if (params.preventClicks || params.preventClicksPropagation) {
|
28861 | el.addEventListener('click', swiper.onClick, true);
|
28862 | }
|
28863 | if (params.cssMode) {
|
28864 | wrapperEl.addEventListener('scroll', swiper.onScroll);
|
28865 | }
|
28866 |
|
28867 |
|
28868 | if (params.updateOnWindowResize) {
|
28869 | swiper.on((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize, true);
|
28870 | } else {
|
28871 | swiper.on('observerUpdate', onResize, true);
|
28872 | }
|
28873 | }
|
28874 |
|
28875 | function detachEvents() {
|
28876 | const swiper = this;
|
28877 |
|
28878 | const {
|
28879 | params, touchEvents, el, wrapperEl,
|
28880 | } = swiper;
|
28881 |
|
28882 | const capture = !!params.nested;
|
28883 |
|
28884 |
|
28885 | if (!Support.touch && Support.pointerEvents) {
|
28886 | el.removeEventListener(touchEvents.start, swiper.onTouchStart, false);
|
28887 | doc.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
28888 | doc.removeEventListener(touchEvents.end, swiper.onTouchEnd, false);
|
28889 | } else {
|
28890 | if (Support.touch) {
|
28891 | const passiveListener = touchEvents.start === 'onTouchStart' && Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
28892 | el.removeEventListener(touchEvents.start, swiper.onTouchStart, passiveListener);
|
28893 | el.removeEventListener(touchEvents.move, swiper.onTouchMove, capture);
|
28894 | el.removeEventListener(touchEvents.end, swiper.onTouchEnd, passiveListener);
|
28895 | if (touchEvents.cancel) {
|
28896 | el.removeEventListener(touchEvents.cancel, swiper.onTouchEnd, passiveListener);
|
28897 | }
|
28898 | }
|
28899 | if ((params.simulateTouch && !Device.ios && !Device.android) || (params.simulateTouch && !Support.touch && Device.ios)) {
|
28900 | el.removeEventListener('mousedown', swiper.onTouchStart, false);
|
28901 | doc.removeEventListener('mousemove', swiper.onTouchMove, capture);
|
28902 | doc.removeEventListener('mouseup', swiper.onTouchEnd, false);
|
28903 | }
|
28904 | }
|
28905 |
|
28906 | if (params.preventClicks || params.preventClicksPropagation) {
|
28907 | el.removeEventListener('click', swiper.onClick, true);
|
28908 | }
|
28909 |
|
28910 | if (params.cssMode) {
|
28911 | wrapperEl.removeEventListener('scroll', swiper.onScroll);
|
28912 | }
|
28913 |
|
28914 |
|
28915 | swiper.off((Device.ios || Device.android ? 'resize orientationchange observerUpdate' : 'resize observerUpdate'), onResize);
|
28916 | }
|
28917 |
|
28918 | var events = {
|
28919 | attachEvents,
|
28920 | detachEvents,
|
28921 | };
|
28922 |
|
28923 | function setBreakpoint () {
|
28924 | const swiper = this;
|
28925 | const {
|
28926 | activeIndex, initialized, loopedSlides = 0, params, $el,
|
28927 | } = swiper;
|
28928 | const breakpoints = params.breakpoints;
|
28929 | if (!breakpoints || (breakpoints && Object.keys(breakpoints).length === 0)) return;
|
28930 |
|
28931 |
|
28932 | const breakpoint = swiper.getBreakpoint(breakpoints);
|
28933 |
|
28934 | if (breakpoint && swiper.currentBreakpoint !== breakpoint) {
|
28935 | const breakpointOnlyParams = breakpoint in breakpoints ? breakpoints[breakpoint] : undefined;
|
28936 | if (breakpointOnlyParams) {
|
28937 | ['slidesPerView', 'spaceBetween', 'slidesPerGroup', 'slidesPerGroupSkip', 'slidesPerColumn'].forEach((param) => {
|
28938 | const paramValue = breakpointOnlyParams[param];
|
28939 | if (typeof paramValue === 'undefined') return;
|
28940 | if (param === 'slidesPerView' && (paramValue === 'AUTO' || paramValue === 'auto')) {
|
28941 | breakpointOnlyParams[param] = 'auto';
|
28942 | } else if (param === 'slidesPerView') {
|
28943 | breakpointOnlyParams[param] = parseFloat(paramValue);
|
28944 | } else {
|
28945 | breakpointOnlyParams[param] = parseInt(paramValue, 10);
|
28946 | }
|
28947 | });
|
28948 | }
|
28949 |
|
28950 | const breakpointParams = breakpointOnlyParams || swiper.originalParams;
|
28951 | const wasMultiRow = params.slidesPerColumn > 1;
|
28952 | const isMultiRow = breakpointParams.slidesPerColumn > 1;
|
28953 | if (wasMultiRow && !isMultiRow) {
|
28954 | $el.removeClass(`${params.containerModifierClass}multirow ${params.containerModifierClass}multirow-column`);
|
28955 | } else if (!wasMultiRow && isMultiRow) {
|
28956 | $el.addClass(`${params.containerModifierClass}multirow`);
|
28957 | if (breakpointParams.slidesPerColumnFill === 'column') {
|
28958 | $el.addClass(`${params.containerModifierClass}multirow-column`);
|
28959 | }
|
28960 | }
|
28961 |
|
28962 | const directionChanged = breakpointParams.direction && breakpointParams.direction !== params.direction;
|
28963 | const needsReLoop = params.loop && (breakpointParams.slidesPerView !== params.slidesPerView || directionChanged);
|
28964 |
|
28965 | if (directionChanged && initialized) {
|
28966 | swiper.changeDirection();
|
28967 | }
|
28968 |
|
28969 | Utils.extend(swiper.params, breakpointParams);
|
28970 |
|
28971 | Utils.extend(swiper, {
|
28972 | allowTouchMove: swiper.params.allowTouchMove,
|
28973 | allowSlideNext: swiper.params.allowSlideNext,
|
28974 | allowSlidePrev: swiper.params.allowSlidePrev,
|
28975 | });
|
28976 |
|
28977 | swiper.currentBreakpoint = breakpoint;
|
28978 |
|
28979 | if (needsReLoop && initialized) {
|
28980 | swiper.loopDestroy();
|
28981 | swiper.loopCreate();
|
28982 | swiper.updateSlides();
|
28983 | swiper.slideTo((activeIndex - loopedSlides) + swiper.loopedSlides, 0, false);
|
28984 | }
|
28985 |
|
28986 | swiper.emit('breakpoint', breakpointParams);
|
28987 | }
|
28988 | }
|
28989 |
|
28990 | function getBreakpoint (breakpoints) {
|
28991 |
|
28992 | if (!breakpoints) return undefined;
|
28993 | let breakpoint = false;
|
28994 |
|
28995 | const points = Object.keys(breakpoints).map((point) => {
|
28996 | if (typeof point === 'string' && point.indexOf('@') === 0) {
|
28997 | const minRatio = parseFloat(point.substr(1));
|
28998 | const value = win.innerHeight * minRatio;
|
28999 | return { value, point };
|
29000 | }
|
29001 | return { value: point, point };
|
29002 | });
|
29003 |
|
29004 | points.sort((a, b) => parseInt(a.value, 10) - parseInt(b.value, 10));
|
29005 | for (let i = 0; i < points.length; i += 1) {
|
29006 | const { point, value } = points[i];
|
29007 | if (value <= win.innerWidth) {
|
29008 | breakpoint = point;
|
29009 | }
|
29010 | }
|
29011 | return breakpoint || 'max';
|
29012 | }
|
29013 |
|
29014 | var breakpoints = { setBreakpoint, getBreakpoint };
|
29015 |
|
29016 | function addClasses () {
|
29017 | const swiper = this;
|
29018 | const {
|
29019 | classNames, params, rtl, $el,
|
29020 | } = swiper;
|
29021 | const suffixes = [];
|
29022 |
|
29023 | suffixes.push('initialized');
|
29024 | suffixes.push(params.direction);
|
29025 |
|
29026 | if (params.freeMode) {
|
29027 | suffixes.push('free-mode');
|
29028 | }
|
29029 | if (params.autoHeight) {
|
29030 | suffixes.push('autoheight');
|
29031 | }
|
29032 | if (rtl) {
|
29033 | suffixes.push('rtl');
|
29034 | }
|
29035 | if (params.slidesPerColumn > 1) {
|
29036 | suffixes.push('multirow');
|
29037 | if (params.slidesPerColumnFill === 'column') {
|
29038 | suffixes.push('multirow-column');
|
29039 | }
|
29040 | }
|
29041 | if (Device.android) {
|
29042 | suffixes.push('android');
|
29043 | }
|
29044 | if (Device.ios) {
|
29045 | suffixes.push('ios');
|
29046 | }
|
29047 |
|
29048 | if (params.cssMode) {
|
29049 | suffixes.push('css-mode');
|
29050 | }
|
29051 |
|
29052 | suffixes.forEach((suffix) => {
|
29053 | classNames.push(params.containerModifierClass + suffix);
|
29054 | });
|
29055 |
|
29056 | $el.addClass(classNames.join(' '));
|
29057 | }
|
29058 |
|
29059 | function removeClasses () {
|
29060 | const swiper = this;
|
29061 | const { $el, classNames } = swiper;
|
29062 |
|
29063 | $el.removeClass(classNames.join(' '));
|
29064 | }
|
29065 |
|
29066 | var classes = { addClasses, removeClasses };
|
29067 |
|
29068 | function loadImage (imageEl, src, srcset, sizes, checkForComplete, callback) {
|
29069 | let image;
|
29070 | function onReady() {
|
29071 | if (callback) callback();
|
29072 | }
|
29073 | const isPicture = $(imageEl).parent('picture')[0];
|
29074 |
|
29075 | if (!isPicture && (!imageEl.complete || !checkForComplete)) {
|
29076 | if (src) {
|
29077 | image = new win.Image();
|
29078 | image.onload = onReady;
|
29079 | image.onerror = onReady;
|
29080 | if (sizes) {
|
29081 | image.sizes = sizes;
|
29082 | }
|
29083 | if (srcset) {
|
29084 | image.srcset = srcset;
|
29085 | }
|
29086 | if (src) {
|
29087 | image.src = src;
|
29088 | }
|
29089 | } else {
|
29090 | onReady();
|
29091 | }
|
29092 | } else {
|
29093 |
|
29094 | onReady();
|
29095 | }
|
29096 | }
|
29097 |
|
29098 | function preloadImages () {
|
29099 | const swiper = this;
|
29100 | swiper.imagesToLoad = swiper.$el.find('img');
|
29101 | function onReady() {
|
29102 | if (typeof swiper === 'undefined' || swiper === null || !swiper || swiper.destroyed) return;
|
29103 | if (swiper.imagesLoaded !== undefined) swiper.imagesLoaded += 1;
|
29104 | if (swiper.imagesLoaded === swiper.imagesToLoad.length) {
|
29105 | if (swiper.params.updateOnImagesReady) swiper.update();
|
29106 | swiper.emit('imagesReady');
|
29107 | }
|
29108 | }
|
29109 | for (let i = 0; i < swiper.imagesToLoad.length; i += 1) {
|
29110 | const imageEl = swiper.imagesToLoad[i];
|
29111 | swiper.loadImage(
|
29112 | imageEl,
|
29113 | imageEl.currentSrc || imageEl.getAttribute('src'),
|
29114 | imageEl.srcset || imageEl.getAttribute('srcset'),
|
29115 | imageEl.sizes || imageEl.getAttribute('sizes'),
|
29116 | true,
|
29117 | onReady
|
29118 | );
|
29119 | }
|
29120 | }
|
29121 |
|
29122 | var images = {
|
29123 | loadImage,
|
29124 | preloadImages,
|
29125 | };
|
29126 |
|
29127 | function checkOverflow() {
|
29128 | const swiper = this;
|
29129 | const params = swiper.params;
|
29130 | const wasLocked = swiper.isLocked;
|
29131 | const lastSlidePosition = swiper.slides.length > 0 && (params.slidesOffsetBefore + (params.spaceBetween * (swiper.slides.length - 1)) + ((swiper.slides[0]).offsetWidth) * swiper.slides.length);
|
29132 |
|
29133 | if (params.slidesOffsetBefore && params.slidesOffsetAfter && lastSlidePosition) {
|
29134 | swiper.isLocked = lastSlidePosition <= swiper.size;
|
29135 | } else {
|
29136 | swiper.isLocked = swiper.snapGrid.length === 1;
|
29137 | }
|
29138 |
|
29139 | swiper.allowSlideNext = !swiper.isLocked;
|
29140 | swiper.allowSlidePrev = !swiper.isLocked;
|
29141 |
|
29142 |
|
29143 | if (wasLocked !== swiper.isLocked) swiper.emit(swiper.isLocked ? 'lock' : 'unlock');
|
29144 |
|
29145 | if (wasLocked && wasLocked !== swiper.isLocked) {
|
29146 | swiper.isEnd = false;
|
29147 | swiper.navigation.update();
|
29148 | }
|
29149 | }
|
29150 |
|
29151 | var checkOverflow$1 = { checkOverflow };
|
29152 |
|
29153 | var defaults = {
|
29154 | init: true,
|
29155 | direction: 'horizontal',
|
29156 | touchEventsTarget: 'container',
|
29157 | initialSlide: 0,
|
29158 | speed: 300,
|
29159 | cssMode: false,
|
29160 | updateOnWindowResize: true,
|
29161 |
|
29162 | preventInteractionOnTransition: false,
|
29163 |
|
29164 |
|
29165 | edgeSwipeDetection: false,
|
29166 | edgeSwipeThreshold: 20,
|
29167 |
|
29168 |
|
29169 | freeMode: false,
|
29170 | freeModeMomentum: true,
|
29171 | freeModeMomentumRatio: 1,
|
29172 | freeModeMomentumBounce: true,
|
29173 | freeModeMomentumBounceRatio: 1,
|
29174 | freeModeMomentumVelocityRatio: 1,
|
29175 | freeModeSticky: false,
|
29176 | freeModeMinimumVelocity: 0.02,
|
29177 |
|
29178 |
|
29179 | autoHeight: false,
|
29180 |
|
29181 |
|
29182 | setWrapperSize: false,
|
29183 |
|
29184 |
|
29185 | virtualTranslate: false,
|
29186 |
|
29187 |
|
29188 | effect: 'slide',
|
29189 |
|
29190 |
|
29191 | breakpoints: undefined,
|
29192 |
|
29193 |
|
29194 | spaceBetween: 0,
|
29195 | slidesPerView: 1,
|
29196 | slidesPerColumn: 1,
|
29197 | slidesPerColumnFill: 'column',
|
29198 | slidesPerGroup: 1,
|
29199 | slidesPerGroupSkip: 0,
|
29200 | centeredSlides: false,
|
29201 | centeredSlidesBounds: false,
|
29202 | slidesOffsetBefore: 0,
|
29203 | slidesOffsetAfter: 0,
|
29204 | normalizeSlideIndex: true,
|
29205 | centerInsufficientSlides: false,
|
29206 |
|
29207 |
|
29208 | watchOverflow: false,
|
29209 |
|
29210 |
|
29211 | roundLengths: false,
|
29212 |
|
29213 |
|
29214 | touchRatio: 1,
|
29215 | touchAngle: 45,
|
29216 | simulateTouch: true,
|
29217 | shortSwipes: true,
|
29218 | longSwipes: true,
|
29219 | longSwipesRatio: 0.5,
|
29220 | longSwipesMs: 300,
|
29221 | followFinger: true,
|
29222 | allowTouchMove: true,
|
29223 | threshold: 0,
|
29224 | touchMoveStopPropagation: false,
|
29225 | touchStartPreventDefault: true,
|
29226 | touchStartForcePreventDefault: false,
|
29227 | touchReleaseOnEdges: false,
|
29228 |
|
29229 |
|
29230 | uniqueNavElements: true,
|
29231 |
|
29232 |
|
29233 | resistance: true,
|
29234 | resistanceRatio: 0.85,
|
29235 |
|
29236 |
|
29237 | watchSlidesProgress: false,
|
29238 | watchSlidesVisibility: false,
|
29239 |
|
29240 |
|
29241 | grabCursor: false,
|
29242 |
|
29243 |
|
29244 | preventClicks: true,
|
29245 | preventClicksPropagation: true,
|
29246 | slideToClickedSlide: false,
|
29247 |
|
29248 |
|
29249 | preloadImages: true,
|
29250 | updateOnImagesReady: true,
|
29251 |
|
29252 |
|
29253 | loop: false,
|
29254 | loopAdditionalSlides: 0,
|
29255 | loopedSlides: null,
|
29256 | loopFillGroupWithBlank: false,
|
29257 |
|
29258 |
|
29259 | allowSlidePrev: true,
|
29260 | allowSlideNext: true,
|
29261 | swipeHandler: null,
|
29262 | noSwiping: true,
|
29263 | noSwipingClass: 'swiper-no-swiping',
|
29264 | noSwipingSelector: null,
|
29265 |
|
29266 |
|
29267 | passiveListeners: true,
|
29268 |
|
29269 |
|
29270 | containerModifierClass: 'swiper-container-',
|
29271 | slideClass: 'swiper-slide',
|
29272 | slideBlankClass: 'swiper-slide-invisible-blank',
|
29273 | slideActiveClass: 'swiper-slide-active',
|
29274 | slideDuplicateActiveClass: 'swiper-slide-duplicate-active',
|
29275 | slideVisibleClass: 'swiper-slide-visible',
|
29276 | slideDuplicateClass: 'swiper-slide-duplicate',
|
29277 | slideNextClass: 'swiper-slide-next',
|
29278 | slideDuplicateNextClass: 'swiper-slide-duplicate-next',
|
29279 | slidePrevClass: 'swiper-slide-prev',
|
29280 | slideDuplicatePrevClass: 'swiper-slide-duplicate-prev',
|
29281 | wrapperClass: 'swiper-wrapper',
|
29282 |
|
29283 |
|
29284 | runCallbacksOnInit: true,
|
29285 | };
|
29286 |
|
29287 |
|
29288 |
|
29289 | const prototypes = {
|
29290 | update,
|
29291 | translate,
|
29292 | transition: transition$1,
|
29293 | slide,
|
29294 | loop,
|
29295 | grabCursor,
|
29296 | manipulation,
|
29297 | events,
|
29298 | breakpoints,
|
29299 | checkOverflow: checkOverflow$1,
|
29300 | classes,
|
29301 | images,
|
29302 | };
|
29303 |
|
29304 | const extendedDefaults = {};
|
29305 |
|
29306 | class Swiper extends SwiperClass {
|
29307 | constructor(...args) {
|
29308 | let el;
|
29309 | let params;
|
29310 | if (args.length === 1 && args[0].constructor && args[0].constructor === Object) {
|
29311 | params = args[0];
|
29312 | } else {
|
29313 | [el, params] = args;
|
29314 | }
|
29315 | if (!params) params = {};
|
29316 |
|
29317 | params = Utils.extend({}, params);
|
29318 | if (el && !params.el) params.el = el;
|
29319 |
|
29320 | super(params);
|
29321 |
|
29322 | Object.keys(prototypes).forEach((prototypeGroup) => {
|
29323 | Object.keys(prototypes[prototypeGroup]).forEach((protoMethod) => {
|
29324 | if (!Swiper.prototype[protoMethod]) {
|
29325 | Swiper.prototype[protoMethod] = prototypes[prototypeGroup][protoMethod];
|
29326 | }
|
29327 | });
|
29328 | });
|
29329 |
|
29330 |
|
29331 | const swiper = this;
|
29332 | if (typeof swiper.modules === 'undefined') {
|
29333 | swiper.modules = {};
|
29334 | }
|
29335 | Object.keys(swiper.modules).forEach((moduleName) => {
|
29336 | const module = swiper.modules[moduleName];
|
29337 | if (module.params) {
|
29338 | const moduleParamName = Object.keys(module.params)[0];
|
29339 | const moduleParams = module.params[moduleParamName];
|
29340 | if (typeof moduleParams !== 'object' || moduleParams === null) return;
|
29341 | if (!(moduleParamName in params && 'enabled' in moduleParams)) return;
|
29342 | if (params[moduleParamName] === true) {
|
29343 | params[moduleParamName] = { enabled: true };
|
29344 | }
|
29345 | if (
|
29346 | typeof params[moduleParamName] === 'object'
|
29347 | && !('enabled' in params[moduleParamName])
|
29348 | ) {
|
29349 | params[moduleParamName].enabled = true;
|
29350 | }
|
29351 | if (!params[moduleParamName]) params[moduleParamName] = { enabled: false };
|
29352 | }
|
29353 | });
|
29354 |
|
29355 |
|
29356 | const swiperParams = Utils.extend({}, defaults);
|
29357 | swiper.useModulesParams(swiperParams);
|
29358 |
|
29359 |
|
29360 | swiper.params = Utils.extend({}, swiperParams, extendedDefaults, params);
|
29361 | swiper.originalParams = Utils.extend({}, swiper.params);
|
29362 | swiper.passedParams = Utils.extend({}, params);
|
29363 |
|
29364 |
|
29365 | swiper.$ = $;
|
29366 |
|
29367 |
|
29368 | const $el = $(swiper.params.el);
|
29369 | el = $el[0];
|
29370 |
|
29371 | if (!el) {
|
29372 | return undefined;
|
29373 | }
|
29374 |
|
29375 | if ($el.length > 1) {
|
29376 | const swipers = [];
|
29377 | $el.each((index, containerEl) => {
|
29378 | const newParams = Utils.extend({}, params, { el: containerEl });
|
29379 | swipers.push(new Swiper(newParams));
|
29380 | });
|
29381 | return swipers;
|
29382 | }
|
29383 |
|
29384 | el.swiper = swiper;
|
29385 | $el.data('swiper', swiper);
|
29386 |
|
29387 |
|
29388 | let $wrapperEl;
|
29389 | if (el && el.shadowRoot && el.shadowRoot.querySelector) {
|
29390 | $wrapperEl = $(el.shadowRoot.querySelector(`.${swiper.params.wrapperClass}`));
|
29391 |
|
29392 | $wrapperEl.children = (options) => $el.children(options);
|
29393 | } else {
|
29394 | $wrapperEl = $el.children(`.${swiper.params.wrapperClass}`);
|
29395 | }
|
29396 |
|
29397 | Utils.extend(swiper, {
|
29398 | $el,
|
29399 | el,
|
29400 | $wrapperEl,
|
29401 | wrapperEl: $wrapperEl[0],
|
29402 |
|
29403 |
|
29404 | classNames: [],
|
29405 |
|
29406 |
|
29407 | slides: $(),
|
29408 | slidesGrid: [],
|
29409 | snapGrid: [],
|
29410 | slidesSizesGrid: [],
|
29411 |
|
29412 |
|
29413 | isHorizontal() {
|
29414 | return swiper.params.direction === 'horizontal';
|
29415 | },
|
29416 | isVertical() {
|
29417 | return swiper.params.direction === 'vertical';
|
29418 | },
|
29419 |
|
29420 | rtl: (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
29421 | rtlTranslate: swiper.params.direction === 'horizontal' && (el.dir.toLowerCase() === 'rtl' || $el.css('direction') === 'rtl'),
|
29422 | wrongRTL: $wrapperEl.css('display') === '-webkit-box',
|
29423 |
|
29424 |
|
29425 | activeIndex: 0,
|
29426 | realIndex: 0,
|
29427 |
|
29428 |
|
29429 | isBeginning: true,
|
29430 | isEnd: false,
|
29431 |
|
29432 |
|
29433 | translate: 0,
|
29434 | previousTranslate: 0,
|
29435 | progress: 0,
|
29436 | velocity: 0,
|
29437 | animating: false,
|
29438 |
|
29439 |
|
29440 | allowSlideNext: swiper.params.allowSlideNext,
|
29441 | allowSlidePrev: swiper.params.allowSlidePrev,
|
29442 |
|
29443 |
|
29444 | touchEvents: (function touchEvents() {
|
29445 | const touch = ['touchstart', 'touchmove', 'touchend', 'touchcancel'];
|
29446 | let desktop = ['mousedown', 'mousemove', 'mouseup'];
|
29447 | if (Support.pointerEvents) {
|
29448 | desktop = ['pointerdown', 'pointermove', 'pointerup'];
|
29449 | }
|
29450 | swiper.touchEventsTouch = {
|
29451 | start: touch[0],
|
29452 | move: touch[1],
|
29453 | end: touch[2],
|
29454 | cancel: touch[3],
|
29455 | };
|
29456 | swiper.touchEventsDesktop = {
|
29457 | start: desktop[0],
|
29458 | move: desktop[1],
|
29459 | end: desktop[2],
|
29460 | };
|
29461 | return Support.touch || !swiper.params.simulateTouch ? swiper.touchEventsTouch : swiper.touchEventsDesktop;
|
29462 | }()),
|
29463 | touchEventsData: {
|
29464 | isTouched: undefined,
|
29465 | isMoved: undefined,
|
29466 | allowTouchCallbacks: undefined,
|
29467 | touchStartTime: undefined,
|
29468 | isScrolling: undefined,
|
29469 | currentTranslate: undefined,
|
29470 | startTranslate: undefined,
|
29471 | allowThresholdMove: undefined,
|
29472 |
|
29473 | formElements: 'input, select, option, textarea, button, video, label',
|
29474 |
|
29475 | lastClickTime: Utils.now(),
|
29476 | clickTimeout: undefined,
|
29477 |
|
29478 | velocities: [],
|
29479 | allowMomentumBounce: undefined,
|
29480 | isTouchEvent: undefined,
|
29481 | startMoving: undefined,
|
29482 | },
|
29483 |
|
29484 |
|
29485 | allowClick: true,
|
29486 |
|
29487 |
|
29488 | allowTouchMove: swiper.params.allowTouchMove,
|
29489 |
|
29490 | touches: {
|
29491 | startX: 0,
|
29492 | startY: 0,
|
29493 | currentX: 0,
|
29494 | currentY: 0,
|
29495 | diff: 0,
|
29496 | },
|
29497 |
|
29498 |
|
29499 | imagesToLoad: [],
|
29500 | imagesLoaded: 0,
|
29501 |
|
29502 | });
|
29503 |
|
29504 |
|
29505 | swiper.useModules();
|
29506 |
|
29507 |
|
29508 | if (swiper.params.init) {
|
29509 | swiper.init();
|
29510 | }
|
29511 |
|
29512 |
|
29513 | return swiper;
|
29514 | }
|
29515 |
|
29516 | slidesPerViewDynamic() {
|
29517 | const swiper = this;
|
29518 | const {
|
29519 | params, slides, slidesGrid, size: swiperSize, activeIndex,
|
29520 | } = swiper;
|
29521 | let spv = 1;
|
29522 | if (params.centeredSlides) {
|
29523 | let slideSize = slides[activeIndex].swiperSlideSize;
|
29524 | let breakLoop;
|
29525 | for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
29526 | if (slides[i] && !breakLoop) {
|
29527 | slideSize += slides[i].swiperSlideSize;
|
29528 | spv += 1;
|
29529 | if (slideSize > swiperSize) breakLoop = true;
|
29530 | }
|
29531 | }
|
29532 | for (let i = activeIndex - 1; i >= 0; i -= 1) {
|
29533 | if (slides[i] && !breakLoop) {
|
29534 | slideSize += slides[i].swiperSlideSize;
|
29535 | spv += 1;
|
29536 | if (slideSize > swiperSize) breakLoop = true;
|
29537 | }
|
29538 | }
|
29539 | } else {
|
29540 | for (let i = activeIndex + 1; i < slides.length; i += 1) {
|
29541 | if (slidesGrid[i] - slidesGrid[activeIndex] < swiperSize) {
|
29542 | spv += 1;
|
29543 | }
|
29544 | }
|
29545 | }
|
29546 | return spv;
|
29547 | }
|
29548 |
|
29549 | update() {
|
29550 | const swiper = this;
|
29551 | if (!swiper || swiper.destroyed) return;
|
29552 | const { snapGrid, params } = swiper;
|
29553 |
|
29554 | if (params.breakpoints) {
|
29555 | swiper.setBreakpoint();
|
29556 | }
|
29557 | swiper.updateSize();
|
29558 | swiper.updateSlides();
|
29559 | swiper.updateProgress();
|
29560 | swiper.updateSlidesClasses();
|
29561 |
|
29562 | function setTranslate() {
|
29563 | const translateValue = swiper.rtlTranslate ? swiper.translate * -1 : swiper.translate;
|
29564 | const newTranslate = Math.min(Math.max(translateValue, swiper.maxTranslate()), swiper.minTranslate());
|
29565 | swiper.setTranslate(newTranslate);
|
29566 | swiper.updateActiveIndex();
|
29567 | swiper.updateSlidesClasses();
|
29568 | }
|
29569 | let translated;
|
29570 | if (swiper.params.freeMode) {
|
29571 | setTranslate();
|
29572 | if (swiper.params.autoHeight) {
|
29573 | swiper.updateAutoHeight();
|
29574 | }
|
29575 | } else {
|
29576 | if ((swiper.params.slidesPerView === 'auto' || swiper.params.slidesPerView > 1) && swiper.isEnd && !swiper.params.centeredSlides) {
|
29577 | translated = swiper.slideTo(swiper.slides.length - 1, 0, false, true);
|
29578 | } else {
|
29579 | translated = swiper.slideTo(swiper.activeIndex, 0, false, true);
|
29580 | }
|
29581 | if (!translated) {
|
29582 | setTranslate();
|
29583 | }
|
29584 | }
|
29585 | if (params.watchOverflow && snapGrid !== swiper.snapGrid) {
|
29586 | swiper.checkOverflow();
|
29587 | }
|
29588 | swiper.emit('update');
|
29589 | }
|
29590 |
|
29591 | changeDirection(newDirection, needUpdate = true) {
|
29592 | const swiper = this;
|
29593 | const currentDirection = swiper.params.direction;
|
29594 | if (!newDirection) {
|
29595 |
|
29596 | newDirection = currentDirection === 'horizontal' ? 'vertical' : 'horizontal';
|
29597 | }
|
29598 | if ((newDirection === currentDirection) || (newDirection !== 'horizontal' && newDirection !== 'vertical')) {
|
29599 | return swiper;
|
29600 | }
|
29601 |
|
29602 | swiper.$el
|
29603 | .removeClass(`${swiper.params.containerModifierClass}${currentDirection}`)
|
29604 | .addClass(`${swiper.params.containerModifierClass}${newDirection}`);
|
29605 |
|
29606 | swiper.params.direction = newDirection;
|
29607 |
|
29608 | swiper.slides.each((slideIndex, slideEl) => {
|
29609 | if (newDirection === 'vertical') {
|
29610 | slideEl.style.width = '';
|
29611 | } else {
|
29612 | slideEl.style.height = '';
|
29613 | }
|
29614 | });
|
29615 |
|
29616 | swiper.emit('changeDirection');
|
29617 | if (needUpdate) swiper.update();
|
29618 |
|
29619 | return swiper;
|
29620 | }
|
29621 |
|
29622 | init() {
|
29623 | const swiper = this;
|
29624 | if (swiper.initialized) return;
|
29625 |
|
29626 | swiper.emit('beforeInit');
|
29627 |
|
29628 |
|
29629 | if (swiper.params.breakpoints) {
|
29630 | swiper.setBreakpoint();
|
29631 | }
|
29632 |
|
29633 |
|
29634 | swiper.addClasses();
|
29635 |
|
29636 |
|
29637 | if (swiper.params.loop) {
|
29638 | swiper.loopCreate();
|
29639 | }
|
29640 |
|
29641 |
|
29642 | swiper.updateSize();
|
29643 |
|
29644 |
|
29645 | swiper.updateSlides();
|
29646 |
|
29647 | if (swiper.params.watchOverflow) {
|
29648 | swiper.checkOverflow();
|
29649 | }
|
29650 |
|
29651 |
|
29652 | if (swiper.params.grabCursor) {
|
29653 | swiper.setGrabCursor();
|
29654 | }
|
29655 |
|
29656 | if (swiper.params.preloadImages) {
|
29657 | swiper.preloadImages();
|
29658 | }
|
29659 |
|
29660 |
|
29661 | if (swiper.params.loop) {
|
29662 | swiper.slideTo(swiper.params.initialSlide + swiper.loopedSlides, 0, swiper.params.runCallbacksOnInit);
|
29663 | } else {
|
29664 | swiper.slideTo(swiper.params.initialSlide, 0, swiper.params.runCallbacksOnInit);
|
29665 | }
|
29666 |
|
29667 |
|
29668 | swiper.attachEvents();
|
29669 |
|
29670 |
|
29671 | swiper.initialized = true;
|
29672 |
|
29673 |
|
29674 | swiper.emit('init');
|
29675 | }
|
29676 |
|
29677 | destroy(deleteInstance = true, cleanStyles = true) {
|
29678 | const swiper = this;
|
29679 | const {
|
29680 | params, $el, $wrapperEl, slides,
|
29681 | } = swiper;
|
29682 |
|
29683 | if (typeof swiper.params === 'undefined' || swiper.destroyed) {
|
29684 | return null;
|
29685 | }
|
29686 |
|
29687 | swiper.emit('beforeDestroy');
|
29688 |
|
29689 |
|
29690 | swiper.initialized = false;
|
29691 |
|
29692 |
|
29693 | swiper.detachEvents();
|
29694 |
|
29695 |
|
29696 | if (params.loop) {
|
29697 | swiper.loopDestroy();
|
29698 | }
|
29699 |
|
29700 |
|
29701 | if (cleanStyles) {
|
29702 | swiper.removeClasses();
|
29703 | $el.removeAttr('style');
|
29704 | $wrapperEl.removeAttr('style');
|
29705 | if (slides && slides.length) {
|
29706 | slides
|
29707 | .removeClass([
|
29708 | params.slideVisibleClass,
|
29709 | params.slideActiveClass,
|
29710 | params.slideNextClass,
|
29711 | params.slidePrevClass,
|
29712 | ].join(' '))
|
29713 | .removeAttr('style')
|
29714 | .removeAttr('data-swiper-slide-index');
|
29715 | }
|
29716 | }
|
29717 |
|
29718 | swiper.emit('destroy');
|
29719 |
|
29720 |
|
29721 | Object.keys(swiper.eventsListeners).forEach((eventName) => {
|
29722 | swiper.off(eventName);
|
29723 | });
|
29724 |
|
29725 | if (deleteInstance !== false) {
|
29726 | swiper.$el[0].swiper = null;
|
29727 | swiper.$el.data('swiper', null);
|
29728 | Utils.deleteProps(swiper);
|
29729 | }
|
29730 | swiper.destroyed = true;
|
29731 |
|
29732 | return null;
|
29733 | }
|
29734 |
|
29735 | static extendDefaults(newDefaults) {
|
29736 | Utils.extend(extendedDefaults, newDefaults);
|
29737 | }
|
29738 |
|
29739 | static get extendedDefaults() {
|
29740 | return extendedDefaults;
|
29741 | }
|
29742 |
|
29743 | static get defaults() {
|
29744 | return defaults;
|
29745 | }
|
29746 |
|
29747 | static get Class() {
|
29748 | return SwiperClass;
|
29749 | }
|
29750 |
|
29751 | static get $() {
|
29752 | return $;
|
29753 | }
|
29754 | }
|
29755 |
|
29756 | var Device$1 = {
|
29757 | name: 'device',
|
29758 | proto: {
|
29759 | device: Device,
|
29760 | },
|
29761 | static: {
|
29762 | device: Device,
|
29763 | },
|
29764 | };
|
29765 |
|
29766 | var Support$1 = {
|
29767 | name: 'support',
|
29768 | proto: {
|
29769 | support: Support,
|
29770 | },
|
29771 | static: {
|
29772 | support: Support,
|
29773 | },
|
29774 | };
|
29775 |
|
29776 | const Browser = (function Browser() {
|
29777 | function isSafari() {
|
29778 | const ua = win.navigator.userAgent.toLowerCase();
|
29779 | return (ua.indexOf('safari') >= 0 && ua.indexOf('chrome') < 0 && ua.indexOf('android') < 0);
|
29780 | }
|
29781 | return {
|
29782 | isEdge: !!win.navigator.userAgent.match(/Edge/g),
|
29783 | isSafari: isSafari(),
|
29784 | isUiWebView: /(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(win.navigator.userAgent),
|
29785 | };
|
29786 | }());
|
29787 |
|
29788 | var Browser$1 = {
|
29789 | name: 'browser',
|
29790 | proto: {
|
29791 | browser: Browser,
|
29792 | },
|
29793 | static: {
|
29794 | browser: Browser,
|
29795 | },
|
29796 | };
|
29797 |
|
29798 | var Resize = {
|
29799 | name: 'resize',
|
29800 | create() {
|
29801 | const swiper = this;
|
29802 | Utils.extend(swiper, {
|
29803 | resize: {
|
29804 | resizeHandler() {
|
29805 | if (!swiper || swiper.destroyed || !swiper.initialized) return;
|
29806 | swiper.emit('beforeResize');
|
29807 | swiper.emit('resize');
|
29808 | },
|
29809 | orientationChangeHandler() {
|
29810 | if (!swiper || swiper.destroyed || !swiper.initialized) return;
|
29811 | swiper.emit('orientationchange');
|
29812 | },
|
29813 | },
|
29814 | });
|
29815 | },
|
29816 | on: {
|
29817 | init() {
|
29818 | const swiper = this;
|
29819 |
|
29820 | win.addEventListener('resize', swiper.resize.resizeHandler);
|
29821 |
|
29822 |
|
29823 | win.addEventListener('orientationchange', swiper.resize.orientationChangeHandler);
|
29824 | },
|
29825 | destroy() {
|
29826 | const swiper = this;
|
29827 | win.removeEventListener('resize', swiper.resize.resizeHandler);
|
29828 | win.removeEventListener('orientationchange', swiper.resize.orientationChangeHandler);
|
29829 | },
|
29830 | },
|
29831 | };
|
29832 |
|
29833 | const Observer = {
|
29834 | func: win.MutationObserver || win.WebkitMutationObserver,
|
29835 | attach(target, options = {}) {
|
29836 | const swiper = this;
|
29837 |
|
29838 | const ObserverFunc = Observer.func;
|
29839 | const observer = new ObserverFunc((mutations) => {
|
29840 |
|
29841 |
|
29842 |
|
29843 | if (mutations.length === 1) {
|
29844 | swiper.emit('observerUpdate', mutations[0]);
|
29845 | return;
|
29846 | }
|
29847 | const observerUpdate = function observerUpdate() {
|
29848 | swiper.emit('observerUpdate', mutations[0]);
|
29849 | };
|
29850 |
|
29851 | if (win.requestAnimationFrame) {
|
29852 | win.requestAnimationFrame(observerUpdate);
|
29853 | } else {
|
29854 | win.setTimeout(observerUpdate, 0);
|
29855 | }
|
29856 | });
|
29857 |
|
29858 | observer.observe(target, {
|
29859 | attributes: typeof options.attributes === 'undefined' ? true : options.attributes,
|
29860 | childList: typeof options.childList === 'undefined' ? true : options.childList,
|
29861 | characterData: typeof options.characterData === 'undefined' ? true : options.characterData,
|
29862 | });
|
29863 |
|
29864 | swiper.observer.observers.push(observer);
|
29865 | },
|
29866 | init() {
|
29867 | const swiper = this;
|
29868 | if (!Support.observer || !swiper.params.observer) return;
|
29869 | if (swiper.params.observeParents) {
|
29870 | const containerParents = swiper.$el.parents();
|
29871 | for (let i = 0; i < containerParents.length; i += 1) {
|
29872 | swiper.observer.attach(containerParents[i]);
|
29873 | }
|
29874 | }
|
29875 |
|
29876 | swiper.observer.attach(swiper.$el[0], { childList: swiper.params.observeSlideChildren });
|
29877 |
|
29878 |
|
29879 | swiper.observer.attach(swiper.$wrapperEl[0], { attributes: false });
|
29880 | },
|
29881 | destroy() {
|
29882 | const swiper = this;
|
29883 | swiper.observer.observers.forEach((observer) => {
|
29884 | observer.disconnect();
|
29885 | });
|
29886 | swiper.observer.observers = [];
|
29887 | },
|
29888 | };
|
29889 |
|
29890 | var Observer$1 = {
|
29891 | name: 'observer',
|
29892 | params: {
|
29893 | observer: false,
|
29894 | observeParents: false,
|
29895 | observeSlideChildren: false,
|
29896 | },
|
29897 | create() {
|
29898 | const swiper = this;
|
29899 | Utils.extend(swiper, {
|
29900 | observer: {
|
29901 | init: Observer.init.bind(swiper),
|
29902 | attach: Observer.attach.bind(swiper),
|
29903 | destroy: Observer.destroy.bind(swiper),
|
29904 | observers: [],
|
29905 | },
|
29906 | });
|
29907 | },
|
29908 | on: {
|
29909 | init() {
|
29910 | const swiper = this;
|
29911 | swiper.observer.init();
|
29912 | },
|
29913 | destroy() {
|
29914 | const swiper = this;
|
29915 | swiper.observer.destroy();
|
29916 | },
|
29917 | },
|
29918 | };
|
29919 |
|
29920 | const Keyboard = {
|
29921 | handle(event) {
|
29922 | const swiper = this;
|
29923 | const { rtlTranslate: rtl } = swiper;
|
29924 | let e = event;
|
29925 | if (e.originalEvent) e = e.originalEvent;
|
29926 | const kc = e.keyCode || e.charCode;
|
29927 |
|
29928 | if (!swiper.allowSlideNext && ((swiper.isHorizontal() && kc === 39) || (swiper.isVertical() && kc === 40) || kc === 34)) {
|
29929 | return false;
|
29930 | }
|
29931 | if (!swiper.allowSlidePrev && ((swiper.isHorizontal() && kc === 37) || (swiper.isVertical() && kc === 38) || kc === 33)) {
|
29932 | return false;
|
29933 | }
|
29934 | if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey) {
|
29935 | return undefined;
|
29936 | }
|
29937 | if (doc.activeElement && doc.activeElement.nodeName && (doc.activeElement.nodeName.toLowerCase() === 'input' || doc.activeElement.nodeName.toLowerCase() === 'textarea')) {
|
29938 | return undefined;
|
29939 | }
|
29940 | if (swiper.params.keyboard.onlyInViewport && (kc === 33 || kc === 34 || kc === 37 || kc === 39 || kc === 38 || kc === 40)) {
|
29941 | let inView = false;
|
29942 |
|
29943 | if (swiper.$el.parents(`.${swiper.params.slideClass}`).length > 0 && swiper.$el.parents(`.${swiper.params.slideActiveClass}`).length === 0) {
|
29944 | return undefined;
|
29945 | }
|
29946 | const windowWidth = win.innerWidth;
|
29947 | const windowHeight = win.innerHeight;
|
29948 | const swiperOffset = swiper.$el.offset();
|
29949 | if (rtl) swiperOffset.left -= swiper.$el[0].scrollLeft;
|
29950 | const swiperCoord = [
|
29951 | [swiperOffset.left, swiperOffset.top],
|
29952 | [swiperOffset.left + swiper.width, swiperOffset.top],
|
29953 | [swiperOffset.left, swiperOffset.top + swiper.height],
|
29954 | [swiperOffset.left + swiper.width, swiperOffset.top + swiper.height],
|
29955 | ];
|
29956 | for (let i = 0; i < swiperCoord.length; i += 1) {
|
29957 | const point = swiperCoord[i];
|
29958 | if (
|
29959 | point[0] >= 0 && point[0] <= windowWidth
|
29960 | && point[1] >= 0 && point[1] <= windowHeight
|
29961 | ) {
|
29962 | inView = true;
|
29963 | }
|
29964 | }
|
29965 | if (!inView) return undefined;
|
29966 | }
|
29967 | if (swiper.isHorizontal()) {
|
29968 | if (kc === 33 || kc === 34 || kc === 37 || kc === 39) {
|
29969 | if (e.preventDefault) e.preventDefault();
|
29970 | else e.returnValue = false;
|
29971 | }
|
29972 | if (((kc === 34 || kc === 39) && !rtl) || ((kc === 33 || kc === 37) && rtl)) swiper.slideNext();
|
29973 | if (((kc === 33 || kc === 37) && !rtl) || ((kc === 34 || kc === 39) && rtl)) swiper.slidePrev();
|
29974 | } else {
|
29975 | if (kc === 33 || kc === 34 || kc === 38 || kc === 40) {
|
29976 | if (e.preventDefault) e.preventDefault();
|
29977 | else e.returnValue = false;
|
29978 | }
|
29979 | if (kc === 34 || kc === 40) swiper.slideNext();
|
29980 | if (kc === 33 || kc === 38) swiper.slidePrev();
|
29981 | }
|
29982 | swiper.emit('keyPress', kc);
|
29983 | return undefined;
|
29984 | },
|
29985 | enable() {
|
29986 | const swiper = this;
|
29987 | if (swiper.keyboard.enabled) return;
|
29988 | $(doc).on('keydown', swiper.keyboard.handle);
|
29989 | swiper.keyboard.enabled = true;
|
29990 | },
|
29991 | disable() {
|
29992 | const swiper = this;
|
29993 | if (!swiper.keyboard.enabled) return;
|
29994 | $(doc).off('keydown', swiper.keyboard.handle);
|
29995 | swiper.keyboard.enabled = false;
|
29996 | },
|
29997 | };
|
29998 |
|
29999 | var keyboard = {
|
30000 | name: 'keyboard',
|
30001 | params: {
|
30002 | keyboard: {
|
30003 | enabled: false,
|
30004 | onlyInViewport: true,
|
30005 | },
|
30006 | },
|
30007 | create() {
|
30008 | const swiper = this;
|
30009 | Utils.extend(swiper, {
|
30010 | keyboard: {
|
30011 | enabled: false,
|
30012 | enable: Keyboard.enable.bind(swiper),
|
30013 | disable: Keyboard.disable.bind(swiper),
|
30014 | handle: Keyboard.handle.bind(swiper),
|
30015 | },
|
30016 | });
|
30017 | },
|
30018 | on: {
|
30019 | init() {
|
30020 | const swiper = this;
|
30021 | if (swiper.params.keyboard.enabled) {
|
30022 | swiper.keyboard.enable();
|
30023 | }
|
30024 | },
|
30025 | destroy() {
|
30026 | const swiper = this;
|
30027 | if (swiper.keyboard.enabled) {
|
30028 | swiper.keyboard.disable();
|
30029 | }
|
30030 | },
|
30031 | },
|
30032 | };
|
30033 |
|
30034 | function isEventSupported() {
|
30035 | const eventName = 'onwheel';
|
30036 | let isSupported = eventName in doc;
|
30037 |
|
30038 | if (!isSupported) {
|
30039 | const element = doc.createElement('div');
|
30040 | element.setAttribute(eventName, 'return;');
|
30041 | isSupported = typeof element[eventName] === 'function';
|
30042 | }
|
30043 |
|
30044 | if (!isSupported
|
30045 | && doc.implementation
|
30046 | && doc.implementation.hasFeature
|
30047 |
|
30048 |
|
30049 | && doc.implementation.hasFeature('', '') !== true
|
30050 | ) {
|
30051 |
|
30052 | isSupported = doc.implementation.hasFeature('Events.wheel', '3.0');
|
30053 | }
|
30054 |
|
30055 | return isSupported;
|
30056 | }
|
30057 | const Mousewheel = {
|
30058 | lastScrollTime: Utils.now(),
|
30059 | lastEventBeforeSnap: undefined,
|
30060 | recentWheelEvents: [],
|
30061 | event() {
|
30062 | if (win.navigator.userAgent.indexOf('firefox') > -1) return 'DOMMouseScroll';
|
30063 | return isEventSupported() ? 'wheel' : 'mousewheel';
|
30064 | },
|
30065 | normalize(e) {
|
30066 |
|
30067 | const PIXEL_STEP = 10;
|
30068 | const LINE_HEIGHT = 40;
|
30069 | const PAGE_HEIGHT = 800;
|
30070 |
|
30071 | let sX = 0;
|
30072 | let sY = 0;
|
30073 | let pX = 0;
|
30074 | let pY = 0;
|
30075 |
|
30076 |
|
30077 | if ('detail' in e) {
|
30078 | sY = e.detail;
|
30079 | }
|
30080 | if ('wheelDelta' in e) {
|
30081 | sY = -e.wheelDelta / 120;
|
30082 | }
|
30083 | if ('wheelDeltaY' in e) {
|
30084 | sY = -e.wheelDeltaY / 120;
|
30085 | }
|
30086 | if ('wheelDeltaX' in e) {
|
30087 | sX = -e.wheelDeltaX / 120;
|
30088 | }
|
30089 |
|
30090 |
|
30091 | if ('axis' in e && e.axis === e.HORIZONTAL_AXIS) {
|
30092 | sX = sY;
|
30093 | sY = 0;
|
30094 | }
|
30095 |
|
30096 | pX = sX * PIXEL_STEP;
|
30097 | pY = sY * PIXEL_STEP;
|
30098 |
|
30099 | if ('deltaY' in e) {
|
30100 | pY = e.deltaY;
|
30101 | }
|
30102 | if ('deltaX' in e) {
|
30103 | pX = e.deltaX;
|
30104 | }
|
30105 |
|
30106 | if (e.shiftKey && !pX) {
|
30107 | pX = pY;
|
30108 | pY = 0;
|
30109 | }
|
30110 |
|
30111 | if ((pX || pY) && e.deltaMode) {
|
30112 | if (e.deltaMode === 1) {
|
30113 | pX *= LINE_HEIGHT;
|
30114 | pY *= LINE_HEIGHT;
|
30115 | } else {
|
30116 | pX *= PAGE_HEIGHT;
|
30117 | pY *= PAGE_HEIGHT;
|
30118 | }
|
30119 | }
|
30120 |
|
30121 |
|
30122 | if (pX && !sX) {
|
30123 | sX = (pX < 1) ? -1 : 1;
|
30124 | }
|
30125 | if (pY && !sY) {
|
30126 | sY = (pY < 1) ? -1 : 1;
|
30127 | }
|
30128 |
|
30129 | return {
|
30130 | spinX: sX,
|
30131 | spinY: sY,
|
30132 | pixelX: pX,
|
30133 | pixelY: pY,
|
30134 | };
|
30135 | },
|
30136 | handleMouseEnter() {
|
30137 | const swiper = this;
|
30138 | swiper.mouseEntered = true;
|
30139 | },
|
30140 | handleMouseLeave() {
|
30141 | const swiper = this;
|
30142 | swiper.mouseEntered = false;
|
30143 | },
|
30144 | handle(event) {
|
30145 | let e = event;
|
30146 | const swiper = this;
|
30147 | const params = swiper.params.mousewheel;
|
30148 |
|
30149 | if (swiper.params.cssMode) {
|
30150 | e.preventDefault();
|
30151 | }
|
30152 |
|
30153 | let target = swiper.$el;
|
30154 | if (swiper.params.mousewheel.eventsTarged !== 'container') {
|
30155 | target = $(swiper.params.mousewheel.eventsTarged);
|
30156 | }
|
30157 | if (!swiper.mouseEntered && !target[0].contains(e.target) && !params.releaseOnEdges) return true;
|
30158 |
|
30159 | if (e.originalEvent) e = e.originalEvent;
|
30160 | let delta = 0;
|
30161 | const rtlFactor = swiper.rtlTranslate ? -1 : 1;
|
30162 |
|
30163 | const data = Mousewheel.normalize(e);
|
30164 |
|
30165 | if (params.forceToAxis) {
|
30166 | if (swiper.isHorizontal()) {
|
30167 | if (Math.abs(data.pixelX) > Math.abs(data.pixelY)) delta = data.pixelX * rtlFactor;
|
30168 | else return true;
|
30169 | } else if (Math.abs(data.pixelY) > Math.abs(data.pixelX)) delta = data.pixelY;
|
30170 | else return true;
|
30171 | } else {
|
30172 | delta = Math.abs(data.pixelX) > Math.abs(data.pixelY) ? -data.pixelX * rtlFactor : -data.pixelY;
|
30173 | }
|
30174 |
|
30175 | if (delta === 0) return true;
|
30176 |
|
30177 | if (params.invert) delta = -delta;
|
30178 |
|
30179 | if (!swiper.params.freeMode) {
|
30180 |
|
30181 | const newEvent = {
|
30182 | time: Utils.now(),
|
30183 | delta: Math.abs(delta),
|
30184 | direction: Math.sign(delta),
|
30185 | raw: event,
|
30186 | };
|
30187 |
|
30188 |
|
30189 | const recentWheelEvents = swiper.mousewheel.recentWheelEvents;
|
30190 | if (recentWheelEvents.length >= 2) {
|
30191 | recentWheelEvents.shift();
|
30192 | }
|
30193 | const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
|
30194 | recentWheelEvents.push(newEvent);
|
30195 |
|
30196 |
|
30197 |
|
30198 |
|
30199 |
|
30200 |
|
30201 |
|
30202 | if (prevEvent) {
|
30203 | if (newEvent.direction !== prevEvent.direction || newEvent.delta > prevEvent.delta || newEvent.time > prevEvent.time + 150) {
|
30204 | swiper.mousewheel.animateSlider(newEvent);
|
30205 | }
|
30206 | } else {
|
30207 | swiper.mousewheel.animateSlider(newEvent);
|
30208 | }
|
30209 |
|
30210 |
|
30211 |
|
30212 | if (swiper.mousewheel.releaseScroll(newEvent)) {
|
30213 | return true;
|
30214 | }
|
30215 | } else {
|
30216 |
|
30217 |
|
30218 |
|
30219 |
|
30220 |
|
30221 |
|
30222 | const newEvent = { time: Utils.now(), delta: Math.abs(delta), direction: Math.sign(delta) };
|
30223 | const { lastEventBeforeSnap } = swiper.mousewheel;
|
30224 | const ignoreWheelEvents = lastEventBeforeSnap
|
30225 | && newEvent.time < lastEventBeforeSnap.time + 500
|
30226 | && newEvent.delta <= lastEventBeforeSnap.delta
|
30227 | && newEvent.direction === lastEventBeforeSnap.direction;
|
30228 | if (!ignoreWheelEvents) {
|
30229 | swiper.mousewheel.lastEventBeforeSnap = undefined;
|
30230 |
|
30231 | if (swiper.params.loop) {
|
30232 | swiper.loopFix();
|
30233 | }
|
30234 | let position = swiper.getTranslate() + (delta * params.sensitivity);
|
30235 | const wasBeginning = swiper.isBeginning;
|
30236 | const wasEnd = swiper.isEnd;
|
30237 |
|
30238 | if (position >= swiper.minTranslate()) position = swiper.minTranslate();
|
30239 | if (position <= swiper.maxTranslate()) position = swiper.maxTranslate();
|
30240 |
|
30241 | swiper.setTransition(0);
|
30242 | swiper.setTranslate(position);
|
30243 | swiper.updateProgress();
|
30244 | swiper.updateActiveIndex();
|
30245 | swiper.updateSlidesClasses();
|
30246 |
|
30247 | if ((!wasBeginning && swiper.isBeginning) || (!wasEnd && swiper.isEnd)) {
|
30248 | swiper.updateSlidesClasses();
|
30249 | }
|
30250 |
|
30251 | if (swiper.params.freeModeSticky) {
|
30252 |
|
30253 |
|
30254 |
|
30255 |
|
30256 |
|
30257 |
|
30258 |
|
30259 |
|
30260 |
|
30261 |
|
30262 |
|
30263 | clearTimeout(swiper.mousewheel.timeout);
|
30264 | swiper.mousewheel.timeout = undefined;
|
30265 | const recentWheelEvents = swiper.mousewheel.recentWheelEvents;
|
30266 | if (recentWheelEvents.length >= 15) {
|
30267 | recentWheelEvents.shift();
|
30268 | }
|
30269 | const prevEvent = recentWheelEvents.length ? recentWheelEvents[recentWheelEvents.length - 1] : undefined;
|
30270 | const firstEvent = recentWheelEvents[0];
|
30271 | recentWheelEvents.push(newEvent);
|
30272 | if (prevEvent && (newEvent.delta > prevEvent.delta || newEvent.direction !== prevEvent.direction)) {
|
30273 |
|
30274 | recentWheelEvents.splice(0);
|
30275 | } else if (recentWheelEvents.length >= 15
|
30276 | && newEvent.time - firstEvent.time < 500
|
30277 | && firstEvent.delta - newEvent.delta >= 1
|
30278 | && newEvent.delta <= 6
|
30279 | ) {
|
30280 |
|
30281 |
|
30282 |
|
30283 |
|
30284 |
|
30285 |
|
30286 | const snapToThreshold = delta > 0 ? 0.8 : 0.2;
|
30287 | swiper.mousewheel.lastEventBeforeSnap = newEvent;
|
30288 | recentWheelEvents.splice(0);
|
30289 | swiper.mousewheel.timeout = Utils.nextTick(() => {
|
30290 | swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
|
30291 | }, 0);
|
30292 | }
|
30293 | if (!swiper.mousewheel.timeout) {
|
30294 |
|
30295 |
|
30296 |
|
30297 | swiper.mousewheel.timeout = Utils.nextTick(() => {
|
30298 | const snapToThreshold = 0.5;
|
30299 | swiper.mousewheel.lastEventBeforeSnap = newEvent;
|
30300 | recentWheelEvents.splice(0);
|
30301 | swiper.slideToClosest(swiper.params.speed, true, undefined, snapToThreshold);
|
30302 | }, 500);
|
30303 | }
|
30304 | }
|
30305 |
|
30306 |
|
30307 | if (!ignoreWheelEvents) swiper.emit('scroll', e);
|
30308 |
|
30309 |
|
30310 | if (swiper.params.autoplay && swiper.params.autoplayDisableOnInteraction) swiper.autoplay.stop();
|
30311 |
|
30312 | if (position === swiper.minTranslate() || position === swiper.maxTranslate()) return true;
|
30313 | }
|
30314 | }
|
30315 |
|
30316 | if (e.preventDefault) e.preventDefault();
|
30317 | else e.returnValue = false;
|
30318 | return false;
|
30319 | },
|
30320 | animateSlider(newEvent) {
|
30321 | const swiper = this;
|
30322 |
|
30323 |
|
30324 |
|
30325 | if (newEvent.delta >= 6 && Utils.now() - swiper.mousewheel.lastScrollTime < 60) {
|
30326 |
|
30327 | return true;
|
30328 | }
|
30329 |
|
30330 |
|
30331 |
|
30332 |
|
30333 |
|
30334 |
|
30335 |
|
30336 |
|
30337 |
|
30338 |
|
30339 |
|
30340 |
|
30341 | if (newEvent.direction < 0) {
|
30342 | if ((!swiper.isEnd || swiper.params.loop) && !swiper.animating) {
|
30343 | swiper.slideNext();
|
30344 | swiper.emit('scroll', newEvent.raw);
|
30345 | }
|
30346 | } else if ((!swiper.isBeginning || swiper.params.loop) && !swiper.animating) {
|
30347 | swiper.slidePrev();
|
30348 | swiper.emit('scroll', newEvent.raw);
|
30349 | }
|
30350 |
|
30351 | swiper.mousewheel.lastScrollTime = (new win.Date()).getTime();
|
30352 |
|
30353 | return false;
|
30354 | },
|
30355 | releaseScroll(newEvent) {
|
30356 | const swiper = this;
|
30357 | const params = swiper.params.mousewheel;
|
30358 | if (newEvent.direction < 0) {
|
30359 | if (swiper.isEnd && !swiper.params.loop && params.releaseOnEdges) {
|
30360 |
|
30361 | return true;
|
30362 | }
|
30363 | } else if (swiper.isBeginning && !swiper.params.loop && params.releaseOnEdges) {
|
30364 |
|
30365 | return true;
|
30366 | }
|
30367 | return false;
|
30368 | },
|
30369 | enable() {
|
30370 | const swiper = this;
|
30371 | const event = Mousewheel.event();
|
30372 | if (swiper.params.cssMode) {
|
30373 | swiper.wrapperEl.removeEventListener(event, swiper.mousewheel.handle);
|
30374 | return true;
|
30375 | }
|
30376 | if (!event) return false;
|
30377 | if (swiper.mousewheel.enabled) return false;
|
30378 | let target = swiper.$el;
|
30379 | if (swiper.params.mousewheel.eventsTarged !== 'container') {
|
30380 | target = $(swiper.params.mousewheel.eventsTarged);
|
30381 | }
|
30382 | target.on('mouseenter', swiper.mousewheel.handleMouseEnter);
|
30383 | target.on('mouseleave', swiper.mousewheel.handleMouseLeave);
|
30384 | target.on(event, swiper.mousewheel.handle);
|
30385 | swiper.mousewheel.enabled = true;
|
30386 | return true;
|
30387 | },
|
30388 | disable() {
|
30389 | const swiper = this;
|
30390 | const event = Mousewheel.event();
|
30391 | if (swiper.params.cssMode) {
|
30392 | swiper.wrapperEl.addEventListener(event, swiper.mousewheel.handle);
|
30393 | return true;
|
30394 | }
|
30395 | if (!event) return false;
|
30396 | if (!swiper.mousewheel.enabled) return false;
|
30397 | let target = swiper.$el;
|
30398 | if (swiper.params.mousewheel.eventsTarged !== 'container') {
|
30399 | target = $(swiper.params.mousewheel.eventsTarged);
|
30400 | }
|
30401 | target.off(event, swiper.mousewheel.handle);
|
30402 | swiper.mousewheel.enabled = false;
|
30403 | return true;
|
30404 | },
|
30405 | };
|
30406 |
|
30407 | const Pagination = {
|
30408 | update() {
|
30409 |
|
30410 | const swiper = this;
|
30411 | const rtl = swiper.rtl;
|
30412 | const params = swiper.params.pagination;
|
30413 | if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;
|
30414 | const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
|
30415 | const $el = swiper.pagination.$el;
|
30416 |
|
30417 | let current;
|
30418 | const total = swiper.params.loop ? Math.ceil((slidesLength - (swiper.loopedSlides * 2)) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
|
30419 | if (swiper.params.loop) {
|
30420 | current = Math.ceil((swiper.activeIndex - swiper.loopedSlides) / swiper.params.slidesPerGroup);
|
30421 | if (current > slidesLength - 1 - (swiper.loopedSlides * 2)) {
|
30422 | current -= (slidesLength - (swiper.loopedSlides * 2));
|
30423 | }
|
30424 | if (current > total - 1) current -= total;
|
30425 | if (current < 0 && swiper.params.paginationType !== 'bullets') current = total + current;
|
30426 | } else if (typeof swiper.snapIndex !== 'undefined') {
|
30427 | current = swiper.snapIndex;
|
30428 | } else {
|
30429 | current = swiper.activeIndex || 0;
|
30430 | }
|
30431 |
|
30432 | if (params.type === 'bullets' && swiper.pagination.bullets && swiper.pagination.bullets.length > 0) {
|
30433 | const bullets = swiper.pagination.bullets;
|
30434 | let firstIndex;
|
30435 | let lastIndex;
|
30436 | let midIndex;
|
30437 | if (params.dynamicBullets) {
|
30438 | swiper.pagination.bulletSize = bullets.eq(0)[swiper.isHorizontal() ? 'outerWidth' : 'outerHeight'](true);
|
30439 | $el.css(swiper.isHorizontal() ? 'width' : 'height', `${swiper.pagination.bulletSize * (params.dynamicMainBullets + 4)}px`);
|
30440 | if (params.dynamicMainBullets > 1 && swiper.previousIndex !== undefined) {
|
30441 | swiper.pagination.dynamicBulletIndex += (current - swiper.previousIndex);
|
30442 | if (swiper.pagination.dynamicBulletIndex > (params.dynamicMainBullets - 1)) {
|
30443 | swiper.pagination.dynamicBulletIndex = params.dynamicMainBullets - 1;
|
30444 | } else if (swiper.pagination.dynamicBulletIndex < 0) {
|
30445 | swiper.pagination.dynamicBulletIndex = 0;
|
30446 | }
|
30447 | }
|
30448 | firstIndex = current - swiper.pagination.dynamicBulletIndex;
|
30449 | lastIndex = firstIndex + (Math.min(bullets.length, params.dynamicMainBullets) - 1);
|
30450 | midIndex = (lastIndex + firstIndex) / 2;
|
30451 | }
|
30452 | bullets.removeClass(`${params.bulletActiveClass} ${params.bulletActiveClass}-next ${params.bulletActiveClass}-next-next ${params.bulletActiveClass}-prev ${params.bulletActiveClass}-prev-prev ${params.bulletActiveClass}-main`);
|
30453 | if ($el.length > 1) {
|
30454 | bullets.each((index, bullet) => {
|
30455 | const $bullet = $(bullet);
|
30456 | const bulletIndex = $bullet.index();
|
30457 | if (bulletIndex === current) {
|
30458 | $bullet.addClass(params.bulletActiveClass);
|
30459 | }
|
30460 | if (params.dynamicBullets) {
|
30461 | if (bulletIndex >= firstIndex && bulletIndex <= lastIndex) {
|
30462 | $bullet.addClass(`${params.bulletActiveClass}-main`);
|
30463 | }
|
30464 | if (bulletIndex === firstIndex) {
|
30465 | $bullet
|
30466 | .prev()
|
30467 | .addClass(`${params.bulletActiveClass}-prev`)
|
30468 | .prev()
|
30469 | .addClass(`${params.bulletActiveClass}-prev-prev`);
|
30470 | }
|
30471 | if (bulletIndex === lastIndex) {
|
30472 | $bullet
|
30473 | .next()
|
30474 | .addClass(`${params.bulletActiveClass}-next`)
|
30475 | .next()
|
30476 | .addClass(`${params.bulletActiveClass}-next-next`);
|
30477 | }
|
30478 | }
|
30479 | });
|
30480 | } else {
|
30481 | const $bullet = bullets.eq(current);
|
30482 | const bulletIndex = $bullet.index();
|
30483 | $bullet.addClass(params.bulletActiveClass);
|
30484 | if (params.dynamicBullets) {
|
30485 | const $firstDisplayedBullet = bullets.eq(firstIndex);
|
30486 | const $lastDisplayedBullet = bullets.eq(lastIndex);
|
30487 | for (let i = firstIndex; i <= lastIndex; i += 1) {
|
30488 | bullets.eq(i).addClass(`${params.bulletActiveClass}-main`);
|
30489 | }
|
30490 | if (swiper.params.loop) {
|
30491 | if (bulletIndex >= bullets.length - params.dynamicMainBullets) {
|
30492 | for (let i = params.dynamicMainBullets; i >= 0; i -= 1) {
|
30493 | bullets.eq(bullets.length - i).addClass(`${params.bulletActiveClass}-main`);
|
30494 | }
|
30495 | bullets.eq(bullets.length - params.dynamicMainBullets - 1).addClass(`${params.bulletActiveClass}-prev`);
|
30496 | } else {
|
30497 | $firstDisplayedBullet
|
30498 | .prev()
|
30499 | .addClass(`${params.bulletActiveClass}-prev`)
|
30500 | .prev()
|
30501 | .addClass(`${params.bulletActiveClass}-prev-prev`);
|
30502 | $lastDisplayedBullet
|
30503 | .next()
|
30504 | .addClass(`${params.bulletActiveClass}-next`)
|
30505 | .next()
|
30506 | .addClass(`${params.bulletActiveClass}-next-next`);
|
30507 | }
|
30508 | } else {
|
30509 | $firstDisplayedBullet
|
30510 | .prev()
|
30511 | .addClass(`${params.bulletActiveClass}-prev`)
|
30512 | .prev()
|
30513 | .addClass(`${params.bulletActiveClass}-prev-prev`);
|
30514 | $lastDisplayedBullet
|
30515 | .next()
|
30516 | .addClass(`${params.bulletActiveClass}-next`)
|
30517 | .next()
|
30518 | .addClass(`${params.bulletActiveClass}-next-next`);
|
30519 | }
|
30520 | }
|
30521 | }
|
30522 | if (params.dynamicBullets) {
|
30523 | const dynamicBulletsLength = Math.min(bullets.length, params.dynamicMainBullets + 4);
|
30524 | const bulletsOffset = (((swiper.pagination.bulletSize * dynamicBulletsLength) - (swiper.pagination.bulletSize)) / 2) - (midIndex * swiper.pagination.bulletSize);
|
30525 | const offsetProp = rtl ? 'right' : 'left';
|
30526 | bullets.css(swiper.isHorizontal() ? offsetProp : 'top', `${bulletsOffset}px`);
|
30527 | }
|
30528 | }
|
30529 | if (params.type === 'fraction') {
|
30530 | $el.find(`.${params.currentClass}`).text(params.formatFractionCurrent(current + 1));
|
30531 | $el.find(`.${params.totalClass}`).text(params.formatFractionTotal(total));
|
30532 | }
|
30533 | if (params.type === 'progressbar') {
|
30534 | let progressbarDirection;
|
30535 | if (params.progressbarOpposite) {
|
30536 | progressbarDirection = swiper.isHorizontal() ? 'vertical' : 'horizontal';
|
30537 | } else {
|
30538 | progressbarDirection = swiper.isHorizontal() ? 'horizontal' : 'vertical';
|
30539 | }
|
30540 | const scale = (current + 1) / total;
|
30541 | let scaleX = 1;
|
30542 | let scaleY = 1;
|
30543 | if (progressbarDirection === 'horizontal') {
|
30544 | scaleX = scale;
|
30545 | } else {
|
30546 | scaleY = scale;
|
30547 | }
|
30548 | $el.find(`.${params.progressbarFillClass}`).transform(`translate3d(0,0,0) scaleX(${scaleX}) scaleY(${scaleY})`).transition(swiper.params.speed);
|
30549 | }
|
30550 | if (params.type === 'custom' && params.renderCustom) {
|
30551 | $el.html(params.renderCustom(swiper, current + 1, total));
|
30552 | swiper.emit('paginationRender', swiper, $el[0]);
|
30553 | } else {
|
30554 | swiper.emit('paginationUpdate', swiper, $el[0]);
|
30555 | }
|
30556 | $el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](params.lockClass);
|
30557 | },
|
30558 | render() {
|
30559 |
|
30560 | const swiper = this;
|
30561 | const params = swiper.params.pagination;
|
30562 | if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;
|
30563 | const slidesLength = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.slides.length : swiper.slides.length;
|
30564 |
|
30565 | const $el = swiper.pagination.$el;
|
30566 | let paginationHTML = '';
|
30567 | if (params.type === 'bullets') {
|
30568 | const numberOfBullets = swiper.params.loop ? Math.ceil((slidesLength - (swiper.loopedSlides * 2)) / swiper.params.slidesPerGroup) : swiper.snapGrid.length;
|
30569 | for (let i = 0; i < numberOfBullets; i += 1) {
|
30570 | if (params.renderBullet) {
|
30571 | paginationHTML += params.renderBullet.call(swiper, i, params.bulletClass);
|
30572 | } else {
|
30573 | paginationHTML += `<${params.bulletElement} class="${params.bulletClass}"></${params.bulletElement}>`;
|
30574 | }
|
30575 | }
|
30576 | $el.html(paginationHTML);
|
30577 | swiper.pagination.bullets = $el.find(`.${params.bulletClass}`);
|
30578 | }
|
30579 | if (params.type === 'fraction') {
|
30580 | if (params.renderFraction) {
|
30581 | paginationHTML = params.renderFraction.call(swiper, params.currentClass, params.totalClass);
|
30582 | } else {
|
30583 | paginationHTML = `<span class="${params.currentClass}"></span>`
|
30584 | + ' / '
|
30585 | + `<span class="${params.totalClass}"></span>`;
|
30586 | }
|
30587 | $el.html(paginationHTML);
|
30588 | }
|
30589 | if (params.type === 'progressbar') {
|
30590 | if (params.renderProgressbar) {
|
30591 | paginationHTML = params.renderProgressbar.call(swiper, params.progressbarFillClass);
|
30592 | } else {
|
30593 | paginationHTML = `<span class="${params.progressbarFillClass}"></span>`;
|
30594 | }
|
30595 | $el.html(paginationHTML);
|
30596 | }
|
30597 | if (params.type !== 'custom') {
|
30598 | swiper.emit('paginationRender', swiper.pagination.$el[0]);
|
30599 | }
|
30600 | },
|
30601 | init() {
|
30602 | const swiper = this;
|
30603 | const params = swiper.params.pagination;
|
30604 | if (!params.el) return;
|
30605 |
|
30606 | let $el = $(params.el);
|
30607 | if ($el.length === 0) return;
|
30608 |
|
30609 | if (
|
30610 | swiper.params.uniqueNavElements
|
30611 | && typeof params.el === 'string'
|
30612 | && $el.length > 1
|
30613 | && swiper.$el.find(params.el).length === 1
|
30614 | ) {
|
30615 | $el = swiper.$el.find(params.el);
|
30616 | }
|
30617 |
|
30618 | if (params.type === 'bullets' && params.clickable) {
|
30619 | $el.addClass(params.clickableClass);
|
30620 | }
|
30621 |
|
30622 | $el.addClass(params.modifierClass + params.type);
|
30623 |
|
30624 | if (params.type === 'bullets' && params.dynamicBullets) {
|
30625 | $el.addClass(`${params.modifierClass}${params.type}-dynamic`);
|
30626 | swiper.pagination.dynamicBulletIndex = 0;
|
30627 | if (params.dynamicMainBullets < 1) {
|
30628 | params.dynamicMainBullets = 1;
|
30629 | }
|
30630 | }
|
30631 | if (params.type === 'progressbar' && params.progressbarOpposite) {
|
30632 | $el.addClass(params.progressbarOppositeClass);
|
30633 | }
|
30634 |
|
30635 | if (params.clickable) {
|
30636 | $el.on('click', `.${params.bulletClass}`, function onClick(e) {
|
30637 | e.preventDefault();
|
30638 | let index = $(this).index() * swiper.params.slidesPerGroup;
|
30639 | if (swiper.params.loop) index += swiper.loopedSlides;
|
30640 | swiper.slideTo(index);
|
30641 | });
|
30642 | }
|
30643 |
|
30644 | Utils.extend(swiper.pagination, {
|
30645 | $el,
|
30646 | el: $el[0],
|
30647 | });
|
30648 | },
|
30649 | destroy() {
|
30650 | const swiper = this;
|
30651 | const params = swiper.params.pagination;
|
30652 | if (!params.el || !swiper.pagination.el || !swiper.pagination.$el || swiper.pagination.$el.length === 0) return;
|
30653 | const $el = swiper.pagination.$el;
|
30654 |
|
30655 | $el.removeClass(params.hiddenClass);
|
30656 | $el.removeClass(params.modifierClass + params.type);
|
30657 | if (swiper.pagination.bullets) swiper.pagination.bullets.removeClass(params.bulletActiveClass);
|
30658 | if (params.clickable) {
|
30659 | $el.off('click', `.${params.bulletClass}`);
|
30660 | }
|
30661 | },
|
30662 | };
|
30663 |
|
30664 | var pagination = {
|
30665 | name: 'pagination',
|
30666 | params: {
|
30667 | pagination: {
|
30668 | el: null,
|
30669 | bulletElement: 'span',
|
30670 | clickable: false,
|
30671 | hideOnClick: false,
|
30672 | renderBullet: null,
|
30673 | renderProgressbar: null,
|
30674 | renderFraction: null,
|
30675 | renderCustom: null,
|
30676 | progressbarOpposite: false,
|
30677 | type: 'bullets',
|
30678 | dynamicBullets: false,
|
30679 | dynamicMainBullets: 1,
|
30680 | formatFractionCurrent: (number) => number,
|
30681 | formatFractionTotal: (number) => number,
|
30682 | bulletClass: 'swiper-pagination-bullet',
|
30683 | bulletActiveClass: 'swiper-pagination-bullet-active',
|
30684 | modifierClass: 'swiper-pagination-',
|
30685 | currentClass: 'swiper-pagination-current',
|
30686 | totalClass: 'swiper-pagination-total',
|
30687 | hiddenClass: 'swiper-pagination-hidden',
|
30688 | progressbarFillClass: 'swiper-pagination-progressbar-fill',
|
30689 | progressbarOppositeClass: 'swiper-pagination-progressbar-opposite',
|
30690 | clickableClass: 'swiper-pagination-clickable',
|
30691 | lockClass: 'swiper-pagination-lock',
|
30692 | },
|
30693 | },
|
30694 | create() {
|
30695 | const swiper = this;
|
30696 | Utils.extend(swiper, {
|
30697 | pagination: {
|
30698 | init: Pagination.init.bind(swiper),
|
30699 | render: Pagination.render.bind(swiper),
|
30700 | update: Pagination.update.bind(swiper),
|
30701 | destroy: Pagination.destroy.bind(swiper),
|
30702 | dynamicBulletIndex: 0,
|
30703 | },
|
30704 | });
|
30705 | },
|
30706 | on: {
|
30707 | init() {
|
30708 | const swiper = this;
|
30709 | swiper.pagination.init();
|
30710 | swiper.pagination.render();
|
30711 | swiper.pagination.update();
|
30712 | },
|
30713 | activeIndexChange() {
|
30714 | const swiper = this;
|
30715 | if (swiper.params.loop) {
|
30716 | swiper.pagination.update();
|
30717 | } else if (typeof swiper.snapIndex === 'undefined') {
|
30718 | swiper.pagination.update();
|
30719 | }
|
30720 | },
|
30721 | snapIndexChange() {
|
30722 | const swiper = this;
|
30723 | if (!swiper.params.loop) {
|
30724 | swiper.pagination.update();
|
30725 | }
|
30726 | },
|
30727 | slidesLengthChange() {
|
30728 | const swiper = this;
|
30729 | if (swiper.params.loop) {
|
30730 | swiper.pagination.render();
|
30731 | swiper.pagination.update();
|
30732 | }
|
30733 | },
|
30734 | snapGridLengthChange() {
|
30735 | const swiper = this;
|
30736 | if (!swiper.params.loop) {
|
30737 | swiper.pagination.render();
|
30738 | swiper.pagination.update();
|
30739 | }
|
30740 | },
|
30741 | destroy() {
|
30742 | const swiper = this;
|
30743 | swiper.pagination.destroy();
|
30744 | },
|
30745 | click(e) {
|
30746 | const swiper = this;
|
30747 | if (
|
30748 | swiper.params.pagination.el
|
30749 | && swiper.params.pagination.hideOnClick
|
30750 | && swiper.pagination.$el.length > 0
|
30751 | && !$(e.target).hasClass(swiper.params.pagination.bulletClass)
|
30752 | ) {
|
30753 | const isHidden = swiper.pagination.$el.hasClass(swiper.params.pagination.hiddenClass);
|
30754 | if (isHidden === true) {
|
30755 | swiper.emit('paginationShow', swiper);
|
30756 | } else {
|
30757 | swiper.emit('paginationHide', swiper);
|
30758 | }
|
30759 | swiper.pagination.$el.toggleClass(swiper.params.pagination.hiddenClass);
|
30760 | }
|
30761 | },
|
30762 | },
|
30763 | };
|
30764 |
|
30765 | const Scrollbar = {
|
30766 | setTranslate() {
|
30767 | const swiper = this;
|
30768 | if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
|
30769 | const { scrollbar, rtlTranslate: rtl, progress } = swiper;
|
30770 | const {
|
30771 | dragSize, trackSize, $dragEl, $el,
|
30772 | } = scrollbar;
|
30773 | const params = swiper.params.scrollbar;
|
30774 |
|
30775 | let newSize = dragSize;
|
30776 | let newPos = (trackSize - dragSize) * progress;
|
30777 | if (rtl) {
|
30778 | newPos = -newPos;
|
30779 | if (newPos > 0) {
|
30780 | newSize = dragSize - newPos;
|
30781 | newPos = 0;
|
30782 | } else if (-newPos + dragSize > trackSize) {
|
30783 | newSize = trackSize + newPos;
|
30784 | }
|
30785 | } else if (newPos < 0) {
|
30786 | newSize = dragSize + newPos;
|
30787 | newPos = 0;
|
30788 | } else if (newPos + dragSize > trackSize) {
|
30789 | newSize = trackSize - newPos;
|
30790 | }
|
30791 | if (swiper.isHorizontal()) {
|
30792 | $dragEl.transform(`translate3d(${newPos}px, 0, 0)`);
|
30793 | $dragEl[0].style.width = `${newSize}px`;
|
30794 | } else {
|
30795 | $dragEl.transform(`translate3d(0px, ${newPos}px, 0)`);
|
30796 | $dragEl[0].style.height = `${newSize}px`;
|
30797 | }
|
30798 | if (params.hide) {
|
30799 | clearTimeout(swiper.scrollbar.timeout);
|
30800 | $el[0].style.opacity = 1;
|
30801 | swiper.scrollbar.timeout = setTimeout(() => {
|
30802 | $el[0].style.opacity = 0;
|
30803 | $el.transition(400);
|
30804 | }, 1000);
|
30805 | }
|
30806 | },
|
30807 | setTransition(duration) {
|
30808 | const swiper = this;
|
30809 | if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
|
30810 | swiper.scrollbar.$dragEl.transition(duration);
|
30811 | },
|
30812 | updateSize() {
|
30813 | const swiper = this;
|
30814 | if (!swiper.params.scrollbar.el || !swiper.scrollbar.el) return;
|
30815 |
|
30816 | const { scrollbar } = swiper;
|
30817 | const { $dragEl, $el } = scrollbar;
|
30818 |
|
30819 | $dragEl[0].style.width = '';
|
30820 | $dragEl[0].style.height = '';
|
30821 | const trackSize = swiper.isHorizontal() ? $el[0].offsetWidth : $el[0].offsetHeight;
|
30822 |
|
30823 | const divider = swiper.size / swiper.virtualSize;
|
30824 | const moveDivider = divider * (trackSize / swiper.size);
|
30825 | let dragSize;
|
30826 | if (swiper.params.scrollbar.dragSize === 'auto') {
|
30827 | dragSize = trackSize * divider;
|
30828 | } else {
|
30829 | dragSize = parseInt(swiper.params.scrollbar.dragSize, 10);
|
30830 | }
|
30831 |
|
30832 | if (swiper.isHorizontal()) {
|
30833 | $dragEl[0].style.width = `${dragSize}px`;
|
30834 | } else {
|
30835 | $dragEl[0].style.height = `${dragSize}px`;
|
30836 | }
|
30837 |
|
30838 | if (divider >= 1) {
|
30839 | $el[0].style.display = 'none';
|
30840 | } else {
|
30841 | $el[0].style.display = '';
|
30842 | }
|
30843 | if (swiper.params.scrollbar.hide) {
|
30844 | $el[0].style.opacity = 0;
|
30845 | }
|
30846 | Utils.extend(scrollbar, {
|
30847 | trackSize,
|
30848 | divider,
|
30849 | moveDivider,
|
30850 | dragSize,
|
30851 | });
|
30852 | scrollbar.$el[swiper.params.watchOverflow && swiper.isLocked ? 'addClass' : 'removeClass'](swiper.params.scrollbar.lockClass);
|
30853 | },
|
30854 | getPointerPosition(e) {
|
30855 | const swiper = this;
|
30856 | if (swiper.isHorizontal()) {
|
30857 | return ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].clientX : e.clientX);
|
30858 | }
|
30859 | return ((e.type === 'touchstart' || e.type === 'touchmove') ? e.targetTouches[0].clientY : e.clientY);
|
30860 | },
|
30861 | setDragPosition(e) {
|
30862 | const swiper = this;
|
30863 | const { scrollbar, rtlTranslate: rtl } = swiper;
|
30864 | const {
|
30865 | $el,
|
30866 | dragSize,
|
30867 | trackSize,
|
30868 | dragStartPos,
|
30869 | } = scrollbar;
|
30870 |
|
30871 | let positionRatio;
|
30872 | positionRatio = ((scrollbar.getPointerPosition(e)) - $el.offset()[swiper.isHorizontal() ? 'left' : 'top']
|
30873 | - (dragStartPos !== null ? dragStartPos : dragSize / 2)) / (trackSize - dragSize);
|
30874 | positionRatio = Math.max(Math.min(positionRatio, 1), 0);
|
30875 | if (rtl) {
|
30876 | positionRatio = 1 - positionRatio;
|
30877 | }
|
30878 |
|
30879 | const position = swiper.minTranslate() + ((swiper.maxTranslate() - swiper.minTranslate()) * positionRatio);
|
30880 |
|
30881 | swiper.updateProgress(position);
|
30882 | swiper.setTranslate(position);
|
30883 | swiper.updateActiveIndex();
|
30884 | swiper.updateSlidesClasses();
|
30885 | },
|
30886 | onDragStart(e) {
|
30887 | const swiper = this;
|
30888 | const params = swiper.params.scrollbar;
|
30889 | const { scrollbar, $wrapperEl } = swiper;
|
30890 | const { $el, $dragEl } = scrollbar;
|
30891 | swiper.scrollbar.isTouched = true;
|
30892 | swiper.scrollbar.dragStartPos = (e.target === $dragEl[0] || e.target === $dragEl)
|
30893 | ? scrollbar.getPointerPosition(e) - e.target.getBoundingClientRect()[swiper.isHorizontal() ? 'left' : 'top'] : null;
|
30894 | e.preventDefault();
|
30895 | e.stopPropagation();
|
30896 |
|
30897 | $wrapperEl.transition(100);
|
30898 | $dragEl.transition(100);
|
30899 | scrollbar.setDragPosition(e);
|
30900 |
|
30901 | clearTimeout(swiper.scrollbar.dragTimeout);
|
30902 |
|
30903 | $el.transition(0);
|
30904 | if (params.hide) {
|
30905 | $el.css('opacity', 1);
|
30906 | }
|
30907 | if (swiper.params.cssMode) {
|
30908 | swiper.$wrapperEl.css('scroll-snap-type', 'none');
|
30909 | }
|
30910 | swiper.emit('scrollbarDragStart', e);
|
30911 | },
|
30912 | onDragMove(e) {
|
30913 | const swiper = this;
|
30914 | const { scrollbar, $wrapperEl } = swiper;
|
30915 | const { $el, $dragEl } = scrollbar;
|
30916 |
|
30917 | if (!swiper.scrollbar.isTouched) return;
|
30918 | if (e.preventDefault) e.preventDefault();
|
30919 | else e.returnValue = false;
|
30920 | scrollbar.setDragPosition(e);
|
30921 | $wrapperEl.transition(0);
|
30922 | $el.transition(0);
|
30923 | $dragEl.transition(0);
|
30924 | swiper.emit('scrollbarDragMove', e);
|
30925 | },
|
30926 | onDragEnd(e) {
|
30927 | const swiper = this;
|
30928 |
|
30929 | const params = swiper.params.scrollbar;
|
30930 | const { scrollbar, $wrapperEl } = swiper;
|
30931 | const { $el } = scrollbar;
|
30932 |
|
30933 | if (!swiper.scrollbar.isTouched) return;
|
30934 | swiper.scrollbar.isTouched = false;
|
30935 | if (swiper.params.cssMode) {
|
30936 | swiper.$wrapperEl.css('scroll-snap-type', '');
|
30937 | $wrapperEl.transition('');
|
30938 | }
|
30939 | if (params.hide) {
|
30940 | clearTimeout(swiper.scrollbar.dragTimeout);
|
30941 | swiper.scrollbar.dragTimeout = Utils.nextTick(() => {
|
30942 | $el.css('opacity', 0);
|
30943 | $el.transition(400);
|
30944 | }, 1000);
|
30945 | }
|
30946 | swiper.emit('scrollbarDragEnd', e);
|
30947 | if (params.snapOnRelease) {
|
30948 | swiper.slideToClosest();
|
30949 | }
|
30950 | },
|
30951 | enableDraggable() {
|
30952 | const swiper = this;
|
30953 | if (!swiper.params.scrollbar.el) return;
|
30954 | const {
|
30955 | scrollbar, touchEventsTouch, touchEventsDesktop, params,
|
30956 | } = swiper;
|
30957 | const $el = scrollbar.$el;
|
30958 | const target = $el[0];
|
30959 | const activeListener = Support.passiveListener && params.passiveListeners ? { passive: false, capture: false } : false;
|
30960 | const passiveListener = Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
30961 | if (!Support.touch) {
|
30962 | target.addEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
|
30963 | doc.addEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
|
30964 | doc.addEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
|
30965 | } else {
|
30966 | target.addEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
|
30967 | target.addEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
|
30968 | target.addEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
|
30969 | }
|
30970 | },
|
30971 | disableDraggable() {
|
30972 | const swiper = this;
|
30973 | if (!swiper.params.scrollbar.el) return;
|
30974 | const {
|
30975 | scrollbar, touchEventsTouch, touchEventsDesktop, params,
|
30976 | } = swiper;
|
30977 | const $el = scrollbar.$el;
|
30978 | const target = $el[0];
|
30979 | const activeListener = Support.passiveListener && params.passiveListeners ? { passive: false, capture: false } : false;
|
30980 | const passiveListener = Support.passiveListener && params.passiveListeners ? { passive: true, capture: false } : false;
|
30981 | if (!Support.touch) {
|
30982 | target.removeEventListener(touchEventsDesktop.start, swiper.scrollbar.onDragStart, activeListener);
|
30983 | doc.removeEventListener(touchEventsDesktop.move, swiper.scrollbar.onDragMove, activeListener);
|
30984 | doc.removeEventListener(touchEventsDesktop.end, swiper.scrollbar.onDragEnd, passiveListener);
|
30985 | } else {
|
30986 | target.removeEventListener(touchEventsTouch.start, swiper.scrollbar.onDragStart, activeListener);
|
30987 | target.removeEventListener(touchEventsTouch.move, swiper.scrollbar.onDragMove, activeListener);
|
30988 | target.removeEventListener(touchEventsTouch.end, swiper.scrollbar.onDragEnd, passiveListener);
|
30989 | }
|
30990 | },
|
30991 | init() {
|
30992 | const swiper = this;
|
30993 | if (!swiper.params.scrollbar.el) return;
|
30994 | const { scrollbar, $el: $swiperEl } = swiper;
|
30995 | const params = swiper.params.scrollbar;
|
30996 |
|
30997 | let $el = $(params.el);
|
30998 | if (swiper.params.uniqueNavElements && typeof params.el === 'string' && $el.length > 1 && $swiperEl.find(params.el).length === 1) {
|
30999 | $el = $swiperEl.find(params.el);
|
31000 | }
|
31001 |
|
31002 | let $dragEl = $el.find(`.${swiper.params.scrollbar.dragClass}`);
|
31003 | if ($dragEl.length === 0) {
|
31004 | $dragEl = $(`<div class="${swiper.params.scrollbar.dragClass}"></div>`);
|
31005 | $el.append($dragEl);
|
31006 | }
|
31007 |
|
31008 | Utils.extend(scrollbar, {
|
31009 | $el,
|
31010 | el: $el[0],
|
31011 | $dragEl,
|
31012 | dragEl: $dragEl[0],
|
31013 | });
|
31014 |
|
31015 | if (params.draggable) {
|
31016 | scrollbar.enableDraggable();
|
31017 | }
|
31018 | },
|
31019 | destroy() {
|
31020 | const swiper = this;
|
31021 | swiper.scrollbar.disableDraggable();
|
31022 | },
|
31023 | };
|
31024 |
|
31025 | var scrollbar = {
|
31026 | name: 'scrollbar',
|
31027 | params: {
|
31028 | scrollbar: {
|
31029 | el: null,
|
31030 | dragSize: 'auto',
|
31031 | hide: false,
|
31032 | draggable: false,
|
31033 | snapOnRelease: true,
|
31034 | lockClass: 'swiper-scrollbar-lock',
|
31035 | dragClass: 'swiper-scrollbar-drag',
|
31036 | },
|
31037 | },
|
31038 | create() {
|
31039 | const swiper = this;
|
31040 | Utils.extend(swiper, {
|
31041 | scrollbar: {
|
31042 | init: Scrollbar.init.bind(swiper),
|
31043 | destroy: Scrollbar.destroy.bind(swiper),
|
31044 | updateSize: Scrollbar.updateSize.bind(swiper),
|
31045 | setTranslate: Scrollbar.setTranslate.bind(swiper),
|
31046 | setTransition: Scrollbar.setTransition.bind(swiper),
|
31047 | enableDraggable: Scrollbar.enableDraggable.bind(swiper),
|
31048 | disableDraggable: Scrollbar.disableDraggable.bind(swiper),
|
31049 | setDragPosition: Scrollbar.setDragPosition.bind(swiper),
|
31050 | getPointerPosition: Scrollbar.getPointerPosition.bind(swiper),
|
31051 | onDragStart: Scrollbar.onDragStart.bind(swiper),
|
31052 | onDragMove: Scrollbar.onDragMove.bind(swiper),
|
31053 | onDragEnd: Scrollbar.onDragEnd.bind(swiper),
|
31054 | isTouched: false,
|
31055 | timeout: null,
|
31056 | dragTimeout: null,
|
31057 | },
|
31058 | });
|
31059 | },
|
31060 | on: {
|
31061 | init() {
|
31062 | const swiper = this;
|
31063 | swiper.scrollbar.init();
|
31064 | swiper.scrollbar.updateSize();
|
31065 | swiper.scrollbar.setTranslate();
|
31066 | },
|
31067 | update() {
|
31068 | const swiper = this;
|
31069 | swiper.scrollbar.updateSize();
|
31070 | },
|
31071 | resize() {
|
31072 | const swiper = this;
|
31073 | swiper.scrollbar.updateSize();
|
31074 | },
|
31075 | observerUpdate() {
|
31076 | const swiper = this;
|
31077 | swiper.scrollbar.updateSize();
|
31078 | },
|
31079 | setTranslate() {
|
31080 | const swiper = this;
|
31081 | swiper.scrollbar.setTranslate();
|
31082 | },
|
31083 | setTransition(duration) {
|
31084 | const swiper = this;
|
31085 | swiper.scrollbar.setTransition(duration);
|
31086 | },
|
31087 | destroy() {
|
31088 | const swiper = this;
|
31089 | swiper.scrollbar.destroy();
|
31090 | },
|
31091 | },
|
31092 | };
|
31093 |
|
31094 | const Zoom = {
|
31095 |
|
31096 | getDistanceBetweenTouches(e) {
|
31097 | if (e.targetTouches.length < 2) return 1;
|
31098 | const x1 = e.targetTouches[0].pageX;
|
31099 | const y1 = e.targetTouches[0].pageY;
|
31100 | const x2 = e.targetTouches[1].pageX;
|
31101 | const y2 = e.targetTouches[1].pageY;
|
31102 | const distance = Math.sqrt(((x2 - x1) ** 2) + ((y2 - y1) ** 2));
|
31103 | return distance;
|
31104 | },
|
31105 |
|
31106 | onGestureStart(e) {
|
31107 | const swiper = this;
|
31108 | const params = swiper.params.zoom;
|
31109 | const zoom = swiper.zoom;
|
31110 | const { gesture } = zoom;
|
31111 | zoom.fakeGestureTouched = false;
|
31112 | zoom.fakeGestureMoved = false;
|
31113 | if (!Support.gestures) {
|
31114 | if (e.type !== 'touchstart' || (e.type === 'touchstart' && e.targetTouches.length < 2)) {
|
31115 | return;
|
31116 | }
|
31117 | zoom.fakeGestureTouched = true;
|
31118 | gesture.scaleStart = Zoom.getDistanceBetweenTouches(e);
|
31119 | }
|
31120 | if (!gesture.$slideEl || !gesture.$slideEl.length) {
|
31121 | gesture.$slideEl = $(e.target).closest(`.${swiper.params.slideClass}`);
|
31122 | if (gesture.$slideEl.length === 0) gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
|
31123 | gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
|
31124 | gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
|
31125 | gesture.maxRatio = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
|
31126 | if (gesture.$imageWrapEl.length === 0) {
|
31127 | gesture.$imageEl = undefined;
|
31128 | return;
|
31129 | }
|
31130 | }
|
31131 | if (gesture.$imageEl) {
|
31132 | gesture.$imageEl.transition(0);
|
31133 | }
|
31134 | swiper.zoom.isScaling = true;
|
31135 | },
|
31136 | onGestureChange(e) {
|
31137 | const swiper = this;
|
31138 | const params = swiper.params.zoom;
|
31139 | const zoom = swiper.zoom;
|
31140 | const { gesture } = zoom;
|
31141 | if (!Support.gestures) {
|
31142 | if (e.type !== 'touchmove' || (e.type === 'touchmove' && e.targetTouches.length < 2)) {
|
31143 | return;
|
31144 | }
|
31145 | zoom.fakeGestureMoved = true;
|
31146 | gesture.scaleMove = Zoom.getDistanceBetweenTouches(e);
|
31147 | }
|
31148 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31149 | if (Support.gestures) {
|
31150 | zoom.scale = e.scale * zoom.currentScale;
|
31151 | } else {
|
31152 | zoom.scale = (gesture.scaleMove / gesture.scaleStart) * zoom.currentScale;
|
31153 | }
|
31154 | if (zoom.scale > gesture.maxRatio) {
|
31155 | zoom.scale = (gesture.maxRatio - 1) + (((zoom.scale - gesture.maxRatio) + 1) ** 0.5);
|
31156 | }
|
31157 | if (zoom.scale < params.minRatio) {
|
31158 | zoom.scale = (params.minRatio + 1) - (((params.minRatio - zoom.scale) + 1) ** 0.5);
|
31159 | }
|
31160 | gesture.$imageEl.transform(`translate3d(0,0,0) scale(${zoom.scale})`);
|
31161 | },
|
31162 | onGestureEnd(e) {
|
31163 | const swiper = this;
|
31164 | const params = swiper.params.zoom;
|
31165 | const zoom = swiper.zoom;
|
31166 | const { gesture } = zoom;
|
31167 | if (!Support.gestures) {
|
31168 | if (!zoom.fakeGestureTouched || !zoom.fakeGestureMoved) {
|
31169 | return;
|
31170 | }
|
31171 | if (e.type !== 'touchend' || (e.type === 'touchend' && e.changedTouches.length < 2 && !Device.android)) {
|
31172 | return;
|
31173 | }
|
31174 | zoom.fakeGestureTouched = false;
|
31175 | zoom.fakeGestureMoved = false;
|
31176 | }
|
31177 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31178 | zoom.scale = Math.max(Math.min(zoom.scale, gesture.maxRatio), params.minRatio);
|
31179 | gesture.$imageEl.transition(swiper.params.speed).transform(`translate3d(0,0,0) scale(${zoom.scale})`);
|
31180 | zoom.currentScale = zoom.scale;
|
31181 | zoom.isScaling = false;
|
31182 | if (zoom.scale === 1) gesture.$slideEl = undefined;
|
31183 | },
|
31184 | onTouchStart(e) {
|
31185 | const swiper = this;
|
31186 | const zoom = swiper.zoom;
|
31187 | const { gesture, image } = zoom;
|
31188 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31189 | if (image.isTouched) return;
|
31190 | if (Device.android && e.cancelable) e.preventDefault();
|
31191 | image.isTouched = true;
|
31192 | image.touchesStart.x = e.type === 'touchstart' ? e.targetTouches[0].pageX : e.pageX;
|
31193 | image.touchesStart.y = e.type === 'touchstart' ? e.targetTouches[0].pageY : e.pageY;
|
31194 | },
|
31195 | onTouchMove(e) {
|
31196 | const swiper = this;
|
31197 | const zoom = swiper.zoom;
|
31198 | const { gesture, image, velocity } = zoom;
|
31199 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31200 | swiper.allowClick = false;
|
31201 | if (!image.isTouched || !gesture.$slideEl) return;
|
31202 |
|
31203 | if (!image.isMoved) {
|
31204 | image.width = gesture.$imageEl[0].offsetWidth;
|
31205 | image.height = gesture.$imageEl[0].offsetHeight;
|
31206 | image.startX = Utils.getTranslate(gesture.$imageWrapEl[0], 'x') || 0;
|
31207 | image.startY = Utils.getTranslate(gesture.$imageWrapEl[0], 'y') || 0;
|
31208 | gesture.slideWidth = gesture.$slideEl[0].offsetWidth;
|
31209 | gesture.slideHeight = gesture.$slideEl[0].offsetHeight;
|
31210 | gesture.$imageWrapEl.transition(0);
|
31211 | if (swiper.rtl) {
|
31212 | image.startX = -image.startX;
|
31213 | image.startY = -image.startY;
|
31214 | }
|
31215 | }
|
31216 |
|
31217 | const scaledWidth = image.width * zoom.scale;
|
31218 | const scaledHeight = image.height * zoom.scale;
|
31219 |
|
31220 | if (scaledWidth < gesture.slideWidth && scaledHeight < gesture.slideHeight) return;
|
31221 |
|
31222 | image.minX = Math.min(((gesture.slideWidth / 2) - (scaledWidth / 2)), 0);
|
31223 | image.maxX = -image.minX;
|
31224 | image.minY = Math.min(((gesture.slideHeight / 2) - (scaledHeight / 2)), 0);
|
31225 | image.maxY = -image.minY;
|
31226 |
|
31227 | image.touchesCurrent.x = e.type === 'touchmove' ? e.targetTouches[0].pageX : e.pageX;
|
31228 | image.touchesCurrent.y = e.type === 'touchmove' ? e.targetTouches[0].pageY : e.pageY;
|
31229 |
|
31230 | if (!image.isMoved && !zoom.isScaling) {
|
31231 | if (
|
31232 | swiper.isHorizontal()
|
31233 | && (
|
31234 | (Math.floor(image.minX) === Math.floor(image.startX) && image.touchesCurrent.x < image.touchesStart.x)
|
31235 | || (Math.floor(image.maxX) === Math.floor(image.startX) && image.touchesCurrent.x > image.touchesStart.x)
|
31236 | )
|
31237 | ) {
|
31238 | image.isTouched = false;
|
31239 | return;
|
31240 | } if (
|
31241 | !swiper.isHorizontal()
|
31242 | && (
|
31243 | (Math.floor(image.minY) === Math.floor(image.startY) && image.touchesCurrent.y < image.touchesStart.y)
|
31244 | || (Math.floor(image.maxY) === Math.floor(image.startY) && image.touchesCurrent.y > image.touchesStart.y)
|
31245 | )
|
31246 | ) {
|
31247 | image.isTouched = false;
|
31248 | return;
|
31249 | }
|
31250 | }
|
31251 | if (e.cancelable) {
|
31252 | e.preventDefault();
|
31253 | }
|
31254 | e.stopPropagation();
|
31255 |
|
31256 | image.isMoved = true;
|
31257 | image.currentX = (image.touchesCurrent.x - image.touchesStart.x) + image.startX;
|
31258 | image.currentY = (image.touchesCurrent.y - image.touchesStart.y) + image.startY;
|
31259 |
|
31260 | if (image.currentX < image.minX) {
|
31261 | image.currentX = (image.minX + 1) - (((image.minX - image.currentX) + 1) ** 0.8);
|
31262 | }
|
31263 | if (image.currentX > image.maxX) {
|
31264 | image.currentX = (image.maxX - 1) + (((image.currentX - image.maxX) + 1) ** 0.8);
|
31265 | }
|
31266 |
|
31267 | if (image.currentY < image.minY) {
|
31268 | image.currentY = (image.minY + 1) - (((image.minY - image.currentY) + 1) ** 0.8);
|
31269 | }
|
31270 | if (image.currentY > image.maxY) {
|
31271 | image.currentY = (image.maxY - 1) + (((image.currentY - image.maxY) + 1) ** 0.8);
|
31272 | }
|
31273 |
|
31274 |
|
31275 | if (!velocity.prevPositionX) velocity.prevPositionX = image.touchesCurrent.x;
|
31276 | if (!velocity.prevPositionY) velocity.prevPositionY = image.touchesCurrent.y;
|
31277 | if (!velocity.prevTime) velocity.prevTime = Date.now();
|
31278 | velocity.x = (image.touchesCurrent.x - velocity.prevPositionX) / (Date.now() - velocity.prevTime) / 2;
|
31279 | velocity.y = (image.touchesCurrent.y - velocity.prevPositionY) / (Date.now() - velocity.prevTime) / 2;
|
31280 | if (Math.abs(image.touchesCurrent.x - velocity.prevPositionX) < 2) velocity.x = 0;
|
31281 | if (Math.abs(image.touchesCurrent.y - velocity.prevPositionY) < 2) velocity.y = 0;
|
31282 | velocity.prevPositionX = image.touchesCurrent.x;
|
31283 | velocity.prevPositionY = image.touchesCurrent.y;
|
31284 | velocity.prevTime = Date.now();
|
31285 |
|
31286 | gesture.$imageWrapEl.transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`);
|
31287 | },
|
31288 | onTouchEnd() {
|
31289 | const swiper = this;
|
31290 | const zoom = swiper.zoom;
|
31291 | const { gesture, image, velocity } = zoom;
|
31292 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31293 | if (!image.isTouched || !image.isMoved) {
|
31294 | image.isTouched = false;
|
31295 | image.isMoved = false;
|
31296 | return;
|
31297 | }
|
31298 | image.isTouched = false;
|
31299 | image.isMoved = false;
|
31300 | let momentumDurationX = 300;
|
31301 | let momentumDurationY = 300;
|
31302 | const momentumDistanceX = velocity.x * momentumDurationX;
|
31303 | const newPositionX = image.currentX + momentumDistanceX;
|
31304 | const momentumDistanceY = velocity.y * momentumDurationY;
|
31305 | const newPositionY = image.currentY + momentumDistanceY;
|
31306 |
|
31307 |
|
31308 | if (velocity.x !== 0) momentumDurationX = Math.abs((newPositionX - image.currentX) / velocity.x);
|
31309 | if (velocity.y !== 0) momentumDurationY = Math.abs((newPositionY - image.currentY) / velocity.y);
|
31310 | const momentumDuration = Math.max(momentumDurationX, momentumDurationY);
|
31311 |
|
31312 | image.currentX = newPositionX;
|
31313 | image.currentY = newPositionY;
|
31314 |
|
31315 |
|
31316 | const scaledWidth = image.width * zoom.scale;
|
31317 | const scaledHeight = image.height * zoom.scale;
|
31318 | image.minX = Math.min(((gesture.slideWidth / 2) - (scaledWidth / 2)), 0);
|
31319 | image.maxX = -image.minX;
|
31320 | image.minY = Math.min(((gesture.slideHeight / 2) - (scaledHeight / 2)), 0);
|
31321 | image.maxY = -image.minY;
|
31322 | image.currentX = Math.max(Math.min(image.currentX, image.maxX), image.minX);
|
31323 | image.currentY = Math.max(Math.min(image.currentY, image.maxY), image.minY);
|
31324 |
|
31325 | gesture.$imageWrapEl.transition(momentumDuration).transform(`translate3d(${image.currentX}px, ${image.currentY}px,0)`);
|
31326 | },
|
31327 | onTransitionEnd() {
|
31328 | const swiper = this;
|
31329 | const zoom = swiper.zoom;
|
31330 | const { gesture } = zoom;
|
31331 | if (gesture.$slideEl && swiper.previousIndex !== swiper.activeIndex) {
|
31332 | if (gesture.$imageEl) {
|
31333 | gesture.$imageEl.transform('translate3d(0,0,0) scale(1)');
|
31334 | }
|
31335 | if (gesture.$imageWrapEl) {
|
31336 | gesture.$imageWrapEl.transform('translate3d(0,0,0)');
|
31337 | }
|
31338 |
|
31339 | zoom.scale = 1;
|
31340 | zoom.currentScale = 1;
|
31341 |
|
31342 | gesture.$slideEl = undefined;
|
31343 | gesture.$imageEl = undefined;
|
31344 | gesture.$imageWrapEl = undefined;
|
31345 | }
|
31346 | },
|
31347 |
|
31348 | toggle(e) {
|
31349 | const swiper = this;
|
31350 | const zoom = swiper.zoom;
|
31351 |
|
31352 | if (zoom.scale && zoom.scale !== 1) {
|
31353 |
|
31354 | zoom.out();
|
31355 | } else {
|
31356 |
|
31357 | zoom.in(e);
|
31358 | }
|
31359 | },
|
31360 | in(e) {
|
31361 | const swiper = this;
|
31362 |
|
31363 | const zoom = swiper.zoom;
|
31364 | const params = swiper.params.zoom;
|
31365 | const { gesture, image } = zoom;
|
31366 |
|
31367 | if (!gesture.$slideEl) {
|
31368 | if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {
|
31369 | gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`);
|
31370 | } else {
|
31371 | gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
|
31372 | }
|
31373 | gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
|
31374 | gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
|
31375 | }
|
31376 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31377 |
|
31378 | gesture.$slideEl.addClass(`${params.zoomedSlideClass}`);
|
31379 |
|
31380 | let touchX;
|
31381 | let touchY;
|
31382 | let offsetX;
|
31383 | let offsetY;
|
31384 | let diffX;
|
31385 | let diffY;
|
31386 | let translateX;
|
31387 | let translateY;
|
31388 | let imageWidth;
|
31389 | let imageHeight;
|
31390 | let scaledWidth;
|
31391 | let scaledHeight;
|
31392 | let translateMinX;
|
31393 | let translateMinY;
|
31394 | let translateMaxX;
|
31395 | let translateMaxY;
|
31396 | let slideWidth;
|
31397 | let slideHeight;
|
31398 |
|
31399 | if (typeof image.touchesStart.x === 'undefined' && e) {
|
31400 | touchX = e.type === 'touchend' ? e.changedTouches[0].pageX : e.pageX;
|
31401 | touchY = e.type === 'touchend' ? e.changedTouches[0].pageY : e.pageY;
|
31402 | } else {
|
31403 | touchX = image.touchesStart.x;
|
31404 | touchY = image.touchesStart.y;
|
31405 | }
|
31406 |
|
31407 | zoom.scale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
|
31408 | zoom.currentScale = gesture.$imageWrapEl.attr('data-swiper-zoom') || params.maxRatio;
|
31409 | if (e) {
|
31410 | slideWidth = gesture.$slideEl[0].offsetWidth;
|
31411 | slideHeight = gesture.$slideEl[0].offsetHeight;
|
31412 | offsetX = gesture.$slideEl.offset().left;
|
31413 | offsetY = gesture.$slideEl.offset().top;
|
31414 | diffX = (offsetX + (slideWidth / 2)) - touchX;
|
31415 | diffY = (offsetY + (slideHeight / 2)) - touchY;
|
31416 |
|
31417 | imageWidth = gesture.$imageEl[0].offsetWidth;
|
31418 | imageHeight = gesture.$imageEl[0].offsetHeight;
|
31419 | scaledWidth = imageWidth * zoom.scale;
|
31420 | scaledHeight = imageHeight * zoom.scale;
|
31421 |
|
31422 | translateMinX = Math.min(((slideWidth / 2) - (scaledWidth / 2)), 0);
|
31423 | translateMinY = Math.min(((slideHeight / 2) - (scaledHeight / 2)), 0);
|
31424 | translateMaxX = -translateMinX;
|
31425 | translateMaxY = -translateMinY;
|
31426 |
|
31427 | translateX = diffX * zoom.scale;
|
31428 | translateY = diffY * zoom.scale;
|
31429 |
|
31430 | if (translateX < translateMinX) {
|
31431 | translateX = translateMinX;
|
31432 | }
|
31433 | if (translateX > translateMaxX) {
|
31434 | translateX = translateMaxX;
|
31435 | }
|
31436 |
|
31437 | if (translateY < translateMinY) {
|
31438 | translateY = translateMinY;
|
31439 | }
|
31440 | if (translateY > translateMaxY) {
|
31441 | translateY = translateMaxY;
|
31442 | }
|
31443 | } else {
|
31444 | translateX = 0;
|
31445 | translateY = 0;
|
31446 | }
|
31447 | gesture.$imageWrapEl.transition(300).transform(`translate3d(${translateX}px, ${translateY}px,0)`);
|
31448 | gesture.$imageEl.transition(300).transform(`translate3d(0,0,0) scale(${zoom.scale})`);
|
31449 | },
|
31450 | out() {
|
31451 | const swiper = this;
|
31452 |
|
31453 | const zoom = swiper.zoom;
|
31454 | const params = swiper.params.zoom;
|
31455 | const { gesture } = zoom;
|
31456 |
|
31457 | if (!gesture.$slideEl) {
|
31458 | if (swiper.params.virtual && swiper.params.virtual.enabled && swiper.virtual) {
|
31459 | gesture.$slideEl = swiper.$wrapperEl.children(`.${swiper.params.slideActiveClass}`);
|
31460 | } else {
|
31461 | gesture.$slideEl = swiper.slides.eq(swiper.activeIndex);
|
31462 | }
|
31463 | gesture.$imageEl = gesture.$slideEl.find('img, svg, canvas, picture, .swiper-zoom-target');
|
31464 | gesture.$imageWrapEl = gesture.$imageEl.parent(`.${params.containerClass}`);
|
31465 | }
|
31466 | if (!gesture.$imageEl || gesture.$imageEl.length === 0) return;
|
31467 |
|
31468 | zoom.scale = 1;
|
31469 | zoom.currentScale = 1;
|
31470 | gesture.$imageWrapEl.transition(300).transform('translate3d(0,0,0)');
|
31471 | gesture.$imageEl.transition(300).transform('translate3d(0,0,0) scale(1)');
|
31472 | gesture.$slideEl.removeClass(`${params.zoomedSlideClass}`);
|
31473 | gesture.$slideEl = undefined;
|
31474 | },
|
31475 |
|
31476 | enable() {
|
31477 | const swiper = this;
|
31478 | const zoom = swiper.zoom;
|
31479 | if (zoom.enabled) return;
|
31480 | zoom.enabled = true;
|
31481 |
|
31482 | const passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? { passive: true, capture: false } : false;
|
31483 | const activeListenerWithCapture = Support.passiveListener ? { passive: false, capture: true } : true;
|
31484 |
|
31485 | const slideSelector = `.${swiper.params.slideClass}`;
|
31486 |
|
31487 |
|
31488 | if (Support.gestures) {
|
31489 | swiper.$wrapperEl.on('gesturestart', slideSelector, zoom.onGestureStart, passiveListener);
|
31490 | swiper.$wrapperEl.on('gesturechange', slideSelector, zoom.onGestureChange, passiveListener);
|
31491 | swiper.$wrapperEl.on('gestureend', slideSelector, zoom.onGestureEnd, passiveListener);
|
31492 | } else if (swiper.touchEvents.start === 'touchstart') {
|
31493 | swiper.$wrapperEl.on(swiper.touchEvents.start, slideSelector, zoom.onGestureStart, passiveListener);
|
31494 | swiper.$wrapperEl.on(swiper.touchEvents.move, slideSelector, zoom.onGestureChange, activeListenerWithCapture);
|
31495 | swiper.$wrapperEl.on(swiper.touchEvents.end, slideSelector, zoom.onGestureEnd, passiveListener);
|
31496 | if (swiper.touchEvents.cancel) {
|
31497 | swiper.$wrapperEl.on(swiper.touchEvents.cancel, slideSelector, zoom.onGestureEnd, passiveListener);
|
31498 | }
|
31499 | }
|
31500 |
|
31501 |
|
31502 | swiper.$wrapperEl.on(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, zoom.onTouchMove, activeListenerWithCapture);
|
31503 | },
|
31504 | disable() {
|
31505 | const swiper = this;
|
31506 | const zoom = swiper.zoom;
|
31507 | if (!zoom.enabled) return;
|
31508 |
|
31509 | swiper.zoom.enabled = false;
|
31510 |
|
31511 | const passiveListener = swiper.touchEvents.start === 'touchstart' && Support.passiveListener && swiper.params.passiveListeners ? { passive: true, capture: false } : false;
|
31512 | const activeListenerWithCapture = Support.passiveListener ? { passive: false, capture: true } : true;
|
31513 |
|
31514 | const slideSelector = `.${swiper.params.slideClass}`;
|
31515 |
|
31516 |
|
31517 | if (Support.gestures) {
|
31518 | swiper.$wrapperEl.off('gesturestart', slideSelector, zoom.onGestureStart, passiveListener);
|
31519 | swiper.$wrapperEl.off('gesturechange', slideSelector, zoom.onGestureChange, passiveListener);
|
31520 | swiper.$wrapperEl.off('gestureend', slideSelector, zoom.onGestureEnd, passiveListener);
|
31521 | } else if (swiper.touchEvents.start === 'touchstart') {
|
31522 | swiper.$wrapperEl.off(swiper.touchEvents.start, slideSelector, zoom.onGestureStart, passiveListener);
|
31523 | swiper.$wrapperEl.off(swiper.touchEvents.move, slideSelector, zoom.onGestureChange, activeListenerWithCapture);
|
31524 | swiper.$wrapperEl.off(swiper.touchEvents.end, slideSelector, zoom.onGestureEnd, passiveListener);
|
31525 | if (swiper.touchEvents.cancel) {
|
31526 | swiper.$wrapperEl.off(swiper.touchEvents.cancel, slideSelector, zoom.onGestureEnd, passiveListener);
|
31527 | }
|
31528 | }
|
31529 |
|
31530 |
|
31531 | swiper.$wrapperEl.off(swiper.touchEvents.move, `.${swiper.params.zoom.containerClass}`, zoom.onTouchMove, activeListenerWithCapture);
|
31532 | },
|
31533 | };
|
31534 |
|
31535 | var zoom = {
|
31536 | name: 'zoom',
|
31537 | params: {
|
31538 | zoom: {
|
31539 | enabled: false,
|
31540 | maxRatio: 3,
|
31541 | minRatio: 1,
|
31542 | toggle: true,
|
31543 | containerClass: 'swiper-zoom-container',
|
31544 | zoomedSlideClass: 'swiper-slide-zoomed',
|
31545 | },
|
31546 | },
|
31547 | create() {
|
31548 | const swiper = this;
|
31549 | const zoom = {
|
31550 | enabled: false,
|
31551 | scale: 1,
|
31552 | currentScale: 1,
|
31553 | isScaling: false,
|
31554 | gesture: {
|
31555 | $slideEl: undefined,
|
31556 | slideWidth: undefined,
|
31557 | slideHeight: undefined,
|
31558 | $imageEl: undefined,
|
31559 | $imageWrapEl: undefined,
|
31560 | maxRatio: 3,
|
31561 | },
|
31562 | image: {
|
31563 | isTouched: undefined,
|
31564 | isMoved: undefined,
|
31565 | currentX: undefined,
|
31566 | currentY: undefined,
|
31567 | minX: undefined,
|
31568 | minY: undefined,
|
31569 | maxX: undefined,
|
31570 | maxY: undefined,
|
31571 | width: undefined,
|
31572 | height: undefined,
|
31573 | startX: undefined,
|
31574 | startY: undefined,
|
31575 | touchesStart: {},
|
31576 | touchesCurrent: {},
|
31577 | },
|
31578 | velocity: {
|
31579 | x: undefined,
|
31580 | y: undefined,
|
31581 | prevPositionX: undefined,
|
31582 | prevPositionY: undefined,
|
31583 | prevTime: undefined,
|
31584 | },
|
31585 | };
|
31586 |
|
31587 | ('onGestureStart onGestureChange onGestureEnd onTouchStart onTouchMove onTouchEnd onTransitionEnd toggle enable disable in out').split(' ').forEach((methodName) => {
|
31588 | zoom[methodName] = Zoom[methodName].bind(swiper);
|
31589 | });
|
31590 | Utils.extend(swiper, {
|
31591 | zoom,
|
31592 | });
|
31593 |
|
31594 | let scale = 1;
|
31595 | Object.defineProperty(swiper.zoom, 'scale', {
|
31596 | get() {
|
31597 | return scale;
|
31598 | },
|
31599 | set(value) {
|
31600 | if (scale !== value) {
|
31601 | const imageEl = swiper.zoom.gesture.$imageEl ? swiper.zoom.gesture.$imageEl[0] : undefined;
|
31602 | const slideEl = swiper.zoom.gesture.$slideEl ? swiper.zoom.gesture.$slideEl[0] : undefined;
|
31603 | swiper.emit('zoomChange', value, imageEl, slideEl);
|
31604 | }
|
31605 | scale = value;
|
31606 | },
|
31607 | });
|
31608 | },
|
31609 | on: {
|
31610 | init() {
|
31611 | const swiper = this;
|
31612 | if (swiper.params.zoom.enabled) {
|
31613 | swiper.zoom.enable();
|
31614 | }
|
31615 | },
|
31616 | destroy() {
|
31617 | const swiper = this;
|
31618 | swiper.zoom.disable();
|
31619 | },
|
31620 | touchStart(e) {
|
31621 | const swiper = this;
|
31622 | if (!swiper.zoom.enabled) return;
|
31623 | swiper.zoom.onTouchStart(e);
|
31624 | },
|
31625 | touchEnd(e) {
|
31626 | const swiper = this;
|
31627 | if (!swiper.zoom.enabled) return;
|
31628 | swiper.zoom.onTouchEnd(e);
|
31629 | },
|
31630 | doubleTap(e) {
|
31631 | const swiper = this;
|
31632 | if (swiper.params.zoom.enabled && swiper.zoom.enabled && swiper.params.zoom.toggle) {
|
31633 | swiper.zoom.toggle(e);
|
31634 | }
|
31635 | },
|
31636 | transitionEnd() {
|
31637 | const swiper = this;
|
31638 | if (swiper.zoom.enabled && swiper.params.zoom.enabled) {
|
31639 | swiper.zoom.onTransitionEnd();
|
31640 | }
|
31641 | },
|
31642 | slideChange() {
|
31643 | const swiper = this;
|
31644 | if (swiper.zoom.enabled && swiper.params.zoom.enabled && swiper.params.cssMode) {
|
31645 | swiper.zoom.onTransitionEnd();
|
31646 | }
|
31647 | },
|
31648 | },
|
31649 | };
|
31650 |
|
31651 |
|
31652 |
|
31653 | const Autoplay = {
|
31654 | run() {
|
31655 | const swiper = this;
|
31656 | const $activeSlideEl = swiper.slides.eq(swiper.activeIndex);
|
31657 | let delay = swiper.params.autoplay.delay;
|
31658 | if ($activeSlideEl.attr('data-swiper-autoplay')) {
|
31659 | delay = $activeSlideEl.attr('data-swiper-autoplay') || swiper.params.autoplay.delay;
|
31660 | }
|
31661 | clearTimeout(swiper.autoplay.timeout);
|
31662 | swiper.autoplay.timeout = Utils.nextTick(() => {
|
31663 | if (swiper.params.autoplay.reverseDirection) {
|
31664 | if (swiper.params.loop) {
|
31665 | swiper.loopFix();
|
31666 | swiper.slidePrev(swiper.params.speed, true, true);
|
31667 | swiper.emit('autoplay');
|
31668 | } else if (!swiper.isBeginning) {
|
31669 | swiper.slidePrev(swiper.params.speed, true, true);
|
31670 | swiper.emit('autoplay');
|
31671 | } else if (!swiper.params.autoplay.stopOnLastSlide) {
|
31672 | swiper.slideTo(swiper.slides.length - 1, swiper.params.speed, true, true);
|
31673 | swiper.emit('autoplay');
|
31674 | } else {
|
31675 | swiper.autoplay.stop();
|
31676 | }
|
31677 | } else if (swiper.params.loop) {
|
31678 | swiper.loopFix();
|
31679 | swiper.slideNext(swiper.params.speed, true, true);
|
31680 | swiper.emit('autoplay');
|
31681 | } else if (!swiper.isEnd) {
|
31682 | swiper.slideNext(swiper.params.speed, true, true);
|
31683 | swiper.emit('autoplay');
|
31684 | } else if (!swiper.params.autoplay.stopOnLastSlide) {
|
31685 | swiper.slideTo(0, swiper.params.speed, true, true);
|
31686 | swiper.emit('autoplay');
|
31687 | } else {
|
31688 | swiper.autoplay.stop();
|
31689 | }
|
31690 | if (swiper.params.cssMode && swiper.autoplay.running) swiper.autoplay.run();
|
31691 | }, delay);
|
31692 | },
|
31693 | start() {
|
31694 | const swiper = this;
|
31695 | if (typeof swiper.autoplay.timeout !== 'undefined') return false;
|
31696 | if (swiper.autoplay.running) return false;
|
31697 | swiper.autoplay.running = true;
|
31698 | swiper.emit('autoplayStart');
|
31699 | swiper.autoplay.run();
|
31700 | return true;
|
31701 | },
|
31702 | stop() {
|
31703 | const swiper = this;
|
31704 | if (!swiper.autoplay.running) return false;
|
31705 | if (typeof swiper.autoplay.timeout === 'undefined') return false;
|
31706 |
|
31707 | if (swiper.autoplay.timeout) {
|
31708 | clearTimeout(swiper.autoplay.timeout);
|
31709 | swiper.autoplay.timeout = undefined;
|
31710 | }
|
31711 | swiper.autoplay.running = false;
|
31712 | swiper.emit('autoplayStop');
|
31713 | return true;
|
31714 | },
|
31715 | pause(speed) {
|
31716 | const swiper = this;
|
31717 | if (!swiper.autoplay.running) return;
|
31718 | if (swiper.autoplay.paused) return;
|
31719 | if (swiper.autoplay.timeout) clearTimeout(swiper.autoplay.timeout);
|
31720 | swiper.autoplay.paused = true;
|
31721 | if (speed === 0 || !swiper.params.autoplay.waitForTransition) {
|
31722 | swiper.autoplay.paused = false;
|
31723 | swiper.autoplay.run();
|
31724 | } else {
|
31725 | swiper.$wrapperEl[0].addEventListener('transitionend', swiper.autoplay.onTransitionEnd);
|
31726 | swiper.$wrapperEl[0].addEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
|
31727 | }
|
31728 | },
|
31729 | };
|
31730 |
|
31731 | var autoplay = {
|
31732 | name: 'autoplay',
|
31733 | params: {
|
31734 | autoplay: {
|
31735 | enabled: false,
|
31736 | delay: 3000,
|
31737 | waitForTransition: true,
|
31738 | disableOnInteraction: true,
|
31739 | stopOnLastSlide: false,
|
31740 | reverseDirection: false,
|
31741 | },
|
31742 | },
|
31743 | create() {
|
31744 | const swiper = this;
|
31745 | Utils.extend(swiper, {
|
31746 | autoplay: {
|
31747 | running: false,
|
31748 | paused: false,
|
31749 | run: Autoplay.run.bind(swiper),
|
31750 | start: Autoplay.start.bind(swiper),
|
31751 | stop: Autoplay.stop.bind(swiper),
|
31752 | pause: Autoplay.pause.bind(swiper),
|
31753 | onVisibilityChange() {
|
31754 | if (document.visibilityState === 'hidden' && swiper.autoplay.running) {
|
31755 | swiper.autoplay.pause();
|
31756 | }
|
31757 | if (document.visibilityState === 'visible' && swiper.autoplay.paused) {
|
31758 | swiper.autoplay.run();
|
31759 | swiper.autoplay.paused = false;
|
31760 | }
|
31761 | },
|
31762 | onTransitionEnd(e) {
|
31763 | if (!swiper || swiper.destroyed || !swiper.$wrapperEl) return;
|
31764 | if (e.target !== this) return;
|
31765 | swiper.$wrapperEl[0].removeEventListener('transitionend', swiper.autoplay.onTransitionEnd);
|
31766 | swiper.$wrapperEl[0].removeEventListener('webkitTransitionEnd', swiper.autoplay.onTransitionEnd);
|
31767 | swiper.autoplay.paused = false;
|
31768 | if (!swiper.autoplay.running) {
|
31769 | swiper.autoplay.stop();
|
31770 | } else {
|
31771 | swiper.autoplay.run();
|
31772 | }
|
31773 | },
|
31774 | },
|
31775 | });
|
31776 | },
|
31777 | on: {
|
31778 | init() {
|
31779 | const swiper = this;
|
31780 | if (swiper.params.autoplay.enabled) {
|
31781 | swiper.autoplay.start();
|
31782 | document.addEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
|
31783 | }
|
31784 | },
|
31785 | beforeTransitionStart(speed, internal) {
|
31786 | const swiper = this;
|
31787 | if (swiper.autoplay.running) {
|
31788 | if (internal || !swiper.params.autoplay.disableOnInteraction) {
|
31789 | swiper.autoplay.pause(speed);
|
31790 | } else {
|
31791 | swiper.autoplay.stop();
|
31792 | }
|
31793 | }
|
31794 | },
|
31795 | sliderFirstMove() {
|
31796 | const swiper = this;
|
31797 | if (swiper.autoplay.running) {
|
31798 | if (swiper.params.autoplay.disableOnInteraction) {
|
31799 | swiper.autoplay.stop();
|
31800 | } else {
|
31801 | swiper.autoplay.pause();
|
31802 | }
|
31803 | }
|
31804 | },
|
31805 | touchEnd() {
|
31806 | const swiper = this;
|
31807 | if (swiper.params.cssMode && swiper.autoplay.paused && !swiper.params.autoplay.disableOnInteraction) {
|
31808 | swiper.autoplay.run();
|
31809 | }
|
31810 | },
|
31811 | destroy() {
|
31812 | const swiper = this;
|
31813 | if (swiper.autoplay.running) {
|
31814 | swiper.autoplay.stop();
|
31815 | }
|
31816 | document.removeEventListener('visibilitychange', swiper.autoplay.onVisibilityChange);
|
31817 | },
|
31818 | },
|
31819 | };
|
31820 |
|
31821 |
|
31822 |
|
31823 | const components = [
|
31824 | Device$1,
|
31825 | Support$1,
|
31826 | Browser$1,
|
31827 | Resize,
|
31828 | Observer$1,
|
31829 | ];
|
31830 |
|
31831 | if (typeof Swiper.use === 'undefined') {
|
31832 | Swiper.use = Swiper.Class.use;
|
31833 | Swiper.installModule = Swiper.Class.installModule;
|
31834 | }
|
31835 |
|
31836 | Swiper.use(components);
|
31837 |
|
31838 | Swiper.use([pagination, scrollbar, autoplay, keyboard, zoom]);
|
31839 |
|
31840 | var swiper_bundle = Object.freeze({
|
31841 | __proto__: null,
|
31842 | Swiper: Swiper
|
31843 | });
|
31844 |
|
31845 | exports.hydrateApp = hydrateApp;
|
31846 |
|
31847 |
|
31848 |
|
31849 | hydrateApp(window, $stencilHydrateOpts, $stencilHydrateResults, $stencilAfterHydrate, $stencilHydrateResolve);
|
31850 | }
|
31851 |
|
31852 | hydrateAppClosure($stencilWindow);
|
31853 | }
|
31854 |
|
31855 | function createWindowFromHtml(e, t) {
|
31856 | let r = templateWindows.get(t);
|
31857 | return null == r && (r = new MockWindow(e), templateWindows.set(t, r)), cloneWindow(r);
|
31858 | }
|
31859 |
|
31860 | function normalizeHydrateOptions(e) {
|
31861 | const t = Object.assign({
|
31862 | serializeToHtml: !1,
|
31863 | destroyWindow: !1,
|
31864 | destroyDocument: !1
|
31865 | }, e || {});
|
31866 | return "boolean" != typeof t.clientHydrateAnnotations && (t.clientHydrateAnnotations = !0),
|
31867 | "boolean" != typeof t.constrainTimeouts && (t.constrainTimeouts = !0), "number" != typeof t.maxHydrateCount && (t.maxHydrateCount = 300),
|
31868 | "boolean" != typeof t.runtimeLogging && (t.runtimeLogging = !1), "number" != typeof t.timeout && (t.timeout = 15e3),
|
31869 | Array.isArray(t.excludeComponents) ? t.excludeComponents = t.excludeComponents.filter(filterValidTags).map(mapValidTags) : t.excludeComponents = [],
|
31870 | Array.isArray(t.staticComponents) ? t.staticComponents = t.staticComponents.filter(filterValidTags).map(mapValidTags) : t.staticComponents = [],
|
31871 | t;
|
31872 | }
|
31873 |
|
31874 | function filterValidTags(e) {
|
31875 | return "string" == typeof e && e.includes("-");
|
31876 | }
|
31877 |
|
31878 | function mapValidTags(e) {
|
31879 | return e.trim().toLowerCase();
|
31880 | }
|
31881 |
|
31882 | function generateHydrateResults(e) {
|
31883 | "string" != typeof e.url && (e.url = "https://hydrate.stenciljs.com/"), "string" != typeof e.buildId && (e.buildId = createHydrateBuildId());
|
31884 | const t = {
|
31885 | buildId: e.buildId,
|
31886 | diagnostics: [],
|
31887 | url: e.url,
|
31888 | host: null,
|
31889 | hostname: null,
|
31890 | href: null,
|
31891 | pathname: null,
|
31892 | port: null,
|
31893 | search: null,
|
31894 | hash: null,
|
31895 | html: null,
|
31896 | httpStatus: null,
|
31897 | hydratedCount: 0,
|
31898 | anchors: [],
|
31899 | components: [],
|
31900 | imgs: [],
|
31901 | scripts: [],
|
31902 | staticData: [],
|
31903 | styles: [],
|
31904 | title: null
|
31905 | };
|
31906 | try {
|
31907 | const r = new URL(e.url, "https://hydrate.stenciljs.com/");
|
31908 | t.url = r.href, t.host = r.host, t.hostname = r.hostname, t.href = r.href, t.port = r.port,
|
31909 | t.pathname = r.pathname, t.search = r.search, t.hash = r.hash;
|
31910 | } catch (e) {
|
31911 | renderCatchError(t, e);
|
31912 | }
|
31913 | return t;
|
31914 | }
|
31915 |
|
31916 | function renderBuildDiagnostic(e, t, r, s) {
|
31917 | const n = {
|
31918 | level: t,
|
31919 | type: "build",
|
31920 | header: r,
|
31921 | messageText: s,
|
31922 | relFilePath: null,
|
31923 | absFilePath: null,
|
31924 | lines: []
|
31925 | };
|
31926 | return e.pathname ? "/" !== e.pathname && (n.header += ": " + e.pathname) : e.url && (n.header += ": " + e.url),
|
31927 | e.diagnostics.push(n), n;
|
31928 | }
|
31929 |
|
31930 | function renderBuildError(e, t) {
|
31931 | return renderBuildDiagnostic(e, "error", "Hydrate Error", t);
|
31932 | }
|
31933 |
|
31934 | function renderCatchError(e, t) {
|
31935 | const r = renderBuildError(e, null);
|
31936 | return null != t && (null != t.stack ? r.messageText = t.stack.toString() : null != t.message ? r.messageText = t.message.toString() : r.messageText = t.toString()),
|
31937 | r;
|
31938 | }
|
31939 |
|
31940 | function runtimeLog(e, t, r) {
|
31941 | global.console[t].apply(global.console, [ `[ ${e} ${t} ] `, ...r ]);
|
31942 | }
|
31943 |
|
31944 | function inspectElement(e, t, r) {
|
31945 | const s = t.children;
|
31946 | for (let t = 0, n = s.length; t < n; t++) {
|
31947 | const n = s[t], o = n.nodeName.toLowerCase();
|
31948 | if (o.includes("-")) {
|
31949 | const t = e.components.find((e => e.tag === o));
|
31950 | null != t && (t.count++, r > t.depth && (t.depth = r));
|
31951 | } else switch (o) {
|
31952 | case "a":
|
31953 | const t = collectAttributes(n);
|
31954 | t.href = n.href, "string" == typeof t.href && (e.anchors.some((e => e.href === t.href)) || e.anchors.push(t));
|
31955 | break;
|
31956 |
|
31957 | case "img":
|
31958 | const r = collectAttributes(n);
|
31959 | r.src = n.src, "string" == typeof r.src && (e.imgs.some((e => e.src === r.src)) || e.imgs.push(r));
|
31960 | break;
|
31961 |
|
31962 | case "link":
|
31963 | const s = collectAttributes(n);
|
31964 | s.href = n.href, "string" == typeof s.rel && "stylesheet" === s.rel.toLowerCase() && "string" == typeof s.href && (e.styles.some((e => e.link === s.href)) || (delete s.rel,
|
31965 | delete s.type, e.styles.push(s)));
|
31966 | break;
|
31967 |
|
31968 | case "script":
|
31969 | const o = collectAttributes(n);
|
31970 | if (n.hasAttribute("src")) o.src = n.src, "string" == typeof o.src && (e.scripts.some((e => e.src === o.src)) || e.scripts.push(o)); else {
|
31971 | const t = n.getAttribute("data-stencil-static");
|
31972 | t && e.staticData.push({
|
31973 | id: t,
|
31974 | type: n.getAttribute("type"),
|
31975 | content: n.textContent
|
31976 | });
|
31977 | }
|
31978 | }
|
31979 | inspectElement(e, n, ++r);
|
31980 | }
|
31981 | }
|
31982 |
|
31983 | function collectAttributes(e) {
|
31984 | const t = {}, r = e.attributes;
|
31985 | for (let e = 0, s = r.length; e < s; e++) {
|
31986 | const s = r.item(e), n = s.nodeName.toLowerCase();
|
31987 | if (SKIP_ATTRS.has(n)) continue;
|
31988 | const o = s.nodeValue;
|
31989 | "class" === n && "" === o || (t[n] = o);
|
31990 | }
|
31991 | return t;
|
31992 | }
|
31993 |
|
31994 | function patchDomImplementation(e, t) {
|
31995 | let r;
|
31996 | if (null != e.defaultView ? (t.destroyWindow = !0, patchWindow(e.defaultView), r = e.defaultView) : (t.destroyWindow = !0,
|
31997 | t.destroyDocument = !1, r = new MockWindow(!1)), r.document !== e && (r.document = e),
|
31998 | e.defaultView !== r && (e.defaultView = r), "function" != typeof e.documentElement.constructor.prototype.getRootNode && (e.createElement("unknown-element").constructor.prototype.getRootNode = getRootNode),
|
31999 | "function" == typeof e.createEvent) {
|
32000 | const t = e.createEvent("CustomEvent").constructor;
|
32001 | r.CustomEvent !== t && (r.CustomEvent = t);
|
32002 | }
|
32003 | try {
|
32004 | e.baseURI;
|
32005 | } catch (t) {
|
32006 | Object.defineProperty(e, "baseURI", {
|
32007 | get() {
|
32008 | const t = e.querySelector("base[href]");
|
32009 | return t ? new URL(t.getAttribute("href"), r.location.href).href : r.location.href;
|
32010 | }
|
32011 | });
|
32012 | }
|
32013 | return r;
|
32014 | }
|
32015 |
|
32016 | function getRootNode(e) {
|
32017 | const t = null != e && !0 === e.composed;
|
32018 | let r = this;
|
32019 | for (;null != r.parentNode; ) r = r.parentNode, !0 === t && null == r.parentNode && null != r.host && (r = r.host);
|
32020 | return r;
|
32021 | }
|
32022 |
|
32023 | function renderToString(e, t) {
|
32024 | const r = normalizeHydrateOptions(t);
|
32025 | return r.serializeToHtml = !0, new Promise((t => {
|
32026 | let s;
|
32027 | const n = generateHydrateResults(r);
|
32028 | if (hasError(n.diagnostics)) t(n); else if ("string" == typeof e) try {
|
32029 | r.destroyWindow = !0, r.destroyDocument = !0, s = new MockWindow(e), render(s, r, n, t);
|
32030 | } catch (e) {
|
32031 | s && s.close && s.close(), s = null, renderCatchError(n, e), t(n);
|
32032 | } else if (isValidDocument(e)) try {
|
32033 | r.destroyDocument = !1, s = patchDomImplementation(e, r), render(s, r, n, t);
|
32034 | } catch (e) {
|
32035 | s && s.close && s.close(), s = null, renderCatchError(n, e), t(n);
|
32036 | } else renderBuildError(n, 'Invalid html or document. Must be either a valid "html" string, or DOM "document".'),
|
32037 | t(n);
|
32038 | }));
|
32039 | }
|
32040 |
|
32041 | function hydrateDocument(e, t) {
|
32042 | const r = normalizeHydrateOptions(t);
|
32043 | return r.serializeToHtml = !1, new Promise((t => {
|
32044 | let s;
|
32045 | const n = generateHydrateResults(r);
|
32046 | if (hasError(n.diagnostics)) t(n); else if ("string" == typeof e) try {
|
32047 | r.destroyWindow = !0, r.destroyDocument = !0, s = new MockWindow(e), render(s, r, n, t);
|
32048 | } catch (e) {
|
32049 | s && s.close && s.close(), s = null, renderCatchError(n, e), t(n);
|
32050 | } else if (isValidDocument(e)) try {
|
32051 | r.destroyDocument = !1, s = patchDomImplementation(e, r), render(s, r, n, t);
|
32052 | } catch (e) {
|
32053 | s && s.close && s.close(), s = null, renderCatchError(n, e), t(n);
|
32054 | } else renderBuildError(n, 'Invalid html or document. Must be either a valid "html" string, or DOM "document".'),
|
32055 | t(n);
|
32056 | }));
|
32057 | }
|
32058 |
|
32059 | function render(e, t, r, s) {
|
32060 | if (process.__stencilErrors || (process.__stencilErrors = !0, process.on("unhandledRejection", (e => {
|
32061 | console.log("unhandledRejection", e);
|
32062 | }))), function n(e, t, r, s) {
|
32063 | try {
|
32064 | e.location.href = r.url;
|
32065 | } catch (e) {
|
32066 | renderCatchError(s, e);
|
32067 | }
|
32068 | if ("string" == typeof r.userAgent) try {
|
32069 | e.navigator.userAgent = r.userAgent;
|
32070 | } catch (e) {}
|
32071 | if ("string" == typeof r.cookie) try {
|
32072 | t.cookie = r.cookie;
|
32073 | } catch (e) {}
|
32074 | if ("string" == typeof r.referrer) try {
|
32075 | t.referrer = r.referrer;
|
32076 | } catch (e) {}
|
32077 | if ("string" == typeof r.direction) try {
|
32078 | t.documentElement.setAttribute("dir", r.direction);
|
32079 | } catch (e) {}
|
32080 | if ("string" == typeof r.language) try {
|
32081 | t.documentElement.setAttribute("lang", r.language);
|
32082 | } catch (e) {}
|
32083 | if ("string" == typeof r.buildId) try {
|
32084 | t.documentElement.setAttribute("data-stencil-build", r.buildId);
|
32085 | } catch (e) {}
|
32086 | try {
|
32087 | e.customElements = null;
|
32088 | } catch (e) {}
|
32089 | return r.constrainTimeouts && constrainTimeouts(e), function n(e, t, r) {
|
32090 | try {
|
32091 | const s = e.location.pathname;
|
32092 | e.console.error = (...e) => {
|
32093 | const n = e.reduce(((e, t) => {
|
32094 | if (t) {
|
32095 | if (null != t.stack) return e + " " + String(t.stack);
|
32096 | if (null != t.message) return e + " " + String(t.message);
|
32097 | }
|
32098 | return String(t);
|
32099 | }), "").trim();
|
32100 | "" !== n && (renderCatchError(r, n), t.runtimeLogging && runtimeLog(s, "error", [ n ]));
|
32101 | }, e.console.debug = (...e) => {
|
32102 | renderBuildDiagnostic(r, "debug", "Hydrate Debug", [ ...e ].join(", ")), t.runtimeLogging && runtimeLog(s, "debug", e);
|
32103 | }, t.runtimeLogging && [ "log", "warn", "assert", "info", "trace" ].forEach((t => {
|
32104 | e.console[t] = (...e) => {
|
32105 | runtimeLog(s, t, e);
|
32106 | };
|
32107 | }));
|
32108 | } catch (e) {
|
32109 | renderCatchError(r, e);
|
32110 | }
|
32111 | }(e, r, s), e;
|
32112 | }(e, e.document, t, r), "function" == typeof t.beforeHydrate) try {
|
32113 | const n = t.beforeHydrate(e.document);
|
32114 | isPromise(n) ? n.then((() => {
|
32115 | hydrateFactory(e, t, r, afterHydrate, s);
|
32116 | })) : hydrateFactory(e, t, r, afterHydrate, s);
|
32117 | } catch (n) {
|
32118 | renderCatchError(r, n), finalizeHydrate(e, e.document, t, r, s);
|
32119 | } else hydrateFactory(e, t, r, afterHydrate, s);
|
32120 | }
|
32121 |
|
32122 | function afterHydrate(e, t, r, s) {
|
32123 | if ("function" == typeof t.afterHydrate) try {
|
32124 | const n = t.afterHydrate(e.document);
|
32125 | isPromise(n) ? n.then((() => {
|
32126 | finalizeHydrate(e, e.document, t, r, s);
|
32127 | })) : finalizeHydrate(e, e.document, t, r, s);
|
32128 | } catch (n) {
|
32129 | renderCatchError(r, n), finalizeHydrate(e, e.document, t, r, s);
|
32130 | } else finalizeHydrate(e, e.document, t, r, s);
|
32131 | }
|
32132 |
|
32133 | function finalizeHydrate(e, t, r, s, n) {
|
32134 | try {
|
32135 | if (inspectElement(s, t.documentElement, 0), !1 !== r.removeUnusedStyles) try {
|
32136 | ((e, t) => {
|
32137 | try {
|
32138 | const r = e.head.querySelectorAll("style[data-styles]"), s = r.length;
|
32139 | if (s > 0) {
|
32140 | const n = (e => {
|
32141 | const t = {
|
32142 | attrs: new Set,
|
32143 | classNames: new Set,
|
32144 | ids: new Set,
|
32145 | tags: new Set
|
32146 | };
|
32147 | return collectUsedSelectors(t, e), t;
|
32148 | })(e.documentElement);
|
32149 | for (let e = 0; e < s; e++) removeUnusedStyleText(n, t, r[e]);
|
32150 | }
|
32151 | } catch (e) {
|
32152 | ((e, t, r) => {
|
32153 | const s = {
|
32154 | level: "error",
|
32155 | type: "build",
|
32156 | header: "Build Error",
|
32157 | messageText: "build error",
|
32158 | relFilePath: null,
|
32159 | absFilePath: null,
|
32160 | lines: []
|
32161 | };
|
32162 | null != t && (null != t.stack ? s.messageText = t.stack.toString() : null != t.message ? s.messageText = t.message.toString() : s.messageText = t.toString()),
|
32163 | null == e || shouldIgnoreError(s.messageText) || e.push(s);
|
32164 | })(t, e);
|
32165 | }
|
32166 | })(t, s.diagnostics);
|
32167 | } catch (e) {
|
32168 | renderCatchError(s, e);
|
32169 | }
|
32170 | if ("string" == typeof r.title) try {
|
32171 | t.title = r.title;
|
32172 | } catch (e) {
|
32173 | renderCatchError(s, e);
|
32174 | }
|
32175 | s.title = t.title, r.removeScripts && removeScripts(t.documentElement);
|
32176 | try {
|
32177 | ((e, t) => {
|
32178 | let r = e.head.querySelector('link[rel="canonical"]');
|
32179 | "string" == typeof t ? (null == r && (r = e.createElement("link"), r.setAttribute("rel", "canonical"),
|
32180 | e.head.appendChild(r)), r.setAttribute("href", t)) : null != r && (r.getAttribute("href") || r.parentNode.removeChild(r));
|
32181 | })(t, r.canonicalUrl);
|
32182 | } catch (e) {
|
32183 | renderCatchError(s, e);
|
32184 | }
|
32185 | try {
|
32186 | (e => {
|
32187 | const t = e.head;
|
32188 | let r = t.querySelector("meta[charset]");
|
32189 | null == r ? (r = e.createElement("meta"), r.setAttribute("charset", "utf-8")) : r.remove(),
|
32190 | t.insertBefore(r, t.firstChild);
|
32191 | })(t);
|
32192 | } catch (e) {}
|
32193 | hasError(s.diagnostics) || (s.httpStatus = 200);
|
32194 | try {
|
32195 | const e = t.head.querySelector('meta[http-equiv="status"]');
|
32196 | if (null != e) {
|
32197 | const t = e.getAttribute("content");
|
32198 | t && t.length > 0 && (s.httpStatus = parseInt(t, 10));
|
32199 | }
|
32200 | } catch (e) {}
|
32201 | r.clientHydrateAnnotations && t.documentElement.classList.add("hydrated"), r.serializeToHtml && (s.html = serializeDocumentToString(t, r));
|
32202 | } catch (e) {
|
32203 | renderCatchError(s, e);
|
32204 | }
|
32205 | if (r.destroyWindow) try {
|
32206 | r.destroyDocument || (e.document = null, t.defaultView = null), e.close && e.close();
|
32207 | } catch (e) {
|
32208 | renderCatchError(s, e);
|
32209 | }
|
32210 | n(s);
|
32211 | }
|
32212 |
|
32213 | function serializeDocumentToString(e, t) {
|
32214 | return serializeNodeToHtml(e, {
|
32215 | approximateLineWidth: t.approximateLineWidth,
|
32216 | outerHtml: !1,
|
32217 | prettyHtml: t.prettyHtml,
|
32218 | removeAttributeQuotes: t.removeAttributeQuotes,
|
32219 | removeBooleanAttributeQuotes: t.removeBooleanAttributeQuotes,
|
32220 | removeEmptyAttributes: t.removeEmptyAttributes,
|
32221 | removeHtmlComments: t.removeHtmlComments,
|
32222 | serializeShadowRoot: !1
|
32223 | });
|
32224 | }
|
32225 |
|
32226 | function isValidDocument(e) {
|
32227 | return null != e && 9 === e.nodeType && null != e.documentElement && 1 === e.documentElement.nodeType && null != e.body && 1 === e.body.nodeType;
|
32228 | }
|
32229 |
|
32230 | function removeScripts(e) {
|
32231 | const t = e.children;
|
32232 | for (let e = t.length - 1; e >= 0; e--) {
|
32233 | const r = t[e];
|
32234 | removeScripts(r), ("SCRIPT" === r.nodeName || "LINK" === r.nodeName && "modulepreload" === r.getAttribute("rel")) && r.remove();
|
32235 | }
|
32236 | }
|
32237 |
|
32238 | const templateWindows = new Map, createHydrateBuildId = () => {
|
32239 | let e = "abcdefghijklmnopqrstuvwxyz", t = "";
|
32240 | for (;t.length < 8; ) t += e[Math.floor(Math.random() * e.length)], 1 === t.length && (e += "0123456789");
|
32241 | return t;
|
32242 | }, isPromise = e => !!e && ("object" == typeof e || "function" == typeof e) && "function" == typeof e.then, hasError = e => null != e && 0 !== e.length && e.some((e => "error" === e.level && "runtime" !== e.type)), shouldIgnoreError = e => e === TASK_CANCELED_MSG, TASK_CANCELED_MSG = "task canceled", SKIP_ATTRS = new Set([ "s-id", "c-id" ]), collectUsedSelectors = (e, t) => {
|
32243 | if (null != t && 1 === t.nodeType) {
|
32244 | const r = t.children, s = t.nodeName.toLowerCase();
|
32245 | e.tags.add(s);
|
32246 | const n = t.attributes;
|
32247 | for (let r = 0, s = n.length; r < s; r++) {
|
32248 | const s = n.item(r), o = s.name.toLowerCase();
|
32249 | if (e.attrs.add(o), "class" === o) {
|
32250 | const r = t.classList;
|
32251 | for (let t = 0, s = r.length; t < s; t++) e.classNames.add(r.item(t));
|
32252 | } else "id" === o && e.ids.add(s.value);
|
32253 | }
|
32254 | if (r) for (let t = 0, s = r.length; t < s; t++) collectUsedSelectors(e, r[t]);
|
32255 | }
|
32256 | }, parseCss = (e, t) => {
|
32257 | let r = 1, s = 1;
|
32258 | const n = [], o = e => {
|
32259 | const t = e.match(/\n/g);
|
32260 | t && (r += t.length);
|
32261 | const n = e.lastIndexOf("\n");
|
32262 | s = ~n ? e.length - n : s + e.length;
|
32263 | }, i = () => {
|
32264 | const e = {
|
32265 | line: r,
|
32266 | column: s
|
32267 | };
|
32268 | return t => (t.position = new z(e), m(), t);
|
32269 | }, a = o => {
|
32270 | const i = e.split("\n"), a = {
|
32271 | level: "error",
|
32272 | type: "css",
|
32273 | language: "css",
|
32274 | header: "CSS Parse",
|
32275 | messageText: o,
|
32276 | absFilePath: t,
|
32277 | lines: [ {
|
32278 | lineIndex: r - 1,
|
32279 | lineNumber: r,
|
32280 | errorCharStart: s,
|
32281 | text: e[r - 1]
|
32282 | } ]
|
32283 | };
|
32284 | if (r > 1) {
|
32285 | const t = {
|
32286 | lineIndex: r - 1,
|
32287 | lineNumber: r - 1,
|
32288 | text: e[r - 2],
|
32289 | errorCharStart: -1,
|
32290 | errorLength: -1
|
32291 | };
|
32292 | a.lines.unshift(t);
|
32293 | }
|
32294 | if (r + 2 < i.length) {
|
32295 | const e = {
|
32296 | lineIndex: r,
|
32297 | lineNumber: r + 1,
|
32298 | text: i[r],
|
32299 | errorCharStart: -1,
|
32300 | errorLength: -1
|
32301 | };
|
32302 | a.lines.push(e);
|
32303 | }
|
32304 | return n.push(a), null;
|
32305 | }, l = () => u(/^{\s*/), c = () => u(/^}/), u = t => {
|
32306 | const r = t.exec(e);
|
32307 | if (!r) return;
|
32308 | const s = r[0];
|
32309 | return o(s), e = e.slice(s.length), r;
|
32310 | }, d = () => {
|
32311 | let t;
|
32312 | const r = [];
|
32313 | for (m(), h(r); e.length && "}" !== e.charAt(0) && (t = w() || A()); ) !1 !== t && (r.push(t),
|
32314 | h(r));
|
32315 | return r;
|
32316 | }, m = () => u(/^\s*/), h = e => {
|
32317 | let t;
|
32318 | for (e = e || []; t = p(); ) !1 !== t && e.push(t);
|
32319 | return e;
|
32320 | }, p = () => {
|
32321 | const t = i();
|
32322 | if ("/" !== e.charAt(0) || "*" !== e.charAt(1)) return null;
|
32323 | let r = 2;
|
32324 | for (;"" !== e.charAt(r) && ("*" !== e.charAt(r) || "/" !== e.charAt(r + 1)); ) ++r;
|
32325 | if (r += 2, "" === e.charAt(r - 1)) return a("End of comment missing");
|
32326 | const n = e.slice(2, r - 2);
|
32327 | return s += 2, o(n), e = e.slice(r), s += 2, t({
|
32328 | type: 1,
|
32329 | comment: n
|
32330 | });
|
32331 | }, f = () => {
|
32332 | const e = u(/^([^{]+)/);
|
32333 | return e ? trim(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, "").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, (function(e) {
|
32334 | return e.replace(/,/g, "");
|
32335 | })).split(/\s*(?![^(]*\)),\s*/).map((function(e) {
|
32336 | return e.replace(/\u200C/g, ",");
|
32337 | })) : null;
|
32338 | }, g = () => {
|
32339 | const e = i();
|
32340 | let t = u(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
|
32341 | if (!t) return null;
|
32342 | if (t = trim(t[0]), !u(/^:\s*/)) return a("property missing ':'");
|
32343 | const r = u(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/), s = e({
|
32344 | type: 4,
|
32345 | property: t.replace(commentre, ""),
|
32346 | value: r ? trim(r[0]).replace(commentre, "") : ""
|
32347 | });
|
32348 | return u(/^[;\s]*/), s;
|
32349 | }, y = () => {
|
32350 | const e = [];
|
32351 | if (!l()) return a("missing '{'");
|
32352 | let t;
|
32353 | for (h(e); t = g(); ) !1 !== t && (e.push(t), h(e));
|
32354 | return c() ? e : a("missing '}'");
|
32355 | }, C = () => {
|
32356 | let e;
|
32357 | const t = [], r = i();
|
32358 | for (;e = u(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/); ) t.push(e[1]), u(/^,\s*/);
|
32359 | return t.length ? r({
|
32360 | type: 9,
|
32361 | values: t,
|
32362 | declarations: y()
|
32363 | }) : null;
|
32364 | }, S = (e, t) => {
|
32365 | const r = new RegExp("^@" + e + "\\s*([^;]+);");
|
32366 | return () => {
|
32367 | const s = i(), n = u(r);
|
32368 | if (!n) return null;
|
32369 | const o = {
|
32370 | type: t
|
32371 | };
|
32372 | return o[e] = n[1].trim(), s(o);
|
32373 | };
|
32374 | }, E = S("import", 7), b = S("charset", 0), T = S("namespace", 11), w = () => "@" !== e[0] ? null : (() => {
|
32375 | const e = i();
|
32376 | let t = u(/^@([-\w]+)?keyframes\s*/);
|
32377 | if (!t) return null;
|
32378 | const r = t[1];
|
32379 | if (t = u(/^([-\w]+)\s*/), !t) return a("@keyframes missing name");
|
32380 | const s = t[1];
|
32381 | if (!l()) return a("@keyframes missing '{'");
|
32382 | let n, o = h();
|
32383 | for (;n = C(); ) o.push(n), o = o.concat(h());
|
32384 | return c() ? e({
|
32385 | type: 8,
|
32386 | name: s,
|
32387 | vendor: r,
|
32388 | keyframes: o
|
32389 | }) : a("@keyframes missing '}'");
|
32390 | })() || (() => {
|
32391 | const e = i(), t = u(/^@media *([^{]+)/);
|
32392 | if (!t) return null;
|
32393 | const r = trim(t[1]);
|
32394 | if (!l()) return a("@media missing '{'");
|
32395 | const s = h().concat(d());
|
32396 | return c() ? e({
|
32397 | type: 10,
|
32398 | media: r,
|
32399 | rules: s
|
32400 | }) : a("@media missing '}'");
|
32401 | })() || (() => {
|
32402 | const e = i(), t = u(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
|
32403 | return t ? e({
|
32404 | type: 2,
|
32405 | name: trim(t[1]),
|
32406 | media: trim(t[2])
|
32407 | }) : null;
|
32408 | })() || (() => {
|
32409 | const e = i(), t = u(/^@supports *([^{]+)/);
|
32410 | if (!t) return null;
|
32411 | const r = trim(t[1]);
|
32412 | if (!l()) return a("@supports missing '{'");
|
32413 | const s = h().concat(d());
|
32414 | return c() ? e({
|
32415 | type: 15,
|
32416 | supports: r,
|
32417 | rules: s
|
32418 | }) : a("@supports missing '}'");
|
32419 | })() || E() || b() || T() || (() => {
|
32420 | const e = i(), t = u(/^@([-\w]+)?document *([^{]+)/);
|
32421 | if (!t) return null;
|
32422 | const r = trim(t[1]), s = trim(t[2]);
|
32423 | if (!l()) return a("@document missing '{'");
|
32424 | const n = h().concat(d());
|
32425 | return c() ? e({
|
32426 | type: 3,
|
32427 | document: s,
|
32428 | vendor: r,
|
32429 | rules: n
|
32430 | }) : a("@document missing '}'");
|
32431 | })() || (() => {
|
32432 | const e = i();
|
32433 | if (!u(/^@page */)) return null;
|
32434 | const t = f() || [];
|
32435 | if (!l()) return a("@page missing '{'");
|
32436 | let r, s = h();
|
32437 | for (;r = g(); ) s.push(r), s = s.concat(h());
|
32438 | return c() ? e({
|
32439 | type: 12,
|
32440 | selectors: t,
|
32441 | declarations: s
|
32442 | }) : a("@page missing '}'");
|
32443 | })() || (() => {
|
32444 | const e = i();
|
32445 | if (!u(/^@host\s*/)) return null;
|
32446 | if (!l()) return a("@host missing '{'");
|
32447 | const t = h().concat(d());
|
32448 | return c() ? e({
|
32449 | type: 6,
|
32450 | rules: t
|
32451 | }) : a("@host missing '}'");
|
32452 | })() || (() => {
|
32453 | const e = i();
|
32454 | if (!u(/^@font-face\s*/)) return null;
|
32455 | if (!l()) return a("@font-face missing '{'");
|
32456 | let t, r = h();
|
32457 | for (;t = g(); ) r.push(t), r = r.concat(h());
|
32458 | return c() ? e({
|
32459 | type: 5,
|
32460 | declarations: r
|
32461 | }) : a("@font-face missing '}'");
|
32462 | })(), A = () => {
|
32463 | const e = i(), t = f();
|
32464 | return t ? (h(), e({
|
32465 | type: 13,
|
32466 | selectors: t,
|
32467 | declarations: y()
|
32468 | })) : a("selector missing");
|
32469 | };
|
32470 | class z {
|
32471 | constructor(e) {
|
32472 | this.start = e, this.end = {
|
32473 | line: r,
|
32474 | column: s
|
32475 | }, this.source = t;
|
32476 | }
|
32477 | }
|
32478 | return z.prototype.content = e, {
|
32479 | diagnostics: n,
|
32480 | ...addParent((() => {
|
32481 | const e = d();
|
32482 | return {
|
32483 | type: 14,
|
32484 | stylesheet: {
|
32485 | source: t,
|
32486 | rules: e
|
32487 | }
|
32488 | };
|
32489 | })())
|
32490 | };
|
32491 | }, trim = e => e ? e.trim() : "", addParent = (e, t) => {
|
32492 | const r = e && "string" == typeof e.type, s = r ? e : t;
|
32493 | for (const t in e) {
|
32494 | const r = e[t];
|
32495 | Array.isArray(r) ? r.forEach((function(e) {
|
32496 | addParent(e, s);
|
32497 | })) : r && "object" == typeof r && addParent(r, s);
|
32498 | }
|
32499 | return r && Object.defineProperty(e, "parent", {
|
32500 | configurable: !0,
|
32501 | writable: !0,
|
32502 | enumerable: !1,
|
32503 | value: t || null
|
32504 | }), e;
|
32505 | }, commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, getCssSelectors = e => {
|
32506 | SELECTORS.all.length = SELECTORS.tags.length = SELECTORS.classNames.length = SELECTORS.ids.length = SELECTORS.attrs.length = 0;
|
32507 | const t = (e = e.replace(/\./g, " .").replace(/\#/g, " #").replace(/\[/g, " [").replace(/\>/g, " > ").replace(/\+/g, " + ").replace(/\~/g, " ~ ").replace(/\*/g, " * ").replace(/\:not\((.*?)\)/g, " ")).split(" ");
|
32508 | for (let e = 0, r = t.length; e < r; e++) t[e] = t[e].split(":")[0], 0 !== t[e].length && ("." === t[e].charAt(0) ? SELECTORS.classNames.push(t[e].substr(1)) : "#" === t[e].charAt(0) ? SELECTORS.ids.push(t[e].substr(1)) : "[" === t[e].charAt(0) ? (t[e] = t[e].substr(1).split("=")[0].split("]")[0].trim(),
|
32509 | SELECTORS.attrs.push(t[e].toLowerCase())) : /[a-z]/g.test(t[e].charAt(0)) && SELECTORS.tags.push(t[e].toLowerCase()));
|
32510 | return SELECTORS.classNames = SELECTORS.classNames.sort(((e, t) => e.length < t.length ? -1 : e.length > t.length ? 1 : 0)),
|
32511 | SELECTORS;
|
32512 | }, SELECTORS = {
|
32513 | all: [],
|
32514 | tags: [],
|
32515 | classNames: [],
|
32516 | ids: [],
|
32517 | attrs: []
|
32518 | }, serializeCssVisitNode = (e, t, r, s) => {
|
32519 | const n = t.type;
|
32520 | return 4 === n ? serializeCssDeclaration(t, r, s) : 13 === n ? serializeCssRule(e, t) : 1 === n ? "!" === t.comment[0] ? `/*${t.comment}*/` : "" : 10 === n ? serializeCssMedia(e, t) : 8 === n ? serializeCssKeyframes(e, t) : 9 === n ? serializeCssKeyframe(e, t) : 5 === n ? serializeCssFontFace(e, t) : 15 === n ? serializeCssSupports(e, t) : 7 === n ? "@import " + t.import + ";" : 0 === n ? "@charset " + t.charset + ";" : 12 === n ? serializeCssPage(e, t) : 6 === n ? "@host{" + serializeCssMapVisit(e, t.rules) + "}" : 2 === n ? "@custom-media " + t.name + " " + t.media + ";" : 3 === n ? serializeCssDocument(e, t) : 11 === n ? "@namespace " + t.namespace + ";" : "";
|
32521 | }, serializeCssRule = (e, t) => {
|
32522 | const r = t.declarations, s = e.usedSelectors, n = t.selectors.slice();
|
32523 | if (null == r || 0 === r.length) return "";
|
32524 | if (s) {
|
32525 | let t, r, o = !0;
|
32526 | for (t = n.length - 1; t >= 0; t--) {
|
32527 | const i = getCssSelectors(n[t]);
|
32528 | o = !0;
|
32529 | let a = i.classNames.length;
|
32530 | if (a > 0 && e.hasUsedClassNames) for (r = 0; r < a; r++) if (!s.classNames.has(i.classNames[r])) {
|
32531 | o = !1;
|
32532 | break;
|
32533 | }
|
32534 | if (o && e.hasUsedTags && (a = i.tags.length, a > 0)) for (r = 0; r < a; r++) if (!s.tags.has(i.tags[r])) {
|
32535 | o = !1;
|
32536 | break;
|
32537 | }
|
32538 | if (o && e.hasUsedAttrs && (a = i.attrs.length, a > 0)) for (r = 0; r < a; r++) if (!s.attrs.has(i.attrs[r])) {
|
32539 | o = !1;
|
32540 | break;
|
32541 | }
|
32542 | if (o && e.hasUsedIds && (a = i.ids.length, a > 0)) for (r = 0; r < a; r++) if (!s.ids.has(i.ids[r])) {
|
32543 | o = !1;
|
32544 | break;
|
32545 | }
|
32546 | o || n.splice(t, 1);
|
32547 | }
|
32548 | }
|
32549 | if (0 === n.length) return "";
|
32550 | const o = [];
|
32551 | let i = "";
|
32552 | for (const e of t.selectors) i = removeSelectorWhitespace(e), o.includes(i) || o.push(i);
|
32553 | return `${o}{${serializeCssMapVisit(e, r)}}`;
|
32554 | }, serializeCssDeclaration = (e, t, r) => "" === e.value ? "" : r - 1 === t ? e.property + ":" + e.value : e.property + ":" + e.value + ";", serializeCssMedia = (e, t) => {
|
32555 | const r = serializeCssMapVisit(e, t.rules);
|
32556 | return "" === r ? "" : "@media " + removeMediaWhitespace(t.media) + "{" + r + "}";
|
32557 | }, serializeCssKeyframes = (e, t) => {
|
32558 | const r = serializeCssMapVisit(e, t.keyframes);
|
32559 | return "" === r ? "" : "@" + (t.vendor || "") + "keyframes " + t.name + "{" + r + "}";
|
32560 | }, serializeCssKeyframe = (e, t) => t.values.join(",") + "{" + serializeCssMapVisit(e, t.declarations) + "}", serializeCssFontFace = (e, t) => {
|
32561 | const r = serializeCssMapVisit(e, t.declarations);
|
32562 | return "" === r ? "" : "@font-face{" + r + "}";
|
32563 | }, serializeCssSupports = (e, t) => {
|
32564 | const r = serializeCssMapVisit(e, t.rules);
|
32565 | return "" === r ? "" : "@supports " + t.supports + "{" + r + "}";
|
32566 | }, serializeCssPage = (e, t) => "@page " + t.selectors.join(", ") + "{" + serializeCssMapVisit(e, t.declarations) + "}", serializeCssDocument = (e, t) => {
|
32567 | const r = serializeCssMapVisit(e, t.rules), s = "@" + (t.vendor || "") + "document " + t.document;
|
32568 | return "" === r ? "" : s + "{" + r + "}";
|
32569 | }, serializeCssMapVisit = (e, t) => {
|
32570 | let r = "";
|
32571 | if (t) for (let s = 0, n = t.length; s < n; s++) r += serializeCssVisitNode(e, t[s], s, n);
|
32572 | return r;
|
32573 | }, removeSelectorWhitespace = e => {
|
32574 | let t = "", r = "", s = !1;
|
32575 | for (let n = 0, o = (e = e.trim()).length; n < o; n++) if (r = e[n], "[" === r && "\\" !== t[t.length - 1] ? s = !0 : "]" === r && "\\" !== t[t.length - 1] && (s = !1),
|
32576 | !s && CSS_WS_REG.test(r)) {
|
32577 | if (CSS_NEXT_CHAR_REG.test(e[n + 1])) continue;
|
32578 | if (CSS_PREV_CHAR_REG.test(t[t.length - 1])) continue;
|
32579 | t += " ";
|
32580 | } else t += r;
|
32581 | return t;
|
32582 | }, removeMediaWhitespace = e => {
|
32583 | let t = "", r = "";
|
32584 | for (let s = 0, n = (e = e.trim()).length; s < n; s++) if (r = e[s], CSS_WS_REG.test(r)) {
|
32585 | if (CSS_WS_REG.test(t[t.length - 1])) continue;
|
32586 | t += " ";
|
32587 | } else t += r;
|
32588 | return t;
|
32589 | }, CSS_WS_REG = /\s/, CSS_NEXT_CHAR_REG = /[>\(\)\~\,\+\s]/, CSS_PREV_CHAR_REG = /[>\(\~\,\+]/, removeUnusedStyleText = (e, t, r) => {
|
32590 | try {
|
32591 | const s = parseCss(r.innerHTML);
|
32592 | if (t.push(...s.diagnostics), hasError(t)) return;
|
32593 | try {
|
32594 | r.innerHTML = ((e, t) => {
|
32595 | const r = t.usedSelectors || null, s = {
|
32596 | usedSelectors: r || null,
|
32597 | hasUsedAttrs: !!r && r.attrs.size > 0,
|
32598 | hasUsedClassNames: !!r && r.classNames.size > 0,
|
32599 | hasUsedIds: !!r && r.ids.size > 0,
|
32600 | hasUsedTags: !!r && r.tags.size > 0
|
32601 | }, n = e.rules;
|
32602 | if (!n) return "";
|
32603 | const o = n.length, i = [];
|
32604 | for (let e = 0; e < o; e++) i.push(serializeCssVisitNode(s, n[e], e, o));
|
32605 | return i.join("");
|
32606 | })(s.stylesheet, {
|
32607 | usedSelectors: e
|
32608 | });
|
32609 | } catch (e) {
|
32610 | t.push({
|
32611 | level: "warn",
|
32612 | type: "css",
|
32613 | header: "CSS Stringify",
|
32614 | messageText: e
|
32615 | });
|
32616 | }
|
32617 | } catch (e) {
|
32618 | t.push({
|
32619 | level: "warn",
|
32620 | type: "css",
|
32621 | header: "CSS Parse",
|
32622 | messageText: e
|
32623 | });
|
32624 | }
|
32625 | };
|
32626 |
|
32627 | exports.createWindowFromHtml = createWindowFromHtml;
|
32628 | exports.hydrateDocument = hydrateDocument;
|
32629 | exports.renderToString = renderToString;
|
32630 | exports.serializeDocumentToString = serializeDocumentToString;
|