lila/public/javascripts/vendor/cash.min.js

37 lines
15 KiB
JavaScript

(()=>{'use strict';var e={"class":"className",contenteditable:"contentEditable","for":"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};function g(a,b){try{return a(b)}catch(c){return b}}
var m=document,n=window,p=m.documentElement,t=m.createElement.bind(m),u=t("div"),v=t("table"),aa=t("tbody"),w=t("tr"),ba=Array.isArray,x=Array.prototype,ca=x.concat,y=x.filter,da=x.indexOf,ea=x.map,fa=x.push,ha=x.slice,z=x.some,ia=x.splice,ja=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,ka=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,la=/<.+>/,ma=/^\w+$/;function A(a,b){return a&&(B(b)||C(b))?ka.test(a)?b.getElementsByClassName(a.slice(1)):ma.test(a)?b.getElementsByTagName(a):b.querySelectorAll(a):[]}
var D=function(){function a(a,c){if(a){if(a instanceof D)return a;var b=a;if(E(a)){if(b=(c instanceof D?c[0]:c)||m,b=ja.test(a)?b.getElementById(a.slice(1)):la.test(a)?na(a):A(a,b),!b)return}else if(F(a))return this.ready(a);if(b.nodeType||b===n)b=[b];this.length=b.length;a=0;for(c=this.length;a<c;a++)this[a]=b[a]}}a.prototype.init=function(b,c){return new a(b,c)};return a}(),G=D.prototype,H=G.init;H.fn=H.prototype=G;G.length=0;G.splice=ia;"function"===typeof Symbol&&(G[Symbol.iterator]=x[Symbol.iterator]);
G.map=function(a){return H(ca.apply([],ea.call(this,function(b,c){return a.call(b,c,b)})))};G.slice=function(a,b){return H(ha.call(this,a,b))};var oa=/-([a-z])/g;function I(a){return a.replace(oa,function(a,c){return c.toUpperCase()})}function J(a,b,c){if(c)for(c=a.length;c--&&!1!==b.call(a[c],c,a[c]););else{c=0;for(var d=a.length;c<d&&!1!==b.call(a[c],c,a[c]);c++);}return a}H.each=J;G.each=function(a){return J(this,a)};G.removeProp=function(a){return this.each(function(b,c){delete c[e[a]||a]})};
H.guid=1;function pa(a,b){var c=a&&(a.matches||a.webkitMatchesSelector||a.msMatchesSelector);return!!c&&!!b&&c.call(a,b)}function K(a){return!!a&&a===a.window}function B(a){return!!a&&9===a.nodeType}function C(a){return!!a&&1===a.nodeType}function F(a){return"function"===typeof a}function E(a){return"string"===typeof a}function qa(a){return!isNaN(parseFloat(a))&&isFinite(a)}H.isWindow=K;H.isFunction=F;H.isNumeric=qa;H.isArray=ba;
G.prop=function(a,b){if(a){if(E(a))return a=e[a]||a,2>arguments.length?this[0]&&this[0][a]:this.each(function(c,h){h[a]=b});for(var c in a)this.prop(c,a[c]);return this}};G.get=function(a){if(void 0===a)return ha.call(this);a=Number(a);return this[0>a?a+this.length:a]};G.eq=function(a){return H(this.get(a))};G.first=function(){return this.eq(0)};G.last=function(){return this.eq(-1)};
function L(a){return E(a)?function(b,c){return pa(c,a)}:F(a)?a:a instanceof D?function(b,c){return a.is(c)}:a?function(b,c){return c===a}:function(){return!1}}G.filter=function(a){var b=L(a);return H(y.call(this,function(a,d){return b.call(a,d,a)}))};function M(a,b){return b?a.filter(b):a}var ra=/\S+/g;function N(a){return E(a)?a.match(ra)||[]:[]}G.hasClass=function(a){return!!a&&z.call(this,function(b){return C(b)&&b.classList.contains(a)})};
G.removeAttr=function(a){var b=N(a);return this.each(function(a,d){C(d)&&J(b,function(a,b){d.removeAttribute(b)})})};G.attr=function(a,b){if(a){if(E(a)){if(2>arguments.length){if(!this[0]||!C(this[0]))return;var c=this[0].getAttribute(a);return null===c?void 0:c}return void 0===b?this:null===b?this.removeAttr(a):this.each(function(c,h){C(h)&&h.setAttribute(a,b)})}for(c in a)this.attr(c,a[c]);return this}};
G.toggleClass=function(a,b){var c=N(a),d=void 0!==b;return this.each(function(a,f){C(f)&&J(c,function(a,c){d?b?f.classList.add(c):f.classList.remove(c):f.classList.toggle(c)})})};G.addClass=function(a){return this.toggleClass(a,!0)};G.removeClass=function(a){return arguments.length?this.toggleClass(a,!1):this.attr("class","")};
function O(a,b,c,d){for(var h=[],f=F(b),q=d&&L(d),r=0,k=a.length;r<k;r++)if(f){var l=b(a[r]);l.length&&fa.apply(h,l)}else for(l=a[r][b];!(null==l||d&&q(-1,l));)h.push(l),l=c?l[b]:null;return h}function P(a){return 1<a.length?y.call(a,function(a,c,d){return da.call(d,a)===c}):a}H.unique=P;G.add=function(a,b){return H(P(this.get().concat(H(a,b).get())))};function Q(a,b,c){if(C(a)){var d=n.getComputedStyle(a,null);return c?d.getPropertyValue(b)||void 0:d[b]||a.style[b]}}
function R(a,b){return parseInt(Q(a,b),10)||0}var S=/^--/,T={},sa=u.style,ta=["webkit","moz","ms"];function ua(a,b){void 0===b&&(b=S.test(a));if(b)return a;if(!T[a]){b=I(a);var c=""+b[0].toUpperCase()+b.slice(1);b=(b+" "+ta.join(c+" ")+c).split(" ");J(b,function(b,c){if(c in sa)return T[a]=c,!1})}return T[a]}
var va={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function wa(a,b,c){void 0===c&&(c=S.test(a));return c||va[a]||!qa(b)?b:b+"px"}
G.css=function(a,b){if(E(a)){var c=S.test(a);a=ua(a,c);if(2>arguments.length)return this[0]&&Q(this[0],a,c);if(!a)return this;b=wa(a,b,c);return this.each(function(d,f){C(f)&&(c?f.style.setProperty(a,b):f.style[a]=b)})}for(var d in a)this.css(d,a[d]);return this};var xa=/^\s+|\s+$/;function ya(a,b){a=a.dataset[b]||a.dataset[I(b)];return xa.test(a)?a:g(JSON.parse,a)}
G.data=function(a,b){if(!a){if(!this[0])return;var c={},d;for(d in this[0].dataset)c[d]=ya(this[0],d);return c}if(E(a))return 2>arguments.length?this[0]&&ya(this[0],a):void 0===b?this:this.each(function(c,d){c=b;c=E(c)?c:g(JSON.stringify,c);d.dataset[I(a)]=c});for(d in a)this.data(d,a[d]);return this};function za(a,b){var c=a.documentElement;return Math.max(a.body["scroll"+b],c["scroll"+b],a.body["offset"+b],c["offset"+b],c["client"+b])}
function Aa(a,b){return R(a,"border"+(b?"Left":"Top")+"Width")+R(a,"padding"+(b?"Left":"Top"))+R(a,"padding"+(b?"Right":"Bottom"))+R(a,"border"+(b?"Right":"Bottom")+"Width")}
J([!0,!1],function(a,b){J(["Width","Height"],function(a,d){G[(b?"outer":"inner")+d]=function(c){if(this[0])return K(this[0])?b?this[0]["inner"+d]:this[0].document.documentElement["client"+d]:B(this[0])?za(this[0],d):this[0][(b?"offset":"client")+d]+(c&&b?R(this[0],"margin"+(a?"Top":"Left"))+R(this[0],"margin"+(a?"Bottom":"Right")):0)}})});
J(["Width","Height"],function(a,b){var c=b.toLowerCase();G[c]=function(d){if(!this[0])return void 0===d?void 0:this;if(!arguments.length)return K(this[0])?this[0].document.documentElement["client"+b]:B(this[0])?za(this[0],b):this[0].getBoundingClientRect()[c]-Aa(this[0],!a);var h=parseInt(d,10);return this.each(function(b,d){C(d)&&(b=Q(d,"boxSizing"),d.style[c]=wa(c,h+("border-box"===b?Aa(d,!a):0)))})}});var U={};
G.toggle=function(a){return this.each(function(b,c){if(C(c))if(void 0===a?"none"===Q(c,"display"):a){if(c.style.display=c.___cd||"","none"===Q(c,"display")){b=c.style;c=c.tagName;if(U[c])c=U[c];else{var d=t(c);m.body.insertBefore(d,null);var h=Q(d,"display");m.body.removeChild(d);c=U[c]="none"!==h?h:"block"}b.display=c}}else c.___cd=Q(c,"display"),c.style.display="none"})};G.hide=function(){return this.toggle(!1)};G.show=function(){return this.toggle(!0)};
function Ba(a,b){return!b||!z.call(b,function(b){return 0>a.indexOf(b)})}var V={focus:"focusin",blur:"focusout"},W={mouseenter:"mouseover",mouseleave:"mouseout"},Ca=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function Da(a,b,c,d,h){var f=a.___ce=a.___ce||{};f[b]=f[b]||[];f[b].push([c,d,h]);a.addEventListener(b,h)}function X(a){a=a.split(".");return[a[0],a.slice(1).sort()]}
function Y(a,b,c,d,h){var f=a.___ce=a.___ce||{};if(b)f[b]&&(f[b]=f[b].filter(function(f){var q=f[0],k=f[1];f=f[2];if(h&&f.guid!==h.guid||!Ba(q,c)||d&&d!==k)return!0;a.removeEventListener(b,f)}));else for(b in f)Y(a,b,c,d,h)}
G.off=function(a,b,c){var d=this;if(void 0===a)this.each(function(a,b){(C(b)||B(b)||K(b))&&Y(b)});else if(E(a))F(b)&&(c=b,b=""),J(N(a),function(a,h){a=X(h);h=a[0];var f=a[1],k=W[h]||V[h]||h;d.each(function(a,d){(C(d)||B(d)||K(d))&&Y(d,k,f,b,c)})});else for(var h in a)this.off(h,a[h]);return this};
G.on=function(a,b,c,d,h){var f=this;if(!E(a)){for(var q in a)this.on(q,b,c,a[q],h);return this}E(b)||(void 0!==b&&null!==b&&(void 0!==c&&(d=c),c=b),b="");F(d)||(d=c,c=void 0);if(!d)return this;J(N(a),function(a,k){a=X(k);k=a[0];var q=a[1],r=W[k]||V[k]||k,Fa=k in W,Ga=k in V;r&&f.each(function(a,f){if(C(f)||B(f)||K(f))a=function Ha(a){if(a.target["___i"+a.type])return a.stopImmediatePropagation();if(!a.namespace||Ba(q,a.namespace.split(".")))if(b||!(Ga&&(a.target!==f||a.___ot===r)||Fa&&a.relatedTarget&&
f.contains(a.relatedTarget))){var k=f;if(b){for(var l=a.target;!pa(l,b);){if(l===f)return;l=l.parentNode;if(!l)return}k=l;a.___cd=!0}a.___cd&&Object.defineProperty(a,"currentTarget",{configurable:!0,get:function(){return k}});Object.defineProperty(a,"data",{configurable:!0,get:function(){return c}});l=d.call(k,a,a.___td);h&&Y(f,r,q,b,Ha);!1===l&&(a.preventDefault(),a.stopPropagation())}},a.guid=d.guid=d.guid||H.guid++,Da(f,r,q,b,a)})});return this};G.one=function(a,b,c,d){return this.on(a,b,c,d,!0)};
G.ready=function(a){function b(){return setTimeout(a,0,H)}"loading"!==m.readyState?b():m.addEventListener("DOMContentLoaded",b);return this};G.trigger=function(a,b){if(E(a)){var c=X(a),d=c[0];c=c[1];var h=W[d]||V[d]||d;if(!h)return this;var f=Ca.test(h)?"MouseEvents":"HTMLEvents";a=m.createEvent(f);a.initEvent(h,!0,!0);a.namespace=c.join(".");a.___ot=d}a.___td=b;var q=a.___ot in V;return this.each(function(b,c){q&&F(c[a.___ot])&&(c["___i"+a.type]=!0,c[a.___ot](),c["___i"+a.type]=!1);c.dispatchEvent(a)})};
function Ea(a){return a.multiple&&a.options?O(y.call(a.options,function(a){return a.selected&&!a.disabled&&!a.parentNode.disabled}),"value"):a.value||""}var Ia=/radio|checkbox/i;G.val=function(a){return arguments.length?this.each(function(b,c){if((b=c.multiple&&c.options)||Ia.test(c.type)){var d=ba(a)?ea.call(a,String):null===a?[]:[String(a)];b?J(c.options,function(a,b){b.selected=0<=d.indexOf(b.value)},!0):c.checked=0<=d.indexOf(c.value)}else c.value=void 0===a||null===a?"":a}):this[0]&&Ea(this[0])};
G.clone=function(){return this.map(function(a,b){return b.cloneNode(!0)})};G.detach=function(a){M(this,a).each(function(a,c){c.parentNode&&c.parentNode.removeChild(c)});return this};var Ja=/^\s*<(\w+)[^>]*>/,Ka=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,La={"*":u,tr:aa,td:w,th:w,thead:v,tbody:v,tfoot:v};function na(a){if(!E(a))return[];if(Ka.test(a))return[t(RegExp.$1)];var b=Ja.test(a)&&RegExp.$1;b=La[b]||La["*"];b.innerHTML=a;return H(b.childNodes).detach().get()}H.parseHTML=na;
G.empty=function(){return this.each(function(a,b){for(;b.firstChild;)b.removeChild(b.firstChild)})};G.html=function(a){return arguments.length?void 0===a?this:this.each(function(b,c){C(c)&&(c.innerHTML=a)}):this[0]&&this[0].innerHTML};G.remove=function(a){M(this,a).detach().off();return this};G.text=function(a){return void 0===a?this[0]?this[0].textContent:"":this.each(function(b,c){C(c)&&(c.textContent=a)})};
G.unwrap=function(){this.parent().each(function(a,b){"BODY"!==b.tagName&&(a=H(b),a.replaceWith(a.children()))});return this};G.offset=function(){var a=this[0];if(a)return a=a.getBoundingClientRect(),{top:a.top+n.pageYOffset,left:a.left+n.pageXOffset}};G.offsetParent=function(){return this.map(function(a,b){for(a=b.offsetParent;a&&"static"===Q(a,"position");)a=a.offsetParent;return a||p})};
G.position=function(){var a=this[0];if(a){var b="fixed"===Q(a,"position"),c=b?a.getBoundingClientRect():this.offset();if(!b){var d=a.ownerDocument;for(b=a.offsetParent||d.documentElement;(b===d.body||b===d.documentElement)&&"static"===Q(b,"position");)b=b.parentNode;b!==a&&C(b)&&(d=H(b).offset(),c.top-=d.top+R(b,"borderTopWidth"),c.left-=d.left+R(b,"borderLeftWidth"))}return{top:c.top-R(a,"marginTop"),left:c.left-R(a,"marginLeft")}}};
G.children=function(a){return M(H(P(O(this,function(a){return a.children}))),a)};G.contents=function(){return H(P(O(this,function(a){return"IFRAME"===a.tagName?[a.contentDocument]:"TEMPLATE"===a.tagName?a.content.childNodes:a.childNodes})))};G.find=function(a){return H(P(O(this,function(b){return A(a,b)})))};var Ma=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,Na=/^$|^module$|\/(java|ecma)script/i,Oa=["type","src","nonce","noModule"];
function Pa(a,b){a=H(a);a.filter("script").add(a.find("script")).each(function(a,d){if(Na.test(d.type)&&p.contains(d)){var c=t("script");c.text=d.textContent.replace(Ma,"");J(Oa,function(a,b){d[b]&&(c[b]=d[b])});b.head.insertBefore(c,null);b.head.removeChild(c)}})}
function Z(a,b,c,d,h,f,q,r){J(a,function(a,f){J(H(f),function(a,f){J(H(b),function(b,k){var l=c?k:f;b=c?a:b;k=c?f:k;l=b?l.cloneNode(!0):l;b=!b;h?k.insertBefore(l,d?k.firstChild:null):k.parentNode.insertBefore(l,d?k:k.nextSibling);b&&Pa(l,k.ownerDocument)},r)},q)},f);return b}G.after=function(){return Z(arguments,this,!1,!1,!1,!0,!0)};G.append=function(){return Z(arguments,this,!1,!1,!0)};G.appendTo=function(a){return Z(arguments,this,!0,!1,!0)};G.before=function(){return Z(arguments,this,!1,!0)};
G.insertAfter=function(a){return Z(arguments,this,!0,!1,!1,!1,!1,!0)};G.insertBefore=function(a){return Z(arguments,this,!0,!0)};G.prepend=function(){return Z(arguments,this,!1,!0,!0,!0,!0)};G.prependTo=function(a){return Z(arguments,this,!0,!0,!0,!1,!1,!0)};G.replaceWith=function(a){return this.before(a).remove()};G.replaceAll=function(a){H(a).replaceWith(this);return this};G.wrapAll=function(a){a=H(a);for(var b=a[0];b.children.length;)b=b.firstElementChild;this.first().before(a);return this.appendTo(b)};
G.wrap=function(a){return this.each(function(b,c){var d=H(a)[0];H(c).wrapAll(b?d.cloneNode(!0):d)})};G.wrapInner=function(a){return this.each(function(b,c){b=H(c);c=b.contents();c.length?c.wrapAll(a):b.append(a)})};G.has=function(a){var b=E(a)?function(b,d){return A(a,d).length}:function(b,d){return d.contains(a)};return this.filter(b)};G.is=function(a){var b=L(a);return z.call(this,function(a,d){return b.call(a,d,a)})};G.next=function(a,b,c){return M(H(P(O(this,"nextElementSibling",b,c))),a)};
G.nextAll=function(a){return this.next(a,!0)};G.nextUntil=function(a,b){return this.next(b,!0,a)};G.not=function(a){var b=L(a);return this.filter(function(c,d){return(!E(a)||C(d))&&!b.call(d,c,d)})};G.parent=function(a){return M(H(P(O(this,"parentNode"))),a)};G.index=function(a){var b=a?H(a)[0]:this[0];a=a?this:H(b).parent().children();return da.call(a,b)};G.closest=function(a){var b=this.filter(a);if(b.length)return b;var c=this.parent();return c.length?c.closest(a):b};
G.parents=function(a,b){return M(H(P(O(this,"parentElement",!0,b))),a)};G.parentsUntil=function(a,b){return this.parents(b,a)};G.prev=function(a,b,c){return M(H(P(O(this,"previousElementSibling",b,c))),a)};G.prevAll=function(a){return this.prev(a,!0)};G.prevUntil=function(a,b){return this.prev(b,!0,a)};G.siblings=function(a){return M(H(P(O(this,function(a){return H(a).parent().children().not(a)}))),a)};"undefined"!==typeof exports?module.exports=H:n.cash=n.$=H;
})();