2 lines
35 KiB
JavaScript
2 lines
35 KiB
JavaScript
/*! For license information please see main.js.LICENSE.txt */
|
|
(()=>{"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};function e(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var r=function(){return r=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},r.apply(this,arguments)};function i(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function n(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,a=r.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function a(t,e,r){if(r||2===arguments.length)for(var i,n=0,a=e.length;n<a;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}Object.create,Object.create;var o=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!1,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),s=function(){function t(t,e){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];this.root=t,this.initialize.apply(this,a([],n(r))),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new o({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw new Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,r){this.root.addEventListener(t,e,r)},t.prototype.unlisten=function(t,e,r){this.root.removeEventListener(t,e,r)},t.prototype.emit=function(t,e,r){var i;void 0===r&&(r=!1),"function"==typeof CustomEvent?i=new CustomEvent(t,{bubbles:r,detail:e}):(i=document.createEvent("CustomEvent")).initCustomEvent(t,r,!1,e),this.root.dispatchEvent(i)},t}(),c={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}};var u={CLOSED_CLASS:"mdc-linear-progress--closed",CLOSED_ANIMATION_OFF_CLASS:"mdc-linear-progress--closed-animation-off",INDETERMINATE_CLASS:"mdc-linear-progress--indeterminate",REVERSED_CLASS:"mdc-linear-progress--reversed",ANIMATION_READY_CLASS:"mdc-linear-progress--animation-ready"},l={ARIA_HIDDEN:"aria-hidden",ARIA_VALUEMAX:"aria-valuemax",ARIA_VALUEMIN:"aria-valuemin",ARIA_VALUENOW:"aria-valuenow",BUFFER_BAR_SELECTOR:".mdc-linear-progress__buffer-bar",FLEX_BASIS:"flex-basis",PRIMARY_BAR_SELECTOR:".mdc-linear-progress__primary-bar"},d=function(t){function n(e){var i=t.call(this,r(r({},n.defaultAdapter),e))||this;return i.observer=null,i}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return u},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return l},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},attachResizeObserver:function(){return null},forceLayout:function(){},getWidth:function(){return 0},hasClass:function(){return!1},setBufferBarStyle:function(){return null},setPrimaryBarStyle:function(){return null},setStyle:function(){},removeAttribute:function(){},removeClass:function(){},setAttribute:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){var t=this;this.determinate=!this.adapter.hasClass(u.INDETERMINATE_CLASS),this.adapter.addClass(u.ANIMATION_READY_CLASS),this.progress=0,this.buffer=1,this.observer=this.adapter.attachResizeObserver((function(e){var r,n;if(!t.determinate)try{for(var a=i(e),o=a.next();!o.done;o=a.next()){var s=o.value;s.contentRect&&t.calculateAndSetDimensions(s.contentRect.width)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}})),!this.determinate&&this.observer&&this.calculateAndSetDimensions(this.adapter.getWidth())},n.prototype.setDeterminate=function(t){if(this.determinate=t,this.determinate)return this.adapter.removeClass(u.INDETERMINATE_CLASS),this.adapter.setAttribute(l.ARIA_VALUENOW,this.progress.toString()),this.adapter.setAttribute(l.ARIA_VALUEMAX,"1"),this.adapter.setAttribute(l.ARIA_VALUEMIN,"0"),this.setPrimaryBarProgress(this.progress),void this.setBufferBarProgress(this.buffer);this.observer&&this.calculateAndSetDimensions(this.adapter.getWidth()),this.adapter.addClass(u.INDETERMINATE_CLASS),this.adapter.removeAttribute(l.ARIA_VALUENOW),this.adapter.removeAttribute(l.ARIA_VALUEMAX),this.adapter.removeAttribute(l.ARIA_VALUEMIN),this.setPrimaryBarProgress(1),this.setBufferBarProgress(1)},n.prototype.isDeterminate=function(){return this.determinate},n.prototype.setProgress=function(t){this.progress=t,this.determinate&&(this.setPrimaryBarProgress(t),this.adapter.setAttribute(l.ARIA_VALUENOW,t.toString()))},n.prototype.getProgress=function(){return this.progress},n.prototype.setBuffer=function(t){this.buffer=t,this.determinate&&this.setBufferBarProgress(t)},n.prototype.getBuffer=function(){return this.buffer},n.prototype.open=function(){this.adapter.removeClass(u.CLOSED_CLASS),this.adapter.removeClass(u.CLOSED_ANIMATION_OFF_CLASS),this.adapter.removeAttribute(l.ARIA_HIDDEN)},n.prototype.close=function(){this.adapter.addClass(u.CLOSED_CLASS),this.adapter.setAttribute(l.ARIA_HIDDEN,"true")},n.prototype.isClosed=function(){return this.adapter.hasClass(u.CLOSED_CLASS)},n.prototype.handleTransitionEnd=function(){this.adapter.hasClass(u.CLOSED_CLASS)&&this.adapter.addClass(u.CLOSED_ANIMATION_OFF_CLASS)},n.prototype.destroy=function(){t.prototype.destroy.call(this),this.observer&&this.observer.disconnect()},n.prototype.restartAnimation=function(){this.adapter.removeClass(u.ANIMATION_READY_CLASS),this.adapter.forceLayout(),this.adapter.addClass(u.ANIMATION_READY_CLASS)},n.prototype.setPrimaryBarProgress=function(t){var e="scaleX("+t+")",r="undefined"!=typeof window?function(t,e){if(function(t){return Boolean(t.document)&&"function"==typeof t.document.createElement}(t)&&e in c){var r=t.document.createElement("div"),i=c.transform,n=i.standard,a=i.prefixed;return n in r.style?n:a}return e}(window,"transform"):"transform";this.adapter.setPrimaryBarStyle(r,e)},n.prototype.setBufferBarProgress=function(t){var e=100*t+"%";this.adapter.setBufferBarStyle(l.FLEX_BASIS,e)},n.prototype.calculateAndSetDimensions=function(t){var e=.8367142*t,r=2.00611057*t,i=.37651913*t,n=.84386165*t,a=1.60277782*t;this.adapter.setStyle("--mdc-linear-progress-primary-half",e+"px"),this.adapter.setStyle("--mdc-linear-progress-primary-half-neg",-e+"px"),this.adapter.setStyle("--mdc-linear-progress-primary-full",r+"px"),this.adapter.setStyle("--mdc-linear-progress-primary-full-neg",-r+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-quarter",i+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-quarter-neg",-i+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-half",n+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-half-neg",-n+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-full",a+"px"),this.adapter.setStyle("--mdc-linear-progress-secondary-full-neg",-a+"px"),this.restartAnimation()},n}(o),p=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.attachTo=function(t){return new r(t)},Object.defineProperty(r.prototype,"determinate",{set:function(t){this.foundation.setDeterminate(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"progress",{set:function(t){this.foundation.setProgress(t)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"buffer",{set:function(t){this.foundation.setBuffer(t)},enumerable:!1,configurable:!0}),r.prototype.open=function(){this.foundation.open()},r.prototype.close=function(){this.foundation.close()},r.prototype.initialSyncWithDOM=function(){var t=this;this.root.addEventListener("transitionend",(function(){t.foundation.handleTransitionEnd()}))},r.prototype.getDefaultFoundation=function(){var t=this;return new d({addClass:function(e){t.root.classList.add(e)},forceLayout:function(){t.root.getBoundingClientRect()},setBufferBarStyle:function(e,r){var i=t.root.querySelector(d.strings.BUFFER_BAR_SELECTOR);i&&i.style.setProperty(e,r)},setPrimaryBarStyle:function(e,r){var i=t.root.querySelector(d.strings.PRIMARY_BAR_SELECTOR);i&&i.style.setProperty(e,r)},hasClass:function(e){return t.root.classList.contains(e)},removeAttribute:function(e){t.root.removeAttribute(e)},removeClass:function(e){t.root.classList.remove(e)},setAttribute:function(e,r){t.root.setAttribute(e,r)},setStyle:function(e,r){t.root.style.setProperty(e,r)},attachResizeObserver:function(e){var r=window.ResizeObserver;if(r){var i=new r(e);return i.observe(t.root),i}return null},getWidth:function(){return t.root.offsetWidth}})},r}(s);function f(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var r={get passive(){return e=!0,!1}},i=function(){};t.document.addEventListener("test",i,r),t.document.removeEventListener("test",i,r)}catch(t){e=!1}return e}(t)&&{passive:!0}}var h,v={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},y={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},m={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},A=["touchstart","pointerdown","mousedown","keydown"],g=["touchend","pointerup","mouseup","contextmenu"],S=[],b=function(t){function n(e){var i=t.call(this,r(r({},n.defaultAdapter),e))||this;return i.activationAnimationHasEnded=!1,i.activationTimer=0,i.fgDeactivationRemovalTimer=0,i.fgScale="0",i.frame={width:0,height:0},i.initialSize=0,i.layoutFrame=0,i.maxRadius=0,i.unboundedCoords={left:0,top:0},i.activationState=i.defaultActivationState(),i.activationTimerCallback=function(){i.activationAnimationHasEnded=!0,i.runDeactivationUXLogicIfReady()},i.activateHandler=function(t){i.activateImpl(t)},i.deactivateHandler=function(){i.deactivateImpl()},i.focusHandler=function(){i.handleFocus()},i.blurHandler=function(){i.handleBlur()},i.resizeHandler=function(){i.layout()},i}return e(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return v},enumerable:!1,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return y},enumerable:!1,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return m},enumerable:!1,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!1,configurable:!0}),n.prototype.init=function(){var t=this,e=this.supportsPressRipple();if(this.registerRootHandlers(e),e){var r=n.cssClasses,i=r.ROOT,a=r.UNBOUNDED;requestAnimationFrame((function(){t.adapter.addClass(i),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal())}))}},n.prototype.destroy=function(){var t=this;if(this.supportsPressRipple()){this.activationTimer&&(clearTimeout(this.activationTimer),this.activationTimer=0,this.adapter.removeClass(n.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer&&(clearTimeout(this.fgDeactivationRemovalTimer),this.fgDeactivationRemovalTimer=0,this.adapter.removeClass(n.cssClasses.FG_DEACTIVATION));var e=n.cssClasses,r=e.ROOT,i=e.UNBOUNDED;requestAnimationFrame((function(){t.adapter.removeClass(r),t.adapter.removeClass(i),t.removeCssVars()}))}this.deregisterRootHandlers(),this.deregisterDeactivationHandlers()},n.prototype.activate=function(t){this.activateImpl(t)},n.prototype.deactivate=function(){this.deactivateImpl()},n.prototype.layout=function(){var t=this;this.layoutFrame&&cancelAnimationFrame(this.layoutFrame),this.layoutFrame=requestAnimationFrame((function(){t.layoutInternal(),t.layoutFrame=0}))},n.prototype.setUnbounded=function(t){var e=n.cssClasses.UNBOUNDED;t?this.adapter.addClass(e):this.adapter.removeClass(e)},n.prototype.handleFocus=function(){var t=this;requestAnimationFrame((function(){return t.adapter.addClass(n.cssClasses.BG_FOCUSED)}))},n.prototype.handleBlur=function(){var t=this;requestAnimationFrame((function(){return t.adapter.removeClass(n.cssClasses.BG_FOCUSED)}))},n.prototype.supportsPressRipple=function(){return this.adapter.browserSupportsCssVars()},n.prototype.defaultActivationState=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},n.prototype.registerRootHandlers=function(t){var e,r;if(t){try{for(var n=i(A),a=n.next();!a.done;a=n.next()){var o=a.value;this.adapter.registerInteractionHandler(o,this.activateHandler)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler)}this.adapter.registerInteractionHandler("focus",this.focusHandler),this.adapter.registerInteractionHandler("blur",this.blurHandler)},n.prototype.registerDeactivationHandlers=function(t){var e,r;if("keydown"===t.type)this.adapter.registerInteractionHandler("keyup",this.deactivateHandler);else try{for(var n=i(g),a=n.next();!a.done;a=n.next()){var o=a.value;this.adapter.registerDocumentInteractionHandler(o,this.deactivateHandler)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},n.prototype.deregisterRootHandlers=function(){var t,e;try{for(var r=i(A),n=r.next();!n.done;n=r.next()){var a=n.value;this.adapter.deregisterInteractionHandler(a,this.activateHandler)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.adapter.deregisterInteractionHandler("focus",this.focusHandler),this.adapter.deregisterInteractionHandler("blur",this.blurHandler),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler)},n.prototype.deregisterDeactivationHandlers=function(){var t,e;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler);try{for(var r=i(g),n=r.next();!n.done;n=r.next()){var a=n.value;this.adapter.deregisterDocumentInteractionHandler(a,this.deactivateHandler)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},n.prototype.removeCssVars=function(){var t=this,e=n.strings;Object.keys(e).forEach((function(r){0===r.indexOf("VAR_")&&t.adapter.updateCssVariable(e[r],null)}))},n.prototype.activateImpl=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var r=this.activationState;if(!r.isActivated){var i=this.previousActivationEvent;i&&void 0!==t&&i.type!==t.type||(r.isActivated=!0,r.isProgrammatic=void 0===t,r.activationEvent=t,r.wasActivatedByPointer=!r.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&S.length>0&&S.some((function(t){return e.adapter.containsEventTarget(t)}))?this.resetActivationState():(void 0!==t&&(S.push(t.target),this.registerDeactivationHandlers(t)),r.wasElementMadeActive=this.checkElementMadeActive(t),r.wasElementMadeActive&&this.animateActivation(),requestAnimationFrame((function(){S=[],r.wasElementMadeActive||void 0===t||" "!==t.key&&32!==t.keyCode||(r.wasElementMadeActive=e.checkElementMadeActive(t),r.wasElementMadeActive&&e.animateActivation()),r.wasElementMadeActive||(e.activationState=e.defaultActivationState())}))))}}},n.prototype.checkElementMadeActive=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},n.prototype.animateActivation=function(){var t=this,e=n.strings,r=e.VAR_FG_TRANSLATE_START,i=e.VAR_FG_TRANSLATE_END,a=n.cssClasses,o=a.FG_DEACTIVATION,s=a.FG_ACTIVATION,c=n.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal();var u="",l="";if(!this.adapter.isUnbounded()){var d=this.getFgTranslationCoordinates(),p=d.startPoint,f=d.endPoint;u=p.x+"px, "+p.y+"px",l=f.x+"px, "+f.y+"px"}this.adapter.updateCssVariable(r,u),this.adapter.updateCssVariable(i,l),clearTimeout(this.activationTimer),clearTimeout(this.fgDeactivationRemovalTimer),this.rmBoundedActivationClasses(),this.adapter.removeClass(o),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer=setTimeout((function(){t.activationTimerCallback()}),c)},n.prototype.getFgTranslationCoordinates=function(){var t,e=this.activationState,r=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,r){if(!t)return{x:0,y:0};var i,n,a=e.x,o=e.y,s=a+r.left,c=o+r.top;if("touchstart"===t.type){var u=t;i=u.changedTouches[0].pageX-s,n=u.changedTouches[0].pageY-c}else{var l=t;i=l.pageX-s,n=l.pageY-c}return{x:i,y:n}}(r,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame.width/2,y:this.frame.height/2}).x-this.initialSize/2,y:t.y-this.initialSize/2},endPoint:{x:this.frame.width/2-this.initialSize/2,y:this.frame.height/2-this.initialSize/2}}},n.prototype.runDeactivationUXLogicIfReady=function(){var t=this,e=n.cssClasses.FG_DEACTIVATION,r=this.activationState,i=r.hasDeactivationUXRun,a=r.isActivated;(i||!a)&&this.activationAnimationHasEnded&&(this.rmBoundedActivationClasses(),this.adapter.addClass(e),this.fgDeactivationRemovalTimer=setTimeout((function(){t.adapter.removeClass(e)}),m.FG_DEACTIVATION_MS))},n.prototype.rmBoundedActivationClasses=function(){var t=n.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded=!1,this.adapter.computeBoundingRect()},n.prototype.resetActivationState=function(){var t=this;this.previousActivationEvent=this.activationState.activationEvent,this.activationState=this.defaultActivationState(),setTimeout((function(){return t.previousActivationEvent=void 0}),n.numbers.TAP_DELAY_MS)},n.prototype.deactivateImpl=function(){var t=this,e=this.activationState;if(e.isActivated){var i=r({},e);e.isProgrammatic?(requestAnimationFrame((function(){t.animateDeactivation(i)})),this.resetActivationState()):(this.deregisterDeactivationHandlers(),requestAnimationFrame((function(){t.activationState.hasDeactivationUXRun=!0,t.animateDeactivation(i),t.resetActivationState()})))}},n.prototype.animateDeactivation=function(t){var e=t.wasActivatedByPointer,r=t.wasElementMadeActive;(e||r)&&this.runDeactivationUXLogicIfReady()},n.prototype.layoutInternal=function(){this.frame=this.adapter.computeBoundingRect();var t=Math.max(this.frame.height,this.frame.width);this.maxRadius=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame.width,2)+Math.pow(this.frame.height,2))+n.numbers.PADDING;var e=Math.floor(t*n.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&e%2!=0?this.initialSize=e-1:this.initialSize=e,this.fgScale=""+this.maxRadius/this.initialSize,this.updateLayoutCssVars()},n.prototype.updateLayoutCssVars=function(){var t=n.strings,e=t.VAR_FG_SIZE,r=t.VAR_LEFT,i=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(e,this.initialSize+"px"),this.adapter.updateCssVariable(a,this.fgScale),this.adapter.isUnbounded()&&(this.unboundedCoords={left:Math.round(this.frame.width/2-this.initialSize/2),top:Math.round(this.frame.height/2-this.initialSize/2)},this.adapter.updateCssVariable(r,this.unboundedCoords.left+"px"),this.adapter.updateCssVariable(i,this.unboundedCoords.top+"px"))},n}(o),C=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return e(r,t),r.attachTo=function(t,e){void 0===e&&(e={isUnbounded:void 0});var i=new r(t);return void 0!==e.isUnbounded&&(i.unbounded=e.isUnbounded),i},r.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var r,i=window.CSS;if("boolean"==typeof h&&!e)return h;if(!i||"function"!=typeof i.supports)return!1;var n=i.supports("--css-vars","yes"),a=i.supports("(--css-vars: yes)")&&i.supports("color","#00000000");return r=n||a,e||(h=r),r}()},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,f())},deregisterInteractionHandler:function(e,r){return t.root.removeEventListener(e,r,f())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return e=t.root,r=":active",(e.matches||e.webkitMatchesSelector||e.msMatchesSelector).call(e,r);var e,r},isSurfaceDisabled:function(){return Boolean(t.disabled)},isUnbounded:function(){return Boolean(t.unbounded)},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,f())},registerInteractionHandler:function(e,r){return t.root.addEventListener(e,r,f())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,r){return t.root.style.setProperty(e,r)}}},Object.defineProperty(r.prototype,"unbounded",{get:function(){return Boolean(this.isUnbounded)},set:function(t){this.isUnbounded=Boolean(t),this.setUnbounded()},enumerable:!1,configurable:!0}),r.prototype.activate=function(){this.foundation.activate()},r.prototype.deactivate=function(){this.foundation.deactivate()},r.prototype.layout=function(){this.foundation.layout()},r.prototype.getDefaultFoundation=function(){return new b(r.createAdapter(this))},r.prototype.initialSyncWithDOM=function(){var t=this.root;this.isUnbounded="mdcRippleIsUnbounded"in t.dataset},r.prototype.setUnbounded=function(){this.foundation.setUnbounded(Boolean(this.isUnbounded))},r}(s),E={FIXED_CLASS:"mdc-top-app-bar--fixed",FIXED_SCROLLED_CLASS:"mdc-top-app-bar--fixed-scrolled",SHORT_CLASS:"mdc-top-app-bar--short",SHORT_COLLAPSED_CLASS:"mdc-top-app-bar--short-collapsed",SHORT_HAS_ACTION_ITEM_CLASS:"mdc-top-app-bar--short-has-action-item"},T={DEBOUNCE_THROTTLE_RESIZE_TIME_MS:100,MAX_TOP_APP_BAR_HEIGHT:128},I={ACTION_ITEM_SELECTOR:".mdc-top-app-bar__action-item",NAVIGATION_EVENT:"MDCTopAppBar:nav",NAVIGATION_ICON_SELECTOR:".mdc-top-app-bar__navigation-icon",ROOT_SELECTOR:".mdc-top-app-bar",TITLE_SELECTOR:".mdc-top-app-bar__title"},_=function(t){function i(e){return t.call(this,r(r({},i.defaultAdapter),e))||this}return e(i,t),Object.defineProperty(i,"strings",{get:function(){return I},enumerable:!1,configurable:!0}),Object.defineProperty(i,"cssClasses",{get:function(){return E},enumerable:!1,configurable:!0}),Object.defineProperty(i,"numbers",{get:function(){return T},enumerable:!1,configurable:!0}),Object.defineProperty(i,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},getTopAppBarHeight:function(){return 0},notifyNavigationIconClicked:function(){},getViewportScrollY:function(){return 0},getTotalActionItems:function(){return 0}}},enumerable:!1,configurable:!0}),i.prototype.handleTargetScroll=function(){},i.prototype.handleWindowResize=function(){},i.prototype.handleNavigationClick=function(){this.adapter.notifyNavigationIconClicked()},i}(o),O=function(t){function r(e){var r=t.call(this,e)||this;return r.wasDocked=!0,r.isDockedShowing=!0,r.currentAppBarOffsetTop=0,r.isCurrentlyBeingResized=!1,r.resizeThrottleId=0,r.resizeDebounceId=0,r.lastScrollPosition=r.adapter.getViewportScrollY(),r.topAppBarHeight=r.adapter.getTopAppBarHeight(),r}return e(r,t),r.prototype.destroy=function(){t.prototype.destroy.call(this),this.adapter.setStyle("top","")},r.prototype.handleTargetScroll=function(){var t=Math.max(this.adapter.getViewportScrollY(),0),e=t-this.lastScrollPosition;this.lastScrollPosition=t,this.isCurrentlyBeingResized||(this.currentAppBarOffsetTop-=e,this.currentAppBarOffsetTop>0?this.currentAppBarOffsetTop=0:Math.abs(this.currentAppBarOffsetTop)>this.topAppBarHeight&&(this.currentAppBarOffsetTop=-this.topAppBarHeight),this.moveTopAppBar())},r.prototype.handleWindowResize=function(){var t=this;this.resizeThrottleId||(this.resizeThrottleId=setTimeout((function(){t.resizeThrottleId=0,t.throttledResizeHandler()}),T.DEBOUNCE_THROTTLE_RESIZE_TIME_MS)),this.isCurrentlyBeingResized=!0,this.resizeDebounceId&&clearTimeout(this.resizeDebounceId),this.resizeDebounceId=setTimeout((function(){t.handleTargetScroll(),t.isCurrentlyBeingResized=!1,t.resizeDebounceId=0}),T.DEBOUNCE_THROTTLE_RESIZE_TIME_MS)},r.prototype.checkForUpdate=function(){var t=-this.topAppBarHeight,e=this.currentAppBarOffsetTop<0,r=this.currentAppBarOffsetTop>t,i=e&&r;if(i)this.wasDocked=!1;else{if(!this.wasDocked)return this.wasDocked=!0,!0;if(this.isDockedShowing!==r)return this.isDockedShowing=r,!0}return i},r.prototype.moveTopAppBar=function(){if(this.checkForUpdate()){var t=this.currentAppBarOffsetTop;Math.abs(t)>=this.topAppBarHeight&&(t=-T.MAX_TOP_APP_BAR_HEIGHT),this.adapter.setStyle("top",t+"px")}},r.prototype.throttledResizeHandler=function(){var t=this.adapter.getTopAppBarHeight();this.topAppBarHeight!==t&&(this.wasDocked=!1,this.currentAppBarOffsetTop-=this.topAppBarHeight-t,this.topAppBarHeight=t),this.handleTargetScroll()},r}(_),L=function(t){function r(){var e=null!==t&&t.apply(this,arguments)||this;return e.wasScrolled=!1,e}return e(r,t),r.prototype.handleTargetScroll=function(){this.adapter.getViewportScrollY()<=0?this.wasScrolled&&(this.adapter.removeClass(E.FIXED_SCROLLED_CLASS),this.wasScrolled=!1):this.wasScrolled||(this.adapter.addClass(E.FIXED_SCROLLED_CLASS),this.wasScrolled=!0)},r}(O),w=function(t){function r(e){var r=t.call(this,e)||this;return r.collapsed=!1,r.isAlwaysCollapsed=!1,r}return e(r,t),Object.defineProperty(r.prototype,"isCollapsed",{get:function(){return this.collapsed},enumerable:!1,configurable:!0}),r.prototype.init=function(){t.prototype.init.call(this),this.adapter.getTotalActionItems()>0&&this.adapter.addClass(E.SHORT_HAS_ACTION_ITEM_CLASS),this.setAlwaysCollapsed(this.adapter.hasClass(E.SHORT_COLLAPSED_CLASS))},r.prototype.setAlwaysCollapsed=function(t){this.isAlwaysCollapsed=!!t,this.isAlwaysCollapsed?this.collapse():this.maybeCollapseBar()},r.prototype.getAlwaysCollapsed=function(){return this.isAlwaysCollapsed},r.prototype.handleTargetScroll=function(){this.maybeCollapseBar()},r.prototype.maybeCollapseBar=function(){this.isAlwaysCollapsed||(this.adapter.getViewportScrollY()<=0?this.collapsed&&this.uncollapse():this.collapsed||this.collapse())},r.prototype.uncollapse=function(){this.adapter.removeClass(E.SHORT_COLLAPSED_CLASS),this.collapsed=!1},r.prototype.collapse=function(){this.adapter.addClass(E.SHORT_COLLAPSED_CLASS),this.collapsed=!0},r}(_),R=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.attachTo=function(t){return new r(t)},r.prototype.initialize=function(t){void 0===t&&(t=function(t){return C.attachTo(t)}),this.navIcon=this.root.querySelector(I.NAVIGATION_ICON_SELECTOR);var e=[].slice.call(this.root.querySelectorAll(I.ACTION_ITEM_SELECTOR));this.navIcon&&e.push(this.navIcon),this.iconRipples=e.map((function(e){var r=t(e);return r.unbounded=!0,r})),this.scrollTarget=window},r.prototype.initialSyncWithDOM=function(){this.handleNavigationClick=this.foundation.handleNavigationClick.bind(this.foundation),this.handleWindowResize=this.foundation.handleWindowResize.bind(this.foundation),this.handleTargetScroll=this.foundation.handleTargetScroll.bind(this.foundation),this.scrollTarget.addEventListener("scroll",this.handleTargetScroll),this.navIcon&&this.navIcon.addEventListener("click",this.handleNavigationClick);var t=this.root.classList.contains(E.FIXED_CLASS);this.root.classList.contains(E.SHORT_CLASS)||t||window.addEventListener("resize",this.handleWindowResize)},r.prototype.destroy=function(){var e,r;try{for(var n=i(this.iconRipples),a=n.next();!a.done;a=n.next())a.value.destroy()}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll),this.navIcon&&this.navIcon.removeEventListener("click",this.handleNavigationClick);var o=this.root.classList.contains(E.FIXED_CLASS);this.root.classList.contains(E.SHORT_CLASS)||o||window.removeEventListener("resize",this.handleWindowResize),t.prototype.destroy.call(this)},r.prototype.setScrollTarget=function(t){this.scrollTarget.removeEventListener("scroll",this.handleTargetScroll),this.scrollTarget=t,this.handleTargetScroll=this.foundation.handleTargetScroll.bind(this.foundation),this.scrollTarget.addEventListener("scroll",this.handleTargetScroll)},r.prototype.getDefaultFoundation=function(){var t=this,e={hasClass:function(e){return t.root.classList.contains(e)},addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setStyle:function(e,r){return t.root.style.setProperty(e,r)},getTopAppBarHeight:function(){return t.root.clientHeight},notifyNavigationIconClicked:function(){return t.emit(I.NAVIGATION_EVENT,{})},getViewportScrollY:function(){var e=t.scrollTarget,r=t.scrollTarget;return void 0!==e.pageYOffset?e.pageYOffset:r.scrollTop},getTotalActionItems:function(){return t.root.querySelectorAll(I.ACTION_ITEM_SELECTOR).length}};return this.root.classList.contains(E.SHORT_CLASS)?new w(e):this.root.classList.contains(E.FIXED_CLASS)?new L(e):new O(e)},r}(s),D=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e};const B=function(){function t(t){this.element=document.createElement(t)}return t.prototype.addAttributes=function(t){for(var e=0,r=Object.keys(t);e<r.length;e++){var i=r[e];this.addAttribute(i,t[i])}return this},t.prototype.addAttribute=function(t,e){var r=document.createAttribute(t);return r.value=e.toString(),this.element.attributes.setNamedItem(r),this},t.prototype.addClass=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return(t=this.element.classList).add.apply(t,e),this},t.prototype.addChildren=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.forEach((function(e){e instanceof HTMLElement?t.element.appendChild(e):t.element.appendChild(e.build())})),this},t.prototype.setText=function(t){return this.element.textContent=t,this},t.prototype.build=function(){return this.element},t}();var P="active-set";const N=function(){function t(t,e,r){this.set=0,this.setPalettes=[],this.maxFixById={},this.playset=t,this.menu=e,this.playSpace=r,this.addEvents(),this.reset(),this.setMenu()}return t.adjustPlacement=function(e,r,i){var n=e.currentPositions[r].x+i.x,a=e.currentPositions[r].y+i.y;return e.currentPositions[r]=new D(n,a),t.getCoordinate(e,r)},t.getCoordinate=function(t,e){var r=t.currentPositions[e];return r?t.offset?new D(r.x+t.offset.x,r.y+t.offset.y):r:new D},t.prototype.setPlayArea=function(e){this.set=e,this.menu.querySelectorAll("button").forEach((function(t){t.classList.remove(P)})),this.menu.querySelector('button[data-set="'+e+'"]').classList.add(P);var r=this.playSpace.querySelectorAll(".cel-image");this.playset.cels.forEach((function(i,n){var a=r[n];if(a.style.visibility="hidden",i.sets[e]){a.style.visibility="visible";var o=t.getCoordinate(i,e);a.style.left=o.x+"px",a.style.top=o.y+"px"}}))},t.prototype.addEvents=function(){var e=this,r=null;this.playSpace.querySelectorAll(".cel-image").forEach((function(i){var n=function(n){var a=new D(n.clientX-r.clientX,n.clientY-r.clientY);r=n,e.getGroup(i).forEach((function(r){var i=parseInt(r.attributes.getNamedItem("data-index").value),n=e.playset.cels[i];if(0==n.currentFix){var o=t.adjustPlacement(n,e.set,a);r.style.left=o.x+"px",r.style.top=o.y+"px"}}))};i.addEventListener("mousedown",(function(t){r=t,e.getGroup(i).forEach((function(t){var r=parseInt(t.attributes.getNamedItem("data-index").value),i=e.playset.cels[r];i.currentFix>0&&i.currentFix--})),window.addEventListener("mousemove",n),window.addEventListener("mouseup",(function(){r=null,window.removeEventListener("mousemove",n)}))}))}))},t.prototype.getGroup=function(t){var e=t.attributes.getNamedItem("data-id").value;return this.playSpace.querySelectorAll('.cel-image[data-id="'+e+'"]')},t.prototype.reset=function(){var t=this;this.playSpace.querySelectorAll(".cel-image").forEach((function(t){t.style.visibility="hidden",t.style.left="0",t.style.top="0"})),this.playset.cels.forEach((function(e){t.maxFixById[e.id]||(t.maxFixById[e.id]=0),t.maxFixById[e.id]<e.fix&&(t.maxFixById[e.id]=e.fix)})),this.playset.cels.forEach((function(e){e.currentFix=t.maxFixById[e.id],e.currentPositions=e.initialPositions.map((function(t){return t?new D(t.x,t.y):null}))}))},t.prototype.setMenu=function(){var t=this;this.menu.querySelector('button[data-rel="reset"]').addEventListener("click",(function(){t.reset(),t.setPlayArea(t.set)})),this.playset.enabledSets.forEach((function(e,r){if(e){var i=new B("li").addChildren(new B("button").addClass("mdc-button").addAttributes({"data-set":r}).addChildren(new B("span").addClass("mdc-button__ripple"),new B("span").addClass("mdc-button__label").setText(r.toString()))).build();i.addEventListener("click",(function(){t.setPlayArea(r)})),t.menu.appendChild(i)}}))},t}();var x=function(){function t(){var t=this;this.ripples=[],this.appBar=R.attachTo(document.querySelector(".mdc-top-app-bar")),document.querySelectorAll(".mdc-button").forEach((function(e){t.ripples.push(C.attachTo(e))})),this.linearProgress=p.attachTo(document.querySelector(".mdc-linear-progress")),this.init()}return t.prototype.load=function(t,e,r,i){void 0===i&&(i=0);var n=document.getElementById(t),a=document.getElementById(e).querySelector("ul");new N(r,a,n).setPlayArea(i)},t.prototype.init=function(){var t=this;this.linearProgress.open();var e=document.querySelector("main").querySelector("ul");e&&e.querySelectorAll("a").forEach((function(e){e.addEventListener("click",(function(){t.linearProgress.determinate=!1,t.linearProgress.open();var r=e.attributes.getNamedItem("data-directory"),i=new B("form").addAttributes({method:"post",action:"/Home/Select"}).addChildren(new B("input").addAttributes({type:"hidden",name:"directory",value:r.value}),new B("input").addAttributes({type:"hidden",name:"file",value:e.textContent})).build();e.appendChild(i),i.submit()}))}))},t}();document.kisekae=new x})(); |