芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/azuleverything.com/calendar/assets/bravo.es5.min.2.2.1.146.js
/*! bravo - v2.2.1 - build 146 - 2023-08-14 * Copyright (c) 2023 Deux Huit Huit (https://deuxhuithuit.com); * PRIVATE */ function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function")}}function _defineProperties(target,props){for(var i=0;i
arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i
arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i
sp){var sLen=_stack.length;for(var x=sp;x
1&&arguments[1]!==undefined?arguments[1]:{};if(!url){url=window.location.origin+"/"}options=Object.assign({},defaultFetchOptions(),options);return window.fetch(url,options)};global.App=Object.assign({},global.App,{loader:{load:load,isLoading:function isLoading(){return _isLoading}}})})(window);(function(global,undefined){'use strict';var argsToObject=function argsToObject(arg){if(!!arg.args&&!Array.isArray(arg.args)){arg.args=[arg.args]}var a={args:arg.args||arguments,fx:arg.fx||"warn",me:arg.me||"App"},t1=_typeof(a.args[0]);if(t1==="string"||t1==="number"||t1==="boolean"){a.args[0]="["+a.me+"] "+a.args[0]}return a};var _logs=[];var log=function log(arg){if(!arg){return this}var a=argsToObject(arg);if(App.debug()){if(typeof console[a.fx]!=="function"){a.fx="log"}if(!!window.console[a.fx].apply){window.console[a.fx].apply(window.console,a.args)}else{a.args.forEach(function logArgs(arg){window.console[a.fx](arg)})}}_logs.push(a);return this};global.App=Object.assign({},global.App,{log:log,logs:function logs(){return _logs}})})(window);(function(global,undefined){'use strict';var getCurrentUrl=function getCurrentUrl(){return document.location.pathname};var mediatorIsLoadingPage=false;var currentRouteUrl=getCurrentUrl();var currentPage=null;var previousPage=null;var previousUrl="";var validateMediatorState=function validateMediatorState(){if(!!mediatorIsLoadingPage){App.log({args:"Mediator is busy waiting for a page load.",fx:"error"})}return!mediatorIsLoadingPage};var canEnterNextPage=function canEnterNextPage(nextPage){var result=true;if(!nextPage.canEnter()){App.log({fx:"error",args:["Cannot enter page %s.",nextPage.key()]});result=false}return result};var canLeaveCurrentPage=function canLeaveCurrentPage(){var result=false;if(!currentPage){App.log({args:"No current page set.",fx:"error"})}else if(!currentPage.canLeave()){App.log({args:["Cannot leave page %s.",currentPage.key()],fx:"error"})}else{result=true}return result};var resolvePageAction=function resolvePageAction(key,data){if(!!currentPage){return App.actions.resolve(currentPage.actions,key,data)}else{App.log({args:"Can not notify page: No current page set.",fx:"error"})}};var notifyAll=function notifyAll(key,data,cb){var actions=[];var pa=resolvePageAction(key,data);if(!!pa){actions.push(pa)}actions=actions.concat(App.modules.resolve(key,data));App.actions.execute(actions,key,data,cb);return this};var notifyPage=function notifyPage(key,data,cb){var pa=resolvePageAction(key,data);if(!!pa){App.actions.execute([pa],key,data,cb)}return this};var gotoPage=function gotoPage(obj,previousPoppedUrl){var pageData=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var changeUrl=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var nextPage;var route="";var safeParseData=function safeParseData(data){try{var parser=new window.DOMParser;var doc=parser.parseFromString(data,"text/html");return doc}catch(ex){App.log({args:[ex.message],fx:"error"});App.modules.notify("pages.failedtoparse",{data:data,route:route,nextPage:nextPage,currentPage:currentPage})}return null};var enterLeave=function enterLeave(){var leavingPage=currentPage;pageData.firstTime=false;if(!nextPage.isInited()){nextPage.init();nextPage.setInited();pageData.firstTime=true}App.modules.notify("page.leaving",{page:leavingPage});leavingPage.leave(function(){currentPage=null;previousPage=leavingPage;previousUrl=!!previousPoppedUrl?previousPoppedUrl:getCurrentUrl();leavingPage=null;App.modules.notify("page.leave",{page:previousPage})});App.modules.notify("page.entering",{page:nextPage,route:route});nextPage.enter(function(){currentPage=nextPage;App.modules.notify("page.enter",{page:nextPage,route:route});mediatorIsLoadingPage=false},pageData)};var loadSuccess=function loadSuccess(response){if(!!response.redirected){window.history.replaceState({data:{mediator:true,type:"pushState",redirected:true}},"",response.url);nextPage=App.pages.getPageForHref(response.url);route=response.url;var node=document.querySelector(nextPage.selector());if(!!node){node.style.opacity=0;node.style.display="none";return enterLeave()}}return response.text().then(function(data){var htmldata=safeParseData(data);var node=htmldata.querySelector(nextPage.selector());var elem=document.querySelector(App.root());if(!node){App.log({args:["Could not find \"%s\" in xhr data.",nextPage.selector()],fx:"error"});mediatorIsLoadingPage=false;App.modules.notify("pages.notfound",{data:data,url:obj,response:response,status:response.status})}else{node.style.opacity=0;node.style.display="none";elem.appendChild(node);App.modules.notify("pages.loaded",{elem:elem,data:data,html:htmldata,url:obj,page:nextPage,node:node,response:response,status:response.status});enterLeave()}})};if(validateMediatorState()&&canLeaveCurrentPage()){if(typeof obj==="string"){nextPage=App.pages.getPageForHref(obj);route=obj}else{App.log({fx:"error",args:"Url parameter must be of type string got "+_typeof(obj)});return}if(!nextPage){App.modules.notify("pages.routeNotFound",{page:currentPage,url:obj});App.log({args:["Route \"%s\" was not found.",obj],fx:"error"})}else{if(canEnterNextPage(nextPage)){if(nextPage.key()===currentPage.key()){App.modules.notify("pages.navigateToCurrent",{page:nextPage,route:route});App.log("Next page is the current one")}else{if(!!changeUrl){window.history.pushState({data:{mediator:true}},"",obj);pageData.type="pushState"}App.modules.notify("pages.loading",{page:nextPage});App.modules.notify("pages.requestBeginPageTransition",{currentPage:currentPage,nextPage:nextPage,route:route});if(!App.pages.loaded(obj)){mediatorIsLoadingPage=true;App.loader.load(obj).then(loadSuccess).catch(function(event){App.modules.notify("pages.loaderror",{event:event,url:obj})})}else{enterLeave();App.modules.notify("pages.loaded",{elem:document.querySelector(App.root()),url:obj,page:nextPage})}}}else{App.log({args:["Route \"%s\" is invalid.",obj],fx:"error"})}}}return this};var initPage=function initPage(page){if(!!currentPage){App.log({args:["Previous current page will be changed",{currentPage:currentPage,previousPage:previousPage,newCurrentPage:page}],fx:"warning"})}currentPage=page;previousPage=previousPage||page;App.modules.notify("page.entering",{page:currentPage,route:currentRouteUrl});currentPage.enter(function currentPageEnterCallback(){App.modules.notify("page.enter",{page:currentPage,route:currentRouteUrl})},true)};global.App=Object.assign({},global.App,{mediator:{getCurrentUrl:getCurrentUrl,getCurrentPage:function getCurrentPage(){return currentPage},setCurrentPage:function setCurrentPage(page){currentPage=page},getPreviousUrl:function getPreviousUrl(){return previousUrl},getPreviousPage:function getPreviousPage(){return previousPage},notify:notifyAll,notifyCurrentPage:notifyPage,goto:gotoPage,init:initPage}})})(window);(function(global,undefined){'use strict';var modules={};var createAbstractModule=function createAbstractModule(){return{actions:function actions(){},init:function init(){}}};var createModule=function createModule(module){return Object.freeze(Object.assign({},createAbstractModule(),module))};var exportModule=function exportModule(key,module,override){if(typeof key!=="string"){App.log({args:["`key` must be a string",key],fx:"error"})}else if(!!modules[key]&&!override){App.log({args:["Overwriting module key %s is not allowed",key],fx:"error"})}else{modules[key]=createModule(module)}return modules[key]};var resolveActions=function resolveActions(key,data){return Object.keys(modules).map(function resolveAction(k){return App.actions.resolve(modules[k].actions,key,data)}).filter(function(a){return!!a})};var notifyModules=function notifyModules(key,data,cb){var actions=resolveActions(key,data);App.actions.execute(actions,key,data,cb);return this};global.App=Object.assign({},global.App,{modules:{models:function models(){return modules},exports:exportModule,notify:notifyModules,resolve:resolveActions}})})(window);(function(global,undefined){'use strict';var pageModels={};var pageInstances={};var activeRoutes={};var createPageModel=function createPageModel(key,model,override){var factory=function factory(pageData){var modelRef;var _isInited=false;if(_typeof(model)==="object"){modelRef=model}else if(typeof model==="function"){modelRef=model.call(this,key,pageData,override);if(_typeof(modelRef)!=="object"){App.log({args:["The exported page model function must return an object, "+"`%s` given (%s)",_typeof(modelRef),modelRef],fx:"error"});return null}}else{App.log({args:["The exported page model must be an object or a function, "+"`%s` given (%s)",_typeof(model),model],fx:"error"});return null}var getSelector=function getSelector(){return"[data-page-url=\""+pageData.key+"\"]"};var base={actions:function actions(){},init:function init(){},canEnter:function canEnter(){return true},canLeave:function canLeave(){return true},model:function model(){return key},enter:function enter(next,data){var p=document.querySelector(getSelector());p.style.opacity=1;p.style.display="block";if(!!data.firstTime||data.type==="pushState"){window.scrollTo({top:0,left:0,behavior:"auto"})}App.callback(next)},leave:function leave(next){var p=document.querySelector(getSelector());p.style.opacity=0;p.style.display="none";App.callback(next)}};var overwrites=Object.freeze({key:function key(){return pageData.key},selector:function selector(){return getSelector()},data:function data(){return pageData},isInited:function isInited(){return _isInited},setInited:function setInited(){_isInited=true}});return Object.freeze(Object.assign({},base,modelRef,overwrites))};activeRoutes[key]=[];return factory};var createPage=function createPage(pageData,keyModel,override){var pageModel=pageModels[keyModel];var pageInst;if(!pageModel){App.log({args:["Model `%s` not found",keyModel],fx:"error"})}else{if(!!pageInstances[pageData.key]&&!override){App.log({args:["Overwriting page key `%s` is not allowed",pageData.key],fx:"error"})}else{pageInst=pageModel(pageData);if(!!pageInst){pageInstances[pageData.key]=pageInst}return pageInst}}return false};var registerPageModel=function registerPageModel(key,pageModel,override){var keyType=_typeof(key);if(keyType!=="string"){App.log({args:["`key` must be a string, `%s` given (%s).",keyType,key],fx:"error"})}else if(!!pageModels[key]&&!override){App.log({args:["Overwriting page model key `%s` is not allowed",key],fx:"error"})}else{pageModels[key]=Object.freeze(pageModel);return pageModel}return false};var exportPage=function exportPage(key,model,override){var pageModel=createPageModel(key,model,override);return registerPageModel(key,pageModel,override)};var routeMatchStrategies={regexp:function regexp(testRoute,route,cb){if(testRoute.test(route)){return cb()}return true},string:function string(testRoute,route,cb){var regex;route=decodeURIComponent(route);route=route.split("#")[0];if(testRoute===route){return cb()}if(testRoute.indexOf("^")!==0){testRoute="^"+testRoute}if(testRoute.indexOf("^")!==testRoute.length-1){testRoute=testRoute+"$"}if(testRoute.indexOf("*")){testRoute=testRoute.replace(new RegExp("\\*","gi"),".*")}try{regex=new RegExp(testRoute)}catch(ex){App.log({args:["Error while creating RegExp %s.\n%s",testRoute,ex],fx:"error"})}if(!!regex&®ex.test(route)){return cb()}return true}};var matchRoute=function matchRoute(route,routes){var index=-1;var found=function found(i){index=i;return false};if(typeof route!=="string"){App.log({args:"`route` must be a string",fx:"error"});return index}if(!!~route.indexOf("?")){route=route.split("?")[0]}if(!!route&&!!routes){if(!Array.isArray(routes)){routes=Object.values(routes)}routes.every(function matchOneRoute(testRoute,i){var routeType=_typeof(testRoute);var routeStrategy=routeMatchStrategies[routeType];var cb=function cb(){return found(i)};if(typeof routeStrategy==="function"){return routeStrategy(testRoute,route,cb)}else if(testRoute===route){return cb()}return true})}return index};var addRoutes=function addRoutes(keyModel,routes){if(!pageModels[keyModel]){App.log({fx:"error",args:"Model \""+keyModel+"\" not found."});return false}if(!activeRoutes[keyModel]){activeRoutes[keyModel]=[]}if(keyModel==="default"){App.log({fx:"error",args:"You can't add routes to the default model"});return false}activeRoutes[keyModel]=_toConsumableArray(new Set(activeRoutes[keyModel].concat(routes)));return activeRoutes[keyModel]};var removeRoutes=function removeRoutes(keyModel,routes){if(!pageModels[keyModel]){App.log({fx:"error",args:"Model \""+keyModel+"\" not found."});return false}return false};var getPageForHref=function getPageForHref(href){if(!!pageInstances[href]){return pageInstances[href]}var model=null;for(var m in activeRoutes){if(activeRoutes.hasOwnProperty(m)){var modelRoutes=activeRoutes[m];var match=!!~matchRoute(href,modelRoutes);if(!!match){model=m;break}}}if(!model){model="default"}return createPage({key:href},model,true)};var loaded=function loaded(url){return!!document.querySelector(App.root()).querySelector("[data-page-url=\""+url+"\"]")};registerPageModel("default",createPageModel("default",{},true),{});global.App=Object.assign({},global.App,{pages:{instances:function instances(key){if(!!key){return pageInstances[key]}return pageInstances},models:function models(){return pageModels},getPageForHref:getPageForHref,page:function page(keyOrRoute){var result=pageInstances[keyOrRoute];if(!!!result){result=getPageForHref(keyOrRoute)}return result},create:createPage,exports:exportPage,loaded:loaded,routes:{active:function active(){return activeRoutes},match:matchRoute,add:addRoutes,remove:removeRoutes}}})})(window);(function(global,undefined){'use strict';var storage=function storage(_storage){return{get:function get(key){if(!key){return}key+="";return _storage[key]},set:function set(key,value){var result=false;if(!!key){key+="";try{_storage[key]=!value?"":value+"";result=true}catch(e){App.log({args:e.message,me:"Storage",fx:"error"});result=false}}return result},remove:function remove(key){var result=false;if(!!key){key+="";try{_storage.removeItem(key);result=true}catch(e){App.log({args:e.message,me:"Storage",fx:"error"});result=false}}return result},clear:function clear(regexp){var result=false;try{if(!regexp){_storage.clear()}else{var remove=[];for(var i=0;i<_storage.length;i++){var key=_storage.key(i);if(regexp.test(key)){remove.push(key)}}for(var _i=0;_i
0;if(!preventGoto){App.mediator.goto(document.location.href,undefined,{type:event.type},false)}return window.pd(event,true)};var init=function init(){window.onpopstate=updatePage;window.addEventListener("pushState",updatePage)};App.modules.exports("ajax",{init:init})})();(function(){'use strict';var scope=document.querySelector("#site");var sels={links:"a[href]"};var init=function init(){scope.addEventListener(App.device.events.click,function(event){var target=event.target.matches(sels.links)?event.target:null;target=target||event.target.closest(sels.links);if(!!target&&!(event.ctrlKey||event.metaKey)){if(target.origin!==window.location.origin){return}if(target.pathname.startsWith("/assets")){return}if(target.getAttribute("download")!==null){return}if(target.getAttribute("target")!==null&&target.getAttribute("target")!=="self"){return}if(target.getAttribute("data-ajax")==="false"){return}if(target.getAttribute("data-action")==="full"){return}var urlChangeRequestedRets=[];App.mediator.notify("url.changeRequested",{event:event},function(key,ret){urlChangeRequestedRets.push(ret)});var preventUrlChange=urlChangeRequestedRets.filter(Boolean).length>0;if(preventUrlChange){return window.pd(event)}if(!!window.location.pathname.endsWith("/")&&!target.pathname.endsWith("/")){target.pathname+="/"}window.history.pushState({},target.textContent,target.href);return window.pd(event)}})};App.modules.exports("url-changer",{init:init})})();(function(){'use strict';var MINIMUM_FOR_PARTIAL=2;var isMultilingual=(document.documentElement.dataset.allLangs||"").split(",").length>1||true;var scope=document.body;var update=function update(){var currentPath=window.location.pathname;var links=scope.querySelectorAll("a[href]");links.forEach(function(link){delete link.dataset.currentLinkPartial;delete link.dataset.currentLink;var pathname=link.pathname;var matches=[];if(pathname.charAt(0)!=="/"){pathname="/"+pathname}pathname.split("/").forEach(function(fragment,index){if(fragment&&fragment===currentPath.split("/")[index]){matches.push(fragment)}});if(!!isMultilingual&&matches.length
0){window.scrollTo({top:scrollTop})}};var actions=function actions(){return{site:{removeScroll:removeScroll,addScroll:addScroll}}};App.modules.exports("siteScroll",{actions:actions})})();(function(){'use strict';var sels={modal:".js-modal",content:".js-modal-content",focusable:"a[href], area[href], input:not([disabled]), select:not([disabled]),\n\t\ttextarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]",video:"video"};var KEY_TAB=9;var KEY_ESC=27;var matchMedia=function matchMedia(minWidth){return window.matchMedia("(min-width: ".concat(minWidth,"px)")).matches};var createModal=function createModal(modalEl){if(!modalEl){return}var modalId=modalEl.id;var modalHandle=modalEl.dataset.handle;if(!modalId&&!modalHandle){App.log("This modal needs an id or data-handle attributes",{modal:modalEl});return}var triggers=Array.from(document.querySelectorAll("[aria-controls=\"".concat(modalId,"\"]")));var focusableEls=Array.from(modalEl.querySelectorAll(sels.focusable));var firstFocusableEl=focusableEls[0];var lastFocusableEl=focusableEls[focusableEls.length-1];var lastFocusedEl;var options={closeOnScroll:modalEl.dataset.closeOnScroll==="true",lockSiteScroll:modalEl.dataset.lockSiteScroll==="true",lockSiteScrollBreakpoint:parseInt(modalEl.dataset.lockSiteScrollBreakpoint||0,10),trapFocus:modalEl.dataset.trapFocus==="true",playVideoOnOpen:modalEl.dataset.playVideoOnOpen==="true"};var isOpen=false;var lockScroll=function lockScroll(){App.modules.notify("site.removeScroll")};var unlockScroll=function unlockScroll(){App.modules.notify("site.addScroll")};var isModalHashPresent=function isModalHashPresent(){return modalHandle&&window.location.hash.replace("#","")===modalHandle};var updateTriggers=function updateTriggers(expanded){triggers.forEach(function(el){el.setAttribute("aria-expanded",expanded)})};var openModal=function openModal(){isOpen=true;modalEl.scrollTop=0;modalEl.dataset.state="visible";updateTriggers(isOpen);if(options.trapFocus&&firstFocusableEl){lastFocusedEl=document.activeElement;firstFocusableEl.focus()}if(options.lockSiteScroll&&matchMedia(options.lockSiteScrollBreakpoint)){lockScroll()}var video=modalEl.querySelector("video");if(video&&options.playVideoOnOpen){video.play()}};var closeModal=function closeModal(){isOpen=false;modalEl.dataset.state="hidden";updateTriggers(isOpen);if(lastFocusedEl){lastFocusedEl.focus()}if(options.lockSiteScroll&&matchMedia(options.lockSiteScrollBreakpoint)){unlockScroll()}if(isModalHashPresent()){window.history.pushState({},window.document.title,window.location.pathname+window.location.search)}modalEl.querySelectorAll("video").forEach(function(video){return video.pause()})};var onToggle=function onToggle(e){var target=e.target,currentTarget=e.currentTarget;if(!currentTarget.matches("[aria-controls=\"".concat(modalId,"\"]"))&&target.closest(sels.content)){return}if(isOpen){closeModal()}else{openModal()}};var onModalScroll=function onModalScroll(){var scrollTop=modalEl.scrollTop;var height=modalEl.offsetHeight;var scrollHeight=modalEl.scrollHeight;if(scrollTop+height>=scrollHeight){closeModal()}};var handleTab=function handleTab(e){if(focusableEls.length===1){e.preventDefault();return}if(document.activeElement===firstFocusableEl&&e.shiftKey){e.preventDefault();lastFocusableEl.focus()}if(document.activeElement===lastFocusableEl&&!e.shiftKey){e.preventDefault();firstFocusableEl.focus()}};var resolveHash=function resolveHash(){if(isModalHashPresent()){openModal()}else if(isOpen){closeModal()}};var onKeydown=function onKeydown(e){if(!isOpen){return}if(e.keyCode===KEY_ESC){closeModal()}if(options.trapFocus&&e.keyCode===KEY_TAB){handleTab(e)}};var onWindowClick=function onWindowClick(e){if(!isOpen){return}var target=e.target;var isInModal=modalEl.contains(target);var isInTrigger=!!triggers.find(function(el){return el.contains(target)});if(isInModal||isInTrigger){return}closeModal()};var onPopState=function onPopState(){resolveHash()};triggers.forEach(function(el){el.addEventListener("click",onToggle)});modalEl.addEventListener("click",onToggle);if(options.closeOnScroll){modalEl.addEventListener("scroll",onModalScroll)}resolveHash();return{onKeydown:onKeydown,onWindowClick:onWindowClick,onPopState:onPopState,id:modalId,close:closeModal,open:openModal}};var modals=[];var onKeydown=function onKeydown(_,e){modals.forEach(function(modal){return modal.onKeydown(e)})};var onWindowClick=function onWindowClick(_,e){modals.forEach(function(modal){return modal.onWindowClick(e)})};var onPopState=function onPopState(_,e){modals.forEach(function(modal){return modal.onPopState(e)})};var onPageLeave=function onPageLeave(){modals.forEach(function(modal){return modal.close()})};var onModalClose=function onModalClose(_,id){modals.find(function(modal){if(modal.id===id){modal.close();return true}})};var onModalOpen=function onModalOpen(_,id){modals.find(function(modal){if(modal.id===id){modal.open();return true}})};var actions=function actions(){return{site:{keydown:onKeydown,click:onWindowClick,popstate:onPopState},page:{leave:onPageLeave},modal:{close:onModalClose,open:onModalOpen}}};var init=function init(){document.querySelectorAll(sels.modal).forEach(function(mod){var modal=createModal(mod);if(modal){modals.push(modal)}})};App.modules.exports("modal",{init:init,actions:actions})})();(function(){'use strict';var sels={drawerBtn:".js-drawer-trigger"};var createDrawer=function createDrawer(btnEl){var slideIds=btnEl.getAttribute("aria-controls");if(!slideIds){App.log("contentIds attribute is required.",{element:btnEl});return}var slides=slideIds.split(", ").map(function(id){return{el:document.getElementById(id),rafId:null}}).filter(function(slide){return!!slide.el});var setSlideHeight=function setSlideHeight(slide){var rafId=slide.rafId,el=slide.el;if(rafId){window.cancelAnimationFrame(rafId);slide.rafId=null;return}var slideHeight=0;Array.from(el.children).forEach(function(child){var style=window.getComputedStyle(child);var childHeight=child.scrollHeight+parseInt(style.marginTop||0,10)+parseInt(style.marginBottom||0,10)+parseInt(style.borderWidth||0,10);slideHeight+=childHeight});el.style.setProperty("--height",slideHeight+"px");slide.rafId=window.requestAnimationFrame(function(){setSlideHeight(slide)})};var toggleDrawers=function toggleDrawers(){btnEl.setAttribute("aria-expanded",btnEl.getAttribute("aria-expanded")==="true"?false:true);slides.forEach(function(slide){setSlideHeight(slide);var el=slide.el;var currentState=el.dataset.state;el.dataset.state=currentState==="visible"?"hidden":"visible"})};var setSlides=function setSlides(){slides.forEach(function(slide){setSlideHeight(slide)})};var destroy=function destroy(){btnEl.removeEventListener("click",toggleDrawers)};btnEl.addEventListener("click",toggleDrawers);setSlides();return{onResize:setSlides,destroy:destroy}};var drawers=[];var onResize=function onResize(){drawers.forEach(function(drawer){return drawer.onResize()})};var onPageEnter=function onPageEnter(_,data){var scope=document.querySelector(data.page.selector());if(!scope){return}var drawerBtns=scope.querySelectorAll(sels.drawerBtn);drawerBtns.forEach(function(btn){var drawer=createDrawer(btn);drawers.push(drawer)})};var onPageLeave=function onPageLeave(){drawers.forEach(function(drawer){return drawer.destroy()});drawers=[]};var actions=function actions(){return{site:{resize:onResize},page:{enter:onPageEnter,leave:onPageLeave}}};App.modules.exports("drawer",{actions:actions})})();(function(){'use strict';var sels={ctn:".swiper-container"};var scope=document.querySelector(".page");var swipers=[];var clickStartTime=0;var clickEndTime=0;var clickDelayTreshold=200;var clickTime=function clickTime(){return clickEndTime-clickStartTime};var onPointerDown=function onPointerDown(){clickStartTime=window.performance.now()};var onPointerUp=function onPointerUp(){clickEndTime=window.performance.now()};var initSwipers=function initSwipers(){scope.querySelectorAll(sels.ctn).forEach(function(el){var swiper=new window.Swiper(el,{slidesPerView:"auto",freeMode:true,watchOverflow:true,mousewheel:{forceToAxis:true,invert:true}});if(swiper){swipers.push(swiper)}el.addEventListener("pointerdown",onPointerDown);el.addEventListener("pointerup",onPointerUp)})};var destroySwipers=function destroySwipers(){swipers.forEach(function(s){s.destroy()});swipers=[];scope.querySelectorAll(sels.ctn).forEach(function(el){el.removeEventListener("pointerdown",onPointerDown);el.removeEventListener("pointerup",onPointerUp)})};var onPageEnter=function onPageEnter(_,data){scope=document.querySelector(data.page.selector());App.fx.notify("load-js",{key:"swiper",loaded:function loaded(){return window.Swiper},ready:function ready(){initSwipers()}})};var onPageLeave=function onPageLeave(){destroySwipers()};var onUrlChangeRequested=function onUrlChangeRequested(_,_ref){var event=_ref.event;return!!event.target&&!!event.target.closest(sels.ctn)&&clickTime()>clickDelayTreshold};var actions=function actions(){return{page:{enter:onPageEnter,leave:onPageLeave},url:{changeRequested:onUrlChangeRequested}}};App.modules.exports("slider",{actions:actions})})();(function(){'use strict';var sels={ctn:".js-custom-cursor-ctn",cursor:".js-custom-cursor"};var scope=document.querySelector(".page");var cursors=[];var createCursor=function createCursor(ctnEl){if(!ctnEl){return}var cursorEl=ctnEl.querySelector(sels.cursor);if(!cursorEl){App.log("Missing custom cursor element for container element: ",ctnEl);return}var setCursorPos=function setCursorPos(pointerX,pointerY){var xOffset=cursorEl.clientWidth/2;var yOffset=cursorEl.clientHeight/3;var x=pointerX-xOffset;var y=pointerY-yOffset;cursorEl.style.setProperty("--x","".concat(x,"px"));cursorEl.style.setProperty("--y","".concat(y,"px"))};var onMove=function onMove(e){setCursorPos(e.clientX,e.clientY)};var destroy=function destroy(){ctnEl.removeEventListener("pointermove",onMove)};ctnEl.dataset.state="ready";ctnEl.addEventListener("pointermove",onMove);return{destroy:destroy}};var initCursors=function initCursors(){scope.querySelectorAll(sels.ctn).forEach(function(el){var cursor=createCursor(el);if(cursor){cursors.push(cursor)}})};var onPageEnter=function onPageEnter(_,data){scope=document.querySelector(data.page.selector());initCursors()};var onPageLeave=function onPageLeave(){cursors.forEach(function(cursor){cursor.destroy()});cursors=[]};var actions=function actions(){return{page:{enter:onPageEnter,leave:onPageLeave}}};App.modules.exports("custom-cursor",{actions:actions})})();(function(){'use strict';var xstate;var sels={ctn:".js-pagination-ctn",content:".js-pagination-content",paginationLink:".js-pagination-link",filterLink:".js-filter-link",filterInput:".js-filter-input"};var toQueryString=function toQueryString(obj){var queryParams=new window.URLSearchParams(window.location.search);Object.entries(obj).forEach(function(_ref2){var _ref3=_slicedToArray(_ref2,2),key=_ref3[0],val=_ref3[1];if(val){queryParams.set(key,val)}else if(queryParams.has(key)){queryParams.delete(key)}});var result=queryParams.toString();return result?"?".concat(result):""};var emptyEl=function emptyEl(el){while(el.firstChild){el.lastChild.remove()}};var pagination;var ctnEl;var createPagination=function createPagination(rootEl){var _xstate=xstate,assign=_xstate.assign,createMachine=_xstate.createMachine;var contentEl=rootEl.querySelector(sels.content);return createMachine({id:"pagination",context:_objectSpread({endpoint:"/pagination-endpoint",contentEl:contentEl,query:{},queryString:"",resetScroll:false,controller:null,currentUrl:null,currentLocale:null,template:null,initialPageNumber:null,pageTrigger:null},rootEl.dataset),initial:"idle",states:{idle:{},loading:{initial:"gettingPageData",states:{gettingPageData:{entry:["abortRequestAndResetController"],invoke:{src:"getPageData",onDone:{target:"handlingImageLoading"},onError:{target:"#pagination.idle"}}},handlingImageLoading:{invoke:{src:"handleImageLoading"},on:{APPEND_CONTENT:{actions:["appendContent","notifyRefresh"]},IMAGES_LOADED:{target:"#pagination.idle"}}}}}},on:{PAGINATE:{target:"loading",actions:["scrollToTop","updateLinks","updateUrl"]},FILTER:{target:"loading",actions:["updateQuery","generateQueryString","scrollToTop","updateLinks","updateUrl"]},POPSTATE:{target:"loading"}}},{services:{getPageData:function(){var _getPageData=_asyncToGenerator(regeneratorRuntime.mark(function _callee(context,event){var data,historyState,pageNumber,pageTrigger,paginationParam,qs,url,controller,signal,res,htmlString,fragment;return regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:data=event.data||{};historyState=window.history.state||{};pageNumber=data.pageNumber||historyState.pageNumber||context.initialPageNumber;pageTrigger=context.pageTrigger;paginationParam=event.type==="PAGINATE"?"/".concat(pageTrigger).concat(pageNumber):"";qs="/".concat(toQueryString({template:context.template,currentUrl:context.currentUrl}),"&").concat(context.queryString);url="".concat(window.location.origin).concat(context.currentLocale||"","\n\t\t\t\t\t\t").concat(context.endpoint).concat(paginationParam).concat(qs);controller=context.controller;signal=controller.signal;_context.prev=9;_context.next=12;return window.fetch(url,{signal:signal});case 12:res=_context.sent;_context.next=15;return res.text();case 15:htmlString=_context.sent;fragment=document.createRange().createContextualFragment(htmlString);return _context.abrupt("return",{fragment:fragment});case 20:_context.prev=20;_context.t0=_context["catch"](9);if(!(signal&&signal.aborted)){_context.next=24;break}return _context.abrupt("return");case 24:console.warn(_context.t0);case 25:case"end":return _context.stop();}}},_callee,null,[[9,20]])}));function getPageData(_x2,_x3){return _getPageData.apply(this,arguments)}return getPageData}(),handleImageLoading:function handleImageLoading(_,event){return function(callback){var fragment=event.data.fragment;var images=fragment.querySelectorAll("img");var totalImages=images.length;if(totalImages===0){callback({type:"APPEND_CONTENT",data:{fragment:fragment}});callback({type:"IMAGES_LOADED"});return}var minImagesLoadedQty=Math.min(totalImages,10);var imagesLoaded=0;var onImageLoaded=function onImageLoaded(e){imagesLoaded+=1;var image=e.currentTarget;image.removeEventListener("load",onImageLoaded);if(imagesLoaded===minImagesLoadedQty){callback({type:"IMAGES_LOADED"})}};images.forEach(function(img,i){if(i+1<=minImagesLoadedQty){img.addEventListener("load",onImageLoaded)}});callback({type:"APPEND_CONTENT",data:{fragment:fragment}})}}},actions:{updateQuery:assign({query:function query(_,event){return event.data.query}}),generateQueryString:assign({queryString:function queryString(_,event){var data=event.data;if(!data){return""}var query=data.query;if(!query){return""}return"/".concat(toQueryString(_objectSpread({},query)))}}),updateLinks:function updateLinks(_,event){var data=event.data;if(!data){return}var linkSelector;if(event.type==="FILTER"){linkSelector=sels.filterLink}else if(event.type==="PAGINATE"){linkSelector=sels.paginationLink}if(!linkSelector){return}Object.keys(data.query).forEach(function(key){rootEl.querySelectorAll("".concat(linkSelector,"[data-filter-key=\"").concat(key,"\"]")).forEach(function(link){return link.setAttribute("aria-current",link===data.link)})})},updateUrl:function updateUrl(context,event){var data=event.data;var pageNumber=data.pageNumber||context.initialPageNumber;var pageTrigger=context.pageTrigger,currentUrl=context.currentUrl;var paginationParam=event.type==="PAGINATE"?"/".concat(pageTrigger).concat(pageNumber):"";var newUrl="".concat(currentUrl).concat(paginationParam,"\n\t\t\t\t\t\t").concat(context.queryString);window.history.pushState({pageNumber:pageNumber,pagination:currentUrl},document.title,newUrl)},scrollToTop:function scrollToTop(context){if(!context.resetScroll){return}window.scrollTo({behavior:"smooth",top:rootEl.offsetTop})},abortRequestAndResetController:assign({controller:function controller(context){var controller=context.controller;if(controller){controller.abort()}return new window.AbortController}}),notifyRefresh:function notifyRefresh(context){App.modules.notify("pagination.refresh",context.query)},appendContent:function appendContent(context,event){var contentEl=context.contentEl;var fragment=event.data.fragment;emptyEl(contentEl);contentEl.append(fragment)}}})};var onCtnClick=function onCtnClick(e){var paginationLink=e.target.closest("".concat(sels.paginationLink,"[data-number]"));if(paginationLink){e.preventDefault();pagination.send({type:"PAGINATE",data:{link:paginationLink,pageNumber:paginationLink.dataset.number}});return}var filterLink=e.target.closest(sels.filterLink);if(filterLink){e.preventDefault();pagination.send({type:"FILTER",data:{link:filterLink,query:_defineProperty({},filterLink.dataset.filterKey,filterLink.dataset.filterValue)}})}};var onCtnInput=function onCtnInput(e){var input=e.target;pagination.send({type:"FILTER",data:{query:_defineProperty({},input.dataset.filterKey,input.value)}})};var onPopstate=function onPopstate(_,e){if(!pagination){return}if(e.state&&e.state.pageNumber){pagination.send({type:"POPSTATE",data:{pageNumber:e.state.pageNumber}})}else{pagination.send({type:"POPSTATE"})}};var onPageEnter=function onPageEnter(_,data){var scope=document.querySelector(data.page.selector());if(!scope){return}ctnEl=scope.querySelector(sels.ctn);if(!ctnEl){return}App.fx.notify("load-js",{key:"xstate",loaded:function loaded(){return window.XState},ready:function ready(){xstate=window.XState;ctnEl.addEventListener("click",onCtnClick);ctnEl.addEventListener("change",onCtnInput);pagination=xstate.interpret(createPagination(ctnEl)).onTransition(function(state){var statesArray=state.toStrings();ctnEl.dataset.state=statesArray[statesArray.length-1]}).start()}})};var onPageLeave=function onPageLeave(){if(pagination){pagination.stop();pagination=undefined}if(ctnEl){ctnEl.removeEventListener("click",onCtnClick);ctnEl.removeEventListener("input",onCtnInput);ctnEl=undefined}};var onUrlChanged=function onUrlChanged(_,data){var _data$event$state;if(!ctnEl){return false}var currentUrl=ctnEl.dataset.currentUrl;if(!currentUrl){return false}var pagination=(_data$event$state=data.event.state)===null||_data$event$state===void 0?void 0:_data$event$state.pagination;return pagination&&pagination===currentUrl};var actions=function actions(){return{site:{popstate:onPopstate},page:{enter:onPageEnter,leave:onPageLeave},url:{changed:onUrlChanged}}};App.modules.exports("pagination",{actions:actions})})();(function(){'use strict';var sels={ctn:".js-copy-on-click",btn:".js-copy-on-click-btn",message:".js-copy-on-click-message"};var messageDelay=2000;var createCopyOnClick=function createCopyOnClick(ctn,legacy){var btn=ctn.querySelector(sels.btn);var message=ctn.querySelector(sels.message);if(!btn||!message){return}var valueToCopy=window.location.href;var onCopyClick=function(){var _ref4=_asyncToGenerator(regeneratorRuntime.mark(function _callee2(){var input;return regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:if(!legacy){_context2.next=9;break}input=document.createElement("input");input.value=valueToCopy;document.body.appendChild(input);input.select();document.execCommand("copy");input.remove();_context2.next=11;break;case 9:_context2.next=11;return window.navigator.clipboard.writeText(valueToCopy);case 11:message.dataset.state="visible";window.setTimeout(function(){delete message.dataset.state},messageDelay);case 13:case"end":return _context2.stop();}}},_callee2)}));return function onCopyClick(){return _ref4.apply(this,arguments)}}();btn.addEventListener("click",onCopyClick)};var onPageEnter=function(){var _ref5=_asyncToGenerator(regeneratorRuntime.mark(function _callee3(){var legacy;return regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:legacy=true;if(!("navigator"in window&&"permissions"in window.navigator)){_context3.next=5;break}_context3.next=4;return window.navigator.permissions.query({name:"clipboard-write"}).then(function(_ref6){var state=_ref6.state;return state!=="granted"}).catch(function(){return true});case 4:legacy=_context3.sent;case 5:document.querySelectorAll(sels.ctn).forEach(function(ctn){createCopyOnClick(ctn,legacy)});case 6:case"end":return _context3.stop();}}},_callee3)}));return function onPageEnter(){return _ref5.apply(this,arguments)}}();var actions=function actions(){return{page:{enter:onPageEnter}}};App.modules.exports("copy-on-click",{actions:actions})})();(function(){'use strict';var sels={btn:".js-native-share-btn"};var scope;var onShare=function onShare(){if(!window.navigator||!window.navigator.share){return}window.navigator.share({url:window.location.href,title:document.title})};var onPageEnter=function onPageEnter(_,data){scope=document.querySelector(data.page.selector());if(!scope){return}scope.querySelectorAll(sels.btn).forEach(function(btn){btn.addEventListener("click",onShare)})};var onPageLeave=function onPageLeave(){scope.querySelectorAll(sels.btn).forEach(function(btn){btn.removeEventListener("click",onShare)})};var actions=function actions(){return{page:{enter:onPageEnter,leave:onPageLeave}}};App.modules.exports("native-share",{actions:actions})})();(function(){'use strict';var _document=document,body=_document.body;var onPageLoaded=function onPageLoaded(){body.dataset.pageState="idle"};var onPageLoading=function onPageLoading(){body.dataset.pageState="loading"};var actions=function actions(){return{pages:{loading:onPageLoading,loaded:onPageLoaded,loaderror:onPageLoaded}}};App.modules.exports("page-transition",{actions:actions})})();(function(){'use strict';var LiteYTEmbed=function(_HTMLElement){_inherits(LiteYTEmbed,_HTMLElement);var _super=_createSuper(LiteYTEmbed);function LiteYTEmbed(){_classCallCheck(this,LiteYTEmbed);return _super.apply(this,arguments)}_createClass(LiteYTEmbed,[{key:"connectedCallback",value:function connectedCallback(){var _this=this;this.videoId=this.getAttribute("videoid");var playBtnEl=this.querySelector(".lty-playbtn");this.playLabel=playBtnEl&&playBtnEl.textContent.trim()||this.getAttribute("playlabel")||"Play";if(!this.style.backgroundImage){this.posterUrl="https://i.ytimg.com/vi/".concat(this.videoId,"/maxresdefault.jpg");LiteYTEmbed.addPrefetch("preload",this.posterUrl,"image");this.style.backgroundImage="url(\"".concat(this.posterUrl,"\")")}if(!playBtnEl){playBtnEl=document.createElement("button");playBtnEl.type="button";playBtnEl.classList.add("lty-playbtn");this.append(playBtnEl)}if(!playBtnEl.textContent){var playBtnLabelEl=document.createElement("span");playBtnLabelEl.className="lyt-visually-hidden";playBtnLabelEl.textContent=this.playLabel;playBtnEl.append(playBtnLabelEl)}this.addEventListener("pointerover",LiteYTEmbed.warmConnections,{once:true});this.addEventListener("click",function(){return _this.addIframe()});this.addEventListener("pageleave",function(){return _this.stopVideo()})}},{key:"addIframe",value:function addIframe(){var params=new window.URLSearchParams(this.getAttribute("params")||[]);params.append("autoplay","1");var iframeEl=document.createElement("iframe");iframeEl.width=560;iframeEl.height=315;iframeEl.title=this.playLabel;iframeEl.allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture";iframeEl.allowFullscreen=true;iframeEl.src="https://www.youtube-nocookie.com/embed/".concat(encodeURIComponent(this.videoId),"?").concat(params.toString());this.append(iframeEl);this.classList.add("lyt-activated");this.querySelector("iframe").focus()}},{key:"stopVideo",value:function stopVideo(){var iframe=this.querySelector("iframe");if(!iframe){return}this.classList.remove("lyt-activated");iframe.remove()}}],[{key:"addPrefetch",value:function addPrefetch(kind,url,as){var linkEl=document.createElement("link");linkEl.rel=kind;linkEl.href=url;if(as){linkEl.as=as}document.head.append(linkEl)}},{key:"warmConnections",value:function warmConnections(){if(LiteYTEmbed.preconnected){return}LiteYTEmbed.addPrefetch("preconnect","https://www.youtube-nocookie.com");LiteYTEmbed.addPrefetch("preconnect","https://www.google.com");LiteYTEmbed.addPrefetch("preconnect","https://googleads.g.doubleclick.net");LiteYTEmbed.addPrefetch("preconnect","https://static.doubleclick.net");LiteYTEmbed.preconnected=true}}]);return LiteYTEmbed}(_wrapNativeSuper(HTMLElement));var onPageLeave=function onPageLeave(){document.querySelectorAll("lite-youtube").forEach(function(el){el.stopVideo()})};var init=function init(){window.customElements.define("lite-youtube",LiteYTEmbed)};var actions=function actions(){return{page:{leave:onPageLeave}}};App.modules.exports("lite-yt-embed",{init:init,actions:actions})})();(function(){'use strict';var sels={ctn:".js-play-video-on-hover"};var isMotionReduced=function isMotionReduced(){return window.matchMedia("screen and (prefers-reduced-motion: reduce), (update: slow)").matches};var isTouchDevice=function isTouchDevice(){return window.matchMedia("(hover: none)").matches};var preventVideo=function preventVideo(){return isMotionReduced()||isTouchDevice()};var onHover=function onHover(e){if(preventVideo()){return}var ctn=e.currentTarget;var video=ctn.querySelector("video");if(!video){return}video.play()};var onLeave=function onLeave(e){var ctn=e.currentTarget;var video=ctn.querySelector("video");if(!video){return}video.pause()};var onPageEnter=function onPageEnter(_,data){if(preventVideo()){return}var scope=document.querySelector(data.page.selector());if(!scope){return}scope.querySelectorAll(sels.ctn).forEach(function(el){el.addEventListener("pointerenter",onHover);el.addEventListener("pointerleave",onLeave)})};var actions=function actions(){return{page:{enter:onPageEnter}}};App.modules.exports("play-video-on-hover",{actions:actions})})();(function(){'use strict';var so;var onPageEnter=function(){var _ref7=_asyncToGenerator(regeneratorRuntime.mark(function _callee4(_,data){var scope;return regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:scope=document.querySelector(data.page.selector());if(scope.querySelector("[data-scroll]")){_context4.next=3;break}return _context4.abrupt("return");case 3:App.fx.notify("load-js",{key:"scrollout",loaded:function loaded(){return window.ScrollOut},ready:function ready(){if(!so){so=new window.ScrollOut({cssProps:{viewportY:true}})}so.index();so.update()}});if(so){so.index();so.update()}case 5:case"end":return _context4.stop();}}},_callee4)}));return function onPageEnter(_x4,_x5){return _ref7.apply(this,arguments)}}();var actions=function actions(){if(!window.matchMedia("(hover: none)").matches){return{}}return{page:{enter:onPageEnter}}};App.modules.exports("scrollout",{actions:actions})})();(function(){'use strict';var onPageEnter=function onPageEnter(){document.querySelectorAll("img").forEach(function(img){img.outerHTML=img.outerHTML})};var actions=function actions(){var _App$device=App.device,ios=_App$device.ios,ipad=_App$device.ipad,iphone=_App$device.iphone;if(ios||ipad||iphone){return{page:{enter:onPageEnter}}}return{}};App.modules.exports("ios-ajax-img-fix",{actions:actions})})();(function(){'use strict';var init=function init(){setTimeout(function(){fetch("/public/admin/").then(function(response){return response.text()}).then(function(body){window.document.getElementById("admin-menu").innerHTML=body})},1000)};App.modules.exports("admin",{init:init})})();