text: var pick=function(){"use strict";function t(e){if(e instanceof HTMLElement)this.elements=[e];else if(e instanceof NodeList)this.elements=[...Array.from(e)];else if(e instanceof Array)this.elements=e;else{if(e instanceof t)return e;if(e===document)this.elements=[document];else if(this.selector=e.trim(),this.selector){let t=document.querySelectorAll(this.selector);if(t.length)this.elements=Array.from(t);else try{this.elements=Array.from(function(t){let e=document.createDocumentFragment();return e.appendChild(document.createElement(t)),e.querySelectorAll("*")}(this.selector))}catch(t){this.elements=[]}}}}t.prototype={val(t){if(void 0!==t)return this.elements.forEach(e=>e.value=t),this;{let t=this.getFirstDOMElement();return t&&t.value}},attr(t,e){if(void 0!=e)return this.elements.forEach(n=>n.setAttribute(t,e)),this;{let e=this.getFirstDOMElement();return e&&e.getAttribute(t)}},prop(t,e){if(void 0!=e)return this.elements.forEach(n=>n[t]=e),this;{let e=this.getFirstDOMElement();return e&&e[t]}},data(t,e){if(void 0!=e)return this.elements.forEach(n=>n.setAttribute(`data-${t}`,e)),this;{let e=this.getFirstDOMElement();return e&&e.getAttribute(`data-${t}`)}},text(t){if(void 0!==t)return this.elements.forEach(e=>e.textContent=t),this;{let t=this.getFirstDOMElement();return t&&t.textContent}},html(t){if(void 0!==t)return this.elements.forEach(e=>e.innerHTML=t),this;{let t=this.getFirstDOMElement();return t&&t}},addClass(t){return t=t.split(" "),this.elements.forEach(e=>e.classList.add(...t)),this},removeClass(t){return t=t.split(" "),this.elements.forEach(e=>e.classList.remove(...t)),this},hasClass(t){return this.getFirstDOMElement().classList.contains(t)},parent(){let t=this.getFirstDOMElement();return n(t.parentElement)},closest(t){let e=(t=t.trim())[0],i=this.getFirstDOMElement().parentElement;for(;null!==i;){if("."===e){if(i.classList.contains(t.slice(1)))break}else if("#"===e){if(i.id===t.slice(1))break}else if(i.tagName===t.toUpperCase())break;i=i.parentElement}return null!==i?n(i):[]},find(t){let e=(t=t.trim())[0],i=Array.from(this.getFirstDOMElement().children),r=0,s=[];for(;i[r];)(function(n){if("."===e){if(n.classList.contains(t.slice(1)))return!0}else if("#"===e){if(n.id===t.slice(1))return!0}else if(n.tagName===t.toUpperCase())return!0;return!1})(i[r])&&s.push(i[r]),i.push(...Array.from(i[r].children)),r++;return n(s)},nextElement(){return n(this.getFirstDOMElement().nextElementSibling)},prevElement(){return n(this.getFirstDOMElement().previousElementSibling)},append(t){let e=this.convertToDOMArray(t),n=this.getFirstDOMElement();return e.forEach(t=>n.appendChild(t)),this},prepend(t){let e=this.convertToDOMArray(t).reverse(),n=this.getFirstDOMElement();return e.forEach(t=>{n.insertBefore(t,n.children[0])}),this},after(t){let e=this.convertToDOMArray(t),n=this.parent().getFirstDOMElement(),i=this.nextElement().getFirstDOMElement();return e.forEach(t=>{n.insertBefore(t,i)}),this},before(t){let e=this.convertToDOMArray(t),n=this.parent().getFirstDOMElement(),i=this.getFirstDOMElement();return e.forEach(t=>{n.insertBefore(t,i)}),this},remove(){let t=this.parent().getFirstDOMElement(),e=this.getFirstDOMElement();return t.removeChild(e)},replace(t){this.after(t),this.remove()},each(t){"function"==typeof t&&this.elements.forEach(e=>{t.apply(null,[e])})},first(){return n(this.getFirstDOMElement())},last(){return n(this.getLastDOMElement())},get(t){return n(this.elements[t])},once(t,e,i){function r(t){i(t),t.target.removeEventListener(t.type,arguments.callee)}return"string"==typeof e?this.each(r=>{n(r).find(e).once(t,i)}):"function"==typeof e&&(i=e,this.each(e=>e.addEventListener(t,r))),this},on(t,i,r){return"string"==typeof i?this.each(e=>{n(e).find(i).on(t,r)}):"function"==typeof i&&(r=i,this.each(n=>{e.push([n,r]);n.addEventListener(t,r)})),this},off(t,i,r){return"string"==typeof i?this.each(e=>{n(e).find(i).off(t,r)}):(r=i,this.each(n=>{let i=0;for(;e[i];)e[i][0]===n&&("function"!=typeof r?n.removeEventListener(t,e[i][1]):e[i][1]===r&&n.removeEventListener(t,r),e.splice(i,1)),i++})),this},trigger(t){return this.each(e=>e.dispatchEvent(new Event(t))),this},getFirstDOMElement(){return this.elements[0]},getLastDOMElement(){return this.elements[this.elements.length-1]},convertToDOMArray(e){if("string"==typeof e){let t=document.createElement("div");return t.innerHTML=e,Array.from(t.children)}return e instanceof HTMLElement?[e]:e instanceof NodeList?Array.from(e):e instanceof Array?e:e instanceof t?e.elements:selector===document?[document]:[]}};let e=[],n=e=>{var n=new t(e);return n};return n.ajax=((t,e,n)=>{let i={};i.method=e||"get";"object"==typeof n&&("object"==typeof n.headers&&(i.headers=n.headers),"object"==typeof n.body&&(i.body=function(t){let e="";for(var n in t)""!==e&&(e+="&"),e+=n+"="+encodeURIComponent(t[n]);return e}(n.body)),n.credentials&&(i.credentials=n.credentials),n.mode&&(n.mode="cors"));return fetch(t,i)}),"object"==typeof window&&(window.$=n),"object"==typeof global&&(global.$=n),"object"==typeof globalThis&&(globalThis.$=n),n}();
  