(()=>{var e={799(){window.WPConsent={displayChecks:[],checksPassed:!0,settingsHooks:[],settingsProcessed:!1,listeners:[],lastPreferences:null,registerListener:function(e){if(this.listeners.push(e),this.lastPreferences)try{e(this.lastPreferences)}catch(e){console.error("Error in WPConsent listener:",e)}},registerDisplayCheck:function(e){this.displayChecks.push(e),this.checksPassed=!1},registerSettingsHook:function(e){this.settingsHooks.push(e),this.settingsProcessed=!1},runDisplayChecks:function(){return 0===this.displayChecks.length?(this.checksPassed=!0,Promise.resolve()):Promise.all(this.displayChecks.map(e=>e())).then(()=>(this.checksPassed=!0,Promise.resolve())).catch(e=>(console.error("Error in WPConsent display check:",e),this.checksPassed=!0,Promise.resolve()))},runSettingsHooks:function(){return 0===this.settingsHooks.length?(this.settingsProcessed=!0,Promise.resolve()):Promise.all(this.settingsHooks.map(e=>e(window.wpconsent))).then(()=>(this.settingsProcessed=!0,Promise.resolve())).catch(e=>(console.error("Error in WPConsent settings hook:",e),this.settingsProcessed=!0,Promise.resolve()))},hooks:{beforeShowPreferences:[],afterShowPreferences:[],beforeHideBanner:[],afterHideBanner:[],beforeShowBanner:[],afterShowBanner:[],accordionToggled:[]},addHook:function(e,t){this.hooks[e]&&this.hooks[e].push(t)},runHooks:function(e,...t){this.hooks[e]&&this.hooks[e].length>0&&this.hooks[e].forEach(o=>{try{o(...t)}catch(t){console.error(`Error in WPConsent hook ${e}:`,t)}})},showToast:function(e,t=2500){const o=this.shadowRoot.querySelector("#wpconsent-gpc-toast");if(!o)return;const n=o.querySelector(".wpconsent-toast-message");n&&e&&(n.textContent=e),o.style.display="block",setTimeout(()=>{o.classList.add("wpconsent-toast-visible")},10);const s=()=>{o.classList.remove("wpconsent-toast-visible"),setTimeout(()=>{o.style.display="none"},300)},c=setTimeout(s,t),r=o.querySelector(".wpconsent-toast-close");r&&(r.onclick=()=>{clearTimeout(c),s()})},highlightGPCOverride:function(){const e=this.shadowRoot.querySelector("#wpconsent-gpc-override-toggle-label"),t=this.shadowRoot.querySelector("#wpconsent-gpc-override-checkbox"),o=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");e&&(e.classList.add("wpconsent-gpc-override-error"),e.classList.add("wpconsent-shake"),setTimeout(()=>{e.classList.remove("wpconsent-shake")},300),t&&t.focus(),o&&setTimeout(()=>{o.scrollIntoView({behavior:"smooth",block:"center"})},100),t&&t.addEventListener("change",function(){t.checked&&e.classList.remove("wpconsent-gpc-override-error")},{once:!0}))},acceptAll:function(){const e={};Array.isArray(wpconsent.slugs)&&wpconsent.slugs.forEach(t=>{e[t]=!0}),this.savePreferences(e),this.closePreferences()},checkGPC:function(){if(!wpconsent.respect_gpc||!0!==navigator.globalPrivacyControl)return;const e=this.getCookie("wpconsent_preferences");let t={};if(e)try{t=JSON.parse(e)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(t.hasOwnProperty("respect_gpc"))return;const o={};if(wpconsent.slugs.forEach(e=>{const t=this.shadowRoot?.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${e}"]`);t&&t.disabled?o[e]=!0:o[e]=!1}),o.essential=!0,o.respect_gpc=!0,this.savePreferences(o,!0),!1!==wpconsent.gpc_toast_enabled){const e=wpconsent.gpc_toast_message||"GPC Signal Honored",t=wpconsent.gpc_toast_duration||1e4;this.showToast(e,t)}this.checksPassed=!1},savePreferences:function(e,t=!1){const o=this.getCookie("wpconsent_preferences");let n=!1,s=null;if(o)try{s=JSON.parse(o)}catch(e){console.error("WPConsent: Error parsing existing preferences:",e)}if(wpconsent.respect_gpc&&!t&&s){const t=!0===navigator.globalPrivacyControl,o=!0===s.respect_gpc;if(t&&o){const t=this.shadowRoot.querySelector("#wpconsent-gpc-override-checkbox");if(t&&!t.checked)return void this.highlightGPCOverride();e.respect_gpc=!1}}t||(s&&JSON.stringify(s)!==JSON.stringify(e)||wpconsent.default_allow&&Object.values(e).some(e=>!1===e))&&(this.clearCookies(),n=!0),wpconsent.respect_gpc&&!t&&s&&s.hasOwnProperty("respect_gpc")&&(e.respect_gpc=!1),this.setCookie("wpconsent_preferences",JSON.stringify(e),wpconsent.consent_duration),this.hideBanner(),this.closePreferences(),this.unlockScripts(e),this.unlockIframes(e),this.showFloatingButtonIfEnabled(),this.updateWordPressConsent(e),window.dispatchEvent(new CustomEvent("wpconsent_consent_saved",{detail:e})),o&&window.dispatchEvent(new CustomEvent("wpconsent_consent_updated",{detail:e})),n&&(Object.defineProperty(document,"cookie",{get:function(){return""},set:function(e){}}),window.location.reload())},showPreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");if(e){e.style.display="flex",this.setupFocusTrap(e),this.runHooks("afterShowPreferences");const t=this.shadowRoot?.querySelector("#wpconsent-preferences-title");t&&setTimeout(()=>{t.focus({preventScroll:!0}),this.lastFocusedElement=t},100);const o=this.getCookie("wpconsent_preferences");if(o)try{const e=JSON.parse(o);this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]').forEach(t=>{let o=null;o=t.id.startsWith("cookie-category-")?t.id.replace("cookie-category-",""):t.id.startsWith("cookie-service-")?t.id.replace("cookie-service-",""):t.value,o&&o in e&&(t.checked=e[o])});const t=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");if(t){const o=!0===navigator.globalPrivacyControl,n=e&&!0===e.respect_gpc;t.style.display=o&&n?"block":"none"}}catch(e){console.error("Error parsing WPConsent preferences:",e)}}},closePreferences:function(){const e=this.shadowRoot?.querySelector("#wpconsent-preferences-modal");e&&(e.style.display="none",this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null))},showBanner:function(){if(!wpconsent.enable_consent_banner)return;const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeShowBanner"),e.classList.add("wpconsent-banner-visible"),this.updateButtonVisibility(wpconsent),this.setupFocusTrap(e),this.runHooks("afterShowBanner"))},hideBanner:function(){const e=this.shadowRoot?.querySelector("#wpconsent-banner-holder");e&&(this.runHooks("beforeHideBanner"),e.classList.remove("wpconsent-banner-visible"),this.removeFocusTrap(),this.previouslyFocusedElement&&(this.previouslyFocusedElement.focus({preventScroll:!0}),this.previouslyFocusedElement=null),this.runHooks("afterHideBanner"))},setCookie:function(e,t,o){let n="";if(o>0){const e=new Date;e.setTime(e.getTime()+24*o*60*60*1e3),n="expires="+e.toUTCString()+";"}const s=this.getCookieDomain();document.cookie=e+"="+t+";"+n+s+"path=/"},getCookieDomain:function(){return wpconsent.enable_shared_consent&&wpconsent.cookie_domain&&""!==wpconsent.cookie_domain?"domain="+(wpconsent.cookie_domain.startsWith(".")?wpconsent.cookie_domain:"."+wpconsent.cookie_domain)+";":""},getCookie:function(e){const t=`; ${document.cookie}`.split(`; ${e}=`);if(2===t.length)return t.pop().split(";").shift()},hasConsent:function(e){const t=this.getCookie("wpconsent_preferences");if(!t)return!1;try{const o=JSON.parse(t);return"essential"===e||!0===o[e]}catch(e){return console.error("Error parsing WPConsent preferences:",e),!1}},shouldUnlockContent:function(e,t,o){return"essential"===o||(wpconsent.manual_toggle_services?!(!t||void 0===e[t])&&e[t]:!0===e[o])},unlockScripts:function(e){this.lastPreferences=e,this.listeners&&this.listeners.length>0&&this.listeners.forEach(t=>{try{t(e)}catch(e){console.error("Error in WPConsent listener:",e)}}),document.querySelectorAll('script[type="text/plain"]').forEach(t=>{const o=t.getAttribute("data-wpconsent-category"),n=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,n,o)){const e=document.createElement("script");t.getAttributeNames().forEach(o=>{"type"!==o&&e.setAttribute(o,t.getAttribute(o))});const o=t.getAttribute("data-wpconsent-src");o?e.src=o:e.text=t.text,t.parentNode.replaceChild(e,t)}}),document.dispatchEvent(new CustomEvent("wpconsent_consent_processed",{detail:e})),WPConsent.localGtag("set","developer_id.dMmRkYz",!0),WPConsent.localGtag("consent","update",{ad_storage:e.marketing?"granted":"denied",analytics_storage:e.statistics?"granted":"denied",ad_user_data:e.marketing?"granted":"denied",ad_personalization:e.marketing?"granted":"denied"}),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"wpconsent_consent_processed",wpconsentPreferences:e})},unlockIframes:function(e){document.querySelectorAll("iframe[data-wpconsent-src]").forEach(t=>{const o=t.getAttribute("data-wpconsent-category"),n=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,n,o)){const e=t.getAttribute("data-wpconsent-src");e&&(t.src=e),t.removeAttribute("data-wpconsent-src"),t.removeAttribute("data-wpconsent-name"),t.removeAttribute("data-wpconsent-category")}}),document.querySelectorAll(".wpconsent-iframe-placeholder").forEach(t=>{const o=t.getAttribute("data-wpconsent-category"),n=t.getAttribute("data-wpconsent-name");if(this.shouldUnlockContent(e,n,o)){const e=t.querySelector(".wpconsent-iframe-thumbnail"),o=t.querySelector(".wpconsent-iframe-overlay-content");e&&e.remove(),o&&o.remove(),t.classList.remove("wpconsent-iframe-placeholder")}})},init:function(){this.runSettingsHooks().then(()=>{this.initWordPress(),this.updateButtonVisibility(wpconsent);const e=document.getElementById("wpconsent-container"),t=document.getElementById("wpconsent-template");if(this.shadowRoot=e.shadowRoot,this.shadowRoot)this.runDisplayChecks().then(()=>{this.processBannerDisplay()});else{this.shadowRoot=e.attachShadow({mode:"open"});const o=t.content.cloneNode(!0);this.shadowRoot.appendChild(o),t.remove(),this.initializeEventListeners(),this.initializeAccordions(),this.initializeKeyboardHandlers(),this.runDisplayChecks().then(()=>{this.loadExternalCSS(e).then(()=>{this.processBannerDisplay()})})}})},processBannerDisplay:function(){this.checkGPC();const e=this.getCookie("wpconsent_preferences");if(e){let t={};try{if(t=JSON.parse(e),wpconsent.slugs&&Array.isArray(wpconsent.slugs)&&!wpconsent.slugs.every(e=>t.hasOwnProperty(e)))return this.setCookie("wpconsent_preferences","",-1),void(this.checksPassed&&this.showBanner());this.unlockScripts(t),this.unlockIframes(t)}catch(e){console.error("Error parsing WPConsent preferences:",e)}this.showFloatingButtonIfEnabled()}else if(this.checksPassed&&this.showBanner(),wpconsent.default_allow||!wpconsent.enable_script_blocking){const e={};wpconsent.slugs.forEach(t=>{e[t]=!0}),this.unlockScripts(e),this.unlockIframes(e)}else if(!wpconsent.enable_content_blocking){const e={};wpconsent.slugs.forEach(t=>{e[t]=!0}),this.unlockIframes(e)}document.querySelectorAll(".wpconsent-iframe-overlay-content.wpconsent-content-hidden").forEach(function(e){e.classList.remove("wpconsent-content-hidden")}),window.dispatchEvent(new CustomEvent("wpconsent_banner_initialized"))},loadExternalCSS:function(e){return new Promise(t=>{try{const o=`${wpconsent.css_url}?ver=${wpconsent.css_version}`,n=document.createElement("link");n.rel="stylesheet",n.href=o,n.onload=function(){e.style.display="block",t()},n.onerror=function(){console.error("Failed to load WPConsent styles"),t()},this.shadowRoot.appendChild(n)}catch(e){console.error("Failed to load WPConsent styles:",e),t()}})},initializeEventListeners:function(){this.shadowRoot.querySelectorAll(".wpconsent-accept-all").forEach(e=>e.addEventListener("click",()=>this.acceptAll())),this.shadowRoot.querySelectorAll(".wpconsent-cancel-cookies").forEach(e=>e.addEventListener("click",()=>{const e={};wpconsent.slugs.forEach(t=>{const o=this.shadowRoot.querySelector(`#wpconsent-preferences-modal input[type="checkbox"][id="cookie-service-${t}"]`);o&&o.disabled?e[t]=!0:e[t]=!1}),e.essential=!0,this.savePreferences(e)})),this.shadowRoot.querySelector("#wpconsent-banner-close")?.addEventListener("click",()=>this.hideBanner()),this.shadowRoot.querySelector("#wpconsent-preferences-all")?.addEventListener("click",()=>this.showPreferences());const e=this.shadowRoot.querySelector("#wpconsent-consent-floating");e&&e.addEventListener("click",()=>this.showPreferences()),this.initializeCheckboxListeners(),document.addEventListener("click",e=>{const t=e.target.closest(".wpconsent-iframe-accept-button");if(t){const e=t.getAttribute("data-category"),o=t.closest(".wpconsent-iframe-placeholder"),n=o?.getAttribute("data-wpconsent-name");if(e){let t={};try{t=JSON.parse(this.getCookie("wpconsent_preferences")||"{}")}catch(e){console.error("Failed to parse wpconsent_preferences cookie:",e)}const o=!0===navigator.globalPrivacyControl,s=!0===t.respect_gpc;if(wpconsent.respect_gpc&&o&&s){this.showPreferences();const t=this.shadowRoot.querySelector(`#cookie-category-${e}`);if(t&&(t.checked=!0),n){const e=this.shadowRoot.querySelector(`#cookie-service-${n}`);e&&(e.checked=!0)}const o=this.shadowRoot.querySelector("#wpconsent-gpc-override-container");o&&(o.style.display="block"),this.highlightGPCOverride()}else{const o={...t,essential:!0,[e]:!0};n&&(o[n]=!0),this.savePreferences(o)}}}}),document.addEventListener("click",e=>{e.target.closest(".wpconsent-open-preferences")&&(e.preventDefault(),this.showPreferences())}),this.shadowRoot.querySelector(".wpconsent-preferences-header-close")?.addEventListener("click",()=>this.closePreferences()),this.shadowRoot.querySelector(".wpconsent-save-preferences")?.addEventListener("click",()=>{const e=this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"]'),t=Array.from(e).filter(e=>e.checked).map(e=>e.value),o={};wpconsent.slugs.forEach(e=>{o[e]=t.includes(e)}),o.essential=!0,this.savePreferences(o)}),this.shadowRoot.querySelector(".wpconsent-close-preferences")?.addEventListener("click",()=>this.closePreferences()),window.addEventListener("wpconsent_consent_saved",function(e){if("function"!=typeof window.clarity)return;const t=e.detail;window.clarity("consentv2",{ad_Storage:t.marketing?"granted":"denied",analytics_Storage:t.statistics?"granted":"denied"})})},localGtag:function(){window.dataLayer=window.dataLayer||[],function(){dataLayer.push(arguments)}.apply(window,arguments)},initializeCheckboxListeners:function(){this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-category-"]').forEach(e=>{e.addEventListener("change",e=>{this.handleCategoryCheckboxChange(e.target)})}),this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach(e=>{e.addEventListener("change",e=>{this.handleServiceCheckboxChange(e.target)})})},handleCategoryCheckboxChange:function(e){const t=e.id.replace("cookie-category-","");this.shadowRoot.querySelectorAll('#wpconsent-preferences-modal input[type="checkbox"][id^="cookie-service-"]').forEach(o=>{o.closest(`.wpconsent-cookie-category-${t}`)&&(o.checked=e.checked)})},handleServiceCheckboxChange:function(e){const t=e.closest(".wpconsent-cookie-category");if(!t)return;const o=t.querySelector('input[type="checkbox"][id^="cookie-category-"]');if(!o)return;const n=t.querySelectorAll('input[type="checkbox"][id^="cookie-service-"]');let s=!1;n.forEach(e=>{e.checked&&(s=!0)}),o.checked=s},initializeAccordions(){this.shadowRoot.querySelectorAll(".wpconsent-preferences-accordion-item").forEach(e=>{const t=e.querySelector(".wpconsent-preferences-accordion-header"),o=e.querySelector(".wpconsent-preferences-accordion-content");t&&o&&t.addEventListener("click",t=>{t.target.closest(".wpconsent-preferences-checkbox-toggle")||this.toggleAccordion(e,o)})})},toggleAccordion(e,t){e.classList.contains("active");const o=e.parentElement,n=e.classList.contains("wpconsent-cookie-service"),s=e.classList.contains("wpconsent-cookie-category");s?o&&o.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-category").forEach(t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),t.querySelectorAll(".wpconsent-cookie-service").forEach(e=>{e.classList.remove("active");const t=e.querySelector(".wpconsent-preferences-accordion-toggle");t&&t.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:e,content:e.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})})}}):n&&o&&o.querySelectorAll(":scope > .wpconsent-preferences-accordion-item.wpconsent-cookie-service").forEach(t=>{if(t!==e){t.classList.remove("active");const e=t.querySelector(".wpconsent-preferences-accordion-toggle");e&&e.setAttribute("aria-expanded","false"),this.runHooks("accordionToggled",{accordion:t,content:t.querySelector(".wpconsent-preferences-accordion-content"),isActive:!1,isService:!0,isCategory:!1})}}),e.classList.toggle("active");const c=e.querySelector(".wpconsent-preferences-accordion-toggle");if(c){const t=e.classList.contains("active");c.setAttribute("aria-expanded",t?"true":"false")}const r=e.classList.contains("active");this.runHooks("accordionToggled",{accordion:e,content:t,isActive:r,isService:n,isCategory:s})},initializeKeyboardHandlers:function(){document.addEventListener("keydown",e=>{"Tab"===e.key?this.handleTabKey(e):"Escape"===e.key&&this.handleEscapeKey(e)})},handleEscapeKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),o=this.shadowRoot?.querySelector("#wpconsent-banner-holder");t&&"flex"===t.style.display?this.closePreferences():o&&o.classList.contains("wpconsent-banner-visible")&&this.hideBanner()},handleTabKey:function(e){const t=this.shadowRoot?.querySelector("#wpconsent-banner-holder"),o=this.shadowRoot?.querySelector("#wpconsent-preferences-modal"),n=t&&t.classList.contains("wpconsent-banner-visible"),s=o&&"flex"===o.style.display;if(!n&&!s)return;const c=s?o:t,r=this.getFocusableElements(c);if(0===r.length)return;e.preventDefault();const i=r[0],a=r[r.length-1];let l;this.lastFocusedElement&&r.includes(this.lastFocusedElement)?l=this.lastFocusedElement:(l=i,this.lastFocusedElement=l);const d=r.indexOf(l);let h;h=e.shiftKey?d<=0?a:r[d-1]:d>=r.length-1?i:r[d+1],h.focus({preventScroll:!0}),this.lastFocusedElement=h},setupFocusTrap:function(e){this.previouslyFocusedElement=document.activeElement,this.lastFocusedElement=null},removeFocusTrap:function(){this.lastFocusedElement=null},setInitialFocus:function(e){const t=this.getFocusableElements(e);t.length>0&&setTimeout(()=>{t[0].focus({preventScroll:!0}),this.lastFocusedElement=t[0]},100)},getFocusableElements:function(e){return Array.from(e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(t=>{let o=t;for(;o&&o!==e;){const e=window.getComputedStyle(o);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity||o.disabled||"true"===o.getAttribute("aria-hidden"))return!1;o=o.parentElement}return!0})},isElementInContainer:function(e,t){return!(!e||!t)&&(t.shadowRoot?t.shadowRoot.contains(e):t.contains(e))},clearCookies:function(){for(var e=document.cookie.split("; "),t=0;t<e.length;t++)for(var o=window.location.hostname.split(".");o.length>0;){var n=encodeURIComponent(e[t].split(";")[0].split("=")[0])+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; domain="+o.join(".")+" ;path=",s=location.pathname.split("/");for(document.cookie=n+"/";s.length>0;)document.cookie=n+s.join("/"),s.pop();o.shift()}},initWordPress:function(){window.wp_consent_type=wpconsent.consent_type;let e=new CustomEvent("wp_consent_type_defined");document.dispatchEvent(e)},showFloatingButtonIfEnabled:function(){if(wpconsent.enable_consent_floating){const e=this.shadowRoot?.querySelector("#wpconsent-consent-floating");e&&(e.style.display="block")}},updateButtonVisibility:function(e){this.shadowRoot&&["accept","cancel","preferences"].forEach(t=>{const o=this.shadowRoot.querySelector(`#wpconsent-${t}-all`);o&&(e[`${t}_button_enabled`]?(o.classList.remove("wpconsent-button-disabled"),o.removeAttribute("data-disabled")):(o.classList.add("wpconsent-button-disabled"),o.setAttribute("data-disabled","true")))})},updateWordPressConsent:function(e){"function"==typeof wp_set_consent&&(wp_set_consent("functional","allow"),wp_set_consent("preferences","allow"),wp_set_consent("statistics",e.statistics?"allow":"deny"),wp_set_consent("statistics-anonymous",e.statistics?"allow":"deny"),wp_set_consent("marketing",e.marketing?"allow":"deny"))}},document.addEventListener("DOMContentLoaded",()=>WPConsent.init())}},t={};function o(n){var s=t[n];if(void 0!==s)return s.exports;var c=t[n]={exports:{}};return e[n](c,c.exports,o),c.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";o(799)})()})();
!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.7",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,o){return o=null==o?u.length-1:+o,function(){for(var n=Math.max(arguments.length-o,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+o];switch(o){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(o+1),r=0;r<o;r++)e[r]=arguments[r];return e[o]=t,u.apply(this,e)}}function o(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function i(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=i("String"),Y=i("Number"),Z=i("Date"),nn=i("RegExp"),tn=i("Error"),rn=i("Symbol"),en=i("ArrayBuffer"),a=i("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=i("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=i("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||i("Array");function y(n,t){return null!=n&&q.call(n,t)}var on=i("Arguments"),an=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,o="constructor";for(y(n,o)&&!t.contains(o)&&t.push(o);r--;)(o=J[r])in n&&n[o]!==u[o]&&!t.contains(o)&&t.push(o)}function b(n){if(!o(n))return[];if(W)return W(n);var t,r=[];for(t in n)y(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=b(t),e=r.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=r[o];if(t[i]!==u[i]||!(i in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,t,r,e){var u;return n===t?0!==n||1/n==1/t:null!=n&&null!=t&&(n!=n?t!=t:("function"==(u=typeof n)||"object"==u||"object"==typeof t)&&function n(t,r,e,u){t instanceof m&&(t=t._wrapped);r instanceof m&&(r=r._wrapped);var o=s.call(t);if(o!==s.call(r))return!1;if(un&&"[object Object]"==o&&h(t)){if(!h(r))return!1;o=bn}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return F.valueOf.call(t)===F.valueOf.call(r);case"[object ArrayBuffer]":case bn:return n(gn(t),gn(r),e,u)}o="[object Array]"===o;if(!o&&vn(t)){var i=d(t);if(i!==d(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof r)return!1;var i=t.constructor,a=r.constructor;if(i!==a&&!(p(i)&&i instanceof i&&p(a)&&a instanceof a)&&"constructor"in t&&"constructor"in r)return!1}e=e||[];u=u||[];var f=e.length;for(;f--;)if(e[f]===t)return u[f]===r;e.push(t);u.push(r);if(o){if((f=t.length)!==r.length)return!1;for(;f--;)if(!mn(t[f],r[f],e,u))return!1}else{var c,l=b(t);if(f=l.length,b(r).length!==f)return!1;for(;f--;)if(c=l[f],!y(r,c)||!mn(t[c],r[c],e,u))return!1}e.pop();u.pop();return!0}(n,t,r,e))}function c(n){if(!o(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var t=c(n);if(g(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==_n||!p(n[wn])}}var wn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(wn,u),_n=t.concat(u),r=["add"].concat(t,wn,"has"),u=a?jn(U):i("Map"),t=a?jn(_n):i("WeakMap"),U=a?jn(r):i("Set"),a=i("WeakSet");function j(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function An(n){for(var t={},r=b(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function xn(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function Sn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),o=u.length,i=0;i<o;i++){var a=u[i];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var On=Sn(c),w=Sn(b),Mn=Sn(c,!0);function En(n){var t;return o(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function Bn(n){return v(n)?n:[n]}function _(n){return m.toPath(n)}function Nn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function In(n,t,r){n=Nn(n,_(t));return H(n)?r:n}function Tn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function kn(t){return t=_(t),function(n){return Nn(n,t)}}function x(u,o,n){if(void 0===o)return u;switch(null==n?3:n){case 1:return function(n){return u.call(o,n)};case 3:return function(n,t,r){return u.call(o,n,t,r)};case 4:return function(n,t,r,e){return u.call(o,n,t,r,e)}}return function(){return u.apply(o,arguments)}}function Dn(n,t,r){return null==n?Tn:p(n)?x(n,t,r):(o(n)&&!v(n)?A:kn)(n)}function Rn(n,t){return Dn(n,t,1/0)}function S(n,t,r){return m.iteratee!==Rn?m.iteratee(n,t):Dn(n,t,r)}function Vn(){}function Fn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(t){function r(n){return t[n]}var n="(?:"+b(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;e<t;e++)r[e]=o[e]===a?arguments[n++]:o[e];for(;n<arguments.length;)r.push(arguments[n++]);return Jn(u,i,this,this,r)}var a=M.placeholder;return i}),Gn=(M.placeholder=m,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Jn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(g);function B(n,t,r,e){if(e=e||[],t||0===t){if(t<=0)return e.concat(n)}else t=1/0;for(var u=e.length,o=0,i=g(n);o<i;o++){var a=n[o];if(E(a)&&(v(a)||an(a)))if(1<t)B(a,t-1,r,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else r||(e[u++]=a)}return e}var Hn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var nt=M(Zn,2);function tt(n,t,r){t=S(t,r);for(var e,u=b(n),o=0,i=u.length;o<i;o++)if(t(n[e=u[o]],e,n))return e}function rt(o){return function(n,t,r){t=S(t,r);for(var e=g(n),u=0<o?0:e-1;0<=u&&u<e;u+=o)if(t(n[u],u,n))return u;return-1}}var et=rt(1),ut=rt(-1);function ot(n,t,r,e){for(var u=(r=S(r,e,1))(t),o=0,i=g(n);o<i;){var a=Math.floor((o+i)/2);r(n[a])<u?o=a+1:i=a}return o}function it(o,i,a){return function(n,t,r){var e=0,u=g(n);if("number"==typeof r)0<o?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=i(f.call(n,e,u),fn))?r+e:-1;for(r=0<o?e:u-1;0<=r&&r<u;r+=o)if(n[r]===t)return r;return-1}}var at=it(1,et,ot),ft=it(-1,ut);function ct(n,t,r){t=(E(n)?et:tt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,o=n.length;u<o;u++)t(n[u],u,n);else for(var e=b(n),u=0,o=e.length;u<o;u++)t(n[e[u]],e[u],n);return n}function I(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=t(n[a],a,n)}return o}function lt(f){return function(n,t,r,e){var u=3<=arguments.length;return function(n,t,r,e){var u=!E(n)&&b(n),o=(u||n).length,i=0<f?0:o-1;for(e||(r=n[u?u[i]:i],i+=f);0<=i&&i<o;i+=f){var a=u?u[i]:i;r=t(r,n[a],a,n)}return r}(n,x(t,e,4),r,u)}}var st=lt(1),pt=lt(-1);function T(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!t(n[i],i,n))return!1}return!0}function vt(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(t(n[i],i,n))return!0}return!1}function k(n,t,r,e){return E(n)||(n=j(n)),0<=at(n,t,r="number"==typeof r&&!e?r:0)}var yt=l(function(n,r,e){var u,o;return p(r)?o=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),I(n,function(n){var t=o;if(!t){if(null==(n=u&&u.length?Nn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function dt(n,t){return I(n,kn(t))}function gt(n,e,t){var r,u,o=-1/0,i=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&o<r&&(o=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(i<u||u===-1/0&&o===-1/0)&&(o=n,i=u)});return o}var bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mt(n){return n?v(n)?f.call(n):X(n)?n.match(bt):E(n)?I(n,Tn):j(n):[]}function jt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Fn(n.length-1)];for(var e=mt(n),r=g(e),u=(t=Math.max(Math.min(t,r),0),r-1),o=0;o<t;o++){var i=Fn(o,u),a=e[o];e[o]=e[i],e[i]=a}return e.slice(0,t)}function D(o,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);o(u,n,t)}),u}}var wt=D(function(n,t,r){y(n,r)?n[r].push(t):n[r]=[t]}),_t=D(function(n,t,r){n[r]=t}),At=D(function(n,t,r){y(n,r)?n[r]++:n[r]=1}),xt=D(function(n,t,r){n[r?0:1].push(t)},!0);function St(n,t,r){return t in r}var Ot=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=c(n)):(e=St,t=B(t,!1,!1),n=Object(n));for(var u=0,o=t.length;u<o;u++){var i=t[u],a=n[i];e(a,i,n)&&(r[i]=a)}}return r}),Mt=l(function(n,r){var t,e=r[0];return p(e)?(e=Yn(e),1<r.length&&(t=r[1])):(r=I(B(r,!1,!1),String),e=function(n,t){return!k(r,t)}),Ot(n,e,t)});function Et(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Bt(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Et(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Nt=l(function(n,t){return t=B(t,!0,!0),T(n,function(n){return!k(t,n)})}),It=l(function(n,t){return Nt(n,t)});function Tt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],o=[],i=0,a=g(n);i<a;i++){var f=n[i],c=r?r(f,i,n):f;t&&!r?(i&&o===c||u.push(f),o=c):r?k(o,c)||(o.push(c),u.push(f)):k(u,f)||u.push(f)}return u}var kt=l(function(n){return Tt(B(n,!0,!0))});function Dt(n){for(var t=n&&gt(n,g).length||0,r=Array(t),e=0;e<t;e++)r[e]=dt(n,e);return r}var Rt=l(Dt);function Vt(n,t){return n._chain?m(t).chain():t}function Ft(r){return N(xn(r),function(n){var t=m[n]=r[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Vt(this,t.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];m.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];m.prototype[n]=function(){var n=this._wrapped;return Vt(this,n=null!=n?t.apply(n,arguments):n)}});n=Ft({__proto__:null,VERSION:n,restArguments:l,isObject:o,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=g(n))&&(v(n)||X(n)||an(n))?0===t:0===g(b(n)))},isMatch:dn,isEqual:function(n,t){return mn(n,t)},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:b,allKeys:c,values:j,pairs:function(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:w,assign:w,defaults:Mn,create:function(n,t){return n=En(n),t&&w(n,t),n},clone:function(n){return o(n)?v(n)?n.slice():On({},n):n},tap:function(n,t){return t(n),n},get:In,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!y(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=b(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=t(n[a],a,n)}return o},identity:Tn,constant:cn,noop:Vn,toPath:Bn,property:kn,propertyOf:function(t){return null==t?Vn:function(n){return In(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Fn,now:O,escape:qn,unescape:r,templateSettings:Un,template:function(o,n,t){n=Mn({},n=!n&&t?t:n,m.templateSettings);var r,t=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),i=0,a="__p+='";if(o.replace(t,function(n,t,r,e,u){return a+=o.slice(i,u).replace(Ln,$n),i=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!Cn.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,m)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var o=null==n?void 0:n[t[u]];void 0===o&&(o=r,u=e),n=p(o)?o.call(n):o}return n},uniqueId:function(n){var t=++Kn+"";return n?n+t:t},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function o(n){var t=o.cache,r=""+(u?u.apply(this,arguments):n);return y(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return o.cache={},o},delay:Qn,defer:Xn,throttle:function(r,e,u){function o(){l=!1===u.leading?0:O(),i=null,c=r.apply(a,f),i||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(i&&(clearTimeout(i),i=null),l=n,c=r.apply(a,f),i||(a=f=null)):i||!1===u.trailing||(i=setTimeout(o,t)),c}var i,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(i),l=0,i=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-i;n<r?o=setTimeout(u,r-n):(o=null,e||(f=t.apply(c,a)),o||(a=c=null))}var o,i,a,f,c,n=l(function(n){return c=this,a=n,i=O(),o||(o=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(o),o=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Yn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Zn,once:nt,findKey:tt,findIndex:et,findLastIndex:ut,sortedIndex:ot,indexOf:at,lastIndexOf:ft,find:ct,detect:ct,findWhere:function(n,t){return ct(n,A(t))},each:N,forEach:N,map:I,collect:I,reduce:st,foldl:st,inject:st,reduceRight:pt,foldr:pt,filter:T,select:T,reject:function(n,t,r){return T(n,Yn(S(t)),r)},every:ht,all:ht,some:vt,any:vt,contains:k,includes:k,include:k,invoke:yt,pluck:dt,where:function(n,t){return T(n,A(t))},max:gt,min:function(n,e,t){var r,u,o=1/0,i=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<o&&(o=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<i||u===1/0&&o===1/0)&&(o=n,i=u)});return o},shuffle:function(n){return jt(n,1/0)},sample:jt,sortBy:function(n,e,t){var u=0;return e=S(e,t),dt(I(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:wt,indexBy:_t,countBy:At,partition:xt,toArray:mt,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Ot,omit:Mt,first:Bt,head:Bt,take:Bt,initial:Et,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:It,uniq:Tt,unique:Tt,union:kt,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=g(n);e<u;e++){var o=n[e];if(!k(t,o)){for(var i=1;i<r&&k(arguments[i],o);i++);i===r&&t.push(o)}}return t},difference:Nt,unzip:Dt,transpose:Dt,zip:Rt,object:function(n,t){for(var r={},e=0,u=g(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),o=0;o<e;o++,n+=r)u[o]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Ft,default:m});return n._=n});
(function(){
var _loading=false;
_load=function(){
if(_loading)
return;
jQuery(function(){
var _headTag=document.getElementsByTagName('head')[0];
var _script=document.createElement("script");
_script.setAttribute('src', HUParams.mainScriptUrl);
_script.setAttribute('id', 'hu-scripts');
_script.setAttribute('defer', 'defer');
if(_headTag){
_headTag.appendChild(_script);
}
_loading=true;
});
};
var _doWhenJqueryIsReady=function(attempts){
attempts=attempts||0;
if(typeof undefined!==typeof window.jQuery){
_load();
}else if(attempts < 30){
setTimeout(function(){
attempts++;
_doWhenJqueryIsReady(attempts);
}, 200);
}else{
console.log('Hueman theme problem:jQuery.js was not detected on your website');
}};
var jquery_script_el=document.querySelectorAll('[src*="wp-includes/js/jquery/jquery.js"]');
if(jquery_script_el[0]){
jquery_script_el[0].addEventListener('load', function(){
_doWhenJqueryIsReady();
});
}
try {_doWhenJqueryIsReady();} catch(er){
console.log('hu-init error', er);
}})();
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
(()=>{var n={243:function(n,t,r){n=r.nmd(n),function(){var e,u="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",f=32,a=128,c=1/0,l=9007199254740991,s=NaN,h=4294967295,p=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",f],["partialRight",64],["rearg",256]],v="[object Arguments]",_="[object Array]",g="[object Boolean]",y="[object Date]",d="[object Error]",w="[object Function]",b="[object GeneratorFunction]",m="[object Map]",x="[object Number]",j="[object Object]",A="[object Promise]",k="[object RegExp]",O="[object Set]",E="[object String]",I="[object Symbol]",R="[object WeakMap]",z="[object ArrayBuffer]",S="[object DataView]",C="[object Float32Array]",L="[object Float64Array]",W="[object Int8Array]",T="[object Int16Array]",U="[object Int32Array]",B="[object Uint8Array]",D="[object Uint8ClampedArray]",$="[object Uint16Array]",M="[object Uint32Array]",F=/\b__p \+='';/g,N=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,K=RegExp(q.source),V=RegExp(Z.source),G=/<%-([\s\S]+?)%>/g,H=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,X=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nn=/[\\^$.*+?()[\]{}|]/g,tn=RegExp(nn.source),rn=/^\s+/,en=/\s/,un=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,on=/\{\n\/\* \[wrapped with (.+)\] \*/,fn=/,? & /,an=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,cn=/[()=,{}\[\]\/\s]/,ln=/\\(\\)?/g,sn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hn=/\w*$/,pn=/^[-+]0x[0-9a-f]+$/i,vn=/^0b[01]+$/i,_n=/^\[object .+?Constructor\]$/,gn=/^0o[0-7]+$/i,yn=/^(?:0|[1-9]\d*)$/,dn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,wn=/($^)/,bn=/['\n\r\u2028\u2029\\]/g,mn="\\ud800-\\udfff",xn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",jn="\\u2700-\\u27bf",An="a-z\\xdf-\\xf6\\xf8-\\xff",kn="A-Z\\xc0-\\xd6\\xd8-\\xde",On="\\ufe0e\\ufe0f",En="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",In="["+mn+"]",Rn="["+En+"]",zn="["+xn+"]",Sn="\\d+",Cn="["+jn+"]",Ln="["+An+"]",Wn="[^"+mn+En+Sn+jn+An+kn+"]",Tn="\\ud83c[\\udffb-\\udfff]",Un="[^"+mn+"]",Bn="(?:\\ud83c[\\udde6-\\uddff]){2}",Dn="[\\ud800-\\udbff][\\udc00-\\udfff]",$n="["+kn+"]",Mn="\\u200d",Fn="(?:"+Ln+"|"+Wn+")",Nn="(?:"+$n+"|"+Wn+")",Pn="(?:['’](?:d|ll|m|re|s|t|ve))?",qn="(?:['’](?:D|LL|M|RE|S|T|VE))?",Zn="(?:"+zn+"|"+Tn+")?",Kn="["+On+"]?",Vn=Kn+Zn+"(?:"+Mn+"(?:"+[Un,Bn,Dn].join("|")+")"+Kn+Zn+")*",Gn="(?:"+[Cn,Bn,Dn].join("|")+")"+Vn,Hn="(?:"+[Un+zn+"?",zn,Bn,Dn,In].join("|")+")",Jn=RegExp("['’]","g"),Yn=RegExp(zn,"g"),Qn=RegExp(Tn+"(?="+Tn+")|"+Hn+Vn,"g"),Xn=RegExp([$n+"?"+Ln+"+"+Pn+"(?="+[Rn,$n,"$"].join("|")+")",Nn+"+"+qn+"(?="+[Rn,$n+Fn,"$"].join("|")+")",$n+"?"+Fn+"+"+Pn,$n+"+"+qn,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Sn,Gn].join("|"),"g"),nt=RegExp("["+Mn+mn+xn+On+"]"),tt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,rt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],et=-1,ut={};ut[C]=ut[L]=ut[W]=ut[T]=ut[U]=ut[B]=ut[D]=ut[$]=ut[M]=!0,ut[v]=ut[_]=ut[z]=ut[g]=ut[S]=ut[y]=ut[d]=ut[w]=ut[m]=ut[x]=ut[j]=ut[k]=ut[O]=ut[E]=ut[R]=!1;var it={};it[v]=it[_]=it[z]=it[S]=it[g]=it[y]=it[C]=it[L]=it[W]=it[T]=it[U]=it[m]=it[x]=it[j]=it[k]=it[O]=it[E]=it[I]=it[B]=it[D]=it[$]=it[M]=!0,it[d]=it[w]=it[R]=!1;var ot={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,at=parseInt,ct="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,lt="object"==typeof self&&self&&self.Object===Object&&self,st=ct||lt||Function("return this")(),ht=t&&!t.nodeType&&t,pt=ht&&n&&!n.nodeType&&n,vt=pt&&pt.exports===ht,_t=vt&&ct.process,gt=function(){try{return pt&&pt.require&&pt.require("util").types||_t&&_t.binding&&_t.binding("util")}catch(n){}}(),yt=gt&&gt.isArrayBuffer,dt=gt&&gt.isDate,wt=gt&&gt.isMap,bt=gt&&gt.isRegExp,mt=gt&&gt.isSet,xt=gt&&gt.isTypedArray;function jt(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function At(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u<i;){var o=n[u];t(e,o,r(o),n)}return e}function kt(n,t){for(var r=-1,e=null==n?0:n.length;++r<e&&!1!==t(n[r],r,n););return n}function Ot(n,t){for(var r=null==n?0:n.length;r--&&!1!==t(n[r],r,n););return n}function Et(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(!t(n[r],r,n))return!1;return!0}function It(n,t){for(var r=-1,e=null==n?0:n.length,u=0,i=[];++r<e;){var o=n[r];t(o,r,n)&&(i[u++]=o)}return i}function Rt(n,t){return!(null==n||!n.length)&&$t(n,t,0)>-1}function zt(n,t,r){for(var e=-1,u=null==n?0:n.length;++e<u;)if(r(t,n[e]))return!0;return!1}function St(n,t){for(var r=-1,e=null==n?0:n.length,u=Array(e);++r<e;)u[r]=t(n[r],r,n);return u}function Ct(n,t){for(var r=-1,e=t.length,u=n.length;++r<e;)n[u+r]=t[r];return n}function Lt(n,t,r,e){var u=-1,i=null==n?0:n.length;for(e&&i&&(r=n[++u]);++u<i;)r=t(r,n[u],u,n);return r}function Wt(n,t,r,e){var u=null==n?0:n.length;for(e&&u&&(r=n[--u]);u--;)r=t(r,n[u],u,n);return r}function Tt(n,t){for(var r=-1,e=null==n?0:n.length;++r<e;)if(t(n[r],r,n))return!0;return!1}var Ut=Pt("length");function Bt(n,t,r){var e;return r(n,function(n,r,u){if(t(n,r,u))return e=r,!1}),e}function Dt(n,t,r,e){for(var u=n.length,i=r+(e?1:-1);e?i--:++i<u;)if(t(n[i],i,n))return i;return-1}function $t(n,t,r){return t==t?function(n,t,r){for(var e=r-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1}(n,t,r):Dt(n,Ft,r)}function Mt(n,t,r,e){for(var u=r-1,i=n.length;++u<i;)if(e(n[u],t))return u;return-1}function Ft(n){return n!=n}function Nt(n,t){var r=null==n?0:n.length;return r?Kt(n,t)/r:s}function Pt(n){return function(t){return null==t?e:t[n]}}function qt(n){return function(t){return null==n?e:n[t]}}function Zt(n,t,r,e,u){return u(n,function(n,u,i){r=e?(e=!1,n):t(r,n,u,i)}),r}function Kt(n,t){for(var r,u=-1,i=n.length;++u<i;){var o=t(n[u]);o!==e&&(r=r===e?o:r+o)}return r}function Vt(n,t){for(var r=-1,e=Array(n);++r<n;)e[r]=t(r);return e}function Gt(n){return n?n.slice(0,sr(n)+1).replace(rn,""):n}function Ht(n){return function(t){return n(t)}}function Jt(n,t){return St(t,function(t){return n[t]})}function Yt(n,t){return n.has(t)}function Qt(n,t){for(var r=-1,e=n.length;++r<e&&$t(t,n[r],0)>-1;);return r}function Xt(n,t){for(var r=n.length;r--&&$t(t,n[r],0)>-1;);return r}var nr=qt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"}),tr=qt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(n){return"\\"+ot[n]}function er(n){return nt.test(n)}function ur(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function ir(n,t){return function(r){return n(t(r))}}function or(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var f=n[r];f!==t&&f!==o||(n[r]=o,i[u++]=r)}return i}function fr(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=n}),r}function ar(n){var t=-1,r=Array(n.size);return n.forEach(function(n){r[++t]=[n,n]}),r}function cr(n){return er(n)?function(n){for(var t=Qn.lastIndex=0;Qn.test(n);)++t;return t}(n):Ut(n)}function lr(n){return er(n)?function(n){return n.match(Qn)||[]}(n):function(n){return n.split("")}(n)}function sr(n){for(var t=n.length;t--&&en.test(n.charAt(t)););return t}var hr=qt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),pr=function n(t){var r,en=(t=null==t?st:pr.defaults(st.Object(),t,pr.pick(st,rt))).Array,mn=t.Date,xn=t.Error,jn=t.Function,An=t.Math,kn=t.Object,On=t.RegExp,En=t.String,In=t.TypeError,Rn=en.prototype,zn=jn.prototype,Sn=kn.prototype,Cn=t["__core-js_shared__"],Ln=zn.toString,Wn=Sn.hasOwnProperty,Tn=0,Un=(r=/[^.]+$/.exec(Cn&&Cn.keys&&Cn.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Bn=Sn.toString,Dn=Ln.call(kn),$n=st._,Mn=On("^"+Ln.call(Wn).replace(nn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Fn=vt?t.Buffer:e,Nn=t.Symbol,Pn=t.Uint8Array,qn=Fn?Fn.allocUnsafe:e,Zn=ir(kn.getPrototypeOf,kn),Kn=kn.create,Vn=Sn.propertyIsEnumerable,Gn=Rn.splice,Hn=Nn?Nn.isConcatSpreadable:e,Qn=Nn?Nn.iterator:e,nt=Nn?Nn.toStringTag:e,ot=function(){try{var n=ai(kn,"defineProperty");return n({},"",{}),n}catch(n){}}(),ct=t.clearTimeout!==st.clearTimeout&&t.clearTimeout,lt=mn&&mn.now!==st.Date.now&&mn.now,ht=t.setTimeout!==st.setTimeout&&t.setTimeout,pt=An.ceil,_t=An.floor,gt=kn.getOwnPropertySymbols,Ut=Fn?Fn.isBuffer:e,qt=t.isFinite,vr=Rn.join,_r=ir(kn.keys,kn),gr=An.max,yr=An.min,dr=mn.now,wr=t.parseInt,br=An.random,mr=Rn.reverse,xr=ai(t,"DataView"),jr=ai(t,"Map"),Ar=ai(t,"Promise"),kr=ai(t,"Set"),Or=ai(t,"WeakMap"),Er=ai(kn,"create"),Ir=Or&&new Or,Rr={},zr=Ui(xr),Sr=Ui(jr),Cr=Ui(Ar),Lr=Ui(kr),Wr=Ui(Or),Tr=Nn?Nn.prototype:e,Ur=Tr?Tr.valueOf:e,Br=Tr?Tr.toString:e;function Dr(n){if(nf(n)&&!Po(n)&&!(n instanceof Nr)){if(n instanceof Fr)return n;if(Wn.call(n,"__wrapped__"))return Bi(n)}return new Fr(n)}var $r=function(){function n(){}return function(t){if(!Xo(t))return{};if(Kn)return Kn(t);n.prototype=t;var r=new n;return n.prototype=e,r}}();function Mr(){}function Fr(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=e}function Nr(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Pr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function qr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Zr(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t<r;){var e=n[t];this.set(e[0],e[1])}}function Kr(n){var t=-1,r=null==n?0:n.length;for(this.__data__=new Zr;++t<r;)this.add(n[t])}function Vr(n){var t=this.__data__=new qr(n);this.size=t.size}function Gr(n,t){var r=Po(n),e=!r&&No(n),u=!r&&!e&&Vo(n),i=!r&&!e&&!u&&cf(n),o=r||e||u||i,f=o?Vt(n.length,En):[],a=f.length;for(var c in n)!t&&!Wn.call(n,c)||o&&("length"==c||u&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||_i(c,a))||f.push(c);return f}function Hr(n){var t=n.length;return t?n[Ze(0,t-1)]:e}function Jr(n,t){return Si(Ou(n),ie(t,0,n.length))}function Yr(n){return Si(Ou(n))}function Qr(n,t,r){(r!==e&&!$o(n[t],r)||r===e&&!(t in n))&&ee(n,t,r)}function Xr(n,t,r){var u=n[t];Wn.call(n,t)&&$o(u,r)&&(r!==e||t in n)||ee(n,t,r)}function ne(n,t){for(var r=n.length;r--;)if($o(n[r][0],t))return r;return-1}function te(n,t,r,e){return le(n,function(n,u,i){t(e,n,r(n),i)}),e}function re(n,t){return n&&Eu(t,Sf(t),n)}function ee(n,t,r){"__proto__"==t&&ot?ot(n,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):n[t]=r}function ue(n,t){for(var r=-1,u=t.length,i=en(u),o=null==n;++r<u;)i[r]=o?e:Of(n,t[r]);return i}function ie(n,t,r){return n==n&&(r!==e&&(n=n<=r?n:r),t!==e&&(n=n>=t?n:t)),n}function oe(n,t,r,u,i,o){var f,a=1&t,c=2&t,l=4&t;if(r&&(f=i?r(n,u,i,o):r(n)),f!==e)return f;if(!Xo(n))return n;var s=Po(n);if(s){if(f=function(n){var t=n.length,r=new n.constructor(t);return t&&"string"==typeof n[0]&&Wn.call(n,"index")&&(r.index=n.index,r.input=n.input),r}(n),!a)return Ou(n,f)}else{var h=si(n),p=h==w||h==b;if(Vo(n))return bu(n,a);if(h==j||h==v||p&&!i){if(f=c||p?{}:pi(n),!a)return c?function(n,t){return Eu(n,li(n),t)}(n,function(n,t){return n&&Eu(t,Cf(t),n)}(f,n)):function(n,t){return Eu(n,ci(n),t)}(n,re(f,n))}else{if(!it[h])return i?n:{};f=function(n,t,r){var e,u=n.constructor;switch(t){case z:return mu(n);case g:case y:return new u(+n);case S:return function(n,t){var r=t?mu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.byteLength)}(n,r);case C:case L:case W:case T:case U:case B:case D:case $:case M:return xu(n,r);case m:return new u;case x:case E:return new u(n);case k:return function(n){var t=new n.constructor(n.source,hn.exec(n));return t.lastIndex=n.lastIndex,t}(n);case O:return new u;case I:return e=n,Ur?kn(Ur.call(e)):{}}}(n,h,a)}}o||(o=new Vr);var _=o.get(n);if(_)return _;o.set(n,f),of(n)?n.forEach(function(e){f.add(oe(e,t,r,e,n,o))}):tf(n)&&n.forEach(function(e,u){f.set(u,oe(e,t,r,u,n,o))});var d=s?e:(l?c?ti:ni:c?Cf:Sf)(n);return kt(d||n,function(e,u){d&&(e=n[u=e]),Xr(f,u,oe(e,t,r,u,n,o))}),f}function fe(n,t,r){var u=r.length;if(null==n)return!u;for(n=kn(n);u--;){var i=r[u],o=t[i],f=n[i];if(f===e&&!(i in n)||!o(f))return!1}return!0}function ae(n,t,r){if("function"!=typeof n)throw new In(u);return Ei(function(){n.apply(e,r)},t)}function ce(n,t,r,e){var u=-1,i=Rt,o=!0,f=n.length,a=[],c=t.length;if(!f)return a;r&&(t=St(t,Ht(r))),e?(i=zt,o=!1):t.length>=200&&(i=Yt,o=!1,t=new Kr(t));n:for(;++u<f;){var l=n[u],s=null==r?l:r(l);if(l=e||0!==l?l:0,o&&s==s){for(var h=c;h--;)if(t[h]===s)continue n;a.push(l)}else i(t,s,e)||a.push(l)}return a}Dr.templateSettings={escape:G,evaluate:H,interpolate:J,variable:"",imports:{_:Dr}},Dr.prototype=Mr.prototype,Dr.prototype.constructor=Dr,Fr.prototype=$r(Mr.prototype),Fr.prototype.constructor=Fr,Nr.prototype=$r(Mr.prototype),Nr.prototype.constructor=Nr,Pr.prototype.clear=function(){this.__data__=Er?Er(null):{},this.size=0},Pr.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},Pr.prototype.get=function(n){var t=this.__data__;if(Er){var r=t[n];return r===i?e:r}return Wn.call(t,n)?t[n]:e},Pr.prototype.has=function(n){var t=this.__data__;return Er?t[n]!==e:Wn.call(t,n)},Pr.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Er&&t===e?i:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(n){var t=this.__data__,r=ne(t,n);return!(r<0||(r==t.length-1?t.pop():Gn.call(t,r,1),--this.size,0))},qr.prototype.get=function(n){var t=this.__data__,r=ne(t,n);return r<0?e:t[r][1]},qr.prototype.has=function(n){return ne(this.__data__,n)>-1},qr.prototype.set=function(n,t){var r=this.__data__,e=ne(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},Zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Pr,map:new(jr||qr),string:new Pr}},Zr.prototype.delete=function(n){var t=oi(this,n).delete(n);return this.size-=t?1:0,t},Zr.prototype.get=function(n){return oi(this,n).get(n)},Zr.prototype.has=function(n){return oi(this,n).has(n)},Zr.prototype.set=function(n,t){var r=oi(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Kr.prototype.add=Kr.prototype.push=function(n){return this.__data__.set(n,i),this},Kr.prototype.has=function(n){return this.__data__.has(n)},Vr.prototype.clear=function(){this.__data__=new qr,this.size=0},Vr.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},Vr.prototype.get=function(n){return this.__data__.get(n)},Vr.prototype.has=function(n){return this.__data__.has(n)},Vr.prototype.set=function(n,t){var r=this.__data__;if(r instanceof qr){var e=r.__data__;if(!jr||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Zr(e)}return r.set(n,t),this.size=r.size,this};var le=zu(de),se=zu(we,!0);function he(n,t){var r=!0;return le(n,function(n,e,u){return r=!!t(n,e,u)}),r}function pe(n,t,r){for(var u=-1,i=n.length;++u<i;){var o=n[u],f=t(o);if(null!=f&&(a===e?f==f&&!af(f):r(f,a)))var a=f,c=o}return c}function ve(n,t){var r=[];return le(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function _e(n,t,r,e,u){var i=-1,o=n.length;for(r||(r=vi),u||(u=[]);++i<o;){var f=n[i];t>0&&r(f)?t>1?_e(f,t-1,r,e,u):Ct(u,f):e||(u[u.length]=f)}return u}var ge=Su(),ye=Su(!0);function de(n,t){return n&&ge(n,t,Sf)}function we(n,t){return n&&ye(n,t,Sf)}function be(n,t){return It(t,function(t){return Jo(n[t])})}function me(n,t){for(var r=0,u=(t=gu(t,n)).length;null!=n&&r<u;)n=n[Ti(t[r++])];return r&&r==u?n:e}function xe(n,t,r){var e=t(n);return Po(n)?e:Ct(e,r(n))}function je(n){return null==n?n===e?"[object Undefined]":"[object Null]":nt&&nt in kn(n)?function(n){var t=Wn.call(n,nt),r=n[nt];try{n[nt]=e;var u=!0}catch(n){}var i=Bn.call(n);return u&&(t?n[nt]=r:delete n[nt]),i}(n):function(n){return Bn.call(n)}(n)}function Ae(n,t){return n>t}function ke(n,t){return null!=n&&Wn.call(n,t)}function Oe(n,t){return null!=n&&t in kn(n)}function Ee(n,t,r){for(var u=r?zt:Rt,i=n[0].length,o=n.length,f=o,a=en(o),c=1/0,l=[];f--;){var s=n[f];f&&t&&(s=St(s,Ht(t))),c=yr(s.length,c),a[f]=!r&&(t||i>=120&&s.length>=120)?new Kr(f&&s):e}s=n[0];var h=-1,p=a[0];n:for(;++h<i&&l.length<c;){var v=s[h],_=t?t(v):v;if(v=r||0!==v?v:0,!(p?Yt(p,_):u(l,_,r))){for(f=o;--f;){var g=a[f];if(!(g?Yt(g,_):u(n[f],_,r)))continue n}p&&p.push(_),l.push(v)}}return l}function Ie(n,t,r){var u=null==(n=Ai(n,t=gu(t,n)))?n:n[Ti(Gi(t))];return null==u?e:jt(u,n,r)}function Re(n){return nf(n)&&je(n)==v}function ze(n,t,r,u,i){return n===t||(null==n||null==t||!nf(n)&&!nf(t)?n!=n&&t!=t:function(n,t,r,u,i,o){var f=Po(n),a=Po(t),c=f?_:si(n),l=a?_:si(t),s=(c=c==v?j:c)==j,h=(l=l==v?j:l)==j,p=c==l;if(p&&Vo(n)){if(!Vo(t))return!1;f=!0,s=!1}if(p&&!s)return o||(o=new Vr),f||cf(n)?Qu(n,t,r,u,i,o):function(n,t,r,e,u,i,o){switch(r){case S:if(n.byteLength!=t.byteLength||n.byteOffset!=t.byteOffset)return!1;n=n.buffer,t=t.buffer;case z:return!(n.byteLength!=t.byteLength||!i(new Pn(n),new Pn(t)));case g:case y:case x:return $o(+n,+t);case d:return n.name==t.name&&n.message==t.message;case k:case E:return n==t+"";case m:var f=ur;case O:var a=1&e;if(f||(f=fr),n.size!=t.size&&!a)return!1;var c=o.get(n);if(c)return c==t;e|=2,o.set(n,t);var l=Qu(f(n),f(t),e,u,i,o);return o.delete(n),l;case I:if(Ur)return Ur.call(n)==Ur.call(t)}return!1}(n,t,c,r,u,i,o);if(!(1&r)){var w=s&&Wn.call(n,"__wrapped__"),b=h&&Wn.call(t,"__wrapped__");if(w||b){var A=w?n.value():n,R=b?t.value():t;return o||(o=new Vr),i(A,R,r,u,o)}}return!!p&&(o||(o=new Vr),function(n,t,r,u,i,o){var f=1&r,a=ni(n),c=a.length;if(c!=ni(t).length&&!f)return!1;for(var l=c;l--;){var s=a[l];if(!(f?s in t:Wn.call(t,s)))return!1}var h=o.get(n),p=o.get(t);if(h&&p)return h==t&&p==n;var v=!0;o.set(n,t),o.set(t,n);for(var _=f;++l<c;){var g=n[s=a[l]],y=t[s];if(u)var d=f?u(y,g,s,t,n,o):u(g,y,s,n,t,o);if(!(d===e?g===y||i(g,y,r,u,o):d)){v=!1;break}_||(_="constructor"==s)}if(v&&!_){var w=n.constructor,b=t.constructor;w==b||!("constructor"in n)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b||(v=!1)}return o.delete(n),o.delete(t),v}(n,t,r,u,i,o))}(n,t,r,u,ze,i))}function Se(n,t,r,u){var i=r.length,o=i,f=!u;if(null==n)return!o;for(n=kn(n);i--;){var a=r[i];if(f&&a[2]?a[1]!==n[a[0]]:!(a[0]in n))return!1}for(;++i<o;){var c=(a=r[i])[0],l=n[c],s=a[1];if(f&&a[2]){if(l===e&&!(c in n))return!1}else{var h=new Vr;if(u)var p=u(l,s,c,n,t,h);if(!(p===e?ze(s,l,3,u,h):p))return!1}}return!0}function Ce(n){return!(!Xo(n)||(t=n,Un&&Un in t))&&(Jo(n)?Mn:_n).test(Ui(n));var t}function Le(n){return"function"==typeof n?n:null==n?ea:"object"==typeof n?Po(n)?De(n[0],n[1]):Be(n):ha(n)}function We(n){if(!bi(n))return _r(n);var t=[];for(var r in kn(n))Wn.call(n,r)&&"constructor"!=r&&t.push(r);return t}function Te(n,t){return n<t}function Ue(n,t){var r=-1,e=Zo(n)?en(n.length):[];return le(n,function(n,u,i){e[++r]=t(n,u,i)}),e}function Be(n){var t=fi(n);return 1==t.length&&t[0][2]?xi(t[0][0],t[0][1]):function(r){return r===n||Se(r,n,t)}}function De(n,t){return yi(n)&&mi(t)?xi(Ti(n),t):function(r){var u=Of(r,n);return u===e&&u===t?Ef(r,n):ze(t,u,3)}}function $e(n,t,r,u,i){n!==t&&ge(t,function(o,f){if(i||(i=new Vr),Xo(o))!function(n,t,r,u,i,o,f){var a=ki(n,r),c=ki(t,r),l=f.get(c);if(l)Qr(n,r,l);else{var s=o?o(a,c,r+"",n,t,f):e,h=s===e;if(h){var p=Po(c),v=!p&&Vo(c),_=!p&&!v&&cf(c);s=c,p||v||_?Po(a)?s=a:Ko(a)?s=Ou(a):v?(h=!1,s=bu(c,!0)):_?(h=!1,s=xu(c,!0)):s=[]:ef(c)||No(c)?(s=a,No(a)?s=yf(a):Xo(a)&&!Jo(a)||(s=pi(c))):h=!1}h&&(f.set(c,s),i(s,c,u,o,f),f.delete(c)),Qr(n,r,s)}}(n,t,f,r,$e,u,i);else{var a=u?u(ki(n,f),o,f+"",n,t,i):e;a===e&&(a=o),Qr(n,f,a)}},Cf)}function Me(n,t){var r=n.length;if(r)return _i(t+=t<0?r:0,r)?n[t]:e}function Fe(n,t,r){t=t.length?St(t,function(n){return Po(n)?function(t){return me(t,1===n.length?n[0]:n)}:n}):[ea];var e=-1;t=St(t,Ht(ii()));var u=Ue(n,function(n,r,u){var i=St(t,function(t){return t(n)});return{criteria:i,index:++e,value:n}});return function(n){var t=n.length;for(n.sort(function(n,t){return function(n,t,r){for(var e=-1,u=n.criteria,i=t.criteria,o=u.length,f=r.length;++e<o;){var a=ju(u[e],i[e]);if(a)return e>=f?a:a*("desc"==r[e]?-1:1)}return n.index-t.index}(n,t,r)});t--;)n[t]=n[t].value;return n}(u)}function Ne(n,t,r){for(var e=-1,u=t.length,i={};++e<u;){var o=t[e],f=me(n,o);r(f,o)&&Je(i,gu(o,n),f)}return i}function Pe(n,t,r,e){var u=e?Mt:$t,i=-1,o=t.length,f=n;for(n===t&&(t=Ou(t)),r&&(f=St(n,Ht(r)));++i<o;)for(var a=0,c=t[i],l=r?r(c):c;(a=u(f,l,a,e))>-1;)f!==n&&Gn.call(f,a,1),Gn.call(n,a,1);return n}function qe(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;_i(u)?Gn.call(n,u,1):au(n,u)}}return n}function Ze(n,t){return n+_t(br()*(t-n+1))}function Ke(n,t){var r="";if(!n||t<1||t>l)return r;do{t%2&&(r+=n),(t=_t(t/2))&&(n+=n)}while(t);return r}function Ve(n,t){return Ii(ji(n,t,ea),n+"")}function Ge(n){return Hr(Mf(n))}function He(n,t){var r=Mf(n);return Si(r,ie(t,0,r.length))}function Je(n,t,r,u){if(!Xo(n))return n;for(var i=-1,o=(t=gu(t,n)).length,f=o-1,a=n;null!=a&&++i<o;){var c=Ti(t[i]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return n;if(i!=f){var s=a[c];(l=u?u(s,c,a):e)===e&&(l=Xo(s)?s:_i(t[i+1])?[]:{})}Xr(a,c,l),a=a[c]}return n}var Ye=Ir?function(n,t){return Ir.set(n,t),n}:ea,Qe=ot?function(n,t){return ot(n,"toString",{configurable:!0,enumerable:!1,value:na(t),writable:!0})}:ea;function Xe(n){return Si(Mf(n))}function nu(n,t,r){var e=-1,u=n.length;t<0&&(t=-t>u?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=en(u);++e<u;)i[e]=n[e+t];return i}function tu(n,t){var r;return le(n,function(n,e,u){return!(r=t(n,e,u))}),!!r}function ru(n,t,r){var e=0,u=null==n?e:n.length;if("number"==typeof t&&t==t&&u<=2147483647){for(;e<u;){var i=e+u>>>1,o=n[i];null!==o&&!af(o)&&(r?o<=t:o<t)?e=i+1:u=i}return u}return eu(n,t,ea,r)}function eu(n,t,r,u){var i=0,o=null==n?0:n.length;if(0===o)return 0;for(var f=(t=r(t))!=t,a=null===t,c=af(t),l=t===e;i<o;){var s=_t((i+o)/2),h=r(n[s]),p=h!==e,v=null===h,_=h==h,g=af(h);if(f)var y=u||_;else y=l?_&&(u||p):a?_&&p&&(u||!v):c?_&&p&&!v&&(u||!g):!v&&!g&&(u?h<=t:h<t);y?i=s+1:o=s}return yr(o,4294967294)}function uu(n,t){for(var r=-1,e=n.length,u=0,i=[];++r<e;){var o=n[r],f=t?t(o):o;if(!r||!$o(f,a)){var a=f;i[u++]=0===o?0:o}}return i}function iu(n){return"number"==typeof n?n:af(n)?s:+n}function ou(n){if("string"==typeof n)return n;if(Po(n))return St(n,ou)+"";if(af(n))return Br?Br.call(n):"";var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function fu(n,t,r){var e=-1,u=Rt,i=n.length,o=!0,f=[],a=f;if(r)o=!1,u=zt;else if(i>=200){var c=t?null:Ku(n);if(c)return fr(c);o=!1,u=Yt,a=new Kr}else a=t?[]:f;n:for(;++e<i;){var l=n[e],s=t?t(l):l;if(l=r||0!==l?l:0,o&&s==s){for(var h=a.length;h--;)if(a[h]===s)continue n;t&&a.push(s),f.push(l)}else u(a,s,r)||(a!==f&&a.push(s),f.push(l))}return f}function au(n,t){return null==(n=Ai(n,t=gu(t,n)))||delete n[Ti(Gi(t))]}function cu(n,t,r,e){return Je(n,t,r(me(n,t)),e)}function lu(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++i<u)&&t(n[i],i,n););return r?nu(n,e?0:i,e?i+1:u):nu(n,e?i+1:0,e?u:i)}function su(n,t){var r=n;return r instanceof Nr&&(r=r.value()),Lt(t,function(n,t){return t.func.apply(t.thisArg,Ct([n],t.args))},r)}function hu(n,t,r){var e=n.length;if(e<2)return e?fu(n[0]):[];for(var u=-1,i=en(e);++u<e;)for(var o=n[u],f=-1;++f<e;)f!=u&&(i[u]=ce(i[u]||o,n[f],t,r));return fu(_e(i,1),t,r)}function pu(n,t,r){for(var u=-1,i=n.length,o=t.length,f={};++u<i;){var a=u<o?t[u]:e;r(f,n[u],a)}return f}function vu(n){return Ko(n)?n:[]}function _u(n){return"function"==typeof n?n:ea}function gu(n,t){return Po(n)?n:yi(n,t)?[n]:Wi(df(n))}var yu=Ve;function du(n,t,r){var u=n.length;return r=r===e?u:r,!t&&r>=u?n:nu(n,t,r)}var wu=ct||function(n){return st.clearTimeout(n)};function bu(n,t){if(t)return n.slice();var r=n.length,e=qn?qn(r):new n.constructor(r);return n.copy(e),e}function mu(n){var t=new n.constructor(n.byteLength);return new Pn(t).set(new Pn(n)),t}function xu(n,t){var r=t?mu(n.buffer):n.buffer;return new n.constructor(r,n.byteOffset,n.length)}function ju(n,t){if(n!==t){var r=n!==e,u=null===n,i=n==n,o=af(n),f=t!==e,a=null===t,c=t==t,l=af(t);if(!a&&!l&&!o&&n>t||o&&f&&c&&!a&&!l||u&&f&&c||!r&&c||!i)return 1;if(!u&&!o&&!l&&n<t||l&&r&&i&&!u&&!o||a&&r&&i||!f&&i||!c)return-1}return 0}function Au(n,t,r,e){for(var u=-1,i=n.length,o=r.length,f=-1,a=t.length,c=gr(i-o,0),l=en(a+c),s=!e;++f<a;)l[f]=t[f];for(;++u<o;)(s||u<i)&&(l[r[u]]=n[u]);for(;c--;)l[f++]=n[u++];return l}function ku(n,t,r,e){for(var u=-1,i=n.length,o=-1,f=r.length,a=-1,c=t.length,l=gr(i-f,0),s=en(l+c),h=!e;++u<l;)s[u]=n[u];for(var p=u;++a<c;)s[p+a]=t[a];for(;++o<f;)(h||u<i)&&(s[p+r[o]]=n[u++]);return s}function Ou(n,t){var r=-1,e=n.length;for(t||(t=en(e));++r<e;)t[r]=n[r];return t}function Eu(n,t,r,u){var i=!r;r||(r={});for(var o=-1,f=t.length;++o<f;){var a=t[o],c=u?u(r[a],n[a],a,r,n):e;c===e&&(c=n[a]),i?ee(r,a,c):Xr(r,a,c)}return r}function Iu(n,t){return function(r,e){var u=Po(r)?At:te,i=t?t():{};return u(r,n,ii(e,2),i)}}function Ru(n){return Ve(function(t,r){var u=-1,i=r.length,o=i>1?r[i-1]:e,f=i>2?r[2]:e;for(o=n.length>3&&"function"==typeof o?(i--,o):e,f&&gi(r[0],r[1],f)&&(o=i<3?e:o,i=1),t=kn(t);++u<i;){var a=r[u];a&&n(t,a,u,o)}return t})}function zu(n,t){return function(r,e){if(null==r)return r;if(!Zo(r))return n(r,e);for(var u=r.length,i=t?u:-1,o=kn(r);(t?i--:++i<u)&&!1!==e(o[i],i,o););return r}}function Su(n){return function(t,r,e){for(var u=-1,i=kn(t),o=e(t),f=o.length;f--;){var a=o[n?f:++u];if(!1===r(i[a],a,i))break}return t}}function Cu(n){return function(t){var r=er(t=df(t))?lr(t):e,u=r?r[0]:t.charAt(0),i=r?du(r,1).join(""):t.slice(1);return u[n]()+i}}function Lu(n){return function(t){return Lt(Yf(Pf(t).replace(Jn,"")),n,"")}}function Wu(n){return function(){var t=arguments;switch(t.length){case 0:return new n;case 1:return new n(t[0]);case 2:return new n(t[0],t[1]);case 3:return new n(t[0],t[1],t[2]);case 4:return new n(t[0],t[1],t[2],t[3]);case 5:return new n(t[0],t[1],t[2],t[3],t[4]);case 6:return new n(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new n(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=$r(n.prototype),e=n.apply(r,t);return Xo(e)?e:r}}function Tu(n){return function(t,r,u){var i=kn(t);if(!Zo(t)){var o=ii(r,3);t=Sf(t),r=function(n){return o(i[n],n,i)}}var f=n(t,r,u);return f>-1?i[o?t[f]:f]:e}}function Uu(n){return Xu(function(t){var r=t.length,i=r,o=Fr.prototype.thru;for(n&&t.reverse();i--;){var f=t[i];if("function"!=typeof f)throw new In(u);if(o&&!a&&"wrapper"==ei(f))var a=new Fr([],!0)}for(i=a?i:r;++i<r;){var c=ei(f=t[i]),l="wrapper"==c?ri(f):e;a=l&&di(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?a[ei(l[0])].apply(a,l[3]):1==f.length&&di(f)?a[c]():a.thru(f)}return function(){var n=arguments,e=n[0];if(a&&1==n.length&&Po(e))return a.plant(e).value();for(var u=0,i=r?t[u].apply(this,n):e;++u<r;)i=t[u].call(this,i);return i}})}function Bu(n,t,r,u,i,o,f,c,l,s){var h=t&a,p=1&t,v=2&t,_=24&t,g=512&t,y=v?e:Wu(n);return function a(){for(var d=arguments.length,w=en(d),b=d;b--;)w[b]=arguments[b];if(_)var m=ui(a),x=function(n,t){for(var r=n.length,e=0;r--;)n[r]===t&&++e;return e}(w,m);if(u&&(w=Au(w,u,i,_)),o&&(w=ku(w,o,f,_)),d-=x,_&&d<s){var j=or(w,m);return qu(n,t,Bu,a.placeholder,r,w,j,c,l,s-d)}var A=p?r:this,k=v?A[n]:n;return d=w.length,c?w=function(n,t){for(var r=n.length,u=yr(t.length,r),i=Ou(n);u--;){var o=t[u];n[u]=_i(o,r)?i[o]:e}return n}(w,c):g&&d>1&&w.reverse(),h&&l<d&&(w.length=l),this&&this!==st&&this instanceof a&&(k=y||Wu(k)),k.apply(A,w)}}function Du(n,t){return function(r,e){return function(n,t,r,e){return de(n,function(n,u,i){t(e,r(n),u,i)}),e}(r,n,t(e),{})}}function $u(n,t){return function(r,u){var i;if(r===e&&u===e)return t;if(r!==e&&(i=r),u!==e){if(i===e)return u;"string"==typeof r||"string"==typeof u?(r=ou(r),u=ou(u)):(r=iu(r),u=iu(u)),i=n(r,u)}return i}}function Mu(n){return Xu(function(t){return t=St(t,Ht(ii())),Ve(function(r){var e=this;return n(t,function(n){return jt(n,e,r)})})})}function Fu(n,t){var r=(t=t===e?" ":ou(t)).length;if(r<2)return r?Ke(t,n):t;var u=Ke(t,pt(n/cr(t)));return er(t)?du(lr(u),0,n).join(""):u.slice(0,n)}function Nu(n){return function(t,r,u){return u&&"number"!=typeof u&&gi(t,r,u)&&(r=u=e),t=pf(t),r===e?(r=t,t=0):r=pf(r),function(n,t,r,e){for(var u=-1,i=gr(pt((t-n)/(r||1)),0),o=en(i);i--;)o[e?i:++u]=n,n+=r;return o}(t,r,u=u===e?t<r?1:-1:pf(u),n)}}function Pu(n){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=gf(t),r=gf(r)),n(t,r)}}function qu(n,t,r,u,i,o,a,c,l,s){var h=8&t;t|=h?f:64,4&(t&=~(h?64:f))||(t&=-4);var p=[n,t,i,h?o:e,h?a:e,h?e:o,h?e:a,c,l,s],v=r.apply(e,p);return di(n)&&Oi(v,p),v.placeholder=u,Ri(v,n,t)}function Zu(n){var t=An[n];return function(n,r){if(n=gf(n),(r=null==r?0:yr(vf(r),292))&&qt(n)){var e=(df(n)+"e").split("e");return+((e=(df(t(e[0]+"e"+(+e[1]+r)))+"e").split("e"))[0]+"e"+(+e[1]-r))}return t(n)}}var Ku=kr&&1/fr(new kr([,-0]))[1]==c?function(n){return new kr(n)}:aa;function Vu(n){return function(t){var r=si(t);return r==m?ur(t):r==O?ar(t):function(n,t){return St(t,function(t){return[t,n[t]]})}(t,n(t))}}function Gu(n,t,r,i,c,l,s,h){var p=2&t;if(!p&&"function"!=typeof n)throw new In(u);var v=i?i.length:0;if(v||(t&=-97,i=c=e),s=s===e?s:gr(vf(s),0),h=h===e?h:vf(h),v-=c?c.length:0,64&t){var _=i,g=c;i=c=e}var y=p?e:ri(n),d=[n,t,r,i,c,_,g,l,s,h];if(y&&function(n,t){var r=n[1],e=t[1],u=r|e,i=u<131,f=e==a&&8==r||e==a&&256==r&&n[7].length<=t[8]||384==e&&t[7].length<=t[8]&&8==r;if(!i&&!f)return n;1&e&&(n[2]=t[2],u|=1&r?0:4);var c=t[3];if(c){var l=n[3];n[3]=l?Au(l,c,t[4]):c,n[4]=l?or(n[3],o):t[4]}(c=t[5])&&(l=n[5],n[5]=l?ku(l,c,t[6]):c,n[6]=l?or(n[5],o):t[6]),(c=t[7])&&(n[7]=c),e&a&&(n[8]=null==n[8]?t[8]:yr(n[8],t[8])),null==n[9]&&(n[9]=t[9]),n[0]=t[0],n[1]=u}(d,y),n=d[0],t=d[1],r=d[2],i=d[3],c=d[4],!(h=d[9]=d[9]===e?p?0:n.length:gr(d[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)w=8==t||16==t?function(n,t,r){var u=Wu(n);return function i(){for(var o=arguments.length,f=en(o),a=o,c=ui(i);a--;)f[a]=arguments[a];var l=o<3&&f[0]!==c&&f[o-1]!==c?[]:or(f,c);return(o-=l.length)<r?qu(n,t,Bu,i.placeholder,e,f,l,e,e,r-o):jt(this&&this!==st&&this instanceof i?u:n,this,f)}}(n,t,h):t!=f&&33!=t||c.length?Bu.apply(e,d):function(n,t,r,e){var u=1&t,i=Wu(n);return function t(){for(var o=-1,f=arguments.length,a=-1,c=e.length,l=en(c+f),s=this&&this!==st&&this instanceof t?i:n;++a<c;)l[a]=e[a];for(;f--;)l[a++]=arguments[++o];return jt(s,u?r:this,l)}}(n,t,r,i);else var w=function(n,t,r){var e=1&t,u=Wu(n);return function t(){return(this&&this!==st&&this instanceof t?u:n).apply(e?r:this,arguments)}}(n,t,r);return Ri((y?Ye:Oi)(w,d),n,t)}function Hu(n,t,r,u){return n===e||$o(n,Sn[r])&&!Wn.call(u,r)?t:n}function Ju(n,t,r,u,i,o){return Xo(n)&&Xo(t)&&(o.set(t,n),$e(n,t,e,Ju,o),o.delete(t)),n}function Yu(n){return ef(n)?e:n}function Qu(n,t,r,u,i,o){var f=1&r,a=n.length,c=t.length;if(a!=c&&!(f&&c>a))return!1;var l=o.get(n),s=o.get(t);if(l&&s)return l==t&&s==n;var h=-1,p=!0,v=2&r?new Kr:e;for(o.set(n,t),o.set(t,n);++h<a;){var _=n[h],g=t[h];if(u)var y=f?u(g,_,h,t,n,o):u(_,g,h,n,t,o);if(y!==e){if(y)continue;p=!1;break}if(v){if(!Tt(t,function(n,t){if(!Yt(v,t)&&(_===n||i(_,n,r,u,o)))return v.push(t)})){p=!1;break}}else if(_!==g&&!i(_,g,r,u,o)){p=!1;break}}return o.delete(n),o.delete(t),p}function Xu(n){return Ii(ji(n,e,Pi),n+"")}function ni(n){return xe(n,Sf,ci)}function ti(n){return xe(n,Cf,li)}var ri=Ir?function(n){return Ir.get(n)}:aa;function ei(n){for(var t=n.name+"",r=Rr[t],e=Wn.call(Rr,t)?r.length:0;e--;){var u=r[e],i=u.func;if(null==i||i==n)return u.name}return t}function ui(n){return(Wn.call(Dr,"placeholder")?Dr:n).placeholder}function ii(){var n=Dr.iteratee||ua;return n=n===ua?Le:n,arguments.length?n(arguments[0],arguments[1]):n}function oi(n,t){var r,e,u=n.__data__;return("string"==(e=typeof(r=t))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==r:null===r)?u["string"==typeof t?"string":"hash"]:u.map}function fi(n){for(var t=Sf(n),r=t.length;r--;){var e=t[r],u=n[e];t[r]=[e,u,mi(u)]}return t}function ai(n,t){var r=function(n,t){return null==n?e:n[t]}(n,t);return Ce(r)?r:e}var ci=gt?function(n){return null==n?[]:(n=kn(n),It(gt(n),function(t){return Vn.call(n,t)}))}:_a,li=gt?function(n){for(var t=[];n;)Ct(t,ci(n)),n=Zn(n);return t}:_a,si=je;function hi(n,t,r){for(var e=-1,u=(t=gu(t,n)).length,i=!1;++e<u;){var o=Ti(t[e]);if(!(i=null!=n&&r(n,o)))break;n=n[o]}return i||++e!=u?i:!!(u=null==n?0:n.length)&&Qo(u)&&_i(o,u)&&(Po(n)||No(n))}function pi(n){return"function"!=typeof n.constructor||bi(n)?{}:$r(Zn(n))}function vi(n){return Po(n)||No(n)||!!(Hn&&n&&n[Hn])}function _i(n,t){var r=typeof n;return!!(t=null==t?l:t)&&("number"==r||"symbol"!=r&&yn.test(n))&&n>-1&&n%1==0&&n<t}function gi(n,t,r){if(!Xo(r))return!1;var e=typeof t;return!!("number"==e?Zo(r)&&_i(t,r.length):"string"==e&&t in r)&&$o(r[t],n)}function yi(n,t){if(Po(n))return!1;var r=typeof n;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=n&&!af(n))||Q.test(n)||!Y.test(n)||null!=t&&n in kn(t)}function di(n){var t=ei(n),r=Dr[t];if("function"!=typeof r||!(t in Nr.prototype))return!1;if(n===r)return!0;var e=ri(r);return!!e&&n===e[0]}(xr&&si(new xr(new ArrayBuffer(1)))!=S||jr&&si(new jr)!=m||Ar&&si(Ar.resolve())!=A||kr&&si(new kr)!=O||Or&&si(new Or)!=R)&&(si=function(n){var t=je(n),r=t==j?n.constructor:e,u=r?Ui(r):"";if(u)switch(u){case zr:return S;case Sr:return m;case Cr:return A;case Lr:return O;case Wr:return R}return t});var wi=Cn?Jo:ga;function bi(n){var t=n&&n.constructor;return n===("function"==typeof t&&t.prototype||Sn)}function mi(n){return n==n&&!Xo(n)}function xi(n,t){return function(r){return null!=r&&r[n]===t&&(t!==e||n in kn(r))}}function ji(n,t,r){return t=gr(t===e?n.length-1:t,0),function(){for(var e=arguments,u=-1,i=gr(e.length-t,0),o=en(i);++u<i;)o[u]=e[t+u];u=-1;for(var f=en(t+1);++u<t;)f[u]=e[u];return f[t]=r(o),jt(n,this,f)}}function Ai(n,t){return t.length<2?n:me(n,nu(t,0,-1))}function ki(n,t){if(("constructor"!==t||"function"!=typeof n[t])&&"__proto__"!=t)return n[t]}var Oi=zi(Ye),Ei=ht||function(n,t){return st.setTimeout(n,t)},Ii=zi(Qe);function Ri(n,t,r){var e=t+"";return Ii(n,function(n,t){var r=t.length;if(!r)return n;var e=r-1;return t[e]=(r>1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(un,"{\n/* [wrapped with "+t+"] */\n")}(e,function(n,t){return kt(p,function(r){var e="_."+r[0];t&r[1]&&!Rt(n,e)&&n.push(e)}),n.sort()}(function(n){var t=n.match(on);return t?t[1].split(fn):[]}(e),r)))}function zi(n){var t=0,r=0;return function(){var u=dr(),i=16-(u-r);if(r=u,i>0){if(++t>=800)return arguments[0]}else t=0;return n.apply(e,arguments)}}function Si(n,t){var r=-1,u=n.length,i=u-1;for(t=t===e?u:t;++r<t;){var o=Ze(r,i),f=n[o];n[o]=n[r],n[r]=f}return n.length=t,n}var Ci,Li,Wi=(Ci=Lo(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(X,function(n,r,e,u){t.push(e?u.replace(ln,"$1"):r||n)}),t},function(n){return 500===Li.size&&Li.clear(),n}),Li=Ci.cache,Ci);function Ti(n){if("string"==typeof n||af(n))return n;var t=n+"";return"0"==t&&1/n==-1/0?"-0":t}function Ui(n){if(null!=n){try{return Ln.call(n)}catch(n){}try{return n+""}catch(n){}}return""}function Bi(n){if(n instanceof Nr)return n.clone();var t=new Fr(n.__wrapped__,n.__chain__);return t.__actions__=Ou(n.__actions__),t.__index__=n.__index__,t.__values__=n.__values__,t}var Di=Ve(function(n,t){return Ko(n)?ce(n,_e(t,1,Ko,!0)):[]}),$i=Ve(function(n,t){var r=Gi(t);return Ko(r)&&(r=e),Ko(n)?ce(n,_e(t,1,Ko,!0),ii(r,2)):[]}),Mi=Ve(function(n,t){var r=Gi(t);return Ko(r)&&(r=e),Ko(n)?ce(n,_e(t,1,Ko,!0),e,r):[]});function Fi(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:vf(r);return u<0&&(u=gr(e+u,0)),Dt(n,ii(t,3),u)}function Ni(n,t,r){var u=null==n?0:n.length;if(!u)return-1;var i=u-1;return r!==e&&(i=vf(r),i=r<0?gr(u+i,0):yr(i,u-1)),Dt(n,ii(t,3),i,!0)}function Pi(n){return null!=n&&n.length?_e(n,1):[]}function qi(n){return n&&n.length?n[0]:e}var Zi=Ve(function(n){var t=St(n,vu);return t.length&&t[0]===n[0]?Ee(t):[]}),Ki=Ve(function(n){var t=Gi(n),r=St(n,vu);return t===Gi(r)?t=e:r.pop(),r.length&&r[0]===n[0]?Ee(r,ii(t,2)):[]}),Vi=Ve(function(n){var t=Gi(n),r=St(n,vu);return(t="function"==typeof t?t:e)&&r.pop(),r.length&&r[0]===n[0]?Ee(r,e,t):[]});function Gi(n){var t=null==n?0:n.length;return t?n[t-1]:e}var Hi=Ve(Ji);function Ji(n,t){return n&&n.length&&t&&t.length?Pe(n,t):n}var Yi=Xu(function(n,t){var r=null==n?0:n.length,e=ue(n,t);return qe(n,St(t,function(n){return _i(n,r)?+n:n}).sort(ju)),e});function Qi(n){return null==n?n:mr.call(n)}var Xi=Ve(function(n){return fu(_e(n,1,Ko,!0))}),no=Ve(function(n){var t=Gi(n);return Ko(t)&&(t=e),fu(_e(n,1,Ko,!0),ii(t,2))}),to=Ve(function(n){var t=Gi(n);return t="function"==typeof t?t:e,fu(_e(n,1,Ko,!0),e,t)});function ro(n){if(!n||!n.length)return[];var t=0;return n=It(n,function(n){if(Ko(n))return t=gr(n.length,t),!0}),Vt(t,function(t){return St(n,Pt(t))})}function eo(n,t){if(!n||!n.length)return[];var r=ro(n);return null==t?r:St(r,function(n){return jt(t,e,n)})}var uo=Ve(function(n,t){return Ko(n)?ce(n,t):[]}),io=Ve(function(n){return hu(It(n,Ko))}),oo=Ve(function(n){var t=Gi(n);return Ko(t)&&(t=e),hu(It(n,Ko),ii(t,2))}),fo=Ve(function(n){var t=Gi(n);return t="function"==typeof t?t:e,hu(It(n,Ko),e,t)}),ao=Ve(ro),co=Ve(function(n){var t=n.length,r=t>1?n[t-1]:e;return r="function"==typeof r?(n.pop(),r):e,eo(n,r)});function lo(n){var t=Dr(n);return t.__chain__=!0,t}function so(n,t){return t(n)}var ho=Xu(function(n){var t=n.length,r=t?n[0]:0,u=this.__wrapped__,i=function(t){return ue(t,n)};return!(t>1||this.__actions__.length)&&u instanceof Nr&&_i(r)?((u=u.slice(r,+r+(t?1:0))).__actions__.push({func:so,args:[i],thisArg:e}),new Fr(u,this.__chain__).thru(function(n){return t&&!n.length&&n.push(e),n})):this.thru(i)}),po=Iu(function(n,t,r){Wn.call(n,r)?++n[r]:ee(n,r,1)}),vo=Tu(Fi),_o=Tu(Ni);function go(n,t){return(Po(n)?kt:le)(n,ii(t,3))}function yo(n,t){return(Po(n)?Ot:se)(n,ii(t,3))}var wo=Iu(function(n,t,r){Wn.call(n,r)?n[r].push(t):ee(n,r,[t])}),bo=Ve(function(n,t,r){var e=-1,u="function"==typeof t,i=Zo(n)?en(n.length):[];return le(n,function(n){i[++e]=u?jt(t,n,r):Ie(n,t,r)}),i}),mo=Iu(function(n,t,r){ee(n,r,t)});function xo(n,t){return(Po(n)?St:Ue)(n,ii(t,3))}var jo=Iu(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),Ao=Ve(function(n,t){if(null==n)return[];var r=t.length;return r>1&&gi(n,t[0],t[1])?t=[]:r>2&&gi(t[0],t[1],t[2])&&(t=[t[0]]),Fe(n,_e(t,1),[])}),ko=lt||function(){return st.Date.now()};function Oo(n,t,r){return t=r?e:t,t=n&&null==t?n.length:t,Gu(n,a,e,e,e,e,t)}function Eo(n,t){var r;if("function"!=typeof t)throw new In(u);return n=vf(n),function(){return--n>0&&(r=t.apply(this,arguments)),n<=1&&(t=e),r}}var Io=Ve(function(n,t,r){var e=1;if(r.length){var u=or(r,ui(Io));e|=f}return Gu(n,e,t,r,u)}),Ro=Ve(function(n,t,r){var e=3;if(r.length){var u=or(r,ui(Ro));e|=f}return Gu(t,e,n,r,u)});function zo(n,t,r){var i,o,f,a,c,l,s=0,h=!1,p=!1,v=!0;if("function"!=typeof n)throw new In(u);function _(t){var r=i,u=o;return i=o=e,s=t,a=n.apply(u,r)}function g(n){var r=n-l;return l===e||r>=t||r<0||p&&n-s>=f}function y(){var n=ko();if(g(n))return d(n);c=Ei(y,function(n){var r=t-(n-l);return p?yr(r,f-(n-s)):r}(n))}function d(n){return c=e,v&&i?_(n):(i=o=e,a)}function w(){var n=ko(),r=g(n);if(i=arguments,o=this,l=n,r){if(c===e)return function(n){return s=n,c=Ei(y,t),h?_(n):a}(l);if(p)return wu(c),c=Ei(y,t),_(l)}return c===e&&(c=Ei(y,t)),a}return t=gf(t)||0,Xo(r)&&(h=!!r.leading,f=(p="maxWait"in r)?gr(gf(r.maxWait)||0,t):f,v="trailing"in r?!!r.trailing:v),w.cancel=function(){c!==e&&wu(c),s=0,i=l=o=c=e},w.flush=function(){return c===e?a:d(ko())},w}var So=Ve(function(n,t){return ae(n,1,t)}),Co=Ve(function(n,t,r){return ae(n,gf(t)||0,r)});function Lo(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new In(u);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(Lo.Cache||Zr),r}function Wo(n){if("function"!=typeof n)throw new In(u);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}Lo.Cache=Zr;var To=yu(function(n,t){var r=(t=1==t.length&&Po(t[0])?St(t[0],Ht(ii())):St(_e(t,1),Ht(ii()))).length;return Ve(function(e){for(var u=-1,i=yr(e.length,r);++u<i;)e[u]=t[u].call(this,e[u]);return jt(n,this,e)})}),Uo=Ve(function(n,t){var r=or(t,ui(Uo));return Gu(n,f,e,t,r)}),Bo=Ve(function(n,t){var r=or(t,ui(Bo));return Gu(n,64,e,t,r)}),Do=Xu(function(n,t){return Gu(n,256,e,e,e,t)});function $o(n,t){return n===t||n!=n&&t!=t}var Mo=Pu(Ae),Fo=Pu(function(n,t){return n>=t}),No=Re(function(){return arguments}())?Re:function(n){return nf(n)&&Wn.call(n,"callee")&&!Vn.call(n,"callee")},Po=en.isArray,qo=yt?Ht(yt):function(n){return nf(n)&&je(n)==z};function Zo(n){return null!=n&&Qo(n.length)&&!Jo(n)}function Ko(n){return nf(n)&&Zo(n)}var Vo=Ut||ga,Go=dt?Ht(dt):function(n){return nf(n)&&je(n)==y};function Ho(n){if(!nf(n))return!1;var t=je(n);return t==d||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!ef(n)}function Jo(n){if(!Xo(n))return!1;var t=je(n);return t==w||t==b||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Yo(n){return"number"==typeof n&&n==vf(n)}function Qo(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=l}function Xo(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function nf(n){return null!=n&&"object"==typeof n}var tf=wt?Ht(wt):function(n){return nf(n)&&si(n)==m};function rf(n){return"number"==typeof n||nf(n)&&je(n)==x}function ef(n){if(!nf(n)||je(n)!=j)return!1;var t=Zn(n);if(null===t)return!0;var r=Wn.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ln.call(r)==Dn}var uf=bt?Ht(bt):function(n){return nf(n)&&je(n)==k},of=mt?Ht(mt):function(n){return nf(n)&&si(n)==O};function ff(n){return"string"==typeof n||!Po(n)&&nf(n)&&je(n)==E}function af(n){return"symbol"==typeof n||nf(n)&&je(n)==I}var cf=xt?Ht(xt):function(n){return nf(n)&&Qo(n.length)&&!!ut[je(n)]},lf=Pu(Te),sf=Pu(function(n,t){return n<=t});function hf(n){if(!n)return[];if(Zo(n))return ff(n)?lr(n):Ou(n);if(Qn&&n[Qn])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[Qn]());var t=si(n);return(t==m?ur:t==O?fr:Mf)(n)}function pf(n){return n?(n=gf(n))===c||n===-1/0?17976931348623157e292*(n<0?-1:1):n==n?n:0:0===n?n:0}function vf(n){var t=pf(n),r=t%1;return t==t?r?t-r:t:0}function _f(n){return n?ie(vf(n),0,h):0}function gf(n){if("number"==typeof n)return n;if(af(n))return s;if(Xo(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=Xo(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=Gt(n);var r=vn.test(n);return r||gn.test(n)?at(n.slice(2),r?2:8):pn.test(n)?s:+n}function yf(n){return Eu(n,Cf(n))}function df(n){return null==n?"":ou(n)}var wf=Ru(function(n,t){if(bi(t)||Zo(t))Eu(t,Sf(t),n);else for(var r in t)Wn.call(t,r)&&Xr(n,r,t[r])}),bf=Ru(function(n,t){Eu(t,Cf(t),n)}),mf=Ru(function(n,t,r,e){Eu(t,Cf(t),n,e)}),xf=Ru(function(n,t,r,e){Eu(t,Sf(t),n,e)}),jf=Xu(ue),Af=Ve(function(n,t){n=kn(n);var r=-1,u=t.length,i=u>2?t[2]:e;for(i&&gi(t[0],t[1],i)&&(u=1);++r<u;)for(var o=t[r],f=Cf(o),a=-1,c=f.length;++a<c;){var l=f[a],s=n[l];(s===e||$o(s,Sn[l])&&!Wn.call(n,l))&&(n[l]=o[l])}return n}),kf=Ve(function(n){return n.push(e,Ju),jt(Wf,e,n)});function Of(n,t,r){var u=null==n?e:me(n,t);return u===e?r:u}function Ef(n,t){return null!=n&&hi(n,t,Oe)}var If=Du(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Bn.call(t)),n[t]=r},na(ea)),Rf=Du(function(n,t,r){null!=t&&"function"!=typeof t.toString&&(t=Bn.call(t)),Wn.call(n,t)?n[t].push(r):n[t]=[r]},ii),zf=Ve(Ie);function Sf(n){return Zo(n)?Gr(n):We(n)}function Cf(n){return Zo(n)?Gr(n,!0):function(n){if(!Xo(n))return function(n){var t=[];if(null!=n)for(var r in kn(n))t.push(r);return t}(n);var t=bi(n),r=[];for(var e in n)("constructor"!=e||!t&&Wn.call(n,e))&&r.push(e);return r}(n)}var Lf=Ru(function(n,t,r){$e(n,t,r)}),Wf=Ru(function(n,t,r,e){$e(n,t,r,e)}),Tf=Xu(function(n,t){var r={};if(null==n)return r;var e=!1;t=St(t,function(t){return t=gu(t,n),e||(e=t.length>1),t}),Eu(n,ti(n),r),e&&(r=oe(r,7,Yu));for(var u=t.length;u--;)au(r,t[u]);return r}),Uf=Xu(function(n,t){return null==n?{}:function(n,t){return Ne(n,t,function(t,r){return Ef(n,r)})}(n,t)});function Bf(n,t){if(null==n)return{};var r=St(ti(n),function(n){return[n]});return t=ii(t),Ne(n,r,function(n,r){return t(n,r[0])})}var Df=Vu(Sf),$f=Vu(Cf);function Mf(n){return null==n?[]:Jt(n,Sf(n))}var Ff=Lu(function(n,t,r){return t=t.toLowerCase(),n+(r?Nf(t):t)});function Nf(n){return Jf(df(n).toLowerCase())}function Pf(n){return(n=df(n))&&n.replace(dn,nr).replace(Yn,"")}var qf=Lu(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),Zf=Lu(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),Kf=Cu("toLowerCase"),Vf=Lu(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),Gf=Lu(function(n,t,r){return n+(r?" ":"")+Jf(t)}),Hf=Lu(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),Jf=Cu("toUpperCase");function Yf(n,t,r){return n=df(n),(t=r?e:t)===e?function(n){return tt.test(n)}(n)?function(n){return n.match(Xn)||[]}(n):function(n){return n.match(an)||[]}(n):n.match(t)||[]}var Qf=Ve(function(n,t){try{return jt(n,e,t)}catch(n){return Ho(n)?n:new xn(n)}}),Xf=Xu(function(n,t){return kt(t,function(t){t=Ti(t),ee(n,t,Io(n[t],n))}),n});function na(n){return function(){return n}}var ta=Uu(),ra=Uu(!0);function ea(n){return n}function ua(n){return Le("function"==typeof n?n:oe(n,1))}var ia=Ve(function(n,t){return function(r){return Ie(r,n,t)}}),oa=Ve(function(n,t){return function(r){return Ie(n,r,t)}});function fa(n,t,r){var e=Sf(t),u=be(t,e);null!=r||Xo(t)&&(u.length||!e.length)||(r=t,t=n,n=this,u=be(t,Sf(t)));var i=!(Xo(r)&&"chain"in r&&!r.chain),o=Jo(n);return kt(u,function(r){var e=t[r];n[r]=e,o&&(n.prototype[r]=function(){var t=this.__chain__;if(i||t){var r=n(this.__wrapped__);return(r.__actions__=Ou(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,Ct([this.value()],arguments))})}),n}function aa(){}var ca=Mu(St),la=Mu(Et),sa=Mu(Tt);function ha(n){return yi(n)?Pt(Ti(n)):function(n){return function(t){return me(t,n)}}(n)}var pa=Nu(),va=Nu(!0);function _a(){return[]}function ga(){return!1}var ya,da=$u(function(n,t){return n+t},0),wa=Zu("ceil"),ba=$u(function(n,t){return n/t},1),ma=Zu("floor"),xa=$u(function(n,t){return n*t},1),ja=Zu("round"),Aa=$u(function(n,t){return n-t},0);return Dr.after=function(n,t){if("function"!=typeof t)throw new In(u);return n=vf(n),function(){if(--n<1)return t.apply(this,arguments)}},Dr.ary=Oo,Dr.assign=wf,Dr.assignIn=bf,Dr.assignInWith=mf,Dr.assignWith=xf,Dr.at=jf,Dr.before=Eo,Dr.bind=Io,Dr.bindAll=Xf,Dr.bindKey=Ro,Dr.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return Po(n)?n:[n]},Dr.chain=lo,Dr.chunk=function(n,t,r){t=(r?gi(n,t,r):t===e)?1:gr(vf(t),0);var u=null==n?0:n.length;if(!u||t<1)return[];for(var i=0,o=0,f=en(pt(u/t));i<u;)f[o++]=nu(n,i,i+=t);return f},Dr.compact=function(n){for(var t=-1,r=null==n?0:n.length,e=0,u=[];++t<r;){var i=n[t];i&&(u[e++]=i)}return u},Dr.concat=function(){var n=arguments.length;if(!n)return[];for(var t=en(n-1),r=arguments[0],e=n;e--;)t[e-1]=arguments[e];return Ct(Po(r)?Ou(r):[r],_e(t,1))},Dr.cond=function(n){var t=null==n?0:n.length,r=ii();return n=t?St(n,function(n){if("function"!=typeof n[1])throw new In(u);return[r(n[0]),n[1]]}):[],Ve(function(r){for(var e=-1;++e<t;){var u=n[e];if(jt(u[0],this,r))return jt(u[1],this,r)}})},Dr.conforms=function(n){return function(n){var t=Sf(n);return function(r){return fe(r,n,t)}}(oe(n,1))},Dr.constant=na,Dr.countBy=po,Dr.create=function(n,t){var r=$r(n);return null==t?r:re(r,t)},Dr.curry=function n(t,r,u){var i=Gu(t,8,e,e,e,e,e,r=u?e:r);return i.placeholder=n.placeholder,i},Dr.curryRight=function n(t,r,u){var i=Gu(t,16,e,e,e,e,e,r=u?e:r);return i.placeholder=n.placeholder,i},Dr.debounce=zo,Dr.defaults=Af,Dr.defaultsDeep=kf,Dr.defer=So,Dr.delay=Co,Dr.difference=Di,Dr.differenceBy=$i,Dr.differenceWith=Mi,Dr.drop=function(n,t,r){var u=null==n?0:n.length;return u?nu(n,(t=r||t===e?1:vf(t))<0?0:t,u):[]},Dr.dropRight=function(n,t,r){var u=null==n?0:n.length;return u?nu(n,0,(t=u-(t=r||t===e?1:vf(t)))<0?0:t):[]},Dr.dropRightWhile=function(n,t){return n&&n.length?lu(n,ii(t,3),!0,!0):[]},Dr.dropWhile=function(n,t){return n&&n.length?lu(n,ii(t,3),!0):[]},Dr.fill=function(n,t,r,u){var i=null==n?0:n.length;return i?(r&&"number"!=typeof r&&gi(n,t,r)&&(r=0,u=i),function(n,t,r,u){var i=n.length;for((r=vf(r))<0&&(r=-r>i?0:i+r),(u=u===e||u>i?i:vf(u))<0&&(u+=i),u=r>u?0:_f(u);r<u;)n[r++]=t;return n}(n,t,r,u)):[]},Dr.filter=function(n,t){return(Po(n)?It:ve)(n,ii(t,3))},Dr.flatMap=function(n,t){return _e(xo(n,t),1)},Dr.flatMapDeep=function(n,t){return _e(xo(n,t),c)},Dr.flatMapDepth=function(n,t,r){return r=r===e?1:vf(r),_e(xo(n,t),r)},Dr.flatten=Pi,Dr.flattenDeep=function(n){return null!=n&&n.length?_e(n,c):[]},Dr.flattenDepth=function(n,t){return null!=n&&n.length?_e(n,t=t===e?1:vf(t)):[]},Dr.flip=function(n){return Gu(n,512)},Dr.flow=ta,Dr.flowRight=ra,Dr.fromPairs=function(n){for(var t=-1,r=null==n?0:n.length,e={};++t<r;){var u=n[t];e[u[0]]=u[1]}return e},Dr.functions=function(n){return null==n?[]:be(n,Sf(n))},Dr.functionsIn=function(n){return null==n?[]:be(n,Cf(n))},Dr.groupBy=wo,Dr.initial=function(n){return null!=n&&n.length?nu(n,0,-1):[]},Dr.intersection=Zi,Dr.intersectionBy=Ki,Dr.intersectionWith=Vi,Dr.invert=If,Dr.invertBy=Rf,Dr.invokeMap=bo,Dr.iteratee=ua,Dr.keyBy=mo,Dr.keys=Sf,Dr.keysIn=Cf,Dr.map=xo,Dr.mapKeys=function(n,t){var r={};return t=ii(t,3),de(n,function(n,e,u){ee(r,t(n,e,u),n)}),r},Dr.mapValues=function(n,t){var r={};return t=ii(t,3),de(n,function(n,e,u){ee(r,e,t(n,e,u))}),r},Dr.matches=function(n){return Be(oe(n,1))},Dr.matchesProperty=function(n,t){return De(n,oe(t,1))},Dr.memoize=Lo,Dr.merge=Lf,Dr.mergeWith=Wf,Dr.method=ia,Dr.methodOf=oa,Dr.mixin=fa,Dr.negate=Wo,Dr.nthArg=function(n){return n=vf(n),Ve(function(t){return Me(t,n)})},Dr.omit=Tf,Dr.omitBy=function(n,t){return Bf(n,Wo(ii(t)))},Dr.once=function(n){return Eo(2,n)},Dr.orderBy=function(n,t,r,u){return null==n?[]:(Po(t)||(t=null==t?[]:[t]),Po(r=u?e:r)||(r=null==r?[]:[r]),Fe(n,t,r))},Dr.over=ca,Dr.overArgs=To,Dr.overEvery=la,Dr.overSome=sa,Dr.partial=Uo,Dr.partialRight=Bo,Dr.partition=jo,Dr.pick=Uf,Dr.pickBy=Bf,Dr.property=ha,Dr.propertyOf=function(n){return function(t){return null==n?e:me(n,t)}},Dr.pull=Hi,Dr.pullAll=Ji,Dr.pullAllBy=function(n,t,r){return n&&n.length&&t&&t.length?Pe(n,t,ii(r,2)):n},Dr.pullAllWith=function(n,t,r){return n&&n.length&&t&&t.length?Pe(n,t,e,r):n},Dr.pullAt=Yi,Dr.range=pa,Dr.rangeRight=va,Dr.rearg=Do,Dr.reject=function(n,t){return(Po(n)?It:ve)(n,Wo(ii(t,3)))},Dr.remove=function(n,t){var r=[];if(!n||!n.length)return r;var e=-1,u=[],i=n.length;for(t=ii(t,3);++e<i;){var o=n[e];t(o,e,n)&&(r.push(o),u.push(e))}return qe(n,u),r},Dr.rest=function(n,t){if("function"!=typeof n)throw new In(u);return Ve(n,t=t===e?t:vf(t))},Dr.reverse=Qi,Dr.sampleSize=function(n,t,r){return t=(r?gi(n,t,r):t===e)?1:vf(t),(Po(n)?Jr:He)(n,t)},Dr.set=function(n,t,r){return null==n?n:Je(n,t,r)},Dr.setWith=function(n,t,r,u){return u="function"==typeof u?u:e,null==n?n:Je(n,t,r,u)},Dr.shuffle=function(n){return(Po(n)?Yr:Xe)(n)},Dr.slice=function(n,t,r){var u=null==n?0:n.length;return u?(r&&"number"!=typeof r&&gi(n,t,r)?(t=0,r=u):(t=null==t?0:vf(t),r=r===e?u:vf(r)),nu(n,t,r)):[]},Dr.sortBy=Ao,Dr.sortedUniq=function(n){return n&&n.length?uu(n):[]},Dr.sortedUniqBy=function(n,t){return n&&n.length?uu(n,ii(t,2)):[]},Dr.split=function(n,t,r){return r&&"number"!=typeof r&&gi(n,t,r)&&(t=r=e),(r=r===e?h:r>>>0)?(n=df(n))&&("string"==typeof t||null!=t&&!uf(t))&&!(t=ou(t))&&er(n)?du(lr(n),0,r):n.split(t,r):[]},Dr.spread=function(n,t){if("function"!=typeof n)throw new In(u);return t=null==t?0:gr(vf(t),0),Ve(function(r){var e=r[t],u=du(r,0,t);return e&&Ct(u,e),jt(n,this,u)})},Dr.tail=function(n){var t=null==n?0:n.length;return t?nu(n,1,t):[]},Dr.take=function(n,t,r){return n&&n.length?nu(n,0,(t=r||t===e?1:vf(t))<0?0:t):[]},Dr.takeRight=function(n,t,r){var u=null==n?0:n.length;return u?nu(n,(t=u-(t=r||t===e?1:vf(t)))<0?0:t,u):[]},Dr.takeRightWhile=function(n,t){return n&&n.length?lu(n,ii(t,3),!1,!0):[]},Dr.takeWhile=function(n,t){return n&&n.length?lu(n,ii(t,3)):[]},Dr.tap=function(n,t){return t(n),n},Dr.throttle=function(n,t,r){var e=!0,i=!0;if("function"!=typeof n)throw new In(u);return Xo(r)&&(e="leading"in r?!!r.leading:e,i="trailing"in r?!!r.trailing:i),zo(n,t,{leading:e,maxWait:t,trailing:i})},Dr.thru=so,Dr.toArray=hf,Dr.toPairs=Df,Dr.toPairsIn=$f,Dr.toPath=function(n){return Po(n)?St(n,Ti):af(n)?[n]:Ou(Wi(df(n)))},Dr.toPlainObject=yf,Dr.transform=function(n,t,r){var e=Po(n),u=e||Vo(n)||cf(n);if(t=ii(t,4),null==r){var i=n&&n.constructor;r=u?e?new i:[]:Xo(n)&&Jo(i)?$r(Zn(n)):{}}return(u?kt:de)(n,function(n,e,u){return t(r,n,e,u)}),r},Dr.unary=function(n){return Oo(n,1)},Dr.union=Xi,Dr.unionBy=no,Dr.unionWith=to,Dr.uniq=function(n){return n&&n.length?fu(n):[]},Dr.uniqBy=function(n,t){return n&&n.length?fu(n,ii(t,2)):[]},Dr.uniqWith=function(n,t){return t="function"==typeof t?t:e,n&&n.length?fu(n,e,t):[]},Dr.unset=function(n,t){return null==n||au(n,t)},Dr.unzip=ro,Dr.unzipWith=eo,Dr.update=function(n,t,r){return null==n?n:cu(n,t,_u(r))},Dr.updateWith=function(n,t,r,u){return u="function"==typeof u?u:e,null==n?n:cu(n,t,_u(r),u)},Dr.values=Mf,Dr.valuesIn=function(n){return null==n?[]:Jt(n,Cf(n))},Dr.without=uo,Dr.words=Yf,Dr.wrap=function(n,t){return Uo(_u(t),n)},Dr.xor=io,Dr.xorBy=oo,Dr.xorWith=fo,Dr.zip=ao,Dr.zipObject=function(n,t){return pu(n||[],t||[],Xr)},Dr.zipObjectDeep=function(n,t){return pu(n||[],t||[],Je)},Dr.zipWith=co,Dr.entries=Df,Dr.entriesIn=$f,Dr.extend=bf,Dr.extendWith=mf,fa(Dr,Dr),Dr.add=da,Dr.attempt=Qf,Dr.camelCase=Ff,Dr.capitalize=Nf,Dr.ceil=wa,Dr.clamp=function(n,t,r){return r===e&&(r=t,t=e),r!==e&&(r=(r=gf(r))==r?r:0),t!==e&&(t=(t=gf(t))==t?t:0),ie(gf(n),t,r)},Dr.clone=function(n){return oe(n,4)},Dr.cloneDeep=function(n){return oe(n,5)},Dr.cloneDeepWith=function(n,t){return oe(n,5,t="function"==typeof t?t:e)},Dr.cloneWith=function(n,t){return oe(n,4,t="function"==typeof t?t:e)},Dr.conformsTo=function(n,t){return null==t||fe(n,t,Sf(t))},Dr.deburr=Pf,Dr.defaultTo=function(n,t){return null==n||n!=n?t:n},Dr.divide=ba,Dr.endsWith=function(n,t,r){n=df(n),t=ou(t);var u=n.length,i=r=r===e?u:ie(vf(r),0,u);return(r-=t.length)>=0&&n.slice(r,i)==t},Dr.eq=$o,Dr.escape=function(n){return(n=df(n))&&V.test(n)?n.replace(Z,tr):n},Dr.escapeRegExp=function(n){return(n=df(n))&&tn.test(n)?n.replace(nn,"\\$&"):n},Dr.every=function(n,t,r){var u=Po(n)?Et:he;return r&&gi(n,t,r)&&(t=e),u(n,ii(t,3))},Dr.find=vo,Dr.findIndex=Fi,Dr.findKey=function(n,t){return Bt(n,ii(t,3),de)},Dr.findLast=_o,Dr.findLastIndex=Ni,Dr.findLastKey=function(n,t){return Bt(n,ii(t,3),we)},Dr.floor=ma,Dr.forEach=go,Dr.forEachRight=yo,Dr.forIn=function(n,t){return null==n?n:ge(n,ii(t,3),Cf)},Dr.forInRight=function(n,t){return null==n?n:ye(n,ii(t,3),Cf)},Dr.forOwn=function(n,t){return n&&de(n,ii(t,3))},Dr.forOwnRight=function(n,t){return n&&we(n,ii(t,3))},Dr.get=Of,Dr.gt=Mo,Dr.gte=Fo,Dr.has=function(n,t){return null!=n&&hi(n,t,ke)},Dr.hasIn=Ef,Dr.head=qi,Dr.identity=ea,Dr.includes=function(n,t,r,e){n=Zo(n)?n:Mf(n),r=r&&!e?vf(r):0;var u=n.length;return r<0&&(r=gr(u+r,0)),ff(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&$t(n,t,r)>-1},Dr.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return-1;var u=null==r?0:vf(r);return u<0&&(u=gr(e+u,0)),$t(n,t,u)},Dr.inRange=function(n,t,r){return t=pf(t),r===e?(r=t,t=0):r=pf(r),function(n,t,r){return n>=yr(t,r)&&n<gr(t,r)}(n=gf(n),t,r)},Dr.invoke=zf,Dr.isArguments=No,Dr.isArray=Po,Dr.isArrayBuffer=qo,Dr.isArrayLike=Zo,Dr.isArrayLikeObject=Ko,Dr.isBoolean=function(n){return!0===n||!1===n||nf(n)&&je(n)==g},Dr.isBuffer=Vo,Dr.isDate=Go,Dr.isElement=function(n){return nf(n)&&1===n.nodeType&&!ef(n)},Dr.isEmpty=function(n){if(null==n)return!0;if(Zo(n)&&(Po(n)||"string"==typeof n||"function"==typeof n.splice||Vo(n)||cf(n)||No(n)))return!n.length;var t=si(n);if(t==m||t==O)return!n.size;if(bi(n))return!We(n).length;for(var r in n)if(Wn.call(n,r))return!1;return!0},Dr.isEqual=function(n,t){return ze(n,t)},Dr.isEqualWith=function(n,t,r){var u=(r="function"==typeof r?r:e)?r(n,t):e;return u===e?ze(n,t,e,r):!!u},Dr.isError=Ho,Dr.isFinite=function(n){return"number"==typeof n&&qt(n)},Dr.isFunction=Jo,Dr.isInteger=Yo,Dr.isLength=Qo,Dr.isMap=tf,Dr.isMatch=function(n,t){return n===t||Se(n,t,fi(t))},Dr.isMatchWith=function(n,t,r){return r="function"==typeof r?r:e,Se(n,t,fi(t),r)},Dr.isNaN=function(n){return rf(n)&&n!=+n},Dr.isNative=function(n){if(wi(n))throw new xn("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ce(n)},Dr.isNil=function(n){return null==n},Dr.isNull=function(n){return null===n},Dr.isNumber=rf,Dr.isObject=Xo,Dr.isObjectLike=nf,Dr.isPlainObject=ef,Dr.isRegExp=uf,Dr.isSafeInteger=function(n){return Yo(n)&&n>=-9007199254740991&&n<=l},Dr.isSet=of,Dr.isString=ff,Dr.isSymbol=af,Dr.isTypedArray=cf,Dr.isUndefined=function(n){return n===e},Dr.isWeakMap=function(n){return nf(n)&&si(n)==R},Dr.isWeakSet=function(n){return nf(n)&&"[object WeakSet]"==je(n)},Dr.join=function(n,t){return null==n?"":vr.call(n,t)},Dr.kebabCase=qf,Dr.last=Gi,Dr.lastIndexOf=function(n,t,r){var u=null==n?0:n.length;if(!u)return-1;var i=u;return r!==e&&(i=(i=vf(r))<0?gr(u+i,0):yr(i,u-1)),t==t?function(n,t,r){for(var e=r+1;e--;)if(n[e]===t)return e;return e}(n,t,i):Dt(n,Ft,i,!0)},Dr.lowerCase=Zf,Dr.lowerFirst=Kf,Dr.lt=lf,Dr.lte=sf,Dr.max=function(n){return n&&n.length?pe(n,ea,Ae):e},Dr.maxBy=function(n,t){return n&&n.length?pe(n,ii(t,2),Ae):e},Dr.mean=function(n){return Nt(n,ea)},Dr.meanBy=function(n,t){return Nt(n,ii(t,2))},Dr.min=function(n){return n&&n.length?pe(n,ea,Te):e},Dr.minBy=function(n,t){return n&&n.length?pe(n,ii(t,2),Te):e},Dr.stubArray=_a,Dr.stubFalse=ga,Dr.stubObject=function(){return{}},Dr.stubString=function(){return""},Dr.stubTrue=function(){return!0},Dr.multiply=xa,Dr.nth=function(n,t){return n&&n.length?Me(n,vf(t)):e},Dr.noConflict=function(){return st._===this&&(st._=$n),this},Dr.noop=aa,Dr.now=ko,Dr.pad=function(n,t,r){n=df(n);var e=(t=vf(t))?cr(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return Fu(_t(u),r)+n+Fu(pt(u),r)},Dr.padEnd=function(n,t,r){n=df(n);var e=(t=vf(t))?cr(n):0;return t&&e<t?n+Fu(t-e,r):n},Dr.padStart=function(n,t,r){n=df(n);var e=(t=vf(t))?cr(n):0;return t&&e<t?Fu(t-e,r)+n:n},Dr.parseInt=function(n,t,r){return r||null==t?t=0:t&&(t=+t),wr(df(n).replace(rn,""),t||0)},Dr.random=function(n,t,r){if(r&&"boolean"!=typeof r&&gi(n,t,r)&&(t=r=e),r===e&&("boolean"==typeof t?(r=t,t=e):"boolean"==typeof n&&(r=n,n=e)),n===e&&t===e?(n=0,t=1):(n=pf(n),t===e?(t=n,n=0):t=pf(t)),n>t){var u=n;n=t,t=u}if(r||n%1||t%1){var i=br();return yr(n+i*(t-n+ft("1e-"+((i+"").length-1))),t)}return Ze(n,t)},Dr.reduce=function(n,t,r){var e=Po(n)?Lt:Zt,u=arguments.length<3;return e(n,ii(t,4),r,u,le)},Dr.reduceRight=function(n,t,r){var e=Po(n)?Wt:Zt,u=arguments.length<3;return e(n,ii(t,4),r,u,se)},Dr.repeat=function(n,t,r){return t=(r?gi(n,t,r):t===e)?1:vf(t),Ke(df(n),t)},Dr.replace=function(){var n=arguments,t=df(n[0]);return n.length<3?t:t.replace(n[1],n[2])},Dr.result=function(n,t,r){var u=-1,i=(t=gu(t,n)).length;for(i||(i=1,n=e);++u<i;){var o=null==n?e:n[Ti(t[u])];o===e&&(u=i,o=r),n=Jo(o)?o.call(n):o}return n},Dr.round=ja,Dr.runInContext=n,Dr.sample=function(n){return(Po(n)?Hr:Ge)(n)},Dr.size=function(n){if(null==n)return 0;if(Zo(n))return ff(n)?cr(n):n.length;var t=si(n);return t==m||t==O?n.size:We(n).length},Dr.snakeCase=Vf,Dr.some=function(n,t,r){var u=Po(n)?Tt:tu;return r&&gi(n,t,r)&&(t=e),u(n,ii(t,3))},Dr.sortedIndex=function(n,t){return ru(n,t)},Dr.sortedIndexBy=function(n,t,r){return eu(n,t,ii(r,2))},Dr.sortedIndexOf=function(n,t){var r=null==n?0:n.length;if(r){var e=ru(n,t);if(e<r&&$o(n[e],t))return e}return-1},Dr.sortedLastIndex=function(n,t){return ru(n,t,!0)},Dr.sortedLastIndexBy=function(n,t,r){return eu(n,t,ii(r,2),!0)},Dr.sortedLastIndexOf=function(n,t){if(null!=n&&n.length){var r=ru(n,t,!0)-1;if($o(n[r],t))return r}return-1},Dr.startCase=Gf,Dr.startsWith=function(n,t,r){return n=df(n),r=null==r?0:ie(vf(r),0,n.length),t=ou(t),n.slice(r,r+t.length)==t},Dr.subtract=Aa,Dr.sum=function(n){return n&&n.length?Kt(n,ea):0},Dr.sumBy=function(n,t){return n&&n.length?Kt(n,ii(t,2)):0},Dr.template=function(n,t,r){var u=Dr.templateSettings;r&&gi(n,t,r)&&(t=e),n=df(n),t=mf({},t,u,Hu);var i,o,f=mf({},t.imports,u.imports,Hu),a=Sf(f),c=Jt(f,a),l=0,s=t.interpolate||wn,h="__p +='",p=On((t.escape||wn).source+"|"+s.source+"|"+(s===J?sn:wn).source+"|"+(t.evaluate||wn).source+"|$","g"),v="//# sourceURL="+(Wn.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++et+"]")+"\n";n.replace(p,function(t,r,e,u,f,a){return e||(e=u),h+=n.slice(l,a).replace(bn,rr),r&&(i=!0,h+="' +\n__e("+r+") +\n'"),f&&(o=!0,h+="';\n"+f+";\n__p +='"),e&&(h+="' +\n((__t=("+e+"))==null ? '':__t) +\n'"),l=a+t.length,t}),h+="';\n";var _=Wn.call(t,"variable")&&t.variable;if(_){if(cn.test(_))throw new xn("Invalid `variable` option passed into `_.template`")}else h="with (obj){\n"+h+"\n}\n";h=(o?h.replace(F,""):h).replace(N,"$1").replace(P,"$1;"),h="function("+(_||"obj")+"){\n"+(_?"":"obj||(obj={});\n")+"var __t, __p=''"+(i?", __e=_.escape":"")+(o?", __j=Array.prototype.join;\nfunction print(){ __p +=__j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Qf(function(){return jn(a,v+"return "+h).apply(e,c)});if(g.source=h,Ho(g))throw g;return g},Dr.times=function(n,t){if((n=vf(n))<1||n>l)return[];var r=h,e=yr(n,h);t=ii(t),n-=h;for(var u=Vt(e,t);++r<n;)t(r);return u},Dr.toFinite=pf,Dr.toInteger=vf,Dr.toLength=_f,Dr.toLower=function(n){return df(n).toLowerCase()},Dr.toNumber=gf,Dr.toSafeInteger=function(n){return n?ie(vf(n),-9007199254740991,l):0===n?n:0},Dr.toString=df,Dr.toUpper=function(n){return df(n).toUpperCase()},Dr.trim=function(n,t,r){if((n=df(n))&&(r||t===e))return Gt(n);if(!n||!(t=ou(t)))return n;var u=lr(n),i=lr(t);return du(u,Qt(u,i),Xt(u,i)+1).join("")},Dr.trimEnd=function(n,t,r){if((n=df(n))&&(r||t===e))return n.slice(0,sr(n)+1);if(!n||!(t=ou(t)))return n;var u=lr(n);return du(u,0,Xt(u,lr(t))+1).join("")},Dr.trimStart=function(n,t,r){if((n=df(n))&&(r||t===e))return n.replace(rn,"");if(!n||!(t=ou(t)))return n;var u=lr(n);return du(u,Qt(u,lr(t))).join("")},Dr.truncate=function(n,t){var r=30,u="...";if(Xo(t)){var i="separator"in t?t.separator:i;r="length"in t?vf(t.length):r,u="omission"in t?ou(t.omission):u}var o=(n=df(n)).length;if(er(n)){var f=lr(n);o=f.length}if(r>=o)return n;var a=r-cr(u);if(a<1)return u;var c=f?du(f,0,a).join(""):n.slice(0,a);if(i===e)return c+u;if(f&&(a+=c.length-a),uf(i)){if(n.slice(a).search(i)){var l,s=c;for(i.global||(i=On(i.source,df(hn.exec(i))+"g")),i.lastIndex=0;l=i.exec(s);)var h=l.index;c=c.slice(0,h===e?a:h)}}else if(n.indexOf(ou(i),a)!=a){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+u},Dr.unescape=function(n){return(n=df(n))&&K.test(n)?n.replace(q,hr):n},Dr.uniqueId=function(n){var t=++Tn;return df(n)+t},Dr.upperCase=Hf,Dr.upperFirst=Jf,Dr.each=go,Dr.eachRight=yo,Dr.first=qi,fa(Dr,(ya={},de(Dr,function(n,t){Wn.call(Dr.prototype,t)||(ya[t]=n)}),ya),{chain:!1}),Dr.VERSION="4.17.21",kt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){Dr[n].placeholder=Dr}),kt(["drop","take"],function(n,t){Nr.prototype[n]=function(r){r=r===e?1:gr(vf(r),0);var u=this.__filtered__&&!t?new Nr(this):this.clone();return u.__filtered__?u.__takeCount__=yr(r,u.__takeCount__):u.__views__.push({size:yr(r,h),type:n+(u.__dir__<0?"Right":"")}),u},Nr.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),kt(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;Nr.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ii(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),kt(["head","last"],function(n,t){var r="take"+(t?"Right":"");Nr.prototype[n]=function(){return this[r](1).value()[0]}}),kt(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Nr.prototype[n]=function(){return this.__filtered__?new Nr(this):this[r](1)}}),Nr.prototype.compact=function(){return this.filter(ea)},Nr.prototype.find=function(n){return this.filter(n).head()},Nr.prototype.findLast=function(n){return this.reverse().find(n)},Nr.prototype.invokeMap=Ve(function(n,t){return"function"==typeof n?new Nr(this):this.map(function(r){return Ie(r,n,t)})}),Nr.prototype.reject=function(n){return this.filter(Wo(ii(n)))},Nr.prototype.slice=function(n,t){n=vf(n);var r=this;return r.__filtered__&&(n>0||t<0)?new Nr(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==e&&(r=(t=vf(t))<0?r.dropRight(-t):r.take(t-n)),r)},Nr.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},Nr.prototype.toArray=function(){return this.take(h)},de(Nr.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),u=/^(?:head|last)$/.test(t),i=Dr[u?"take"+("last"==t?"Right":""):t],o=u||/^find/.test(t);i&&(Dr.prototype[t]=function(){var t=this.__wrapped__,f=u?[1]:arguments,a=t instanceof Nr,c=f[0],l=a||Po(t),s=function(n){var t=i.apply(Dr,Ct([n],f));return u&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(a=l=!1);var h=this.__chain__,p=!!this.__actions__.length,v=o&&!h,_=a&&!p;if(!o&&l){t=_?t:new Nr(this);var g=n.apply(t,f);return g.__actions__.push({func:so,args:[s],thisArg:e}),new Fr(g,h)}return v&&_?n.apply(this,f):(g=this.thru(s),v?u?g.value()[0]:g.value():g)})}),kt(["pop","push","shift","sort","splice","unshift"],function(n){var t=Rn[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);Dr.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(Po(u)?u:[],n)}return this[r](function(r){return t.apply(Po(r)?r:[],n)})}}),de(Nr.prototype,function(n,t){var r=Dr[t];if(r){var e=r.name+"";Wn.call(Rr,e)||(Rr[e]=[]),Rr[e].push({name:t,func:r})}}),Rr[Bu(e,2).name]=[{name:"wrapper",func:e}],Nr.prototype.clone=function(){var n=new Nr(this.__wrapped__);return n.__actions__=Ou(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ou(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ou(this.__views__),n},Nr.prototype.reverse=function(){if(this.__filtered__){var n=new Nr(this);n.__dir__=-1,n.__filtered__=!0}else(n=this.clone()).__dir__*=-1;return n},Nr.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=Po(n),e=t<0,u=r?n.length:0,i=function(n,t,r){for(var e=-1,u=r.length;++e<u;){var i=r[e],o=i.size;switch(i.type){case"drop":n+=o;break;case"dropRight":t-=o;break;case"take":t=yr(t,n+o);break;case"takeRight":n=gr(n,t-o)}}return{start:n,end:t}}(0,u,this.__views__),o=i.start,f=i.end,a=f-o,c=e?f:o-1,l=this.__iteratees__,s=l.length,h=0,p=yr(a,this.__takeCount__);if(!r||!e&&u==a&&p==a)return su(n,this.__actions__);var v=[];n:for(;a--&&h<p;){for(var _=-1,g=n[c+=t];++_<s;){var y=l[_],d=y.iteratee,w=y.type,b=d(g);if(2==w)g=b;else if(!b){if(1==w)continue n;break n}}v[h++]=g}return v},Dr.prototype.at=ho,Dr.prototype.chain=function(){return lo(this)},Dr.prototype.commit=function(){return new Fr(this.value(),this.__chain__)},Dr.prototype.next=function(){this.__values__===e&&(this.__values__=hf(this.value()));var n=this.__index__>=this.__values__.length;return{done:n,value:n?e:this.__values__[this.__index__++]}},Dr.prototype.plant=function(n){for(var t,r=this;r instanceof Mr;){var u=Bi(r);u.__index__=0,u.__values__=e,t?i.__wrapped__=u:t=u;var i=u;r=r.__wrapped__}return i.__wrapped__=n,t},Dr.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof Nr){var t=n;return this.__actions__.length&&(t=new Nr(this)),(t=t.reverse()).__actions__.push({func:so,args:[Qi],thisArg:e}),new Fr(t,this.__chain__)}return this.thru(Qi)},Dr.prototype.toJSON=Dr.prototype.valueOf=Dr.prototype.value=function(){return su(this.__wrapped__,this.__actions__)},Dr.prototype.first=Dr.prototype.head,Qn&&(Dr.prototype[Qn]=function(){return this}),Dr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(st._=pr,define(function(){return pr})):pt?((pt.exports=pr)._=pr,ht._=pr):st._=pr}.call(this)}},t={};function r(e){var u=t[e];if(void 0!==u)return u.exports;var i=t[e]={id:e,loaded:!1,exports:{}};return n[e].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.n=n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return r.d(t,{a:t}),t},r.d=(n,t)=>{for(var e in t)r.o(t,e)&&!r.o(n,e)&&Object.defineProperty(n,e,{enumerable:!0,get:t[e]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),r.o=(n,t)=>Object.prototype.hasOwnProperty.call(n,t),r.nmd=n=>(n.paths=[],n.children||(n.children=[]),n),(()=>{"use strict";var n=r(243);!function(){function t(){if(!r.g.wp_consent_type&&!r.g.wp_fallback_consent_type)return;const t={};let e=!1;Object.entries(r.g._googlesitekitConsentCategoryMap).forEach(n=>{let[u,i]=n;r.g.wp_has_consent&&r.g.wp_has_consent(u)&&(i.forEach(n=>{t[n]="granted"}),e=e||!!i.length)}),e&&!(0,n.isEqual)(t,r.g._googlesitekitConsents)&&(r.g.gtag("consent","update",t),r.g._googlesitekitConsents=t)}r.g.document.addEventListener("wp_listen_for_consent_change",function(n){if(n.detail){const t={};let e=!1;Object.keys(n.detail).forEach(u=>{if(r.g._googlesitekitConsentCategoryMap[u]){const i="allow"===n.detail[u]?"granted":"denied",o=r.g._googlesitekitConsentCategoryMap[u];o.forEach(n=>{t[n]=i}),e=!!o.length}}),e&&r.g.gtag("consent","update",t)}}),r.g.document.addEventListener("wp_consent_type_defined",t),r.g.document.addEventListener("DOMContentLoaded",()=>{r.g.waitfor_consent_hook||t()})}()})()})();
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('jquery-bridget/jquery-bridget',[ 'jquery' ], function(jQuery){
return factory(window, jQuery);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('jquery')
);
}else{
window.jQueryBridget=factory(
window,
window.jQuery
);
}}(window, function factory(window, jQuery){
'use strict';
var arraySlice=Array.prototype.slice;
var console=window.console;
var logError=typeof console=='undefined' ? function(){} :
function(message){
console.error(message);
};
function jQueryBridget(namespace, PluginClass, $){
$=$||jQuery||window.jQuery;
if(!$){
return;
}
if(!PluginClass.prototype.option){
PluginClass.prototype.option=function(opts){
if(!$.isPlainObject(opts) ){
return;
}
this.options=$.extend(true, this.options, opts);
};}
$.fn[ namespace ]=function(arg0 ){
if(typeof arg0=='string'){
var args=arraySlice.call(arguments, 1);
return methodCall(this, arg0, args);
}
plainCall(this, arg0);
return this;
};
function methodCall($elems, methodName, args){
var returnValue;
var pluginMethodStr='$().' + namespace + '("' + methodName + '")';
$elems.each(function(i, elem){
var instance=$.data(elem, namespace);
if(!instance){
logError(namespace + ' not initialized. Cannot call methods, i.e. ' +
pluginMethodStr);
return;
}
var method=instance[ methodName ];
if(!method||methodName.charAt(0)=='_'){
logError(pluginMethodStr + ' is not a valid method');
return;
}
var value=method.apply(instance, args);
returnValue=returnValue===undefined ? value:returnValue;
});
return returnValue!==undefined ? returnValue:$elems;
}
function plainCall($elems, options){
$elems.each(function(i, elem){
var instance=$.data(elem, namespace);
if(instance){
instance.option(options);
instance._init();
}else{
instance=new PluginClass(elem, options);
$.data(elem, namespace, instance);
}});
}
updateJQuery($);
}
function updateJQuery($){
if(!$||($&&$.bridget) ){
return;
}
$.bridget=jQueryBridget;
}
updateJQuery(jQuery||window.jQuery);
return jQueryBridget;
}));
(function(global, factory){
if(typeof define=='function'&&define.amd){
define('ev-emitter/ev-emitter',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
global.EvEmitter=factory();
}}(typeof window!='undefined' ? window:this, function(){
function EvEmitter(){}
var proto=EvEmitter.prototype;
proto.on=function(eventName, listener){
if(!eventName||!listener){
return;
}
var events=this._events=this._events||{};
var listeners=events[ eventName ]=events[ eventName ]||[];
if(listeners.indexOf(listener)==-1){
listeners.push(listener);
}
return this;
};
proto.once=function(eventName, listener){
if(!eventName||!listener){
return;
}
this.on(eventName, listener);
var onceEvents=this._onceEvents=this._onceEvents||{};
var onceListeners=onceEvents[ eventName ]=onceEvents[ eventName ]||{};
onceListeners[ listener ]=true;
return this;
};
proto.off=function(eventName, listener){
var listeners=this._events&&this._events[ eventName ];
if(!listeners||!listeners.length){
return;
}
var index=listeners.indexOf(listener);
if(index!=-1){
listeners.splice(index, 1);
}
return this;
};
proto.emitEvent=function(eventName, args){
var listeners=this._events&&this._events[ eventName ];
if(!listeners||!listeners.length){
return;
}
var i=0;
var listener=listeners[i];
args=args||[];
var onceListeners=this._onceEvents&&this._onceEvents[ eventName ];
while(listener){
var isOnce=onceListeners&&onceListeners[ listener ];
if(isOnce){
this.off(eventName, listener);
delete onceListeners[ listener ];
}
listener.apply(this, args);
i +=isOnce ? 0:1;
listener=listeners[i];
}
return this;
};
return EvEmitter;
}));
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('get-size/get-size',[],function(){
return factory();
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.getSize=factory();
}})(window, function factory(){
'use strict';
function getStyleSize(value){
var num=parseFloat(value);
var isValid=value.indexOf('%')==-1&&!isNaN(num);
return isValid&&num;
}
function noop(){}
var logError=typeof console=='undefined' ? noop :
function(message){
console.error(message);
};
var measurements=[
'paddingLeft',
'paddingRight',
'paddingTop',
'paddingBottom',
'marginLeft',
'marginRight',
'marginTop',
'marginBottom',
'borderLeftWidth',
'borderRightWidth',
'borderTopWidth',
'borderBottomWidth'
];
var measurementsLength=measurements.length;
function getZeroSize(){
var size={
width: 0,
height: 0,
innerWidth: 0,
innerHeight: 0,
outerWidth: 0,
outerHeight: 0
};
for(var i=0; i < measurementsLength; i++){
var measurement=measurements[i];
size[ measurement ]=0;
}
return size;
}
function getStyle(elem){
var style=getComputedStyle(elem);
if(!style){
logError('Style returned ' + style +
'. Are you running this code in a hidden iframe on Firefox? ' +
'See http://bit.ly/getsizebug1');
}
return style;
}
var isSetup=false;
var isBoxSizeOuter;
function setup(){
if(isSetup){
return;
}
isSetup=true;
var div=document.createElement('div');
div.style.width='200px';
div.style.padding='1px 2px 3px 4px';
div.style.borderStyle='solid';
div.style.borderWidth='1px 2px 3px 4px';
div.style.boxSizing='border-box';
var body=document.body||document.documentElement;
body.appendChild(div);
var style=getStyle(div);
getSize.isBoxSizeOuter=isBoxSizeOuter=getStyleSize(style.width)==200;
body.removeChild(div);
}
function getSize(elem){
setup();
if(typeof elem=='string'){
elem=document.querySelector(elem);
}
if(!elem||typeof elem!='object'||!elem.nodeType){
return;
}
var style=getStyle(elem);
if(style.display=='none'){
return getZeroSize();
}
var size={};
size.width=elem.offsetWidth;
size.height=elem.offsetHeight;
var isBorderBox=size.isBorderBox=style.boxSizing=='border-box';
for(var i=0; i < measurementsLength; i++){
var measurement=measurements[i];
var value=style[ measurement ];
var num=parseFloat(value);
size[ measurement ] = !isNaN(num) ? num:0;
}
var paddingWidth=size.paddingLeft + size.paddingRight;
var paddingHeight=size.paddingTop + size.paddingBottom;
var marginWidth=size.marginLeft + size.marginRight;
var marginHeight=size.marginTop + size.marginBottom;
var borderWidth=size.borderLeftWidth + size.borderRightWidth;
var borderHeight=size.borderTopWidth + size.borderBottomWidth;
var isBorderBoxSizeOuter=isBorderBox&&isBoxSizeOuter;
var styleWidth=getStyleSize(style.width);
if(styleWidth!==false){
size.width=styleWidth +
(isBorderBoxSizeOuter ? 0:paddingWidth + borderWidth);
}
var styleHeight=getStyleSize(style.height);
if(styleHeight!==false){
size.height=styleHeight +
(isBorderBoxSizeOuter ? 0:paddingHeight + borderHeight);
}
size.innerWidth=size.width -(paddingWidth + borderWidth);
size.innerHeight=size.height -(paddingHeight + borderHeight);
size.outerWidth=size.width + marginWidth;
size.outerHeight=size.height + marginHeight;
return size;
}
return getSize;
});
(function(window, factory){
'use strict';
if(typeof define=='function'&&define.amd){
define('desandro-matches-selector/matches-selector',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.matchesSelector=factory();
}}(window, function factory(){
'use strict';
var matchesMethod=(function(){
var ElemProto=Element.prototype;
if(ElemProto.matches){
return 'matches';
}
if(ElemProto.matchesSelector){
return 'matchesSelector';
}
var prefixes=[ 'webkit', 'moz', 'ms', 'o' ];
for(var i=0; i < prefixes.length; i++){
var prefix=prefixes[i];
var method=prefix + 'MatchesSelector';
if(ElemProto[ method ]){
return method;
}}
})();
return function matchesSelector(elem, selector){
return elem[ matchesMethod ](selector);
};}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('fizzy-ui-utils/utils',[
'desandro-matches-selector/matches-selector'
], function(matchesSelector){
return factory(window, matchesSelector);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('desandro-matches-selector')
);
}else{
window.fizzyUIUtils=factory(
window,
window.matchesSelector
);
}}(window, function factory(window, matchesSelector){
var utils={};
utils.extend=function(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
};
utils.modulo=function(num, div){
return(( num % div) + div) % div;
};
utils.makeArray=function(obj){
var ary=[];
if(Array.isArray(obj) ){
ary=obj;
}else if(obj&&typeof obj.length=='number'){
for(var i=0; i < obj.length; i++){
ary.push(obj[i]);
}}else{
ary.push(obj);
}
return ary;
};
utils.removeFrom=function(ary, obj){
var index=ary.indexOf(obj);
if(index!=-1){
ary.splice(index, 1);
}};
utils.getParent=function(elem, selector){
while(elem!=document.body){
elem=elem.parentNode;
if(matchesSelector(elem, selector) ){
return elem;
}}
};
utils.getQueryElement=function(elem){
if(typeof elem=='string'){
return document.querySelector(elem);
}
return elem;
};
utils.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
utils.filterFindElements=function(elems, selector){
elems=utils.makeArray(elems);
var ffElems=[];
elems.forEach(function(elem){
if(!(elem instanceof HTMLElement) ){
return;
}
if(!selector){
ffElems.push(elem);
return;
}
if(matchesSelector(elem, selector) ){
ffElems.push(elem);
}
var childElems=elem.querySelectorAll(selector);
for(var i=0; i < childElems.length; i++){
ffElems.push(childElems[i]);
}});
return ffElems;
};
utils.debounceMethod=function(_class, methodName, threshold){
var method=_class.prototype[ methodName ];
var timeoutName=methodName + 'Timeout';
_class.prototype[ methodName ]=function(){
var timeout=this[ timeoutName ];
if(timeout){
clearTimeout(timeout);
}
var args=arguments;
var _this=this;
this[ timeoutName ]=setTimeout(function(){
method.apply(_this, args);
delete _this[ timeoutName ];
}, threshold||100);
};};
utils.docReady=function(callback){
var readyState=document.readyState;
if(readyState=='complete'||readyState=='interactive'){
setTimeout(callback);
}else{
document.addEventListener('DOMContentLoaded', callback);
}};
utils.toDashed=function(str){
return str.replace(/(.)([A-Z])/g, function(match, $1, $2){
return $1 + '-' + $2;
}).toLowerCase();
};
var console=window.console;
utils.htmlInit=function(WidgetClass, namespace){
utils.docReady(function(){
var dashedNamespace=utils.toDashed(namespace);
var dataAttr='data-' + dashedNamespace;
var dataAttrElems=document.querySelectorAll('[' + dataAttr + ']');
var jsDashElems=document.querySelectorAll('.js-' + dashedNamespace);
var elems=utils.makeArray(dataAttrElems)
.concat(utils.makeArray(jsDashElems) );
var dataOptionsAttr=dataAttr + '-options';
var jQuery=window.jQuery;
elems.forEach(function(elem){
var attr=elem.getAttribute(dataAttr) ||
elem.getAttribute(dataOptionsAttr);
var options;
try {
options=attr&&JSON.parse(attr);
} catch(error){
if(console){
console.error('Error parsing ' + dataAttr + ' on ' + elem.className +
': ' + error);
}
return;
}
var instance=new WidgetClass(elem, options);
if(jQuery){
jQuery.data(elem, namespace, instance);
}});
});
};
return utils;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/cell',[
'get-size/get-size'
], function(getSize){
return factory(window, getSize);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('get-size')
);
}else{
window.Flickity=window.Flickity||{};
window.Flickity.Cell=factory(
window,
window.getSize
);
}}(window, function factory(window, getSize){
function Cell(elem, parent){
this.element=elem;
this.parent=parent;
this.create();
}
var proto=Cell.prototype;
proto.create=function(){
this.element.style.position='absolute';
this.x=0;
this.shift=0;
};
proto.destroy=function(){
this.element.style.position='';
var side=this.parent.originSide;
this.element.style[ side ]='';
};
proto.getSize=function(){
this.size=getSize(this.element);
};
proto.setPosition=function(x){
this.x=x;
this.updateTarget();
this.renderPosition(x);
};
proto.updateTarget=proto.setDefaultTarget=function(){
var marginProperty=this.parent.originSide=='left' ? 'marginLeft':'marginRight';
this.target=this.x + this.size[ marginProperty ] +
this.size.width * this.parent.cellAlign;
};
proto.renderPosition=function(x){
var side=this.parent.originSide;
this.element.style[ side ]=this.parent.getPositionValue(x);
};
proto.wrapShift=function(shift){
this.shift=shift;
this.renderPosition(this.x + this.parent.slideableWidth * shift);
};
proto.remove=function(){
this.element.parentNode.removeChild(this.element);
};
return Cell;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/slide',factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory();
}else{
window.Flickity=window.Flickity||{};
window.Flickity.Slide=factory();
}}(window, function factory(){
'use strict';
function Slide(parent){
this.parent=parent;
this.isOriginLeft=parent.originSide=='left';
this.cells=[];
this.outerWidth=0;
this.height=0;
}
var proto=Slide.prototype;
proto.addCell=function(cell){
this.cells.push(cell);
this.outerWidth +=cell.size.outerWidth;
this.height=Math.max(cell.size.outerHeight, this.height);
if(this.cells.length==1){
this.x=cell.x;
var beginMargin=this.isOriginLeft ? 'marginLeft':'marginRight';
this.firstMargin=cell.size[ beginMargin ];
}};
proto.updateTarget=function(){
var endMargin=this.isOriginLeft ? 'marginRight':'marginLeft';
var lastCell=this.getLastCell();
var lastMargin=lastCell ? lastCell.size[ endMargin ]:0;
var slideWidth=this.outerWidth -(this.firstMargin + lastMargin);
this.target=this.x + this.firstMargin + slideWidth * this.parent.cellAlign;
};
proto.getLastCell=function(){
return this.cells[ this.cells.length - 1 ];
};
proto.select=function(){
this.changeSelectedClass('add');
};
proto.unselect=function(){
this.changeSelectedClass('remove');
};
proto.changeSelectedClass=function(method){
this.cells.forEach(function(cell){
cell.element.classList[ method ]('is-selected');
});
};
proto.getCellElements=function(){
return this.cells.map(function(cell){
return cell.element;
});
};
return Slide;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/animate',[
'fizzy-ui-utils/utils'
], function(utils){
return factory(window, utils);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('fizzy-ui-utils')
);
}else{
window.Flickity=window.Flickity||{};
window.Flickity.animatePrototype=factory(
window,
window.fizzyUIUtils
);
}}(window, function factory(window, utils){
var requestAnimationFrame=window.requestAnimationFrame ||
window.webkitRequestAnimationFrame;
var lastTime=0;
if(!requestAnimationFrame){
requestAnimationFrame=function(callback){
var currTime=new Date().getTime();
var timeToCall=Math.max(0, 16 -(currTime - lastTime) );
var id=setTimeout(callback, timeToCall);
lastTime=currTime + timeToCall;
return id;
};}
var proto={};
proto.startAnimation=function(){
if(this.isAnimating){
return;
}
this.isAnimating=true;
this.restingFrames=0;
this.animate();
};
proto.animate=function(){
this.applyDragForce();
this.applySelectedAttraction();
var previousX=this.x;
this.integratePhysics();
this.positionSlider();
this.settle(previousX);
if(this.isAnimating){
var _this=this;
requestAnimationFrame(function animateFrame(){
_this.animate();
});
}};
var transformProperty=(function (){
var style=document.documentElement.style;
if(typeof style.transform=='string'){
return 'transform';
}
return 'WebkitTransform';
})();
proto.positionSlider=function(){
var x=this.x;
if(this.options.wrapAround&&this.cells.length > 1){
x=utils.modulo(x, this.slideableWidth);
x=x - this.slideableWidth;
this.shiftWrapCells(x);
}
x=x + this.cursorPosition;
x=this.options.rightToLeft&&transformProperty ? -x:x;
var value=this.getPositionValue(x);
this.slider.style[ transformProperty ]=this.isAnimating ?
'translate3d(' + value + ',0,0)':'translateX(' + value + ')';
var firstSlide=this.slides[0];
if(firstSlide){
var positionX=-this.x - firstSlide.target;
var progress=positionX / this.slidesWidth;
this.dispatchEvent('scroll', null, [ progress, positionX ]);
}};
proto.positionSliderAtSelected=function(){
if(!this.cells.length){
return;
}
this.x=-this.selectedSlide.target;
this.positionSlider();
};
proto.getPositionValue=function(position){
if(this.options.percentPosition){
return(Math.round(( position / this.size.innerWidth) * 10000) * 0.01)+ '%';
}else{
return Math.round(position) + 'px';
}};
proto.settle=function(previousX){
if(!this.isPointerDown&&Math.round(this.x * 100)==Math.round(previousX * 100) ){
this.restingFrames++;
}
if(this.restingFrames > 2){
this.isAnimating=false;
delete this.isFreeScrolling;
this.positionSlider();
this.dispatchEvent('settle');
}};
proto.shiftWrapCells=function(x){
var beforeGap=this.cursorPosition + x;
this._shiftCells(this.beforeShiftCells, beforeGap, -1);
var afterGap=this.size.innerWidth -(x + this.slideableWidth + this.cursorPosition);
this._shiftCells(this.afterShiftCells, afterGap, 1);
};
proto._shiftCells=function(cells, gap, shift){
for(var i=0; i < cells.length; i++){
var cell=cells[i];
var cellShift=gap > 0 ? shift:0;
cell.wrapShift(cellShift);
gap -=cell.size.outerWidth;
}};
proto._unshiftCells=function(cells){
if(!cells||!cells.length){
return;
}
for(var i=0; i < cells.length; i++){
cells[i].wrapShift(0);
}};
proto.integratePhysics=function(){
this.x +=this.velocity;
this.velocity *=this.getFrictionFactor();
};
proto.applyForce=function(force){
this.velocity +=force;
};
proto.getFrictionFactor=function(){
return 1 - this.options[ this.isFreeScrolling ? 'freeScrollFriction':'friction' ];
};
proto.getRestingPosition=function(){
return this.x + this.velocity /(1 - this.getFrictionFactor());
};
proto.applyDragForce=function(){
if(!this.isPointerDown){
return;
}
var dragVelocity=this.dragX - this.x;
var dragForce=dragVelocity - this.velocity;
this.applyForce(dragForce);
};
proto.applySelectedAttraction=function(){
if(this.isPointerDown||this.isFreeScrolling||!this.cells.length){
return;
}
var distance=this.selectedSlide.target * -1 - this.x;
var force=distance * this.options.selectedAttraction;
this.applyForce(force);
};
return proto;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/flickity',[
'ev-emitter/ev-emitter',
'get-size/get-size',
'fizzy-ui-utils/utils',
'./cell',
'./slide',
'./animate'
], function(EvEmitter, getSize, utils, Cell, Slide, animatePrototype){
return factory(window, EvEmitter, getSize, utils, Cell, Slide, animatePrototype);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('ev-emitter'),
require('get-size'),
require('fizzy-ui-utils'),
require('./cell'),
require('./slide'),
require('./animate')
);
}else{
var _Flickity=window.Flickity;
window.Flickity=factory(
window,
window.EvEmitter,
window.getSize,
window.fizzyUIUtils,
_Flickity.Cell,
_Flickity.Slide,
_Flickity.animatePrototype
);
}}(window, function factory(window, EvEmitter, getSize,
utils, Cell, Slide, animatePrototype){
var jQuery=window.jQuery;
var getComputedStyle=window.getComputedStyle;
var console=window.console;
function moveElements(elems, toElem){
elems=utils.makeArray(elems);
while(elems.length){
toElem.appendChild(elems.shift());
}}
var GUID=0;
var instances={};
function Flickity(element, options){
var queryElement=utils.getQueryElement(element);
if(!queryElement){
if(console){
console.error('Bad element for Flickity: ' +(queryElement||element) );
}
return;
}
this.element=queryElement;
if(this.element.flickityGUID){
var instance=instances[ this.element.flickityGUID ];
instance.option(options);
return instance;
}
if(jQuery){
this.$element=jQuery(this.element);
}
this.options=utils.extend({}, this.constructor.defaults);
this.option(options);
this._create();
}
Flickity.defaults={
accessibility: true,
cellAlign: 'center',
freeScrollFriction: 0.075,
friction: 0.28,
namespaceJQueryEvents: true,
percentPosition: true,
resize: true,
selectedAttraction: 0.025,
setGallerySize: true
};
Flickity.createMethods=[];
var proto=Flickity.prototype;
utils.extend(proto, EvEmitter.prototype);
proto._create=function(){
var id=this.guid=++GUID;
this.element.flickityGUID=id;
instances[ id ]=this;
this.selectedIndex=0;
this.restingFrames=0;
this.x=0;
this.velocity=0;
this.originSide=this.options.rightToLeft ? 'right':'left';
this.viewport=document.createElement('div');
this.viewport.className='flickity-viewport';
this._createSlider();
if(this.options.resize||this.options.watchCSS){
window.addEventListener('resize', this);
}
Flickity.createMethods.forEach(function(method){
this[ method ]();
}, this);
if(this.options.watchCSS){
this.watchCSS();
}else{
this.activate();
}};
proto.option=function(opts){
utils.extend(this.options, opts);
};
proto.activate=function(){
if(this.isActive){
return;
}
this.isActive=true;
this.element.classList.add('flickity-enabled');
if(this.options.rightToLeft){
this.element.classList.add('flickity-rtl');
}
this.getSize();
var cellElems=this._filterFindCellElements(this.element.children);
moveElements(cellElems, this.slider);
this.viewport.appendChild(this.slider);
this.element.appendChild(this.viewport);
this.reloadCells();
if(this.options.accessibility){
this.element.tabIndex=0;
this.element.addEventListener('keydown', this);
}
this.emitEvent('activate');
var index;
var initialIndex=this.options.initialIndex;
if(this.isInitActivated){
index=this.selectedIndex;
}else if(initialIndex!==undefined){
index=this.cells[ initialIndex ] ? initialIndex:0;
}else{
index=0;
}
this.select(index, false, true);
this.isInitActivated=true;
};
proto._createSlider=function(){
var slider=document.createElement('div');
slider.className='flickity-slider';
slider.style[ this.originSide ]=0;
this.slider=slider;
};
proto._filterFindCellElements=function(elems){
return utils.filterFindElements(elems, this.options.cellSelector);
};
proto.reloadCells=function(){
this.cells=this._makeCells(this.slider.children);
this.positionCells();
this._getWrapShiftCells();
this.setGallerySize();
};
proto._makeCells=function(elems){
var cellElems=this._filterFindCellElements(elems);
var cells=cellElems.map(function(cellElem){
return new Cell(cellElem, this);
}, this);
return cells;
};
proto.getLastCell=function(){
return this.cells[ this.cells.length - 1 ];
};
proto.getLastSlide=function(){
return this.slides[ this.slides.length - 1 ];
};
proto.positionCells=function(){
this._sizeCells(this.cells);
this._positionCells(0);
};
proto._positionCells=function(index){
index=index||0;
this.maxCellHeight=index ? this.maxCellHeight||0:0;
var cellX=0;
if(index > 0){
var startCell=this.cells[ index - 1 ];
cellX=startCell.x + startCell.size.outerWidth;
}
var len=this.cells.length;
for(var i=index; i < len; i++){
var cell=this.cells[i];
cell.setPosition(cellX);
cellX +=cell.size.outerWidth;
this.maxCellHeight=Math.max(cell.size.outerHeight, this.maxCellHeight);
}
this.slideableWidth=cellX;
this.updateSlides();
this._containSlides();
this.slidesWidth=len ? this.getLastSlide().target - this.slides[0].target:0;
};
proto._sizeCells=function(cells){
cells.forEach(function(cell){
cell.getSize();
});
};
proto.updateSlides=function(){
this.slides=[];
if(!this.cells.length){
return;
}
var slide=new Slide(this);
this.slides.push(slide);
var isOriginLeft=this.originSide=='left';
var nextMargin=isOriginLeft ? 'marginRight':'marginLeft';
var canCellFit=this._getCanCellFit();
this.cells.forEach(function(cell, i){
if(!slide.cells.length){
slide.addCell(cell);
return;
}
var slideWidth=(slide.outerWidth - slide.firstMargin) +
(cell.size.outerWidth - cell.size[ nextMargin ]);
if(canCellFit.call(this, i, slideWidth) ){
slide.addCell(cell);
}else{
slide.updateTarget();
slide=new Slide(this);
this.slides.push(slide);
slide.addCell(cell);
}}, this);
slide.updateTarget();
this.updateSelectedSlide();
};
proto._getCanCellFit=function(){
var groupCells=this.options.groupCells;
if(!groupCells){
return function(){
return false;
};}else if(typeof groupCells=='number'){
var number=parseInt(groupCells, 10);
return function(i){
return(i % number)!==0;
};}
var percentMatch=typeof groupCells=='string' &&
groupCells.match(/^(\d+)%$/);
var percent=percentMatch ? parseInt(percentMatch[1], 10) / 100:1;
return function(i, slideWidth){
return slideWidth <=(this.size.innerWidth + 1) * percent;
};};
proto._init =
proto.reposition=function(){
this.positionCells();
this.positionSliderAtSelected();
};
proto.getSize=function(){
this.size=getSize(this.element);
this.setCellAlign();
this.cursorPosition=this.size.innerWidth * this.cellAlign;
};
var cellAlignShorthands={
center: {
left: 0.5,
right: 0.5
},
left: {
left: 0,
right: 1
},
right: {
right: 0,
left: 1
}};
proto.setCellAlign=function(){
var shorthand=cellAlignShorthands[ this.options.cellAlign ];
this.cellAlign=shorthand ? shorthand[ this.originSide ]:this.options.cellAlign;
};
proto.setGallerySize=function(){
if(this.options.setGallerySize){
var height=this.options.adaptiveHeight&&this.selectedSlide ?
this.selectedSlide.height:this.maxCellHeight;
this.viewport.style.height=height + 'px';
}};
proto._getWrapShiftCells=function(){
if(!this.options.wrapAround){
return;
}
this._unshiftCells(this.beforeShiftCells);
this._unshiftCells(this.afterShiftCells);
var gapX=this.cursorPosition;
var cellIndex=this.cells.length - 1;
this.beforeShiftCells=this._getGapCells(gapX, cellIndex, -1);
gapX=this.size.innerWidth - this.cursorPosition;
this.afterShiftCells=this._getGapCells(gapX, 0, 1);
};
proto._getGapCells=function(gapX, cellIndex, increment){
var cells=[];
while(gapX > 0){
var cell=this.cells[ cellIndex ];
if(!cell){
break;
}
cells.push(cell);
cellIndex +=increment;
gapX -=cell.size.outerWidth;
}
return cells;
};
proto._containSlides=function(){
if(!this.options.contain||this.options.wrapAround||!this.cells.length){
return;
}
var isRightToLeft=this.options.rightToLeft;
var beginMargin=isRightToLeft ? 'marginRight':'marginLeft';
var endMargin=isRightToLeft ? 'marginLeft':'marginRight';
var contentWidth=this.slideableWidth - this.getLastCell().size[ endMargin ];
var isContentSmaller=contentWidth < this.size.innerWidth;
var beginBound=this.cursorPosition + this.cells[0].size[ beginMargin ];
var endBound=contentWidth - this.size.innerWidth *(1 - this.cellAlign);
this.slides.forEach(function(slide){
if(isContentSmaller){
slide.target=contentWidth * this.cellAlign;
}else{
slide.target=Math.max(slide.target, beginBound);
slide.target=Math.min(slide.target, endBound);
}}, this);
};
proto.dispatchEvent=function(type, event, args){
var emitArgs=event ? [ event ].concat(args):args;
this.emitEvent(type, emitArgs);
if(jQuery&&this.$element){
type +=this.options.namespaceJQueryEvents ? '.flickity':'';
var $event=type;
if(event){
var jQEvent=jQuery.Event(event);
jQEvent.type=type;
$event=jQEvent;
}
this.$element.trigger($event, args);
}};
proto.select=function(index, isWrap, isInstant){
if(!this.isActive){
return;
}
index=parseInt(index, 10);
this._wrapSelect(index);
if(this.options.wrapAround||isWrap){
index=utils.modulo(index, this.slides.length);
}
if(!this.slides[ index ]){
return;
}
this.selectedIndex=index;
this.updateSelectedSlide();
if(isInstant){
this.positionSliderAtSelected();
}else{
this.startAnimation();
}
if(this.options.adaptiveHeight){
this.setGallerySize();
}
this.dispatchEvent('select');
this.dispatchEvent('cellSelect');
};
proto._wrapSelect=function(index){
var len=this.slides.length;
var isWrapping=this.options.wrapAround&&len > 1;
if(!isWrapping){
return index;
}
var wrapIndex=utils.modulo(index, len);
var delta=Math.abs(wrapIndex - this.selectedIndex);
var backWrapDelta=Math.abs(( wrapIndex + len) - this.selectedIndex);
var forewardWrapDelta=Math.abs(( wrapIndex - len) - this.selectedIndex);
if(!this.isDragSelect&&backWrapDelta < delta){
index +=len;
}else if(!this.isDragSelect&&forewardWrapDelta < delta){
index -=len;
}
if(index < 0){
this.x -=this.slideableWidth;
}else if(index >=len){
this.x +=this.slideableWidth;
}};
proto.previous=function(isWrap, isInstant){
this.select(this.selectedIndex - 1, isWrap, isInstant);
};
proto.next=function(isWrap, isInstant){
this.select(this.selectedIndex + 1, isWrap, isInstant);
};
proto.updateSelectedSlide=function(){
var slide=this.slides[ this.selectedIndex ];
if(!slide){
return;
}
this.unselectSelectedSlide();
this.selectedSlide=slide;
slide.select();
this.selectedCells=slide.cells;
this.selectedElements=slide.getCellElements();
this.selectedCell=slide.cells[0];
this.selectedElement=this.selectedElements[0];
};
proto.unselectSelectedSlide=function(){
if(this.selectedSlide){
this.selectedSlide.unselect();
}};
proto.selectCell=function(value, isWrap, isInstant){
var cell;
if(typeof value=='number'){
cell=this.cells[ value ];
}else{
if(typeof value=='string'){
value=this.element.querySelector(value);
}
cell=this.getCell(value);
}
for(var i=0; cell&&i < this.slides.length; i++){
var slide=this.slides[i];
var index=slide.cells.indexOf(cell);
if(index!=-1){
this.select(i, isWrap, isInstant);
return;
}}
};
proto.getCell=function(elem){
for(var i=0; i < this.cells.length; i++){
var cell=this.cells[i];
if(cell.element==elem){
return cell;
}}
};
proto.getCells=function(elems){
elems=utils.makeArray(elems);
var cells=[];
elems.forEach(function(elem){
var cell=this.getCell(elem);
if(cell){
cells.push(cell);
}}, this);
return cells;
};
proto.getCellElements=function(){
return this.cells.map(function(cell){
return cell.element;
});
};
proto.getParentCell=function(elem){
var cell=this.getCell(elem);
if(cell){
return cell;
}
elem=utils.getParent(elem, '.flickity-slider > *');
return this.getCell(elem);
};
proto.getAdjacentCellElements=function(adjCount, index){
if(!adjCount){
return this.selectedSlide.getCellElements();
}
index=index===undefined ? this.selectedIndex:index;
var len=this.slides.length;
if(1 +(adjCount * 2) >=len){
return this.getCellElements();
}
var cellElems=[];
for(var i=index - adjCount; i <=index + adjCount ; i++){
var slideIndex=this.options.wrapAround ? utils.modulo(i, len):i;
var slide=this.slides[ slideIndex ];
if(slide){
cellElems=cellElems.concat(slide.getCellElements());
}}
return cellElems;
};
proto.uiChange=function(){
this.emitEvent('uiChange');
};
proto.childUIPointerDown=function(event){
this.emitEvent('childUIPointerDown', [ event ]);
};
proto.onresize=function(){
this.watchCSS();
this.resize();
};
utils.debounceMethod(Flickity, 'onresize', 150);
proto.resize=function(){
if(!this.isActive){
return;
}
this.getSize();
if(this.options.wrapAround){
this.x=utils.modulo(this.x, this.slideableWidth);
}
this.positionCells();
this._getWrapShiftCells();
this.setGallerySize();
this.emitEvent('resize');
var selectedElement=this.selectedElements&&this.selectedElements[0];
this.selectCell(selectedElement, false, true);
};
proto.watchCSS=function(){
var watchOption=this.options.watchCSS;
if(!watchOption){
return;
}
var afterContent=getComputedStyle(this.element, ':after').content;
if(afterContent.indexOf('flickity')!=-1){
this.activate();
}else{
this.deactivate();
}};
proto.onkeydown=function(event){
if(!this.options.accessibility ||
(document.activeElement&&document.activeElement!=this.element) ){
return;
}
if(event.keyCode==37){
var leftMethod=this.options.rightToLeft ? 'next':'previous';
this.uiChange();
this[ leftMethod ]();
}else if(event.keyCode==39){
var rightMethod=this.options.rightToLeft ? 'previous':'next';
this.uiChange();
this[ rightMethod ]();
}};
proto.deactivate=function(){
if(!this.isActive){
return;
}
this.element.classList.remove('flickity-enabled');
this.element.classList.remove('flickity-rtl');
this.cells.forEach(function(cell){
cell.destroy();
});
this.unselectSelectedSlide();
this.element.removeChild(this.viewport);
moveElements(this.slider.children, this.element);
if(this.options.accessibility){
this.element.removeAttribute('tabIndex');
this.element.removeEventListener('keydown', this);
}
this.isActive=false;
this.emitEvent('deactivate');
};
proto.destroy=function(){
this.deactivate();
window.removeEventListener('resize', this);
this.emitEvent('destroy');
if(jQuery&&this.$element){
jQuery.removeData(this.element, 'flickity');
}
delete this.element.flickityGUID;
delete instances[ this.guid ];
};
utils.extend(proto, animatePrototype);
Flickity.data=function(elem){
elem=utils.getQueryElement(elem);
var id=elem&&elem.flickityGUID;
return id&&instances[ id ];
};
utils.htmlInit(Flickity, 'flickity');
if(jQuery&&jQuery.bridget){
jQuery.bridget('flickity', Flickity);
}
Flickity.Cell=Cell;
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('unipointer/unipointer',[
'ev-emitter/ev-emitter'
], function(EvEmitter){
return factory(window, EvEmitter);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('ev-emitter')
);
}else{
window.Unipointer=factory(
window,
window.EvEmitter
);
}}(window, function factory(window, EvEmitter){
function noop(){}
function Unipointer(){}
var proto=Unipointer.prototype=Object.create(EvEmitter.prototype);
proto.bindStartEvent=function(elem){
this._bindStartEvent(elem, true);
};
proto.unbindStartEvent=function(elem){
this._bindStartEvent(elem, false);
};
proto._bindStartEvent=function(elem, isBind){
isBind=isBind===undefined ? true:!!isBind;
var bindMethod=isBind ? 'addEventListener':'removeEventListener';
if(window.navigator.pointerEnabled){
elem[ bindMethod ]('pointerdown', this);
}else if(window.navigator.msPointerEnabled){
elem[ bindMethod ]('MSPointerDown', this);
}else{
elem[ bindMethod ]('mousedown', this);
elem[ bindMethod ]('touchstart', this);
}};
proto.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
proto.getTouch=function(touches){
for(var i=0; i < touches.length; i++){
var touch=touches[i];
if(touch.identifier==this.pointerIdentifier){
return touch;
}}
};
proto.onmousedown=function(event){
var button=event.button;
if(button&&(button!==0&&button!==1) ){
return;
}
this._pointerDown(event, event);
};
proto.ontouchstart=function(event){
this._pointerDown(event, event.changedTouches[0]);
};
proto.onMSPointerDown =
proto.onpointerdown=function(event){
this._pointerDown(event, event);
};
proto._pointerDown=function(event, pointer){
if(this.isPointerDown){
return;
}
this.isPointerDown=true;
this.pointerIdentifier=pointer.pointerId!==undefined ?
pointer.pointerId:pointer.identifier;
this.pointerDown(event, pointer);
};
proto.pointerDown=function(event, pointer){
this._bindPostStartEvents(event);
this.emitEvent('pointerDown', [ event, pointer ]);
};
var postStartEvents={
mousedown: [ 'mousemove', 'mouseup' ],
touchstart: [ 'touchmove', 'touchend', 'touchcancel' ],
pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ],
MSPointerDown: [ 'MSPointerMove', 'MSPointerUp', 'MSPointerCancel' ]
};
proto._bindPostStartEvents=function(event){
if(!event){
return;
}
var events=postStartEvents[ event.type ];
events.forEach(function(eventName){
window.addEventListener(eventName, this);
}, this);
this._boundPointerEvents=events;
};
proto._unbindPostStartEvents=function(){
if(!this._boundPointerEvents){
return;
}
this._boundPointerEvents.forEach(function(eventName){
window.removeEventListener(eventName, this);
}, this);
delete this._boundPointerEvents;
};
proto.onmousemove=function(event){
this._pointerMove(event, event);
};
proto.onMSPointerMove =
proto.onpointermove=function(event){
if(event.pointerId==this.pointerIdentifier){
this._pointerMove(event, event);
}};
proto.ontouchmove=function(event){
var touch=this.getTouch(event.changedTouches);
if(touch){
this._pointerMove(event, touch);
}};
proto._pointerMove=function(event, pointer){
this.pointerMove(event, pointer);
};
proto.pointerMove=function(event, pointer){
this.emitEvent('pointerMove', [ event, pointer ]);
};
proto.onmouseup=function(event){
this._pointerUp(event, event);
};
proto.onMSPointerUp =
proto.onpointerup=function(event){
if(event.pointerId==this.pointerIdentifier){
this._pointerUp(event, event);
}};
proto.ontouchend=function(event){
var touch=this.getTouch(event.changedTouches);
if(touch){
this._pointerUp(event, touch);
}};
proto._pointerUp=function(event, pointer){
this._pointerDone();
this.pointerUp(event, pointer);
};
proto.pointerUp=function(event, pointer){
this.emitEvent('pointerUp', [ event, pointer ]);
};
proto._pointerDone=function(){
this.isPointerDown=false;
delete this.pointerIdentifier;
this._unbindPostStartEvents();
this.pointerDone();
};
proto.pointerDone=noop;
proto.onMSPointerCancel =
proto.onpointercancel=function(event){
if(event.pointerId==this.pointerIdentifier){
this._pointerCancel(event, event);
}};
proto.ontouchcancel=function(event){
var touch=this.getTouch(event.changedTouches);
if(touch){
this._pointerCancel(event, touch);
}};
proto._pointerCancel=function(event, pointer){
this._pointerDone();
this.pointerCancel(event, pointer);
};
proto.pointerCancel=function(event, pointer){
this.emitEvent('pointerCancel', [ event, pointer ]);
};
Unipointer.getPointerPoint=function(pointer){
return {
x: pointer.pageX,
y: pointer.pageY
};};
return Unipointer;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('unidragger/unidragger',[
'unipointer/unipointer'
], function(Unipointer){
return factory(window, Unipointer);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('unipointer')
);
}else{
window.Unidragger=factory(
window,
window.Unipointer
);
}}(window, function factory(window, Unipointer){
function noop(){}
function Unidragger(){}
var proto=Unidragger.prototype=Object.create(Unipointer.prototype);
proto.bindHandles=function(){
this._bindHandles(true);
};
proto.unbindHandles=function(){
this._bindHandles(false);
};
var navigator=window.navigator;
proto._bindHandles=function(isBind){
isBind=isBind===undefined ? true:!!isBind;
var binderExtra;
if(navigator.pointerEnabled){
binderExtra=function(handle){
handle.style.touchAction=isBind ? 'none':'';
};}else if(navigator.msPointerEnabled){
binderExtra=function(handle){
handle.style.msTouchAction=isBind ? 'none':'';
};}else{
binderExtra=noop;
}
var bindMethod=isBind ? 'addEventListener':'removeEventListener';
for(var i=0; i < this.handles.length; i++){
var handle=this.handles[i];
this._bindStartEvent(handle, isBind);
binderExtra(handle);
handle[ bindMethod ]('click', this);
}};
proto.pointerDown=function(event, pointer){
if(event.target.nodeName=='INPUT'&&event.target.type=='range'){
this.isPointerDown=false;
delete this.pointerIdentifier;
return;
}
this._dragPointerDown(event, pointer);
var focused=document.activeElement;
if(focused&&focused.blur){
focused.blur();
}
this._bindPostStartEvents(event);
this.emitEvent('pointerDown', [ event, pointer ]);
};
proto._dragPointerDown=function(event, pointer){
this.pointerDownPoint=Unipointer.getPointerPoint(pointer);
var canPreventDefault=this.canPreventDefaultOnPointerDown(event, pointer);
if(canPreventDefault){
event.preventDefault();
}};
proto.canPreventDefaultOnPointerDown=function(event){
return event.target.nodeName!='SELECT';
};
proto.pointerMove=function(event, pointer){
var moveVector=this._dragPointerMove(event, pointer);
this.emitEvent('pointerMove', [ event, pointer, moveVector ]);
this._dragMove(event, pointer, moveVector);
};
proto._dragPointerMove=function(event, pointer){
var movePoint=Unipointer.getPointerPoint(pointer);
var moveVector={
x: movePoint.x - this.pointerDownPoint.x,
y: movePoint.y - this.pointerDownPoint.y
};
if(!this.isDragging&&this.hasDragStarted(moveVector) ){
this._dragStart(event, pointer);
}
return moveVector;
};
proto.hasDragStarted=function(moveVector){
return Math.abs(moveVector.x) > 3||Math.abs(moveVector.y) > 3;
};
proto.pointerUp=function(event, pointer){
this.emitEvent('pointerUp', [ event, pointer ]);
this._dragPointerUp(event, pointer);
};
proto._dragPointerUp=function(event, pointer){
if(this.isDragging){
this._dragEnd(event, pointer);
}else{
this._staticClick(event, pointer);
}};
proto._dragStart=function(event, pointer){
this.isDragging=true;
this.dragStartPoint=Unipointer.getPointerPoint(pointer);
this.isPreventingClicks=true;
this.dragStart(event, pointer);
};
proto.dragStart=function(event, pointer){
this.emitEvent('dragStart', [ event, pointer ]);
};
proto._dragMove=function(event, pointer, moveVector){
if(!this.isDragging){
return;
}
this.dragMove(event, pointer, moveVector);
};
proto.dragMove=function(event, pointer, moveVector){
event.preventDefault();
this.emitEvent('dragMove', [ event, pointer, moveVector ]);
};
proto._dragEnd=function(event, pointer){
this.isDragging=false;
setTimeout(function(){
delete this.isPreventingClicks;
}.bind(this) );
this.dragEnd(event, pointer);
};
proto.dragEnd=function(event, pointer){
this.emitEvent('dragEnd', [ event, pointer ]);
};
proto.onclick=function(event){
if(this.isPreventingClicks){
event.preventDefault();
}};
proto._staticClick=function(event, pointer){
if(this.isIgnoringMouseUp&&event.type=='mouseup'){
return;
}
var nodeName=event.target.nodeName;
if(nodeName=='INPUT'||nodeName=='TEXTAREA'){
event.target.focus();
}
this.staticClick(event, pointer);
if(event.type!='mouseup'){
this.isIgnoringMouseUp=true;
setTimeout(function(){
delete this.isIgnoringMouseUp;
}.bind(this), 400);
}};
proto.staticClick=function(event, pointer){
this.emitEvent('staticClick', [ event, pointer ]);
};
Unidragger.getPointerPoint=Unipointer.getPointerPoint;
return Unidragger;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/drag',[
'./flickity',
'unidragger/unidragger',
'fizzy-ui-utils/utils'
], function(Flickity, Unidragger, utils){
return factory(window, Flickity, Unidragger, utils);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('./flickity'),
require('unidragger'),
require('fizzy-ui-utils')
);
}else{
window.Flickity=factory(
window,
window.Flickity,
window.Unidragger,
window.fizzyUIUtils
);
}}(window, function factory(window, Flickity, Unidragger, utils){
utils.extend(Flickity.defaults, {
draggable: true,
dragThreshold: 3,
});
Flickity.createMethods.push('_createDrag');
var proto=Flickity.prototype;
utils.extend(proto, Unidragger.prototype);
var isTouch='createTouch' in document;
var isTouchmoveScrollCanceled=false;
proto._createDrag=function(){
this.on('activate', this.bindDrag);
this.on('uiChange', this._uiChangeDrag);
this.on('childUIPointerDown', this._childUIPointerDownDrag);
this.on('deactivate', this.unbindDrag);
if(isTouch&&!isTouchmoveScrollCanceled){
window.addEventListener('touchmove', function(){});
isTouchmoveScrollCanceled=true;
}};
proto.bindDrag=function(){
if(!this.options.draggable||this.isDragBound){
return;
}
this.element.classList.add('is-draggable');
this.handles=[ this.viewport ];
this.bindHandles();
this.isDragBound=true;
};
proto.unbindDrag=function(){
if(!this.isDragBound){
return;
}
this.element.classList.remove('is-draggable');
this.unbindHandles();
delete this.isDragBound;
};
proto._uiChangeDrag=function(){
delete this.isFreeScrolling;
};
proto._childUIPointerDownDrag=function(event){
event.preventDefault();
this.pointerDownFocus(event);
};
var cursorNodes={
TEXTAREA: true,
INPUT: true,
OPTION: true,
};
var clickTypes={
radio: true,
checkbox: true,
button: true,
submit: true,
image: true,
file: true,
};
proto.pointerDown=function(event, pointer){
var isCursorInput=cursorNodes[ event.target.nodeName ] &&
!clickTypes[ event.target.type ];
if(isCursorInput){
this.isPointerDown=false;
delete this.pointerIdentifier;
return;
}
this._dragPointerDown(event, pointer);
var focused=document.activeElement;
if(focused&&focused.blur&&focused!=this.element &&
focused!=document.body){
focused.blur();
}
this.pointerDownFocus(event);
this.dragX=this.x;
this.viewport.classList.add('is-pointer-down');
this._bindPostStartEvents(event);
this.pointerDownScroll=getScrollPosition();
window.addEventListener('scroll', this);
this.dispatchEvent('pointerDown', event, [ pointer ]);
};
var touchStartEvents={
touchstart: true,
MSPointerDown: true
};
var focusNodes={
INPUT: true,
SELECT: true
};
proto.pointerDownFocus=function(event){
if(!this.options.accessibility||touchStartEvents[ event.type ] ||
focusNodes[ event.target.nodeName ]){
return;
}
var prevScrollY=window.pageYOffset;
this.element.focus();
if(window.pageYOffset!=prevScrollY){
window.scrollTo(window.pageXOffset, prevScrollY);
}};
proto.canPreventDefaultOnPointerDown=function(event){
var isTouchstart=event.type=='touchstart';
var targetNodeName=event.target.nodeName;
return !isTouchstart&&targetNodeName!='SELECT';
};
proto.hasDragStarted=function(moveVector){
return Math.abs(moveVector.x) > this.options.dragThreshold;
};
proto.pointerUp=function(event, pointer){
delete this.isTouchScrolling;
this.viewport.classList.remove('is-pointer-down');
this.dispatchEvent('pointerUp', event, [ pointer ]);
this._dragPointerUp(event, pointer);
};
proto.pointerDone=function(){
window.removeEventListener('scroll', this);
delete this.pointerDownScroll;
};
proto.dragStart=function(event, pointer){
this.dragStartPosition=this.x;
this.startAnimation();
window.removeEventListener('scroll', this);
this.dispatchEvent('dragStart', event, [ pointer ]);
};
proto.pointerMove=function(event, pointer){
var moveVector=this._dragPointerMove(event, pointer);
this.dispatchEvent('pointerMove', event, [ pointer, moveVector ]);
this._dragMove(event, pointer, moveVector);
};
proto.dragMove=function(event, pointer, moveVector){
event.preventDefault();
this.previousDragX=this.dragX;
var direction=this.options.rightToLeft ? -1:1;
var dragX=this.dragStartPosition + moveVector.x * direction;
if(!this.options.wrapAround&&this.slides.length){
var originBound=Math.max(-this.slides[0].target, this.dragStartPosition);
dragX=dragX > originBound ?(dragX + originBound) * 0.5:dragX;
var endBound=Math.min(-this.getLastSlide().target, this.dragStartPosition);
dragX=dragX < endBound ?(dragX + endBound) * 0.5:dragX;
}
this.dragX=dragX;
this.dragMoveTime=new Date();
this.dispatchEvent('dragMove', event, [ pointer, moveVector ]);
};
proto.dragEnd=function(event, pointer){
if(this.options.freeScroll){
this.isFreeScrolling=true;
}
var index=this.dragEndRestingSelect();
if(this.options.freeScroll&&!this.options.wrapAround){
var restingX=this.getRestingPosition();
this.isFreeScrolling=-restingX > this.slides[0].target &&
-restingX < this.getLastSlide().target;
}else if(!this.options.freeScroll&&index==this.selectedIndex){
index +=this.dragEndBoostSelect();
}
delete this.previousDragX;
this.isDragSelect=this.options.wrapAround;
this.select(index);
delete this.isDragSelect;
this.dispatchEvent('dragEnd', event, [ pointer ]);
};
proto.dragEndRestingSelect=function(){
var restingX=this.getRestingPosition();
var distance=Math.abs(this.getSlideDistance(-restingX, this.selectedIndex) );
var positiveResting=this._getClosestResting(restingX, distance, 1);
var negativeResting=this._getClosestResting(restingX, distance, -1);
var index=positiveResting.distance < negativeResting.distance ?
positiveResting.index:negativeResting.index;
return index;
};
proto._getClosestResting=function(restingX, distance, increment){
var index=this.selectedIndex;
var minDistance=Infinity;
var condition=this.options.contain&&!this.options.wrapAround ?
function(d, md){ return d <=md; }:function(d, md){ return d < md; };
while(condition(distance, minDistance) ){
index +=increment;
minDistance=distance;
distance=this.getSlideDistance(-restingX, index);
if(distance===null){
break;
}
distance=Math.abs(distance);
}
return {
distance: minDistance,
index: index - increment
};};
proto.getSlideDistance=function(x, index){
var len=this.slides.length;
var isWrapAround=this.options.wrapAround&&len > 1;
var slideIndex=isWrapAround ? utils.modulo(index, len):index;
var slide=this.slides[ slideIndex ];
if(!slide){
return null;
}
var wrap=isWrapAround ? this.slideableWidth * Math.floor(index / len):0;
return x -(slide.target + wrap);
};
proto.dragEndBoostSelect=function(){
if(this.previousDragX===undefined||!this.dragMoveTime ||
new Date() - this.dragMoveTime > 100){
return 0;
}
var distance=this.getSlideDistance(-this.dragX, this.selectedIndex);
var delta=this.previousDragX - this.dragX;
if(distance > 0&&delta > 0){
return 1;
}else if(distance < 0&&delta < 0){
return -1;
}
return 0;
};
proto.staticClick=function(event, pointer){
var clickedCell=this.getParentCell(event.target);
var cellElem=clickedCell&&clickedCell.element;
var cellIndex=clickedCell&&this.cells.indexOf(clickedCell);
this.dispatchEvent('staticClick', event, [ pointer, cellElem, cellIndex ]);
};
proto.onscroll=function(){
var scroll=getScrollPosition();
var scrollMoveX=this.pointerDownScroll.x - scroll.x;
var scrollMoveY=this.pointerDownScroll.y - scroll.y;
if(Math.abs(scrollMoveX) > 3||Math.abs(scrollMoveY) > 3){
this._pointerDone();
}};
function getScrollPosition(){
return {
x: window.pageXOffset,
y: window.pageYOffset
};}
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('tap-listener/tap-listener',[
'unipointer/unipointer'
], function(Unipointer){
return factory(window, Unipointer);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('unipointer')
);
}else{
window.TapListener=factory(
window,
window.Unipointer
);
}}(window, function factory(window, Unipointer){
function TapListener(elem){
this.bindTap(elem);
}
var proto=TapListener.prototype=Object.create(Unipointer.prototype);
proto.bindTap=function(elem){
if(!elem){
return;
}
this.unbindTap();
this.tapElement=elem;
this._bindStartEvent(elem, true);
};
proto.unbindTap=function(){
if(!this.tapElement){
return;
}
this._bindStartEvent(this.tapElement, true);
delete this.tapElement;
};
proto.pointerUp=function(event, pointer){
if(this.isIgnoringMouseUp&&event.type=='mouseup'){
return;
}
var pointerPoint=Unipointer.getPointerPoint(pointer);
var boundingRect=this.tapElement.getBoundingClientRect();
var scrollX=window.pageXOffset;
var scrollY=window.pageYOffset;
var isInside=pointerPoint.x >=boundingRect.left + scrollX &&
pointerPoint.x <=boundingRect.right + scrollX &&
pointerPoint.y >=boundingRect.top + scrollY &&
pointerPoint.y <=boundingRect.bottom + scrollY;
if(isInside){
this.emitEvent('tap', [ event, pointer ]);
}
if(event.type!='mouseup'){
this.isIgnoringMouseUp=true;
var _this=this;
setTimeout(function(){
delete _this.isIgnoringMouseUp;
}, 400);
}};
proto.destroy=function(){
this.pointerDone();
this.unbindTap();
};
return TapListener;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/prev-next-button',[
'./flickity',
'tap-listener/tap-listener',
'fizzy-ui-utils/utils'
], function(Flickity, TapListener, utils){
return factory(window, Flickity, TapListener, utils);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('./flickity'),
require('tap-listener'),
require('fizzy-ui-utils')
);
}else{
factory(
window,
window.Flickity,
window.TapListener,
window.fizzyUIUtils
);
}}(window, function factory(window, Flickity, TapListener, utils){
'use strict';
var svgURI='http://www.w3.org/2000/svg';
function PrevNextButton(direction, parent){
this.direction=direction;
this.parent=parent;
this._create();
}
PrevNextButton.prototype=new TapListener();
PrevNextButton.prototype._create=function(){
this.isEnabled=true;
this.isPrevious=this.direction==-1;
var leftDirection=this.parent.options.rightToLeft ? 1:-1;
this.isLeft=this.direction==leftDirection;
var element=this.element=document.createElement('button');
element.className='flickity-prev-next-button';
element.className +=this.isPrevious ? ' previous':' next';
element.setAttribute('type', 'button');
this.disable();
element.setAttribute('aria-label', this.isPrevious ? 'previous':'next');
var svg=this.createSVG();
element.appendChild(svg);
this.on('tap', this.onTap);
this.parent.on('select', this.update.bind(this) );
this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent) );
};
PrevNextButton.prototype.activate=function(){
this.bindTap(this.element);
this.element.addEventListener('click', this);
this.parent.element.appendChild(this.element);
};
PrevNextButton.prototype.deactivate=function(){
this.parent.element.removeChild(this.element);
TapListener.prototype.destroy.call(this);
this.element.removeEventListener('click', this);
};
PrevNextButton.prototype.createSVG=function(){
var svg=document.createElementNS(svgURI, 'svg');
svg.setAttribute('viewBox', '0 0 100 100');
var path=document.createElementNS(svgURI, 'path');
var pathMovements=getArrowMovements(this.parent.options.arrowShape);
path.setAttribute('d', pathMovements);
path.setAttribute('class', 'arrow');
if(!this.isLeft){
path.setAttribute('transform', 'translate(100, 100) rotate(180) ');
}
svg.appendChild(path);
return svg;
};
function getArrowMovements(shape){
if(typeof shape=='string'){
return shape;
}
return 'M ' + shape.x0 + ',50' +
' L ' + shape.x1 + ',' +(shape.y1 + 50) +
' L ' + shape.x2 + ',' +(shape.y2 + 50) +
' L ' + shape.x3 + ',50 ' +
' L ' + shape.x2 + ',' +(50 - shape.y2) +
' L ' + shape.x1 + ',' +(50 - shape.y1) +
' Z';
}
PrevNextButton.prototype.onTap=function(){
if(!this.isEnabled){
return;
}
this.parent.uiChange();
var method=this.isPrevious ? 'previous':'next';
this.parent[ method ]();
};
PrevNextButton.prototype.handleEvent=utils.handleEvent;
PrevNextButton.prototype.onclick=function(){
var focused=document.activeElement;
if(focused&&focused==this.element){
this.onTap();
}};
PrevNextButton.prototype.enable=function(){
if(this.isEnabled){
return;
}
this.element.disabled=false;
this.isEnabled=true;
};
PrevNextButton.prototype.disable=function(){
if(!this.isEnabled){
return;
}
this.element.disabled=true;
this.isEnabled=false;
};
PrevNextButton.prototype.update=function(){
var slides=this.parent.slides;
if(this.parent.options.wrapAround&&slides.length > 1){
this.enable();
return;
}
var lastIndex=slides.length ? slides.length - 1:0;
var boundIndex=this.isPrevious ? 0:lastIndex;
var method=this.parent.selectedIndex==boundIndex ? 'disable':'enable';
this[ method ]();
};
PrevNextButton.prototype.destroy=function(){
this.deactivate();
};
utils.extend(Flickity.defaults, {
prevNextButtons: true,
arrowShape: {
x0: 10,
x1: 60, y1: 50,
x2: 70, y2: 40,
x3: 30
}});
Flickity.createMethods.push('_createPrevNextButtons');
var proto=Flickity.prototype;
proto._createPrevNextButtons=function(){
if(!this.options.prevNextButtons){
return;
}
this.prevButton=new PrevNextButton(-1, this);
this.nextButton=new PrevNextButton(1, this);
this.on('activate', this.activatePrevNextButtons);
};
proto.activatePrevNextButtons=function(){
this.prevButton.activate();
this.nextButton.activate();
this.on('deactivate', this.deactivatePrevNextButtons);
};
proto.deactivatePrevNextButtons=function(){
this.prevButton.deactivate();
this.nextButton.deactivate();
this.off('deactivate', this.deactivatePrevNextButtons);
};
Flickity.PrevNextButton=PrevNextButton;
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/page-dots',[
'./flickity',
'tap-listener/tap-listener',
'fizzy-ui-utils/utils'
], function(Flickity, TapListener, utils){
return factory(window, Flickity, TapListener, utils);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('./flickity'),
require('tap-listener'),
require('fizzy-ui-utils')
);
}else{
factory(
window,
window.Flickity,
window.TapListener,
window.fizzyUIUtils
);
}}(window, function factory(window, Flickity, TapListener, utils){
function PageDots(parent){
this.parent=parent;
this._create();
}
PageDots.prototype=new TapListener();
PageDots.prototype._create=function(){
this.holder=document.createElement('ol');
this.holder.className='flickity-page-dots';
this.dots=[];
this.on('tap', this.onTap);
this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent) );
};
PageDots.prototype.activate=function(){
this.setDots();
this.bindTap(this.holder);
this.parent.element.appendChild(this.holder);
};
PageDots.prototype.deactivate=function(){
this.parent.element.removeChild(this.holder);
TapListener.prototype.destroy.call(this);
};
PageDots.prototype.setDots=function(){
var delta=this.parent.slides.length - this.dots.length;
if(delta > 0){
this.addDots(delta);
}else if(delta < 0){
this.removeDots(-delta);
}};
PageDots.prototype.addDots=function(count){
var fragment=document.createDocumentFragment();
var newDots=[];
while(count){
var dot=document.createElement('li');
dot.className='dot';
fragment.appendChild(dot);
newDots.push(dot);
count--;
}
this.holder.appendChild(fragment);
this.dots=this.dots.concat(newDots);
};
PageDots.prototype.removeDots=function(count){
var removeDots=this.dots.splice(this.dots.length - count, count);
removeDots.forEach(function(dot){
this.holder.removeChild(dot);
}, this);
};
PageDots.prototype.updateSelected=function(){
if(this.selectedDot){
this.selectedDot.className='dot';
}
if(!this.dots.length){
return;
}
this.selectedDot=this.dots[ this.parent.selectedIndex ];
this.selectedDot.className='dot is-selected';
};
PageDots.prototype.onTap=function(event){
var target=event.target;
if(target.nodeName!='LI'){
return;
}
this.parent.uiChange();
var index=this.dots.indexOf(target);
this.parent.select(index);
};
PageDots.prototype.destroy=function(){
this.deactivate();
};
Flickity.PageDots=PageDots;
utils.extend(Flickity.defaults, {
pageDots: true
});
Flickity.createMethods.push('_createPageDots');
var proto=Flickity.prototype;
proto._createPageDots=function(){
if(!this.options.pageDots){
return;
}
this.pageDots=new PageDots(this);
this.on('activate', this.activatePageDots);
this.on('select', this.updateSelectedPageDots);
this.on('cellChange', this.updatePageDots);
this.on('resize', this.updatePageDots);
this.on('deactivate', this.deactivatePageDots);
};
proto.activatePageDots=function(){
this.pageDots.activate();
};
proto.updateSelectedPageDots=function(){
this.pageDots.updateSelected();
};
proto.updatePageDots=function(){
this.pageDots.setDots();
};
proto.deactivatePageDots=function(){
this.pageDots.deactivate();
};
Flickity.PageDots=PageDots;
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/player',[
'ev-emitter/ev-emitter',
'fizzy-ui-utils/utils',
'./flickity'
], function(EvEmitter, utils, Flickity){
return factory(EvEmitter, utils, Flickity);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('ev-emitter'),
require('fizzy-ui-utils'),
require('./flickity')
);
}else{
factory(
window.EvEmitter,
window.fizzyUIUtils,
window.Flickity
);
}}(window, function factory(EvEmitter, utils, Flickity){
var hiddenProperty, visibilityEvent;
if('hidden' in document){
hiddenProperty='hidden';
visibilityEvent='visibilitychange';
}else if('webkitHidden' in document){
hiddenProperty='webkitHidden';
visibilityEvent='webkitvisibilitychange';
}
function Player(parent){
this.parent=parent;
this.state='stopped';
if(visibilityEvent){
this.onVisibilityChange=function(){
this.visibilityChange();
}.bind(this);
this.onVisibilityPlay=function(){
this.visibilityPlay();
}.bind(this);
}}
Player.prototype=Object.create(EvEmitter.prototype);
Player.prototype.play=function(){
if(this.state=='playing'){
return;
}
var isPageHidden=document[ hiddenProperty ];
if(visibilityEvent&&isPageHidden){
document.addEventListener(visibilityEvent, this.onVisibilityPlay);
return;
}
this.state='playing';
if(visibilityEvent){
document.addEventListener(visibilityEvent, this.onVisibilityChange);
}
this.tick();
};
Player.prototype.tick=function(){
if(this.state!='playing'){
return;
}
var time=this.parent.options.autoPlay;
time=typeof time=='number' ? time:3000;
var _this=this;
this.clear();
this.timeout=setTimeout(function(){
_this.parent.next(true);
_this.tick();
}, time);
};
Player.prototype.stop=function(){
this.state='stopped';
this.clear();
if(visibilityEvent){
document.removeEventListener(visibilityEvent, this.onVisibilityChange);
}};
Player.prototype.clear=function(){
clearTimeout(this.timeout);
};
Player.prototype.pause=function(){
if(this.state=='playing'){
this.state='paused';
this.clear();
}};
Player.prototype.unpause=function(){
if(this.state=='paused'){
this.play();
}};
Player.prototype.visibilityChange=function(){
var isPageHidden=document[ hiddenProperty ];
this[ isPageHidden ? 'pause':'unpause' ]();
};
Player.prototype.visibilityPlay=function(){
this.play();
document.removeEventListener(visibilityEvent, this.onVisibilityPlay);
};
utils.extend(Flickity.defaults, {
pauseAutoPlayOnHover: true
});
Flickity.createMethods.push('_createPlayer');
var proto=Flickity.prototype;
proto._createPlayer=function(){
this.player=new Player(this);
this.on('activate', this.activatePlayer);
this.on('uiChange', this.stopPlayer);
this.on('pointerDown', this.stopPlayer);
this.on('deactivate', this.deactivatePlayer);
};
proto.activatePlayer=function(){
if(!this.options.autoPlay){
return;
}
this.player.play();
this.element.addEventListener('mouseenter', this);
};
proto.playPlayer=function(){
this.player.play();
};
proto.stopPlayer=function(){
this.player.stop();
};
proto.pausePlayer=function(){
this.player.pause();
};
proto.unpausePlayer=function(){
this.player.unpause();
};
proto.deactivatePlayer=function(){
this.player.stop();
this.element.removeEventListener('mouseenter', this);
};
proto.onmouseenter=function(){
if(!this.options.pauseAutoPlayOnHover){
return;
}
this.player.pause();
this.element.addEventListener('mouseleave', this);
};
proto.onmouseleave=function(){
this.player.unpause();
this.element.removeEventListener('mouseleave', this);
};
Flickity.Player=Player;
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/add-remove-cell',[
'./flickity',
'fizzy-ui-utils/utils'
], function(Flickity, utils){
return factory(window, Flickity, utils);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('./flickity'),
require('fizzy-ui-utils')
);
}else{
factory(
window,
window.Flickity,
window.fizzyUIUtils
);
}}(window, function factory(window, Flickity, utils){
function getCellsFragment(cells){
var fragment=document.createDocumentFragment();
cells.forEach(function(cell){
fragment.appendChild(cell.element);
});
return fragment;
}
var proto=Flickity.prototype;
proto.insert=function(elems, index){
var cells=this._makeCells(elems);
if(!cells||!cells.length){
return;
}
var len=this.cells.length;
index=index===undefined ? len:index;
var fragment=getCellsFragment(cells);
var isAppend=index==len;
if(isAppend){
this.slider.appendChild(fragment);
}else{
var insertCellElement=this.cells[ index ].element;
this.slider.insertBefore(fragment, insertCellElement);
}
if(index===0){
this.cells=cells.concat(this.cells);
}else if(isAppend){
this.cells=this.cells.concat(cells);
}else{
var endCells=this.cells.splice(index, len - index);
this.cells=this.cells.concat(cells).concat(endCells);
}
this._sizeCells(cells);
var selectedIndexDelta=index > this.selectedIndex ? 0:cells.length;
this._cellAddedRemoved(index, selectedIndexDelta);
};
proto.append=function(elems){
this.insert(elems, this.cells.length);
};
proto.prepend=function(elems){
this.insert(elems, 0);
};
proto.remove=function(elems){
var cells=this.getCells(elems);
var selectedIndexDelta=0;
var len=cells.length;
var i, cell;
for(i=0; i < len; i++){
cell=cells[i];
var wasBefore=this.cells.indexOf(cell) < this.selectedIndex;
selectedIndexDelta -=wasBefore ? 1:0;
}
for(i=0; i < len; i++){
cell=cells[i];
cell.remove();
utils.removeFrom(this.cells, cell);
}
if(cells.length){
this._cellAddedRemoved(0, selectedIndexDelta);
}};
proto._cellAddedRemoved=function(changedCellIndex, selectedIndexDelta){
selectedIndexDelta=selectedIndexDelta||0;
this.selectedIndex +=selectedIndexDelta;
this.selectedIndex=Math.max(0, Math.min(this.slides.length - 1, this.selectedIndex) );
this.cellChange(changedCellIndex, true);
this.emitEvent('cellAddedRemoved', [ changedCellIndex, selectedIndexDelta ]);
};
proto.cellSizeChange=function(elem){
var cell=this.getCell(elem);
if(!cell){
return;
}
cell.getSize();
var index=this.cells.indexOf(cell);
this.cellChange(index);
};
proto.cellChange=function(changedCellIndex, isPositioningSlider){
var prevSlideableWidth=this.slideableWidth;
this._positionCells(changedCellIndex);
this._getWrapShiftCells();
this.setGallerySize();
this.emitEvent('cellChange', [ changedCellIndex ]);
if(this.options.freeScroll){
var deltaX=prevSlideableWidth - this.slideableWidth;
this.x +=deltaX * this.cellAlign;
this.positionSlider();
}else{
if(isPositioningSlider){
this.positionSliderAtSelected();
}
this.select(this.selectedIndex);
}};
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/lazyload',[
'./flickity',
'fizzy-ui-utils/utils'
], function(Flickity, utils){
return factory(window, Flickity, utils);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('./flickity'),
require('fizzy-ui-utils')
);
}else{
factory(
window,
window.Flickity,
window.fizzyUIUtils
);
}}(window, function factory(window, Flickity, utils){
'use strict';
Flickity.createMethods.push('_createLazyload');
var proto=Flickity.prototype;
proto._createLazyload=function(){
this.on('select', this.lazyLoad);
};
proto.lazyLoad=function(){
var lazyLoad=this.options.lazyLoad;
if(!lazyLoad){
return;
}
var adjCount=typeof lazyLoad=='number' ? lazyLoad:0;
var cellElems=this.getAdjacentCellElements(adjCount);
var lazyImages=[];
cellElems.forEach(function(cellElem){
var lazyCellImages=getCellLazyImages(cellElem);
lazyImages=lazyImages.concat(lazyCellImages);
});
lazyImages.forEach(function(img){
new LazyLoader(img, this);
}, this);
};
function getCellLazyImages(cellElem){
if(cellElem.nodeName=='IMG' &&
cellElem.getAttribute('data-flickity-lazyload')){
return [ cellElem ];
}
var imgs=cellElem.querySelectorAll('img[data-flickity-lazyload]');
return utils.makeArray(imgs);
}
function LazyLoader(img, flickity){
this.img=img;
this.flickity=flickity;
this.load();
}
LazyLoader.prototype.handleEvent=utils.handleEvent;
LazyLoader.prototype.load=function(){
this.img.addEventListener('load', this);
this.img.addEventListener('error', this);
this.img.src=this.img.getAttribute('data-flickity-lazyload');
this.img.removeAttribute('data-flickity-lazyload');
};
LazyLoader.prototype.onload=function(event){
this.complete(event, 'flickity-lazyloaded');
};
LazyLoader.prototype.onerror=function(event){
this.complete(event, 'flickity-lazyerror');
};
LazyLoader.prototype.complete=function(event, className){
this.img.removeEventListener('load', this);
this.img.removeEventListener('error', this);
var cell=this.flickity.getParentCell(this.img);
var cellElem=cell&&cell.element;
this.flickity.cellSizeChange(cellElem);
this.img.classList.add(className);
this.flickity.dispatchEvent('lazyLoad', event, cellElem);
};
Flickity.LazyLoader=LazyLoader;
return Flickity;
}));
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity/js/index',[
'./flickity',
'./drag',
'./prev-next-button',
'./page-dots',
'./player',
'./add-remove-cell',
'./lazyload'
], factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('./flickity'),
require('./drag'),
require('./prev-next-button'),
require('./page-dots'),
require('./player'),
require('./add-remove-cell'),
require('./lazyload')
);
}})(window, function factory(Flickity){
return Flickity;
});
(function(window, factory){
if(typeof define=='function'&&define.amd){
define('flickity-as-nav-for/as-nav-for',[
'flickity/js/index',
'fizzy-ui-utils/utils'
], factory);
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
require('flickity'),
require('fizzy-ui-utils')
);
}else{
window.Flickity=factory(
window.Flickity,
window.fizzyUIUtils
);
}}(window, function factory(Flickity, utils){
Flickity.createMethods.push('_createAsNavFor');
var proto=Flickity.prototype;
proto._createAsNavFor=function(){
this.on('activate', this.activateAsNavFor);
this.on('deactivate', this.deactivateAsNavFor);
this.on('destroy', this.destroyAsNavFor);
var asNavForOption=this.options.asNavFor;
if(!asNavForOption){
return;
}
var _this=this;
setTimeout(function initNavCompanion(){
_this.setNavCompanion(asNavForOption);
});
};
proto.setNavCompanion=function(elem){
elem=utils.getQueryElement(elem);
var companion=Flickity.data(elem);
if(!companion||companion==this){
return;
}
this.navCompanion=companion;
var _this=this;
this.onNavCompanionSelect=function(){
_this.navCompanionSelect();
};
companion.on('select', this.onNavCompanionSelect);
this.on('staticClick', this.onNavStaticClick);
this.navCompanionSelect(true);
};
proto.navCompanionSelect=function(isInstant){
if(!this.navCompanion){
return;
}
var selectedCell=this.navCompanion.selectedCells[0];
var firstIndex=this.navCompanion.cells.indexOf(selectedCell);
var lastIndex=firstIndex + this.navCompanion.selectedCells.length - 1;
var selectIndex=Math.floor(lerp(firstIndex, lastIndex,
this.navCompanion.cellAlign) );
this.selectCell(selectIndex, false, isInstant);
this.removeNavSelectedElements();
if(selectIndex >=this.cells.length){
return;
}
var selectedCells=this.cells.slice(firstIndex, lastIndex + 1);
this.navSelectedElements=selectedCells.map(function(cell){
return cell.element;
});
this.changeNavSelectedClass('add');
};
function lerp(a, b, t){
return(b - a) * t + a;
}
proto.changeNavSelectedClass=function(method){
this.navSelectedElements.forEach(function(navElem){
navElem.classList[ method ]('is-nav-selected');
});
};
proto.activateAsNavFor=function(){
this.navCompanionSelect(true);
};
proto.removeNavSelectedElements=function(){
if(!this.navSelectedElements){
return;
}
this.changeNavSelectedClass('remove');
delete this.navSelectedElements;
};
proto.onNavStaticClick=function(event, pointer, cellElement, cellIndex){
if(typeof cellIndex=='number'){
this.navCompanion.selectCell(cellIndex);
}};
proto.deactivateAsNavFor=function(){
this.removeNavSelectedElements();
};
proto.destroyAsNavFor=function(){
if(!this.navCompanion){
return;
}
this.navCompanion.off('select', this.onNavCompanionSelect);
this.off('staticClick', this.onNavStaticClick);
delete this.navCompanion;
};
return Flickity;
}));
(function(window, factory){ 'use strict';
if(typeof define=='function'&&define.amd){
define('imagesloaded/imagesloaded',[
'ev-emitter/ev-emitter'
], function(EvEmitter){
return factory(window, EvEmitter);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('ev-emitter')
);
}else{
window.imagesLoaded=factory(
window,
window.EvEmitter
);
}})(window,
function factory(window, EvEmitter){
var $=window.jQuery;
var console=window.console;
function extend(a, b){
for(var prop in b){
a[ prop ]=b[ prop ];
}
return a;
}
function makeArray(obj){
var ary=[];
if(Array.isArray(obj) ){
ary=obj;
}else if(typeof obj.length=='number'){
for(var i=0; i < obj.length; i++){
ary.push(obj[i]);
}}else{
ary.push(obj);
}
return ary;
}
function ImagesLoaded(elem, options, onAlways){
if(!(this instanceof ImagesLoaded) ){
return new ImagesLoaded(elem, options, onAlways);
}
if(typeof elem=='string'){
elem=document.querySelectorAll(elem);
}
this.elements=makeArray(elem);
this.options=extend( {}, this.options);
if(typeof options=='function'){
onAlways=options;
}else{
extend(this.options, options);
}
if(onAlways){
this.on('always', onAlways);
}
this.getImages();
if($){
this.jqDeferred=new $.Deferred();
}
setTimeout(function(){
this.check();
}.bind(this));
}
ImagesLoaded.prototype=Object.create(EvEmitter.prototype);
ImagesLoaded.prototype.options={};
ImagesLoaded.prototype.getImages=function(){
this.images=[];
this.elements.forEach(this.addElementImages, this);
};
ImagesLoaded.prototype.addElementImages=function(elem){
if(elem.nodeName=='IMG'){
this.addImage(elem);
}
if(this.options.background===true){
this.addElementBackgroundImages(elem);
}
var nodeType=elem.nodeType;
if(!nodeType||!elementNodeTypes[ nodeType ]){
return;
}
var childImgs=elem.querySelectorAll('img');
for(var i=0; i < childImgs.length; i++){
var img=childImgs[i];
this.addImage(img);
}
if(typeof this.options.background=='string'){
var children=elem.querySelectorAll(this.options.background);
for(i=0; i < children.length; i++){
var child=children[i];
this.addElementBackgroundImages(child);
}}
};
var elementNodeTypes={
1: true,
9: true,
11: true
};
ImagesLoaded.prototype.addElementBackgroundImages=function(elem){
var style=getComputedStyle(elem);
if(!style){
return;
}
var reURL=/url\((['"])?(.*?)\1\)/gi;
var matches=reURL.exec(style.backgroundImage);
while(matches!==null){
var url=matches&&matches[2];
if(url){
this.addBackground(url, elem);
}
matches=reURL.exec(style.backgroundImage);
}};
ImagesLoaded.prototype.addImage=function(img){
var loadingImage=new LoadingImage(img);
this.images.push(loadingImage);
};
ImagesLoaded.prototype.addBackground=function(url, elem){
var background=new Background(url, elem);
this.images.push(background);
};
ImagesLoaded.prototype.check=function(){
var _this=this;
this.progressedCount=0;
this.hasAnyBroken=false;
if(!this.images.length){
this.complete();
return;
}
function onProgress(image, elem, message){
setTimeout(function(){
_this.progress(image, elem, message);
});
}
this.images.forEach(function(loadingImage){
loadingImage.once('progress', onProgress);
loadingImage.check();
});
};
ImagesLoaded.prototype.progress=function(image, elem, message){
this.progressedCount++;
this.hasAnyBroken=this.hasAnyBroken||!image.isLoaded;
this.emitEvent('progress', [ this, image, elem ]);
if(this.jqDeferred&&this.jqDeferred.notify){
this.jqDeferred.notify(this, image);
}
if(this.progressedCount==this.images.length){
this.complete();
}
if(this.options.debug&&console){
console.log('progress: ' + message, image, elem);
}};
ImagesLoaded.prototype.complete=function(){
var eventName=this.hasAnyBroken ? 'fail':'done';
this.isComplete=true;
this.emitEvent(eventName, [ this ]);
this.emitEvent('always', [ this ]);
if(this.jqDeferred){
var jqMethod=this.hasAnyBroken ? 'reject':'resolve';
this.jqDeferred[ jqMethod ](this);
}};
function LoadingImage(img){
this.img=img;
}
LoadingImage.prototype=Object.create(EvEmitter.prototype);
LoadingImage.prototype.check=function(){
var isComplete=this.getIsImageComplete();
if(isComplete){
this.confirm(this.img.naturalWidth!==0, 'naturalWidth');
return;
}
this.proxyImage=new Image();
this.proxyImage.addEventListener('load', this);
this.proxyImage.addEventListener('error', this);
this.img.addEventListener('load', this);
this.img.addEventListener('error', this);
this.proxyImage.src=this.img.src;
};
LoadingImage.prototype.getIsImageComplete=function(){
return this.img.complete&&this.img.naturalWidth!==undefined;
};
LoadingImage.prototype.confirm=function(isLoaded, message){
this.isLoaded=isLoaded;
this.emitEvent('progress', [ this, this.img, message ]);
};
LoadingImage.prototype.handleEvent=function(event){
var method='on' + event.type;
if(this[ method ]){
this[ method ](event);
}};
LoadingImage.prototype.onload=function(){
this.confirm(true, 'onload');
this.unbindEvents();
};
LoadingImage.prototype.onerror=function(){
this.confirm(false, 'onerror');
this.unbindEvents();
};
LoadingImage.prototype.unbindEvents=function(){
this.proxyImage.removeEventListener('load', this);
this.proxyImage.removeEventListener('error', this);
this.img.removeEventListener('load', this);
this.img.removeEventListener('error', this);
};
function Background(url, element){
this.url=url;
this.element=element;
this.img=new Image();
}
Background.prototype=Object.create(LoadingImage.prototype);
Background.prototype.check=function(){
this.img.addEventListener('load', this);
this.img.addEventListener('error', this);
this.img.src=this.url;
var isComplete=this.getIsImageComplete();
if(isComplete){
this.confirm(this.img.naturalWidth!==0, 'naturalWidth');
this.unbindEvents();
}};
Background.prototype.unbindEvents=function(){
this.img.removeEventListener('load', this);
this.img.removeEventListener('error', this);
};
Background.prototype.confirm=function(isLoaded, message){
this.isLoaded=isLoaded;
this.emitEvent('progress', [ this, this.element, message ]);
};
ImagesLoaded.makeJQueryPlugin=function(jQuery){
jQuery=jQuery||window.jQuery;
if(!jQuery){
return;
}
$=jQuery;
$.fn.imagesLoaded=function(options, callback){
var instance=new ImagesLoaded(this, options, callback);
return instance.jqDeferred.promise($(this));
};};
ImagesLoaded.makeJQueryPlugin();
return ImagesLoaded;
});
(function(window, factory){
if(typeof define=='function'&&define.amd){
define([
'flickity/js/index',
'imagesloaded/imagesloaded'
], function(Flickity, imagesLoaded){
return factory(window, Flickity, imagesLoaded);
});
}else if(typeof module=='object'&&module.exports){
module.exports=factory(
window,
require('flickity'),
require('imagesloaded')
);
}else{
window.Flickity=factory(
window,
window.Flickity,
window.imagesLoaded
);
}}(window, function factory(window, Flickity, imagesLoaded){
'use strict';
Flickity.createMethods.push('_createImagesLoaded');
var proto=Flickity.prototype;
proto._createImagesLoaded=function(){
this.on('activate', this.imagesLoaded);
};
proto.imagesLoaded=function(){
if(!this.options.imagesLoaded){
return;
}
var _this=this;
function onImagesLoadedProgress(instance, image){
var cell=_this.getParentCell(image.img);
_this.cellSizeChange(cell&&cell.element);
if(!_this.options.freeScroll){
_this.positionSliderAtSelected();
}}
imagesLoaded(this.slider).on('progress', onImagesLoadedProgress);
};
return Flickity;
}));