-
Notifications
You must be signed in to change notification settings - Fork 15
/
app.min.js
4 lines (4 loc) · 12.6 KB
/
app.min.js
1
2
3
4
/*!
* jekyll-theme-chirpy v7.1.1 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/
*/
!function(){"use strict";const e=new Map;var t={set(t,n,r){e.has(t)||e.set(t,new Map);const o=e.get(t);o.has(n)||0===o.size?o.set(n,r):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(o.keys())[0]}.`)},get:(t,n)=>e.has(t)&&e.get(t).get(n)||null,remove(t,n){if(!e.has(t))return;const r=e.get(t);r.delete(n),0===r.size&&e.delete(t)}};const n="transitionend",r=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),o=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),i=e=>o(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(r(e)):null,s=e=>!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled"))),a=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,l=[],c=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"==typeof e?e(...arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]):t},u=function(e,t){if(!(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]))return void c(e);const r=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);const r=Number.parseFloat(t),o=Number.parseFloat(n);return r||o?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0})(t)+5;let o=!1;const i=r=>{let{target:s}=r;s===t&&(o=!0,t.removeEventListener(n,i),c(e))};t.addEventListener(n,i),setTimeout((()=>{o||t.dispatchEvent(new Event(n))}),r)},d=/[^.]*(?=\..*)\.|.*/,f=/\..*/,h=/::\d+$/,g={};let m=1;const p={mouseenter:"mouseover",mouseleave:"mouseout"},b=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function v(e,t){return t&&`${t}::${m++}`||e.uidEvent||m++}function _(e){const t=v(e);return e.uidEvent=t,g[t]=g[t]||{},g[t]}function y(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===n))}function E(e,t,n){const r="string"==typeof t,o=r?n:t||n;let i=C(e);return b.has(i)||(i=e),[r,o,i]}function w(e,t,n,r,o){if("string"!=typeof t||!e)return;let[i,s,a]=E(t,n,r);if(t in p){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};s=e(s)}const l=_(e),c=l[a]||(l[a]={}),u=y(c,s,i?n:null);if(u)return void(u.oneOff=u.oneOff&&o);const f=v(s,t.replace(d,"")),h=i?function(e,t,n){return function r(o){const i=e.querySelectorAll(t);for(let{target:s}=o;s&&s!==this;s=s.parentNode)for(const a of i)if(a===s)return T(o,{delegateTarget:s}),r.oneOff&&O.off(e,o.type,t,n),n.apply(s,[o])}}(e,n,s):function(e,t){return function n(r){return T(r,{delegateTarget:e}),n.oneOff&&O.off(e,r.type,t),t.apply(e,[r])}}(e,s);h.delegationSelector=i?n:null,h.callable=s,h.oneOff=o,h.uidEvent=f,c[f]=h,e.addEventListener(a,h,i)}function A(e,t,n,r,o){const i=y(t[n],r,o);i&&(e.removeEventListener(n,i,Boolean(o)),delete t[n][i.uidEvent])}function S(e,t,n,r){const o=t[n]||{};for(const[i,s]of Object.entries(o))i.includes(r)&&A(e,t,n,s.callable,s.delegationSelector)}function C(e){return e=e.replace(f,""),p[e]||e}const O={on(e,t,n,r){w(e,t,n,r,!1)},one(e,t,n,r){w(e,t,n,r,!0)},off(e,t,n,r){if("string"!=typeof t||!e)return;const[o,i,s]=E(t,n,r),a=s!==t,l=_(e),c=l[s]||{},u=t.startsWith(".");if(void 0===i){if(u)for(const n of Object.keys(l))S(e,l,n,t.slice(1));for(const[n,r]of Object.entries(c)){const o=n.replace(h,"");a&&!t.includes(o)||A(e,l,s,r.callable,r.delegationSelector)}}else{if(!Object.keys(c).length)return;A(e,l,s,i,o?n:null)}},trigger(e,t,n){if("string"!=typeof t||!e)return null;const r=a();let o=null,i=!0,s=!0,l=!1;t!==C(t)&&r&&(o=r.Event(t,n),r(e).trigger(o),i=!o.isPropagationStopped(),s=!o.isImmediatePropagationStopped(),l=o.isDefaultPrevented());const c=T(new Event(t,{bubbles:i,cancelable:!0}),n);return l&&c.preventDefault(),s&&e.dispatchEvent(c),c.defaultPrevented&&o&&o.preventDefault(),c}};function T(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const[n,r]of Object.entries(t))try{e[n]=r}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>r})}return e}function $(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function N(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const j={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${N(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${N(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const r of n){let n=r.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),t[n]=$(e.dataset[r])}return t},getDataAttribute:(e,t)=>$(e.getAttribute(`data-bs-${N(t)}`))};class L{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=o(t)?j.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...o(t)?j.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType;for(const[r,i]of Object.entries(t)){const t=e[r],s=o(t)?"element":null==(n=t)?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase();if(!new RegExp(i).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${s}" but expected type "${i}".`)}var n}}class D extends L{constructor(e,n){super(),(e=i(e))&&(this._element=e,this._config=this._getConfig(n),t.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t.remove(this._element,this.constructor.DATA_KEY),O.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t){u(e,t,!(arguments.length>2&&void 0!==arguments[2])||arguments[2])}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return t.get(i(e),this.DATA_KEY)}static getOrCreateInstance(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return"5.3.3"}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const I=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((e=>r(e))).join(","):null},k={find(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return[].concat(...Element.prototype.querySelectorAll.call(t,e))},findOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return Element.prototype.querySelector.call(t,e)},children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const n=[];let r=e.parentNode.closest(t);for(;r;)n.push(r),r=r.parentNode.closest(t);return n},prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!s(e)&&(e=>{if(!o(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t})(e)))},getSelectorFromElement(e){const t=I(e);return t&&k.findOne(t)?t:null},getElementFromSelector(e){const t=I(e);return t?k.findOne(t):null},getMultipleElementsFromSelector(e){const t=I(e);return t?k.find(t):[]}},M=".bs.toast",K=`mouseover${M}`,P=`mouseout${M}`,q=`focusin${M}`,x=`focusout${M}`,W=`hide${M}`,Y=`hidden${M}`,F=`show${M}`,R=`shown${M}`,V="hide",Q="show",z="showing",B={animation:"boolean",autohide:"boolean",delay:"number"},H={animation:!0,autohide:!0,delay:5e3};class U extends D{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return H}static get DefaultType(){return B}static get NAME(){return"toast"}show(){if(O.trigger(this._element,F).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(V),this._element.offsetHeight,this._element.classList.add(Q,z),this._queueCallback((()=>{this._element.classList.remove(z),O.trigger(this._element,R),this._maybeScheduleHide()}),this._element,this._config.animation)}hide(){if(!this.isShown())return;if(O.trigger(this._element,W).defaultPrevented)return;this._element.classList.add(z),this._queueCallback((()=>{this._element.classList.add(V),this._element.classList.remove(z,Q),O.trigger(this._element,Y)}),this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Q),super.dispose()}isShown(){return this._element.classList.contains(Q)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){O.on(this._element,K,(e=>this._onInteraction(e,!0))),O.on(this._element,P,(e=>this._onInteraction(e,!1))),O.on(this._element,q,(e=>this._onInteraction(e,!0))),O.on(this._element,x,(e=>this._onInteraction(e,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each((function(){const t=U.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}var G,J;if(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hide";const n=`click.dismiss${e.EVENT_KEY}`,r=e.NAME;O.on(document,n,`[data-bs-dismiss="${r}"]`,(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),s(this))return;const o=k.getElementFromSelector(this)||this.closest(`.${r}`);e.getOrCreateInstance(o)[t]()}))}(U),G=U,J=()=>{const e=a();if(e){const t=G.NAME,n=e.fn[t];e.fn[t]=G.jQueryInterface,e.fn[t].Constructor=G,e.fn[t].noConflict=()=>(e.fn[t]=n,G.jQueryInterface)}},"loading"===document.readyState?(l.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of l)e()})),l.push(J)):J(),"serviceWorker"in navigator){const e=new URL(document.currentScript.src),t=e.searchParams.get("register"),n=e.searchParams.get("baseurl");if(t){const e=`${n}/sw.min.js`,t=document.getElementById("notification"),r=t.querySelector(".toast-body>button"),o=U.getOrCreateInstance(t);navigator.serviceWorker.register(e).then((e=>{e.waiting&&o.show(),e.addEventListener("updatefound",(()=>{e.installing.addEventListener("statechange",(()=>{e.waiting&&navigator.serviceWorker.controller&&o.show()}))})),r.addEventListener("click",(()=>{e.waiting&&e.waiting.postMessage("SKIP_WAITING"),o.hide()}))}));let i=!1;navigator.serviceWorker.addEventListener("controllerchange",(()=>{i||(window.location.reload(),i=!0)}))}else navigator.serviceWorker.getRegistrations().then((function(e){for(let t of e)t.unregister()}))}}();